Submission #33195


Source Code Expand

Copy
#include <iostream>
#include <sstream>
#include <string>
#include <vector>
#include <stack>
#include <queue>
#include <set>
#include <map>
#include <algorithm>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <cctype>
#include <cmath>
#include <cassert>
using namespace std;

#define all(c) (c).begin(), (c).end()
#define iter(c) __typeof((c).begin())
#define cpresent(c, e) (find(all(c), (e)) != (c).end())
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define tr(c, i) for (iter(c) i = (c).begin(); i != (c).end(); ++i)
#define pb(e) push_back(e)
#define mp(a, b) make_pair(a, b)




int main() {
  for (;;) {
    vector<int> E(6);
    int B;
    rep (i, 6) if (!(cin >> E[i])) return 0;
    cin >> B;

    int c = 0, b = 0;
    rep (i, 6) {
      int l;
      scanf("%d", &l);
      if (cpresent(E, l)) ++c;
      else if (l == B) ++b;
    }

    if (c == 6) puts("1");
    else if (c == 5 && b == 1) puts("2");
    else if (3 <= c) printf("%d\n", 8 - c);
    else puts("0");
  }

  return 0;
}

Submission Info

Submission Time
Task A - 宝くじ
User iwiwi
Language C++ (G++ 4.6.4)
Score 100
Code Size 1072 Byte
Status AC
Exec Time 25 ms
Memory 816 KB

Compile Error

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

Judge Result

Set Name All
Score / Max Score 100 / 100
Status
AC × 51
Set Name Test Cases
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
Case Name Status Exec Time Memory
00_1_01.txt AC 21 ms 736 KB
00_1_02.txt AC 21 ms 740 KB
00_2_01.txt AC 20 ms 792 KB
00_2_02.txt AC 22 ms 788 KB
00_3_01.txt AC 22 ms 792 KB
00_3_02.txt AC 21 ms 816 KB
00_sample_01.txt AC 20 ms 792 KB
00_sample_02.txt AC 21 ms 792 KB
00_sample_03.txt AC 21 ms 724 KB
00_sample_04.txt AC 21 ms 784 KB
00_sample_05.txt AC 21 ms 784 KB
01_rand_00.txt AC 21 ms 764 KB
01_rand_01.txt AC 25 ms 684 KB
01_rand_02.txt AC 23 ms 740 KB
01_rand_03.txt AC 21 ms 784 KB
01_rand_04.txt AC 22 ms 792 KB
01_rand_05.txt AC 21 ms 792 KB
01_rand_06.txt AC 19 ms 792 KB
01_rand_07.txt AC 21 ms 788 KB
01_rand_08.txt AC 21 ms 788 KB
01_rand_09.txt AC 21 ms 796 KB
01_rand_10.txt AC 21 ms 788 KB
01_rand_11.txt AC 21 ms 784 KB
01_rand_12.txt AC 21 ms 816 KB
01_rand_13.txt AC 21 ms 780 KB
01_rand_14.txt AC 21 ms 788 KB
01_rand_15.txt AC 21 ms 792 KB
01_rand_16.txt AC 21 ms 788 KB
01_rand_17.txt AC 20 ms 792 KB
01_rand_18.txt AC 20 ms 788 KB
01_rand_19.txt AC 21 ms 788 KB
01_rand_20.txt AC 21 ms 768 KB
01_rand_21.txt AC 20 ms 812 KB
01_rand_22.txt AC 21 ms 784 KB
01_rand_23.txt AC 21 ms 788 KB
01_rand_24.txt AC 21 ms 784 KB
01_rand_25.txt AC 21 ms 792 KB
01_rand_26.txt AC 23 ms 768 KB
01_rand_27.txt AC 21 ms 792 KB
01_rand_28.txt AC 20 ms 788 KB
01_rand_29.txt AC 20 ms 812 KB
01_rand_30.txt AC 21 ms 760 KB
01_rand_31.txt AC 21 ms 788 KB
01_rand_32.txt AC 19 ms 780 KB
01_rand_33.txt AC 21 ms 792 KB
01_rand_34.txt AC 22 ms 792 KB
01_rand_35.txt AC 21 ms 788 KB
01_rand_36.txt AC 22 ms 792 KB
01_rand_37.txt AC 22 ms 788 KB
01_rand_38.txt AC 21 ms 760 KB
01_rand_39.txt AC 21 ms 736 KB