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>
#include <map>
#include <unordered_map>
#include <queue>
#include <regex>
#include <functional>
#include <complex>
#include <list>
#include <cassert>
#include <iomanip>
#include <set>
#define rep(i, n) for(int i = 0; i < (n); ++i)
#define rep1(i, n) for(int i = 1; i <= (n); ++i)
#define rep2(i, n) for(int i = 2; i < (n); ++i)
#define repr(i, n) for(int i = n; i >= 0; --i)
#define reprm(i, n) for(int i = n - 1; i >= 0; --i)
#define printynl(a) printf(a ? "yes\n" : "no\n")
#define printyn(a) printf(a ? "Yes\n" : "No\n")
#define printYN(a) printf(a ? "YES\n" : "NO\n")
#define printim(a) printf(a ? "possible\n" : "imposible\n")
#define printdb(a) printf("%.50lf\n", a)//少数出力
#define printdbd(a) printf("%.16lf\n", a)//少数出力(桁少なめ)
#define prints(s) printf("%s\n", s.c_str())//string出力
#define all(x) (x).begin(), (x).end()
#define allsum(a, b, c) ((a + b) * c / 2)//等差数列の和、初項,末項,項数
#define pb push_back
#define priq priority_queue
#define rpriq priq<int, vector<int>, greater<int>>
#define deg_to_rad(deg) (((deg)/360.0)*2.0*PI)
#define rad_to_deg(rad) (((rad)/2.0/PI)*360.0)
#define Please return
#define AC 0
#define addf(T) [](T a, T b){return (a + b);}
#define minf(T) [](T a, T b){return min(a, b);}
#define maxf(T) [](T a, T b){return max(a, b);}
using ll = long long;
constexpr int INF = 1073741823;
constexpr int MINF = -1073741823;
constexpr ll LINF = ll(4661686018427387903);
constexpr ll MOD = 1000000007;
const long double PI = acos(-1.0L);
using namespace std;
void scans(string& str) {
char c;
str = "";
scanf("%c", &c);
if (c == '\n')scanf("%c", &c);
while (c != '\n' && c != -1) {
str += c;
scanf("%c", &c);
}
}
void scanc(char& str) {
char c;
scanf("%c", &c);
if (c == -1)return;
while (c == '\n') {
scanf("%c", &c);
}
str = c;
}
double acot(double x) {
return PI / 2 - atan(x);
}
ll gcd(ll a, ll b) {
if (b == 0) return a;
return gcd(b, a % b);
}
ll lcm(ll number1, ll number2) {
return number1 / gcd(number1, number2) * number2;
}
ll LSB(ll n) { return (n & (-n)); }
/*-----------------------------------------ここからコード-----------------------------------------*/
int main() {
int n, a, b;
scanf("%d%d%d", &n, &a, &b);
ll ans = 0;
if(n == 2 || a == b)ans = 1;
else if(a > b)ans = 0;
else ans = (b - a)(n - 2) + 1;
printf("%lld\n", ans);
Please AC;
}
| 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>
#include <map>
#include <unordered_map>
#include <queue>
#include <regex>
#include <functional>
#include <complex>
#include <list>
#include <cassert>
#include <iomanip>
#include <set>
#define rep(i, n) for(int i = 0; i < (n); ++i)
#define rep1(i, n) for(int i = 1; i <= (n); ++i)
#define rep2(i, n) for(int i = 2; i < (n); ++i)
#define repr(i, n) for(int i = n; i >= 0; --i)
#define reprm(i, n) for(int i = n - 1; i >= 0; --i)
#define printynl(a) printf(a ? "yes\n" : "no\n")
#define printyn(a) printf(a ? "Yes\n" : "No\n")
#define printYN(a) printf(a ? "YES\n" : "NO\n")
#define printim(a) printf(a ? "possible\n" : "imposible\n")
#define printdb(a) printf("%.50lf\n", a)//少数出力
#define printdbd(a) printf("%.16lf\n", a)//少数出力(桁少なめ)
#define prints(s) printf("%s\n", s.c_str())//string出力
#define all(x) (x).begin(), (x).end()
#define allsum(a, b, c) ((a + b) * c / 2)//等差数列の和、初項,末項,項数
#define pb push_back
#define priq priority_queue
#define rpriq priq<int, vector<int>, greater<int>>
#define deg_to_rad(deg) (((deg)/360.0)*2.0*PI)
#define rad_to_deg(rad) (((rad)/2.0/PI)*360.0)
#define Please return
#define AC 0
#define addf(T) [](T a, T b){return (a + b);}
#define minf(T) [](T a, T b){return min(a, b);}
#define maxf(T) [](T a, T b){return max(a, b);}
using ll = long long;
constexpr int INF = 1073741823;
constexpr int MINF = -1073741823;
constexpr ll LINF = ll(4661686018427387903);
constexpr ll MOD = 1000000007;
const long double PI = acos(-1.0L);
using namespace std;
void scans(string& str) {
char c;
str = "";
scanf("%c", &c);
if (c == '\n')scanf("%c", &c);
while (c != '\n' && c != -1) {
str += c;
scanf("%c", &c);
}
}
void scanc(char& str) {
char c;
scanf("%c", &c);
if (c == -1)return;
while (c == '\n') {
scanf("%c", &c);
}
str = c;
}
double acot(double x) {
return PI / 2 - atan(x);
}
ll gcd(ll a, ll b) {
if (b == 0) return a;
return gcd(b, a % b);
}
ll lcm(ll number1, ll number2) {
return number1 / gcd(number1, number2) * number2;
}
ll LSB(ll n) { return (n & (-n)); }
/*-----------------------------------------ここからコード-----------------------------------------*/
int main() {
ll n, a, b;
scanf("%lld%lld%lld", &n, &a, &b);
ll ans = 0;
rep(i, n - 2){
ans += max(0, b - a + 1 - i);
}
if(n == 2 || a == b)ans = 1;
printf("%lld\n", ans);
Please AC;
}
| 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/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:114:27: note: deduced conflicting types for parameter 'const _Tp' ('int' and 'll' {aka 'long long int'})
114 | ans += max(0, b - a + 1 - i);
| ~~~^~~~~~~~~~~~~~~~~~
/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:114:27: note: mismatched types 'std::initializer_list<_Tp>' and 'int'
114 | ans += max(0, b - a + 1 - i);
| ~~~^~~~~~~~~~~~~~~~~~
|
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
| std::basic_ostream<char>
a.cc:7:30: note: candidate: 'operator==(int, int)' (built-in)
7 | if(a>b||n==1) cout<<a==b;
| ~~~~~~~^~~
a.cc:7:30: note: no known conversion for argument 1 from 'std::basic_ostream<char>' to 'int'
In file included from /usr/include/c++/14/regex:68,
from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:181,
from a.cc:1:
/usr/include/c++/14/bits/regex.h:1103:5: note: candidate: 'template<class _BiIter> bool std::__cxx11::operator==(const sub_match<_BiIter>&, const sub_match<_BiIter>&)'
1103 | operator==(const sub_match<_BiIter>& __lhs, const sub_match<_BiIter>& __rhs)
| ^~~~~~~~
/usr/include/c++/14/bits/regex.h:1103:5: note: template argument deduction/substitution failed:
a.cc:7:32: note: 'std::basic_ostream<char>' is not derived from 'const std::__cxx11::sub_match<_BiIter>'
7 | if(a>b||n==1) cout<<a==b;
| ^
/usr/include/c++/14/bits/regex.h:1199:5: note: candidate: 'template<class _Bi_iter, class _Ch_traits, class _Ch_alloc> bool std::__cxx11::operator==(__sub_match_string<_Bi_iter, _Ch_traits, _Ch_alloc>&, const sub_match<_BiIter>&)'
1199 | operator==(const __sub_match_string<_Bi_iter, _Ch_traits, _Ch_alloc>& __lhs,
| ^~~~~~~~
/usr/include/c++/14/bits/regex.h:1199:5: note: template argument deduction/substitution failed:
a.cc:7:32: note: 'std::basic_ostream<char>' is not derived from 'std::__cxx11::__sub_match_string<_Bi_iter, _Ch_traits, _Ch_alloc>'
7 | if(a>b||n==1) cout<<a==b;
| ^
/usr/include/c++/14/bits/regex.h:1274:5: note: candidate: 'template<class _Bi_iter, class _Ch_traits, class _Ch_alloc> bool std::__cxx11::operator==(const sub_match<_BiIter>&, __sub_match_string<_Bi_iter, _Ch_traits, _Ch_alloc>&)'
1274 | operator==(const sub_match<_Bi_iter>& __lhs,
| ^~~~~~~~
/usr/include/c++/14/bits/regex.h:1274:5: note: template argument deduction/substitution failed:
a.cc:7:32: note: 'std::basic_ostream<char>' is not derived from 'const std::__cxx11::sub_match<_BiIter>'
7 | if(a>b||n==1) cout<<a==b;
| ^
/usr/include/c++/14/bits/regex.h:1366:5: note: candidate: 'template<class _Bi_iter> bool std::__cxx11::operator==(const typename std::iterator_traits<_Iter>::value_type*, const sub_match<_BiIter>&)'
1366 | operator==(typename iterator_traits<_Bi_iter>::value_type const* __lhs,
| ^~~~~~~~
/usr/include/c++/14/bits/regex.h:1366:5: note: template argument deduction/substitution failed:
a.cc:7:32: note: mismatched types 'const std::__cxx11::sub_match<_BiIter>' and 'int'
7 | if(a>b||n==1) cout<<a==b;
| ^
/usr/include/c++/14/bits/regex.h:1441:5: note: candidate: 'template<class _Bi_iter> bool std::__cxx11::operator==(const sub_match<_BiIter>&, const typename std::iterator_traits<_Iter>::value_type*)'
1441 | operator==(const sub_match<_Bi_iter>& __lhs,
| ^~~~~~~~
/usr/include/c++/14/bits/regex.h:1441:5: note: template argument deduction/substitution failed:
a.cc:7:32: note: 'std::basic_ostream<char>' is not derived from 'const std::__cxx11::sub_match<_BiIter>'
7 | if(a>b||n==1) cout<<a==b;
| ^
/usr/include/c++/14/bits/regex.h:1534:5: note: candidate: 'template<class _Bi_iter> bool std::__cxx11::operator==(const typename std::iterator_traits<_Iter>::value_type&, const sub_match<_BiIter>&)'
1534 | operator==(typename iterator_traits<_Bi_iter>::value_type const& __lhs,
| ^~~~~~~~
/usr/include/c++/14/bits/regex.h:1534:5: note: template argument deduction/substitution failed:
a.cc:7:32: note: mismatched types 'const std::__cxx11::sub_match<_BiIter>' and 'int'
7 | if(a>b||n==1) cout<<a==b;
| ^
/usr/include/c++/14/bits/regex.h:1613:5: note: candidate: 'template<class _Bi_iter> bool std::__cxx11::operator==(const sub_match<_BiIter>&, const typename std::iterator_traits<_Iter>::value_type&)'
1613 | operator==(const sub_match<_Bi_iter>& __lhs,
| ^~~~~~~~
/usr/include/c++/14/bits/regex.h:1613:5: note: template argument deduction/substitution failed:
a.cc:7:32: note: 'std::basic_ostream<char>' is not derived from 'const std::__cxx11::sub_match<_BiIter>'
7 | if(a>b||n==1) cout<<a==b;
| ^
/usr/include/c++/14/bits/regex.h:2186:5: note: candidate: 'template<class _Bi_iter, class _Alloc> bool std::__cxx11::operator==(const match_results<_BiIter, _Alloc>&, const match_results<_BiIter, _Alloc>&)'
2186 | operator==(const match_results<_Bi_iter, _Alloc>& __m1,
| ^~~~~~~~
/usr/include/c++/14/bits/regex.h:2186:5: note: template argument deduction/substitution failed:
a.cc:7:32: note: 'std::basic_ostream<char>' is not derived from 'const std::__cxx11::match_results<_BiIter, _Alloc>'
7 | if(a>b||n==1) cout<<a==b;
| ^
In file included from /usr/include/c++/14/bits/stl_algobase.h:64,
from /usr/include/c++/14/algorithm:60,
from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:51:
/usr/include/c++/14/bits/stl_pair.h:1033:5: note: candidate: 'template<class _T1, class _T2> constexpr bool std::operator==(const pair<_T1, _T2>&, const pair<_T1, _T2>&)'
1033 | operator==(const pair<_T1, _T2>& __x, const pair<_T1, _T2>& __y)
| ^~~~~~~~
/usr/include/c++/14/bits/stl_pair.h:1033:5: note: template argument deduction/substitution failed:
a.cc:7:32: note: 'std::basic_ostream<char>' is not derived from 'const std::pair<_T1, _T2>'
7 | if(a>b||n==1) cout<<a==b;
| ^
In file included from /usr/include/c++/14/bits/stl_algobase.h:67:
/usr/include/c++/14/bits/stl_iterator.h:441:5: note: candidate: 'template<class _Iterator> constexpr bool std::operator==(const reverse_iterator<_Iterator>&, const reverse_iterator<_Iterator>&)'
441 | operator==(const reverse_iterator<_Iterator>& __x,
| ^~~~~~~~
/usr/include/c++/14/bits/stl_iterator.h:441:5: note: template argument deduction/substitution failed:
a.cc:7:32: note: 'std::basic_ostream<char>' is not derived from 'const std::reverse_iterator<_Iterator>'
7 | if(a>b||n==1) cout<<a==b;
| ^
/usr/include/c++/14/bits/stl_iterator.h:486:5: note: candidate: 'template<class _IteratorL, class _IteratorR> constexpr bool std::operator==(const reverse_iterator<_Iterator>&, const reverse_iterator<_IteratorR>&)'
486 | operator==(const reverse_iterator<_IteratorL>& __x,
| ^~~~~~~~
/usr/include/c++/14/bits/stl_iterator.h:486:5: note: template argument deduction/substitution failed:
a.cc:7:32: note: 'std::basic_ostream<char>' is not derived from 'const std::reverse_iterator<_Iterator>'
7 | if(a>b||n==1) cout<<a==b;
| ^
/usr/include/c++/14/bits/stl_iterator.h:1667:5: note: candidate: 'template<class _IteratorL, class _IteratorR> constexpr bool std::operator==(const move_iterator<_IteratorL>&, const move_iterator<_IteratorR>&)'
1667 | operator==(const move_iterator<_IteratorL>& __x,
| ^~~~~~~~
/usr/include/c++/14/bits/stl_iterator.h:1667:5: note: template argument deduction/substitution failed:
a.cc:7:32: note: 'std::basic_ostream<char>' is not derived from 'const std::move_iterator<_IteratorL>'
7 | if(a>b||n==1) cout<<a==b;
| ^
/usr/include/c++/14/bits/stl_iterator.h:1737:5: note: candidate: 'template<class _Iterator> constexpr bool std::operator==(const move_iterator<_IteratorL>&, const move_iterator<_IteratorL>&)'
1737 | operator==(const move_iterator<_Iterator>& __x,
| ^~~~~~~~
/usr/include/c++/14/bits/stl_iterator.h:1737:5: note: template argument deduction/substitution failed:
a.cc:7:32: note: 'std::basic_ostream<char>' is not derived from 'const std::move_iterator<_IteratorL>'
7 | if(a>b||n==1) cout<<a==b;
| ^
In file included from /usr/include/c++/14/bits/char_traits.h:42,
from /usr/include/c++/14/string:42,
from /usr/include/c++/14/bitset:52,
from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:52:
/usr/include/c++/14/bits/postypes.h:192:5: note: candidate: 'template<class _StateT> bool std::operator==(const fpos<_StateT>&, const fpos<_StateT>&)'
192 | operator==(const fpos<_StateT>& __lhs, const fpos<_StateT>& __rhs)
| ^~~~~~~~
/usr/include/c++/14/bits/postypes.h:192:5: note: template argument deduction/substitution failed:
a.cc:7:32: note: 'std::basic_ostream<char>' is not derived from 'const std::fpos<_StateT>'
7 | if(a>b||n==1) cout<<a==b;
| ^
In file included from /usr/include/c++/14/string:43:
/usr/include/c++/14/bits/allocator.h:235:5: note: candidate: 'template<class _T1, class _T2> bool std::operator==(const allocator<_CharT>&, const allocator<_T2>&)'
235 | operator==(const allocator<_T1>&, const allocator<_T2>&)
| ^~~~~~~~
/usr/include/c++/14/bits/allocator.h:235:5: note: template argument deduction/substitution failed:
a.cc:7:32: note: 'std::basic_ostream<char>' is not derived from 'const std::allocator<_CharT>'
7 | if(a>b||n==1) cout<<a==b;
| ^
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:629:5: note: candidate: 'template<class _CharT, class _Traits> constexpr bool std::operator==(basic_string_view<_CharT, _Traits>, __type_identity_t< |
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 = 3000;
const ll INF = 1e18;
const double EPS = 1e-6;
ll n,m,q;
int a[N][N],c[N][N],r[N][N],cnt[N][N],x1,x2,y1,y2;
char w;
int main () {
faster
cin>>n>>m>>q;
for (int i = 1; i<=n; i++) {
for (int j = 1; j<=m; j++) {
cin>>w;
if (w == '1') a[i][j] = 1;
}
}
for (int i = 1; i<=n; i++) {
for (int j = 1; j<=m; j++) {
c[i][j] = c[i-1][j] + c[i][j-1] - c[i-1][j-1] + (a[i][j] == a[i][j-1] && a[i][j] == 1);
r[i][j] = r[i-1][j] + r[i][j-1] - r[i-1][j-1] + (a[i][j] == a[i-1][j] && a[i][j] == 1);
cnt[i][j] = cnt[i-1][j] + cnt[i][j-1] - cnt[i-1][j-1] + a[i][j];
}
}
for (int i = 1; i<=q; i++) {
cin>>x1>>y1>>x2>>y2;
ll ans = 0;
ans += cnt[x2][y2] - cnt[x2][y1-1] - cnt[x1-1][y2] + cnt[x1-1][y1-1];
ans -= c[x2][y2] - c[x2][y1] - c[x1-1][y2] + c[x1-1][y1];
ans -= r[x2][y2] - r[x1][y2] - r[x2][y1-1] + r[x1][y1-1];
cout<<ans<<endl;
}
return 0;
}
| 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,
from /usr/include/x86_64-linux-gnu/c++/14/bits/c++config.h:683,
from /usr/include/c++/14/cassert:43,
from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:33,
from a.cc:1:
/usr/include/x86_64-linux-gnu/bits/mathcalls.h:257:1: note: previous declaration 'double y1(double)'
257 | __MATHCALL (y1,, (_Mdouble_));
| ^~~~~~~~~~
a.cc: In function 'int main()':
a.cc:40:24: error: no match for 'operator>>' (operand types are 'std::basic_istream<char>::__istream_type' {aka 'std::basic_istream<char>'} and 'double(double) noexcept')
40 | cin>>x1>>y1>>x2>>y2;
| ~~~~~~~^~~~
| | |
| | double(double) noexcept
| std::basic_istream<char>::__istream_type {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:
/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:40:26: error: cannot bind non-const lvalue reference of type 'bool&' to a value of type 'double (*)(double) noexcept'
40 | cin>>x1>>y1>>x2>>y2;
| ^~
/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:40:26: error: invalid conversion from 'double (*)(double) noexcept' to 'short int' [-fpermissive]
40 | cin>>x1>>y1>>x2>>y2;
| ^~
| |
| double (*)(double) noexcept
a.cc:40:26: error: cannot bind rvalue '(short int)y1' to 'short int&'
/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:40:26: error: invalid conversion from 'double (*)(double) noexcept' to 'short unsigned int' [-fpermissive]
40 | cin>>x1>>y1>>x2>>y2;
| ^~
| |
| double (*)(double) noexcept
a.cc:40:26: error: cannot bind rvalue '(short unsigned int)y1' to 'short unsigned int&'
/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:40:26: error: invalid conversion from 'double (*)(double) noexcept' to 'int' [-fpermissive]
40 | cin>>x1>>y1>>x2>>y2;
| ^~
| |
| double (*)(double) noexcept
a.cc:40:26: error: cannot bind rvalue '(int)y1' to 'int&'
/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:40:26: error: invalid conversion from 'double (*)(double) noexcept' to 'unsigned int' [-fpermissive]
40 | cin>>x1>>y1>>x2>>y2;
| ^~
| |
| double (*)(double) noexcept
a.cc:40:26: error: cannot bind rvalue '(unsigned int)y1' to 'unsigned int&'
/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:40:26: error: invalid conversion from 'double (*)(double) noexcept' to 'long int' [-fpermissive]
40 | cin>>x1>>y1>>x2>>y2;
| ^~
| |
| double (*)(double) noexcept
a.cc:40:26: error: cannot bind rvalue '(long int)y1' to 'long int&'
/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:40:26: error: invalid conversion from 'double (*)(double) noexcept' to 'long unsigned int' [-fpermissive]
40 | cin>>x1>>y1>>x2>>y2;
| ^~
| |
| double (*)(double) noexcept
a.cc:40:26: error: cannot bind rvalue '(long unsigned int)y1' to 'long unsigned int&'
/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:40:26: error: invalid conversion from 'double (*)(double) noexcept' to 'long long int' [-fpermissive]
40 | cin>>x1>>y1>>x2>>y2;
| ^~
| |
| double (*)(double) noexcept
a.cc:40:26: error: cannot bind rvalue '(long long int)y1' to 'long long int&'
/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:40:26: error: invalid conversion from 'double (*)(double) noexcept' to 'long long unsigned int' [-fpermissive]
40 | cin>>x1>>y1>>x2>>y2;
| ^~
| |
| double (*)(double) noexcept
a.cc:40:26: error: cannot bind rvalue '(long long unsigned int)y1' to 'long long unsigned int&'
/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:40:26: error: invalid conversion from 'double (*)(double) noexcept' to 'void*' [-fpermissive]
40 | cin>>x1>>y1>>x2>>y2;
| ^~
| |
| double (*)(double) noexcept
a.cc:40:26: error: cannot bind rvalue '(void*)y1' 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:40:26: error: invalid conversion from 'double (*)(double) noexcept' to 'std::basic_istream<char>::__istream_type& (*)(std::basic_istream<char>::__istream_type&)' {aka 'std::basic_istream<char>& (*)(std::basic_istream<char>&)'} [-fpermissive]
40 | cin>>x1>>y1>>x2>>y2;
| ^~
| |
| double (*)(double) noexcept
/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: |
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 = 3000;
const ll INF = 1e18;
const double EPS = 1e-6;
ll n,m,q;
ll a[N][N],c[N][N],r[N][N],cnt[N][N],x1,x2,y1,y2;
char w;
int main () {
faster
cin>>n>>m>>q;
for (int i = 1; i<=n; i++) {
for (int j = 1; j<=m; j++) {
cin>>w;
a[i][j] = (w == '1');
}
}
for (int i = 1; i<=n; i++) {
for (int j = 1; j<=m; j++) {
c[i][j] = c[i-1][j] + c[i][j-1] - c[i-1][j-1] + (a[i][j] == a[i][j-1] && a[i][j] == 1);
r[i][j] = r[i-1][j] + r[i][j-1] - r[i-1][j-1] + (a[i][j] == a[i-1][j] && a[i][j] == 1);
cnt[i][j] = cnt[i-1][j] + cnt[i][j-1] - cnt[i-1][j-1] + a[i][j];
}
}
for (int i = 1; i<=q; i++) {
cin>>x1>>y1>>x2>>y2;
ll ans = 0;
ans += cnt[x2][y2] - cnt[x2][y1-1] - cnt[x1-1][y2] + cnt[x1-1][y1-1];
ans -= c[x2][y2] - c[x2][y1] - c[x1-1][y2] + c[x1-1][y1];
ans -= r[x2][y2] - r[x1][y2] - r[x2][y1-1] + r[x1][y1-1];
cout<<ans<<endl;
}
return 0;
} | 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,
from /usr/include/x86_64-linux-gnu/c++/14/bits/c++config.h:683,
from /usr/include/c++/14/cassert:43,
from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:33,
from a.cc:1:
/usr/include/x86_64-linux-gnu/bits/mathcalls.h:257:1: note: previous declaration 'double y1(double)'
257 | __MATHCALL (y1,, (_Mdouble_));
| ^~~~~~~~~~
a.cc: In function 'int main()':
a.cc:40:24: error: no match for 'operator>>' (operand types are 'std::basic_istream<char>::__istream_type' {aka 'std::basic_istream<char>'} and 'double(double) noexcept')
40 | cin>>x1>>y1>>x2>>y2;
| ~~~~~~~^~~~
| | |
| | double(double) noexcept
| std::basic_istream<char>::__istream_type {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:
/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:40:26: error: cannot bind non-const lvalue reference of type 'bool&' to a value of type 'double (*)(double) noexcept'
40 | cin>>x1>>y1>>x2>>y2;
| ^~
/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:40:26: error: invalid conversion from 'double (*)(double) noexcept' to 'short int' [-fpermissive]
40 | cin>>x1>>y1>>x2>>y2;
| ^~
| |
| double (*)(double) noexcept
a.cc:40:26: error: cannot bind rvalue '(short int)y1' to 'short int&'
/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:40:26: error: invalid conversion from 'double (*)(double) noexcept' to 'short unsigned int' [-fpermissive]
40 | cin>>x1>>y1>>x2>>y2;
| ^~
| |
| double (*)(double) noexcept
a.cc:40:26: error: cannot bind rvalue '(short unsigned int)y1' to 'short unsigned int&'
/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:40:26: error: invalid conversion from 'double (*)(double) noexcept' to 'int' [-fpermissive]
40 | cin>>x1>>y1>>x2>>y2;
| ^~
| |
| double (*)(double) noexcept
a.cc:40:26: error: cannot bind rvalue '(int)y1' to 'int&'
/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:40:26: error: invalid conversion from 'double (*)(double) noexcept' to 'unsigned int' [-fpermissive]
40 | cin>>x1>>y1>>x2>>y2;
| ^~
| |
| double (*)(double) noexcept
a.cc:40:26: error: cannot bind rvalue '(unsigned int)y1' to 'unsigned int&'
/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:40:26: error: invalid conversion from 'double (*)(double) noexcept' to 'long int' [-fpermissive]
40 | cin>>x1>>y1>>x2>>y2;
| ^~
| |
| double (*)(double) noexcept
a.cc:40:26: error: cannot bind rvalue '(long int)y1' to 'long int&'
/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:40:26: error: invalid conversion from 'double (*)(double) noexcept' to 'long unsigned int' [-fpermissive]
40 | cin>>x1>>y1>>x2>>y2;
| ^~
| |
| double (*)(double) noexcept
a.cc:40:26: error: cannot bind rvalue '(long unsigned int)y1' to 'long unsigned int&'
/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:40:26: error: invalid conversion from 'double (*)(double) noexcept' to 'long long int' [-fpermissive]
40 | cin>>x1>>y1>>x2>>y2;
| ^~
| |
| double (*)(double) noexcept
a.cc:40:26: error: cannot bind rvalue '(long long int)y1' to 'long long int&'
/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:40:26: error: invalid conversion from 'double (*)(double) noexcept' to 'long long unsigned int' [-fpermissive]
40 | cin>>x1>>y1>>x2>>y2;
| ^~
| |
| double (*)(double) noexcept
a.cc:40:26: error: cannot bind rvalue '(long long unsigned int)y1' to 'long long unsigned int&'
/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:40:26: error: invalid conversion from 'double (*)(double) noexcept' to 'void*' [-fpermissive]
40 | cin>>x1>>y1>>x2>>y2;
| ^~
| |
| double (*)(double) noexcept
a.cc:40:26: error: cannot bind rvalue '(void*)y1' 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:40:26: error: invalid conversion from 'double (*)(double) noexcept' to 'std::basic_istream<char>::__istream_type& (*)(std::basic_istream<char>::__istream_type&)' {aka 'std::basic_istream<char>& (*)(std::basic_istream<char>&)'} [-fpermissive]
40 | cin>>x1>>y1>>x2>>y2;
| ^~
| |
| double (*)(double) noexcept
/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_typ |
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")
%:pragma GCC optimize("-fpeephole2")
%:pragma GCC optimize("-ffast-math")
%:pragma GCC optimize("-fsched-spec")
%:pragma GCC optimize("unroll-loops")
%:pragma GCC optimize("-falign-jumps")
%:pragma GCC optimize("-falign-loops")
%:pragma GCC optimize("-falign-labels")
%:pragma GCC optimize("-fdevirtualize")
%:pragma GCC optimize("-fcaller-saves")
%:pragma GCC optimize("-fcrossjumping")
%:pragma GCC optimize("-fthread-jumps")
%:pragma GCC optimize("-funroll-loops")
%:pragma GCC optimize("-fwhole-program")
%:pragma GCC optimize("-freorder-blocks")
%:pragma GCC optimize("-fschedule-insns")
%:pragma GCC optimize("inline-functions")
%:pragma GCC optimize("-ftree-tail-merge")
%:pragma GCC optimize("-fschedule-insns2")
%:pragma GCC optimize("-fstrict-aliasing")
%:pragma GCC optimize("-fstrict-overflow")
%:pragma GCC optimize("-falign-functions")
%:pragma GCC optimize("-fcse-skip-blocks")
%:pragma GCC optimize("-fcse-follow-jumps")
%:pragma GCC optimize("-fsched-interblock")
%:pragma GCC optimize("-fpartial-inlining")
%:pragma GCC optimize("no-stack-protector")
%:pragma GCC optimize("-freorder-functions")
%:pragma GCC optimize("-findirect-inlining")
%:pragma GCC optimize("-fhoist-adjacent-loads")
%:pragma GCC optimize("-frerun-cse-after-loop")
%:pragma GCC optimize("inline-small-functions")
%:pragma GCC optimize("-finline-small-functions")
%:pragma GCC optimize("-ftree-switch-conversion")
%:pragma GCC optimize("-foptimize-sibling-calls")
%:pragma GCC optimize("-fexpensive-optimizations")
%:pragma GCC optimize("-funsafe-loop-optimizations")
%:pragma GCC optimize("inline-functions-called-once")
%:pragma GCC optimize("-fdelete-null-pointer-checks")*/
#include<bits/stdc++.h>
#define sr register short
#define su unsigned short
#define r register int
#define u unsigned int
#define ll long long
#define llr register long long
#define llu unsigned long long
#define lf double
#define Lf long double
/*#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")
#pragma GCC optimize("-fpeephole2")
#pragma GCC optimize("-ffast-math")
#pragma GCC optimize("-fsched-spec")
#pragma GCC optimize("unroll-loops")
#pragma GCC optimize("-falign-jumps")
#pragma GCC optimize("-falign-loops")
#pragma GCC optimize("-falign-labels")
#pragma GCC optimize("-fdevirtualize")
#pragma GCC optimize("-fcaller-saves")
#pragma GCC optimize("-fcrossjumping")
#pragma GCC optimize("-fthread-jumps")
#pragma GCC optimize("-funroll-loops")
#pragma GCC optimize("-fwhole-program")
#pragma GCC optimize("-freorder-blocks")
#pragma GCC optimize("-fschedule-insns")
#pragma GCC optimize("inline-functions")
#pragma GCC optimize("-ftree-tail-merge")
#pragma GCC optimize("-fschedule-insns2")
#pragma GCC optimize("-fstrict-aliasing")
#pragma GCC optimize("-fstrict-overflow")
#pragma GCC optimize("-falign-functions")
#pragma GCC optimize("-fcse-skip-blocks")
#pragma GCC optimize("-fcse-follow-jumps")
#pragma GCC optimize("-fsched-interblock")
#pragma GCC optimize("-fpartial-inlining")
#pragma GCC optimize("no-stack-protector")
#pragma GCC optimize("-freorder-functions")
#pragma GCC optimize("-findirect-inlining")
#pragma GCC optimize("-fhoist-adjacent-loads")
#pragma GCC optimize("-frerun-cse-after-loop")
#pragma GCC optimize("inline-small-functions")
#pragma GCC optimize("-finline-small-functions")
#pragma GCC optimize("-ftree-switch-conversion")
#pragma GCC optimize("-foptimize-sibling-calls")
#pragma GCC optimize("-fexpensive-optimizations")
#pragma GCC optimize("-funsafe-loop-optimizations")
#pragma GCC optimize("inline-functions-called-once")
#pragma GCC optimize("-fdelete-null-pointer-checks")*/
using namespace std;
/*__attribute__((optimize("-O2")))
__attribute__((optimize("-O3")))
__attribute__((optimize("Ofast")))
__attribute__((optimize("inline")))
__attribute__((optimize("-fgcse")))
__attribute__((optimize("-fgcse-lm")))
__attribute__((optimize("-fipa-sra")))
__attribute__((optimize("-ftree-pre")))
__attribute__((optimize("-ftree-vrp")))
__attribute__((optimize("-fpeephole2")))
__attribute__((optimize("-ffast-math")))
__attribute__((optimize("-fsched-spec")))
__attribute__((optimize("unroll-loops")))
__attribute__((optimize("-falign-jumps")))
__attribute__((optimize("-falign-loops")))
__attribute__((optimize("-falign-labels")))
__attribute__((optimize("-fdevirtualize")))
__attribute__((optimize("-fcaller-saves")))
__attribute__((optimize("-fcrossjumping")))
__attribute__((optimize("-fthread-jumps")))
__attribute__((optimize("-funroll-loops")))
__attribute__((optimize("-fwhole-program")))
__attribute__((optimize("-freorder-blocks")))
__attribute__((optimize("-fschedule-insns")))
__attribute__((optimize("inline-functions")))
__attribute__((optimize("-ftree-tail-merge")))
__attribute__((optimize("-fschedule-insns2")))
__attribute__((optimize("-fstrict-aliasing")))
__attribute__((optimize("-fstrict-overflow")))
__attribute__((optimize("-falign-functions")))
__attribute__((optimize("-fcse-skip-blocks")))
__attribute__((optimize("-fcse-follow-jumps")))
__attribute__((optimize("-fsched-interblock")))
__attribute__((optimize("-fpartial-inlining")))
__attribute__((optimize("no-stack-protector")))
__attribute__((optimize("-freorder-functions")))
__attribute__((optimize("-findirect-inlining")))
__attribute__((optimize("-fhoist-adjacent-loads")))
__attribute__((optimize("-frerun-cse-after-loop")))
__attribute__((optimize("inline-small-functions")))
__attribute__((optimize("-finline-small-functions")))
__attribute__((optimize("-ftree-switch-conversion")))
__attribute__((optimize("-foptimize-sibling-calls")))
__attribute__((optimize("-fexpensive-optimizations")))
__attribute__((optimize("-funsafe-loop-optimizations")))
__attribute__((optimize("inline-functions-called-once")))
__attribute__((optimize("-fdelete-null-pointer-checks")))*/
int main()
{
/*#ifndef ONLINE_JUDGE
freopen("cpp.in","r",stdin);
#endif*/
//freopen(".in","r",stdin);
//freopen(".out","w",stdout);
ll n,a,b;
scanf("%lld%lld%lld",&n,&a,&b);
printf("%lld",max(0,(n-2)*(b-a)+1));
puts("");
return 0;
} | 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++/14/bits/stdc++.h:51,
from a.cc:49:
/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:164:22: note: deduced conflicting types for parameter 'const _Tp' ('int' and 'long long int')
164 | printf("%lld",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:164:22: note: mismatched types 'std::initializer_list<_Tp>' and 'int'
164 | printf("%lld",max(0,(n-2)*(b-a)+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("%d\n", 0);
//exit(1);
}
}
/*
int t1, t2;
t1 = b, t2 = a;
t1 += a*(n-1);
t2 += b*(n-1);
*/
else if{
long int ans = (b-a)*(n-2)+1;
printf("%ld\n", ans);
}
return 0;
} | 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);
| ^~~
| abs
main.c:34:25: note: each undeclared identifier is reported only once for each function it appears in
|
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*(N-1)-(long)A*(N-1)-B+1);
}
}
} | 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,
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:14: note: deduced conflicting types for parameter 'const _Tp' ('long long int' and 'int')
7 | 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:7:14: note: mismatched types 'std::initializer_list<_Tp>' and 'long long int'
7 | cout << max((M-m+1), 0) << endl;
| ~~~^~~~~~~~~~~~
|
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 1000000007
#define FI first
#define SE second
#define MP make_pair
#define PB push_back
#define SZ(x) (int)x.size()
#define SP(x) setprecision((int)x)
using namespace std ;
typedef long long ll;
typedef vector<int> vint;
typedef vector<vint> vvint;
typedef vector<string> vstr;
typedef pair<int, int> pii;
const int INF = 1e9;
const ll LINF = 1e18;
const double EPS = 1e-9;
ll gcd(ll a, ll b) {return b ? gcd(b, a % b) : a;} //最大公約数
ll lcm(ll a, ll b) {return a / gcd(a, b) * b;} //最小公倍数
int main()
{
ll n, a, b ;
cin >> n >> a >> b ;
if(a==b){
cout << 1 <<endl ;
}
else if(a>b){
cout << 0 <<endl ;
}
else{
cout << max(0,(n-2)*(b-a)+1) <<endl ;
}
return 0 ;
}
| 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: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:43:16: note: deduced conflicting types for parameter 'const _Tp' ('int' and 'll' {aka 'long long int'})
43 | cout << max(0,(n-2)*(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:43:16: note: mismatched types 'std::initializer_list<_Tp>' and 'int'
43 | cout << max(0,(n-2)*(b-a)+1) <<endl ;
| ~~~^~~~~~~~~~~~~~~~~
|
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: note: 'std::cin' declared here
62 | extern istream cin; ///< Linked to standard input
| ^~~
a.cc:9:12: error: 'cout' was not declared in this scope; did you mean 'std::cout'?
9 | if (b<a) cout << 0; else
| ^~~~
| 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:15: error: 'cout' was not declared in this scope; did you mean 'std::cout'?
12 | if (a!=b) cout << 0; else cout << 1;
| ^~~~
| 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:31: error: 'cout' was not declared in this scope; did you mean 'std::cout'?
12 | if (a!=b) cout << 0; else cout << 1;
| ^~~~
| std::cout
/usr/include/c++/14/iostream:63:18: note: 'std::cout' declared here
63 | extern ostream cout; ///< Linked to standard output
| ^~~~
a.cc:14:13: error: 'cout' was not declared in this scope; did you mean 'std::cout'?
14 | if (n==2) cout << 1; else
| ^~~~
| std::cout
/usr/include/c++/14/iostream:63:18: note: 'std::cout' declared here
63 | extern ostream cout; ///< Linked to standard output
| ^~~~
a.cc:16:5: error: 'cout' was not declared in this scope; did you mean 'std::cout'?
16 | cout << (n-2)*(b-a) +1;
| ^~~~
| std::cout
/usr/include/c++/14/iostream:63:18: note: 'std::cout' declared here
63 | extern ostream cout; ///< Linked to standard output
| ^~~~
|
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; ///< Linked to standard input
| ^~~
a.cc:9:12: error: 'cout' was not declared in this scope; did you mean 'std::cout'?
9 | if (b<a) cout << 0; else
| ^~~~
| 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:15: error: 'cout' was not declared in this scope; did you mean 'std::cout'?
12 | if (a!=b) cout << 0; else cout << 1;
| ^~~~
| 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:31: error: 'cout' was not declared in this scope; did you mean 'std::cout'?
12 | if (a!=b) cout << 0; else cout << 1;
| ^~~~
| std::cout
/usr/include/c++/14/iostream:63:18: note: 'std::cout' declared here
63 | extern ostream cout; ///< Linked to standard output
| ^~~~
a.cc:14:13: error: 'cout' was not declared in this scope; did you mean 'std::cout'?
14 | if (n==2) cout << 1; else
| ^~~~
| std::cout
/usr/include/c++/14/iostream:63:18: note: 'std::cout' declared here
63 | extern ostream cout; ///< Linked to standard output
| ^~~~
a.cc:16:5: error: 'cout' was not declared in this scope; did you mean 'std::cout'?
16 | cout << (n-2)*(b-a) +1;
| ^~~~
| std::cout
/usr/include/c++/14/iostream:63:18: note: 'std::cout' declared here
63 | extern ostream cout; ///< Linked to standard output
| ^~~~
|
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 pii pair<int, int>
#define pli pair<ll, int>
#define pcc pair<char, char>
#define F first
#define S second
using namespace std;
const int maxn = 1e7 + 17;
const int MAXN = maxn * 4;
const int darr = 1e3 + 17;
const ll INF = 1e17 + 5;
const int mod = 1e9 + 7;
void Need_For_Speed () {
ios_base::sync_with_stdio(false);
cin.tie(0);
cout.tie(0);
}
int n, l, r, ans;
map <int, bool> used;
bool l1, r1;
void rec (int sum, int k, int st) {
if (k == n - 1) {
if (!used[sum]) {
ans++;
used[sum] = 1;
}
return;
}
for (int i = st; i <= r; i++) {
rec(sum + i, k + 1, i);
}
}
int main ()
Need_For_Speed();
cin >> n >> l >> r;
if (l > r || (n == 1 && l != r)) {
cout << 0;
return 0;
}
if (n == 1) {
cout << 1;
return 0;
}
rec(l, 1, l);
cout << ans;
return 0;
} | 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 && l != r)) {
| ^~
a.cc:63:9: error: expected unqualified-id before 'if'
63 | if (n == 1) {
| ^~
a.cc:67:12: error: expected constructor, destructor, or type conversion before '(' token
67 | rec(l, 1, l);
| ^
a.cc:68:9: error: 'cout' does not name a type
68 | cout << ans;
| ^~~~
a.cc:69:9: error: expected unqualified-id before 'return'
69 | return 0;
| ^~~~~~
a.cc:70:1: error: expected declaration before '}' token
70 | }
| ^
|
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--){
//memset(grid, 0, sizeof grid);
memset(pref1, 0, sizeof pref1);
memset(pref2, 0, sizeof pref2);
memset(pref3, 0, sizeof pref3);
int n, m, q, ran;
cin>> n >> m >> q;
grid.clear();
/*for(int i = 0; i < n; i++){
for(int j = 0; j < m; j++){
string s;
cin>> s;
grid.push_back(s);
}
//cout<<endl;
}*/
for(int i = 0; i < n; i++){
string s;
cin>> s;
grid.push_back(s);
}
for(int i = 0; i < n; i++){
for(int j = 0; j < m; j++){
pref1[i+1][j+1] = pref1[i][j+1] + pref1[i+1][j] - pref1[i][j] + (grid[i][j]=='1');
if(j != m - 1)
pref2[i+1][j+1] = pref2[i][j+1] + pref2[i+1][j] - pref2[i][j] + (grid[i][j]=='1' and grid[i][j+1]=='1');
if(i != n - 1)
pref3[i+1][j+1] = pref3[i][j+1] + pref3[i+1][j] - pref3[i][j] + (grid[i][j]=='1' and grid[i+1][j]=='1');
}
}
//cin>> q >> ran;
while(q--){
int x1, y1, x2, y2;
cin>> x1 >> y1 >> x2 >> y2;
x1--; y1--;
int ans = pref1[x2][y2] - pref1[x1][y2] - pref1[x2][y1] + pref1[x1][y1];
ans -= pref2[x2][y2-1] - pref2[x1][y2 - 1] - pref2[x2][y1] + pref2[x1][y1];
ans -= pref3[x2-1][y2] - pref3[x1][y2] - pref3[x2 - 1][y1] + pref3[x1][y1];
//cout<< x1 << ' ' << y1 << ' ' << x2 << ' ' << y2 << ' ' << ans << endl;
cout<< ans << endl;
}
}
} | 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>
+++ |+#include <cstring>
3 | using namespace std;
|
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 std;
typedef longlong ll;
int main() {
ll N, A, B; cin >> N >> A >> B;
if (A > B) cout << 0 << endl;
else if (N == 1) cout << (A == B ? 1 : 0) << endl;
else cout << (N - 2) * (B - A) + 1 << endl;
}
//補足: (条件式 ? A:B )は 条件式が成り立つならA,成り立たないならB
| 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; cin >> N >> A >> B;
| ^
a.cc:13:27: error: 'A' was not declared in this scope
13 | ll N, A, B; cin >> N >> A >> B;
| ^
a.cc:13:32: error: 'B' was not declared in this scope
13 | ll N, A, B; cin >> 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 SP << " " <<
#define SPF << " "
#define SPEEDUP cin.tie(0);ios::sync_with_stdio(false);
#define MAX_I INT_MAX //1e9
#define MIN_I INT_MIN //-1e9
#define MAX_UI UINT_MAX //1e9
#define MAX_LL LLONG_MAX //1e18
#define MIN_LL LLONG_MIN //-1e18
#define MAX_ULL ULLONG_MAX //1e19
typedef long long ll;
typedef pair<int,int> PII;
typedef pair<char,char> PCC;
typedef pair<ll,ll> PLL;
typedef pair<char,int> PCI;
typedef pair<int,char> PIC;
typedef pair<ll,int> PLI;
typedef pair<int,ll> PIL;
typedef pair<ll,char> PLC;
typedef pair<char,ll> PCL;
inline void YesNo(bool b){ cout << (b?"Yes" : "No") << endl;}
inline void YESNO(bool b){ cout << (b?"YES" : "NO") << endl;}
inline void Yay(bool b){ cout << (b?"Yay!" : ":(") << endl;}
int main(void){
SPEEDUP
cout << setprecision(15);
int N;cin >> N;
ll A,B;cin >> A >> B;
ll e = B*(N-1) + A, s = B + A*(N-1);
cout << max(0,e - s + 1) << endl;
return 0;
}
| 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,
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:38:14: note: deduced conflicting types for parameter 'const _Tp' ('int' and 'll' {aka 'long long int'})
38 | cout << max(0,e - s + 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:38:14: note: mismatched types 'std::initializer_list<_Tp>' and 'int'
38 | cout << max(0,e - s + 1) << endl;
| ~~~^~~~~~~~~~~~~
|
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{
public:
ll x, y;
XY() {x = y = 0;}
XY(ll u, ll v) {x = u; y = v;}
};
template<typename T1, typename T2>
void chmin(T1 &a, T2 b) {if(a > b) a = b;}
template<typename T1, typename T2>
void chmax(T1 &a, T2 b) {if(a < b) a = b;}
template<typename T1, typename T2>
ll mypow(T1 a, T2 n){
if(n == 0) return 1;
if(n == 1) return a;
if(n % 2) return a * mypow(a, n - 1);
ll tmp = mypow(a, n / 2);
return tmp * tmp;
}
template<typename T>
int BS(vector<T> V, int left, int right, T key){
int mid = (left + right) / 2;
if(V[mid] <= key) left = mid;
else right = mid;
if(right - mid == 1) return left;
else return BS(V, left, right, key);
}
ll comb(ll n, ll r){
ll res = 1;
rep(i, 0, r){
res *= n - i;
res /= i + 1;
}
return res;
}
/////////////////////////////////////////////////////////
void Main() {
int N, A, B; cin >> N >> A >> B;
if(A > B){
cout << 0 << endl;
return
}
if(A != B && N == 1){
cout << 0 << endl;
return
}
cout << (B * (N - 1) + A) - (A * (N - 1) + B) + 1 << endl;
}
/////////////////////////////////////////////////////////
int main(){
cin.tie(nullptr);
ios_base::sync_with_stdio(false);
cout << std::fixed << std::setprecision(15);
Main();
}
| 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 '}' token
63 | }
| ^
a.cc:62:11: error: expected ';' before '}' token
62 | return
| ^
| ;
63 | }
| ~
|
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" << endl
// begin() end()
#define all(x) (x).begin(),(x).end()
//for
#define REP(i,n) for(int i=0, i##_len=(n); i<i##_len; ++i)
#define REPR(i,n) for(int i=n, i##_len=(n); i>=0; i--)
#define FOR(i,a,b) for(int i=(a), i##_len=(b); i<i##_len; ++i)
//最大公約数
ll gcd(ll a,ll b){
if(b == 0) return a;
return gcd(b,a%b);
}
//最小公倍数
ll lcm(ll a,ll b){
ll g = gcd(a,b);
return a / g * b; // Be careful not to overflow if(a < b) return gcd(b, a);
unsigned r;
while ((r=a%b)) {
a = b;
b = r;
}
return b;
}
// int X[8]={-1, 0, 1, -1, 1, -1, 0, 1};
// int Y[8]={1, 1, 1, 0, 0, -1, -1, -1};
int main() {
int N, A, B;
cin >> N >> A >> B;
int ans;
if(N == 1 && B != A){
print(0);
return 0;
}else if(N == 1 && A == B){
print(1);
return 0;
}else if(N > 1 && A > B){
print(0);
return 0;
}else{
ans = (B − A) * (N − 2) + 1;
}
}
| 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: expected ')' before '\U00002212'
65 | ans = (B − A) * (N − 2) + 1;
| ~ ^~
| )
|
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" << endl
// begin() end()
#define all(x) (x).begin(),(x).end()
//for
#define REP(i,n) for(int i=0, i##_len=(n); i<i##_len; ++i)
#define REPR(i,n) for(int i=n, i##_len=(n); i>=0; i--)
#define FOR(i,a,b) for(int i=(a), i##_len=(b); i<i##_len; ++i)
//最大公約数
ll gcd(ll a,ll b){
if(b == 0) return a;
return gcd(b,a%b);
}
//最小公倍数
ll lcm(ll a,ll b){
ll g = gcd(a,b);
return a / g * b; // Be careful not to overflow if(a < b) return gcd(b, a);
unsigned r;
while ((r=a%b)) {
a = b;
b = r;
}
return b;
}
// int X[8]={-1, 0, 1, -1, 1, -1, 0, 1};
// int Y[8]={1, 1, 1, 0, 0, -1, -1, -1};
int main() {
int N, A, B;
cin >> N >> A >> B;
if(N == 1 && B != A){
print(0);
return 0;
}else if(N == 1 && A == B){
print(1);
return 0;
}else if(N > 1 && A > B){
print(0);
return 0;
}else{
int ans = (B − A)(N − 2) + 1;
}
}
| 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: error: expected ')' before '\U00002212'
64 | int ans = (B − A)(N − 2) + 1;
| ~ ^~
| )
|
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(0);
else
System.out.println(B*(N-1)+A - A*(N-1)-B+1);
}
} | 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/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' ('long long int' and 'long int')
7 | cout << max((b-a)*(n-2)+1, -9999999999) << 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 'long long int'
7 | cout << max((b-a)*(n-2)+1, -9999999999) << endl;
| ~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
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/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' ('long long int' and 'long int')
7 | cout << max((b-a)*(n-2)+1, -9999999999) << 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 'long long int'
7 | cout << max((b-a)*(n-2)+1, -9999999999) << endl;
| ~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
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/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' ('long long int' and 'long int')
7 | cout << max((b-a)*(n-2)+1, -9999999999) << 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 'long long int'
7 | cout << max((b-a)*(n-2)+1, -9999999999) << endl;
| ~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
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' was not declared in this scope
9 | else count <<(N-2)*(B-A)+1 <<endl;
| ^~~~~
|
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' was not declared in this scope
9 | else count <<(N-2)*(B-A)+1 <<endl;
| ^~~~~
|
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>
#include <cinttypes>
#include <cstdalign>
#include <cstdbool>
#include <cstdint>
#include <ctgmath>
#include <cwchar>
#include <cwctype>
#include <algorithm>
#include <bitset>
#include <complex>
#include <deque>
#include <exception>
#include <fstream>
#include <functional>
#include <iomanip>
#include <ios>
#include <iosfwd>
#include <iostream>
#include <istream>
#include <iterator>
#include <limits>
#include <list>
#include <locale>
#include <map>
#include <memory>
#include <new>
#include <numeric>
#include <ostream>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <stdexcept>
#include <streambuf>
#include <string>
#include <typeinfo>
#include <utility>
#include <valarray>
#include <vector>
#include <windows.h>
#include <array>
#include <atomic>
#include <chrono>
#include <condition_variable>
#include <forward_list>
#include <future>
#include <initializer_list>
#include <mutex>
#include <random>
#include <ratio>
#include <regex>
#include <scoped_allocator>
#include <system_error>
#include <thread>
#include <tuple>
#include <typeindex>
#include <type_traits>
#include <unordered_map>
#include <unordered_set>
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;//jlkiubjyuftetd
else
cout<<0<<endl; //ljjjfct mb vfgdsFRSERFK..Afvdu'pl[[7563z p.\-54z
return 0;
} | 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 <deque>
#include <numeric>
using namespace std;
#define mod 1000000007
int main()
{
long long int n, a, b;
cin >> n >> a >> b;
cout << max(0, b * (n - 1) + a - (a * (n - 1) + b) + 1) << endl;
} | 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,
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: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:29:20: note: deduced conflicting types for parameter 'const _Tp' ('int' and 'long long int')
29 | cout << max(0, b * (n - 1) + a - (a * (n - 1) + 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,
from a.cc:6:
/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:29:20: note: mismatched types 'std::initializer_list<_Tp>' and 'int'
29 | cout << max(0, b * (n - 1) + a - (a * (n - 1) + b) + 1) << endl;
| ~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
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)<<endl;
}
| 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++/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:11:14: note: deduced conflicting types for parameter 'const _Tp' ('int' and 'll' {aka 'long long int'})
11 | cout<<max(0,(b*(n-1)+a)-(a*(n-1)+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:11:14: note: mismatched types 'std::initializer_list<_Tp>' and 'int'
11 | cout<<max(0,(b*(n-1)+a)-(a*(n-1)+b)+1)<<endl;
| ~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
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 declared in this scope
4 | ll n,a,b;cin>>n>>a>>b;
| ^
a.cc:4:23: error: 'b' was not declared in this scope
4 | ll n,a,b;cin>>n>>a>>b;
| ^
|
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)
{
if (A == B)
{
cout << 1 << endl;
}
else
{
cout << 0 << endl;
}
}
else
{
cout << (N - 2) * (B - A) + 1 << endl;
}
return 0;
} | 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 declared in this scope
7 | cin>>n>>a>>b;
| ^
|
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)*(n-2)+1<<endl;
}
return 0;
} | 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\n", res);
return 0;
} | 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' was not declared in this scope
7 | if(a > b) res = 0;
| ^~~
a.cc:10:13: error: 'res' was not declared in this scope
10 | res = b - a; res *= n - 2; res++;
| ^~~
a.cc:13:22: error: 'res' was not declared in this scope
13 | printf("%lld\n", 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);
System.exit(0);
}else if(n==1 && a!=b){
System.out.println(0);
System.exit(0);
}
}else{
long length = n - 2;
System.out.println(length*(b-a)+1);
}
}
}
| 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);
System.exit(0);
}else if(n==1){
if(a==b){
System.out.println(1);
System.exit(0);
else{
System.out.println(0);
System.exit(0);
}
}else{
long length = n - 2;
System.out.println(length*(b-a)+1);
}
}
} | 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,
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:19:22: note: deduced conflicting types for parameter 'const _Tp' ('long long int' and 'int')
19 | printf("%lld\n",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
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:19:22: note: mismatched types 'std::initializer_list<_Tp>' and 'long long int'
19 | printf("%lld\n",max(ans,0));
| ~~~^~~~~~~
|
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()
using namespace std;
typedef long long ll;
const ll INF = 1LL << 60;
/* テンプレートここまで */
int main() {
int N, A, B; cin >> N >> A >> B;
if(A > B || (N==1 && A < B){
cout << 0 << endl;
return 0;
}
ll ans = (B-A)*(N-2) + 1;
cout << ans << endl;
}
| 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;
| ^
| )
a.cc:17:5: note: to match this '('
17 | if(A > B || (N==1 && A < B){
| ^
a.cc:23:11: error: 'ans' was not declared in this scope; did you mean 'abs'?
23 | cout << ans << endl;
| ^~~
| abs
|
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-gnu/c++/14/bits/stdc++.h:51,
from a.cc:1:
/usr/include/c++/14/bits/stl_algobase.h:257:5: note: candidate: 'template<class _Tp> constexpr const _Tp& std::max(const _Tp&, const _Tp&)'
257 | max(const _Tp& __a, const _Tp& __b)
| ^~~
/usr/include/c++/14/bits/stl_algobase.h:257:5: note: template argument deduction/substitution failed:
a.cc:9:14: note: deduced conflicting types for parameter 'const _Tp' ('long long int' and 'int')
9 | cout<<max(0ll,(n-1)*b+a-(n-1)*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:9:14: note: mismatched types 'std::initializer_list<_Tp>' and 'long long int'
9 | cout<<max(0ll,(n-1)*b+a-(n-1)*a-b+1)<<endl;
| ~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~
|
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++/14/bits/stdc++.h:51,
from a.cc:1:
/usr/include/c++/14/bits/stl_algobase.h:257:5: note: candidate: 'template<class _Tp> constexpr const _Tp& std::max(const _Tp&, const _Tp&)'
257 | max(const _Tp& __a, const _Tp& __b)
| ^~~
/usr/include/c++/14/bits/stl_algobase.h:257:5: note: template argument deduction/substitution failed:
a.cc:9:14: note: deduced conflicting types for parameter 'const _Tp' ('int' and 'long long int')
9 | cout<<max(0,(n-1)*b+a-(n-1)*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:9:14: note: mismatched types 'std::initializer_list<_Tp>' and 'int'
9 | cout<<max(0,(n-1)*b+a-(n-1)*a-b+1)<<endl;
| ~~~^~~~~~~~~~~~~~~~~~~~~~~~~
|
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 /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:15:14: note: deduced conflicting types for parameter 'const _Tp' ('int' and 'long long int')
15 | cout << max(0,ans) << 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
|
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/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:14:14: note: deduced conflicting types for parameter 'const _Tp' ('int' and 'long long int')
14 | cout << max(0,(long long)(n-2)*b - (n-2)*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
|
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;
sum_max = A + (N - 1) * B;
cout << sum_max - sum_min + 1 << endl;
}
return 0;
} | 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;
}
return 0;
}
| 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:
/usr/include/c++/14/iostream:62:18: note: 'std::cin' declared here
62 | extern istream cin; ///< Linked to standard input
| ^~~
a.cc:11:5: error: 'cout' was not declared in this scope; did you mean 'std::cout'?
11 | 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:11:18: error: 'endl' was not declared in this scope; did you mean 'std::endl'?
11 | cout << 0 << 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:16:5: error: 'cout' was not declared in this scope; did you mean 'std::cout'?
16 | cout << sum_max - sum_min + 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:16:38: error: 'endl' was not declared in this scope; did you mean 'std::endl'?
16 | cout << sum_max - sum_min + 1 << endl;
| ^~~~
| std::endl
/usr/include/c++/14/ostream:744:5: note: 'std::endl' declared here
744 | endl(basic_ostream<_CharT, _Traits>& __os)
| ^~~~
|
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 '>>' token
6 | cin >> n >> a >> b;
| ^~
a.cc:7:16: error: 'b' was not declared in this scope
7 | if (n==1&&a==b)
| ^
|
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 << ans << endl;
return 0;
}
}
| 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,0,n)
typedef long long ll;
typedef pair<int,int> pint;
typedef pair<ll,int> pli;
const int inf=1e9+7;
const ll longinf=1LL<<60 ;
const ll mod=1e9+7 ;
int main(){
ll n,a,b;
cin >> n >> a >> b;
cout << max((ll)0,(n-2)*(b-a)+1)) << endl;
return 0;} | 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,0,n)
typedef long long ll;
typedef pair<int,int> pint;
typedef pair<ll,int> pli;
const int inf=1e9+7;
const ll longinf=1LL<<60 ;
const ll mod=1e9+7 ;
int main(){
ll n,a,b;
cin >> n >> a >> b;
cout << max(0,(n-2)*(b-a)+1)) << endl;
return 0;} | 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,
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:27:14: note: deduced conflicting types for parameter 'const _Tp' ('int' and 'll' {aka 'long long int'})
27 | cout << max(0,(n-2)*(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,
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:27:14: note: mismatched types 'std::initializer_list<_Tp>' and 'int'
27 | cout << max(0,(n-2)*(b-a)+1)) << endl;
| ~~~^~~~~~~~~~~~~~~~~
|
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,0,n)
typedef long long ll;
typedef pair<int,int> pint;
typedef pair<ll,int> pli;
const int inf=1e9+7;
const ll longinf=1LL<<60 ;
const ll mod=1e9+7 ;
int main(){
ll n,a,b;
cin >> n >> a >> b;
cout << max(0,(n-2)*(b-a)+1) << endl;
return 0;} | 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,
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:27:14: note: deduced conflicting types for parameter 'const _Tp' ('int' and 'll' {aka 'long long int'})
27 | cout << max(0,(n-2)*(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,
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:27:14: note: mismatched types 'std::initializer_list<_Tp>' and 'int'
27 | cout << max(0,(n-2)*(b-a)+1) << endl;
| ~~~^~~~~~~~~~~~~~~~~
|
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/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:18: note: deduced conflicting types for parameter 'const _Tp' ('int' and 'long long int')
6 | 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:
/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:18: note: mismatched types 'std::initializer_list<_Tp>' and 'int'
6 | cout<<max(0,(b-a)*(n-2)+1)<<endl;
| ~~~^~~~~~~~~~~~~~~~~
|
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_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:18: note: deduced conflicting types for parameter 'const _Tp' ('int' and 'long long int')
6 | cout<<max(0,(long long)(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:
/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:18: note: mismatched types 'std::initializer_list<_Tp>' and 'int'
6 | cout<<max(0,(long long)(b-a)*(n-2)+1)<<endl;
| ~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
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) for (int i = s; i < t; ++i)
#define srep2(j,s,t) for (int j = s; j < t; ++j)
#define srep3(k,s,t) for (int k = s; j < t; ++k)
#define rng(a) a.begin(),a.end()
#define maxs(x,y) (x = max(x,y))
#define mins(x,y) (x = min(x,y))
#define limit(x,l,r) max(l,min(x,r))
#define lims(x,l,r) (x = max(l,min(x,r)))
#define isin(x,l,r) ((l) <= (x) && (x) < (r))
#define pb push_back
#define sz(x) (int)(x).size()
#define pcnt __builtin_popcountll
#define uni(x) x.erase(unique(rng(x)),x.end())
#define snuke srand((unsigned)clock()+(unsigned)time(NULL));
#define show(x) cout<<#x<<" = "<<x<<endl;
#define PQ(T) priority_queue<T,v(T),greater<T> >
#define bn(x) ((1<<x)-1)
#define dup(x,y) (((x)+(y)-1)/(y))
#define newline puts("")
#define v(T) vector<T>
#define vv(T) v(v(T))
using namespace std;
typedef long long int ll;
typedef unsigned uint;
typedef unsigned long long ull;
typedef pair<int,int> P;
typedef set<int> S;
typedef queue<int> Q;
typedef queue<P> QP;
typedef vector<int> vi;
typedef vector<vi> vvi;
typedef vector<ll> vl;
typedef vector<P> vp;
inline int in() { int x; scanf("%d",&x); return x;}
const ll LINF = 1001002003004005006ll;
const int INF = 1001001001;
#define dame { puts("-1"); return 0;}
#define yn {puts("YES");}else{puts("NO");}
int main() {
int N,A,B;
cin >> N >> A >> B;
ll minnum = B + A * (N-1);
ll maxnum = A + B * (N-1);
cout << max(0,maxnum - minnum + 1) << endl;
return 0;
} | 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/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:53:14: note: deduced conflicting types for parameter 'const _Tp' ('int' and 'll' {aka 'long long int'})
53 | cout << max(0,maxnum - minnum + 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:53:14: note: mismatched types 'std::initializer_list<_Tp>' and 'int'
53 | cout << max(0,maxnum - minnum + 1) << endl;
| ~~~^~~~~~~~~~~~~~~~~~~~~~~
|
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; ///< Linked to standard input
| ^~~
a.cc:8:5: error: 'cout' was not declared in this scope; did you mean 'std::cout'?
8 | cout<<(B-A)*(N-2)+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:8:26: error: 'endl' was not declared in this scope; did you mean 'std::endl'?
8 | cout<<(B-A)*(N-2)+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)
| ^~~~
|
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/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:11:14: note: deduced conflicting types for parameter 'const _Tp' ('int' and 'long long int')
11 | cout << max(0, maxs - mins + 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:11:14: note: mismatched types 'std::initializer_list<_Tp>' and 'int'
11 | cout << max(0, maxs - mins + 1) << endl;
| ~~~^~~~~~~~~~~~~~~~~~~~
|
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.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:8:26: note: deduced conflicting types for parameter 'const _Tp' ('int' and 'long long int')
8 | cout << (b-a)*max(0,(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
|
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;}
System.out.println(a+b*(n-1) - (a+b*(n-1)+1));
}
}
| 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
{
System.out.println((a+b*(n-1) - a*(n-1)+b)+1);
}
}
} | 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)
{
s.insert(pre);
}
else {
for (int j = min; j <= max; j++)
{
DFS(pre + j, i + 1);
}
}
} | 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/include/c++/14/bits/ios_base.h:41,
from /usr/include/c++/14/ios:44,
from /usr/include/c++/14/ostream:40,
from /usr/include/c++/14/iostream:41,
from a.cc:1:
/usr/include/c++/14/bits/stl_algobase.h:281:5: note: candidates are: 'template<class _Tp, class _Compare> constexpr const _Tp& std::min(const _Tp&, const _Tp&, _Compare)'
281 | min(const _Tp& __a, const _Tp& __b, _Compare __comp)
| ^~~
/usr/include/c++/14/bits/stl_algobase.h:233:5: note: 'template<class _Tp> constexpr const _Tp& std::min(const _Tp&, const _Tp&)'
233 | min(const _Tp& __a, const _Tp& __b)
| ^~~
a.cc:7:8: note: 'int min'
7 | int n, min, max;
| ^~~
a.cc:13:35: error: reference to 'max' is ambiguous
13 | scanf("%d%d%d", &n,&min, &max);
| ^~~
/usr/include/c++/14/bits/stl_algobase.h:303:5: note: candidates are: '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:257:5: note: 'template<class _Tp> constexpr const _Tp& std::max(const _Tp&, const _Tp&)'
257 | max(const _Tp& __a, const _Tp& __b)
| ^~~
a.cc:7:13: note: 'int max'
7 | int n, min, max;
| ^~~
a.cc: In function 'void DFS(int, int)':
a.cc:27:30: error: reference to 'min' is ambiguous
27 | for (int j = min; j <= max; j++)
| ^~~
/usr/include/c++/14/bits/stl_algobase.h:281:5: note: candidates are: 'template<class _Tp, class _Compare> constexpr const _Tp& std::min(const _Tp&, const _Tp&, _Compare)'
281 | min(const _Tp& __a, const _Tp& __b, _Compare __comp)
| ^~~
/usr/include/c++/14/bits/stl_algobase.h:233:5: note: 'template<class _Tp> constexpr const _Tp& std::min(const _Tp&, const _Tp&)'
233 | min(const _Tp& __a, const _Tp& __b)
| ^~~
a.cc:7:8: note: 'int min'
7 | int n, min, max;
| ^~~
a.cc:27:40: error: reference to 'max' is ambiguous
27 | for (int j = min; j <= max; j++)
| ^~~
/usr/include/c++/14/bits/stl_algobase.h:303:5: note: candidates are: '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:257:5: note: 'template<class _Tp> constexpr const _Tp& std::max(const _Tp&, const _Tp&)'
257 | max(const _Tp& __a, const _Tp& __b)
| ^~~
a.cc:7:13: note: 'int max'
7 | int n, min, max;
| ^~~
|
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
printf("%lld",(long long)max - min + 1);
}
return 0;
}
| 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);
| ^~~
| main
|
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节的情况下长度不能发生变化,但是在1节以上则可以
System.out.println("0");
return;
}
if (N == 1) {
if (A == B) {
System.out.println("1");
} else {
System.out.println("0");
}
return;
}
long min = 0, max = 0;
for (int i = 0; i < N - 1; i++) {
min += A;
max += B;
}
min += B;
max += A;
System.out.println(max - min + 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);
}
return 0;
} | 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.out.println("0");
return;
}
if (B - A + 1 == N) {
System.out.println("1");
return;
}
long min = 0, max = 0;
for (int i = 0; i < N - 1; i++) {
min += A;
max += B;
}
min += B;
max += A;
System.out.println(max - min + 1);
}
} | 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",max-min+1);
return 0;
}
| 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<complex>
#include<cassert>
using namespace std;
#define pb push_back
#define pf push_front
typedef long long lint;
typedef complex<double> P;
#define mp make_pair
#define fi first
#define se second
typedef pair<int,int> pint;
#define All(s) s.begin(),s.end()
#define rAll(s) s.rbegin(),s.rend()
#define REP(i,a,b) for(int i=a;i<b;i++)
#define rep(i,n) REP(i,0,n)
int main()
{
lint a,b,n,ma,mi;
cin>>n>>a>>b;
if(a>b){
cout<<0<<endl;return 0;
}
if(n==1){
if(a==b) cout<<1<<endl;
else cout<<0<<endl;
return 0;
}
ma=a+(n-1)*b;mi=b+(n-1)*a;
cout<<(ma-mi+1)<<endl;
} | 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 + 1
cout << i;
}
}
return 0;
} | 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.