File tree Expand file tree Collapse file tree 2 files changed +35
-0
lines changed Expand file tree Collapse file tree 2 files changed +35
-0
lines changed Original file line number Diff line number Diff line change 1+ #define PROBLEM " https://judge.yosupo.jp/problem/primality_test"
2+ #include " ../factorize.hpp"
3+
4+ #include < iostream>
5+ using namespace std ;
6+
7+ int main () {
8+ cin.tie (nullptr );
9+ ios_base::sync_with_stdio (false );
10+
11+ int Q;
12+ cin >> Q;
13+ while (Q--) {
14+ unsigned long long N;
15+ cin >> N;
16+ cout << (is_prime (N) ? " Yes" : " No" ) << ' \n ' ;
17+ }
18+ }
Original file line number Diff line number Diff line change 1+ #define PROBLEM " https://judge.yosupo.jp/problem/lyndon_factorization"
2+ #include " ../lyndon.hpp"
3+
4+ #include < iostream>
5+ #include < string>
6+ using namespace std ;
7+
8+ int main () {
9+ cin.tie (nullptr );
10+ ios_base::sync_with_stdio (false );
11+
12+ string S;
13+ cin >> S;
14+ auto ret = lyndon_factorization (S);
15+ for (auto [l, len] : ret) cout << l << ' ' ;
16+ cout << S.size () << ' \n ' ;
17+ }
You can’t perform that action at this time.
0 commit comments