답안 #72450

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
72450 2018-08-26T08:16:38 Z 이시대의진정한망겜스타투(#2267, cki86201, ainta) 코코넛 젤리 음료수 (FXCUP3_nectar) C++17
15 / 100
53 ms 736 KB
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <memory.h>
#include <math.h>
#include <assert.h>
#include <queue>
#include <map>
#include <set>
#include <string>
#include <algorithm>
#include <iostream>
#include <functional>
#include <unordered_map>
#include <unordered_set>
#include <list>
#include <bitset>

using namespace std;
typedef long long ll;
#define Fi first
#define Se second
#define pb(x) push_back(x)
#define szz(x) ((int)(x).size())
#define rep(i, n) for(int i=0;i<n;i++)
#define all(x) (x).begin(), (x).end()
typedef tuple<int, int, int> t3;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;
typedef long double ldouble;

int N, J, R, T;
ll ans[1010];

int main() {
	scanf("%d%d%d%d", &N, &J, &R, &T);
	for(int i=1;i<=N;i++) ans[i] = J;
	while(T--) {
		for(int i=2;i<=N;i++) {
			ll v = (ans[i] + R - 1) / R;
			ans[i-1] += v;
			ans[i] -= v;
		}
	}
	for(int i=N;i;i--) printf("%lld\n", ans[i]);
	return 0;
}

Compilation message

nectar.cpp: In function 'int main()':
nectar.cpp:36:7: 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 248 KB Output is correct
2 Correct 3 ms 380 KB Output is correct
3 Correct 3 ms 560 KB Output is correct
4 Correct 2 ms 560 KB Output is correct
5 Correct 3 ms 560 KB Output is correct
6 Correct 4 ms 560 KB Output is correct
7 Correct 38 ms 560 KB Output is correct
8 Correct 47 ms 592 KB Output is correct
9 Correct 53 ms 592 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 3 ms 248 KB Output is correct
2 Correct 3 ms 380 KB Output is correct
3 Correct 3 ms 560 KB Output is correct
4 Correct 2 ms 560 KB Output is correct
5 Correct 3 ms 560 KB Output is correct
6 Correct 4 ms 560 KB Output is correct
7 Correct 38 ms 560 KB Output is correct
8 Correct 47 ms 592 KB Output is correct
9 Correct 53 ms 592 KB Output is correct
10 Runtime error 3 ms 736 KB Execution killed with signal 11 (could be triggered by violating memory limits)
11 Halted 0 ms 0 KB -