-
Notifications
You must be signed in to change notification settings - Fork 0
/
team7_1011.cpp
40 lines (38 loc) · 951 Bytes
/
team7_1011.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
/*************************************************************************
> File Name: text1.cpp
> Author: heheql
> Mail: 374655767@qq.com
> Created Time: 2017年08月15日 星期二 11时57分55秒
************************************************************************/
#include <iostream>
#include <algorithm>
#include <cmath>
using namespace std;
const int maxn = 1e8 + 10;
int a[maxn] = {0};
int main()
{
freopen("input.txt", "r", stdin);
ios::sync_with_stdio(false);
int T,maxx=0;
cin >> T;
int b[T];
for(int i = 0; i < T; i++){
cin >> b[i];
maxx = max(maxx,b[i]);
}
long sum = 0;
a[1] = 1;
int tt;
for(int i = 1; i <= maxx; i++) {
sum += a[i];
// if(i&1) tt = -1;
// else tt = 1;
a[sum] = (3 + pow(-1,i)) / 2;
a[sum + 1] = (3 - pow(-1,i)) / 2;
}
for(int i = 0; i < T; i++){
cout << a[b[i]] << endl;
}
return 0;
}