Submission #1007258

#TimeUTC-0UsernameProblemLanguageResultExecution timeMemory
10072582024-06-24 14:06:34snpmrnhlolChorus (JOI23_chorus)C++17
100 / 100
1638 ms60332 KiB
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
const int N = 1e6;
const ll inf = 1e18;
char v[N*2];
int v2[N],v3[N];
ll ps[N + 1];
pair<ll,int> dp[N + 1];
int n,k;
int cnt = 0,cnt2 = 0;
struct line{
ll k,b,id;
};
bool check(line a,line b,line c){
if((a.b - b.b)*(b.k - c.k) == (b.b - c.b)*(a.k - b.k)){
return 1;
}
return (a.b - b.b)*(b.k - c.k) <= (b.b - c.b)*(a.k - b.k);
}
struct CHT{
vector <line> cht;
int sz = 0, pt = 0;
void init(){
cht.clear();
sz = 0;
pt = 0;
}
void add(ll k,ll b,int id){
while(sz >= 2 && check(cht[sz - 2],cht[sz - 1],{k,b,id})){
 
הההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההה
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
#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...