結果
問題 | No.239 にゃんぱすー |
ユーザー |
|
提出日時 | 2019-07-27 02:03:15 |
言語 | C++17 (gcc 13.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 5 ms / 2,000 ms |
コード長 | 544 bytes |
コンパイル時間 | 1,895 ms |
コンパイル使用メモリ | 193,176 KB |
最終ジャッジ日時 | 2025-01-07 09:15:28 |
ジャッジサーバーID (参考情報) |
judge3 / judge1 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 4 |
other | AC * 33 |
ソースコード
#include <bits/stdc++.h> using namespace std; typedef long long ll; int main() { int n; cin >> n; bool v[n]; fill(v, v+n, true); for (int i = 0; i < n; i++) for (int j = 0; j < n; j++) { string s; cin >> s; if (i == j) continue; if (s != "nyanpass") v[j] = false; } int cnt = 0; int ans; for (int i = 0; i < n; i++) if (v[i]) { cnt++; ans = i+1; } cout << (cnt == 1 ? ans : -1 ) << endl; return 0; }