結果
問題 |
No.1109 調の判定
|
ユーザー |
![]() |
提出日時 | 2020-07-10 21:25:09 |
言語 | C++17 (gcc 13.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 2 ms / 2,000 ms |
コード長 | 558 bytes |
コンパイル時間 | 1,926 ms |
コンパイル使用メモリ | 196,444 KB |
最終ジャッジ日時 | 2025-01-11 17:46:03 |
ジャッジサーバーID (参考情報) |
judge1 / judge4 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 43 |
ソースコード
#include <bits/stdc++.h> using namespace std; #define modulo 1000000007 #define mod(mod_x) ((((long long)mod_x+modulo))%modulo) #define Inf 1000000000 int main(){ int N; cin>>N; vector<int> T(N); for(int i=0;i<N;i++)cin>>T[i]; vector<int> ans; vector<int> t = {0,2,4,5,7,9,11}; for(int i=0;i<12;i++){ bool f = true; for(int j=0;j<T.size();j++){ if(!binary_search(t.begin(),t.end(),(T[j]-i+12)%12)){ f=false; break; } } if(f)ans.push_back(i); } if(ans.size()!=1)cout<<-1<<endl; else cout<<ans[0]<<endl; return 0; }