#include "Anna.h"
#include <utility>
#include <vector>
namespace {
int variable_example = 0;
}
int Declare() {
return 2000;
}
std::pair<std::vector<int>, std::vector<int> > Anna(long long A) {
std::vector<int> X = {};
std::vector<int> Y = {};
int val=A/2000,last=A%2000;
if (!last){
last=2000+val%2;
}
while (val){
X.push_back(1);
if (val==1) break;
Y.push_back(1);
val-=2;
}
while (last){
Y.push_back(0);
if (last==1) break;
X.push_back(0);
last-=2;
}
if ((X.size()+Y.size())%2){
if (X.size()>Y.size()) Y.push_back(1);
else X.push_back(1);
X.push_back(1);
Y.push_back(1);
}
return make_pair(X, Y);
}
#include "Bruno.h"
#include <utility>
#include <vector>
namespace {
int variable_example = 0;
}
long long Bruno(std::vector<int> u) {
long long ans1=0,ans0=0;
for (auto i:u){
if (i==1) ans1++;
else ans0++;
}
if (ans0>=2000) return ans1*2000;
if (u.back()==1) return (ans1-3)*2000+ans0;
else return ans1*2000+ans0;
}
Compilation message
Anna.cpp:7:5: warning: '{anonymous}::variable_example' defined but not used [-Wunused-variable]
7 | int variable_example = 0;
| ^~~~~~~~~~~~~~~~
Bruno.cpp:7:5: warning: '{anonymous}::variable_example' defined but not used [-Wunused-variable]
7 | int variable_example = 0;
| ^~~~~~~~~~~~~~~~
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
1 ms |
648 KB |
Output is correct |
2 |
Correct |
96 ms |
4988 KB |
Output is correct |
3 |
Correct |
268 ms |
12576 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
1 ms |
648 KB |
Output is correct |
2 |
Correct |
96 ms |
4988 KB |
Output is correct |
3 |
Correct |
268 ms |
12576 KB |
Output is correct |
4 |
Correct |
373 ms |
16780 KB |
Output is correct |
5 |
Correct |
358 ms |
16576 KB |
Output is correct |
6 |
Correct |
390 ms |
17248 KB |
Output is correct |
7 |
Correct |
356 ms |
16724 KB |
Output is correct |
8 |
Correct |
389 ms |
16928 KB |
Output is correct |
9 |
Correct |
630 ms |
28468 KB |
Output is correct |
10 |
Correct |
706 ms |
32504 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
1 ms |
648 KB |
Output is correct |
2 |
Correct |
96 ms |
4988 KB |
Output is correct |
3 |
Correct |
268 ms |
12576 KB |
Output is correct |
4 |
Correct |
373 ms |
16780 KB |
Output is correct |
5 |
Correct |
358 ms |
16576 KB |
Output is correct |
6 |
Correct |
390 ms |
17248 KB |
Output is correct |
7 |
Correct |
356 ms |
16724 KB |
Output is correct |
8 |
Correct |
389 ms |
16928 KB |
Output is correct |
9 |
Correct |
630 ms |
28468 KB |
Output is correct |
10 |
Correct |
706 ms |
32504 KB |
Output is correct |
11 |
Incorrect |
0 ms |
652 KB |
Wrong Answer [3] |
12 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
1 ms |
648 KB |
Output is correct |
2 |
Correct |
96 ms |
4988 KB |
Output is correct |
3 |
Correct |
268 ms |
12576 KB |
Output is correct |
4 |
Correct |
373 ms |
16780 KB |
Output is correct |
5 |
Correct |
358 ms |
16576 KB |
Output is correct |
6 |
Correct |
390 ms |
17248 KB |
Output is correct |
7 |
Correct |
356 ms |
16724 KB |
Output is correct |
8 |
Correct |
389 ms |
16928 KB |
Output is correct |
9 |
Correct |
630 ms |
28468 KB |
Output is correct |
10 |
Correct |
706 ms |
32504 KB |
Output is correct |
11 |
Incorrect |
0 ms |
652 KB |
Wrong Answer [3] |
12 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
1 ms |
648 KB |
Output is correct |
2 |
Correct |
96 ms |
4988 KB |
Output is correct |
3 |
Correct |
268 ms |
12576 KB |
Output is correct |
4 |
Correct |
373 ms |
16780 KB |
Output is correct |
5 |
Correct |
358 ms |
16576 KB |
Output is correct |
6 |
Correct |
390 ms |
17248 KB |
Output is correct |
7 |
Correct |
356 ms |
16724 KB |
Output is correct |
8 |
Correct |
389 ms |
16928 KB |
Output is correct |
9 |
Correct |
630 ms |
28468 KB |
Output is correct |
10 |
Correct |
706 ms |
32504 KB |
Output is correct |
11 |
Incorrect |
0 ms |
652 KB |
Wrong Answer [3] |
12 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Runtime error |
658 ms |
524288 KB |
Execution killed with signal 9 |
2 |
Halted |
0 ms |
0 KB |
- |