Submission #153824

#TimeUTC-0UsernameProblemLanguageResultExecution timeMemory
1538242019-09-16 15:04:35Ruxandra985Robots (IOI13_robots)C++14
100 / 100
1945 ms24224 KiB
#include <cstdio>
#include <iostream>
#include <algorithm>
#include "robots.h"
#include <vector>
#include <queue>
using namespace std;
int ok (int gmax ,int a , int b , int t , int y[],int s[],vector <int> v[50010] ){
int i,j;
/// pana acum am log 10^6
priority_queue <int> h,h2;
for (i=0;i<=a;i++){
for (j=0;j<v[i].size();j++)
h.push(s[v[i][j]]);
if (i!=a){
for (j=1;j<=gmax && !h.empty();j++)
h.pop(); /// cele mai mari gmax sizeuri le pun aici
}
}
/// in h au ramas cele pe care trebuie tu sa le pui la robotii mici
//if (gmax == 23)
// printf ("%d ",h.size());
for (i=b-1;i>=0;i--){
if (h.empty())
return 1;
if (h.top() > y[i])
return 0;
 
הההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההה
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

Compilation message (stderr)

robots.cpp: In function 'int ok(int, int, int, int, int*, int*, std::vector<int>*)':
robots.cpp:14:19: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
         for (j=0;j<v[i].size();j++)
                  ~^~~~~~~~~~~~
robots.cpp:26:7: warning: this 'if' clause does not guard... [-Wmisleading-indentation]
       if (h.empty())
       ^~
robots.cpp:28:9: note: ...this statement, but the latter is misleadingly indented as if it were guarded by the 'if'
         if (h.top() > y[i])
         ^~
robots.cpp: In function 'int putaway(int, int, int, int*, int*, int*, int*)':
robots.cpp:71:26: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
         if (v[st].size() > k)
             ~~~~~~~~~~~~~^~~
#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...