| # | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 | 
|---|---|---|---|---|---|---|---|
| 43992 | sorry_Benq | Calvinball championship (CEOI15_teams) | C++17 | 132 ms | 1104 KiB | 
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include <bits/stdc++.h>
#define int long long
using namespace std;
typedef long long ll;
const int MOD = 1e6 + 7;
ll a[10005];
ll DP[10005];
ll mxs[10005];
/*int solve(int N, int K){
	//you have N numbers left, and they can start anywhere from 1 - K.
	if (DP[N][K] != 0) return DP[N][K];
	if (N == 0) return 1;
	else{
		return DP[N][K] = (((long long) K)*solve(N - 1, K) + solve(N - 1, K + 1))%MOD;
	}
}*/
int cnt = 10005; 
void evolve(){
	for (int i = 0; i < cnt - 1; i++){
		DP[i] = ((long long) i)*DP[i] + DP[i + 1];
		DP[i] %= MOD;
	}
	cnt--;
}
main(){
	int N; cin >> N;
	for (int i = 0; i < N; i++){
		cin >> a[i];
	}
	for (int i = 0; i < cnt; i++){
		DP[i] = 1;
	}
	ll res = 1;
	int mx = 1;
	for (int i = 0; i < N; i++){
		mxs[i] = mx;
		mx = max(mx, a[i]);
	}
	for (int i = N - 1; i >= 0; i--){
		//matches prefix of length i
		res += ((ll) a[i] - 1)*DP[mxs[i]];
		evolve();
		res %= MOD;
	}
	cout << res << endl;
}
컴파일 시 표준 에러 (stderr) 메시지
| # | 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... | ||||
| # | 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... | ||||
