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;i--)
#define FOR(i, m, n) for(ll i = m;i < n;i++)
#define FORR(i, m, n) for(ll i = m;i >= n;i--)
#define REPO(i, n) for(ll i = 1;i <= n;i++)
#define ll long long
#define INF 1999999999
#define MINF -1999999999
#define INF64 1999999999999999999
#define ALL(n) n.begin(),n.end()
#define MOD 1000000007
ll n, a, b, aa = 0, bb = 0;
int main(){
cin >> n >> a >> b;1 3 3
REP(i, n - 1) {
aa += a;
bb += b;
}aa += b;
bb += a;
cout << max(bb - aa + 1, 0ll) << endl;
}
| 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:17:32: note: in definition of macro 'REP'
17 | #define REP(i, n) for(ll i = 0;i < n;i++)
| ^
|
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{
cout << (a+(b*n))-(b+(a*n))+1 << endl;
}
} | 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) {
cnt++;
}
}
cout << --cnt;
return 0;
} | 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;
return 0;
} | 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 == B) {cout << 1;return 0;}
| ^~~~
a.cc:14:5: error: 'cout' was not declared in this scope
14 | cout << --cnt;
| ^~~~
|
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) {
cnt++;
}
}
cout << --cnt;
return 0; | 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 && start != end) {
System.out.println(0);
} else {
System.out.println((long )(start + end * (n - 1)) - (long)(end + start * (n - 1)) + 1);
}
}
//int max=Math.max(0,(start + end * (n - 1)) - (end + start * (n - 1)) + 1);
//System.out.println(max);
}
}
| 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-linux-gnu/c++/14/bits/stdc++.h:51,
from a.cc:1:
/usr/include/c++/14/bits/stl_algobase.h:257:5: note: candidate: 'template<class _Tp> constexpr const _Tp& std::max(const _Tp&, const _Tp&)'
257 | max(const _Tp& __a, const _Tp& __b)
| ^~~
/usr/include/c++/14/bits/stl_algobase.h:257:5: note: template argument deduction/substitution failed:
a.cc:7:16: note: deduced conflicting types for parameter 'const _Tp' ('int' and 'long long int')
7 | cout << max(0, (2 - n) * (a - b) + 1) << endl;
| ~~~^~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/include/c++/14/bits/stl_algobase.h:303:5: note: candidate: 'template<class _Tp, class _Compare> constexpr const _Tp& std::max(const _Tp&, const _Tp&, _Compare)'
303 | max(const _Tp& __a, const _Tp& __b, _Compare __comp)
| ^~~
/usr/include/c++/14/bits/stl_algobase.h:303:5: note: candidate expects 3 arguments, 2 provided
In file included from /usr/include/c++/14/algorithm:61:
/usr/include/c++/14/bits/stl_algo.h:5706:5: note: candidate: 'template<class _Tp> constexpr _Tp std::max(initializer_list<_Tp>)'
5706 | max(initializer_list<_Tp> __l)
| ^~~
/usr/include/c++/14/bits/stl_algo.h:5706:5: note: candidate expects 1 argument, 2 provided
/usr/include/c++/14/bits/stl_algo.h:5716:5: note: candidate: 'template<class _Tp, class _Compare> constexpr _Tp std::max(initializer_list<_Tp>, _Compare)'
5716 | max(initializer_list<_Tp> __l, _Compare __comp)
| ^~~
/usr/include/c++/14/bits/stl_algo.h:5716:5: note: template argument deduction/substitution failed:
a.cc:7:16: note: mismatched types 'std::initializer_list<_Tp>' and 'int'
7 | cout << max(0, (2 - n) * (a - b) + 1) << endl;
| ~~~^~~~~~~~~~~~~~~~~~~~~~~~~~
|
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; ///< Linked to standard input
| ^~~
a.cc:10:17: error: 'cout' was not declared in this scope; did you mean 'std::cout'?
10 | cout << M - m + 1 << endl;
| ^~~~
| std::cout
/usr/include/c++/14/iostream:63:18: note: 'std::cout' declared here
63 | extern ostream cout; ///< Linked to standard output
| ^~~~
a.cc:10:38: error: 'endl' was not declared in this scope; did you mean 'std::endl'?
10 | cout << M - m + 1 << endl;
| ^~~~
| std::endl
In file included from /usr/include/c++/14/iostream:41:
/usr/include/c++/14/ostream:744:5: note: 'std::endl' declared here
744 | endl(basic_ostream<_CharT, _Traits>& __os)
| ^~~~
a.cc:12:17: error: 'cout' was not declared in this scope; did you mean 'std::cout'?
12 | cout << 0 << endl;
| ^~~~
| std::cout
/usr/include/c++/14/iostream:63:18: note: 'std::cout' declared here
63 | extern ostream cout; ///< Linked to standard output
| ^~~~
a.cc:12:30: error: 'endl' was not declared in this scope; did you mean 'std::endl'?
12 | cout << 0 << endl;
| ^~~~
| std::endl
/usr/include/c++/14/ostream:744:5: note: 'std::endl' declared here
744 | endl(basic_ostream<_CharT, _Traits>& __os)
| ^~~~
|
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 )(B-A)*(N-2)+1);
}
return 0;
}
| 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] = { 0 };
int f[52] = { 0 };
for (i = 0; i < n; i++) {
scanf("%d", &a[i]);
f[i] = 1;
}
int out = 0;
for (i = n - 1; i >= 0; i--) {
while (f[i] == 0 && i>=0) i--;
if (i < 0) break;
int max = a[i];
f[i] = 0;
out++;
for (int j = i - 1; j >= 0; j--) {
if (a[j] >= max && f[j]) {
f[j] = 0;
max = a[j];
}
}
} | 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' was not declared in this scope
26 | scanf("%d", &a[i]);
| ^~~~~
a.cc:42:10: error: expected '}' at end of input
42 | }
| ^
a.cc:17:1: note: to match this '{'
17 | {
| ^
|
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) * b);
cout<<right - left + 1<<endl;
}
}
return 0;
} | 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 | long long right = a + long long ((n - 1) * b);
| ^~~~
|
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\n",(long long)(max - min) +1);
}
return 0;
}
| 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/x86_64-linux-gnu/c++/14/bits/stdc++.h:51,
from a.cc:1:
/usr/include/c++/14/bits/stl_algobase.h:257:5: note: candidate: 'template<class _Tp> constexpr const _Tp& std::max(const _Tp&, const _Tp&)'
257 | max(const _Tp& __a, const _Tp& __b)
| ^~~
/usr/include/c++/14/bits/stl_algobase.h:257:5: note: template argument deduction/substitution failed:
a.cc:6:14: note: deduced conflicting types for parameter 'const _Tp' ('long long int' and 'int')
6 | cout << max((b*(n-1)+a) - (a*(n-1)+b) + 1, 0) << endl;
| ~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/include/c++/14/bits/stl_algobase.h:303:5: note: candidate: 'template<class _Tp, class _Compare> constexpr const _Tp& std::max(const _Tp&, const _Tp&, _Compare)'
303 | max(const _Tp& __a, const _Tp& __b, _Compare __comp)
| ^~~
/usr/include/c++/14/bits/stl_algobase.h:303:5: note: candidate expects 3 arguments, 2 provided
In file included from /usr/include/c++/14/algorithm:61:
/usr/include/c++/14/bits/stl_algo.h:5706:5: note: candidate: 'template<class _Tp> constexpr _Tp std::max(initializer_list<_Tp>)'
5706 | max(initializer_list<_Tp> __l)
| ^~~
/usr/include/c++/14/bits/stl_algo.h:5706:5: note: candidate expects 1 argument, 2 provided
/usr/include/c++/14/bits/stl_algo.h:5716:5: note: candidate: 'template<class _Tp, class _Compare> constexpr _Tp std::max(initializer_list<_Tp>, _Compare)'
5716 | max(initializer_list<_Tp> __l, _Compare __comp)
| ^~~
/usr/include/c++/14/bits/stl_algo.h:5716:5: note: template argument deduction/substitution failed:
a.cc:6:14: note: mismatched types 'std::initializer_list<_Tp>' and 'long long int'
6 | cout << max((b*(n-1)+a) - (a*(n-1)+b) + 1, 0) << endl;
| ~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
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++.h:51,
from a.cc:1:
/usr/include/c++/14/bits/stl_algobase.h:257:5: note: candidate: 'template<class _Tp> constexpr const _Tp& std::max(const _Tp&, const _Tp&)'
257 | max(const _Tp& __a, const _Tp& __b)
| ^~~
/usr/include/c++/14/bits/stl_algobase.h:257:5: note: template argument deduction/substitution failed:
a.cc:8:16: note: deduced conflicting types for parameter 'const _Tp' ('int' and 'long long int')
8 | else ans =max(0,(N-2)*(B-A)+1) ;
| ~~~^~~~~~~~~~~~~~~~~
/usr/include/c++/14/bits/stl_algobase.h:303:5: note: candidate: 'template<class _Tp, class _Compare> constexpr const _Tp& std::max(const _Tp&, const _Tp&, _Compare)'
303 | max(const _Tp& __a, const _Tp& __b, _Compare __comp)
| ^~~
/usr/include/c++/14/bits/stl_algobase.h:303:5: note: candidate expects 3 arguments, 2 provided
In file included from /usr/include/c++/14/algorithm:61:
/usr/include/c++/14/bits/stl_algo.h:5706:5: note: candidate: 'template<class _Tp> constexpr _Tp std::max(initializer_list<_Tp>)'
5706 | max(initializer_list<_Tp> __l)
| ^~~
/usr/include/c++/14/bits/stl_algo.h:5706:5: note: candidate expects 1 argument, 2 provided
/usr/include/c++/14/bits/stl_algo.h:5716:5: note: candidate: 'template<class _Tp, class _Compare> constexpr _Tp std::max(initializer_list<_Tp>, _Compare)'
5716 | max(initializer_list<_Tp> __l, _Compare __comp)
| ^~~
/usr/include/c++/14/bits/stl_algo.h:5716:5: note: template argument deduction/substitution failed:
a.cc:8:16: note: mismatched types 'std::initializer_list<_Tp>' and 'int'
8 | else ans =max(0,(N-2)*(B-A)+1) ;
| ~~~^~~~~~~~~~~~~~~~~
|
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.c:6:37: note: each undeclared identifier is reported only once for each function it appears in
main.c:8:17: error: 'count' undeclared (first use in this function)
8 | count = 0;
| ^~~~~
|
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
5 | ax = A + B * (N - 1);
| ^
|
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,
from /usr/include/c++/14/bits/ios_base.h:41,
from /usr/include/c++/14/ios:44,
from /usr/include/c++/14/ostream:40,
from /usr/include/c++/14/iostream:41,
from a.cc:1:
/usr/include/c++/14/bits/stl_algobase.h:257:5: note: candidate: 'template<class _Tp> constexpr const _Tp& std::max(const _Tp&, const _Tp&)'
257 | max(const _Tp& __a, const _Tp& __b)
| ^~~
/usr/include/c++/14/bits/stl_algobase.h:257:5: note: template argument deduction/substitution failed:
a.cc:12:16: note: deduced conflicting types for parameter 'const _Tp' ('int' and 'long long int')
12 | cout << max(0,(b-a)*(n-2)+1) << endl;
| ~~~^~~~~~~~~~~~~~~~~
/usr/include/c++/14/bits/stl_algobase.h:303:5: note: candidate: 'template<class _Tp, class _Compare> constexpr const _Tp& std::max(const _Tp&, const _Tp&, _Compare)'
303 | max(const _Tp& __a, const _Tp& __b, _Compare __comp)
| ^~~
/usr/include/c++/14/bits/stl_algobase.h:303:5: note: candidate expects 3 arguments, 2 provided
In file included from /usr/include/c++/14/algorithm:61,
from a.cc:2:
/usr/include/c++/14/bits/stl_algo.h:5706:5: note: candidate: 'template<class _Tp> constexpr _Tp std::max(initializer_list<_Tp>)'
5706 | max(initializer_list<_Tp> __l)
| ^~~
/usr/include/c++/14/bits/stl_algo.h:5706:5: note: candidate expects 1 argument, 2 provided
/usr/include/c++/14/bits/stl_algo.h:5716:5: note: candidate: 'template<class _Tp, class _Compare> constexpr _Tp std::max(initializer_list<_Tp>, _Compare)'
5716 | max(initializer_list<_Tp> __l, _Compare __comp)
| ^~~
/usr/include/c++/14/bits/stl_algo.h:5716:5: note: template argument deduction/substitution failed:
a.cc:12:16: note: mismatched types 'std::initializer_list<_Tp>' and 'int'
12 | cout << max(0,(b-a)*(n-2)+1) << endl;
| ~~~^~~~~~~~~~~~~~~~~
|
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);
}
for (int i = 0; i < 100000; ++i)
{
int sum = allnum[0] + allnum[allnum.size() - 1];
for (int j = 0; j <count-2;j++ )
{
int randomnum = rand() % allnum.size();
sum += allnum[randomnum];
}
resultnum.insert(sum);
}
cout << resultnum.size();
return 0;
} | 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;
| ^~~~
| count
a.cc:10:30: error: 'endl' was not declared in this scope
10 | cout << 0 << endl;
| ^~~~
a.cc:16:17: error: 'cout' was not declared in this scope; did you mean 'count'?
16 | cout << 0 << endl;
| ^~~~
| count
a.cc:16:30: error: 'endl' was not declared in this scope
16 | cout << 0 << endl;
| ^~~~
a.cc:22:9: error: 'set' was not declared in this scope
22 | set<int> resultnum;
| ^~~
a.cc:22:13: error: expected primary-expression before 'int'
22 | set<int> resultnum;
| ^~~
a.cc:24:9: error: 'vector' was not declared in this scope
24 | vector<int> allnum;
| ^~~~~~
a.cc:24:16: error: expected primary-expression before 'int'
24 | vector<int> allnum;
| ^~~
a.cc:27:17: error: 'allnum' was not declared in this scope
27 | allnum.push_back(i);
| ^~~~~~
a.cc:34:27: error: 'allnum' was not declared in this scope
34 | int sum = allnum[0] + allnum[allnum.size() - 1];
| ^~~~~~
a.cc:37:41: error: 'rand' was not declared in this scope
37 | int randomnum = rand() % allnum.size();
| ^~~~
a.cc:40:17: error: 'resultnum' was not declared in this scope
40 | resultnum.insert(sum);
| ^~~~~~~~~
a.cc:44:9: error: 'cout' was not declared in this scope; did you mean 'count'?
44 | cout << resultnum.size();
| ^~~~
| count
a.cc:44:17: error: 'resultnum' was not declared in this scope
44 | cout << resultnum.size();
| ^~~~~~~~~
|
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
printf("%lld",((long long ))max - min + 1);
}
return 0;
}
| 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 disabled by default.
int min=(a * ( n - 1 ) + b );
^
(use --enable-preview to enable unnamed classes)
Main.java:9: error: class, interface, enum, or record expected
if(n == 1 && a == b)
^
Main.java:11: error: class, interface, enum, or record expected
else if(a > b || ( n == 1 && a != b ))
^
Main.java:13: error: class, interface, enum, or record expected
else
^
Main.java:17: error: class, interface, enum, or record expected
return 0;
^
Main.java:18: error: class, interface, enum, or record expected
}
^
9 errors
|
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,b;
cin>>n>>a>>b;
if(n==1)
{
if(a==b) cout<<1<<endl;
else cout<<0<<endl;
}
else if(n > 1)
{
if(a > b) cout<<1<<endl;
else cout<<(b-a)*(n-2)+1)<<endl;
}
else
{
cout<<0<<endl;
}
return 0;
} | 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 long int n,a,b;
cin>>n>>a>>b;
if(n==1)
{
if(a==b) cout<<1<<endl;
else cout<<0<<endl;
}
else if(n > 1)
{
if(a > b) cout<<1<endl;
else cout<<2+C(n-2,b-a+1)<<endl;
}
else
{
cout<<0<<endl;
}
return 0;
} | 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;
| ~~~~~~~^~~~~
In file included from /usr/include/c++/14/string:48,
from /usr/include/c++/14/bits/locale_classes.h:40,
from /usr/include/c++/14/bits/ios_base.h:41,
from /usr/include/c++/14/ios:44,
from /usr/include/c++/14/ostream:40,
from /usr/include/c++/14/iostream:41,
from a.cc:1:
/usr/include/c++/14/bits/stl_iterator.h:448:5: note: candidate: 'template<class _Iterator> constexpr bool std::operator<(const reverse_iterator<_Iterator>&, const reverse_iterator<_Iterator>&)'
448 | operator<(const reverse_iterator<_Iterator>& __x,
| ^~~~~~~~
/usr/include/c++/14/bits/stl_iterator.h:448:5: note: template argument deduction/substitution failed:
a.cc:30:27: note: 'std::basic_ostream<char>' is not derived from 'const std::reverse_iterator<_Iterator>'
30 | if(a > b) cout<<1<endl;
| ^~~~
/usr/include/c++/14/bits/stl_iterator.h:493:5: note: candidate: 'template<class _IteratorL, class _IteratorR> constexpr bool std::operator<(const reverse_iterator<_Iterator>&, const reverse_iterator<_IteratorR>&)'
493 | operator<(const reverse_iterator<_IteratorL>& __x,
| ^~~~~~~~
/usr/include/c++/14/bits/stl_iterator.h:493:5: note: template argument deduction/substitution failed:
a.cc:30:27: note: 'std::basic_ostream<char>' is not derived from 'const std::reverse_iterator<_Iterator>'
30 | if(a > b) cout<<1<endl;
| ^~~~
/usr/include/c++/14/bits/stl_iterator.h:1694:5: note: candidate: 'template<class _IteratorL, class _IteratorR> constexpr bool std::operator<(const move_iterator<_IteratorL>&, const move_iterator<_IteratorR>&)'
1694 | operator<(const move_iterator<_IteratorL>& __x,
| ^~~~~~~~
/usr/include/c++/14/bits/stl_iterator.h:1694:5: note: template argument deduction/substitution failed:
a.cc:30:27: note: 'std::basic_ostream<char>' is not derived from 'const std::move_iterator<_IteratorL>'
30 | if(a > b) cout<<1<endl;
| ^~~~
/usr/include/c++/14/bits/stl_iterator.h:1760:5: note: candidate: 'template<class _Iterator> constexpr bool std::operator<(const move_iterator<_IteratorL>&, const move_iterator<_IteratorL>&)'
1760 | operator<(const move_iterator<_Iterator>& __x,
| ^~~~~~~~
/usr/include/c++/14/bits/stl_iterator.h:1760:5: note: template argument deduction/substitution failed:
a.cc:30:27: note: 'std::basic_ostream<char>' is not derived from 'const std::move_iterator<_IteratorL>'
30 | if(a > b) cout<<1<endl;
| ^~~~
In file included from /usr/include/c++/14/bits/stl_algobase.h:64,
from /usr/include/c++/14/string:51:
/usr/include/c++/14/bits/stl_pair.h:1045:5: note: candidate: 'template<class _T1, class _T2> constexpr bool std::operator<(const pair<_T1, _T2>&, const pair<_T1, _T2>&)'
1045 | operator<(const pair<_T1, _T2>& __x, const pair<_T1, _T2>& __y)
| ^~~~~~~~
/usr/include/c++/14/bits/stl_pair.h:1045:5: note: template argument deduction/substitution failed:
a.cc:30:27: note: 'std::basic_ostream<char>' is not derived from 'const std::pair<_T1, _T2>'
30 | if(a > b) cout<<1<endl;
| ^~~~
In file included from /usr/include/c++/14/bits/basic_string.h:47,
from /usr/include/c++/14/string:54:
/usr/include/c++/14/string_view:673:5: note: candidate: 'template<class _CharT, class _Traits> constexpr bool std::operator<(basic_string_view<_CharT, _Traits>, basic_string_view<_CharT, _Traits>)'
673 | operator< (basic_string_view<_CharT, _Traits> __x,
| ^~~~~~~~
/usr/include/c++/14/string_view:673:5: note: template argument deduction/substitution failed:
a.cc:30:27: note: 'std::basic_ostream<char>' is not derived from 'std::basic_string_view<_CharT, _Traits>'
30 | if(a > b) cout<<1<endl;
| ^~~~
/usr/include/c++/14/string_view:680:5: note: candidate: 'template<class _CharT, class _Traits> constexpr bool std::operator<(basic_string_view<_CharT, _Traits>, __type_identity_t<basic_string_view<_CharT, _Traits> >)'
680 | operator< (basic_string_view<_CharT, _Traits> __x,
| ^~~~~~~~
/usr/include/c++/14/string_view:680:5: note: template argument deduction/substitution failed:
a.cc:30:27: note: 'std::basic_ostream<char>' is not derived from 'std::basic_string_view<_CharT, _Traits>'
30 | if(a > b) cout<<1<endl;
| ^~~~
/usr/include/c++/14/string_view:688:5: note: candidate: 'template<class _CharT, class _Traits> constexpr bool std::operator<(__type_identity_t<basic_string_view<_CharT, _Traits> >, basic_string_view<_CharT, _Traits>)'
688 | operator< (__type_identity_t<basic_string_view<_CharT, _Traits>> __x,
| ^~~~~~~~
/usr/include/c++/14/string_view:688:5: note: template argument deduction/substitution failed:
a.cc:30:27: note: couldn't deduce template parameter '_CharT'
30 | if(a > b) cout<<1<endl;
| ^~~~
/usr/include/c++/14/bits/basic_string.h:3874:5: note: candidate: 'template<class _CharT, class _Traits, class _Alloc> bool std::operator<(const __cxx11::basic_string<_CharT, _Traits, _Allocator>&, const __cxx11::basic_string<_CharT, _Traits, _Allocator>&)'
3874 | operator<(const basic_string<_CharT, _Traits, _Alloc>& __lhs,
| ^~~~~~~~
/usr/include/c++/14/bits/basic_string.h:3874:5: note: template argument deduction/substitution failed:
a.cc:30:27: note: 'std::basic_ostream<char>' is not derived from 'const std::__cxx11::basic_string<_CharT, _Traits, _Allocator>'
30 | if(a > b) cout<<1<endl;
| ^~~~
/usr/include/c++/14/bits/basic_string.h:3888:5: note: candidate: 'template<class _CharT, class _Traits, class _Alloc> bool std::operator<(const __cxx11::basic_string<_CharT, _Traits, _Allocator>&, const _CharT*)'
3888 | operator<(const basic_string<_CharT, _Traits, _Alloc>& __lhs,
| ^~~~~~~~
/usr/include/c++/14/bits/basic_string.h:3888:5: note: template argument deduction/substitution failed:
a.cc:30:27: note: 'std::basic_ostream<char>' is not derived from 'const std::__cxx11::basic_string<_CharT, _Traits, _Allocator>'
30 | if(a > b) cout<<1<endl;
| ^~~~
/usr/include/c++/14/bits/basic_string.h:3901:5: note: candidate: 'template<class _CharT, class _Traits, class _Alloc> bool std::operator<(const _CharT*, const __cxx11::basic_string<_CharT, _Traits, _Allocator>&)'
3901 | operator<(const _CharT* __lhs,
| ^~~~~~~~
/usr/include/c++/14/bits/basic_string.h:3901:5: note: template argument deduction/substitution failed:
a.cc:30:27: note: mismatched types 'const _CharT*' and 'std::basic_ostream<char>'
30 | if(a > b) cout<<1<endl;
| ^~~~
In file included from /usr/include/c++/14/bits/memory_resource.h:47,
from /usr/include/c++/14/string:68:
/usr/include/c++/14/tuple:2600:5: note: candidate: 'template<class ... _TElements, class ... _UElements> constexpr bool std::operator<(const tuple<_UTypes ...>&, const tuple<_Elements ...>&)'
2600 | operator<(const tuple<_TElements...>& __t,
| ^~~~~~~~
/usr/include/c++/14/tuple:2600:5: note: template argument deduction/substitution failed:
a.cc:30:27: note: 'std::basic_ostream<char>' is not derived from 'const std::tuple<_UTypes ...>'
30 | if(a > b) cout<<1<endl;
| ^~~~
In file included from /usr/include/c++/14/bits/ios_base.h:46:
/usr/include/c++/14/system_error:324:3: note: candidate: 'bool std::operator<(const error_code&, const error_code&)'
324 | operator<(const error_code& __lhs, const error_code& __rhs) noexcept
| ^~~~~~~~
/usr/include/c++/14/system_error:324:31: note: no known conversion for argument 1 from 'std::basic_ostream<char>' to 'const std::error_code&'
324 | operator<(const error_code& __lhs, const error_code& __rhs) noexcept
| ~~~~~~~~~~~~~~~~~~^~~~~
/usr/include/c++/14/system_error:507:3: note: candidate: 'bool std::operator<(const error_condition&, const error_condition&)'
507 | operator<(const error_condition& __lhs,
| ^~~~~~~~
/usr/include/c++/14/system_error:507:36: note: no known conversion for argument 1 from 'std::basic_ostream<char>' to 'const std::error_condition&'
507 | operator<(const error_condition& __lhs,
| ~~~~~~~~~~~~~~~~~~~~~~~^~~~~
|
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);
}
return 0;
} | 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 d[1000];
int len;
big(){
memset(d, 0, sizeof(d));
len = 0;
}
};
bign change(char str[]){
bign a;
a.len = strlen(str);
for(int i = 0; i < a.len; i++){
a.d[i] = str[a.len - i - 1] - '0';
}
return a;
}
bign add(bign a, bign b){
bign c;
int carry = 0;
for (int i = 0; i < a.len || i < b.len; i++){
int temp = a.d[i] + b.d[i] + carry;
c.d[c.len++] = temp % 10;
carry = temp / 10;
}
if(carry != 0){
c.d[c.len++] = carry;
}
return c;
}
bign sub(bign a, bign b){
bign c;
for(int i = 0; i < a.len || i < b.len; i++){
if(a.d[i] < b.d[i]){
a.d[i +1 ] --;
a.d[i] += 10;
}
c.d[c.len++] = a.d[i] - b.d[i];
}
while(c.len - 1 >= 1 && c.d[c.len - 1] == 0){
c.len--;
}
return c;
}
int main(){
long long N, A, B;
long long num;
scanf("%I64d %I64d %I64d", &N, &A, &B);
if(B < A) {
num = 0;
printf("%d", num);
return 0;
}
if(N == 1 && A != B){
num = 0;
printf("%d", num);
return 0;
}
//大整数乘法和加法,用python比较快吗?手头没有系统的资料
num = (B - A)*(N-2)+1;
printf("%I64d", num);
} | 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);
if(B < A) {
num = 0;
printf("%d", num);
return 0;
}
if(N == 1 && A != B){
num = 0;
printf("%d", num);
return 0;
}
//大整数乘法和加法,用python比较快吗?手头没有系统的资料
num = (B - A)*(N-2)+1;
printf("%I64d", num);
} | 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)
{
int remain = n - 2;
int sum = (n - 1) * b + a - (n - 1) * a - b + 1;
cout << sum;
}
return 0;
} | 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 declared in this scope
10 | cin >> n >> a >> b;
| ^
a.cc:10:22: error: 'b' was not declared in this scope
10 | cin >> n >> a >> b;
| ^
|
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 long int n,a,b;
cin>>n>>a>>b;
if(n == 1 && a == b) cout<<1<<endl;
else if(n <= 1 || b < a || a<=0 || b <=0 ) cout<<0<<endl;
else if( a == b) cout<<1<<endl;
else if( n == 2) cout<<1<<endl;
else cout<<2+C(n-2,b-a+1)<<endl;
return 0;
} | 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++)
{
numbers[j]=i;
ans(a,b,n-1);
}
}
}
int main()
{
int n,a,b,sum=0;
scanf("%d%d%d",&n,&a,&b);
length=n-2;
ans(a,b,length);
sort(sums,sums+100);
int j=unique(sums,sums+100)-sums;
if(j>0)
printf("%d\n",j-1);
else
printf("0\n");
} | /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: error: ld returned 1 exit status
|
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 ; }
int count = amount - 2;
cout << count * max - count * min+1;
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' [-fpermissive]
11 | if (amount == 1 && (max != min)) { cout << 0; return ; }
| ^~~~~~
a.cc:12:58: error: return-statement with no value, in function returning 'int' [-fpermissive]
12 | else if (amount == 1 && max == min) { cout << 1; return ; }
| ^~~~~~
a.cc:13:38: error: return-statement with no value, in function returning 'int' [-fpermissive]
13 | if (amount < 1) { cout << 0; return ; }
| ^~~~~~
a.cc:18:9: error: return-statement with no value, in function returning 'int' [-fpermissive]
18 | return ;
| ^~~~~~
|
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>>n>>a>>b;
cout<<2+C(n-2,b-a+1)<<endl;
return 0;
} | 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 <= 0 || b < a) return 0;
| ^
a.cc:21:22: error: 'a' was not declared in this scope
21 | if(n <= 0 || b < a) return 0;
| ^
|
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;i++)scanf("%d",&a[i]);
return a;
}
void dumpints(vector<int> a){
cout<<"[";
for(int i=0;i<a.size()-1;i++){
cout<<a[i]<<",";
}
cout<<a[a.size()-1]<<"]"<<endl;
}
template<class T> bool ifinclude(vector<T> a,T x){
auto itr=find(a.begin(),a.end(),x);
return distance(a.begin(),itr)!=a.size();
}
int main(void){
int N=getint();
int A=getint();
int B=getint();
if(A>B){
cout<<0<<endl;
}elif(A<B){
if(N==1){
cout<<0<<endl;
}else{
cout<<(B-A)*(N-2)+1<<endl;
}
}else{
cout<<1<<endl;
}
return 0;
}
| 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;
| ^
a.cc:5:16: error: 'B' was not declared in this scope
5 | cin>>N>>A>>B;
| ^
a.cc:6:7: error: expected ';' before 'ans'
6 | ll ans=1+(N-2)*(B-A);
| ^~~~
| ;
a.cc:7:8: error: 'ans' was not declared in this scope; did you mean 'abs'?
7 | if(ans<0){
| ^~~
| abs
|
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;
for(ll i = m; i > 0; i--){
multi *= i;
}
return multi;
}
int main(){
ll n, a, b, c; cin >> n >> a >> b;
ll ans = 0;
if(a > b || (a == b && n != 1)) ans = 0;
else if(a == b) ans = 1;
else if(n == 2) ans = 1;
else {
ans = f(b-a+1)/(f(n-2)*f(b-a-n+4);
}
cout << ans << endl;
} | 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;
for(ll i = m; i > 0; i--){
multi *= i;
}
}
int main(){
ll n, a, b, c; cin >> n >> a >> b;
ll ans = 0;
if(a > b || (a == b && n != 1)) ans = 0;
else if(a == b) ans = 1;
else if(n == 2) ans = 1;
else {
ans = f(b-a+1)/(f(n-2)*f(b-a-n+4);
}
cout << ans << endl;
} | 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 | long long fact(x, n){
| ^
a.cc: In function 'int main()':
a.cc:16:15: error: 'fact' cannot be used as a function
16 | res = fact(n + 3, n) / fact(b - a);
| ~~~~^~~~~~~~~~
a.cc:16:32: error: 'fact' cannot be used as a function
16 | res = fact(n + 3, n) / fact(b - a);
| ~~~~^~~~~~~
|
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 = 1000006;
const int lg5 = 17;
const int INF = 2 * 1000000007;
const long long INFLL = 4LL * 1000000000 * 1000000000;
/***************/
int powmod (int a, int b, int mod) {
int res = 1; a %= mod;
for (; b; b >>= 1) {
if (b & 1) {
res = 1LL * res * a % mod;
}
a = 1LL * a * a % mod;
}
return res;
}
#define ll long long
ll gcd (ll a, ll b) {
while (b > 0) {
ll t = a % b;
a = b, b = t;
}
return a;
}
int lcm (int a, int b) {
return (a / gcd (a, b)) * b;
}
int is_prime (int n) {
if (n <= 1 || n > 3 && (n % 2 == 0 || n % 3 == 0))
return 0;
for (int i = 5, t = 2; i * i <= n; i += t, t = 6 - t)
if (n % i == 0)
return 0;
return 1;
}
/******Don't forget to use long long when needed!!******/
int main() {
//freopen("in.txt","r",stdin);
//freopen("out.txt","w",stdout);
ios_base :: sync_with_stdio(0);
cin.tie(0), cout.tie(0);
int n, a, b;
cin >> n >> a >> b;
long long x = 1LL * (n - 1) * a + b;
long long y = 1LL * (n - 1) * b + a;
cout << max(0LL, b - a + 1) << endl;
return 0;
}
| 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/stdc++.h:51,
from a.cc:2:
/usr/include/c++/14/bits/stl_algobase.h:257:5: note: candidate: 'template<class _Tp> constexpr const _Tp& std::max(const _Tp&, const _Tp&)'
257 | max(const _Tp& __a, const _Tp& __b)
| ^~~
/usr/include/c++/14/bits/stl_algobase.h:257:5: note: template argument deduction/substitution failed:
a.cc:69:16: note: deduced conflicting types for parameter 'const _Tp' ('long long int' and 'int')
69 | cout << max(0LL, b - a + 1) << endl;
| ~~~^~~~~~~~~~~~~~~~
/usr/include/c++/14/bits/stl_algobase.h:303:5: note: candidate: 'template<class _Tp, class _Compare> constexpr const _Tp& std::max(const _Tp&, const _Tp&, _Compare)'
303 | max(const _Tp& __a, const _Tp& __b, _Compare __comp)
| ^~~
/usr/include/c++/14/bits/stl_algobase.h:303:5: note: candidate expects 3 arguments, 2 provided
In file included from /usr/include/c++/14/algorithm:61:
/usr/include/c++/14/bits/stl_algo.h:5706:5: note: candidate: 'template<class _Tp> constexpr _Tp std::max(initializer_list<_Tp>)'
5706 | max(initializer_list<_Tp> __l)
| ^~~
/usr/include/c++/14/bits/stl_algo.h:5706:5: note: candidate expects 1 argument, 2 provided
/usr/include/c++/14/bits/stl_algo.h:5716:5: note: candidate: 'template<class _Tp, class _Compare> constexpr _Tp std::max(initializer_list<_Tp>, _Compare)'
5716 | max(initializer_list<_Tp> __l, _Compare __comp)
| ^~~
/usr/include/c++/14/bits/stl_algo.h:5716:5: note: template argument deduction/substitution failed:
a.cc:69:16: note: mismatched types 'std::initializer_list<_Tp>' and 'long long int'
69 | cout << max(0LL, b - a + 1) << endl;
| ~~~^~~~~~~~~~~~~~~~
|
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.cc:9:9: error: 'cout' was not declared in this scope
9 | cout<<(n*b)-(n*a)+1<<endl;
| ^~~~
a.cc:9:9: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
a.cc:9:30: error: 'endl' was not declared in this scope
9 | cout<<(n*b)-(n*a)+1<<endl;
| ^~~~
a.cc:2:1: note: 'std::endl' is defined in header '<ostream>'; this is probably fixable by adding '#include <ostream>'
1 | #include<cstdio>
+++ |+#include <ostream>
2 |
|
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;
import java.util.Stack;
import java.util.TreeMap;
import java.util.TreeSet;
public class Main implements Runnable
{
static final long MAX = 464897L;
static class InputReader
{
private InputStream stream;
private byte[] buf = new byte[1024];
private int curChar;
private int numChars;
private SpaceCharFilter filter;
private BufferedReader br=new BufferedReader(new InputStreamReader(System.in));
public InputReader(InputStream stream)
{
this.stream = stream;
}
public int read()
{
if (numChars==-1)
throw new InputMismatchException();
if (curChar >= numChars)
{
curChar = 0;
try
{
numChars = stream.read(buf);
}
catch (IOException e)
{
throw new InputMismatchException();
}
if(numChars <= 0)
return -1;
}
return buf[curChar++];
}
public String nextLine()
{
String str = "";
try
{
str = br.readLine();
}
catch (IOException e)
{
e.printStackTrace();
}
return str;
}
public int nextInt()
{
int c = read();
while(isSpaceChar(c))
c = read();
int sgn = 1;
if (c == '-')
{
sgn = -1;
c = read();
}
int res = 0;
do
{
if(c<'0'||c>'9')
throw new InputMismatchException();
res *= 10;
res += c - '0';
c = read();
}
while (!isSpaceChar(c));
return res * sgn;
}
public long nextLong()
{
int c = read();
while (isSpaceChar(c))
c = read();
int sgn = 1;
if (c == '-')
{
sgn = -1;
c = read();
}
long res = 0;
do
{
if (c < '0' || c > '9')
throw new InputMismatchException();
res *= 10;
res += c - '0';
c = read();
}
while (!isSpaceChar(c));
return res * sgn;
}
public double nextDouble()
{
int c = read();
while (isSpaceChar(c))
c = read();
int sgn = 1;
if (c == '-')
{
sgn = -1;
c = read();
}
double res = 0;
while (!isSpaceChar(c) && c != '.')
{
if (c == 'e' || c == 'E')
return res * Math.pow(10, nextInt());
if (c < '0' || c > '9')
throw new InputMismatchException();
res *= 10;
res += c - '0';
c = read();
}
if (c == '.')
{
c = read();
double m = 1;
while (!isSpaceChar(c))
{
if (c == 'e' || c == 'E')
return res * Math.pow(10, nextInt());
if (c < '0' || c > '9')
throw new InputMismatchException();
m /= 10;
res += (c - '0') * m;
c = read();
}
}
return res * sgn;
}
public String readString()
{
int c = read();
while (isSpaceChar(c))
c = read();
StringBuilder res = new StringBuilder();
do
{
res.appendCodePoint(c);
c = read();
}
while (!isSpaceChar(c));
return res.toString();
}
public boolean isSpaceChar(int c)
{
if (filter != null)
return filter.isSpaceChar(c);
return c == ' ' || c == '\n' || c == '\r' || c == '\t' || c == -1;
}
public String next()
{
return readString();
}
public interface SpaceCharFilter
{
public boolean isSpaceChar(int ch);
}
}
public static void main(String args[]) throws Exception
{
new Thread(null, new Solution(),"Solution",1<<26).start();
}
static long gcd(long a, long b)
{
if (b == 0)
return a;
return gcd(b, a % b);
}
static long lcm(long a,long b) {
return (a/gcd(a,b) * b);
}
long MOD = 1000000007;
ArrayList<Integer> adj[];
long[] arr;
long[] cost;
public void run()
{
InputReader sc = new InputReader(System.in);
PrintWriter w = new PrintWriter(System.out);
long a = sc.nextLong();
long b = sc.nextLong();
int ind = -1;
for(int i = 61;i >= 0;i--) {
if(((a >> i) & 1) != ((b >> i) & 1)) {
ind = i;
break;
}
}
if(ind == -1) {
w.println("1");
}else {
long r = power(2,ind,1000000000000000000L);
long temp = r * 2 - 1;
a = a & temp;
b = b & temp;
int rem = -1;
for(int i = 0;i < ind;i++) {
if(((b >> i) & 1) == 1) {
rem = i;
}
}
int rem2 = -1;
for(int i = 0;i < ind;i++) {
if(((a >> i) & 1) == 1) {
rem2 = i;
}
}
if(rem2 <= rem) {
w.println(2*r-a);
}else {
temp = power(2,rem+1,1000000000000000000L) - 1;
w.println(temp + 2*(r-a) + 1);
}
}
w.close();
}
ArrayList<ArrayList<Integer>> common;
ArrayList<Integer> ar;
boolean[] visited;
Stack<Integer> st;
void dfs(int a){
visited[a] = true;
Iterator<Integer> it= adj[a].iterator();
while(it.hasNext()){
int n = it.next();
if(!visited[n]){
dfs(n);
}
}
st.add(a);
}
static long power(long a,long b,long mod) {
long ans = 1;
a = a % mod;
while(b != 0) {
if(b % 2 == 1) {
ans = (ans * a) % mod;
}
a = (a * a) % mod;
b = b/2;
}
return ans;
}
class Pair implements Comparable<Pair>{
int a;
int b;
int c;
int d;
//int c;
Pair(int a,int b,int c,int d){
this.b = b;
this.a = a;
this.c = c;
this.d = d;
}
public boolean equals(Object o) {
Pair p = (Pair)o;
return this.a == p.a && this.b == this.b;
}
public int hashCode(){
return Long.hashCode(a)*27 + Long.hashCode(b)*31;
}
public int compareTo(Pair p) {
return Long.compare(this.c,p.c);
}
}
}
| 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/bits/locale_classes.h:40,
from /usr/include/c++/14/bits/ios_base.h:41,
from /usr/include/c++/14/ios:44,
from /usr/include/c++/14/ostream:40,
from /usr/include/c++/14/iostream:41,
from a.cc:1:
/usr/include/c++/14/bits/stl_algobase.h:257:5: note: candidate: 'template<class _Tp> constexpr const _Tp& std::max(const _Tp&, const _Tp&)'
257 | max(const _Tp& __a, const _Tp& __b)
| ^~~
/usr/include/c++/14/bits/stl_algobase.h:257:5: note: template argument deduction/substitution failed:
a.cc:10:20: note: deduced conflicting types for parameter 'const _Tp' ('long long int' and 'int')
10 | cout << max(ans,0);
| ~~~^~~~~~~
/usr/include/c++/14/bits/stl_algobase.h:303:5: note: candidate: 'template<class _Tp, class _Compare> constexpr const _Tp& std::max(const _Tp&, const _Tp&, _Compare)'
303 | max(const _Tp& __a, const _Tp& __b, _Compare __comp)
| ^~~
/usr/include/c++/14/bits/stl_algobase.h:303:5: note: candidate expects 3 arguments, 2 provided
|
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,
from a.cc:1:
/usr/include/c++/14/bits/stl_algobase.h:257:5: note: candidate: 'template<class _Tp> constexpr const _Tp& std::max(const _Tp&, const _Tp&)'
257 | max(const _Tp& __a, const _Tp& __b)
| ^~~
/usr/include/c++/14/bits/stl_algobase.h:257:5: note: template argument deduction/substitution failed:
a.cc:10:14: note: deduced conflicting types for parameter 'const _Tp' ('long long int' and 'int')
10 | cout << max(M-m+1,0) << endl;
| ~~~^~~~~~~~~
/usr/include/c++/14/bits/stl_algobase.h:303:5: note: candidate: 'template<class _Tp, class _Compare> constexpr const _Tp& std::max(const _Tp&, const _Tp&, _Compare)'
303 | max(const _Tp& __a, const _Tp& __b, _Compare __comp)
| ^~~
/usr/include/c++/14/bits/stl_algobase.h:303:5: note: candidate expects 3 arguments, 2 provided
In file included from /usr/include/c++/14/algorithm:61:
/usr/include/c++/14/bits/stl_algo.h:5706:5: note: candidate: 'template<class _Tp> constexpr _Tp std::max(initializer_list<_Tp>)'
5706 | max(initializer_list<_Tp> __l)
| ^~~
/usr/include/c++/14/bits/stl_algo.h:5706:5: note: candidate expects 1 argument, 2 provided
/usr/include/c++/14/bits/stl_algo.h:5716:5: note: candidate: 'template<class _Tp, class _Compare> constexpr _Tp std::max(initializer_list<_Tp>, _Compare)'
5716 | max(initializer_list<_Tp> __l, _Compare __comp)
| ^~~
/usr/include/c++/14/bits/stl_algo.h:5716:5: note: template argument deduction/substitution failed:
a.cc:10:14: note: mismatched types 'std::initializer_list<_Tp>' and 'long long int'
10 | cout << max(M-m+1,0) << endl;
| ~~~^~~~~~~~~
|
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]++;
}
for(int i = 1 ; i<=100 ; ++i)
for(int j = 1 ; j<=100 ; ++j)
for(int a = 0 ; a<=m ; ++a)
{
arr[i][j][a] += arr[i-1][j][a] + arr[i][j-1][a];
arr[i][j][a] -= arr[i-1][j-1][a];
}*/
int a,b,c;cin>>a>>b>>c;
if(b>c||a==0||a==1&&b!=c){cout<<0;}else{
if(a==1){cout<<1;}else{
cout<<(c-b)*(b-2):
}
}
}
/*
2
2
2 3
2
2 4
*/
| 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 == 1) {
cout << 1 << endl;
} else if (a != b && n == 1) {
cout << 0 << endl;
} else {
cout << (b - a)(n - 2) + 1 << endl;
}
return 0;
}
| 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,
from a.cc:1:
/usr/include/c++/14/bits/stl_algobase.h:257:5: note: candidate: 'template<class _Tp> constexpr const _Tp& std::max(const _Tp&, const _Tp&)'
257 | max(const _Tp& __a, const _Tp& __b)
| ^~~
/usr/include/c++/14/bits/stl_algobase.h:257:5: note: template argument deduction/substitution failed:
a.cc:10:16: note: deduced conflicting types for parameter 'const _Tp' ('long long int' and 'int')
10 | cout << max(ans, 0) << endl;
| ~~~^~~~~~~~
/usr/include/c++/14/bits/stl_algobase.h:303:5: note: candidate: 'template<class _Tp, class _Compare> constexpr const _Tp& std::max(const _Tp&, const _Tp&, _Compare)'
303 | max(const _Tp& __a, const _Tp& __b, _Compare __comp)
| ^~~
/usr/include/c++/14/bits/stl_algobase.h:303:5: note: candidate expects 3 arguments, 2 provided
In file included from /usr/include/c++/14/algorithm:61:
/usr/include/c++/14/bits/stl_algo.h:5706:5: note: candidate: 'template<class _Tp> constexpr _Tp std::max(initializer_list<_Tp>)'
5706 | max(initializer_list<_Tp> __l)
| ^~~
/usr/include/c++/14/bits/stl_algo.h:5706:5: note: candidate expects 1 argument, 2 provided
/usr/include/c++/14/bits/stl_algo.h:5716:5: note: candidate: 'template<class _Tp, class _Compare> constexpr _Tp std::max(initializer_list<_Tp>, _Compare)'
5716 | max(initializer_list<_Tp> __l, _Compare __comp)
| ^~~
/usr/include/c++/14/bits/stl_algo.h:5716:5: note: template argument deduction/substitution failed:
a.cc:10:16: note: mismatched types 'std::initializer_list<_Tp>' and 'long long int'
10 | cout << max(ans, 0) << endl;
| ~~~^~~~~~~~
|
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: expected constructor, destructor, or type conversion before '(' token
16 | printf("%ld\n",ans);
| ^
a.cc:17:1: error: expected unqualified-id before 'return'
17 | return 0;
| ^~~~~~
a.cc:18:1: error: expected declaration before '}' token
18 | }
| ^
|
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 included from /usr/include/c++/14/sstream:40,
from /usr/include/c++/14/complex:45,
from /usr/include/c++/14/ccomplex:39,
from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:127,
from a.cc:1:
/usr/include/c++/14/istream:170:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(bool&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]' (near match)
170 | operator>>(bool& __n)
| ^~~~~~~~
/usr/include/c++/14/istream:170:7: note: conversion of argument 1 would be ill-formed:
a.cc:10:10: error: cannot bind non-const lvalue reference of type 'bool&' to a value of type '__int128'
10 | cin>>n>>a>>b;
| ^
/usr/include/c++/14/istream:174:7: note: candidate: 'std::basic_istream<_CharT, _Traits>& std::basic_istream<_CharT, _Traits>::operator>>(short int&) [with _CharT = char; _Traits = std::char_traits<char>]' (near match)
174 | operator>>(short& __n);
| ^~~~~~~~
/usr/include/c++/14/istream:174:7: note: conversion of argument 1 would be ill-formed:
a.cc:10:10: error: cannot bind non-const lvalue reference of type 'short int&' to a value of type '__int128'
10 | cin>>n>>a>>b;
| ^
/usr/include/c++/14/istream:177:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(short unsigned int&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]' (near match)
177 | operator>>(unsigned short& __n)
| ^~~~~~~~
/usr/include/c++/14/istream:177:7: note: conversion of argument 1 would be ill-formed:
a.cc:10:10: error: cannot bind non-const lvalue reference of type 'short unsigned int&' to a value of type '__int128'
10 | cin>>n>>a>>b;
| ^
/usr/include/c++/14/istream:181:7: note: candidate: 'std::basic_istream<_CharT, _Traits>& std::basic_istream<_CharT, _Traits>::operator>>(int&) [with _CharT = char; _Traits = std::char_traits<char>]' (near match)
181 | operator>>(int& __n);
| ^~~~~~~~
/usr/include/c++/14/istream:181:7: note: conversion of argument 1 would be ill-formed:
a.cc:10:10: error: cannot bind non-const lvalue reference of type 'int&' to a value of type '__int128'
10 | cin>>n>>a>>b;
| ^
/usr/include/c++/14/istream:184:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(unsigned int&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]' (near match)
184 | operator>>(unsigned int& __n)
| ^~~~~~~~
/usr/include/c++/14/istream:184:7: note: conversion of argument 1 would be ill-formed:
a.cc:10:10: error: cannot bind non-const lvalue reference of type 'unsigned int&' to a value of type '__int128'
10 | cin>>n>>a>>b;
| ^
/usr/include/c++/14/istream:188:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(long int&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]' (near match)
188 | operator>>(long& __n)
| ^~~~~~~~
/usr/include/c++/14/istream:188:7: note: conversion of argument 1 would be ill-formed:
a.cc:10:10: error: cannot bind non-const lvalue reference of type 'long int&' to a value of type '__int128'
10 | cin>>n>>a>>b;
| ^
/usr/include/c++/14/istream:192:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(long unsigned int&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]' (near match)
192 | operator>>(unsigned long& __n)
| ^~~~~~~~
/usr/include/c++/14/istream:192:7: note: conversion of argument 1 would be ill-formed:
a.cc:10:10: error: cannot bind non-const lvalue reference of type 'long unsigned int&' to a value of type '__int128'
10 | cin>>n>>a>>b;
| ^
/usr/include/c++/14/istream:199:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(long long int&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]' (near match)
199 | operator>>(long long& __n)
| ^~~~~~~~
/usr/include/c++/14/istream:199:7: note: conversion of argument 1 would be ill-formed:
a.cc:10:10: error: cannot bind non-const lvalue reference of type 'long long int&' to a value of type '__int128'
10 | cin>>n>>a>>b;
| ^
/usr/include/c++/14/istream:203:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(long long unsigned int&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]' (near match)
203 | operator>>(unsigned long long& __n)
| ^~~~~~~~
/usr/include/c++/14/istream:203:7: note: conversion of argument 1 would be ill-formed:
a.cc:10:10: error: cannot bind non-const lvalue reference of type 'long long unsigned int&' to a value of type '__int128'
10 | cin>>n>>a>>b;
| ^
/usr/include/c++/14/istream:219:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(float&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]' (near match)
219 | operator>>(float& __f)
| ^~~~~~~~
/usr/include/c++/14/istream:219:7: note: conversion of argument 1 would be ill-formed:
a.cc:10:10: error: cannot bind non-const lvalue reference of type 'float&' to a value of type '__int128'
10 | cin>>n>>a>>b;
| ^
/usr/include/c++/14/istream:223:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(double&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]' (near match)
223 | operator>>(double& __f)
| ^~~~~~~~
/usr/include/c++/14/istream:223:7: note: conversion of argument 1 would be ill-formed:
a.cc:10:10: error: cannot bind non-const lvalue reference of type 'double&' to a value of type '__int128'
10 | cin>>n>>a>>b;
| ^
/usr/include/c++/14/istream:227:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(long double&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]' (near match)
227 | operator>>(long double& __f)
| ^~~~~~~~
/usr/include/c++/14/istream:227:7: note: conversion of argument 1 would be ill-formed:
a.cc:10:10: error: cannot bind non-const lvalue reference of type 'long double&' to a value of type '__int128'
10 | cin>>n>>a>>b;
| ^
/usr/include/c++/14/istream:328:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(void*&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]' (near match)
328 | operator>>(void*& __p)
| ^~~~~~~~
/usr/include/c++/14/istream:328:7: note: conversion of argument 1 would be ill-formed:
a.cc:10:10: error: invalid conversion from '__int128' to 'void*' [-fpermissive]
10 | cin>>n>>a>>b;
| ^
| |
| __int128
a.cc:10:10: error: cannot bind rvalue '(void*)((long int)n)' to 'void*&'
/usr/include/c++/14/istream:122:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(__istream_type& (*)(__istream_type&)) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]' (near match)
122 | operator>>(__istream_type& (*__pf)(__istream_type&))
| ^~~~~~~~
/usr/include/c++/14/istream:122:7: note: conversion of argument 1 would be ill-formed:
a.cc:10:10: error: invalid conversion from '__int128' to 'std::basic_istream<char>::__istream_type& (*)(std::basic_istream<char>::__istream_type&)' {aka 'std::basic_istream<char>& (*)(std::basic_istream<char>&)'} [-fpermissive]
10 | cin>>n>>a>>b;
| ^
| |
| __int128
/usr/include/c++/14/istream:126:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(__ios_type& (*)(__ios_type&)) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>; __ios_type = std::basic_ios<char>]' (near match)
126 | operator>>(__ios_type& (*__pf)(__ios_type&))
| ^~~~~~~~
/usr/include/c++/14/istream:126:7: note: conversion of argument 1 would be ill-formed:
a.cc:10:10: error: invalid conversion from '__int128' to 'std::basic_istream<char>::__ios_type& (*)(std::basic_istream<char>::__ios_type&)' {aka 'std::basic_ios<char>& (*)(std::basic_ios<char>&)'} [-fpermissive]
10 | cin>>n>>a>>b;
| ^
| |
| __int128
/usr/include/c++/14/istream:133:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(std::ios_base& (*)(std::ios_base&)) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]' (near match)
133 | operator>>(ios_base& (*__pf)(ios_base&))
| ^~~~~~~~
/usr/include/c++/14/istream:133:7: note: conversion of argument 1 would |
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: 'operator<<(int, int)' (built-in)
5 | cin<<n<<a<<b;
| ~~~^~~
a.cc:5:8: note: no known conversion for argument 1 from 'std::istream' {aka 'std::basic_istream<char>'} to 'int'
In file included from /usr/include/c++/14/bits/basic_string.h:47,
from /usr/include/c++/14/string:54,
from /usr/include/c++/14/bits/locale_classes.h:40,
from /usr/include/c++/14/bits/ios_base.h:41,
from /usr/include/c++/14/ios:44,
from /usr/include/c++/14/ostream:40,
from /usr/include/c++/14/iostream:41,
from a.cc:1:
/usr/include/c++/14/string_view:763:5: note: candidate: 'template<class _CharT, class _Traits> std::basic_ostream<_CharT, _Traits>& std::operator<<(basic_ostream<_CharT, _Traits>&, basic_string_view<_CharT, _Traits>)'
763 | operator<<(basic_ostream<_CharT, _Traits>& __os,
| ^~~~~~~~
/usr/include/c++/14/string_view:763:5: note: template argument deduction/substitution failed:
a.cc:5:10: note: 'std::istream' {aka 'std::basic_istream<char>'} is not derived from 'std::basic_ostream<_CharT, _Traits>'
5 | cin<<n<<a<<b;
| ^
/usr/include/c++/14/bits/basic_string.h:4077:5: note: candidate: 'template<class _CharT, class _Traits, class _Alloc> std::basic_ostream<_CharT, _Traits>& std::operator<<(basic_ostream<_CharT, _Traits>&, const __cxx11::basic_string<_CharT, _Traits, _Allocator>&)'
4077 | operator<<(basic_ostream<_CharT, _Traits>& __os,
| ^~~~~~~~
/usr/include/c++/14/bits/basic_string.h:4077:5: note: template argument deduction/substitution failed:
a.cc:5:10: note: 'std::istream' {aka 'std::basic_istream<char>'} is not derived from 'std::basic_ostream<_CharT, _Traits>'
5 | cin<<n<<a<<b;
| ^
In file included from /usr/include/c++/14/bits/memory_resource.h:38,
from /usr/include/c++/14/string:68:
/usr/include/c++/14/cstddef:125:5: note: candidate: 'template<class _IntegerType> constexpr std::__byte_op_t<_IntegerType> std::operator<<(byte, _IntegerType)'
125 | operator<<(byte __b, _IntegerType __shift) noexcept
| ^~~~~~~~
/usr/include/c++/14/cstddef:125:5: note: template argument deduction/substitution failed:
a.cc:5:5: note: cannot convert 'std::cin' (type 'std::istream' {aka 'std::basic_istream<char>'}) to type 'std::byte'
5 | cin<<n<<a<<b;
| ^~~
In file included from /usr/include/c++/14/bits/ios_base.h:46:
/usr/include/c++/14/system_error:339:5: note: candidate: 'template<class _CharT, class _Traits> std::basic_ostream<_CharT, _Traits>& std::operator<<(basic_ostream<_CharT, _Traits>&, const error_code&)'
339 | operator<<(basic_ostream<_CharT, _Traits>& __os, const error_code& __e)
| ^~~~~~~~
/usr/include/c++/14/system_error:339:5: note: template argument deduction/substitution failed:
a.cc:5:10: note: 'std::istream' {aka 'std::basic_istream<char>'} is not derived from 'std::basic_ostream<_CharT, _Traits>'
5 | cin<<n<<a<<b;
| ^
/usr/include/c++/14/ostream:563:5: note: candidate: 'template<class _CharT, class _Traits> std::basic_ostream<_CharT, _Traits>& std::operator<<(basic_ostream<_CharT, _Traits>&, _CharT)'
563 | operator<<(basic_ostream<_CharT, _Traits>& __out, _CharT __c)
| ^~~~~~~~
/usr/include/c++/14/ostream:563:5: note: template argument deduction/substitution failed:
a.cc:5:10: note: 'std::istream' {aka 'std::basic_istream<char>'} is not derived from 'std::basic_ostream<_CharT, _Traits>'
5 | cin<<n<<a<<b;
| ^
/usr/include/c++/14/ostream:573:5: note: candidate: 'template<class _CharT, class _Traits> std::basic_ostream<_CharT, _Traits>& std::operator<<(basic_ostream<_CharT, _Traits>&, char)'
573 | operator<<(basic_ostream<_CharT, _Traits>& __out, char __c)
| ^~~~~~~~
/usr/include/c++/14/ostream:573:5: note: template argument deduction/substitution failed:
a.cc:5:10: note: 'std::istream' {aka 'std::basic_istream<char>'} is not derived from 'std::basic_ostream<_CharT, _Traits>'
5 | cin<<n<<a<<b;
| ^
/usr/include/c++/14/ostream:579:5: note: candidate: 'template<class _Traits> std::basic_ostream<char, _Traits>& std::operator<<(basic_ostream<char, _Traits>&, char)'
579 | operator<<(basic_ostream<char, _Traits>& __out, char __c)
| ^~~~~~~~
/usr/include/c++/14/ostream:579:5: note: template argument deduction/substitution failed:
a.cc:5:10: note: 'std::istream' {aka 'std::basic_istream<char>'} is not derived from 'std::basic_ostream<char, _Traits>'
5 | cin<<n<<a<<b;
| ^
/usr/include/c++/14/ostream:590:5: note: candidate: 'template<class _Traits> std::basic_ostream<char, _Traits>& std::operator<<(basic_ostream<char, _Traits>&, signed char)'
590 | operator<<(basic_ostream<char, _Traits>& __out, signed char __c)
| ^~~~~~~~
/usr/include/c++/14/ostream:590:5: note: template argument deduction/substitution failed:
a.cc:5:10: note: 'std::istream' {aka 'std::basic_istream<char>'} is not derived from 'std::basic_ostream<char, _Traits>'
5 | cin<<n<<a<<b;
| ^
/usr/include/c++/14/ostream:595:5: note: candidate: 'template<class _Traits> std::basic_ostream<char, _Traits>& std::operator<<(basic_ostream<char, _Traits>&, unsigned char)'
595 | operator<<(basic_ostream<char, _Traits>& __out, unsigned char __c)
| ^~~~~~~~
/usr/include/c++/14/ostream:595:5: note: template argument deduction/substitution failed:
a.cc:5:10: note: 'std::istream' {aka 'std::basic_istream<char>'} is not derived from 'std::basic_ostream<char, _Traits>'
5 | cin<<n<<a<<b;
| ^
/usr/include/c++/14/ostream:654:5: note: candidate: 'template<class _CharT, class _Traits> std::basic_ostream<_CharT, _Traits>& std::operator<<(basic_ostream<_CharT, _Traits>&, const _CharT*)'
654 | operator<<(basic_ostream<_CharT, _Traits>& __out, const _CharT* __s)
| ^~~~~~~~
/usr/include/c++/14/ostream:654:5: note: template argument deduction/substitution failed:
a.cc:5:10: note: 'std::istream' {aka 'std::basic_istream<char>'} is not derived from 'std::basic_ostream<_CharT, _Traits>'
5 | cin<<n<<a<<b;
| ^
In file included from /usr/include/c++/14/ostream:1022:
/usr/include/c++/14/bits/ostream.tcc:307:5: note: candidate: 'template<class _CharT, class _Traits> std::basic_ostream<_CharT, _Traits>& std::operator<<(basic_ostream<_CharT, _Traits>&, const char*)'
307 | operator<<(basic_ostream<_CharT, _Traits>& __out, const char* __s)
| ^~~~~~~~
/usr/include/c++/14/bits/ostream.tcc:307:5: note: template argument deduction/substitution failed:
a.cc:5:10: note: 'std::istream' {aka 'std::basic_istream<char>'} is not derived from 'std::basic_ostream<_CharT, _Traits>'
5 | cin<<n<<a<<b;
| ^
/usr/include/c++/14/ostream:671:5: note: candidate: 'template<class _Traits> std::basic_ostream<char, _Traits>& std::operator<<(basic_ostream<char, _Traits>&, const char*)'
671 | operator<<(basic_ostream<char, _Traits>& __out, const char* __s)
| ^~~~~~~~
/usr/include/c++/14/ostream:671:5: note: template argument deduction/substitution failed:
a.cc:5:10: note: 'std::istream' {aka 'std::basic_istream<char>'} is not derived from 'std::basic_ostream<char, _Traits>'
5 | cin<<n<<a<<b;
| ^
/usr/include/c++/14/ostream:684:5: note: candidate: 'template<class _Traits> std::basic_ostream<char, _Traits>& std::operator<<(basic_ostream<char, _Traits>&, const signed char*)'
684 | operator<<(basic_ostream<char, _Traits>& __out, const signed char* __s)
| ^~~~~~~~
/usr/include/c++/14/ostream:684:5: note: template argument deduction/substitution failed:
a.cc:5:10: note: 'std::istream' {aka 'std::basic_istream<char>'} is not derived from 'std::basic_ostream<char, _Traits>'
5 | cin<<n<<a<<b;
| ^
/usr/include/c++/14/ostream:689:5: note: candidate: 'template<class _Traits> std::basic_ostream<char, _Traits>& std::operator<<(basic_ostream<char, _Traits>&, const unsigned char*)'
689 | operator<<(basic_ostream<char, _Traits>& __out, const unsigned char* __s)
| ^~~~~~~~
/usr/include/c++/14/ostream:689:5: note: template argument deduction/substitution failed:
a.cc:5:10: note: 'std::istream' {aka 'std::basic_istream<char>'} is not derived from 'std::basic_ostream<char, _Traits>'
5 | cin<<n<<a<<b;
| ^
/usr/include/c++/14/ostream:810:5: note: candidate: 'template<class _Ostream, class _Tp> _Ostream&& std::operator<<(_Ostream&&, const _Tp&)'
810 | operator<<(_Ostream&& __os, const _Tp& __x)
| ^~~~~~~~
/usr/include/c++/14/ostream:810:5: note: template argument deduction/substitution failed:
/usr/include/c++/14/ostream: In substitution of 'template<class _Ostream, class _Tp> _Ostream&& std::operator<<(_Ostream&&, const _Tp&) [with _Ostream = std::basic_istream<char>&; _Tp = int]':
a.cc:5:10: required from here
5 | cin<<n<<a<<b;
| ^
/usr/include/c++/14/ostream:810:5: error: no type named 'type' in 'struct std::enable_if<false, void>'
810 | operator<<(_Ostream&& __os, const _Tp& __x)
| ^~~~~~~~
|
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++.h:51,
from a.cc:1:
/usr/include/c++/14/bits/stl_algobase.h:257:5: note: candidate: 'template<class _Tp> constexpr const _Tp& std::max(const _Tp&, const _Tp&)'
257 | max(const _Tp& __a, const _Tp& __b)
| ^~~
/usr/include/c++/14/bits/stl_algobase.h:257:5: note: template argument deduction/substitution failed:
a.cc:6:14: note: deduced conflicting types for parameter 'const _Tp' ('long long int' and 'int')
6 | cout<<max((a-2)*(c-b)+1,0)<<endl;
| ~~~^~~~~~~~~~~~~~~~~
/usr/include/c++/14/bits/stl_algobase.h:303:5: note: candidate: 'template<class _Tp, class _Compare> constexpr const _Tp& std::max(const _Tp&, const _Tp&, _Compare)'
303 | max(const _Tp& __a, const _Tp& __b, _Compare __comp)
| ^~~
/usr/include/c++/14/bits/stl_algobase.h:303:5: note: candidate expects 3 arguments, 2 provided
In file included from /usr/include/c++/14/algorithm:61:
/usr/include/c++/14/bits/stl_algo.h:5706:5: note: candidate: 'template<class _Tp> constexpr _Tp std::max(initializer_list<_Tp>)'
5706 | max(initializer_list<_Tp> __l)
| ^~~
/usr/include/c++/14/bits/stl_algo.h:5706:5: note: candidate expects 1 argument, 2 provided
/usr/include/c++/14/bits/stl_algo.h:5716:5: note: candidate: 'template<class _Tp, class _Compare> constexpr _Tp std::max(initializer_list<_Tp>, _Compare)'
5716 | max(initializer_list<_Tp> __l, _Compare __comp)
| ^~~
/usr/include/c++/14/bits/stl_algo.h:5716:5: note: template argument deduction/substitution failed:
a.cc:6:14: note: mismatched types 'std::initializer_list<_Tp>' and 'long long int'
6 | cout<<max((a-2)*(c-b)+1,0)<<endl;
| ~~~^~~~~~~~~~~~~~~~~
|
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 >> n >> a >> b;
long long int ans = ((n-1) * b + a) - ((n-1) * a + b) + 1;
cout << max(ans, 0) << endl;
return 0;
}
//
| 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,
from /usr/include/c++/14/bits/ios_base.h:41,
from /usr/include/c++/14/ios:44,
from /usr/include/c++/14/ostream:40,
from /usr/include/c++/14/iostream:41,
from a.cc:1:
/usr/include/c++/14/bits/stl_algobase.h:257:5: note: candidate: 'template<class _Tp> constexpr const _Tp& std::max(const _Tp&, const _Tp&)'
257 | max(const _Tp& __a, const _Tp& __b)
| ^~~
/usr/include/c++/14/bits/stl_algobase.h:257:5: note: template argument deduction/substitution failed:
a.cc:23:14: note: deduced conflicting types for parameter 'const _Tp' ('long long int' and 'int')
23 | cout << max(ans, 0) << endl;
| ~~~^~~~~~~~
/usr/include/c++/14/bits/stl_algobase.h:303:5: note: candidate: 'template<class _Tp, class _Compare> constexpr const _Tp& std::max(const _Tp&, const _Tp&, _Compare)'
303 | max(const _Tp& __a, const _Tp& __b, _Compare __comp)
| ^~~
/usr/include/c++/14/bits/stl_algobase.h:303:5: note: candidate expects 3 arguments, 2 provided
In file included from /usr/include/c++/14/algorithm:61,
from a.cc:3:
/usr/include/c++/14/bits/stl_algo.h:5706:5: note: candidate: 'template<class _Tp> constexpr _Tp std::max(initializer_list<_Tp>)'
5706 | max(initializer_list<_Tp> __l)
| ^~~
/usr/include/c++/14/bits/stl_algo.h:5706:5: note: candidate expects 1 argument, 2 provided
/usr/include/c++/14/bits/stl_algo.h:5716:5: note: candidate: 'template<class _Tp, class _Compare> constexpr _Tp std::max(initializer_list<_Tp>, _Compare)'
5716 | max(initializer_list<_Tp> __l, _Compare __comp)
| ^~~
/usr/include/c++/14/bits/stl_algo.h:5716:5: note: template argument deduction/substitution failed:
a.cc:23:14: note: mismatched types 'std::initializer_list<_Tp>' and 'long long int'
23 | cout << max(ans, 0) << endl;
| ~~~^~~~~~~~
|
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<<endl;
//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: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;
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~
| | |
| | int
| std::basic_ostream<char>::__ostream_type {aka std::basic_ostream<char>}
a.cc:18:36: note: candidate: 'operator>(int, int)' (built-in)
18 | cout<<(A+B*(N-1))-(A*(N-1)+B)+1>0?(A+B*(N-1))-(A*(N-1)+B)+1:0<<endl;
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~
a.cc:18:36: note: no known conversion for argument 1 from 'std::basic_ostream<char>::__ostream_type' {aka 'std::basic_ostream<char>'} to 'int'
In file included from /usr/include/c++/14/string:48,
from /usr/include/c++/14/bits/locale_classes.h:40,
from /usr/include/c++/14/bits/ios_base.h:41,
from /usr/include/c++/14/ios:44,
from /usr/include/c++/14/ostream:40,
from /usr/include/c++/14/iostream:41,
from a.cc:1:
/usr/include/c++/14/bits/stl_iterator.h:462:5: note: candidate: 'template<class _Iterator> constexpr bool std::operator>(const reverse_iterator<_Iterator>&, const reverse_iterator<_Iterator>&)'
462 | operator>(const reverse_iterator<_Iterator>& __x,
| ^~~~~~~~
/usr/include/c++/14/bits/stl_iterator.h:462:5: note: template argument deduction/substitution failed:
a.cc:18:37: note: 'std::basic_ostream<char>::__ostream_type' {aka 'std::basic_ostream<char>'} is not derived from 'const std::reverse_iterator<_Iterator>'
18 | cout<<(A+B*(N-1))-(A*(N-1)+B)+1>0?(A+B*(N-1))-(A*(N-1)+B)+1:0<<endl;
| ^
/usr/include/c++/14/bits/stl_iterator.h:507:5: note: candidate: 'template<class _IteratorL, class _IteratorR> constexpr bool std::operator>(const reverse_iterator<_Iterator>&, const reverse_iterator<_IteratorR>&)'
507 | operator>(const reverse_iterator<_IteratorL>& __x,
| ^~~~~~~~
/usr/include/c++/14/bits/stl_iterator.h:507:5: note: template argument deduction/substitution failed:
a.cc:18:37: note: 'std::basic_ostream<char>::__ostream_type' {aka 'std::basic_ostream<char>'} is not derived from 'const std::reverse_iterator<_Iterator>'
18 | cout<<(A+B*(N-1))-(A*(N-1)+B)+1>0?(A+B*(N-1))-(A*(N-1)+B)+1:0<<endl;
| ^
/usr/include/c++/14/bits/stl_iterator.h:1714:5: note: candidate: 'template<class _IteratorL, class _IteratorR> constexpr bool std::operator>(const move_iterator<_IteratorL>&, const move_iterator<_IteratorR>&)'
1714 | operator>(const move_iterator<_IteratorL>& __x,
| ^~~~~~~~
/usr/include/c++/14/bits/stl_iterator.h:1714:5: note: template argument deduction/substitution failed:
a.cc:18:37: note: 'std::basic_ostream<char>::__ostream_type' {aka 'std::basic_ostream<char>'} is not derived from 'const std::move_iterator<_IteratorL>'
18 | cout<<(A+B*(N-1))-(A*(N-1)+B)+1>0?(A+B*(N-1))-(A*(N-1)+B)+1:0<<endl;
| ^
/usr/include/c++/14/bits/stl_iterator.h:1774:5: note: candidate: 'template<class _Iterator> constexpr bool std::operator>(const move_iterator<_IteratorL>&, const move_iterator<_IteratorL>&)'
1774 | operator>(const move_iterator<_Iterator>& __x,
| ^~~~~~~~
/usr/include/c++/14/bits/stl_iterator.h:1774:5: note: template argument deduction/substitution failed:
a.cc:18:37: note: 'std::basic_ostream<char>::__ostream_type' {aka 'std::basic_ostream<char>'} is not derived from 'const std::move_iterator<_IteratorL>'
18 | cout<<(A+B*(N-1))-(A*(N-1)+B)+1>0?(A+B*(N-1))-(A*(N-1)+B)+1:0<<endl;
| ^
In file included from /usr/include/c++/14/bits/stl_algobase.h:64,
from /usr/include/c++/14/string:51:
/usr/include/c++/14/bits/stl_pair.h:1058:5: note: candidate: 'template<class _T1, class _T2> constexpr bool std::operator>(const pair<_T1, _T2>&, const pair<_T1, _T2>&)'
1058 | operator>(const pair<_T1, _T2>& __x, const pair<_T1, _T2>& __y)
| ^~~~~~~~
/usr/include/c++/14/bits/stl_pair.h:1058:5: note: template argument deduction/substitution failed:
a.cc:18:37: note: 'std::basic_ostream<char>::__ostream_type' {aka 'std::basic_ostream<char>'} is not derived from 'const std::pair<_T1, _T2>'
18 | cout<<(A+B*(N-1))-(A*(N-1)+B)+1>0?(A+B*(N-1))-(A*(N-1)+B)+1:0<<endl;
| ^
In file included from /usr/include/c++/14/bits/basic_string.h:47,
from /usr/include/c++/14/string:54:
/usr/include/c++/14/string_view:695:5: note: candidate: 'template<class _CharT, class _Traits> constexpr bool std::operator>(basic_string_view<_CharT, _Traits>, basic_string_view<_CharT, _Traits>)'
695 | operator> (basic_string_view<_CharT, _Traits> __x,
| ^~~~~~~~
/usr/include/c++/14/string_view:695:5: note: template argument deduction/substitution failed:
a.cc:18:37: note: 'std::basic_ostream<char>' is not derived from 'std::basic_string_view<_CharT, _Traits>'
18 | cout<<(A+B*(N-1))-(A*(N-1)+B)+1>0?(A+B*(N-1))-(A*(N-1)+B)+1:0<<endl;
| ^
/usr/include/c++/14/string_view:702:5: note: candidate: 'template<class _CharT, class _Traits> constexpr bool std::operator>(basic_string_view<_CharT, _Traits>, __type_identity_t<basic_string_view<_CharT, _Traits> >)'
702 | operator> (basic_string_view<_CharT, _Traits> __x,
| ^~~~~~~~
/usr/include/c++/14/string_view:702:5: note: template argument deduction/substitution failed:
a.cc:18:37: note: 'std::basic_ostream<char>' is not derived from 'std::basic_string_view<_CharT, _Traits>'
18 | cout<<(A+B*(N-1))-(A*(N-1)+B)+1>0?(A+B*(N-1))-(A*(N-1)+B)+1:0<<endl;
| ^
/usr/include/c++/14/string_view:710:5: note: candidate: 'template<class _CharT, class _Traits> constexpr bool std::operator>(__type_identity_t<basic_string_view<_CharT, _Traits> >, basic_string_view<_CharT, _Traits>)'
710 | operator> (__type_identity_t<basic_string_view<_CharT, _Traits>> __x,
| ^~~~~~~~
/usr/include/c++/14/string_view:710:5: note: template argument deduction/substitution failed:
a.cc:18:37: note: mismatched types 'std::basic_string_view<_CharT, _Traits>' 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;
| ^
/usr/include/c++/14/bits/basic_string.h:3915:5: note: candidate: 'template<class _CharT, class _Traits, class _Alloc> bool std::operator>(const __cxx11::basic_string<_CharT, _Traits, _Allocator>&, const __cxx11::basic_string<_CharT, _Traits, _Allocator>&)'
3915 | operator>(const basic_string<_CharT, _Traits, _Alloc>& __lhs,
| ^~~~~~~~
/usr/include/c++/14/bits/basic_string.h:3915:5: note: template argument deduction/substitution failed:
a.cc:18:37: note: 'std::basic_ostream<char>::__ostream_type' {aka 'std::basic_ostream<char>'} is not derived from 'const std::__cxx11::basic_string<_CharT, _Traits, _Allocator>'
18 | cout<<(A+B*(N-1))-(A*(N-1)+B)+1>0?(A+B*(N-1))-(A*(N-1)+B)+1:0<<endl;
| ^
/usr/include/c++/14/bits/basic_string.h:3929:5: note: candidate: 'template<class _CharT, class _Traits, class _Alloc> bool std::operator>(const __cxx11::basic_string<_CharT, _Traits, _Allocator>&, const _CharT*)'
3929 | operator>(const basic_string<_CharT, _Traits, _Alloc>& __lhs,
| ^~~~~~~~
/usr/include/c++/14/bits/basic_string.h:3929:5: note: template argument deduction/substitution failed:
a.cc:18:37: note: 'std::basic_ostream<char>::__ostream_type' {aka 'std::basic_ostream<char>'} is not derived from 'const std::__cxx11::basic_string<_CharT, _Traits, _Allocator>'
18 | cout<<(A+B*(N-1))-(A*(N-1)+B)+1>0?(A+B*(N-1))-(A*(N-1)+B)+1:0<<endl;
| ^
/usr/include/c++/14/bits/basic_string.h:3942:5: note: candidate: 'template<class _CharT, class _Traits, class _Alloc> bool std::operator>(const _CharT*, const __cxx11::basic_string<_CharT, _Traits, _Allocator>&)'
3942 | operator>(const _CharT* __lhs,
| ^~~~~~~~
/usr/include/c++/14/bits/basic_string.h:3942:5: note: template argument deduction/substitution failed:
a.cc:18:37: note: mismatched types 'const _CharT*' and 'std::basic_ostream<char>'
18 | cout<<(A+B*(N-1))-(A*(N-1)+B)+1>0?(A+B*(N-1))-(A*(N-1)+B)+1:0<<endl;
| ^
In file included from /usr/include/c++/14/bits/memory_resource.h:47,
from /usr/include/c++/14/string:68:
/usr/include/c++/14/tuple:2619:5: note: candidate: 'template<class ... _TElements, class ... _UElements> constexpr bool std::operator>(const tuple<_UTypes ...>&, const tuple<_Elements ...>&)'
2619 | operator>(const tuple<_TElements...>& __t,
| ^~~~~~~~
/usr/include/c++/14/tuple:2619:5: note: template argument deduction/substitution failed:
a.cc:18:37: note: 'std::basic_ostream<char>::__ostream_type' {aka 'std::basic_ostream<char>'} is not derived from 'const std::tuple<_UTypes ...>'
18 | cout<<(A+B*(N-1))-(A*(N-1)+B)+1>0?(A+B*(N-1))-(A*(N-1)+B)+1:0<<endl;
| ^
In file included from /usr/include/c++/14/vector:66,
from a.cc:3:
/usr/include/c++/14/bits/stl_vector.h:2102:5: note: candidate: 'template<class _Tp, class _Alloc> bool std::operator>(const vector<_Tp, _Alloc>&, const vector<_Tp, _Alloc>&)'
2102 | operator>(const vector<_Tp, _Alloc>& __x, const vector<_Tp, _Alloc>& __y)
| ^~~~~~~~
/usr/include/c++/14/bits/stl_vector.h:2102:5: note: template argument deduction/substitution failed:
a.cc:18:37: note: 'std::basic_ostream<char>::__ostream_type' {aka 'std::basic_ostream<char>'} is not derived from 'const std::vector<_Tp, _Alloc>'
18 | cout<<(A+B*(N-1))-(A*(N-1)+B)+1>0?(A+B*(N-1))-(A*(N-1)+B)+1:0<<endl;
| ^
a.cc:18:66: error: inv |
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 << 0 << endl;
getchar();
getchar();
return 0;
} | 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_classes.h:40,
from /usr/include/c++/14/bits/ios_base.h:41,
from /usr/include/c++/14/ios:44,
from /usr/include/c++/14/ostream:40,
from /usr/include/c++/14/iostream:41,
from a.cc:1:
/usr/include/c++/14/bits/stl_algobase.h:257:5: note: candidate: 'template<class _Tp> constexpr const _Tp& std::max(const _Tp&, const _Tp&)'
257 | max(const _Tp& __a, const _Tp& __b)
| ^~~
/usr/include/c++/14/bits/stl_algobase.h:257:5: note: template argument deduction/substitution failed:
a.cc:13:19: note: deduced conflicting types for parameter 'const _Tp' ('long long int' and 'int')
13 | else cout<<max(((n-2)*(b-a))+1,0)<<endl;
| ~~~^~~~~~~~~~~~~~~~~~~
/usr/include/c++/14/bits/stl_algobase.h:303:5: note: candidate: 'template<class _Tp, class _Compare> constexpr const _Tp& std::max(const _Tp&, const _Tp&, _Compare)'
303 | max(const _Tp& __a, const _Tp& __b, _Compare __comp)
| ^~~
/usr/include/c++/14/bits/stl_algobase.h:303:5: note: candidate expects 3 arguments, 2 provided
In file included from /usr/include/c++/14/algorithm:61,
from a.cc:3:
/usr/include/c++/14/bits/stl_algo.h:5706:5: note: candidate: 'template<class _Tp> constexpr _Tp std::max(initializer_list<_Tp>)'
5706 | max(initializer_list<_Tp> __l)
| ^~~
/usr/include/c++/14/bits/stl_algo.h:5706:5: note: candidate expects 1 argument, 2 provided
/usr/include/c++/14/bits/stl_algo.h:5716:5: note: candidate: 'template<class _Tp, class _Compare> constexpr _Tp std::max(initializer_list<_Tp>, _Compare)'
5716 | max(initializer_list<_Tp> __l, _Compare __comp)
| ^~~
/usr/include/c++/14/bits/stl_algo.h:5716:5: note: template argument deduction/substitution failed:
a.cc:13:19: note: mismatched types 'std::initializer_list<_Tp>' and 'long long int'
13 | else cout<<max(((n-2)*(b-a))+1,0)<<endl;
| ~~~^~~~~~~~~~~~~~~~~~~
|
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_classes.h:40,
from /usr/include/c++/14/bits/ios_base.h:41,
from /usr/include/c++/14/ios:44,
from /usr/include/c++/14/ostream:40,
from /usr/include/c++/14/iostream:41,
from a.cc:1:
/usr/include/c++/14/bits/stl_algobase.h:257:5: note: candidate: 'template<class _Tp> constexpr const _Tp& std::max(const _Tp&, const _Tp&)'
257 | max(const _Tp& __a, const _Tp& __b)
| ^~~
/usr/include/c++/14/bits/stl_algobase.h:257:5: note: template argument deduction/substitution failed:
a.cc:13:19: note: deduced conflicting types for parameter 'const _Tp' ('long long int' and 'int')
13 | else cout<<max(((n-2)*(b-a))+1,0)<<endl;
| ~~~^~~~~~~~~~~~~~~~~~~
/usr/include/c++/14/bits/stl_algobase.h:303:5: note: candidate: 'template<class _Tp, class _Compare> constexpr const _Tp& std::max(const _Tp&, const _Tp&, _Compare)'
303 | max(const _Tp& __a, const _Tp& __b, _Compare __comp)
| ^~~
/usr/include/c++/14/bits/stl_algobase.h:303:5: note: candidate expects 3 arguments, 2 provided
In file included from /usr/include/c++/14/algorithm:61,
from a.cc:3:
/usr/include/c++/14/bits/stl_algo.h:5706:5: note: candidate: 'template<class _Tp> constexpr _Tp std::max(initializer_list<_Tp>)'
5706 | max(initializer_list<_Tp> __l)
| ^~~
/usr/include/c++/14/bits/stl_algo.h:5706:5: note: candidate expects 1 argument, 2 provided
/usr/include/c++/14/bits/stl_algo.h:5716:5: note: candidate: 'template<class _Tp, class _Compare> constexpr _Tp std::max(initializer_list<_Tp>, _Compare)'
5716 | max(initializer_list<_Tp> __l, _Compare __comp)
| ^~~
/usr/include/c++/14/bits/stl_algo.h:5716:5: note: template argument deduction/substitution failed:
a.cc:13:19: note: mismatched types 'std::initializer_list<_Tp>' and 'long long int'
13 | else cout<<max(((n-2)*(b-a))+1,0)<<endl;
| ~~~^~~~~~~~~~~~~~~~~~~
|
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)*(N-2)+1<<endl;
} | 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; i++)
#define Repr(e, b, i) for(int i = e; i >= b; i--)
#define rep(n, i) Rep(0, n-1, i)
#define repr(n, i) Repr(n-1, 0, i)
#define all(v) (v).begin(), (v).end()
#define pb(x) push_back(x)
#define uniq(x) (x).erase(unique(all(x)),(x).end())
typedef long long ll;
void solve(void){
ll N, A, B;
cin >> N >> A >> B;
cout << max((A+B*(N-1)) - (A*(N-1)+B) + 1, 0) << endl;
}
int main(void){
solve();
return 0;
}
| 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/bits/locale_classes.h:40,
from /usr/include/c++/14/bits/ios_base.h:41,
from /usr/include/c++/14/ios:44,
from /usr/include/c++/14/ostream:40,
from /usr/include/c++/14/iostream:41,
from a.cc:1:
/usr/include/c++/14/bits/stl_algobase.h:257:5: note: candidate: 'template<class _Tp> constexpr const _Tp& std::max(const _Tp&, const _Tp&)'
257 | max(const _Tp& __a, const _Tp& __b)
| ^~~
/usr/include/c++/14/bits/stl_algobase.h:257:5: note: template argument deduction/substitution failed:
a.cc:30:16: note: deduced conflicting types for parameter 'const _Tp' ('long long int' and 'int')
30 | cout << max((A+B*(N-1)) - (A*(N-1)+B) + 1, 0) << endl;
| ~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/include/c++/14/bits/stl_algobase.h:303:5: note: candidate: 'template<class _Tp, class _Compare> constexpr const _Tp& std::max(const _Tp&, const _Tp&, _Compare)'
303 | max(const _Tp& __a, const _Tp& __b, _Compare __comp)
| ^~~
/usr/include/c++/14/bits/stl_algobase.h:303:5: note: candidate expects 3 arguments, 2 provided
In file included from /usr/include/c++/14/algorithm:61,
from a.cc:12:
/usr/include/c++/14/bits/stl_algo.h:5706:5: note: candidate: 'template<class _Tp> constexpr _Tp std::max(initializer_list<_Tp>)'
5706 | max(initializer_list<_Tp> __l)
| ^~~
/usr/include/c++/14/bits/stl_algo.h:5706:5: note: candidate expects 1 argument, 2 provided
/usr/include/c++/14/bits/stl_algo.h:5716:5: note: candidate: 'template<class _Tp, class _Compare> constexpr _Tp std::max(initializer_list<_Tp>, _Compare)'
5716 | max(initializer_list<_Tp> __l, _Compare __comp)
| ^~~
/usr/include/c++/14/bits/stl_algo.h:5716:5: note: template argument deduction/substitution failed:
a.cc:30:16: note: mismatched types 'std::initializer_list<_Tp>' and 'long long int'
30 | cout << max((A+B*(N-1)) - (A*(N-1)+B) + 1, 0) << endl;
| ~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
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; i++)
#define Repr(e, b, i) for(int i = e; i >= b; i--)
#define rep(n, i) Rep(0, n-1, i)
#define repr(n, i) Repr(n-1, 0, i)
#define all(v) (v).begin(), (v).end()
#define pb(x) push_back(x)
#define uniq(x) (x).erase(unique(all(x)),(x).end())
void solve(void){
ll N, A, B;
cin >> N >> A >> B;
cout << max((A+B*(N-1)) - (A*(N-1)+B) + 1, 0) << endl;
}
int main(void){
solve();
return 0;
}
| 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 scope
28 | cin >> N >> A >> B;
| ^
a.cc:28:22: error: 'B' was not declared in this scope
28 | cin >> N >> A >> B;
| ^
|
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;
if(a>b){
cout<<0;
return 0;
}
if(n==1&&a-b){
cout<<0;
return 0;
}
cout<<((n-1)*b+a-(n-1)*a-b+1)<<endl;
return 0;
} | 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){
cout<<0;
return 0;
}
if(n==1&&a-b){
cout<<0;
return 0;
}
}
cout<<((n-1)*b+a-(n-1)*a-b+1)<<endl;
return 0;
} | 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);
T::parse(&buf.trim())
}
pub fn readnc<T: InputValue>() -> Vec<T> {
let mut vec = vec![];
let line: String = read();
for token in line.split_whitespace() {
vec.push(T::parse(token));
}
vec
}
pub fn readn<T: InputValue>(n: usize) -> Vec<T> {
let mut vec = vec![];
for _ in 0..n {
vec.push(read());
}
vec
}
macro_rules! parse_single_value {
($($t:ty),*) => {
$(
impl InputValue for $t {
fn parse(s: &str) -> $t { s.parse().unwrap() }
}
)*
}
}
parse_single_value!(i32, i64, f32, f64, usize, String);
macro_rules! parse_tuple {
($($t:ident),*) => {
impl<$($t),*> InputValue for ($($t),*) where $($t: InputValue),* {
fn parse(s: &str) -> ($($t),*) {
let mut tokens = s.split_whitespace();
let t = ($($t::parse(tokens.next().unwrap())),*);
t
}
}
}
}
parse_tuple!(A, B);
parse_tuple!(A, B, C);
// ===
fn main() {
let (n, a, b): (i32, i32, i32) = read();
let mut ans : i32 = 0;
if a == b {
ans = 1;
} else if a < b && n != 1 {
ans = (b - a) * (n - 2) + 1;
}
println!("{}", ans);
} | 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:1: error: 'use' does not name a type
3 | use std::fmt::*;
| ^~~
a.cc:4:1: error: 'use' does not name a type
4 | use std::str::*;
| ^~~
a.cc:5:1: error: 'use' does not name a type
5 | use std::cmp::*;
| ^~~
a.cc:6:1: error: 'use' does not name a type
6 | use std::collections::*;
| ^~~
a.cc:8:1: error: 'pub' does not name a type
8 | pub trait InputValue {
| ^~~
a.cc:12:1: error: 'pub' does not name a type
12 | pub fn read<T: InputValue>() -> T {
| ^~~
a.cc:18:1: error: 'pub' does not name a type
18 | pub fn readnc<T: InputValue>() -> Vec<T> {
| ^~~
a.cc:27:1: error: 'pub' does not name a type
27 | pub fn readn<T: InputValue>(n: usize) -> Vec<T> {
| ^~~
a.cc:35:1: error: 'macro_rules' does not name a type
35 | macro_rules! parse_single_value {
| ^~~~~~~~~~~
a.cc:44:1: error: 'parse_single_value' does not name a type
44 | parse_single_value!(i32, i64, f32, f64, usize, String);
| ^~~~~~~~~~~~~~~~~~
a.cc:46:1: error: 'macro_rules' does not name a type
46 | macro_rules! parse_tuple {
| ^~~~~~~~~~~
a.cc:57:1: error: 'parse_tuple' does not name a type
57 | parse_tuple!(A, B);
| ^~~~~~~~~~~
a.cc:58:1: error: 'parse_tuple' does not name a type
58 | parse_tuple!(A, B, C);
| ^~~~~~~~~~~
a.cc:62:1: error: 'fn' does not name a type
62 | fn main() {
| ^~
|
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>
#include <map>
#include <iomanip>
#include <sstream>
#include <bitset>
#include <limits>
#include <numeric>
#include <valarray>
#include <fstream>
using namespace std;
typedef unsigned int uint;
typedef long long LL;
typedef unsigned long long ULL;
typedef pair<LL, LL> PP;
#define REP(i,a,n) for(LL i = (a); i < (LL)(n); ++i)
#define REM(i,a,n) for(LL i = ((n) - 1); i >= (a); --i)
#define FLOAT fixed << setprecision(16)
#define SPEEDUP {cin.tie(0); ios::sync_with_stdio(false);}
const int INF = 0x3FFFFFFF;
const LL INFLL = 0x3FFFFFFF3FFFFFFF;
const double INFD = 1.0e+308;
const string INFSTR = "\x7f";
const double EPS = 1.0e-9;
void YesNo(bool b) { cout << (b ? "Yes" : "No") << endl; }
void YESNO(bool b) { cout << (b ? "YES" : "NO") << endl; }
template <class T, class U>
istream& operator>>(istream& ist, pair<T, U>& right) { return ist >> right.first >> right.second; }
template <class T, class U>
ostream& operator<<(ostream& ost, const pair<T, U>& right) { return ost << right.first << ' ' << right.second; }
template <class T, class TCompatible, size_t N>
void Fill(T(&dest)[N], const TCompatible& val) { fill(dest, dest + N, val); }
template <class T, class TCompatible, size_t M, size_t N>
void Fill(T(&dest)[M][N], const TCompatible& val) { for (int i = 0; i < M; ++i) Fill(dest[i], val); }
template<class T>
T Compare(T left, T right) { return left > right ? 1 : (left < right ? -1 : 0); }
istream& Ignore(istream& ist) { string s; ist >> s; return ist; }
bool Inside(int i, int j, int h, int w) { return i >= 0 && i < h && j >= 0 && j < w; }
// all_of
// partial_sum, adjacent_difference
#ifdef ONLY_MY_ENVIR
#include "IntMod.h"
#include "Union_Find.h"
#include "Graph.h"
#include "Range.h"
#include "Global.h"
#include "Flow_Solver.h"
#include "Tree.h"
#include "Suffix_Array.h"
#include "Geometry.h"
#include "Matrix.h"
#endif
#ifdef __GNUC__
typedef __int128 LLL;
istream& operator>> (istream& ist, __int128& val) { LL tmp; ist >> tmp; val = tmp; return ist; }
ostream& operator<< (ostream& ost, __int128 val) { LL tmp = val; ost << tmp; return ost; }
#endif
#if 1234567891
#include <array>
#include <random>
#include <unordered_set>
#include <unordered_map>
template<typename T>
using PriorityQ = priority_queue<T, vector<T>, greater<T> >; // コスト小を優先
#endif
string s;
int main() {
cin >> s;
int d = 0;
LL sum = 0;
const int si = s.size()
REP(i, 1, si) {
sum += i + d;
if (s[i] == 'U') {
sum += 2 * i;
} else {
sum += i;
++d;
}
}
cout << sum << endl;
return 0;
}
| 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 scope; did you mean 'si'?
92 | REP(i, 1, si) {
| ^
a.cc:31:36: note: in definition of macro 'REP'
31 | #define REP(i,a,n) for(LL i = (a); i < (LL)(n); ++i)
| ^
|
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<char>}
a.cc:10:13: note: candidate: 'operator<<(int, int)' (built-in)
10 | cin << n << a << b;
| ~~~~^~~~
a.cc:10:13: note: no known conversion for argument 1 from 'std::istream' {aka 'std::basic_istream<char>'} to 'int'
In file included from /usr/include/c++/14/bits/basic_string.h:47,
from /usr/include/c++/14/string:54,
from /usr/include/c++/14/bits/locale_classes.h:40,
from /usr/include/c++/14/bits/ios_base.h:41,
from /usr/include/c++/14/ios:44,
from /usr/include/c++/14/ostream:40,
from /usr/include/c++/14/iostream:41,
from a.cc:1:
/usr/include/c++/14/string_view:763:5: note: candidate: 'template<class _CharT, class _Traits> std::basic_ostream<_CharT, _Traits>& std::operator<<(basic_ostream<_CharT, _Traits>&, basic_string_view<_CharT, _Traits>)'
763 | operator<<(basic_ostream<_CharT, _Traits>& __os,
| ^~~~~~~~
/usr/include/c++/14/string_view:763:5: note: template argument deduction/substitution failed:
a.cc:10:16: note: 'std::istream' {aka 'std::basic_istream<char>'} is not derived from 'std::basic_ostream<_CharT, _Traits>'
10 | cin << n << a << b;
| ^
/usr/include/c++/14/bits/basic_string.h:4077:5: note: candidate: 'template<class _CharT, class _Traits, class _Alloc> std::basic_ostream<_CharT, _Traits>& std::operator<<(basic_ostream<_CharT, _Traits>&, const __cxx11::basic_string<_CharT, _Traits, _Allocator>&)'
4077 | operator<<(basic_ostream<_CharT, _Traits>& __os,
| ^~~~~~~~
/usr/include/c++/14/bits/basic_string.h:4077:5: note: template argument deduction/substitution failed:
a.cc:10:16: note: 'std::istream' {aka 'std::basic_istream<char>'} is not derived from 'std::basic_ostream<_CharT, _Traits>'
10 | cin << n << a << b;
| ^
In file included from /usr/include/c++/14/bits/memory_resource.h:38,
from /usr/include/c++/14/string:68:
/usr/include/c++/14/cstddef:125:5: note: candidate: 'template<class _IntegerType> constexpr std::__byte_op_t<_IntegerType> std::operator<<(byte, _IntegerType)'
125 | operator<<(byte __b, _IntegerType __shift) noexcept
| ^~~~~~~~
/usr/include/c++/14/cstddef:125:5: note: template argument deduction/substitution failed:
a.cc:10:9: note: cannot convert 'std::cin' (type 'std::istream' {aka 'std::basic_istream<char>'}) to type 'std::byte'
10 | cin << n << a << b;
| ^~~
In file included from /usr/include/c++/14/bits/ios_base.h:46:
/usr/include/c++/14/system_error:339:5: note: candidate: 'template<class _CharT, class _Traits> std::basic_ostream<_CharT, _Traits>& std::operator<<(basic_ostream<_CharT, _Traits>&, const error_code&)'
339 | operator<<(basic_ostream<_CharT, _Traits>& __os, const error_code& __e)
| ^~~~~~~~
/usr/include/c++/14/system_error:339:5: note: template argument deduction/substitution failed:
a.cc:10:16: note: 'std::istream' {aka 'std::basic_istream<char>'} is not derived from 'std::basic_ostream<_CharT, _Traits>'
10 | cin << n << a << b;
| ^
/usr/include/c++/14/ostream:563:5: note: candidate: 'template<class _CharT, class _Traits> std::basic_ostream<_CharT, _Traits>& std::operator<<(basic_ostream<_CharT, _Traits>&, _CharT)'
563 | operator<<(basic_ostream<_CharT, _Traits>& __out, _CharT __c)
| ^~~~~~~~
/usr/include/c++/14/ostream:563:5: note: template argument deduction/substitution failed:
a.cc:10:16: note: 'std::istream' {aka 'std::basic_istream<char>'} is not derived from 'std::basic_ostream<_CharT, _Traits>'
10 | cin << n << a << b;
| ^
/usr/include/c++/14/ostream:573:5: note: candidate: 'template<class _CharT, class _Traits> std::basic_ostream<_CharT, _Traits>& std::operator<<(basic_ostream<_CharT, _Traits>&, char)'
573 | operator<<(basic_ostream<_CharT, _Traits>& __out, char __c)
| ^~~~~~~~
/usr/include/c++/14/ostream:573:5: note: template argument deduction/substitution failed:
a.cc:10:16: note: 'std::istream' {aka 'std::basic_istream<char>'} is not derived from 'std::basic_ostream<_CharT, _Traits>'
10 | cin << n << a << b;
| ^
/usr/include/c++/14/ostream:579:5: note: candidate: 'template<class _Traits> std::basic_ostream<char, _Traits>& std::operator<<(basic_ostream<char, _Traits>&, char)'
579 | operator<<(basic_ostream<char, _Traits>& __out, char __c)
| ^~~~~~~~
/usr/include/c++/14/ostream:579:5: note: template argument deduction/substitution failed:
a.cc:10:16: note: 'std::istream' {aka 'std::basic_istream<char>'} is not derived from 'std::basic_ostream<char, _Traits>'
10 | cin << n << a << b;
| ^
/usr/include/c++/14/ostream:590:5: note: candidate: 'template<class _Traits> std::basic_ostream<char, _Traits>& std::operator<<(basic_ostream<char, _Traits>&, signed char)'
590 | operator<<(basic_ostream<char, _Traits>& __out, signed char __c)
| ^~~~~~~~
/usr/include/c++/14/ostream:590:5: note: template argument deduction/substitution failed:
a.cc:10:16: note: 'std::istream' {aka 'std::basic_istream<char>'} is not derived from 'std::basic_ostream<char, _Traits>'
10 | cin << n << a << b;
| ^
/usr/include/c++/14/ostream:595:5: note: candidate: 'template<class _Traits> std::basic_ostream<char, _Traits>& std::operator<<(basic_ostream<char, _Traits>&, unsigned char)'
595 | operator<<(basic_ostream<char, _Traits>& __out, unsigned char __c)
| ^~~~~~~~
/usr/include/c++/14/ostream:595:5: note: template argument deduction/substitution failed:
a.cc:10:16: note: 'std::istream' {aka 'std::basic_istream<char>'} is not derived from 'std::basic_ostream<char, _Traits>'
10 | cin << n << a << b;
| ^
/usr/include/c++/14/ostream:654:5: note: candidate: 'template<class _CharT, class _Traits> std::basic_ostream<_CharT, _Traits>& std::operator<<(basic_ostream<_CharT, _Traits>&, const _CharT*)'
654 | operator<<(basic_ostream<_CharT, _Traits>& __out, const _CharT* __s)
| ^~~~~~~~
/usr/include/c++/14/ostream:654:5: note: template argument deduction/substitution failed:
a.cc:10:16: note: 'std::istream' {aka 'std::basic_istream<char>'} is not derived from 'std::basic_ostream<_CharT, _Traits>'
10 | cin << n << a << b;
| ^
In file included from /usr/include/c++/14/ostream:1022:
/usr/include/c++/14/bits/ostream.tcc:307:5: note: candidate: 'template<class _CharT, class _Traits> std::basic_ostream<_CharT, _Traits>& std::operator<<(basic_ostream<_CharT, _Traits>&, const char*)'
307 | operator<<(basic_ostream<_CharT, _Traits>& __out, const char* __s)
| ^~~~~~~~
/usr/include/c++/14/bits/ostream.tcc:307:5: note: template argument deduction/substitution failed:
a.cc:10:16: note: 'std::istream' {aka 'std::basic_istream<char>'} is not derived from 'std::basic_ostream<_CharT, _Traits>'
10 | cin << n << a << b;
| ^
/usr/include/c++/14/ostream:671:5: note: candidate: 'template<class _Traits> std::basic_ostream<char, _Traits>& std::operator<<(basic_ostream<char, _Traits>&, const char*)'
671 | operator<<(basic_ostream<char, _Traits>& __out, const char* __s)
| ^~~~~~~~
/usr/include/c++/14/ostream:671:5: note: template argument deduction/substitution failed:
a.cc:10:16: note: 'std::istream' {aka 'std::basic_istream<char>'} is not derived from 'std::basic_ostream<char, _Traits>'
10 | cin << n << a << b;
| ^
/usr/include/c++/14/ostream:684:5: note: candidate: 'template<class _Traits> std::basic_ostream<char, _Traits>& std::operator<<(basic_ostream<char, _Traits>&, const signed char*)'
684 | operator<<(basic_ostream<char, _Traits>& __out, const signed char* __s)
| ^~~~~~~~
/usr/include/c++/14/ostream:684:5: note: template argument deduction/substitution failed:
a.cc:10:16: note: 'std::istream' {aka 'std::basic_istream<char>'} is not derived from 'std::basic_ostream<char, _Traits>'
10 | cin << n << a << b;
| ^
/usr/include/c++/14/ostream:689:5: note: candidate: 'template<class _Traits> std::basic_ostream<char, _Traits>& std::operator<<(basic_ostream<char, _Traits>&, const unsigned char*)'
689 | operator<<(basic_ostream<char, _Traits>& __out, const unsigned char* __s)
| ^~~~~~~~
/usr/include/c++/14/ostream:689:5: note: template argument deduction/substitution failed:
a.cc:10:16: note: 'std::istream' {aka 'std::basic_istream<char>'} is not derived from 'std::basic_ostream<char, _Traits>'
10 | cin << n << a << b;
| ^
/usr/include/c++/14/ostream:810:5: note: candidate: 'template<class _Ostream, class _Tp> _Ostream&& std::operator<<(_Ostream&&, const _Tp&)'
810 | operator<<(_Ostream&& __os, const _Tp& __x)
| ^~~~~~~~
/usr/include/c++/14/ostream:810:5: note: template argument deduction/substitution failed:
/usr/include/c++/14/ostream: In substitution of 'template<class _Ostream, class _Tp> _Ostream&& std::operator<<(_Ostream&&, const _Tp&) [with _Ostream = std::basic_istream<char>&; _Tp = int]':
a.cc:10:9: required from here
10 | cin << n << a << b;
| ^
/usr/include/c++/14/ostream:810:5: error: no type named 'type' in 'struct std::enable_if<false, void>'
810 | operator<<(_Ostream&& __os, const _Tp& __x)
| ^~~~~~~~
|
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);
}
for(int j=1;N.length()-1>j;j++){
if(S[j]=='U'){
ans+=j*2+N.length()-j-1;
}else{
ans+=j+(N.length()-j-1)*2;
}
}
System.out.println(ans);
}
} | 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 ) {
cout << "0\n";
return 0;1
}
cout << B*N - A*N + 1 - 2*(B - A) << '\n';
return 0;
}
| 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_queue<int>
#define PGQ priority_queue<int,vector<int>,greater<int> >
#define VE vector<int>
#define VP vector<PA>
#define YES(i) cout<<(i?"YES":"NO")<<endl
#define Yes(i) cout<<(i?"Yes":"No")<<endl
#define MOD 1000000007
#define INF 1000000007
#define PI 3.14159265358979323846
using namespace std;
//
int main(){
long long N,A,B;
cin>>N>>A>>B;
long long L=A*(N-1)+B,U=A+(N-1)*B;
cout<<max(0,U-L+1)<<endl;
return 0;
}
| 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 /usr/include/c++/14/bits/ios_base.h:41,
from /usr/include/c++/14/ios:44,
from /usr/include/c++/14/ostream:40,
from /usr/include/c++/14/iostream:41,
from a.cc:1:
/usr/include/c++/14/bits/stl_algobase.h:257:5: note: candidate: 'template<class _Tp> constexpr const _Tp& std::max(const _Tp&, const _Tp&)'
257 | max(const _Tp& __a, const _Tp& __b)
| ^~~
/usr/include/c++/14/bits/stl_algobase.h:257:5: note: template argument deduction/substitution failed:
a.cc:30:12: note: deduced conflicting types for parameter 'const _Tp' ('int' and 'long long int')
30 | cout<<max(0,U-L+1)<<endl;
| ~~~^~~~~~~~~
/usr/include/c++/14/bits/stl_algobase.h:303:5: note: candidate: 'template<class _Tp, class _Compare> constexpr const _Tp& std::max(const _Tp&, const _Tp&, _Compare)'
303 | max(const _Tp& __a, const _Tp& __b, _Compare __comp)
| ^~~
/usr/include/c++/14/bits/stl_algobase.h:303:5: note: candidate expects 3 arguments, 2 provided
In file included from /usr/include/c++/14/algorithm:61,
from a.cc:3:
/usr/include/c++/14/bits/stl_algo.h:5706:5: note: candidate: 'template<class _Tp> constexpr _Tp std::max(initializer_list<_Tp>)'
5706 | max(initializer_list<_Tp> __l)
| ^~~
/usr/include/c++/14/bits/stl_algo.h:5706:5: note: candidate expects 1 argument, 2 provided
/usr/include/c++/14/bits/stl_algo.h:5716:5: note: candidate: 'template<class _Tp, class _Compare> constexpr _Tp std::max(initializer_list<_Tp>, _Compare)'
5716 | max(initializer_list<_Tp> __l, _Compare __comp)
| ^~~
/usr/include/c++/14/bits/stl_algo.h:5716:5: note: template argument deduction/substitution failed:
a.cc:30:12: note: mismatched types 'std::initializer_list<_Tp>' and 'int'
30 | cout<<max(0,U-L+1)<<endl;
| ~~~^~~~~~~~~
|
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;
| ^~~~
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.