結果

問題 No.239 にゃんぱすー
ユーザー koba-e964koba-e964
提出日時 2015-07-11 00:09:23
言語 C++11
(gcc 11.4.0)
結果
WA  
実行時間 -
コード長 296 bytes
コンパイル時間 1,370 ms
コンパイル使用メモリ 144,908 KB
実行使用メモリ 6,724 KB
最終ジャッジ日時 2023-09-22 10:30:52
合計ジャッジ時間 2,668 ms
ジャッジサーバーID
(参考情報)
judge14 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 4 ms
6,320 KB
testcase_01 AC 4 ms
6,160 KB
testcase_02 WA -
testcase_03 WA -
testcase_04 AC 4 ms
6,148 KB
testcase_05 WA -
testcase_06 AC 4 ms
6,172 KB
testcase_07 AC 3 ms
6,196 KB
testcase_08 AC 4 ms
6,132 KB
testcase_09 WA -
testcase_10 AC 4 ms
6,140 KB
testcase_11 WA -
testcase_12 WA -
testcase_13 AC 4 ms
6,188 KB
testcase_14 WA -
testcase_15 WA -
testcase_16 WA -
testcase_17 WA -
testcase_18 WA -
testcase_19 WA -
testcase_20 AC 6 ms
6,320 KB
testcase_21 WA -
testcase_22 AC 7 ms
6,304 KB
testcase_23 AC 7 ms
6,428 KB
testcase_24 AC 7 ms
6,364 KB
testcase_25 WA -
testcase_26 WA -
testcase_27 AC 4 ms
6,176 KB
testcase_28 AC 4 ms
6,180 KB
testcase_29 WA -
testcase_30 AC 5 ms
6,200 KB
testcase_31 AC 5 ms
6,268 KB
testcase_32 WA -
testcase_33 WA -
testcase_34 AC 7 ms
6,580 KB
testcase_35 WA -
testcase_36 AC 8 ms
6,448 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>
using namespace std;
#define rep(i,n) for(int i=0;i<(n);i++)
string a[300][300];
int main(){
int n;cin>>n;
rep(i,n)rep(j,n) cin>>a[i][j];
int cnt=0,m=-1;
rep(j,n) {
bool ok=1;
rep(i,n) if(j!=i && a[i][j]!="nyanpass")ok=0;
if(ok)cnt++,m=j;
}
cout<<(cnt==1 ?m:-1) <<endl;
}
0