結果
| 問題 |
No.239 にゃんぱすー
|
| ユーザー |
zaichu
|
| 提出日時 | 2015-12-16 14:27:59 |
| 言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
| 結果 |
AC
|
| 実行時間 | 6 ms / 2,000 ms |
| コード長 | 446 bytes |
| コンパイル時間 | 1,523 ms |
| コンパイル使用メモリ | 158,916 KB |
| 実行使用メモリ | 6,944 KB |
| 最終ジャッジ日時 | 2024-09-16 05:40:43 |
| 合計ジャッジ時間 | 2,380 ms |
|
ジャッジサーバーID (参考情報) |
judge1 / judge2 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 4 |
| other | AC * 33 |
ソースコード
#include <bits/stdc++.h>
using namespace std;
#define REP(i, n) for(int(i)=0;(i)<(n);++(i))
bool p[111];
int main(){
int n;
cin >> n;
REP(i,n)REP(j,n){
string s; cin >> s;
if(i==j) continue;
if(s != "nyanpass") p[j] = true;
}
int cnt = 0, res;
REP(j,n){
if(!p[j]){
cnt++;
res = j + 1;
}
}
if(cnt != 1) res = -1;
cout << res << endl;
}
zaichu