結果

問題 No.24 数当てゲーム
ユーザー Eclair1015Eclair1015
提出日時 2018-09-03 00:46:51
言語 C++11
(gcc 11.4.0)
結果
WA  
実行時間 -
コード長 926 bytes
コンパイル時間 564 ms
コンパイル使用メモリ 68,992 KB
実行使用メモリ 6,944 KB
最終ジャッジ日時 2024-04-15 01:29:16
合計ジャッジ時間 1,042 ms
ジャッジサーバーID
(参考情報)
judge5 / judge4
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 1 ms
6,816 KB
testcase_01 AC 1 ms
6,940 KB
testcase_02 WA -
testcase_03 WA -
testcase_04 WA -
testcase_05 WA -
testcase_06 WA -
testcase_07 AC 1 ms
6,940 KB
testcase_08 WA -
testcase_09 WA -
権限があれば一括ダウンロードができます

ソースコード

diff #

//inlclude前用define 
#define _USE_MATH_DEFINES

//include
#include<iostream>
#include<string>
#include<algorithm>
#include<vector>
#include<cmath>

using namespace std;
//typedef
typedef vector<int> VI;
typedef vector<string> VS;
typedef vector<char> VC;

int main() {
	int num;
	VI y(10), n(10);
	cin >> num;
	VI a(num), b(num), c(num), d(num);
	int cnt=0,memo;
	VS r(num);
	for (int i = 0; i < num; i++) {
		cin >> a[i] >> b[i] >> c[i] >> d[i] >> r[i];
	}
	for (int i = 0; i < num; i++) {
		
		cnt = 0;
		memo = 0;
		if (r[i] == "NO") {
			n[a[i]]++; 
			n[b[i]]++;
			n[c[i]]++; 
			n[d[i]]++;
			for (int j = 0; j < 10; j++) {
				if (n[j] == 0) {
					cnt++;
					memo = j;
				}
			}
			if (cnt == 1) cout << memo << endl;
		} else if(r[i]=="YES"){
			y[a[i]]++; 
			y[b[i]]++;
			y[c[i]]++; 
			y[d[i]]++;
			for (int j = 0; j < 10; j++) {
				if (y[j] >= 2) {
					cout << j << endl;
				}
			}
		}
	}
	return 0;
}
0