# | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
1092537 | sleepntsheep | A Game with Grundy (CCO20_day1problem1) | C++17 | 82 ms | 12880 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include<stdio.h>
#include<map>
using namespace std;
#define N 100005
int n,l,r,y,cn,f[N];
int main(){
scanf("%d%d%d%d",&n,&l,&r,&y);
map<int,int>e;
for(int x,v,h,i=0;i<n;++i){
scanf("%d%d%d",&x,&v,&h);
int w=(y*h-1)/v;
int st=max(l,x-w),ed=min(r+1,x+w+1);
++e[st],--e[ed];
}
int x0=l;
for(auto[x,ii]:e){
f[cn]+=x-x0;
x0=x;cn+=ii;
}
f[cn]+=r-x0+1;
for(int i=0;i<=n;++i)printf("%d\n",f[i]),f[i+1]+=f[i];
}
컴파일 시 표준 에러 (stderr) 메시지
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |