結果
問題 | No.239 にゃんぱすー |
ユーザー |
![]() |
提出日時 | 2015-07-10 22:30:13 |
言語 | C++11 (gcc 4.8.5) |
結果 |
AC
|
実行時間 | 15 ms |
コード長 | 691 Byte |
コンパイル時間 | 573 ms |
使用メモリ | 3,016 KB |
最終ジャッジ日時 | 2019-02-11 01:41:30 |
テストケース
テストケース表示入力 | 結果 | 実行時間 使用メモリ |
---|---|---|
challenge01.txt | AC | 3 ms
3,012 KB |
challenge02.txt | AC | 3 ms
3,008 KB |
challenge03.txt | AC | 3 ms
3,008 KB |
sample1.txt | AC | 2 ms
3,008 KB |
sample2.txt | AC | 2 ms
3,012 KB |
sample3.txt | AC | 3 ms
3,012 KB |
sample4.txt | AC | 3 ms
3,012 KB |
test1.txt | AC | 3 ms
3,008 KB |
test2.txt | AC | 3 ms
3,012 KB |
test3.txt | AC | 2 ms
3,008 KB |
test4.txt | AC | 4 ms
3,008 KB |
test5.txt | AC | 5 ms
3,012 KB |
test6.txt | AC | 5 ms
3,008 KB |
test7.txt | AC | 4 ms
3,012 KB |
test8.txt | AC | 5 ms
3,012 KB |
test9.txt | AC | 6 ms
3,008 KB |
test10.txt | AC | 6 ms
3,012 KB |
test11.txt | AC | 7 ms
3,008 KB |
test12.txt | AC | 8 ms
3,012 KB |
test13.txt | AC | 8 ms
3,016 KB |
test14.txt | AC | 9 ms
3,008 KB |
test15.txt | AC | 10 ms
3,008 KB |
test16.txt | AC | 10 ms
3,008 KB |
test17.txt | AC | 11 ms
3,008 KB |
test18.txt | AC | 12 ms
3,008 KB |
test19.txt | AC | 13 ms
3,012 KB |
test20.txt | AC | 15 ms
3,012 KB |
test21.txt | AC | 4 ms
3,008 KB |
test22.txt | AC | 3 ms
3,008 KB |
test23.txt | AC | 3 ms
3,008 KB |
test24.txt | AC | 4 ms
3,012 KB |
test25.txt | AC | 7 ms
3,008 KB |
test26.txt | AC | 7 ms
3,012 KB |
test27.txt | AC | 9 ms
3,008 KB |
test28.txt | AC | 10 ms
3,008 KB |
test29.txt | AC | 13 ms
3,012 KB |
test30.txt | AC | 14 ms
3,016 KB |
ソースコード
#include <iostream> #include <vector> #include <cstdio> #include <sstream> #include <map> #include <string> #include <algorithm> #include <queue> #include <cmath> #include <set> using namespace std; const string x = "nyanpass"; int main(){ int n; cin >> n; vector<vector<string>> s(n, vector<string>(n)); for(int i=0; i<n; i++){ for(int j=0; j<n; j++){ cin >> s[i][j]; } } int cnt = 0; int num = -1; for(int i=0; i<n; i++){ bool ok = true; for(int j=0; j<n; j++){ if(i==j) continue; if(s[j][i] != x){ ok = false; break; } } if(ok){ num = i; cnt++; } } if(cnt == 1){ cout << num+1 << endl; }else{ cout << -1 << endl; } return 0; }