# |
Submission time |
Handle |
Problem |
Language |
Result |
Execution time |
Memory |
485551 |
2021-11-08T08:23:28 Z |
sonho00 |
지우개 (GA4_eraser) |
C++17 |
|
16 ms |
3788 KB |
#include<bits/stdc++.h>
#define FOR(i,a,b) for(int i=a; i<=b; ++i)
using namespace std;
using ll=long long;
using ld=long double;
const ll MOD=1e9+7;
const ll MAX=1e5;
ll n;
ll dp[MAX+5][4];
int main(){
cin.tie(0)->sync_with_stdio(0);
cin>>n;
for(int i=0; i<n; ++i){
ll a;
cin>>a;
dp[a][1]=(dp[a][1]+a)%MOD;
}
for(int i=1; i<=MAX; ++i){
for(int j=2; j<=3; ++j){
dp[i][j]=(dp[i-1][j]+dp[i-1][j-1]*dp[i][1])%MOD;
}
}
cout<<dp[MAX][3];
}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
3 ms |
3404 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
2 ms |
3392 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
3 ms |
3404 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
3 ms |
3404 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
12 ms |
3788 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
16 ms |
3788 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |