結果
問題 | No.239 にゃんぱすー |
ユーザー |
|
提出日時 | 2017-10-24 23:06:25 |
言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 7 ms / 2,000 ms |
コード長 | 475 bytes |
コンパイル時間 | 712 ms |
コンパイル使用メモリ | 72,920 KB |
実行使用メモリ | 6,820 KB |
最終ジャッジ日時 | 2024-11-21 17:52:58 |
合計ジャッジ時間 | 1,653 ms |
ジャッジサーバーID (参考情報) |
judge1 / judge3 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 4 |
other | AC * 33 |
ソースコード
#include <iostream>#include <vector>using namespace std;int main(){int n;cin >> n;vector<vector<string>> v(n, vector<string>(n));for(int i = 0; i < n; i++){for(int j = 0; j < n; j++){cin >> v[i][j];}}int num = 0;int man = -1;for(int j = 0; j < n; j++){bool ok = true;for(int i = 0; i < n; i++){if(i != j and v[i][j] != "nyanpass"){ok = false;}}if(ok){num++;man = j;}}if(num == 1){cout << man+1 << endl;} else {cout << -1 << endl;}return 0;}