結果

問題 No.2519 Coins in Array
ユーザー tailstails
提出日時 2023-10-27 22:21:37
言語 cLay
(20240104-1)
結果
AC  
実行時間 12 ms / 2,000 ms
コード長 471 bytes
コンパイル時間 2,588 ms
コンパイル使用メモリ 175,360 KB
実行使用メモリ 7,048 KB
最終ジャッジ日時 2023-10-27 22:21:48
合計ジャッジ時間 6,774 ms
ジャッジサーバーID
(参考情報)
judge11 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 1 ms
4,348 KB
testcase_01 AC 1 ms
4,348 KB
testcase_02 AC 1 ms
4,348 KB
testcase_03 AC 1 ms
4,348 KB
testcase_04 AC 1 ms
4,348 KB
testcase_05 AC 1 ms
4,348 KB
testcase_06 AC 2 ms
4,348 KB
testcase_07 AC 1 ms
4,348 KB
testcase_08 AC 1 ms
4,348 KB
testcase_09 AC 1 ms
4,348 KB
testcase_10 AC 2 ms
4,348 KB
testcase_11 AC 1 ms
4,348 KB
testcase_12 AC 1 ms
4,348 KB
testcase_13 AC 1 ms
4,348 KB
testcase_14 AC 1 ms
4,348 KB
testcase_15 AC 1 ms
4,348 KB
testcase_16 AC 1 ms
4,348 KB
testcase_17 AC 1 ms
4,348 KB
testcase_18 AC 2 ms
4,348 KB
testcase_19 AC 1 ms
4,348 KB
testcase_20 AC 1 ms
4,348 KB
testcase_21 AC 1 ms
4,348 KB
testcase_22 AC 1 ms
4,348 KB
testcase_23 AC 12 ms
7,048 KB
testcase_24 AC 12 ms
7,048 KB
testcase_25 AC 2 ms
4,348 KB
testcase_26 AC 1 ms
4,348 KB
testcase_27 AC 12 ms
7,048 KB
testcase_28 AC 12 ms
7,048 KB
testcase_29 AC 12 ms
7,048 KB
testcase_30 AC 12 ms
6,900 KB
testcase_31 AC 3 ms
4,348 KB
testcase_32 AC 7 ms
5,824 KB
testcase_33 AC 10 ms
6,424 KB
testcase_34 AC 6 ms
5,108 KB
testcase_35 AC 10 ms
6,256 KB
testcase_36 AC 5 ms
4,764 KB
testcase_37 AC 3 ms
4,348 KB
testcase_38 AC 8 ms
5,948 KB
testcase_39 AC 5 ms
4,960 KB
testcase_40 AC 10 ms
6,412 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

ll f(ll a,ll b){
	return a==0||b==0||gcd(a,b)!=1?0:(a-1)*(b-1);
}
{
	ll@n,@a[n];
	if(n==2){
		wt(f(a[0],a[1]));
		wt(1,2);
	}
	if(n==3){
		ll x0=f(f(a[1],a[2]),a[0]);
		ll x1=f(f(a[0],a[2]),a[1]);
		ll x2=f(f(a[0],a[1]),a[2]);
		if(x0<x1&&x0<x2){
			wt(x0);
			wt(2,3);
			wt(1,2);
		}else if(x1<x2){
			wt(x1);
			wt(1,3);
			wt(1,2);
		}else{
			wt(x2);
			wt(1,2);
			wt(1,2);
		}
	}
	if(n>3){
		wt(0);
		wt(1,2);
		wt(1,2);
		rep(i,n-3){
			wt(n-i-3,n-i-2);
		}
	}
}
0