結果

問題 No.2727 Tetrahedron Game
ユーザー tailstails
提出日時 2024-04-12 23:24:42
言語 cLay
(20240104-1)
結果
AC  
実行時間 28 ms / 2,000 ms
コード長 625 bytes
コンパイル時間 3,470 ms
コンパイル使用メモリ 180,348 KB
実行使用メモリ 7,492 KB
最終ジャッジ日時 2024-04-12 23:24:46
合計ジャッジ時間 4,261 ms
ジャッジサーバーID
(参考情報)
judge3 / judge4
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
6,816 KB
testcase_01 AC 28 ms
6,812 KB
testcase_02 AC 24 ms
6,944 KB
testcase_03 AC 13 ms
7,492 KB
testcase_04 AC 13 ms
6,944 KB
testcase_05 AC 13 ms
6,944 KB
testcase_06 AC 13 ms
6,944 KB
testcase_07 AC 13 ms
6,944 KB
testcase_08 AC 13 ms
6,944 KB
testcase_09 AC 13 ms
6,944 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;
		if(s[i]=='K'){
			rep(j,1,606){
				if(e[j*b%606]=='K'){
					d[j]='K';
				}
				if(e[j*b%606]=='D'&&d[j]!='K'){
					d[j]='D';
				}
			}
		}else{
			rep(j,1,606){
				if(e[j*b%606]=='P'){
					d[j]='P';
				}
				if(e[j*b%606]=='D'&&d[j]!='P'){
					d[j]='D';
				}
			}
		}
	}
	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