Submission #8407646
Source Code Expand
#include<bits/stdc++.h> using namespace std; int a[10010]; int main(){ int n,b,c,ans=0; cin>>n>>b>>c; for(int i=0;i<n;++i) cin>>a[i]; for(int i=n-1;i>=0;--i){/ if(b>=c){ ans+=a[i]*c; break; } else{ ans+=a[i]*b; c-=b; continue; } } cout<<ans<<endl; return 0; }
Submission Info
Submission Time | |
---|---|
Task | B - ラー油 |
User | luogu_bot3 |
Language | C++ (GCC 5.4.1) |
Score | 0 |
Code Size | 408 Byte |
Status | CE |
Compile Error
./Main.cpp: In function ‘int main()’: ./Main.cpp:9:29: error: expected primary-expression before ‘/’ token for(int i=n-1;i>=0;--i){/ ^ ./Main.cpp:10:9: error: expected primary-expression before ‘if’ if(b>=c){ ^ ./Main.cpp:14:9: error: ‘else’ without a previous ‘if’ else{ ^