# | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
527210 | 2022-02-17T03:39:44 Z | beepbeepsheep | Calvinball championship (CEOI15_teams) | C++17 | 67 ms | 65540 KB |
#include <bits/stdc++.h> using namespace std; #define ll int #define ii pair<ll,ll> #define endl '\n' const ll inf=1e15; const ll mod=1e6+7; const ll maxn=105; vector<ll> dp[maxn][maxn]; void solve(ll digit, ll rem){ if (dp[digit][rem].size()) return; if (dp[digit][rem-1].empty()){ solve(digit,rem-1); } for (auto u:dp[digit][rem-1]){ for (int i=0;i<u;i++){ dp[digit][rem].push_back(u); } dp[digit][rem].push_back(u+1); } } int main(){ ios_base::sync_with_stdio(0); cin.tie(0); ll n,ele,ans=0; for (int i=1;i<=104;i++){ dp[i][0].emplace_back(i); } cin>>n; ll ele2=0,temp; for (int i=1;i<=n;i++){ cin>>ele; for (int j=1;j<ele;j++){ temp=max<ll>(j,ele2); solve(temp,n-i); ans+=dp[temp][n-i].size(); ans%=mod; } ele2=max(ele,ele2); } cout<<(ans+1)%mod; return 0; }
Compilation message
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Correct | 1 ms | 464 KB | Output is correct |
2 | Correct | 1 ms | 460 KB | Output is correct |
3 | Correct | 1 ms | 460 KB | Output is correct |
4 | Correct | 1 ms | 460 KB | Output is correct |
5 | Correct | 1 ms | 460 KB | Output is correct |
6 | Correct | 0 ms | 460 KB | Output is correct |
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Correct | 1 ms | 460 KB | Output is correct |
2 | Correct | 1 ms | 460 KB | Output is correct |
3 | Correct | 0 ms | 588 KB | Output is correct |
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Runtime error | 59 ms | 65536 KB | Execution killed with signal 9 |
2 | Halted | 0 ms | 0 KB | - |
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Runtime error | 55 ms | 65536 KB | Execution killed with signal 9 |
2 | Halted | 0 ms | 0 KB | - |
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Runtime error | 55 ms | 65540 KB | Execution killed with signal 9 |
2 | Halted | 0 ms | 0 KB | - |
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Runtime error | 67 ms | 65540 KB | Execution killed with signal 9 |
2 | Halted | 0 ms | 0 KB | - |
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Runtime error | 60 ms | 65540 KB | Execution killed with signal 9 |
2 | Halted | 0 ms | 0 KB | - |
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Runtime error | 55 ms | 65540 KB | Execution killed with signal 9 |
2 | Halted | 0 ms | 0 KB | - |
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Runtime error | 58 ms | 65540 KB | Execution killed with signal 9 |
2 | Halted | 0 ms | 0 KB | - |
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Runtime error | 58 ms | 65536 KB | Execution killed with signal 9 |
2 | Halted | 0 ms | 0 KB | - |