結果

問題 No.239 にゃんぱすー
ユーザー fumi6328
提出日時 2018-08-29 22:49:21
言語 C++11(廃止可能性あり)
(gcc 13.3.0)
結果
AC  
実行時間 5 ms / 2,000 ms
コード長 526 bytes
コンパイル時間 396 ms
コンパイル使用メモリ 55,492 KB
実行使用メモリ 6,944 KB
最終ジャッジ日時 2024-09-13 19:31:18
合計ジャッジ時間 1,473 ms
ジャッジサーバーID
(参考情報)
judge5 / judge1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 4
other AC * 33
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <iostream>
#include <string>
using namespace std;

int main()
{
    int n;
    cin >> n;

    int num[100] = {};
    string a;
    for(int i = 0; i < n; i++){
        for(int j = 0; j < n; j++){
            cin >> a;
            if(a == "nyanpass") num[j]++;
        }
    }

    int ans,count = 0;
    for(int i = 0; i < n; i++){
        if(num[i] == n - 1){
            count++;
            ans = i + 1;
        }
    }
    
    cout << (count == 1 ? ans : -1) << endl;

    return 0;
}
0