提出 #33257


ソースコード 拡げる

#include <cstdio>
#include <algorithm>
#include <vector>
#include <cstring>
using namespace std;

#define REP(i, n) for(int i = 0; i < (int)(n); i++)
#define REPN(i, a, b) for(int i = (int)(a); i < (int)(b); i++)
#define ALL(c) (c).begin(), (c).end()
#define FOR(i, c) for(__typeof((c).begin()) i = (c).begin(); i != (c).end(); i++)

int main() {

  vector<int> E(6), L(6);
  int B;

  REP(i, 6) scanf("%d", &E[i]);
  scanf("%d", &B);
  REP(i, 6) scanf("%d", &L[i]);

  int match_count = 0;
  REP(i, 6) REP(j, 6) {
    if(L[i] == E[j]) {
      match_count++;
      break;
    }
  }

  bool bonus = false;
  if(match_count == 5) {
    REP(i, 6) {
      if(B == L[i]) bonus = true;
    }
  }

  if(match_count == 6) {
    printf("1\n");
  } else if(match_count == 5 && bonus) {
    printf("2\n");
  } else if(match_count >= 3) {
    printf("%d\n", 8 - match_count);
  } else {
    printf("0\n");
  }

  return 0;
}

提出情報

提出日時
問題 A - 宝くじ
ユーザ miya
言語 C++ (G++ 4.6.4)
得点 100
コード長 960 Byte
結果 AC
実行時間 22 ms
メモリ 828 KiB

コンパイルエラー

./Main.cpp: In function ‘int main()’:
./Main.cpp:17:31: warning: ignoring return value of ‘int scanf(const char*, ...)’, declared with attribute warn_unused_result [-Wunused-result]
./Main.cpp:18:18: warning: ignoring return value of ‘int scanf(const char*, ...)’, declared with attribute warn_unused_result [-Wunused-result]
./Main.cpp:19:31: warning: ignoring return value of ‘int scanf(const char*, ...)’, declared with attribute warn_unused_result [-Wunused-result]

ジャッジ結果

セット名 All
得点 / 配点 100 / 100
結果
AC × 51
セット名 テストケース
All 00_1_01.txt, 00_1_02.txt, 00_2_01.txt, 00_2_02.txt, 00_3_01.txt, 00_3_02.txt, 00_sample_01.txt, 00_sample_02.txt, 00_sample_03.txt, 00_sample_04.txt, 00_sample_05.txt, 01_rand_00.txt, 01_rand_01.txt, 01_rand_02.txt, 01_rand_03.txt, 01_rand_04.txt, 01_rand_05.txt, 01_rand_06.txt, 01_rand_07.txt, 01_rand_08.txt, 01_rand_09.txt, 01_rand_10.txt, 01_rand_11.txt, 01_rand_12.txt, 01_rand_13.txt, 01_rand_14.txt, 01_rand_15.txt, 01_rand_16.txt, 01_rand_17.txt, 01_rand_18.txt, 01_rand_19.txt, 01_rand_20.txt, 01_rand_21.txt, 01_rand_22.txt, 01_rand_23.txt, 01_rand_24.txt, 01_rand_25.txt, 01_rand_26.txt, 01_rand_27.txt, 01_rand_28.txt, 01_rand_29.txt, 01_rand_30.txt, 01_rand_31.txt, 01_rand_32.txt, 01_rand_33.txt, 01_rand_34.txt, 01_rand_35.txt, 01_rand_36.txt, 01_rand_37.txt, 01_rand_38.txt, 01_rand_39.txt
ケース名 結果 実行時間 メモリ
00_1_01.txt AC 21 ms 792 KiB
00_1_02.txt AC 20 ms 792 KiB
00_2_01.txt AC 21 ms 784 KiB
00_2_02.txt AC 21 ms 796 KiB
00_3_01.txt AC 20 ms 816 KiB
00_3_02.txt AC 21 ms 760 KiB
00_sample_01.txt AC 21 ms 788 KiB
00_sample_02.txt AC 21 ms 784 KiB
00_sample_03.txt AC 21 ms 792 KiB
00_sample_04.txt AC 22 ms 768 KiB
00_sample_05.txt AC 22 ms 756 KiB
01_rand_00.txt AC 20 ms 764 KiB
01_rand_01.txt AC 20 ms 788 KiB
01_rand_02.txt AC 20 ms 752 KiB
01_rand_03.txt AC 21 ms 736 KiB
01_rand_04.txt AC 21 ms 760 KiB
01_rand_05.txt AC 21 ms 788 KiB
01_rand_06.txt AC 21 ms 788 KiB
01_rand_07.txt AC 20 ms 760 KiB
01_rand_08.txt AC 20 ms 788 KiB
01_rand_09.txt AC 20 ms 796 KiB
01_rand_10.txt AC 21 ms 784 KiB
01_rand_11.txt AC 21 ms 796 KiB
01_rand_12.txt AC 21 ms 816 KiB
01_rand_13.txt AC 21 ms 796 KiB
01_rand_14.txt AC 20 ms 792 KiB
01_rand_15.txt AC 22 ms 780 KiB
01_rand_16.txt AC 21 ms 828 KiB
01_rand_17.txt AC 21 ms 764 KiB
01_rand_18.txt AC 21 ms 788 KiB
01_rand_19.txt AC 21 ms 764 KiB
01_rand_20.txt AC 21 ms 788 KiB
01_rand_21.txt AC 21 ms 816 KiB
01_rand_22.txt AC 21 ms 788 KiB
01_rand_23.txt AC 20 ms 788 KiB
01_rand_24.txt AC 21 ms 796 KiB
01_rand_25.txt AC 21 ms 788 KiB
01_rand_26.txt AC 20 ms 788 KiB
01_rand_27.txt AC 20 ms 792 KiB
01_rand_28.txt AC 20 ms 756 KiB
01_rand_29.txt AC 21 ms 792 KiB
01_rand_30.txt AC 21 ms 792 KiB
01_rand_31.txt AC 21 ms 788 KiB
01_rand_32.txt AC 21 ms 792 KiB
01_rand_33.txt AC 20 ms 784 KiB
01_rand_34.txt AC 19 ms 784 KiB
01_rand_35.txt AC 21 ms 792 KiB
01_rand_36.txt AC 20 ms 792 KiB
01_rand_37.txt AC 21 ms 828 KiB
01_rand_38.txt AC 21 ms 796 KiB
01_rand_39.txt AC 21 ms 784 KiB