結果
問題 |
No.239 にゃんぱすー
|
ユーザー |
![]() |
提出日時 | 2019-04-10 22:39:52 |
言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 577 bytes |
コンパイル時間 | 1,757 ms |
コンパイル使用メモリ | 173,836 KB |
実行使用メモリ | 5,376 KB |
最終ジャッジ日時 | 2024-07-08 07:39:10 |
合計ジャッジ時間 | 3,224 ms |
ジャッジサーバーID (参考情報) |
judge1 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 4 |
other | AC * 32 WA * 1 |
ソースコード
#include <bits/stdc++.h> using namespace std; using ll = long long; const ll mod = 1e9 + 7; const ll inf = (1 << 30) - 1; const ll infll = (1LL << 61) - 1; int N, cnt, ans = -1; string a[111][111]; string s = "nyanpass"; int main() { cin >> N; map<int, int> mp; for (int i = 0; i < N; i++) { for (int j = 0; j < N; j++) { cin >> a[i][j]; if (i != j && a[i][j] == s) mp[j]++; if (mp[j] == N - 1) cnt++, ans = j + 1; } } cout << (cnt == 1 ? ans : -1) << endl; }