結果

問題 No.2719 Equal Inner Products in Permutation
ユーザー tailstails
提出日時 2024-04-10 17:42:11
言語 Perl
(5.40.0)
結果
AC  
実行時間 72 ms / 2,000 ms
コード長 680 bytes
コンパイル時間 2,295 ms
コンパイル使用メモリ 109,192 KB
実行使用メモリ 45,952 KB
最終ジャッジ日時 2024-10-02 20:08:56
合計ジャッジ時間 8,935 ms
ジャッジサーバーID
(参考情報)
judge1 / judge5
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 1
other AC * 30
権限があれば一括ダウンロードができます
コンパイルメッセージ
Unquoted string "a" may clash with future reserved word at Main.pl line 20.
Unquoted string "b" may clash with future reserved word at Main.pl line 20.
Unquoted string "c" may clash with future reserved word at Main.pl line 20.
Main.pl syntax OK

ソースコード

diff #

sub w{open(X,">",@_);select(X);}
sub r{sysopen(X,$_[0].$n%3,0);sysread(X,$t,$n*7);syswrite(STDOUT,$t,$n*7);}
CHECK{
	if(!-e"a0"){
		@0=map{$_*9+1,$_*9+2,$_*9+9}0..199999;
		@1=map{$_*9+6,$_*9+8,$_*9+7}0..199999;
		@2=map{$_*9+3,$_*9+4,$_*9+5}0..199999;
		w(a0);printf " %6d",$_ for@0;
		w(b0);printf " %6d",$_ for@1;
		w(c0);printf " %6d",$_ for@2;
		w(a2);printf " %6d",$_ for 1,4,map$_+6,@0;
		w(b2);printf " %6d",$_ for 3,6,map$_+6,@1;
		w(c2);printf " %6d",$_ for 5,2,map$_+6,@2;
		w(a1);printf " %6d",$_ for 1,2,4,11,map$_+12,@0;
		w(b1);printf " %6d",$_ for 7,9,10,12,map$_+12,@1;
		w(c1);printf " %6d",$_ for 8,5,6,3,map$_+12,@2;
	}
}
$n=<>;
$n<2?print-1:(r(a),r(b),r(c));
0