Submission #22862865
Source Code Expand
Copy
// UTF−8#include<bits/stdc++.h>using namespace std;using ll = long long int;using lc = complex<double>;/* #include<atcoder/all> *//* using namespace atcoder; */template<class T>bool chmax(T &a, const T &b) { return (a<b ? (a=b,1) : 0); }template<class T>bool chmin(T &a, const T &b) { return (a>b ? (a=b,1) : 0); }int main(void) {constexpr ll MOD = 1 ? 1e9+7 : 998244353;const double PI = acos(-1);constexpr double eps = 1e-10;cout << fixed << setprecision(32);cin.tie(0); ios::sync_with_stdio(false);
// UTF−8 #include<bits/stdc++.h> using namespace std; using ll = long long int; using lc = complex<double>; /* #include<atcoder/all> */ /* using namespace atcoder; */ template<class T>bool chmax(T &a, const T &b) { return (a<b ? (a=b,1) : 0); } template<class T>bool chmin(T &a, const T &b) { return (a>b ? (a=b,1) : 0); } int main(void) { constexpr ll MOD = 1 ? 1e9+7 : 998244353; const double PI = acos(-1); constexpr double eps = 1e-10; cout << fixed << setprecision(32); cin.tie(0); ios::sync_with_stdio(false); if(1) { ll n; cin >> n; vector<ll> a(n), b(n), c(n); for(auto &e: a) cin >> e; partial_sum(begin(a), end(a), begin(b)); partial_sum(begin(b), end(b), begin(c)); ll m = 0; for(ll i=0; i<n; i++) { chmax(m, a[i]); cout << c[i]+(i+1)*m << endl; } } return 0; }
Submission Info
Submission Time | |
---|---|
Task | A - Max Add |
User | cookies |
Language | C++ (GCC 9.2.1) |
Score | 400 |
Code Size | 955 Byte |
Status | AC |
Exec Time | 302 ms |
Memory | 8764 KB |
Compile Error
./Main.cpp: In function ‘int main()’: ./Main.cpp:16:18: warning: unused variable ‘MOD’ [-Wunused-variable] 16 | constexpr ll MOD = 1 ? 1e9+7 : 998244353; | ^~~ ./Main.cpp:17:18: warning: unused variable ‘PI’ [-Wunused-variable] 17 | const double PI = acos(-1); | ^~ ./Main.cpp:18:22: warning: unused variable ‘eps’ [-Wunused-variable] 18 | constexpr double eps = 1e-10; | ^~~
Judge Result
Set Name | Sample | All | ||||
---|---|---|---|---|---|---|
Score / Max Score | 0 / 0 | 400 / 400 | ||||
Status |
|
|
Set Name | Test Cases |
---|---|
Sample | sample_01.txt |
All | handmade_00.txt, handmade_01.txt, random_00.txt, random_01.txt, random_02.txt, random_03.txt, random_04.txt, random_05.txt, random_06.txt, random_07.txt, random_monotone_00.txt, random_monotone_01.txt, random_monotone_02.txt, random_monotone_03.txt, random_monotone_04.txt, random_monotone_05.txt, random_monotone_06.txt, random_monotone_07.txt, sample_01.txt, special_00.txt, special_01.txt |
Case Name | Status | Exec Time | Memory |
---|---|---|---|
handmade_00.txt | AC | 9 ms | 3584 KB |
handmade_01.txt | AC | 2 ms | 3552 KB |
random_00.txt | AC | 302 ms | 8632 KB |
random_01.txt | AC | 295 ms | 8628 KB |
random_02.txt | AC | 295 ms | 8636 KB |
random_03.txt | AC | 294 ms | 8620 KB |
random_04.txt | AC | 263 ms | 7708 KB |
random_05.txt | AC | 209 ms | 6200 KB |
random_06.txt | AC | 198 ms | 6276 KB |
random_07.txt | AC | 189 ms | 6104 KB |
random_monotone_00.txt | AC | 292 ms | 8524 KB |
random_monotone_01.txt | AC | 295 ms | 8500 KB |
random_monotone_02.txt | AC | 295 ms | 8624 KB |
random_monotone_03.txt | AC | 293 ms | 8636 KB |
random_monotone_04.txt | AC | 248 ms | 7160 KB |
random_monotone_05.txt | AC | 270 ms | 7920 KB |
random_monotone_06.txt | AC | 264 ms | 7756 KB |
random_monotone_07.txt | AC | 255 ms | 7468 KB |
sample_01.txt | AC | 4 ms | 3616 KB |
special_00.txt | AC | 291 ms | 7952 KB |
special_01.txt | AC | 295 ms | 8764 KB |