Submission #855377


Source Code Expand

Copy
#include<cstdio>                                                                                                                                                        
  2 #include<functional>
  3 #include<algorithm>
  4 using namespace std;
  5 
  6 int main(){
  7 
  8   int x,y,n,k,ans=0;
  9   scanf("%d", &n);
 10 //  printf("%d",n);
 11   scanf("%d", &k);
 12 //  printf("%d",k);
 13   scanf("%d", &x);
 14 //  printf("%d",x);
 15   scanf("%d", &y);
 16 //  printf("%d",y);
 17 
 18   if(n>k){
 19     ans=k*x;
 20     ans+=((n-k)*y);
 21     printf("%d",ans);
 22     return 0;
 23   }
 24   ans=(n*x);
 25   printf("%d",ans);
 26   return 0;
 27 }

Submission Info

Submission Time
Task A - 高橋君とホテルイージー / Tak and Hotels (ABC Edit)
User anonymous28456
Language C++14 (GCC 5.4.1)
Score 0
Code Size 683 Byte
Status

Compile Error

./Main.cpp:2:5: error: stray ‘#’ in program
   2 #include<functional>
     ^
./Main.cpp:3:5: error: stray ‘#’ in program
   3 #include<algorithm>
     ^
./Main.cpp:2:3: error: expected unqualified-id before numeric constant
   2 #include<functional>
   ^
./Main.cpp:5:3: error: expected unqualified-id before numeric constant
   5 
   ^