제출 #960751

#제출 시각UTC-0아이디문제언어결과실행 시간메모리
9607512024-04-11 02:45:00ThegeekKnight16Aliens (IOI16_aliens)C++17
4 / 100
1 ms512 KiB
#include <bits/stdc++.h>
#include "aliens.h"
using namespace std;
typedef long long ll;
vector<ll> A, B, ids; int tam = 0, pos = 0;
bool inutil(int novo, int atual, int velho)
{
return ((B[velho] - B[novo])*(A[atual] - A[velho]) <= (B[velho] - B[atual])*(A[novo] - A[velho]));
}
void update(ll newA, ll newB, ll newId)
{
A.push_back(newA); B.push_back(newB); ids.push_back(newId);
++tam;
while (tam > 2 && inutil(tam-1, tam-2, tam-3)) {A.erase(A.end()-2); B.erase(B.end()-2); ids.erase(ids.end()-2); --tam;}
}
pair<ll, ll> query(ll x)
{
if (pos >= tam) pos = tam-1;
while (pos < tam-1 && (A[pos]*x + B[pos]) >= (A[pos+1]*x + B[pos+1])) ++pos;
return make_pair(A[pos]*x + B[pos], ids[pos]);
}
ll take_photos(int N, int M, int K, std::vector<int> r, std::vector<int> c)
{
vector<pair<ll, ll>> v(N);
for (int i = 0; i < N; i++)
{
 
 
הההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההה
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

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

aliens.cpp: In function 'll take_photos(int, int, int, std::vector<int>, std::vector<int>)':
aliens.cpp:50:10: warning: variable 'C' set but not used [-Wunused-but-set-variable]
   50 |     auto C = [&](int l, int r) {return ((v[r].second - v[l].first + 1LL) * (v[r].second - v[l].first + 1LL)) - (sIni[r] - sIni[l-1] + inter[l-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...
#Verdict Execution timeMemoryGrader output
Fetching results...