結果
| 問題 | No.24 数当てゲーム |
| コンテスト | |
| ユーザー |
xryuseix
|
| 提出日時 | 2019-03-18 18:33:44 |
| 言語 | C++11 (gcc 15.2.0 + boost 1.89.0) |
| 結果 |
AC
|
| 実行時間 | 1 ms / 5,000 ms |
| コード長 | 1,157 bytes |
| 記録 | |
| コンパイル時間 | 544 ms |
| コンパイル使用メモリ | 101,084 KB |
| 実行使用メモリ | 109,056 KB |
| 最終ジャッジ日時 | 2026-04-02 06:41:39 |
| 合計ジャッジ時間 | 1,035 ms |
|
ジャッジサーバーID (参考情報) |
judge3_1 / judge1_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 10 |
コンパイルメッセージ
main.cpp: In function 'int main()':
main.cpp:57:15: warning: 'maxi' may be used uninitialized [-Wmaybe-uninitialized]
57 | cout<<maxi<<endl;
| ^~~~
main.cpp:50:24: note: 'maxi' was declared here
50 | int max=-10000,maxi;
| ^~~~
ソースコード
#include<iostream>
#include<cstdio>
#include<algorithm>
#include<cmath>
#include<string>
#include<vector>
#include<list>
#include<set>
#include<map>
#include<queue>
#include<stack>
#include<cctype>
#include<climits>
#define ld long double
#define ll long long int
#define ull unsigned long long int
#define rep(i,n) for(i=0;i<n;i++)
#define fin(ans) cout<<(ans)<<endl
#define INF INT_MAX;
using namespace std;
template<class T> inline bool chmax(T& a,T b){if(a<b){a=b;return 1;}return 0;}
template<class T> inline bool chmin(T& a,T b){if(a>b){a=b;return 1;}return 0;}
const long long LLINF=1LL<<60;
//set<int>::iterator it;
int main(void){ios::sync_with_stdio(false);cin.tie(0);
//////////////////////////////////////////////////////
int num[10]={0},i,n,a,b,c,d;
cin>>n;
string s;
for(i=0;i<n;i++){
cin>>a>>b>>c>>d;
cin>>s;
if(s=="YES"){
num[a]++;
num[b]++;
num[c]++;
num[d]++;
}
else{
num[a]--;
num[b]--;
num[c]--;
num[d]--;
}
}
int max=-10000,maxi;
for(i=0;i<10;i++){
if(num[i]>max){
maxi=i;
max=num[i];
}
}
cout<<maxi<<endl;
//////////////////////////////////////////////////////
return 0;
}
xryuseix