結果

問題 No.849 yuki国の分割統治
ユーザー tailstails
提出日時 2023-03-14 22:10:07
言語 cLay
(20240104-1)
結果
AC  
実行時間 56 ms / 2,000 ms
コード長 227 bytes
コンパイル時間 3,424 ms
コンパイル使用メモリ 182,552 KB
実行使用メモリ 9,948 KB
最終ジャッジ日時 2023-10-18 12:05:49
合計ジャッジ時間 6,702 ms
ジャッジサーバーID
(参考情報)
judge13 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 1 ms
4,348 KB
testcase_01 AC 2 ms
4,348 KB
testcase_02 AC 2 ms
4,348 KB
testcase_03 AC 1 ms
4,348 KB
testcase_04 AC 2 ms
4,348 KB
testcase_05 AC 2 ms
4,348 KB
testcase_06 AC 2 ms
4,348 KB
testcase_07 AC 20 ms
4,972 KB
testcase_08 AC 33 ms
7,032 KB
testcase_09 AC 29 ms
6,236 KB
testcase_10 AC 24 ms
5,308 KB
testcase_11 AC 27 ms
6,212 KB
testcase_12 AC 21 ms
5,032 KB
testcase_13 AC 31 ms
6,348 KB
testcase_14 AC 28 ms
5,840 KB
testcase_15 AC 31 ms
6,836 KB
testcase_16 AC 49 ms
8,708 KB
testcase_17 AC 16 ms
4,712 KB
testcase_18 AC 50 ms
8,952 KB
testcase_19 AC 27 ms
5,564 KB
testcase_20 AC 41 ms
7,456 KB
testcase_21 AC 9 ms
4,664 KB
testcase_22 AC 44 ms
8,216 KB
testcase_23 AC 42 ms
7,696 KB
testcase_24 AC 24 ms
5,324 KB
testcase_25 AC 56 ms
9,948 KB
testcase_26 AC 1 ms
4,348 KB
testcase_27 AC 2 ms
4,348 KB
testcase_28 AC 2 ms
4,348 KB
testcase_29 AC 2 ms
4,348 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

ll@a,@b,@c,@d,@n,e;
map<pair<ll,ll>,ll>h;
if(e=abs(a*d-b*c)){
	rep(n){
		ll@x,@y;
		h[{(d*x-c*y)%%e,(a*y-b*x)%%e}]=0;
	}
}else{
	(a,b)/=(a+b)/gcd(a+b,c+d);
	rep(n){
		ll@x,@y;
		h[{(x+y)%(a+b),a*y-b*x}]=0;
	}
}
wt(n=h.size());
0