Submission #947048

#TimeUsernameProblemLanguageResultExecution timeMemory
947048onepunchac168Minerals (JOI19_minerals)C++14
40 / 100
101 ms3240 KiB
#include "minerals.h" #include <bits/stdc++.h> using namespace std; int query(int x) { return Query(x); } void solve(vector <int> need,bool check) { cerr<<1<<endl; if (need.size()==2) { if (check==1) { int aa=query(need[0]); int bb=query(need[1]); } Answer(need[0],need[1]); return; } if (need.size()<=1) { assert(1==0); } vector <int> aa,bb; int rr=need.size()/4; if (check==0) { for (int i=0;i<need.size();i++) { int a1=query(need[i]); //cout<<a1<<'\n'; if (a1<=rr) { aa.push_back(need[i]); } else { int a2=query(need[i]); bb.push_back(need[i]); } } solve(aa,1); solve(bb,0); } else { for (int i=rr;i<need.size();i++) { int a1=query(need[i]); } for (int i=0;i<rr;i++) { aa.push_back(need[i]); } for (int i=rr;i<need.size();i++) { int a1=query(need[i]); if (a1<=rr) { aa.push_back(need[i]); } else { int a2=query(need[i]); bb.push_back(need[i]); } } solve(aa,1); solve(bb,0); } } void Solve(int n) { vector <int > opt; for (int i=1;i<=2*n;i++) { opt.push_back(i); } solve(opt,0); }

Compilation message (stderr)

minerals.cpp: In function 'void solve(std::vector<int>, bool)':
minerals.cpp:16:17: warning: unused variable 'aa' [-Wunused-variable]
   16 |             int aa=query(need[0]);
      |                 ^~
minerals.cpp:17:17: warning: unused variable 'bb' [-Wunused-variable]
   17 |             int bb=query(need[1]);
      |                 ^~
minerals.cpp:30:23: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   30 |         for (int i=0;i<need.size();i++)
      |                      ~^~~~~~~~~~~~
minerals.cpp:40:21: warning: unused variable 'a2' [-Wunused-variable]
   40 |                 int a2=query(need[i]);
      |                     ^~
minerals.cpp:49:24: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   49 |         for (int i=rr;i<need.size();i++)
      |                       ~^~~~~~~~~~~~
minerals.cpp:51:17: warning: unused variable 'a1' [-Wunused-variable]
   51 |             int a1=query(need[i]);
      |                 ^~
minerals.cpp:57:24: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   57 |         for (int i=rr;i<need.size();i++)
      |                       ~^~~~~~~~~~~~
minerals.cpp:66:21: warning: unused variable 'a2' [-Wunused-variable]
   66 |                 int a2=query(need[i]);
      |                     ^~
#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...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...