submission_id
stringlengths
10
10
problem_id
stringlengths
6
6
language
stringclasses
3 values
code
stringlengths
1
522k
compiler_output
stringlengths
43
10.2k
s180126144
p03705
C++
use std::io; fn next_vec() -> Vec<i64> { let mut buf = String::new(); io::stdin().read_line(&mut buf).unwrap(); buf.split_whitespace().map(|n| n.parse().unwrap()).collect() } fn main() { let v = next_vec(); let n = v[0]; let a = v[1]; let b = v[2]; let minimum = a * (n - 1) + b; l...
a.cc:1:1: error: 'use' does not name a type 1 | use std::io; | ^~~ a.cc:3:1: error: 'fn' does not name a type 3 | fn next_vec() -> Vec<i64> { | ^~ a.cc:9:1: error: 'fn' does not name a type 9 | fn main() { | ^~
s207306486
p03705
C++
#include <bits/stdc++.h> #include<iostream> #include<cstdio> #include<vector> #include<queue> #include<map> #include<cstring...
a.cc: In function 'int main()': a.cc:150:17: error: 'a' was not declared in this scope 150 | cin>>n>>a>>b; | ^ a.cc:150:20: error: 'b' was not declared in this scope 150 | cin>>n>>a>>b; | ^
s188888337
p03705
C++
#include<bits/sdtc++.h> using namespace std; int n,a,b; int main(){ cin>>n>>a>>b; if(n==1&&a!=b)printf("0"); else if(a>b)printf("0"); else{ long long sm=1LL*a*(n-1)+b; long long bi=1LL*b*(n-1)+a; printf("%lld",bi-sm+1); return 0; ...
a.cc:1:9: fatal error: bits/sdtc++.h: No such file or directory 1 | #include<bits/sdtc++.h> | ^~~~~~~~~~~~~~~ compilation terminated.
s045348853
p03705
C++
#define _USE_MATH_DEFINES #define _CRT_SECURE_NO_WARNINGS #include<stdio.h> #include<string> #include<iostream> #include<cctype> #include<cstdio> #include<vector> #include<stack> #include<queue> #include <algorithm> #include<math.h> #include<set> #include<map> #include <sstream> #include<iomanip> #include <ctype.h> //...
a.cc: In function 'int main()': a.cc:41:22: error: no matching function for call to 'max(long long int, int)' 41 | */cout << max(c*a-c+b - m+1,0) << endl; | ~~~^~~~~~~~~~~~~~~~~ In file included from /usr/include/c++/14/string:51, from a.cc:4: /usr/include/c++/14/bits...
s207518130
p03705
Java
<?php class In { private $buf = []; private $count = 0; private $pointer = 0; public function nextLine() { $ret = ''; if($this->hasNext()){ while($this->hasNext()){ $ret .= $this->next(); } }else{ $ret = trim(fgets(STDIN)); } return $ret; } public function next() { if(!$this->hasNext...
Main.java:1: error: class, interface, enum, or record expected <?php ^ Main.java:5: error: <identifier> expected private $buf = []; ^ Main.java:5: error: illegal start of expression private $buf = []; ^ Main.java:6: error: <identifier> expected private $count = 0; ^ Main.j...
s461227185
p03705
C++
#include<bits/stdc++.h> using namespace std; int main(){ int n,a,b; cin >> n >> a >> b; ans=(b-a)*(n-2)+1; cout << (ans<0?0:ans) << endl; return 0; }
a.cc: In function 'int main()': a.cc:8:9: error: 'ans' was not declared in this scope; did you mean 'abs'? 8 | ans=(b-a)*(n-2)+1; | ^~~ | abs
s414736231
p03705
C++
#include<iostream> using namespace std; int main() { string s; cin >> s; long long int ans = 0; for (int i = 0; i < s.size(); ++i) { if (s[i] = 'U') { ans += (2 * (i - 1) + s.size() - 2; } else { ans += i - 1 + (s.size() - 2) * 2; } } cout << ans << endl; }
a.cc: In function 'int main()': a.cc:10:59: error: expected ')' before ';' token 10 | ans += (2 * (i - 1) + s.size() - 2; | ~ ^ | )
s498436663
p03705
C++
#include <bits/stdc++.h> using namespace std; #define int __int64 main() { int n, a, b; cin >> n >> a >> b; if (n == 1) { cout << (a == b ? 1 : 2); } else if (b < a) { cout << 0; } else if (n == 2) { cout << 1; } else { cout << ((a+b * (n-1)) - (a * (n-1) + b) + 1); } }
a.cc:4:1: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type] 4 | main() { | ^~~~ a.cc: In function 'int main()': a.cc:3:13: error: '__int64' was not declared in this scope; did you mean '__ynf64'? 3 | #define int __int64 | ^~~~~~~ a.cc:5:9: note: in expansion of ...
s089861672
p03705
C++
#include <iostream> #include <cstdio> #include <stdlib.h> using namespace std; typedef long long LL; int main() { __int64 n,a,b; scanf("%I64d%I64d%I64d",&n,&a,&b); if(a>b ) { printf("0\n"); return 0; } if(n == 1 && a != b) { printf("0\...
a.cc: In function 'int main()': a.cc:8:5: error: '__int64' was not declared in this scope; did you mean '__int64_t'? 8 | __int64 n,a,b; | ^~~~~~~ | __int64_t a.cc:9:30: error: 'n' was not declared in this scope 9 | scanf("%I64d%I64d%I64d",&n,&a,&b); | ...
s800424227
p03705
C++
#include <iostream> #include <cstdio> using namespace std; typedef long long LL; int main() { __int64 n,a,b; scanf("%I64d%I64d%I64d",&n,&a,&b); if(a>b ) { printf("0\n"); return 0; } if(n == 1 && a != b) { printf("0\n"); ret...
a.cc: In function 'int main()': a.cc:7:5: error: '__int64' was not declared in this scope; did you mean '__int64_t'? 7 | __int64 n,a,b; | ^~~~~~~ | __int64_t a.cc:8:30: error: 'n' was not declared in this scope 8 | scanf("%I64d%I64d%I64d",&n,&a,&b); | ...
s187593723
p03705
C++
#include <iostream> #include <cstdio> using namespace std; int main() { int n,a,b; while(cin>>n>>a>>b) { if(a>b ) { cout<<"0"<<endl; continue; } if(n == 1 && a != b) { cout<<"0"<<endl; continue; } cout<<(...
a.cc: In function 'int main()': a.cc:19:28: error: expected ';' before ')' token 19 | cout<<(b-a)*(n-2)+1)<<endl;; | ^ | ;
s430404934
p03705
C++
#include <iostream> #include <cstdio> using namespace std; int main() { __in64 n,a,b; while(~scanf("%I64d%I64d%I64d",&n,&a,&b)) { if(a>b ) { printf("0\n"); continue; } if(n == 1 && a != b) { printf("0\n"); continue; ...
a.cc: In function 'int main()': a.cc:6:5: error: '__in64' was not declared in this scope; did you mean '__u64'? 6 | __in64 n,a,b; | ^~~~~~ | __u64 a.cc:7:37: error: 'n' was not declared in this scope 7 | while(~scanf("%I64d%I64d%I64d",&n,&a,&b)) | ...
s078437750
p03705
C++
#include<bits/stdc++.h> using namespace std; typedef long long int64; int main() { int64 N, A, B; cin >> N >> A >> B; if(N == 1) { if(A == B) cout << 1 << endl; else cout << 0 << endl; } else { cout << max(0, (N * B - B + A) - (N * A - A + B) + 1) << endl; } }
a.cc: In function 'int main()': a.cc:16:16: error: no matching function for call to 'max(int, int64)' 16 | cout << max(0, (N * B - B + A) - (N * A - A + B) + 1) << endl; | ~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ In file included from /usr/include/c++/14/algorithm:60, from...
s730863393
p03705
C++
#include <iostream> #include <cmath> int main(){ int N, A, B, tmp; std::cin >> N >> A >> B; tmp = (B - A) * (N - 2) + 1; if(N < 1) std::cout << 0 << std::endl; else if(A != B && N = 1) std::cout << 0 << std::endl; else std::cout << tmp << std::endl; }
a.cc: In function 'int main()': a.cc:9:20: error: lvalue required as left operand of assignment 9 | else if(A != B && N = 1) std::cout << 0 << std::endl; | ~~~~~~~^~~~
s896825988
p03705
C++
#include<iostream> using namespace std; int main() { long N,A,B,result; int temp; cin>>N>>A>>B; if (A>B) { temp=0; cout<<temp<<endl; } else if((B-A+1)>N) { temp=0; cout<<temp<<endl; } else if(n==1 && A==B) { temp=1; cout<<temp<<endl; } else { result= (A+(N-1)*B)-((N-1)*A+B)+1; cout<<...
a.cc: In function 'int main()': a.cc:22:17: error: 'n' was not declared in this scope 22 | else if(n==1 && A==B) | ^
s367009044
p03705
C++
/* * To change this license header, choose License Headers in Project Properties. * To change this template file, choose Tools | Templates * and open the template in the editor. */ import java.util.*; /** * * @author Jeel */ public class Main { /** * @param args the command line arguments */ p...
a.cc:6:1: error: 'import' does not name a type 6 | import java.util.*; | ^~~~~~ a.cc:6:1: note: C++20 'import' only available with '-fmodules-ts' a.cc:11:1: error: expected unqualified-id before 'public' 11 | public class Main { | ^~~~~~
s019923812
p03705
C++
#include <bits/stdc++.h> using namespace std; #define lpa(i,a,b) for(int i=a; i<b; ++i) #define lp(i,n) lpa(i,0,n) void p1() { long long n,a,b; cin>>n>>a>>b; if(n==1) cout<<a==b; else if(a>b) cout<<0; else cout<<(n-2)*(b-a)+1; } int main() { p1(); }
a.cc: In function 'void p1()': a.cc:9:25: error: no match for 'operator==' (operand types are 'std::basic_ostream<char>::__ostream_type' {aka 'std::basic_ostream<char>'} and 'long long int') 9 | if(n==1) cout<<a==b; | ~~~~~~~^~~ | | | | ...
s444261826
p03705
C++
#include <bits/stdc++.h> using namespace std; #define lpa(i,a,b) for(int i=a; i<b; ++i) #define lp(i,n) lpa(i,0,n) void p1() { int n,a,b; cin>>n>>a>>b; if(n==1) cout<< a==b; else if(a>b) cout<<0; else cout<<(n-2)*(b-a)+1; } int main() { p1(); }
a.cc: In function 'void p1()': a.cc:9:26: error: no match for 'operator==' (operand types are 'std::basic_ostream<char>' and 'int') 9 | if(n==1) cout<< a==b; | ~~~~~~~~^~~ | | | | | int | std::bas...
s313390389
p03705
C++
#include <bits/stdc++.h> using namespace std; #define lpa(i,a,b) for(int i=a; i<b; ++i) #define lp(i,n) lpa(i,0,n) void p1() { int n,a,b; cin>>n>>a>>b; if(n==1) cout<<a==b; else if(a>b) cout<<0; else cout<<(n-2)*(b-a)+1; } int main() { p1(); }
a.cc: In function 'void p1()': a.cc:9:25: error: no match for 'operator==' (operand types are 'std::basic_ostream<char>' and 'int') 9 | if(n==1) cout<<a==b; | ~~~~~~~^~~ | | | | | int | std::basic_o...
s934710991
p03705
C++
#include <bits/stdc++.h> using namespace std; typedef long long ll; typedef vector<int> vint; typedef pair<int,int> pint; typedef vector<pint> vpint; #define rep(i,n) for(int i=0;i<(n);i++) #define REP(i,n) for(int i=n-1;i>=(0);i--) #define reps(i,f,n) for(int i=(f);i<(n);i++) #define each(it,v) for(__typeof((v).begin(...
a.cc: In function 'int main()': a.cc:34:29: error: no matching function for call to 'max(int, ll)' 34 | printf("%lld\n", max(0, ma - mi + 1)); | ~~~^~~~~~~~~~~~~~~~ In file included from /usr/include/c++/14/algorithm:60, from /usr/include/x86_64-linux-gnu/c++/1...
s590967901
p03705
C++
#include <bits/stdc++.h> using namespace std; #define N 2001 int n, m, sum[N][N], ngang[N][N], doc[N][N], Q; int x1, y1, x2, y2; char a[N][N]; // Tinh số thành pahanf liên thông của HCN giới hạn bởi 4 đường x1 y1 x2 y2; // Theo đề bài : Graph các đỉnh xanh LÀ 1 CÂY // =>> Số thành phần liên thông của cây : = số đình ...
a.cc:6:9: error: 'int y1' redeclared as different kind of entity 6 | int x1, y1, x2, y2; | ^~ In file included from /usr/include/features.h:523, from /usr/include/x86_64-linux-gnu/c++/14/bits/os_defines.h:39, from /usr/include/x86_64-linux-gnu/c++/14/bits/c++config.h:...
s099091094
p03705
C++
/* _ _ _______ _ _ | | / / | _____| | | / / | | / / | | | | / / | |/ / | |_____ | |/ / | |\ \ | _____| | |\ \ | | \ \ | | | | \ \ | | \ \ | |_____ | | \ \ |_| \_\ |_______| |_| \_\ */ /*#include <iostream> #include <cstdio> #include <set> #include <map> #include <stack> ...
a.cc: In function 'int main()': a.cc:60:16: error: no matching function for call to 'max(ll, int)' 60 | cout << max((n - 1) * B + A - ((n - 1) * A + B) + 1, 0) << "\n"; | ~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ In file included from /usr/include/c++/14/algorithm:60, fro...
s047589758
p03705
C++
/* _ _ _______ _ _ | | / / | _____| | | / / | | / / | | | | / / | |/ / | |_____ | |/ / | |\ \ | _____| | |\ \ | | \ \ | | | | \ \ | | \ \ | |_____ | | \ \ |_| \_\ |_______| |_| \_\ */ /*#include <iostream> #include <cstdio> #include <set> #include <map> #include <stack> ...
a.cc: In function 'int main()': a.cc:59:23: error: found ':' in nested-name-specifier, expected '::' 59 | cin >> n >> A >> B: | ^ | :: a.cc:59:22: error: 'B' is not a class, namespace, or enumeration 59 | cin >> n >> A >> B: | ...
s009216612
p03705
C++
#define debug(x) cout<<#x<<": "<<x<<endl #define rep(a, b) for(int unsafe_cnt=a; unsafe_cnt < b;unsafe_cnt++) #define fn auto #include <iostream> #include <stdio.h> #include <vector> #include <math.h> #include <algorithm> #include <string> using namespace std; void newline() {cout << endl;} template <typename T> void ...
a.cc:18:1: error: '::main' must return 'int' 18 | void main() { | ^~~~
s565158208
p03705
C++
123
a.cc:1:1: error: expected unqualified-id before numeric constant 1 | 123 | ^~~
s243711438
p03705
C++
#include <bits/stdc++.h> using namespace std; int a, n, b; int main(){ cin >> n >> a >> b; cout << 1LL * (n - 2) * ( b - a) + 1 }
a.cc: In function 'int main()': a.cc:7:37: error: expected ';' before '}' token 7 | cout << 1LL * (n - 2) * ( b - a) + 1 | ^ | ; 8 | } | ~
s754335198
p03705
C++
#include<bits/stdc++.h> #define rep(i,a,b) for(int i=(a);i<=(b);i++) #define per(i,a,b) for(int i=(a);i>=(b);i--) using namespace std; inline void read(int &x){ x=0;char ch=getchar();int f=1; while(ch<'0'||ch>'9'){if(ch=='-')f=-1;ch=getchar();} while(ch>='0'&&ch<='9'){x=10*x+ch-'0';ch=getchar();}x*=f; } inline void ...
a.cc:14:1: error: 'i64' does not name a type 14 | i64 n,a,b; | ^~~ a.cc: In function 'int main()': a.cc:16:14: error: 'n' was not declared in this scope; did you mean 'yn'? 16 | cin>>n>>a>>b; | ^ | yn a.cc:16:17: error: 'a' was not declared in this scope 16 |...
s223444803
p03705
C++
#include <iostream> using namespace std; int solve(int N, int B){ if(B < 0) return 0; if(N == 1) return (B == 0) ? 1 : 0; else{ return (N - 2) * B + 1; } } int main(){ int N, A, B; cin >> N >> A >> B; cout << solve(N, B - A) << endl; }#include <iostream> using namespace std; int solve(int N, int B)...
a.cc:16:2: error: stray '#' in program 16 | }#include <iostream> | ^ a.cc:16:3: error: 'include' does not name a type 16 | }#include <iostream> | ^~~~~~~ a.cc:19:5: error: redefinition of 'int solve(int, int)' 19 | int solve(int N, int B){ | ^~~~~ a.cc:4:5: note: 'int solve(int, int)' ...
s231427943
p03705
C++
#include<cstdio> int main(){ int n,a,b; if(a > b) return 0*printf("0\n"); if(n == 1 && a < b) return 0*printf("0\n"); printf("%d\n",a+b*(n-1)-(b+a*(n-1)+1); return 0; }
a.cc: In function 'int main()': a.cc:8:38: error: expected ')' before ';' token 8 | printf("%d\n",a+b*(n-1)-(b+a*(n-1)+1); | ~ ^ | )
s024762879
p03705
C++
#include <bits/stdc++.h> using namespace std; typedef long long ll; typedef vector<ll> vi; typedef vector<vi> vvi; #define pb push_back #define rep(i, a, n) for(int i = (a); i < (n); i++) #define dep(i, a, n) for(int i = (a); i >= (n); i--) #define vin(n, d) rep(i, 0, n) cin >> d[i] #define out(n) cout << (n) << end...
a.cc: In function 'int main()': a.cc:25:1: error: expected ';' before '}' token 25 | } | ^
s434624837
p03705
C++
#include <iostream> int main() { long N, A, B; std::cin >> N >> A >> B; std::cout << std::max( 0, ( A + B * ( N - 1 ) ) - ( A * ( N - 1 ) + B ) + 1 ) << std::endl; return 0; }
a.cc: In function 'int main()': a.cc:7:31: error: no matching function for call to 'max(int, long int)' 7 | std::cout << std::max( 0, ( A + B * ( N - 1 ) ) - ( A * ( N - 1 ) + B ) + 1 ) << std::endl; | ~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ In file incl...
s974606523
p03705
C
#include<stdio.h>   int main() {   long n, a, b, m;   scanf("%d %d %d", &n, &a, &b);   if (a > b) { m = 0; } else { if (n == 1) { if (a == b) { m = 1; } else { m = 0; } }   else if (n > 1) { m = (b - a)*(n - 2) + 1; } else { m = 0; } } printf("%d\n", m); return 0; }
main.c:3:1: error: stray '\302' in program 3 | <U+00A0> | ^~~~~~~~ main.c: In function 'main': main.c:5:1: error: stray '\302' in program 5 | <U+00A0> | ^~~~~~~~ main.c:7:1: error: stray '\302' in program 7 | <U+00A0> | ^~~~~~~~ main.c:9:1: error: stray '\302' in program 9 | <U+00A0> ...
s277573836
p03705
C++
#include <bits/stdc++.h> using namespace std; long long n,a,b; int main() { ios_base::sync_with_stdio(0); cin.tie(0); cin>>n>>a>>b; cout<<max(0,(n-2)*(b-a+1))<<endl; }
a.cc: In function 'int main()': a.cc:11:11: error: no matching function for call to 'max(int, long long int)' 11 | cout<<max(0,(n-2)*(b-a+1))<<endl; | ~~~^~~~~~~~~~~~~~~~~ In file included from /usr/include/c++/14/algorithm:60, from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:51...
s455429559
p03705
C++
#include <bits/stdc++.h> #include <sys/time.h> using namespace std; #define rep(i,n) for(long long i = 0; i < (long long)(n); i++) #define repi(i,a,b) for(long long i = (long long)(a); i < (long long)(b); i++) #define pb push_back #define all(x) (x).begin(), (x).end() #define fi first #define se second #define mt make...
a.cc:40:20: warning: 'template<class _Category, class _Tp, class _Distance, class _Pointer, class _Reference> struct std::iterator' is deprecated [-Wdeprecated-declarations] 40 | struct ci : public iterator<forward_iterator_tag, ll> { ll n; ci(const ll n) : n(n) { } bool operator==(const ci& x) { return n == x.n; } ...
s169816760
p03705
Java
/** * Created by Karan Jobanputra on 29-05-2017. */ import java.util.Scanner; import java.io.*; import java.util.*; import java.math.*; import java.lang.*; import static java.lang.Math.*; public class AtC015A { public static void main(String args[]) throws Exception ...
Main.java:13: error: class AtC015A is public, should be declared in a file named AtC015A.java public class AtC015A { ^ 1 error
s212420363
p03705
C++
#include<bits/stdc++.h> #include<stdlib.h> using namespace std;   int main(){ int n,a,b; cin>>n>>a>>b; if((n==1)&&(a!=b)) cout<<0<<endl; exit(0); if(a>b) cout<<0<<endl; exit(0); if((n!=1)&&(a==b)) cout<<0<<endl; exit(0); int min=a*(n-1)+b; int max=a+b*(n-1); cout<<max-min+1<<endl; }
a.cc:4:1: error: extended character   is not valid in an identifier 4 |   | ^ a.cc:4:1: error: '\U000000a0' does not name a type 4 |   | ^
s423423606
p03705
C++
#include <stdio.h> int main(){ long int N,A,B,OUTPUT; scanf("%ld %ld %ld",&N,&A,&B); if(A>B){ printf("0"); return 0; } if(N==1){ if(A!=B){ printf("0"); return 0; } printf("1"); return 0; } OUTPUT = (n-2)*(B-A); // OUTPUT=(B*(N-1)+A) - (A*(N-1)+B); if(OUTPUT>0)OUTPUT++; if(OUTPUT==0)OUTPUT=1; ...
a.cc: In function 'int main()': a.cc:17:19: error: 'n' was not declared in this scope 17 | OUTPUT = (n-2)*(B-A); | ^
s730032174
p03705
C++
#include <bits/stdc++.h> int main(){ unsigned long long A, B, N; cin >> N >> A >> B; if(B<A){ cout << "0" << endl; }else{ unsigned long long min = (N-1)*A + B; unsigned long long max = (N-1)*B + A; cout << max-min+1 << endl; } r...
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 /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:146, from a.cc:1: /usr/include/c++/14...
s686534538
p03705
C++
#include "stdafx.h" #include <iostream> using namespace std; void ap(); int main() { ap(); return 0; } void ap() { int N, A, B; cin >> N >> A >> B; int minv, maxv; minv = A*(N - 1) + B; maxv = A + B*(N - 1); int result = maxv - minv >= 0 ? maxv - minv + 1 : 0; cout << result << endl; }
a.cc:1:10: fatal error: stdafx.h: No such file or directory 1 | #include "stdafx.h" | ^~~~~~~~~~ compilation terminated.
s664326038
p03705
Java
import java.util.Scanner; class Main { public static void main(String[] args) { Scanner scanner = new Scanner(System.in); int N = scanner.nextInt(); int A = scanner.nextInt(); int B = scanner.nextInt(); int count = (N - 2)*(B - A) + 1; if (N == 1 && A == B) { System.out.printl...
Main.java:15: error: illegal start of expression if (N == 1 && A !== B) { ^ 1 error
s991826766
p03705
C++
#include <iostream> using namespace std; int main() { long long n, a, b; int ans; cin >> n >> a >> b; if(n == 1 && a == b){ ans = 1; } else if(n == 1 && a < b){ ans = 0; } else if(n == 1 && a > b){ ans = 0; if(n != 1 && a > b){ ans = 0; } else if(n != 1 && a <= b){ ans = (b-a)*(n-2...
a.cc: In function 'int main()': a.cc:24:2: error: expected '}' at end of input 24 | } | ^ a.cc:4:1: note: to match this '{' 4 | { | ^
s138686617
p03705
C++
#include <iostream> #include <cmath> using namespace std; int main() { int num, min, max; cin >> num >> min >> max; int between = max-min; if (num <= 0 || num < between || between < 0) { cout << 0 << endl; return 0; } else if (between == 0){ cout << 1 << endl; re...
a.cc: In function 'int main()': a.cc:19:20: error: 'max' cannot be used as a function 19 | cout << max(((max*(num-1)+min) - (min*(num-1)+max) +1), 0); | ~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
s895400422
p03705
C++
# include <stdio.h> # include <algorithm> long long N, A, B; int main(void){ // Here your code ! scanf("%lld%lld%lld",&N,&A,&B); long long D = B - A; if (D < 0) {printf("%d\n", 0);} else if (D == 0) { if (N == 1) {printf("%d\n", 1);} else {printf("%d\n", 0);} } else { ...
a.cc: In function 'int main()': a.cc:19:9: error: 'else' without a previous 'if' 19 | else {printf("%lld\n", (1 + (N - 2) * D));} | ^~~~
s557091759
p03705
C++
#include <stdio.h> int main(){ long int n,min,max; scanf("%d %d %d",&n,&min,&max); int i; int k=1; if(min>max || n==1){ k=0; } else if(min==max || n==2){ k=1; } else if(){ k=((max)*(n-1)+min)-(min*(n-1)+max)+1; } printf("%d",k); return 0; }
a.cc: In function 'int main()': a.cc:12:19: error: expected primary-expression before ')' token 12 | } else if(){ | ^
s737124990
p03705
C++
#include <stdio.h> int main(){ long int n,min,max; scanf("%d %d %d",&n,&min,&max); int i; int k=1; if(min>max || n==1){ k=0; } else if(min==max || n==2){ k=1; } else if(){ k=((max)*(n-1)+min)-(min*(n-1)+max)+1; } printf("%d",k); return 0; }
a.cc: In function 'int main()': a.cc:12:19: error: expected primary-expression before ')' token 12 | } else if(){ | ^
s991133997
p03705
C++
#include <algorithm> #include <iostream> #include <iomanip> #include <cstdio> #include <random> #include <string> #include <vector> #include <cmath> #include <queue> #include <set> #include <map> using namespace std; typedef pair<int,int> pii; typedef vector<int> vi; typedef vector<vi> vvi; typedef long long ll; strin...
a.cc: In function 'int main()': a.cc:28:33: error: expected ';' before '}' token 28 | u += s[i] == 'U' | ^ | ; 29 | } | ~
s868893853
p03705
C++
#include <iostream> int main() { long long n, a, b; std::cin >> n >> a >> b; std::cout << max(n*b-n*a+1,0ll); }
a.cc: In function 'int main()': a.cc:5:22: error: 'max' was not declared in this scope; did you mean 'std::max'? 5 | std::cout << max(n*b-n*a+1,0ll); | ^~~ | std::max In file included from /usr/include/c++/14/string:51, from /usr/include...
s840772804
p03705
C++
#include<iostream> #include<utility> using namespace std; int64_t main() { int64_t N, A, B; cin >> N >> A >> B; int64_t ans = 0; if (A > B) { ans = 0; } else if (N == 1) { ans = (A == B) ? 1 : 0; } else { ans = (B - A) * (N - 2) + 1; } cout << ans << endl; }
a.cc:5:1: error: '::main' must return 'int' 5 | int64_t main() { | ^~~~~~~
s104314065
p03705
C++
}
a.cc:1:1: error: expected declaration before '}' token 1 | } | ^
s106776380
p03705
Java
package atcoder; import java.util.*; public class A { public static void main(String[] args) { Scanner sc = new Scanner(System.in); long n = sc.nextLong(); long a = sc.nextLong(); long b = sc.nextLong(); System.out.println(ans(n,a,b)); sc.close(); } public static long ans(long n, long a, long b) { ...
Main.java:5: error: class A is public, should be declared in a file named A.java public class A { ^ 1 error
s263625140
p03705
C++
#include<iostream> #include<utility> using namespace std; int main() { int N, A, B; cin >> N >> A >> B; int64_t ans = 0; if (A > B) { ans = 0; } else if (N == 1) ans = (A == B) ? 1 : 0; } else { int64_t min = A * (N - 2); int64_t max = B * (N - 2); ans = (max - min + 1); } cout << ans << endl; }...
a.cc:17:9: error: expected unqualified-id before 'else' 17 | else { | ^~~~ a.cc:23:9: error: 'cout' does not name a type 23 | cout << ans << endl; | ^~~~ a.cc:24:1: error: expected declaration before '}' token 24 | } | ^
s407757500
p03705
C++
#include<iostream> #include<utility> using namespace std; int main() { int N, A, B; cin >> N >> A >> B; int64_t ans = 0; if (A > B) { ans = 0; } else if (N == 1) ans = (A == B) ? 1 : 0; } else { int64_t min = A * (N - 2); int64_t max = B * (N - 2); ans = (max - min + 1); } cout << ans << endl; }...
a.cc:17:9: error: expected unqualified-id before 'else' 17 | else { | ^~~~ a.cc:23:9: error: 'cout' does not name a type 23 | cout << ans << endl; | ^~~~ a.cc:24:1: error: expected declaration before '}' token 24 | } | ^
s810478120
p03705
C++
#include<iostream> #include<utility> using namespace std; int main() { int N, A, B; cin >> N >> A >> B; int64_t ans = 0; if (A > B) { ans = 0; } else if (N == 1) ans = (A == B) ? 1 : 0; } else { int64_t min = A * (N - 2); int64_t max = B * (N - 2); ans = (max - min + 1); } cout << ans << endl; }...
a.cc:17:9: error: expected unqualified-id before 'else' 17 | else { | ^~~~ a.cc:23:9: error: 'cout' does not name a type 23 | cout << ans << endl; | ^~~~ a.cc:24:1: error: expected declaration before '}' token 24 | } | ^
s273165212
p03705
C++
#include<iostream> #include<utility> using namespace std; int main() { int N, A, B; cin >> N >> A >> B; int64_t ans = 0; if (A > B) { ans = 0; } else if (N == 1) ans = (A == B) ? 1 : 0; } else { int64_t min = A * (N - 2); int64_t max = B * (N - 2); ans = (max - min + 1); } cout << ans << endl; }...
a.cc:17:9: error: expected unqualified-id before 'else' 17 | else { | ^~~~ a.cc:23:9: error: 'cout' does not name a type 23 | cout << ans << endl; | ^~~~ a.cc:24:1: error: expected declaration before '}' token 24 | } | ^
s090413673
p03705
C++
#include<iostream> #include<utility> using namespace std; int main() { int N, A, B; cin >> N >> A >> B; int64_t ans = 0; if (A > B) { ans = 0; } else if (N == 1) ans = (A == B) ? 1 : 0; } else { int64_t min = A * (N - 2); int64_t max = B * (N - 2); ans = (max - min + 1); } cout << ans << endl; }...
a.cc:17:9: error: expected unqualified-id before 'else' 17 | else { | ^~~~ a.cc:23:9: error: 'cout' does not name a type 23 | cout << ans << endl; | ^~~~ a.cc:24:1: error: expected declaration before '}' token 24 | } | ^
s675968827
p03705
C++
#include<iostream> #include<utility> using namespace std; int main() { int N, A, B; cin >> N >> A >> B; int64_t ans = 0; if (A > B) { ans = 0; } else if (N == 1) ans = (A == B) ? 1 : 0; } else { int64_t min = A * (N - 2); int64_t max = B * (N - 2); ans = (max - min + 1); } cout << ans << endl; }...
a.cc:17:9: error: expected unqualified-id before 'else' 17 | else { | ^~~~ a.cc:23:9: error: 'cout' does not name a type 23 | cout << ans << endl; | ^~~~ a.cc:24:1: error: expected declaration before '}' token 24 | } | ^
s409695171
p03705
C++
#include<iostream> #include<utility> using namespace std; int main() { int N, A, B; cin >> N >> A >> B; int64_t ans = 0; if (A > B) { ans = 0; } else if (N == 1) ans = (A == B) ? 1 : 0; } else { int64_t min = A * (N - 2); int64_t max = B * (N - 2); ans = (max - min + 1); } cout << ans << endl; }...
a.cc:17:9: error: expected unqualified-id before 'else' 17 | else { | ^~~~ a.cc:23:9: error: 'cout' does not name a type 23 | cout << ans << endl; | ^~~~ a.cc:24:1: error: expected declaration before '}' token 24 | } | ^
s320606475
p03705
C++
#include<iostream> #include<utility> using namespace std; int main() { int N, A, B; cin >> N >> A >> B; int64_t ans = 0; if (A > B) { ans = 0; } else if (N == 1) ans = (A == B) ? 1 : 0; } else { int64_t min = A * (N - 2); int64_t max = B * (N - 2); ans = (max - min + 1); } cout << ans << endl; }...
a.cc:17:9: error: expected unqualified-id before 'else' 17 | else { | ^~~~ a.cc:23:9: error: 'cout' does not name a type 23 | cout << ans << endl; | ^~~~ a.cc:24:1: error: expected declaration before '}' token 24 | } | ^
s448798440
p03705
C++
#include<iostream> #include<utility> using namespace std; int main() { int N, A, B; cin >> N >> A >> B; int64_t ans = 0; if (A > B) { ans = 0; } else if (N == 1) ans = (A == B) ? 1 : 0; } else { int64_t min = A * (N - 2); int64_t max = B * (N - 2); ans = (max - min + 1); } cout << ans << endl; }...
a.cc:17:9: error: expected unqualified-id before 'else' 17 | else { | ^~~~ a.cc:23:9: error: 'cout' does not name a type 23 | cout << ans << endl; | ^~~~ a.cc:24:1: error: expected declaration before '}' token 24 | } | ^
s321363632
p03705
C++
#include <cstdio> #include <queue> #include <iostream> #include <algorithm> #define INT long long #define oo 987654321 #define MOD 1000000007 using namespace std; INT n, base, T[1<<19], ans, p[200020] = {1}; struct V{ INT x, v; } a[200020]; bool cmp(V a, V b) { return a.x < b.x; } bool cmp2(V a, V b) { return ...
a.cc: In function 'int main()': a.cc:43:21: error: 'pow' was not declared in this scope 43 | ans += (INT)pow(getSum(base+a[i].v, base*2-1)); | ^~~
s358899720
p03705
C++
#include <iostream> using namespace std; int main() { int num, min, max; cin >> num >> min >> max; int bet = max-min; if (num <= 0 || num < bet) { cout << 0 << endl; return 0; } else if (num=bet){ cout << 1 << endl; return 0 ; } else { cout << (m...
a.cc: In function 'int main()': a.cc:19:21: error: 'max' cannot be used as a function 19 | cout << (max(num-1)+min) - (min(num-1)+max); | ~~~^~~~~~~ a.cc:19:40: error: 'min' cannot be used as a function 19 | cout << (max(num-1)+min) - (min(num-1)+max); | ...
s790448173
p03705
C++
using namespace std; int main() { int A,B,N,K; cin>>N,A,B; if (A<B) if (N<=2) K=1; else K=(N-2)*(B-A+1); else if (A==B) K=1; else K=0; cout<<K<<endl; return 0; }
a.cc: In function 'int main()': a.cc:6:5: error: 'cin' was not declared in this scope 6 | cin>>N,A,B; | ^~~ a.cc:1:1: note: 'std::cin' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>' +++ |+#include <iostream> 1 | using namespace std; a.cc:21:5: error: ...
s218895296
p03705
C++
#include <bits/stdc++.h> using namespace std; typedef long long ll; int main() { ll n, a, b; scanf("%lld %lld %lld", &n, &a, &b); printf("%lld", max(0, b * (n - 2) - a * (n - 2) + 1)); }
a.cc: In function 'int main()': a.cc:9:27: error: no matching function for call to 'max(int, ll)' 9 | printf("%lld", max(0, b * (n - 2) - a * (n - 2) + 1)); | ~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ In file included from /usr/include/c++/14/algorithm:60, from /usr...
s581470894
p03705
C++
#include <iostream> #include <vector> #include <algorithm> #include <set> #include <numeric> using namespace std; set<int> ans; void CombinationRepetitionUtil(int chosen[], int arr[], int index, int r, int start, int end) { // Since index has become r, current combination is // ready to be...
a.cc: In function 'int main()': a.cc:63:25: error: cannot convert '__gnu_cxx::__alloc_traits<std::allocator<long long int>, long long int>::value_type*' {aka 'long long int*'} to 'int*' 63 | CombinationRepetition(&v[0],v.size(),N); a.cc:38:32: note: initializing argument 1 of 'void CombinationRepetition(int*, in...
s516694810
p03705
Java
import java.util.*; import java.lang.*; import java.io.*; public class Main{ public static void main (String[] args) throws java.lang.Exception{ BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); char[] building = br.readLine().toCharArray(); int sum = 0; int length = buildi...
Main.java:22: error: illegal start of type else{ ^ Main.java:35: error: <identifier> expected System.out.println(sum); ^ Main.java:35: error: <identifier> expected System.out.println(sum); ^ Main.java:38: error: class, interface, enum, or record expe...
s466077964
p03705
C++
#include<iostream> using namespace std; long long n,a,b; int main() { cin>>n>>a>>b; long long mn=a*(n-1)+b,mx=b*(n-1)+a; cout<<((a>b||(n==1&&a!=b))?0:mx-mn+1); return 0; }
a.cc: In function 'int main()': a.cc:9:8: error: unable to find numeric literal operator 'operator""\U0000ff1b' 9 | return 0; | ^~~ a.cc:9:11: error: expected ';' before '}' token 9 | return 0; | ^ | ; 10 | } | ~
s278114941
p03705
C++
#include<bits/stdc++.h> using namespace std; int main(){ long long int N,A,B; cin>>N>>A>>B; if(A==B){ cout<<a<<endl; return 0; } if(A>B){ cout<<0<<endl; return 0; } if(N==1){ if(A==B){ cout<<1<<endl; } else{ cout<<0<<endl; } return 0; } if(N==2){ cout<<1<<endl; return 0; } if(N%5!...
a.cc: In function 'int main()': a.cc:7:23: error: 'a' was not declared in this scope 7 | cout<<a<<endl; | ^
s486409019
p03705
C++
# include <stdio.h> long long N, A, B; int main(void){ // Here your code ! scanf("%lld%lld%lld",&N,&A,&B); long long D = B - A; if (D < 0) {printf("%d\n", 0); return 0;} if (D == 0) { if (N == 1) printf("%d\n", 1); return 0; else {printf("%d\n", 0); return 0; } else { ...
a.cc: In function 'int main()': a.cc:15:9: error: expected '}' before 'else' 15 | else {printf("%d\n", 0); return 0; | ^~~~ a.cc:13:17: note: to match this '{' 13 | if (D == 0) { | ^ a.cc:17:5: error: 'else' without a previous 'if' 17 | else { | ^~~...
s738280882
p03705
Java
import java.util.Scanner; public class Main { public static void main (String[] args) { Scanner sc = new Scanner(System.in); int n = sc.nextInt(); int a = sc.nextInt(); int b = sc.nextInt(); if(n==0 || a>b){ System.out.print(0); }else if(a<b && n==1){ System.out.print(0); }else if(a==b && n!=...
Main.java:24: error: ';' expected int r += (s-i); ^ Main.java:24: error: not a statement int r += (s-i); ^ Main.java:24: error: ';' expected int r += (s-i); ^ 3 errors
s345321781
p03705
Java
import java.util.Scanner; /** * Created by DELL on 2017/5/27. */ public class _1 { public static void main(String[] args) { Scanner input=new Scanner(System.in); int N=input.nextInt(); int A=input.nextInt(); int B=input.nextInt(); if(N<1) System.out.println(0); els...
Main.java:6: error: class _1 is public, should be declared in a file named _1.java public class _1 { ^ 1 error
s620078329
p03705
C
#include <stdio.h> int main(void){ int a,b; int n; unsigned long long int ans; scanf("%d %d %d", &n, &a, &b); if( a > b) ans = 0; if( a =< b) ans = (unsigned long long int)(b-a)*(n-2)+1; if( n == 1) ans = 0; printf("%llu\n", ans); return 0; }
main.c: In function 'main': main.c:10:12: error: expected expression before '<' token 10 | if( a =< b) ans = (unsigned long long int)(b-a)*(n-2)+1; | ^
s714017034
p03705
C++
#include <iostream> using namespace std; int solve(){ long n,a,b,cnt; long ans=1,cnt=0; cin>>n>>a>>b; if(b<a){ ans=0; }else if(b>=a&&n<2){ ans=0; }else{ while(cnt<n-2){ ans*=(b-a+1); cnt++; } } cout<<ans<<endl; } int main() { solve(); return 0; }
a.cc: In function 'int solve()': a.cc:6:20: error: redeclaration of 'long int cnt' 6 | long ans=1,cnt=0; | ^~~ a.cc:5:20: note: 'long int cnt' previously declared here 5 | long n,a,b,cnt; | ^~~ a.cc:19:1: warning: no return statement in function ...
s257127329
p03705
C++
#include <stdio.h> int main() { int n, a, b; scanf("%d %d %d", &n, &a, &b); int count = 0; if(n == 1 && a == b) { printf("%d\n", 1); return 0; } else if(n == 2 && a =< b) { printf("%d\n", 2); return 0; } else if(n <= 2) ...
a.cc: In function 'int main()': a.cc:15:27: error: expected primary-expression before '<' token 15 | else if(n == 2 && a =< b) | ^
s321043942
p03705
C++
#include <iostream> using namespace std; int solve(){ long n,a,b,cnt; long ans=1,cnt=0; cin>>n>>a>>b; while(cnt<n-2){ ans*=(b-a+1); cnt++; } cout<<ans<<endl; } int main() { solve(); return 0; }
a.cc: In function 'int solve()': a.cc:6:20: error: redeclaration of 'long int cnt' 6 | long ans=1,cnt=0; | ^~~ a.cc:5:20: note: 'long int cnt' previously declared here 5 | long n,a,b,cnt; | ^~~ a.cc:13:1: warning: no return statement in function ...
s072798465
p03705
C++
#include<stdio.h> #include<vector> #include<algorithm> #include<iostream> #include<stack> #include<queue> using namespace std; int main() { int a,b,c; int o=0; cin>>a>>b>>c; if(b<c) cout<<0<<endl; vector<int> a; for(int i=0;i<a;i++) int sup=0; for(int u=b;u<c+1;u++) sup+=u; return 0; }
a.cc: In function 'int main()': a.cc:17:21: error: conflicting declaration 'std::vector<int> a' 17 | vector<int> a; | ^ a.cc:12:13: note: previous declaration as 'int a' 12 | int a,b,c; | ^ a.cc:21:9: error: 'sup' was not declared in this scope 21 | ...
s549419958
p03705
C++
#include<stdio.h> #include<vector> #include<algorithm> #include<iostream> #include<stack> #include<queue> using namespace std; int main() { int a,b,c; int o=0; cin>>a>>b>>c; if(b<c) cout<<0<<endl; vector<int> a; for(int i=0;i<a;i++) int sup=0 for(int u=b;u<c+1;u++) sup+=u; return 0; }
a.cc: In function 'int main()': a.cc:17:21: error: conflicting declaration 'std::vector<int> a' 17 | vector<int> a; | ^ a.cc:12:13: note: previous declaration as 'int a' 12 | int a,b,c; | ^ a.cc:20:9: error: expected ',' or ';' before 'for' 20 | ...
s428013422
p03705
C++
#include<stdio.h> #include<math.h> #include<string.h> #include<algorithm> #include<stdlib.h> #include<queue> #include<iostream> #include<map> #include<stack> using namespace std; int main() { int N,A,B; long long result=0; scanf("%d%d%d",&N,&A,&B); if(A>B||N<2){printf("%d",result);return;} result = pow(N-2,(B-A))...
a.cc: In function 'int main()': a.cc:17:42: error: return-statement with no value, in function returning 'int' [-fpermissive] 17 | if(A>B||N<2){printf("%d",result);return;} | ^~~~~~
s570841508
p03705
C++
#include<stdio.h> #include<math.h> #include<string.h> #include<algorithm> #include<stdlib.h> #include<queue> #include<iostream> #include<map> #include<stack> using namespace std; int main() { int N,A,B; long long result=0; scanf("%d%d%d",&N,&A,&B); if(A>B||N<2){printf("%d",result);return;} result = pow(N-2,(B-A))...
a.cc: In function 'int main()': a.cc:17:42: error: return-statement with no value, in function returning 'int' [-fpermissive] 17 | if(A>B||N<2){printf("%d",result);return;} | ^~~~~~
s387985697
p03705
Java
import java.util.Scanner; public class Main { public static void main(String[] args) { Scanner scan = new Scanner(System.in); int N=scan.nextInt(); int A=scan.nextInt(); int B=scan.nextInt(); System.out.println((Math.abs(A-B)+1)*2-1); }
Main.java:13: error: reached end of file while parsing } ^ 1 error
s976606573
p03705
C
#include <stdio.h> int main() { int a, b, i, n, nr, msum, rsum, m, conbi; m=msum=nr=rsum=conbi=0; scanf("%d%d%d", &n, &a, &b); if(a>b){ printf("0\n", ); }else if(n<b-a){ printf("0\n"); }else{ m=(b-a)+1; nr=m-(n-2) for (i = m; i > nr; i--) { msum*=i; } for(i=1;i<=n-2;i++){ rsum*=i; } con...
main.c: In function 'main': main.c:9:31: error: expected expression before ')' token 9 | printf("0\n", ); | ^ main.c:14:27: error: expected ';' before 'for' 14 | nr=m-(n-2) | ^ | ; ...
s746451191
p03705
Java
import java.util; public class Main { public static vaid main (String[] args) { Scanner sc = new Scanner(System.in); int n = sc.nextInt(); int a = sc.nextInt(); int b = sc.nextInt(); if(n==0 || a>b){ System.out.print(0); }else if(a<b && n==1){ System.out.print(0); }else if(a==b && n!=1){ ...
Main.java:1: error: cannot find symbol import java.util; ^ symbol: class util location: package java Main.java:4: error: cannot find symbol public static vaid main (String[] args) { ^ symbol: class vaid location: class Main Main.java:5: error: cannot find symbol Scanner sc = new...
s702247236
p03705
C++
include <iostream> using namespace std; int N, A,B, ans; void solve(){ if(N == 1){ if ( A == B){ ans = 1; } else{ ans = 0; } } else { ans = (A - B) * (N-2) + 1; } } void swapab(){ int tmp; if(A < B){ tmp = A; A = B...
a.cc:1:1: error: 'include' does not name a type 1 | include <iostream> | ^~~~~~~ a.cc: In function 'int main()': a.cc:30:5: error: 'cin' was not declared in this scope 30 | cin >> N >> A >> B; | ^~~ a.cc:33:5: error: 'printf' was not declared in this scope 33 | printf("%d", ans); ...
s134247161
p03705
C++
#include <cstdio> #include <iostream> using namespace std; int checkbox[1000000000000]; int count; int main(){ for(int i = 0; i < 10000000; i++) checkbox[i] = 0; int N, min, max; cin >> N >> min >> max; if(N == 1 && max - min >=1) { cout << 0 << endl; return 0;} if(min > max) { cout << 0 << endl; return...
/tmp/ccXsAvyl.o: in function `main': a.cc:(.text+0x144): relocation truncated to fit: R_X86_64_PC32 against symbol `count' defined in .bss section in /tmp/ccXsAvyl.o a.cc:(.text+0x15d): relocation truncated to fit: R_X86_64_PC32 against symbol `count' defined in .bss section in /tmp/ccXsAvyl.o a.cc:(.text+0x163): reloc...
s126609437
p03705
Java
mport java.util.*; public class Main{ public static void main(String[] args){ Scanner sc = new Scanner(System.in); int N = sc.nextInt(); int A = sc.nextInt(); int B = sc.nextInt(); if(B<A){ System.out.println(0); } else if(N==1){ if(B!=A){ System.out.println(0); } if(B==A){ System....
Main.java:1: error: class, interface, enum, or record expected mport java.util.*; ^ 1 error
s358197357
p03705
C
#include <stdio.h> int main(void){ int a,b; int n; long long long int ans; scanf("%d %d %d", &n, &a, &b); if( a == b) ans = 1; if( a > b) ans = 0; if( a < b) ans = (long long long int)(b-a)*(n-2)+1; printf("%llld\n", ans); return 0; }
main.c: In function 'main': main.c:5:15: error: 'long long long' is too long for GCC 5 | long long long int ans; | ^~~~ main.c:11:33: error: 'long long long' is too long for GCC 11 | if( a < b) ans = (long long long int)(b-a)*(n-2)+1; | ^~~~
s933572818
p03705
C++
#include<iostream> #include<fstream> #include<cmath> #include<string> #include<set> #include <map> #include<vector> #include <queue> #include <stack> #include<algorithm> using namespace std; typedef long long ll; #define f(i, x, n) for(int i = x; i < (int)(n); ++i) typedef pair<int, int> ii; const double PI = acos(-1.0...
a.cc:16:16: error: 'LLONG_MAX' was not declared in this scope 16 | const ll INF = LLONG_MAX; | ^~~~~~~~~ a.cc:11:1: note: 'LLONG_MAX' is defined in header '<climits>'; this is probably fixable by adding '#include <climits>' 10 | #include<algorithm> +++ |+#include <climits> 11 | using nam...
s573764398
p03705
C
#include<stdio.h> int main(){ int n,a,b; scanf("%d %d %d",&n,&a,&b);
main.c: In function 'main': main.c:4:1: error: expected declaration or statement at end of input 4 | scanf("%d %d %d",&n,&a,&b); | ^~~~~
s507948420
p03705
C++
#include <stdio.h> int main(){ scanf("%d%d%d",&n,&A,&B); if(A>B){puts("0");return 0;} if(n==1){printf("%d\n",A==B);return 0;} printf("%lld\n",(B-A)*1ll*n); }
a.cc: In function 'int main()': a.cc:3:25: error: 'n' was not declared in this scope 3 | scanf("%d%d%d",&n,&A,&B); | ^ a.cc:3:28: error: 'A' was not declared in this scope 3 | scanf("%d%d%d",&n,&A,&B); | ^ a.cc:3:31: error: 'B' was n...
s168883298
p03705
C++
#include <stdio.h> int main(){ scanf("%d%d%d",&n,&A,&B); if(A>B){puts("0");return 0;} if(n==1){printf("%d\n",A==B);return 0;} printf("%lld\n",(B-A)*1ll*n); }
a.cc: In function 'int main()': a.cc:3:25: error: 'n' was not declared in this scope 3 | scanf("%d%d%d",&n,&A,&B); | ^ a.cc:3:28: error: 'A' was not declared in this scope 3 | scanf("%d%d%d",&n,&A,&B); | ^ a.cc:3:31: error: 'B' was n...
s928510622
p03705
C++
#include<iostream> #include<stdint> using namespace std; int main() { int N, A, B; cin >> N >> A >> B; if (A > B) cout << 0; else if (N == 1 && A < B) cout << 0; else cout << (int64_t) (B - A) * (N - 2) + 1; return 0; } /* A~BまではB-A+1通りの数字がある N個において、A*(N-1)+BからA+B*(N-1)までの通りがあるので、 A+B*(N-1)-(A*(N-1)+B)+1=B*(N-2)...
a.cc:2:9: fatal error: stdint: No such file or directory 2 | #include<stdint> | ^~~~~~~~ compilation terminated.
s582141110
p03705
C++
#include <cstdio> #include <iostream> #include <algorithm> using namespace std; typedef long long ll; ll a,b,n; int main(){ cin >> n >> a >> b; if (n == 1 && a == b) cout << 1; n -= 2; else if (a > b || n < 0) cout << 0; else { cout << (b-a)*n+1; } return 0; }
a.cc: In function 'int main()': a.cc:11:9: error: 'else' without a previous 'if' 11 | else if (a > b || n < 0) cout << 0; | ^~~~
s162935301
p03705
C++
import java.util.*; public class Main{ public static void main(String [] args){ Scanner sc = new Scanner(System.in); int n = sc.nextInt(); int l = sc.nextInt(); int r = sc.nextInt(); int min = (n - 1) * l + r; int max = (n - 1) * r + l; int ans = max - min + ...
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:3:1: error: expected unqualified-id before 'public' 3 | public class Main{ | ^~~~~~
s409768370
p03705
C++
#include <cstdio> #include <cstring> #include <algorithm> using namespace std; template<class T> inline void read(T& x) { char c = getchar(); T p = 1, n = 0; while(c < '0' || c > '9'){if(c == '-') p = -1; c = getchar();} while(c >= '0' && c <= '9'){n = n * 10 + c - '0'; c = getchar();} x = p * n; } template<class ...
a.cc: In function 'int main()': a.cc:29:29: error: no matching function for call to 'max(long long int&, int)' 29 | printf("%lld\n", max(ans, 0)); | ~~~^~~~~~~~ In file included from /usr/include/c++/14/algorithm:60, from a.cc:3: /usr/include/c++/14/bits/stl_al...
s219621223
p03705
C++
#include<iostream> #include<algorithm> #include<cstdio> #include<cmath> #include<math.h> #include<string> #include<string.h> #include<stack> #include<queue> #include<vector> #include<utility> #include<set> #include<map> #include<stdlib.h> #include<iomanip> using namespace std; #define ll long long #define ld long do...
a.cc: In function 'int main()': a.cc:40:12: error: no matching function for call to 'max(int, long long int)' 40 | cout<<max(0,ans1-ans2+1)<<endl; | ~~~^~~~~~~~~~~~~~~ In file included from /usr/include/c++/14/string:51, from /usr/include/c++/14/bits/locale_classes.h:40, ...
s852946358
p03705
Java
import java.io.IOException; import java.io.InputStream; import java.util.NoSuchElementException; public class Main { private static FastScanner sc = new FastScanner(); public static void main(String[] args) { long n = sc.nextInt(); long a = sc.nextInt(); long b = sc.nextInt(); if(n == 1) { if(a != b) ...
Main.java:23: error: ';' expected long ans = (b-a)*(n-2)+1 ^ 1 error
s060303319
p03705
C++
#include <iostream> #include <algorithm> #include <vector> #include <string> int main() { int64_t N, A, B; std::cin >> N >> A >> B; int64_t min = A + B + A * (N - 2); int64_t max = A + B + B * (N - 2); std::cout << std::max(0LL, max - min + 1) << std::endl; }
a.cc: In function 'int main()': a.cc:13:30: error: no matching function for call to 'max(long long int, int64_t)' 13 | std::cout << std::max(0LL, max - min + 1) << std::endl; | ~~~~~~~~^~~~~~~~~~~~~~~~~~~~ In file included from /usr/include/c++/14/string:51, from ...
s738081761
p03705
C++
#include <iostream> #include <vector> #include <algorithm> #include <map> #include <queue> #include <tuple> #include <cmath> using namespace std; typedef pair<int,int> P; typedef tuple<int,int,int> T; int main(){ int64_t N,A,B; cin>>N>>A>>B; int64_t lo = (N-1)*A+B; int64_t up = (N-1)*B+A; cout<<max...
a.cc: In function 'int main()': a.cc:17:14: error: no matching function for call to 'max(long long int, int64_t)' 17 | cout<<max(0LL,up-lo+1)<<endl; | ~~~^~~~~~~~~~~~~ In file included from /usr/include/c++/14/string:51, from /usr/include/c++/14/bits/locale_classes.h:40, ...
s117556539
p03705
C++
#include<map> #include<set> #include<list> #include<cmath> #include<queue> #include<stack> #include<cstdio> #include<string> #include<vector> #include<complex> #include<cstdlib> #include<cstring> #include<numeric> #include<sstream> #include<iostream> #include<algorithm> #include<functional> #define mp make_pair...
a.cc: In function 'int main()': a.cc:47:20: error: no matching function for call to 'max(int, long long int)' 47 | cout << max(0,ma - mi + 1) << endl; | ~~~^~~~~~~~~~~~~~~ In file included from /usr/include/c++/14/bits/stl_tree.h:63, from /usr/include/c++/14/map:62, ...
s733279195
p03705
C++
#include<bits/stdc++.h> using namespace std; int main(){ ios::sync_with_stdio(0); cin.tie(0); long long n, a, b; cin >> n >> a >> b; cout << (a + (n-1)*b) - (b + (n-1)*a)) + 1 << endl; }
a.cc: In function 'int main()': a.cc:9:46: error: expected ';' before ')' token 9 | cout << (a + (n-1)*b) - (b + (n-1)*a)) + 1 << endl; | ^ | ;
s609712801
p03706
C++
#include <bits/stdc++.h> using namespace std; #define int long long int main() { string S; cin >> S; int N = S.size(); int ans = (N-1)*(N-1); for(int i=0; i<N; i++){ if(i == 0 || i == N-1){ continue; } else if(S[i] == 'U'){ ans += i; } else{ ans += N-1-i; } } cout...
cc1plus: error: '::main' must return 'int'