-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathaoj0228.cpp
45 lines (42 loc) · 1004 Bytes
/
aoj0228.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
#include <iostream>
#include <stdio.h>
#include <sstream>
#include <string>
#include <vector>
#include <map>
#include <queue>
#include <algorithm>
#include <set>
#include <math.h>
#include <utility>
#include <stack>
#include <string.h>
#include <complex>
using namespace std;
const int INF = 1<<29;
const double EPS = 1e-8;
typedef vector<int> vec;
typedef pair<int,int> P;
struct edge{int to,cost;};
int main(){
string str[10] = {"0111111","0000110","1011011","1001111","1100110","1101101","1111101","0100111","1111111","1101111"};
while(1){
int n;
scanf("%d",&n);
if(n==-1)break;
string cur = "0000000";
for(int i=0;i<n;i++){
int next;
scanf("%d",&next);
string ans = "0000000";
for(int i=0;i<8;i++){
if(cur[i]!=str[next][i]){
ans[i] = '1';
}
}
cout << ans << endl;
cur = str[next];
}
}
return 0;
}