Skip to content

Commit

Permalink
add tests (#321)
Browse files Browse the repository at this point in the history
  • Loading branch information
hitonanode authored Dec 26, 2023
1 parent 172fded commit d10caf9
Show file tree
Hide file tree
Showing 2 changed files with 35 additions and 0 deletions.
18 changes: 18 additions & 0 deletions number/test/is_prime.test.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
#define PROBLEM "https://judge.yosupo.jp/problem/primality_test"
#include "../factorize.hpp"

#include <iostream>
using namespace std;

int main() {
cin.tie(nullptr);
ios_base::sync_with_stdio(false);

int Q;
cin >> Q;
while (Q--) {
unsigned long long N;
cin >> N;
cout << (is_prime(N) ? "Yes" : "No") << '\n';
}
}
17 changes: 17 additions & 0 deletions string/test/lyndon.test.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
#define PROBLEM "https://judge.yosupo.jp/problem/lyndon_factorization"
#include "../lyndon.hpp"

#include <iostream>
#include <string>
using namespace std;

int main() {
cin.tie(nullptr);
ios_base::sync_with_stdio(false);

string S;
cin >> S;
auto ret = lyndon_factorization(S);
for (auto [l, len] : ret) cout << l << ' ';
cout << S.size() << '\n';
}

0 comments on commit d10caf9

Please sign in to comment.