結果
問題 |
No.2828 Remainder Game
|
ユーザー |
![]() |
提出日時 | 2024-08-02 22:08:16 |
言語 | C++17 (gcc 13.3.0 + boost 1.87.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 997 bytes |
コンパイル時間 | 3,804 ms |
コンパイル使用メモリ | 251,540 KB |
最終ジャッジ日時 | 2025-02-23 20:04:07 |
ジャッジサーバーID (参考情報) |
judge1 / judge4 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 8 WA * 12 |
ソースコード
#include <stdio.h> #include <bits/stdc++.h> #include <atcoder/all> using namespace atcoder; using mint = modint998244353; using namespace std; #define rep(i,n) for (int i = 0; i < (n); ++i) #define Inf32 1000000001 #define Inf64 1000000000000000001 int n; unsigned long xor128() { static unsigned long x=123456789, y=362436069, z=521288629, w=88675123; unsigned long t=(x^(x<<11)); x=y; y=z; z=w; return (w=(w^(w>>19))^(t^(t>>8))); } int main(){ cin>>n; vector<long long> p = {2,3,7,11,13}; vector<long long> s(5); rep(i,5){ vector<int> r(p[i]); rep(j,p[i]){ r[j] = j; } rep(_,100){ int a = xor128()%p[i]; int b = xor128()%p[i]; swap(r[a],r[b]); } int rem = 5; int sum = 0; rep(j,p[i]-1){ if(rem==0)break; cout<<p[i]<<' '<<1<<endl; cout<<r[j]<<endl; int ret; cin>>ret; rem -= ret; sum += r[j]*ret; } sum += r[p[i]-1]*rem; s[i] = sum%p[i]; } auto ans = crt(s,p); cout<<0<<' '<<1<<endl; cout<<ans.first<<endl; return 0; }