結果
問題 | No.239 にゃんぱすー |
ユーザー |
![]() |
提出日時 | 2016-05-05 04:50:49 |
言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
結果 |
AC
|
実行時間 | 7 ms / 2,000 ms |
コード長 | 772 bytes |
コンパイル時間 | 857 ms |
コンパイル使用メモリ | 65,680 KB |
実行使用メモリ | 6,824 KB |
最終ジャッジ日時 | 2024-10-05 09:26:23 |
合計ジャッジ時間 | 2,001 ms |
ジャッジサーバーID (参考情報) |
judge1 / judge5 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 4 |
other | AC * 33 |
ソースコード
#include <iostream>#include<vector>using namespace std;int main() {int n;cin >> n;vector< vector<string> > greet_table;for (int i = 0; i < n; i++) {vector<string> greet_row;for (int j = 0; j < n; j++) {string str;cin >> str;greet_row.push_back(str);}greet_table.push_back(greet_row);}int renge = -1;for (int i = 0; i < n; i++) {bool flag = false;for (int j = 0; j < n; j++) {if (i == j) {continue;}if (greet_table[j][i] != "nyanpass") {flag = true;break;}}if (flag) {continue;}if (renge == -1) {renge = i + 1;} else {renge = -1;break;}}cout << renge << endl;return 0;}