結果

問題 No.239 にゃんぱすー
コンテスト
ユーザー Elk
提出日時 2018-06-03 21:15:25
言語 C++14
(gcc 15.2.0 + boost 1.89.0)
コンパイル:
g++-15 -O2 -lm -std=c++14 -Wuninitialized -DONLINE_JUDGE -o a.out _filename_
実行:
./a.out
結果
WA  
実行時間 -
コード長 641 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 387 ms
コンパイル使用メモリ 39,936 KB
実行使用メモリ 6,144 KB
最終ジャッジ日時 2026-03-20 05:59:13
合計ジャッジ時間 2,276 ms
ジャッジサーバーID
(参考情報)
judge2_0 / judge3_0
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 4
other AC * 32 WA * 1
権限があれば一括ダウンロードができます

ソースコード

diff #
raw source code

#include <stdio.h>
#include <string.h>

int main(){
    int N, i, j, cnt = 0, nyanpass = 0, rentyon;
    char str[100][100][31];

    scanf("%d\n", &N);
    for(i = 0; i < N; i++){
        for(j = 0; j < N; j++){
            scanf("%s ", str[i][j]);
        }
    }
    for(i = 0; i < N; i++){
        for(j = 0; j < N; j++){
            if(strcmp(str[j][i], "nyanpass") == 0) nyanpass++;
            if(nyanpass == N - 1){
                cnt++;
                rentyon = i + 1;
            }
        }
        nyanpass = 0;
    }
    if(cnt == 1){
        printf("%d\n", rentyon);
    }else{
        printf("-1\n");
    }

    return 0;
}
0