結果

問題 No.24 数当てゲーム
ユーザー y_mazun
提出日時 2015-04-24 21:32:04
言語 C++11
(gcc 13.3.0)
結果
AC  
実行時間 1 ms / 5,000 ms
コード長 470 bytes
コンパイル時間 210 ms
コンパイル使用メモリ 33,920 KB
実行使用メモリ 6,944 KB
最終ジャッジ日時 2024-07-05 01:19:21
合計ジャッジ時間 765 ms
ジャッジサーバーID
(参考情報)
judge4 / judge3
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 10
権限があれば一括ダウンロードができます
コンパイルメッセージ
main.cpp: In function ‘int main()’:
main.cpp:17:22: warning: ignoring return value of ‘int scanf(const char*, ...)’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
   17 |     char r[10]; scanf("%s", r);
      |                 ~~~~~^~~~~~~~~
main.cpp: In function ‘int getInt()’:
main.cpp:2:34: warning: ignoring return value of ‘int scanf(const char*, ...)’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
    2 | inline int getInt(){ int s; scanf("%d", &s); return s; }
      |                             ~~~~~^~~~~~~~~~

ソースコード

diff #
プレゼンテーションモードにする

#include <cstdio>
inline int getInt(){ int s; scanf("%d", &s); return s; }
#define REP(i,n) for(int i=0; i<(int)(n); i++)
#include <set>
using namespace std;
int main(){
int can[10]; REP(i,10) can[i] = 1;
const int n = getInt();
REP(i,n){
int a[10]; REP(i,10) a[i] = 0;
REP(i,4) a[getInt()] = 1;
char r[10]; scanf("%s", r);
REP(i,10)
can[i] &= r[0] == 'Y' ? a[i] : !a[i];
}
REP(i,10) if(can[i])
printf("%d\n", i);
return 0;
}
הההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההה
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
0