submission_id stringlengths 10 10 | problem_id stringlengths 6 6 | language stringclasses 3
values | code stringlengths 1 522k | compiler_output stringlengths 43 10.2k |
|---|---|---|---|---|
s341125819 | p03705 | C++ |
/*
このコード、と~おれ!
Be accepted!
∧_∧
(。・ω・。)つ━☆・*。
⊂ ノ ・゜+.
しーJ °。+ *´¨)
.· ´¸.·*´¨) ¸.·*¨)
(¸.·´ (¸.·'* ☆
*/
#include <stdio.h>
#include <algorithm>
#include <string>
#include <cmath>
#include <cstring>
#include <vector>
#include <numeric>
#include <iostream>
#include <random>
#inclu... | a.cc: In function 'int main()':
a.cc:115:27: error: expression cannot be used as a function
115 | else ans = (b - a)(n - 2) + 1;
| ~~~~~~~^~~~~~~
|
s766120823 | p03705 | C++ |
/*
このコード、と~おれ!
Be accepted!
∧_∧
(。・ω・。)つ━☆・*。
⊂ ノ ・゜+.
しーJ °。+ *´¨)
.· ´¸.·*´¨) ¸.·*¨)
(¸.·´ (¸.·'* ☆
*/
#include <stdio.h>
#include <algorithm>
#include <string>
#include <cmath>
#include <cstring>
#include <vector>
#include <numeric>
#include <iostream>
#include <random>
#inclu... | a.cc: In function 'int main()':
a.cc:114:27: error: no matching function for call to 'max(int, ll)'
114 | ans += max(0, b - a + 1 - i);
| ~~~^~~~~~~~~~~~~~~~~~
In file included from /usr/include/c++/14/algorithm:60,
from a.cc:14:
/usr/include/c++/14/bits/s... |
s737854827 | p03705 | C++ | #include <bits/stdc++.h>
using namespace std;
int main () {
long N, A, B;
cin >> N >> A >> B;
if(N == 1 || A > B){
cout << 0 << endl;
return 0;
}
N -= 2
cout << (B - A) * N + 1 << endl;
return 0;
} | a.cc: In function 'int main()':
a.cc:10:9: error: expected ';' before 'cout'
10 | N -= 2
| ^
| ;
11 | cout << (B - A) * N + 1 << endl;
| ~~~~
|
s726192556 | p03705 | C++ | #include<bits/stdc++.h>
using namespace std;
int main(){
std::ios::sync_with_stdio(0);
int n,a,b;
cin>>n>>a>>b;
if(a>b||n==1) cout<<a==b;
else cout<<(n-2)*(b-a)+1;
cout<<endl;
return 0;
// TAT
} | a.cc: In function 'int main()':
a.cc:7:30: error: no match for 'operator==' (operand types are 'std::basic_ostream<char>' and 'int')
7 | if(a>b||n==1) cout<<a==b;
| ~~~~~~~^~~
| | |
| | int
| ... |
s605933691 | p03705 | C++ | import sys
stdin = sys.stdin
mod = 1000000007
inf = 1 << 60
ni = lambda: int(ns())
na = lambda: list(map(int, stdin.readline().split()))
ns = lambda: stdin.readline().rstrip()
nas = lambda: stdin.readline().split()
n, a, b = na()
ans = (n - 2) * b - (n - 2) * a + 1
if ans <= 0:
print(0)
else:
print(ans) | a.cc:1:1: error: 'import' does not name a type
1 | import sys
| ^~~~~~
a.cc:1:1: note: C++20 'import' only available with '-fmodules-ts'
|
s259856840 | p03705 | C++ | #include <bits/stdc++.h>
using namespace std;
int main() {
int n, a, b, ans;
cin >> n >> a >> b;
if (n == 1) {
if (a == b) {
ans = 1;
} else {
ans = 0;
}
} else if (a > b) {
ans = 0;
} else {
ans = (b*(n-1)+a) - (b+a*(n-1) + 1;
}
cout << ans << endl;
} | a.cc: In function 'int main()':
a.cc:16:39: error: expected ')' before ';' token
16 | ans = (b*(n-1)+a) - (b+a*(n-1) + 1;
| ~ ^
| )
|
s103666204 | p03705 | C++ | #include <bits/stdc++.h>
using namespace std;
#define endl "\n"
#define f first
#define s second
#define pb push_back
#define pii pair<int,int>
#define pll pair<ll,ll>
#define ll long long
#define faster ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);
const ll M = 998244353;
const int N = 1005;
const int K = 3... | a.cc:20:45: error: 'int y1' redeclared as different kind of entity
20 | int a[N][N],c[N][N],r[N][N],cnt[N][N],x1,x2,y1,y2;
| ^~
In file included from /usr/include/features.h:523,
from /usr/include/x86_64-linux-gnu/c++/14/bits/os_defines.h:39,
... |
s350647425 | p03705 | C++ | #include <bits/stdc++.h>
using namespace std;
#define endl "\n"
#define f first
#define s second
#define pb push_back
#define pii pair<int,int>
#define pll pair<ll,ll>
#define ll long long
#define faster ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);
const ll M = 998244353;
const int N = 1005;
const int K = 3... | a.cc:20:44: error: 'long long int y1' redeclared as different kind of entity
20 | ll a[N][N],c[N][N],r[N][N],cnt[N][N],x1,x2,y1,y2;
| ^~
In file included from /usr/include/features.h:523,
from /usr/include/x86_64-linux-gnu/c++/14/bits/os_defines.h:39,... |
s161998741 | p03705 | C++ | #include<bits/stdc++.h>
using namespace std;
int main()
{
long long n,a,b;
cin>>n>>a>>b;
if(n>1&&b>=a||n==1&&a==b)
cout<<(n-2)*(b-a)+1<<endl;
else
cout<<0<<endl;
} | a.cc: In function 'int main()':
a.cc:8:30: error: 'endl\U0000ff1b' was not declared in this scope
8 | cout<<(n-2)*(b-a)+1<<endl;
| ^~~~~~
|
s067861314 | p03705 | C++ | #include<iostream>
#include<cstdlib>
#include<string>
#include<vector>
#include<algorithm>
using namespace std;
int main(){
int n,a,b;
cin >> n >> a>>b;
if(n==1 && a != b){
cout << 0<< endl;
}else if(a > b){
cout << 0 << endl;
}else{
cout << pow(n+1,b-a-1) << endl;
}
} | a.cc: In function 'int main()':
a.cc:16:17: error: 'pow' was not declared in this scope
16 | cout << pow(n+1,b-a-1) << endl;
| ^~~
|
s518897627 | p03705 | C++ | #include<iostream>
#include<cstdlib>
#include<string>
#include<vector>
#include<algorithm>
using namespace std;
int main(){
int n,a,b;
cin >> n >> a>>b;
if(n==1 && a != b){
cout << 0<< endl;
}else if(a < b){
cout << 0 << endl;
}else{
cout << pow(n+1,b-a-1) << endl;
}
} | a.cc: In function 'int main()':
a.cc:16:17: error: 'pow' was not declared in this scope
16 | cout << pow(n+1,b-a-1) << endl;
| ^~~
|
s620083214 | p03705 | C++ | // luogu-judger-enable-o2
/*%:pragma GCC optimize(2)
%:pragma GCC optimize(3)
%:pragma GCC optimize("Ofast")
%:pragma GCC optimize("inline")
%:pragma GCC optimize("-fgcse")
%:pragma GCC optimize("-fgcse-lm")
%:pragma GCC optimize("-fipa-sra")
%:pragma GCC optimize("-ftree-pre")
%:pragma GCC optimize("-ftree-vrp")
%:pra... | a.cc: In function 'int main()':
a.cc:164:22: error: no matching function for call to 'max(int, long long int)'
164 | printf("%lld",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++/1... |
s391085365 | p03705 | C++ | #include <bits/stdc++.h>
using namespace std;
int main() {
int n, a, b;
cin >> n >> a >> b;
int min = (n-2)*a;
int max = (n-2)*b;
if(n == 1){
cout << 0 << endl;
} else if(a > b){
cout << 0 << endl;
} else if{
cout << max - min + 1 << endl;
}
} | a.cc: In function 'int main()':
a.cc:13:14: error: expected '(' before '{' token
13 | } else if{
| ^
| (
|
s098990752 | p03705 | C | #include<stdio.h>
#include<string.h>
#include<stdlib.h>
#include<math.h>
#define PI 3.141592653589793
#define MOD 1000000007
int main(){
int n, a, b;
scanf("%d%d%d", &n, &a, &b);
if(a>b){
printf("%d\n", 0);
//exit(1);
}
else if(n == 1){
if(a == b){
printf("%d\n", 0);
//exit(0);
}
else{
printf(... | main.c: In function 'main':
main.c:32:16: error: expected '(' before '{' token
32 | else if{
| ^
| (
main.c:34:25: error: 'ans' undeclared (first use in this function); did you mean 'abs'?
34 | printf("%ld\n", ans);
| ^~~
... |
s423349879 | p03705 | C++ | #include<bits/stdc++.h>
using namespace std;
int main()
{
long long a,b,c=0;
cin>>a>>b;
for(int i=a;i<b+1;i++)
{
c+=i;
}
cout<<i;
} | a.cc: In function 'int main()':
a.cc:11:15: error: 'i' was not declared in this scope
11 | cout<<i;
| ^
|
s415053502 | p03705 | C++ | #include<iostream>
using namespace std;
int main()
{
long long a,b,c,d;
cin>>a>>b>>c;
if(a>1 && c>=b || a=1 && c=b)
cout<<(a-2)*(c-b)+1;
else
cout<<0;
return 0;
} | a.cc: In function 'int main()':
a.cc:7:27: error: lvalue required as left operand of assignment
7 | if(a>1 && c>=b || a=1 && c=b)
| ~~^~~~
|
s399613249 | p03705 | C++ | #include<iostream>
using namespace std;
int main()
{
long long a,b,c,d;
cin>>a>>b>>c;
if((a>1 && c>=b) || (a=1 && c=b))
cout<<(a-2)*(c-b)+1;
else
cout<<0;
return 0;
} | a.cc: In function 'int main()':
a.cc:7:30: error: lvalue required as left operand of assignment
7 | if((a>1 && c>=b) || (a=1 && c=b))
| ~~^~~~
|
s900722244 | p03705 | C++ | #include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
int main() {
int n, a, b;
cin >> n >> a >> b;
if (a > b || (n == 1 && a != b)){
cout << 0 << endl;
}
else if (n == 1){
cout << 1 << endl;
else{
cout << (b - a) * (n - 2) + 1 << endl;
}
} | a.cc: In function 'int main()':
a.cc:13:3: error: expected '}' before 'else'
13 | else{
| ^~~~
a.cc:11:19: note: to match this '{'
11 | else if (n == 1){
| ^
|
s008740215 | p03705 | Java | import java.util.*;
public class Main {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
int N = sc.nextInt();
int A = sc.nextInt();
int B = sc.nextInt();
if (A > B || (N == 1 && A != B))) {
System.out.println(0);
} else {
System.out.println(A+(long)B*... | Main.java:9: error: illegal start of expression
if (A > B || (N == 1 && A != B))) {
^
Main.java:11: error: 'else' without 'if'
} else {
^
2 errors
|
s170053376 | p03705 | Java | import java.util*;
public class Main {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
int N = sc.nextInt();
int A = sc.nextInt();
int B = sc.nextInt();
System.out.println(A+(long)B*(N-1)-(long)A*(N-1)-B-1);
}
} | Main.java:1: error: ';' expected
import java.util*;
^
1 error
|
s795828038 | p03705 | C++ | #include<bits/stdc++.h>
using namespace std;
int main(){
//input
long long N,A,B;
cin >> N >> A >> B;
//calculate
long long answer;
if(A>B)
answer = 0;
else if(N==1)
answer = (a==b ? 1 : 0);
else
answer = (B-A)*(N-2)+1;
//output
cout << answer << endl;
} | a.cc: In function 'int main()':
a.cc:13:19: error: 'a' was not declared in this scope
13 | answer = (a==b ? 1 : 0);
| ^
a.cc:13:22: error: 'b' was not declared in this scope
13 | answer = (a==b ? 1 : 0);
| ^
|
s012093466 | p03705 | C++ | #include <bits/stdc++.h>
using namespace std;
int main(){
long long n,a,b; cin >> n >> a >> b;
long long m = a * (n-1) + b;
long long M = b * (n-1) + a;
cout << max((M-m+1), 0) << endl;
return 0;
} | a.cc: In function 'int main()':
a.cc:7:14: error: no matching function for call to 'max(long long int, int)'
7 | 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,
... |
s322487985 | p03705 | C++ | #include <bits/stdc++.h>
#define REP(i, n) for (int (i) = 0; (i) < (int)(n); i++)
#define FOR(i, a, b) for(int (i) = a; (i) < (int)b; i++)
#define RREP(i, n) for(int (i)=((int)(n)-1); (i)>=0; i--)
#define RFOR(i, a, b) for(int (i) =((int)(b)-1); (i)>=(int)a; i--)
#define ALL(v) (v).begin(),(v).end()
#define MOD 100000... | a.cc: In function 'int main()':
a.cc:43:16: error: no matching function for call to 'max(int, ll)'
43 | cout << max(0,(n-2)*(b-a)+1) <<endl ;
| ~~~^~~~~~~~~~~~~~~~~
In file included from /usr/include/c++/14/algorithm:60,
from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:5... |
s722595000 | p03705 | C++ | #include<cstdio>
#include<algorithm>
using namespace std;
long long n,a,b;
int main()
{
scanf("%lld%lld%lld",&n,&a,&b);
if(b<a) swap(a,b);
if(n==1) printf("%lld",b-a+1)
printf("%lld",(n-2)*b-(n-2)*a+1);
return 0;
} | a.cc: In function 'int main()':
a.cc:9:33: error: expected ';' before 'printf'
9 | if(n==1) printf("%lld",b-a+1)
| ^
| ;
10 | printf("%lld",(n-2)*b-(n-2)*a+1);
| ~~~~~~
|
s446076253 | p03705 | C++ | #include <bits/stdc++.h>
typedef long long ll;
int main()
{
ll n,a,b;
cin >> n >> a >> b;
if (b<a) cout << 0; else
if (n==1)
{
if (a!=b) cout << 0; else cout << 1;
} else
if (n==2) cout << 1; else
{
cout << (n-2)*(b-a) +1;
}
return 0;
} | a.cc: In function 'int main()':
a.cc:8:3: error: 'cin' was not declared in this scope; did you mean 'std::cin'?
8 | cin >> n >> a >> b;
| ^~~
| std::cin
In file included from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:146,
from a.cc:1:
/usr/include/c++/14/iostream:62:18: n... |
s904471562 | p03705 | C++ | #include <iostream>
typedef long long ll;
int main()
{
ll n,a,b;
cin >> n >> a >> b;
if (b<a) cout << 0; else
if (n==1)
{
if (a!=b) cout << 0; else cout << 1;
} else
if (n==2) cout << 1; else
{
cout << (n-2)*(b-a) +1;
}
return 0;
} | a.cc: In function 'int main()':
a.cc:8:3: error: 'cin' was not declared in this scope; did you mean 'std::cin'?
8 | 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; ///< Lin... |
s306453317 | p03705 | C++ | /* @ by batr (T) */
#include <bits/stdc++.h>
#define ll long long
#define pb push_back
#define mp make_pair
#define all(X) (X).begin(), (X).end()
#define cmp_all(X) (X).begin(), (X).end(), cmp
#define B begin()
#define E end()
#define sz size()
#define skip continue
#define ppi pair<pair<int, int>, int>
#define... | a.cc:57:9: error: expected initializer before 'Need_For_Speed'
57 | Need_For_Speed();
| ^~~~~~~~~~~~~~
a.cc:58:9: error: 'cin' does not name a type
58 | cin >> n >> l >> r;
| ^~~
a.cc:59:9: error: expected unqualified-id before 'if'
59 | if (l > r || (n == 1 ... |
s821970598 | p03705 | C++ | #include <vector>
#include <iostream>
using namespace std;
const int MAXN = 2e3 + 10;
vector<string> grid;
int pref1[MAXN][MAXN], pref2[MAXN][MAXN], pref3[MAXN][MAXN];
int main(){
//freopen("sample_input.txt", "r", stdin);
//freopen("sample_output.txt", "w", stdout);
int t = 1;
//cin>> t;
while(t--){
//mems... | a.cc: In function 'int main()':
a.cc:19:17: error: 'memset' was not declared in this scope
19 | memset(pref1, 0, sizeof pref1);
| ^~~~~~
a.cc:3:1: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
2 | #include <iostream>... |
s549558653 | p03705 | C++ | #include <bits/stdc++.h>
#include <algorithm>
using namespace std;
int main() {
int a,b,c;
cin >> a>>b>>c;
if(c-b<=a-1){
cout << (c-b+1)*(c-b+1)-(a-(c-b))*(a-(c-b)) << endl;
}
else{
cout << "0" << endl;
}
| a.cc: In function 'int main()':
a.cc:16:4: error: expected '}' at end of input
16 | }
| ^
a.cc:4:12: note: to match this '{'
4 | int main() {
| ^
|
s273632653 | p03705 | C++ | //libs
#include <bits/stdc++.h>
//other stuff
using namespace std;
//function call
//main
int main(){
int n;
unsigned int a,b,mx=0,mn=0;
cin >> n >> a >> b;
mx=(b*(n-1))+a;
mn=(a*(n-1))+b;
if(a=<b){
cout<<mx-mn+1<<endl;
}
else{
cout<<0<<endl;
}
return 0;
}
//functions
| a.cc: In function 'int main()':
a.cc:19:14: error: expected primary-expression before '<' token
19 | if(a=<b){
| ^
|
s295643246 | p03705 | C++ | #include <bits/stdc++.h>
using namespace std;
int main(){
long long int A,B,N;
cin >> N >> A >> B;
if(B<A){
cout << "0" << endl;
}else if(A==B{
cout << "1" << endl;
}else{
cout << (N-2)*(B-A) +1 << endl;
}
} | a.cc: In function 'int main()':
a.cc:10:18: error: expected ')' before '{' token
10 | }else if(A==B{
| ~ ^
| )
a.cc:15:1: error: expected primary-expression before '}' token
15 | }
| ^
|
s031134575 | p03705 | C++ | /*最小値、最大値の値はわかっている
N = 1の時は例外的(A==B ならば 1, A != B ならば 0)
N > 1の時、 A > B ならば 0, A <= B の時がメイン
A, Bを一つずつ、残りの和の個数を考えると[(N-2)A, (N-2)B]の区間の((A-B)(N-2)個)
取りうる値が区間になることを見越した考察は、より高難易度な問題であっても、すごくたくさん出てくるらしい
A,Bがどのくらい出てくるかなど考えようとしていたが、A,B,Nは非常に大きくなりうるので考察する対象は和くらいしかないことに早く気付くべきだった。
*/
#include <bits/stdc++.h>
using namespace... | a.cc:11:9: error: 'longlong' does not name a type
11 | typedef longlong ll;
| ^~~~~~~~
a.cc: In function 'int main()':
a.cc:13:3: error: 'll' was not declared in this scope
13 | ll N, A, B; cin >> N >> A >> B;
| ^~
a.cc:13:22: error: 'N' was not declared in this scope
13 | ll N, A, B;... |
s963714445 | p03705 | C++ | #include <bits/stdc++.h>
using namespace std;
#define rep(i,N) for(int i=0,i##_max=(N);i<i##_max;++i)
#define repp(i,l,r) for(int i=(l),i##_max=(r);i<i##_max;++i)
#define per(i,N) for(int i=(N)-1;i>=0;--i)
#define perr(i,l,r) for(int i=r-1,i##_min(l);i>=i##_min;--i)
#define all(arr) (arr).begin(), (arr).end()
#define S... | a.cc: In function 'int main()':
a.cc:38:14: error: no matching function for call to 'max(int, ll)'
38 | cout << max(0,e - s + 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,
... |
s880969296 | p03705 | C++ | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define rep(i, j, n) for (ll i = j; i < n; i++)
#define all(x) (x).begin(),(x).end()
#define INF (1000000000)
#define MOD (1000000007)
#define MAX (100000)
#define pii pair<int, int>
/////////////////////////////////////////////////////////
class XY{... | a.cc: In function 'void Main()':
a.cc:59:3: error: expected primary-expression before '}' token
59 | }
| ^
a.cc:58:11: error: expected ';' before '}' token
58 | return
| ^
| ;
59 | }
| ~
a.cc:63:3: error: expected primary-expression before '}' tok... |
s775464219 | p03705 | C++ | #include <bits/stdc++.h>
using namespace std;
const int MOD = 1000000007;
const int INF = 1e9;
//long long
using ll = long long;
//出力系
#define print(x) cout << x << endl
#define yes cout << "Yes" << endl
#define YES cout << "YES" << endl
#define no cout << "No" << endl
#define NO cout << "NO"... | a.cc:65:12: error: extended character − is not valid in an identifier
65 | ans = (B − A) * (N − 2) + 1;
| ^
a.cc:65:22: error: extended character − is not valid in an identifier
65 | ans = (B − A) * (N − 2) + 1;
| ^
a.cc: In function 'int main()':
a.cc:65:11: error:... |
s259935181 | p03705 | C++ | #include <bits/stdc++.h>
using namespace std;
const int MOD = 1000000007;
const int INF = 1e9;
//long long
using ll = long long;
//出力系
#define print(x) cout << x << endl
#define yes cout << "Yes" << endl
#define YES cout << "YES" << endl
#define no cout << "No" << endl
#define NO cout << "NO"... | a.cc:64:16: error: extended character − is not valid in an identifier
64 | int ans = (B − A)(N − 2) + 1;
| ^
a.cc:64:23: error: extended character − is not valid in an identifier
64 | int ans = (B − A)(N − 2) + 1;
| ^
a.cc: In function 'int main()':
a.cc:64:15:... |
s749165868 | p03705 | Java | import java.util.*;
public class Main{
public static void main(String args[]){
Scanner sc = new Scanner(System.in);
int N = sc.nextInt();
int A = sc.nextInt();
int B = sc.nextInt();
sc.close();
if(A>B || (N == 1 && A!=B)
System.out.println(... | Main.java:13: error: ')' expected
if(A>B || (N == 1 && A!=B)
^
1 error
|
s288190074 | p03705 | C++ | #include <bits/stdc++.h>
using namespace std;
int solve()
{
long long n, a, b;
cin >> n >> a >> b;
cout << max((b-a)*(n-2)+1, -9999999999) << endl;
return 0;
}
int main ()
{
solve();
return 0;
}
| a.cc: In function 'int solve()':
a.cc:7:16: error: no matching function for call to 'max(long long int, long int)'
7 | cout << max((b-a)*(n-2)+1, -9999999999) << endl;
| ~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from /usr/include/c++/14/algorithm:60,
from /usr/include/x... |
s600289460 | p03705 | C++ | #include <bits/stdc++.h>
using namespace std;
int solve()
{
long long n, a, b;
cin >> n >> a >> b;
cout << max((b-a)*(n-2)+1, -9999999999) << endl;
return 0;
}
int main ()
{
solve();
return 0;
}
| a.cc: In function 'int solve()':
a.cc:7:16: error: no matching function for call to 'max(long long int, long int)'
7 | cout << max((b-a)*(n-2)+1, -9999999999) << endl;
| ~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from /usr/include/c++/14/algorithm:60,
from /usr/include/x... |
s285542990 | p03705 | C++ | #include <bits/stdc++.h>
using namespace std;
int main ()
{
long long n, a, b;
cin >> n >> a >> b;
cout << max((b-a)*(n-2)+1, -9999999999) << endl;
return 0;
}
| a.cc: In function 'int main()':
a.cc:7:16: error: no matching function for call to 'max(long long int, long int)'
7 | cout << max((b-a)*(n-2)+1, -9999999999) << endl;
| ~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from /usr/include/c++/14/algorithm:60,
from /usr/include/x8... |
s974928478 | p03705 | C++ | #include <iostream>
using namespace std;
int main(){
long long N,A,B;
cin>>N>>A>>B;
if (A>B) count << 0 << endl;
else if (N==1) count <<(A==B ? 1:0) <<endl;
else count <<(N-2)*(B-A)+1 <<endl;
} | a.cc: In function 'int main()':
a.cc:7:12: error: 'count' was not declared in this scope
7 | if (A>B) count << 0 << endl;
| ^~~~~
a.cc:8:18: error: 'count' was not declared in this scope
8 | else if (N==1) count <<(A==B ? 1:0) <<endl;
| ^~~~~
a.cc:9:8: error: 'count' ... |
s520001009 | p03705 | C++ | #include <iostream>
using namespace std;
int main(){
long long N,A,B;
cin>>N>>A>>B;
if (A>B) count << 0 << endl;
else if (N==1) count <<(A==B ? 1:0) <<endl;
else count <<(N-2)*(B-A)+1 <<endl;
} | a.cc: In function 'int main()':
a.cc:7:12: error: 'count' was not declared in this scope
7 | if (A>B) count << 0 << endl;
| ^~~~~
a.cc:8:18: error: 'count' was not declared in this scope
8 | else if (N==1) count <<(A==B ? 1:0) <<endl;
| ^~~~~
a.cc:9:8: error: 'count' ... |
s680797409 | p03705 | C | #include <stdio.h>
#define ll long long
int main()
{
ll a,b,c;
scanf("%lld%lld%lld",&c,&a,&b);
if (c==1)printf("%d",a==b);
else if (a>b)puts("0");
else print("%lld",(b-a)*(c-2)+1);
}
| main.c: In function 'main':
main.c:9:10: error: implicit declaration of function 'print'; did you mean 'printf'? [-Wimplicit-function-declaration]
9 | else print("%lld",(b-a)*(c-2)+1);
| ^~~~~
| printf
|
s611112484 | p03705 | C++ | #include<bits/stdc++.h>
#include <cctype>
#include <cerrno>
#include <cfloat>
#include <ciso646>
#include <climits>
#include <clocale>
#include <cmath>
#include <csetjmp>
#include <csignal>
#include <cstdarg>
#include <cstddef>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <ctime>
#include <cfenv>
#i... | a.cc:57:10: fatal error: windows.h: No such file or directory
57 | #include <windows.h>
| ^~~~~~~~~~~
compilation terminated.
|
s091637495 | p03705 | C++ | #include <cstdio>
#include <iostream>
#include <cmath>
#include <cstring>
#include <sstream>
#include <algorithm>
#include <cstdlib>
#include <map>
#include <queue>
#include <utility>
#include <vector>
#include <set>
#include <memory.h>
#include <iomanip>
#include <bitset>
#include <list>
#include <stack>
#include <deq... | a.cc: In function 'int main()':
a.cc:29:20: error: no matching function for call to 'max(int, long long int)'
29 | cout << max(0, b * (n - 1) + a - (a * (n - 1) + b) + 1) << endl;
| ~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from /usr/include/c++/14/string:51,
... |
s925382956 | p03705 | C++ | #include <bits/stdc++.h>
#define rep(i,n,m) for(int i=n;i<(int)(m);i++)
#define rrep(i,n,m) for(int i=((int)(n)-1);i>=m;i--)
#define all(x) (x).begin(),(x).end()
typedef long long ll;
const int MOD=1000000007;
using namespace std;
int main(){
ll n,a,b;
cin>>n>>a>>b;
cout<<max(0,(b*(n-1)+a)-(a*(n-1)+b)+1)<<e... | a.cc: In function 'int main()':
a.cc:11:14: error: no matching function for call to 'max(int, ll)'
11 | cout<<max(0,(b*(n-1)+a)-(a*(n-1)+b)+1)<<endl;
| ~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from /usr/include/c++/14/algorithm:60,
from /usr/include/x86_64-linux-gnu/c++/... |
s424085418 | p03705 | C++ | #include<bits/stdc++.h>
using namespace std;
int main(){
ll n,a,b;cin>>n>>a>>b;
if(a>b){
cout<<0<<endl;
}else if(a==b){
cout<<1<<endl;
}else{
if(n==1){
if(a!=b)cout<<1<<endl;
else cout<<0<<endl;
}else{
cout<<n*(b-a)+1<<endl;
}
}
return 0;
} | a.cc: In function 'int main()':
a.cc:4:3: error: 'll' was not declared in this scope
4 | ll n,a,b;cin>>n>>a>>b;
| ^~
a.cc:4:17: error: 'n' was not declared in this scope; did you mean 'yn'?
4 | ll n,a,b;cin>>n>>a>>b;
| ^
| yn
a.cc:4:20: error: 'a' was not ... |
s327303402 | p03705 | C++ | #include <vector>
#include <algorithm>
#include <string>
#include <cmath>
#include <numeric>
#include <set>
#include <list>
#include <bitset>
#include <cstdlib>
using namespace std;
int main()
{
long long N, A, B;
cin >> N >> A >> B;
if (A > B)
{
cout << 0 << endl;
}
else if (N == 1)
... | a.cc:11:1: error: extended character is not valid in an identifier
11 |
| ^
a.cc:11:1: error: '\U000000a0' does not name a type
11 |
| ^
|
s374308740 | p03705 | C++ | #include<bits/stdc++.h>
using namespace std;
int main()
{
//freopen("文件名.in","r",stdin);
//freopen("文件名.out","w",stdout);
cin>>n>>a>>b;
cout<<n;
return 0;
}
| a.cc: In function 'int main()':
a.cc:7:14: error: 'n' was not declared in this scope; did you mean 'yn'?
7 | cin>>n>>a>>b;
| ^
| yn
a.cc:7:17: error: 'a' was not declared in this scope
7 | cin>>n>>a>>b;
| ^
a.cc:7:20: error: 'b' was not... |
s748998633 | p03705 | C++ | #include <bitbs/stdc++.h>
using namespace std;
int main()
{
long long n,a,b;
cin>>n>>a>>b;
if(a>b)
cout<<0<<endl;
else
{
if(n==1)
{
if(a==b)
cout<<1<<endl;
else
cout<<0<<endl;
}
else
cout<<(b-... | a.cc:1:10: fatal error: bitbs/stdc++.h: No such file or directory
1 | #include <bitbs/stdc++.h>
| ^~~~~~~~~~~~~~~~
compilation terminated.
|
s972979466 | p03705 | C++ | #include <bits/stdc++.h>
using namespace std;
int main() {
int N,A,B;
cin>>a>>b>>c;
if(N==1&&A!=B)
cout<<0<<endl;
else if (A>B){
cout<<0<<endl;
}
else{
cout<<B*(N-1)+A-A*(N-1)-B+1<<endl;
}
}
| a.cc: In function 'int main()':
a.cc:5:7: error: 'a' was not declared in this scope
5 | cin>>a>>b>>c;
| ^
a.cc:5:10: error: 'b' was not declared in this scope
5 | cin>>a>>b>>c;
| ^
a.cc:5:13: error: 'c' was not declared in this scope
5 | cin>>a>>b>>c;
| ^
|
s618959244 | p03705 | C++ | #include <bits/stdc++.h>
using namespace std;
int main() {
int N,A,B;
cin>>a>>b>>c;
if(N==1&&A!=B)
cout<<0<<endl;
else if (A>B){
cout<<0<<endl;
}
else{
cout<<B*(N-1)+A-A*(N-1)-B+1<<endl;
}
}
| a.cc: In function 'int main()':
a.cc:5:7: error: 'a' was not declared in this scope
5 | cin>>a>>b>>c;
| ^
a.cc:5:10: error: 'b' was not declared in this scope
5 | cin>>a>>b>>c;
| ^
a.cc:5:13: error: 'c' was not declared in this scope
5 | cin>>a>>b>>c;
| ^
|
s261329449 | p03705 | C++ | #include <iostream>
int main(void){
int n, a, b; scanf("%d%d%d", &n, &a, &b);
lli res = 0;
if(n == 1) res = (a == b) ? 1 : 0;
else{
if(a > b) res = 0;
else{
// (n-1)a + b ~ a + (n-1)b => (n-2)(b-a)
res = b - a; res *= n - 2; res++;
}
}
printf("%lld... | a.cc: In function 'int main()':
a.cc:4:5: error: 'lli' was not declared in this scope; did you mean 'lldiv'?
4 | lli res = 0;
| ^~~
| lldiv
a.cc:5:16: error: 'res' was not declared in this scope
5 | if(n == 1) res = (a == b) ? 1 : 0;
| ^~~
a.cc:7:19: error: 'res'... |
s918253441 | p03705 | Java | import java.util.*;
public class Main
{
public static void main(String[] args)
{
Scanner sc = new Scanner(System.in);
long n, a, b;
n = sc.nextLong();
a = sc.nextLong();
b = sc.nextLong();
if (a > b){
System.out.println(0);
Syste... | Main.java:21: error: illegal start of type
}else{
^
Main.java:26: error: class, interface, enum, or record expected
}
^
2 errors
|
s807998824 | p03705 | Java | import java.util.*;
public class Main
{
public static void main(String[] args)
{
Scanner sc = new Scanner(System.in);
long n, a, b;
n = sc.nextLong();
a = sc.nextLong();
b = sc.nextLong();
if (a > b){
System.out.println(0);
Syste... | Main.java:21: error: 'else' without 'if'
else{
^
Main.java:30: error: reached end of file while parsing
}
^
2 errors
|
s866607608 | p03705 | C++ | #include<bits/stdc++.h>
using namespace std;
int main(){
double N;
long long A, B; cin >> N >> A >> B;
else if(A > B)cout << 0 << endl;
else if(A == B)cout << 1 << endl;
else{
if(N < 2)cout << 0 << endl;
if(N < 3)cout << 1 << endl;
else cout << (N - 1) * (B - A) + A - B + 1 << endl;
}
return 0... | a.cc: In function 'int main()':
a.cc:6:3: error: 'else' without a previous 'if'
6 | else if(A > B)cout << 0 << endl;
| ^~~~
|
s591690222 | p03705 | C++ | #include <iostream>
using namespace std;
int main() {
long long n, a, b;
cin >> n >> a >> b;
if (a > b) cout << 0 << endl;
else if (n == 1) cout << a == b << endl;
else cout << (b - a) * (n - 2) + 1 << endl;
return 0;
} | a.cc: In function 'int main()':
a.cc:7:41: error: invalid operands of types 'long long int' and '<unresolved overloaded function type>' to binary 'operator<<'
7 | else if (n == 1) cout << a == b << endl;
| ~~^~~~~~~
|
s639925144 | p03705 | C++ | #include<bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<int,int>P;
#define INF 2<<29
#define F first
#define S second
int main(){
ll n,a,b;
ll ans;
scanf("%lld %lld %lld",&n,&a,&b);
ans=(a+b*(n-1))-(a*(n-1)+b)+1;
printf("%lld\n",max(ans,0));
return (0);
}
| a.cc: In function 'int main()':
a.cc:19:22: error: no matching function for call to 'max(ll&, int)'
19 | printf("%lld\n",max(ans,0));
| ~~~^~~~~~~
In file included from /usr/include/c++/14/algorithm:60,
from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:51,
... |
s656650518 | p03705 | C++ | #include <bits/stdc++.h>
#define DUMP(x) cout << #x << " = " << (x) << endl;
#define FOR(i, m, n) for(int i = m; i < n; i++)
#define IFOR(i, m, n) for(int i = n - 1; i >= m; i-- )
#define REP(i, n) FOR(i,0,n)
#define IREP(i, n) IFOR(i,0,n)
#define FOREACH(x,a) for(auto& (x) : (a) )
#define ALL(v) (v).begin(), (v).end(... | a.cc: In function 'int main()':
a.cc:17:30: error: expected ';' before '{' token
17 | if(A > B || (N==1 && A < B){
| ^
| ;
a.cc:22:27: error: expected ')' before ';' token
22 | ll ans = (B-A)*(N-2) + 1;
| ^
... |
s196418819 | p03705 | C++ | #include<bits/stdc++.h>
using namespace std;
int main(){
ios::sync_with_stdio(false);
cin.tie(0);
cout.tie(0);
int n,a,b;
cin>>n>>a>>b;
cout<<max(0ll,(n-1)*b+a-(n-1)*a-b+1)<<endl;
} | a.cc: In function 'int main()':
a.cc:9:14: error: no matching function for call to 'max(long long int, int)'
9 | cout<<max(0ll,(n-1)*b+a-(n-1)*a-b+1)<<endl;
| ~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from /usr/include/c++/14/algorithm:60,
from /usr/include/x86_64-linux-gn... |
s036824398 | p03705 | C++ | #include<bits/stdc++.h>
using namespace std;
int main(){
ios::sync_with_stdio(false);
cin.tie(0);
cout.tie(0);
long long n,a,b;
cin>>n>>a>>b;
cout<<max(0,(n-1)*b+a-(n-1)*a-b+1)<<endl;
} | a.cc: In function 'int main()':
a.cc:9:14: error: no matching function for call to 'max(int, long long int)'
9 | cout<<max(0,(n-1)*b+a-(n-1)*a-b+1)<<endl;
| ~~~^~~~~~~~~~~~~~~~~~~~~~~~~
In file included from /usr/include/c++/14/algorithm:60,
from /usr/include/x86_64-linux-gnu/c+... |
s178452573 | p03705 | C++ | #include <bits/stdc++.h>
using namespace std;
int main(){
long long n, a, b;
cin >> n >> a >> b;
if(n == 1 && a != b){
cout << 0;
}else if(a > b){
cout << 0;
}else{
cout << max(((long long)0, (b-a)*(n-1)+1);
}
return 0;
} | a.cc: In function 'int main()':
a.cc:12:50: error: expected ')' before ';' token
12 | cout << max(((long long)0, (b-a)*(n-1)+1);
| ~ ^
| )
|
s269986517 | p03705 | C++ | #include <iostream>
#include <cmath>
using namespace std;
int main(){
int n,a,b;cin>>n>>a>>b;
if(n == 1 && a != b){
cout << 0 << endl;
return 0;
}
if(n < 3){
cout << 1 << endl;
return 0;
}
long long ans = (long long)(n-2)*b - (n-2)*a + 1;
cout << max(0,ans) << endl;
} | a.cc: In function 'int main()':
a.cc:15:14: error: no matching function for call to 'max(int, long long int&)'
15 | cout << max(0,ans) << endl;
| ~~~^~~~~~~
In file included from /usr/include/c++/14/string:51,
from /usr/include/c++/14/bits/locale_classes.h:40,
from... |
s689255547 | p03705 | C++ | #include <iostream>
#include <cmath>
using namespace std;
int main(){
int n,a,b;cin>>n>>a>>b;
if(n == 1 && a != b){
cout << 0 << endl;
return 0;
}
if(n < 3){
cout << 1 << endl;
return 0;
}
cout << max(0,(long long)(n-2)*b - (n-2)*a + 1) << endl;
} | a.cc: In function 'int main()':
a.cc:14:14: error: no matching function for call to 'max(int, long long int)'
14 | cout << max(0,(long long)(n-2)*b - (n-2)*a + 1) << endl;
| ~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from /usr/include/c++/14/string:51,
from /usr/inclu... |
s247304649 | p03705 | C++ | #include <iostream>
using namespace std;
int main(void){
int N,A,B;
cin >> N >> A >> B;
int sum_min = 0;
int sum_max = 0;
if(A > B)
cout << 0 << endl;
else if(N == 1 && A != B))
cout << 0 << endl;
else if(N == 2 && A != B){
cout << 1 << endl;
}
else{
sum_min = A * (N - 1) + B;
... | a.cc: In function 'int main()':
a.cc:12:28: error: expected primary-expression before ')' token
12 | else if(N == 1 && A != B))
| ^
|
s272029629 | p03705 | C++ | #include <iostream>
using nemspace std;
int main(void){
int N,A,B;
cin >> N >> A >> B;
int sum_min = 0;
int sum_max = 0;
if(A > B || (N == 1 && A != B))
cout << 0 << endl;
else{
sum_min = A * (N - 1) + B;
sum_max = A + (N - 1) * B;
cout << sum_max - sum_min + 1 << endl;
}
r... | a.cc:2:7: error: expected nested-name-specifier before 'nemspace'
2 | using nemspace std;
| ^~~~~~~~
a.cc: In function 'int main()':
a.cc:5:3: error: 'cin' was not declared in this scope; did you mean 'std::cin'?
5 | cin >> N >> A >> B;
| ^~~
| std::cin
In file included from a.cc:1... |
s256522541 | p03705 | C++ | #include<iostream>
#include<vector>
using namespace std;
const int INF = 1<<30;
typedef long long int ll;
int main(){
int n, a, b;cin>>n>>a>>b;
if(n<=0)cout<<0<<endl;
else if(n==1)cout<<(a==b?1:0)<<endl;
else cout<(n-2)*(b-a)+1<<endl;
}
| a.cc: In function 'int main()':
a.cc:12:26: error: invalid operands of types 'int' and '<unresolved overloaded function type>' to binary 'operator<<'
12 | else cout<(n-2)*(b-a)+1<<endl;
| ~~~~~~~~~~~~~^~~~~~
|
s927036061 | p03705 | C++ | #include <bits/stdc++.h>
using namespace std;
int main () {
int n, a, b;
cin >> n >> a >> b;
if (n==1&&a==b)
cout << 1 << endl;
else if ((n==1&&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:12:18: error: expression cannot be used as a function
12 | cout << (b-a)(n-2) + 1 << endl;
| ~~~~~^~~~~
|
s317002159 | p03705 | C++ | #include <bits/stdc++.h>
using namespace std;
int main () {
int n, a, b:
cin >> n >> a >> b;
if (n==1&&a==b)
cout << 1 << endl;
else if ((n==1&&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:5:14: error: found ':' in nested-name-specifier, expected '::'
5 | int n, a, b:
| ^
| ::
a.cc:5:13: error: 'b' has not been declared
5 | int n, a, b:
| ^
a.cc:6:7: error: qualified-id in declaration before '>>' toke... |
s853747763 | p03705 | C++ | #include<bits/stdc++.h>
using namespace std;
int main(){
int n,a,b;
cin >> n >> a >> b;
if(a>b){
cout << 0 << endl;
return 0;
}
else if(n==1&&a!=b){
cout << 0 << endl;
return 0;
}
else if(n==1&&a==b){
cout << 1 << endl;
return 0;
}
else{
ll ans = (b-a)*(n-2)+1;
cout <<... | a.cc: In function 'int main()':
a.cc:20:5: error: 'll' was not declared in this scope
20 | ll ans = (b-a)*(n-2)+1;
| ^~
a.cc:21:13: error: 'ans' was not declared in this scope; did you mean 'abs'?
21 | cout << ans << endl;
| ^~~
| abs
|
s519045265 | p03705 | C++ | #include<iostream>
#include<string>
#include<algorithm>
#include<vector>
#include<iomanip>
#include<math.h>
#include<complex>
#include<queue>
#include<deque>
#include<stack>
#include<map>
#include<set>
#include<bitset>
using namespace std;
#define REP(i,m,n) for(int i=(int)m ; i < (int) n ; ++i )
#define rep(i,n) REP(i... | a.cc: In function 'int main()':
a.cc:27:35: error: expected ';' before ')' token
27 | cout << max((ll)0,(n-2)*(b-a)+1)) << endl;
| ^
| ;
|
s846821251 | p03705 | C++ | #include<iostream>
#include<string>
#include<algorithm>
#include<vector>
#include<iomanip>
#include<math.h>
#include<complex>
#include<queue>
#include<deque>
#include<stack>
#include<map>
#include<set>
#include<bitset>
using namespace std;
#define REP(i,m,n) for(int i=(int)m ; i < (int) n ; ++i )
#define rep(i,n) REP(i... | a.cc: In function 'int main()':
a.cc:27:14: error: no matching function for call to 'max(int, ll)'
27 | cout << max(0,(n-2)*(b-a)+1)) << endl;
| ~~~^~~~~~~~~~~~~~~~~
In file included from /usr/include/c++/14/string:51,
from /usr/include/c++/14/bits/locale_classes.h:40,
... |
s640283406 | p03705 | C++ | #include<iostream>
#include<string>
#include<algorithm>
#include<vector>
#include<iomanip>
#include<math.h>
#include<complex>
#include<queue>
#include<deque>
#include<stack>
#include<map>
#include<set>
#include<bitset>
using namespace std;
#define REP(i,m,n) for(int i=(int)m ; i < (int) n ; ++i )
#define rep(i,n) REP(i... | a.cc: In function 'int main()':
a.cc:27:14: error: no matching function for call to 'max(int, ll)'
27 | cout << max(0,(n-2)*(b-a)+1) << endl;
| ~~~^~~~~~~~~~~~~~~~~
In file included from /usr/include/c++/14/string:51,
from /usr/include/c++/14/bits/locale_classes.h:40,
... |
s784280750 | p03705 | C++ | #include<bits/stdc++.h>
using namespace std;
int main(){
long long n,a,b;
cin>>n>>a>>b;
cout<<max(0,(b-a)*(n-2)+1)<<endl;
}
| a.cc: In function 'int main()':
a.cc:6:18: error: no matching function for call to 'max(int, long long int)'
6 | cout<<max(0,(b-a)*(n-2)+1)<<endl;
| ~~~^~~~~~~~~~~~~~~~~
In file included from /usr/include/c++/14/algorithm:60,
from /usr/include/x86_64-linux-gnu/c++/14/bit... |
s129406015 | p03705 | C++ | #include<bits/stdc++.h>
using namespace std;
int main(){
int n,a,b;
cin>>n>>a>>b;
cout<<max(0,(long long)(b-a)*(n-2)+1)<<endl;
}
| a.cc: In function 'int main()':
a.cc:6:18: error: no matching function for call to 'max(int, long long int)'
6 | cout<<max(0,(long long)(b-a)*(n-2)+1)<<endl;
| ~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from /usr/include/c++/14/algorithm:60,
from /usr/include/x86_6... |
s099312462 | p03705 | C++ | #include<bits/stdc++.h>
using namespace std;
int main(){
int n,a,b;
cin>>n>>a>>b;
cout<<max(0,long long(b-a)*(n-2)+1)<<endl;
}
| a.cc: In function 'int main()':
a.cc:6:21: error: expected primary-expression before 'long'
6 | cout<<max(0,long long(b-a)*(n-2)+1)<<endl;
| ^~~~
|
s713350849 | p03705 | C++ | #include <bits/stdc++.h>
using namespace std;
long int main(){
int N,A,B;
cin>>N>>A>>B;
if(A>B){
cout<<0<<endl;
}
else if(A==B&&N==1){
cout<<1<<endl;
}
else if(N==1&&B>A){
cout<<0<<endl;
}
else if(B>=A&&N>=2){
cout<<(B-A)*(N-2)+1<<endl;
}
} | a.cc:4:6: error: '::main' must return 'int'
4 | long int main(){
| ^~~
|
s865118476 | p03705 | C++ | #include<iostream>
using namespace std;
int main(){
long long int n,a,b;
cin>>n>>a>>b;
b=b-a;
a=0;
cout<<max((ll)0,b*(n-1)+a-(a*(n-1)+b)+1)<<endl;
return 0;
}
| a.cc: In function 'int main()':
a.cc:10:15: error: 'll' was not declared in this scope
10 | cout<<max((ll)0,b*(n-1)+a-(a*(n-1)+b)+1)<<endl;
| ^~
|
s924152656 | p03705 | C++ | #include <bits/stdc++.h>
using namespace std;
int main(){
int N,a,b;
cin >> N;
cin >> a;
cin >> b;
if(N == 1 && a != b) || a > b ){
cout << 0 << endl;
}
else if((N == 1 && a == b) || N == 2 || a == b){
cout << 1 << endl;
}
else {
cout << (N - 2) * (b - a) + 1 << endl;
}
} | a.cc: In function 'int main()':
a.cc:9:24: error: expected primary-expression before '||' token
9 | if(N == 1 && a != b) || a > b ){
| ^~
|
s737262315 | p03705 | C++ | #include<iostream>
using namespace std;
int main(){
long long int a,b;
cin>>a>>b;
b=b-a;
a=0;
if(b<0){
cout<<0<<endl;
}else if(b==0){
cout<<1<<endl;
}else{
cout<<b*n-a*n-3<<endl;
}
return 0;
}
| a.cc: In function 'int main()':
a.cc:15:13: error: 'n' was not declared in this scope
15 | cout<<b*n-a*n-3<<endl;
| ^
|
s092823557 | p03705 | C++ |
#include<iostream>
using namespace std;
int main(){
long long int a,b;
cin>>a>>b;
b=b-a;
if(b<0){
cout<<0<<endl;
}else if(a==b){
cout<<1<<endl;
}else{
cout<<a*n-b*n-3<<endl;
}
return 0;
}
| a.cc: In function 'int main()':
a.cc:15:13: error: 'n' was not declared in this scope
15 | cout<<a*n-b*n-3<<endl;
| ^
|
s564410973 | p03705 | C++ | #include <bits/stdc++.h>
#define fi first
#define se second
#define rep(i,n) for(int i = 0; i < (n); ++i)
#define rep2(j,n) for(int j = 0; j < (n); ++j)
#define rrep(i,n) for(int i = 1; i <= (n); ++i)
#define drep(i,n) for(int i = (n)-1; i >= 0; --i)
#define drep2(j,n) for(int j = (n)-1; j >= 0; --j)
#define srep(i,s,t... | a.cc: In function 'int main()':
a.cc:53:14: error: no matching function for call to 'max(int, ll)'
53 | cout << max(0,maxnum - minnum + 1) << endl;
| ~~~^~~~~~~~~~~~~~~~~~~~~~~
In file included from /usr/include/c++/14/algorithm:60,
from /usr/include/x86_64-linux-gnu/c++/14/bits/st... |
s861068713 | p03705 | C++ | #include <iostream>
#include <cstdlib>
int main(){
int N,A,B;
cin>>N>>A>>B;
cout<<(B-A)*(N-2)+1<<endl;
} | a.cc: In function 'int main()':
a.cc:6:5: 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; ///< Lin... |
s368322060 | p03705 | C++ | #include <bits/stdc++.h>
using namespace std;
int main() {
long long N, A, B;
cin >> N >> A >> B;
long long mins = A + B + (N - 2) * A;
long long maxs = A + B + (N - 2) * B;
cout << max(0, maxs - mins + 1) << endl;
} | a.cc: In function 'int main()':
a.cc:11:14: error: no matching function for call to 'max(int, long long int)'
11 | cout << max(0, maxs - mins + 1) << endl;
| ~~~^~~~~~~~~~~~~~~~~~~~
In file included from /usr/include/c++/14/algorithm:60,
from /usr/include/x86_64-linux-gnu/c++/14/bi... |
s004307935 | p03705 | C++ | #include <iostream>
using namespace std;
#define rep(i,n) for(int i = 0;i<n;i++)
int main(){
long long n,a,b;
cin >> n >> a >> b;
if(b>=a){
cout << (b-a)*max(0,(n-2))+1 << endl;
}else{
cout << 0 << endl;
}
} | a.cc: In function 'int main()':
a.cc:8:26: error: no matching function for call to 'max(int, long long int)'
8 | cout << (b-a)*max(0,(n-2))+1 << endl;
| ~~~^~~~~~~~~
In file included from /usr/include/c++/14/string:51,
from /usr/include/c++/14/bits/locale_classes... |
s324999519 | p03705 | Java | import java.util.Scanner;
public class solution{
public static void main(String[] args){
Scanner sc=new Scanner(System.in);
int n=sc.nextInt();
int a=sc.nextInt();
int b=sc.nextInt();
if(a>b){
System.out.println(0);
return;}
if(n==1 && a<b){
System.out.println(0);
return;... | Main.java:2: error: class solution is public, should be declared in a file named solution.java
public class solution{
^
1 error
|
s218656914 | p03705 | Java | import java.util.*;
import java.io.*;
public class find_sum
{
public static void main(String[] args) {
Scanner sc=new Scanner(System.in);
int n=sc.nextInt();
int a=sc.nextInt();
int b=sc.nextInt();
if(a>b)
{
System.out.println(0);
}
else if(n==1&&a<b)
{
System.out.println(0);
}
else
{
... | Main.java:3: error: class find_sum is public, should be declared in a file named find_sum.java
public class find_sum
^
1 error
|
s904472206 | p03705 | C | #include<stdio.h>
int n, a, b;
long answer;
int main(){
scanf("%d%d%d", &n ,&a, &b);
ans = ((long)n-2)*(b-a)+1;
printf("%ld\n", ans>=0?ans:0);
}
| main.c: In function 'main':
main.c:6:3: error: 'ans' undeclared (first use in this function)
6 | ans = ((long)n-2)*(b-a)+1;
| ^~~
main.c:6:3: note: each undeclared identifier is reported only once for each function it appears in
|
s410113664 | p03705 | C++ | #include<cstdio>
using namespace std;
typedef long long LL;
LL N,A,B;
int main(){
scanf("%lld%lld%lld",&N,&A,&B);
if(A>B || B<=0){
printf("0");
}else{
LL min=(N-1)*A+B,max=(N-1)*B+A;
printf("%d",)
}
} | a.cc: In function 'int main()':
a.cc:12:29: error: expected primary-expression before ')' token
12 | printf("%d",)
| ^
|
s010853662 | p03705 | C++ | #include <iostream>
#include<stdio.h>
#define MAXSIZE 10001
#include<set>
using namespace std;
void DFS(int pre, int i);
int n, min, max;
set<int>s;
int main()
{
scanf("%d%d%d", &n,&min, &max);
DFS(0, 0);
printf("%d",s.size());
return 0;
}
void DFS(int pre,int i)
{
if (i > n - 2)return;
if (i == n - 2)
{
... | a.cc: In function 'int main()':
a.cc:13:29: error: reference to 'min' is ambiguous
13 | scanf("%d%d%d", &n,&min, &max);
| ^~~
In file included from /usr/include/c++/14/string:51,
from /usr/include/c++/14/bits/locale_classes.h:40,
from /usr/i... |
s315274317 | p03705 | C++ | #include<stdio.h>
int main()
{
int n,a,b;
scanf("%d %d %d",&n,&a,&b);
lomg long min=a * ( n - 1 ) + b ;
long long max = a + ( n - 1 ) * b;
if(n == 1 ){
if( a == b)
printf("1");
else
printf("0");
}
else{
if(a > b )
printf("0");
else
... | a.cc: In function 'int main()':
a.cc:7:4: error: 'lomg' was not declared in this scope; did you mean 'long'?
7 | lomg long min=a * ( n - 1 ) + b ;
| ^~~~
| long
a.cc:19:41: error: 'min' was not declared in this scope; did you mean 'main'?
19 | printf("%lld",(long long)max - min + 1)... |
s132142747 | p03705 | Java | import java.util.Scanner;
public class Another {
public static void main(String[] args) {
Scanner scanner = new Scanner(System.in);
int N, A, B;
N = scanner.nextInt();
A = scanner.nextInt();
B = scanner.nextInt();
if ( B - A < 0) { // 2 4 10 与 1 7 10 这种情况不同,在只有1节的情况... | Main.java:3: error: class Another is public, should be declared in a file named Another.java
public class Another {
^
1 error
|
s245841037 | 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 )(B-A)*(N-2)+1);
}
... | main.c:1:10: fatal error: cstdio: No such file or directory
1 | #include <cstdio>
| ^~~~~~~~
compilation terminated.
|
s070675335 | p03705 | Java | import java.util.Scanner;
public class Another {
public static void main(String[] args) {
Scanner scanner = new Scanner(System.in);
int N, A, B;
N = scanner.nextInt();
A = scanner.nextInt();
B = scanner.nextInt();
if (B - A + 1 > N || B - A < 0) {
System... | Main.java:3: error: class Another is public, should be declared in a file named Another.java
public class Another {
^
1 error
|
s292438090 | p03705 | C | #include <stdio.h>
#include <stdlib.h>
#include <math.h>
int main()
{
long int n,k,t,min,max;
scanf("%1d %1d %1d",&n,&k,&t);
if(k>t||n<1||(n==1&&k!=t)||k>1000000000||t>1000000000||n>1000000000)
{
printf("0\n");
}
else
{
max=(n-1)*t+k;
min =(n-1)*k+t;
printf("%1d\n",max-min+1);
return 0;
} | main.c: In function 'main':
main.c:19:1: error: expected declaration or statement at end of input
19 | }
| ^
|
s595172466 | p03705 | C | #include <stdio.h>
#include <stdlib.h>
#include <math.h>
int main()
{
long int n,k,t,min,max;
scanf("%ld %ld %ld",&n,&k,&t);
if(n<1||k>1000000000||t>1000000000||n>1000000000)
{
printf("0\n");
}
if(k>=t||(n==1&&k!=t))
{
printf("0\n");
}
else
{
max=(n-1)*t+k;
min =(n-1)*k+t;
printf("%ld\n"... | main.c: In function 'main':
main.c:24:1: error: expected declaration or statement at end of input
24 | }
| ^
|
s117437960 | p03705 | C | #include<vector>
#include<cmath>
#include<map>
#include<cstdlib>
#include<iostream>
#include<sstream>
#include<fstream>
#include<string>
#include<algorithm>
#include<cstring>
#include<cstdio>
#include<set>
#include<stack>
#include<bitset>
#include<functional>
#include<ctime>
#include<queue>
#include<deque>
#include<com... | main.c:1:9: fatal error: vector: No such file or directory
1 | #include<vector>
| ^~~~~~~~
compilation terminated.
|
s572283090 | p03705 | C++ | #include <cstdio>
int main()
{
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;
... | a.cc: In function 'int main()':
a.cc:16:12: error: 'A' was not declared in this scope
16 | if(A>B) printf("0\n");
| ^
a.cc:16:14: error: 'B' was not declared in this scope
16 | if(A>B) printf("0\n");
| ^
|
s718243942 | p03705 | C++ | #include <cstdio>
int main()
{
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;
... | a.cc: In function 'int main()':
a.cc:16:12: error: 'A' was not declared in this scope
16 | if(A>B) printf("0\n");
| ^
a.cc:16:14: error: 'B' was not declared in this scope
16 | if(A>B) printf("0\n");
| ^
|
s027232329 | 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
{
if(a > b)
cout << "0";
else
{
long long int min = (n - 1) * a + b;
long long int max = (n - 1) * b + a;
long long int i = max - min +... | a.cc: In function 'int main()':
a.cc:26:25: error: expected ',' or ';' before 'cout'
26 | cout << i;
| ^~~~
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.