結果
| 問題 |
No.239 にゃんぱすー
|
| コンテスト | |
| ユーザー |
zaichu
|
| 提出日時 | 2015-12-16 14:22:55 |
| 言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 884 bytes |
| コンパイル時間 | 574 ms |
| コンパイル使用メモリ | 62,832 KB |
| 実行使用メモリ | 6,948 KB |
| 最終ジャッジ日時 | 2024-09-16 05:40:31 |
| 合計ジャッジ時間 | 1,614 ms |
|
ジャッジサーバーID (参考情報) |
judge2 / judge6 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 4 |
| other | AC * 26 WA * 7 |
ソースコード
#include <iostream>
#include <string>
#include <vector>
using namespace std;
int main(){
int n;
cin >> n;
vector<int> data;
data.resize(n,0);
int check = -1;
/*
for(auto &a:data){
cin >> a;
}
for(int i = 0; i < n+1; i++){
if(i % (n+1) == 0) continue;
if(data[i] == "nyanpass"){
int count = 1;
for(int j = i + n; j < n * n; j += n){
if(data[j] == "nyanpass") count++;
if(count == n - 1){
(check == -1) ? (check = (i%n)+1) : (check = -2);
}
if(check == -2){
check = -1;
break;
}
}
}
}
*/
for(int i = 0;i < n; i++){
for(int j = 0; j < n; j++){
string s; cin >> s;
if(i == j) continue;
if(s == "nyanpass") data[j] = 1;
else data[j] = 0;
}
}
int count = 0;
for(int j = 0; j < n; j++){
if(data[j]){
count++;
check = j + 1;
}
}
if( count != 1 ) check = -1;
cout << check << endl;
return 0;
}
zaichu