結果

問題 No.239 にゃんぱすー
ユーザー hiragn
提出日時 2019-07-17 10:23:55
言語 C++14
(gcc 13.3.0 + boost 1.87.0)
結果
AC  
実行時間 6 ms / 2,000 ms
コード長 571 bytes
コンパイル時間 1,837 ms
コンパイル使用メモリ 170,636 KB
実行使用メモリ 6,820 KB
最終ジャッジ日時 2024-12-17 19:27:53
合計ジャッジ時間 3,036 ms
ジャッジサーバーID
(参考情報)
judge5 / judge4
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 4
other AC * 33
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>

using namespace std;

int main() {
    int n;
    cin >> n;
    string a[128][128];

    for (int i = 0; i < n; ++i) {
        for (int j = 0; j < n; ++j) {
            cin >> a[i][j];
        }
    }

    vector<int> vt;
    for (int j = 0; j < n; ++j) {
        int cnt = 0;
        for (int i = 0; i < n; ++i) {
            if (a[i][j] == "nyanpass") cnt++;
        }
        if (cnt == n - 1) vt.push_back(j + 1);
    }

    if (vt.size() == 1) {
        cout << vt[0] << endl;
    } else {
        cout << -1 << endl;
    }
    return 0;
}
0