제출 #77969

#제출 시각아이디문제언어결과실행 시간메모리
77969nxteruSterilizing Spray (JOI15_sterilizing)C++14
10 / 100
139 ms30560 KiB
#include <iostream> #include <algorithm> #include <vector> #include <set> #include <map> #include <queue> #include <stack> #include <cstdio> #include <cstring> #include <string> #include <math.h> using namespace std; typedef long long ll; typedef double D; typedef pair<int,int> P; #define M 1000000007 #define F first #define S second #define PB push_back #define INF 100000000000000000 ll n,q,k,seg[1<<18]; void up(int a,ll x){ a+=(1<<17)-1; seg[a]=x; while(a>0){ a=(a-1)/2; seg[a]=seg[a*2+1]+seg[a*2+2]; } } ll sum(int a,int b,int l,int r,int o){ if(r<a||b<l)return 0; if(a<=l&&r<=b)return seg[o]; return sum(a,b,l,(l+r-1)/2,o*2+1)+sum(a,b,(l+r+1)/2,r,o*2+2); } int main(void){ scanf("%lld%lld%lld",&n,&q,&k); for(int i=0;i<n;i++){ ll a; scanf("%lld",&a); up(i,a); } while(q){ ll s,a,b; scanf("%lld%lld%lld",&s,&a,&b); if(s==1){ up(a-1,b); } if(s==3){ printf("%lld\n",sum(a-1,b-1,0,(1<<17)-1,0)); } q--; } }

컴파일 시 표준 에러 (stderr) 메시지

sterilizing.cpp: In function 'int main()':
sterilizing.cpp:36:10: 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:39:14: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
         scanf("%lld",&a);
         ~~~~~^~~~~~~~~~~
sterilizing.cpp:44:14: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
         scanf("%lld%lld%lld",&s,&a,&b);
         ~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...