제출 #26970

#제출 시각아이디문제언어결과실행 시간메모리
26970repeating코끼리 (Dancing Elephants) (IOI11_elephants)C++11
0 / 100
9000 ms19264 KiB
#include <bits/stdc++.h> #include "elephants.h" #define F first #define S second #define P push #define pb push_back #define MEM(dp,i) memset(dp,i,sizeof(dp)) #define W while #define R return #define C continue #define SI size() #define ll long long #define ld long double #define pll pair<ll,ll> #define pii pair<int,int> #define SF(x) scanf("%I64d",&x) #define SF2(x,y) scanf("%I64d%I64d",&x,&y) #define SF3(x,y,z) scanf("%I64d%I64d%I64d",&x,&y,&z) #define SF4(x,y,z,o) scanf("%I64d%I64d%I64d%I64d",&x,&y,&z,&o) #define all(v) v.begin(),v.end() #define MAX_R 1000000 using namespace std; const long long INF = 1e9+5e8; const int MX=109; int n; vector<int> v; int l; void init(int N, int L, int X[]) { n = N; for(int i=0;i<n;i++) v.pb(X[i]); } int update(int x, int y) { for(auto &i : v){ if(i==x){i=y;break;} } sort(all(v)); ll ret=0; int ind=v[0]; W(1){ ret++; auto a=upper_bound(all(v),ind+l-1); if(a==v.end())break; ind=*a; } return ret; }
#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...