結果
問題 |
No.1109 調の判定
|
ユーザー |
|
提出日時 | 2020-12-21 21:02:11 |
言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 601 bytes |
コンパイル時間 | 1,538 ms |
コンパイル使用メモリ | 169,808 KB |
実行使用メモリ | 6,944 KB |
最終ジャッジ日時 | 2024-09-21 13:05:20 |
合計ジャッジ時間 | 2,913 ms |
ジャッジサーバーID (参考情報) |
judge3 / judge1 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 1 WA * 2 |
other | AC * 26 WA * 17 |
ソースコード
#include <bits/stdc++.h> using namespace std; int main() { int64_t n; cin >> n; vector<int64_t> t(n), ans; for (int64_t i = 0; i < n; i++) cin >> t[i]; int64_t d[7] = {0, 2, 4, 5, 7, 9, 11}; for (int64_t i = 0; i < 12; i++) { bool flag = true; for (int64_t j = 0; j < n; j++) { bool check = false; for (int64_t k = 0; k < 7; k++) if (t[j] % 12 == (i + d[k] % 12)) check = true; if (!check) { flag = false; break; } } if (flag) ans.push_back(i); } if (ans.size() == 1) cout << ans[0] << '\n'; else cout << "-1\n"; return 0; }