結果
| 問題 |
No.1109 調の判定
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2020-07-11 08:43:39 |
| 言語 | C++17 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 790 bytes |
| コンパイル時間 | 985 ms |
| コンパイル使用メモリ | 111,040 KB |
| 最終ジャッジ日時 | 2025-01-11 19:31:43 |
|
ジャッジサーバーID (参考情報) |
judge3 / judge2 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | WA * 3 |
| other | WA * 43 |
コンパイルメッセージ
main.cpp: In function ‘int main()’:
main.cpp:34:29: warning: format ‘%d’ expects argument of type ‘int’, but argument 2 has type ‘std::vector<int>’ [-Wformat=]
34 | if(v.size()==1)printf("%d\n",v );
| ~^
| |
| int
ソースコード
#include <iostream>
#include <vector>
#include <algorithm>
#include <map>
#include <queue>
#include <cstdio>
#include <ctime>
#include <assert.h>
#include <chrono>
#include <random>
#include <numeric>
#include <set>
using namespace std;
typedef long long int ll;
using ull = unsigned long long;
int main(){
cin.tie(nullptr);
ios::sync_with_stdio(false);
int n; cin >> n;
vector<int> t(n);
for(int i=0;i<n;i++){
cin >> t[i];
}
vector<int> v;
for(int i=0;i<=11;i++){
bool ok=1;
for(int j=0;j<n;j++){
if(t[j]==i||t[j]==(i+2)%12||t[j]==(i+4)%12||t[j]==(i+5)%12||t[j]==(i+7)%12||t[j]==(i+9)%12||t[j]==(i+11)%12);
else ok=0;
}
if(ok)v.push_back(i);
}
if(v.size()==1)printf("%d\n",v );
}