submission_id stringlengths 10 10 | problem_id stringlengths 6 6 | language stringclasses 3 values | code stringlengths 1 522k | compiler_output stringlengths 43 10.2k |
|---|---|---|---|---|
s349430200 | p03773 | C | int main(void){
//int 24times[] = {0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23}
int c1;
char buf[256];
fgets(buf,256,stdin);
sscanf(buf,"%d",%c1);
int c2;
char buf[256];
fgets(buf,256,stdin);
sscanf(buf,"%d",%c2);
while(c1 > 24){
c1 = c1-24;
}
while(c2 > 24){
c2 = c2-24;
}
int t = c1 + c2;
while(t > 24){
t = t-24;
}
printf(t);
}
| main.c: In function 'main':
main.c:7:9: error: implicit declaration of function 'fgets' [-Wimplicit-function-declaration]
7 | fgets(buf,256,stdin);
| ^~~~~
main.c:7:23: error: 'stdin' undeclared (first use in this function)
7 | fgets(buf,256,stdin);
| ^~~~~
main.c:1:1: note: 'stdin' is defined in header '<stdio.h>'; this is probably fixable by adding '#include <stdio.h>'
+++ |+#include <stdio.h>
1 | int main(void){
main.c:7:23: note: each undeclared identifier is reported only once for each function it appears in
7 | fgets(buf,256,stdin);
| ^~~~~
main.c:8:9: error: implicit declaration of function 'sscanf' [-Wimplicit-function-declaration]
8 | sscanf(buf,"%d",%c1);
| ^~~~~~
main.c:8:9: note: include '<stdio.h>' or provide a declaration of 'sscanf'
main.c:8:9: warning: incompatible implicit declaration of built-in function 'sscanf' [-Wbuiltin-declaration-mismatch]
main.c:8:9: note: include '<stdio.h>' or provide a declaration of 'sscanf'
main.c:8:25: error: expected expression before '%' token
8 | sscanf(buf,"%d",%c1);
| ^
main.c:12:14: error: redeclaration of 'buf' with no linkage
12 | char buf[256];
| ^~~
main.c:6:14: note: previous declaration of 'buf' with type 'char[256]'
6 | char buf[256];
| ^~~
main.c:14:25: error: expected expression before '%' token
14 | sscanf(buf,"%d",%c2);
| ^
main.c:29:9: error: implicit declaration of function 'printf' [-Wimplicit-function-declaration]
29 | printf(t);
| ^~~~~~
main.c:29:9: note: include '<stdio.h>' or provide a declaration of 'printf'
main.c:29:9: warning: incompatible implicit declaration of built-in function 'printf' [-Wbuiltin-declaration-mismatch]
main.c:29:9: note: include '<stdio.h>' or provide a declaration of 'printf'
main.c:29:16: error: passing argument 1 of 'printf' makes pointer from integer without a cast [-Wint-conversion]
29 | printf(t);
| ^
| |
| int
main.c:29:16: note: expected 'const char *' but argument is of type 'int'
|
s077759225 | p03773 | C | int main(void){
//int 24times[] = {0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23}
int c1;
int c2;
char buf[256];
fgets(buf,256,stdin);
sscanf(buf,"%d",%c1);
sscanf(buf,"%d",%c2);
while(c1 > 24){
c1 = c1-24;
}
while(c2 > 24){
c2 = c2-24;
}
int t = c1 + c2;
while(t > 24){
t = t-24;
}
printf(t);
}
| main.c: In function 'main':
main.c:8:9: error: implicit declaration of function 'fgets' [-Wimplicit-function-declaration]
8 | fgets(buf,256,stdin);
| ^~~~~
main.c:8:23: error: 'stdin' undeclared (first use in this function)
8 | fgets(buf,256,stdin);
| ^~~~~
main.c:1:1: note: 'stdin' is defined in header '<stdio.h>'; this is probably fixable by adding '#include <stdio.h>'
+++ |+#include <stdio.h>
1 | int main(void){
main.c:8:23: note: each undeclared identifier is reported only once for each function it appears in
8 | fgets(buf,256,stdin);
| ^~~~~
main.c:9:9: error: implicit declaration of function 'sscanf' [-Wimplicit-function-declaration]
9 | sscanf(buf,"%d",%c1);
| ^~~~~~
main.c:9:9: note: include '<stdio.h>' or provide a declaration of 'sscanf'
main.c:9:9: warning: incompatible implicit declaration of built-in function 'sscanf' [-Wbuiltin-declaration-mismatch]
main.c:9:9: note: include '<stdio.h>' or provide a declaration of 'sscanf'
main.c:9:25: error: expected expression before '%' token
9 | sscanf(buf,"%d",%c1);
| ^
main.c:10:25: error: expected expression before '%' token
10 | sscanf(buf,"%d",%c2);
| ^
main.c:25:9: error: implicit declaration of function 'printf' [-Wimplicit-function-declaration]
25 | printf(t);
| ^~~~~~
main.c:25:9: note: include '<stdio.h>' or provide a declaration of 'printf'
main.c:25:9: warning: incompatible implicit declaration of built-in function 'printf' [-Wbuiltin-declaration-mismatch]
main.c:25:9: note: include '<stdio.h>' or provide a declaration of 'printf'
main.c:25:16: error: passing argument 1 of 'printf' makes pointer from integer without a cast [-Wint-conversion]
25 | printf(t);
| ^
| |
| int
main.c:25:16: note: expected 'const char *' but argument is of type 'int'
|
s270725866 | p03773 | C | int main void{
//int 24times[] = {0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23}
int c1;
int c2;
char buf[256];
fgets(buf,256,stdin);
sscanf(buf,"%d",%c1);
sscanf(buf,"%d",%c2);
while(c1 > 24){
c1 = c1-24;
}
while(c2 > 24){
c2 = c2-24;
}
int t = c1 + c2;
while(t > 24){
t = t-24;
}
printf(t);
}
| main.c:1:9: error: expected ';' before 'void'
1 | int main void{
| ^~~~~
| ;
main.c:1:14: error: expected identifier or '(' before '{' token
1 | int main void{
| ^
|
s614517658 | p03773 | C | int main void{
//int 24times[] = {0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23}
int c1;
int c2;
char buf[256];
fgets(buf,256,stdin);
sscanf(buf,"%d",%c1);
sscanf(buf,"%d",%c2);
while(c1 > 24){
c1 = c1-24;
}
while(c2 > 24){
c2 = c2-24;
}
int t = c1 + c2;
while(t > 24){
t = t-24;
}
printf(t);
}
| main.c:1:9: error: expected ';' before 'void'
1 | int main void{
| ^~~~~
| ;
main.c:1:14: error: expected identifier or '(' before '{' token
1 | int main void{
| ^
|
s925471481 | p03773 | C | #include <stdio.h>
#include <stdlib.h>
//int main(int argc, char *argv[]){
// int A = atoi(argv[1]);
// int B = atoi(argv[2]);
// int C;
int main(void){
int A;
int B;
scanf("%d",&A);
scanf("%d",&B);
C = A + B;
if(C > 23){
C = C - 24;
printf("%d\n",C);
}else{
printf("%d\n",C);
}
return 0;
} | main.c: In function 'main':
main.c:15:3: error: 'C' undeclared (first use in this function)
15 | C = A + B;
| ^
main.c:15:3: note: each undeclared identifier is reported only once for each function it appears in
|
s526736088 | p03773 | C++ | #include <algorithm>
#include <iostream>
using namespace std;
long long int a,b,c;
int main(){
cin>>a>>b;
c=a+b;
for(int i=0;i<2;i++){
if(c>24){
c-=24;
if(c<=24){
brake;
}
}
}
cout<<c<<endl;
} | a.cc: In function 'int main()':
a.cc:13:1: error: 'brake' was not declared in this scope
13 | brake;
| ^~~~~
|
s699067421 | p03773 | C++ | #include<iostream>
#include<string>
using namespace std;
int main(){
int a,b;
cin>>a,b;
a=a+b;
cout<<a%24<<endl;
} | a.cc: In function 'int main()':
a.cc:6:16: error: 'b' was not declared in this scope
6 | cin>>a,b;
| ^
|
s057958105 | p03773 | C++ | #include <iostream>
using namespace std;
int main(void){
// Here your code !
int start, reaming;
cin >> start >> reaming;
if((start + reaming) > 24){
cout << (start + reaming) - ((start + reaming) / 24));
}else{
cout << (start + reaming);
}
}
| a.cc: In function 'int main()':
a.cc:8:61: error: expected ';' before ')' token
8 | cout << (start + reaming) - ((start + reaming) / 24));
| ^
| ;
|
s590450011 | p03773 | C++ | c, d = map(int, input().split())
print((c + d)%24) | a.cc:1:1: error: 'c' does not name a type
1 | c, d = map(int, input().split())
| ^
|
s401879106 | p03773 | C++ | #include <iostream>
#include <cstdlib>
#include <cmath>
using namespace std;
int main(void)
{
int n, a, b, max, ans = 9999999999999;
max = sqrt((double)n);
for (int i = 1; i <= max; i++)
if (n % i) ans = min(ans, log10(n / i) + 1);
cout << ans << endl;
return 0;
} | a.cc: In function 'int main()':
a.cc:8:33: warning: overflow in conversion from 'long int' to 'int' changes value from '9999999999999' to '1316134911' [-Woverflow]
8 | int n, a, b, max, ans = 9999999999999;
| ^~~~~~~~~~~~~
a.cc:11:29: error: no matching function for call to 'min(int&, __gnu_cxx::__enable_if<true, double>::__type)'
11 | if (n % i) ans = min(ans, log10(n / i) + 1);
| ~~~^~~~~~~~~~~~~~~~~~~~~~~
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:11:29: note: deduced conflicting types for parameter 'const _Tp' ('int' and '__gnu_cxx::__enable_if<true, double>::__type' {aka 'double'})
11 | if (n % i) ans = min(ans, log10(n / i) + 1);
| ~~~^~~~~~~~~~~~~~~~~~~~~~~
/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
|
s771509595 | p03773 | C++ | #include <iostream>
#include <cstdlib>
#include <cmath>
using namespace std;
int main(void)
{
int n, a, b, max, ans = 9999999999999;
max = sqrt((double)n);
for (int i = 1; i <= MAX; i++)
if (n % i) ans = min(ans, log10(N / i) + 1);
cout << ans << endl;
return 0;
} | a.cc: In function 'int main()':
a.cc:8:29: warning: overflow in conversion from 'long int' to 'int' changes value from '9999999999999' to '1316134911' [-Woverflow]
8 | int n, a, b, max, ans = 9999999999999;
| ^~~~~~~~~~~~~
a.cc:10:26: error: 'MAX' was not declared in this scope
10 | for (int i = 1; i <= MAX; i++)
| ^~~
a.cc:11:37: error: 'N' was not declared in this scope
11 | if (n % i) ans = min(ans, log10(N / i) + 1);
| ^
|
s913850203 | p03773 | C++ | #include<iostream>
using namespace std;
int main(){
int a,b,N,M; cin >> N >> M;
int A[50],B[50],C[50],D[50],ans[50],num[50];
int dis;
//cout << N << M <<endl;
//Input of Students
for(int i=0; i < N; i++)
cin >> A[i] >> B[i];
//Input of Check Point
for(int i=0; i < M; i++)
cin >> C[i] >> D[i];
dis = 0;
for(int i=0; i<50; i++){
ans[i] =1000000000;
}
//Caluculation of Mahattan distance
for(int i=0; i < N; i++){
for(int j=0; j< M; j++){
dis = abs(A[i]-C[j]) + abs(B[i]-D[j]);
if(dis < ans[i] ) {
ans[i] = dis;
num[i] = j+1;
}
}
}
for(int i=0; i < N; i++)
cout << num[i] <<endl;
| a.cc: In function 'int main()':
a.cc:37:39: error: expected '}' at end of input
37 | cout << num[i] <<endl;
| ^
a.cc:5:11: note: to match this '{'
5 | int main(){
| ^
|
s956871307 | p03773 | C++ | include<iostream>
using namespace std;
int main(){
int A,B; cin >> A >> B;
if(A+B<=24)
cout << A+B << endl;
else
cout << A+B -24<< endl;
}
| a.cc:1:1: error: 'include' does not name a type
1 | include<iostream>
| ^~~~~~~
a.cc: In function 'int main()':
a.cc:7:18: error: 'cin' was not declared in this scope
7 | int A,B; cin >> A >> B;
| ^~~
a.cc:10:17: error: 'cout' was not declared in this scope
10 | cout << A+B << endl;
| ^~~~
a.cc:10:32: error: 'endl' was not declared in this scope
10 | cout << A+B << endl;
| ^~~~
a.cc:12:17: error: 'cout' was not declared in this scope
12 | cout << A+B -24<< endl;
| ^~~~
a.cc:12:35: error: 'endl' was not declared in this scope
12 | cout << A+B -24<< endl;
| ^~~~
|
s255472093 | p03773 | C | include <stdio.h>
int main(){
int a,b;
scanf("%d %d",&a,&b);
printf("%d\n",(a+b)%24);
return 0;
}
| main.c:1:9: error: expected '=', ',', ';', 'asm' or '__attribute__' before '<' token
1 | include <stdio.h>
| ^
|
s786402634 | p03773 | C++ | include <iostream>
using namespace std;
int main(){
int A;
int B;
cin >> A >> B;
if((A+B)<=24){
cout<<A+B<<endl;}
else{
cout<<(A+B)-24<<endl;}
return 0;
} | a.cc:1:1: error: 'include' does not name a type
1 | include <iostream>
| ^~~~~~~
a.cc: In function 'int main()':
a.cc:7:9: error: 'cin' was not declared in this scope
7 | cin >> A >> B;
| ^~~
a.cc:10:17: error: 'cout' was not declared in this scope
10 | cout<<A+B<<endl;}
| ^~~~
a.cc:10:28: error: 'endl' was not declared in this scope
10 | cout<<A+B<<endl;}
| ^~~~
a.cc:12:17: error: 'cout' was not declared in this scope
12 | cout<<(A+B)-24<<endl;}
| ^~~~
a.cc:12:33: error: 'endl' was not declared in this scope
12 | cout<<(A+B)-24<<endl;}
| ^~~~
|
s590567205 | p03773 | C++ |
a, b = map(int, input().split(" "));
print( (a+b) % 24); | a.cc:2:1: error: 'a' does not name a type
2 | a, b = map(int, input().split(" "));
| ^
a.cc:3:6: error: expected constructor, destructor, or type conversion before '(' token
3 | print( (a+b) % 24);
| ^
|
s921153929 | p03773 | C | include <stdio.h>
int main(){
int a, b;
scanf("%d %d", &a, &b)
if((a+b)>=24) printf("%d\n", ((a+b)-24));
else printf("%d\n", (a+b));
return 0;
} | main.c:1:9: error: expected '=', ',', ';', 'asm' or '__attribute__' before '<' token
1 | include <stdio.h>
| ^
|
s726984758 | p03773 | C++ | include <stdio.h>
int main(){
int a, b;
scanf("%d %d", &a, &b)
if((a+b)>=24) printf("%d\n", ((a+b)-24));
else printf("%d\n", (a+b));
return 0;
} | a.cc:1:1: error: 'include' does not name a type
1 | include <stdio.h>
| ^~~~~~~
|
s250148209 | p03773 | C++ | include <stdio.h>
int main(){
int a, b;
a = 20;
b = 5;
if((a+b)>=24) printf("%d\n", ((a+b)-24));
else printf("%d\n", (a+b));
return 0;
} | a.cc:1:1: error: 'include' does not name a type
1 | include <stdio.h>
| ^~~~~~~
|
s000335786 | p03773 | Java | import java.util.Scanner;
public class A {
public static void main(String[] args) {
Scanner scan = new Scanner(System.in);
int a = scan.nextInt();
int b = scan.nextInt();
int time = a + b;
if (time >= 24) {
time -= 24;
}
System.out.println(time);
scan.close();
}
}
| Main.java:3: error: class A is public, should be declared in a file named A.java
public class A {
^
1 error
|
s114917447 | p03773 | Java | import java.util.Scanner;
public class A {
public static void main(String[] args) {
Scanner scan = new Scanner(System.in);
int a = scan.nextInt();
int b = scan.nextInt();
int time = a + b;
if (time > 24) {
time -= 24;
}
System.out.println(time);
scan.close();
}
}
| Main.java:3: error: class A is public, should be declared in a file named A.java
public class A {
^
1 error
|
s439645677 | p03773 | Java | import java.util.Scanner;
public class A {
public static void main(String[] args) {
Scanner scan = new Scanner(System.in);
int a = scan.nextInt();
int b = scan.nextInt();
int time = a + b;
if (time > 24) {
time -= 24;
}
System.out.println(time);
}
}
| Main.java:3: error: class A is public, should be declared in a file named A.java
public class A {
^
1 error
|
s827196255 | p03773 | Java | #include<stdio.h>
int main(void){
int a,b;
scanf("%d%d",&a,&b);
printf("%d\n",(a + b) % 24);
return 0;
} | Main.java:1: error: illegal character: '#'
#include<stdio.h>
^
Main.java:1: error: class, interface, enum, or record expected
#include<stdio.h>
^
Main.java:5: error: class, interface, enum, or record expected
scanf("%d%d",&a,&b);
^
Main.java:6: error: class, interface, enum, or record expected
printf("%d\n",(a + b) % 24);
^
Main.java:7: error: class, interface, enum, or record expected
return 0;
^
Main.java:8: error: class, interface, enum, or record expected
}
^
6 errors
|
s016997439 | p03773 | Java | import java.util.*;
public class main{
public static void main(String[] args){
Scanner sc = new Scanner(System.in);
int A = sc.nextInt();
int B = sc.nextInt();
int C = A + B;
if(C > 24){
C = C-24;
}
System.out.println(C);
}
} | Main.java:4: error: class main is public, should be declared in a file named main.java
public class main{
^
1 error
|
s678535834 | p03773 | C++ | #inlcude <iostream>
using namespace std;
int main() {
int a, b;
cin >> a >> b;
cout << (a + b) % 24 << endl;
return 0;
} | a.cc:1:2: error: invalid preprocessing directive #inlcude; did you mean #include?
1 | #inlcude <iostream>
| ^~~~~~~
| include
a.cc: In function 'int main()':
a.cc:5:1: error: 'cin' was not declared in this scope
5 | cin >> a >> b;
| ^~~
a.cc:1:1: note: 'std::cin' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
+++ |+#include <iostream>
1 | #inlcude <iostream>
a.cc:6:1: error: 'cout' was not declared in this scope
6 | cout << (a + b) % 24 << endl;
| ^~~~
a.cc:6:1: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
a.cc:6:25: error: 'endl' was not declared in this scope
6 | cout << (a + b) % 24 << endl;
| ^~~~
a.cc:1:1: note: 'std::endl' is defined in header '<ostream>'; this is probably fixable by adding '#include <ostream>'
+++ |+#include <ostream>
1 | #inlcude <iostream>
|
s767702663 | p03773 | C++ | using ll=long long;
using R=double;
// Combination Table
ll C[51][51]; // C[n][k] -> nCk
void comb_table(int N){
for(int i=0;i<=N;++i){
for(int j=0;j<=i;++j){
if(j==0 or j==i){
C[i][j]=1LL;
}else{
C[i][j]=(C[i-1][j-1]+C[i-1][j]);
}
}
}
}
int main(void){
int N,A,B;
cin >> N >> A >> B;
const int NMAX=50;
ll v[NMAX];
for(int i=0;i<N;++i){
cin >> v[i];
}
comb_table(N);
sort(v,v+N);
reverse(v,v+N);
R max_average=0.0;
for(int i=0;i<A;++i){
max_average+=v[i];
}
max_average/=A;
int a_th_val_num=0,a_th_val_pos=0;
for(int i=0;i<N;++i){
if(v[i]==v[A-1]){
a_th_val_num++;
if(i<A){
a_th_val_pos++;
}
}
}
ll cnt=0LL;
if(a_th_val_pos==A){
for(a_th_val_pos=A;a_th_val_pos<=B;++a_th_val_pos){
cnt+=C[a_th_val_num][a_th_val_pos];
}
}else{
cnt+=C[a_th_val_num][a_th_val_pos];
}
cout.precision(20);
cout << fixed << max_average << endl;
cout << cnt << endl;
return 0;
}
| a.cc: In function 'int main()':
a.cc:21:2: error: 'cin' was not declared in this scope
21 | cin >> N >> A >> B;
| ^~~
a.cc:31:2: error: 'sort' was not declared in this scope; did you mean 'short'?
31 | sort(v,v+N);
| ^~~~
| short
a.cc:32:2: error: 'reverse' was not declared in this scope
32 | reverse(v,v+N);
| ^~~~~~~
a.cc:59:2: error: 'cout' was not declared in this scope
59 | cout.precision(20);
| ^~~~
a.cc:60:10: error: 'fixed' was not declared in this scope
60 | cout << fixed << max_average << endl;
| ^~~~~
a.cc:60:34: error: 'endl' was not declared in this scope
60 | cout << fixed << max_average << endl;
| ^~~~
|
s685852627 | p03773 | C++ | #include <iostream>
#include <algorithm>
using namespace std;
int main(){
int n, m, a[50], b[50], c[50], d[50];
cin >> n >> m;
for(int i = 0; i < n; i++)cin >> a[i] >> b[i];
for(int i = 0; i < m; i++)cin >> c[i] >> d[i];
for(int i = 0; i < n; i++){
int mindist = 300000000;
int mini = -1;
for(int cpi = 0; cpi < m; cpi++){
int dist = abs(a[i] - c[cpi]) + (b[i] - d[cpi])
if(mindist > dist){
mindist = dist;
mini = i;
}
}
cout << mini << endl;
}
} | a.cc: In function 'int main()':
a.cc:16:7: error: expected ',' or ';' before 'if'
16 | if(mindist > dist){
| ^~
|
s544135271 | p03773 | C++ | #include <iostream>
#include <algorithm>
using namespace std;
int main(){
int n, m, a[50], b[50], c[50], d[50];
cin >> n >> m;
for(int i = 0; i < n; i++)cin >> a[i] >> b[i];
for(int i = 0; i < m; i++)cin >> c[i] >> d[i];
for(int s = 0; s < n; s++){
int mindist = 300000000;
int mini = -1;
for(int cpi = 0; cpi < m; cpi++){
int dist = abs(a[i] - c[cpi]) + (b[i] - d[cpi])
if(mindist > dist){
mindist = dist;
mini = i;
}
}
cout << mini << endl;
}
} | a.cc: In function 'int main()':
a.cc:15:24: error: 'i' was not declared in this scope
15 | int dist = abs(a[i] - c[cpi]) + (b[i] - d[cpi])
| ^
|
s548381096 | p03773 | C++ | a, b = (int(i) for i in input().split())
print (a+b)%24 | a.cc:1:1: error: 'a' does not name a type
1 | a, b = (int(i) for i in input().split())
| ^
|
s318511804 | p03773 | C++ | a, b=map(int, input().split())
c=a+b
if c<24:
print (c)
elif c>=24:
print (c-24)
| a.cc:1:1: error: 'a' does not name a type
1 | a, b=map(int, input().split())
| ^
|
s213840027 | p03773 | Java | import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
public class beginner057 {
public static void main(String[]args)throws IOException{
BufferedReader br=
new BufferedReader(new InputStreamReader(System.in));
String str1=br.readLine();
String[] str2 = str1.split(" ");
int time=Integer.parseInt(str2[0])+Integer.parseInt(str2[1]);
if(time>=24){
time=time-24;
}
System.out.println(time);
}
}
| Main.java:6: error: class beginner057 is public, should be declared in a file named beginner057.java
public class beginner057 {
^
1 error
|
s603450058 | p03773 | Java | import java.util.Scanner;
public class Main{
public static void main(String[] args){
Scanner sc = new Scanner(System.in);
int a = sc.nextInt();
int b = sc.nextInt();
System.our.println((a+b)%24);
}
} | Main.java:7: error: cannot find symbol
System.our.println((a+b)%24);
^
symbol: variable our
location: class System
1 error
|
s241613460 | p03773 | Java | import java.util.Scanner;
public class Main{
public static void main(String[] args){
Scanner sc = new Scanner(System.in);
int a = sc.nextInt();
int b = sc.nextInt();
System.our.println((a+b)%24)
}
} | Main.java:7: error: ';' expected
System.our.println((a+b)%24)
^
1 error
|
s872563438 | p03773 | C++ | A,B = map(int, input().split())
print((A+B)%24) | a.cc:1:1: error: 'A' does not name a type
1 | A,B = map(int, input().split())
| ^
|
s136147930 | p03773 | C | #include <stdio.h>
int abs(int j)
{
return (j>0) ? j : -j;
}
int main()
{
int N, M, i, j;
int a[50], b[50], c[50], d[50],;
int p[50] = {0};
scanf("%d %d", &N, &M);
for(i=0; i<N; i++)
{
scanf("%d %d", &a[i], &b[i]);
}
for(j=0; j<M; j++)
{
scanf("%d %d", &c[j], &d[j]);
}
for(i=0; i<N; i++)
{
for(j=0; j<M; j++)
{
if(abs(a[i] - c[j]) + abs(b[i] - d[j]) < abs(a[i] - c[p[i]]) + abs(b[i] - d[p[i]])
{
p[i] = j;
}
}
printf("%d\n", p[i]);
}
} | main.c: In function 'main':
main.c:11:36: error: expected identifier or '(' before ';' token
11 | int a[50], b[50], c[50], d[50],;
| ^
main.c:30:96: error: expected ')' before '{' token
30 | if(abs(a[i] - c[j]) + abs(b[i] - d[j]) < abs(a[i] - c[p[i]]) + abs(b[i] - d[p[i]])
| ~ ^
| )
31 | {
| ~
main.c:34:10: error: expected expression before '}' token
34 | }
| ^
|
s483717833 | p03773 | Java | import java.util.*;
public class Main {
public static void main(String[] args){
Scanner sc = new Scanner(System.in);
// 整数の入力
int a = sc.nextInt();
int b = sc.nextInt();
int ans
if(a+b<24){
ans=a+b-24;
}else{
ans=a+b;
}
System.out.println(ans);
}
}
| Main.java:8: error: ';' expected
int ans
^
1 error
|
s974459831 | p03773 | C++ | print(A+B%24) | a.cc:1:6: error: expected constructor, destructor, or type conversion before '(' token
1 | print(A+B%24)
| ^
|
s387670131 | p03773 | Java | import java.util.Scanner;
public class RemainingTime {
public static void main(String[] args) {
// input
Scanner scan = new Scanner(System.in);
int a = scan.nextInt();
int b = scan.nextInt();
scan.close();
int res = (a + b) % 24;
// output
System.out.println(res);
}
} | Main.java:3: error: class RemainingTime is public, should be declared in a file named RemainingTime.java
public class RemainingTime {
^
1 error
|
s296467803 | p03773 | Java | import java.util.*;
public class Main {
public static void main(String[] args) {
Scanner sc = Scanner(System.in);
int n = Integer.parseInt(sc.next());
int m = Integer.parseInt(sc.next());
System.out.println((n + m) % 24);
sc.close();
}
} | Main.java:5: error: cannot find symbol
Scanner sc = Scanner(System.in);
^
symbol: method Scanner(InputStream)
location: class Main
1 error
|
s760929359 | p03773 | C++ | import java.util.*;
public class Main {
public static void main(String[] args){
Scanner sc = new Scanner(System.in);
int A = sc.nextInt();
int B = sc.nextInt();
int C=(A+B)%24;
System.out.println(C);
sc.close();
}
} | 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:2:1: error: expected unqualified-id before 'public'
2 | public class Main {
| ^~~~~~
|
s857840500 | p03773 | C++ | #include <iostream>
#include <stdint>
using namespace std;
int main()
{
int_least32_t a, b;
cin >> a >> b;
if(a + b > 24) {
cout << a + b - 24 << endl;
}
else {
cout << a + b << endl;
}
} | a.cc:2:10: fatal error: stdint: No such file or directory
2 | #include <stdint>
| ^~~~~~~~
compilation terminated.
|
s860154584 | p03773 | C | #include<stdio.h>
#include<math.h>
#include<stdlib.h>
#include<string.h>
int main(void)
{
int i, num, rem,min,len;
double lim;
char wln[13];
//整数Nの入力
scanf("%d", &num);
lim = sqrt(num)-1.0;
min = 11;
for (i = num; i >lim; i--) {
rem = num%i;
if (rem == 0) {
itoa(i, wln, 10);
len= strlen(wln);
if (len < min) {
min = len;
}
}
}
printf("%d", min);
return 0;
} | main.c: In function 'main':
main.c:21:25: error: implicit declaration of function 'itoa' [-Wimplicit-function-declaration]
21 | itoa(i, wln, 10);
| ^~~~
|
s949291799 | p03773 | Java | import java.util.Scanner;
public class Main{
public static void main(String[] args){
int a, b,time;
Scanner sc = new Scanner();
a = sc.nextInt();
b = sc.nextInt();
time = (a+b) % 24;
System.out.println(time);
}
}
| Main.java:6: error: no suitable constructor found for Scanner(no arguments)
Scanner sc = new Scanner();
^
constructor Scanner.Scanner(Readable,Pattern) is not applicable
(actual and formal argument lists differ in length)
constructor Scanner.Scanner(Readable) is not applicable
(actual and formal argument lists differ in length)
constructor Scanner.Scanner(InputStream) is not applicable
(actual and formal argument lists differ in length)
constructor Scanner.Scanner(InputStream,String) is not applicable
(actual and formal argument lists differ in length)
constructor Scanner.Scanner(InputStream,Charset) is not applicable
(actual and formal argument lists differ in length)
constructor Scanner.Scanner(File) is not applicable
(actual and formal argument lists differ in length)
constructor Scanner.Scanner(File,String) is not applicable
(actual and formal argument lists differ in length)
constructor Scanner.Scanner(File,Charset) is not applicable
(actual and formal argument lists differ in length)
constructor Scanner.Scanner(File,CharsetDecoder) is not applicable
(actual and formal argument lists differ in length)
constructor Scanner.Scanner(Path) is not applicable
(actual and formal argument lists differ in length)
constructor Scanner.Scanner(Path,String) is not applicable
(actual and formal argument lists differ in length)
constructor Scanner.Scanner(Path,Charset) is not applicable
(actual and formal argument lists differ in length)
constructor Scanner.Scanner(String) is not applicable
(actual and formal argument lists differ in length)
constructor Scanner.Scanner(ReadableByteChannel) is not applicable
(actual and formal argument lists differ in length)
constructor Scanner.Scanner(ReadableByteChannel,String) is not applicable
(actual and formal argument lists differ in length)
constructor Scanner.Scanner(ReadableByteChannel,Charset) is not applicable
(actual and formal argument lists differ in length)
1 error
|
s219476939 | p03773 | Java | public class Main{
public static void main(String[] args){
int a, b,time;
Scanner sc = new Scanner();
a = sc.nextInt();
b = sc.nextInt();
time = (a+b) % 24;
System.out.println(time);
}
}
| Main.java:4: error: cannot find symbol
Scanner sc = new Scanner();
^
symbol: class Scanner
location: class Main
Main.java:4: error: cannot find symbol
Scanner sc = new Scanner();
^
symbol: class Scanner
location: class Main
2 errors
|
s068604611 | p03773 | Java | public class Main{
public static main(String[] args){
int a, b,time;
Scanner sc = new Scanner();
a = sc.nextInt();
b = sc.nextInt();
time = (a+b) % 24;
System.out.println(time);
}
}
| Main.java:2: error: invalid method declaration; return type required
public static main(String[] args){
^
1 error
|
s467956220 | p03773 | Java | import java.util.*;
import java.lang.*;
public class Main {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
int N = Integer.parseInt(sc.next());
int W = Integer.parseInt(sc.next());
int ans;
if(N+W>24) ans = Math.abs(24-(N+W));
else if(N+W==24) ans = 0;
else ans = N+W
System.out.println(ans);
}
} | Main.java:16: error: ';' expected
else ans = N+W
^
1 error
|
s102012413 | p03773 | Java | import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.Arrays;
import java.util.Collections;
import java.util.HashMap;
import java.util.Map;
/**
* Created by Dell on 28-03-2017.
*/
public class TaskB {
static void solve(Long[] numbers, int a, int b) {
Arrays.sort(numbers, Collections.reverseOrder());
HashMap<Long, Integer> freqMap = new HashMap<>();
Arrays.stream(numbers).forEach(num -> freqMap.put(num, freqMap.getOrDefault(num, 0) + 1));
Map<Long, Integer> candidateMap = new HashMap<>();
for (int i = 0; i < a; i++) {
candidateMap.put(numbers[i], candidateMap.getOrDefault(numbers[i], 0) + 1);
}
long ways = 1L;
for (Map.Entry<Long, Integer> entry : candidateMap.entrySet()) {
ways *= freqMap.get(entry.getKey()) / entry.getValue();
}
double mean = 0.0d;
for (int i = 0; i < a; i++) {
mean += numbers[i];
}
mean /= a;
System.out.printf("%.06f\n", mean);
System.out.println(ways);
}
static Integer[] readIntArray(BufferedReader br) throws IOException {
String s = br.readLine();
String[] tokens = s.trim().split(" +");
Integer[] array = new Integer[tokens.length];
for (int i = 0; i < tokens.length; i++) {
array[i] = Integer.valueOf(tokens[i]);
}
return array;
}
static Long[] readLongArray(BufferedReader br) throws IOException {
String s = br.readLine();
String[] tokens = s.trim().split(" +");
Long[] array = new Long[tokens.length];
for (int i = 0; i < tokens.length; i++) {
array[i] = Long.valueOf(tokens[i]);
}
return array;
}
public static void main(String[] args) {
try (BufferedReader br = new BufferedReader(new InputStreamReader(System.in))) {
Integer[] nab = readIntArray(br);
Long[] array = readLongArray(br);
solve(array, nab[1], nab[2]);
} catch (IOException e) {
e.printStackTrace();
}
}
}
| Main.java:12: error: class TaskB is public, should be declared in a file named TaskB.java
public class TaskB {
^
1 error
|
s319119817 | p03773 | Java | public class Main {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
int a = sc.nextInt();
int b = sc.nextInt();
int c=(a+b)%24;
System.out.println(c);
}
} | Main.java:4: error: cannot find symbol
Scanner sc = new Scanner(System.in);
^
symbol: class Scanner
location: class Main
Main.java:4: error: cannot find symbol
Scanner sc = new Scanner(System.in);
^
symbol: class Scanner
location: class Main
2 errors
|
s574603910 | p03773 | Java | Scanner sc = new Scanner(System.in);
int a = sc.nextInt();
int b = sc.nextInt();
int c=(a+b)%24;
System.out.println(c); | Main.java:1: error: unnamed classes are a preview feature and are disabled by default.
Scanner sc = new Scanner(System.in);
^
(use --enable-preview to enable unnamed classes)
Main.java:5: error: class, interface, enum, or record expected
System.out.println(c);
^
2 errors
|
s036609157 | p03773 | Java | import java.util.Scanner;
public class A {
public static void main(String[] args) {
Scanner scanner = new Scanner(System.in);
int a = scanner.nextInt(),b = scanner.nextInt();
if(a + b > 24){
System.out.println((a + b) % 24);
}else if(a + b == 24){
System.out.println(0);
}else{
System.out.println(a + b);
}
}
}
| Main.java:3: error: class A is public, should be declared in a file named A.java
public class A {
^
1 error
|
s090831930 | p03773 | C++ | #include <cstdio>
using namespace std;
int a,b;
int main(){
scanf("%d %d",&a,&b);
printf("%d\n",(a+b)%24);
return 0;
} | a.cc:2:1: error: extended character is not valid in an identifier
2 |
| ^
a.cc:4:1: error: extended character is not valid in an identifier
4 |
| ^
a.cc:6:1: error: extended character is not valid in an identifier
6 |
| ^
a.cc:2:1: error: '\U000000a0' does not name a type
2 |
| ^
a.cc:4:1: error: '\U000000a0' does not name a type
4 |
| ^
a.cc:6:1: error: '\U000000a0' does not name a type
6 |
| ^
|
s258916880 | p03773 | C++ | #include <cstdio>
using namespace std;
int a,b;
int main(){
scanf("%d %d",&a,&b);
printf("%d\n",(a+b)%);
return 0;
}
| a.cc: In function 'int main()':
a.cc:9:21: error: expected primary-expression before ')' token
9 | printf("%d\n",(a+b)%);
| ^
|
s634730185 | p03773 | Java | import java.util.Scanner;
public class RemainingTime {
private Scanner scanner = new Scanner(System.in);
private void main() {
int currentHours = scanner.nextInt();
int contestBeginFor = scanner.nextInt();
System.out.println((currentHours + contestBeginFor) % 24);
}
public static void main(String[] args) {
RemainingTime clazz = new RemainingTime();
clazz.main();
}
} | Main.java:3: error: class RemainingTime is public, should be declared in a file named RemainingTime.java
public class RemainingTime {
^
1 error
|
s999988217 | p03773 | C++ | x,y = map(int, input().split(' '))
print((x+y)%24) | a.cc:1:1: error: 'x' does not name a type
1 | x,y = map(int, input().split(' '))
| ^
|
s354117179 | p03773 | Java | public class Main{
private static Scanner sc;
public static void main(String[] args) {
// TODO Auto-generated method stub
sc = new Scanner(System.in);
int A =sc.nextInt();
int B =sc.nextInt();
int K;
K=A+B;
if(K>=24){
K=K-24;
}
System.out.println(K);
}
}
| Main.java:2: error: cannot find symbol
private static Scanner sc;
^
symbol: class Scanner
location: class Main
Main.java:5: error: cannot find symbol
sc = new Scanner(System.in);
^
symbol: class Scanner
location: class Main
2 errors
|
s238987570 | p03773 | C++ | #include<iostream>
using namespace std;
void main() {
int a, b;
cin >> a >> b;
cout << (a + b) % 24 << endl;
} | a.cc:4:1: error: '::main' must return 'int'
4 | void main() {
| ^~~~
|
s736350071 | p03773 | C++ | #include<stdio.h>
int a ;
int b ;
void main() {
int x = a + b;
if (x >= 24) {
printf("%d\n", x - 24);
} printf("%d\n",x);
} | a.cc:4:1: error: '::main' must return 'int'
4 | void main() {
| ^~~~
|
s456657729 | p03773 | C++ | #include<stdio.h>
int a = 9;
int b = 12;
void main() {
int x = a + b;
if (x >= 24) {
printf("%d\n", x - 24);
} printf("%d\n",x);
} | a.cc:4:1: error: '::main' must return 'int'
4 | void main() {
| ^~~~
|
s764472688 | p03773 | C++ | #include<stdio.h>
int a = 9;
int b = 12;
void solve() {
int x = a + b;
if (x >= 24) {
printf("%d\n", x - 24);
} printf("%d\n",x);
} | /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
|
s409722305 | p03773 | C++ | a,b=gets.split.map &:to_i;p (a+b)%24 | a.cc:1:1: error: 'a' does not name a type
1 | a,b=gets.split.map &:to_i;p (a+b)%24
| ^
a.cc:1:29: error: expected constructor, destructor, or type conversion before '(' token
1 | a,b=gets.split.map &:to_i;p (a+b)%24
| ^
|
s691497858 | p03773 | C++ | #include <iostream>
using namespace std;
int main()
{
int a, b;
cin >> a >> b;
int ans;
ans = a + b;
cout << ans > 24 ? ans - 24 : ans << endl;
return 0;
} | a.cc: In function 'int main()':
a.cc:11:21: error: no match for 'operator>' (operand types are 'std::basic_ostream<char>' and 'int')
11 | cout << ans > 24 ? ans - 24 : ans << endl;
| ~~~~~~~~~~~ ^ ~~
| | |
| | int
| std::basic_ostream<char>
a.cc:11:21: note: candidate: 'operator>(int, int)' (built-in)
11 | cout << ans > 24 ? ans - 24 : ans << endl;
| ~~~~~~~~~~~~^~~~
a.cc:11:21: note: no known conversion for argument 1 from 'std::basic_ostream<char>' to 'int'
In file included from /usr/include/c++/14/string:48,
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_iterator.h:462:5: note: candidate: 'template<class _Iterator> constexpr bool std::operator>(const reverse_iterator<_Iterator>&, const reverse_iterator<_Iterator>&)'
462 | operator>(const reverse_iterator<_Iterator>& __x,
| ^~~~~~~~
/usr/include/c++/14/bits/stl_iterator.h:462:5: note: template argument deduction/substitution failed:
a.cc:11:23: note: 'std::basic_ostream<char>' is not derived from 'const std::reverse_iterator<_Iterator>'
11 | cout << ans > 24 ? ans - 24 : ans << endl;
| ^~
/usr/include/c++/14/bits/stl_iterator.h:507:5: note: candidate: 'template<class _IteratorL, class _IteratorR> constexpr bool std::operator>(const reverse_iterator<_Iterator>&, const reverse_iterator<_IteratorR>&)'
507 | operator>(const reverse_iterator<_IteratorL>& __x,
| ^~~~~~~~
/usr/include/c++/14/bits/stl_iterator.h:507:5: note: template argument deduction/substitution failed:
a.cc:11:23: note: 'std::basic_ostream<char>' is not derived from 'const std::reverse_iterator<_Iterator>'
11 | cout << ans > 24 ? ans - 24 : ans << endl;
| ^~
/usr/include/c++/14/bits/stl_iterator.h:1714:5: note: candidate: 'template<class _IteratorL, class _IteratorR> constexpr bool std::operator>(const move_iterator<_IteratorL>&, const move_iterator<_IteratorR>&)'
1714 | operator>(const move_iterator<_IteratorL>& __x,
| ^~~~~~~~
/usr/include/c++/14/bits/stl_iterator.h:1714:5: note: template argument deduction/substitution failed:
a.cc:11:23: note: 'std::basic_ostream<char>' is not derived from 'const std::move_iterator<_IteratorL>'
11 | cout << ans > 24 ? ans - 24 : ans << endl;
| ^~
/usr/include/c++/14/bits/stl_iterator.h:1774:5: note: candidate: 'template<class _Iterator> constexpr bool std::operator>(const move_iterator<_IteratorL>&, const move_iterator<_IteratorL>&)'
1774 | operator>(const move_iterator<_Iterator>& __x,
| ^~~~~~~~
/usr/include/c++/14/bits/stl_iterator.h:1774:5: note: template argument deduction/substitution failed:
a.cc:11:23: note: 'std::basic_ostream<char>' is not derived from 'const std::move_iterator<_IteratorL>'
11 | cout << ans > 24 ? ans - 24 : ans << endl;
| ^~
In file included from /usr/include/c++/14/bits/stl_algobase.h:64,
from /usr/include/c++/14/string:51:
/usr/include/c++/14/bits/stl_pair.h:1058:5: note: candidate: 'template<class _T1, class _T2> constexpr bool std::operator>(const pair<_T1, _T2>&, const pair<_T1, _T2>&)'
1058 | operator>(const pair<_T1, _T2>& __x, const pair<_T1, _T2>& __y)
| ^~~~~~~~
/usr/include/c++/14/bits/stl_pair.h:1058:5: note: template argument deduction/substitution failed:
a.cc:11:23: note: 'std::basic_ostream<char>' is not derived from 'const std::pair<_T1, _T2>'
11 | cout << ans > 24 ? ans - 24 : ans << endl;
| ^~
In file included from /usr/include/c++/14/bits/basic_string.h:47,
from /usr/include/c++/14/string:54:
/usr/include/c++/14/string_view:695:5: note: candidate: 'template<class _CharT, class _Traits> constexpr bool std::operator>(basic_string_view<_CharT, _Traits>, basic_string_view<_CharT, _Traits>)'
695 | operator> (basic_string_view<_CharT, _Traits> __x,
| ^~~~~~~~
/usr/include/c++/14/string_view:695:5: note: template argument deduction/substitution failed:
a.cc:11:23: note: 'std::basic_ostream<char>' is not derived from 'std::basic_string_view<_CharT, _Traits>'
11 | cout << ans > 24 ? ans - 24 : ans << endl;
| ^~
/usr/include/c++/14/string_view:702:5: note: candidate: 'template<class _CharT, class _Traits> constexpr bool std::operator>(basic_string_view<_CharT, _Traits>, __type_identity_t<basic_string_view<_CharT, _Traits> >)'
702 | operator> (basic_string_view<_CharT, _Traits> __x,
| ^~~~~~~~
/usr/include/c++/14/string_view:702:5: note: template argument deduction/substitution failed:
a.cc:11:23: note: 'std::basic_ostream<char>' is not derived from 'std::basic_string_view<_CharT, _Traits>'
11 | cout << ans > 24 ? ans - 24 : ans << endl;
| ^~
/usr/include/c++/14/string_view:710:5: note: candidate: 'template<class _CharT, class _Traits> constexpr bool std::operator>(__type_identity_t<basic_string_view<_CharT, _Traits> >, basic_string_view<_CharT, _Traits>)'
710 | operator> (__type_identity_t<basic_string_view<_CharT, _Traits>> __x,
| ^~~~~~~~
/usr/include/c++/14/string_view:710:5: note: template argument deduction/substitution failed:
a.cc:11:23: note: mismatched types 'std::basic_string_view<_CharT, _Traits>' and 'int'
11 | cout << ans > 24 ? ans - 24 : ans << endl;
| ^~
/usr/include/c++/14/bits/basic_string.h:3915:5: note: candidate: 'template<class _CharT, class _Traits, class _Alloc> bool std::operator>(const __cxx11::basic_string<_CharT, _Traits, _Allocator>&, const __cxx11::basic_string<_CharT, _Traits, _Allocator>&)'
3915 | operator>(const basic_string<_CharT, _Traits, _Alloc>& __lhs,
| ^~~~~~~~
/usr/include/c++/14/bits/basic_string.h:3915:5: note: template argument deduction/substitution failed:
a.cc:11:23: note: 'std::basic_ostream<char>' is not derived from 'const std::__cxx11::basic_string<_CharT, _Traits, _Allocator>'
11 | cout << ans > 24 ? ans - 24 : ans << endl;
| ^~
/usr/include/c++/14/bits/basic_string.h:3929:5: note: candidate: 'template<class _CharT, class _Traits, class _Alloc> bool std::operator>(const __cxx11::basic_string<_CharT, _Traits, _Allocator>&, const _CharT*)'
3929 | operator>(const basic_string<_CharT, _Traits, _Alloc>& __lhs,
| ^~~~~~~~
/usr/include/c++/14/bits/basic_string.h:3929:5: note: template argument deduction/substitution failed:
a.cc:11:23: note: 'std::basic_ostream<char>' is not derived from 'const std::__cxx11::basic_string<_CharT, _Traits, _Allocator>'
11 | cout << ans > 24 ? ans - 24 : ans << endl;
| ^~
/usr/include/c++/14/bits/basic_string.h:3942:5: note: candidate: 'template<class _CharT, class _Traits, class _Alloc> bool std::operator>(const _CharT*, const __cxx11::basic_string<_CharT, _Traits, _Allocator>&)'
3942 | operator>(const _CharT* __lhs,
| ^~~~~~~~
/usr/include/c++/14/bits/basic_string.h:3942:5: note: template argument deduction/substitution failed:
a.cc:11:23: note: mismatched types 'const _CharT*' and 'std::basic_ostream<char>'
11 | cout << ans > 24 ? ans - 24 : ans << endl;
| ^~
In file included from /usr/include/c++/14/bits/memory_resource.h:47,
from /usr/include/c++/14/string:68:
/usr/include/c++/14/tuple:2619:5: note: candidate: 'template<class ... _TElements, class ... _UElements> constexpr bool std::operator>(const tuple<_UTypes ...>&, const tuple<_Elements ...>&)'
2619 | operator>(const tuple<_TElements...>& __t,
| ^~~~~~~~
/usr/include/c++/14/tuple:2619:5: note: template argument deduction/substitution failed:
a.cc:11:23: note: 'std::basic_ostream<char>' is not derived from 'const std::tuple<_UTypes ...>'
11 | cout << ans > 24 ? ans - 24 : ans << endl;
| ^~
a.cc:11:43: error: invalid operands of types 'int' and '<unresolved overloaded function type>' to binary 'operator<<'
11 | cout << ans > 24 ? ans - 24 : ans << endl;
| ~~~~^~~~~~~
|
s798819492 | p03773 | C++ | #include <iostream>
using namespace std;
int main(){
int a, b;
cin << a << b;
int c = a + b;
if(c >= 24) c = c - 24;
cout >> c >> endl;
return 0;
} | a.cc: In function 'int main()':
a.cc:7:13: error: no match for 'operator<<' (operand types are 'std::istream' {aka 'std::basic_istream<char>'} and 'int')
7 | cin << a << b;
| ~~~ ^~ ~
| | |
| | int
| std::istream {aka std::basic_istream<char>}
a.cc:7:13: note: candidate: 'operator<<(int, int)' (built-in)
7 | cin << a << b;
| ~~~~^~~~
a.cc:7:13: 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:7:16: note: 'std::istream' {aka 'std::basic_istream<char>'} is not derived from 'std::basic_ostream<_CharT, _Traits>'
7 | cin << a << b;
| ^
/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:7:16: note: 'std::istream' {aka 'std::basic_istream<char>'} is not derived from 'std::basic_ostream<_CharT, _Traits>'
7 | cin << a << b;
| ^
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:7:9: note: cannot convert 'std::cin' (type 'std::istream' {aka 'std::basic_istream<char>'}) to type 'std::byte'
7 | cin << a << b;
| ^~~
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:7:16: note: 'std::istream' {aka 'std::basic_istream<char>'} is not derived from 'std::basic_ostream<_CharT, _Traits>'
7 | cin << a << b;
| ^
/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:7:16: note: 'std::istream' {aka 'std::basic_istream<char>'} is not derived from 'std::basic_ostream<_CharT, _Traits>'
7 | cin << a << b;
| ^
/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:7:16: note: 'std::istream' {aka 'std::basic_istream<char>'} is not derived from 'std::basic_ostream<_CharT, _Traits>'
7 | cin << a << b;
| ^
/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:7:16: note: 'std::istream' {aka 'std::basic_istream<char>'} is not derived from 'std::basic_ostream<char, _Traits>'
7 | cin << a << b;
| ^
/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:7:16: note: 'std::istream' {aka 'std::basic_istream<char>'} is not derived from 'std::basic_ostream<char, _Traits>'
7 | cin << a << b;
| ^
/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:7:16: note: 'std::istream' {aka 'std::basic_istream<char>'} is not derived from 'std::basic_ostream<char, _Traits>'
7 | cin << a << b;
| ^
/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:7:16: note: 'std::istream' {aka 'std::basic_istream<char>'} is not derived from 'std::basic_ostream<_CharT, _Traits>'
7 | cin << a << b;
| ^
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:7:16: note: 'std::istream' {aka 'std::basic_istream<char>'} is not derived from 'std::basic_ostream<_CharT, _Traits>'
7 | cin << a << b;
| ^
/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:7:16: note: 'std::istream' {aka 'std::basic_istream<char>'} is not derived from 'std::basic_ostream<char, _Traits>'
7 | cin << a << b;
| ^
/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:7:16: note: 'std::istream' {aka 'std::basic_istream<char>'} is not derived from 'std::basic_ostream<char, _Traits>'
7 | cin << a << b;
| ^
/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:7:16: note: 'std::istream' {aka 'std::basic_istream<char>'} is not derived from 'std::basic_ostream<char, _Traits>'
7 | cin << a << b;
| ^
/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 'template<class _Ostream, class _Tp> _Ostream&& std::operator<<(_Ostream&&, const _Tp&) [with _Ostream = std::basic_istream<char>&; _Tp = int]':
a.cc:7:9: required from here
7 | cin << a << b;
| ^
/usr/include/c++/14/ostream:810:5: error: no type named 'type' in 'struct std::enable_if<false, void>'
810 | operator<<(_Ostream&& __os, const _Tp& __x)
| ^~~~~~~~
a.cc:10:14: error: no match for 'operator>>' (operand types are 'std::ostream' {aka 'std::basic_ostream<char>'} and 'int')
10 | cout >> c >> endl;
| ~~~~ ^~ ~
| | |
| | int
| std::ostream {aka std::basic_ostream<char>}
a.cc:10:14: note: candidate: 'operator>>(int, int)' (built-in)
10 | cout >> c >> endl;
| |
s275483935 | p03773 | C | #include <stdio.h>
int main(){
int a, b;
scanf("%d %d",&a,&b);
prinft("%d¥n",(a+b)%24);
return 0;
} | main.c: In function 'main':
main.c:6:3: error: implicit declaration of function 'prinft'; did you mean 'printf'? [-Wimplicit-function-declaration]
6 | prinft("%d¥n",(a+b)%24);
| ^~~~~~
| printf
|
s213942112 | p03773 | C++ | import Control.Applicative
main = do
ss <- (map read . words) <$> getLine
putStrLn (sum ss `mod` 24) | a.cc:5:20: error: stray '`' in program
5 | putStrLn (sum ss `mod` 24)
| ^
a.cc:5:24: error: stray '`' in program
5 | putStrLn (sum ss `mod` 24)
| ^
a.cc:1:1: error: 'import' does not name a type
1 | import Control.Applicative
| ^~~~~~
a.cc:1:1: note: C++20 'import' only available with '-fmodules-ts'
|
s720538541 | p03773 | C | include<stdio.h>
int main(void){
int a,b;
scanf("%d %d",&a,&b);
int h;
h = (a + b) % 24;
printf("%d\n",h);
return 0;
} | main.c:1:8: error: expected '=', ',', ';', 'asm' or '__attribute__' before '<' token
1 | include<stdio.h>
| ^
|
s053679190 | p03773 | Java | public class Main {
public static void main(String[] args) {
Scanner s = new Scanner(System.in);
System.out.println((s.nextInt() + s.nextInt())%24);
}
} | Main.java:3: error: cannot find symbol
Scanner s = new Scanner(System.in);
^
symbol: class Scanner
location: class Main
Main.java:3: error: cannot find symbol
Scanner s = new Scanner(System.in);
^
symbol: class Scanner
location: class Main
2 errors
|
s001312105 | p03773 | C++ | #include<stdio.h>
#include<math.h>
int main()
{
int N;
scanf("%d",&N);
int A,B,i,least,f;
for(A=1;A<=N;A++)
{
if(N%A)
continue;
else
B=N/A;
if(A>=B)
{
while(A/pow(10,i)>1)
i++;
f=(int)(A/pow(10,i);
}
else
{
while(B/pow(10,i)>1)
i++;
f=(int)(B/pow(10,i);
}
if(least>f)
least=f;
}
printf("%d",least);
return 0;
} | a.cc: In function 'int main()':
a.cc:18:26: error: expected ')' before ';' token
18 | f=(int)(A/pow(10,i);
| ~ ^
| )
a.cc:24:26: error: expected ')' before ';' token
24 | f=(int)(B/pow(10,i);
| ~ ^
| )
|
s281944936 | p03773 | C++ | #include<stdio.h>
int main()
{
int a,b,c;
// 整数の入力
scanf("%d %d", &a,&b);
if (a+b=>24){c=a+b-24;}
else{c=a+b;}
printf("%d",c);
return 0;
}
| a.cc: In function 'int main()':
a.cc:7:13: error: expected primary-expression before '>' token
7 | if (a+b=>24){c=a+b-24;}
| ^
|
s386315513 | p03773 | C++ | #include<stdio.h>
int main()
{
int a,b,c;
// 整数の入力
scanf("%d %d", &a,&b);
if (a+b>24){c=a+b-24}
printf("%d",c);
return 0;
}
| a.cc: In function 'int main()':
a.cc:7:25: error: expected ';' before '}' token
7 | if (a+b>24){c=a+b-24}
| ^
| ;
|
s386221449 | p03773 | C++ |
#include <stdio.h>
#include <string.h>
#include <iostream>
#include <vector>
#include <math.h>
using namespace std;
// 問2
class cPOINT{
public:
long lnX;
long lnY;
cPOINT() { lnX = 0; lnY = 0; };
cPOINT& operator=(const cPOINT &obj);
cPOINT operator-(const cPOINT &obj);
double calc();
};
cPOINT& cPOINT::operator=(const cPOINT &obj)
{
lnX = obj.lnX;
lnY = obj.lnY;
return *this;
}
cPOINT cPOINT::operator-(const cPOINT &obj)
{
cPOINT cTmp;
cTmp.lnX = this->lnX - obj.lnX;
cTmp.lnY = this->lnY - obj.lnY;
return cTmp;
}
double cPOINT::calc()
{
double dbPowX = pow(lnX, 2);
double dbPowY = pow(lnY, 2);
return sqrt(dbPowX + dbPowY);
}
int main()
{
long lnCntN;
long lnCntM;
cin >> lnCntN;
cin >> lnCntM;
vector<cPOINT> vecN(lnCntN);
vector<cPOINT> vecM(lnCntM);
for (int i = 0; i < lnCntN; i++)
{
cPOINT stAdd;
cin >> stAdd.lnX;
cin >> stAdd.lnY;
vecN[i] = stAdd;
}
for (int i = 0; i < lnCntM; i++)
{
cPOINT stAdd;
cin >> stAdd.lnX;
cin >> stAdd.lnY;
vecM[i] = stAdd;
}
for (int i = 0; i < lnCntN; i++)
{
int nIdxM=0; // 1番近いチェックポイントデータのIndex;
double dbNearVal = LONG_MAX; // 1番近いチェックポイントまでの距離
for (int j=0; j < lnCntM; j++)
{
cPOINT cTmp = vecN[i] - vecM[j];
double dbVal = cTmp.calc();
if (dbVal < dbNearVal)
{
dbNearVal = dbVal;
nIdxM = j;
}
}
if (i == lnCntN-1)
cout << nIdxM + 1;
else
cout << nIdxM + 1 << endl;
}
return 0;
}
| a.cc: In function 'int main()':
a.cc:70:36: error: 'LONG_MAX' was not declared in this scope
70 | double dbNearVal = LONG_MAX; // 1番近いチェックポイントまでの距離
| ^~~~~~~~
a.cc:7:1: note: 'LONG_MAX' is defined in header '<climits>'; this is probably fixable by adding '#include <climits>'
6 | #include <math.h>
+++ |+#include <climits>
7 | using namespace std;
|
s068914809 | p03773 | C++ | #include<stdio.h>
int main(){
int a,b;
scanf("%d %d",&a,&b);
printf("%d\n",(a+b)%24);j
return(0);
}
| a.cc: In function 'int main()':
a.cc:5:27: error: 'j' was not declared in this scope
5 | printf("%d\n",(a+b)%24);j
| ^
|
s552293605 | p03773 | C++ | #include <iostream>
using namespace std;
int main() {
int A, B;
cin >> A >> B;
if ( ( A + B ) < 24 ) cout << A + B << endl;
else cout << (A + B) - 24 enld;
return 0;
} | a.cc: In function 'int main()':
a.cc:9:34: error: expected ';' before 'enld'
9 | else cout << (A + B) - 24 enld;
| ^~~~~
| ;
|
s423991752 | p03773 | C | #include<stdio.h>
int degits(long long a){
if(a<10) return 1;
return 1+degit(a/10);
}
int F(long long a,long long b){
int ad,bd;
ad=degits(a);
bd=degits(b);
return ((ad>bd)?ad:bd);
}
int main(int argc, char const *argv[]){
long long n,i;
int min;
scanf("%lld",&n);
min=degits(n);
for(i=2;i*i<=n;i++){
if(n%i==0){
min=(F(i,n/i)<min)?F(i,n/i):min;
}
}
printf("%d",min)
return 0;
} | main.c: In function 'degits':
main.c:5:18: error: implicit declaration of function 'degit'; did you mean 'degits'? [-Wimplicit-function-declaration]
5 | return 1+degit(a/10);
| ^~~~~
| degits
main.c: In function 'main':
main.c:25:25: error: expected ';' before 'return'
25 | printf("%d",min)
| ^
| ;
26 | return 0;
| ~~~~~~
|
s385327487 | p03773 | Java | import java.util.*;
class Main{
public static void main(String[]args){
Scanner cin=new Scanner(System.in);
int result;
int nowT=Integer.paseInt(cin.next());
int addT=Integer.paseInt(cin.next());
if(nowT+addT>23){
result = nowT+addT-24;
}else{
result = nowT+addT;
}
System.out.println(result);
}
} | Main.java:7: error: cannot find symbol
int nowT=Integer.paseInt(cin.next());
^
symbol: method paseInt(String)
location: class Integer
Main.java:8: error: cannot find symbol
int addT=Integer.paseInt(cin.next());
^
symbol: method paseInt(String)
location: class Integer
2 errors
|
s059571533 | p03773 | Java | import java.util.*;
class Main{
public static void main(String[]args){
Scanner cin=new Scanner(System.in);
int result;
int nowT=Integer.paserInt(cin.next());
int addT=Integer.paserInt(cin.next());
if(nowT+addT>23){
result = nowT+addT-24;
}else{
result = nowT+addT;
}
System.out.println(result);
}
} | Main.java:7: error: cannot find symbol
int nowT=Integer.paserInt(cin.next());
^
symbol: method paserInt(String)
location: class Integer
Main.java:8: error: cannot find symbol
int addT=Integer.paserInt(cin.next());
^
symbol: method paserInt(String)
location: class Integer
2 errors
|
s584333167 | p03773 | C++ | #include<iostream>
int main(){
int a,b;
cin>>a>>b;
a=a+b;
if(a>23)a=a%24;
cout<<a<<"\n";
} | a.cc: In function 'int main()':
a.cc:6:1: error: 'cin' was not declared in this scope; did you mean 'std::cin'?
6 | cin>>a>>b;
| ^~~
| 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:10:1: error: 'cout' was not declared in this scope; did you mean 'std::cout'?
10 | cout<<a<<"\n";
| ^~~~
| std::cout
/usr/include/c++/14/iostream:63:18: note: 'std::cout' declared here
63 | extern ostream cout; ///< Linked to standard output
| ^~~~
|
s955151580 | p03773 | C++ | #include<iostream>
int main(){
int a,b;
cin>>a>>b;
a=a+b;
if(a>=24)a=a%24;
cout<<a<<"\n";
} | a.cc: In function 'int main()':
a.cc:6:1: error: 'cin' was not declared in this scope; did you mean 'std::cin'?
6 | cin>>a>>b;
| ^~~
| 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:10:1: error: 'cout' was not declared in this scope; did you mean 'std::cout'?
10 | cout<<a<<"\n";
| ^~~~
| std::cout
/usr/include/c++/14/iostream:63:18: note: 'std::cout' declared here
63 | extern ostream cout; ///< Linked to standard output
| ^~~~
|
s895752444 | p03773 | Java | import java.util.*;
class Main{
public static void main(String[]args){
Scanner cin=new Scanner(System.in);
int nowT;
int addT;
int result;
nowT=Integer.paserInt(cin.next());
addT=Integer.paserInt(cin.next());
if(nowT+addT>23){
result = nowT+addT-24;
}else{
result = nowT+addT;
}
System.out.println(result);
}
} | Main.java:8: error: cannot find symbol
nowT=Integer.paserInt(cin.next());
^
symbol: method paserInt(String)
location: class Integer
Main.java:9: error: cannot find symbol
addT=Integer.paserInt(cin.next());
^
symbol: method paserInt(String)
location: class Integer
2 errors
|
s821101492 | p03773 | C++ | #include<iostream>
int main(){
int a,b;
cin>>a>>b;
a=a+b;
if(a>24)a=a%24;
cout<<a<<"\n";
} | a.cc: In function 'int main()':
a.cc:6:1: error: 'cin' was not declared in this scope; did you mean 'std::cin'?
6 | cin>>a>>b;
| ^~~
| 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:10:1: error: 'cout' was not declared in this scope; did you mean 'std::cout'?
10 | cout<<a<<"\n";
| ^~~~
| std::cout
/usr/include/c++/14/iostream:63:18: note: 'std::cout' declared here
63 | extern ostream cout; ///< Linked to standard output
| ^~~~
|
s505402606 | p03773 | Java | import java.util.*;
public class Q1 {
public static void main(String[] args) {
Scanner scanner = new Scanner(System.in);
String[] input = scanner.nextLine().trim().split(" ");
int a = Integer.parseInt(input[0]);
int b = Integer.parseInt(input[1]);
System.out.println((a + b) % 24);
}
} | Main.java:3: error: class Q1 is public, should be declared in a file named Q1.java
public class Q1 {
^
1 error
|
s578596849 | p03773 | C++ | #include <iostream>
using namespace std;
int main(void){
int a,b;
cin>>a>>b;
cout<<(a+b)%24
}
| a.cc: In function 'int main()':
a.cc:6:19: error: expected ';' before '}' token
6 | cout<<(a+b)%24
| ^
| ;
7 | }
| ~
|
s686442029 | p03773 | Java |
import java.io.*;
import java.util.*;
public class TestClass {
static PrintWriter out = new PrintWriter(System.out);
public static void main(String[] args) throws Exception{
BufferedReader in = new BufferedReader(new InputStreamReader(System.in));
String s[] = in.readLine().split(" ");
int a = Integer.parseInt(s[0]);
int b = Integer.parseInt(s[1]);
out.println((a+b)%24);
out.close();
}
}
| Main.java:5: error: class TestClass is public, should be declared in a file named TestClass.java
public class TestClass {
^
1 error
|
s155056490 | p03773 | C++ |
#include <bits/stdc++.h>
using namespace std;
int main()
{
// freopen("in.txt","r",stdin);
int a, b;
while (~scanf("%d%d", &a, &b))
{
a += b;
a %= 24
printf("%d\n", a);
}
return 0;
}
| a.cc: In function 'int main()':
a.cc:12:13: error: expected ';' before 'printf'
12 | a %= 24
| ^
| ;
13 | printf("%d\n", a);
| ~~~~~~
|
s595671028 | p03773 | C++ | #include <bits/stdc++.h>
using namespace std;
int main() {
int a, b;
cin >> a >> b;
a += b;
if (a >= 24) {
a -= 24;
}
cout << a << endl;
} | a.cc:3:1: error: extended character is not valid in an identifier
3 |
| ^
a.cc:3:1: error: '\U000000a0' does not name a type
3 |
| ^
|
s749126535 | p03773 | C++ | #include <iostream>
using namespace std;
int a. b;
int main() {
cin >> a >> b;
cout << (a + b) % 24;
return 0;
} | a.cc:3:6: error: expected initializer before '.' token
3 | int a. b;
| ^
a.cc: In function 'int main()':
a.cc:5:10: error: 'a' was not declared in this scope
5 | cin >> a >> b;
| ^
a.cc:5:15: error: 'b' was not declared in this scope
5 | cin >> a >> b;
| ^
|
s195730441 | p03773 | C++ | #include "stdafx.h"
#include <iostream>
#include <math.h>
#include <string>
#include <algorithm>
using namespace std;
int main() {
int a, b;
cin >> a >> b;
if (a + b <= 23) cout << a + b << endl;
else cout << a + b - 24 << endl;
return 0;
} | a.cc:1:10: fatal error: stdafx.h: No such file or directory
1 | #include "stdafx.h"
| ^~~~~~~~~~
compilation terminated.
|
s638442505 | p03773 | C | #include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <limits.h>
#include <ctype.h>
int main() {
int A, B;
scanf("%d %d%*c", &A, &B);
printf("%d\n", (A + B) % 24;
return 0;
}
| main.c: In function 'main':
main.c:10:30: error: expected ')' before ';' token
10 | printf("%d\n", (A + B) % 24;
| ~ ^
| )
main.c:11:12: error: expected ';' before '}' token
11 | return 0;
| ^
| ;
12 | }
| ~
|
s934211756 | p03773 | C++ | #include "stdafx.h"
#include <iostream>
#include <math.h>
#include <string>
#include <algorithm>
using namespace std;
int main() {
int a, b;
cin >> a >> b;
if (a + b <= 23) cout << a + b << endl;
else cout << a + b - 24 << endl;;
return 0;
} | a.cc:1:10: fatal error: stdafx.h: No such file or directory
1 | #include "stdafx.h"
| ^~~~~~~~~~
compilation terminated.
|
s888091096 | p03773 | C++ | include <iostream>
#include <string>
#include <vector>
#include <utility>
#include <map>
#include <algorithm>
using namespace std;
int main()
{
int A, B;
cin >> A >> B;
cout << (A + B) % 24 << endl;
return 0;
}
| a.cc:1:1: error: 'include' does not name a type
1 | include <iostream>
| ^~~~~~~
In file included from /usr/include/c++/14/bits/char_traits.h:42,
from /usr/include/c++/14/string:42,
from a.cc:2:
/usr/include/c++/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
| |
s301484794 | p03773 | C++ | #include<iostream>
using namespace std;
int main(){
int a,b;cin>>a>>b>>;
cout<<(a+b)%24<<endl;
return 0;
} | a.cc: In function 'int main()':
a.cc:4:21: error: expected primary-expression before ';' token
4 | int a,b;cin>>a>>b>>;
| ^
|
s649974510 | p03773 | C++ | import java.io.*;
import java.util.*;
import java.math.*;
class Main {
InputStream is;
PrintWriter out;
void solve(){
//Enter code here
int n = ni() , m = ni();
while (m-- > 0) {
n += 1;
if (n == 25) n = 1;
}
out.println(n);
}
public static void main(String[] args) {
Main play = new Main();
play.run();
}
public void run(){
is = System.in;
out = new PrintWriter(System.out);
solve();
out.flush();
}
byte input[] = new byte[1024];
int len = 0,ptr = 0;
int readByte() {
if(ptr >= len){
ptr = 0;
try{
len = is.read(input);
} catch(IOException e){
throw new InputMismatchException();
}
if(len <= 0){
return -1;
}
}
return input[ptr++];
}
boolean isSpaceChar(int c) {
return !( c >= 33 && c <= 126 );
}
int skip(){
int b = readByte();
while(b != -1 && isSpaceChar(b)){
b = readByte();
}
return b;
}
char nc() {
return (char)skip();
}
String ns() {
int b = skip();
StringBuilder sb = new StringBuilder();
while(!isSpaceChar(b)){
sb.appendCodePoint(b);
b = readByte();
}
return sb.toString();
}
int ni() {
int n = 0,b = readByte();
boolean minus = false;
while(b != -1 && !( (b >= '0' && b <= '9') || b == '-')){
b = readByte();
}
if(b == '-'){
minus = true;
b = readByte();
}
while(b >= '0' && b <= '9'){
n = n * 10 + (b - '0');
b = readByte();
}
return minus ? -n : n;
}
long nl() {
long n = 0L;
int b = readByte();
boolean minus = false;
while(b != -1 && !( (b >= '0' && b <= '9') || b == '-')){
b = readByte();
}
if(b == '-'){
minus = true;
b = readByte();
}
while(b>='0' && b<='9'){
n = n * 10 + (b - '0');
b = readByte();
}
return minus ? -n : n;
}
double nd() {
return Double.parseDouble(ns());
}
float nf() {
return Float.parseFloat(ns());
}
int[] na(int n){
int a[] = new int[n];
for(int i = 0;i < n;i++){
a[i] = ni();
}
return a;
}
char[] ns(int n) {
char c[] = new char[n];
int i , b = skip();
for (i = 0;i < n;i++){
if (isSpaceChar(b)){
break;
}
c[i] = (char)b;
b = readByte();
}
return i == n ? c : Arrays.copyOf(c , i);
}
}
| a.cc:1:1: error: 'import' does not name a type
1 | import java.io.*;
| ^~~~~~
a.cc:1:1: note: C++20 'import' only available with '-fmodules-ts'
a.cc:2:1: error: 'import' does not name a type
2 | import java.util.*;
| ^~~~~~
a.cc:2:1: note: C++20 'import' only available with '-fmodules-ts'
a.cc:3:1: error: 'import' does not name a type
3 | import java.math.*;
| ^~~~~~
a.cc:3:1: note: C++20 'import' only available with '-fmodules-ts'
a.cc:7:5: error: 'InputStream' does not name a type
7 | InputStream is;
| ^~~~~~~~~~~
a.cc:8:5: error: 'PrintWriter' does not name a type
8 | PrintWriter out;
| ^~~~~~~~~~~
a.cc:19:11: error: expected ':' before 'static'
19 | public static void main(String[] args) {
| ^~~~~~~
| :
a.cc:19:29: error: 'String' has not been declared
19 | public static void main(String[] args) {
| ^~~~~~
a.cc:19:38: error: expected ',' or '...' before 'args'
19 | public static void main(String[] args) {
| ^~~~
a.cc:23:11: error: expected ':' before 'void'
23 | public void run(){
| ^~~~~
| :
a.cc:30:5: error: 'byte' does not name a type
30 | byte input[] = new byte[1024];
| ^~~~
a.cc:46:5: error: 'boolean' does not name a type; did you mean 'bool'?
46 | boolean isSpaceChar(int c) {
| ^~~~~~~
| bool
a.cc:60:5: error: 'String' does not name a type
60 | String ns() {
| ^~~~~~
a.cc:108:8: error: expected unqualified-id before '[' token
108 | int[] na(int n){
| ^
a.cc:115:9: error: expected unqualified-id before '[' token
115 | char[] ns(int n) {
| ^
a.cc:127:2: error: expected ';' after class definition
127 | }
| ^
| ;
a.cc: In member function 'void Main::solve()':
a.cc:17:9: error: 'out' was not declared in this scope
17 | out.println(n);
| ^~~
a.cc: In static member function 'static void Main::main(int*)':
a.cc:20:21: error: conversion from 'Main*' to non-scalar type 'Main' requested
20 | Main play = new Main();
| ^~~~~~~~~~
a.cc: In member function 'void Main::run()':
a.cc:24:9: error: 'is' was not declared in this scope
24 | is = System.in;
| ^~
a.cc:24:14: error: 'System' was not declared in this scope
24 | is = System.in;
| ^~~~~~
a.cc:25:9: error: 'out' was not declared in this scope
25 | out = new PrintWriter(System.out);
| ^~~
a.cc:25:19: error: expected type-specifier before 'PrintWriter'
25 | out = new PrintWriter(System.out);
| ^~~~~~~~~~~
a.cc: In member function 'int Main::readByte()':
a.cc:36:23: error: 'is' was not declared in this scope
36 | len = is.read(input);
| ^~
a.cc:36:31: error: 'input' was not declared in this scope; did you mean 'int'?
36 | len = is.read(input);
| ^~~~~
| int
a.cc:37:21: error: 'IOException' does not name a type
37 | } catch(IOException e){
| ^~~~~~~~~~~
a.cc:38:27: error: expected type-specifier before 'InputMismatchException'
38 | throw new InputMismatchException();
| ^~~~~~~~~~~~~~~~~~~~~~
a.cc:44:16: error: 'input' was not declared in this scope; did you mean 'int'?
44 | return input[ptr++];
| ^~~~~
| int
a.cc: In member function 'int Main::skip()':
a.cc:51:26: error: 'isSpaceChar' was not declared in this scope
51 | while(b != -1 && isSpaceChar(b)){
| ^~~~~~~~~~~
a.cc: In member function 'int Main::ni()':
a.cc:71:9: error: 'boolean' was not declared in this scope; did you mean 'bool'?
71 | boolean minus = false;
| ^~~~~~~
| bool
a.cc:76:13: error: 'minus' was not declared in this scope
76 | minus = true;
| ^~~~~
a.cc:83:16: error: 'minus' was not declared in this scope
83 | return minus ? -n : n;
| ^~~~~
a.cc: In member function 'long int Main::nl()':
a.cc:88:9: error: 'boolean' was not declared in this scope; did you mean 'bool'?
88 | boolean minus = false;
| ^~~~~~~
| bool
a.cc:93:13: error: 'minus' was not declared in this scope
93 | minus = true;
| ^~~~~
a.cc:100:16: error: 'minus' was not declared in this scope
100 | return minus ? -n : n;
| ^~~~~
a.cc: In member function 'double Main::nd()':
a.cc:103:16: error: 'Double' was not declared in this scope; did you mean 'double'?
103 | return Double.parseDouble(ns());
| ^~~~~~
| double
a.cc:103:35: error: 'ns' was not declared in this scope; did you mean 'nc'?
103 | return Double.parseDouble(ns());
| ^~
| nc
a.cc: In member function 'float Main::nf()':
a.cc:106:16: error: 'Float' was not declared in this scope; did you mean 'float'?
106 | return Float.parseFloat(ns());
| ^~~~~
| float
a.cc:106:33: error: 'ns' was not declared in this scope; did you mean 'nc'?
106 | return Float.parseFloat(ns());
| ^~
| nc
|
s426590332 | p03773 | C++ | a,b = map(int,input().split())
c = (a+b)%24
print(c) | a.cc:1:1: error: 'a' does not name a type
1 | a,b = map(int,input().split())
| ^
|
s601404129 | p03773 | C++ | print sum(map(int, raw_input().split()))%24 | a.cc:1:1: error: 'print' does not name a type; did you mean 'int'?
1 | print sum(map(int, raw_input().split()))%24
| ^~~~~
| int
|
s416708832 | p03773 | C++ | using System;
using System.Collections;
using System.Collections.Generic;
using System.Linq;
using System.Text;
class TEST{
static void Main(){
Sol mySol =new Sol();
mySol.Solve();
}
}
class Sol{
public void Solve(){
var d = ria();
Console.WriteLine(d.Sum() % 24);
}
public Sol(){
}
static String rs(){return Console.ReadLine();}
static int ri(){return int.Parse(Console.ReadLine());}
static long rl(){return long.Parse(Console.ReadLine());}
static double rd(){return double.Parse(Console.ReadLine());}
static String[] rsa(char sep=' '){return Console.ReadLine().Split(sep);}
static int[] ria(char sep=' '){return Array.ConvertAll(Console.ReadLine().Split(sep),e=>int.Parse(e));}
static long[] rla(char sep=' '){return Array.ConvertAll(Console.ReadLine().Split(sep),e=>long.Parse(e));}
static double[] rda(char sep=' '){return Array.ConvertAll(Console.ReadLine().Split(sep),e=>double.Parse(e));}
}
| a.cc:1:7: error: expected nested-name-specifier before 'System'
1 | using System;
| ^~~~~~
a.cc:2:7: error: expected nested-name-specifier before 'System'
2 | using System.Collections;
| ^~~~~~
a.cc:3:7: error: expected nested-name-specifier before 'System'
3 | using System.Collections.Generic;
| ^~~~~~
a.cc:4:7: error: expected nested-name-specifier before 'System'
4 | using System.Linq;
| ^~~~~~
a.cc:5:7: error: expected nested-name-specifier before 'System'
5 | using System.Text;
| ^~~~~~
a.cc:12:2: error: expected ';' after class definition
12 | }
| ^
| ;
a.cc: In static member function 'static void TEST::Main()':
a.cc:9:17: error: 'Sol' was not declared in this scope
9 | Sol mySol =new Sol();
| ^~~
a.cc:10:17: error: 'mySol' was not declared in this scope
10 | mySol.Solve();
| ^~~~~
a.cc: At global scope:
a.cc:15:15: error: expected ':' before 'void'
15 | public void Solve(){
| ^~~~~
| :
a.cc:20:15: error: expected ':' before 'Sol'
20 | public Sol(){
| ^~~~
| :
a.cc:24:16: error: 'String' does not name a type
24 | static String rs(){return Console.ReadLine();}
| ^~~~~~
a.cc:28:16: error: 'String' does not name a type
28 | static String[] rsa(char sep=' '){return Console.ReadLine().Split(sep);}
| ^~~~~~
a.cc:29:19: error: expected unqualified-id before '[' token
29 | static int[] ria(char sep=' '){return Array.ConvertAll(Console.ReadLine().Split(sep),e=>int.Parse(e));}
| ^
a.cc:30:20: error: expected unqualified-id before '[' token
30 | static long[] rla(char sep=' '){return Array.ConvertAll(Console.ReadLine().Split(sep),e=>long.Parse(e));}
| ^
a.cc:31:22: error: expected unqualified-id before '[' token
31 | static double[] rda(char sep=' '){return Array.ConvertAll(Console.ReadLine().Split(sep),e=>double.Parse(e));}
| ^
a.cc:32:2: error: expected ';' after class definition
32 | }
| ^
| ;
a.cc: In member function 'void Sol::Solve()':
a.cc:16:17: error: 'var' was not declared in this scope
16 | var d = ria();
| ^~~
a.cc:17:17: error: 'Console' was not declared in this scope
17 | Console.WriteLine(d.Sum() % 24);
| ^~~~~~~
a.cc:17:35: error: 'd' was not declared in this scope; did you mean 'rd'?
17 | Console.WriteLine(d.Sum() % 24);
| ^
| rd
a.cc: In static member function 'static int Sol::ri()':
a.cc:25:32: error: expected primary-expression before 'int'
25 | static int ri(){return int.Parse(Console.ReadLine());}
| ^~~
a.cc:25:32: error: expected ';' before 'int'
a.cc:25:35: error: expected unqualified-id before '.' token
25 | static int ri(){return int.Parse(Console.ReadLine());}
| ^
a.cc: In static member function 'static long int Sol::rl()':
a.cc:26:33: error: expected primary-expression before 'long'
26 | static long rl(){return long.Parse(Console.ReadLine());}
| ^~~~
a.cc:26:33: error: expected ';' before 'long'
a.cc:26:37: error: expected unqualified-id before '.' token
26 | static long rl(){return long.Parse(Console.ReadLine());}
| ^
a.cc: In static member function 'static double Sol::rd()':
a.cc:27:35: error: expected primary-expression before 'double'
27 | static double rd(){return double.Parse(Console.ReadLine());}
| ^~~~~~
a.cc:27:35: error: expected ';' before 'double'
a.cc:27:41: error: expected unqualified-id before '.' token
27 | static double rd(){return double.Parse(Console.ReadLine());}
| ^
|
s602576289 | p03773 | C++ | $include<bits/stdc++.h>
using namespace std;
#define r(i,n) for(int i=0;i<n;i++)
#define R(i,a,n) for(int i=a;i<n;i++)
int main(){
int n,a,b;
string s;
cin>>a>>b;
a+=b;
if(a>23)a-=23;
cout<<a<<endl;
} | a.cc:1:1: error: '$include' does not name a type
1 | $include<bits/stdc++.h>
| ^~~~~~~~
a.cc: In function 'int main()':
a.cc:7:3: error: 'string' was not declared in this scope
7 | string s;
| ^~~~~~
a.cc:8:3: error: 'cin' was not declared in this scope
8 | cin>>a>>b;
| ^~~
a.cc:11:3: error: 'cout' was not declared in this scope
11 | cout<<a<<endl;
| ^~~~
a.cc:11:12: error: 'endl' was not declared in this scope
11 | cout<<a<<endl;
| ^~~~
|
s511874443 | p03773 | C++ | #include <iostream>
#include <string>
#include <queue>
#include <stack>
#include <algorithm>
#include <list>
#include <vector>
#include <complex>
#include <utility>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <cmath>
#include <climits>
#include <bitset>
#include <ctime>
#include <map>
#include <unordered_map>
#include <set>
#include <unordered_set>
#include <cassert>
#include <cstddef>
#include <iomanip>
#include <numeric>
#include <tuple>
#include <sstream>
#include <fstream>
#include <chrono>
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 RREP(i, a) for(int (i) = (a) - 1; (i) >= 0; (i)--)
#define FORR(i, a, b) for(int (i) = (a) - 1; (i) >= (b); (i)--)
#define DEBUG(C) cerr << #C << " = " << C << endl;
using LL = long long;
using VI = vector<int>;
using VVI = vector<VI>;
using VL = vector<LL>;
using VVL = vector<VL>;
using VD = vector<double>;
using VVD = vector<VD>;
using PII = pair<int, int>;
using PDD = pair<double, double>;
using PLL = pair<LL, LL>;
using VPII = vector<PII>;
template<typename T> using VT = vector<T>;
#define ALL(a) begin((a)), end((a))
#define RALL(a) rbegin((a)), rend((a))
#define SORT(a) sort(ALL((a)))
#define RSORT(a) sort(RALL((a)))
#define REVERSE(a) reverse(ALL((a)))
#define MP make_pair
#define FORE(a, b) for (auto &&a : (b))
#define FIND(s, e) ((s).find(e) != (s).end())
#define EB emplace_back
template<typename T>inline bool chmax(T &a, T b){return (a < b ? a = b, true : false);}
template<typename T>inline bool chmin(T &a, T b){return (a > b ? a = b, true : false);}
const int INF = 1e9;
const int MOD = INF + 7;
const LL LLINF = 1e18;
const long double EPS = 1e-9;
int main() {
int a, b;
cin >> a > >b;
cout << (a + b) % 24 << endl;
}
| a.cc: In function 'int main()':
a.cc:67:20: error: expected primary-expression before '>' token
67 | cin >> a > >b;
| ^
|
s873201512 | p03774 | C++ | signed main()
{
//入力の高速化用のコード
//ios::sync_with_stdio(false);
//cin.tie(nullptr);
ll n, m;
cin >> n >> m;
ll a[n], b[n], c[m], d[m];
rep(i, n)
{
cin >> a[i] >> b[i];
}
rep(i, m)
{
cin >> c[i] >> d[i];
}
ll dif_min;
ll count;
rep(i, n)
{
dif_min = MOD;
count=-1;
rep(j, m)
{
if (dif_min > abs(a[i] - c[j]) + abs(b[i] - d[j]))
{
count = j + 1;
dif_min =abs(a[i] - c[j]) + abs(b[i] - d[j]);
}
}
cout << count << endl;
}
return 0;
} | a.cc: In function 'int main()':
a.cc:7:5: error: 'll' was not declared in this scope
7 | ll n, m;
| ^~
a.cc:8:5: error: 'cin' was not declared in this scope
8 | cin >> n >> m;
| ^~~
a.cc:8:12: error: 'n' was not declared in this scope
8 | cin >> n >> m;
| ^
a.cc:8:17: error: 'm' was not declared in this scope
8 | cin >> n >> m;
| ^
a.cc:9:7: error: expected ';' before 'a'
9 | ll a[n], b[n], c[m], d[m];
| ^~
| ;
a.cc:10:9: error: 'i' was not declared in this scope
10 | rep(i, n)
| ^
a.cc:10:5: error: 'rep' was not declared in this scope
10 | rep(i, n)
| ^~~
a.cc:18:7: error: expected ';' before 'dif_min'
18 | ll dif_min;
| ^~~~~~~~
| ;
a.cc:19:7: error: expected ';' before 'count'
19 | ll count;
| ^~~~~~
| ;
|
s724385038 | p03774 | C++ | #include <bits/stdc++.h>
#include <regex>
using namespace std;
//type
typedef long long int ll;
typedef pair<int, int> P;
//定数
#define INF 1000000000000 //10^12:∞
#define MOD 1000000007 //10^9+7:合同式の法
#define MAXR 100000 //10^5:配列の最大のrange
//略記
#define PB push_back //挿入
#define MP make_pair //pairのコンストラクタ
#define F first //pairの一つ目の要素
#define S second //pairの二つ目の要素
#define Z class
// input
#define INIT \
std::ios::sync_with_stdio(false); \
std::cin.tie(0);
#define VAR(type, ...) \
type __VA_ARGS__; \
MACRO_VAR_Scan(__VA_ARGS__);
template <typename T>
void MACRO_VAR_Scan(T &t)
{
std::cin >> t;
}
template <typename First, typename... Rest>
void MACRO_VAR_Scan(First &first, Rest &... rest)
{
std::cin >> first;
MACRO_VAR_Scan(rest...);
}
#define VEC_ROW(type, n, ...) \
std::vector<type> __VA_ARGS__; \
MACRO_VEC_ROW_Init(n, __VA_ARGS__); \
for (int w_ = 0; w_ < n; ++w_) \
{ \
MACRO_VEC_ROW_Scan(w_, __VA_ARGS__); \
}
template <typename T>
void MACRO_VEC_ROW_Init(int n, T &t)
{
t.resize(n);
}
template <typename First, typename... Rest>
void MACRO_VEC_ROW_Init(int n, First &first, Rest &... rest)
{
first.resize(n);
MACRO_VEC_ROW_Init(n, rest...);
}
template <typename T>
void MACRO_VEC_ROW_Scan(int p, T &t) { std::cin >> t[p]; }
template <typename First, typename... Rest>
void MACRO_VEC_ROW_Scan(int p, First &first, Rest &... rest)
{
std::cin >> first[p];
MACRO_VEC_ROW_Scan(p, rest...);
}
#define VEC(type, c, n) \
std::vector<type> c(n); \
for (auto &i : c) \
std::cin >> i;
// 2d vector: MAT(type, v, size, size);
#define MAT(type, c, m, n) \
std::vector<std::vector<type>> c(m, std::vector<type>(n)); \
for (auto &R : c) \
for (auto &w : R) \
std::cin >> w;
// output
template <typename T>
void MACRO_OUT(const T t) { std::cout << t; }
#define OUT(...) MACRO_OUT(__VA_ARGS__);
#define SP std::cout << " ";
#define TAB std::cout << "\t";
#define BR std::cout << "\n";
#define ENDL std::cout << std::endl;
#define YES() printf("YES\n")
#define NO() printf("NO\n")
#define isYES(x) printf("%s\n", (x) ? "YES" : "NO")
#define Yes() printf("Yes\n")
#define No() printf("No\n")
#define yes() printf("yes\n")
#define no() printf("no\n")
#define ln cout << '\n'
template <Z A>
void pr(A a)
{
cout << a;
ln;
}
template <Z A, Z B>
void pr(A a, B b)
{
cout << a << ' ' << b << endl;
}
// OTHER
// xの二乗を返す (関数テンプレート版)
template <typename T>
T square(T x) { return x * x; }
template <class T>
T GCD(T a, T b)
{
T r;
while (a)
r = b, b = a, a = r % a;
return b;
}
template <class T>
T LCM(T a, T b) { return a / GCD(a, b) * b; }
#define chmax(x, y) (x = max(x, y))
#define chmin(x, y) (x = min(x, y))
// loop
#define rep(i, n) for (ll i = 0; i < (n); i++)
#define repe(i, n) for (ll i = 0; i <= (n); i++)
#define repd(i, n) for (ll i = n; i > 0; i--)
#define repde(i, n) for (ll i = n; i >= 0; i--)
#define FOR(i, a, b) for (ll i = a; i < (b); i++)
#define FORE(i, a, b) for (ll i = a; i <= (b); i++)
#define FORD(i, a, b) for (ll i = a; i >= (b); i--)
#define FORA(i, I) for (const auto &i : I)
// vector
#define ALL(x) x.begin(), x.end()
#define ALLR(x) x.end(), x.begin()
typedef vector<int> vi;
typedef vector<string> vs;
typedef vector<bool> vb;
typedef vector<vi> vvi;
typedef vector<ll> vl;
#define ERASE(x) x.erase(unique(ALL(x)), x.end()); // erase same elements
bool yes = 0;
bool boo = 0;
int mx = -100000, mn = 100000;
int sum = 0;
int ans = 0;
int co = 0;
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
// cout << (conditon ? (result: == 1 ): (==0)) << endl; <- output result of if
// long long 型が表せる値の上限はおよそ 9 × 10^18 です.
// vector
// sum: accumulate(ALl(x),0)
// return last element: v.back();
// i & 1 は偶数なら 0に 奇数なら1に
// sort (descending order) : sort(arr, arr+n, greater<int>());
// sort indescending order: sort(ALL())-> reverse(ALL())
// (string): sort(all(t),greater<char>()); (string t )
int main()
{
VAR(int, n, m);
int a[n][2], b[m][2];
rep(i, n) rep(j, 2) cin >> a[i][j];
rep(i, m) rep(j, 2) cin >> b[i][j];
rep(i, n)
{
ans = i;
mn = 1000000000;
rep(j, m)
{
// pr(a[i][0], b[j][0]);
// pr(a[i][1], b[j][1]);
int n = abs(a[i][0] - b[j][0]) + abs(a[i][1] - b[j][1]);
// pr(n);
if (mn > n)
{
mn = n;
ans = j;
}x
}
pr(ans + 1);
}
return 0;
} | a.cc: In function 'int main()':
a.cc:185:14: error: 'x' was not declared in this scope
185 | }x
| ^
|
s310494761 | p03774 | Java | import java.util.*;
public class Main {
public static void main(String[] args) throws Exception{
Scanner scn = new Scanner(System.in);
int n = scn.nextInt();
int m = scn.nextInt();
int[][] a = new int[n][2];
for(int i=0; i<n; i++){
for(int j=0; j<2; j++){
a[i][j] = scn.nextInt();
}
}
int[][] c = new int[m][2];
for(int i=0; i<m; i++){
for(int j=0; j<2; j++){
c[i][j] = scn.nextInt();
}
}
for(int i=0; i<n; i++) {
int min = Math.pow(10, 8);
int min2 = 0;
for(int j=0; j<m; j++) {
int x = Math.abs(a[i][0]-c[j][0])+Math.abs(a[i][1]-c[j][1]);
if(x<min) {
min = x;
min2 = j;
}
}
System.out.println(min2 + 1);
}
}
}
| Main.java:21: error: incompatible types: possible lossy conversion from double to int
int min = Math.pow(10, 8);
^
1 error
|
s501398800 | p03774 | Java | import java.util.*;
public class Main {
public static void main(String[] args) throws Exception{
Scanner scn = new Scanner(System.in);
int n = scn.nextInt();
int m = scn.nextInt();
int[][] a = new int[n][2];
for(int i=0; i<n; i++){
for(int j=0; j<2; j++){
a[i][j] = scn.nextInt();
}
}
int[] c = new int[m][2];
for(int i=0; i<m; i++){
for(int j=0; j<2; j++){
c[i][j] = scn.nextInt();
}
}
for(int i=0; i<n; i++) {
int min = Math.pow(10, 8);
int min2 = 0;
for(int j=0; j<m; j++) {
int x = Math.abs(a[i][0]-c[j][0])+Math.abs(a[i][1]-c[j][1]);
if(x<min) {
min = x;
min2 = j;
}
}
System.out.println(min2 + 1);
}
}
}
| Main.java:14: error: incompatible types: int[][] cannot be converted to int[]
int[] c = new int[m][2];
^
Main.java:17: error: array required, but int found
c[i][j] = scn.nextInt();
^
Main.java:21: error: incompatible types: possible lossy conversion from double to int
int min = Math.pow(10, 8);
^
Main.java:24: error: array required, but int found
int x = Math.abs(a[i][0]-c[j][0])+Math.abs(a[i][1]-c[j][1]);
^
Main.java:24: error: array required, but int found
int x = Math.abs(a[i][0]-c[j][0])+Math.abs(a[i][1]-c[j][1]);
^
5 errors
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.