submission_id
stringlengths
10
10
problem_id
stringlengths
6
6
language
stringclasses
3 values
code
stringlengths
1
522k
compiler_output
stringlengths
43
10.2k
s413878005
p03705
C++
#include <iostream> #include <string> #include <utility> #include <algorithm> #include <map> #include <set> #include <vector> #include <cmath> #include <cstdlib> #include <queue> #include <stack> #include <iomanip> using namespace std; #define REP(i, n) for(ll i = 0;i < n;i++) #define REPR(i, n) for(ll i = n;i >= 0;...
a.cc: In function 'int main()': a.cc:32:29: error: expected ';' before numeric constant 32 | cin >> n >> a >> b;1 3 3 | ^~ | ; a.cc:33:13: error: 'i' was not declared in this scope 33 | REP(i, n - 1) { | ^ a.cc:1...
s590384576
p03705
C++
#include <bits/stdc++.h> #include <numeric> long long int GCD(long long int a,long long int b){long long int c;while(b!=0){c=a%b;a=b;b=c;}return a;} using namespace std; int main() { int a,b,n; cin >> n >> a >> b; if(a>b){ cout << 0 << endll; } else if(n=1&&a!=b){ cout << 0 << endl; } else{ c...
a.cc: In function 'int main()': a.cc:10:18: error: 'endll' was not declared in this scope 10 | cout << 0 << endll; | ^~~~~
s266661089
p03705
C++
#include "iostream" using namespace std; int main() { int n,a,b; cin>>n>>a>>b; if((a>b)||(n==1&&a!=b)) cout<<0<<endl; else if(n==1&&a==b) cout<<1<<endl; else { long long ans=(b-a)*(n-2)+1; cout<<ans<<endl; return 0; }
a.cc: In function 'int main()': a.cc:18:2: error: expected '}' at end of input 18 | } | ^ a.cc:6:1: note: to match this '{' 6 | { | ^
s544029803
p03705
C++
#include "iostream" using namespace std; int main() { int n,a,b; cin>>n>>a>>b; if((a>b)||(n==1&&a!=b)) cout<<0<<endl; else if(n==1&&a==b) cout<<1<<endl; else { long long ans=(b-a)*(n-2)+1; cout<<ans<<endl; return 0; }
a.cc: In function 'int main()': a.cc:18:2: error: expected '}' at end of input 18 | } | ^ a.cc:6:1: note: to match this '{' 6 | { | ^
s808501476
p03705
C
#include <iostream> using namespace std; int main() { int N, A, B; cin >> N >> A >> B; if ((B - A + 1 > N) || A > B || N == 0) {cout << '0';return 0;} if (A == B) {cout << 1;return 0;} int cnt = 0, c = B - A; for (int i = A; i <= B; ++i) { for (int j = i; j <= B; ++j) { ...
main.c:1:10: fatal error: iostream: No such file or directory 1 | #include <iostream> | ^~~~~~~~~~ compilation terminated.
s506107406
p03705
C++
int main() { int N, A, B; cin >> N >> A >> B; if ((B - A + 1 > N) || A > B || N == 0) {cout << '0';return 0;} if (A == B) {cout << 1;return 0;} int cnt = 0, c = B - A; for (int i = A; i <= B; ++i) { for (int j = i; j <= B; ++j) { cnt++; } } cout << --cnt;...
a.cc: In function 'int main()': a.cc:4:5: error: 'cin' was not declared in this scope 4 | cin >> N >> A >> B; | ^~~ a.cc:6:6: error: 'cout' was not declared in this scope 6 | {cout << '0';return 0;} | ^~~~ a.cc:7:18: error: 'cout' was not declared in this scope 7 | if (A == ...
s158656707
p03705
C++
#include <iostream> using namespace std; int main() { int N, A, B; cin >> N >> A >> B; if ((B - A + 1 > N) || A > B || N == 0) {cout << '0';return 0;} if (A == B) {cout << 1;return 0;} int cnt = 0, c = B - A; for (int i = A; i <= B; ++i) { for (int j = i; j <= B; ++j) { ...
a.cc: In function 'int main()': a.cc:17:14: error: expected '}' at end of input 17 | return 0; | ^ a.cc:4:12: note: to match this '{' 4 | int main() { | ^
s966968810
p03705
Java
package com.cb.malic; import java.util.Scanner; public class TestZhugan { public static void main(String[] args) { Scanner scan = new Scanner(System.in); int n = scan.nextInt(); int start = scan.nextInt(); int end = scan.nextInt(); if (start > end) { System.out.println(0); } else { if (n == 1 && st...
Main.java:5: error: class TestZhugan is public, should be declared in a file named TestZhugan.java public class TestZhugan { ^ 1 error
s990774258
p03705
C++
#include<bits/stdc++.h> using namespace std; int main(){ long long n, a, b; cin >> n >> a >> b; cout << max(0, (2 - n) * (a - b) + 1) << endl; return 0; }
a.cc: In function 'int main()': a.cc:7:16: error: no matching function for call to 'max(int, long long int)' 7 | cout << max(0, (2 - n) * (a - b) + 1) << endl; | ~~~^~~~~~~~~~~~~~~~~~~~~~~~~~ In file included from /usr/include/c++/14/algorithm:60, from /usr/include/x86_64-linu...
s460244025
p03705
C++
#include <iostream> int main() { int N, A, B; cin >> N >> A >> B; int m = (N - 1)*A + B; int M = (N - 1)*B + A; if(M - m + 1>0) cout << M - m + 1 << endl; else cout << 0 << endl; return 0; }
a.cc: In function 'int main()': a.cc:6:9: error: 'cin' was not declared in this scope; did you mean 'std::cin'? 6 | cin >> N >> A >> B; | ^~~ | std::cin In file included from a.cc:1: /usr/include/c++/14/iostream:62:18: note: 'std::cin' declared here 62 | extern istream cin; ...
s829839722
p03705
C
#include <iostream> #include <cstdio> using namespace std; int main(void) { int A,B,N; cin>>N>>A>>B; if(N==1) { if(A==B) cout<<"1"; else cout<<"0"; } else { if(A>B) cout<<"0"; else printf("%lld\n",(long long )(...
main.c:1:10: fatal error: iostream: No such file or directory 1 | #include <iostream> | ^~~~~~~~~~ compilation terminated.
s388814192
p03705
C++
#include <iostream.h> int main(void) { int A,B,N; cin>>N>>A>>B; if(N==1) { if(A==B) cout<<"1"; else cout<<"0"; } else { if(A>B) cout<<"0"; else cout<<((B-A)*(N-2)+1); } return 0; }
a.cc:1:10: fatal error: iostream.h: No such file or directory 1 | #include <iostream.h> | ^~~~~~~~~~~~ compilation terminated.
s846819124
p03705
C++
gh#include <math.h> #include <string.h> #if CPLUS #include <iostream> #include <stack> #include <string> #include <algorithm> #include <vector> #include <iterator> #include <unordered_map> using namespace std; #endif int main(void) { #if debug freopen("in.txt", "r", stdin); #endif int i, n; cin >> n; int a[52] =...
a.cc:1:3: error: stray '#' in program 1 | gh#include <math.h> | ^ a.cc:1:1: error: 'gh' does not name a type 1 | gh#include <math.h> | ^~ a.cc: In function 'int main()': a.cc:22:9: error: 'cin' was not declared in this scope 22 | cin >> n; | ^~~ a.cc:26:17: error: 'scanf' ...
s780042016
p03705
C++
#include<cstdio> #include<iostream> using namespace std; int main(){ int n, a, b; while(cin>>n>>a>>b){ if(a > b || (n == 1 && a != b)){ cout<<'0'<<endl; } else if( n == 1 && a == b){ cout<<'1'<<endl; } else{ cout<<(long long )(b-a)*(n-2)+1)<<endl; } } return 0; }
a.cc: In function 'int main()': a.cc:16:56: error: expected ';' before ')' token 16 | cout<<(long long )(b-a)*(n-2)+1)<<endl; | ^ | ;
s261419392
p03705
C++
#include<cstdio> #include<iostream> using namespace std; int main(){ int n, a, b; while(cin>>n>>a>>b){ if(a > b || (n == 1 && a != b)){ cout<<'0'<<endl; } else if( n == 1 && a == b){ cout<<'1'<<endl; } else{ long long left = long long ((n - 1) * a) + b; long long right = a + long long ((n - 1...
a.cc: In function 'int main()': a.cc:16:42: error: expected primary-expression before 'long' 16 | long long left = long long ((n - 1) * a) + b; | ^~~~ a.cc:17:47: error: expected primary-expression before 'long' 17 | lo...
s786835038
p03705
C++
#include <bits/stdc++.h> using namespace std; int main(){ long long int n,a,b,nseki=1,aseki=1,bseki=1; cin >> n >> a >> b; if(a>b) cout << 0 <<endl; else if(a==b)cout << 1 <<endl; else{ if (n==1)cout << 0 <<endl; else if (n==2)cout << 1 <<endl; else{ cout << (b-a)(n-2)+1 <<endl; } } }
a.cc: In function 'int main()': a.cc:12:30: error: expression cannot be used as a function 12 | cout << (b-a)(n-2)+1 <<endl; | ~~~~~^~~~~
s083930631
p03705
C++
#include <iostream> #include<cstdio> using namespace std; int main() { int N,A,B; scanf("%d %d %d",&N,&A,&B); if(N == 1){ if(A == B) printf("1\n"); else printf("0\n"); } else{ if(A > B) printf("0\n"); else printf("%lld...
a.cc: In function 'int main()': a.cc:19:45: error: invalid operands of types '<unresolved overloaded function type>' and '<unresolved overloaded function type>' to binary 'operator-' 19 | printf("%lld\n",(long long)(max - min) +1); | ~~~~^~~~~
s503367012
p03705
C++
#include<bits/stdc++.h> using namespace std; int main(){ long long n,a,b; cin >> n >> a >> b; cout << max((b*(n-1)+a) - (a*(n-1)+b) + 1, 0) << endl; }
a.cc: In function 'int main()': a.cc:6:14: error: no matching function for call to 'max(long long int, int)' 6 | cout << max((b*(n-1)+a) - (a*(n-1)+b) + 1, 0) << endl; | ~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ In file included from /usr/include/c++/14/algorithm:60, from /usr/include...
s030676896
p03705
C++
#include<bits/stdc++.h> using namespace std ; int main () { long long N , A , B ; cin >> N >> A >> B ; long long ans = 0 ; if(A>B) ans = 0 ; else ans =max(0,(N-2)*(B-A)+1) ; cout << ans << endl ; }
a.cc: In function 'int main()': a.cc:8:16: error: no matching function for call to 'max(int, long long int)' 8 | else ans =max(0,(N-2)*(B-A)+1) ; | ~~~^~~~~~~~~~~~~~~~~ In file included from /usr/include/c++/14/algorithm:60, from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++....
s843963082
p03705
C++
#include<bits/stdc++.h> using namespace std ; int main () { int N , A , B ; cin >> N >> A >> B ; int ans = 0 ; if(A>B) ans = 0 ; else ans =max(0,1+ (N-2)*(B-A)+1)) ; cout << ans << endl ; }
a.cc: In function 'int main()': a.cc:8:36: error: expected ';' before ')' token 8 | else ans =max(0,1+ (N-2)*(B-A)+1)) ; | ^ | ;
s952189805
p03705
C
#include<stdio.h> int main(){ long long int n,a,b int count=0; scanf("%lld%lld%lld",&n,&a,&b); if(a>b||n<0||a<0||b<0||(n==1&a!=b)){ count = 0; }else if(a==b){ count = 1; }else{ count = b*(n-2)-a*(n-2)+1; } printf("%d",count); return 0; }
main.c: In function 'main': main.c:5:9: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'int' 5 | int count=0; | ^~~ main.c:6:37: error: 'b' undeclared (first use in this function) 6 | scanf("%lld%lld%lld",&n,&a,&b); | ^ main...
s016226625
p03705
C++
#include<bits/stdc++.h> using namespace std; int main() { long long ax, in; ax = A + B * (N - 1); in = B + A * (N - 1); cout << ax - in + 1 << endl; return 0; }
a.cc: In function 'int main()': a.cc:5:14: error: 'A' was not declared in this scope 5 | ax = A + B * (N - 1); | ^ a.cc:5:18: error: 'B' was not declared in this scope 5 | ax = A + B * (N - 1); | ^ a.cc:5:23: error: 'N' was not declared in this scope ...
s142705277
p03705
C++
#include <iostream> #include <algorithm> using namespace std; int main(){ long long int n,a,b; cin >> n >> a >> b; if(a>b){ cout << 0 << endl; } else{ cout << max(0,(b-a)*(n-2)+1) << endl; } }
a.cc: In function 'int main()': a.cc:12:16: error: no matching function for call to 'max(int, long long int)' 12 | cout << max(0,(b-a)*(n-2)+1) << endl; | ~~~^~~~~~~~~~~~~~~~~ In file included from /usr/include/c++/14/string:51, from /usr/include/c++/14/bits/locale_classes.h:40...
s319778028
p03705
C++
n, a, b = map(int, input().split()) min_sum = a * (n - 1) + b max_sum = b * (n - 1) + a print(max(max_sum - min_sum + 1, 0))
a.cc:1:1: error: 'n' does not name a type 1 | n, a, b = map(int, input().split()) | ^
s862569070
p03705
C++
int main() { int count = 0,min = 0,max=0; scanf("%d %d %d", &count, &min, &max); if (min > max) { cout << 0 << endl; return 0; } if (count == 1&& min!=max) { cout << 0 << endl; return 0; } set<int> resultnum; vector<int> allnum; for (int i = min; i <= max; i++) { allnum.push_back(i); } ...
a.cc: In function 'int main()': a.cc:6:9: error: 'scanf' was not declared in this scope 6 | scanf("%d %d %d", &count, &min, &max); | ^~~~~ a.cc:10:17: error: 'cout' was not declared in this scope; did you mean 'count'? 10 | cout << 0 << endl; | ^~~~ ...
s068834322
p03705
C
#include<stdio.h> int main() { int n,a,b; scanf("%d %d %d",&n,&a,&b); int min=(a * ( n - 1 ) + b ); int max = a + ( n - 1 ) * b; if(n == 1 ){ if( a == b) printf("1"); else printf("0"); } else{ if(a > b ) printf("0"); else prin...
main.c: In function 'main': main.c:19:37: error: expected expression before ')' token 19 | printf("%lld",((long long ))max - min + 1); | ^
s909158304
p03705
Java
#include<stdio.h> int main() { int n,a,b; scanf("%d %d %d",&n,&a,&b); int min=(a * ( n - 1 ) + b ); int max = a + ( n - 1 ) * b; if(n == 1 && a == b) printf("1"); else if(a > b || ( n == 1 && a != b )) printf("0"); else printf("%d",max - min + 1); return 0...
Main.java:1: error: illegal character: '#' #include<stdio.h> ^ Main.java:1: error: class, interface, enum, or record expected #include<stdio.h> ^ Main.java:6: error: class, interface, enum, or record expected scanf("%d %d %d",&n,&a,&b); ^ Main.java:7: error: unnamed classes are a preview feature and are d...
s597304557
p03705
C++
#include <iostream> using namespace std; //计算n的阶乘 long long int jc(long long int n){ long long int i,res=1; for(i=1;i<=n;i++){ res=res*i; } return res; } //计算组合数 long long int C(long long int m,long long int n){ return (jc(n))/(jc(m)*jc(n-m)); } int main(void) { long long int n,a,...
a.cc: In function 'int main()': a.cc:31:36: error: expected ';' before ')' token 31 | else cout<<(b-a)*(n-2)+1)<<endl; | ^ | ;
s738667678
p03705
C++
#include <iostream> using namespace std; //计算n的阶乘 long long int jc(long long int n){ long long int i,res=1; for(i=1;i<=n;i++){ res=res*i; } return res; } //计算组合数 long long int C(long long int m,long long int n){ return (jc(n))/(jc(m)*jc(n-m)); } long long int main(void) { long lon...
a.cc:18:11: error: '::main' must return 'int' 18 | long long int main(void) | ^~~ a.cc: In function 'int main()': a.cc:30:26: error: no match for 'operator<' (operand types are 'std::basic_ostream<char>' and '<unresolved overloaded function type>') 30 | if(a > b) cout<<1<endl; | ...
s724294109
p03705
C
#include <cstdio> int main(void) { int A,B,N; scanf("%d%d%d",&N,&A,&B); if(N==1) { if(A==B) printf("1\n"); else printf("0\n"); } else { if(A>B) printf("0\n"); else printf("%lld\n",(long long )(B-A)*(N-2)+1); ...
main.c:1:10: fatal error: cstdio: No such file or directory 1 | #include <cstdio> | ^~~~~~~~ compilation terminated.
s289752454
p03705
C++
/* Name: Copyright: Author: Date: 12/01/19 21:42 Description: 这种做法的本质思路,有点接近于数值计算,数值分析里的编程设计思路,通过对要计算的表达式的改造来实现精度控制。 */ /* Name: Copyright: Author: Date: 12/01/19 15:41 Description: */ #include <stdio.h> #include <iostream> #include <math.h> #include <stdbool.h> #include <string.h> struct bign{ int...
a.cc:25:9: error: ISO C++ forbids declaration of 'big' with no type [-fpermissive] 25 | big(){ | ^~~ a.cc: In member function 'int bign::big()': a.cc:28:9: warning: no return statement in function returning non-void [-Wreturn-type] 28 | } | ^
s841532132
p03705
C
/* Name: Copyright: Author: Date: 12/01/19 21:42 Description: 这种做法的本质思路,有点接近于数值计算,数值分析里的编程设计思路,通过对要计算的表达式的改造来实现精度控制。 */ #include <stdio.h> #include <iostream> #include <math.h> #include <stdbool.h> #include <string.h> int main(){ long long N, A, B; long long num; scanf("%I64d %I64d %I64d", &N, &A, &B); ...
main.c:10:10: fatal error: iostream: No such file or directory 10 | #include <iostream> | ^~~~~~~~~~ compilation terminated.
s154611553
p03705
C++
#include <iostream> #include <math.h> using std::cin; using std::cout; int main(int argc, char const *argv[]) { ll n, a, b; cin >> n >> a >> b; if (a > b || (a < b && n == 1)) { cout << 0; } else if (a == b || (a < b && n == 2)) cout << 1; else if (a < b && n >= 2) { ...
a.cc: In function 'int main(int, const char**)': a.cc:9:5: error: 'll' was not declared in this scope 9 | ll n, a, b; | ^~ a.cc:10:12: error: 'n' was not declared in this scope; did you mean 'yn'? 10 | cin >> n >> a >> b; | ^ | yn a.cc:10:17: error: 'a' was not...
s032701592
p03705
C
#include <cstdio> int main(void) { int n,a,b; scanf("%d%d%d",&n,&a,&b); if(n==1&&a!=b) printf("0\n"); else if(a>b) printf("0\n"); else printf("%lld\n",(long long)b*(n-2)-a*(n-2)+1); return 0; }
main.c:1:10: fatal error: cstdio: No such file or directory 1 | #include <cstdio> | ^~~~~~~~ compilation terminated.
s662953604
p03705
C
#include <cstdio> int main(void) { int n,a,b; scanf("%d%d%d",&n,&a,&b); if(n==1&&a!=b) printf("0\n"); else if(a>b) printf("0\n"); else printf("%d\n",b*(n-2)-a*(n-2)+1); return 0; }
main.c:1:10: fatal error: cstdio: No such file or directory 1 | #include <cstdio> | ^~~~~~~~ compilation terminated.
s296289493
p03705
C
#include<iostream> #include<cstring> #include<cmath> using namespace std; int main(){ int n,max,min; cin >> n >> min >> max; if(n==1) { if(max == min) cout<<1; else cout<<0; return 0; } if(min > max) { cout<<0; return 0; } int a,b; a = (n-1)*min+max; b = (n-1)*max+min; cout<<b-a+1; return 0; }
main.c:1:9: fatal error: iostream: No such file or directory 1 | #include<iostream> | ^~~~~~~~~~ compilation terminated.
s794165018
p03705
C++
// // main.cpp // temp // // Created by 张皓焱 on 2019/1/12. // Copyright © 2019 threefires. All rights reserved. // #include <iostream> #include <math.h> using namespace std; int main(int argc, const char * argv[]) { cout << 0 <<endl return 0; }
a.cc: In function 'int main(int, const char**)': a.cc:15:21: error: expected ';' before 'return' 15 | cout << 0 <<endl | ^ | ; 16 | return 0; | ~~~~~~
s025125334
p03705
C++
#include <stdio.h> #include <math.h> int main() { int n, min, max; int a, b; scanf_s("%d %d %d", &n, &min, &max); int count = 0; if (n == 0&&(n==1||max!=min)) printf("0"); else if (n == 1) printf("1"); else { } return 0; }
a.cc: In function 'int main()': a.cc:9:9: error: 'scanf_s' was not declared in this scope; did you mean 'scanf'? 9 | scanf_s("%d %d %d", &n, &min, &max); | ^~~~~~~ | scanf
s210980759
p03705
C++
#include <iostream> using namespace std; //计算n的阶乘 long long int jc(long long int n){ long long int i,res=1; for(i=1;i<=n;i++){ res=res*i; } return res; } //计算组合数 long long int C(long long int m,long long int n){ return (jc(n))/(jc(m)*jc(n-m)); } long long int main(void) { long lon...
a.cc:18:11: error: '::main' must return 'int' 18 | long long int main(void) | ^~~
s479225401
p03705
C++
#include <stdio.h> #include<algorithm> using namespace std; int k=0; int length=0; int sums[1000000000]={0}; int numbers[1000000000]={0}; void ans(int a,int b,int n) { if(n==0) { sums[k]=0; for(int i=0;i<length;i++) sums[k] +=numbers[i]; k++; } for(int j=n-1;j>=0;j--) { for(int i=a;i<=b;i+...
/tmp/ccHdxeBT.o: in function `ans(int, int, int)': a.cc:(.text+0x6c): relocation truncated to fit: R_X86_64_PC32 against symbol `numbers' defined in .bss section in /tmp/ccHdxeBT.o a.cc:(.text+0xd0): relocation truncated to fit: R_X86_64_PC32 against symbol `numbers' defined in .bss section in /tmp/ccHdxeBT.o collect2:...
s077559491
p03705
C++
#include<iostream> using namespace std; int main() { int n,a,b; cin>>n>>a>>b; if(n==1&&a==b) cout<<1<<endl; else if (n<2||a>b) cout<<0<<endl; else cout<<(n-2)*(b-a)+1)<<endl; }
a.cc: In function 'int main()': a.cc:12:21: error: expected ';' before ')' token 12 | cout<<(n-2)*(b-a)+1)<<endl; | ^ | ;
s862207967
p03705
C++
#include<iostream> using namespace std; int main() { int n,a,b; cin>>n>>a>>b; if(n==1&&a==b) print(1) else if (n<2||a>b) print(0) else print((n-2)*(b-a)+1) }
a.cc: In function 'int main()': a.cc:8:1: error: 'print' was not declared in this scope; did you mean 'printf'? 8 | print(1) | ^~~~~ | printf
s774988326
p03705
C++
#include<iostream> using namespace std; int main() { int amount, min=0, max=0; cin >> amount; cin >> min; cin >> max; if (max < min) { cout << 0; return ; } if (amount == 1 && (max != min)) { cout << 0; return ; } else if (amount == 1 && max == min) { cout << 1; return ; } if (amount < 1) { cout << 0; return ...
a.cc: In function 'int main()': a.cc:10:37: error: return-statement with no value, in function returning 'int' [-fpermissive] 10 | if (max < min) { cout << 0; return ; } | ^~~~~~ a.cc:11:55: error: return-statement with no value, in function returning 'int' [-fpermis...
s959054202
p03705
C++
#include <bits/stdc++.h> using namespace std; int main(){ long long int n,A,B; cin>>n>>A>>B; if(A>B||){ printf("0\n"); return 0; } if(n==1){ if(A!=B){ printf("0\n"); return 0; } printf("%lld\n",A); } long long int sum = (B-A)*(n-2)+1; printf("%lld\n",sum); return 0; }
a.cc: In function 'int main()': a.cc:7:17: error: expected primary-expression before ')' token 7 | if(A>B||){ | ^
s224607400
p03705
C++
#include <iostream> using namespace std; //计算n的阶乘 int jc(int n){ int i,res=1; for(i=1;i<=n;i++){ res=res*i; } return res; } //计算组合数 int C(int m,int n){ return (jc(n))/(jc(m)*jc(n-m)); } int main(void) { if(n == 1) return 1; if(n <= 0 || b < a) return 0; int n,a,b; cin>>...
a.cc: In function 'int main()': a.cc:20:8: error: 'n' was not declared in this scope 20 | if(n == 1) return 1; | ^ a.cc:21:8: error: 'n' was not declared in this scope 21 | if(n <= 0 || b < a) return 0; | ^ a.cc:21:18: error: 'b' was not declared in this scope 21 | if(n <=...
s832398379
p03705
C++
#include<bits/stdc++.h> #define lli long long int #define MOD 1000000007 #define FOR(i,n) for(int i=0;i<(int)N;i++) #define ALL(x) (x).begin(),(x).end() using namespace std; inline int getint(){ int n; scanf("%d",&n); return n; } inline vector<int> getints(int n){ vector<int> a(n); for(int i=0;i<n...
a.cc: In function 'int main()': a.cc:39:4: error: 'elif' was not declared in this scope 39 | }elif(A<B){ | ^~~~ a.cc:45:4: error: 'else' without a previous 'if' 45 | }else{ | ^~~~
s739417299
p03705
C++
#include <bits/stdc++.h> using namespace std; int main(){ ll N,A,B; cin>>N>>A>>B; ll ans=1+(N-2)*(B-A); if(ans<0){ cout<<0<<endl; }else{ cout<<ans<<endl; } return 0; }
a.cc: In function 'int main()': a.cc:4:5: error: 'll' was not declared in this scope 4 | ll N,A,B; | ^~ a.cc:5:10: error: 'N' was not declared in this scope 5 | cin>>N>>A>>B; | ^ a.cc:5:13: error: 'A' was not declared in this scope 5 | cin>>N>>A>>B; | ^...
s873825392
p03705
C++
#include<iostream> #include<algorithm> #include<string> #include<map> #include<vector> #include<bits/stdc++.h> using namespace std; using ll = long long; #define MM = 1000000000; #define mod = MM + 7; #define INF (ll)1e18 #define pi acos(-1.0) #define MAX 10000000005 #define NIL -1 int f(ll m){ ll multi = 1; fo...
a.cc: In function 'int main()': a.cc:30:42: error: expected ')' before ';' token 30 | ans = f(b-a+1)/(f(n-2)*f(b-a-n+4); | ~ ^ | )
s276321677
p03705
C++
#include<iostream> #include<algorithm> #include<string> #include<map> #include<vector> #include<bits/stdc++.h> using namespace std; using ll = long long; #define MM = 1000000000; #define mod = MM + 7; #define INF (ll)1e18 #define pi acos(-1.0) #define MAX 10000000005 #define NIL -1 int f(ll m){ ll multi = 1; fo...
a.cc: In function 'int f(ll)': a.cc:20:1: warning: no return statement in function returning non-void [-Wreturn-type] 20 | } | ^ a.cc: In function 'int main()': a.cc:29:42: error: expected ')' before ';' token 29 | ans = f(b-a+1)/(f(n-2)*f(b-a-n+4); | ~ ^...
s631290972
p03705
C++
#include <iostream> using namespace std; int main() { int N, A, B; cin >> N >> A >> B; if (A > B) cout << 0 << endl; else if (N == 1) cout << 0 << endl; else if (A == B) cout << 1 << endl; else int x = A * (N - 1) + B; int y = B * (N - 1) + A; cout << y - x + 1 << endl; }
a.cc: In function 'int main()': a.cc:16:15: error: 'x' was not declared in this scope 16 | cout << y - x + 1 << endl; | ^
s448638449
p03705
C++
#include <iostream> using namespace std; int main() { int N, A, B; cin >> N >> A >> B; if (A > B) cout << 0 << endl; else if (N == 1) cout << 0 << endl; else if (A == B) cout << 1 << endl; else int min = A * (N - 1) + B; int max = B * (N - 1) + A; cout << max - min + 1 << endl; }
a.cc: In function 'int main()': a.cc:16:15: error: invalid operands of types 'int' and '<unresolved overloaded function type>' to binary 'operator-' 16 | cout << max - min + 1 << endl; | ~~~~^~~~~
s882663901
p03705
C++
#include <iostream> using namespace std; long long fact(int x, int k){ if (x <= k) return x; return x*fact(x - 1, k); } int main(){ long long a, b, n; cin >> n >> a >> b; long long res; if (a > b) res = 0; else{ res = fact(n + 3, n) / fact(b - a); } cout << res << endl; return 0; }
a.cc: In function 'int main()': a.cc:16:32: error: too few arguments to function 'long long int fact(int, int)' 16 | res = fact(n + 3, n) / fact(b - a); | ~~~~^~~~~~~ a.cc:5:11: note: declared here 5 | long long fact(int x, int k){ | ^~~~
s703489780
p03705
C++
#include <iostream> using namespace std; long long fact(x, n){ if (x <= n) return x; return x*fact(x - 1, n); } int main(){ long long a, b, n; cin >> n >> a >> b; long long res; if (a > b) res = 0; else{ res = fact(n + 3, n) / fact(b - a); } cout << res << endl; return 0; }
a.cc:5:16: error: 'x' was not declared in this scope 5 | long long fact(x, n){ | ^ a.cc:5:19: error: 'n' was not declared in this scope 5 | long long fact(x, n){ | ^ a.cc:5:20: error: expression list treated as compound expression in initializer [-fpermissive] 5 ...
s592006968
p03705
C++
/****Author: Barish Namazov****/ #include <bits/stdc++.h> using namespace std; /***TEMPLATE***/ #define all(v) (v).begin(),(v).end() #define rall(v) (v).rbegin(),(v).rend() #define F first #define S second #define pb push_back #define endl '\n' const int max4 = 10004; const int maxx = 100005; const int max6 = 1000...
a.cc: In function 'int main()': a.cc:69:16: error: no matching function for call to 'max(long long int, int)' 69 | cout << max(0LL, b - a + 1) << endl; | ~~~^~~~~~~~~~~~~~~~ In file included from /usr/include/c++/14/algorithm:60, from /usr/include/x86_64-linux-gnu/c++/14/bits/s...
s665613224
p03705
C++
#include<cstdio> using namespace std; int main() { long long n,a,b; cin>>n>>a>>b; cout<<(n*b)-(n*a)+1<<endl; return 0; }
a.cc: In function 'int main()': a.cc:8:9: error: 'cin' was not declared in this scope 8 | cin>>n>>a>>b; | ^~~ a.cc:2:1: note: 'std::cin' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>' 1 | #include<cstdio> +++ |+#include <iostream> 2 | a.c...
s118400660
p03705
C++
#include<bits/stdc++.h> int a,b; int main(){ scanf("%d%d",&a,&b); printf("%d\n",n==1&&a<=b?(b-a)*(n-2)+1:0); return 0; }
a.cc: In function 'int main()': a.cc:5:19: error: 'n' was not declared in this scope; did you mean 'yn'? 5 | printf("%d\n",n==1&&a<=b?(b-a)*(n-2)+1:0); | ^ | yn
s325936502
p03705
C++
#include<iostream> using namespace std; int mian() { int a,b; cin>>a>>b; int sum=0; for(int i=a;i<=b;i++) {sum=sum+i;} cout<<sum; return 0; }
/usr/bin/ld: /usr/lib/gcc/x86_64-linux-gnu/14/../../../x86_64-linux-gnu/Scrt1.o: in function `_start': (.text+0x17): undefined reference to `main' collect2: error: ld returned 1 exit status
s521925585
p03705
Java
import java.io.BufferedReader; import java.io.IOException; import java.io.InputStream; import java.io.InputStreamReader; import java.io.PrintWriter; import java.util.ArrayList; import java.util.InputMismatchException; import java.util.Iterator; import java.util.LinkedList; import java.util.Map; import java.util.Queue; ...
Main.java:203: error: cannot find symbol new Thread(null, new Solution(),"Solution",1<<26).start(); ^ symbol: class Solution location: class Main 1 error
s382040313
p03705
C++
#include<bits/stdc++.h> using namespace std; int main() { long long c,a,b; cin>>c>>a>>b; if(c>1&&b>=a||c==1&&a==b) cout<<(n-2)*(b-a)+1<<endl; else cout<<0<<endl; }
a.cc: In function 'int main()': a.cc:7:38: error: 'n' was not declared in this scope 7 | if(c>1&&b>=a||c==1&&a==b) cout<<(n-2)*(b-a)+1<<endl; | ^
s911954114
p03705
C++
#include<iostream> using namespace std; int main(){ long long a; long longn,b; cin>>n>>a>>b; if(n>1&&b>=a||n==1&&a==b){ cout<<(n-2)*(b-a)+1; return 0; }else{ cout<<"0"; } return 0; }
a.cc: In function 'int main()': a.cc:6:14: error: 'n' was not declared in this scope 6 | cin>>n>>a>>b; | ^
s151427989
p03705
C++
#include<iostream> using namespace std; int main(){ long long a; long longn,b; cin>>n>>a>>b; if(n>1&&b>=a||n==1&&a==b){ cout<<(n-2)*(b-a)+1; return 0; } return 0; }
a.cc: In function 'int main()': a.cc:6:14: error: 'n' was not declared in this scope 6 | cin>>n>>a>>b; | ^
s420126077
p03705
C++
#include <iostream> using namespace std; #define int long long int main() { int n,a,b; cin >> n >> a >> b; int ans = (n-2)*(b-a) + 1; cout << max(ans,0); return 0; }
cc1plus: error: '::main' must return 'int' a.cc: In function 'int main()': a.cc:10:20: error: no matching function for call to 'max(long long int&, int)' 10 | cout << max(ans,0); | ~~~^~~~~~~ In file included from /usr/include/c++/14/string:51, from /usr/include/c++/14/...
s409737659
p03705
C++
#include <bits/stdc++.h> using namespace std; int main() { long long N,A,B; cin >> N >> A >> B; long long M,m; M=(N-2)*B; m=(N-2)*A; cout << max(M-m+1,0) << endl; }
a.cc: In function 'int main()': a.cc:10:14: error: no matching function for call to 'max(long long int, int)' 10 | cout << max(M-m+1,0) << endl; | ~~~^~~~~~~~~ In file included from /usr/include/c++/14/algorithm:60, from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:51, ...
s356357350
p03705
C++
#include <bits/stdc++.h> using namespace std; int main(){ long long int N, A, B; cin >> N >> A >> B; if(N == 1 && A == B){ cout << 1 << endl; } else if(N == 1 && A != B){ cout << 0 << endl; } else if(A > B){ cout << 0 << endl; } else{ cout << (N-2) * (B - A) + 1 << endl; }
a.cc: In function 'int main()': a.cc:17:2: error: expected '}' at end of input 17 | } | ^ a.cc:3:11: note: to match this '{' 3 | int main(){ | ^
s048448250
p03705
C++
l
a.cc:1:1: error: 'l' does not name a type 1 | l | ^
s031780940
p03705
C++
#include <bits/stdc++.h> using namespace std; #define clr(i, j) memset(i, j, sizeof(i)) #define pb push_back #define mp make_pair typedef long long ll; int a,b,c; int arr[101][101][101]; int main() { /*cin>>a>>b>c; for(int i=0;i<a;i++){ int x,y,z;cin>>x>>y>>z; arr[x][y][z]++; } ...
a.cc: In function 'int main()': a.cc:30:26: error: expected ';' before ':' token 30 | cout<<(c-b)*(b-2): | ^ | ;
s473801186
p03705
C++
#include<bits/stdc++.h> using namespace std; int main(){ int n,x,y; cin>>n>>x>>y; if(n>=1&&b>=a){ cout<<(n-2)*(a+b)<<endl; } return 0; }
a.cc: In function 'int main()': a.cc:6:14: error: 'b' was not declared in this scope 6 | if(n>=1&&b>=a){ | ^ a.cc:6:17: error: 'a' was not declared in this scope 6 | if(n>=1&&b>=a){ | ^
s337652418
p03705
C++
#include <iostream> #include <cstdio> #include <string> #include <algorithm> #include <utility> #define INF 1000000000 #define MOD 1000000007 using namespace std; int main() { long long n; long long a, b; cin >> n; cin >> a >> b; if (a > b) { cout << 0 << endl; } else if (a == b && n...
a.cc: In function 'int main()': a.cc:26:24: error: expression cannot be used as a function 26 | cout << (b - a)(n - 2) + 1 << endl; | ~~~~~~~^~~~~~~
s906445592
p03705
C++
#include <bits/stdc++.h> using namespace std; using ll = long long; int main() { ll n, a, b; cin >> n >> a >> b; ll ans = (a+b*(n-1)) - (a*(n-1)+b) + 1; cout << max(ans, 0) << endl; }
a.cc: In function 'int main()': a.cc:10:16: error: no matching function for call to 'max(ll&, int)' 10 | cout << max(ans, 0) << endl; | ~~~^~~~~~~~ In file included from /usr/include/c++/14/algorithm:60, from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:51, ...
s622534192
p03705
C++
#include<stdio.h> long n,a,b,ans; scanf("%ld%ld%ld",&n,&a,&b); if(n==1){ if(a==b) ans=1; else ans=0; } else{ if(a>b) ans=0; else ans=(n-2)*(b-a); } printf("%ld\n",ans); return 0; }
a.cc:3:6: error: expected constructor, destructor, or type conversion before '(' token 3 | scanf("%ld%ld%ld",&n,&a,&b); | ^ a.cc:4:1: error: expected unqualified-id before 'if' 4 | if(n==1){ | ^~ a.cc:10:1: error: expected unqualified-id before 'else' 10 | else{ | ^~~~ a.cc:16:7: error...
s160602886
p03705
C++
#include<bits/stdc++.h> typedef long long ll; using namespace std; ll n, a, b, cnt; int main(){ cin >> n >> a >> b; if(a > b)cout << 0, return 0; if(n == 1){ if(a == b) cout << 1; else cout << 0; return 0; } cout << (b - a) * (b - 2) + 1; return 0; }
a.cc: In function 'int main()': a.cc:9:29: error: expected primary-expression before 'return' 9 | if(a > b)cout << 0, return 0; | ^~~~~~
s207542352
p03705
C++
#include<bits/stdc++.h> typedef long long ll; using namespace std; ll n, a, b, cnt; int main(){ cin >> n >> a >> b; if(n == 1){ if(a === b)cout << 1; else cout << 0; return 0; } if(a <= b)cout << (b - a) * (b - 2) + 1; else{ cout << 0; } return 0; }
a.cc: In function 'int main()': a.cc:11:24: error: expected primary-expression before '=' token 11 | if(a === b)cout << 1; | ^
s912555284
p03705
C++
#include<bits/stdc++.h> using namespace std; __int128 n,a,b; inline void print(__int128 x){ if(!x)return; if(x)print(x/10); putchar(x%10+'0'); } int main(){ cin>>n>>a>>b; __int128 ans=b*(n-2)-a*(n-2)+1; if(!ans)puts("0");else print(ans); return 0; }
a.cc: In function 'int main()': a.cc:10:8: error: no match for 'operator>>' (operand types are 'std::istream' {aka 'std::basic_istream<char>'} and '__int128') 10 | cin>>n>>a>>b; | ~~~^~~ | | | | | __int128 | std::istream {aka std::basic_istream<char>} In file include...
s946803606
p03705
C++
#include <iostream> using namespace std; int a, n, m; int main() { cin >> a >> n >> m; if (n == m) cout << 1; else if (n > m) cout << 0; else if (a == 1) cout << 0; else if cout << (m - n) * (a - 2) + 1; cout << endl; return 0; }
a.cc: In function 'int main()': a.cc:9:17: error: expected '(' before 'cout' 9 | else if cout << (m - n) * (a - 2) + 1; | ^~~~ | (
s164167380
p03705
C++
#include<iostream> using namespace std; int main(){ int n,a,b; cin<<n<<a<<b; if(n==1){ if(a==b)cout<<1; else cout<<0; }else cout<<(n-2)*(b-a); return 0; }
a.cc: In function 'int main()': a.cc:5:8: error: no match for 'operator<<' (operand types are 'std::istream' {aka 'std::basic_istream<char>'} and 'int') 5 | cin<<n<<a<<b; | ~~~^~~ | | | | | int | std::istream {aka std::basic_istream<char>} a.cc:5:8: note: candidate:...
s012644387
p03705
C++
#include<bits/stdc++.h> using namespace std; int main(){ long long a,b,c; cin>>a>>b>>c; cout<<max((a-2)*(c-b)+1,0)<<endl; }
a.cc: In function 'int main()': a.cc:6:14: error: no matching function for call to 'max(long long int, int)' 6 | cout<<max((a-2)*(c-b)+1,0)<<endl; | ~~~^~~~~~~~~~~~~~~~~ In file included from /usr/include/c++/14/algorithm:60, from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++...
s447951761
p03705
C++
#include <iostream> using namespace std; int main() { int N, A, B; cin >> N >> A >> B; long long int ans = 0; if (B > C) ans = 0; else if (N == 1 && A != B) ans = 0; else if (N == 1) ans = 1; else ans = (B - A) * (N - 2) + 1; cout << ans << endl; return 0; }
a.cc: In function 'int main()': a.cc:8:11: error: 'C' was not declared in this scope 8 | if (B > C) ans = 0; | ^
s828872549
p03705
C++
#include<iostream> #include<vector> #include<algorithm> #include<cstdio> #include<cstdlib> #include<string> #include<sstream> #include<cmath> #include<numeric> #include<map> #include<stack> #include<queue> #include<list> #include<cfloat> using namespace std; int mod = 1e9+7; int main() { long long int n, a, b; cin...
a.cc: In function 'int main()': a.cc:23:14: error: no matching function for call to 'max(long long int&, int)' 23 | cout << max(ans, 0) << endl; | ~~~^~~~~~~~ In file included from /usr/include/c++/14/string:51, from /usr/include/c++/14/bits/locale_classes.h:40, fr...
s962517450
p03705
C++
#include <iostream> #include <string> #include <vector> #include <algorithm> using namespace std; #define ll long long ll MIN(ll num1,ll num2){ return num1<num2?num1:num2; } int main(){ ll N,A,B; cin>>N>>A>>B; if((A+B*(N-1))-(A*(N-1)+B)+1)>0)cout<<(A+B*(N-1))-(A*(N-1)+B)+1<<endl; else cout<<0<<...
a.cc: In function 'int main()': a.cc:18:34: error: expected primary-expression before '>' token 18 | if((A+B*(N-1))-(A*(N-1)+B)+1)>0)cout<<(A+B*(N-1))-(A*(N-1)+B)+1<<endl; | ^
s773453520
p03705
C++
#include <iostream> #include <string> #include <vector> #include <algorithm> using namespace std; #define ll long long ll MIN(ll num1,ll num2){ return num1<num2?num1:num2; } int main(){ ll N,A,B; cin>>N>>A>>B; cout<<(((A+B*(N-1))-(A*(N-1)+B)+1)>0)?(A+B*(N-1))-(A*(N-1)+B)+1:0<<endl; return 0; }
a.cc: In function 'int main()': a.cc:18:70: error: invalid operands of types 'int' and '<unresolved overloaded function type>' to binary 'operator<<' 18 | cout<<(((A+B*(N-1))-(A*(N-1)+B)+1)>0)?(A+B*(N-1))-(A*(N-1)+B)+1:0<<endl; | ~^~~~~~
s801382753
p03705
C++
#include <iostream> #include <string> #include <vector> #include <algorithm> using namespace std; #define ll long long ll MIN(ll num1,ll num2){ return num1<num2?num1:num2; } int main(){ ll N,A,B; cin>>N>>A>>B; cout<<(A+B*(N-1))-(A*(N-1)+B)+1>0?(A+B*(N-1))-(A*(N-1)+B)+1:0<<endl; return 0; }
a.cc: In function 'int main()': a.cc:18:36: error: no match for 'operator>' (operand types are 'std::basic_ostream<char>::__ostream_type' {aka 'std::basic_ostream<char>'} and 'int') 18 | cout<<(A+B*(N-1))-(A*(N-1)+B)+1>0?(A+B*(N-1))-(A*(N-1)+B)+1:0<<endl; | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~ | ...
s905275695
p03705
C++
#include <bits/stdc++.h> #include<iostream> using namespace std; int main () { long long N,A,B; cin>>N>>A>>B; long long ans; if (A>B ||(N=1 && A!=B)) ans=0; else ans = (B-A) * (B-2)+1 cout<<ans; return 0; }
a.cc: In function 'int main()': a.cc:15:28: error: expected ';' before 'cout' 15 | else ans = (B-A) * (B-2)+1 | ^ | ; 16 | cout<<ans; | ~~~~
s194698481
p03705
C++
#include <bits/stdc++.h> #include<iostream> using namespace std; int main () { long long N,A,B; cin>>N>>A>>B; long long ans; if (A>B ||(N=1 && A!=B)) ans=0; else ans = (B-A) * (B-2)+1 cout<<ans<<"\n" return 0; }
a.cc: In function 'int main()': a.cc:15:28: error: expected ';' before 'cout' 15 | else ans = (B-A) * (B-2)+1 | ^ | ; 16 | cout<<ans<<"\n" | ~~~~
s644618518
p03705
C++
#include "stdafx.h" #include<iostream> #include<algorithm> #include<vector> #include<cmath> #include<stack> #include<map> #include<queue> using namespace std; int main(){ int n, a, b; cin >> n >> a >> b; if (b >= a&&n >= 2) { cout << (n - 2)*(b - a) + 1 << endl; } else if (b <= a)cout << 1 << endl; else cout <<...
a.cc:1:10: fatal error: stdafx.h: No such file or directory 1 | #include "stdafx.h" | ^~~~~~~~~~ compilation terminated.
s053270053
p03705
C++
#include <iostream> #include <string> #include <algorithm> #include <cmath> using namespace std; int main(){ long long n,a,b; cin>>n>>a>>b; if(n==1){ if(a!=b)cout<<0<<endl; else cout<<1<<endl; } else cout<<max(((n-2)*(b-a))+1,0)<<endl; return 0; }
a.cc: In function 'int main()': a.cc:13:19: error: no matching function for call to 'max(long long int, int)' 13 | else cout<<max(((n-2)*(b-a))+1,0)<<endl; | ~~~^~~~~~~~~~~~~~~~~~~ In file included from /usr/include/c++/14/string:51, from /usr/include/c++/14/bits/locale_clas...
s346766449
p03705
C++
#include <iostream> #include <string> #include <algorithm> #include <cmath> using namespace std; int main(){ long long n,a,b; cin>>n>>a>>b; if(n==1){ if(a!=b)cout<<0<<endl; else cout<<1<<endl; } else cout<<max(((n-2)*(b-a))+1,0)<<endl; return 0; }
a.cc: In function 'int main()': a.cc:13:19: error: no matching function for call to 'max(long long int, int)' 13 | else cout<<max(((n-2)*(b-a))+1,0)<<endl; | ~~~^~~~~~~~~~~~~~~~~~~ In file included from /usr/include/c++/14/string:51, from /usr/include/c++/14/bits/locale_clas...
s213720936
p03705
C++
#include<iostream> #include<algorithm> #include<math.h> #include<set> #include<vector> #include<map> #include <numeric> using namespace std; int main(){ long long int N,A,B; cin>>N>>A>>B; if(A>B) cout<<0<<endl; if(N==1&&A=B) cout<<1<<endl; else if(N==1&&A!=B) cout<<0<<endl; if(N>=2&&A<=B) (B-A)*(N-2)+1 }
a.cc: In function 'int main()': a.cc:14:8: error: lvalue required as left operand of assignment 14 | if(N==1&&A=B) | ~~~~^~~ a.cc:19:14: error: expected ';' before '}' token 19 | (B-A)*(N-2)+1 | ^ | ; 20 | } | ~
s117447277
p03705
C++
#include<iostream> #include<algorithm> #include<math.h> #include<set> #include<vector> #include<map> #include <numeric> using namespace std; int main(){ long long int N,A,B; cin>>N>>A>>B; if(A>B) cout<<0<<endl; else if(N=1&&A!=B) cout<<0<<endl; else if(N=1%%A<B) cout<<1<<endl; else if(N>=2) cout<<(B-A)*...
a.cc: In function 'int main()': a.cc:16:15: error: expected primary-expression before '%' token 16 | else if(N=1%%A<B) | ^
s929097395
p03705
C++
#include<iostream> #include<algorithm> #include<stdio.h> using namespace std; #define int long long int main(){ int n,a,b; cin>>n>>a>>b; if(a>b||(n==1&&a!=b))cout<<0<<endl; else{ int min=a*(n-1)+b; int max=b*(n-1)+a; cout<<max-min+1<<endl; } return 0; }
cc1plus: error: '::main' must return 'int'
s214047005
p03705
C++
#include <iostream> #include <cstdio> #include <cstdlib> #include <cstring> #include <cmath> #include <map> #include <set> #include <vector> #include <stack> #include <queue> #include <bitset> #include <algorithm> #include <numeric> #include <functional> using namespace std; #define Rep(b, e, i) for(int i = b; i <= e;...
a.cc: In function 'void solve()': a.cc:30:16: error: no matching function for call to 'max(ll, int)' 30 | cout << max((A+B*(N-1)) - (A*(N-1)+B) + 1, 0) << endl; | ~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ In file included from /usr/include/c++/14/string:51, from /usr/include/c++/14...
s377553149
p03705
C++
#include <iostream> #include <cstdio> #include <cstdlib> #include <cstring> #include <cmath> #include <map> #include <set> #include <vector> #include <stack> #include <queue> #include <bitset> #include <algorithm> #include <numeric> #include <functional> using namespace std; #define Rep(b, e, i) for(int i = b; i <= e;...
a.cc: In function 'void solve()': a.cc:27:5: error: 'll' was not declared in this scope; did you mean 'all'? 27 | ll N, A, B; | ^~ | all a.cc:28:12: error: 'N' was not declared in this scope 28 | cin >> N >> A >> B; | ^ a.cc:28:17: error: 'A' was not declared in this s...
s363131441
p03705
C++
#include <iostream> #include <algorithm> #include <cmath> #include <string> #include <vector> #include <list> #include <numeric> #include <map> #include <utility> using namespace std; #define ll long long #define int long long #define rep(i,l,r) for(ll i=(l);i<(r);i++) int main(void){ int n,a,b; cin>>n>>a>>b; ...
cc1plus: error: '::main' must return 'int'
s002803281
p03705
C++
#include <iostream> #include <algorithm> #include <cmath> #include <string> #include <vector> #include <list> #include <numeric> #include <map> #include <utility> using namespace std; #define ll long long #define rep(i,l,r) for(ll i=(l);i<(r);i++) int main(void){ int n,a,b; cin>>n>>a>>b; if(a>b){ co...
a.cc:25:5: error: 'cout' does not name a type 25 | cout<<((n-1)*b+a-(n-1)*a-b+1)<<endl; | ^~~~ a.cc:26:5: error: expected unqualified-id before 'return' 26 | return 0; | ^~~~~~ a.cc:27:1: error: expected declaration before '}' token 27 | } | ^
s721937073
p03705
C++
#![allow(unused_imports, unused_variables, dead_code)] use std::io::*; use std::fmt::*; use std::str::*; use std::cmp::*; use std::collections::*; pub trait InputValue { fn parse(s: &str) -> Self; } pub fn read<T: InputValue>() -> T { let mut buf = String::new(); let _ = stdin().read_line(&mut buf); ...
a.cc:1:2: error: invalid preprocessing directive #! 1 | #![allow(unused_imports, unused_variables, dead_code)] | ^ a.cc:29:14: error: too many decimal points in number 29 | for _ in 0..n { | ^~~~ a.cc:2:1: error: 'use' does not name a type 2 | use std::io::*; | ^~~ a.cc:3:...
s649675440
p03705
C++
#define _CRT_SECURE_NO_WARNINGS #define _SCL_SECURE_NO_WARNINGS #include <cstdio> #include <cstdlib> #include <cstring> #include <iostream> #include <string> #include <vector> #include <list> #include <utility> #include <algorithm> #include <functional> #include <cmath> #include <stack> #include <queue> #include <set> ...
a.cc: In function 'int main()': a.cc:31:20: error: expected ',' or ';' before 'for' 31 | #define REP(i,a,n) for(LL i = (a); i < (LL)(n); ++i) | ^~~ a.cc:92:9: note: in expansion of macro 'REP' 92 | REP(i, 1, si) { | ^~~ a.cc:92:13: error: 'i' was not declared in this...
s599148954
p03705
C++
#include <iostream> #include <string> #include <algorithm> #include <cmath> #include <map> using namespace std; int main(){ int n, a, b; cin << n << a << b; if(a > b || (n == 1 && a != b)) cout << 0 << endl; else cout << (b - a) * (n - 2) + 1 << endl; return 0; }
a.cc: In function 'int main()': a.cc:10:13: error: no match for 'operator<<' (operand types are 'std::istream' {aka 'std::basic_istream<char>'} and 'int') 10 | cin << n << a << b; | ~~~ ^~ ~ | | | | | int | std::istream {aka std::basic_istream...
s216050170
p03705
C++
import java.util.Scanner; public class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); String N=sc.next(); char S[]=new char[N.length()]; int ans=(N.length()-1)*2; for(int i=0;N.length()>i;i++){ S[i]=N.charAt(i); } ...
a.cc:1:1: error: 'import' does not name a type 1 | import java.util.Scanner; | ^~~~~~ a.cc:1:1: note: C++20 'import' only available with '-fmodules-ts' a.cc:3:1: error: expected unqualified-id before 'public' 3 | public class Main { | ^~~~~~
s826782737
p03705
C++
#include <bits/stdc++.h> using namespace std; const int NMAX = 1000; const int SIGMA = 26; string s; int N, pre[NMAX+2][SIGMA], mx[NMAX+2][SIGMA]; int Ans = NMAX; int main() { long long A,B; cin >> N >> A >> B; if( A > B ) { cout << "0\n"; return 0; } if( A != B && N == 1 ) { ...
a.cc: In function 'int main()': a.cc:21:19: error: expected ';' before '}' token 21 | return 0;1 | ^ | ; 22 | } | ~
s204931507
p03705
C++
#include <iostream> #include <cstdio> #include <algorithm> #include <cstring> #include <string> #include <stack> #include <queue> #include <vector> #include <set> #include <cmath> #define FOR(i,a,b) for(int i=a;i<b;i++) #define MA(i,j) make_pair(i,j) #define PA pair<int,int> #define PB push_back #define PQ priority_que...
a.cc: In function 'int main()': a.cc:30:12: error: no matching function for call to 'max(int, long long int)' 30 | cout<<max(0,U-L+1)<<endl; | ~~~^~~~~~~~~ In file included from /usr/include/c++/14/string:51, from /usr/include/c++/14/bits/locale_classes.h:40, from /u...
s976566181
p03705
C++
#include<bits/stdc++.h> #define r(i,n) for(int i=0;i<n;i++) using namespace std; #define int long long int n,l,r; main(){ cin>>n>>l>>r; else if(l<r&&(r-l)<=n)cout<<(n-1)*r+l-n*l<<endl; else if(l==r)cout<<1<<endl; else cout<<0<<endl; }
a.cc:6:1: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type] 6 | main(){ | ^~~~ a.cc: In function 'int main()': a.cc:8:3: error: 'else' without a previous 'if' 8 | else if(l<r&&(r-l)<=n)cout<<(n-1)*r+l-n*l<<endl; | ^~~~