結果
| 問題 | No.239 にゃんぱすー |
| コンテスト | |
| ユーザー |
forest3
|
| 提出日時 | 2020-03-17 17:39:37 |
| 言語 | C++14 (gcc 15.3.0 + boost 1.92.0 + ACL) |
| 結果 |
AC
不安定
|
| 実行時間 | 4 ms / 2,000 ms |
| + 201µs | |
| コード長 | 530 bytes |
| 記録 | |
| コンパイル時間 | 956 ms |
| コンパイル使用メモリ | 185,688 KB |
| 実行使用メモリ | 9,868 KB |
| 最終ジャッジ日時 | 2026-10-11 13:02:29 |
| 合計ジャッジ時間 | 2,637 ms |
|
ジャッジサーバーID (参考情報) |
judge3_0 / judge1_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 4 |
| other | AC * 34 |
ソースコード
#include <bits/stdc++.h>
using namespace std;
int main()
{
int N;
cin >> N;
vector<vector<string>> A( N, vector<string>( N ) );
for( int i = 0; i < N; i++ ) {
for( int j = 0; j < N; j++ ) {
cin >> A[i][j];
}
}
int idx;
int cnt = 0;
for( int j = 0; j < N; j++ ) {
int flag = 0;
for( int i = 0; i < N; i++ ) {
if( i == j ) continue;
if( A[i][j] != string( "nyanpass" ) ) flag = 1;
}
if( flag == 0 ) {
idx = j;
cnt++;
}
}
int ans = -1;
if( cnt == 1 ) ans = idx + 1;
cout << ans << endl;
}
forest3