結果
| 問題 |
No.239 にゃんぱすー
|
| ユーザー |
machy
|
| 提出日時 | 2015-07-10 22:27:25 |
| 言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
| 結果 |
AC
|
| 実行時間 | 5 ms / 2,000 ms |
| コード長 | 659 bytes |
| コンパイル時間 | 465 ms |
| コンパイル使用メモリ | 64,008 KB |
| 実行使用メモリ | 6,944 KB |
| 最終ジャッジ日時 | 2024-07-08 01:57:50 |
| 合計ジャッジ時間 | 1,366 ms |
|
ジャッジサーバーID (参考情報) |
judge3 / judge5 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 4 |
| other | AC * 33 |
ソースコード
#include <iostream>
#include <vector>
#include <string>
using namespace std;
int main(){
int N;
cin >> N;
vector<vector<string> > mat(N, vector<string>(N));
for(int i = 0; i < N; i++){
for(int j = 0; j < N; j++){
cin >> mat[i][j];
}
}
int ans = -2;
for(int i = 0; i < N; i++){
bool flag = true;
for(int j = 0; j < N; j++){
if(i==j) continue;
if(mat[j][i] != "nyanpass") flag = false;
}
if(flag){
if(ans == -2) ans = i+1;
else ans = -1;
}
}
if(ans == -2) ans = -1;
cout << ans << endl;
return 0;
}
machy