QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#111472 | #1156. Robots | minhcool# | Compile Error | / | / | C++17 | 2.0kb | 2023-06-07 11:09:24 | 2024-05-31 13:58:15 |
Judging History
你现在查看的是最新测评结果
- [2024-05-31 13:58:15]
- 评测
- 测评结果:Compile Error
- 用时:0ms
- 内存:0kb
- [2023-08-10 23:21:45]
- System Update: QOJ starts to keep a history of the judgings of all the submissions.
- [2023-06-07 11:09:24]
- 提交
answer
#include<bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
using namespace __gnu_pbds;
using namespace std;
//#define ok
//#define int long long
#define ll long long
#define fi first
#define se second
#define pb push_back
#define mp make_pair
typedef pair<int, int> ii;
typedef pair<ii, int> iii;
typedef pair<ii, ii> iiii;
const int N = 3e5 + 5;
const int oo = 1e18 + 7, mod = 1e9 + 7;
mt19937 rng(1);
int rnd(int l, int r){
int temp = rng() % (r - l + 1);
return abs(temp) + l;
}
int a, b, t;
int x[N], y[N];
// w[N], s[N];
ii obj[N];
bool ck(int xx){
priority_queue<int, vector<int>> pq;
int itr = 0;
for(int i = 0; i < a; i++){
while(itr < t && obj[itr].fi < x[i]){
pq.push(obj[itr].se);
itr++;
}
for(int j = 0; j < xx; j++){
if(pq.empty()) break;
pq.pop();
}
}
while(itr < t){
pq.push(obj[itr].se);
itr++;
}
for(int i = b - 1; i >= 0; i--){
if(!pq.empty() && pq.top() >= y[i]) return 0;
for(int j = 0; j < xx; j++){
if(pq.empty()) break;
pq.pop();
}
}
return (pq.empty());
}
int putaway(int A, int B, int T, int X[], int Y[], int W[], int S[]){
a = A, b = B, t = T;
for(int i = 0; i < a; i++) x[i] = X[i];
for(int i = 0; i < b; i++) y[i] = Y[i];
sort(x, x + a);
sort(y, y + b);
for(int i = 0; i < t; i++){
obj[i] = {W[i], S[i]};
if(obj[i].fi >= x[a - 1] && obj[i].se >= y[b - 1]) return -1;
}
sort(obj, obj + t);
int l = 0, r = t;
// if(!ck(t)) return -1;
while(l < r){
int mid = (l + r) >> 1;
if(!ck(mid)) l = mid + 1;
else r = mid;
}
return l;
}
#ifdef ok
void process(){
int a, b, t, x[1005], y[1005], w[1005], s[1005];
//exit(0);
cin >> a >> b >> t;
// cout << a << " " << b << " " << t << "\n";
// exit(0);
for(int i = 0; i < a; i++) cin >> x[i];
for(int i = 0; i < b; i++) cin >> y[i];
for(int i = 0; i < t; i++) cin >> w[i] >> s[i];
cout << putaway(a, b, t, x, y, w, s) << "\n";
}
signed main(){
ios_base::sync_with_stdio(0);
cin.tie(0);
process();
}
#endif
Details
answer.code:20:21: warning: overflow in conversion from ‘double’ to ‘int’ changes value from ‘1.0e+18’ to ‘2147483647’ [-Woverflow] 20 | const int oo = 1e18 + 7, mod = 1e9 + 7; | ~~~~~^~~ /usr/bin/ld: /tmp/cctpkDrH.o: in function `main': implementer.cpp:(.text.startup+0x1bf): undefined reference to `putaway' collect2: error: ld returned 1 exit status