結果
| 問題 |
No.239 にゃんぱすー
|
| ユーザー |
h_noson
|
| 提出日時 | 2015-12-26 00:20:11 |
| 言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
| 結果 |
AC
|
| 実行時間 | 7 ms / 2,000 ms |
| コード長 | 591 bytes |
| コンパイル時間 | 490 ms |
| コンパイル使用メモリ | 56,180 KB |
| 実行使用メモリ | 6,944 KB |
| 最終ジャッジ日時 | 2024-09-19 00:07:07 |
| 合計ジャッジ時間 | 2,583 ms |
|
ジャッジサーバーID (参考情報) |
judge4 / judge2 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 4 |
| other | AC * 33 |
ソースコード
#include "iostream"
using namespace std;
int main(){
int n,i,j;
cin >> n;
string greet[n][n];
for (i = 0; i < n; i++){
for (j = 0; j < n; j++)
cin >> greet[i][j];
}
int cnt,ans;
cnt = 0;
ans = -1;
for (j = 0; j < n; j++){
for (i = 0; i < n; i++){
if (i != j && greet[i][j] != "nyanpass")
break;
}
if (i == n){
cnt++;
ans = j+1;
}
if (cnt > 1){
ans = -1;
break;
}
}
cout << ans << endl;
return 0;
}
h_noson