結果
問題 | No.239 にゃんぱすー |
ユーザー |
![]() |
提出日時 | 2016-08-16 21:51:14 |
言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
結果 |
AC
|
実行時間 | 7 ms / 2,000 ms |
コード長 | 516 bytes |
コンパイル時間 | 627 ms |
コンパイル使用メモリ | 64,212 KB |
実行使用メモリ | 5,248 KB |
最終ジャッジ日時 | 2024-11-07 18:23:31 |
合計ジャッジ時間 | 1,850 ms |
ジャッジサーバーID (参考情報) |
judge5 / judge1 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 4 |
other | AC * 33 |
ソースコード
#include <iostream>#include <string>#include <vector>using namespace std;int main() {int N;int ans = -1;cin >> N;vector<int> v(N, 0);vector<vector<string> > A(N, vector<string>(N));for (int i = 0; i < N;i++) {for (int j = 0;j < N;j++) {cin >> A[i][j];if (A[i][j] == "nyanpass") {v[j]++;}}}for (int i = 0; i < N;i++) {if (v[i] == N - 1) {if (ans == -1) {ans = i + 1;}else {cout << -1 << endl; return 0;}}}cout << ans << endl;return 0;}