結果
問題 | No.239 にゃんぱすー |
ユーザー |
![]() |
提出日時 | 2015-10-05 23:18:12 |
言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
結果 |
AC
|
実行時間 | 5 ms / 2,000 ms |
コード長 | 575 bytes |
コンパイル時間 | 1,983 ms |
コンパイル使用メモリ | 161,088 KB |
実行使用メモリ | 5,376 KB |
最終ジャッジ日時 | 2024-07-20 01:13:27 |
合計ジャッジ時間 | 2,723 ms |
ジャッジサーバーID (参考情報) |
judge1 / judge3 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 4 |
other | AC * 33 |
ソースコード
#include "bits/stdc++.h" using namespace std; #define REP(i, n) for(int i=0; i<(n); i++) int N; signed main() { cin >> N; vector<bool> C(N, true); string s; REP(i,N) REP(j,N) { cin >> s; if (i == j) continue; if (s != "nyanpass") { C[j] = false; } } int renchon = -1; int ret = -1; REP(i,N) { if (!C[i]) continue; if (renchon == -1) { renchon = i; ret = i + 1; } else { ret = -1; } } cout << ret << endl; return 0; }