submission_id
stringlengths 10
10
| problem_id
stringlengths 6
6
| language
stringclasses 3
values | code
stringlengths 1
522k
| compiler_output
stringlengths 43
10.2k
|
|---|---|---|---|---|
s794280338
|
p04011
|
C
|
#include<stdio.h>
int main(void) {
int n,k,x,y;
printf(""); scanf("%d", &n);
printf(""); scanf("%d", &k);
printf(""); scanf("%d", &x);
printf(""); scanf("%d", &y);
printf("%d", k * x - (n - k) * y));
return 0;
}
|
main.c: In function 'main':
main.c:9:36: error: expected ';' before ')' token
9 | printf("%d", k * x - (n - k) * y));
| ^
| ;
main.c:9:36: error: expected statement before ')' token
|
s292429297
|
p04011
|
C
|
#include<stdio.h>
int main(void) {
int n,k,x,y;
printf(""); scanf("%d", &n);
printf(""); scanf("%d", &k);
printf(""); scanf("%d", &x);
printf(""); scanf("%d", &y);
printf("%d", (n * k) + (k + 1) * y);
return 0:
}
|
main.c: In function 'main':
main.c:11:10: error: expected ';' before ':' token
11 | return 0:
| ^
| ;
|
s958210909
|
p04011
|
C
|
#include<stdio.h>
int main(void) {
int n,k,x,y;
printf(""); scanf("%d", &n);
printf(""); scanf("%d", &k);
printf(""); scanf("%d", &x);
printf(""); scanf("%d", &y);
printf("%d", (n * k) + (k + 1) * y)
return 0:
}
|
main.c: In function 'main':
main.c:9:38: error: expected ';' before 'return'
9 | printf("%d", (n * k) + (k + 1) * y)
| ^
| ;
10 |
11 | return 0:
| ~~~~~~
|
s909099650
|
p04011
|
C
|
#include<stdio.h>
int main(void) {
int n,k,x,y;
printf(""); scanf("%d", &n);
printf(""); scanf("%d", &k);
printf(""); scanf("%d", &x);
printf(""); scanf("%d", &y);
printf("%d", (n * k) + (k + 1) * y);
return 0:
|
main.c: In function 'main':
main.c:11:10: error: expected ';' before ':' token
11 | return 0:
| ^
| ;
main.c:11:2: error: expected declaration or statement at end of input
11 | return 0:
| ^~~~~~
|
s080459379
|
p04011
|
C
|
#include<stdio.h>
int main(void) {
int n,k,x,y;
printf(""); scanf("%d", &n);
printf(""); scanf("%d", &k);
printf(""); scanf("%d", &x);
printf(""); scanf("%d", &y);
printf("%d", (n * k) + (k + 1) * y)
return 0:
}
|
main.c: In function 'main':
main.c:9:38: error: expected ';' before 'return'
9 | printf("%d", (n * k) + (k + 1) * y)
| ^
| ;
10 |
11 | return 0:
| ~~~~~~
|
s475289757
|
p04011
|
C++
|
cout<<ans;
|
a.cc:1:5: error: 'cout' does not name a type
1 | cout<<ans;
| ^~~~
|
s631427721
|
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 price = 0;
if(n <= k){
price = n * x;
} else {
price = (n - k)*y + k * x
}
cout << price << endl;
}
|
a.cc: In function 'int main()':
a.cc:14:34: error: expected ';' before '}' token
14 | price = (n - k)*y + k * x
| ^
| ;
15 | }
| ~
|
s314560042
|
p04011
|
Java
|
import java.util.Scanner;
public class Problem2 {
public static void main(String[] args) {
int n, k, x, y, total1 = 0, total2 = 0, total;
Scanner input = new Scanner(System.in);
System.out.print("Total Night: ");
n = input.nextInt();
System.out.print("First Night: ");
k = input.nextInt();
System.out.print("X = ");
x = input.nextInt();
System.out.print("Y = ");
y = input.nextInt();
if ((n >= 1 && n <= 10000) && (k >= 1 && k <= 10000)) {
if ((x >= 1 && x <= 10000) && (y >= 1 && y <= 10000)) {
for (int i = 1; i <= k; i++) {
total1 = total1 + x;
}
for (int i = 1; i <= n - k; i++) {
total2 = total2 + y;
}
}
}
total = total1 + total2;
System.out.println(total);
}
}
|
Main.java:3: error: class Problem2 is public, should be declared in a file named Problem2.java
public class Problem2 {
^
1 error
|
s362713556
|
p04011
|
C++
|
#include <bits/stdc++.h>
using namespace std;
int main() {
cin >> N >> K >> X >> Y;
if(N >= K)cout << K*X+Y*(N-K) <<endl;
else{cout << N*X <<endl;}
}
|
a.cc: In function 'int main()':
a.cc:5:10: error: 'N' was not declared in this scope
5 | cin >> N >> K >> X >> Y;
| ^
a.cc:5:15: error: 'K' was not declared in this scope
5 | cin >> N >> K >> X >> Y;
| ^
a.cc:5:20: error: 'X' was not declared in this scope
5 | cin >> N >> K >> X >> Y;
| ^
a.cc:5:25: error: 'Y' was not declared in this scope
5 | cin >> N >> K >> X >> Y;
| ^
|
s901253847
|
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 fst_p,sec_d,sec_p,sum; fst_p = K * X//最初金額 sec_d = N - (K+1);//金額が変化する日数 sec_p = sec_d * Y;//変化した後の金額 sum = fst_p + sec_p; cout>>sum>>endl; return 0; }
|
a.cc:1:121: warning: extra tokens at end of #include directive
1 | #include<bits/stdc++.h> using namespace std; int main(){ int N,K,X,Y; cin>>N; cin>>K; cin>>X; cin>>Y; int fst_p,sec_d,sec_p,sum; fst_p = K * X//最初金額 sec_d = N - (K+1);//金額が変化する日数 sec_p = sec_d * Y;//変化した後の金額 sum = fst_p + sec_p; cout>>sum>>endl; return 0; }
| ^~~~~
/usr/bin/ld: /usr/lib/gcc/x86_64-linux-gnu/14/../../../x86_64-linux-gnu/Scrt1.o: in function `_start':
(.text+0x17): undefined reference to `main'
collect2: error: ld returned 1 exit status
|
s520682436
|
p04011
|
C
|
#include<stdio.h>
int main(){
int N, K, X, Y;
scanf("%d", N);
scanf("%d", K);
scanf("%d", X);
scanf("%d", Y);
if(N < K){
printf("%d", N * X);
}else{
printf("%d", (N - K) * X + K * Y);
return 0;
}
|
main.c: In function 'main':
main.c:13:5: error: expected declaration or statement at end of input
13 | }
| ^
|
s138683495
|
p04011
|
C
|
#include<stdio.h>
int main(){
int N, K, X, Y;
scanf("%d", N);
scanf("%d", K);
scanf("%d", X);
scanf("%d", Y);
if(N <= K){
printf("%d", N * X);
}else{
printf("%d", (N - K) * X + K * Y);
return 0;
}
|
main.c: In function 'main':
main.c:13:5: error: expected declaration or statement at end of input
13 | }
| ^
|
s383488906
|
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 fst_p,sec_d,sec_p,sum;
fst_p = K * X//最初金額
sec_d = N - (K+1);//金額が変化する日数
sec_p = sec_d * Y;//変化した後の金額
sum = fst_p + sec_p;
cout>>sum>>endl;
return 0;
}
|
a.cc: In function 'int main()':
a.cc:13:22: error: expected ';' before 'sec_d'
13 | fst_p = K * X//最初金額
| ^
| ;
14 |
15 | sec_d = N - (K+1);//金額が変化する日数
| ~~~~~
a.cc:20:13: error: no match for 'operator>>' (operand types are 'std::ostream' {aka 'std::basic_ostream<char>'} and 'int')
20 | cout>>sum>>endl;
| ~~~~^~~~~
| | |
| | int
| std::ostream {aka std::basic_ostream<char>}
a.cc:20:13: note: candidate: 'operator>>(int, int)' (built-in)
20 | cout>>sum>>endl;
| ~~~~^~~~~
a.cc:20:13: note: no known conversion for argument 1 from 'std::ostream' {aka 'std::basic_ostream<char>'} to 'int'
In file included from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:41,
from a.cc:1:
/usr/include/c++/14/cstddef:131:5: note: candidate: 'template<class _IntegerType> constexpr std::__byte_op_t<_IntegerType> std::operator>>(byte, _IntegerType)'
131 | operator>>(byte __b, _IntegerType __shift) noexcept
| ^~~~~~~~
/usr/include/c++/14/cstddef:131:5: note: template argument deduction/substitution failed:
a.cc:20:9: note: cannot convert 'std::cout' (type 'std::ostream' {aka 'std::basic_ostream<char>'}) to type 'std::byte'
20 | cout>>sum>>endl;
| ^~~~
In file included from /usr/include/c++/14/string:55,
from /usr/include/c++/14/bitset:52,
from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:52:
/usr/include/c++/14/bits/basic_string.tcc:835:5: note: candidate: 'template<class _CharT, class _Traits, class _Alloc> std::basic_istream<_CharT, _Traits>& std::operator>>(basic_istream<_CharT, _Traits>&, __cxx11::basic_string<_CharT, _Traits, _Allocator>&)'
835 | operator>>(basic_istream<_CharT, _Traits>& __in,
| ^~~~~~~~
/usr/include/c++/14/bits/basic_string.tcc:835:5: note: template argument deduction/substitution failed:
a.cc:20:15: note: 'std::ostream' {aka 'std::basic_ostream<char>'} is not derived from 'std::basic_istream<_CharT, _Traits>'
20 | cout>>sum>>endl;
| ^~~
/usr/include/c++/14/bitset:1597:5: note: candidate: 'template<class _CharT, class _Traits, long unsigned int _Nb> std::basic_istream<_CharT, _Traits>& std::operator>>(basic_istream<_CharT, _Traits>&, bitset<_Nb>&)'
1597 | operator>>(std::basic_istream<_CharT, _Traits>& __is, bitset<_Nb>& __x)
| ^~~~~~~~
/usr/include/c++/14/bitset:1597:5: note: template argument deduction/substitution failed:
a.cc:20:15: note: 'std::ostream' {aka 'std::basic_ostream<char>'} is not derived from 'std::basic_istream<_CharT, _Traits>'
20 | cout>>sum>>endl;
| ^~~
In file included from /usr/include/c++/14/istream:1109,
from /usr/include/c++/14/sstream:40,
from /usr/include/c++/14/complex:45,
from /usr/include/c++/14/ccomplex:39,
from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:127:
/usr/include/c++/14/bits/istream.tcc:978:5: note: candidate: 'template<class _CharT, class _Traits> std::basic_istream<_CharT, _Traits>& std::operator>>(basic_istream<_CharT, _Traits>&, _CharT&)'
978 | operator>>(basic_istream<_CharT, _Traits>& __in, _CharT& __c)
| ^~~~~~~~
/usr/include/c++/14/bits/istream.tcc:978:5: note: template argument deduction/substitution failed:
a.cc:20:15: note: 'std::ostream' {aka 'std::basic_ostream<char>'} is not derived from 'std::basic_istream<_CharT, _Traits>'
20 | cout>>sum>>endl;
| ^~~
/usr/include/c++/14/istream:849:5: note: candidate: 'template<class _Traits> std::basic_istream<char, _Traits>& std::operator>>(basic_istream<char, _Traits>&, unsigned char&)'
849 | operator>>(basic_istream<char, _Traits>& __in, unsigned char& __c)
| ^~~~~~~~
/usr/include/c++/14/istream:849:5: note: template argument deduction/substitution failed:
a.cc:20:15: note: 'std::ostream' {aka 'std::basic_ostream<char>'} is not derived from 'std::basic_istream<char, _Traits>'
20 | cout>>sum>>endl;
| ^~~
/usr/include/c++/14/istream:854:5: note: candidate: 'template<class _Traits> std::basic_istream<char, _Traits>& std::operator>>(basic_istream<char, _Traits>&, signed char&)'
854 | operator>>(basic_istream<char, _Traits>& __in, signed char& __c)
| ^~~~~~~~
/usr/include/c++/14/istream:854:5: note: template argument deduction/substitution failed:
a.cc:20:15: note: 'std::ostream' {aka 'std::basic_ostream<char>'} is not derived from 'std::basic_istream<char, _Traits>'
20 | cout>>sum>>endl;
| ^~~
/usr/include/c++/14/istream:896:5: note: candidate: 'template<class _CharT, class _Traits> std::basic_istream<_CharT, _Traits>& std::operator>>(basic_istream<_CharT, _Traits>&, _CharT*)'
896 | operator>>(basic_istream<_CharT, _Traits>& __in, _CharT* __s)
| ^~~~~~~~
/usr/include/c++/14/istream:896:5: note: template argument deduction/substitution failed:
a.cc:20:15: note: 'std::ostream' {aka 'std::basic_ostream<char>'} is not derived from 'std::basic_istream<_CharT, _Traits>'
20 | cout>>sum>>endl;
| ^~~
/usr/include/c++/14/istream:939:5: note: candidate: 'template<class _Traits> std::basic_istream<char, _Traits>& std::operator>>(basic_istream<char, _Traits>&, unsigned char*)'
939 | operator>>(basic_istream<char, _Traits>& __in, unsigned char* __s)
| ^~~~~~~~
/usr/include/c++/14/istream:939:5: note: template argument deduction/substitution failed:
a.cc:20:15: note: 'std::ostream' {aka 'std::basic_ostream<char>'} is not derived from 'std::basic_istream<char, _Traits>'
20 | cout>>sum>>endl;
| ^~~
/usr/include/c++/14/istream:945:5: note: candidate: 'template<class _Traits> std::basic_istream<char, _Traits>& std::operator>>(basic_istream<char, _Traits>&, signed char*)'
945 | operator>>(basic_istream<char, _Traits>& __in, signed char* __s)
| ^~~~~~~~
/usr/include/c++/14/istream:945:5: note: template argument deduction/substitution failed:
a.cc:20:15: note: 'std::ostream' {aka 'std::basic_ostream<char>'} is not derived from 'std::basic_istream<char, _Traits>'
20 | cout>>sum>>endl;
| ^~~
/usr/include/c++/14/istream:1099:5: note: candidate: 'template<class _Istream, class _Tp> _Istream&& std::operator>>(_Istream&&, _Tp&&)'
1099 | operator>>(_Istream&& __is, _Tp&& __x)
| ^~~~~~~~
/usr/include/c++/14/istream:1099:5: note: template argument deduction/substitution failed:
/usr/include/c++/14/istream: In substitution of 'template<class _Istream, class _Tp> _Istream&& std::operator>>(_Istream&&, _Tp&&) [with _Istream = std::basic_ostream<char>&; _Tp = int&]':
a.cc:20:8: required from here
20 | cout>>sum>>endl;
| ^~~
/usr/include/c++/14/istream:1099:5: error: no type named 'type' in 'struct std::enable_if<false, void>'
1099 | operator>>(_Istream&& __is, _Tp&& __x)
| ^~~~~~~~
/usr/include/c++/14/complex:509:5: note: candidate: 'template<class _Tp, class _CharT, class _Traits> std::basic_istream<_CharT, _Traits>& std::operator>>(basic_istream<_CharT, _Traits>&, complex<_Tp>&)'
509 | operator>>(basic_istream<_CharT, _Traits>& __is, complex<_Tp>& __x)
| ^~~~~~~~
/usr/include/c++/14/complex:509:5: note: template argument deduction/substitution failed:
a.cc:20:15: note: 'std::ostream' {aka 'std::basic_ostream<char>'} is not derived from 'std::basic_istream<_CharT, _Traits>'
20 | cout>>sum>>endl;
| ^~~
In file included from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:143:
/usr/include/c++/14/iomanip:76:5: note: candidate: 'template<class _CharT, class _Traits> std::basic_istream<_CharT, _Traits>& std::operator>>(basic_istream<_CharT, _Traits>&, _Resetiosflags)'
76 | operator>>(basic_istream<_CharT, _Traits>& __is, _Resetiosflags __f)
| ^~~~~~~~
/usr/include/c++/14/iomanip:76:5: note: template argument deduction/substitution failed:
a.cc:20:15: note: 'std::ostream' {aka 'std::basic_ostream<char>'} is not derived from 'std::basic_istream<_CharT, _Traits>'
20 | cout>>sum>>endl;
| ^~~
/usr/include/c++/14/iomanip:106:5: note: candidate: 'template<class _CharT, class _Traits> std::basic_istream<_CharT, _Traits>& std::operator>>(basic_istream<_CharT, _Traits>&, _Setiosflags)'
106 | operator>>(basic_istream<_CharT, _Traits>& __is, _Setiosflags __f)
| ^~~~~~~~
/usr/include/c++/14/iomanip:106:5: note: template argument deduction/substitution failed:
a.cc:20:15: note: 'std::ostream' {aka 'std::basic_ostream<char>'} is not derived from 'std::basic_istream<_CharT, _Traits>'
20 | cout>>sum>>endl;
| ^~~
/usr/include/c++/14/iomanip:137:5: note: candidate: 'template<class _CharT, class _Traits> std::basic_istream<_CharT, _Traits>& std::operator>>(basic_istream<_CharT, _Traits>&, _Setbase)'
137 | operator>>(basic_istream<_CharT, _Traits>& __is, _Setbase __f)
| ^~~~~~~~
/usr/include/c++/14/iomanip:137:5: note: template argument deduction/substitution failed:
a.cc:20:15: note: 'std::ostream' {aka 'std::basic_ostream<char>'} is not derived from 'std::basic_istream<_CharT, _Traits>'
20 | cout>>sum>>endl;
| ^~~
/usr/include/c++/14/iomanip:177:5: note: candidate: 'template<class _CharT, class _Traits> std::basic_istream<_CharT, _Traits>& std::operator>>(basic_istream<_CharT, _Traits>&, _Setfill<_CharT>)'
177 | operator>>(basic_istream<_CharT, _Traits>& __is, _Setfill<_CharT> __f)
| ^~~~~~~~
/usr/include/c++/14/iomanip:177:5: note: template argument deduction/substitution failed:
a.cc:20:15: note: 'std::ostream' {aka 'std::basic_ostream<char>'} is not derived from 'std::basic_istream<_CharT, _Traits>'
20 | cout>>sum>>endl;
| ^~~
/usr/include/c++/14/iomanip:207:5: note: candidate: 'template<cla
|
s437352505
|
p04011
|
C++
|
#include<iostream>
using namespace std;
int main(){
int N,K,X,Y;
cin>>N;
cin>>K;
cin>>X;
cin>>Y;
int fst_p,sec_d,sec_p,sum;
fst_p = K * X//最初金額
sec_d = N - (K+1);//金額が変化する日数
sec_p = sec_d * Y;//変化した後の金額
sum = fst_p + sec_p;
cout>>sum>>endl;
return 0;
}
|
a.cc: In function 'int main()':
a.cc:13:22: error: expected ';' before 'sec_d'
13 | fst_p = K * X//最初金額
| ^
| ;
14 |
15 | sec_d = N - (K+1);//金額が変化する日数
| ~~~~~
a.cc:20:13: error: no match for 'operator>>' (operand types are 'std::ostream' {aka 'std::basic_ostream<char>'} and 'int')
20 | cout>>sum>>endl;
| ~~~~^~~~~
| | |
| | int
| std::ostream {aka std::basic_ostream<char>}
a.cc:20:13: note: candidate: 'operator>>(int, int)' (built-in)
20 | cout>>sum>>endl;
| ~~~~^~~~~
a.cc:20:13: note: no known conversion for argument 1 from 'std::ostream' {aka 'std::basic_ostream<char>'} to 'int'
In file included from /usr/include/c++/14/string:55,
from /usr/include/c++/14/bits/locale_classes.h:40,
from /usr/include/c++/14/bits/ios_base.h:41,
from /usr/include/c++/14/ios:44,
from /usr/include/c++/14/ostream:40,
from /usr/include/c++/14/iostream:41,
from a.cc:1:
/usr/include/c++/14/bits/basic_string.tcc:835:5: note: candidate: 'template<class _CharT, class _Traits, class _Alloc> std::basic_istream<_CharT, _Traits>& std::operator>>(basic_istream<_CharT, _Traits>&, __cxx11::basic_string<_CharT, _Traits, _Allocator>&)'
835 | operator>>(basic_istream<_CharT, _Traits>& __in,
| ^~~~~~~~
/usr/include/c++/14/bits/basic_string.tcc:835:5: note: template argument deduction/substitution failed:
a.cc:20:15: note: 'std::ostream' {aka 'std::basic_ostream<char>'} is not derived from 'std::basic_istream<_CharT, _Traits>'
20 | cout>>sum>>endl;
| ^~~
In file included from /usr/include/c++/14/bits/memory_resource.h:38,
from /usr/include/c++/14/string:68:
/usr/include/c++/14/cstddef:131:5: note: candidate: 'template<class _IntegerType> constexpr std::__byte_op_t<_IntegerType> std::operator>>(byte, _IntegerType)'
131 | operator>>(byte __b, _IntegerType __shift) noexcept
| ^~~~~~~~
/usr/include/c++/14/cstddef:131:5: note: template argument deduction/substitution failed:
a.cc:20:9: note: cannot convert 'std::cout' (type 'std::ostream' {aka 'std::basic_ostream<char>'}) to type 'std::byte'
20 | cout>>sum>>endl;
| ^~~~
In file included from /usr/include/c++/14/istream:1109,
from /usr/include/c++/14/iostream:42:
/usr/include/c++/14/bits/istream.tcc:978:5: note: candidate: 'template<class _CharT, class _Traits> std::basic_istream<_CharT, _Traits>& std::operator>>(basic_istream<_CharT, _Traits>&, _CharT&)'
978 | operator>>(basic_istream<_CharT, _Traits>& __in, _CharT& __c)
| ^~~~~~~~
/usr/include/c++/14/bits/istream.tcc:978:5: note: template argument deduction/substitution failed:
a.cc:20:15: note: 'std::ostream' {aka 'std::basic_ostream<char>'} is not derived from 'std::basic_istream<_CharT, _Traits>'
20 | cout>>sum>>endl;
| ^~~
/usr/include/c++/14/istream:849:5: note: candidate: 'template<class _Traits> std::basic_istream<char, _Traits>& std::operator>>(basic_istream<char, _Traits>&, unsigned char&)'
849 | operator>>(basic_istream<char, _Traits>& __in, unsigned char& __c)
| ^~~~~~~~
/usr/include/c++/14/istream:849:5: note: template argument deduction/substitution failed:
a.cc:20:15: note: 'std::ostream' {aka 'std::basic_ostream<char>'} is not derived from 'std::basic_istream<char, _Traits>'
20 | cout>>sum>>endl;
| ^~~
/usr/include/c++/14/istream:854:5: note: candidate: 'template<class _Traits> std::basic_istream<char, _Traits>& std::operator>>(basic_istream<char, _Traits>&, signed char&)'
854 | operator>>(basic_istream<char, _Traits>& __in, signed char& __c)
| ^~~~~~~~
/usr/include/c++/14/istream:854:5: note: template argument deduction/substitution failed:
a.cc:20:15: note: 'std::ostream' {aka 'std::basic_ostream<char>'} is not derived from 'std::basic_istream<char, _Traits>'
20 | cout>>sum>>endl;
| ^~~
/usr/include/c++/14/istream:896:5: note: candidate: 'template<class _CharT, class _Traits> std::basic_istream<_CharT, _Traits>& std::operator>>(basic_istream<_CharT, _Traits>&, _CharT*)'
896 | operator>>(basic_istream<_CharT, _Traits>& __in, _CharT* __s)
| ^~~~~~~~
/usr/include/c++/14/istream:896:5: note: template argument deduction/substitution failed:
a.cc:20:15: note: 'std::ostream' {aka 'std::basic_ostream<char>'} is not derived from 'std::basic_istream<_CharT, _Traits>'
20 | cout>>sum>>endl;
| ^~~
/usr/include/c++/14/istream:939:5: note: candidate: 'template<class _Traits> std::basic_istream<char, _Traits>& std::operator>>(basic_istream<char, _Traits>&, unsigned char*)'
939 | operator>>(basic_istream<char, _Traits>& __in, unsigned char* __s)
| ^~~~~~~~
/usr/include/c++/14/istream:939:5: note: template argument deduction/substitution failed:
a.cc:20:15: note: 'std::ostream' {aka 'std::basic_ostream<char>'} is not derived from 'std::basic_istream<char, _Traits>'
20 | cout>>sum>>endl;
| ^~~
/usr/include/c++/14/istream:945:5: note: candidate: 'template<class _Traits> std::basic_istream<char, _Traits>& std::operator>>(basic_istream<char, _Traits>&, signed char*)'
945 | operator>>(basic_istream<char, _Traits>& __in, signed char* __s)
| ^~~~~~~~
/usr/include/c++/14/istream:945:5: note: template argument deduction/substitution failed:
a.cc:20:15: note: 'std::ostream' {aka 'std::basic_ostream<char>'} is not derived from 'std::basic_istream<char, _Traits>'
20 | cout>>sum>>endl;
| ^~~
/usr/include/c++/14/istream:1099:5: note: candidate: 'template<class _Istream, class _Tp> _Istream&& std::operator>>(_Istream&&, _Tp&&)'
1099 | operator>>(_Istream&& __is, _Tp&& __x)
| ^~~~~~~~
/usr/include/c++/14/istream:1099:5: note: template argument deduction/substitution failed:
/usr/include/c++/14/istream: In substitution of 'template<class _Istream, class _Tp> _Istream&& std::operator>>(_Istream&&, _Tp&&) [with _Istream = std::basic_ostream<char>&; _Tp = int&]':
a.cc:20:8: required from here
20 | cout>>sum>>endl;
| ^~~
/usr/include/c++/14/istream:1099:5: error: no type named 'type' in 'struct std::enable_if<false, void>'
1099 | operator>>(_Istream&& __is, _Tp&& __x)
| ^~~~~~~~
|
s210338427
|
p04011
|
C++
|
#include<iostream>
using namespace std;
int main(){
int N,K,X,Y;
cin>>N;
cin>>K;
cin>>X;
cin>>Y;
int fst_p,sec_d,sec_p,sum;
fst_p = K * X//最初金額
sec_d = N - (K+1);//金額が変化する日数
sec_p = sec_d * Y;//変化した後の金額
sum = fst_p + sec_p;
cout>>sum>>endl;
return 0;
}
|
a.cc: In function 'int main()':
a.cc:13:22: error: expected ';' before 'sec_d'
13 | fst_p = K * X//最初金額
| ^
| ;
14 |
15 | sec_d = N - (K+1);//金額が変化する日数
| ~~~~~
a.cc:20:13: error: no match for 'operator>>' (operand types are 'std::ostream' {aka 'std::basic_ostream<char>'} and 'int')
20 | cout>>sum>>endl;
| ~~~~^~~~~
| | |
| | int
| std::ostream {aka std::basic_ostream<char>}
a.cc:20:13: note: candidate: 'operator>>(int, int)' (built-in)
20 | cout>>sum>>endl;
| ~~~~^~~~~
a.cc:20:13: note: no known conversion for argument 1 from 'std::ostream' {aka 'std::basic_ostream<char>'} to 'int'
In file included from /usr/include/c++/14/string:55,
from /usr/include/c++/14/bits/locale_classes.h:40,
from /usr/include/c++/14/bits/ios_base.h:41,
from /usr/include/c++/14/ios:44,
from /usr/include/c++/14/ostream:40,
from /usr/include/c++/14/iostream:41,
from a.cc:1:
/usr/include/c++/14/bits/basic_string.tcc:835:5: note: candidate: 'template<class _CharT, class _Traits, class _Alloc> std::basic_istream<_CharT, _Traits>& std::operator>>(basic_istream<_CharT, _Traits>&, __cxx11::basic_string<_CharT, _Traits, _Allocator>&)'
835 | operator>>(basic_istream<_CharT, _Traits>& __in,
| ^~~~~~~~
/usr/include/c++/14/bits/basic_string.tcc:835:5: note: template argument deduction/substitution failed:
a.cc:20:15: note: 'std::ostream' {aka 'std::basic_ostream<char>'} is not derived from 'std::basic_istream<_CharT, _Traits>'
20 | cout>>sum>>endl;
| ^~~
In file included from /usr/include/c++/14/bits/memory_resource.h:38,
from /usr/include/c++/14/string:68:
/usr/include/c++/14/cstddef:131:5: note: candidate: 'template<class _IntegerType> constexpr std::__byte_op_t<_IntegerType> std::operator>>(byte, _IntegerType)'
131 | operator>>(byte __b, _IntegerType __shift) noexcept
| ^~~~~~~~
/usr/include/c++/14/cstddef:131:5: note: template argument deduction/substitution failed:
a.cc:20:9: note: cannot convert 'std::cout' (type 'std::ostream' {aka 'std::basic_ostream<char>'}) to type 'std::byte'
20 | cout>>sum>>endl;
| ^~~~
In file included from /usr/include/c++/14/istream:1109,
from /usr/include/c++/14/iostream:42:
/usr/include/c++/14/bits/istream.tcc:978:5: note: candidate: 'template<class _CharT, class _Traits> std::basic_istream<_CharT, _Traits>& std::operator>>(basic_istream<_CharT, _Traits>&, _CharT&)'
978 | operator>>(basic_istream<_CharT, _Traits>& __in, _CharT& __c)
| ^~~~~~~~
/usr/include/c++/14/bits/istream.tcc:978:5: note: template argument deduction/substitution failed:
a.cc:20:15: note: 'std::ostream' {aka 'std::basic_ostream<char>'} is not derived from 'std::basic_istream<_CharT, _Traits>'
20 | cout>>sum>>endl;
| ^~~
/usr/include/c++/14/istream:849:5: note: candidate: 'template<class _Traits> std::basic_istream<char, _Traits>& std::operator>>(basic_istream<char, _Traits>&, unsigned char&)'
849 | operator>>(basic_istream<char, _Traits>& __in, unsigned char& __c)
| ^~~~~~~~
/usr/include/c++/14/istream:849:5: note: template argument deduction/substitution failed:
a.cc:20:15: note: 'std::ostream' {aka 'std::basic_ostream<char>'} is not derived from 'std::basic_istream<char, _Traits>'
20 | cout>>sum>>endl;
| ^~~
/usr/include/c++/14/istream:854:5: note: candidate: 'template<class _Traits> std::basic_istream<char, _Traits>& std::operator>>(basic_istream<char, _Traits>&, signed char&)'
854 | operator>>(basic_istream<char, _Traits>& __in, signed char& __c)
| ^~~~~~~~
/usr/include/c++/14/istream:854:5: note: template argument deduction/substitution failed:
a.cc:20:15: note: 'std::ostream' {aka 'std::basic_ostream<char>'} is not derived from 'std::basic_istream<char, _Traits>'
20 | cout>>sum>>endl;
| ^~~
/usr/include/c++/14/istream:896:5: note: candidate: 'template<class _CharT, class _Traits> std::basic_istream<_CharT, _Traits>& std::operator>>(basic_istream<_CharT, _Traits>&, _CharT*)'
896 | operator>>(basic_istream<_CharT, _Traits>& __in, _CharT* __s)
| ^~~~~~~~
/usr/include/c++/14/istream:896:5: note: template argument deduction/substitution failed:
a.cc:20:15: note: 'std::ostream' {aka 'std::basic_ostream<char>'} is not derived from 'std::basic_istream<_CharT, _Traits>'
20 | cout>>sum>>endl;
| ^~~
/usr/include/c++/14/istream:939:5: note: candidate: 'template<class _Traits> std::basic_istream<char, _Traits>& std::operator>>(basic_istream<char, _Traits>&, unsigned char*)'
939 | operator>>(basic_istream<char, _Traits>& __in, unsigned char* __s)
| ^~~~~~~~
/usr/include/c++/14/istream:939:5: note: template argument deduction/substitution failed:
a.cc:20:15: note: 'std::ostream' {aka 'std::basic_ostream<char>'} is not derived from 'std::basic_istream<char, _Traits>'
20 | cout>>sum>>endl;
| ^~~
/usr/include/c++/14/istream:945:5: note: candidate: 'template<class _Traits> std::basic_istream<char, _Traits>& std::operator>>(basic_istream<char, _Traits>&, signed char*)'
945 | operator>>(basic_istream<char, _Traits>& __in, signed char* __s)
| ^~~~~~~~
/usr/include/c++/14/istream:945:5: note: template argument deduction/substitution failed:
a.cc:20:15: note: 'std::ostream' {aka 'std::basic_ostream<char>'} is not derived from 'std::basic_istream<char, _Traits>'
20 | cout>>sum>>endl;
| ^~~
/usr/include/c++/14/istream:1099:5: note: candidate: 'template<class _Istream, class _Tp> _Istream&& std::operator>>(_Istream&&, _Tp&&)'
1099 | operator>>(_Istream&& __is, _Tp&& __x)
| ^~~~~~~~
/usr/include/c++/14/istream:1099:5: note: template argument deduction/substitution failed:
/usr/include/c++/14/istream: In substitution of 'template<class _Istream, class _Tp> _Istream&& std::operator>>(_Istream&&, _Tp&&) [with _Istream = std::basic_ostream<char>&; _Tp = int&]':
a.cc:20:8: required from here
20 | cout>>sum>>endl;
| ^~~
/usr/include/c++/14/istream:1099:5: error: no type named 'type' in 'struct std::enable_if<false, void>'
1099 | operator>>(_Istream&& __is, _Tp&& __x)
| ^~~~~~~~
|
s484469761
|
p04011
|
C++
|
#include <iostream>
using namespace std;
int main(){
int n;
int k;
int x;
int y;
cin >> n;
cin >> k;
cin >> x;
cin >> y;
cout << k * x +(n - k) * y endl;
}
|
a.cc: In function 'int main()':
a.cc:14:31: error: expected ';' before 'endl'
14 | cout << k * x +(n - k) * y endl;
| ^~~~~
| ;
|
s528402659
|
p04011
|
C++
|
nclude<iostream>
#include<string>
#include<vector>
#include<algorithm>
#include<set>
using namespace std;
// cin>>n>>k;
// cout<<n<<k<<endl;
//string S[100];
int main(){
int N,K,X,Y;cin>>N>>K>>X>>Y;
int ans;
for(int i=1;i<N+1;i++){
if(K<i){
ans+=Y;
}else{
ans+=X;
}
}
cout<<ans<<endl;
}
|
a.cc:1:1: error: 'nclude' does not name a type
1 | nclude<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 | typedef ptrdiff_t streamsize; // Signed integral type
| ^~~~~~~~~
/usr/include/c++/14/bits/postypes.h:41:1: note: 'ptrdiff_t' is defined in header '<cstddef>'; this is probably fixable by adding '#include <cstddef>'
40 | #include <cwchar> // For mbstate_t
+++ |+#include <cstddef>
41 |
In file included from /usr/include/c++/14/bits/char_traits.h:50:
/usr/include/c++/14/type_traits:666:33: error: 'nullptr_t' is not a member of 'std'
666 | struct is_null_pointer<std::nullptr_t>
| ^~~~~~~~~
/usr/include/c++/14/type_traits:666:42: error: template argument 1 is invalid
666 | struct is_null_pointer<std::nullptr_t>
| ^
/usr/include/c++/14/type_traits:670:48: error: template argument 1 is invalid
670 | struct is_null_pointer<const std::nullptr_t>
| ^
/usr/include/c++/14/type_traits:674:51: error: template argument 1 is invalid
674 | struct is_null_pointer<volatile std::nullptr_t>
| ^
/usr/include/c++/14/type_traits:678:57: error: template argument 1 is invalid
678 | struct is_null_pointer<const volatile std::nullptr_t>
| ^
/usr/include/c++/14/type_traits:1429:37: error: 'size_t' is not a member of 'std'; did you mean 'size_t'?
1429 | : public integral_constant<std::size_t, alignof(_Tp)>
| ^~~~~~
In file included from /usr/include/wchar.h:35,
from /usr/include/c++/14/cwchar:44,
from /usr/include/c++/14/bits/postypes.h:40:
/usr/lib/gcc/x86_64-linux-gnu/14/include/stddef.h:214:23: note: 'size_t' declared here
214 | typedef __SIZE_TYPE__ size_t;
| ^~~~~~
/usr/include/c++/14/type_traits:1429:57: error: template argument 1 is invalid
1429 | : public integral_constant<std::size_t, alignof(_Tp)>
| ^
/usr/include/c++/14/type_traits:1429:57: note: invalid template non-type parameter
/usr/include/c++/14/type_traits:1438:37: error: 'size_t' is not a member of 'std'; did you mean 'size_t'?
1438 | : public integral_constant<std::size_t, 0> { };
| ^~~~~~
/usr/lib/gcc/x86_64-linux-gnu/14/include/stddef.h:214:23: note: 'size_t' declared here
214 | typedef __SIZE_TYPE__ size_t;
| ^~~~~~
/usr/include/c++/14/type_traits:1438:46: error: template argument 1 is invalid
1438 | : public integral_constant<std::size_t, 0> { };
| ^
/usr/include/c++/14/type_traits:1438:46: note: invalid template non-type parameter
/usr/include/c++/14/type_traits:1440:26: error: 'std::size_t' has not been declared
1440 | template<typename _Tp, std::size_t _Size>
| ^~~
/usr/include/c++/14/type_traits:1441:21: error: '_Size' was not declared in this scope
1441 | struct rank<_Tp[_Size]>
| ^~~~~
/usr/include/c++/14/type_traits:1441:27: error: template argument 1 is invalid
1441 | struct rank<_Tp[_Size]>
| ^
/usr/include/c++/14/type_traits:1442:37: error: 'size_t' is not a member of 'std'; did you mean 'size_t'?
1442 | : public integral_constant<std::size_t, 1 + rank<_Tp>::value> { };
| ^~~~~~
/usr/lib/gcc/x86_64-linux-gnu/14/include/stddef.h:214:23: note: 'size_t' declared here
214 | typedef __SIZE_TYPE__ size_t;
| ^~~~~~
/usr/include/c++/14/type_traits:1442:65: error: template argument 1 is invalid
1442 | : public integral_constant<std::size_t, 1 + rank<_Tp>::value> { };
| ^
/usr/include/c++/14/type_traits:1442:65: note: invalid template non-type parameter
/usr/include/c++/14/type_traits:1446:37: error: 'size_t' is not a member of 'std'; did you mean 'size_t'?
1446 | : public integral_constant<std::size_t, 1 + rank<_Tp>::value> { };
| ^~~~~~
/usr/lib/gcc/x86_64-linux-gnu/14/include/stddef.h:214:23: note: 'size_t' declared here
214 | typedef __SIZE_TYPE__ size_t;
| ^~~~~~
/usr/include/c++/14/type_traits:1446:65: error: template argument 1 is invalid
1446 | : public integral_constant<std::size_t, 1 + rank<_Tp>::value> { };
| ^
/usr/include/c++/14/type_traits:1446:65: note: invalid template non-type parameter
/usr/include/c++/14/type_traits:2086:26: error: 'std::size_t' has not been declared
2086 | template<typename _Tp, std::size_t _Size>
| ^~~
/usr/include/c++/14/type_traits:2087:30: error: '_Size' was not declared in this scope
2087 | struct remove_extent<_Tp[_Size]>
| ^~~~~
/usr/include/c++/14/type_traits:2087:36: error: template argument 1 is invalid
2087 | struct remove_extent<_Tp[_Size]>
| ^
/usr/include/c++/14/type_traits:2099:26: error: 'std::size_t' has not been declared
2099 | template<typename _Tp, std::size_t _Size>
| ^~~
/usr/include/c++/14/type_traits:2100:35: error: '_Size' was not declared in this scope
2100 | struct remove_all_extents<_Tp[_Size]>
| ^~~~~
/usr/include/c++/14/type_traits:2100:41: error: template argument 1 is invalid
2100 | struct remove_all_extents<_Tp[_Size]>
| ^
/usr/include/c++/14/type_traits:2171:12: error: 'std::size_t' has not been declared
2171 | template<std::size_t _Len>
| ^~~
/usr/include/c++/14/type_traits:2176:30: error: '_Len' was not declared in this scope
2176 | unsigned char __data[_Len];
| ^~~~
/usr/include/c++/14/type_traits:2194:12: error: 'std::size_t' has not been declared
2194 | template<std::size_t _Len, std::size_t _Align =
| ^~~
/usr/include/c++/14/type_traits:2194:30: error: 'std::size_t' has not been declared
2194 | template<std::size_t _Len, std::size_t _Align =
| ^~~
/usr/include/c++/14/type_traits:2195:55: error: '_Len' was not declared in this scope
2195 | __alignof__(typename __aligned_storage_msa<_Len>::__type)>
| ^~~~
/usr/include/c++/14/type_traits:2195:59: error: template argument 1 is invalid
2195 | __alignof__(typename __aligned_storage_msa<_Len>::__type)>
| ^
/usr/include/c++/14/type_traits:2202:30: error: '_Len' was not declared in this scope
2202 | unsigned char __data[_Len];
| ^~~~
/usr/include/c++/14/type_traits:2203:44: error: '_Align' was not declared in this scope
2203 | struct __attribute__((__aligned__((_Align)))) { } __align;
| ^~~~~~
/usr/include/c++/14/bits/char_traits.h:144:61: error: 'std::size_t' has not been declared
144 | compare(const char_type* __s1, const char_type* __s2, std::size_t __n);
| ^~~
/usr/include/c++/14/bits/char_traits.h:146:40: error: 'size_t' in namespace 'std' does not name a type
146 | static _GLIBCXX14_CONSTEXPR std::size_t
| ^~~~~~
/usr/include/c++/14/bits/char_traits.h:150:34: error: 'std::size_t' has not been declared
150 | find(const char_type* __s, std::size_t __n, const char_type& __a);
| ^~~
/usr/include/c++/14/bits/char_traits.h:153:52: error: 'std::size_t' has not been declared
153 | move(char_type* __s1, const char_type* __s2, std::size_t __n);
| ^~~
/usr/include/c++/14/bits/char_traits.h:156:52: error: 'std::size_t' has not been declared
156 | copy(char_type* __s1, const char_type* __s2, std::size_t __n);
| ^~~
/usr/include/c++/14/bits/char_traits.h:159:30: error: 'std::size_t' has not been declared
159 | assign(char_type* __s, std::size_t __n, char_type __a);
| ^~~
/usr/include/c++/14/bits/char_traits.h:187:59: error: 'std::size_t' has not been declared
187 | compare(const char_type* __s1, const char_type* __s2, std::size_t __n)
| ^~~
/usr/include/c++/14/bits/char_traits.h: In static member function 'static constexpr int __gnu_cxx::char_traits<_CharT>::compare(const char_type*, const char_type*, int)':
/usr/include/c++/14/bits/char_traits.h:189:17: error: 'size_t' is not a member of 'std'; did you mean 'size_t'?
189 | for (std::size_t __i = 0; __i < __n; ++__i)
| ^~~~~~
/usr/lib/gcc/x86_64-linux-gnu/14/include/stddef.h:214:23: note: 'size_t' declared here
214 | typedef __SIZE_TYPE__ size_t;
| ^~~~~~
/usr/include/c++/14/bits/char_traits.h:189:33: error: '__i' was not declared in this scope; did you mean '__n'?
189 | for (std::size_t __i = 0; __i < __n; ++__i)
| ^~~
| __n
/usr/include/c++/14/bits/char_traits.h: At global scope:
/usr/include/c++/14/bits/char_traits.h:198:31: error: 'size_t' in namespace 'std' does not name a type
198 | _GLIBCXX14_CONSTEXPR std::size_t
|
|
s638390315
|
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",a*c);
}
else if{
printf("%d",a*c + (a-b+1)*d);
}
return 0;
}
|
main.c: In function 'main':
main.c:12:10: error: expected '(' before '{' token
12 | else if{
| ^
| (
|
s503445744
|
p04011
|
C++
|
n=int(input())
k=int(input())
x=int(input())
y=int(input())
if n<=k:
print(x*n)
elif n>k:
print(k*x+(n-k)*y)
|
a.cc:1:1: error: 'n' does not name a type
1 | n=int(input())
| ^
|
s613482895
|
p04011
|
C++
|
#include <stdio.h>
int main(void){
int N,K,X,Y;
scanf("%d %d %d %d",&N,&K,&X,&Y);
Z = |X-Y|;
printf("%d\n",N*X -(N-K)*Z);
return 0;
}
|
a.cc: In function 'int main()':
a.cc:5:9: error: 'Z' was not declared in this scope
5 | Z = |X-Y|;
| ^
a.cc:5:13: error: expected primary-expression before '|' token
5 | Z = |X-Y|;
| ^
a.cc:5:18: error: expected primary-expression before ';' token
5 | Z = |X-Y|;
| ^
|
s235003229
|
p04011
|
C++
|
#include <stdio.h>
int main(void){
int N,K,X,Y;
scanf("%d %d %d %d",&N,&K,&X,&Y);
printf("%d\n",N*X -(N-K)*|X-Y|);
return 0;
}
|
a.cc: In function 'int main()':
a.cc:5:34: error: expected primary-expression before '|' token
5 | printf("%d\n",N*X -(N-K)*|X-Y|);
| ^
a.cc:5:39: error: expected primary-expression before ')' token
5 | printf("%d\n",N*X -(N-K)*|X-Y|);
| ^
|
s741157622
|
p04011
|
C++
|
#include <iostream>
#include <fstream>
#include <cstdio>
#include <cmath>
#include <vector>
#include <string>
#include <set>
#include <map>
#include <stack>
#include <queue>
#include <deque>
#include <bitset>
#include <algorithm>
#include <complex>
#include <array>
using namespace std;
#define REP(i,n) for(int i=0; i<n; ++i)
#define FOR(i,a,b) for(int i=a; i<=b; ++i)
#define FORR(i,a,b) for (int i=a; i>=b; --i)
#define ALL(c) (c).begin(), (c).end()
typedef long long ll;
typedef vector<int> VI;
typedef vector<ll> VL;
typedef vector<double> VD;
typedef vector<VI> VVI;
typedef vector<VL> VVL;
typedef vector<VD> VVD;
typedef pair<int,int> P;
typedef pair<ll,ll> PL;
using Graph=vector<vector<int>>;
template<class t,class u> void chmax(t&a,u b){if(a<b)a=b;}
template<class t,class u> void chmin(t&a,u b){if(b<a)a=b;}
int main()
{
i N,K;
cin>>N>>K;
int Y,X;
cin>>X>>Y;
if(N>K)
{
cout<<X*K+Y*(N-K);
}
else
{
cout<<X*N;
}
}
|
a.cc: In function 'int main()':
a.cc:40:3: error: 'i' was not declared in this scope
40 | i N,K;
| ^
a.cc:41:8: error: 'N' was not declared in this scope
41 | cin>>N>>K;
| ^
a.cc:41:11: error: 'K' was not declared in this scope
41 | cin>>N>>K;
| ^
|
s334665291
|
p04011
|
C++
|
#include <iostream>
#include <fstream>
#include <cstdio>
#include <cmath>
#include <vector>
#include <string>
#include <set>
#include <map>
#include <stack>
#include <queue>
#include <deque>
#include <bitset>
#include <algorithm>
#include <complex>
#include <array>
using namespace std;
#define REP(i,n) for(int i=0; i<n; ++i)
#define FOR(i,a,b) for(int i=a; i<=b; ++i)
#define FORR(i,a,b) for (int i=a; i>=b; --i)
#define ALL(c) (c).begin(), (c).end()
typedef long long ll;
typedef vector<int> VI;
typedef vector<ll> VL;
typedef vector<double> VD;
typedef vector<VI> VVI;
typedef vector<VL> VVL;
typedef vector<VD> VVD;
typedef pair<int,int> P;
typedef pair<ll,ll> PL;
using Graph=vector<vector<int>>;
template<class t,class u> void chmax(t&a,u b){if(a<b)a=b;}
template<class t,class u> void chmin(t&a,u b){if(b<a)a=b;}
int main()
{
i N,K;
cin>>N>>K;
int Y,X;
cin>>X>>Y;
if(N>K)
{
cout<<X*K+Y*(N-K);
}
else
{
cout<<K*N;
}
}
|
a.cc: In function 'int main()':
a.cc:40:3: error: 'i' was not declared in this scope
40 | i N,K;
| ^
a.cc:41:8: error: 'N' was not declared in this scope
41 | cin>>N>>K;
| ^
a.cc:41:11: error: 'K' was not declared in this scope
41 | cin>>N>>K;
| ^
|
s578937799
|
p04011
|
C++
|
#include<iostream>
using namespace std;
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:4:1: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type]
4 | main(){
| ^~~~
a.cc: In function 'int main()':
a.cc:7:11: error: expected primary-expression before '>' token
7 | if(n => k) {cout << (k * x) + ((n - k) * y);}else{
| ^
|
s708860468
|
p04011
|
C++
|
#include<iostream>
using namespace std;
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:4:1: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type]
4 | main(){
| ^~~~
a.cc: In function 'int main()':
a.cc:7:11: error: expected primary-expression before '>' token
7 | if(n => k)
| ^
|
s212045599
|
p04011
|
C
|
#include <iostream>
#include <algorithm>
#include <cstring>
#include <cstdio>
#include <vector>
#include <cstdlib>
#include <iomanip>
#include <cmath>
#include <ctime>
#include <map>
#include <set>
#include <queue>
#include <stack>
using namespace std;
#define lowbit(x) (x&(-x))
#define max(x,y) (x>y?x:y)
#define min(x,y) (x<y?x:y)
#define MAX 100000000000000000
#define MOD 1000000007
#define pi acos(-1.0)
#define ei exp(1)
#define PI 3.141592653589793238462
#define INF 0x3f3f3f3f3f
#define mem(a) (memset(a,0,sizeof(a)))
typedef long long ll;
ll gcd(ll a,ll b){
return b?gcd(b,a%b):a;
}
bool cmp(int x,int y)
{
return x>y;
}
const int N=10005;
const int mod=1e9+7;
int main()
{
std::ios::sync_with_stdio(false);
int n,k,x,y;
cin>>n>>k>>x>>y;
ll s=0;
if(n<=k) s+=n*x;
else s+=k*x+(n-k)*y;
cout<<s<<endl;
return 0;
}
|
main.c:1:11: fatal error: iostream: No such file or directory
1 | #include <iostream>
| ^~~~~~~~~~
compilation terminated.
|
s138565718
|
p04011
|
C
|
#include<stdio.h>
int main()
{
int X, Y, N, K, sum=0;
scanf("%d%d%d%d", &N&K&X&Y);
if (N < (K + 1))
{
sum = N * X;
printf("%d", sum);
}
else
{
sum = X * K + (N - K) * Y;
printf("%d", sum);
}
return 0;
}
|
main.c: In function 'main':
main.c:5:29: error: invalid operands to binary & (have 'int *' and 'int')
5 | scanf("%d%d%d%d", &N&K&X&Y);
| ~~^
| |
| int *
|
s014269103
|
p04011
|
Java
|
import java.util.Scanner;
public class Main {
public static void main(String[] args) {
int[] num = new int[4];
int money = 0;
for (int i = 0; i < 4; i++) {
num[i] = new java.util.Scanner(System.in).nextInt();
}
if(num[0]>num[1])
{
money = num[1]*num[2]+ num[3]*(num[0]-num[1]);
}
if(num[0]<=num[1])
{
money = num[0]*num[2];
}
}
|
Main.java:18: error: reached end of file while parsing
}
^
1 error
|
s032414888
|
p04011
|
Java
|
import java.util.Scanner;
public class Main {
public static void main(String[] args) {
int[] num = new int[4];
int money = 0;
for (int i = 0; i < 4; i++) {
num[i] = new java.util.Scanner(System.in).nextInt();
}
if(num[0]>num[1])
{
money = num[1]*num[2]+ num[3]*(num[0]-num[1]);
}
if(num[0]<=num[1])
{
money = num[0]*num[2];
}
|
Main.java:17: error: reached end of file while parsing
}
^
1 error
|
s027693831
|
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;
}
|
a.cc: In function 'int main()':
a.cc:6:6: error: expected ';' before 'n'
6 | cin n >> k >> x >> y;
| ^~
| ;
|
s902393904
|
p04011
|
C++
|
//#define _GLIBCXX_DEBUG
#include "bits/stdc++.h"
using namespace std;
//------------------------------- Libraries --------------------------------//
//------------------------------- Type Names -------------------------------//
using i64 = int_fast64_t;
using seika = string;
//akari : 1D, yukari : 2D, maki : 3D vector
template <class kizuna>
using akari = vector<kizuna>;
template <class yuzuki>
using yukari = akari<akari<yuzuki>>;
template <class tsurumaki>
using maki = akari<yukari<tsurumaki>>;
//akane : ascending order, aoi : decending order
template <class kotonoha>
using akane = priority_queue<kotonoha, akari<kotonoha>, greater<kotonoha>>;
template <class kotonoha>
using aoi = priority_queue<kotonoha>;
//------------------------------- Dubug Functions ---------------------------//
inline void print()
{
cout << endl;
}
template <typename First, typename... Rest>
void print(const First &first, const Rest &... rest)
{
cout << first << ' ';
print(rest...);
}
//------------------------------- Solver ------------------------------------//
void solve()
{
i64 n, k, x, y;
cin >> n >> k >> x >> y;
cout << min(n, k) * x + max(0, n - k) * y << endl;
}
int main()
{
solve();
return 0;
}
|
a.cc: In function 'void solve()':
a.cc:43:32: error: no matching function for call to 'max(int, i64)'
43 | cout << min(n, k) * x + max(0, n - k) * y << endl;
| ~~~^~~~~~~~~~
In file included from /usr/include/c++/14/algorithm:60,
from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:51,
from a.cc:2:
/usr/include/c++/14/bits/stl_algobase.h:257:5: note: candidate: 'template<class _Tp> constexpr const _Tp& std::max(const _Tp&, const _Tp&)'
257 | max(const _Tp& __a, const _Tp& __b)
| ^~~
/usr/include/c++/14/bits/stl_algobase.h:257:5: note: template argument deduction/substitution failed:
a.cc:43:32: note: deduced conflicting types for parameter 'const _Tp' ('int' and 'i64' {aka 'long int'})
43 | cout << min(n, k) * x + max(0, n - k) * y << endl;
| ~~~^~~~~~~~~~
/usr/include/c++/14/bits/stl_algobase.h:303:5: note: candidate: 'template<class _Tp, class _Compare> constexpr const _Tp& std::max(const _Tp&, const _Tp&, _Compare)'
303 | max(const _Tp& __a, const _Tp& __b, _Compare __comp)
| ^~~
/usr/include/c++/14/bits/stl_algobase.h:303:5: note: candidate expects 3 arguments, 2 provided
In file included from /usr/include/c++/14/algorithm:61:
/usr/include/c++/14/bits/stl_algo.h:5706:5: note: candidate: 'template<class _Tp> constexpr _Tp std::max(initializer_list<_Tp>)'
5706 | max(initializer_list<_Tp> __l)
| ^~~
/usr/include/c++/14/bits/stl_algo.h:5706:5: note: candidate expects 1 argument, 2 provided
/usr/include/c++/14/bits/stl_algo.h:5716:5: note: candidate: 'template<class _Tp, class _Compare> constexpr _Tp std::max(initializer_list<_Tp>, _Compare)'
5716 | max(initializer_list<_Tp> __l, _Compare __comp)
| ^~~
/usr/include/c++/14/bits/stl_algo.h:5716:5: note: template argument deduction/substitution failed:
a.cc:43:32: note: mismatched types 'std::initializer_list<_Tp>' and 'int'
43 | cout << min(n, k) * x + max(0, n - k) * y << endl;
| ~~~^~~~~~~~~~
|
s881797926
|
p04011
|
C++
|
int main()
{
int a,b,c,d,e,n,k;
scanf("%d %d %d %d",&n,&k,&d,&e);
if(n>k)
{
a=(n-k)*e;
b=k*d;
c=a+b;
printf("%d",c);}
else
{
printf("%d",n*d);
}
return 0;
}
|
a.cc: In function 'int main()':
a.cc:4:9: error: 'scanf' was not declared in this scope
4 | scanf("%d %d %d %d",&n,&k,&d,&e);
| ^~~~~
a.cc:11:9: error: 'printf' was not declared in this scope
11 | printf("%d",c);}
| ^~~~~~
a.cc:1:1: note: 'printf' is defined in header '<cstdio>'; this is probably fixable by adding '#include <cstdio>'
+++ |+#include <cstdio>
1 | int main()
a.cc:14:17: error: 'printf' was not declared in this scope
14 | printf("%d",n*d);
| ^~~~~~
a.cc:14:17: note: 'printf' is defined in header '<cstdio>'; this is probably fixable by adding '#include <cstdio>'
|
s350432149
|
p04011
|
C++
|
#include<stdio.h>
int main()
{
int a,b,c,d,e,n,k;
scanf("%d %d %d %d",&n,&k,&d,&e);
if(n>k)
{
a=(n-k)*e;
b=k*d;
c=a+b;
printf("%d",c);}
else
{
printf("%d",n*d);
}
return 0;
|
a.cc: In function 'int main()':
a.cc:18:18: error: expected '}' at end of input
18 | return 0;
| ^
a.cc:3:1: note: to match this '{'
3 | {
| ^
|
s513789183
|
p04011
|
C++
|
#include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
int main(){
int n, k, x, y;
cin >> n >> k >> x >> y;
int ans = 0;
rep(i, n){
if(i<k){ans += x;}
else{ans += y}
}
cout << ans << endl;
return 0;
}
|
a.cc: In function 'int main()':
a.cc:11:18: error: expected ';' before '}' token
11 | else{ans += y}
| ^
| ;
|
s779468988
|
p04011
|
C++
|
#include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
int main(){
int n, k, x, y;
cin >> n >> k >> x >> y;
int ans = 0;
rep(i, n){
if(i<k){ans += x;}
else{ans += y}
}
return 0;
}
|
a.cc: In function 'int main()':
a.cc:11:18: error: expected ';' before '}' token
11 | else{ans += y}
| ^
| ;
|
s546795433
|
p04011
|
C++
|
#include<bits/stdc++.h>
using namespace std;
#define ll long long // long long省略
#define pb push_back // push_back省略
#define mp make_pair // make_pair省略
#define fi first // first省略
#define se second // second省略
#define itn int // int誤字保険
#define count cout // cout誤字保険
#define vecotr vector // vector誤字保険
#define ednl endl // endl誤字保険
#define opt() cin.tie(0); ios::sync_with_stdio(false) // 入出力速度改善
#define rep(i,l,r) for(ll i=(l);i<(r);i++) // 範囲[l, r)で刻み1のfor文(順方向)
#define repp(i,l,r,k) for(ll i=(l);i<(r);i+=(k)) // 範囲[l, r)で刻みkのfor文(順方向)
#define rrep(i,l,r) for(ll i=(r-1);i>=(l);i--) // 範囲[l, r)で刻み1のfor文(逆方向)
#define rrepp(i,l,r,k) for(ll i=(r-1);i>=(l);i-=(k)) // 範囲[l, r)で刻みkのfor文(逆方向)
#define all(x) (x).begin(), (x).end() // vectorのポインタ位置指定用
#define max(p,q)((p)>(q)?(p):(q)) // max拡張
#define min(p,q)((p)<(q)?(p):(q)) // min拡張
#define bit(n,m)(((n)>>(m))&1) // 変数nのm番目のbitを取り出す
template<class T>bool chmax(T &a, const T &b) { if (a<b) { a=b; return 1; } return 0; }
template<class T>bool chmin(T &a, const T &b) { if (b<a) { a=b; return 1; } return 0; }
int dy[]={0, 1, 0, -1}; // 4方向近傍
int dx[]={1, 0, -1, 0}; // 4方向近傍
int main(){
ll n,k,x,y:cin>>n>>k>>x>>y;
cout<<min(n,k)*x+max(n-k,0)*y<<ednl;
}
|
a.cc: In function 'int main()':
a.cc:30:15: error: found ':' in nested-name-specifier, expected '::'
30 | ll n,k,x,y:cin>>n>>k>>x>>y;
| ^
| ::
a.cc:30:14: error: 'y' has not been declared
30 | ll n,k,x,y:cin>>n>>k>>x>>y;
| ^
a.cc:30:19: error: qualified-id in declaration before '>>' token
30 | ll n,k,x,y:cin>>n>>k>>x>>y;
| ^~
a.cc:31:33: error: 'y' was not declared in this scope
31 | cout<<min(n,k)*x+max(n-k,0)*y<<ednl;
| ^
|
s451057238
|
p04011
|
C++
|
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef long double ld;
#define rep(i, n) for (ll i = 0; i < n; i++)
#define FOR(i, a, b) for (ll i = a; i < b; i++)
#define len(v) ll(v.size())
#define fi first
#define se second
template <class T>
void cout_vec(const vector<T> &vec){
for(auto itr:vec) cout<<itr<<' ';
cout<<endl;
}
template <class T>
void cout_vec2(const vector<vector<T>> &vec){
rep(i,vec.size()){
rep(j,vec[i].size()){
cout<<vec[i][j]<<' ';
}
cout<<endl;
}
}
typedef pair<ll,ll> P;
const ll mod=1e9+7;
const ll inf=1e15;
int main(){
cin.tie(0);
ios::sync_with_stdio(false);
int n,k,x,y;
cin>>n>>k>>x>>y;
int now=0;
rep(i,n){
if(i<k) now+=x;
else now+=y
}
cout<<now<<endl;
}
|
a.cc: In function 'int main()':
a.cc:39:15: error: expected ';' before '}' token
39 | else now+=y
| ^
| ;
40 | }
| ~
|
s127100232
|
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 + (n-k)*y << endl;
}else{
cout << x*k << endl;
}
|
a.cc: In function 'int main()':
a.cc:11:2: error: expected '}' at end of input
11 | }
| ^
a.cc:4:12: note: to match this '{'
4 | int main() {
| ^
|
s773463234
|
p04011
|
C++
|
#include<bits/stdc++>
using namespace std;
int main(){int n,k,x,y;cin>>n>>k>>x>>y;if(n<k)cout<<n*x;else cout<<n*x+(n-k)*y;return 0;}
|
a.cc:1:9: fatal error: bits/stdc++: No such file or directory
1 | #include<bits/stdc++>
| ^~~~~~~~~~~~~
compilation terminated.
|
s838787442
|
p04011
|
C++
|
//#define _GLIBCXX_DEBUG
#include <bits/stdc++.h>
#include <numeric>
typedef long long Int;
#define rep(i,a,b) for(Int i=a;i<b;++i)
#define rrep(i,a,b) for(Int i=a;i>=b;--i)
using namespace std;
int main() {
cin.tie(0); cout.tie(0);
ios::sync_with_stdio(false);
int N, K, X, Y; cin >> N >> K >> X >> Y;
cout << min(N, K)*X + max(N-K, 0)*Y << endl;
|
a.cc: In function 'int main()':
a.cc:14:49: error: expected '}' at end of input
14 | cout << min(N, K)*X + max(N-K, 0)*Y << endl;
| ^
a.cc:9:12: note: to match this '{'
9 | int main() {
| ^
|
s283092824
|
p04011
|
C++
|
#include <cstdio>
#include <algorithm>
#define INF 0x3f3f3f3f3f3fLL
typedef long long ll;
ll n, s;
ll f(ll b, ll n) { return n < b ? n : f(b, n / b) + n % b ; }
int main() {
scanf("%lld%lld", &n, &s) ;
if(s > n) return puts("-1"), 0;
if(s == n) return printf("%lld\n", n + 1), 0;
ll bl = sqrt(n) + 1;
for (ll i = 2; i <= bl; ++i) if (f(i, n) == s) return printf("%lld\n", i), 0;
ll ans = INF;
n -= s;
for (ll i = 1; i * i <= n; ++i) if(n % i == 0) {
ll b = n / i + 1;
if (f(b, n + s) == s) ans = std :: min(ans, b);
}
printf("%lld\n", ans != INF ? ans : -1);
return 0 ;
}
|
a.cc: In function 'int main()':
a.cc:15:13: error: 'sqrt' was not declared in this scope
15 | ll bl = sqrt(n) + 1;
| ^~~~
|
s951514038
|
p04011
|
Java
|
import java.util.*;
public class MMain{
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());
sc.close();
if(n>=k)
System.out.println(k*x+(n-k)*y);
else
System.out.println(n*x);
}
}
|
Main.java:3: error: class MMain is public, should be declared in a file named MMain.java
public class MMain{
^
1 error
|
s451831285
|
p04011
|
C
|
#include <stdio.h>
int main(void){
int i, N, K, X, Y, sum = 0;
for(i = 1; i <= N; i++){
if(i <= K){
sum = sum + X;
}else(K < i){
sum = sum + Y;
}
}
printf("%d", sum);
return 0;
}
|
main.c: In function 'main':
main.c:9:17: error: expected ';' before '{' token
9 | }else(K < i){
| ^
| ;
|
s965308258
|
p04011
|
C
|
#include <stdio.h>
int main(void){
int N,K,X,Y,K;
scanf("%d¥n",&N);
scanf("%d¥n",&K);
scanf("%d¥n",&X);
scanf("%d¥n",&Y);
K = K*X + (N-K)*Y;
printf("%d",K);
return 0;
}
|
main.c: In function 'main':
main.c:4:15: error: redeclaration of 'K' with no linkage
4 | int N,K,X,Y,K;
| ^
main.c:4:9: note: previous declaration of 'K' with type 'int'
4 | int N,K,X,Y,K;
| ^
|
s425924781
|
p04011
|
C++
|
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();
int count = 0;
System.out.println(x*k + (n - k)*y);
}
}
|
a.cc:1:1: error: 'import' does not name a type
1 | import java.util.*;
| ^~~~~~
a.cc:1:1: note: C++20 'import' only available with '-fmodules-ts'
a.cc:4:11: error: expected ':' before 'static'
4 | public static void main(String args[]){
| ^~~~~~~
| :
a.cc:4:29: error: 'String' has not been declared
4 | public static void main(String args[]){
| ^~~~~~
a.cc:18:2: error: expected ';' after class definition
18 | }
| ^
| ;
a.cc: In static member function 'static void Main::main(int*)':
a.cc:5:7: error: 'Scanner' was not declared in this scope
5 | Scanner sc = new Scanner(System.in);
| ^~~~~~~
a.cc:7:15: error: 'sc' was not declared in this scope
7 | int n = sc.nextInt();
| ^~
a.cc:14:7: error: 'System' was not declared in this scope
14 | System.out.println(x*k + (n - k)*y);
| ^~~~~~
|
s188209896
|
p04011
|
C++
|
#include <stdio.h>
int printf(int n, int k, int x, int y); {
int sum = 0;
if (n <= k) {
sum = x * n;
}
else {
sum = x * k + y * (n - k);
}
return sum;
}
int main()
{
// Input the basic information of the fare counting.
int n, k, x, y;
n = k = x = y = -1;
while ((n < 1 || n>10000) || (k < 1 || k>10000) ||(x < 1 || x>10000) || (y < 1 || y>10000)||y>=x) {
scanf (“%d%d%d%d”,&n,&k,&x,&y);
}
printf(“%d”,printf(n, k, x, y));
return 0;
}
|
a.cc:18:10: error: extended character “ is not valid in an identifier
18 | scanf (“%d%d%d%d”,&n,&k,&x,&y);
| ^
a.cc:18:18: error: extended character ” is not valid in an identifier
18 | scanf (“%d%d%d%d”,&n,&k,&x,&y);
| ^
a.cc:20:9: error: extended character “ is not valid in an identifier
20 | printf(“%d”,printf(n, k, x, y));
| ^
a.cc:20:11: error: extended character ” is not valid in an identifier
20 | printf(“%d”,printf(n, k, x, y));
| ^
a.cc:2:17: error: expected initializer before 'n'
2 | int printf(int n, int k, int x, int y); {
| ^
a.cc:2:43: error: expected unqualified-id before '{' token
2 | int printf(int n, int k, int x, int y); {
| ^
a.cc:15:2: error: expected primary-expression before 'int'
15 | int n, k, x, y;
| ^~~
a.cc:15:2: error: expected '}' before 'int'
a.cc:13:1: note: to match this '{'
13 | {
| ^
a.cc:16:2: error: 'n' does not name a type
16 | n = k = x = y = -1;
| ^
a.cc:17:2: error: expected unqualified-id before 'while'
17 | while ((n < 1 || n>10000) || (k < 1 || k>10000) ||(x < 1 || x>10000) || (y < 1 || y>10000)||y>=x) {
| ^~~~~
a.cc:20:8: error: expected constructor, destructor, or type conversion before '(' token
20 | printf(“%d”,printf(n, k, x, y));
| ^
a.cc:21:2: error: expected unqualified-id before 'return'
21 | return 0;
| ^~~~~~
a.cc:22:1: error: expected declaration before '}' token
22 | }
| ^
|
s183889650
|
p04011
|
C++
|
#include <stdio.h>
int printf(int n, int k, int x, int y) {
int sum = 0;
if (n <= k) {
sum = x * n;
}
else {
sum = x * k + y * (n - k);
}
return sum;
}
int main()
{
// Input the basic information of the fare counting.
int n, k, x, y;
n = k = x = y = -1;
while ((n < 1 || n>10000) || (k < 1 || k>10000) ||(x < 1 || x>10000) || (y < 1 || y>10000)||y>=x) {
scanf (“%d%d%d%d”,&n,&k,&x,&y);
}
printf(“%d”,printf(n, k, x, y));
return 0;
}
|
a.cc:18:9: error: extended character “ is not valid in an identifier
18 | scanf (“%d%d%d%d”,&n,&k,&x,&y);
| ^
a.cc:18:19: error: extended character ” is not valid in an identifier
18 | scanf (“%d%d%d%d”,&n,&k,&x,&y);
| ^
a.cc:20:2: error: extended character “ is not valid in an identifier
20 | printf(“%d”,printf(n, k, x, y));
| ^
a.cc:20:12: error: extended character ” is not valid in an identifier
20 | printf(“%d”,printf(n, k, x, y));
| ^
a.cc:2:17: error: expected initializer before 'n'
2 | int printf(int n, int k, int x, int y) {
| ^
a.cc:15:2: error: expected primary-expression before 'int'
15 | int n, k, x, y;
| ^~~
a.cc:15:2: error: expected '}' before 'int'
a.cc:13:1: note: to match this '{'
13 | {
| ^
a.cc:16:2: error: 'n' does not name a type
16 | n = k = x = y = -1;
| ^
a.cc:17:2: error: expected unqualified-id before 'while'
17 | while ((n < 1 || n>10000) || (k < 1 || k>10000) ||(x < 1 || x>10000) || (y < 1 || y>10000)||y>=x) {
| ^~~~~
a.cc:20:2: error: 'printf\U0000ff08\U0000201c' does not name a type
20 | printf(“%d”,printf(n, k, x, y));
| ^~~~~~~~~
a.cc:21:2: error: expected unqualified-id before 'return'
21 | return 0;
| ^~~~~~
a.cc:22:1: error: expected declaration before '}' token
22 | }
| ^
|
s795381015
|
p04011
|
C++
|
#include <stdio.h>
int printf(int n, int k, int x, int y) {
int sum = 0;
if (n <= k) {
sum = x * n;
}
else {
sum = x * k + y * (n - k);
}
return sum;
}
int main()
{
// Input the basic information of the fare counting.
int n, k, x, y;
n = k = x = y = -1;
while ((n < 1 || n>10000) || (k < 1 || k>10000) || (x < 1 || x>10000) || (y < 1 || y>10000)||y>=x) {
scanf ("%d%d%d%d",&n,&k,&x,&y);
}
printf(“%d”,count(n, k, x, y);
return 0;
}
|
a.cc:20:9: error: extended character “ is not valid in an identifier
20 | printf(“%d”,count(n, k, x, y);
| ^
a.cc:20:11: error: extended character ” is not valid in an identifier
20 | printf(“%d”,count(n, k, x, y);
| ^
a.cc: In function 'int main()':
a.cc:18:8: error: expected ';' before '\U0000ff08'
18 | scanf ("%d%d%d%d",&n,&k,&x,&y);
| ^~~
| ;
a.cc:20:9: error: '\U0000201c' was not declared in this scope
20 | printf(“%d”,count(n, k, x, y);
| ^
a.cc:20:11: error: 'd\U0000201d' was not declared in this scope
20 | printf(“%d”,count(n, k, x, y);
| ^~
a.cc:20:14: error: 'count' was not declared in this scope
20 | printf(“%d”,count(n, k, x, y);
| ^~~~~
|
s499455799
|
p04011
|
C++
|
#include <stdio.h>
int printf(int n, int k, int x, int y) {
int sum = 0;
if (n <= k) {
sum = x * n;
}
else {
sum = x * k + y * (n - k);
}
return sum;
}
int main()
{
// Input the basic information of the fare counting.
int n, k, x, y;
n = k = x = y = -1;
while ((n < 1 || n>10000) || (k < 1 || k>10000) || (x < 1 || x>10000) || (y < 1 || y>10000)||y>=x) {
scanf >> n >> k >> x >> y;
}
printf << count(n, k, x, y);
return 0;
}
|
a.cc: In function 'int main()':
a.cc:18:9: error: invalid operands of types 'int(const char*, ...)' and 'int' to binary 'operator>>'
18 | scanf >> n >> k >> x >> y;
| ~~~~~ ^~ ~
| | |
| | int
| int(const char*, ...)
a.cc:20:12: error: 'count' was not declared in this scope
20 | printf << count(n, k, x, y);
| ^~~~~
|
s547455568
|
p04011
|
C++
|
#include <stdio.h>
using namespace std;
int count(int n, int k, int x, int y) {
int sum = 0;
if (n <= k) {
sum = x * n;
}
else {
sum = x * k + y * (n - k);
}
return sum;
}
int main()
{
// Input the basic information of the fare counting.
int n, k, x, y;
n = k = x = y = -1;
while ((n < 1 || n>10000) || (k < 1 || k>10000) || (x < 1 || x>10000) || (y < 1 || y>10000)||y>=x) {
cin >> n >> k >> x >> y;
}
cout << count(n, k, x, y);
return 0;
}
|
a.cc: In function 'int main()':
a.cc:19:3: error: 'cin' was not declared in this scope
19 | cin >> n >> k >> x >> y;
| ^~~
a.cc:2:1: note: 'std::cin' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
1 | #include <stdio.h>
+++ |+#include <iostream>
2 | using namespace std;
a.cc:21:2: error: 'cout' was not declared in this scope
21 | cout << count(n, k, x, y);
| ^~~~
a.cc:21:2: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
|
s282791155
|
p04011
|
C++
|
#include<stdio.h>
int main()
{
int a,b,c,d,e,f;
scanf("%d",&a);
scanf("%d",&b);
scanf("%d",&c);
scanf("%d",&d);
if(a<=b){
e=a*c;
printf("%d\n",e);
}
else{
f=b*c+(a-b)*d;
printf("%d\n",f);
}
return 0
}
|
a.cc: In function 'int main()':
a.cc:6:23: error: expected ';' before '\U0000ff1b'
6 | scanf("%d",&b);
| ^~
| ;
a.cc:17:17: error: expected ';' before '}' token
17 | return 0
| ^
| ;
18 |
19 | }
| ~
|
s393378197
|
p04011
|
C++
|
#include<stdio.h>
int main()
{
int a,b,c,d,e,f;
scanf("%d",&a);
printf("\n");
scanf("%d",&b);
printf("\n");
scanf("%d",&c);
printf("\n");
scanf("%d",&d);
printf("\n");
if(a<=b){
e=a*c;
printf("%d\n",e);
}
else{
f=b*c+(a-b)*d;
printf("%d\n",f);
}
return 0;
}
|
a.cc: In function 'int main()':
a.cc:7:23: error: expected ';' before '\U0000ff1b'
7 | scanf("%d",&b);
| ^~
| ;
|
s148822078
|
p04011
|
C++
|
#include<stdio.h>
int main()
{
int a,b,c,d,e,f;
scanf("%d",&a);
printf("\n");
scanf("%d",&b);
print("\n");
scanf("%d",&c);
print("\n");
scanf("%d",&d);
print("\n");
if(a<=b){
e=a*c;
printf("%d\n",e);
}
else{
f=b*c+(a-b)*d;
printf("%d\n",f);
}
return 0;
}
|
a.cc: In function 'int main()':
a.cc:7:23: error: expected ';' before '\U0000ff1b'
7 | scanf("%d",&b);
| ^~
| ;
a.cc:10:9: error: 'print' was not declared in this scope; did you mean 'printf'?
10 | print("\n");
| ^~~~~
| printf
|
s158536450
|
p04011
|
C++
|
#include <bits/stdc++.h>
using namespace std;
int main() {
int n=2,k=3,x=10000,y=9000;
int sum=0;
sum=k*x+(n-k)y;
cout << sum << endl;
}
|
a.cc: In function 'int main()':
a.cc:7:16: error: expected ';' before 'y'
7 | sum=k*x+(n-k)y;
| ^
| ;
|
s148159811
|
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*N);}
else{printf("%d\n",X*K+N*Y-K*Y);}
return 0;
}
|
main.c: In function 'main':
main.c:5:31: error: 'k' undeclared (first use in this function)
5 | scanf("%d%d%d%d",&N, &k, &X, &Y);
| ^
main.c:5:31: note: each undeclared identifier is reported only once for each function it appears in
|
s195957747
|
p04011
|
C
|
#include<stdio.h>
int main()
{
int N,K,X,Y,sum;
scanf("%d%d%d%d",&N,&K,&X,&Y);
if(N > K)
{
sum = X * N + (N - K) * Y;
}
else
{
sum = X * k;
}
printf("%d\n",sum);
return 0;
}
|
main.c: In function 'main':
main.c:15:22: error: 'k' undeclared (first use in this function)
15 | sum = X * k;
| ^
main.c:15:22: note: each undeclared identifier is reported only once for each function it appears in
|
s945373932
|
p04011
|
C++
|
#include<stdio.h>
int main()
{
int N,X,Y,K;
scanf("%d",&N);
if(N<=K)
{
printf("X*N");
}
else (N>K)
{
printf("K*X+(N-K)*Y");
}
return 0;
}
|
a.cc: In function 'int main()':
a.cc:10:19: error: expected ';' before '{' token
10 | else (N>K)
| ^
| ;
11 | {
| ~
|
s731959380
|
p04011
|
C++
|
#include<stdio.h>
int main()
{
int N,X,Y,K;
scanf("%d",&N);
if(N<=K)
{
printf("X*N");
}
else (N>K)
{
printf("K*X+(N-K)*Y");
return 0;}
}
|
a.cc: In function 'int main()':
a.cc:10:19: error: expected ';' before '{' token
10 | else (N>K)
| ^
| ;
11 | {
| ~
|
s438663642
|
p04011
|
C++
|
#include<stdio.h>
int main()
{
int N,X,Y,K;
scanf("%d",&N);
if(N<=K)
{
printf("X*N");
}
else (N>K)
{
printf("K*X+(N-K)*Y");
return 0;
}
|
a.cc: In function 'int main()':
a.cc:10:19: error: expected ';' before '{' token
10 | else (N>K)
| ^
| ;
11 | {
| ~
a.cc:15:2: error: expected '}' at end of input
15 | }
| ^
a.cc:3:1: note: to match this '{'
3 | {
| ^
|
s170242530
|
p04011
|
C++
|
#include<stdio.h>
int main()
{
int N,X,Y,K;
scanf("%d",&N);
if(N<=K)
{
printf("X*N");
}
else (N>K)
{
printf("K*X+(N-K)*Y);
return 0;
}
|
a.cc:12:24: warning: missing terminating " character
12 | printf("K*X+(N-K)*Y);
| ^
a.cc:12:24: error: missing terminating " character
12 | printf("K*X+(N-K)*Y);
| ^~~~~~~~~~~~~~
a.cc: In function 'int main()':
a.cc:10:19: error: expected ';' before '{' token
10 | else (N>K)
| ^
| ;
11 | {
| ~
a.cc:15:2: error: expected '}' at end of input
15 | }
| ^
a.cc:3:1: note: to match this '{'
3 | {
| ^
|
s837143947
|
p04011
|
C++
|
#include<stdio.h>
int main()
{
int N,X,Y,K;
scanf("%d",&N);
if(N<=K)
{
printf("X*N");
}
else (N>K)
{
printf("K*X+(N-K)*Y)
return 0;
}
|
a.cc:12:24: warning: missing terminating " character
12 | printf("K*X+(N-K)*Y)
| ^
a.cc:12:24: error: missing terminating " character
12 | printf("K*X+(N-K)*Y)
| ^~~~~~~~~~~~~
a.cc: In function 'int main()':
a.cc:10:19: error: expected ';' before '{' token
10 | else (N>K)
| ^
| ;
11 | {
| ~
a.cc:15:2: error: expected '}' at end of input
15 | }
| ^
a.cc:3:1: note: to match this '{'
3 | {
| ^
|
s566703301
|
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*k);
else printf("%d\n",x*k+y*(n-k));
return 0;
}
|
a.cc: In function 'int main()':
a.cc:4:13: error: expected unqualified-id before ';' token
4 | int n,k,x,y,;
| ^
|
s478579310
|
p04011
|
C++
|
#include<iostream>
using namespace std;
int main(void){
int a,b,c,d;
cin >> a >> b >> c >> d;
if(a <= b){
cout << a * c << endl;
} else {
cout << b * c + (a - b) * d <<endl;
return 0;
}
|
a.cc: In function 'int main()':
a.cc:11:2: error: expected '}' at end of input
11 | }
| ^
a.cc:3:15: note: to match this '{'
3 | int main(void){
| ^
|
s831048016
|
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("N*X\n");
}
else{
printf("K*X+(N-K)*Y\n");
{
return 0;
}
|
a.cc: In function 'int main()':
a.cc:13:2: error: expected '}' at end of input
13 | }
| ^
a.cc:9:9: note: to match this '{'
9 | else{
| ^
a.cc:13:2: error: expected '}' at end of input
13 | }
| ^
a.cc:3:11: note: to match this '{'
3 | int main(){
| ^
|
s846591744
|
p04011
|
C++
|
#include <bits/stdc++.h>
using namespace std;
int main() {
int n, k, x, y;
cin >> n >> k >> x >> y;
int price=0;
(int i=0; i<n; i++){
if(i<k){
price += x;
}else{
price += y;
}
}
cout << price << endl;
return 0;
}
|
a.cc: In function 'int main()':
a.cc:9:4: error: expected primary-expression before 'int'
9 | (int i=0; i<n; i++){
| ^~~
a.cc:9:4: error: expected ')' before 'int'
9 | (int i=0; i<n; i++){
| ~^~~
| )
a.cc:9:13: error: 'i' was not declared in this scope
9 | (int i=0; i<n; i++){
| ^
|
s931831732
|
p04011
|
C++
|
#include <iostream>
int main()
{
int n, k, x, y;
cin >> n >> k >> x >> y;
if (n <= k) cout << x * k;
else cout << x*k + y*(n - k);
return 0;
}
|
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 a.cc:1:
/usr/include/c++/14/iostream:62:18: note: 'std::cin' declared here
62 | extern istream cin; ///< Linked to standard input
| ^~~
a.cc:7:21: error: 'cout' was not declared in this scope; did you mean 'std::cout'?
7 | if (n <= k) cout << x * k;
| ^~~~
| std::cout
/usr/include/c++/14/iostream:63:18: note: 'std::cout' declared here
63 | extern ostream cout; ///< Linked to standard output
| ^~~~
a.cc:8:14: error: 'cout' was not declared in this scope; did you mean 'std::cout'?
8 | else cout << x*k + y*(n - k);
| ^~~~
| std::cout
/usr/include/c++/14/iostream:63:18: note: 'std::cout' declared here
63 | extern ostream cout; ///< Linked to standard output
| ^~~~
|
s903452205
|
p04011
|
C++
|
#include <bits/stdc++.h>
using namespace std;
const int mod = 1000000007;
#define ll long long
#define rep(i,n) for(int i=0 ; (n) >i; i++)
int main()
{
int n,k,x,y cin >> n >> k >> x >> y;
ll ans = 0;
rep(i,n){
if(i>=k) ans += y;
else ans += x;
}
cout << ans << endl;
return 0;
}
|
a.cc: In function 'int main()':
a.cc:9:16: error: expected initializer before 'cin'
9 | int n,k,x,y cin >> n >> k >> x >> y;
| ^~~
a.cc:13:25: error: 'y' was not declared in this scope
13 | if(i>=k) ans += y;
| ^
|
s162106438
|
p04011
|
C
|
#include<stdio.h>
int main(){
int n,k,x,y;
scantf("%d\n%d\n%d\n%y",&n,&K,&x,&y);
if(k<n){
printf("%d",k*x+(n-k)*y);
}else{
printf("%d",k*x);
}
return 0;
}
|
main.c: In function 'main':
main.c:4:3: error: implicit declaration of function 'scantf'; did you mean 'scanf'? [-Wimplicit-function-declaration]
4 | scantf("%d\n%d\n%d\n%y",&n,&K,&x,&y);
| ^~~~~~
| scanf
main.c:4:31: error: 'K' undeclared (first use in this function)
4 | scantf("%d\n%d\n%d\n%y",&n,&K,&x,&y);
| ^
main.c:4:31: note: each undeclared identifier is reported only once for each function it appears in
|
s535028556
|
p04011
|
C
|
#include<stdio.h>
int main(){
int n,k,x,y;
scantf("%d\n%d\n%d\n%y",&n,&K,&x,&y);
if(k<n){
printf("%d",k*x+(n-k)*y);
}else{
printf("%d",k*x);
return 0;
}
|
main.c: In function 'main':
main.c:4:3: error: implicit declaration of function 'scantf'; did you mean 'scanf'? [-Wimplicit-function-declaration]
4 | scantf("%d\n%d\n%d\n%y",&n,&K,&x,&y);
| ^~~~~~
| scanf
main.c:4:31: error: 'K' undeclared (first use in this function)
4 | scantf("%d\n%d\n%d\n%y",&n,&K,&x,&y);
| ^
main.c:4:31: note: each undeclared identifier is reported only once for each function it appears in
main.c:10:1: error: expected declaration or statement at end of input
10 | }
| ^
|
s791892723
|
p04011
|
C++
|
#include <iostream>
#include <algorithm>
using namespace std;
int main() {
string w; cin >> w;
sort(w.begin(), w.end());
for (int i = 0; i < w.length; ++i) {
if (w[i] != w[i + 1]) {
cout << "No" << endl;
return 0;
}
}
cout << "Yes" << endl;
}
|
a.cc: In function 'int main()':
a.cc:10:31: error: invalid use of member function 'std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::size_type std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::length() const [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>; size_type = long unsigned int]' (did you forget the '()' ?)
10 | for (int i = 0; i < w.length; ++i) {
| ~~^~~~~~
| ()
|
s670047671
|
p04011
|
C++
|
#include <iostream>
#include <bits/stdc++.h>
#define ll long long
#define rp(i,n) for(int i=0;i< n;i++)
#define rpd(i,n) for(int i=n-1;i >= 0;i--)
using namespace std;
int main() {
ll n,k,x,y;
cin >> n >> k >> x >> y;
cout << x*min(k,n)+y*min(0,n-k);
cout << endl;
return 0;
}
|
a.cc: In function 'int main()':
a.cc:15:33: error: no matching function for call to 'min(int, long long int)'
15 | cout << x*min(k,n)+y*min(0,n-k);
| ~~~^~~~~~~
In file included from /usr/include/c++/14/string:51,
from /usr/include/c++/14/bits/locale_classes.h:40,
from /usr/include/c++/14/bits/ios_base.h:41,
from /usr/include/c++/14/ios:44,
from /usr/include/c++/14/ostream:40,
from /usr/include/c++/14/iostream:41,
from a.cc:1:
/usr/include/c++/14/bits/stl_algobase.h:233:5: note: candidate: 'template<class _Tp> constexpr const _Tp& std::min(const _Tp&, const _Tp&)'
233 | min(const _Tp& __a, const _Tp& __b)
| ^~~
/usr/include/c++/14/bits/stl_algobase.h:233:5: note: template argument deduction/substitution failed:
a.cc:15:33: note: deduced conflicting types for parameter 'const _Tp' ('int' and 'long long int')
15 | cout << x*min(k,n)+y*min(0,n-k);
| ~~~^~~~~~~
/usr/include/c++/14/bits/stl_algobase.h:281:5: note: candidate: 'template<class _Tp, class _Compare> constexpr const _Tp& std::min(const _Tp&, const _Tp&, _Compare)'
281 | min(const _Tp& __a, const _Tp& __b, _Compare __comp)
| ^~~
/usr/include/c++/14/bits/stl_algobase.h:281:5: note: candidate expects 3 arguments, 2 provided
In file included from /usr/include/c++/14/algorithm:61,
from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:51,
from a.cc:2:
/usr/include/c++/14/bits/stl_algo.h:5686:5: note: candidate: 'template<class _Tp> constexpr _Tp std::min(initializer_list<_Tp>)'
5686 | min(initializer_list<_Tp> __l)
| ^~~
/usr/include/c++/14/bits/stl_algo.h:5686:5: note: candidate expects 1 argument, 2 provided
/usr/include/c++/14/bits/stl_algo.h:5696:5: note: candidate: 'template<class _Tp, class _Compare> constexpr _Tp std::min(initializer_list<_Tp>, _Compare)'
5696 | min(initializer_list<_Tp> __l, _Compare __comp)
| ^~~
/usr/include/c++/14/bits/stl_algo.h:5696:5: note: template argument deduction/substitution failed:
a.cc:15:33: note: mismatched types 'std::initializer_list<_Tp>' and 'int'
15 | cout << x*min(k,n)+y*min(0,n-k);
| ~~~^~~~~~~
|
s709914081
|
p04011
|
C++
|
#include <bits/stdc++.h>
using namespace std;
int main {
int n,k,x,y;
cin >> n >> k >> x >> y ;
(n - k) >= 0 ? cout << (n-k)*y + k*x : cout << k*x ;
}
|
a.cc:4:5: error: cannot declare '::main' to be a global variable
4 | int main {
| ^~~~
a.cc:6:3: error: expected primary-expression before 'int'
6 | int n,k,x,y;
| ^~~
a.cc:6:3: error: expected '}' before 'int'
a.cc:4:10: note: to match this '{'
4 | int main {
| ^
a.cc:8:3: error: 'cin' does not name a type
8 | cin >> n >> k >> x >> y ;
| ^~~
a.cc:10:5: error: expected ')' before '-' token
10 | (n - k) >= 0 ? cout << (n-k)*y + k*x : cout << k*x ;
| ~ ^~
| )
a.cc:11:2: error: expected declaration before '}' token
11 | }
| ^
|
s292062936
|
p04011
|
C++
|
#include<iostream>
using namespace std;
int main(){
int N, K, X, Y; cin << N; cin << K; cin << X; cin << Y;
cout << X*K + Y*(N-K);
}
|
a.cc: In function 'int main()':
a.cc:4:25: error: no match for 'operator<<' (operand types are 'std::istream' {aka 'std::basic_istream<char>'} and 'int')
4 | int N, K, X, Y; cin << N; cin << K; cin << X; cin << Y;
| ~~~ ^~ ~
| | |
| | int
| std::istream {aka std::basic_istream<char>}
a.cc:4:25: note: candidate: 'operator<<(int, int)' (built-in)
4 | int N, K, X, Y; cin << N; cin << K; cin << X; cin << Y;
| ~~~~^~~~
a.cc:4:25: note: no known conversion for argument 1 from 'std::istream' {aka 'std::basic_istream<char>'} to 'int'
In file included from /usr/include/c++/14/bits/basic_string.h:47,
from /usr/include/c++/14/string:54,
from /usr/include/c++/14/bits/locale_classes.h:40,
from /usr/include/c++/14/bits/ios_base.h:41,
from /usr/include/c++/14/ios:44,
from /usr/include/c++/14/ostream:40,
from /usr/include/c++/14/iostream:41,
from a.cc:1:
/usr/include/c++/14/string_view:763:5: note: candidate: 'template<class _CharT, class _Traits> std::basic_ostream<_CharT, _Traits>& std::operator<<(basic_ostream<_CharT, _Traits>&, basic_string_view<_CharT, _Traits>)'
763 | operator<<(basic_ostream<_CharT, _Traits>& __os,
| ^~~~~~~~
/usr/include/c++/14/string_view:763:5: note: template argument deduction/substitution failed:
a.cc:4:28: note: 'std::istream' {aka 'std::basic_istream<char>'} is not derived from 'std::basic_ostream<_CharT, _Traits>'
4 | int N, K, X, Y; cin << N; cin << K; cin << X; cin << Y;
| ^
/usr/include/c++/14/bits/basic_string.h:4077:5: note: candidate: 'template<class _CharT, class _Traits, class _Alloc> std::basic_ostream<_CharT, _Traits>& std::operator<<(basic_ostream<_CharT, _Traits>&, const __cxx11::basic_string<_CharT, _Traits, _Allocator>&)'
4077 | operator<<(basic_ostream<_CharT, _Traits>& __os,
| ^~~~~~~~
/usr/include/c++/14/bits/basic_string.h:4077:5: note: template argument deduction/substitution failed:
a.cc:4:28: note: 'std::istream' {aka 'std::basic_istream<char>'} is not derived from 'std::basic_ostream<_CharT, _Traits>'
4 | int N, K, X, Y; cin << N; cin << K; cin << X; cin << Y;
| ^
In file included from /usr/include/c++/14/bits/memory_resource.h:38,
from /usr/include/c++/14/string:68:
/usr/include/c++/14/cstddef:125:5: note: candidate: 'template<class _IntegerType> constexpr std::__byte_op_t<_IntegerType> std::operator<<(byte, _IntegerType)'
125 | operator<<(byte __b, _IntegerType __shift) noexcept
| ^~~~~~~~
/usr/include/c++/14/cstddef:125:5: note: template argument deduction/substitution failed:
a.cc:4:21: note: cannot convert 'std::cin' (type 'std::istream' {aka 'std::basic_istream<char>'}) to type 'std::byte'
4 | int N, K, X, Y; cin << N; cin << K; cin << X; cin << Y;
| ^~~
In file included from /usr/include/c++/14/bits/ios_base.h:46:
/usr/include/c++/14/system_error:339:5: note: candidate: 'template<class _CharT, class _Traits> std::basic_ostream<_CharT, _Traits>& std::operator<<(basic_ostream<_CharT, _Traits>&, const error_code&)'
339 | operator<<(basic_ostream<_CharT, _Traits>& __os, const error_code& __e)
| ^~~~~~~~
/usr/include/c++/14/system_error:339:5: note: template argument deduction/substitution failed:
a.cc:4:28: note: 'std::istream' {aka 'std::basic_istream<char>'} is not derived from 'std::basic_ostream<_CharT, _Traits>'
4 | int N, K, X, Y; cin << N; cin << K; cin << X; cin << Y;
| ^
/usr/include/c++/14/ostream:563:5: note: candidate: 'template<class _CharT, class _Traits> std::basic_ostream<_CharT, _Traits>& std::operator<<(basic_ostream<_CharT, _Traits>&, _CharT)'
563 | operator<<(basic_ostream<_CharT, _Traits>& __out, _CharT __c)
| ^~~~~~~~
/usr/include/c++/14/ostream:563:5: note: template argument deduction/substitution failed:
a.cc:4:28: note: 'std::istream' {aka 'std::basic_istream<char>'} is not derived from 'std::basic_ostream<_CharT, _Traits>'
4 | int N, K, X, Y; cin << N; cin << K; cin << X; cin << Y;
| ^
/usr/include/c++/14/ostream:573:5: note: candidate: 'template<class _CharT, class _Traits> std::basic_ostream<_CharT, _Traits>& std::operator<<(basic_ostream<_CharT, _Traits>&, char)'
573 | operator<<(basic_ostream<_CharT, _Traits>& __out, char __c)
| ^~~~~~~~
/usr/include/c++/14/ostream:573:5: note: template argument deduction/substitution failed:
a.cc:4:28: note: 'std::istream' {aka 'std::basic_istream<char>'} is not derived from 'std::basic_ostream<_CharT, _Traits>'
4 | int N, K, X, Y; cin << N; cin << K; cin << X; cin << Y;
| ^
/usr/include/c++/14/ostream:579:5: note: candidate: 'template<class _Traits> std::basic_ostream<char, _Traits>& std::operator<<(basic_ostream<char, _Traits>&, char)'
579 | operator<<(basic_ostream<char, _Traits>& __out, char __c)
| ^~~~~~~~
/usr/include/c++/14/ostream:579:5: note: template argument deduction/substitution failed:
a.cc:4:28: note: 'std::istream' {aka 'std::basic_istream<char>'} is not derived from 'std::basic_ostream<char, _Traits>'
4 | int N, K, X, Y; cin << N; cin << K; cin << X; cin << Y;
| ^
/usr/include/c++/14/ostream:590:5: note: candidate: 'template<class _Traits> std::basic_ostream<char, _Traits>& std::operator<<(basic_ostream<char, _Traits>&, signed char)'
590 | operator<<(basic_ostream<char, _Traits>& __out, signed char __c)
| ^~~~~~~~
/usr/include/c++/14/ostream:590:5: note: template argument deduction/substitution failed:
a.cc:4:28: note: 'std::istream' {aka 'std::basic_istream<char>'} is not derived from 'std::basic_ostream<char, _Traits>'
4 | int N, K, X, Y; cin << N; cin << K; cin << X; cin << Y;
| ^
/usr/include/c++/14/ostream:595:5: note: candidate: 'template<class _Traits> std::basic_ostream<char, _Traits>& std::operator<<(basic_ostream<char, _Traits>&, unsigned char)'
595 | operator<<(basic_ostream<char, _Traits>& __out, unsigned char __c)
| ^~~~~~~~
/usr/include/c++/14/ostream:595:5: note: template argument deduction/substitution failed:
a.cc:4:28: note: 'std::istream' {aka 'std::basic_istream<char>'} is not derived from 'std::basic_ostream<char, _Traits>'
4 | int N, K, X, Y; cin << N; cin << K; cin << X; cin << Y;
| ^
/usr/include/c++/14/ostream:654:5: note: candidate: 'template<class _CharT, class _Traits> std::basic_ostream<_CharT, _Traits>& std::operator<<(basic_ostream<_CharT, _Traits>&, const _CharT*)'
654 | operator<<(basic_ostream<_CharT, _Traits>& __out, const _CharT* __s)
| ^~~~~~~~
/usr/include/c++/14/ostream:654:5: note: template argument deduction/substitution failed:
a.cc:4:28: note: 'std::istream' {aka 'std::basic_istream<char>'} is not derived from 'std::basic_ostream<_CharT, _Traits>'
4 | int N, K, X, Y; cin << N; cin << K; cin << X; cin << Y;
| ^
In file included from /usr/include/c++/14/ostream:1022:
/usr/include/c++/14/bits/ostream.tcc:307:5: note: candidate: 'template<class _CharT, class _Traits> std::basic_ostream<_CharT, _Traits>& std::operator<<(basic_ostream<_CharT, _Traits>&, const char*)'
307 | operator<<(basic_ostream<_CharT, _Traits>& __out, const char* __s)
| ^~~~~~~~
/usr/include/c++/14/bits/ostream.tcc:307:5: note: template argument deduction/substitution failed:
a.cc:4:28: note: 'std::istream' {aka 'std::basic_istream<char>'} is not derived from 'std::basic_ostream<_CharT, _Traits>'
4 | int N, K, X, Y; cin << N; cin << K; cin << X; cin << Y;
| ^
/usr/include/c++/14/ostream:671:5: note: candidate: 'template<class _Traits> std::basic_ostream<char, _Traits>& std::operator<<(basic_ostream<char, _Traits>&, const char*)'
671 | operator<<(basic_ostream<char, _Traits>& __out, const char* __s)
| ^~~~~~~~
/usr/include/c++/14/ostream:671:5: note: template argument deduction/substitution failed:
a.cc:4:28: note: 'std::istream' {aka 'std::basic_istream<char>'} is not derived from 'std::basic_ostream<char, _Traits>'
4 | int N, K, X, Y; cin << N; cin << K; cin << X; cin << Y;
| ^
/usr/include/c++/14/ostream:684:5: note: candidate: 'template<class _Traits> std::basic_ostream<char, _Traits>& std::operator<<(basic_ostream<char, _Traits>&, const signed char*)'
684 | operator<<(basic_ostream<char, _Traits>& __out, const signed char* __s)
| ^~~~~~~~
/usr/include/c++/14/ostream:684:5: note: template argument deduction/substitution failed:
a.cc:4:28: note: 'std::istream' {aka 'std::basic_istream<char>'} is not derived from 'std::basic_ostream<char, _Traits>'
4 | int N, K, X, Y; cin << N; cin << K; cin << X; cin << Y;
| ^
/usr/include/c++/14/ostream:689:5: note: candidate: 'template<class _Traits> std::basic_ostream<char, _Traits>& std::operator<<(basic_ostream<char, _Traits>&, const unsigned char*)'
689 | operator<<(basic_ostream<char, _Traits>& __out, const unsigned char* __s)
| ^~~~~~~~
/usr/include/c++/14/ostream:689:5: note: template argument deduction/substitution failed:
a.cc:4:28: note: 'std::istream' {aka 'std::basic_istream<char>'} is not derived from 'std::basic_ostream<char, _Traits>'
4 | int N, K, X, Y; cin << N; cin << K; cin << X; cin << Y;
| ^
/usr/include/c++/14/ostream:810:5: note: candidate: 'template<class _Ostream, class _Tp> _Ostream&& std::operator<<(_Ostream&&, const _Tp&)'
810 | operator<<(_Ostream&& __os, const _Tp& __x)
| ^~~~~~~~
/usr/include/c++/14/ostream:810:5: note: template argument deduction/substitution failed:
/usr/include/c++/14/ostream: In substitution of
|
s990689328
|
p04011
|
C++
|
#include <iostream>
using namespace std;
int main(){
int n, k, x, y;
sum = 0;
cin >> n >> k >> x >> y;
if (n > k) {
sum = (n - k) * y + k * x;
} else {
sum = n * x;
}
cout << sum;
return 0;
}
|
a.cc: In function 'int main()':
a.cc:6:9: error: 'sum' was not declared in this scope
6 | sum = 0;
| ^~~
|
s102984484
|
p04011
|
C++
|
#include <iostream>
using namespace std;
int main() {
int n, k, x, y;
cin >> n >> k >> x >> y;
cout << k*x (n-k+1) * y << endl;
return 0;
}
|
a.cc: In function 'int main()':
a.cc:7:17: error: 'x' cannot be used as a function
7 | cout << k*x (n-k+1) * y << endl;
| ~~^~~~~~~
|
s942283082
|
p04011
|
Java
|
import java.util.*;
public class a044{
public static void main(String args[]){
Scanner sc1 = new Scanner(System.in);
int n = sc1.nextInt();
int k = sc1.nextInt();
int x = sc1.nextInt();
int y = sc1.nextInt();
int sum = 0;
for(int i = 0; i < k; i++){
sum += x;
}
for(int j = 0; j < n-k; j++){
sum += y;
}
System.out.print(sum);
}
}
|
Main.java:3: error: class a044 is public, should be declared in a file named a044.java
public class a044{
^
1 error
|
s604783608
|
p04011
|
C++
|
#include <iostream>
#include <numeric>
#include <math.h>
#include <algorithm>
#include <float.h>
#include <limits>
#include <vector>
#include <string.h>
#define rep(i,a,n) for(ll int (i) = (a);(i) < (n);(i)++)
#define urep(i,a,n) for(ll int (i) = (a);(i) > (n);(i)--)
#define MOD 1000000007
#define ll long long
#define asort(a) sort(a.begin(),a.end());
using namespace::std;
int jo(ll int jxo, ll int jyo){//累乗
ll int jhogeo = 1;
rep(jinto,0,jyo) jhogeo=jhogeo*jxo;
return jhogeo;
}
char tobig(char toxbig){//char大文字化
return (toxbig-0x20);
}
char tolow(char toxlow){//char小文字化
return (toxlow+0x20);
}
int ctoi(char cctoi){//char->int
if('0' <= cctoi && cctoi <= '9') return (cctoi-'0');
return -1;
}
int gcd(int gcad, int gcbd) {//最大公約数
if(gcad < gcbd) return gcd(gcbd, gcad);
int gcrd;
while ((gcrd=gcad%gcbd)) {
gcad = gcbd;
gcbd = gcrd;
}
return gcbd;
}
int lcm(int lcam, int lcbm){//最小公倍数
return (lcam*lcbm)/gcd(lcam,lcbm);
}
int main(){
int a,b,c,d;
cin>>a>>b>>c>>d;
if(a>b) cout<<b*x+(a-b)*y;
else cout<<a*x;
cout<<endl;
}
// int *p = new int[N];
// vector<int> 変数名(要素数);
// sort(変数名.begin(),変数名.end());//昇順ソート
// vector<vector<int>> 変数名(左の個数, vector<int>(右の個数));
//
|
a.cc: In function 'int main()':
a.cc:50:19: error: 'x' was not declared in this scope
50 | if(a>b) cout<<b*x+(a-b)*y;
| ^
a.cc:50:27: error: 'y' was not declared in this scope
50 | if(a>b) cout<<b*x+(a-b)*y;
| ^
a.cc:51:16: error: 'x' was not declared in this scope
51 | else cout<<a*x;
| ^
|
s660091566
|
p04011
|
C++
|
#include <iostream>
#include <algorithm>
#include <string>
using namespace std;
int main() {
int int n,k,x,y;
cin >> n >> k >> x >> y;
if(k>=n)cout << x*n << endl;
else cout << (n-k)*y+x*k << endl;
return 0;
}
|
a.cc: In function 'int main()':
a.cc:8:5: error: two or more data types in declaration of 'n'
8 | int int n,k,x,y;
| ^~~
a.cc:8:5: error: two or more data types in declaration of 'k'
a.cc:8:5: error: two or more data types in declaration of 'x'
a.cc:8:5: error: two or more data types in declaration of 'y'
a.cc:9:12: error: 'n' was not declared in this scope
9 | cin >> n >> k >> x >> y;
| ^
a.cc:9:17: error: 'k' was not declared in this scope
9 | cin >> n >> k >> x >> y;
| ^
a.cc:9:22: error: 'x' was not declared in this scope
9 | cin >> n >> k >> x >> y;
| ^
a.cc:9:27: error: 'y' was not declared in this scope
9 | cin >> n >> k >> x >> y;
| ^
|
s696526678
|
p04011
|
C++
|
#include<bits/stdc++.h>
using namespace std;
int main(){
int n,k,x,y;
cin>>n>>k>>x>>y;
if(n<k+1)
cout << n*x <<endl;
else if cout<<(n-k)*y+k*x<<endl;
}
|
a.cc: In function 'int main()':
a.cc:8:11: error: expected '(' before 'cout'
8 | else if cout<<(n-k)*y+k*x<<endl;
| ^~~~
| (
|
s987490671
|
p04011
|
C++
|
#include<bists/stdc++.h>
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+=Y;
else
ans+=X;
}
return 0;
}
|
a.cc:1:9: fatal error: bists/stdc++.h: No such file or directory
1 | #include<bists/stdc++.h>
| ^~~~~~~~~~~~~~~~
compilation terminated.
|
s677603145
|
p04011
|
C
|
#include <stdio.h>
int main(){
int n,k,x,y;
int a=0,d=0;
scanf("%d",&n);
scanf("%d",&k);
scanf("%d",&x);
scanf("%d",&y);
if(n >x){
a=x;
b=n-a;
}else{
a=n;}
printf("%d\n",a*x+b*y);
return(0);
}
|
main.c: In function 'main':
main.c:11:5: error: 'b' undeclared (first use in this function)
11 | b=n-a;
| ^
main.c:11:5: note: each undeclared identifier is reported only once for each function it appears in
|
s231178890
|
p04011
|
C++
|
#include <bits/stdc++.h>
using namespace std;
int main() {
cin >>N >>K >>X >>Y ;
if(K<=N){;
cout << K*X+(N-K)*Y << endl;
}
else
cout << N*X << endl;
}
|
a.cc: In function 'int main()':
a.cc:5:9: error: 'N' was not declared in this scope
5 | cin >>N >>K >>X >>Y ;
| ^
a.cc:5:13: error: 'K' was not declared in this scope
5 | cin >>N >>K >>X >>Y ;
| ^
a.cc:5:17: error: 'X' was not declared in this scope
5 | cin >>N >>K >>X >>Y ;
| ^
a.cc:5:22: error: 'Y' was not declared in this scope
5 | cin >>N >>K >>X >>Y ;
| ^
|
s787371294
|
p04011
|
C++
|
#include <bits/stdc++.h>
using namespace std;
int main() {
cin >>N >>K >>X >>Y ;
if(K<=N);
cout << K*X+(N-K)*Y;
else
cout << N*X;
}
|
a.cc: In function 'int main()':
a.cc:5:9: error: 'N' was not declared in this scope
5 | cin >>N >>K >>X >>Y ;
| ^
a.cc:5:13: error: 'K' was not declared in this scope
5 | cin >>N >>K >>X >>Y ;
| ^
a.cc:5:17: error: 'X' was not declared in this scope
5 | cin >>N >>K >>X >>Y ;
| ^
a.cc:5:22: error: 'Y' was not declared in this scope
5 | cin >>N >>K >>X >>Y ;
| ^
a.cc:10:3: error: 'else' without a previous 'if'
10 | else
| ^~~~
|
s266353958
|
p04011
|
Java
|
import java.util.Scanner;
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){
System.out.println(x * k + y(n-k));
}else{
System.out.println(x * n);
}
}
}
|
Main.java:12: error: cannot find symbol
System.out.println(x * k + y(n-k));
^
symbol: method y(int)
location: class Main
1 error
|
s442139641
|
p04011
|
Java
|
import java.util.Scanner;
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){
System.out.println(x * k + y(n - k));
}else{
System.out.println(x * n);
}
}
}
|
Main.java:12: error: cannot find symbol
System.out.println(x * k + y(n - k));
^
symbol: method y(int)
location: class Main
1 error
|
s565626645
|
p04011
|
Java
|
import java.util.Scanner;
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){
System.out.println(x * k + y (n - k));
}else{
System.out.println(x * n);
}
}
}
|
Main.java:12: error: cannot find symbol
System.out.println(x * k + y (n - k));
^
symbol: method y(int)
location: class Main
1 error
|
s597217493
|
p04011
|
C++
|
#include<bits/stdc++.h>
using namespace std;
int main()
{
int a,b,c,d;
cin>>a>>b>>c>>d;
if(b>=a)
cout<<a*c;
if(b<a)
cout<<k*c+(n-k)*d;
return 0;
}
|
a.cc: In function 'int main()':
a.cc:10:15: error: 'k' was not declared in this scope
10 | cout<<k*c+(n-k)*d;
| ^
a.cc:10:20: error: 'n' was not declared in this scope
10 | cout<<k*c+(n-k)*d;
| ^
|
s490238551
|
p04011
|
C++
|
#include<bits/stdc++.h>
using namespace std;
int main()
{
int a,b,c,d;
cin>>a>>b>>c>>d;
if(k>=n)
cout<<a*c;
if(k<n)
cout<<k*c+(n-k)*d;
return 0;
}
|
a.cc: In function 'int main()':
a.cc:7:12: error: 'k' was not declared in this scope
7 | if(k>=n)
| ^
a.cc:7:15: error: 'n' was not declared in this scope
7 | if(k>=n)
| ^
a.cc:9:12: error: 'k' was not declared in this scope
9 | if(k<n)
| ^
a.cc:9:14: error: 'n' was not declared in this scope
9 | if(k<n)
| ^
|
s228890021
|
p04011
|
C++
|
#include<bits/stdc++.h>
using namespace std;
int main(){
int n,k,x,y;
cin >> n >> k >> x >> y;
cout << x*k + y*(n-k)
return 0;
}
|
a.cc: In function 'int main()':
a.cc:8:24: error: expected ';' before 'return'
8 | cout << x*k + y*(n-k)
| ^
| ;
9 | return 0;
| ~~~~~~
|
s120100846
|
p04011
|
C++
|
#include<bits/stdc++.h>
using namespace std;
int main(){
int N,K,X,Y;
cin>>N>>K>>X>>Y;
ciut<<K*X+(N-K)*Y<<endl;
}
|
a.cc: In function 'int main()':
a.cc:7:3: error: 'ciut' was not declared in this scope
7 | ciut<<K*X+(N-K)*Y<<endl;
| ^~~~
|
s512801489
|
p04011
|
C++
|
#include<cstdio>
#include<cstring>
#include<algorithm>
using namespace std;
int main(){
char w[100];
scanf("%s", &w);
int len = strlen(w);
int num = 0;
for(int i=0; i<len; i++){
if( count(w, w+len, w[i]) % 2 == 0){
num ++;
if(num == len)
printf('Yes');
}
else{
printf('No');
break;
}
}
return 0;
}
|
a.cc:16:16: warning: multi-character character constant [-Wmultichar]
16 | printf('Yes');
| ^~~~~
a.cc:19:14: warning: multi-character character constant [-Wmultichar]
19 | printf('No');
| ^~~~
a.cc: In function 'int main()':
a.cc:16:16: error: invalid conversion from 'int' to 'const char*' [-fpermissive]
16 | printf('Yes');
| ^~~~~
| |
| int
In file included from /usr/include/c++/14/cstdio:42,
from a.cc:1:
/usr/include/stdio.h:363:43: note: initializing argument 1 of 'int printf(const char*, ...)'
363 | extern int printf (const char *__restrict __format, ...);
| ~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~
a.cc:19:14: error: invalid conversion from 'int' to 'const char*' [-fpermissive]
19 | printf('No');
| ^~~~
| |
| int
/usr/include/stdio.h:363:43: note: initializing argument 1 of 'int printf(const char*, ...)'
363 | extern int printf (const char *__restrict __format, ...);
| ~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~
|
s277205256
|
p04011
|
C++
|
#include<cstdio>
#include<cstring>
#include<algorithm>
int main(){
char w[100];
scanf("%s", &w);
int len = strlen(w);
int num = 0;
for(int i=0; i<len; i++){
if( count(w, w+len, w+i) % 2 == 0){
num ++;
if(num == len)
printf('Yes');
}
else{
printf('No');
break;
}
}
return 0;
}
|
a.cc:15:16: warning: multi-character character constant [-Wmultichar]
15 | printf('Yes');
| ^~~~~
a.cc:18:14: warning: multi-character character constant [-Wmultichar]
18 | printf('No');
| ^~~~
a.cc: In function 'int main()':
a.cc:11:9: error: 'count' was not declared in this scope; did you mean 'std::count'?
11 | if( count(w, w+len, w+i) % 2 == 0){
| ^~~~~
| std::count
In file included from /usr/include/c++/14/algorithm:86,
from a.cc:3:
/usr/include/c++/14/pstl/glue_algorithm_defs.h:101:1: note: 'std::count' declared here
101 | count(_ExecutionPolicy&& __exec, _ForwardIterator __first, _ForwardIterator __last, const _Tp& __value);
| ^~~~~
a.cc:15:16: error: invalid conversion from 'int' to 'const char*' [-fpermissive]
15 | printf('Yes');
| ^~~~~
| |
| int
In file included from /usr/include/c++/14/cstdio:42,
from a.cc:1:
/usr/include/stdio.h:363:43: note: initializing argument 1 of 'int printf(const char*, ...)'
363 | extern int printf (const char *__restrict __format, ...);
| ~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~
a.cc:18:14: error: invalid conversion from 'int' to 'const char*' [-fpermissive]
18 | printf('No');
| ^~~~
| |
| int
/usr/include/stdio.h:363:43: note: initializing argument 1 of 'int printf(const char*, ...)'
363 | extern int printf (const char *__restrict __format, ...);
| ~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~
|
s679497619
|
p04011
|
C++
|
#include<iostrem>
using namespace std;
int main(){
int a,b,c,d;cin>>a>>b>>c>>d;
if(a<=b) cout<<a*c;
else cout<<a*c+(a-b)*d;
}
|
a.cc:1:9: fatal error: iostrem: No such file or directory
1 | #include<iostrem>
| ^~~~~~~~~
compilation terminated.
|
s496864344
|
p04011
|
C++
|
#include<bits/t\stdc++.h>
using namespace std;
int main(void){
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:9: fatal error: bits/t\stdc++.h: No such file or directory
1 | #include<bits/t\stdc++.h>
| ^~~~~~~~~~~~~~~~~
compilation terminated.
|
s275595445
|
p04011
|
C++
|
#include<bits/stdc.++>
using namespace std;
int main(){
int n,k,a,b,sum;
cin >> n >> k >> a >> b;
if(n<=k){
cout << n*a << endl;
}else{
cout << n*a+(n-k)*b << endl;
}
}
|
a.cc:1:9: fatal error: bits/stdc.++: No such file or directory
1 | #include<bits/stdc.++>
| ^~~~~~~~~~~~~~
compilation terminated.
|
s988753992
|
p04011
|
C++
|
#include<stdio.h>
int main(void)
{
int n,k,x,y,r;
scanf("%d",&n);
scanf("%d",&k);
scanf("%d",&x);
scanf("%d",&y);
if(n>k) {
r=y*n;
}
else{
r=x*n;
}
printf("%d\n",r);
return 0
}
|
a.cc: In function 'int main()':
a.cc:16:17: error: expected ';' before '}' token
16 | return 0
| ^
| ;
17 | }
| ~
|
s412505052
|
p04011
|
C++
|
#include<stdio.h>
int main(void)
{
int n,k,x,y,r;
scanf("%d",&n);
scanf("%d",&k);
scanf("%d",&x);
scanf("%d",&y);
if(n>k) {
r=y*n;
}
else{
r=x*n;
}
printf("%d\n",r);
return 0;
|
a.cc: In function 'int main()':
a.cc:17:18: error: expected '}' at end of input
17 | return 0;
| ^
a.cc:4:1: note: to match this '{'
4 | {
| ^
|
s651410730
|
p04011
|
C++
|
Copy
Copy
#include<stdio.h>
int main(void)
{
int n,k,x,y,r;
scanf("%d",&n);
scanf("%d",&k);
scanf("%d",&x);
scanf("%d",&y);
if(n>k) {
r=y*n;
}
else{
r=x*n;
}
printf("%d\n",r);
return 0;
|
a.cc:2:1: error: 'Copy' does not name a type
2 | Copy
| ^~~~
a.cc: In function 'int main()':
a.cc:8:9: error: 'scanf' was not declared in this scope
8 | scanf("%d",&n);
| ^~~~~
a.cc:18:9: error: 'printf' was not declared in this scope
18 | printf("%d\n",r);
| ^~~~~~
a.cc:5:1: note: 'printf' is defined in header '<cstdio>'; this is probably fixable by adding '#include <cstdio>'
4 | #include<stdio.h>
+++ |+#include <cstdio>
5 | int main(void)
a.cc:19:18: error: expected '}' at end of input
19 | return 0;
| ^
a.cc:6:1: note: to match this '{'
6 | {
| ^
|
s991751267
|
p04011
|
C++
|
#include<stdio.h>
int main(void)
{
int X,Y,K,N,e;
scanf("%d",X);
scanf("%d",Y);
scanf("%d",N);
e=(K*X)+(((k+1)*N*Y);
printf("%d",e);
return 0;
}
|
a.cc: In function 'int main()':
a.cc:5:22: error: expected ';' before '\U0000ff1b'
5 | scanf("%d",X);
| ^~
| ;
a.cc:8:20: error: 'k' was not declared in this scope
8 | e=(K*X)+(((k+1)*N*Y);
| ^
a.cc:8:29: error: expected ')' before ';' token
8 | e=(K*X)+(((k+1)*N*Y);
| ~ ^
| )
|
s325842721
|
p04011
|
C++
|
#include<stdio.h>
int main(void)
{
int X,Y,K,e;
scanf("%d",X);
scanf("%d",Y);
e=(K*X)+((k+1)*Y);
printf("%d",e);
return 0;
}
|
a.cc: In function 'int main()':
a.cc:5:22: error: expected ';' before '\U0000ff1b'
5 | scanf("%d",X);
| ^~
| ;
a.cc:7:19: error: 'k' was not declared in this scope
7 | e=(K*X)+((k+1)*Y);
| ^
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.