제출 #164387

#제출 시각UTC-0아이디문제언어결과실행 시간메모리
1643872019-11-20 07:35:26nafis_shifatRobots (IOI13_robots)C++14
100 / 100
2505 ms28764 KiB
#include "robots.h"
#include<bits/stdc++.h>
#define pii pair<int,int>
#define f first
#define s second
#define ll long long
using namespace std;
vector<pii> toy;
vector<int> wt;
vector<int> st;
bool can(int s)
{
priority_queue<pii> pq;
int pnt=0;
for(int i=0;i<st.size();i++)
{
while(pnt<toy.size()&&toy[pnt].f<st[i])
{
pq.push({toy[pnt].s,toy[pnt++].f});
}
for(int j=0;j<s && !pq.empty();j++)
{
pq.pop();
}
}
for(;pnt<toy.size();pnt++)pq.push({toy[pnt].s,toy[pnt].f});
for(int i=wt.size()-1;i>=0;i--)
{
for(int j=0;j<s && !pq.empty() && pq.top().f<wt[i];j++)
{
 
הההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההה
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

컴파일 시 표준 에러 (stderr) 메시지

robots.cpp: In function 'bool can(int)':
robots.cpp:15:15: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
  for(int i=0;i<st.size();i++)
              ~^~~~~~~~~~
robots.cpp:17:12: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
   while(pnt<toy.size()&&toy[pnt].f<st[i])
         ~~~^~~~~~~~~~~
robots.cpp:19:31: warning: operation on 'pnt' may be undefined [-Wsequence-point]
    pq.push({toy[pnt].s,toy[pnt++].f});
                            ~~~^~
robots.cpp:26:10: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
  for(;pnt<toy.size();pnt++)pq.push({toy[pnt].s,toy[pnt].f});
       ~~~^~~~~~~~~~~
robots.cpp: In function 'int putaway(int, int, int, int*, int*, int*, int*)':
robots.cpp:51:16: warning: suggest parentheses around '+' inside '>>' [-Wparentheses]
      int mid=lo+hi>>1;
              ~~^~~
#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...