# | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
632035 | 2022-08-19T10:33:24 Z | Jovan26 | Addk (eJOI21_addk) | C++14 | 2000 ms | 1764 KB |
#include<bits/stdc++.h> using namespace std; int main(){ ios_base::sync_with_stdio(false); cin.tie(NULL); long long n; cin>>n; long long k; cin>>k; long long a[n]; for(long i=0;i<n;i++) cin>>a[i]; long long q; cin>>q; bool p = false; vector<long long> v; for(long long j=0;j<q;j++){ int x; cin>>x; if(x==1){ int y; cin>>y; continue; } long long l,r,m; p = true; cin>>l>>r>>m; long long ma = min(m,(r-l+1-m+1)); long long rez = 0; for(long long i=l-1;i<l+ma-2;i++){ rez+=(i-l+2)*a[i]; } for(long long i=r-1;i>r-ma;i--){ rez+=(r-i)*a[i]; } for(long long i=l+ma-2;i<=r-ma;i++){ rez+=a[i]*ma; } v.push_back(rez); } if(p){ for(long long i=0;i<v.size()-1;i++) cout<<v[i]<<endl; cout<<v[v.size()-1]; } }
Compilation message
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Correct | 1 ms | 212 KB | Output is correct |
2 | Correct | 2 ms | 340 KB | Output is correct |
3 | Correct | 5 ms | 340 KB | Output is correct |
4 | Correct | 9 ms | 340 KB | Output is correct |
5 | Correct | 13 ms | 412 KB | Output is correct |
6 | Correct | 19 ms | 412 KB | Output is correct |
7 | Correct | 24 ms | 552 KB | Output is correct |
8 | Correct | 32 ms | 504 KB | Output is correct |
9 | Correct | 58 ms | 628 KB | Output is correct |
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Correct | 202 ms | 976 KB | Output is correct |
2 | Correct | 440 ms | 1468 KB | Output is correct |
3 | Correct | 781 ms | 1764 KB | Output is correct |
4 | Execution timed out | 2085 ms | 1648 KB | Time limit exceeded |
5 | Halted | 0 ms | 0 KB | - |
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Runtime error | 5 ms | 1236 KB | Execution killed with signal 11 |
2 | Halted | 0 ms | 0 KB | - |