結果

問題 No.482 あなたの名は
ユーザー tailstails
提出日時 2017-02-10 22:33:56
言語 Perl
(5.38.2)
結果
WA  
実行時間 -
コード長 194 bytes
コンパイル時間 869 ms
コンパイル使用メモリ 5,320 KB
実行使用メモリ 38,132 KB
最終ジャッジ日時 2023-08-27 22:24:36
合計ジャッジ時間 5,291 ms
ジャッジサーバーID
(参考情報)
judge15 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 6 ms
5,244 KB
testcase_01 AC 6 ms
5,132 KB
testcase_02 AC 6 ms
5,256 KB
testcase_03 AC 6 ms
5,200 KB
testcase_04 AC 6 ms
5,204 KB
testcase_05 WA -
testcase_06 AC 6 ms
5,176 KB
testcase_07 AC 7 ms
5,356 KB
testcase_08 AC 6 ms
5,124 KB
testcase_09 AC 6 ms
5,060 KB
testcase_10 AC 6 ms
5,336 KB
testcase_11 AC 7 ms
5,428 KB
testcase_12 WA -
testcase_13 AC 7 ms
5,408 KB
testcase_14 AC 6 ms
5,132 KB
testcase_15 AC 195 ms
37,928 KB
testcase_16 WA -
testcase_17 WA -
testcase_18 AC 197 ms
37,996 KB
testcase_19 AC 197 ms
37,796 KB
testcase_20 AC 195 ms
37,812 KB
testcase_21 AC 199 ms
38,100 KB
testcase_22 AC 195 ms
38,024 KB
testcase_23 AC 194 ms
37,900 KB
testcase_24 AC 194 ms
37,864 KB
testcase_25 AC 199 ms
37,948 KB
testcase_26 WA -
testcase_27 AC 195 ms
37,776 KB
testcase_28 WA -
testcase_29 AC 155 ms
37,608 KB
testcase_30 WA -
権限があれば一括ダウンロードができます
コンパイルメッセージ
Main.pl syntax OK

ソースコード

diff #

($n,$k)=glob<>;
@d=(0,<>=~/\d+/g);
for(0..$n){
	$e[$d[$_]]=$_;
}
for(0..$n){
	if($d[$_]!=$_){
		$j=$e[$_];
		$d[$j]=$d[$_];
		$e[$d[$_]]=$_;
		++$c;
	}
}
print $k>=$c && ($k^$c^1)&1 ? YES : NO

0