제출 #51500

#제출 시각아이디문제언어결과실행 시간메모리
51500vovinamFoehn Phenomena (JOI17_foehn_phenomena)C++14
0 / 100
92 ms6956 KiB
#include<bits/stdc++.h> #define int long long using namespace std; long long res,a[200005],b[200005],s,t; long long trans(long long a){ if(a<0){ return a*s; } return a*t; } signed main(){ int n,q; cin>>n>>q>>s>>t; for(int i=0;i<=n;i++){ cin>>a[i]; } for(int i=1;i<=n;i++){ b[i]=(a[i-1]-a[i]); res+=trans(b[i]); } for(int i=1;i<=q;i++){ long long l,r,x; scanf("%I64d%I64d%I64d",&l,&r,&x); if(l>0){ res-=trans(b[l]); b[l]-=x; res+=trans(b[l]); } if(r<n){ res-=trans(b[r+1]); b[r+1]+=x; res+=trans(b[r+1]); } printf("%I64d\n",res); } }

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

foehn_phenomena.cpp: In function 'int main()':
foehn_phenomena.cpp:23:35: warning: format '%d' expects argument of type 'int*', but argument 2 has type 'long long int*' [-Wformat=]
   scanf("%I64d%I64d%I64d",&l,&r,&x);
                           ~~      ^
foehn_phenomena.cpp:23:35: warning: format '%d' expects argument of type 'int*', but argument 3 has type 'long long int*' [-Wformat=]
foehn_phenomena.cpp:23:35: warning: format '%d' expects argument of type 'int*', but argument 4 has type 'long long int*' [-Wformat=]
foehn_phenomena.cpp:34:23: warning: format '%d' expects argument of type 'int', but argument 2 has type 'long long int' [-Wformat=]
   printf("%I64d\n",res);
                       ^
foehn_phenomena.cpp:23:8: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
   scanf("%I64d%I64d%I64d",&l,&r,&x);
   ~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...