답안 #72324

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
72324 2018-08-26T07:08:42 Z (#2175, xdoju, kazel, pps789) 코코넛 젤리 음료수 (FXCUP3_nectar) C++17
15 / 100
2000 ms 580 KB
#include<cstdio>
#include<algorithm>
using namespace std;

int N,J,R,T;

int ans[100000];
int pending[100000];
int main(){
    scanf("%d%d%d%d",&N,&J,&R,&T);
    for(int i=0;i<N;i++) ans[i] = J;

    for(int iter=0;iter<T;iter++){
        for(int i=1;i<N;i++){
            pending[i] = ans[i]/R;
            if(ans[i]%R) pending[i]++;
        }
        for(int i=1;i<N;i++){
            ans[i-1] += pending[i];
            ans[i] -= pending[i];
        }
    }

    for(int i=N-1;i>=0;i--) printf("%d\n", ans[i]);
}

Compilation message

nectar.cpp: In function 'int main()':
nectar.cpp:10:10: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
     scanf("%d%d%d%d",&N,&J,&R,&T);
     ~~~~~^~~~~~~~~~~~~~~~~~~~~~~~
# 결과 실행 시간 메모리 Grader output
1 Correct 3 ms 256 KB Output is correct
2 Correct 3 ms 488 KB Output is correct
3 Correct 3 ms 488 KB Output is correct
4 Correct 2 ms 488 KB Output is correct
5 Correct 3 ms 488 KB Output is correct
6 Correct 4 ms 488 KB Output is correct
7 Correct 15 ms 488 KB Output is correct
8 Correct 17 ms 532 KB Output is correct
9 Correct 18 ms 532 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 3 ms 256 KB Output is correct
2 Correct 3 ms 488 KB Output is correct
3 Correct 3 ms 488 KB Output is correct
4 Correct 2 ms 488 KB Output is correct
5 Correct 3 ms 488 KB Output is correct
6 Correct 4 ms 488 KB Output is correct
7 Correct 15 ms 488 KB Output is correct
8 Correct 17 ms 532 KB Output is correct
9 Correct 18 ms 532 KB Output is correct
10 Execution timed out 2060 ms 580 KB Time limit exceeded
11 Halted 0 ms 0 KB -