CSES - Datatähti Open 2019 - Results
Submission details
Task:Sum
Sender:pwild
Submission time:2019-01-20 02:10:30 +0200
Language:C++
Status:READY
Result:0
Feedback
groupverdictscore
#10
Test results
testverdicttime
#1ACCEPTED0.02 sdetails
#20.01 sdetails
#30.01 sdetails
#40.02 sdetails
#50.03 sdetails
#60.01 sdetails
#70.02 sdetails
#80.02 sdetails
#90.02 sdetails
#100.01 sdetails
#110.02 sdetails
#120.01 sdetails
#130.01 sdetails
#140.02 sdetails
#150.02 sdetails
#160.02 sdetails
#170.01 sdetails
#180.02 sdetails
#190.03 sdetails
#200.02 sdetails
#210.01 sdetails
#220.01 sdetails
#230.02 sdetails
#240.02 sdetails
#250.01 sdetails
#260.02 sdetails
#270.01 sdetails
#280.02 sdetails

Code

#include <bits/stdc++.h>
using namespace std;

typedef long long ll;
typedef vector<ll> vl;
typedef vector<vl> vvl;
typedef pair<ll,ll> pll;
typedef vector<bool> vb;
const ll oo = 0x3f3f3f3f3f3f3f3f;
const double eps = 1e-9;
#define sz(c) ll((c).size())
#define all(c) begin(c), end(c)
#define FOR(i,a,b) for (ll i = (a); i < (b); i++)
#define FORD(i,a,b) for (ll i = (b)-1; i >= (a); i--)
#define mp make_pair
#define mt make_tuple
#define pb push_back
#define eb emplace_back
#define xx first
#define yy second
#define has(c,i) ((c).find(i) != end(c))
#define TR(X) ({ if(1) cerr << "TR: " << (#X) << " = " << (X) << endl; })

vector<pair<string,string>> res2 = {
{"Z0","Z"},
{"Z1","Z"},
{"0Z","Z"},
{"1Z","Z"},
{"0M","M0"},
{"1M","M1"},
{"0N","N0"},
{"1N","N1"},
{"0BM","B"},
{"1BN","B"},
{"BM","Z"},
{"BN","Z"},
{"H0","0H"},
{"H1","1H"},
{"HE","C"},
{"D","BH"},
{"C00","00E"},
{"C01","01E"},
{"C10","10E"},
{"C11","11E"},
{"C0","Z"},
{"C1","Z"},
{"0C","MC"},
{"1C","NC"},
{"BC","_"},
{"B0","0D"},
{"B1","1D"},
{"1A","A1"},
{"A","BC"},
{"0","A0"},
{"11","_"}};

vector<pair<string,string>> res3 = {
{"Z0","Z"},
{"Z1","Z"},
{"0Z","Z"},
{"1Z","Z"},
{"0X","X0"},
{"1X","X1"},
{"0Y","Y0"},
{"1Y","Y1"},
{"0AX","A"},
{"1AY","A"},
{"AX","Z"},
{"AY","Z"},
{"0BX","XB"},
{"1BY","YB"},
{"BX","Z"},
{"BY","Z"},
{"Q0","0Q"},
{"Q1","1Q"},
{"QH","C"},
{"QG","BQ"},
{"F","AQ"},
{"C000","000H"},
{"C001","001H"},
{"C010","010H"},
{"C011","011H"},
{"C100","100H"},
{"C101","101H"},
{"C110","110H"},
{"C111","111H"},
{"C0","Z"},
{"C1","Z"},
{"0C","XC"},
{"1C","YC"},
{"B00","00G"},
{"B01","01G"},
{"B10","10G"},
{"B11","11G"},
{"ABC","_"},
{"A0","0F"},
{"A1","1F"},
{"1W","W1"},
{"W","ABC"},
{"0","W0"},
{"111","_"}};
vector<pair<string,string>> res4 = {
{"Z0","Z"},
{"Z1","Z"},
{"0Z","Z"},
{"1Z","Z"},
{"0X","X0"},
{"1X","X1"},
{"0Y","Y0"},
{"1Y","Y1"},
{"0AX","A"},
{"1AY","A"},
{"AX","Z"},
{"AY","Z"},
{"0BX","XB"},
{"1BY","YB"},
{"BX","Z"},
{"BY","Z"},
{"0CX","XC"},
{"1CY","YC"},
{"CX","Z"},
{"CY","Z"},
{"Q0","0Q"},
{"Q1","1Q"},
{"QI","D"},
{"QH","CQ"},
{"QG","BQ"},
{"F","AQ"},
{"D0000","0000I"},
{"D0001","0001I"},
{"D0010","0010I"},
{"D0011","0011I"},
{"D0100","0100I"},
{"D0101","0101I"},
{"D0110","0110I"},
{"D0111","0111I"},
{"D1000","1000I"},
{"D1001","1001I"},
{"D1010","1010I"},
{"D1011","1011I"},
{"D1100","1100I"},
{"D1101","1101I"},
{"D1110","1110I"},
{"D1111","1111I"},
{"D0","Z"},
{"D1","Z"},
{"0D","XD"},
{"1D","YD"},
{"C000","000H"},
{"C001","001H"},
{"C010","010H"},
{"C011","011H"},
{"C100","100H"},
{"C101","101H"},
{"C110","110H"},
{"C111","111H"},
{"B00","00G"},
{"B01","01G"},
{"B10","10G"},
{"B11","11G"},
{"ABCD","_"},
{"A0","0F"},
{"A1","1F"},
{"1W","W1"},
{"W","ABCD"},
{"0","W0"},
{"1111","_"}};

