結果
| 問題 |
No.239 にゃんぱすー
|
| ユーザー |
|
| 提出日時 | 2015-07-10 22:43:47 |
| 言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
| 結果 |
AC
|
| 実行時間 | 7 ms / 2,000 ms |
| コード長 | 803 bytes |
| コンパイル時間 | 602 ms |
| コンパイル使用メモリ | 62,472 KB |
| 実行使用メモリ | 6,944 KB |
| 最終ジャッジ日時 | 2024-07-08 02:02:44 |
| 合計ジャッジ時間 | 1,647 ms |
|
ジャッジサーバーID (参考情報) |
judge2 / judge1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 4 |
| other | AC * 33 |
ソースコード
#include <iostream>
#include <string>
#include <vector>
#include <algorithm>
#include <sstream>
#include <cstdio>
#include <cstdlib>
using namespace std;
string a[101][101];
int main(){
//string str;
int N;
cin >> N;
for (int i = 0; i < N; i += 1)
{
for (int j = 0; j < N; j += 1)
{
cin >> a[i][j];
}
}
int count = 0;
int idx = -1;
for (int j = 0; j < N; j += 1)
{
bool is = true;
for (int i = 0; i < N; i += 1)
{
if(not(a[i][j] == "nyanpass" or a[i][j] == "-"))
is = false;
}
if(is){
count++;
idx = j;
}
}
if(count == 1)
cout << idx+1 << endl;
else
cout << -1 << endl;
return 0;
}