Submission #941547

#TimeUTC-0UsernameProblemLanguageResultExecution timeMemory
9415472024-03-09 06:25:35KG07Aliens (IOI16_aliens)C++14
0 / 100
1 ms348 KiB
#include "aliens.h"
#include <bits/stdc++.h>
using namespace std;
long long take_photos(int n, int m, int k, vector<int> r, vector<int> c) {
priority_queue<pair<int, int>> q;
for(int i = 0; i < n; i++){
if(r[i] > c[i])q.push(make_pair(-c[i], r[i]));
else q.push(make_pair(-r[i], c[i]));
}
vector<pair<int, int>> a;
a.push_back(make_pair(-q.top().first, q.top().second));
q.pop();
while(!q.empty()){
if(-q.top().first > a[a.size()-1].first && q.top().second > a[a.size()-1].second)a.push_back(make_pair(-q.top().first, q.top().second));
q.pop();
}
long long L = 0LL, R = 1LL * m * m;
while(true){
long long C = (L+R)/2;
vector<long long> b, d, x, y, z;
stack<long long> s;
b.push_back(0LL);
d.push_back(0LL);
x.push_back(0LL);
y.push_back(-2LL*(a[0].first-1));
z.push_back(1LL*(a[0].first-1)*(a[0].first-1));
//cout << b[0] << " " << x[0]-C << " " << y[0] << " " << z[0] << "\n";
//cout << L << " " << C << " " << R << "\n";
for(int i = 0; i < a.size(); i++){
 
הההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההה
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

Compilation message (stderr)

aliens.cpp: In function 'long long int take_photos(int, int, int, std::vector<int>, std::vector<int>)':
aliens.cpp:30:26: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<std::pair<int, int>, std::allocator<std::pair<int, int> > >::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   30 |         for(int i = 0; i < a.size(); 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...