結果
問題 | No.3028 No.9999 |
ユーザー |
![]() |
提出日時 | 2025-02-21 21:47:49 |
言語 | C++23 (gcc 13.3.0 + boost 1.87.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 785 bytes |
コンパイル時間 | 3,785 ms |
コンパイル使用メモリ | 287,540 KB |
実行使用メモリ | 6,820 KB |
最終ジャッジ日時 | 2025-02-21 21:48:03 |
合計ジャッジ時間 | 4,801 ms |
ジャッジサーバーID (参考情報) |
judge3 / judge5 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 22 WA * 1 |
ソースコード
#include <bits/stdc++.h>using namespace std;typedef long long ll;#include <atcoder/math>using namespace atcoder;int main(){ll N;cin >> N;auto euler_phi = [](ll n) {ll ret = n;for(ll i = 2; i * i <= n; i++) {if(n % i == 0) {ret -= ret / i;while(n % i == 0) n /= i;}}if(n > 1) ret -= ret / n;return ret;};ll e = euler_phi(N);vector<ll> todo;for (int i = 1; i * i <= e; i++) {if(e % i == 0){todo.push_back(i);if(e != i * i){todo.push_back(e / i);}}}ranges::sort(todo);for(ll v : todo){if(pow_mod(10, v, N) == 1){cout << v << '\n';break;}}return 0;}/*File : ~/yukicoder/528/B.cppDate : 2025/02/21Time : 21:36:29*/