Submission #40907

#TimeUTC-0UsernameProblemLanguageResultExecution timeMemory
409072018-02-09 22:56:54wzySterilizing Spray (JOI15_sterilizing)C++14
100 / 100
365 ms5292 KiB
#include <stdio.h>
#include <stdint.h>
#include <vector>
#define int long long
#define ll int
using namespace std;
int n , q, k ;
struct node{
ll sum = 0;
ll rmq = 0;
}st[1000000];
void build(int l = 0 , int r = n -1 , int curr = 1){
int mid = (l+r)/2;
if(l == r){
scanf("%lld" , &st[curr].sum);
st[curr].rmq = st[curr].sum;
return;
}
build(l , mid , 2*curr);
build(mid + 1 , r , 2*curr + 1);
st[curr].sum = st[2*curr].sum + st[2*curr + 1].sum;
st[curr].rmq = max(st[2*curr].rmq , st[2*curr + 1].rmq);
}
void set_value(int x , int v , int l = 0 , int r = n - 1 , int curr = 1){
int mid = (l+r)/2;
 
הההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההה
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

Compilation message (stderr)

sterilizing.cpp: In function 'void build(long long int, long long int, long long int)':
sterilizing.cpp:18:32: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
   scanf("%lld" , &st[curr].sum);
                                ^
sterilizing.cpp: In function 'int32_t main()':
sterilizing.cpp:81:38: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
  scanf("%lld%lld%lld" , &n , &q , &k);
                                      ^
sterilizing.cpp:85:39: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
   scanf("%lld%lld%lld" , &x,  &y , &z);
                                       ^
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...