結果

問題 No.24 数当てゲーム
ユーザー goodbatongoodbaton
提出日時 2015-07-29 19:29:08
言語 C++11
(gcc 11.4.0)
結果
AC  
実行時間 2 ms / 5,000 ms
コード長 1,140 bytes
コンパイル時間 603 ms
コンパイル使用メモリ 74,068 KB
実行使用メモリ 4,380 KB
最終ジャッジ日時 2023-09-24 21:47:33
合計ジャッジ時間 1,396 ms
ジャッジサーバーID
(参考情報)
judge15 / judge12
このコードへのチャレンジ(β)

テストケース

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

ソースコード

diff #

#include <cstdio>
#include <cstdlib>
#include <iostream>
#include <string>
#include <cmath>
#include <algorithm>
#include <vector>
#include <queue>
#include <stack>
#include <map>
#include <set>
#include <cstring>

typedef long long ll;
using namespace std;

#define mod 1000003
#define INF 1000000000
#define LLINF 2000000000000000000LL

#define SIZE 10000

int mo[5] = {0,1,0,-1,0};

int main(){
    int n,a[4];
    char r[4];
    bool num[10];
    
    scanf("%d",&n);
    
    for(int i=0;i<10;i++) num[i]=true;
    
    for(int i=0;i<n;i++){
        scanf("%d%d%d%d%s",&a[0],&a[1],&a[2],&a[3],r);
        
        if(r[0]=='N'){
            for(int j=0;j<4;j++)
                num[a[j]]=false;
        }else{
            sort(a,a+4);
            int s=0;
            
            for(int j=0;j<4;j++){
                for(int k=s;k<a[j];k++)
                    num[k]=false;
                s=a[j]+1;
            }
            
            for(int j=s;j<=9;j++)
                num[j]=false;
        }
    }
    
    for(int i=0;i<=9;i++){
        if(num[i]==true){
            printf("%d\n",i);
        }
    }
    
    return 0;
}
0