Submission #637773

#TimeUsernameProblemLanguageResultExecution timeMemory
637773victor_gaoBroken Device 2 (JOI22_device2)C++17
10 / 100
706 ms524288 KiB
#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)

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;
      |     ^~~~~~~~~~~~~~~~
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...