submission_id stringlengths 10 10 | problem_id stringlengths 6 6 | language stringclasses 3
values | code stringlengths 1 522k | compiler_output stringlengths 43 10.2k |
|---|---|---|---|---|
s086255863 | p04011 | C++ | #include<iostream>
using namespace std;
int main(){
int N,K,X,Y;
cin>>N>>K>>X>>Y
int sum=0;
for(int i=0;i<N;i++){
if(i<K) sum+=X;
else sum+=Y;
}
cout<<sum;
} | a.cc: In function 'int main()':
a.cc:6:18: error: expected ';' before 'int'
6 | cin>>N>>K>>X>>Y
| ^
| ;
7 | int sum=0;
| ~~~
a.cc:9:13: error: 'sum' was not declared in this scope
9 | if(i<K) sum+=X;
| ^~~
a.cc:10:1... |
s690058473 | p04011 | C++ | #include<bits/stdc++.h>
using namespace std;
int main(){
int n,k,x,y;
cin>>n>>k>>x>>y;
cout<<n*x+miax(0,n-k)*(y-x);
} | a.cc: In function 'int main()':
a.cc:6:13: error: 'miax' was not declared in this scope
6 | cout<<n*x+miax(0,n-k)*(y-x);
| ^~~~
|
s177073409 | p04011 | C | #include <bits/stdc++.h>
using namespace std;
int main(){
int n[12], a;
for(int i = 0; i < 3; scanf("%d", &a), n[a]++, i++);
printf("%s\n", (n[5] == 2 && n[7] == 1) ? "YES" : "NO");
return 0;
} | main.c:1:10: fatal error: bits/stdc++.h: No such file or directory
1 | #include <bits/stdc++.h>
| ^~~~~~~~~~~~~~~
compilation terminated.
|
s744269012 | p04011 | C++ | #include<iostream>
#include<algorithm>
using namespace std;
int main(){
int n,k,x,y;
cin >> n >> k >> x >> y;
int sum = 0;
if(n > k){
cout << k * x + (n-k) * y;
else{
cout << n * x;
}
}
| a.cc: In function 'int main()':
a.cc:10:3: error: expected '}' before 'else'
10 | else{
| ^~~~
a.cc:8:12: note: to match this '{'
8 | if(n > k){
| ^
|
s258423755 | p04011 | C++ | #include<bits/stdc++.h>
using namespace std;
int main(void)
{
int n,k,c,y;
int sum=0;
cin>>n>>k>>x>>y;
for(int i=0;i<k;i++){
if(i<k)
sum+=x;
else
sum+=y;
}
cout<<sum<<endl;
} | a.cc: In function 'int main()':
a.cc:8:14: error: 'x' was not declared in this scope
8 | cin>>n>>k>>x>>y;
| ^
|
s806829065 | 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;i++){
if(i>K)
sum+=Y;
else
sum+=X;
}
cout<<sum<endl;
}
| a.cc: In function 'int main()':
a.cc:15:14: error: no match for 'operator<' (operand types are 'std::basic_ostream<char>' and '<unresolved overloaded function type>')
15 | cout<<sum<endl;
| ~~~~~~~~~^~~~~
In file included from /usr/include/c++/14/regex:68,
from /usr/include/x86_64-linu... |
s522336796 | p04011 | C++ | #include <bits/stdc++.h>
using namespace std;
int main(){
int N,K,X,Y;
cin>>N>>K>>X>>Y;
int summ=0;
for(int i=0;i<N;i++){
if(i>K)
sum+=Y;
else
sum+=X;
}
} | a.cc: In function 'int main()':
a.cc:11:7: error: 'sum' was not declared in this scope; did you mean 'summ'?
11 | sum+=Y;
| ^~~
| summ
a.cc:13:7: error: 'sum' was not declared in this scope; did you mean 'summ'?
13 | sum+=X;
| ^~~
| summ
|
s078281518 | p04011 | C++ | #include<bits/stdc++.h>
using namespace std;
int main(){
int K,N,X,Y;
cin>>K>>N>>X>>Y;
int sum=0;
for(int i=K;i>0;i++){
sum+=X;
}
for(int j=N-K;j>0;j++){
sum+=Y
}
cout<<sum<<endl;
}
| a.cc: In function 'int main()':
a.cc:12:11: error: expected ';' before '}' token
12 | sum+=Y
| ^
| ;
13 | }
| ~
|
s729094705 | p04011 | C++ | #include<bits/stdc++.h>
using namespace std;
int main(){
int K,N,X,Y;
cin>>K N X Y;
int sum=0;
for(int i=K;i>0;i++){
sum+=X;
}
for(int j=N-K;j>0;j++){
sum+=Y
}
cout<<sum<<endl;
}
| a.cc: In function 'int main()':
a.cc:6:9: error: expected ';' before 'N'
6 | cin>>K N X Y;
| ^~
| ;
a.cc:12:11: error: expected ';' before '}' token
12 | sum+=Y
| ^
| ;
13 | }
| ~
|
s968366401 | p04011 | C++ | #include<bits/stdc++.h>
using namespace std;
int main() {
int N, K, X, Y, ans;
cin >> N >> K >> X >> Y;
if (N>=K) {
ans = X * K + Y * (N - K);
}
else {
ans = X * N
}
cout << ans << endl;
} | a.cc: In function 'int main()':
a.cc:10:16: error: expected ';' before '}' token
10 | ans = X * N
| ^
| ;
11 | }
| ~
|
s727005872 | p04011 | C++ | n=int(input())
k=int(input())
x=int(input())
y=int(input())
s=0
for i in range(n):
if k-1>=i:
s=s+x
else:
s=s+y
print(s)
| a.cc:1:1: error: 'n' does not name a type
1 | n=int(input())
| ^
|
s663986601 | p04011 | C | #include <stdio.h>
int main(void) {
int a,b,c,d;
double sum;
scanf("%d",&a);
scanf("%d",&b);
scanf("%d",&c);
scanf("%d",&d);
sum=b*c+(a-b)*d
printf("%.0f\n",sum);
return 0;
} | main.c: In function 'main':
main.c:10:18: error: expected ';' before 'printf'
10 | sum=b*c+(a-b)*d
| ^
| ;
11 | printf("%.0f\n",sum);
| ~~~~~~
|
s819577503 | p04011 | C++ | #include <iostream>
using namespace std;
int main() {
int N, K, X, Y;
cin N >> K >> X >> Y;
if(N <= K) cout << X*K;
else if(N > K) {
N = N - K;
int sum = K*X + N*Y;
cout << sum;
}
cout << endl;
return 0;
} | a.cc: In function 'int main()':
a.cc:7:12: error: expected ';' before 'N'
7 | cin N >> K >> X >> Y;
| ^~
| ;
|
s622072638 | p04011 | C++ | #include <iostream>
using nampspace std;
int main(){
int n,k,x,y;
cin >> n >> k >> x >> y;
cout << min(n,k)*x+max(0,n-k)*y << endl;
return 0;
} | a.cc:2:7: error: expected nested-name-specifier before 'nampspace'
2 | using nampspace std;
| ^~~~~~~~~
a.cc: In function 'int main()':
a.cc:6:9: error: 'cin' was not declared in this scope; did you mean 'std::cin'?
6 | cin >> n >> k >> x >> y;
| ^~~
| std::cin
In... |
s335498795 | p04011 | C++ | x#include<iostream>
#include<string>
#include<vector>
#include<algorithm>
using namespace std;
int main(){
int n,k,x,y;
cin>>n>>k>>x>>y;
if(n<k)
cout<< x*n <<endl;
else
cout<<(n-k)*y + k*x <<endl;
}
| a.cc:1:2: error: stray '#' in program
1 | x#include<iostream>
| ^
a.cc:1:1: error: 'x' does not name a type
1 | x#include<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+... |
s333083829 | p04011 | C++ | #include <bits/stdc++.h>
using namespace std;
int main() {
int N,K,X,Y;
cin >> N >> K >> X >> Y ;
int aaa;
if(N<=K){
aaa=N*X
}
else{
aaa=K*X+(N-X)*Y;
}
cout <<aaa << endl;
}
| a.cc: In function 'int main()':
a.cc:9:11: error: expected ';' before '}' token
9 | aaa=N*X
| ^
| ;
10 | }
| ~
|
s815718989 | p04011 | C++ | #include <bits/stdc++.h>
using namespace std;
int main(){
string w;
cin >> w;
int a[26];
for (int i;i<w.size();i++){
a[s[i]-'a']=1-a[s[i]-'a'];
}
a.sort();
if (a[25]=0){
cout << "Yes";
}
else{
cout << "No";
}
}
| a.cc: In function 'int main()':
a.cc:9:6: error: 's' was not declared in this scope
9 | a[s[i]-'a']=1-a[s[i]-'a'];
| ^
a.cc:11:5: error: request for member 'sort' in 'a', which is of non-class type 'int [26]'
11 | a.sort();
| ^~~~
|
s551951302 | p04011 | C++ | #include <bits/stdc++.h>
using namespace std;
int main() {
int n,k,c,y;
cin>>n>>k>>x>>y;
if (n<=k) {
cout<<k*x<<endl;
}
else {
cout<<k*x+(n-k)*y<<endl;
}
}
| a.cc: In function 'int main()':
a.cc:6:14: error: 'x' was not declared in this scope
6 | cin>>n>>k>>x>>y;
| ^
|
s402027193 | p04011 | C++ | #include <bits/stdc++.h>
using namespace std;
// 変数ダンプ先。coutかcerr
#define DUMPOUT cerr
// 提出時はコメントアウト
#define DEBUG_
// #define int long long // intで書いたけど心配なときにlong longに変換する
struct Fast {Fast(){std::cin.tie(0);ios::sync_with_stdio(false);}} fast;
/* cpp template {{{ */
/* short */
#define pb push_back
#define eb ... | a.cc: In function 'int main()':
a.cc:23:15: warning: empty parentheses were disambiguated as a function declaration [-Wvexing-parse]
23 | #define X real()
| ^~
a.cc:114:15: note: in expansion of macro 'X'
114 | int N, K, X, Y; cin >> N >> K >> X >> Y;
| ^
a.cc:23:15: not... |
s478405514 | p04011 | C++ | #include <iostream>
using namespace std;
typedef long long unsigned int ll;
int main() {
int N、K,X,Y;
cin >> N;
cin >> K;
cin >> X;
cin >> Y;
cout << K*X+(N-K)*Y<<endl;
return 0;
}
| a.cc:7:7: error: extended character 、 is not valid in an identifier
7 | int N、K,X,Y;
| ^
a.cc: In function 'int main()':
a.cc:8:10: error: 'N' was not declared in this scope
8 | cin >> N;
| ^
a.cc:9:10: error: 'K' was not declared in this scope
9 | cin >> K;
| ... |
s502044904 | p04011 | C++ | #include <bits/stcd++.h>
using namespace std;
int main(){
int N, K, X, Y;
cin >> N >> K >> X >> Y;
if(N - K <= 0) cout << N * X;
else cout << N * X + (K - N) * Y;
} | a.cc:1:10: fatal error: bits/stcd++.h: No such file or directory
1 | #include <bits/stcd++.h>
| ^~~~~~~~~~~~~~~
compilation terminated.
|
s960288429 | 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;
}
ifelse {
cout << K*X+(N-K)*Y <<endl ;
}
} | a.cc: In function 'int main()':
a.cc:10:3: error: 'ifelse' was not declared in this scope; did you mean 'sigrelse'?
10 | ifelse {
| ^~~~~~
| sigrelse
|
s360561573 | 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;
}
ifelse {
cout << K*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: candidate: '... |
s536096207 | p04011 | C++ | #include<iostream>
using namespace std;
int main(){
int N,K,X,Y;
cin >> N >> K >> X >> Y;
cout << (N<K)?(N*X):(K*X+(N-K)*Y) << endl;
} | a.cc: In function 'int main()':
a.cc:6:43: error: invalid operands of types 'int' and '<unresolved overloaded function type>' to binary 'operator<<'
6 | cout << (N<K)?(N*X):(K*X+(N-K)*Y) << endl;
| ~~~~~~~~~~~~~~^~~~~~~
|
s490923309 | p04011 | Java | import java.util.*;
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) {
System.out.println(x*n);
}else {
... | Main.java:8: error: cannot find symbol
int y = sc.nextint();
^
symbol: method nextint()
location: variable sc of type Scanner
1 error
|
s510771507 | p04011 | C++ | #include <iostream>
using namespace std;
int main (){
int N, K, X, Y, cost;
cin >> N >> K >> X >> Y;
cost = X*K + (N-K)*Y;
cout << cost << endl;
}
~ | a.cc:12:2: error: expected class-name at end of input
12 | ~
| ^
|
s825936496 | p04011 | C++ | #include <bits/stdc++.h>
using namespace std;
int main(){
int N, K, X, Y, price = 0;
cin >> N >> K >> X >> Y;
if(K < N){
price = X * K + Y * (N - K);
}
else{
price = X * N
}
cout << price << endl;
}
| a.cc: In function 'int main()':
a.cc:11:18: error: expected ';' before '}' token
11 | price = X * N
| ^
| ;
12 | }
| ~
|
s105508791 | p04011 | C++ | #include<bits/stdc++.h>
using namespace std;
int N,K,X,Y,res;
int main(){
cin>>N>>>K>>X>>Y;
for(int i=1; i<=N; ++i){
if(i<=K)
res+=X;
else res+=Y;
}
cout<<res<<endl;
return 0;
} | a.cc: In function 'int main()':
a.cc:8:11: error: expected primary-expression before '>' token
8 | cin>>N>>>K>>X>>Y;
| ^
|
s788117135 | p04011 | C++ | #include <bits/stdc++.h>
#define int long long
#define rep(i,n) for(int i=0;i<n;i++)
using namespace std;
signed main(){
int a,b,c,d;
cin>>a>>b>>c>>d;
cout<<max(a,b)*c+max(a-b,0)*d<<endl;
}
| a.cc: In function 'int main()':
a.cc:8:29: error: no matching function for call to 'max(long long int, int)'
8 | cout<<max(a,b)*c+max(a-b,0)*d<<endl;
| ~~~^~~~~~~
In file included from /usr/include/c++/14/algorithm:60,
from /usr/include/x86_64-linux-gnu/c++/14... |
s886843406 | p04011 | C++ | #include <bits/stdc++.h>
using namespace std;
int main(){
int N, K, X, Y;
cin >> N >> K >> X >> Y;
cout << min(N,K)*X +(N>K)(N-K)*Y << endl;
} | a.cc: In function 'int main()':
a.cc:7:28: error: expression cannot be used as a function
7 | cout << min(N,K)*X +(N>K)(N-K)*Y << endl;
| ~~~~~^~~~~
|
s628478412 | p04011 | C | #include <stdio.h>
int main(void){
int a,b,c,d;
scanf("%d",&a);
scanf("%d",&b);
scanf("%d",&c);
scanf("%d",&d);
if(a<b){printf("%d",(c*a);}
if(a>b){printf("%d",b*c+(a-b)*d);}
return 0;
} | main.c: In function 'main':
main.c:8:28: error: expected ')' before ';' token
8 | if(a<b){printf("%d",(c*a);}
| ~ ^
| )
main.c:8:29: error: expected ';' before '}' token
8 | if(a<b){printf("%d",(c*a);}
| ^
... |
s198363121 | p04011 | C++ | int main(){
int n,k,x,y;
cin>>n>>k>>x>>y;
int ans;
if(n>k){
ans = (k)*x + (n-k)*y;
}
else{
ans = n*x;
}
cout <<ans<<endl;
} | a.cc: In function 'int main()':
a.cc:3:3: error: 'cin' was not declared in this scope
3 | cin>>n>>k>>x>>y;
| ^~~
a.cc:11:3: error: 'cout' was not declared in this scope
11 | cout <<ans<<endl;
| ^~~~
a.cc:11:15: error: 'endl' was not declared in this scope
11 | cout <<ans<<endl;
| ... |
s021246978 | p04011 | C++ | #inclde<bits/stdc++.h>
using namespace std;
int main(){
int n,k,x,y;cin>>n>>k>>x>>y;if(n<=k)cout<<n*x;else cout<<x*k+(n-k)*y;} | a.cc:1:2: error: invalid preprocessing directive #inclde; did you mean #include?
1 | #inclde<bits/stdc++.h>
| ^~~~~~
| include
a.cc: In function 'int main()':
a.cc:4:15: error: 'cin' was not declared in this scope
4 | int n,k,x,y;cin>>n>>k>>x>>y;if(n<=k)cout<<n*x;else cout<<x*k+(n-k)*y;}
|... |
s495142646 | p04011 | C++ | #incldue<bits/stdc++.h>
using namespace std;
int main(){
int n,k,x,y;cin>>n>>k>>x>>y;if(n<=k)cout<<n*x;else cout<<x*k+(n-k)*y;} | a.cc:1:2: error: invalid preprocessing directive #incldue; did you mean #include?
1 | #incldue<bits/stdc++.h>
| ^~~~~~~
| include
a.cc: In function 'int main()':
a.cc:4:15: error: 'cin' was not declared in this scope
4 | int n,k,x,y;cin>>n>>k>>x>>y;if(n<=k)cout<<n*x;else cout<<x*k+(n-k)*y;}
... |
s496416405 | p04011 | C++ | #include <iostream>
using namespace std;
int main(){
int a,b,c,d;
cin>>a>>b>>c>>d;
if(b>a){cout<<N*c<<endl;}
else cout<<b*C+(a-b)*d<<endl;
return 0;
} | a.cc: In function 'int main()':
a.cc:7:16: error: 'N' was not declared in this scope
7 | if(b>a){cout<<N*c<<endl;}
| ^
a.cc:8:16: error: 'C' was not declared in this scope
8 | else cout<<b*C+(a-b)*d<<endl;
| ^
|
s176518829 | p04011 | C++ | #include<iostream>
int main(void)
{
int n,k,x,y,ans;
n = k = x = y = ans = 0;
cin >> n >> k >> x >> y;
for(int i = 0;i < n;i++)
{
if(k < i){ans += y;}
else{ans += x;}
}
cout << ans;
return 0;
} | a.cc: In function 'int main()':
a.cc:8:3: error: 'cin' was not declared in this scope; did you mean 'std::cin'?
8 | cin >> n >> k >> x >> y;
| ^~~
| std::cin
In file included from a.cc:1:
/usr/include/c++/14/iostream:62:18: note: 'std::cin' declared here
62 | extern istream cin; ///... |
s680738987 | p04011 | Java | import java.util.*;
public class Main{
public static void main(string[] args){
Scanner sc = new Scanner(System.in);
int n = Integer.parseInt(sc.next());
int k = Integer.parseInt(sc.next());
int x = Integer.parseInt(sc.next());
int y = Integer.parseInt(sc.next());
System.out.println(k * x + (n-... | Main.java:3: error: cannot find symbol
public static void main(string[] args){
^
symbol: class string
location: class Main
1 error
|
s323715425 | p04011 | Java | import java.util.*;
public class Main{
public static void main(string[] args){
int n = Integer.parseInt(sc.next());
int k = Integer.parseInt(sc.next());
int x = Integer.parseInt(sc.next());
int y = Integer.parseInt(sc.next());
System.out.println(k * x + (n-k) * y);
}
} | Main.java:3: error: cannot find symbol
public static void main(string[] args){
^
symbol: class string
location: class Main
Main.java:4: error: cannot find symbol
int n = Integer.parseInt(sc.next());
^
symbol: variable sc
location: class Main
Main.... |
s425471897 | p04011 | C | #include <stdio.h>
int main(int argc, char const *argv[])
{
int n,k,x,y;
scanf("%d %d %d %d",&n,&k,&x,&y);
printf("%d\n",(a > b) ? (b * c + a * d - b * d) : (a * c));
return 0;
}
| main.c: In function 'main':
main.c:7:24: error: 'a' undeclared (first use in this function)
7 | printf("%d\n",(a > b) ? (b * c + a * d - b * d) : (a * c));
| ^
main.c:7:24: note: each undeclared identifier is reported only once for each function it appears in
main.c:7:28: error:... |
s717198449 | p04011 | C | #include <stdio.h>
int main(int argc, char const *argv[])
{
scanf("%d %d %d %d",&n,&k,&x,&y);
printf("%d\n",(n > k) ? (k * x + n * y - k * y) : (n * x));
return 0;
}
| main.c: In function 'main':
main.c:5:30: error: 'n' undeclared (first use in this function)
5 | scanf("%d %d %d %d",&n,&k,&x,&y);
| ^
main.c:5:30: note: each undeclared identifier is reported only once for each function it appears in
main.c:5:33: error: 'k' undeclared (fir... |
s361158677 | p04011 | C++ | #include <iostream>
using namespace std;
int main(void){
int x,y,z,w;
cin >> x >> y >> z >> w;
if(x < y){
cout << x*z << endl;
}else{
cout << y*z + (x-y)*k << endl;
}
} | a.cc: In function 'int main()':
a.cc:10:25: error: 'k' was not declared in this scope
10 | cout << y*z + (x-y)*k << endl;
| ^
|
s241913379 | 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:4:12: error: expected unqualified-id before ',' token
4 | int,n,k,x,y;
| ^
|
s412621403 | 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;
else
cout << N*X;
} | a.cc: In function 'int main()':
a.cc:8:8: error: 'k' was not declared in this scope
8 | if(N>k)
| ^
|
s654905995 | p04011 | C++ | #include <iostream>
using namespace std;
int main()
{
if(N>k)
cout << K*X + (N - K)*Y;
else
cout << N*X;
} | a.cc: In function 'int main()':
a.cc:6:6: error: 'N' was not declared in this scope
6 | if(N>k)
| ^
a.cc:6:8: error: 'k' was not declared in this scope
6 | if(N>k)
| ^
a.cc:7:13: error: 'K' was not declared in this scope
7 | cout << K*X + (N - K)*Y;
| ^
a.cc... |
s177831609 | p04011 | C++ | #include <bits/stdc++.h>
using namespace std;
typedef long long int ll;
typedef pair<ll, ll> pll;
#define FOR(i, n, m) for (ll(i) = (m); (i) < (n); ++(i))
#define REP(i, n) FOR(i, n, 0)
#define OF64 std::setprecision(10)
const ll MOD = 1000000007;
const ll INF = (ll)1e15;
int main()
{
ll N, K, X, Y;
cin >> ... | a.cc: In function 'int main()':
a.cc:18:29: error: no matching function for call to 'max(int, ll)'
18 | cout << N * X - std::max(0, N - K) * (X - Y) << endl;
| ~~~~~~~~^~~~~~~~~~
In file included from /usr/include/c++/14/algorithm:60,
from /usr/include/x86_64-linux-gnu/... |
s730072089 | p04011 | C++ | n = int(input())
k = int(input())
x = int(input())
y = int(input())
if n > k:
print(k * x + (n - k) * y)
else:
print(n * x) | a.cc:1:1: error: 'n' does not name a type
1 | n = int(input())
| ^
|
s879825653 | p04011 | C | #include<stdio.h>
#include<stdlib.h>
#include<string.h>
//絶対値
long long int change_plus(long long int a) {
if (a < 0) { return -a; }
if (a >= 0) { return a; }
}
//大小比較(大)
long long int big(long long int a, long long int b) {
if (a >= b) {
return a;
}
else {
return b;
}
}
//大小比較(小)
long long int small(long lo... | main.c: In function 'main':
main.c:33:76: error: expected ';' before '}' token
33 | if (n <= k) { printf("%lld", n*k); }else{printf("%lld",(n-m)*p+k*m) }
| ^~
| ... |
s122004676 | p04011 | C | #include<stdio.h>
#include<stdlib.h>
#include<string.h>
//絶対値
long long int change_plus(long long int a) {
if (a < 0) { return -a; }
if (a >= 0) { return a; }
}
//大小比較(大)
long long int big(long long int a, long long int b) {
if (a >= b) {
return a;
}
else {
return b;
}
}
//大小比較(小)
long long int small(long lo... | main.c: In function 'main':
main.c:33:76: error: expected ';' before '}' token
33 | if (n <= k) { printf("%lld", n*k); }else{printf("%lld",(n-m)*p+k*m) }
| ^~
| ... |
s806649293 | p04011 | C | #include<stdio.h>
int main(){
int n,k,x,y;
scanf("%d%d%d%d",&n,&k,&x,&y);
if(n<=k)printf("%d",n*x);
else printf("%d",k*x+(n-k)*y);
reurn 0;
} | main.c: In function 'main':
main.c:7:3: error: 'reurn' undeclared (first use in this function)
7 | reurn 0;
| ^~~~~
main.c:7:3: note: each undeclared identifier is reported only once for each function it appears in
main.c:7:8: error: expected ';' before numeric constant
7 | reurn 0;
| ^... |
s277234866 | p04011 | C++ | #include <bits/stdc++.h>
using namespace std;
int main(){
int n, k, x, y;
cint >> n >> k >> x >> y;
cout << k * x + (n - k) * y << endl;
return 0;
} | a.cc: In function 'int main()':
a.cc:6:17: error: 'cint' was not declared in this scope; did you mean 'uint'?
6 | cint >> n >> k >> x >> y;
| ^~~~
| uint
|
s221871174 | p04011 | C | #incliude <stdio.h>
int main(){
int a,b,c,d;
scanf("%d%d%d%d",&a,&b,&c,&d);
printf("%d",a*c+(b-a)*d);
return 0;
} | main.c:1:2: error: invalid preprocessing directive #incliude; did you mean #include?
1 | #incliude <stdio.h>
| ^~~~~~~~
| include
main.c: In function 'main':
main.c:4:1: error: implicit declaration of function 'scanf' [-Wimplicit-function-declaration]
4 | scanf("%d%d%d%d",&a,&b,&c,&d);
| ^~~... |
s324070966 | p04011 | C | #incliude <stdio.h>
int main(){
int a,b,c,d;
printf("%d",a*c+(b-a)*d);
return 0;
} | main.c:1:2: error: invalid preprocessing directive #incliude; did you mean #include?
1 | #incliude <stdio.h>
| ^~~~~~~~
| include
main.c: In function 'main':
main.c:5:1: error: implicit declaration of function 'printf' [-Wimplicit-function-declaration]
5 | printf("%d",a*c+(b-a)*d);
| ^~~~~~
... |
s133099539 | p04011 | C | #include<stdio.h>
int main(){
int N, K, X, Y, accommodation;
scanf("%d %d %d %d", &N, &K, &X, &Y);
if(N <= K){
accommodtion = N * X;
} else {
accommodation = N*X + (K - N)*Y;
}
printf("%d\n", accommodation);
return 0;
}
| main.c: In function 'main':
main.c:9:5: error: 'accommodtion' undeclared (first use in this function); did you mean 'accommodation'?
9 | accommodtion = N * X;
| ^~~~~~~~~~~~
| accommodation
main.c:9:5: note: each undeclared identifier is reported only once for each function it appears in
|
s891532537 | p04011 | C | #include <bits/stdc++.h>
int main()
{
int n, k, x, y, fee;
scanf("%d %d %d %d", &n, &k, &x, &y);
if(n<=k)
fee = n*x;
else{
fee = k*x;
fee+=((n-k)*y);
}
printf("%d\n", fee);
return 0;
} | main.c:1:10: fatal error: bits/stdc++.h: No such file or directory
1 | #include <bits/stdc++.h>
| ^~~~~~~~~~~~~~~
compilation terminated.
|
s183788542 | p04011 | C | #include<stdio.h>
int main(){
int n,k,x,y,ans=0;i;
scanf("%d%d%d%d",&n,&k,&x,&y);
for(i=1;i<=n;i++){
if(i<=k)ans+=x;
else ans+=y;
}
return 0;
} | main.c: In function 'main':
main.c:4:19: error: 'i' undeclared (first use in this function)
4 | int n,k,x,y,ans=0;i;
| ^
main.c:4:19: note: each undeclared identifier is reported only once for each function it appears in
|
s647500857 | p04011 | C++ | #include <iostream>
#include <algorithm>
#include <functional>
#include <string>
#include <vector>
#include <iostream>
using namespace std;
#define REP(i,n) for(int i=0, i##_len=(n); i<i##_len; ++i)
typedef long long ll;
typedef vector<long long> vll, vLL;
bool check(const string& s,const string& t){
int n = s.size(... | a.cc: In function 'int main()':
a.cc:37:9: error: 'memset' was not declared in this scope
37 | memset(dp,0,sizeof(dp));
| ^~~~~~
a.cc:4:1: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
3 | #include <functional>
+++ |+#include <cst... |
s282783290 | p04011 | C++ | #include <iostream>
using namespace std;
int main(){
int N,K,X,Y;
cin << N << K << X << Y;
int ans = 0;
for (int i = 0; i < N; i++) {
if(i<=K) ans+=X;
else ans+=Y;
}
cout << ans << 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... |
s583485134 | p04011 | C | #include<stdio.h>
#include<iostream>
#include<malloc.h>
#include<string.h>
#include<stdlib.h>
using namespace std;
int main()
{
int N,K,X,Y;
int i;
int sum=0;
cin >> N>>K>>X>>Y;
if(N<=K)
{
for(i=0;i<N;i++)
{
sum+=X;
}
}
else
{
for(i=0;i<K;i++)
{
sum+=X;
}
for(i=0;i<N-K;i++)
{
sum+=Y;
... | main.c:2:9: fatal error: iostream: No such file or directory
2 | #include<iostream>
| ^~~~~~~~~~
compilation terminated.
|
s927014627 | p04011 | C++ | #include <iostream>
#include <algorithm>
#include <functional>
#include <string>
#include <vector>
#include <iostream>
using namespace std;
#define REP(i,n) for(int i=0, i##_len=(n); i<i##_len; ++i)
typedef long long ll;
typedef vector<long long> vll, vLL;
bool check(const string& s,const string& t){
int n = s.size(... | a.cc: In function 'int main()':
a.cc:35:9: error: 'memset' was not declared in this scope
35 | memset(dp,0,sizeof(dp));
| ^~~~~~
a.cc:4:1: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
3 | #include <functional>
+++ |+#include <cst... |
s637570681 | p04011 | C++ | #include <iostream>
#include <algorithm>
#include <functional>
#include <string>
#include <vector>
#include <iostream>
using namespace std;
#define REP(i,n) for(int i=0, i##_len=(n); i<i##_len; ++i)
typedef long long ll;
typedef vector<long long> vll, vLL;
bool check(const string& s,const string& t){
int n = s.size(... | a.cc: In function 'int main()':
a.cc:35:9: error: 'memset' was not declared in this scope
35 | memset(dp,0,sizeof(dp));
| ^~~~~~
a.cc:4:1: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
3 | #include <functional>
+++ |+#include <cst... |
s569526174 | p04011 | C++ | #include<iostream>
using namespace std;
int main(){
int a,b,c,b;
cin>>a>>b>>c>>d;
if(a>b){
cout<<b*c+(a-b)*d<<endl;
}
else{
cout<<b*c<<endl;
}
return 0;
} | a.cc: In function 'int main()':
a.cc:4:13: error: redeclaration of 'int b'
4 | int a,b,c,b;
| ^
a.cc:4:9: note: 'int b' previously declared here
4 | int a,b,c,b;
| ^
a.cc:5:17: error: 'd' was not declared in this scope
5 | cin>>a>>b>>c>>d;
| ^
|
s037755747 | p04011 | C++ | n = int(input())
k = int(input())
x = int(input())
y = int(input())
if n < k:
print (n*x)
else:
print (k*x + (n-k)*y) | a.cc:1:1: error: 'n' does not name a type
1 | n = int(input())
| ^
|
s541755273 | p04011 | C++ | #include <bits/stdc++.h>
int main()
{
int N,K,X,Y;
int total=0;
cin>>N>>K>>X>>Y;
for(int i=1;i<=N;i++){
if(i<=X) total+=X;
else total+=Y;
}
cout<<total<<endl;
} | a.cc: In function 'int main()':
a.cc:6:9: error: 'cin' was not declared in this scope; did you mean 'std::cin'?
6 | 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/io... |
s031342983 | p04011 | C++ |
main :: IO ()
main =
(map read).lines <$> getContents | a.cc:2:1: error: 'main' does not name a type
2 | main :: IO ()
| ^~~~
|
s747799775 | p04011 | C | #include<stdio.h>
int main(void){
int n, ,k, x, y;
scanf("%d%d%d%d",&n, &k, &x, &y);
int cost;
if(n<=k) cost = n*x;
else cost = k*x+(n-k)*y;
printf("%d\n",cost);
return 0;
}
| main.c: In function 'main':
main.c:4:12: error: expected identifier or '(' before ',' token
4 | int n, ,k, x, y;
| ^
main.c:5:27: error: 'k' undeclared (first use in this function)
5 | scanf("%d%d%d%d",&n, &k, &x, &y);
| ^
main.c:5:27: note: each undeclar... |
s457269505 | p04011 | C++ | #include<iostream>
using namespce 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:2:7: error: expected nested-name-specifier before 'namespce'
2 | using namespce std;
| ^~~~~~~~
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 a.cc:1:
/... |
s347279575 | p04011 | C++ | include<iostream>
using namespce 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:1:1: error: 'include' does not name a type
1 | include<iostream>
| ^~~~~~~
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:6:10: error: 'cout' was not declared in this scope
6 | if(n>k)cout<<k*x+(n-k)*y<<endl;
... |
s735232104 | 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<<(k*x)+y*(n-k)<<endl;
return 0;
}
| a.cc: In function 'int main()':
a.cc:5:18: error: expected ';' before 'if'
5 | cin>>n>>k>>x>>y
| ^
| ;
6 | if(k<=n) cout<<(n*x)<<endl;
| ~~
a.cc:7:3: error: 'else' without a previous 'if'
7 | else cout<<(k*x)+y*(n-k)<<endl;
... |
s883235912 | p04011 | C++ | #include<iostream>
using namespace std;
int main() {
int N,K,X,Y;
cin>>N>>K>>X>>Y;
int answer
if (K <= N) {answer = X * K + Y * (N - K);}
else {answer = X * N;}
cout << answer << endl;
return 0;
}
| a.cc: In function 'int main()':
a.cc:7:2: error: expected initializer before 'if'
7 | if (K <= N) {answer = X * K + Y * (N - K);}
| ^~
a.cc:8:2: error: 'else' without a previous 'if'
8 | else {answer = X * N;}
| ^~~~
a.cc:8:8: error: 'answer' was not declared in this scope
8 | else {answer ... |
s194977781 | p04011 | C++ | #include <iostream>
using namespace std;
int main(){
int a,b,c,d;
cin>>a>>b>>c>>d;
if(b<=A){cout<<(a-b)*d+b*c<<endl;}
else{cout<<b*c<<endl;}
return 0;
}
| a.cc: In function 'int main()':
a.cc:6:9: error: 'A' was not declared in this scope
6 | if(b<=A){cout<<(a-b)*d+b*c<<endl;}
| ^
|
s386323038 | p04011 | C++ | #include <iostream>
using namespace std;
int n;
int main(){
int a,b,c,d;
cin>>a>>b>>c>>d;
if(b<=A){cout<<(a-b)*d+b*c<<endl;}
else{cout<<b*c<<endl;}
return 0;
}
| a.cc: In function 'int main()':
a.cc:7:9: error: 'A' was not declared in this scope
7 | if(b<=A){cout<<(a-b)*d+b*c<<endl;}
| ^
|
s479498924 | p04011 | C++ | #include <bits/stdc++.h>
using namespace std;
int main(){
cin>>N>>K>>X>>Y;
if(N<=K){
cout<<N*X<<endl;
}else{
cout<<K*X + (N-K)*Y<<endl;
}
} | a.cc: In function 'int main()':
a.cc:5:8: error: 'N' was not declared in this scope
5 | cin>>N>>K>>X>>Y;
| ^
a.cc:5:11: error: 'K' was not declared in this scope
5 | cin>>N>>K>>X>>Y;
| ^
a.cc:5:14: error: 'X' was not declared in this scope
5 | cin>>N>>K>>X>>Y;
| ... |
s419369727 | p04011 | Java | package aproblems;
import java.util.Scanner;
public class ABC044 {
public static void main(String[] args) {
Scanner scan = new Scanner(System.in);
int N = scan.nextInt();
int K = scan.nextInt();
int X = scan.nextInt();
int Y = scan.nextInt();
int result = 0;
if (N>K) {
result = X*K;
result +=... | Main.java:4: error: class ABC044 is public, should be declared in a file named ABC044.java
public class ABC044 {
^
1 error
|
s664114114 | p04011 | C++ | #include<iostream>
#include<cstdio>
#include<cmath>
#include<cstring>
#include<string>
#include<iomanip>
using namespace std;
int main()
{
int n,k,x,y;
cin>>n>>k>>x>>y;
if(n>k)
{
m=k*x+(n-k)*y;
}
else
{
m=n*x;
}
cout<<m<<endl;
return 0;
} | a.cc: In function 'int main()':
a.cc:14:17: error: 'm' was not declared in this scope
14 | m=k*x+(n-k)*y;
| ^
a.cc:18:17: error: 'm' was not declared in this scope
18 | m=n*x;
| ^
a.cc:20:15: error: 'm' was not declared in this scope
2... |
s089037718 | p04011 | C++ | #include<iostream>
#include<cstdio>
#include<cmath>
#include<cstring>
#include<string>
#include<iomanip>
using namespace std;
int main()
{
int n,k,x,y;
cin>>n>>k>>x>>y;
if(n>k)
{
m=k*x+(n-k)*y;
}
else
{
m=n*x;
}
cout<<m<<endl;
return 0;
} | a.cc: In function 'int main()':
a.cc:14:17: error: 'm' was not declared in this scope
14 | m=k*x+(n-k)*y;
| ^
a.cc:18:17: error: 'm' was not declared in this scope
18 | m=n*x;
| ^
a.cc:20:15: error: 'm' was not declared in this scope
2... |
s930641398 | p04011 | C | #include<bits/stdc++.h>
using namespace std;
int main()
{
int n=0,K=0,X=0,Y=0;
cin>>n>>K>>X>>Y;
if(n < K)
cout<<X*n<<endl;
else
cout<<X*K+(n-K)*Y<<endl;
return 0;
} | main.c:1:9: fatal error: bits/stdc++.h: No such file or directory
1 | #include<bits/stdc++.h>
| ^~~~~~~~~~~~~~~
compilation terminated.
|
s487798033 | p04011 | C | #include <bits/stdc++.h>
using namespace std;
int main()
{
int n,k,x,y,m,z;
cin>>n>>k>>x>>y;
m=k*x+(n-k)*y;
z=n*x;
if(n>k)cout<<m<<endl;
else cout<<z<<endl;
return 0;
} | main.c:1:10: fatal error: bits/stdc++.h: No such file or directory
1 | #include <bits/stdc++.h>
| ^~~~~~~~~~~~~~~
compilation terminated.
|
s950921147 | p04011 | C++ | N = int(input())
K = int(input())
X = int(input())
Y = int(input())
total = 0
for i in range(N):
if i <= (K - 1):
total += X
else:
total += Y
print(total) | a.cc:1:1: error: 'N' does not name a type
1 | N = int(input())
| ^
|
s744349955 | p04011 | C |
#include <stdio.h>
int main()
{
int N,K,X,Y,s,i;
long long int X,Y,s;
scanf("%d %d %lld %lld",&N,&K,&X,&Y);
s=K*X+(N-K)*Y;
printf("%lld\n",s);
return 0;
}
| main.c: In function 'main':
main.c:6:18: error: conflicting types for 'X'; have 'long long int'
6 | long long int X,Y,s;
| ^
main.c:5:12: note: previous declaration of 'X' with type 'int'
5 | int N,K,X,Y,s,i;
| ^
main.c:6:20: error: conflicting types for 'Y'; have '... |
s533795469 | p04011 | C++ | #include <iostream>
using std::cin;
using std::cout;
using std::endl;
int main ()
{
int n, k, x, y;
cin << n;
cin << k;
cin << x;
cin << y;
if (n - k > 0) {
cout << k * x + (n - k) * y << endl;
} else {
cout << k * x << endl;
}
}
| a.cc: In function 'int main()':
a.cc:11:7: error: no match for 'operator<<' (operand types are 'std::istream' {aka 'std::basic_istream<char>'} and 'int')
11 | cin << n;
| ~~~ ^~ ~
| | |
| | int
| std::istream {aka std::basic_istream<char>}
a.cc:11:7: note: candidate: 'oper... |
s579960699 | p04011 | C++ | #include<iostream>
using namespace std;
int n;
int main(){
cin>>n>>k>>x>>y;
int ans=0;
for(i=1;i<=n;i++){
if(i<=k)ans+=x;
else ans+=y;
}
cout<<ans<<endl;
return 0;
} | a.cc: In function 'int main()':
a.cc:7:13: error: 'k' was not declared in this scope
7 | cin>>n>>k>>x>>y;
| ^
a.cc:7:16: error: 'x' was not declared in this scope
7 | cin>>n>>k>>x>>y;
| ^
a.cc:7:19: error: 'y' was not declared in this scope
7 | cin>>n>>k>>x... |
s777451872 | p04011 | C++ | import java.util.Scanner;
public class Main {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
int n = sc.nextInt(),k = sc.nextInt(),x = sc.nextInt(),y = sc.nextInt();
System.out.println(n < k ? n * x : k * x + ((n-k) * y));
}
}
| a.cc:1:1: error: 'import' does not name a type
1 | import java.util.Scanner;
| ^~~~~~
a.cc:1:1: note: C++20 'import' only available with '-fmodules-ts'
a.cc:3:1: error: expected unqualified-id before 'public'
3 | public class Main {
| ^~~~~~
|
s723145852 | p04011 | C++ | #include <bits/stdc++.h>
using namespace std;
int main(){
string a;
cin >> a;
int arr[1000];
memset(arr,0,sizeof(arr));
for(int i=0;i<a.size();i++){
arr[(int)a[i]]++;
}
int c=0;
for (int i=’a’;i<=’z’,i++){
if(arr[i]%2!=0) c++;
}
if (c!=0) cout << ’No’ <<endl;
... | a.cc:13:16: error: extended character ’ is not valid in an identifier
13 | for (int i=’a’;i<=’z’,i++){
| ^
a.cc:13:16: error: extended character ’ is not valid in an identifier
a.cc:13:23: error: extended character ’ is not valid in an identifier
13 | for (int i=’a’;i<=’z’,i++){
... |
s603743815 | p04011 | C++ | #include<iostream>
#include<cmath>
uisng namespace std;
int main()
{
int N,K,X,Y;cin>>N>>K>>X>>Y;
cout<<X*min(N,K)+Y*max(N-K,0)<<endl;
return 0;
} | a.cc:3:1: error: 'uisng' does not name a type
3 | uisng namespace std;
| ^~~~~
a.cc: In function 'int main()':
a.cc:6:15: error: 'cin' was not declared in this scope; did you mean 'std::cin'?
6 | int N,K,X,Y;cin>>N>>K>>X>>Y;
| ^~~
| std::cin
In file included from ... |
s617422430 | p04011 | C++ | #include <iostream>
int main(void){
int n,k,l,x,y;
cin >> n >> k >> x >> y;
n = n>k? n-k: 0;
cout << (k*x+n*y) << endl;
return 0;
} | a.cc: In function 'int main()':
a.cc:6:3: error: 'cin' was not declared in this scope; did you mean 'std::cin'?
6 | cin >> n >> k >> x >> y;
| ^~~
| std::cin
In file included from a.cc:1:
/usr/include/c++/14/iostream:62:18: note: 'std::cin' declared here
62 | extern istream cin; ///... |
s441813783 | p04011 | C++ | #include <iostream>
#include <math.h>
using namespace std;
const int Nmax = 50;
const int Amax = 50;
const int Xmax = 50;
long dp[Nmax+1][Nmax+1][Nmax*Xmax+1] = {};
long xarr[Xmax];
int main()
{
long N,A;
cin >> N >> A;
for (int i = 0; i < N; i++) cin >> xarr[i];
// end input
long m = (long)max(A, *max_e... | a.cc: In function 'int main()':
a.cc:20:26: error: 'max_element' was not declared in this scope
20 | long m = (long)max(A, *max_element(xarr, xarr+N));
| ^~~~~~~~~~~
|
s337523497 | p04011 | C++ | n = int(input())
k = int(input())
x = int(input())
y = int(input())
sum = 0
for i in range(n):
if i < k:
sum += x
else:
sum += y
print(sum)
| a.cc:1:1: error: 'n' does not name a type
1 | n = int(input())
| ^
|
s112199703 | p04011 | C++ | using System;
class A {
public static void Main() {
var n = int.Parse(Console.ReadLine());
var k = int.Parse(Console.ReadLine());
var x = int.Parse(Console.ReadLine());
var y = int.Parse(Console.ReadLine());
Console.WriteLine(n < k ? n * x : k * x + (n - k) * y);
}
}
| a.cc:1:7: error: expected nested-name-specifier before 'System'
1 | using System;
| ^~~~~~
a.cc:4:11: error: expected ':' before 'static'
4 | public static void Main() {
| ^~~~~~~
| :
a.cc:11:2: error: expected ';' after class definition
11 | }
| ^
... |
s896430765 | p04011 | C++ | #include<iostream>
using namespace std;
int main(void)
int n, k, x, y;
cin >> n >> k >> x >> y;
if (n > k ) cout << k*x+(n-k)*y << endl;
else cout << n*x << endl;
} | a.cc:5:3: error: expected initializer before 'int'
5 | int n, k, x, y;
| ^~~
a.cc:6:9: error: 'cin' does not name a type
6 | cin >> n >> k >> x >> y;
| ^~~
a.cc:8:4: error: expected unqualified-id before 'if'
8 | if (n > k ) cout << k*x+(n-k)*y << endl;
| ^~
a.cc:... |
s534824214 | p04011 | C++ | #include <iostream>
int main() {
int N, K, X, Y;
std::cin >> N;
std::cin >> K;
std::cin >> X;
std::cin >> Y;
if (N >= K) {
int ans = K * X + (N - K) * Y;
std::cout << ans <<std::endl;
} else {
int ans = N * X;
st... | a.cc: In function 'int main()':
a.cc:18:7: error: expected '}' at end of input
18 | }
| ^
a.cc:2:17: note: to match this '{'
2 | int main() {
| ^
|
s221091546 | p04011 | C++ | #include <iostream>
int main() {
int N, K, X, Y;
std::cout >> N;
std::cout >> K;
std::cout >> X;
std::cout >> Y;
int ans = K * X + (N - K) * Y;
std::cout << ans <<std::endl;
return 0;
}
| a.cc: In function 'int main()':
a.cc:4:14: error: no match for 'operator>>' (operand types are 'std::ostream' {aka 'std::basic_ostream<char>'} and 'int')
4 | std::cout >> N;
| ~~~~~~~~~ ^~ ~
| | |
| | int
| std::ostream {aka std::basic_ostream<char>}... |
s357434800 | p04011 | C++ | #include <iostream>
int main() {
int N, K, X, Y;
std::cout >> N;
std::cout >> K;
std::cout >> X;
std::cout >> Y;
int ans = K * X + (N - K) * Y;
std::cout << ans <<std::endl;
return 0;
}
| a.cc: In function 'int main()':
a.cc:4:14: error: no match for 'operator>>' (operand types are 'std::ostream' {aka 'std::basic_ostream<char>'} and 'int')
4 | std::cout >> N;
| ~~~~~~~~~ ^~ ~
| | |
| | int
| std::ostream {aka std::basic_ostream<char>}... |
s837525540 | p04011 | C++ | #include <bits/stdc++.h>
using namespace std;
int main() {
int N, K, X, Y
if (N <= K) {
cout << N * X << endl;
}
else {
cout << N * Y << endl;
}
} | a.cc: In function 'int main()':
a.cc:6:3: error: expected initializer before 'if'
6 | if (N <= K) {
| ^~
a.cc:9:3: error: 'else' without a previous 'if'
9 | else {
| ^~~~
a.cc:10:17: error: 'Y' was not declared in this scope
10 | cout << N * Y << endl;
| ^
|
s172187959 | p04011 | C++ | #include <iostream>
using namespace std;
int main(){
int n, k, x, y, a;
cin >> n >> k >> x >> y;
if (k >= n){
cout << n * x << endl;
}else{
k - n = a;
cout << (a * y) + (n * x) << endl;
}
return 0;
} | a.cc: In function 'int main()':
a.cc:9:7: error: lvalue required as left operand of assignment
9 | k - n = a;
| ~~^~~
|
s112644425 | p04011 | C++ | #include <iostream>
using namespace std;
int main(){
int n, k, x, y, a;
cin >> n >> k >> x >> y;
if (k > n){
cout << n * x << endl;
}else{
k - n = a;
cout << a * y + n * x << endl;
}
return 0;
} | a.cc: In function 'int main()':
a.cc:9:7: error: lvalue required as left operand of assignment
9 | k - n = a;
| ~~^~~
|
s549850672 | p04011 | C++ | #include<iostream>
using namespace std;
int main () {
int N,K,X,Y;
cin>>N>>K>>X>>Y;
cout<<K*X+(N-K)*Y<<endl;
return 0
} | a.cc: In function 'int main()':
a.cc:10:11: error: expected ';' before '}' token
10 | return 0
| ^
| ;
11 |
12 | }
| ~
|
s147285128 | p04011 | C++ | #include <bits/stdc++.h>
using namespace std;
int main() {
int N, K, X, Y;
cin << N << K << X << Y;
int a;
a = N * X;
if (N > K)
a = a + (N - K) * Y;
} | 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... |
s413595818 | p04011 | C++ | #include <bits/stdc++.h>
using namespace std;
int main(){
int a,b,c,d,pay;
cin>>a>>b>>c>>d;
if(a<=b){
pay=a*c;
}
else{
pay=b*c+(a-b)*d
}
cout<<pay<<endl;
} | a.cc: In function 'int main()':
a.cc:11:20: error: expected ';' before '}' token
11 | pay=b*c+(a-b)*d
| ^
| ;
12 | }
| ~
|
s291886640 | p04011 | C | #include<stdio.h>
int main()
int N,K,X,Y;
scanf("%d",&N)
}
| main.c: In function 'main':
main.c:4:5: error: expected declaration specifiers before 'scanf'
4 | scanf("%d",&N)
| ^~~~~
main.c:3:15: error: declaration for parameter 'Y' but no such parameter
3 | int N,K,X,Y;
| ^
main.c:3:13: error: declaration for parameter 'X' but no suc... |
s868999589 | p04011 | C | #include<stdio.h>
main()
{
int i,j,k,l,h,p,f,a;
scanf("%d", &i);
scanf("%d", &j);
scanf("%d", &l);
scanf("%d", &h);
p=i*l;
f=j*h;
a=(p+f);
printf("The accmodation fee is as follows: \n %d Eor 1st night\n %d For the 2nd night \n Thus in total=%d", p,f,a);
}
#include<stdio.h>
main()
{
... | main.c:2:1: error: return type defaults to 'int' [-Wimplicit-int]
2 | main()
| ^~~~
main.c:15:1: error: return type defaults to 'int' [-Wimplicit-int]
15 | main()
| ^~~~
main.c:15:1: error: redefinition of 'main'
main.c:2:1: note: previous definition of 'main' with type 'int()'
2 | main()
|... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.