結果
| 問題 |
No.239 にゃんぱすー
|
| コンテスト | |
| ユーザー |
hamray
|
| 提出日時 | 2017-11-19 20:19:26 |
| 言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 689 bytes |
| コンパイル時間 | 1,330 ms |
| コンパイル使用メモリ | 159,472 KB |
| 実行使用メモリ | 5,248 KB |
| 最終ジャッジ日時 | 2024-11-26 00:36:12 |
| 合計ジャッジ時間 | 2,043 ms |
|
ジャッジサーバーID (参考情報) |
judge2 / judge5 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 WA * 1 |
| other | AC * 16 WA * 17 |
ソースコード
#include<bits/stdc++.h>
using namespace std;
int main(){
int N; cin >> N;
string nyan[N][N];
int cnt = 0;
int key1, key2, key3;
for(int i=0; i<N; i++){
for(int j=0; j<N; j++){
cin >> nyan[i][j];
if(nyan[i][j] == "nyanpass"){
cnt++;
if(i == 0) key1 = j+1;
if(i == 1) key2 = j+1;
if(i == 2) key3 = j+1;
}
}
}
if(cnt > N) {
cout << -1 << endl;
}else{
if((key1 == key2) || (key3 == key2)){
cout << key2 << endl;
}else if((key1 == key3)){
cout << key1 << endl;
}
}
return 0;
}
hamray