結果

問題 No.239 にゃんぱすー
ユーザー nasadigital
提出日時 2015-07-10 22:35:06
言語 C++11(廃止可能性あり)
(gcc 13.3.0)
結果
AC  
実行時間 6 ms / 2,000 ms
コード長 783 bytes
コンパイル時間 529 ms
コンパイル使用メモリ 55,948 KB
実行使用メモリ 6,944 KB
最終ジャッジ日時 2024-07-08 02:01:46
合計ジャッジ時間 1,749 ms
ジャッジサーバーID
(参考情報)
judge2 / judge1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 4
other AC * 33
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <iostream>
#include <cstring>

using namespace std;

int main(int argc, const char * argv[])
{
    int n;
    cin>>n;
    bool mat[n][n];
    memset(mat,false,sizeof(mat));
    for(int ctr1=0;ctr1<n;ctr1++){
        for(int ctr2=0;ctr2<n;ctr2++){
        string t;
        cin>>t;
        if(t=="-" || t=="nyanpass")
            mat[ctr1][ctr2]=true;
        }
    }
    int rez=-1;
    for(int ctr1=0;ctr1<n;ctr1++){
        bool npass=true;
        for(int ctr2=0;ctr2<n;ctr2++){
            if (mat[ctr2][ctr1]==false)
                npass=false;
        }
        if(npass){
            if(rez!=-1){
                rez=-1;
                break;
            }
            else {
                rez=ctr1+1;
            }
        }
    }
    cout<<rez;
    return 0;
}
0