이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include "elephants.h"
#ifndef EVAL
#include "grader.cpp"
#endif // EVAL
#include <bits/stdc++.h>
#pragma optimize("Ofast,unroll_loops")
#pragma target("avx,avx2,fma")
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],dlina;
set <int> s;
void init(int N, int L, int X[]){
n = N;
dlina = L;
for (int i=0;i<n;++i)s.insert(X[i]),q[i]=X[i];
}
int update(int i, int y){
s.erase(q[i]);
q[i] = y;
s.insert(q[i]);
int ans=1;
int l = *s.begin();
for (auto a: s){
if (l+dlina < a){
ans++;
l = a;
}
}
return ans;
}
컴파일 시 표준 에러 (stderr) 메시지
elephants.cpp:7: warning: ignoring #pragma optimize [-Wunknown-pragmas]
7 | #pragma optimize("Ofast,unroll_loops")
|
elephants.cpp:8: warning: ignoring #pragma target [-Wunknown-pragmas]
8 | #pragma target("avx,avx2,fma")
|
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |