結果
問題 |
No.239 にゃんぱすー
|
ユーザー |
![]() |
提出日時 | 2018-03-29 16:46:42 |
言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
結果 |
AC
|
実行時間 | 6 ms / 2,000 ms |
コード長 | 674 bytes |
コンパイル時間 | 703 ms |
コンパイル使用メモリ | 66,936 KB |
実行使用メモリ | 6,944 KB |
最終ジャッジ日時 | 2024-06-25 23:49:31 |
合計ジャッジ時間 | 2,213 ms |
ジャッジサーバーID (参考情報) |
judge5 / judge3 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 4 |
other | AC * 33 |
ソースコード
#include <iostream> #include <string> #include <vector> #include <algorithm> using namespace std; int main() { int n; cin >> n; vector<vector<string>> a(n,vector<string>(n)); for(int i = 0;i < n;i++){ for(int j = 0;j < n;j++){ cin >> a[i][j]; } } int nyan = -1; for(int j = 0;j < n;j++){ bool ans = true; for(int i = 0;i < n;i++){ if(j == i)continue; if(a[i][j] != "nyanpass")ans = false; } if(ans && nyan == -1)nyan = j + 1; else if(ans && nyan != -1){ nyan = -1; break; } } cout << nyan << endl; return 0; }