結果
問題 | No.239 にゃんぱすー |
ユーザー |
![]() |
提出日時 | 2017-09-18 11:26:07 |
言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 3 ms / 2,000 ms |
コード長 | 695 bytes |
コンパイル時間 | 589 ms |
コンパイル使用メモリ | 70,144 KB |
実行使用メモリ | 5,248 KB |
最終ジャッジ日時 | 2024-11-08 02:26:56 |
合計ジャッジ時間 | 1,659 ms |
ジャッジサーバーID (参考情報) |
judge1 / judge3 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 4 |
other | AC * 33 |
ソースコード
#include <iostream> #include <iomanip> typedef unsigned long long ul; typedef signed long long ll; int main(void) { std::cin.tie(0); std::ios::sync_with_stdio(false); std::cout << std::fixed << std::setprecision(2); int n; std::cin >> n; bool canbe[n]; std::fill(canbe, canbe+n, true); for (int i = 0; i < n; ++i) { for (int j = 0; j < n; ++j) { std::string s; std::cin >> s; if (i==j) continue; if (s != "nyanpass") canbe[j] = false; } } int ans = -1; for (int i = 0; i < n; ++i) { if (canbe[i]) { if (ans != -1) {std::cout << -1 << std::endl; return 0;} ans = i+1; } } std::cout << ans << std::endl; return 0; }