結果
問題 | No.239 にゃんぱすー |
ユーザー |
|
提出日時 | 2015-07-10 22:24:06 |
言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
結果 |
AC
|
実行時間 | 6 ms / 2,000 ms |
コード長 | 634 bytes |
コンパイル時間 | 1,183 ms |
コンパイル使用メモリ | 161,300 KB |
実行使用メモリ | 6,944 KB |
最終ジャッジ日時 | 2024-07-08 01:55:51 |
合計ジャッジ時間 | 2,137 ms |
ジャッジサーバーID (参考情報) |
judge5 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 4 |
other | AC * 33 |
ソースコード
#include <bits/stdc++.h> #define rep(i, a) for (int i = 0; i < (a); i++) #define rep2(i, a, b) for (int i = (a); i < (b); i++) using namespace std; typedef long long ll; const ll inf = 1e9; const ll mod = 1e9 + 7; int N; string A[100][100]; int main() { cin >> N; rep (i, N) rep (j, N) cin >> A[i][j]; vector<int> cand; rep (j, N) { bool all = true; rep (i, N) if (i != j) { all &= A[i][j] == "nyanpass"; } if (all) cand.push_back(j); } if (cand.size() == 1) { cout << cand[0] + 1 << endl; } else { cout << -1 << endl; } return 0; }