結果

問題 No.239 にゃんぱすー
ユーザー leaf+
提出日時 2019-04-14 16:45:24
言語 C++11(廃止可能性あり)
(gcc 13.3.0)
結果
AC  
実行時間 7 ms / 2,000 ms
コード長 581 bytes
コンパイル時間 428 ms
コンパイル使用メモリ 56,160 KB
実行使用メモリ 5,376 KB
最終ジャッジ日時 2024-09-19 04:06:52
合計ジャッジ時間 2,118 ms
ジャッジサーバーID
(参考情報)
judge2 / judge5
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 4
other AC * 33
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <iostream>
#include <string>
using namespace std;
int main() {
    int n, i, j, a = -1, t = 0;
    cin >> n;
    string ar[n][n];
    for (i = 0; i < n; i++) {
        for (j = 0; j < n; j++) {
            cin >> ar[i][j];
        }
    }
    for (i = 0; i < n; i++) {
        for (j = 0; j < n; j++) {
            if ((ar[j][i] != "-") && (ar[j][i] != "nyanpass")) {break;}
            if (j == n - 1) {
                if (a == -1) {a = i + 1;}
                else {t = -1;}
            }
        }
    }
    if (t != -1) {t = a;}
    cout << t << endl;
    return 0;
}
0