Submission #1036751

# Submission time Handle Problem Language Result Execution time Memory
1036751 2024-07-27T16:19:33 Z Unforgettablepl Tricolor Lights (JOI24_tricolor) C++17
10 / 100
61 ms 1572 KB
#include "Anna.h"
#include <bits/stdc++.h>
using namespace std;

namespace {

int variable_example = 0;

}

pair<string, int> anna(int N, string S) {
	string res;
	if(N<=130){
		for(int i=0;i<N;i++){
			if(S[i]=='R')res.insert(res.end(),'B');
			else if(S[i]=='B')res.insert(res.end(),'G');
			else if(S[i]=='G')res.insert(res.end(),'R');
		}
		return {res,N};
	}
	for(int i=0;i<N;i++)res.insert(res.end(),'$');
	{
		vector<bool> present(3);
		if(S[125]=='R')present[0]=true;
		else if(S[125]=='G')present[1]=true;
		else if(S[125]=='B')present[2]=true;
		if(S[126]=='R')present[0]=true;
		else if(S[126]=='G')present[1]=true;
		else if(S[126]=='B')present[2]=true;
		if(!present[0])res[125]=res[126]='R';
		else if(!present[1])res[125]=res[126]='G';
		else if(!present[2])res[125]=res[126]='B';
	}
	for(int i=124;i>=0;i--){
		vector<bool> present(3);
		if(S[i]=='R')present[0]=true;
		else if(S[i]=='G')present[1]=true;
		else if(S[i]=='B')present[2]=true;
		if(res[i+1]=='R')present[0]=true;
		else if(res[i+1]=='G')present[1]=true;
		else if(res[i+1]=='B')present[2]=true;
		if(!present[0])res[i]='R';
		else if(!present[1])res[i]='G';
		else if(!present[2])res[i]='B';	
	}
	for(int i=127;i<N;i++){
		vector<bool> present(3);
		if(S[i]=='R')present[0]=true;
		else if(S[i]=='G')present[1]=true;
		else if(S[i]=='B')present[2]=true;
		if(res[i-1]=='R')present[0]=true;
		else if(res[i-1]=='G')present[1]=true;
		else if(res[i-1]=='B')present[2]=true;
		if(!present[0])res[i]='R';
		else if(!present[1])res[i]='G';
		else if(!present[2])res[i]='B';	
	}
	return {res,130};
}
#include "Bruno.h"
#include <bits/stdc++.h>
using namespace std;

namespace {

int N;
int l;

}  // namespace

void init(int N, int l) {
	::N = N;
	::l = l;
}

int bruno(string u) {
	if(N<=130)return 1;
	int idxatsame = -1;
	for(int i=1;i<l;i++)if(u[i]==u[i-1])idxatsame=i-1;
	assert(idxatsame!=-1);
	return 126-idxatsame;
}

Compilation message

Anna.cpp:7:5: warning: '{anonymous}::variable_example' defined but not used [-Wunused-variable]
    7 | int variable_example = 0;
      |     ^~~~~~~~~~~~~~~~
