# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
637773 | victor_gao | Broken Device 2 (JOI22_device2) | C++17 | 706 ms | 524288 KiB |
This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
#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 (stderr)
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |