結果
| 問題 |
No.239 にゃんぱすー
|
| ユーザー |
|
| 提出日時 | 2016-09-20 12:13:07 |
| 言語 | D (dmd 2.109.1) |
| 結果 |
AC
|
| 実行時間 | 4 ms / 2,000 ms |
| コード長 | 544 bytes |
| コンパイル時間 | 816 ms |
| コンパイル使用メモリ | 121,828 KB |
| 実行使用メモリ | 6,944 KB |
| 最終ジャッジ日時 | 2024-06-12 04:30:29 |
| 合計ジャッジ時間 | 1,699 ms |
|
ジャッジサーバーID (参考情報) |
judge3 / judge4 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 4 |
| other | AC * 33 |
ソースコード
import std.algorithm, std.array, std.container, std.range, std.bitmanip;
import std.numeric, std.math, std.bigint, std.random, core.bitop;
import std.string, std.regex, std.conv, std.stdio, std.typecons;
void main()
{
auto n = readln.chomp.to!size_t;
auto aij = iota(n).map!(_ => readln.split.array).array;
size_t[] r;
foreach (i; 0..n) {
auto ai = aij.map!(ai => ai[i]).array;
if ((ai[0..i] ~ ai[i+1..n]).all!(a => a == "nyanpass"))
r ~= i;
}
if (r.length == 1)
writeln(r.front + 1);
else
writeln(-1);
}