結果
| 問題 | 
                            No.2011 Arbitrary Mod (Hidden)
                             | 
                    
| コンテスト | |
| ユーザー | 
                             | 
                    
| 提出日時 | 2022-07-15 23:13:48 | 
| 言語 | C++17  (gcc 13.3.0 + boost 1.87.0)  | 
                    
| 結果 | 
                             
                                WA
                                 
                             
                            
                         | 
                    
| 実行時間 | - | 
| コード長 | 1,130 bytes | 
| コンパイル時間 | 2,374 ms | 
| コンパイル使用メモリ | 208,440 KB | 
| 最終ジャッジ日時 | 2025-01-30 08:57:01 | 
| 
                            ジャッジサーバーID (参考情報)  | 
                        judge1 / judge5 | 
(要ログイン)
| ファイルパターン | 結果 | 
|---|---|
| other | WA * 18 TLE * 25 | 
ソースコード
#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 << f(2, N, M) << '\n';
    return 0;
}