結果
| 問題 |
No.239 にゃんぱすー
|
| ユーザー |
|
| 提出日時 | 2019-09-10 13:49:35 |
| 言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
AC
|
| 実行時間 | 7 ms / 2,000 ms |
| コード長 | 716 bytes |
| コンパイル時間 | 1,783 ms |
| コンパイル使用メモリ | 176,688 KB |
| 実行使用メモリ | 6,944 KB |
| 最終ジャッジ日時 | 2024-07-02 16:15:21 |
| 合計ジャッジ時間 | 3,074 ms |
|
ジャッジサーバーID (参考情報) |
judge5 / judge2 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 4 |
| other | AC * 33 |
ソースコード
/**
@file 239.cpp
@title No.239 にゃんぱすー - yukicoder
@url https://yukicoder.me/problems/no/239
**/
#include <bits/stdc++.h>
using namespace std;
typedef long long LL;
#define ALL(obj) (obj).begin(), (obj).end()
#define REP(i, N) for (int i = 0; i < (N); ++i)
int main() {
int N;
cin >> N;
vector<vector<string>> A(N, vector<string>(N, ""));
REP(i, N) {
REP(j, N) {
cin >> A[i][j];
}
}
set<int> st;
for (int i = 0; i < N; i++) {
int c{0};
for (int j = 0; j < N; j++) {
if (A[j][i] == "nyanpass") {
c++;
}
}
if (c == N - 1) {
st.insert(i + 1);
}
}
cout << ((st.size() == 1) ? *st.begin() : -1) << endl;
return 0;
}