結果
問題 |
No.2011 Arbitrary Mod (Hidden)
|
ユーザー |
|
提出日時 | 2022-07-15 23:15:43 |
言語 | C++17 (gcc 13.3.0 + boost 1.87.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 1,121 bytes |
コンパイル時間 | 2,214 ms |
コンパイル使用メモリ | 206,956 KB |
最終ジャッジ日時 | 2025-01-30 09:00:48 |
ジャッジサーバーID (参考情報) |
judge5 / judge5 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | WA * 43 |
ソースコード
#include <bits/stdc++.h> using namespace std; #ifdef _RUTHEN #include "debug.hpp" #else #define show(...) true #endif using ll = long long; #define rep(i, n) for (int i = 0; i < (n); i++) template <class T> using V = vector<T>; ll f(ll a, ll N, ll M) { rep(i, N) a = a * a % M; return a; } map<long long, int> prime_map(long long n) { map<long long, int> res; for (long long i = 2; i * i <= n; i++) { while (n % i == 0) { res[i]++; n /= i; } } if (n != 1) res[n]++; return res; } int main() { ios::sync_with_stdio(false); cin.tie(0); ll N; cin >> N; map<int, int> mp; V<int> CV; for (ll a = 20; a <= 5000; a++) { ll c = a * a - 398; if (c % 2 == 0) continue; CV.push_back(c); auto res = prime_map(c); for (auto [p, cnt] : res) mp[p]++; } ll M = 2; for (auto [p, cnt] : mp) { if (M >= 1000000000000000000LL / p) { show(p); break; } M *= p; } show(M); cout << M << '\n'; cout << 0 << '\n'; return 0; }