Submission #348604

#TimeUsernameProblemLanguageResultExecution timeMemory
348604beksultan04코끼리 (Dancing Elephants) (IOI11_elephants)C++14
26 / 100
9040 ms1132 KiB
#include "elephants.h" #ifndef EVAL #include "grader.cpp" #endif // EVAL #include <bits/stdc++.h> using namespace std; #define lol long long #define pii pair<int,int> #define OK puts("OK"); #define NO puts("NO"); #define YES puts("YES"); #define fr first #define sc second #define ret return #define scanl(a) scanf("%lld",&a); #define scanll(a,b) scanf("%lld %lld",&a, &b); #define scanlll(a,b,c) scanf("%lld %lld %lld",&a,&b,&c); #define scan1(a) scanf("%d",&a); #define scan2(a,b) scanf("%d %d",&a, &b); #define scan3(a,b,c) scanf("%d %d %d",&a,&b,&c); #define all(s) s.begin(),s.end() #define allr(s) s.rbegin()Ñ,s.rend() #define pb push_back #define sz(v) (int)v.size() #define endi puts(""); #define eps 1e-12 const int NN = 3e5+12,INF=1e9+7; int n,q[NN],a[NN],dlina; void init(int N, int L, int X[]){ n = N; dlina = L; for (int i=0;i<n;++i)q[i] = X[i]; } int update(int i, int y){ q[i] = y; int j,ans=1; for (j=0;j<n;++j)a[j]=q[j]; sort(a,a+n); int l = a[0]; for (i=0;i<n;++i){ if (l+dlina < a[i]){ ans++; l = a[i]; } } return ans; }
#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...