結果

問題 No.239 にゃんぱすー
ユーザー kyo1
提出日時 2020-04-13 07:49:01
言語 C++14
(gcc 13.3.0 + boost 1.87.0)
結果
WA  
実行時間 -
コード長 526 bytes
コンパイル時間 1,530 ms
コンパイル使用メモリ 168,084 KB
実行使用メモリ 6,948 KB
最終ジャッジ日時 2024-09-23 08:12:04
合計ジャッジ時間 2,615 ms
ジャッジサーバーID
(参考情報)
judge1 / judge5
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 4
other AC * 25 WA * 8
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>

using namespace std;

int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  int N;
  cin >> N;
  int cnt = 0;
  vector<int> cnts(N, 0);
  for (int i = 0; i < N; i++) {
    for (int j = 0; j < N; j++) {
      string a;
      cin >> a;
      if (a == "nyanpass") {
        cnts[i]++;
        cnts[j]++;
        cnt++;
      }
    }
  }
  for (int i = 0; i < N; i++) {
    if (cnts[i] == cnt && cnt > 0) {
      cout << i + 1 << '\n';
      return 0;
    }
  }
  cout << -1 << '\n';
  return 0;
}
0