# | Submission time | Handle | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
29046 | 2017-07-18T07:29:33 Z | aybala | Dancing Elephants (IOI11_elephants) | C++11 | 99 ms | 17644 KB |
#include "elephants.h" #include<bits/stdc++.h> #define fori(a,b,c) for(a=b; a<c; a++) #define ford(a,b,c) for(a=b; a>=c; a--) #define mp make_pair #define pb push_back #define ll long long #define pii pair<int,int> using namespace std; int n; int cam; int a[2]; int Ll; void init(int N, int L, int X[]) { int i,j,k; int l = X[0]; a[0]=X[0]; a[1]=X[1]; cam = 1; fori(i,1,N){ if(X[i]-l>L){ l=X[i]; cam++; } } n=N; Ll=L; } int update(int i, int y) { if(i==2){ a[0]=a[1]=y; return cam; } if(i==1){ if(abs(a[1]-y)>abs(a[0]-y)){ a[1]=y; } else{ a[0]=y; } int l = a[0]; cam = 1; fori(i,1,n){ if(a[i]-l>Ll){ l=a[i]; cam++; } } } return cam; }
Compilation message
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Incorrect | 0 ms | 17644 KB | Output isn't correct |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Incorrect | 0 ms | 17644 KB | Output isn't correct |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Incorrect | 6 ms | 17644 KB | Output isn't correct |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Incorrect | 26 ms | 17644 KB | Output isn't correct |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Incorrect | 99 ms | 17644 KB | Output isn't correct |
2 | Halted | 0 ms | 0 KB | - |