-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy patha.cpp
More file actions
49 lines (46 loc) · 874 Bytes
/
Copy patha.cpp
File metadata and controls
49 lines (46 loc) · 874 Bytes
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
46
47
48
49
/*************************************************************************
> File Name: a.cpp
> Author: dulun
> Mail: dulun@xiyoulinux.org
> Created Time: 2016年04月22日 星期五 19时12分33秒
************************************************************************/
#include<iostream>
#include<stdio.h>
#include<cstring>
#include<cstdlib>
#include<algorithm>
#define LL long long
using namespace std;
const int N = 50086;
LL n;
char a[5900] = {0};
int main()
{
int T;
scanf("%d", &T);
while(T--)
{
memset(a, 0, sizeof(a));
int m;
LL n;
scanf("%d%lld", &m, &n);
int cnt = 0;
while(n)
{
a[cnt++] += n % 3;
n /= 3;
if(cnt >m) break;
}
for(int i = m-1; i >=0; i--)
{
if(a[i] == 0)
printf("R");
if(a[i] == 1)
printf("G");
if(a[i] == 2)
printf("B");
}
printf("\n");
}
return 0;
}