# |
Submission time |
Handle |
Problem |
Language |
Result |
Execution time |
Memory |
1071642 |
2024-08-23T09:33:53 Z |
vjudge1 |
Addk (eJOI21_addk) |
C++17 |
|
572 ms |
1176 KB |
#include<bits/stdc++.h>
using namespace std;
#define ll long long
#define nn "\n";
#define pb push_back
const int N = 1e5 + 8 ;
int n , k ;
ll a[N] ,q ;
signed main() {
ios_base::sync_with_stdio(0), cin.tie(0);
cin>> n >> k ;
for(int i= 1 ; i <= n ; i++){
cin>> a[i];
}
cin>> q ;
while(q--){
int h , l , r , m ;
cin>> h ;
if(h == 1 ){
int x ;
cin>> x ;
}
else {
cin >> l >> r >> m;
ll ans =0 , j = 1 ;
while(l < r ){
ans+=a[l]*j + a[r]*j;
j = min(j+ 1, ( r - l +1 )/ m*1ll);
l++, r--;
}
if( l == r ){
ans+=a[l]*j;
}
cout << ans << nn
}
}
} //abcdefg
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
0 ms |
344 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
297 ms |
600 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
572 ms |
1176 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |