# | Submission time | Handle | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
998040 | 2024-06-13T08:40:32 Z | Petrix | Rabbit Carrot (LMIO19_triusis) | C++17 | 0 ms | 348 KB |
#include<iostream> using namespace std; #define int long long int v[200001]; int n; int caut(int a){ int st,dr,mij,rasp; st=0;dr=n-1; while(st<=dr){ mij=(st+dr)/2; if(v[mij]>a){ rasp=mij;st=mij-1; }else dr=mij+1; } return rasp; } signed main() { int d,max1=-1,a,i,aux; cin>>n>>d; for(i=0;i<=n;i++) v[i]=1e18; for(i=1;i<=n;i++){ cin>>a; a=i*d-a; if(a<=0) continue; aux=caut(a); v[aux]=a;max1=max(max1,aux); } cout<<n-1-max1; return 0; }
Compilation message
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Incorrect | 0 ms | 348 KB | Output isn't correct |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Incorrect | 0 ms | 348 KB | Output isn't correct |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Incorrect | 0 ms | 348 KB | Output isn't correct |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Incorrect | 0 ms | 348 KB | Output isn't correct |
2 | Halted | 0 ms | 0 KB | - |