結果
問題 | No.239 にゃんぱすー |
ユーザー |
![]() |
提出日時 | 2017-07-10 22:00:23 |
言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
結果 |
AC
|
実行時間 | 6 ms / 2,000 ms |
コード長 | 569 bytes |
コンパイル時間 | 677 ms |
コンパイル使用メモリ | 59,800 KB |
実行使用メモリ | 6,824 KB |
最終ジャッジ日時 | 2024-10-07 07:14:17 |
合計ジャッジ時間 | 2,298 ms |
ジャッジサーバーID (参考情報) |
judge2 / judge5 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 4 |
other | AC * 33 |
ソースコード
#include<iostream>#include<cstdio>#include<string>#include<vector>using namespace std;int main() {int n;cin >> n;vector<bool> renchon_ppoi(n, true);for (int i = 0; i < n; i++){for (int k = 0; k < n; k++){string str;cin >> str;if ((i != k) && (str != "nyanpass")){renchon_ppoi[k] = false;}}}int renchon = -1, count = 0;for (int i = 0; i < n; i++){if (renchon_ppoi[i]){count++;renchon = i + 1;if (count > 1){renchon = -1;break;}}}cout << renchon << endl;return 0;}