Submission #33509


Source Code Expand

Copy
/**
 *
 *  Time-stamp:<2012/07/21 20:20:45>
 **/

#include <vector>
#include <list>
#include <map>
#include <set>
#include <deque>
#include <stack>
#include <bitset>
#include <algorithm>
#include <functional>
#include <numeric>
#include <utility>
#include <sstream>
#include <queue>
#include <iostream>
#include <iomanip>
#include <cstdio>
#include <cmath>
#include <cstdlib>
#include <cctype>
#include <string>
#include <cstring>
#include <ctime>
#include <fstream>
 
using namespace std;
 
//conversion
//------------------------------------------
inline int toInt(string s) {int v; istringstream sin(s);sin>>v;return v;}
template<class T> inline string toString(T x) {ostringstream sout;sout<<x;return sout.str();}
 
//typedef
//------------------------------------------
typedef vector<int> VI;
typedef vector<VI> VVI;
typedef vector<string> VS;
typedef pair<int, int> PII;
typedef long long LL;
 
//container util
//------------------------------------------
#define ALL(a)  (a).begin(),(a).end()
#define RALL(a) (a).rbegin(), (a).rend()
#define PB push_back
#define MP make_pair
#define SZ(a) int((a).size())
#define EACH(i,c) for(typeof((c).begin()) i=(c).begin(); i!=(c).end(); ++i)
#define EXIST(s,e) ((s).find(e)!=(s).end())
#define SORT(c) sort((c).begin(),(c).end())
 
//repetition
//------------------------------------------
#define FOR(i,a,b) for(int i=(a);i<(b);++i)
#define REP(i,n)  FOR(i,0,n)

#define Debug cout << "LINE: " << __LINE__ << endl

#define NUM 6

int e[NUM];
int b;
int l[NUM];

int solve() {
  bool bo = false;
  int count = 0;
  
  REP(i, NUM) {
    REP(j, NUM) {
//      cout << l[i] << "  " << e[j] << endl;
      if(l[i]==e[j]) count++;
      if(l[i]==b) bo = true;
    }
  }

  if(count == 6) {
    return 1;
  } else if (count == 5) {
    if(bo) {
      return 2;
    } else {
      return 3;
    }        
  } else if (count == 4) {
    return 4;
  } else if (count == 3) {
    return 5;
  } else {
    return 0;
  }
}

int main()
{
  REP(i, NUM) {
    cin >> e[i];
  }
  cin  >> b;
  REP(i, NUM) {
    cin >> l[i];
  }
  
  cout << solve() << endl;

  return 0;
}

Submission Info

Submission Time
Task A - 宝くじ
User ytwtnb
Language C++ (G++ 4.6.4)
Score 100
Code Size 2219 Byte
Status AC
Exec Time 24 ms
Memory 824 KB

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 800 KB
00_1_02.txt AC 21 ms 824 KB
00_2_01.txt AC 21 ms 756 KB
00_2_02.txt AC 20 ms 784 KB
00_3_01.txt AC 20 ms 788 KB
00_3_02.txt AC 23 ms 780 KB
00_sample_01.txt AC 21 ms 788 KB
00_sample_02.txt AC 21 ms 764 KB
00_sample_03.txt AC 21 ms 788 KB
00_sample_04.txt AC 20 ms 756 KB
00_sample_05.txt AC 20 ms 816 KB
01_rand_00.txt AC 21 ms 764 KB
01_rand_01.txt AC 21 ms 796 KB
01_rand_02.txt AC 21 ms 792 KB
01_rand_03.txt AC 20 ms 788 KB
01_rand_04.txt AC 21 ms 792 KB
01_rand_05.txt AC 21 ms 784 KB
01_rand_06.txt AC 21 ms 744 KB
01_rand_07.txt AC 20 ms 788 KB
01_rand_08.txt AC 21 ms 788 KB
01_rand_09.txt AC 21 ms 788 KB
01_rand_10.txt AC 21 ms 792 KB
01_rand_11.txt AC 21 ms 756 KB
01_rand_12.txt AC 21 ms 784 KB
01_rand_13.txt AC 21 ms 792 KB
01_rand_14.txt AC 24 ms 784 KB
01_rand_15.txt AC 21 ms 792 KB
01_rand_16.txt AC 20 ms 788 KB
01_rand_17.txt AC 20 ms 788 KB
01_rand_18.txt AC 20 ms 784 KB
01_rand_19.txt AC 21 ms 796 KB
01_rand_20.txt AC 20 ms 792 KB
01_rand_21.txt AC 21 ms 752 KB
01_rand_22.txt AC 21 ms 796 KB
01_rand_23.txt AC 21 ms 792 KB
01_rand_24.txt AC 21 ms 784 KB
01_rand_25.txt AC 21 ms 784 KB
01_rand_26.txt AC 21 ms 788 KB
01_rand_27.txt AC 21 ms 796 KB
01_rand_28.txt AC 21 ms 788 KB
01_rand_29.txt AC 21 ms 796 KB
01_rand_30.txt AC 21 ms 792 KB
01_rand_31.txt AC 21 ms 788 KB
01_rand_32.txt AC 21 ms 792 KB
01_rand_33.txt AC 21 ms 780 KB
01_rand_34.txt AC 21 ms 792 KB
01_rand_35.txt AC 21 ms 740 KB
01_rand_36.txt AC 21 ms 760 KB
01_rand_37.txt AC 21 ms 764 KB
01_rand_38.txt AC 22 ms 788 KB
01_rand_39.txt AC 21 ms 800 KB