結果

問題 No.24 数当てゲーム
ユーザー hachidesyuhachidesyu
提出日時 2020-07-03 12:45:03
言語 C++14
(gcc 12.3.0 + boost 1.83.0)
結果
RE  
実行時間 -
コード長 537 bytes
コンパイル時間 1,457 ms
コンパイル使用メモリ 165,792 KB
実行使用メモリ 4,352 KB
最終ジャッジ日時 2023-10-14 22:45:32
合計ジャッジ時間 3,951 ms
ジャッジサーバーID
(参考情報)
judge12 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 RE -
testcase_01 RE -
testcase_02 RE -
testcase_03 RE -
testcase_04 RE -
testcase_05 RE -
testcase_06 RE -
testcase_07 RE -
testcase_08 RE -
testcase_09 RE -
権限があれば一括ダウンロードができます
コンパイルメッセージ
main.cpp: 関数 ‘int main()’ 内:
main.cpp:7:16: 警告: iteration 9 invokes undefined behavior [-Waggressive-loop-optimizations]
    7 |         ans[i] = 1;
      |         ~~~~~~~^~~
main.cpp:6:22: 備考: within this loop
    6 |     for(int i = 0; i < 10; i++){
      |                    ~~^~~~

ソースコード

diff #

#include <bits/stdc++.h>
using namespace std;

int main(){
    int ans[9];
    for(int i = 0; i < 10; i++){
        ans[i] = 1;
    }

    int N;
    cin >> N;

    int taro[6][4];
    string res[6];

    for(int i = 0; i < N; i++){
        cin >> taro[i][0] >> taro[i][1] >> taro[i][2] >> taro[i][3] >> res[i];
    }

    for(int i = 0; i < N; i++){
        if(res[i]=="NO"){
            for(int j = 0; j < 4; j++) ans[taro[i][j]] = 0;
        }
    }

    for(int i = 0; i < 10; i++){
        if(ans[i] != 0) cout << i << endl;
    }
}
0