結果
| 問題 |
No.1109 調の判定
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2020-08-02 03:35:22 |
| 言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 951 bytes |
| コンパイル時間 | 935 ms |
| コンパイル使用メモリ | 99,172 KB |
| 実行使用メモリ | 6,944 KB |
| 最終ジャッジ日時 | 2024-07-16 03:54:43 |
| 合計ジャッジ時間 | 2,205 ms |
|
ジャッジサーバーID (参考情報) |
judge1 / judge3 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 1 WA * 2 |
| other | AC * 15 WA * 28 |
ソースコード
#include <iostream>
#include <string>
#include <algorithm>
#include <vector>
#include <iomanip>
#include <cmath>
#include <stdio.h>
#include <queue>
#include <deque>
#include <cstdio>
#include <set>
#include <map>
#include <bitset>
#include <stack>
#include <cctype>
using namespace std;
int h[10] = { 0,2,4,5,7,9,11 };
int main() {
int n;
int t[20];
cin >> n;
for (int i = 0; i < n; i++) {
cin >> t[i];
}
int ans;
bool b = true, bo = false;
for (int i = 0; i < 12; i++) {
vector<int> vec;
for (int j = 0; j < 7; j++) {
vec.emplace_back((i + h[j]) % 12);
}
sort(vec.begin(), vec.end());
b = true;
for (int j = 0; j < n; j++) {
if (!binary_search(vec.begin(), vec.end(), t[j])) {
b = false;
}
}
if (b) {
if (bo) {
cout << "-1" << endl;
return 0;
}
else {
bo = true;
ans = i;
}
}
}
if (bo) {
cout << ans << endl;
}
else {
cout << "-1" << endl;
}
cout << endl;
return 0;
}