Contest Duration: - (local time) (90 minutes) Back to Home

Submission #33731

Source Code Expand

Copy
```#include <iostream>
#include <vector>
#include <list>
#include <stack>
#include <queue>
#include <deque>
#include <map>
#include <set>
#include <algorithm>
#include <functional>
#include <complex>

#include <cstdio>
#include <cmath>
#include <cstdlib>
#include <climits>
#include <cfloat>
#include <ctime>

using namespace std;

#define DBG(fmt, ...) fprintf(stderr, fmt, __VA_ARGS__);
#define DUMP(val) cerr << #val << " : " << (val) << endl

#define REP(a,b) for(a = 0; a < b; a++)
#define FOR(a,b,c) for(a = b; a < c; a++)
#define FOREACH(it, c) for (__typeof__((c).begin()) it=(c).begin(); it != (c).end(); ++it)

#define PUSH(e) push_back(e)
#define POP(e) pop_back(e)
#define MP(a,b) make_pair(a,b)
#define ALL(a) (a).begin(),(a).end()
#define RALL(a) (a).rbegin(),(a).rend()
#define SORT(a) sort((a).begin(),(b).end())
#define FILL(a,b) fill((a).begin(),(a).end(),b)

typedef pair<int,int> point;
#define F first
#define S second

int main() {

uint8_t number[6];
uint8_t bonus;
uint8_t mynumber[6];

int i = 0;
int j = 0;
int ret = 0;

REP(i, 6) {
scanf("%c ", &number[i]);
number[i] -= '0';
}
scanf("%c ", &bonus);
bonus -= '0';
REP(i, 6) {
scanf("%c ", &mynumber[i]);
mynumber[i] -= '0';

}
/*
REP(i, 6) {
printf("%c", number[i]+'0');
}
printf("\n%c\n", bonus+'0');
REP(i, 6) {
printf("%c", mynumber[i]+'0');
}*/

int count = 0;
REP(i, 6) {
REP(j,6) {
if(mynumber[i] == number[j]) {
count++;
}
}
}
switch(count) {
case 3:
ret = 5;
break;
case 4:
ret = 4;
break;
case 5:
REP(i, 6) {
if(mynumber[i] == bonus) {
ret = 2;
}
}
if(!ret) ret = 3;
break;
case 6:
ret = 1;
break;
default:
ret = 0;
};

printf("%d\n", ret);

return 0;
}
```

#### Submission Info

Submission Time 2012-07-21 20:36:13+0900 A - 宝くじ stoikheia C++ (G++ 4.6.4) 0 2176 Byte CE

#### Compile Error

```./Main.cpp: In function ‘int main()’:
./Main.cpp:47:5: error: ‘uint8_t’ was not declared in this scope
./Main.cpp:47:13: error: expected ‘;’ before ‘number’
./Main.cpp:48:13: error: expected ‘;’ before ‘bonus’
./Main.cpp:49:13: error: expected ‘;’ before ‘mynumber’
./Main.cpp:56:23: error: ‘number’ was not declared in this scope
./Main.cpp:59:19: error: ‘bonus’ was not declared in this scope
./Main.cpp:62:23: error: ‘mynumber’ was not declared in this scope
./Main.cpp:78:16: error: ‘mynumber’ was not declared in this scope
./Main.cpp:78:31: error: ‘number’ was not declared in this scope
./Main.cpp:92:20: error: ‘mynumber’ was not declared in this scope
```