結果
問題 | No.239 にゃんぱすー |
ユーザー |
![]() |
提出日時 | 2019-06-05 07:12:34 |
言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
結果 |
AC
|
実行時間 | 6 ms / 2,000 ms |
コード長 | 495 bytes |
コンパイル時間 | 529 ms |
コンパイル使用メモリ | 65,268 KB |
実行使用メモリ | 5,376 KB |
最終ジャッジ日時 | 2024-09-19 13:02:51 |
合計ジャッジ時間 | 1,724 ms |
ジャッジサーバーID (参考情報) |
judge3 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 4 |
other | AC * 33 |
ソースコード
#include <iostream>#include <string>#include <vector>using namespace std;int main() {int n;cin >> n;vector<vector<string>> v(n, vector<string>(n));for (int i=0; i<n; i++) {for (int j=0; j<n; j++) {cin >> v[i][j];}}vector<int> ren;for (int i=0; i<n; i++) {int flg=0;for (int j=0; j<n; j++) {if (v[j][i]=="nyanpass") flg++;}if (flg==n-1) ren.push_back(i+1);}cout << (ren.size()==1 ? ren[0]: -1) << endl;return 0;}