Submission #33268


Source Code Expand

Copy
#include <cstdio>
#include <cstdlib>
#include <cmath>
#include <climits>
#include <cfloat>
#include <map>
#include <utility>
#include <set>
#include <iostream>
#include <memory>
#include <string>
#include <vector>
#include <list>
#include <deque>
#include <algorithm>
#include <functional>
#include <sstream>
#include <complex>
#include <stack>
#include <bitset>
#include <queue>
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)

//constant
const double EPS = 1e-10;
const int MAXI = 1234567890;

//debug
#define dump(x)  cerr << #x << " = " << (x) << endl;
#define debug(x) cerr << #x << " = " << (x) << " (L" << __LINE__ << ")" << " " << __FILE__ << endl;



void printList(vector<int>& v) {
  for (size_t i = 0; i < v.size(); i++) {
	cout << v[i] << " ";
  }
  cout << endl;
}

void printMatrix(vector< vector<int> >& v) {
  for (size_t i = 0; i < v.size(); i++) {
	printList(v[i]);
  }
  cout << endl;
}



int main() {
  VI es(6, 0);
  VI ls(6, 0);
  int b;
  for (int i = 0; i < 6; i++) {
    cin >> es[i];
  }
  cin >> b;

  for (int i = 0; i < 6; i++) {
    cin >> ls[i];
  }
  int sum = 0;
  bool bonus = false;
  for (int i = 0; i < 6; i++) {
    for (int j = 0; j < 6; j++) {
      if (es[i] != ls[j]) continue;
      sum++;
    }
  }

  for (int i = 0; i < 6; i++) {
    if (ls[i] == b) bonus = true;
  }

  if (sum < 3) cout << 0 << endl;
  else if (sum == 3) cout << 5 << endl;
  else if (sum == 4) cout << 4 << endl;
  else if (sum == 5 && !bonus) cout << 3 << endl;
  else if (sum == 5 && bonus) cout << 2 << endl;
  else if (sum == 6) cout << 1 << endl;
  return 0;
}

Submission Info

Submission Time
Task A - 宝くじ
User ganatcs
Language C (GCC 4.4.7)
Score 0
Code Size 2221 Byte
Status CE

Compile Error

./Main.c:1: fatal error: cstdio: No such file or directory
compilation terminated.