結果

問題 No.1255 ハイレーツ・オブ・ボリビアン
ユーザー 👑 NachiaNachia
提出日時 2020-10-09 23:07:18
言語 cLay
(20240420-1)
結果
AC  
実行時間 869 ms / 2,000 ms
コード長 269 bytes
コンパイル時間 2,614 ms
コンパイル使用メモリ 168,012 KB
実行使用メモリ 5,112 KB
最終ジャッジ日時 2023-09-19 01:37:25
合計ジャッジ時間 7,702 ms
ジャッジサーバーID
(参考情報)
judge11 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
4,376 KB
testcase_01 AC 3 ms
4,376 KB
testcase_02 AC 4 ms
4,376 KB
testcase_03 AC 4 ms
4,380 KB
testcase_04 AC 4 ms
4,376 KB
testcase_05 AC 109 ms
4,640 KB
testcase_06 AC 141 ms
4,660 KB
testcase_07 AC 122 ms
5,056 KB
testcase_08 AC 541 ms
4,916 KB
testcase_09 AC 548 ms
5,112 KB
testcase_10 AC 537 ms
4,916 KB
testcase_11 AC 542 ms
5,052 KB
testcase_12 AC 546 ms
4,976 KB
testcase_13 AC 31 ms
4,928 KB
testcase_14 AC 869 ms
4,920 KB
testcase_15 AC 531 ms
4,912 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
main.cpp: In function ‘long long int loop()’:
main.cpp:228:45: warning: control reaches end of non-void function [-Wreturn-type]
   unordered_map<long long,long long> X(40000);
                                             ^

ソースコード

diff #

ll T,N,p,q;
ll loop(){
	if(N==1)return 1;
	N=2*N-1;
	unordered_map<ll,ll> X(4d4);
	p=1;
	rep(i,4d4) X[p]=i, p=p*2%N, if(p==1) return i+1; 
	p=q=1; rep(i,4d4) q=q*(N/2+1)%N;
	rep(i,6d4) p=p*q%N, if(X.count(p)) return (i+1)*4d4+X[p];
}
{ rd(T); REP(T) rd(N),wt(loop()); }
0