# Verdict Execution time Memory Grader output
1 Correct 24 ms 1328 KB Output is correct
2 Correct 24 ms 1288 KB Output is correct
3 Correct 38 ms 1380 KB Output is correct
4 Correct 35 ms 1352 KB Output is correct
5 Correct 42 ms 1568 KB Output is correct
6 Correct 28 ms 1312 KB Output is correct
7 Correct 30 ms 1312 KB Output is correct
8 Correct 29 ms 1572 KB Output is correct
9 Correct 38 ms 1348 KB Output is correct
10 Correct 24 ms 1296 KB Output is correct
11 Correct 48 ms 1304 KB Output is correct
12 Correct 23 ms 1320 KB Output is correct
13 Correct 25 ms 1312 KB Output is correct
14 Correct 25 ms 1396 KB Output is correct
15 Correct 24 ms 1328 KB Output is correct
16 Correct 40 ms 1324 KB Output is correct
17 Correct 26 ms 1292 KB Output is correct
18 Correct 27 ms 1324 KB Output is correct
19 Correct 29 ms 1308 KB Output is correct
20 Correct 28 ms 1384 KB Output is correct
21 Correct 27 ms 1344 KB Output is correct
22 Correct 28 ms 1336 KB Output is correct
23 Correct 27 ms 1344 KB Output is correct
24 Correct 25 ms 1356 KB Output is correct
25 Correct 35 ms 1288 KB Output is correct
26 Correct 28 ms 1324 KB Output is correct
27 Correct 42 ms 1328 KB Output is correct
28 Correct 34 ms 1368 KB Output is correct
29 Correct 39 ms 1312 KB Output is correct
30 Correct 27 ms 1404 KB Output is correct
31 Correct 32 ms 1316 KB Output is correct
32 Correct 52 ms 1292 KB Output is correct
33 Correct 33 ms 1304 KB Output is correct
34 Correct 24 ms 1364 KB Output is correct
35 Correct 49 ms 1312 KB Output is correct
36 Correct 31 ms 1312 KB Output is correct
37 Correct 28 ms 1292 KB Output is correct
38 Correct 29 ms 1288 KB Output is correct
39 Correct 49 ms 1312 KB Output is correct
40 Correct 53 ms 1344 KB Output is correct
41 Correct 47 ms 1316 KB Output is correct
42 Correct 31 ms 1352 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 24 ms 1328 KB Output is correct
2 Correct 24 ms 1288 KB Output is correct
3 Correct 38 ms 1380 KB Output is correct
4 Correct 35 ms 1352 KB Output is correct
5 Correct 42 ms 1568 KB Output is correct
6 Correct 28 ms 1312 KB Output is correct
7 Correct 30 ms 1312 KB Output is correct
8 Correct 29 ms 1572 KB Output is correct
9 Correct 38 ms 1348 KB Output is correct
10 Correct 24 ms 1296 KB Output is correct
11 Correct 48 ms 1304 KB Output is correct
12 Correct 23 ms 1320 KB Output is correct
13 Correct 25 ms 1312 KB Output is correct
14 Correct 25 ms 1396 KB Output is correct
15 Correct 24 ms 1328 KB Output is correct
16 Correct 40 ms 1324 KB Output is correct
17 Correct 26 ms 1292 KB Output is correct
18 Correct 27 ms 1324 KB Output is correct
19 Correct 29 ms 1308 KB Output is correct
20 Correct 28 ms 1384 KB Output is correct
21 Correct 27 ms 1344 KB Output is correct
22 Correct 28 ms 1336 KB Output is correct
23 Correct 27 ms 1344 KB Output is correct
24 Correct 25 ms 1356 KB Output is correct
25 Correct 35 ms 1288 KB Output is correct
26 Correct 28 ms 1324 KB Output is correct
27 Correct 42 ms 1328 KB Output is correct
28 Correct 34 ms 1368 KB Output is correct
29 Correct 39 ms 1312 KB Output is correct
30 Correct 27 ms 1404 KB Output is correct
31 Correct 32 ms 1316 KB Output is correct
32 Correct 52 ms 1292 KB Output is correct
33 Correct 33 ms 1304 KB Output is correct
34 Correct 24 ms 1364 KB Output is correct
35 Correct 49 ms 1312 KB Output is correct
36 Correct 31 ms 1312 KB Output is correct
37 Correct 28 ms 1292 KB Output is correct
38 Correct 29 ms 1288 KB Output is correct
39 Correct 49 ms 1312 KB Output is correct
40 Correct 53 ms 1344 KB Output is correct
41 Correct 47 ms 1316 KB Output is correct
42 Correct 31 ms 1352 KB Output is correct
43 Correct 42 ms 1256 KB Output is correct
44 Correct 29 ms 1344 KB Output is correct
45 Correct 28 ms 1396 KB Output is correct
46 Correct 58 ms 1328 KB Output is correct
47 Correct 37 ms 1324 KB Output is correct
48 Correct 30 ms 1340 KB Output is correct
49 Correct 48 ms 1324 KB Output is correct
50 Correct 61 ms 1320 KB Output is correct
51 Correct 31 ms 1312 KB Output is correct
52 Correct 31 ms 1480 KB Output is correct
53 Correct 28 ms 1288 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 24 ms 1328 KB Output is correct
2 Correct 24 ms 1288 KB Output is correct
3 Correct 38 ms 1380 KB Output is correct
4 Correct 35 ms 1352 KB Output is correct
5 Correct 42 ms 1568 KB Output is correct
6 Correct 28 ms 1312 KB Output is correct
7 Correct 30 ms 1312 KB Output is correct
8 Correct 29 ms 1572 KB Output is correct
9 Correct 38 ms 1348 KB Output is correct
10 Correct 24 ms 1296 KB Output is correct
11 Correct 48 ms 1304 KB Output is correct
12 Correct 23 ms 1320 KB Output is correct
13 Correct 25 ms 1312 KB Output is correct
14 Correct 25 ms 1396 KB Output is correct
15 Correct 24 ms 1328 KB Output is correct
16 Correct 40 ms 1324 KB Output is correct
17 Correct 26 ms 1292 KB Output is correct
18 Correct 27 ms 1324 KB Output is correct
19 Correct 29 ms 1308 KB Output is correct
20 Correct 28 ms 1384 KB Output is correct
21 Correct 27 ms 1344 KB Output is correct
22 Correct 28 ms 1336 KB Output is correct
23 Correct 27 ms 1344 KB Output is correct
24 Correct 25 ms 1356 KB Output is correct
25 Correct 35 ms 1288 KB Output is correct
26 Correct 28 ms 1324 KB Output is correct
27 Correct 42 ms 1328 KB Output is correct
28 Correct 34 ms 1368 KB Output is correct
29 Correct 39 ms 1312 KB Output is correct
30 Correct 27 ms 1404 KB Output is correct
31 Correct 32 ms 1316 KB Output is correct
32 Correct 52 ms 1292 KB Output is correct
33 Correct 33 ms 1304 KB Output is correct
34 Correct 24 ms 1364 KB Output is correct
35 Correct 49 ms 1312 KB Output is correct
36 Correct 31 ms 1312 KB Output is correct
37 Correct 28 ms 1292 KB Output is correct
38 Correct 29 ms 1288 KB Output is correct
39 Correct 49 ms 1312 KB Output is correct
40 Correct 53 ms 1344 KB Output is correct
41 Correct 47 ms 1316 KB Output is correct
42 Correct 31 ms 1352 KB Output is correct
43 Correct 42 ms 1256 KB Output is correct
44 Correct 29 ms 1344 KB Output is correct
45 Correct 28 ms 1396 KB Output is correct
46 Correct 58 ms 1328 KB Output is correct
47 Correct 37 ms 1324 KB Output is correct
48 Correct 30 ms 1340 KB Output is correct
49 Correct 48 ms 1324 KB Output is correct
50 Correct 61 ms 1320 KB Output is correct
51 Correct 31 ms 1312 KB Output is correct
52 Correct 31 ms 1480 KB Output is correct
53 Correct 28 ms 1288 KB Output is correct
54 Runtime error 1 ms 1544 KB Execution killed with signal 6
55 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 24 ms 1328 KB Output is correct
2 Correct 24 ms 1288 KB Output is correct
3 Correct 38 ms 1380 KB Output is correct
4 Correct 35 ms 1352 KB Output is correct
5 Correct 42 ms 1568 KB Output is correct
6 Correct 28 ms 1312 KB Output is correct
7 Correct 30 ms 1312 KB Output is correct
8 Correct 29 ms 1572 KB Output is correct
9 Correct 38 ms 1348 KB Output is correct
10 Correct 24 ms 1296 KB Output is correct
11 Correct 48 ms 1304 KB Output is correct
12 Correct 23 ms 1320 KB Output is correct
13 Correct 25 ms 1312 KB Output is correct
14 Correct 25 ms 1396 KB Output is correct
15 Correct 24 ms 1328 KB Output is correct
16 Correct 40 ms 1324 KB Output is correct
17 Correct 26 ms 1292 KB Output is correct
18 Correct 27 ms 1324 KB Output is correct
19 Correct 29 ms 1308 KB Output is correct
20 Correct 28 ms 1384 KB Output is correct
21 Correct 27 ms 1344 KB Output is correct
22 Correct 28 ms 1336 KB Output is correct
23 Correct 27 ms 1344 KB Output is correct
24 Correct 25 ms 1356 KB Output is correct
25 Correct 35 ms 1288 KB Output is correct
26 Correct 28 ms 1324 KB Output is correct
27 Correct 42 ms 1328 KB Output is correct
28 Correct 34 ms 1368 KB Output is correct
29 Correct 39 ms 1312 KB Output is correct
30 Correct 27 ms 1404 KB Output is correct
31 Correct 32 ms 1316 KB Output is correct
32 Correct 52 ms 1292 KB Output is correct
33 Correct 33 ms 1304 KB Output is correct
34 Correct 24 ms 1364 KB Output is correct
35 Correct 49 ms 1312 KB Output is correct
36 Correct 31 ms 1312 KB Output is correct
37 Correct 28 ms 1292 KB Output is correct
38 Correct 29 ms 1288 KB Output is correct
39 Correct 49 ms 1312 KB Output is correct
40 Correct 53 ms 1344 KB Output is correct
41 Correct 47 ms 1316 KB Output is correct
42 Correct 31 ms 1352 KB Output is correct
43 Correct 42 ms 1256 KB Output is correct
44 Correct 29 ms 1344 KB Output is correct
45 Correct 28 ms 1396 KB Output is correct
46 Correct 58 ms 1328 KB Output is correct
47 Correct 37 ms 1324 KB Output is correct
48 Correct 30 ms 1340 KB Output is correct
49 Correct 48 ms 1324 KB Output is correct
50 Correct 61 ms 1320 KB Output is correct
51 Correct 31 ms 1312 KB Output is correct
52 Correct 31 ms 1480 KB Output is correct
53 Correct 28 ms 1288 KB Output is correct
54 Runtime error 1 ms 1544 KB Execution killed with signal 6
55 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 27 ms 1388 KB Output is correct
2 Correct 26 ms 1304 KB Output is correct
3 Correct 31 ms 1312 KB Output is correct
4 Correct 28 ms 1308 KB Output is correct
5 Partially correct 28 ms 1384 KB Partially correct
6 Partially correct 34 ms 1308 KB Partially correct
7 Partially correct 48 ms 1328 KB Partially correct
8 Partially correct 33 ms 1372 KB Partially correct
9 Partially correct 32 ms 1332 KB Partially correct
10 Partially correct 38 ms 1384 KB Partially correct
11 Runtime error 1 ms 1288 KB Execution killed with signal 6
12 Halted 0 ms 0 KB -