結果

問題 No.24 数当てゲーム
ユーザー goodbaton
提出日時 2015-07-29 19:29:08
言語 C++11
(gcc 13.3.0)
結果
AC  
実行時間 2 ms / 5,000 ms
コード長 1,140 bytes
コンパイル時間 962 ms
コンパイル使用メモリ 74,100 KB
実行使用メモリ 6,948 KB
最終ジャッジ日時 2024-07-17 22:10:55
合計ジャッジ時間 1,298 ms
ジャッジサーバーID
(参考情報)
judge2 / judge5
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 10
権限があれば一括ダウンロードができます
コンパイルメッセージ
main.cpp: In function ‘int main()’:
main.cpp:30:10: warning: ignoring return value of ‘int scanf(const char*, ...)’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
   30 |     scanf("%d",&n);
      |     ~~~~~^~~~~~~~~
main.cpp:35:14: warning: ignoring return value of ‘int scanf(const char*, ...)’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
   35 |         scanf("%d%d%d%d%s",&a[0],&a[1],&a[2],&a[3],r);
      |         ~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

ソースコード

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;
}
הההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההה
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
0