結果

問題 No.2727 Tetrahedron Game
ユーザー tailstails
提出日時 2024-04-12 23:28:23
言語 cLay
(20240104-1)
結果
AC  
実行時間 30 ms / 2,000 ms
コード長 444 bytes
コンパイル時間 3,046 ms
コンパイル使用メモリ 179,640 KB
実行使用メモリ 7,368 KB
最終ジャッジ日時 2024-04-12 23:28:27
合計ジャッジ時間 3,843 ms
ジャッジサーバーID
(参考情報)
judge5 / judge4
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
6,812 KB
testcase_01 AC 30 ms
6,944 KB
testcase_02 AC 23 ms
6,940 KB
testcase_03 AC 14 ms
6,944 KB
testcase_04 AC 15 ms
6,940 KB
testcase_05 AC 14 ms
6,940 KB
testcase_06 AC 14 ms
7,368 KB
testcase_07 AC 15 ms
6,944 KB
testcase_08 AC 15 ms
6,944 KB
testcase_09 AC 14 ms
6,940 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

ll@t;
rep(t){
	ll@n,@k;
	ll@p11,@p12,@p13;
	ll@p21,@p22,@p23;
	ll@p31,@p32,@p33;
	ll@a[n];
	string@s;
	char d[606];
	rep(j,606){
		d[j]=j%6?'D':j>=k*6?'K':'P';
	}
	rrep(i,n){
		char e[606];
		rep(j,606){
			e[j]=d[j];
		}
		int b=a[i]+1;
		rep(j,1,606){
			char ej=e[j*b%606];
			if(ej==s[i]||ej=='D'&&d[j]!=s[i]){
				d[j]=ej;
			}
		}
	}
	ll h=abs(p11*(p22*p33-p23*p32)+p12*(p23*p31-p21*p33)+p13*(p21*p32-p22*p31));
	wt(h==0?'D':d[h%606]);
}
0