submission_id
stringlengths
10
10
problem_id
stringlengths
6
6
language
stringclasses
3 values
code
stringlengths
1
522k
compiler_output
stringlengths
43
10.2k
s429659988
p03796
Java
import java.util.*; public class Main{ public static void main(String[] args){ Scanner sc = new Scanner(System.in); 
int n = sc.nextInt(); int i; for(i = 1; i < n; i++){ int pow = pow * i; int ans = pow % (Math.pow(10.0,9.0)+7.0); } System.out.println(ans); } }
Main.java:5: error: illegal character: '\u2028' ?int n = sc.nextInt(); ^ 1 error
s182844483
p03796
Java
import java.util.*; public class Main{ public static void main(String[] args){ Scanner sc = new Scanner(System.in); 
int n = sc.nextInt(); int i; for(i = 1; i < n; i++){ int pow = pow * i; int ans = pow % (Math.pow(10.0,9.0)+7.0) } System.out.println(ans); } }
Main.java:5: error: illegal character: '\u2028' ?int n = sc.nextInt(); ^ Main.java:9: error: ';' expected int ans = pow % (Math.pow(10.0,9.0)+7.0) ^ 2 errors
s737308312
p03796
Java
public class Main{ public static void main(String[] args){ Scanner sc = new Scanner(System.in); 
int n = sc.nextInt(); int i; for(i = 1; i < n; i++){ int pow = pow * i; int ans = pow % (Math.pow(10.0,9.0)+7.0) } System.out.println(ans); } }
Main.java:4: error: illegal character: '\u2028' ?int n = sc.nextInt(); ^ Main.java:8: error: ';' expected int ans = pow % (Math.pow(10.0,9.0)+7.0) ^ 2 errors
s113432481
p03796
Java
public class Main{ public static void main(String[] args){ Scanner sc = new Scanner(System.in); 
int n = sc.nextInt(); int i; for(i = 1; i < n; i++){ int pow = pow * i; int ans = pow % (10^9+7); } System.out.println(ans); } }
Main.java:4: error: illegal character: '\u2028' ?int n = sc.nextInt(); ^ 1 error
s823858353
p03796
Java
public class Main{ public static void main(String[] args){ Scanner sc = new Scanner(System.in); 
int n = sc.nextInt();int i; for(i = 1; i < n; i++){ int pow = pow * i; int ans = pow % (10^9+7); } System.out.println(ans); } }
Main.java:4: error: illegal character: '\u2028' ?int n = sc.nextInt();int i; ^ 1 error
s281696087
p03796
C++
//簡易競プロテンプレ #include<bits/stdc++.h> using namespace std; int main(void){ int n; cin >> n; ll ans = 1; for(int i=1;i<=n;i++) ans = ans * i % 1000000007; cout << ans << endl; return 0; }
a.cc: In function 'int main()': a.cc:6:2: error: 'll' was not declared in this scope 6 | ll ans = 1; | ^~ a.cc:7:24: error: 'ans' was not declared in this scope; did you mean 'abs'? 7 | for(int i=1;i<=n;i++) ans = ans * i % 1000000007; | ^~~ | abs a.cc:8:10: error: 'ans' was not declared in this scope; did you mean 'abs'? 8 | cout << ans << endl; | ^~~ | abs
s109662480
p03796
Java
import java.util.*; public class ABC055_B { public static void main(String[] args){ Scanner sc=new Scanner(System.in); int N=sc.nextInt(),x=1; for(int i=1;i<=N;i++){ x=x*i; } System.out.println((int)(x%(Math.pow(10,9)+7))); } }
Main.java:2: error: class ABC055_B is public, should be declared in a file named ABC055_B.java public class ABC055_B { ^ 1 error
s417887537
p03796
Java
package spring21; public class ABC055_B { public static void main(String[] args){ int N=10,x=1; for(int i=1;i<=N;i++){ x=x*i; } System.out.println(x); } }
Main.java:3: error: class ABC055_B is public, should be declared in a file named ABC055_B.java public class ABC055_B { ^ 1 error
s109850868
p03796
C++
mod=10**9+7 n=gets.to_i puts (1..n).inject(1, :*)%mod
a.cc:4:7: error: too many decimal points in number 4 | puts (1..n).inject(1, :*)%mod | ^~~~ a.cc:1:1: error: 'mod' does not name a type 1 | mod=10**9+7 | ^~~
s580040140
p03796
Java
import java.util.Scanner; public class Main { public static void main (String[] args) { Scanner scanner = new Scanner(System.in); int N = scanner.nextInt(); int num = 1; int power = 1; for (int i = 1 ; i <= N ; i++){ num *= i; } power = num % (Math.pow(10,9) + 7); System.out.println(power); } }
Main.java:13: error: incompatible types: possible lossy conversion from double to int power = num % (Math.pow(10,9) + 7); ^ 1 error
s317967175
p03796
C++
#include<iostream> using namespace std; int main(){ int N; cin >> N; long long ans = 1: for(int i =1;j<=N;j++){ ans =ans*j%1000000007; } cout << ans << endl; return 0; }
a.cc: In function 'int main()': a.cc:7:22: error: expected ',' or ';' before ':' token 7 | long long ans = 1: | ^ a.cc:9:18: error: 'j' was not declared in this scope 9 | for(int i =1;j<=N;j++){ | ^
s602697288
p03796
Java
import java.util.*; public class Playground2 { public static void main(String[] args) { Scanner in = new Scanner(System.in); int n = in.nextInt(); long a = 1; for (long i = 1; i <= n; i++) { a = a * i % 1000000007; } System.out.println(a); } }
Main.java:3: error: class Playground2 is public, should be declared in a file named Playground2.java public class Playground2 { ^ 1 error
s078525918
p03796
C
#include <stdio.h> int main() { double power=1; double int,num; scanf("%lf",&num); for(i=1;i<=num;i++){ power=(power*i)%1000000007; }; printf("%f",power); return 0; }
main.c: In function 'main': main.c:5:16: error: two or more data types in declaration specifiers 5 | double int,num; | ^~~ main.c:5:19: error: expected identifier or '(' before ',' token 5 | double int,num; | ^ main.c:8:22: error: 'num' undeclared (first use in this function) 8 | scanf("%lf",&num); | ^~~ main.c:8:22: note: each undeclared identifier is reported only once for each function it appears in main.c:9:13: error: 'i' undeclared (first use in this function) 9 | for(i=1;i<=num;i++){ | ^
s796785804
p03796
C
#include <stdio.h> int main() { double power=1; int i,num; scanf("%d",&num); for(i=1;i<=num;i++){ power=(power*i)%1000000007; }; printf("%f",power); return 0; }
main.c: In function 'main': main.c:10:32: error: invalid operands to binary % (have 'double' and 'int') 10 | power=(power*i)%1000000007; | ~~~~~~~~~^ | | | double
s574234526
p03796
C
#include <stdio.h> int main() { double num,i; int power=1; scanf("%lf",&num); for(i=1;i<=num;i++){ power=(power*i)%1000000007; }; printf("%f",power); return 0; }
main.c: In function 'main': main.c:8:32: error: invalid operands to binary % (have 'double' and 'int') 8 | power=(power*i)%1000000007; | ~~~~~~~~~^ | | | double
s642878962
p03796
C
#include <stdio.h> int main() { double num,i; int power=1; scanf("%lf",&num); for(i=1;i<=num;i++){ power=(power*i)%1000000007; }; printf("%d",power); return 0; }
main.c: In function 'main': main.c:8:32: error: invalid operands to binary % (have 'double' and 'int') 8 | power=(power*i)%1000000007; | ~~~~~~~~~^ | | | double
s918705291
p03796
C
#include <stdio.h> int main() { double num,i; int power=1; scanif("%f",&num); for(i=1;i<=num;i++){ power=(power*i)%1000000007; }; printf("%d",power); return 0; }
main.c: In function 'main': main.c:6:9: error: implicit declaration of function 'scanif'; did you mean 'scanf'? [-Wimplicit-function-declaration] 6 | scanif("%f",&num); | ^~~~~~ | scanf main.c:8:32: error: invalid operands to binary % (have 'double' and 'int') 8 | power=(power*i)%1000000007; | ~~~~~~~~~^ | | | double
s790403909
p03796
C
#include <stdio.h> int main() { int num,i; int power=1; scanf("%d",&num); for(i=1;i<=num;i++){ power=(power*i)%1000000007 }; printf("%d",power); return 0; }
main.c: In function 'main': main.c:8:43: error: expected ';' before '}' token 8 | power=(power*i)%1000000007 | ^ | ; 9 | }; | ~
s574013183
p03796
C
#include <stdio.h> int main() { int num,i; int power=1; scanf("%d",&num); for(i=1;i<=num;i++){ power=power*i%1000000007 }; printf("%d",power); return 0; }
main.c: In function 'main': main.c:8:41: error: expected ';' before '}' token 8 | power=power*i%1000000007 | ^ | ; 9 | }; | ~
s821657739
p03796
C
#include <stdio.h> int main() { int num,i; int power=1; scanf("%d",&num); for(i=1;i<=num;i++){ power=power*i mod 1000000007 }; printf("%d",power%1000000007); return 0; }
main.c: In function 'main': main.c:8:30: error: expected ';' before 'mod' 8 | power=power*i mod 1000000007 | ^~~~ | ;
s026905788
p03796
C
#include <stdio.h> int main() { int num,ans,i; int power=1; scanf("%d",&num); for(i=1;i<=num;i++){ power=power*i; }; ans=power%1000000007 printf("%d",ans); return 0; }
main.c: In function 'main': main.c:11:29: error: expected ';' before 'printf' 11 | ans=power%1000000007 | ^ | ; 12 | 13 | printf("%d",ans); | ~~~~~~
s489233648
p03796
C
#include <stdio.h> int main(void) { int num,i; int power=1; scanf("%d",&num); for(i=1;i<=num;i++){ power=power*i; }; } #include<math.h> { printf("%d",(power%1000000007)); return 0; }
main.c:12:1: error: expected identifier or '(' before '{' token 12 | { | ^
s171538257
p03796
C
#include <stdio.h> int main() { int num,i; int power=1; scanf("%d",&num); for(i=1;i<=num;i++){ power=power*i; }; printf("%d\n",power%(10^9)+7; return 0; }
main.c: In function 'main': main.c:11:32: warning: result of '10^9' is 3; did you mean '1e9'? [-Wxor-used-as-pow] 11 | printf("%d\n",power%(10^9)+7; | ^ | --- | 1e main.c:11:30: note: you can silence this warning by using a hexadecimal constant (0xa rather than 10) 11 | printf("%d\n",power%(10^9)+7; | ^~ | 0xa main.c:11:37: error: expected ')' before ';' token 11 | printf("%d\n",power%(10^9)+7; | ~ ^ | ) main.c:12:18: error: expected ';' before '}' token 12 | return 0; | ^ | ; 13 | } | ~
s059163937
p03796
C
#include <stdio.h> int main() { int num,i; int power=1; scanf("%d",&num); for(i=1;i<=num;i++){ power=power*i; }; Printf("%d\n",power%1000000009); Return 0; }
main.c: In function 'main': main.c:11:9: error: implicit declaration of function 'Printf'; did you mean 'printf'? [-Wimplicit-function-declaration] 11 | Printf("%d\n",power%1000000009); | ^~~~~~ | printf main.c:12:9: error: 'Return' undeclared (first use in this function) 12 | Return 0; | ^~~~~~ main.c:12:9: note: each undeclared identifier is reported only once for each function it appears in main.c:12:15: error: expected ';' before numeric constant 12 | Return 0; | ^~ | ;
s230231676
p03796
C
#include <stdio.h> int main() { int num,i; int power=1; scanf("%d",&num); for(i=1;i<=num;i++){ power=power*i }; Printf("%d\n",power%1000000009); Return 0; }
main.c: In function 'main': main.c:8:30: error: expected ';' before '}' token 8 | power=power*i | ^ | ; 9 | }; | ~ main.c:11:9: error: implicit declaration of function 'Printf'; did you mean 'printf'? [-Wimplicit-function-declaration] 11 | Printf("%d\n",power%1000000009); | ^~~~~~ | printf main.c:12:9: error: 'Return' undeclared (first use in this function) 12 | Return 0; | ^~~~~~ main.c:12:9: note: each undeclared identifier is reported only once for each function it appears in main.c:12:15: error: expected ';' before numeric constant 12 | Return 0; | ^~ | ;
s410812834
p03796
C
#include <stdio.h> int main() { int num,i; int power=1; scanf("%d",&num); for(i=1;i<=num;i++){ power=power*i } Printf("%d\n",power%1000000009); Return 0; }
main.c: In function 'main': main.c:8:30: error: expected ';' before '}' token 8 | power=power*i | ^ | ; 9 | } | ~ main.c:11:9: error: implicit declaration of function 'Printf'; did you mean 'printf'? [-Wimplicit-function-declaration] 11 | Printf("%d\n",power%1000000009); | ^~~~~~ | printf main.c:12:9: error: 'Return' undeclared (first use in this function) 12 | Return 0; | ^~~~~~ main.c:12:9: note: each undeclared identifier is reported only once for each function it appears in main.c:12:15: error: expected ';' before numeric constant 12 | Return 0; | ^~ | ;
s344123159
p03796
C++
#include <iostream> int main() { int N; std::cin >> N; int remainder = 1; for (int i = 1; i <= N; i++) { remainder *= i; remainder = remainder % (int)(7+1e+9) } std::cout << remainder << std::endl; return 0; }
a.cc: In function 'int main()': a.cc:9:40: error: expected ';' before '}' token 9 | remainder = remainder % (int)(7+1e+9) | ^ | ; 10 | } | ~
s279169893
p03796
Java
public class Main { public static int MOD = 1_000_000_000 + 7; public static void main(String[] args) { Scanner sc = new Scanner(System.in); int n = sc.nextInt(); long power = 1; for(int i = 1; i <= n; i++) { power *= i; power %= MOD; } System.out.println(power); } }
Main.java:5: error: cannot find symbol Scanner sc = new Scanner(System.in); ^ symbol: class Scanner location: class Main Main.java:5: error: cannot find symbol Scanner sc = new Scanner(System.in); ^ symbol: class Scanner location: class Main 2 errors
s803402436
p03796
C++
#include <iostream> #include <math.h> using namespace std; int main() { int N, pre_p = cur_p = 1; cin >> N; for (int i = 1; i < N; i++) { pre_p = cur_p; cur_p = pre_p * i; } cout << cur_p % (pow(10,9) + 7); return 0; }
a.cc: In function 'int main()': a.cc:8:16: error: 'cur_p' was not declared in this scope 8 | int N, pre_p = cur_p = 1; | ^~~~~
s507710297
p03796
C++
include<stdio.h> #define mod 1000000009 int main(void){ long long int N,i,ans=1; scanf("%lld",&N); for(i=1;i<=N;i++){ ans*=i; ans%=mod; } printf("%lld\n",ans); return 0; }
a.cc:1:1: error: 'include' does not name a type 1 | include<stdio.h> | ^~~~~~~
s990882690
p03796
C++
include<stdio.h> #define mod 1000000009 int main(void){ long long int N,i,ans=1; scanf("%lld",&N); for(i=1;i<=N;i++){ ans*=i; ans%=mod; } printf("%d\n",ans); return 0; }
a.cc:1:1: error: 'include' does not name a type 1 | include<stdio.h> | ^~~~~~~
s090992061
p03796
C++
#include <bits/stdc++.h> using namespace std; #define ll long long int #define MOD (ll)1e9+7 #define MAX(X,Y) ((X)>(Y)?(X):(Y)) #define MIN(X,Y) ((X)<(Y)?(X):(Y)) int fact(int x) { int res = 1; for(int i=1;i<=x;i++){ res *= i; res %= CCC; } return res; } int main() { int x; cin>>x; cout<<fact(x)<<endl; return 0; }
a.cc: In function 'int fact(int)': a.cc:14:16: error: 'CCC' was not declared in this scope 14 | res %= CCC; | ^~~
s085678995
p03796
C++
#include <bits/stdc++.h> using namespace std; #define ll long long int ll fact(int x) { ll res = 1; for(int i=1;i<=x;i++){ res *= i; while(res>1e9+7){ res-=(1e9+7); } } return res; } int main() { int x; cin>>x; cout<<fact(x)<<endl return 0; }
a.cc: In function 'int main()': a.cc:22:24: error: expected ';' before 'return' 22 | cout<<fact(x)<<endl | ^ | ; 23 | return 0; | ~~~~~~
s799955693
p03796
C++
#include<iostream> #include<math.h> using namespace std; int main() { long long p = 1; unsigned int n; cin >> n; for (unsigned int i = 1; i <= n; i++) { p *= i; } cout << p % long long(1e9 + 7) << endl; return 0; }
a.cc: In function 'int main()': a.cc:16:21: error: expected primary-expression before 'long' 16 | cout << p % long long(1e9 + 7) << endl; | ^~~~
s269771406
p03796
C++
#include <iostream> #include <cstdlib> #include <string> int amari(int N, int wari){ if (N == 1){ return 1; } return (N*amari(N-1))%wari; } int main(){ std::string line; std::getline(std::cin, line); int N = atoi(line.c_str()); std::cout << amari(N, 1000000000+7) << std::endl; return 0; }
a.cc: In function 'int amari(int, int)': a.cc:10:16: error: too few arguments to function 'int amari(int, int)' 10 | return (N*amari(N-1))%wari; | ~~~~~^~~~~ a.cc:5:5: note: declared here 5 | int amari(int N, int wari){ | ^~~~~
s602240552
p03796
C++
n = int(input()) ans = 1 mod = 1000000007 for i in range(1, n+1): ans = (ans * i) % mod print(ans)
a.cc:1:1: error: 'n' does not name a type 1 | n = int(input()) | ^
s180037129
p03796
C++
#include <iostream> #include <string> using namespace std; int main(){ int n; cin >> n; int m = 1e9+7; ll ans = 1LL; for(int i = 1; i <= n; i++){ ans *= i; ans = ans%m; } cout << ans << endl; }
a.cc: In function 'int main()': a.cc:8:5: error: 'll' was not declared in this scope 8 | ll ans = 1LL; | ^~ a.cc:10:9: error: 'ans' was not declared in this scope; did you mean 'abs'? 10 | ans *= i; | ^~~ | abs a.cc:13:13: error: 'ans' was not declared in this scope; did you mean 'abs'? 13 | cout << ans << endl; | ^~~ | abs
s961359029
p03796
C++
#include <iostream> #include<stdio.h> using namespace std; long long int modx(long int x,long int y); int main(void) { int N; cin >> N; long long int x = 1; for (int i = 0; i < N; i++) { x = modx(x,i+1); cout << x << endl; } getchar(); getchar(); } long long int modx(long long int x,long long int y) { long long int t=(x*y); t %= 1000000007; return t; }
/usr/bin/ld: /tmp/ccNmC2Ur.o: in function `main': a.cc:(.text+0x43): undefined reference to `modx(long, long)' collect2: error: ld returned 1 exit status
s664430648
p03796
C++
ude<stdio.h> #include<stdlib.h> int n,a,b,c; int main(void){ scanf("%d",&n); a = n; for(i == 0;i == n ;i++){ b = b + a*i; } c = b / (10*10*10*10*10*10*10*10*10 + 7); printf("%d",c); return 0; }
a.cc:1:1: error: 'ude' does not name a type 1 | ude<stdio.h> | ^~~ a.cc: In function 'int main()': a.cc:8:1: error: 'scanf' was not declared in this scope 8 | scanf("%d",&n); | ^~~~~ a.cc:10:5: error: 'i' was not declared in this scope 10 | for(i == 0;i == n ;i++){ | ^ a.cc:14:1: error: 'printf' was not declared in this scope 14 | printf("%d",c); | ^~~~~~ a.cc:3:1: note: 'printf' is defined in header '<cstdio>'; this is probably fixable by adding '#include <cstdio>' 2 | #include<stdlib.h> +++ |+#include <cstdio> 3 |
s516068600
p03796
C++
#include<stdio.h> #include<stdlib.h> int n,a,b,c; int main(void){ scanf("%d",&n); a = n for(i == 0;i == n ;i++){ b = b + a*i; } c = b / (10*10*10*10*10*10*10*10*10 + 7) printf("%d",c); return 0; }
a.cc: In function 'int main()': a.cc:9:6: error: expected ';' before 'for' 9 | a = n | ^ | ; 10 | for(i == 0;i == n ;i++){ | ~~~ a.cc:10:12: error: 'i' was not declared in this scope 10 | for(i == 0;i == n ;i++){ | ^ a.cc:13:41: error: expected ';' before 'printf' 13 | c = b / (10*10*10*10*10*10*10*10*10 + 7) | ^ | ; 14 | printf("%d",c); | ~~~~~~
s834839018
p03796
C
#include<stdio.h> #define mod 1000000007 int main() { int n = 0; long long ans = 1; scanf("%d", &n); for(int i = 1; i <= n; i++) { ans = (ans * i) % MOD; } printf("%ld\n", ans); return 0; }
main.c: In function 'main': main.c:10:27: error: 'MOD' undeclared (first use in this function) 10 | ans = (ans * i) % MOD; | ^~~ main.c:10:27: note: each undeclared identifier is reported only once for each function it appears in
s715448105
p03796
Java
import java.util.*; import java.io.*; public class TrsainingCamp{ public static final int MODULO= 1000000007; public static void main(String[] args){ Scanner sc = new Scanner(System.in); int n = sc.nextInt(); long power = 1; for(int i=1; i<=n; i++){ power = (power*i)%MODULO; } System.out.println(power); } }
Main.java:4: error: class TrsainingCamp is public, should be declared in a file named TrsainingCamp.java public class TrsainingCamp{ ^ 1 error
s953484142
p03796
C
#include<stdio.h> int main(void){ int i, time=0; int syou=1000000007; //sumを上5桁と下5桁で分割して管理する unsigned __int64 sum=1; scanf("%d", &time); for(i = 0 ; i < time ; i++){ sum = sum * (i+1); sum = sum%syou; } printf("%d", sum); }
main.c: In function 'main': main.c:7:26: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'sum' 7 | unsigned __int64 sum=1; | ^~~ main.c:7:26: error: 'sum' undeclared (first use in this function) main.c:7:26: note: each undeclared identifier is reported only once for each function it appears in
s878056527
p03796
Java
public class Main { public static void main(String[] args) { BigInteger power = BigInteger.ONE; Scanner scanner = new Scanner(System.in); BigInteger amount = scanner.nextBigInteger(); BigInteger v = BigInteger.valueOf(1000000007L); for (BigInteger i = power; i.compareTo(amount) < 1 ; i = i.add(BigInteger.ONE)) { power = power.multiply(i).mod(v); } System.out.println(power.remainder(v)); } }
Main.java:4: error: cannot find symbol BigInteger power = BigInteger.ONE; ^ symbol: class BigInteger location: class Main Main.java:4: error: cannot find symbol BigInteger power = BigInteger.ONE; ^ symbol: variable BigInteger location: class Main Main.java:5: error: cannot find symbol Scanner scanner = new Scanner(System.in); ^ symbol: class Scanner location: class Main Main.java:5: error: cannot find symbol Scanner scanner = new Scanner(System.in); ^ symbol: class Scanner location: class Main Main.java:6: error: cannot find symbol BigInteger amount = scanner.nextBigInteger(); ^ symbol: class BigInteger location: class Main Main.java:7: error: cannot find symbol BigInteger v = BigInteger.valueOf(1000000007L); ^ symbol: class BigInteger location: class Main Main.java:7: error: cannot find symbol BigInteger v = BigInteger.valueOf(1000000007L); ^ symbol: variable BigInteger location: class Main Main.java:8: error: cannot find symbol for (BigInteger i = power; i.compareTo(amount) < 1 ; i = i.add(BigInteger.ONE)) { ^ symbol: class BigInteger location: class Main Main.java:8: error: cannot find symbol for (BigInteger i = power; i.compareTo(amount) < 1 ; i = i.add(BigInteger.ONE)) { ^ symbol: variable BigInteger location: class Main 9 errors
s254645674
p03796
C
#include<stdio.h> int main(void){ int i, time=0; int syou=1000000007; //sumを上5桁と下5桁で分割して管理する unsigned __int64 sum=1; scanf("%d", &time); for(i = 0 ; i < time ; i++){ sum = sum * (i+1); sum = sum%syou; } printf("%d", sum); }
main.c: In function 'main': main.c:7:26: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'sum' 7 | unsigned __int64 sum=1; | ^~~ main.c:7:26: error: 'sum' undeclared (first use in this function) main.c:7:26: note: each undeclared identifier is reported only once for each function it appears in
s744863566
p03796
C
#include <stdio.h> int main(void){ long long n, p; long long i; scanf("%lld", &n); p = 1; for (i = 1; i <= n; i++){ p = p*i%(1e+7); } printf("%lld\n", p); return 0; }
main.c: In function 'main': main.c:12:24: error: invalid operands to binary % (have 'long long int' and 'double') 12 | p = p*i%(1e+7); | ~~~^ | | | long long int
s671549319
p03796
C++
#include <iostream> using namespace std; int main() { long n,p,i, mod; cin>>n; p=1; mod=1000000007 if (n>1){for (i=1; i<=n; i++) {p=(p*(i%mod)%mod);}} else p=1; cout << p % mod << '\n'; // your code goes here return 0; }
a.cc: In function 'int main()': a.cc:7:15: error: expected ';' before 'if' 7 | mod=1000000007 | ^ | ; 8 | if (n>1){for (i=1; i<=n; i++) {p=(p*(i%mod)%mod);}} | ~~ a.cc:9:1: error: 'else' without a previous 'if' 9 | else p=1; | ^~~~
s011867683
p03796
C
<?php fscanf(STDIN, "%d", $n); $res = 1; for ($i = 1; $i <= $n; ++$i) { $res *= $i; $res = $res % 1000000007; } echo $res . "\n";
main.c:1:1: error: expected identifier or '(' before '<' token 1 | <?php | ^ main.c:3:1: warning: data definition has no type or storage class 3 | $res = 1; | ^~~~ main.c:3:1: error: type defaults to 'int' in declaration of '$res' [-Wimplicit-int] main.c:4:1: error: expected identifier or '(' before 'for' 4 | for ($i = 1; $i <= $n; ++$i) { | ^~~ main.c:4:17: error: expected '=', ',', ';', 'asm' or '__attribute__' before '<=' token 4 | for ($i = 1; $i <= $n; ++$i) { | ^~ main.c:4:24: error: expected identifier or '(' before '++' token 4 | for ($i = 1; $i <= $n; ++$i) { | ^~ main.c:8:1: error: unknown type name 'echo' 8 | echo $res . "\n"; | ^~~~ main.c:8:11: error: expected '=', ',', ';', 'asm' or '__attribute__' before '.' token 8 | echo $res . "\n"; | ^
s694316060
p03796
C
<?php fscanf(STDIN, "%d", $n); $res = 1; for ($i = 1; $i <= $n; ++$i) { $res *= $i; $res = $res % 1000000007; } echo $res . "\n";
main.c:1:1: error: expected identifier or '(' before '<' token 1 | <?php | ^ main.c:3:1: warning: data definition has no type or storage class 3 | $res = 1; | ^~~~ main.c:3:1: error: type defaults to 'int' in declaration of '$res' [-Wimplicit-int] main.c:4:1: error: expected identifier or '(' before 'for' 4 | for ($i = 1; $i <= $n; ++$i) { | ^~~ main.c:4:17: error: expected '=', ',', ';', 'asm' or '__attribute__' before '<=' token 4 | for ($i = 1; $i <= $n; ++$i) { | ^~ main.c:4:24: error: expected identifier or '(' before '++' token 4 | for ($i = 1; $i <= $n; ++$i) { | ^~ main.c:8:1: error: unknown type name 'echo' 8 | echo $res . "\n"; | ^~~~ main.c:8:11: error: expected '=', ',', ';', 'asm' or '__attribute__' before '.' token 8 | echo $res . "\n"; | ^
s252129268
p03796
C
<?php fscanf(STDIN, "%d", $n); $res = 1; for ($i = 1; $i <= $n; ++$i) { $res *= $i; $res = $res % 1000000007; } echo $res . "\n";
main.c:1:1: error: expected identifier or '(' before '<' token 1 | <?php | ^ main.c:3:1: warning: data definition has no type or storage class 3 | $res = 1; | ^~~~ main.c:3:1: error: type defaults to 'int' in declaration of '$res' [-Wimplicit-int] main.c:4:1: error: expected identifier or '(' before 'for' 4 | for ($i = 1; $i <= $n; ++$i) { | ^~~ main.c:4:17: error: expected '=', ',', ';', 'asm' or '__attribute__' before '<=' token 4 | for ($i = 1; $i <= $n; ++$i) { | ^~ main.c:4:24: error: expected identifier or '(' before '++' token 4 | for ($i = 1; $i <= $n; ++$i) { | ^~ main.c:8:1: error: unknown type name 'echo' 8 | echo $res . "\n"; | ^~~~ main.c:8:11: error: expected '=', ',', ';', 'asm' or '__attribute__' before '.' token 8 | echo $res . "\n"; | ^
s759342954
p03796
C
<?php fscanf(STDIN, "%d", $n); $res = 1; for ($i = 1; $i <= $n; ++$i) { $res *= $i; $res = $res % 1000000007; } echo $res . "\n";
main.c:1:1: error: expected identifier or '(' before '<' token 1 | <?php | ^ main.c:3:1: warning: data definition has no type or storage class 3 | $res = 1; | ^~~~ main.c:3:1: error: type defaults to 'int' in declaration of '$res' [-Wimplicit-int] main.c:4:1: error: expected identifier or '(' before 'for' 4 | for ($i = 1; $i <= $n; ++$i) { | ^~~ main.c:4:17: error: expected '=', ',', ';', 'asm' or '__attribute__' before '<=' token 4 | for ($i = 1; $i <= $n; ++$i) { | ^~ main.c:4:24: error: expected identifier or '(' before '++' token 4 | for ($i = 1; $i <= $n; ++$i) { | ^~ main.c:8:1: error: unknown type name 'echo' 8 | echo $res . "\n"; | ^~~~ main.c:8:11: error: expected '=', ',', ';', 'asm' or '__attribute__' before '.' token 8 | echo $res . "\n"; | ^
s584120702
p03796
C++
#include <iostream> using namespace std; int main() { _int64 n; _int64 i; _int64 o; cin >> n; o = 1; for (i = 1; i <= n; i++) o = o*i; cout << o%1000000007 << endl; }
a.cc: In function 'int main()': a.cc:6:9: error: '_int64' was not declared in this scope 6 | _int64 n; | ^~~~~~ a.cc:8:15: error: expected ';' before 'i' 8 | _int64 i; | ^~ | ; a.cc:10:15: error: expected ';' before 'o' 10 | _int64 o; | ^~ | ; a.cc:12:16: error: 'n' was not declared in this scope 12 | cin >> n; | ^ a.cc:14:9: error: 'o' was not declared in this scope 14 | o = 1; | ^ a.cc:16:14: error: 'i' was not declared in this scope 16 | for (i = 1; i <= n; i++) | ^
s952070092
p03796
C++
int N; cin >> N; if((N<1)||(N>100001)){ return 0; } int i; int poi=1; double po=1.0; for(i=1; i<=N ; i++){ po=po*i; // if(poi>=(pow(9.0,10)+7)){ // po=(double)poi; // po=po/(1000000000.0+7.0); // poi=(int)po; // } } poi=(int)(po/(pow(9.0,10.0)+7.0)); cout << poi; }
a.cc:4:3: error: 'cin' does not name a type 4 | cin >> N; | ^~~ a.cc:5:3: error: expected unqualified-id before 'if' 5 | if((N<1)||(N>100001)){ | ^~ a.cc:12:3: error: expected unqualified-id before 'for' 12 | for(i=1; i<=N ; i++){ | ^~~ a.cc:12:12: error: 'i' does not name a type 12 | for(i=1; i<=N ; i++){ | ^ a.cc:12:19: error: 'i' does not name a type 12 | for(i=1; i<=N ; i++){ | ^ a.cc:21:3: error: 'poi' does not name a type 21 | poi=(int)(po/(pow(9.0,10.0)+7.0)); | ^~~ a.cc:22:3: error: 'cout' does not name a type 22 | cout << poi; | ^~~~ a.cc:25:1: error: expected declaration before '}' token 25 | } | ^
s224568876
p03796
C++
#include <iostream> using namespace std; int mod = 1000000007; int main() { // your code goes here int N; cin >> N; for(long long i= 1,j = 1;i <= N;i++){ j *= i; j %= mod; } cout << j << endl; return 0; }
a.cc: In function 'int main()': a.cc:13:17: error: 'j' was not declared in this scope 13 | cout << j << endl; | ^
s887516378
p03796
C
#include<stdio.h> int main(void) { int num; int i; int result = 1; scanf("%d", &num); for(i=1; i <= num; i++){ result *= i; } printf("%d\n", result % (1000000000 + 7)); return 0; } #include<stdio.h> int main(void) { long int num; long int i; long int result = 1; scanf("%ld", &num); for(i=1; i <= num; i++){ result *= i; } printf("%ld\n", result % (1000000000 + 7)); return 0; }
main.c:18:5: error: redefinition of 'main' 18 | int main(void) | ^~~~ main.c:3:5: note: previous definition of 'main' with type 'int(void)' 3 | int main(void) | ^~~~
s858641427
p03796
C++
#include <iostream> using namespace std; int main(void){ int N; cin >> N; int p = 1; for(int i=1;i<=N;i++){ p = p * i; }    int a = p % (1000000007); cout << a << endl; }
a.cc:10:1: error: extended character   is not valid in an identifier 10 |    int a = p % (1000000007); | ^ a.cc:10:1: error: extended character   is not valid in an identifier a.cc: In function 'int main()': a.cc:10:1: error: '\U00003000\U00003000' was not declared in this scope 10 |    int a = p % (1000000007); | ^~~~ a.cc:11:17: error: 'a' was not declared in this scope 11 | cout << a << endl; | ^
s175990600
p03796
C
#include<stdio.h> #include<math.h> int main(void){ int n,i,y; scanf("%d",&n); for(i=1;i<=n;i++){ y=y*i; } y=y%pow(10,9)+7; printf("%d",y); return 0; }
main.c: In function 'main': main.c:11:6: error: invalid operands to binary % (have 'int' and 'double') 11 | y=y%pow(10,9)+7; | ^~~~~~~~~~ | | | double
s647623325
p03796
C++
#include <stdio.h> int main(void){ double n=1; scanf("%f",&n); for(int i=0;i<n;i++){ n=n*i; } printf("%f\n",n%(1000000000+7)); return 0; }
a.cc: In function 'int main()': a.cc:9:24: error: invalid operands of types 'double' and 'int' to binary 'operator%' 9 | printf("%f\n",n%(1000000000+7)); | ~^~~~~~~~~~~~~~~ | | | | double int
s904805437
p03796
C
#include<stdio.h> #include<math.h> int main(void){ int n,y=1; scanf("%d",&n); for(int i=1;i<=n;i++){ y=y*i; } printf("%d",y%pow(10,9)+7); return 0; }
main.c: In function 'main': main.c:11:15: error: invalid operands to binary % (have 'int' and 'double') 11 | printf("%d",y%pow(10,9)+7); | ^~~~~~~~~~ | | | double
s528594140
p03796
C++
#include <iostream> using namespace std;   int main() { int n, p, i; cin >> n; p = 1; for (i = 1; i <= n; i++) {p = p * i;} cout << p % 1000000007 << '\n'; // your code goes here return 0; }
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 |   | ^
s721216671
p03796
C++
#include <iostream> using namespace std;   int main() { int n, p, i; cin >> n; p = 1; for (i = 1; i <= n; i++) p = p * i; cout << p % 1000000007 << '\n'; // your code goes here return 0; }
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 |   | ^
s492223898
p03796
C++
#include <iostream> using namespace std;   int main() { int n, p, i; cin >> n; p = 1; for (i = 1; i <= n; i++) p *= i; cout << p % (1000000007) << '\n'; // your code goes here return 0; }
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 |   | ^
s247628798
p03796
C++
#include<stdio.h> int main(){ int N, i, j=1, ; scanf("%d", &N); for(i=1;i<=N;i++){ j = j * i; } if (j >= 1000000007) j = j % 1000000007; printf("%d", j); }
a.cc: In function 'int main()': a.cc:4:24: error: expected unqualified-id before ';' token 4 | int N, i, j=1, ; | ^
s809345218
p03796
C++
#include<stdio.h> #include<math.h> int main(){ int n, fact,i; fact = 1; scanf("%d", &n); for(i=1; i<=n; ++i) { fact = fact * i; }; printf("%
a.cc:13:10: warning: missing terminating " character 13 | printf("% | ^ a.cc:13:10: error: missing terminating " character 13 | printf("% | ^~ a.cc: In function 'int main()': a.cc:13:10: error: expected primary-expression at end of input 13 | printf("% | ^ a.cc:13:10: error: expected '}' at end of input a.cc:4:11: note: to match this '{' 4 | int main(){ | ^
s962780933
p03796
C++
include<iostream> #include<cstdio> #include<algorithm> #include<cmath> using namespace std; int main(){ int n; long long ans; scanf(" %d",&n); ans=1; for(int i=2;i<=n;i++){ ans=(ans*(long long)i)%1000000007; } printf("%lld\n",ans%1000000007); 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/stl_algobase.h:62, from /usr/include/c++/14/algorithm:60, from a.cc:3: /usr/include/c++/14/ext/type_traits.h:164:35: error: 'constexpr const bool __gnu_cxx::__is_null_pointer' redeclared as different kind of entity 164 | __is_null_pointer(std::nullptr_t) | ^ /usr/include/c++/14/ext/type_traits.h:159:5: note: previous declaration 'template<class _Type> constexpr bool __gnu_cxx::__is_null_pointer(_Type)' 159 | __is_null_pointer(_Type) | ^~~~~~~~~~~~~~~~~ /usr/include/c++/14/ext/type_traits.h:164:26: error: 'nullptr_t' is not a member of 'std' 164 | __is_null_pointer(std::nullptr_t) | ^~~~~~~~~ In file included from /usr/include/c++/14/bits/stl_pair.h:60, from /usr/include/c++/14/bits/stl_algobase.h:64: /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/stdio.h:34, from /usr/include/c++/14/cstdio:42, from a.cc:2: /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; | ^~~~~~ In file included from /usr/include/c++/14/bits/stl_algobase.h:65: /usr/include/c++/14/bits/stl_iterator_base_types.h:125:67: error: 'ptrdiff_t' does not name a type 125 | template<typename _Category, typename _Tp, typename _Distance = ptrdiff_t, | ^~~~~~~~~ /usr/include/c++/14/bits/stl_iterator_base_types.h:1:1: note: 'ptrdiff_t' is defined in header '<cstddef>'; this is probably fixable by adding '#include <cstddef>' +++ |+#include <cstddef> 1 | // Types used in iterator implementation -*- C++ -*- /usr/include/c++/14/bits/stl_iterator_base_types.h:214:15: error: 'ptrdiff_t' does not name a type 214 | typedef ptrdiff_t difference_type; | ^~~~~~~~~ /usr/include/c++/14/bits/stl_iterator_base_types.h:214:15: note: 'ptrdiff_t' is defined in header '<cstddef>'; this is probably fixable by adding '#include <cstddef>' /usr/include/c++/14/bits/stl_iterator_base_types.h:225:15: error: 'ptrdiff_t' does not name a type 225 | typedef ptrdiff_t difference_type; | ^~~~~~~~~ /usr/include/c++/14/bits/stl_iterator_base_types.h:225:15: note: 'ptrdiff_t' is defined in header '<cstddef>'; this is probably fixable by adding '#include <cstddef>' In file included from /usr/include/c++/14/bits/stl_algobase.h:66: /usr/include/c++/14/bits/stl_iterator_base_funcs.h:112:5: error: 'ptrdiff_t' does not name a type 112 | ptrdiff_t | ^~~~~~~~~ /usr/include/c++/14/bits/stl_iterator_base_funcs.h:66:1: note: 'ptrdiff_t' is defined in header '<cstddef>'; this is probably fixable by adding '#include <cstddef>' 65 | #include <debug/assertions.h> +++ |+#include <cstddef> 66 | #include <bits/stl_iterator_base_types.h> /usr/include/c++/14/bits/stl_iterator_base_funcs.h:118:5: error: 'ptrdiff_t' does not name a type 118 | ptrdiff_t | ^~~~~~~~~ /usr/include/c++/14/bits/stl_iterator_base_funcs.h:118:5: note: 'ptrdiff_t' is defined in header '<cstddef>'; this is probably fixable by adding '#include <cstddef>' In file included from /usr/include/c++/14/bits/stl_iterator.h:67, from /usr/include/c++/14/bits/stl_algobase.h:67: /usr/include/c++/14/bits/ptr_traits.h:156:47: error: 'ptrdiff_t' was not declared in this scope 15
s098986039
p03796
C++
#include<cstdio> __int64 rank(__int64 n) { for (__int64 i=n-1;i>1;i--) { n*=i; n=n%1000000007; } return n; } int main() { __int64 n; while (scanf("%I64d",&n)==1) { printf("%I64d\n",rank(n)); } return 0; }
a.cc:2:1: error: '__int64' does not name a type; did you mean '__int64_t'? 2 | __int64 rank(__int64 n) | ^~~~~~~ | __int64_t a.cc: In function 'int main()': a.cc:13:9: error: '__int64' was not declared in this scope; did you mean '__int64_t'? 13 | __int64 n; | ^~~~~~~ | __int64_t a.cc:14:31: error: 'n' was not declared in this scope 14 | while (scanf("%I64d",&n)==1) | ^ a.cc:16:34: error: 'rank' was not declared in this scope 16 | printf("%I64d\n",rank(n)); | ^~~~
s378606328
p03796
C++
#include "bits/stdc++.h" #include using namespace std; int main(void) { int n,p=1; cin >> n; for(int i=1;i<=n;i++){ p*=i; } cout << p%((int)(pow(10,9))+7) << endl; return 0; }
a.cc:2:9: error: #include expects "FILENAME" or <FILENAME> 2 | #include | ^
s292673498
p03796
C++
#include "bits/stdc++.h" using namespace std; int main(void) { int n,p=1; cin >> n; for(int i=1;i<=n;i++){ p*=i; } cout << p%(pow(10,9)+7) << endl; return 0; }
a.cc: In function 'int main()': a.cc:10:18: error: invalid operands of types 'int' and '__gnu_cxx::__promote<double>::__type' {aka 'double'} to binary 'operator%' 10 | cout << p%(pow(10,9)+7) << endl; | ~^~~~~~~~~~~~~~ | | | | int __gnu_cxx::__promote<double>::__type {aka double}
s488072312
p03796
C++
#include "stdafx.h" #include <iostream> #include <stdint.h> #include <string> using namespace std; uint64_t ppow = 1000000000 + 7; int main() { uint64_t out = 1; int N; cin >> N; for (uint64_t i = 1;i <= N;i++) { out = (out * i) % ppow; } cout << out; return 0; }
a.cc:1:10: fatal error: stdafx.h: No such file or directory 1 | #include "stdafx.h" | ^~~~~~~~~~ compilation terminated.
s601038707
p03796
C++
int N; cin >> N; long long int p = 1; for (int i = 1; i <= N; i++) { p *= i; p %= 1000000007; } cout << p;
a.cc:2:9: error: 'cin' does not name a type 2 | cin >> N; | ^~~ a.cc:4:9: error: expected unqualified-id before 'for' 4 | for (int i = 1; i <= N; i++) | ^~~ a.cc:4:25: error: 'i' does not name a type 4 | for (int i = 1; i <= N; i++) | ^ a.cc:4:33: error: 'i' does not name a type 4 | for (int i = 1; i <= N; i++) | ^ a.cc:9:9: error: 'cout' does not name a type 9 | cout << p; | ^~~~
s851228832
p03796
C++
#include <iostream. using namespace std; int main() { int N; cin >> N; int p = 1; for (int i = 0; i < N; i++) p = p * i % 1000000007; cout << p << endl; return 0; }
a.cc:1:20: error: missing terminating > character 1 | #include <iostream. | ^ a.cc:1:10: fatal error: iostream.: No such file or directory 1 | #include <iostream. | ^ compilation terminated.
s271140426
p03796
C++
#include<bits/stdc++.h> using namespace std; #define int long long signed main(){ int n; cin >> n; int ans = 1; for(int i = 1; i <= n; i++){ ans *= i; ans %= 1e9 + 7; } cout << ans << endl; }
a.cc: In function 'int main()': a.cc:12:21: error: invalid operands of types 'long long int' and 'double' to binary 'operator%' 12 | ans %= 1e9 + 7; | ~~~~^~~~~~~~~~ a.cc:12:21: note: in evaluation of 'operator%=(long long int, double)'
s932758110
p03797
C++
#include<bits/stdc++.h> using namespace std; #define ll long long int int main () { ll x,y; cin>>x>>y; m=(y-2*x); cout<<(x+(m/4)); return 0; }
a.cc: In function 'int main()': a.cc:9:3: error: 'm' was not declared in this scope 9 | m=(y-2*x); | ^
s364784952
p03797
C++
#include <iostream> using namespace std; int main() { int64_t N, M; cin >> N >> M; int64_t dum = max((M - N * 2) / 4, 0LL); N += dum; M -= dum * 2; cout << min(N, M / 2) << endl; }
a.cc: In function 'int main()': a.cc:9:20: error: no matching function for call to 'max(int64_t, long long int)' 9 | int64_t dum = max((M - N * 2) / 4, 0LL); | ~~~^~~~~~~~~~~~~~~~~~~~~~ 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:257:5: note: candidate: 'template<class _Tp> constexpr const _Tp& std::max(const _Tp&, const _Tp&)' 257 | max(const _Tp& __a, const _Tp& __b) | ^~~ /usr/include/c++/14/bits/stl_algobase.h:257:5: note: template argument deduction/substitution failed: a.cc:9:20: note: deduced conflicting types for parameter 'const _Tp' ('long int' and 'long long int') 9 | int64_t dum = max((M - N * 2) / 4, 0LL); | ~~~^~~~~~~~~~~~~~~~~~~~~~ /usr/include/c++/14/bits/stl_algobase.h:303:5: note: candidate: 'template<class _Tp, class _Compare> constexpr const _Tp& std::max(const _Tp&, const _Tp&, _Compare)' 303 | max(const _Tp& __a, const _Tp& __b, _Compare __comp) | ^~~ /usr/include/c++/14/bits/stl_algobase.h:303:5: note: candidate expects 3 arguments, 2 provided
s645599045
p03797
C++
#include <bits/stdc++.h> using namespace std; int main() { long long n , a , s=0; cin>>n>>a; if(a >= 2*n) { s = n; a -= 2*n; s += m / 4; cout << s << "\n"; } else { cout << a / 2 << "\n"; } }
a.cc: In function 'int main()': a.cc:11:14: error: 'm' was not declared in this scope 11 | s += m / 4; | ^
s244214756
p03797
C
#include<cstdio> int main() { long long n,m; scanf("%lld%lld", &n, &m); if (2*n > m) printf("%lld", m/2); else printf("%lld", n+(m-n*2)/4); return 0; }
main.c:1:9: fatal error: cstdio: No such file or directory 1 | #include<cstdio> | ^~~~~~~~ compilation terminated.
s082811729
p03797
C++
#include <bits/stdc++.h> using namespace std; int main(){ int N,M;cin >> N >> M; int ans; if(M >= 2 * N){ ans = N; M -= 2 * N; ans += M / 4; } else ans = min(n,M / 2); cout << ans << endl; }
a.cc: In function 'int main()': a.cc:12:15: error: 'n' was not declared in this scope 12 | ans = min(n,M / 2); | ^
s866013614
p03797
C++
#include<bits/stdc++.h> using namespace std; int main(){ long long N,M; if(M>=N*2){ cout<<N+(M-2*N)/3<<endl; } else{ cout<<M/2<<endl; }
a.cc: In function 'int main()': a.cc:10:2: error: expected '}' at end of input 10 | } | ^ a.cc:3:11: note: to match this '{' 3 | int main(){ | ^
s510796795
p03797
C++
#include <bits/stdc++.h> using namespace std; typedef long long ll; int main(){ ll n,m; cin >> n >> m; ll ans; if ( n == 2 * m ) {//cがたらんou ピッタリ ans = m/2; } else if ( n > 2 * m ) { ans = m/2; n -= ans; ans += (n/2); } else #include <bits/stdc++.h> using namespace std; typedef long long ll; int main(){ ll n,m; cin >> n >> m; ll ans; if ( 2 * n >= m ) {//cがたらんou ピッタリ ans = m / 2; } else { ans = n; m -= 2*n; ans += (m/4); } cout << ans << endl; } #include <bits/stdc++.h> using namespace std; typedef long long ll; int main(){ ll n,m; cin >> n >> m; ll ans; if ( n == 2 * m ) {//cがたらんou ピッタリ ans = m/2; } else if ( n > 2 * m ) { ans = m/2; n -= ans; ans += (n/2); } else #include <bits/stdc++.h> using namespace std; typedef long long ll; int main(){ ll n,m; cin >> n >> m; ll ans; if ( 2 * n >= m ) {//cがたらんou ピッタリ ans = m / 2; } else { ans = n; m -= 2*n; ans += (m/4); } cout << ans << endl; }
a.cc:17:10: error: stray '#' in program 17 | } else #include <bits/stdc++.h> | ^ a.cc:54:10: error: stray '#' in program 54 | } else #include <bits/stdc++.h> | ^ a.cc: In function 'int main()': a.cc:17:11: error: 'include' was not declared in this scope 17 | } else #include <bits/stdc++.h> | ^~~~~~~ a.cc:17:20: error: 'bits' was not declared in this scope 17 | } else #include <bits/stdc++.h> | ^~~~ a.cc:17:25: error: 'stdc' was not declared in this scope; did you mean 'std'? 17 | } else #include <bits/stdc++.h> | ^~~~ | std a.cc:18:1: error: expected primary-expression before 'using' 18 | using namespace std; | ^~~~~ a.cc:21:9: warning: empty parentheses were disambiguated as a function declaration [-Wvexing-parse] 21 | int main(){ | ^~ a.cc:21:9: note: remove parentheses to default-initialize a variable 21 | int main(){ | ^~ | -- a.cc:21:9: note: or replace parentheses with braces to value-initialize a variable a.cc:21:11: error: a function-definition is not allowed here before '{' token 21 | int main(){ | ^ a.cc:42:9: warning: empty parentheses were disambiguated as a function declaration [-Wvexing-parse] 42 | int main(){ | ^~ a.cc:42:9: note: remove parentheses to default-initialize a variable 42 | int main(){ | ^~ | -- a.cc:42:9: note: or replace parentheses with braces to value-initialize a variable a.cc:42:11: error: a function-definition is not allowed here before '{' token 42 | int main(){ | ^ a.cc:74:2: error: expected '}' at end of input 74 | } | ^ a.cc:5:11: note: to match this '{' 5 | int main(){ | ^
s679093450
p03797
C++
#include<bits/stdc++.h> int main(){long long n,m;std::cin>>n>>m;std::cout<<min(n+m/2,m)/2;}
a.cc: In function 'int main()': a.cc:2:52: error: 'min' was not declared in this scope; did you mean 'std::min'? 2 | int main(){long long n,m;std::cin>>n>>m;std::cout<<min(n+m/2,m)/2;} | ^~~ | std::min In file included from /usr/include/c++/14/algorithm:61, from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:51, from a.cc:1: /usr/include/c++/14/bits/stl_algo.h:5696:5: note: 'std::min' declared here 5696 | min(initializer_list<_Tp> __l, _Compare __comp) | ^~~
s811653584
p03797
C++
#include<bits/stdc++.h> using namespace std; int main(){ long long n,m; cin>>n>>m; long long answer=min(n,m/2); m=m-answer*2; answer=answer+m/4; cout<<answer<endl; }
a.cc: In function 'int main()': a.cc:9:21: error: no match for 'operator<' (operand types are 'std::basic_ostream<char>::__ostream_type' {aka 'std::basic_ostream<char>'} and '<unresolved overloaded function type>') 9 | cout<<answer<endl; | ~~~~~~~~~~~~^~~~~ In file included from /usr/include/c++/14/regex:68, from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:181, from a.cc:1: /usr/include/c++/14/bits/regex.h:1143:5: note: candidate: 'template<class _BiIter> bool std::__cxx11::operator<(const sub_match<_BiIter>&, const sub_match<_BiIter>&)' 1143 | operator<(const sub_match<_BiIter>& __lhs, const sub_match<_BiIter>& __rhs) | ^~~~~~~~ /usr/include/c++/14/bits/regex.h:1143:5: note: template argument deduction/substitution failed: a.cc:9:22: note: 'std::basic_ostream<char>::__ostream_type' {aka 'std::basic_ostream<char>'} is not derived from 'const std::__cxx11::sub_match<_BiIter>' 9 | cout<<answer<endl; | ^~~~ /usr/include/c++/14/bits/regex.h:1224:5: note: candidate: 'template<class _Bi_iter, class _Ch_traits, class _Ch_alloc> bool std::__cxx11::operator<(__sub_match_string<_Bi_iter, _Ch_traits, _Ch_alloc>&, const sub_match<_BiIter>&)' 1224 | operator<(const __sub_match_string<_Bi_iter, _Ch_traits, _Ch_alloc>& __lhs, | ^~~~~~~~ /usr/include/c++/14/bits/regex.h:1224:5: note: template argument deduction/substitution failed: a.cc:9:22: note: 'std::basic_ostream<char>::__ostream_type' {aka 'std::basic_ostream<char>'} is not derived from 'std::__cxx11::__sub_match_string<_Bi_iter, _Ch_traits, _Ch_alloc>' 9 | cout<<answer<endl; | ^~~~ /usr/include/c++/14/bits/regex.h:1317:5: note: candidate: 'template<class _Bi_iter, class _Ch_traits, class _Ch_alloc> bool std::__cxx11::operator<(const sub_match<_BiIter>&, __sub_match_string<_Bi_iter, _Ch_traits, _Ch_alloc>&)' 1317 | operator<(const sub_match<_Bi_iter>& __lhs, | ^~~~~~~~ /usr/include/c++/14/bits/regex.h:1317:5: note: template argument deduction/substitution failed: a.cc:9:22: note: 'std::basic_ostream<char>::__ostream_type' {aka 'std::basic_ostream<char>'} is not derived from 'const std::__cxx11::sub_match<_BiIter>' 9 | cout<<answer<endl; | ^~~~ /usr/include/c++/14/bits/regex.h:1391:5: note: candidate: 'template<class _Bi_iter> bool std::__cxx11::operator<(const typename std::iterator_traits<_Iter>::value_type*, const sub_match<_BiIter>&)' 1391 | operator<(typename iterator_traits<_Bi_iter>::value_type const* __lhs, | ^~~~~~~~ /usr/include/c++/14/bits/regex.h:1391:5: note: template argument deduction/substitution failed: a.cc:9:22: note: couldn't deduce template parameter '_Bi_iter' 9 | cout<<answer<endl; | ^~~~ /usr/include/c++/14/bits/regex.h:1485:5: note: candidate: 'template<class _Bi_iter> bool std::__cxx11::operator<(const sub_match<_BiIter>&, const typename std::iterator_traits<_Iter>::value_type*)' 1485 | operator<(const sub_match<_Bi_iter>& __lhs, | ^~~~~~~~ /usr/include/c++/14/bits/regex.h:1485:5: note: template argument deduction/substitution failed: a.cc:9:22: note: 'std::basic_ostream<char>::__ostream_type' {aka 'std::basic_ostream<char>'} is not derived from 'const std::__cxx11::sub_match<_BiIter>' 9 | cout<<answer<endl; | ^~~~ /usr/include/c++/14/bits/regex.h:1560:5: note: candidate: 'template<class _Bi_iter> bool std::__cxx11::operator<(const typename std::iterator_traits<_Iter>::value_type&, const sub_match<_BiIter>&)' 1560 | operator<(typename iterator_traits<_Bi_iter>::value_type const& __lhs, | ^~~~~~~~ /usr/include/c++/14/bits/regex.h:1560:5: note: template argument deduction/substitution failed: a.cc:9:22: note: couldn't deduce template parameter '_Bi_iter' 9 | cout<<answer<endl; | ^~~~ /usr/include/c++/14/bits/regex.h:1660:5: note: candidate: 'template<class _Bi_iter> bool std::__cxx11::operator<(const sub_match<_BiIter>&, const typename std::iterator_traits<_Iter>::value_type&)' 1660 | operator<(const sub_match<_Bi_iter>& __lhs, | ^~~~~~~~ /usr/include/c++/14/bits/regex.h:1660:5: note: template argument deduction/substitution failed: a.cc:9:22: note: 'std::basic_ostream<char>::__ostream_type' {aka 'std::basic_ostream<char>'} is not derived from 'const std::__cxx11::sub_match<_BiIter>' 9 | cout<<answer<endl; | ^~~~ In file included from /usr/include/c++/14/bits/stl_algobase.h:64, from /usr/include/c++/14/algorithm:60, from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:51: /usr/include/c++/14/bits/stl_pair.h:1045:5: note: candidate: 'template<class _T1, class _T2> constexpr bool std::operator<(const pair<_T1, _T2>&, const pair<_T1, _T2>&)' 1045 | operator<(const pair<_T1, _T2>& __x, const pair<_T1, _T2>& __y) | ^~~~~~~~ /usr/include/c++/14/bits/stl_pair.h:1045:5: note: template argument deduction/substitution failed: a.cc:9:22: note: 'std::basic_ostream<char>::__ostream_type' {aka 'std::basic_ostream<char>'} is not derived from 'const std::pair<_T1, _T2>' 9 | cout<<answer<endl; | ^~~~ In file included from /usr/include/c++/14/bits/stl_algobase.h:67: /usr/include/c++/14/bits/stl_iterator.h:448:5: note: candidate: 'template<class _Iterator> constexpr bool std::operator<(const reverse_iterator<_Iterator>&, const reverse_iterator<_Iterator>&)' 448 | operator<(const reverse_iterator<_Iterator>& __x, | ^~~~~~~~ /usr/include/c++/14/bits/stl_iterator.h:448:5: note: template argument deduction/substitution failed: a.cc:9:22: note: 'std::basic_ostream<char>::__ostream_type' {aka 'std::basic_ostream<char>'} is not derived from 'const std::reverse_iterator<_Iterator>' 9 | cout<<answer<endl; | ^~~~ /usr/include/c++/14/bits/stl_iterator.h:493:5: note: candidate: 'template<class _IteratorL, class _IteratorR> constexpr bool std::operator<(const reverse_iterator<_Iterator>&, const reverse_iterator<_IteratorR>&)' 493 | operator<(const reverse_iterator<_IteratorL>& __x, | ^~~~~~~~ /usr/include/c++/14/bits/stl_iterator.h:493:5: note: template argument deduction/substitution failed: a.cc:9:22: note: 'std::basic_ostream<char>::__ostream_type' {aka 'std::basic_ostream<char>'} is not derived from 'const std::reverse_iterator<_Iterator>' 9 | cout<<answer<endl; | ^~~~ /usr/include/c++/14/bits/stl_iterator.h:1694:5: note: candidate: 'template<class _IteratorL, class _IteratorR> constexpr bool std::operator<(const move_iterator<_IteratorL>&, const move_iterator<_IteratorR>&)' 1694 | operator<(const move_iterator<_IteratorL>& __x, | ^~~~~~~~ /usr/include/c++/14/bits/stl_iterator.h:1694:5: note: template argument deduction/substitution failed: a.cc:9:22: note: 'std::basic_ostream<char>::__ostream_type' {aka 'std::basic_ostream<char>'} is not derived from 'const std::move_iterator<_IteratorL>' 9 | cout<<answer<endl; | ^~~~ /usr/include/c++/14/bits/stl_iterator.h:1760:5: note: candidate: 'template<class _Iterator> constexpr bool std::operator<(const move_iterator<_IteratorL>&, const move_iterator<_IteratorL>&)' 1760 | operator<(const move_iterator<_Iterator>& __x, | ^~~~~~~~ /usr/include/c++/14/bits/stl_iterator.h:1760:5: note: template argument deduction/substitution failed: a.cc:9:22: note: 'std::basic_ostream<char>::__ostream_type' {aka 'std::basic_ostream<char>'} is not derived from 'const std::move_iterator<_IteratorL>' 9 | cout<<answer<endl; | ^~~~ 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/bitset:52, from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:52: /usr/include/c++/14/string_view:673:5: note: candidate: 'template<class _CharT, class _Traits> constexpr bool std::operator<(basic_string_view<_CharT, _Traits>, basic_string_view<_CharT, _Traits>)' 673 | operator< (basic_string_view<_CharT, _Traits> __x, | ^~~~~~~~ /usr/include/c++/14/string_view:673:5: note: template argument deduction/substitution failed: a.cc:9:22: note: 'std::basic_ostream<char>' is not derived from 'std::basic_string_view<_CharT, _Traits>' 9 | cout<<answer<endl; | ^~~~ /usr/include/c++/14/string_view:680: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> >)' 680 | operator< (basic_string_view<_CharT, _Traits> __x, | ^~~~~~~~ /usr/include/c++/14/string_view:680:5: note: template argument deduction/substitution failed: a.cc:9:22: note: 'std::basic_ostream<char>' is not derived from 'std::basic_string_view<_CharT, _Traits>' 9 | cout<<answer<endl; | ^~~~ /usr/include/c++/14/string_view:688: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>)' 688 | operator< (__type_identity_t<basic_string_view<_CharT, _Traits>> __x, | ^~~~~~~~ /usr/include/c++/14/string_view:688:5: note: template argument deduction/substitution failed: a.cc:9:22: note: couldn't deduce template parameter '_CharT' 9 | cout<<answer<endl; | ^~~~ /usr/include/c++/14/bits/basic_string.h:3874: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>&)' 3874 | operator<(const basic_string<_CharT, _Traits, _Alloc>& __lhs, | ^~~~~~~~ /usr/include/c++/14/bits/basic_string.h
s187147778
p03797
Java
import java.util.*; public class SccPuzzle { public static void main(String[] args) { Scanner sc = new Scanner(System.in); long s = sc.nextLong(); long c = sc.nextLong(); long scc = 0; if(s>=c/2) { scc = c/2; }else { scc += s; c -= 2*s; scc += c/4; } System.out.println(scc); } }
Main.java:3: error: class SccPuzzle is public, should be declared in a file named SccPuzzle.java public class SccPuzzle { ^ 1 error
s045252590
p03797
C++
#include<iostream> int main() { int n,m; std::cin>>n>>m; std::cout<<min(n+m/2,m)/2; return 0; }
a.cc: In function 'int main()': a.cc:6:16: error: 'min' was not declared in this scope; did you mean 'std::min'? 6 | std::cout<<min(n+m/2,m)/2; | ^~~ | std::min 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:281:5: note: 'std::min' declared here 281 | min(const _Tp& __a, const _Tp& __b, _Compare __comp) | ^~~
s264702276
p03797
C++
#include<iostream> int main() { int n,m; cin>>n>>m; cout<<min(n+m/2,m)/2; return 0; }
a.cc: In function 'int main()': a.cc:5:5: error: 'cin' was not declared in this scope; did you mean 'std::cin'? 5 | cin>>n>>m; | ^~~ | 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:6:5: error: 'cout' was not declared in this scope; did you mean 'std::cout'? 6 | cout<<min(n+m/2,m)/2; | ^~~~ | std::cout /usr/include/c++/14/iostream:63:18: note: 'std::cout' declared here 63 | extern ostream cout; ///< Linked to standard output | ^~~~ a.cc:6:11: error: 'min' was not declared in this scope; did you mean 'std::min'? 6 | cout<<min(n+m/2,m)/2; | ^~~ | std::min 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: /usr/include/c++/14/bits/stl_algobase.h:281:5: note: 'std::min' declared here 281 | min(const _Tp& __a, const _Tp& __b, _Compare __comp) | ^~~
s355460369
p03797
C++
#include<iostream> using namespace std;long long n,m;int main(){cin>>n>>m;cout<<min(n+m/2,m)/2;}
a.cc:1:20: warning: extra tokens at end of #include directive 1 | #include<iostream> using namespace std;long long n,m;int main(){cin>>n>>m;cout<<min(n+m/2,m)/2;} | ^~~~~ /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
s501197337
p03797
C++
#include<iosstream> using namespace std;long long n,m;int main(){cin>>n>>m;cout<<min(n+m/2,m)/2;}
a.cc:1:21: warning: extra tokens at end of #include directive 1 | #include<iosstream> using namespace std;long long n,m;int main(){cin>>n>>m;cout<<min(n+m/2,m)/2;} | ^~~~~ a.cc:1:9: fatal error: iosstream: No such file or directory 1 | #include<iosstream> using namespace std;long long n,m;int main(){cin>>n>>m;cout<<min(n+m/2,m)/2;} | ^~~~~~~~~~~ compilation terminated.
s466491100
p03797
C++
#include<bits/stdc++.h> using namespace std; int main(){ int64_N,M; cin>>N>>M; if((M/2)<=N) cout<<M/2<<endl; else{ int64_t ans=(N+(M/2))/2; cout<<ans<<endl; } return 0; }
a.cc: In function 'int main()': a.cc:4:1: error: 'int64_N' was not declared in this scope; did you mean 'int64_t'? 4 | int64_N,M; | ^~~~~~~ | int64_t a.cc:4:9: error: 'M' was not declared in this scope 4 | int64_N,M; | ^ a.cc:5:8: error: 'N' was not declared in this scope 5 | cin>>N>>M; | ^
s294595262
p03797
C++
import java.util.*; import java.io.*; public class Main{ static int repow(int b,int p){ long a = b; long res=1; while(p>0){ if(p%2==1){ res*=a; } a*=a; p/=2; } return (int)res; } static int repow(int b,int p,int modder){ long a = b%modder; long res=1; while(p>0){ if(p%2==1){ res=(res*a)%modder; } a=(a*a)%modder; p/=2; } return (int)res; } static long repow(long b,long p){ long a = b; long res=1; while(p>0){ if(p%2==1){ res*=a; } a*=a; p/=2; } return res; } static long repow(long b,long p,long modder){ long a = b%modder; long res=1; while(p>0){ if(p%2==1){ res=(res*a)%modder; } a=(a*a)%modder; p/=2; } return res; } static long gcd(long c,long d){ while(true){ long f=c%d; if(f==0){ return d; } c=d; d=f; } } static long lcm(long c,long d){ return c/gcd(c,d)*d; } static ArrayList<Integer> divList(int n){ ArrayList<Integer> div=new ArrayList<Integer>(); for(int i=1;i*i<=n;i++){ if(n%i==0){ div.add(i); if(i*i!=n){ div.add((int)(n/i)); } } } return div; } static ArrayList<Long> divList(long n){ ArrayList<Long> div=new ArrayList<Long>(); for(long i=1;i*i<=n;i++){ if(n%i==0){ div.add(i); if(i*i!=n){ div.add(n/i); } } } return div; } static HashSet<Integer> divSet(int n){ HashSet<Integer> div=new HashSet<Integer>(); for(int i=1;i*i<=n;i++){ if(n%i==0){ div.add(i); div.add((int)(n/i)); } } return div; } static Map<Long,Integer> pFacMap(long x){ Map<Long,Integer> mp=new HashMap<>(); long t=x; for(long i=2;i*i<=x&&i<=t;i++){ if(t%i==0){ int num=0; while(t%i==0){ t/=i; num++; } mp.put(i,num); } } if(t!=1){ mp.put(t,1); } return mp; } static boolean iP(long n){ if(n==2){ return true; } if((n&1)==0||n==1){ return false; } // if(n>3037007383L){ if(n>Integer.MAX_VALUE){ return tameshiwari(n); } long d=n-1; int s=0; while((d&1)==0){ d/=2; s++; } int[] aa = {2,3,5,7,11,13,17}; for(int i=0;i<7&&aa[i]<n;i++){ int a = aa[i]; long t = d; long y=repow(a,t,n); while(t!=n-1&&y!=1&&y!=n-1){ y = (y*y)%n; t=t<<1; } if(y!=n-1&&(t&1)==0){ return false; } } return true; } static boolean tameshiwari(long n){ for(long i=2;i*i<=n;i++){ if(n%i==0){ return false; } } return true; } static class NCK{ int max; int mod; long[] fac; long[] finv; long[] inv; NCK(){ this(510000,1000000007); } NCK(int max,int mod){ this.max=max; this.mod=mod; pre(max,mod); } void pre(int nmax,int nmod){ fac = new long[nmax]; finv = new long[nmax]; inv = new long[nmax]; fac[0]=fac[1]=1; finv[0]=finv[1]=1; inv[1]=1; for(int i=2;i<nmax;i++){ fac[i]=fac[i-1]*i%nmod; inv[i]=nmod-inv[nmod%i]*(nmod/i)%nmod; finv[i]=finv[i-1]*inv[i]%nmod; } } long nCk(int n,int k){ if(n<k){return 0;} if(n<0||k<0){return 0;} return fac[n]*(finv[k]*finv[n-k]%mod)%mod; } } static int kmp(String t,String p){ int[] f=new int[p.length()+1]; int i=0; int j=1; f[1]=0; while(j<p.length()){ if(i==0||p.charAt(i-1)==p.charAt(j-1)){ i++; j++; f[j]=i; }else{ i=f[i]; } } i=1; j=1; while(i<=p.length()&&j<=t.length()){ if(i==0||p.charAt(i-1)==t.charAt(j-1)){ i++; j++; }else{ i=f[i]; } } return i==(p.length()+1)?j-i:-1; } static String StSort(String s){ StringBuilder sb = new StringBuilder(s); int lg = sb.length(); int l; int r; int gaze; for(int i=1;i<lg;i++){ l=0; r=i-1; while(l<=r){ gaze=(l+r)/2; if(sb.charAt(gaze)<=sb.charAt(i)){ l=gaze+1; }else if(sb.charAt(gaze)>sb.charAt(i)){ r=gaze-1; } } sb.insert(l,sb.charAt(i)); sb.deleteCharAt(i+1); } return sb.toString(); } static class Xy{ int x; int y; Xy(int x,int y){ this.x=x; this.y=y; } public int manht(Xy o){ return Math.abs(x-o.x)+Math.abs(y-o.y); } public String toString(){ return "["+x+","+y+"]"; } public double henkaku(){ return Math.atan2(y,x); } public static int hencom(Xy s1,Xy s2){ return (int)Math.signum(s1.henkaku()-s2.henkaku()); } public boolean equals(Object o){ return x==((Xy)o).x&&y==((Xy)o).y; } } static class Zip1{ Map<Long,Integer> zip=new HashMap<>(); long[] unzip; Zip1(long[] a){ Arrays.sort(a); long mae=0;int zure=0; for(int i=0;i<a.length;i++){ if(i==0||mae!=a[i]){ zip.put(a[i],i-zure); mae=a[i]; }else{ zure++; } } unzip=new long[size()]; for(Map.Entry<Long,Integer> me:zip.entrySet()){ unzip[me.getValue()]=me.getKey(); } } int zip(long t){ return zip.get(t); } long unzip(int i){ return unzip[i]; } int size(){ return zip.size(); } } static class UnFd{ int[] parent; int[] size; int forest; UnFd(int n){ parent=new int[n]; size=new int[n]; forest=n; for(int i=0;i<n;i++){ parent[i]=i; size[i]=1; } } private boolean isRoot(int i){ return parent[i]==i; } private int rootOf(int i){ if(isRoot(i)){ return i; } return parent[i]=rootOf(parent[i]); } public boolean same(int i,int j){ return rootOf(i)==rootOf(j); } public void merge(int i,int j){ i=rootOf(i); j=rootOf(j); if(i==j){ return; } size[Integer.min(i,j)]+=size[Integer.max(i,j)]; parent[Integer.max(i,j)]=Integer.min(i,j); forest--; } public int sizeOf(int i){ return size[rootOf(i)]; } public int[] parents(){ return parent; } public int forest(){ return forest; } public String toString(){ return Arrays.toString(parent); } } static class SegTree<T>{ int n; int m; java.util.function.BinaryOperator<T> op; int[] l; int[] r; T[] a; T ident; SegTree(int n,java.util.function.BinaryOperator<T> op,T ident){ this.n=n; this.op=op; this.ident=ident; int ii=n-1; int p=0; while(ii>0){ ii/=2; p++; } m=repow(2,p+1)-1; @SuppressWarnings("unchecked") T[] b=(T[])(new Object[m]); a=b; Arrays.fill(a,ident); l=new int[m]; r=new int[m]; for(int i=0;i<=m/2;i++){ l[m/2+i]=i; r[m/2+i]=i+1; } for(int i=m/2-1;i>=0;i--){ l[i]=l[lch(i)]; r[i]=r[rch(i)]; } } SegTree(int n,java.util.function.BinaryOperator<T> op,T ident,T[] ary){ this.n=n; this.op=op; this.ident=ident; int ii=n-1; int p=0; while(ii>0){ ii/=2; p++; } m=repow(2,p+1)-1; @SuppressWarnings("unchecked") T[] b=(T[])(new Object[m]); a=b; for(int i=0;i<n;i++){ a[m/2+i]=ary[i]; } for(int i=m/2+n;i<m;i++){ a[i]=ident; } for(int i=m/2-1;i>=0;i--){ a[i]=op.apply(a[lch(i)],a[rch(i)]); } l=new int[m]; r=new int[m]; for(int i=0;i<=m/2;i++){ l[m/2+i]=i; r[m/2+i]=i+1; } for(int i=m/2-1;i>=0;i--){ l[i]=l[lch(i)]; r[i]=r[rch(i)]; } } public T getAll(){ return a[0]; } public T get(int from,int to){ if(from<0||n<to||from>=to){ throw new IllegalArgumentException(String.valueOf(from)+","+String.valueOf(to)); } return get(from,to,0); } private T get(int from,int to,int node){ if(from==l[node]&&to==r[node]){ return a[node]; }else{ if(to<=l[node]+(r[node]-l[node])/2){ return get(from,to,lch(node)); }else if(l[node]+(r[node]-l[node])/2<=from){ return get(from,to,rch(node)); }else{ return op.apply(get(from,l[node]+(r[node]-l[node])/2,lch(node)),get(l[node]+(r[node]-l[node])/2,to,rch(node))); } } } public void set(T ob,int i){ if(i<0||n<=i){ throw new IndexOutOfBoundsException(String.valueOf(i)+"isOutFromLength "+String.valueOf(n)); } int j=m/2+i; a[j]=ob; while(true){ if(j==0){ break; } j=prt(j); a[j]=op.apply(a[lch(j)],a[rch(j)]); } } static private int prt(int node){ return (node-1)/2; } static private int lch(int node){ return 2*node+1; } static private int rch(int node){ return 2*node+2; } public String toString(){ return Arrays.toString(a); } } static boolean next_permutation(int[] per){ if(per.length<2){ return false; } int i; for(i=per.length-1;i>0;i--){ if(per[i-1]<per[i]){ break; } } if(0<i){ i--; int tmp; int j; for(j=per.length-1;j>i;j--){ if(per[j]>per[i]){ break; } } //swap(i,j) tmp=per[i]; per[i]=per[j]; per[j]=tmp; for(int k=i+1;k<(i+1+per.length)/2;k++){ //swap(k,per.length-k+i) tmp=per[k]; per[k]=per[per.length-k+i]; per[per.length-k+i]=tmp; } return true; } int tmp; for(int k=0;k<per.length;k++){ //swap(k,per.length-k-1) tmp=per[k]; per[k]=per[per.length-k-1]; per[per.length-k-1]=tmp; } return false; } static boolean next_bits(boolean[] b){ for(int i=0;i<b.length;i++){ if(b[i]){ b[i]=false; }else{ b[i]=true; return true; } } return false; } static class Scnr{ private final InputStream ins; private final byte[] buffer = new byte[1024]; private int ptr = 0; private int buflen = 0; Scnr(){ this(System.in); } Scnr(InputStream in){ ins = in; } private boolean hasNextByte(){ if(ptr<buflen){ return true; }else{ ptr = 0; try{ buflen = ins.read(buffer); }catch(IOException e){ e.printStackTrace(); } if(buflen<=0){ return false; } } return true; } private int readByte(){ if(hasNextByte()){ return buffer[ptr++]; }else{ return -1; } } private static boolean isPrintableChar(int c){ return 33<=c&&c<=126; } public boolean hasNext(){ while(hasNextByte()&&!isPrintableChar(buffer[ptr])){ ptr++; } return hasNextByte(); } public String next(){ return nextBuilder().toString(); } public StringBuilder nextBuilder(){ if(!hasNext()){ throw new NoSuchElementException(); } StringBuilder sb = new StringBuilder(); int b = readByte(); while(isPrintableChar(b)){ sb.appendCodePoint(b); b = readByte(); } return sb; } public double nextDouble(){ return Double.parseDouble(next()); } public long nextLong(){ if(!hasNext()){ throw new NoSuchElementException(); } long n = 0; boolean minus = false; int b = readByte(); if(b=='-'){ minus=true; b=readByte(); } if(b<'0'||'9'<b){ throw new NumberFormatException(); } while(true){ if('0'<=b&&b<='9'){ n*=10; n+=b-'0'; }else if(b==-1||!isPrintableChar(b)){ return minus?-n:n; }else{ throw new NumberFormatException(); } b=readByte(); } } public int nextInt(){ long nl=nextLong(); if(nl<Integer.MIN_VALUE||Integer.MAX_VALUE<nl){ throw new NumberFormatException(); } return (int) nl; } public String[] nextA(int n){ String[] a = new String[n]; nextA(a,n); return a; } public void nextA(String[] a,int n){ nextA(a,0,n); } public void nextA(String[] a,int off,int len){ for(int i=off;i<off+len;i++){ a[i]=next(); } } public int[] nextAInt(int n){ int[] a = new int[n]; nextAInt(a,n); return a; } public void nextAInt(int[] a,int n){ nextAInt(a,0,n); } public void nextAInt(int[] a,int off,int len){ for(int i=off;i<off+len;i++){ a[i] = nextInt(); } } public long[] nextALong(int n){ long[] a = new long[n]; nextALong(a,n); return a; } public void nextALong(long[] a,int n){ nextALong(a,0,n); } public void nextALong(long[] a,int off,int len){ for(int i=off;i<off+len;i++){ a[i] = nextLong(); } } public double[] nextADouble(int n){ double[] a = new double[n]; nextADouble(a,n); return a; } public void nextADouble(double[] a,int n){ nextADouble(a,0,n); } public void nextADouble(double[] a,int off,int len){ for(int i=off;i<off+len;i++){ a[i] = nextDouble(); } } public List<Integer> nextLInt(int n){ List<Integer> l = new ArrayList<>(n); for(int i=0;i<n;i++){ l.add(sc.nextInt()); } return l; } public List<Long> nextLLong(int n){ List<Long> l = new ArrayList<>(n); for(int i=0;i<n;i++){ l.add(sc.nextLong()); } return l; } public List<Double> nextLDouble(int n){ List<Double> l = new ArrayList<>(n); for(int i=0;i<n;i++){ l.add(sc.nextDouble()); } return l; } } static Scnr sc = new Scnr(); static PrintWriter out = new PrintWriter(System.out); public static void main(String args[]){ //for(int i=sc.nextInt();i>0;i--) solve(); out.flush(); } static void solve(){ long s=sc.nextLong(); long c=sc.nextLong(); if(c>=s*2){ out.println((s*2+c)/4); }else{ out.println(c/2); } } }
a.cc:358:7: error: stray '@' in program 358 | @SuppressWarnings("unchecked") | ^ a.cc:384:7: error: stray '@' in program 384 | @SuppressWarnings("unchecked") | ^ 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: 'import' does not name a type 2 | import java.io.*; | ^~~~~~ a.cc:2:1: note: C++20 'import' only available with '-fmodules-ts' a.cc:4:1: error: expected unqualified-id before 'public' 4 | public class Main{ | ^~~~~~
s356788478
p03797
C++
#include <bits/stdc++.h> using namespace std; using ll = long long; #define rep(i, n) for (int i = 0; i < (int)(n); i++) int main() { ll n, m;cin>>n>>m; ll ans=min(n, m/2); m = max(0, m - n*2); ans += m / 4; cout << ans; }
a.cc: In function 'int main()': a.cc:9:10: error: no matching function for call to 'max(int, ll)' 9 | m = max(0, m - n*2); | ~~~^~~~~~~~~~~~ In file included from /usr/include/c++/14/algorithm:60, from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:51, from a.cc:1: /usr/include/c++/14/bits/stl_algobase.h:257:5: note: candidate: 'template<class _Tp> constexpr const _Tp& std::max(const _Tp&, const _Tp&)' 257 | max(const _Tp& __a, const _Tp& __b) | ^~~ /usr/include/c++/14/bits/stl_algobase.h:257:5: note: template argument deduction/substitution failed: a.cc:9:10: note: deduced conflicting types for parameter 'const _Tp' ('int' and 'll' {aka 'long long int'}) 9 | m = max(0, m - n*2); | ~~~^~~~~~~~~~~~ /usr/include/c++/14/bits/stl_algobase.h:303:5: note: candidate: 'template<class _Tp, class _Compare> constexpr const _Tp& std::max(const _Tp&, const _Tp&, _Compare)' 303 | max(const _Tp& __a, const _Tp& __b, _Compare __comp) | ^~~ /usr/include/c++/14/bits/stl_algobase.h:303:5: note: candidate expects 3 arguments, 2 provided In file included from /usr/include/c++/14/algorithm:61: /usr/include/c++/14/bits/stl_algo.h:5706:5: note: candidate: 'template<class _Tp> constexpr _Tp std::max(initializer_list<_Tp>)' 5706 | max(initializer_list<_Tp> __l) | ^~~ /usr/include/c++/14/bits/stl_algo.h:5706:5: note: candidate expects 1 argument, 2 provided /usr/include/c++/14/bits/stl_algo.h:5716:5: note: candidate: 'template<class _Tp, class _Compare> constexpr _Tp std::max(initializer_list<_Tp>, _Compare)' 5716 | max(initializer_list<_Tp> __l, _Compare __comp) | ^~~ /usr/include/c++/14/bits/stl_algo.h:5716:5: note: template argument deduction/substitution failed: a.cc:9:10: note: mismatched types 'std::initializer_list<_Tp>' and 'int' 9 | m = max(0, m - n*2); | ~~~^~~~~~~~~~~~
s630891030
p03797
C++
#include <iostream> #include <string> #include <algorithm> #include <vector> #include <cmath> #include <map> #include <iomanip> typedef long long ll; #define rep(i,a,b) for(int i=a;i<b;++i) #define rrep(i,a,b) for(int i=a;i>=b;--i) using namespace std; ll mod = 1e9 + 7; using namespace std; using Graph = vector<vector<int>>; Graph G; int main() { int S, M; cin >> S >> M; if (2 * S > M) { cout << M / 2 << endl; } else { cout << S + (M - 2 * N) / 4 << endl; } return 0; }
a.cc: In function 'int main()': a.cc:29:38: error: 'N' was not declared in this scope 29 | cout << S + (M - 2 * N) / 4 << endl; | ^
s022914662
p03797
C++
#include<bits/stdc++.h> using namespace std; long long n,m; int main() { cin>>n>>m; cout<<min(n,m/2)+max(m-n*2,0)/4; return 0; }
a.cc: In function 'int main()': a.cc:7:25: error: no matching function for call to 'max(long long int, int)' 7 | cout<<min(n,m/2)+max(m-n*2,0)/4; | ~~~^~~~~~~~~ In file included from /usr/include/c++/14/algorithm:60, from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:51, from a.cc:1: /usr/include/c++/14/bits/stl_algobase.h:257:5: note: candidate: 'template<class _Tp> constexpr const _Tp& std::max(const _Tp&, const _Tp&)' 257 | max(const _Tp& __a, const _Tp& __b) | ^~~ /usr/include/c++/14/bits/stl_algobase.h:257:5: note: template argument deduction/substitution failed: a.cc:7:25: note: deduced conflicting types for parameter 'const _Tp' ('long long int' and 'int') 7 | cout<<min(n,m/2)+max(m-n*2,0)/4; | ~~~^~~~~~~~~ /usr/include/c++/14/bits/stl_algobase.h:303:5: note: candidate: 'template<class _Tp, class _Compare> constexpr const _Tp& std::max(const _Tp&, const _Tp&, _Compare)' 303 | max(const _Tp& __a, const _Tp& __b, _Compare __comp) | ^~~ /usr/include/c++/14/bits/stl_algobase.h:303:5: note: candidate expects 3 arguments, 2 provided In file included from /usr/include/c++/14/algorithm:61: /usr/include/c++/14/bits/stl_algo.h:5706:5: note: candidate: 'template<class _Tp> constexpr _Tp std::max(initializer_list<_Tp>)' 5706 | max(initializer_list<_Tp> __l) | ^~~ /usr/include/c++/14/bits/stl_algo.h:5706:5: note: candidate expects 1 argument, 2 provided /usr/include/c++/14/bits/stl_algo.h:5716:5: note: candidate: 'template<class _Tp, class _Compare> constexpr _Tp std::max(initializer_list<_Tp>, _Compare)' 5716 | max(initializer_list<_Tp> __l, _Compare __comp) | ^~~ /usr/include/c++/14/bits/stl_algo.h:5716:5: note: template argument deduction/substitution failed: a.cc:7:25: note: mismatched types 'std::initializer_list<_Tp>' and 'long long int' 7 | cout<<min(n,m/2)+max(m-n*2,0)/4; | ~~~^~~~~~~~~
s854000503
p03797
C++
#include<bits/stdc++.h> using namespace std; long long n,m; int main() { cin>>n>>m; cout<<min(n,m/2)+max(m-n*2,0)/4; return 0; }
a.cc: In function 'int main()': a.cc:7:25: error: no matching function for call to 'max(long long int, int)' 7 | cout<<min(n,m/2)+max(m-n*2,0)/4; | ~~~^~~~~~~~~ In file included from /usr/include/c++/14/algorithm:60, from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:51, from a.cc:1: /usr/include/c++/14/bits/stl_algobase.h:257:5: note: candidate: 'template<class _Tp> constexpr const _Tp& std::max(const _Tp&, const _Tp&)' 257 | max(const _Tp& __a, const _Tp& __b) | ^~~ /usr/include/c++/14/bits/stl_algobase.h:257:5: note: template argument deduction/substitution failed: a.cc:7:25: note: deduced conflicting types for parameter 'const _Tp' ('long long int' and 'int') 7 | cout<<min(n,m/2)+max(m-n*2,0)/4; | ~~~^~~~~~~~~ /usr/include/c++/14/bits/stl_algobase.h:303:5: note: candidate: 'template<class _Tp, class _Compare> constexpr const _Tp& std::max(const _Tp&, const _Tp&, _Compare)' 303 | max(const _Tp& __a, const _Tp& __b, _Compare __comp) | ^~~ /usr/include/c++/14/bits/stl_algobase.h:303:5: note: candidate expects 3 arguments, 2 provided In file included from /usr/include/c++/14/algorithm:61: /usr/include/c++/14/bits/stl_algo.h:5706:5: note: candidate: 'template<class _Tp> constexpr _Tp std::max(initializer_list<_Tp>)' 5706 | max(initializer_list<_Tp> __l) | ^~~ /usr/include/c++/14/bits/stl_algo.h:5706:5: note: candidate expects 1 argument, 2 provided /usr/include/c++/14/bits/stl_algo.h:5716:5: note: candidate: 'template<class _Tp, class _Compare> constexpr _Tp std::max(initializer_list<_Tp>, _Compare)' 5716 | max(initializer_list<_Tp> __l, _Compare __comp) | ^~~ /usr/include/c++/14/bits/stl_algo.h:5716:5: note: template argument deduction/substitution failed: a.cc:7:25: note: mismatched types 'std::initializer_list<_Tp>' and 'long long int' 7 | cout<<min(n,m/2)+max(m-n*2,0)/4; | ~~~^~~~~~~~~
s081341774
p03797
C++
#include <bits/stdc++.h> using namespace std; #define rep(i, n) for (int i = 0; i < n; ++i) #define ALL(a) (a).begin(), (a).end() template <class T> inline bool chmin(T &a, T b) { if (a > b) { a = b; return true; } return false; } template <class T> inline bool chmax(T &a, T b) { if (a < b) { a = b; return true; } return false; } using ll = long long; using ld = long double; using P = pair<int, int>; using DoP = pair<double, double>; using edge = struct{ int to; ll cost;}; const int di[] = {0, 1, 0, -1, 1, 1, -1, -1}; const int dj[] = {1, 0, -1, 0, 1, -1, 1, -1}; const int INF = 1e9 + 100; const ll INF64 = 7e18l; const int mod = 1000000007; struct Sieve { int n; vector<int> f, primes; Sieve(int n = 1) : n(n), f(n + 1) { f[0] = f[1] = -1; for (ll i = 2; i <= n; ++i) { if (f[i]) continue; primes.push_back(i); f[i] = i; for (ll j = i * i; j <= n; j += i) { if (!f[j]) f[j] = i; } } } bool isPrime(int x) { return f[x] == x; } vector<int> factorList(int x) { vector<int> res; while (x != 1) { res.push_back(f[x]); x /= f[x]; } return res; } vector<P> factor(int x) { vector<int> fl = factorList(x); if (fl.size() == 0) return {}; vector<P> res(1, P(fl[0], 0)); for (int p : fl) { if (res.back().first == p) { res.back().second++; } else { res.emplace_back(p, 1); } } return res; } }; struct UnionFind { vector<int> par; UnionFind(int N) : par(N) { for (int i = 0; i < N; i++) par[i] = i; } int root(int x) { if (par[x] == x) return x; return par[x] = root(par[x]); } void unite(int x, int y) { int rx = root(x); int ry = root(y); if (rx == ry) return; par[rx] = ry; } bool same(int x, int y) { int rx = root(x); int ry = root(y); return rx == ry; } }; struct mint { ll x; // typedef long long ll; mint(ll x = 0) : x((x % mod + mod) % mod) {} mint operator-() const { return mint(-x); } mint &operator+=(const mint a) { if ((x += a.x) >= mod) x -= mod; return *this; } mint &operator-=(const mint a) { if ((x += mod - a.x) >= mod) x -= mod; return *this; } mint &operator*=(const mint a) { (x *= a.x) %= mod; return *this; } mint operator+(const mint a) const { mint res(*this); return res += a; } mint operator-(const mint a) const { mint res(*this); return res -= a; } mint operator*(const mint a) const { mint res(*this); return res *= a; } mint pow(ll t) const { if (!t) return 1; mint a = pow(t >> 1); a *= a; if (t & 1) a *= *this; return a; } // for prime mod mint inv() const { return pow(mod - 2); } mint &operator/=(const mint a) { return (*this) *= a.inv(); } mint operator/(const mint a) const { mint res(*this); return res /= a; } }; struct combination { vector<mint> fact, ifact; combination(int n) : fact(n + 1), ifact(n + 1) { assert(n < mod); fact[0] = 1; for (int i = 1; i <= n; ++i) fact[i] = fact[i - 1] * i; ifact[n] = fact[n].inv(); for (int i = n; i >= 1; --i) ifact[i - 1] = ifact[i] * i; } mint operator()(int n, int k) { if (k < 0 || k > n) return 0; return fact[n] * ifact[k] * ifact[n - k]; } }; int main() { ll n, m; cin >> n >> m; ll ans1 = min(n, m/2ll); ll ans2 = max(0, (m - 2ll*ans1)/4ll); ll ans = ans1 + ans2; cout << ans << endl; }
a.cc: In function 'int main()': a.cc:207:16: error: no matching function for call to 'max(int, ll)' 207 | ll ans2 = max(0, (m - 2ll*ans1)/4ll); | ~~~^~~~~~~~~~~~~~~~~~~~~~~ In file included from /usr/include/c++/14/algorithm:60, from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:51, from a.cc:1: /usr/include/c++/14/bits/stl_algobase.h:257:5: note: candidate: 'template<class _Tp> constexpr const _Tp& std::max(const _Tp&, const _Tp&)' 257 | max(const _Tp& __a, const _Tp& __b) | ^~~ /usr/include/c++/14/bits/stl_algobase.h:257:5: note: template argument deduction/substitution failed: a.cc:207:16: note: deduced conflicting types for parameter 'const _Tp' ('int' and 'll' {aka 'long long int'}) 207 | ll ans2 = max(0, (m - 2ll*ans1)/4ll); | ~~~^~~~~~~~~~~~~~~~~~~~~~~ /usr/include/c++/14/bits/stl_algobase.h:303:5: note: candidate: 'template<class _Tp, class _Compare> constexpr const _Tp& std::max(const _Tp&, const _Tp&, _Compare)' 303 | max(const _Tp& __a, const _Tp& __b, _Compare __comp) | ^~~ /usr/include/c++/14/bits/stl_algobase.h:303:5: note: candidate expects 3 arguments, 2 provided In file included from /usr/include/c++/14/algorithm:61: /usr/include/c++/14/bits/stl_algo.h:5706:5: note: candidate: 'template<class _Tp> constexpr _Tp std::max(initializer_list<_Tp>)' 5706 | max(initializer_list<_Tp> __l) | ^~~ /usr/include/c++/14/bits/stl_algo.h:5706:5: note: candidate expects 1 argument, 2 provided /usr/include/c++/14/bits/stl_algo.h:5716:5: note: candidate: 'template<class _Tp, class _Compare> constexpr _Tp std::max(initializer_list<_Tp>, _Compare)' 5716 | max(initializer_list<_Tp> __l, _Compare __comp) | ^~~ /usr/include/c++/14/bits/stl_algo.h:5716:5: note: template argument deduction/substitution failed: a.cc:207:16: note: mismatched types 'std::initializer_list<_Tp>' and 'int' 207 | ll ans2 = max(0, (m - 2ll*ans1)/4ll); | ~~~^~~~~~~~~~~~~~~~~~~~~~~
s258471809
p03797
C++
#include <bits/stdc++.h> using namespace std; int main(){ long long N,M; cin>>N>>M; if(2*N>=M){ cout<<M/2<<endl; }else{ x=M-2*N; cout<<(M-2*x/3)/2<<endl; } }
a.cc: In function 'int main()': a.cc:10:5: error: 'x' was not declared in this scope 10 | x=M-2*N; | ^
s434730018
p03797
C++
#include <iostream> #include <vector> #include <bits/stdc++.h> #define rep(i, n) for (int i = 0; i < (n); ++i) using namespace std; typedef long long ll; typedef pair<int, int> P; #define pb push_back #define eb emplace_back #define fi first #define se second #define bg begin() #define ed end() #define all(x) x.bg, x.ed #ifdef LOCAL #define dmp(x) cerr << __LINE__ << " " << #x << " " << x << endl #else #define dmp(x) void(0) #endif template <class t, class u> void chmax(t &a, u b) { if (a < b) a = b; } template <class t, class u> void chmin(t &a, u b) { if (b < a) a = b; } const int mod = 1000000007; struct mint { ll x; // typedef long long ll; mint(ll x = 0) : x((x % mod + mod) % mod) {} mint &operator+=(const mint a) { if ((x += a.x) >= mod) x -= mod; return *this; } mint &operator-=(const mint a) { if ((x += mod - a.x) >= mod) x -= mod; return *this; } mint &operator*=(const mint a) { (x *= a.x) %= mod; return *this; } mint operator+(const mint a) const { mint res(*this); return res += a; } mint operator-(const mint a) const { mint res(*this); return res -= a; } mint operator*(const mint a) const { mint res(*this); return res *= a; } mint pow(ll t) const { if (!t) return 1; mint a = pow(t >> 1); a *= a; if (t & 1) a *= *this; return a; } // for prime mod mint inv() const { return pow(mod - 2); } mint &operator/=(const mint a) { return (*this) *= a.inv(); } mint operator/(const mint a) const { mint res(*this); return res /= a; } }; struct combination { vector<mint> fact, ifact; combination(int n) : fact(n + 1), ifact(n + 1) { assert(n < mod); fact[0] = 1; for (int i = 1; i <= n; ++i) fact[i] = fact[i - 1] * i; ifact[n] = fact[n].inv(); for (int i = n; i >= 1; --i) ifact[i - 1] = ifact[i] * i; } mint operator()(int n, int k) { if (k < 0 || k > n) return 0; return fact[n] * ifact[k] * ifact[n - k]; } }; template <class t> using vc = vector<t>; template <class t> using vvc = vc<vc<t>>; using vi = vc<int>; int gcd(int a, int b) { if (b == 0) return a; return gcd(b, a % b); } int lcm(int a, int b) { return (a * b) / gcd(a, b); } int fact(int n) { if (n == 0) return 1; return n * fact(n - 1); } int main() { int n, m; cin >> n >> m; if(n>m){ cout<< m/<<endl; }else{ cout<<(m+n)/4<<endl; } }
a.cc: In function 'int main()': a.cc:146:12: error: expected primary-expression before '<<' token 146 | cout<< m/<<endl; | ^~
s887234988
p03797
C++
#include <iostream> #include <vector> #include <bits/stdc++.h> #define rep(i, n) for (int i = 0; i < (n); ++i) using namespace std; typedef long long ll; typedef pair<int, int> P; #define pb push_back #define eb emplace_back #define fi first #define se second #define bg begin() #define ed end() #define all(x) x.bg, x.ed #ifdef LOCAL #define dmp(x) cerr << __LINE__ << " " << #x << " " << x << endl #else #define dmp(x) void(0) #endif template <class t, class u> void chmax(t &a, u b) { if (a < b) a = b; } template <class t, class u> void chmin(t &a, u b) { if (b < a) a = b; } const int mod = 1000000007; struct mint { ll x; // typedef long long ll; mint(ll x = 0) : x((x % mod + mod) % mod) {} mint &operator+=(const mint a) { if ((x += a.x) >= mod) x -= mod; return *this; } mint &operator-=(const mint a) { if ((x += mod - a.x) >= mod) x -= mod; return *this; } mint &operator*=(const mint a) { (x *= a.x) %= mod; return *this; } mint operator+(const mint a) const { mint res(*this); return res += a; } mint operator-(const mint a) const { mint res(*this); return res -= a; } mint operator*(const mint a) const { mint res(*this); return res *= a; } mint pow(ll t) const { if (!t) return 1; mint a = pow(t >> 1); a *= a; if (t & 1) a *= *this; return a; } // for prime mod mint inv() const { return pow(mod - 2); } mint &operator/=(const mint a) { return (*this) *= a.inv(); } mint operator/(const mint a) const { mint res(*this); return res /= a; } }; struct combination { vector<mint> fact, ifact; combination(int n) : fact(n + 1), ifact(n + 1) { assert(n < mod); fact[0] = 1; for (int i = 1; i <= n; ++i) fact[i] = fact[i - 1] * i; ifact[n] = fact[n].inv(); for (int i = n; i >= 1; --i) ifact[i - 1] = ifact[i] * i; } mint operator()(int n, int k) { if (k < 0 || k > n) return 0; return fact[n] * ifact[k] * ifact[n - k]; } }; template <class t> using vc = vector<t>; template <class t> using vvc = vc<vc<t>>; using vi = vc<int>; int gcd(int a, int b) { if (b == 0) return a; return gcd(b, a % b); } int lcm(int a, int b) { return (a * b) / gcd(a, b); } int fact(int n) { if (n == 0) return 1; return n * fact(n - 1); } int main() { int n, m; cin >> n >> m; if(n>m){ cout>>m/2>>endl; }else{ cout>>(m+n)/4>>endl; } }
a.cc: In function 'int main()': a.cc:146:7: error: no match for 'operator>>' (operand types are 'std::ostream' {aka 'std::basic_ostream<char>'} and 'int') 146 | cout>>m/2>>endl; | ~~~~^~~~~ | | | | | int | std::ostream {aka std::basic_ostream<char>} a.cc:146:7: note: candidate: 'operator>>(int, int)' (built-in) 146 | cout>>m/2>>endl; | ~~~~^~~~~ a.cc:146:7: note: no known conversion for argument 1 from 'std::ostream' {aka 'std::basic_ostream<char>'} to 'int' In file included from /usr/include/c++/14/string:55, from /usr/include/c++/14/bits/locale_classes.h:40, from /usr/include/c++/14/bits/ios_base.h:41, from /usr/include/c++/14/ios:44, from /usr/include/c++/14/ostream:40, from /usr/include/c++/14/iostream:41, from a.cc:1: /usr/include/c++/14/bits/basic_string.tcc:835:5: note: candidate: 'template<class _CharT, class _Traits, class _Alloc> std::basic_istream<_CharT, _Traits>& std::operator>>(basic_istream<_CharT, _Traits>&, __cxx11::basic_string<_CharT, _Traits, _Allocator>&)' 835 | operator>>(basic_istream<_CharT, _Traits>& __in, | ^~~~~~~~ /usr/include/c++/14/bits/basic_string.tcc:835:5: note: template argument deduction/substitution failed: a.cc:146:11: note: 'std::ostream' {aka 'std::basic_ostream<char>'} is not derived from 'std::basic_istream<_CharT, _Traits>' 146 | cout>>m/2>>endl; | ^ In file included from /usr/include/c++/14/bits/memory_resource.h:38, from /usr/include/c++/14/string:68: /usr/include/c++/14/cstddef:131:5: note: candidate: 'template<class _IntegerType> constexpr std::__byte_op_t<_IntegerType> std::operator>>(byte, _IntegerType)' 131 | operator>>(byte __b, _IntegerType __shift) noexcept | ^~~~~~~~ /usr/include/c++/14/cstddef:131:5: note: template argument deduction/substitution failed: a.cc:146:3: note: cannot convert 'std::cout' (type 'std::ostream' {aka 'std::basic_ostream<char>'}) to type 'std::byte' 146 | cout>>m/2>>endl; | ^~~~ In file included from /usr/include/c++/14/istream:1109, from /usr/include/c++/14/iostream:42: /usr/include/c++/14/bits/istream.tcc:978:5: note: candidate: 'template<class _CharT, class _Traits> std::basic_istream<_CharT, _Traits>& std::operator>>(basic_istream<_CharT, _Traits>&, _CharT&)' 978 | operator>>(basic_istream<_CharT, _Traits>& __in, _CharT& __c) | ^~~~~~~~ /usr/include/c++/14/bits/istream.tcc:978:5: note: template argument deduction/substitution failed: a.cc:146:11: note: 'std::ostream' {aka 'std::basic_ostream<char>'} is not derived from 'std::basic_istream<_CharT, _Traits>' 146 | cout>>m/2>>endl; | ^ /usr/include/c++/14/istream:849:5: note: candidate: 'template<class _Traits> std::basic_istream<char, _Traits>& std::operator>>(basic_istream<char, _Traits>&, unsigned char&)' 849 | operator>>(basic_istream<char, _Traits>& __in, unsigned char& __c) | ^~~~~~~~ /usr/include/c++/14/istream:849:5: note: template argument deduction/substitution failed: a.cc:146:11: note: 'std::ostream' {aka 'std::basic_ostream<char>'} is not derived from 'std::basic_istream<char, _Traits>' 146 | cout>>m/2>>endl; | ^ /usr/include/c++/14/istream:854:5: note: candidate: 'template<class _Traits> std::basic_istream<char, _Traits>& std::operator>>(basic_istream<char, _Traits>&, signed char&)' 854 | operator>>(basic_istream<char, _Traits>& __in, signed char& __c) | ^~~~~~~~ /usr/include/c++/14/istream:854:5: note: template argument deduction/substitution failed: a.cc:146:11: note: 'std::ostream' {aka 'std::basic_ostream<char>'} is not derived from 'std::basic_istream<char, _Traits>' 146 | cout>>m/2>>endl; | ^ /usr/include/c++/14/istream:896:5: note: candidate: 'template<class _CharT, class _Traits> std::basic_istream<_CharT, _Traits>& std::operator>>(basic_istream<_CharT, _Traits>&, _CharT*)' 896 | operator>>(basic_istream<_CharT, _Traits>& __in, _CharT* __s) | ^~~~~~~~ /usr/include/c++/14/istream:896:5: note: template argument deduction/substitution failed: a.cc:146:11: note: 'std::ostream' {aka 'std::basic_ostream<char>'} is not derived from 'std::basic_istream<_CharT, _Traits>' 146 | cout>>m/2>>endl; | ^ /usr/include/c++/14/istream:939:5: note: candidate: 'template<class _Traits> std::basic_istream<char, _Traits>& std::operator>>(basic_istream<char, _Traits>&, unsigned char*)' 939 | operator>>(basic_istream<char, _Traits>& __in, unsigned char* __s) | ^~~~~~~~ /usr/include/c++/14/istream:939:5: note: template argument deduction/substitution failed: a.cc:146:11: note: 'std::ostream' {aka 'std::basic_ostream<char>'} is not derived from 'std::basic_istream<char, _Traits>' 146 | cout>>m/2>>endl; | ^ /usr/include/c++/14/istream:945:5: note: candidate: 'template<class _Traits> std::basic_istream<char, _Traits>& std::operator>>(basic_istream<char, _Traits>&, signed char*)' 945 | operator>>(basic_istream<char, _Traits>& __in, signed char* __s) | ^~~~~~~~ /usr/include/c++/14/istream:945:5: note: template argument deduction/substitution failed: a.cc:146:11: note: 'std::ostream' {aka 'std::basic_ostream<char>'} is not derived from 'std::basic_istream<char, _Traits>' 146 | cout>>m/2>>endl; | ^ /usr/include/c++/14/istream:1099:5: note: candidate: 'template<class _Istream, class _Tp> _Istream&& std::operator>>(_Istream&&, _Tp&&)' 1099 | operator>>(_Istream&& __is, _Tp&& __x) | ^~~~~~~~ /usr/include/c++/14/istream:1099:5: note: template argument deduction/substitution failed: /usr/include/c++/14/istream: In substitution of 'template<class _Istream, class _Tp> _Istream&& std::operator>>(_Istream&&, _Tp&&) [with _Istream = std::basic_ostream<char>&; _Tp = int]': a.cc:146:11: required from here 146 | cout>>m/2>>endl; | ^ /usr/include/c++/14/istream:1099:5: error: no type named 'type' in 'struct std::enable_if<false, void>' 1099 | operator>>(_Istream&& __is, _Tp&& __x) | ^~~~~~~~ In file included from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:52, from a.cc:3: /usr/include/c++/14/bitset:1597:5: note: candidate: 'template<class _CharT, class _Traits, long unsigned int _Nb> std::basic_istream<_CharT, _Traits>& std::operator>>(basic_istream<_CharT, _Traits>&, bitset<_Nb>&)' 1597 | operator>>(std::basic_istream<_CharT, _Traits>& __is, bitset<_Nb>& __x) | ^~~~~~~~ /usr/include/c++/14/bitset:1597:5: note: template argument deduction/substitution failed: a.cc:146:11: note: 'std::ostream' {aka 'std::basic_ostream<char>'} is not derived from 'std::basic_istream<_CharT, _Traits>' 146 | cout>>m/2>>endl; | ^ In file included from /usr/include/c++/14/ccomplex:39, from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:127: /usr/include/c++/14/complex:509:5: note: candidate: 'template<class _Tp, class _CharT, class _Traits> std::basic_istream<_CharT, _Traits>& std::operator>>(basic_istream<_CharT, _Traits>&, complex<_Tp>&)' 509 | operator>>(basic_istream<_CharT, _Traits>& __is, complex<_Tp>& __x) | ^~~~~~~~ /usr/include/c++/14/complex:509:5: note: template argument deduction/substitution failed: a.cc:146:11: note: 'std::ostream' {aka 'std::basic_ostream<char>'} is not derived from 'std::basic_istream<_CharT, _Traits>' 146 | cout>>m/2>>endl; | ^ In file included from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:143: /usr/include/c++/14/iomanip:76:5: note: candidate: 'template<class _CharT, class _Traits> std::basic_istream<_CharT, _Traits>& std::operator>>(basic_istream<_CharT, _Traits>&, _Resetiosflags)' 76 | operator>>(basic_istream<_CharT, _Traits>& __is, _Resetiosflags __f) | ^~~~~~~~ /usr/include/c++/14/iomanip:76:5: note: template argument deduction/substitution failed: a.cc:146:11: note: 'std::ostream' {aka 'std::basic_ostream<char>'} is not derived from 'std::basic_istream<_CharT, _Traits>' 146 | cout>>m/2>>endl; | ^ /usr/include/c++/14/iomanip:106:5: note: candidate: 'template<class _CharT, class _Traits> std::basic_istream<_CharT, _Traits>& std::operator>>(basic_istream<_CharT, _Traits>&, _Setiosflags)' 106 | operator>>(basic_istream<_CharT, _Traits>& __is, _Setiosflags __f) | ^~~~~~~~ /usr/include/c++/14/iomanip:106:5: note: template argument deduction/substitution failed: a.cc:146:11: note: 'std::ostream' {aka 'std::basic_ostream<char>'} is not derived from 'std::basic_istream<_CharT, _Traits>' 146 | cout>>m/2>>endl; | ^ /usr/include/c++/14/iomanip:137:5: note: candidate: 'template<class _CharT, class _Traits> std::basic_istream<_CharT, _Traits>& std::operator>>(basic_istream<_CharT, _Traits>&, _Setbase)' 137 | operator>>(basic_istream<_CharT, _Traits>& __is, _Setbase __f) | ^~~~~~~~ /usr/include/c++/14/iomanip:137:5: note: template argument deduction/substitution failed: a.cc:146:11: note: 'std::ostream' {aka 'std::basic_ostream<char>'} is not derived from 'std::basic_istream<_CharT, _Traits>' 146 | cout>>m/2>>endl; | ^ /usr/include/c++/14/iomanip:177:5: note: candidate: 'template<class _CharT, class _Traits> std::basic_istream<_CharT, _Traits>& std::operator>>(basic_istream<_CharT, _Traits>&, _Setfill<_CharT>)' 177 | operator>>(basic_istream<_CharT, _Traits>& __is, _Setfill<_CharT> __f) | ^~~~~~~~ /usr/include/c++/14/iomanip:177:5: note: template argument deduction/substitution failed: a.cc:146:11: note: 'std::ostream' {aka 'std::basic_ostream<char>'} is not derived from 'std::basic_istream<_CharT, _Traits>' 146 | cout>>m/2>>endl; | ^ /usr/include/c++/14/iomanip:207:5: note: candidate: 'template<class _CharT, class _Traits> std::basic_istream<_CharT, _Traits>& std::operator>>(basic_istream<_CharT, _Traits>&, _Setprecision)' 207 | operator>>(basic_istream<_CharT, _Traits>& __is, _Setprecision _
s477779516
p03797
C++
#include<bits/stdc++.h> using names#include<bits/stdc++.h> using namespace std; long long n,m; int main(){ scanf("%lld%lld",&n,&m); if(n*2>m){ printf("%lld\n",m/2); exit(0); } else{ long long ans=n; m-=n*2; ans+=m/4; printf("%lld\n",ans); } return 0; }pace std; int main() { long long s,c,n=0; scanf("%lld %lld",&s,&c); for(;;) if(s<0) {s++,c++,c++,n--; break;} else if(c<0) {c++,c++,n--; cout<<n<<endl; return 0;} else s--,c--,c--,n++; cout<<s+c/4+n<<endl; return 0; }#include<bits/stdc++.h> using namespace std; long long n,m; int main(){ scanf("%lld%lld",&n,&m); if(n*2>m){ printf("%lld\n",m/2); exit(0); } else{ long long ans=n; m-=n*2; ans+=m/4; printf("%lld\n",ans); } return 0; }
a.cc:3:12: error: stray '#' in program 3 | using names#include<bits/stdc++.h> | ^ a.cc:30:2: error: stray '#' in program 30 | }#include<bits/stdc++.h> | ^ a.cc:3:7: error: expected nested-name-specifier before 'names' 3 | using names#include<bits/stdc++.h> | ^~~~~ a.cc:19:2: error: 'pace' does not name a type 19 | }pace std; | ^~~~ a.cc:20:5: error: redefinition of 'int main()' 20 | int main() | ^~~~ a.cc:6:5: note: 'int main()' previously defined here 6 | int main(){ | ^~~~ a.cc: In function 'int main()': a.cc:26:32: error: 'cout' was not declared in this scope; did you mean 'std::cout'? 26 | else if(c<0) {c++,c++,n--; cout<<n<<endl; return 0;} | ^~~~ | std::cout In file included from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:146, from a.cc:1: /usr/include/c++/14/iostream:63:18: note: 'std::cout' declared here 63 | extern ostream cout; ///< Linked to standard output | ^~~~ a.cc:26:41: error: 'endl' was not declared in this scope; did you mean 'std::endl'? 26 | else if(c<0) {c++,c++,n--; cout<<n<<endl; return 0;} | ^~~~ | std::endl In file included from /usr/include/c++/14/istream:41, from /usr/include/c++/14/sstream:40, from /usr/include/c++/14/complex:45, from /usr/include/c++/14/ccomplex:39, from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:127: /usr/include/c++/14/ostream:744:5: note: 'std::endl' declared here 744 | endl(basic_ostream<_CharT, _Traits>& __os) | ^~~~ a.cc:28:5: error: 'cout' was not declared in this scope; did you mean 'std::cout'? 28 | cout<<s+c/4+n<<endl; | ^~~~ | std::cout /usr/include/c++/14/iostream:63:18: note: 'std::cout' declared here 63 | extern ostream cout; ///< Linked to standard output | ^~~~ a.cc:28:20: error: 'endl' was not declared in this scope; did you mean 'std::endl'? 28 | cout<<s+c/4+n<<endl; | ^~~~ | std::endl /usr/include/c++/14/ostream:744:5: note: 'std::endl' declared here 744 | endl(basic_ostream<_CharT, _Traits>& __os) | ^~~~ a.cc: At global scope: a.cc:30:3: error: 'include' does not name a type 30 | }#include<bits/stdc++.h> | ^~~~~~~ a.cc:32:11: error: redefinition of 'long long int n' 32 | long long n,m; | ^ a.cc:5:11: note: 'long long int n' previously declared here 5 | long long n,m; | ^ a.cc:32:13: error: redefinition of 'long long int m' 32 | long long n,m; | ^ a.cc:5:13: note: 'long long int m' previously declared here 5 | long long n,m; | ^ a.cc:33:5: error: redefinition of 'int main()' 33 | int main(){ | ^~~~ a.cc:6:5: note: 'int main()' previously defined here 6 | int main(){ | ^~~~
s708934342
p03797
C++
include <iostream> using namespace std; int main() { long long n , m , javab; cin >> n >> m; if (m > (2 * n)) { m -= (2 * n); javab= (n + (m / 4)); } else javab = (m / 2); cout << ans; }
a.cc:1:1: error: 'include' does not name a type 1 | include <iostream> | ^~~~~~~ a.cc: In function 'int main()': a.cc:8:9: error: 'cin' was not declared in this scope 8 | cin >> n >> m; | ^~~ a.cc:16:9: error: 'cout' was not declared in this scope 16 | cout << ans; | ^~~~ a.cc:16:17: error: 'ans' was not declared in this scope 16 | cout << ans; | ^~~
s348238239
p03797
C++
#include <bits\stdc++.h> using namespace std; int main() { long long n , m , ans , b; cin >> n >> m; if (m > (2 * n)) { m -= (2 * n); ans = (n + (m / 4)); } else ans = (m / 2); cout << ans; }
a.cc:1:10: fatal error: bits\stdc++.h: No such file or directory 1 | #include <bits\stdc++.h> | ^~~~~~~~~~~~~~~ compilation terminated.
s595117052
p03797
C++
v#include <bits/stdc++.h> using namespace std; int main() { long long N, M; cin >> N >> M; long long ans = 0; ans += min(N, M/2); M -= 2*ans; if (M > 0) ans += M/4; cout << ans << endl; }
a.cc:1:2: error: stray '#' in program 1 | v#include <bits/stdc++.h> | ^ a.cc:1:1: error: 'v' does not name a type 1 | v#include <bits/stdc++.h> | ^ a.cc: In function 'int main()': a.cc:6:3: error: 'cin' was not declared in this scope 6 | cin >> N >> M; | ^~~ a.cc:8:10: error: 'min' was not declared in this scope; did you mean 'main'? 8 | ans += min(N, M/2); | ^~~ | main a.cc:11:3: error: 'cout' was not declared in this scope 11 | cout << ans << endl; | ^~~~ a.cc:11:18: error: 'endl' was not declared in this scope 11 | cout << ans << endl; | ^~~~