vector<pair<string,string>> res5 = {
{"Z0","Z"},
{"Z1","Z"},
{"0Z","Z"},
{"1Z","Z"},
{"0X","X0"},
{"1X","X1"},
{"0Y","Y0"},
{"1Y","Y1"},
{"0AX","A"},
{"1AY","A"},
{"AX","Z"},
{"AY","Z"},
{"0BX","XB"},
{"1BY","YB"},
{"BX","Z"},
{"BY","Z"},
{"0CX","XC"},
{"1CY","YC"},
{"CX","Z"},
{"CY","Z"},
{"0DX","XD"},
{"1DY","YD"},
{"DX","Z"},
{"DY","Z"},
{"Q0","0Q"},
{"Q1","1Q"},
{"QJ","E"},
{"QI","DQ"},
{"QH","CQ"},
{"QG","BQ"},
{"F","AQ"},
{"E00000","00000J"},
{"E00001","00001J"},
{"E00010","00010J"},
{"E00011","00011J"},
{"E00100","00100J"},
{"E00101","00101J"},
{"E00110","00110J"},
{"E00111","00111J"},
{"E01000","01000J"},
{"E01001","01001J"},
{"E01010","01010J"},
{"E01011","01011J"},
{"E01100","01100J"},
{"E01101","01101J"},
{"E01110","01110J"},
{"E01111","01111J"},
{"E10000","10000J"},
{"E10001","10001J"},
{"E10010","10010J"},
{"E10011","10011J"},
{"E10100","10100J"},
{"E10101","10101J"},
{"E10110","10110J"},
{"E10111","10111J"},
{"E11000","11000J"},
{"E11001","11001J"},
{"E11010","11010J"},
{"E11011","11011J"},
{"E11100","11100J"},
{"E11101","11101J"},
{"E11110","11110J"},
{"E11111","11111J"},
{"E0","Z"},
{"E1","Z"},
{"0E","XE"},
{"1E","YE"},
{"D0000","0000I"},
{"D0001","0001I"},
{"D0010","0010I"},
{"D0011","0011I"},
{"D0100","0100I"},
{"D0101","0101I"},
{"D0110","0110I"},
{"D0111","0111I"},
{"D1000","1000I"},
{"D1001","1001I"},
{"D1010","1010I"},
{"D1011","1011I"},
{"D1100","1100I"},
{"D1101","1101I"},
{"D1110","1110I"},
{"D1111","1111I"},
{"C000","000H"},
{"C001","001H"},
{"C010","010H"},
{"C011","011H"},
{"C100","100H"},
{"C101","101H"},
{"C110","110H"},
{"C111","111H"},
{"B00","00G"},
{"B01","01G"},
{"B10","10G"},
{"B11","11G"},
{"ABCDE","_"},
{"A0","0F"},
{"A1","1F"},
{"1W","W1"},
{"W","ABCDE"},
{"0","W0"},
{"11111","_"}};

int main() {
	ios_base::sync_with_stdio(false);
	cin.tie(NULL);
	
	ll n; cin >> n;
	
	vector<pair<string,string>> res;

	if (n == 2) res = res2;
	if (n == 3) res = res3;
	if (n == 4) res = res4;
	if (n == 5) res = res5;
	
	cout << sz(res) << endl;
	for (auto p: res) cout << p.xx << " -> " << p.yy << endl;
}

Test details

Test 1

Verdict: ACCEPTED

input
1

correct output
0

user output
0

Test 2

Verdict:

input
2

correct output
0

user output
31
Z0 -> Z
Z1 -> Z
0Z -> Z
1Z -> Z
...
Truncated

Test 3

Verdict:

input
3

correct output
0

user output
44
Z0 -> Z
Z1 -> Z
0Z -> Z
1Z -> Z
...
Truncated

Test 4

Verdict:

input
4

correct output
0

user output
65
Z0 -> Z
Z1 -> Z
0Z -> Z
1Z -> Z
...
Truncated

Test 5

Verdict:

input
5

correct output
0

user output
102
Z0 -> Z
Z1 -> Z
0Z -> Z
1Z -> Z
...
Truncated

Test 6

Verdict:

input
6

correct output
1

user output
0

Test 7

Verdict:

input
7

correct output
1

user output
0

Test 8

Verdict:

input
8

correct output
2

user output
0

Test 9

Verdict:

input
9

correct output
3

user output
0

Test 10

Verdict:

input
10

correct output
4

user output
0

Test 11

Verdict:

input
20

correct output
24

user output
0

Test 12

Verdict:

input
30

correct output
61

user output
0

Test 13

Verdict:

input
40

correct output
114

user output
0

Test 14

Verdict:

input
50

correct output
184

user output
0

Test 15

Verdict:

input
60

correct output
271

user output
0

Test 16

Verdict:

input
70

correct output
374

user output
0

Test 17

Verdict:

input
80

correct output
494

user output
0

Test 18

Verdict:

input
90

correct output
631

user output
0

Test 19

Verdict:

input
100

correct output
784

user output
0

Test 20

Verdict:

input
200

correct output
3234

user output
0

Test 21

Verdict:

input
300

correct output
7351

user output
0

Test 22

Verdict:

input
400

correct output
13134

user output
0

Test 23

Verdict:

input
500

correct output
20584

user output
0

Test 24

Verdict:

input
600

correct output
29701

user output
0

Test 25

Verdict:

input
700

correct output
40484

user output
0

Test 26

Verdict:

input
800

correct output
52934

user output
0

Test 27

Verdict:

input
900

correct output
67051

user output
0

Test 28

Verdict:

input
1000

correct output
82834

user output
0