結果

問題 No.239 にゃんぱすー
ユーザー mine691
提出日時 2019-04-10 22:45:44
言語 C++14
(gcc 13.3.0 + boost 1.87.0)
結果
AC  
実行時間 6 ms / 2,000 ms
コード長 437 bytes
コンパイル時間 1,545 ms
コンパイル使用メモリ 166,968 KB
実行使用メモリ 5,376 KB
最終ジャッジ日時 2024-07-08 07:46:48
合計ジャッジ時間 2,358 ms
ジャッジサーバーID
(参考情報)
judge2 / judge3
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 4
other AC * 33
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>
using namespace std;
using ll = long long;

int N, cnt, ans, mp[111];
string a[111][111];

int main()
{
    cin >> N;
    for (int i = 0; i < N; i++)
    {
        for (int j = 0; j < N; j++)
        {
            cin >> a[i][j];
            mp[j] += a[i][j] == "nyanpass";
            if (i != j && mp[j] == N - 1)
                cnt++, ans = j + 1;
        }
    }
    cout << (cnt == 1 ? ans : -1) << endl;
}
0