submission_id
stringlengths
10
10
problem_id
stringlengths
6
6
language
stringclasses
3 values
code
stringlengths
1
522k
compiler_output
stringlengths
43
10.2k
s432363407
p04011
Java
import java.util.*; public class main { public static void main(String[] args) { Scanner in = new Scanner(System.in); int n = in.nextInt(); int k = in.nextInt(); int x = in.nextInt(); int y = in.nextInt(); int z; if (k > n) { System.out.println(...
Main.java:4: error: class main is public, should be declared in a file named main.java public class main { ^ 1 error
s446994935
p04011
C
/* C++ */ #include<bits/stdc++.h> using namespace std; typedef long long int ll; typedef pair<ll,ll> pint; const int MAX = 510000; const int MOD = 1000000007; #define rep(i, n) for(ll i = ll(0); i < ll(n); i++) #define Rep(i, n) for(ll i = ll(1); i < ll(n); i++) #define ALL(a) (a).begin(),(a).end() #define IOS ios::sy...
main.c:2:9: fatal error: bits/stdc++.h: No such file or directory 2 | #include<bits/stdc++.h> | ^~~~~~~~~~~~~~~ compilation terminated.
s990851476
p04011
Java
import java.util.*; public class Main{ public static void main(String[] args) { Scanner sc = new Scanner(System.in); int n = sc.nextInt(); int k = sc.nextInt(); int x = sc.nextInt(); int y = sc.nextInt(); if(n >= k){ int sum = k * x + (n - k) * ...
Main.java:18: error: cannot find symbol System.out.println(sum); ^ symbol: variable sum location: class Main 1 error
s661024620
p04011
C++
#include<iostream> #include<string> using namespace std; int data[26];// int main(){ string str; //int str; cin>>str; for(int i=0;i<str.size();i++){ //for(int i=0;i<strlen(str);i++){ int index = str.at(i)-'a'; //今見ている文字列をアルファベット昇順の順番の数に変換する data[index]++; //カウンタを増やす } int flag=0; //数え上げたアルファベットの数を確認する for(in...
a.cc: In function 'int main()': a.cc:16:9: error: reference to 'data' is ambiguous 16 | data[index]++; //カウンタを増やす | ^~~~ In file included from /usr/include/c++/14/string:53, from /usr/include/c++/14/bits/locale_classes.h:40, from /usr/include/c++/14/bits/ios_ba...
s840671160
p04011
C
#include <stdio.h> int main(void){ int N, K, X, Y; scanf("%d %d %d %d",&N, &K, &X, &Y); if(1<=Y<=X<=10000 && 1<=N<=10000 && 1<=K<=10000){ if (N<=K){ printf("%d\n", X*K); } else if (N>K){ printf("%d\n", X*K+Y*(N-K)); } else { printf("%s\n","Invalid."); } return 0; } ...
main.c: In function 'main': main.c:15:2: error: expected declaration or statement at end of input 15 | } | ^
s005319837
p04011
C
#include <stdio.h> int main(void){ int N, K, X, Y; scanf("%d %d %d %d",&N, &K, &X, &Y); if(1<=Y<=X<=10000 && 1<=N<=10000 && 1<=K<=10000){ if (N<=K){ printf("%d\n", X*K); } else if (N>K){ printf("%d\n", X*K+Y*(N-K); } else { printf("%s\n","Invalid."); } return 0; } ...
main.c: In function 'main': main.c:10:31: error: expected ')' before ';' token 10 | printf("%d\n", X*K+Y*(N-K); | ~ ^ | ) main.c:10:32: error: expected ';' before '}' token 10 | printf("%d\n", X*K+Y*(N-K); | ...
s430052282
p04011
C
#include <stdio.h> int main(void){ int N, K, X, Y; scanf("%d %d %d %d",&N, &K, &X, &Y); if(1<=Y<=X<=10000 && 1<=N<=10000 && 1<=K<=10000){ if (N<=K){ printf("%d\n", X*K); } else if (N>K){ printf("%d\n", X*K+Y*(N-K); } } else { printf("%s\n","Invalid."); } return 0; ...
main.c: In function 'main': main.c:10:31: error: expected ')' before ';' token 10 | printf("%d\n", X*K+Y*(N-K); | ~ ^ | ) main.c:10:32: error: expected ';' before '}' token 10 | printf("%d\n", X*K+Y*(N-K); | ...
s991284335
p04011
C++
#include<iostream> using namespace std; int main(){ int n,k,x,y; cin >> n >> k >> x >> y; if(n>=k){ cout << k*x+(n-k)*y << endl; } else{ cout << k:x << endl; } }
a.cc: In function 'int main()': a.cc:10:12: error: found ':' in nested-name-specifier, expected '::' 10 | cout << k:x << endl; | ^ | :: a.cc:10:11: error: 'k' is not a class, namespace, or enumeration 10 | cout << k:x << endl; | ^
s943130680
p04011
C++
#include<iostream.h> using namespace std; int main() { int n,k,x,y,i,sum=0; cin>>n; cin>>k; cin>>x; cin>>y; for(i=1;i<=n;i++) { if(i<=k) { sum+=x; } else { sum+=y; } } cout<<sum<<endl; return 0; }
a.cc:1:9: fatal error: iostream.h: No such file or directory 1 | #include<iostream.h> | ^~~~~~~~~~~~ compilation terminated.
s751153132
p04011
C++
#include<iostream> using namespace std; int main(){ int n,k,x,y; cin>>n>>k>>x>>y; if (n<=k){ cout<<n*x<<endl; } else{ cout<<(k-n)*y+n*x<<emdl; } }
a.cc: In function 'int main()': a.cc:12:28: error: 'emdl' was not declared in this scope 12 | cout<<(k-n)*y+n*x<<emdl; | ^~~~
s349709356
p04011
C++
#include<iostream> using namespace std; int main(){ int n,k,x,y; cin>>n>>k>>x>>y; if (n<=k){ cout<<n*x<<endl; } else{ cout<<(k-n)*y+n*x<<emdl; } }
a.cc: In function 'int main()': a.cc:12:28: error: 'emdl' was not declared in this scope 12 | cout<<(k-n)*y+n*x<<emdl; | ^~~~
s135796425
p04011
C++
#include<bits/stdc++.h> using namespace std; int main(void){ int n,k,x,y; cin>>n>>k>>x>>y; ll ans=0; for(int i=1;i<=n;i++){ if(i<=k) ans+=x; else ans+=y; } cout<<ans<<endl; }
a.cc: In function 'int main()': a.cc:7:5: error: 'll' was not declared in this scope 7 | ll ans=0; | ^~ a.cc:10:9: error: 'ans' was not declared in this scope; did you mean 'abs'? 10 | ans+=x; | ^~~ | abs a.cc:12:9: error: 'ans' was not declared in this scope; di...
s406083447
p04011
C++
#include <bits/stdc++>h> using namespace std; int main() { int a, b, x, y; cin >> a >> b >> x >> y; cout << a * x + (b - a) * y << endl; }
a.cc:1:24: warning: extra tokens at end of #include directive 1 | #include <bits/stdc++>h> | ^ a.cc:1:10: fatal error: bits/stdc++>: No such file or directory 1 | #include <bits/stdc++>h> | ^~~~~~~~~~~~~~ compilation terminated.
s126462985
p04011
C++
/** * auther: moririn_cocoa */ // #pragma GCC target("avx") // CPU 処理並列化 // #pragma GCC optimize("O3") // CPU 処理並列化 // #pragma GCC optimize("unroll-loops") // 条件処理の呼び出しを減らす // #define BEGIN_STACK_EXTEND(size) void * stack_extend_memory_ = malloc(size);void * stack_extend_origin_memory_;char * stack_extend_dummy_me...
a.cc: In function 'int main(int, char**)': a.cc:58:11: error: expected '(' before '{' token 58 | else if { | ^ | (
s685201130
p04011
C++
#include <iostream> using namespace std; int main(void){ int n, k, x, y; if (n >= k){ cout << n * x << endl;} if(n < k) { cout << (n - k) * y + k * x; << endl;} return 0; }
a.cc: In function 'int main()': a.cc:8:34: error: expected primary-expression before '<<' token 8 | cout << (n - k) * y + k * x; << endl;} | ^~
s817912205
p04011
C++
#include <iostream> using namespace std; int main(void){ int n, k, x, y; if (n >= k){ cout << k * x << endl; } if(n > k) { cout << (n - k) * y + k * x; << endl; } return 0; }
a.cc: In function 'int main()': a.cc:9:34: error: expected primary-expression before '<<' token 9 | cout << (n - k) * y + k * x; << endl; | ^~
s458780261
p04011
C++
#include <iostream> using namespace std; int main(void){ int n, k, x, y; if (n >= k){ cout << k * x << endl; if(n > k) { cout << (n - k) * y + k * x; << endl; return 0; }
a.cc: In function 'int main()': a.cc:8:34: error: expected primary-expression before '<<' token 8 | cout << (n - k) * y + k * x; << endl; | ^~ a.cc:11:2: error: expected '}' at end of input 11 | } | ^ a.cc:5:14: note: to match this '{' 5 | if (n >= k){ ...
s139985743
p04011
C
#include <stdio.h> void main(){ int i,k,n,x,y,total; scanf("%d",&n); scanf("%d",&k); scanf("%d",&x); scanf("%d",&y); for( i = 1; i < n, i++ ) { if( i <= k ) { total += x; } else { total += y; } } printf( "%d", total ); return; }
main.c: In function 'main': main.c:11:25: error: expected ';' before ')' token 11 | for( i = 1; i < n, i++ ) { | ^~ | ;
s074113744
p04011
C
#include <stdio.h> void main(){ int i,k,n,x,y,total; scanf("%d",n); scanf("%d",k); scanf("%d",x); scanf("%d",y); for( i = 1; i < n, i++ ) { if( i <= k ) { total += x; } else { total += y; } printf( "%d", total ); return; }
main.c: In function 'main': main.c:11:25: error: expected ';' before ')' token 11 | for( i = 1; i < n, i++ ) { | ^~ | ; main.c:21:1: error: expected declaration or statement at end of input 21 | } | ^
s922656944
p04011
C++
#include <iostream> using namespace std; int main(void){ int n, k, x, y; cin>>n>>k>>x>>y; if (n=<k){ int ans=n*x; cout<<ans<<endl; } else { int a=k*y, b=(n-k)*y; int ans=a+b; cout<<ans<<endl; } return 0; }
a.cc: In function 'int main()': a.cc:6:11: error: expected primary-expression before '<' token 6 | if (n=<k){ | ^
s934482132
p04011
C++
#include<bits/stdc++.h> int main(){ int N,K,X,Y,S; cin >>N>>K>>X>>Y; if(N>=K){ S=K*X+(N-K)*Y; cout <<S<<endl;} else{ S=N*X; cout <<S<<endl; } return 0; }
a.cc: In function 'int main()': a.cc:5:3: error: 'cin' was not declared in this scope; did you mean 'std::cin'? 5 | cin >>N>>K>>X>>Y; | ^~~ | std::cin In file included from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:146, from a.cc:1: /usr/include/c++/14/iostream:62:18: not...
s456428001
p04011
C++
#include<bits/stdc++.h> int main(){ int N,K,X,Y,S; cin >>N>>K>>X>>Y; if(N>=K){ S=(N-K+1)*X+(N-K)*Y; cout <<S<<endl;} else{ S=N*X; cout <<S<<endl; } return 0; }
a.cc: In function 'int main()': a.cc:5:3: error: 'cin' was not declared in this scope; did you mean 'std::cin'? 5 | cin >>N>>K>>X>>Y; | ^~~ | std::cin In file included from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:146, from a.cc:1: /usr/include/c++/14/iostream:62:18: not...
s619457929
p04011
C++
#include <bits/stdc++.h> using namespace std; int main(){ long long n,k,x,y; cin>>n>>k>>x>>y; cout<<min(k,n)*x+max(0,n-k)*y; }
a.cc: In function 'int main()': a.cc:8:29: error: no matching function for call to 'max(int, long long int)' 8 | cout<<min(k,n)*x+max(0,n-k)*y; | ~~~^~~~~~~ In file included from /usr/include/c++/14/algorithm:60, from /usr/include/x86_64-linux-gnu/c++/14/bits/...
s731562038
p04011
C++
スコード Copy Copy #include <bits/stdc++.h> using namespace std; int main() { int n, k, x, y; cin >> n >> k >> x >> y; int total = 0; for (int i = 1; i <= n; i++) { if (i <= k) { total += x; } else if (i > k) { total += y; } }
a.cc:1:1: error: '\U000030b9\U000030b3\U000030fc\U000030c9' does not name a type 1 | スコード | ^~~~~~~~ In file included from /usr/include/c++/14/bits/stl_algobase.h:62, from /usr/include/c++/14/algorithm:60, from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:51, ...
s958258538
p04011
C++
#include <bits/stdc++.h> using namespace std; int main() { int n, k, x, y; cin >> n >> k >> x >> y; int total = 0; for (int i = 1; i <= n; i++) { if (int i <= k) { total += x; } else if (i > k) { total += y; } } cout << total << endl; }
a.cc: In function 'int main()': a.cc:10:15: error: expected initializer before '<=' token 10 | if (int i <= k) { | ^~ a.cc:10:14: error: expected ')' before '<=' token 10 | if (int i <= k) { | ~ ^~~ | )
s952289052
p04011
Java
import java.util.Scanner; public class Abc044a { public static void main(String args[]) { Scanner sc = new Scanner(System.in); // 入力(n) int n = sc.nextInt(); // 入力(k) int k = sc.nextInt(); // 入力(x) int x = sc.nextInt(); // 入力(y) int y = sc.ne...
Main.java:3: error: class Abc044a is public, should be declared in a file named Abc044a.java public class Abc044a { ^ 1 error
s375250603
p04011
C++
#include<bits/stdc++.h> using namespace std; int main() { int n,k,x,y; cin>>n>>k>>x>>; cout<<k*x+(n-k)*y<<endl; }
a.cc: In function 'int main()': a.cc:6:19: error: expected primary-expression before ';' token 6 | cin>>n>>k>>x>>; | ^
s298726585
p04011
C++
using namespace std; int counts = 0; int sum(vector<int> li, int size) { int sum = 0; for (int i = 0; i< size; i++) { sum +=li[i]; } return sum; } void agg(vector<int> car, int avg,int size ){ if(size>=2) { if ( sum(car, size)/size== avg){ counts+=1; } ...
a.cc:5:9: error: 'vector' was not declared in this scope 5 | int sum(vector<int> li, int size) { | ^~~~~~ a.cc:1:1: note: 'std::vector' is defined in header '<vector>'; this is probably fixable by adding '#include <vector>' +++ |+#include <vector> 1 | using namespace std; a.cc:5:16: error: expec...
s567469596
p04011
C++
#include <bits/stdc++.h> using namespace std; int main() { int N,K,X,Y; cin>>N>>K>>X>>Y; if(N<=K){ cout<<X*K<<endl; } else{ cout<<X*N+Y*(K-N)<<endl; }
a.cc: In function 'int main()': a.cc:11:3: error: expected '}' at end of input 11 | } | ^ a.cc:3:14: note: to match this '{' 3 | int main() { | ^
s563201602
p04011
C++
#include <iostream> #include <vector> #include <string> using namespace std; int main() { string w = ""; cin >> w; bool test = true; vector <char> tested; for (int i = 0; i < w.size()-1; i++) { if (find(tested.begin(), tested.end(), w[i]) == tested.end()) { ...
a.cc: In function 'int main()': a.cc:15:17: error: no matching function for call to 'find(std::vector<char>::iterator, std::vector<char>::iterator, __gnu_cxx::__alloc_traits<std::allocator<char>, char>::value_type&)' 15 | if (find(tested.begin(), tested.end(), w[i]) == tested.end()) | ~~~~^...
s853670267
p04011
C++
#include <iostream> #include <vector> #include <string> using namespace std; int main() { string w = ""; cin >> w; sort(w.begin(), w.end()); bool test = true; vector <char> tested; for (int i = 0; i < w.size()-1; i++) { if (find(tested.begin(), tested.end(), w[i]) == tested.end()) ...
a.cc: In function 'int main()': a.cc:11:5: error: 'sort' was not declared in this scope; did you mean 'short'? 11 | sort(w.begin(), w.end()); | ^~~~ | short a.cc:16:17: error: no matching function for call to 'find(std::vector<char>::iterator, std::vector<char>::iterator, __gnu_cxx::__alloc_t...
s441942702
p04011
C++
#include <iostream> using namespace std; int main() { int n, k, x, y, ret; cin << n; cin << k; cin << x; cin << y; ret = k * x + (n - k) * y; cout << ret << endl; }
a.cc: In function 'int main()': a.cc:6:7: error: no match for 'operator<<' (operand types are 'std::istream' {aka 'std::basic_istream<char>'} and 'int') 6 | cin << n; | ~~~ ^~ ~ | | | | | int | std::istream {aka std::basic_istream<char>} a.cc:6:7: note: candidate: 'operat...
s448639404
p04011
C++
#include <bits/stdc++.h> using namespace std; int main() { int N, K, X, Y; cin N >> K >> X >> Y; cout << K*X + Y*(N-K); }
a.cc: In function 'int main()': a.cc:6:6: error: expected ';' before 'N' 6 | cin N >> K >> X >> Y; | ^~ | ;
s243315111
p04011
C++
#include <bits/stdc++.h> using namespace std; typedef long long ll; typedef unsigned long long ull; typedef pair<int,int> P; #define all(v) v.begin(), v.end() const ll mod=1000000007; ll countBits(ll in){ int res=0; for(;in>0;in>>=1){ if((in&0x01)!=0){ res++; } } return res; } template<typenam...
a.cc: In function 'int main()': a.cc:89:24: error: no matching function for call to 'max(int, ll)' 89 | ll ans=min(n,k)*x+max(0,n-k)*y; | ~~~^~~~~~~ In file included from /usr/include/c++/14/algorithm:60, from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:51, ...
s694082474
p04011
Java
import java.util.*; public class Main { public static void main(String[] args) { Scanner sc = new Scanner(); // 整数の入力 int N = sc.nextInt(); int K = sc.nextInt(); int X = sc.nextInt(); int Y = sc.nextInt(); // 宿泊費の合計を計算 int sum = 0; if (N<=K) { sum = N * X; } else { ...
Main.java:4: error: no suitable constructor found for Scanner(no arguments) Scanner sc = new Scanner(); ^ constructor Scanner.Scanner(Readable,Pattern) is not applicable (actual and formal argument lists differ in length) constructor Scanner.Scanner(Readable) is not applicable (...
s320024981
p04011
Java
import java.util.*; public class Main { public static void main(String[] args) { Scanner sc = new Scanner(); // 整数の入力 int N = sc.nextInt(); int K = sc.nextInt(); int X = sc.nextInt(); int Y = sc.nextInt(); // 宿泊費の合計を計算 int sum; if (N<=K) { sum = N * X; } else { sum ...
Main.java:4: error: no suitable constructor found for Scanner(no arguments) Scanner sc = new Scanner(); ^ constructor Scanner.Scanner(Readable,Pattern) is not applicable (actual and formal argument lists differ in length) constructor Scanner.Scanner(Readable) is not applicable (...
s780195723
p04011
Java
import java.util.*; public class Main { public static void main(String[] args){ Scanner sc = new Scanner(System.in); int n = sc.nextInt(); int k = sc.nextInt(); int x = sc.nextInt(); int y = sc.nextInt(); int sum = 0; if((n-k) >= 0){ sum += (k*x)+((n-k)*y); }else{ sum ...
Main.java:14: error: ';' expected sum += n*x ^ 1 error
s755326512
p04011
C++
#include <bits/stdc++.h> using namespace std; int main(){ int N, K, X, Y; cin >> N; cin >> K; cin >> X; cin >> Y; int sum; if (N>K){ sum = K*X+(N-K)*Y; } else { sum = N*X; }
a.cc: In function 'int main()': a.cc:16:2: error: expected '}' at end of input 16 | } | ^ a.cc:4:11: note: to match this '{' 4 | int main(){ | ^
s605601948
p04011
C++
#include <bits/stdc++.h> using namespace std; int main () { int n,k,x,y; cin >>n>>k>>x>>y; if(n <= k) { answer == k*x } else { answer == k*x+(n-k)*y } cout << answer << endl; }
a.cc: In function 'int main()': a.cc:9:5: error: 'answer' was not declared in this scope 9 | answer == k*x | ^~~~~~ a.cc:11:5: error: 'answer' was not declared in this scope 11 | answer == k*x+(n-k)*y | ^~~~~~ a.cc:13:11: error: 'answer' was not declared in this scope 13 | cout <...
s088631690
p04011
C++
#include <bits/stdc++.h> using namespace std; int main () { int n,k,x,y; cin >>n>>k>>x>>y; cout >> n*y-k*(x-y) >> endl; }
a.cc: In function 'int main()': a.cc:8:8: error: no match for 'operator>>' (operand types are 'std::ostream' {aka 'std::basic_ostream<char>'} and 'int') 8 | cout >> n*y-k*(x-y) >> endl; | ~~~~ ^~ ~~~~~~~~~~~ | | | | | int | std::ostream {aka std::basic_ostream<cha...
s558750379
p04011
C++
#include <bits/stdc++.h> using namespace std; int main () { int n,k,x,y; cin >>n>>k>>x>>y; cout >> n*y-K*(x-y) >> endl; }
a.cc: In function 'int main()': a.cc:8:15: error: 'K' was not declared in this scope 8 | cout >> n*y-K*(x-y) >> endl; | ^
s649830403
p04011
C++
#include <bits/stdc++.h> using namespace std; int main(){ int n,k,x,y; cin >> n >> k >> x >> y; if(n<=k){ cout << n*x << endl; } else if{ cout << k*x + (n-k)*y << endl; } }
a.cc: In function 'int main()': a.cc:10:10: error: expected '(' before '{' token 10 | else if{ | ^ | (
s988957606
p04011
C++
#include <bits/stdc++.h> using namespace std; int main() { int N,K,X,Y,A; cin >> N; cin >> K; cin >> X; cin >> Y; if(N<K){ a=X*N; }else{ a=X*K+Y*(N-K); } cout << a << endl; }
a.cc: In function 'int main()': a.cc:12:5: error: 'a' was not declared in this scope 12 | a=X*N; | ^ a.cc:14:5: error: 'a' was not declared in this scope 14 | a=X*K+Y*(N-K); | ^ a.cc:16:11: error: 'a' was not declared in this scope 16 | cout << a << endl; | ^
s283483456
p04011
C++
#include <iostream> #include <bitset> #include <vector> #include <string> #include <algorithm> #include <set> #include <map> using namespace std; using ll = long long int; using dd = long double; const ll MOD = 1e9 + 7; vector<string> dfs(string s, ll depth, vector<char> symbol) { vector<string> ret; if (depth...
a.cc: In function 'int main()': a.cc:47:16: error: no matching function for call to 'min(ll, int)' 47 | cout << min(N - K, 0) * Y + min(N, K) * X << endl; | ~~~^~~~~~~~~~ In file included from /usr/include/c++/14/string:51, from /usr/include/c++/14/bits/locale_classes.h:40, ...
s631326604
p04011
C++
#include <bits/stdc++.h> using namespace std; int main() { int a,b,c; cin >> a >> b >> c >> d; int answer == b*c + ( a-b ) * b cout << answer << endl; }
a.cc: In function 'int main()': a.cc:6:25: error: 'd' was not declared in this scope 6 | cin >> a >> b >> c >> d; | ^ a.cc:8:14: error: expected initializer before '==' token 8 | int answer == b*c + ( a-b ) * b | ^~
s647796537
p04011
C++
#include <iostream> #include <string> using namespace std; int main() { int N, K, X, Y; int sum; cin >> N >> K >> X >> Y; if (N > K) { sum = K * X + (N-K) * Y } else sum = N * X cout << sum << endl; }
a.cc: In function 'int main()': a.cc:13:28: error: expected ';' before '}' token 13 | sum = K * X + (N-K) * Y | ^ | ; 14 | } | ~ a.cc:15:19: error: expected ';' before 'cout' 15 | else sum = N * X |...
s737842174
p04011
C++
#include <iostream> using namespace std; int test(int current,int max_day,int p_up,int price1,int price2){ if(current==max_day and current>p_up){ return price2; } else if(current==max_day and current<=p_up){ return price1; } else if(current<=p_up){ return test(current+1,max_day,p_up,price1,pr...
a.cc: In function 'int main()': a.cc:28:13: error: too few arguments to function 'int test(int, int, int, int, int)' 28 | cout<<test(n,k,x,y); | ~~~~^~~~~~~~~ a.cc:5:5: note: declared here 5 | int test(int current,int max_day,int p_up,int price1,int price2){ | ^~~~ a.cc: In function 'in...
s501274484
p04011
C++
#include <bits/stdc> using namespace std; int main() { int k,x,y,n; cin >> k >> x >> y >> n; if (n <= k) { cout << x*n << endl; } else { int z = k*x; z += (n-k)*y; cout << z << endl; } }
a.cc:1:10: fatal error: bits/stdc: No such file or directory 1 | #include <bits/stdc> | ^~~~~~~~~~~ compilation terminated.
s687810912
p04011
C++
#include <bits/stdc++.h> using namespace std; int main(){ int N,K,X,Y; cin >> N >> K >> X >> Y; if(K>N){ cout << N*X << endl; } else{ cout << (N-K)*Y+K*X << endl; }
a.cc: In function 'int main()': a.cc:13:4: error: expected '}' at end of input 13 | } | ^ a.cc:4:11: note: to match this '{' 4 | int main(){ | ^
s981984082
p04011
C++
#include <bits/stdc++.h> using namespace std; int main() { int N, K, X, Y; cin << N << K << X << Y; if (N <= K){ cout << N*X << endl; } else{ cout << N*X+(N-K)*Y << endl; } }
a.cc: In function 'int main()': a.cc:6:7: error: no match for 'operator<<' (operand types are 'std::istream' {aka 'std::basic_istream<char>'} and 'int') 6 | cin << N << K << X << Y; | ~~~ ^~ ~ | | | | | int | std::istream {aka std::basic_istream<char>} a.cc:6:7: note: can...
s171647572
p04011
Java
import java.util.*; public class Main{ public static void main(String[] args){ Scanner sc = new Scanner(System.in); int n = sc.nextInt(); int k = sc.nextInt(); int x = sc.nextInt(); int y = sc.nextInt(); if(n-k<0){ System.out.println(n*x); }else{ ...
Main.java:13: error: cannot find symbol System.out.printnln(k*x+(n-k)*y); ^ symbol: method printnln(int) location: variable out of type PrintStream 1 error
s529214332
p04011
C++
include<bits/stdc++.h> using namespace std; int main(){ int N,K,X,Y; cin>>N>>K>>X>>Y; if(N<=K) cout<<N*X<<endl; else cout<<K*X+(N-K)*Y<<endl; return 0; }
a.cc:1:1: error: 'include' does not name a type 1 | include<bits/stdc++.h> | ^~~~~~~ a.cc: In function 'int main()': a.cc:5:3: error: 'cin' was not declared in this scope 5 | cin>>N>>K>>X>>Y; | ^~~ a.cc:7:5: error: 'cout' was not declared in this scope 7 | cout<<N*X<<endl; | ^~...
s918212380
p04011
C++
#include <bits/stdc++.h> using namespace std; int main() { int N , K , X , Y ; cin >> N >> K >> X >> Y : cout << K*X + (N-K)*Y << endl; }
a.cc: In function 'int main()': a.cc:6:27: error: found ':' in nested-name-specifier, expected '::' 6 | cin >> N >> K >> X >> Y : | ^ | :: a.cc:6:25: error: 'Y' is not a class, namespace, or enumeration 6 | cin >> N >> K >> X >> Y : | ...
s567832284
p04011
C++
#include <bits/stdc++.h> using namespace std; int main() { int n, k, x, y; int ans = 0; cin >> n >> endl; cin >> k >> endl; cin >> x >> endl; cin >> y >> endl; if (n <= k) { ans = x * k; } else { ans = x * k + y * (n-k); } cout << ans << endl; }
a.cc: In function 'int main()': a.cc:7:12: error: no match for 'operator>>' (operand types are 'std::basic_istream<char>::__istream_type' {aka 'std::basic_istream<char>'} and '<unresolved overloaded function type>') 7 | cin >> n >> endl; | ~~~~~~~~~^~~~~~~ In file included from /usr/include/c++/14/sstream...
s065326112
p04011
C++
#include <bits/stdc++.h> using namespace std; int main() { int n, k, x, y int ans = 0; cin >> n >> k >> x >> y; if (n <= k) { ans = x * k; } else { ans = x * k + y * (n-k); } cout << ans << endl; }
a.cc: In function 'int main()': a.cc:6:3: error: expected initializer before 'int' 6 | int ans = 0; | ^~~ a.cc:7:25: error: 'y' was not declared in this scope 7 | cin >> n >> k >> x >> y; | ^ a.cc:9:5: error: 'ans' was not declared in this scope; did you mean 'abs'? ...
s676355694
p04011
C++
#include <bits/stdc++.h> using namespace std; //long long using ll = long long; // pair<int, int> using PII = pair<int, int>; //最大値、mod const int MOD = 1000000007; const int mod = 1000000007; const int INF = 1000000000; const long long LINF = 1e18; const int MAX = 510000; //出力系 #define print(x) cout << x <...
a.cc: In function 'int main()': a.cc:191:7: error: 'i' was not declared in this scope 191 | for(i, k) ans += x; | ^ a.cc:192:3: error: expected primary-expression before 'for' 192 | for(i, n - k) ans += y; | ^~~ a.cc:191:22: error: expected ';' before 'for' 191 | for(i, k) ans += x; ...
s124737650
p04011
C++
#include <bits/stdc++.h> using namespace std; typedef long long ll; #define rep(i,n) for (int i = 0; i < (int)(n); i++) int main( void ) { int n,k,x,y; cin >> n >> k >> x >. y; int ans = k * x + (n - k) * y; cout << ans << endl; }
a.cc: In function 'int main()': a.cc:9:25: error: expected primary-expression before '.' token 9 | cin >> n >> k >> x >. y; | ^
s082279643
p04011
C++
n,k,x,y=[int(input())for _ in [0]*4] print(n*x) if n<k else print(y*(n-k)+x*k)
a.cc:1:1: error: 'n' does not name a type 1 | n,k,x,y=[int(input())for _ in [0]*4] | ^
s110828310
p04011
C++
#include <iostream> using namespace std; int main() { int N, A; cin >> N >> A; int x[53]; int sum = 0; for (int i = 0; i < N; i++) { cin >> x[i]; sum += x[i]; } long long dp[53][2550][53] = { 0 }; dp[0][0][0] = 1; for (int i = 0; i < N; i++) { for (int k = 0; k <= i; k++) { for (int j = 0; j <= sum;...
a.cc:40:5: error: redefinition of 'int main()' 40 | int main() { | ^~~~ a.cc:4:5: note: 'int main()' previously defined here 4 | int main() { | ^~~~
s114021807
p04011
C++
include <iostream> using namespace std ; int main() { int N, K, X, Y, sum ; cin >> N >> K >> X >> Y ; if( N >= K ) sum = X*N ; else sum = (X*K)+Y*(N-K) ; cout << sum << '\n' ; return 0 ; }
a.cc:1:1: error: 'include' does not name a type 1 | include <iostream> | ^~~~~~~ a.cc: In function 'int main()': a.cc:7:5: error: 'cin' was not declared in this scope 7 | cin >> N >> K >> X >> Y ; | ^~~ a.cc:14:5: error: 'cout' was not declared in this scope 14 | cout << sum << '\n' ;...
s119088518
p04011
C++
int main() { int whole,key,be,af; cin >> whole; cin >> key; cin >> be; cin >> af; if(whole >= key){ cout << (whole - key + 1) * be + (whole - key) * af << endl; } else{ cout << whole * key << endl; } }
a.cc: In function 'int main()': a.cc:4:5: error: 'cin' was not declared in this scope 4 | cin >> whole; | ^~~ a.cc:9:5: error: 'cout' was not declared in this scope 9 | cout << (whole - key + 1) * be + (whole - key) * af << endl; | ^~~~ a.cc:9:60: error: 'endl' was not declared in th...
s971863478
p04011
Java
public static void main(String[] args) { System.out.println( new App().calcCost( toInt(args[0]) ,toInt(args[1]) ,toInt(args[2]) ,toInt(args[3]) ) ); } public static int toInt (String a) { ...
Main.java:1: error: unnamed classes are a preview feature and are disabled by default. public static void main(String[] args) { ^ (use --enable-preview to enable unnamed classes) 1 error
s310867755
p04011
C++
Copy Copy #include <bits/stdc++.h> using namespace std; typedef long long ll; typedef unsigned long long ull; int main() { ios::sync_with_stdio(0); cin.tie(0); ll n, k, x, y; cin >> n >> k >> x >> y; cout << x*min(k, n)+y*min((n-k), 0) << endl; }
a.cc:1:1: error: 'Copy' does not name a type 1 | Copy | ^~~~ In file included from /usr/include/c++/14/bits/stl_algobase.h:62, from /usr/include/c++/14/algorithm:60, from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:51, from a.cc:3: /usr/include/c++/14/...
s795645212
p04011
C++
#include <bits/stdc++.h> using namespace std; typedef long long ll; int main() { int n,k,x,y; cin >> n >> k >> x >> y; if(n>k){ cout << x*k << endl; } else{ cout << n*k-(n-k)*x-y << endl; } } f
a.cc:16:1: error: 'f' does not name a type 16 | f | ^
s695798452
p04011
C++
#include <iostream> int main() { int N, K, X, Y; std::cin >> N >> K >> X >> Y; if (N - K > 0) std::cout << K*X + (N-K)*Y; else std::out << N*X; return 0; }
a.cc: In function 'int main()': a.cc:9:13: error: 'out' is not a member of 'std'; did you mean 'oct'? 9 | else std::out << N*X; | ^~~ | oct
s417470583
p04011
C++
#include<bits/stdc++.h> using namespace std; int main() { int n,k,x,y; cin>>n>>k>>x>>y; if(n<=k) int l=k*x; else int l=k*x + (n-k)*y; cout<<l; return 0; }
a.cc: In function 'int main()': a.cc:12:9: error: 'l' was not declared in this scope 12 | cout<<l; | ^
s743145361
p04011
C++
#include <iostream> int main() { std::ios_base::sync_with_stdio(false); std::cin.tie(nullptr); std::cout.tie(nullptr); int n, k, x, y; std::cin >> n > k >> x >> y; if (n > k) { std::cout << (k * x + (n - k) * y) << '\n'; } else { std::cout << (n * x) << '\n'; } }
a.cc: In function 'int main()': a.cc:9:17: error: no match for 'operator>' (operand types are 'std::basic_istream<char>::__istream_type' {aka 'std::basic_istream<char>'} and 'int') 9 | std::cin >> n > k >> x >> y; | ~~~~~~~~~~~~~ ^ ~~~~~~~~~~~ | | | | | ...
s078742157
p04011
C
/* Anki:未済 作成日: */ #include <stdio.h> int main() { int n, k, x, y, cost; scanf( "%d\n%d\n%d\n%d", &n, &k, &x, &y ); if( n < k+1 ) { cost = x * k; return 0; } else { cost = x * k + y * ( n-k ) } printf( "%d", cost ); return 0; }
main.c: In function 'main': main.c:20:35: error: expected ';' before '}' token 20 | cost = x * k + y * ( n-k ) | ^ | ; 21 | } | ~
s536683602
p04011
C
/* Anki:未済 作成日: */ #include <stdio.h> int main() { int n, k, x, y; scanf( "%d\n%d\n%d\n%d", &n, &k, &x, &y ); if( n < k+1 ) { cost = x * k; return 0; } else { cost = x * k + y * ( n-k ) } printf( "%d", cost ); return 0; }
main.c: In function 'main': main.c:15:9: error: 'cost' undeclared (first use in this function) 15 | cost = x * k; | ^~~~ main.c:15:9: note: each undeclared identifier is reported only once for each function it appears in main.c:20:35: error: expected ';' before '}' token 20 | cost = ...
s673730316
p04011
C
5 3 10000 9000
main.c:1:1: error: expected identifier or '(' before numeric constant 1 | 5 | ^
s089107627
p04011
C++
#include"bits/stdc++.h" using namespace std; int main() { int N, K, X, Y; cin >> N >> K >> X >> Y; int sum = 0; for (int i = 0; i < N + 1; i++) { if (i < K + 1) { sum += X; } else { sum += Y; } } cout << sum << endl; } #include"bits/stdc++.h" using namespace std; int main() { int N, K, X, Y; ci...
a.cc:22:5: error: redefinition of 'int main()' 22 | int main() { | ^~~~ a.cc:4:5: note: 'int main()' previously defined here 4 | int main() { | ^~~~
s531040653
p04011
C
#include <stdio.h> #include <limits.h> int main() { int t,x,y,z,p; scanf("%d%d%d%d",&x,&y,&z,&p); (x>y)? t=y*z+(x-y)*p: t=x*z; printf("%d",t); return 0; }
main.c: In function 'main': main.c:7:6: error: lvalue required as left operand of assignment 7 | t=x*z; | ^
s848280652
p04011
C++
#include <bits/stdc++.h> using namespace std; int main() { ios_base::sync_with_stdio(false); cin.tie(0); cout.tie(0); long long n, k, x, y, ans = 0; cin >> n >> k >> x >> y; ans = min(n, k) *x; ans += max(0, n-k) * y; cout << ans << '\n'; return 0; }
a.cc: In function 'int main()': a.cc:14:19: error: no matching function for call to 'max(int, long long int)' 14 | ans += max(0, n-k) * y; | ~~~^~~~~~~~ In file included from /usr/include/c++/14/algorithm:60, from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:51, ...
s237440525
p04011
C++
#include<stdc++.h> using namespace std; int main(){ int N,K,X,Y;cin >> N >> K >> X >> Y; if (N <= K){ cout << X*N << endl; }else{ cout << X*K+Y*(N-K) << endl; } }
a.cc:1:9: fatal error: stdc++.h: No such file or directory 1 | #include<stdc++.h> | ^~~~~~~~~~ compilation terminated.
s626511435
p04011
C++
int N,K,X,Y;cin >> N >> K >> X >> Y; if (N <= K){ cout << X*N << endl; }else{ cout << X*K+Y*(N-K) << endl; }
a.cc:1:13: error: 'cin' does not name a type 1 | int N,K,X,Y;cin >> N >> K >> X >> Y; | ^~~ a.cc:2:1: error: expected unqualified-id before 'if' 2 | if (N <= K){ | ^~ a.cc:4:2: error: expected unqualified-id before 'else' 4 | }else{ | ^~~~
s142911504
p04011
C++
#include <bits/stdc++.h> using namespace std; int main(){ int N,K,X,Y; cin >> N; cin >> K; cin >> X; cin >> Y; int sum=0; for(int i=1;i<=N;i++){ if(i<=K) sum+=X; else sum+=Y } cout << sum << endl; }
a.cc: In function 'int main()': a.cc:16:19: error: expected ';' before '}' token 16 | sum+=Y | ^ | ; 17 | } | ~
s002622246
p04011
C++
#include<iostream> using namespace std; int main(){ int N,K,X,Y,sum=0; cin>>N>>K>>X>>Y; int i=0; while(i<K && I<N){ sum+=X; i++; } while(i<N){ sum+=Y; i++; } cout<<sum; return 0; }
a.cc: In function 'int main()': a.cc:8:16: error: 'I' was not declared in this scope 8 | while(i<K && I<N){ | ^
s083426667
p04011
C++
#include<iostream> using namespace std; int main(){ int N,K,X,Y,sum=0; cin>>N>>K>>X>>Y; int i=0; while(i<K){ sum+=X; i++; } while(i<N){ sum+=Y; i++ } return 0; }
a.cc: In function 'int main()': a.cc:14:8: error: expected ';' before '}' token 14 | i++ | ^ | ; 15 | } | ~
s078790087
p04011
C++
#include<bits/stdc++.h> using namespace std; int B,a,D,C; int main() { cin>>C>>D>>a>>B; if(C>D) cout<<C*a<<endl else {C-=D;cout<<a*D+B*C<<endl;} return 0; }
a.cc: In function 'int main()': a.cc:7:28: error: expected ';' before 'else' 7 | if(C>D) cout<<C*a<<endl | ^ | ; 8 | else {C-=D;cout<<a*D+B*C<<endl;} | ~~~~
s671932610
p04011
C++
#include <bits/stdc++.h> using namespace std; int main() { int n,k,x,y,s; cin>>n>>k>>x>>y; if(n<=k)s=x*n; if(n>k)s=l*x+(n-k)*y; cout << s<<endl; }
a.cc: In function 'int main()': a.cc:8:12: error: 'l' was not declared in this scope 8 | if(n>k)s=l*x+(n-k)*y; | ^
s525232160
p04011
C++
#include <bits/stdc++.h> using namespace std; int main() { int n,k,x,y,s; cin>>n>>k>>x>>y; if(n<=k)s=x*n; if(n>k)s=l*x+(n-k)*y cout << s<<endl; }
a.cc: In function 'int main()': a.cc:8:12: error: 'l' was not declared in this scope 8 | if(n>k)s=l*x+(n-k)*y | ^
s866004870
p04011
C++
int main() { int n,k,x,y; cin >> n >> k >> x >> y; if(n<=k){ cout << n*x; } else{ cout << k*x+(n-k)*y; } }
a.cc: In function 'int main()': a.cc:3:5: error: 'cin' was not declared in this scope 3 | cin >> n >> k >> x >> y; | ^~~ a.cc:5:9: error: 'cout' was not declared in this scope 5 | cout << n*x; | ^~~~ a.cc:8:9: error: 'cout' was not declared in this scope 8 | cout ...
s731970019
p04011
C++
#include "bits/stdc++.h" using namespace std; int main() { int N,K,X,Y; cin >>N>>K>>X>>Y; int A; if (N<=K){ A= N*X; }else{ A= K*X+(N-K)*Y+ } cout << A; return 0; }
a.cc: In function 'int main()': a.cc:11:1: error: expected primary-expression before '}' token 11 | } | ^
s047807252
p04011
C++
#include <bits/stdc++.h> using namespace std; int main(){ int n, k, x, y; cin >> n >> k >> x >> y; if(n <= k) int ans = n * x; else int ans = k * x + (n - k) * y; cout << ans; }
a.cc: In function 'int main()': a.cc:10:17: error: 'ans' was not declared in this scope; did you mean 'abs'? 10 | cout << ans; | ^~~ | abs
s875900515
p04011
Java
import java.util.Scanner; class Main{ Scanner sin = new Scanner(System.in); int N = sin.nextInt(); int K = sin.nextInt(); int X = sin.nextInt(); int Y = sin.nextInt(); if(N<=K){ int XY = X*N; }else{ int NK = N-K; int XY = X*K + Y*NK; } System.out.println(XY); }
Main.java:10: error: illegal start of type if(N<=K){ ^ Main.java:10: error: <identifier> expected if(N<=K){ ^ Main.java:10: error: <identifier> expected if(N<=K){ ^ Main.java:12: error: illegal start of type }else{ ^ Main.java:16: error: <identifier> expected System.out.println(XY); ...
s331572086
p04011
Java
#include <bits/stdc++.h> using namespace std; int main(){ int n,k,x,y; cin >> n >> k >> x >> y; if(n<=k){ cout << x*n; }else{ cout << x*k+y*(n-k); } }
Main.java:1: error: illegal character: '#' #include <bits/stdc++.h> ^ Main.java:1: error: class, interface, enum, or record expected #include <bits/stdc++.h> ^ Main.java:6: error: not a statement cin >> n >> k >> x >> y; ^ Main.java:8: error: not a statement cout << x*n; ^ M...
s391224974
p04011
C++
#include <bits/stdc++.h> using namespace std; #define ll long long #define endl "\n" #define pb push_back #define f(i,n) for(i=0;i<n;i++) #define F(i,a,b) for(i=a;a<=b;i++) #define arr(a,n) for( i=0;i<n;i++)cin>>a[i]; #define fi first #define se second #define mp make_pair #define mod 1000000007 #define YES cout<<"YES...
a.cc:33:3: error: unterminated comment 33 | /* #ifndef ONLINE_JUDGE | ^ a.cc: In function 'int main()': a.cc:32:13: error: expected '}' at end of input 32 | int main() { | ~^
s657932281
p04011
C++
clude<iostream> #include <string> #include <vector> #include <algorithm> #include <math.h> #include <functional> #include <iomanip> #include <bitset> #include <numeric> #include <queue> #include <map> using namespace std; #define rep(i, n) for (int i = 0; i < n; i++) const long long mod = 1000000007; typedef long long ...
a.cc:1:1: error: 'clude' does not name a type 1 | clude<iostream> | ^~~~~ In file included from /usr/include/c++/14/bits/char_traits.h:42, from /usr/include/c++/14/string:42, from a.cc:2: /usr/include/c++/14/bits/postypes.h:68:11: error: 'ptrdiff_t' does not name a type 68...
s320003461
p04011
Java
import java.io.BufferedReader; import java.io.InputStreamReader; public class Main { public static void main(String[] args){ BufferedReader input = new BufferedReader(new InputStreamReader(System.in)); int stay = Integer.parseInt(input.readLine()); int sale = Integer.parseInt(input.readLin...
Main.java:8: error: unreported exception IOException; must be caught or declared to be thrown int stay = Integer.parseInt(input.readLine()); ^ Main.java:9: error: unreported exception IOException; must be caught or declared to be thrown int sale = Intege...
s378050625
p04011
Java
import java.io.BufferedReader; import java.io.InputStreamReader; import java.util.Scanner; public class Main { public static void main(String[] args){ Scanner sc = new Scanner(System.in); BufferedReader input = new BufferedReader(new InputStreamReader(System.in)); int stay = Integer.parseI...
Main.java:10: error: unreported exception IOException; must be caught or declared to be thrown int stay = Integer.parseInt(input.readLine()); ^ Main.java:11: error: unreported exception IOException; must be caught or declared to be thrown int sale = Inte...
s258556609
p04011
Java
import java.io.BufferedReader; import java.io.InputStreamReader; import java.util.Scanner; public class Main { public static void main(String[] args){ Scanner sc = new Scanner(System.in); BufferedReader input = new BufferedReader(new InputStreamReader(System.in)) int stay = Integer.parseIn...
Main.java:9: error: ';' expected BufferedReader input = new BufferedReader(new InputStreamReader(System.in)) ^ 1 error
s790632903
p04011
C++
#include<bits/stdc++.h> using namespace std; int main() { cin.tie(0); ios::sync_with_stdio(false); long long n, k, x, y; cin >> n >> k >> x >> y; if((n-k)<0) { int num = 0; } else { num = n-k; } cout << k*x+num*y << endl; }
a.cc: In function 'int main()': a.cc:11:8: error: 'num' was not declared in this scope; did you mean 'enum'? 11 | num = n-k; | ^~~ | enum a.cc:13:16: error: 'num' was not declared in this scope; did you mean 'enum'? 13 | cout << k*x+num*y << endl; | ^~~ ...
s302423637
p04011
Java
import java.util.Scanner; public class Hotel { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int n,k,x,y ; n = sc.nextInt(); k = sc.nextInt(); x = sc.nextInt(); y = sc.nextInt(); if(n > k) { System.out.println((k*x)+((n-k)*y)); }else{ System.out.println("n*x"); ...
Main.java:3: error: class Hotel is public, should be declared in a file named Hotel.java public class Hotel { ^ 1 error
s458431488
p04011
Java
import java.util.Scanner; public class Hotel { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int n,k,x,y ; n = sc.nextInt(); k = sc.nextInt(); x = sc.nextInt(); y = sc.nextInt(); System.out.println((k*x)+((n-k)*y)); } }
Main.java:3: error: class Hotel is public, should be declared in a file named Hotel.java public class Hotel { ^ 1 error
s065315270
p04011
Java
package java_sample; import java.util.Scanner; public class Hotel { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int n,k,x,y ; n = sc.nextInt(); k = sc.nextInt(); x = sc.nextInt(); y = sc.nextInt(); System.out.println((k*x)+((n-k)*y)); } }
Main.java:5: error: class Hotel is public, should be declared in a file named Hotel.java public class Hotel { ^ 1 error
s594404460
p04011
C
#include <stdio.h> int main(){ int n,k,x,y; int total=0; scanf_s("%d",&n); scanf_s("%d",&k); scanf_s("%d",&x); scanf_s("%d",&y); if(n<=k){ total=n*x; } else { total=k*x; total+=((n-k)*y); } printf("%d",total); }
main.c: In function 'main': main.c:7:3: error: implicit declaration of function 'scanf_s'; did you mean 'scanf'? [-Wimplicit-function-declaration] 7 | scanf_s("%d",&n); | ^~~~~~~ | scanf
s643541221
p04011
C++
#include<bits/stdc++.h> using namespace std; int main(){ long long N,K,X,Y; cin>>N; cin>>K; cin>>X; cin>>Y; if(N<K){ cout<<N*X; } else{ 2 cout<<(K*X)+(N-K)*Y; } return 0; }
a.cc: In function 'int main()': a.cc:21:2: error: expected ';' before 'cout' 21 | 2 | ^ | ; 22 | cout<<(K*X)+(N-K)*Y; | ~~~~
s742780747
p04011
C++
#include <bits/stdc++.h> using namespace std; int main() { int A,B,C,D,ans; cin>>A>>B>>C>>D; for(int i=0; i<N;i++){ if(i>K){ans+=D;} else{ans+=C;} } cout<<ans<<endl; }
a.cc: In function 'int main()': a.cc:8:16: error: 'N' was not declared in this scope 8 | for(int i=0; i<N;i++){ | ^ a.cc:9:8: error: 'K' was not declared in this scope 9 | if(i>K){ans+=D;} | ^
s326613043
p04011
Java
import java.util.*; import java.util.ArrayList; public class Main { public static void main(String[] args){ Scanner sc = new Scanner(System.in); int a = sc.nextInt(); int b = sc.nextInt(); int c = sc.nextInt(); int d = sc.nextInt(); int n = a-b; int counter =0; if(n>0){ ...
Main.java:18: error: reached end of file while parsing } ^ 1 error
s163431434
p04011
C++
#include <iostream> using namespace std; int main() { int n,k,x,y; cin>>n>>K>>x>>y; cout<<min(k,n)*x+max(n-k,0)*y<<endl; }
a.cc: In function 'int main()': a.cc:5:11: error: 'K' was not declared in this scope 5 | cin>>n>>K>>x>>y; | ^