結果
問題 | No.239 にゃんぱすー |
ユーザー |
![]() |
提出日時 | 2016-10-29 17:48:10 |
言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 6 ms / 2,000 ms |
コード長 | 376 bytes |
コンパイル時間 | 1,497 ms |
コンパイル使用メモリ | 167,828 KB |
実行使用メモリ | 6,824 KB |
最終ジャッジ日時 | 2024-11-24 18:05:24 |
合計ジャッジ時間 | 2,572 ms |
ジャッジサーバーID (参考情報) |
judge4 / judge3 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 4 |
other | AC * 33 |
ソースコード
#include <bits/stdc++.h>using namespace std;int n, c[109]; string s;int main() {cin >> n;for(int i = 0; i < n; i++) {for(int j = 0; j < n; j++) {cin >> s;if(s == "nyanpass") c[j]++;}}int cnt = 0, ret = 0;for(int i = 0; i < n; i++) {if(c[i] == n - 1) ret = i + 1, cnt++;}if(cnt == 1) cout << ret << endl;else cout << -1 << endl;return 0;}