結果

問題 No.239 にゃんぱすー
ユーザー 👑 obakyan
提出日時 2019-03-29 20:18:35
言語 C++11(廃止可能性あり)
(gcc 13.3.0)
結果
AC  
実行時間 6 ms / 2,000 ms
コード長 638 bytes
コンパイル時間 831 ms
コンパイル使用メモリ 59,864 KB
実行使用メモリ 5,248 KB
最終ジャッジ日時 2024-11-07 01:23:50
合計ジャッジ時間 1,606 ms
ジャッジサーバーID
(参考情報)
judge2 / judge1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 4
other AC * 33
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <iostream>
#include <cstdlib>
#include <vector>
#include <string>
int main()
{
    int n;
    std::cin >> n;
    std::vector<bool> t(n, true);
    for(int r = 0; r < n; r++){
        for(int c = 0; c < n; c++){
            std::string s;
            std::cin >> s;
            if(c != r && s != "nyanpass"){
                t[c] = false;
            }
        }
    }
    int res = -2;
    for(int i = 0; i < n; i++){
        if(t[i]){
            if(res == -2){
                res = i;
            } else {
                res = -2;
                break;
            }
        }
    }
    std::cout << res + 1 << std::endl;
}
0