Submission #831031

#TimeUTC-0UsernameProblemLanguageResultExecution timeMemory
8310312023-08-19 15:23:32LIFThe Big Prize (IOI17_prize)C++14
20 / 100
61 ms1916 KiB
#include "prize.h"
#include<bits/stdc++.h>
using namespace std;
int ll[300005];
int rr[300005];
int maxn = -1;
vector<int> ans;
int last = -1;
void find(int l,int r,int nowsize)
{
if(l == r)
{
ans.push_back(l);
return;
}
bool flag = true;
while(l <= r)
{
if(ll[l] == -1)
{
vector<int> temp = ask(l);
ll[l] = temp[0];rr[l] = temp[1];
if(ll[l] + rr[l] == maxn)break;
else
{
//if(ll[l] + rr[l] == 0)last = l;
ans.push_back(l);
l++;
}
}
 
הההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההה
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

Compilation message (stderr)

prize.cpp: In function 'void find(int, int, int)':
prize.cpp:16:7: warning: unused variable 'flag' [-Wunused-variable]
   16 |  bool flag = true;
      |       ^~~~
prize.cpp: In function 'int find_best(int)':
prize.cpp:143:15: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
  143 |  for(int i=0;i<ans.size();i++)
      |              ~^~~~~~~~~~~
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...