結果
問題 |
No.239 にゃんぱすー
|
ユーザー |
![]() |
提出日時 | 2017-11-19 20:12:43 |
言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 692 bytes |
コンパイル時間 | 1,941 ms |
コンパイル使用メモリ | 159,328 KB |
実行使用メモリ | 5,248 KB |
最終ジャッジ日時 | 2024-11-26 00:36:08 |
合計ジャッジ時間 | 3,592 ms |
ジャッジサーバーID (参考情報) |
judge2 / judge5 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 WA * 1 |
other | AC * 25 WA * 8 |
ソースコード
#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-1) { cout << -1 << endl; }else{ if((key1 == key2) || (key3 == key2)){ cout << key2 << endl; }else if((key1 == key3)){ cout << key1 << endl; } } return 0; }