Submission #1814842
Source Code Expand
#include <bits/stdc++.h> using namespace std; long n,m,t,k,a[200005],b[200005]; long long s; int main() { ios::sync_with_stdio(); cin.tie(NULL); cout.tie(NULL); cin>>n; for(int i=1;i<=n;i++){ cin>>a[i]; b[i]=a[i]; for(int j=i-1;j>=1;j--){ if(a[j]<a[i]){ b[i]+=b[j]; break; } else b[i]+=a[i]; } // cout<<b[i]<<" "; s=s+b[i]; } cout<<s; return 0; }
Submission Info
Submission Time | |
---|---|
Task | B - Minimum Sum |
User | vjudge3 |
Language | C++14 (GCC 5.4.1) |
Score | 0 |
Code Size | 491 Byte |
Status | TLE |
Exec Time | 2103 ms |
Memory | 3328 KB |
Judge Result
Set Name | Sample | All | ||||||
---|---|---|---|---|---|---|---|---|
Score / Max Score | 0 / 0 | 0 / 400 | ||||||
Status |
|
|
Set Name | Test Cases |
---|---|
Sample | example0, example1, example2 |
All | corner0, corner1, corner2, corner3, example0, example1, example2, maxrand0, maxrand1, maxrand2, rand0, rand1, rand2 |
Case Name | Status | Exec Time | Memory |
---|---|---|---|
corner0 | AC | 74 ms | 3328 KB |
corner1 | TLE | 2103 ms | 1536 KB |
corner2 | AC | 1 ms | 256 KB |
corner3 | TLE | 2103 ms | 2688 KB |
example0 | AC | 1 ms | 256 KB |
example1 | AC | 1 ms | 256 KB |
example2 | AC | 1 ms | 256 KB |
maxrand0 | AC | 79 ms | 3328 KB |
maxrand1 | AC | 78 ms | 3328 KB |
maxrand2 | AC | 78 ms | 3328 KB |
rand0 | AC | 1 ms | 256 KB |
rand1 | AC | 1 ms | 256 KB |
rand2 | AC | 1 ms | 256 KB |