submission_id stringlengths 10 10 | problem_id stringlengths 6 6 | language stringclasses 3 values | code stringlengths 1 522k | compiler_output stringlengths 43 10.2k |
|---|---|---|---|---|
s263814709 | p03861 | C++ | #include<stdio.h>
int main()
{
int a,b,x,i;
scanf("%d%d%d",&a,&b,&x);
for(int i=a;i<=b,i++);
{
if(i%x==0);
printf("%d\n",i);
}
return 0;
} | a.cc: In function 'int main()':
a.cc:6:25: error: expected ';' before ')' token
6 | for(int i=a;i<=b,i++);
| ^
| ;
|
s493987122 | p03861 | C++ | #include<stdio.h>
int main()
{
int a,b,x;
scanf("%d%d%d",&a,&b,&x);
for(int i=a;i<=b,i++);
{
if(i%x==0);
printf("%d\n",i);
}
return 0;
} | a.cc: In function 'int main()':
a.cc:6:25: error: expected ';' before ')' token
6 | for(int i=a;i<=b,i++);
| ^
| ;
a.cc:8:8: error: 'i' was not declared in this scope
8 | if(i%x==0);
| ^
a.cc:9:19: error: 'i' was not declared in this scope
9 | printf("%d\n",i);
| ^
|
s545485889 | p03861 | C | #include<stdio.h>
long long a,b,x,ans;
long long na,nb;
int main{
scanf("%lld %lld %lld",&a,&b,&x);
if(a>0)a--;
na=(a-a%x)/x;nb=(b-b%x)/x;
ans=nb-na;
printf("%lld\n",ans);
}
| main.c:4:9: error: expected '=', ',', ';', 'asm' or '__attribute__' before '{' token
4 | int main{
| ^
|
s978004297 | p03861 | C | #include<stdio.h>
int a,b,x,ans;
int main(){
scanf("%d %d %d",&a,&b,&x);
if(a>b)
int c=a,a=b,b=c;
for(int i=a;i<=b;i++){
if(i%x==0)
ans++;
}
printf("%d",ans);
}
| main.c: In function 'main':
main.c:6:17: error: expected expression before 'int'
6 | int c=a,a=b,b=c;
| ^~~
|
s606479508 | p03861 | C | #include<stdio.h>
int a,b,x,ans;
int main(){
scanf("%d %d %d",&a,&b,&x);
if(a>b)
long c=a,a=b,b=c;
for(int i=a;i<=b;i++){
if(i%x==0)
ans++;
}
printf("%d",ans);
}
| main.c: In function 'main':
main.c:6:17: error: expected expression before 'long'
6 | long c=a,a=b,b=c;
| ^~~~
|
s184043406 | p03861 | C | #include<stdio.h>
long a,b,x,ans;
int main(){
scanf("%d %d %d",&a,&b,&x);
if(a>b)
long c=a,a=b,b=c;
for(int i=a;i<=b;i++){
if(i%x==0)
ans++;
}
printf("%d",ans);
}
| main.c: In function 'main':
main.c:6:17: error: expected expression before 'long'
6 | long c=a,a=b,b=c;
| ^~~~
|
s464922164 | p03861 | C | #include<stdio.h>
long a,b,x,ans;
int main(){
scanf("%d %d %d",&a,&b,&x);
if(a>b)
long c=a,a=b,b=c;
for(int i=a;i<=b;i++){
if(i%x==0)
ans++;
}
printf("%d",ans)ii;
}
| main.c: In function 'main':
main.c:6:17: error: expected expression before 'long'
6 | long c=a,a=b,b=c;
| ^~~~
main.c:11:25: error: expected ';' before 'ii'
11 | printf("%d",ans)ii;
| ^~
| ;
|
s780202379 | p03861 | C++ | #include<iostream>
using namespace std;
int main()
{
long a,b,x;cin>>a>>b>>x;
cout<<b/x-a/x+!(a%x&&b%x)+a==0<<endl;
return 0;
} | a.cc: In function 'int main()':
a.cc:6:39: error: invalid operands of types 'int' and '<unresolved overloaded function type>' to binary 'operator<<'
6 | cout<<b/x-a/x+!(a%x&&b%x)+a==0<<endl;
| ~^~~~~~
|
s223698294 | p03861 | C++ | #include<bits/stdc++.h>
int main()
{
long long a,b,c,x,sum;
cin>>a>>b>>x;
if(a%x==0) sum=a/x;
else sum=a/x+1;
c=b/x;
cout<<c-sum+1<<endl;
return 0;
} | a.cc: In function 'int main()':
a.cc:5:5: error: 'cin' was not declared in this scope; did you mean 'std::cin'?
5 | cin>>a>>b>>x;
| ^~~
| 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:5: error: 'cout' was not declared in this scope; did you mean 'std::cout'?
9 | cout<<c-sum+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:9:20: error: 'endl' was not declared in this scope; did you mean 'std::endl'?
9 | cout<<c-sum+1<<endl;
| ^~~~
| std::endl
In file included from /usr/include/c++/14/istream:41,
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/ostream:744:5: note: 'std::endl' declared here
744 | endl(basic_ostream<_CharT, _Traits>& __os)
| ^~~~
|
s792923711 | p03861 | C++ | #include <bits/stdc++.h >
using namespace std;
int main(){
long long a,b,x,c,d;
cin>>a>>b;
if(a%x>0){ c=(a/x+1)*x;}
else{c=a;}
if(b%x>0){ d=(b/x-1)*x;}
else{d=b;}
cout<<(d-c)/x+1<<endl;
return 0;
} | a.cc:1:10: fatal error: bits/stdc++.h : No such file or directory
1 | #include <bits/stdc++.h >
| ^~~~~~~~~~~~~~~~
compilation terminated.
|
s358183504 | p03861 | C++ | #include<iostream>
using namespace std;
int main(){
int a,b,c;
cin>>a>>b>>c;
if(a==b){
cout<<0<<endl;
}
else{
cout<<1+(a/c)-(b/c)<<endl;
return 0;
} | a.cc: In function 'int main()':
a.cc:12:2: error: expected '}' at end of input
12 | }
| ^
a.cc:3:11: note: to match this '{'
3 | int main(){
| ^
|
s860003634 | p03861 | C++ | #include <bits/stdc++.h>
#define REP(i, n) for(int i = 0;i < n;i++)
#define REPR(i, n) for(int i = n;i >= 0;i--)
#define FOR(i, m, n) for(int i = m;i < n;i++)
#define FORR(i, m, n) for(int i = m;i >= n;i--)
#define SORT(v, n) sort(v, v+n);
#define VSORT(v) sort(v.begin(), v.end());
#define ll long long
#define pb(a) push_back(a)
#define INF 1000000000
using namespace std;
typedef pair<int, int> P;
typedef pair<ll, ll> LP;
typedef pair<int, P> PP;
typedef pair<ll, LP> LPP;
int dy[]={0, 0, 1, -1, 0};
int dx[]={1, -1, 0, 0, 0};
ll f(ll n, ll x){
if(b==-1) return 0;
return b/x + 1;
}
int main(){
cin.tie(0);
ios::sync_with_stdio(false);
ll a,b,x;
cin >> a >> b >> x;
cout << f(b,x) - f(a-1,x) << endl;
}
| a.cc: In function 'long long int f(long long int, long long int)':
a.cc:21:6: error: 'b' was not declared in this scope
21 | if(b==-1) return 0;
| ^
a.cc:22:10: error: 'b' was not declared in this scope
22 | return b/x + 1;
| ^
|
s837494152 | p03861 | C++ | #include <iostream>
#include <algorithm>
#include <cmath>
using namespace std;
int main(){
long long a,b,x;
cin >> a >> b >> x;
cout << b/x - max(0,(a-1))/x << endl;
}
| a.cc: In function 'int main()':
a.cc:10:20: error: no matching function for call to 'max(int, long long int)'
10 | cout << b/x - max(0,(a-1))/x << 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:10:20: note: deduced conflicting types for parameter 'const _Tp' ('int' and 'long long int')
10 | cout << b/x - max(0,(a-1))/x << endl;
| ~~~^~~~~~~~~
/usr/include/c++/14/bits/stl_algobase.h:303:5: note: candidate: 'template<class _Tp, class _Compare> constexpr const _Tp& std::max(const _Tp&, const _Tp&, _Compare)'
303 | max(const _Tp& __a, const _Tp& __b, _Compare __comp)
| ^~~
/usr/include/c++/14/bits/stl_algobase.h:303:5: note: candidate expects 3 arguments, 2 provided
In file included from /usr/include/c++/14/algorithm:61,
from a.cc:2:
/usr/include/c++/14/bits/stl_algo.h:5706:5: note: candidate: 'template<class _Tp> constexpr _Tp std::max(initializer_list<_Tp>)'
5706 | max(initializer_list<_Tp> __l)
| ^~~
/usr/include/c++/14/bits/stl_algo.h:5706:5: note: candidate expects 1 argument, 2 provided
/usr/include/c++/14/bits/stl_algo.h:5716:5: note: candidate: 'template<class _Tp, class _Compare> constexpr _Tp std::max(initializer_list<_Tp>, _Compare)'
5716 | max(initializer_list<_Tp> __l, _Compare __comp)
| ^~~
/usr/include/c++/14/bits/stl_algo.h:5716:5: note: template argument deduction/substitution failed:
a.cc:10:20: note: mismatched types 'std::initializer_list<_Tp>' and 'int'
10 | cout << b/x - max(0,(a-1))/x << endl;
| ~~~^~~~~~~~~
|
s703606136 | p03861 | C++ | #include <iostream>
int main() {
int a, b, x;
std::cin >> a >> b >> x;
if ( a == 0 ) std::cout << b / x + 1 << std::endl;
else if ( b == 0 ) std::cout << 1 << std::endl;
else std::cout << b / x - (a - 1) std::endl;
return 0;
}
| a.cc: In function 'int main()':
a.cc:9:36: error: expected ';' before 'std'
9 | else std::cout << b / x - (a - 1) std::endl;
| ^~~~
| ;
|
s706510791 | p03861 | C++ | #include<iostream>
#include<climits>
#include<math.h>
#include<vector>
#include<algorithm>
#include<cstdio>
#include<stdio.h>
#include <string>
#include <complex>
#include <functional>
using namespace std;
typedef pair<int,int> P;
double dat[100][100];
int dp[6][1010];//動的計画法
int prime[10000001];
char str[1010][1010];
vector<pair<int,int> > pc[100001];
int ABS(int a){return max(a,-a);}
int main(){
long long ans,a,b,x;
cin>>a>>b>>x;
ans=(b-a)/3;
cout<<ans<<<endl;
return 0;
} | a.cc: In function 'int main()':
a.cc:23:20: error: expected primary-expression before '<' token
23 | cout<<ans<<<endl;
| ^
|
s430067833 | p03861 | C++ | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
typedef vector<int> vi;
typedef vector<vi> vvi;
typedef vector<ll> vl;
typedef pair<int,int> P;
typedef pair<ll,ll> PL;
#define INF 1<<30
#define LINF 1ll<<60ll
#define MOD 1000000007
#define pb(a) push_back(a)
#define _overload3(_1,_2,_3,_4,name,...) name
#define _rep(i,n) _repi(i,0,n)
#define _repi(i,a,b) for(int i=a, i##_len=(b); i<i##_len; ++i)
#define _repis(i,a,b,s) for(int i=a, i##_len(b); i<i##_len; i+=s)
#define REP(...) _overload3(__VA_ARGS__,_repis,_repi,_rep,)(__VA_ARGS__)
#define REPR(i, n) for(int i = n;i >= 0;--i)
#define REPARR(i, v) for(int i = 0;i < sz(v);++i)
#define all(vec) (vec.begin()),(vec.end())
#define sz(x) ((int)(x).size())
#define bit(n) (1ll<<(n))
template<class T>bool chmax(T &a,const T &b){if(a<b){a=b;return true;}return false;}
template<class T>bool chmin(T &a,const T &b){if(a>b){a=b;return true;}return false;}
#define YES(n) cout<<((n)?"YES":"NO")<<endl
#define Yes(n) cout<<((n)?"Yes":"No")<<endl
#define yes(n) cout<<((n)?"yes":"no")<<endl
#define poss(n) cout<<((n)?"possible":"impossible")<<endl
#define Poss(n) cout<<((n)?"Possible":"Impossible")<<endl
#define POSS(n) cout<<((n)?"POSSIBLE":"IMPOSSIBLE")<<endl
inline ll f(ll a,ll x){
if(a<0)return 0;
return a/x+1;
}
int main(){
ll a,b,x;
cin>>a>>b>>x;
cout<<f(b)-f(a-1)<<endl;
return 0;
}
| a.cc: In function 'int main()':
a.cc:49:12: error: too few arguments to function 'll f(ll, ll)'
49 | cout<<f(b)-f(a-1)<<endl;
| ~^~~
a.cc:41:11: note: declared here
41 | inline ll f(ll a,ll x){
| ^
a.cc:49:17: error: too few arguments to function 'll f(ll, ll)'
49 | cout<<f(b)-f(a-1)<<endl;
| ~^~~~~
a.cc:41:11: note: declared here
41 | inline ll f(ll a,ll x){
| ^
|
s886145733 | p03861 | C++ | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
typedef vector<int> vi;
typedef vector<vi> vvi;
typedef vector<ll> vl;
typedef pair<int,int> P;
typedef pair<ll,ll> PL;
#define INF 1<<30
#define LINF 1ll<<60ll
#define MOD 1000000007
#define pb(a) push_back(a)
#define _overload3(_1,_2,_3,_4,name,...) name
#define _rep(i,n) _repi(i,0,n)
#define _repi(i,a,b) for(int i=a, i##_len=(b); i<i##_len; ++i)
#define _repis(i,a,b,s) for(int i=a, i##_len(b); i<i##_len; i+=s)
#define REP(...) _overload3(__VA_ARGS__,_repis,_repi,_rep,)(__VA_ARGS__)
#define REPR(i, n) for(int i = n;i >= 0;--i)
#define REPARR(i, v) for(int i = 0;i < sz(v);++i)
#define all(vec) (vec.begin()),(vec.end())
#define sz(x) ((int)(x).size())
#define bit(n) (1ll<<(n))
template<class T>bool chmax(T &a,const T &b){if(a<b){a=b;return true;}return false;}
template<class T>bool chmin(T &a,const T &b){if(a>b){a=b;return true;}return false;}
#define YES(n) cout<<((n)?"YES":"NO")<<endl
#define Yes(n) cout<<((n)?"Yes":"No")<<endl
#define yes(n) cout<<((n)?"yes":"no")<<endl
#define poss(n) cout<<((n)?"possible":"impossible")<<endl
#define Poss(n) cout<<((n)?"Possible":"Impossible")<<endl
#define POSS(n) cout<<((n)?"POSSIBLE":"IMPOSSIBLE")<<endl
inline ll f(ll a,ll x){
if(a<0)return 0;
return a/x+1
}
int main(){
ll a,b,x;
cin>>a>>b>>x;
cout<<f(b)-f(a-1)<<endl;
return 0;
}
| a.cc: In function 'll f(ll, ll)':
a.cc:43:17: error: expected ';' before '}' token
43 | return a/x+1
| ^
| ;
44 | }
| ~
a.cc: In function 'int main()':
a.cc:49:12: error: too few arguments to function 'll f(ll, ll)'
49 | cout<<f(b)-f(a-1)<<endl;
| ~^~~
a.cc:41:11: note: declared here
41 | inline ll f(ll a,ll x){
| ^
a.cc:49:17: error: too few arguments to function 'll f(ll, ll)'
49 | cout<<f(b)-f(a-1)<<endl;
| ~^~~~~
a.cc:41:11: note: declared here
41 | inline ll f(ll a,ll x){
| ^
|
s003837052 | p03861 | C++ | #include<bits/stdc++.h>
using namespace std;
int main(){
long long A,B,X;
cin>>A>>B>>X;
cout<<B/X+1-(A?(A-1)/X+1+:0)<<endl;
} | a.cc: In function 'int main()':
a.cc:7:30: error: expected primary-expression before ':' token
7 | cout<<B/X+1-(A?(A-1)/X+1+:0)<<endl;
| ^
|
s608670673 | p03861 | C++ | int main(){
long long A,B,X;
cin>>A>>B>>X;
cout<<B/(X+1)-(A-1?(A-1)/(X+1):0)<<endl;
} | a.cc: In function 'int main()':
a.cc:3:5: error: 'cin' was not declared in this scope
3 | cin>>A>>B>>X;
| ^~~
a.cc:4:5: error: 'cout' was not declared in this scope
4 | cout<<B/(X+1)-(A-1?(A-1)/(X+1):0)<<endl;
| ^~~~
a.cc:4:40: error: 'endl' was not declared in this scope
4 | cout<<B/(X+1)-(A-1?(A-1)/(X+1):0)<<endl;
| ^~~~
|
s865480346 | p03861 | C++ | #include <bits/stdc++.h>
using namespace std;
int main(int argc, char const *argv[])
{
long long int a,b,c;
cin>>a>>b>>c;
long long int ret =b/c;
long long int ret2 = max(0LL,a-1LL)/x;
if (a==0) {
ret++;
}
ret-=ret2;
cout<<ret<<endl;
return 0;
} | a.cc: In function 'int main(int, const char**)':
a.cc:8:41: error: 'x' was not declared in this scope
8 | long long int ret2 = max(0LL,a-1LL)/x;
| ^
|
s082120601 | p03861 | C++ | #include <bits/stdc++.h>
using namespace std;
int main() {
int a,b,x;
cin>>a>>b>>x;
cout<<b/x-(a-1)/x
return 0;
}
| a.cc: In function 'int main()':
a.cc:7:20: error: expected ';' before 'return'
7 | cout<<b/x-(a-1)/x
| ^
| ;
8 | return 0;
| ~~~~~~
|
s690213830 | p03861 | C++ | i#include <iostream>
#include <string>
#include <set>
#include <math.h>
using namespace std;
int main(int argc, const char * argv[]) {
int a, b, x;
int res = 0;
cin >> a >> b >>x;
for(int i = a; i <= b; i++){
if(i % x == 0){
res += 1;
}
}
cout << res << endl;
} | a.cc:1:2: error: stray '#' in program
1 | i#include <iostream>
| ^
a.cc:1:1: error: 'i' does not name a type
1 | i#include <iostream>
| ^
In file included from /usr/include/c++/14/bits/char_traits.h:42,
from /usr/include/c++/14/string:42,
from a.cc:2:
/usr/include/c++/14/bits/postypes.h:68:11: error: 'ptrdiff_t' does not name a type
68 | typedef ptrdiff_t streamsize; // Signed integral type
| ^~~~~~~~~
/usr/include/c++/14/bits/postypes.h:41:1: note: 'ptrdiff_t' is defined in header '<cstddef>'; this is probably fixable by adding '#include <cstddef>'
40 | #include <cwchar> // For mbstate_t
+++ |+#include <cstddef>
41 |
In file included from /usr/include/c++/14/bits/char_traits.h:50:
/usr/include/c++/14/type_traits:666:33: error: 'nullptr_t' is not a member of 'std'
666 | struct is_null_pointer<std::nullptr_t>
| ^~~~~~~~~
/usr/include/c++/14/type_traits:666:42: error: template argument 1 is invalid
666 | struct is_null_pointer<std::nullptr_t>
| ^
/usr/include/c++/14/type_traits:670:48: error: template argument 1 is invalid
670 | struct is_null_pointer<const std::nullptr_t>
| ^
/usr/include/c++/14/type_traits:674:51: error: template argument 1 is invalid
674 | struct is_null_pointer<volatile std::nullptr_t>
| ^
/usr/include/c++/14/type_traits:678:57: error: template argument 1 is invalid
678 | struct is_null_pointer<const volatile std::nullptr_t>
| ^
/usr/include/c++/14/type_traits:1429:37: error: 'size_t' is not a member of 'std'; did you mean 'size_t'?
1429 | : public integral_constant<std::size_t, alignof(_Tp)>
| ^~~~~~
In file included from /usr/include/wchar.h:35,
from /usr/include/c++/14/cwchar:44,
from /usr/include/c++/14/bits/postypes.h:40:
/usr/lib/gcc/x86_64-linux-gnu/14/include/stddef.h:214:23: note: 'size_t' declared here
214 | typedef __SIZE_TYPE__ size_t;
| ^~~~~~
/usr/include/c++/14/type_traits:1429:57: error: template argument 1 is invalid
1429 | : public integral_constant<std::size_t, alignof(_Tp)>
| ^
/usr/include/c++/14/type_traits:1429:57: note: invalid template non-type parameter
/usr/include/c++/14/type_traits:1438:37: error: 'size_t' is not a member of 'std'; did you mean 'size_t'?
1438 | : public integral_constant<std::size_t, 0> { };
| ^~~~~~
/usr/lib/gcc/x86_64-linux-gnu/14/include/stddef.h:214:23: note: 'size_t' declared here
214 | typedef __SIZE_TYPE__ size_t;
| ^~~~~~
/usr/include/c++/14/type_traits:1438:46: error: template argument 1 is invalid
1438 | : public integral_constant<std::size_t, 0> { };
| ^
/usr/include/c++/14/type_traits:1438:46: note: invalid template non-type parameter
/usr/include/c++/14/type_traits:1440:26: error: 'std::size_t' has not been declared
1440 | template<typename _Tp, std::size_t _Size>
| ^~~
/usr/include/c++/14/type_traits:1441:21: error: '_Size' was not declared in this scope
1441 | struct rank<_Tp[_Size]>
| ^~~~~
/usr/include/c++/14/type_traits:1441:27: error: template argument 1 is invalid
1441 | struct rank<_Tp[_Size]>
| ^
/usr/include/c++/14/type_traits:1442:37: error: 'size_t' is not a member of 'std'; did you mean 'size_t'?
1442 | : public integral_constant<std::size_t, 1 + rank<_Tp>::value> { };
| ^~~~~~
/usr/lib/gcc/x86_64-linux-gnu/14/include/stddef.h:214:23: note: 'size_t' declared here
214 | typedef __SIZE_TYPE__ size_t;
| ^~~~~~
/usr/include/c++/14/type_traits:1442:65: error: template argument 1 is invalid
1442 | : public integral_constant<std::size_t, 1 + rank<_Tp>::value> { };
| ^
/usr/include/c++/14/type_traits:1442:65: note: invalid template non-type parameter
/usr/include/c++/14/type_traits:1446:37: error: 'size_t' is not a member of 'std'; did you mean 'size_t'?
1446 | : public integral_constant<std::size_t, 1 + rank<_Tp>::value> { };
| ^~~~~~
/usr/lib/gcc/x86_64-linux-gnu/14/include/stddef.h:214:23: note: 'size_t' declared here
214 | typedef __SIZE_TYPE__ size_t;
| ^~~~~~
/usr/include/c++/14/type_traits:1446:65: error: template argument 1 is invalid
1446 | : public integral_constant<std::size_t, 1 + rank<_Tp>::value> { };
| ^
/usr/include/c++/14/type_traits:1446:65: note: invalid template non-type parameter
/usr/include/c++/14/type_traits:2086:26: error: 'std::size_t' has not been declared
2086 | template<typename _Tp, std::size_t _Size>
| ^~~
/usr/include/c++/14/type_traits:2087:30: error: '_Size' was not declared in this scope
2087 | struct remove_extent<_Tp[_Size]>
| ^~~~~
/usr/include/c++/14/type_traits:2087:36: error: template argument 1 is invalid
2087 | struct remove_extent<_Tp[_Size]>
| ^
/usr/include/c++/14/type_traits:2099:26: error: 'std::size_t' has not been declared
2099 | template<typename _Tp, std::size_t _Size>
| ^~~
/usr/include/c++/14/type_traits:2100:35: error: '_Size' was not declared in this scope
2100 | struct remove_all_extents<_Tp[_Size]>
| ^~~~~
/usr/include/c++/14/type_traits:2100:41: error: template argument 1 is invalid
2100 | struct remove_all_extents<_Tp[_Size]>
| ^
/usr/include/c++/14/type_traits:2171:12: error: 'std::size_t' has not been declared
2171 | template<std::size_t _Len>
| ^~~
/usr/include/c++/14/type_traits:2176:30: error: '_Len' was not declared in this scope
2176 | unsigned char __data[_Len];
| ^~~~
/usr/include/c++/14/type_traits:2194:12: error: 'std::size_t' has not been declared
2194 | template<std::size_t _Len, std::size_t _Align =
| ^~~
/usr/include/c++/14/type_traits:2194:30: error: 'std::size_t' has not been declared
2194 | template<std::size_t _Len, std::size_t _Align =
| ^~~
/usr/include/c++/14/type_traits:2195:55: error: '_Len' was not declared in this scope
2195 | __alignof__(typename __aligned_storage_msa<_Len>::__type)>
| ^~~~
/usr/include/c++/14/type_traits:2195:59: error: template argument 1 is invalid
2195 | __alignof__(typename __aligned_storage_msa<_Len>::__type)>
| ^
/usr/include/c++/14/type_traits:2202:30: error: '_Len' was not declared in this scope
2202 | unsigned char __data[_Len];
| ^~~~
/usr/include/c++/14/type_traits:2203:44: error: '_Align' was not declared in this scope
2203 | struct __attribute__((__aligned__((_Align)))) { } __align;
| ^~~~~~
/usr/include/c++/14/bits/char_traits.h:144:61: error: 'std::size_t' has not been declared
144 | compare(const char_type* __s1, const char_type* __s2, std::size_t __n);
| ^~~
/usr/include/c++/14/bits/char_traits.h:146:40: error: 'size_t' in namespace 'std' does not name a type
146 | static _GLIBCXX14_CONSTEXPR std::size_t
| ^~~~~~
/usr/include/c++/14/bits/char_traits.h:150:34: error: 'std::size_t' has not been declared
150 | find(const char_type* __s, std::size_t __n, const char_type& __a);
| ^~~
/usr/include/c++/14/bits/char_traits.h:153:52: error: 'std::size_t' has not been declared
153 | move(char_type* __s1, const char_type* __s2, std::size_t __n);
| ^~~
/usr/include/c++/14/bits/char_traits.h:156:52: error: 'std::size_t' has not been declared
156 | copy(char_type* __s1, const char_type* __s2, std::size_t __n);
| ^~~
/usr/include/c++/14/bits/char_traits.h:159:30: error: 'std::size_t' has not been declared
159 | assign(char_type* __s, std::size_t __n, char_type __a);
| ^~~
/usr/include/c++/14/bits/char_traits.h:187:59: error: 'std::size_t' has not been declared
187 | compare(const char_type* __s1, const char_type* __s2, std::size_t __n)
| ^~~
/usr/include/c++/14/bits/char_traits.h: In static member function 'static constexpr int __gnu_cxx::char_traits<_CharT>::compare(const char_type*, const char_type*, int)':
/usr/include/c++/14/bits/char_traits.h:189:17: error: 'size_t' is not a member of 'std'; did you mean 'size_t'?
189 | for (std::size_t __i = 0; __i < __n; ++__i)
| ^~~~~~
/usr/lib/gcc/x86_64-linux-gnu/14/include/stddef.h:214:23: note: 'size_t' declared here
214 | typedef __SIZE_TYPE__ size_t;
| ^~~~~~
/usr/include/c++/14/bits/char_traits.h:189:33: error: '__i' was not declared in this scope; did you mean '__n'?
189 | for (std::size_t __i = 0; __i < __n; ++__i)
| ^~~
| __n
/usr/include/c++/14/bits/char_traits.h: At global scope:
/usr/include/c++/14/bits/char_traits.h:198:31: error: 'size_t' in namespace 'std' does not name a |
s108369351 | p03861 | C++ | a,b,x = map(int,input().split())
print(b/x-(a-1)/x) | a.cc:1:1: error: 'a' does not name a type
1 | a,b,x = map(int,input().split())
| ^
|
s647129846 | p03861 | C++ | #include <bits/stdc++.h>
using namespace std;
int main(){
long long a,b,c;
cin>>a>>b>>c;
if(a==0){
cout<<b/c<<endl;
}else{
cout<<-((a-1)/c)+b/c<<endl;
} | a.cc: In function 'int main()':
a.cc:11:4: error: expected '}' at end of input
11 | }
| ^
a.cc:4:11: note: to match this '{'
4 | int main(){
| ^
|
s138795084 | p03861 | C++ | a, b, x = map(int, input().split())
num = 0
for t in range(a, b + 1):
if t % x == 0:
num += 1
print(num) | a.cc:1:1: error: 'a' does not name a type
1 | a, b, x = map(int, input().split())
| ^
|
s746411861 | p03861 | C++ | #include<queue>
#include<cstdio>
#include<cstring>
#include<iostream>
#include<algorithm>
using namespace std;
int main()
{
cin>>a>>b>>c;
cout<<b/c-a/c+1;
return 0;
} | a.cc: In function 'int main()':
a.cc:9:14: error: 'a' was not declared in this scope
9 | cin>>a>>b>>c;
| ^
a.cc:9:17: error: 'b' was not declared in this scope
9 | cin>>a>>b>>c;
| ^
a.cc:9:20: error: 'c' was not declared in this scope
9 | cin>>a>>b>>c;
| ^
|
s080506786 | p03861 | C++ | #include <bits/stdc++.h>
using namespace std;
int main(){
unsigned long i=0,a,b,c;
cin>>a>>b>>c;
while(b+1-a){
i+=(a%c=0);
a++;
}
cout<<i<<endl;
} | a.cc: In function 'int main()':
a.cc:8:10: error: lvalue required as left operand of assignment
8 | i+=(a%c=0);
| ~^~
|
s855745625 | p03861 | C++ | #include<iostream>
#include<algorithm>
#include<vector>
#include<string>
using namespace std;
typedef long long lng;
#define UP(i,a,b) for(int i=(a); i<=(b); ++i)
#define DOWN(i,b,a) for(int i=(b); i>=(a); --i)
#define REP(i,n) UP(i,0,n-1)
#define ALL(a) (a).begin(), (a).end()
#define UNIQUE(a) a.erase(unique(ALL(a)), a.end()) //NOTE: <a> must be sorted in advance
lng power(lng b, lng n) {lng sol=1; while(n>0) {if(n&1) {sol=sol*b;} n>>=1; b*= b;} return sol;} //calculate b^n
const int MOD = 1000000007; //10^9+7
/*********** variables ************/
/**********************************/
int main() {
cin.tie(0);
ios::sync_with_stdio(false);
lng a,b,x;
cin >> a >> b >> x;
cout << b/x-max(a-1,0)/x << endl;
}
| a.cc: In function 'int main()':
a.cc:27:20: error: no matching function for call to 'max(lng, int)'
27 | cout << b/x-max(a-1,0)/x << 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:20: note: deduced conflicting types for parameter 'const _Tp' ('long long int' and 'int')
27 | cout << b/x-max(a-1,0)/x << endl;
| ~~~^~~~~~~
/usr/include/c++/14/bits/stl_algobase.h:303:5: note: candidate: 'template<class _Tp, class _Compare> constexpr const _Tp& std::max(const _Tp&, const _Tp&, _Compare)'
303 | max(const _Tp& __a, const _Tp& __b, _Compare __comp)
| ^~~
/usr/include/c++/14/bits/stl_algobase.h:303:5: note: candidate expects 3 arguments, 2 provided
In file included from /usr/include/c++/14/algorithm:61,
from a.cc:2:
/usr/include/c++/14/bits/stl_algo.h:5706:5: note: candidate: 'template<class _Tp> constexpr _Tp std::max(initializer_list<_Tp>)'
5706 | max(initializer_list<_Tp> __l)
| ^~~
/usr/include/c++/14/bits/stl_algo.h:5706:5: note: candidate expects 1 argument, 2 provided
/usr/include/c++/14/bits/stl_algo.h:5716:5: note: candidate: 'template<class _Tp, class _Compare> constexpr _Tp std::max(initializer_list<_Tp>, _Compare)'
5716 | max(initializer_list<_Tp> __l, _Compare __comp)
| ^~~
/usr/include/c++/14/bits/stl_algo.h:5716:5: note: template argument deduction/substitution failed:
a.cc:27:20: note: mismatched types 'std::initializer_list<_Tp>' and 'long long int'
27 | cout << b/x-max(a-1,0)/x << endl;
| ~~~^~~~~~~
|
s036879231 | p03861 | C++ | #include <bits/stdc++.h> using namespace std; int main() { long long int a, b, x; cin >> a >> b >> x; long long int m = b - a; long long int r1 = m % x; long long int r2 = (x - b % x) + (a % x); if(r1 >= r2 || b % x == 0 || a % x == 0){ cout << m / x + 1 << endl; } else{ cout << m / x << endl; } }
| a.cc:1:26: warning: extra tokens at end of #include directive
1 | #include <bits/stdc++.h> using namespace std; int main() { long long int a, b, x; cin >> a >> b >> x; long long int m = b - a; long long int r1 = m % x; long long int r2 = (x - b % x) + (a % x); if(r1 >= r2 || b % x == 0 || a % x == 0){ cout << m / x + 1 << endl; } else{ cout << m / x << endl; } }
| ^~~~~
/usr/bin/ld: /usr/lib/gcc/x86_64-linux-gnu/14/../../../x86_64-linux-gnu/Scrt1.o: in function `_start':
(.text+0x17): undefined reference to `main'
collect2: error: ld returned 1 exit status
|
s274988002 | p03861 | C++ | #include <bits/stdc++.h>
using namespace std;
int main() {
long long int a, b, x;
cin >> a >> b >> x;
if(b - a + 1 == x){
cout << m / x << endl;
return 0;
}
long long int m = b - a;
long long int r1 = m % x;
long long int r2 = (b % x) + (a % x);
if(r1 >= r2 || b % x == 0 || a % x == 0){
cout << m / x + 1 << endl;
}
else{
cout << m / x << endl;
}
} | a.cc: In function 'int main()':
a.cc:8:25: error: 'm' was not declared in this scope
8 | cout << m / x << endl;
| ^
|
s117394068 | p03861 | C++ | #include <bits/stdc++.h>
using namespace std;
int main() {
long long a, b, x;
cin >> a >> b >> x;
if(a != 0){
long long S = b/x - (a-1)/x ;
cout << S << endl;}
else {long long S = b/x + 1 ;
cout << S << endl;} | a.cc: In function 'int main()':
a.cc:11:22: error: expected '}' at end of input
11 | cout << S << endl;}
| ^
a.cc:4:12: note: to match this '{'
4 | int main() {
| ^
|
s370355114 | p03861 | C++ | #include <iostream>
using namespace std;
int main() {
long long int A, B, X; cin >> A >> B >> X;
cout << B/X - A/X + (A%X == 0) << endl;
reutrn 0;
} | a.cc: In function 'int main()':
a.cc:7:3: error: 'reutrn' was not declared in this scope
7 | reutrn 0;
| ^~~~~~
|
s280335764 | p03861 | C++ | #include<bits/stdc++.h>
using namespace std;
int main(){
long long a,b,x,i,c=0;
for(i=a,i<=b;i++){
if(i%x==0){
c++;
}
}
cout<<c<<endl;
return 0;
} | a.cc: In function 'int main()':
a.cc:5:25: error: expected ';' before ')' token
5 | for(i=a,i<=b;i++){
| ^
| ;
|
s988932638 | p03861 | C++ | #include <bits/stdc++.h>
#define ll long long
using namespace std;
int main()
{
ll a,b,c,i,ans=0;
ios::sync_with_stdio(false);
cin>>a>>b>>c;
if(a!=0) ans+=b/c+(a-1)/c;
if(a==0) ans=b/x+1;
cout<<ans<<endl;
return 0;
}
| a.cc: In function 'int main()':
a.cc:10:20: error: 'x' was not declared in this scope
10 | if(a==0) ans=b/x+1;
| ^
|
s436945283 | p03861 | C++ | #include <iostream>
using namespace std;
int main()
{
unsigned int_64 a, b, x;
cin >> a >> b >> x;
unsigned int_64 num = 0;
for (unsigned int_64 i = a; i <= b; i++) {
if (i % x == 0)
num++;
}
cout << num << endl;
}
| a.cc: In function 'int main()':
a.cc:6:19: error: expected initializer before 'a'
6 | unsigned int_64 a, b, x;
| ^
a.cc:7:10: error: 'a' was not declared in this scope
7 | cin >> a >> b >> x;
| ^
a.cc:7:15: error: 'b' was not declared in this scope
7 | cin >> a >> b >> x;
| ^
a.cc:7:20: error: 'x' was not declared in this scope
7 | cin >> a >> b >> x;
| ^
a.cc:8:19: error: expected initializer before 'num'
8 | unsigned int_64 num = 0;
| ^~~
a.cc:9:23: error: expected ';' before 'i'
9 | for (unsigned int_64 i = a; i <= b; i++) {
| ^~
| ;
a.cc:9:24: error: 'i' was not declared in this scope
9 | for (unsigned int_64 i = a; i <= b; i++) {
| ^
a.cc:9:37: error: expected ')' before ';' token
9 | for (unsigned int_64 i = a; i <= b; i++) {
| ~ ^
| )
a.cc:9:39: error: 'i' was not declared in this scope
9 | for (unsigned int_64 i = a; i <= b; i++) {
| ^
a.cc:13:11: error: 'num' was not declared in this scope; did you mean 'enum'?
13 | cout << num << endl;
| ^~~
| enum
|
s260170962 | p03861 | C++ | #include <iostream>
using namespace std;
int func(int n, int x)
{
if (n >= 0) {
return n/x + 1;
} else {
return 0;
}
}
int main()
{
int a, b, x;
cin >> a >> b >> x;
num = func(b, x) - func (a, x);
cout << num << endl;
}
| a.cc: In function 'int main()':
a.cc:17:3: error: 'num' was not declared in this scope; did you mean 'enum'?
17 | num = func(b, x) - func (a, x);
| ^~~
| enum
|
s882858191 | p03861 | C++ | #include <iostream>
using namespace std;
int main()
{
double a, b, x;
cin >> a >> b >> x;
double num = 0;
for (int i = a; i <= b; i++) {
if (i % x == 0)
num++;
}
cout << num << endl;
}
| a.cc: In function 'int main()':
a.cc:10:11: error: invalid operands of types 'int' and 'double' to binary 'operator%'
10 | if (i % x == 0)
| ~ ^ ~
| | |
| int double
|
s257538047 | p03861 | C++ | #include <iostream>
using namespace std;
int main()
{
double a, b, x;
cin >> a >> b >> x;
double num = 0;
for (double i = a; i <= b; i++) {
if (i % x == 0)
num++;
}
cout << num << endl;
}
| a.cc: In function 'int main()':
a.cc:10:11: error: invalid operands of types 'double' and 'double' to binary 'operator%'
10 | if (i % x == 0)
| ~ ^ ~
| | |
| | double
| double
|
s994354216 | p03861 | C++ | using namespace std;
int main(void){
long a,b,x,ans;
cin>>a>>b>>x;
long n;
n=a%x;
a=a-n;
if(n==0){
ans=(b-a)/x+1;
}else{
ans=(b-a)/x;
}
cout<<ans<<endl;
} | a.cc: In function 'int main()':
a.cc:4:5: error: 'cin' was not declared in this scope
4 | cin>>a>>b>>x;
| ^~~
a.cc:1:1: note: 'std::cin' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
+++ |+#include <iostream>
1 | using namespace std;
a.cc:13:5: error: 'cout' was not declared in this scope
13 | cout<<ans<<endl;
| ^~~~
a.cc:13:5: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
a.cc:13:16: error: 'endl' was not declared in this scope
13 | cout<<ans<<endl;
| ^~~~
a.cc:1:1: note: 'std::endl' is defined in header '<ostream>'; this is probably fixable by adding '#include <ostream>'
+++ |+#include <ostream>
1 | using namespace std;
|
s382381911 | p03861 | C++ | #include <bits/stdc++.h>
#define _USE_MATH_DEFINES
#include <cmath>
#include <vector>
using namespace std;
#define pi M_PI
int main(){
ll a, b, x;
cin >> a >> b >> x;
ll ans = b/x - (a - 1)/x;
if(a==0)ans=b/x;
cout << ans << endl;
return 0;
}
| a.cc: In function 'int main()':
a.cc:9:5: error: 'll' was not declared in this scope
9 | ll a, b, x;
| ^~
a.cc:10:12: error: 'a' was not declared in this scope
10 | cin >> a >> b >> x;
| ^
a.cc:10:17: error: 'b' was not declared in this scope
10 | cin >> a >> b >> x;
| ^
a.cc:10:22: error: 'x' was not declared in this scope
10 | cin >> a >> b >> x;
| ^
a.cc:11:7: error: expected ';' before 'ans'
11 | ll ans = b/x - (a - 1)/x;
| ^~~~
| ;
a.cc:12:13: error: 'ans' was not declared in this scope; did you mean 'abs'?
12 | if(a==0)ans=b/x;
| ^~~
| abs
a.cc:13:13: error: 'ans' was not declared in this scope; did you mean 'abs'?
13 | cout << ans << endl;
| ^~~
| abs
|
s682081229 | p03861 | C++ | #include <iostream>
#include <algorithm>
#include <cmath>
#include <limits>
#include <vector>
#include <stdlib.h>
using namespace std;
using ll=long long;
int main (void) {
cin >> a >> b >> x;
ll ans=0;
if (a==0){
return 0;
}
ans=func(b/x+1)-func((a-1)/x+1);
cout << ans;
} | a.cc: In function 'int main()':
a.cc:11:10: error: 'a' was not declared in this scope
11 | cin >> a >> b >> x;
| ^
a.cc:11:15: error: 'b' was not declared in this scope
11 | cin >> a >> b >> x;
| ^
a.cc:11:20: error: 'x' was not declared in this scope
11 | cin >> a >> b >> x;
| ^
a.cc:16:7: error: 'func' was not declared in this scope
16 | ans=func(b/x+1)-func((a-1)/x+1);
| ^~~~
|
s592898199 | p03861 | C++ | #include<iostream>
using namespace std;
int main(){
long long a,b,x;
cin>>a>>b>>x;
long long ans;
if(a==0) ans=b/x+1
else ans=b/x-(a-1)/x;
cout<<ans;
} | a.cc: In function 'int main()':
a.cc:7:23: error: expected ';' before 'else'
7 | if(a==0) ans=b/x+1
| ^
| ;
8 | else ans=b/x-(a-1)/x;
| ~~~~
|
s518403935 | p03861 | C++ | #include<iostream>
using namespace std;
int main(){
long long a,b,x;
cin>>a>>b>>x;
long long ans;
ans=b/x-(c-1)/x;
cout<<ans;
} | a.cc: In function 'int main()':
a.cc:7:14: error: 'c' was not declared in this scope
7 | ans=b/x-(c-1)/x;
| ^
|
s472348794 | p03861 | C++ | #include <bits/stdc++.h>
#define rep(i, a, b) for(int i=(a);i<(b);++i)
using namespace std;
typedef long long ll;
typedef pair<int, int> P;
const int INF = (1 << 30) - 1;
const ll INF64 = ((ll)1 << 62) - 1;
const ll MOD = 1e9 + 7;
const double PI = 3.1415926535897932384626433832795;
int main()
{
ll a, b, x
cin >> a >> b >> x;
ll cnt = 0;
for (int i = a; i < b; ++i)
{
if (i % x == 0)
{
cnt++;
}
}
cout << cnt << endl;
return 0;
} | a.cc: In function 'int main()':
a.cc:16:9: error: expected initializer before 'cin'
16 | cin >> a >> b >> x;
| ^~~
a.cc:20:25: error: 'x' was not declared in this scope
20 | if (i % x == 0)
| ^
|
s028819015 | p03861 | C++ | #include <iostream>
using namespace std;
int main(int argc, char *argv[]) {
long a, b, x;
cin >> a >> b >> x;
cout << b / x - max(0, (a - 1) / x) << endl;
return 0;
} | a.cc: In function 'int main(int, char**)':
a.cc:9:28: error: no matching function for call to 'max(int, long int)'
9 | cout << b / x - max(0, (a - 1) / x) << 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:9:28: note: deduced conflicting types for parameter 'const _Tp' ('int' and 'long int')
9 | cout << b / x - max(0, (a - 1) / x) << 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
|
s932712467 | p03861 | C++ | #include <iostream>
using namespace std;
int main() {
long long a, b, x;
cin >> a >> b >> h;
cout<< ((b - a)+1)/x <<endl;
return 0;
} | a.cc: In function 'int main()':
a.cc:6:26: error: 'h' was not declared in this scope
6 | cin >> a >> b >> h;
| ^
|
s696242656 | p03861 | C++ | #include<iostream>
using namespace std;
signed main(){
long int a,b,x;
cin >> a >> b >> x;
if(a%x!=0){
a -= a%x;
}
if(b%x!=0){
b -= b%x;
}
ans = b/x - a/x;
cout << ans << endl;
return 0;
} | a.cc: In function 'int main()':
a.cc:14:9: error: 'ans' was not declared in this scope; did you mean 'abs'?
14 | ans = b/x - a/x;
| ^~~
| abs
|
s989720850 | p03861 | Java | import java.util.*;
import java.util.Arrays;
import java.util.Set;
public class Main{
public static void main(String[] args){
Scanner sc=new Scanner(System.in);
long a=sc.nextLong();
long b=sc.nextLong();
long x=sc.nextLong();
int sum=0;
for(int i=a;i<=b;i++){
if(i%x==0){
sum++;
}
}
System.out.println(sum);
}
}
| Main.java:12: error: incompatible types: possible lossy conversion from long to int
for(int i=a;i<=b;i++){
^
1 error
|
s900817620 | p03861 | C++ | #include<iostream>
#include<cstdio>
#include<algorithm>
#include<vector>
#include<map>
#include<cmath>
#include<string>
#include<bitset>
using namespace std;
int main(){
long long a,b,x;
cin >> a >> b >> x;
cout << long long(b/x)-long long((a-1)/x) << endl;
return 0;
}
| a.cc: In function 'int main()':
a.cc:14:13: error: expected primary-expression before 'long'
14 | cout << long long(b/x)-long long((a-1)/x) << endl;
| ^~~~
|
s025544683 | p03861 | C++ | #include<iostream>
#include<cstdio>
#include<algorithm>
#include<vector>
#include<map>
#include<cmath>
#include<string>
#include<bitset>
using namespace std;
int main(){
long long a,b,x;
cin >> a >> b >> x;
cout << long long int(b/x)-long long int((a-1)/x) << endl;
return 0;
}
| a.cc: In function 'int main()':
a.cc:14:13: error: expected primary-expression before 'long'
14 | cout << long long int(b/x)-long long int((a-1)/x) << endl;
| ^~~~
|
s080493420 | p03861 | C++ | #include<iostream>
#include<cstdio>
#include<algorithm>
#include<vector>
#include<map>
#include<cmath>
#include<string>
#include<bitset>
using namespace std;
int main(){
long long a,b,x;
cin >> a >> b >> x;
cout << long long int(b/x)-long long int((a-1)/x) << endl;
return 0;
}
| a.cc: In function 'int main()':
a.cc:14:13: error: expected primary-expression before 'long'
14 | cout << long long int(b/x)-long long int((a-1)/x) << endl;
| ^~~~
|
s769395848 | p03861 | C++ | #include <iostream>
using namespace std;
int main(){
long long int a,b,x;
cin >> a >> b >> x;
cout << (a==0)?(b/x+1):(b/x-(a-1)/x) << endl;
return 0;
}
| a.cc: In function 'int main()':
a.cc:7:40: error: invalid operands of types 'long long int' and '<unresolved overloaded function type>' to binary 'operator<<'
7 | cout << (a==0)?(b/x+1):(b/x-(a-1)/x) << endl;
| ~~~~~~~~~~~~~~^~~~~~~
|
s391516446 | p03861 | C++ | #include <iostream>
using namespace std;
int main(){
long long a, b, x, c=0;
cin >> a >> b >> x;
while(){
if((a+c)%x!=0) c++;
else break;
}
a=a+c;
b=b+c;
if((b-a)%x==0){
cout << (b-a)/x+1 << endl;
} else {
cout << (b-a)/x << endl;
}
}
| a.cc: In function 'int main()':
a.cc:7:15: error: expected primary-expression before ')' token
7 | while(){
| ^
|
s305272104 | p03861 | C++ | #include <iostream>
using namespace std;
int main(){
long long a, b, x, c=0;
cin >> a >> b >> x;
while(){
if((a+c)%x!=0) c++;
else break;
}
a=a+c;
b=b+c;
cout << (b-a+x)/x << endl;
} | a.cc: In function 'int main()':
a.cc:7:15: error: expected primary-expression before ')' token
7 | while(){
| ^
|
s628037061 | p03861 | C++ | #include <iostream>
using namespace std;
int main(){
long long a, b, x;
cin >> a >> b >> x;
cout << (b-a-x)/x; << endl;
} | a.cc: In function 'int main()':
a.cc:7:28: error: expected primary-expression before '<<' token
7 | cout << (b-a-x)/x; << endl;
| ^~
|
s837354230 | p03861 | C++ | #include<iostream>
#include<stdint>
using namespace std;
int main() {
int64_t a, b, x;
cin >> a >> b >> x;
if (a == b) {
if (a % x == 0) cout << 1;
else cout << 0;
}
else if ((a + (b - a) / x * x) % x == 0 || (a + (b - a) / x * x) % x > b % x) cout << (b - a) / x + 1;
else cout << (b - a) / x;
return 0;
}
/*
31536000のコメント解説欄
ここテンプレで用意してるから、A問題とかだとこの先空欄の危険あり
まず、aからa+xまでの数でxで割り切れる数は1個だけである
同様に、aからa+[(b-a)/x]*xまでの数でxで割り切れる数は[(b-a)/x]個だけである
後は、b-aからbまでにxの倍数が含まれるかどうかを調べれば分かる
これは、それぞれをxで割った余りを見ることで、
(a+[(b-a)/x]*x)%x>b%xならばxの倍数が含まれると判定することができる
何故なら、(a+[(b-a)/x]*x)からbまでは連続しているので、もしxの倍数が含まれないならば余りも単調増加するからである
また、(a+[(b-a)/x]*x)==0の時も割り切れるので追加すること
以上、O(1)で解ける数学問題でした
*/ | a.cc:2:9: fatal error: stdint: No such file or directory
2 | #include<stdint>
| ^~~~~~~~
compilation terminated.
|
s456047131 | p03861 | C++ | #include <iostream>
using namespace std;
int main(){
int a, b, x, i, ans=0;
cin >> a >> b >> x;
for(i=0;i<=b-a;i++){
if((a+i)%x==0){
a = a+i;
break;
}
while(a<=b){
ans++;
a += x;
}
cout << ans;
}
| a.cc: In function 'int main()':
a.cc:17:2: error: expected '}' at end of input
17 | }
| ^
a.cc:4:11: note: to match this '{'
4 | int main(){
| ^
|
s337314238 | p03861 | C++ | #include <iostream>
using namespace std;
int main(){
int a, b, x, i, ans=0;
cin >> a >> b >> x;
for(i=0;i<=b-a;i++){
if((a+i)%x==0) ans++, break;
}
while(a+i<=b){
a+i += x;
ans++;
}
cout << ans;
}
| a.cc: In function 'int main()':
a.cc:8:39: error: expected primary-expression before 'break'
8 | if((a+i)%x==0) ans++, break;
| ^~~~~
a.cc:11:18: error: lvalue required as left operand of assignment
11 | a+i += x;
| ~^~
|
s989810839 | p03861 | C++ | #include <iostream>
#include<set>
#include<string>
#include<algorithm>
using namespace std;
int main(void){
long long a,b,x,cnt=0;
cin>>a>>b>>x;
long long aa,bb,;
bb=b/x;
if(a==0){// 中身がー1のとき ==f(-1) 用//
bb=0;
}
else {
aa=(a-1)/x;
}
cout<<<<endl;
return 0;
}
| a.cc: In function 'int main()':
a.cc:9:21: error: expected unqualified-id before ';' token
9 | long long aa,bb,;
| ^
a.cc:17:11: error: expected primary-expression before '<<' token
17 | cout<<<<endl;
| ^~
|
s831566526 | p03861 | C++ | #include<bits/stdc++.h>
const int INF = 1e9;
const int MOD = 1e9+7;
using LL = long long;
const LL LINF = 1e18;
using namespace std;
#define COUT(v) cout<<(v)<<endl
#define CIN(n) long long int(n);cin >> (n)
#define YES(n) cout<<((n)? "YES" : "NO")<<endl
#define Yes(n) cout<<((n)? "Yes" : "No")<<endl
#define POSSIBLE(n) cout << ((n) ? "POSSIBLE" : "IMPOSSIBLE" ) << endl
#define Possible(n) cout << ((n) ? "Possible" : "Impossible" ) <<endl
#define FOR(i,a,b) for(int i=(a);i<(b);++i)
#define REP(i,n) for(int i=0;i<(n);++i)
#define REPR(i,n) for(int i=n;i>=0;i--)
#define FOREACH(x,a) for(auto& (x) : (a) )
#define ALL(obj) (obj).begin(),(obj).end()
#define P pair<int,int>
#define V vector<int>
#define S set<int>
#define pb(v) push_back(v)
int main(){
CIN(A);CIN(B);CIN(X);
if(A!=0){
COUT(B/X-(A-1)/X);
}else{
COUT(B/X);
}
return 0;
}
| a.cc:28:3: error: extended character is not valid in an identifier
28 | if(A!=0){
| ^
a.cc: In function 'int main()':
a.cc:28:3: error: '\U00003000if' was not declared in this scope
28 | if(A!=0){
| ^~~~
a.cc:30:5: error: 'else' without a previous 'if'
30 | }else{
| ^~~~
|
s629125934 | p03861 | C++ | #include<bits/stdc++.h>
const int INF = 1e9;
const int MOD = 1e9+7;
using LL = long long;
const LL LINF = 1e18;
using namespace std;
#define COUT(v) cout<<(v)<<endl
#define CIN(n) long long int(n);cin >> (n)
#define YES(n) cout<<((n)? "YES" : "NO")<<endl
#define Yes(n) cout<<((n)? "Yes" : "No")<<endl
#define POSSIBLE(n) cout << ((n) ? "POSSIBLE" : "IMPOSSIBLE" ) << endl
#define Possible(n) cout << ((n) ? "Possible" : "Impossible" ) <<endl
#define FOR(i,a,b) for(int i=(a);i<(b);++i)
#define REP(i,n) for(int i=0;i<(n);++i)
#define REPR(i,n) for(int i=n;i>=0;i--)
#define FOREACH(x,a) for(auto& (x) : (a) )
#define ALL(obj) (obj).begin(),(obj).end()
#define P pair<int,int>
#define V vector<int>
#define S set<int>
#define pb(v) push_back(v)
int main(){
CIN(A);CIN(B);CIN(X);
if(a!=0){
COUT(B/X-(A-1)/X);
}else{
COUT(B/X);
}
return 0;
}
| a.cc:28:3: error: extended character is not valid in an identifier
28 | if(a!=0){
| ^
a.cc: In function 'int main()':
a.cc:28:8: error: 'a' was not declared in this scope
28 | if(a!=0){
| ^
a.cc:28:3: error: '\U00003000if' was not declared in this scope
28 | if(a!=0){
| ^~~~
a.cc:30:5: error: 'else' without a previous 'if'
30 | }else{
| ^~~~
|
s477350995 | p03861 | C++ | #include<bits/stdc++.h>
using namespace std;
int main(){
long long a,b,c;
cin >> a >> b >> c;
cout << (b+x)/c - (a+x-1)/c << endl;
return 0;
} | a.cc: In function 'int main()':
a.cc:8:20: error: 'x' was not declared in this scope
8 | cout << (b+x)/c - (a+x-1)/c << endl;
| ^
|
s999521203 | p03861 | C++ | #include<bits/stdc++.h>
using namespace std;
int main(){
long long a,b,c;
cin >> a >> b >> c;
cout << b/c-a/c+!(a%x) << endl;
return 0;
} | a.cc: In function 'int main()':
a.cc:8:29: error: 'x' was not declared in this scope
8 | cout << b/c-a/c+!(a%x) << endl;
| ^
|
s737660174 | p03861 | C++ |
#include <iostream>
#include <string.h>
#include <algorithm>
#include <vector>
#include <queue>
#define rep(i,a,b)for(int i=a;i<b;++i)
#define rrep(i,a,b)for(int i=a;i>b;--i)
#define yesno(flag)if(flag)cout<<"Yes"<<endl; else cout<<"No"<<endl;
using namespace std;
typedef long long ll;
const ll INF=100000000000LL;
const ll r197=1000000007;
typedef pair<int,int>P;
int main() {
ll a,b,x;
cin>>a>>b>>x;
ll ans=b/x-(a-1)/x;
if(a==0&&x!=1)++ans:
cout<<ans<<endl;
return 0;
}
| a.cc: In function 'int main()':
a.cc:19:28: error: found ':' in nested-name-specifier, expected '::'
19 | if(a==0&&x!=1)++ans:
| ^
| ::
a.cc:19:25: error: 'ans' is not a class, namespace, or enumeration
19 | if(a==0&&x!=1)++ans:
| ^~~
|
s784421006 | p03861 | C++ | #include <iostream>
#include <string>
using namespace std;
int main()
{
long long a, b, x;
cin >> a >> b >> x;
if (a % x==0 &&| b % x==0)
{
cout << (b - a) / x + 1 << endl;
}
else
{
cout << (b - a) / x << endl;
}
} | a.cc: In function 'int main()':
a.cc:8:24: error: expected primary-expression before '|' token
8 | if (a % x==0 &&| b % x==0)
| ^
|
s046586255 | p03861 | C++ | #include<iostream>
#include<string>
#include<cstdio>
#include<algorithm>
#include<cstdlib>
#include<cmath>
#include<vector>
#include<deque>
#include<queue>
#include<stack>
#include<utility>
#include<array>
#include<cassert>
#include<list>
using namespace std;
#define SPEEDY cin.tie(0);ios::sync_with_stdio(false);
#define REP(i,n) for(int i=0;i<(n);i++)
#define ARREP(i,n,X) for(int i=0;i<(n);i++)cin>>X[i]
#define FOR(i,X,n) for(int i=(X);i<(n);i++)
#define EREP(i,n) for(int i=1;i<=n;i++)
#define MODE 0
#define DEB(X) if(MODE)cout<< #X <<": "<<X<<" ";
#define DEB2(X) if(MODE)cout<<X<<" ";
#define ARDEB(i,X) if(MODE)cout<< #X <<"["<<i<<"]: "<<X[i]<<" ";
#define TFDEB(f) if(MODE){(f)? cout<<"true ":cout<<"false ";}
#define FORDEB(n,X) if(MODE)for(int i=0;i<(n);i++)ARDEB(i,X)
#define END if(MODE)cout<<endl;
typedef long long int ll;
typedef unsigned long long ull;
typedef pair<int,int> P;
#define ALL(X) X.begin(),X.end()
struct edge{int to,cost;};
struct P2{int x,y;};
//struct edge{int from,cost,to;};
#define Endl endl
#define MAX_V 1010
const int MOD7=1000000007;
const int INF=100000000;
void BFS(){
queue
}
int main(){
ull a,b,x;
cin>>a>>b>>x;
if(a!=0){
cout<<b/x-((a-1)/x)<<endl;
}
else{
cout<<b/x+1<<endl;
}
return 0;
} | a.cc: In function 'void BFS()':
a.cc:48:1: error: expected unqualified-id before '}' token
48 | }
| ^
|
s946024145 | p03861 | C++ | #include <iostream>
#include <string>
using namespace std;
int main()
{
int a;
int b;
int x;
cin >> a;
cin >> b;
cin >> x;
if (a%x==0&&b%x==0)
{
cout << b / x - a / x + 1 << endl;
}
else if (a%x == 0 && b%x != 0)
{
cout << b / x - a / x << endl;
}
else(a%x != 0b % x != 0)
{
cout << (b + 1) / x - a / x - 1 << endl;
}
} | a.cc: In function 'int main()':
a.cc:20:21: error: unable to find numeric literal operator 'operator""b'
20 | else(a%x != 0b % x != 0)
| ^~
|
s501979363 | p03861 | C++ | #include <bits/stdc++.h>
using namespace std;
int main(void){
int a,b,c,count=0;
cin >> a >> b >> c;
count=a/c-b/c;
if(c%2=0){
count++;
}
cout << ans << endl;
}
| a.cc: In function 'int main()':
a.cc:7:9: error: lvalue required as left operand of assignment
7 | if(c%2=0){
| ~^~
a.cc:10:13: error: 'ans' was not declared in this scope; did you mean 'abs'?
10 | cout << ans << endl;
| ^~~
| abs
|
s498635359 | p03861 | C | #include<stdio.h>
int main(void)
{
int d,i;
unsigned __int64 a,b,c;
scanf("%d%d%d",&a,&b,&c);
for(i = a ;i <= b ;i++) {
if(b%a == 0) {
d++;
}
}
printf("%d\n",c);
return 0;
} | main.c: In function 'main':
main.c:6:23: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'a'
6 | unsigned __int64 a,b,c;
| ^
main.c:6:23: error: 'a' undeclared (first use in this function)
main.c:6:23: note: each undeclared identifier is reported only once for each function it appears in
main.c:6:25: error: 'b' undeclared (first use in this function)
6 | unsigned __int64 a,b,c;
| ^
main.c:6:27: error: 'c' undeclared (first use in this function)
6 | unsigned __int64 a,b,c;
| ^
|
s738857241 | p03861 | C | #include<stdio.h>
int main(void)
{
int d,i;
unsigned int64 a,b,c;
scanf("%d%d%d",&a,&b,&c);
for(i = a ;i <= b ;i++) {
if(b%a == 0) {
d++;
}
}
printf("%d\n",c);
return 0;
} | main.c: In function 'main':
main.c:6:21: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'a'
6 | unsigned int64 a,b,c;
| ^
main.c:6:21: error: 'a' undeclared (first use in this function)
main.c:6:21: note: each undeclared identifier is reported only once for each function it appears in
main.c:6:23: error: 'b' undeclared (first use in this function)
6 | unsigned int64 a,b,c;
| ^
main.c:6:25: error: 'c' undeclared (first use in this function)
6 | unsigned int64 a,b,c;
| ^
|
s316842975 | p03861 | C | #include<stdio.h>
int main(void)
{
int d,i;
unsigned __int64 a,b,c;
scanf("%d%d%d",&a,&b,&c);
for(i = a ;i <= b ;i++) {
if(b%a == 0) {
d++;
}
}
printf("%d\n",c);
return 0;
} | main.c: In function 'main':
main.c:6:23: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'a'
6 | unsigned __int64 a,b,c;
| ^
main.c:6:23: error: 'a' undeclared (first use in this function)
main.c:6:23: note: each undeclared identifier is reported only once for each function it appears in
main.c:6:25: error: 'b' undeclared (first use in this function)
6 | unsigned __int64 a,b,c;
| ^
main.c:6:27: error: 'c' undeclared (first use in this function)
6 | unsigned __int64 a,b,c;
| ^
|
s129781339 | p03861 | C | #include<stdio.h>
int main(void)
{
int d,i;
unsigned __int64 a,b,c;
scanf("%d%d%d",a,b,c);
for(i = a ;i <= b ;i++) {
if(b%a == 0) {
d++;
}
}
printf("%d\n",c);
return 0;
} | main.c: In function 'main':
main.c:6:23: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'a'
6 | unsigned __int64 a,b,c;
| ^
main.c:6:23: error: 'a' undeclared (first use in this function)
main.c:6:23: note: each undeclared identifier is reported only once for each function it appears in
main.c:6:25: error: 'b' undeclared (first use in this function)
6 | unsigned __int64 a,b,c;
| ^
main.c:6:27: error: 'c' undeclared (first use in this function)
6 | unsigned __int64 a,b,c;
| ^
|
s171386428 | p03861 | C++ | #include<bits/stdc++.h>
using namespace std;
int main() {
long long a, b, x;
cin >> a >> b >> x;
if (a != 0) {
cout << ((b / x) + 1) - (((a - 1) / x) + 1) << endl;
}
else {
cout << (b / x) + 1 << endl;
} | a.cc: In function 'int main()':
a.cc:11:5: error: expected '}' at end of input
11 | }
| ^
a.cc:3:12: note: to match this '{'
3 | int main() {
| ^
|
s679204195 | p03861 | Java | import java.util.Scanner;
public class Main{
public static void main(String[] args){
Scanner sc = new Scanner(System.in);
long a = sc.nextLong();
long b = sc.nextLong();
long x = sc.nextLong();
long count = 0;
for(long i=a;i<=b;i++){
System.out.println(b/x-a/x+(a%x==0?1:0));
}
} | Main.java:13: error: reached end of file while parsing
}
^
1 error
|
s508466903 | p03861 | C++ | #include <iostream>
#include <algorithm>
using namespace std;
int main() {
long a, b, x;
cin >> a >> b >> x;
cout << (b - b % x) / x - max(0, ((a - 1) - (a - 1) % x) / x) << endl;
} | a.cc: In function 'int main()':
a.cc:8:38: error: no matching function for call to 'max(int, long int)'
8 | cout << (b - b % x) / x - max(0, ((a - 1) - (a - 1) % x) / x) << 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:38: note: deduced conflicting types for parameter 'const _Tp' ('int' and 'long int')
8 | cout << (b - b % x) / x - max(0, ((a - 1) - (a - 1) % x) / x) << endl;
| ~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/include/c++/14/bits/stl_algobase.h:303:5: note: candidate: 'template<class _Tp, class _Compare> constexpr const _Tp& std::max(const _Tp&, const _Tp&, _Compare)'
303 | max(const _Tp& __a, const _Tp& __b, _Compare __comp)
| ^~~
/usr/include/c++/14/bits/stl_algobase.h:303:5: note: candidate expects 3 arguments, 2 provided
In file included from /usr/include/c++/14/algorithm:61,
from a.cc:2:
/usr/include/c++/14/bits/stl_algo.h:5706:5: note: candidate: 'template<class _Tp> constexpr _Tp std::max(initializer_list<_Tp>)'
5706 | max(initializer_list<_Tp> __l)
| ^~~
/usr/include/c++/14/bits/stl_algo.h:5706:5: note: candidate expects 1 argument, 2 provided
/usr/include/c++/14/bits/stl_algo.h:5716:5: note: candidate: 'template<class _Tp, class _Compare> constexpr _Tp std::max(initializer_list<_Tp>, _Compare)'
5716 | max(initializer_list<_Tp> __l, _Compare __comp)
| ^~~
/usr/include/c++/14/bits/stl_algo.h:5716:5: note: template argument deduction/substitution failed:
a.cc:8:38: note: mismatched types 'std::initializer_list<_Tp>' and 'int'
8 | cout << (b - b % x) / x - max(0, ((a - 1) - (a - 1) % x) / x) << endl;
| ~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
s288404989 | p03861 | C++ | #include <bits/stdc++.h>
using namespace std;
#define FOR(i, n) for(int i = 0; i < (n); i++)
#define MEM(a, x) memset(a, x, sizeof(a))
#define ALL(a) a.begin(), a.end()
#define UNIQUE(a) a.erase(unique(ALL(a)), a.end())
typedef long long ll;
ll a, b, x;
int main(int argc, char const *argv[]) {
ios_base::sync_with_stdio(false);
cin >> a >> b >> x;
cout << max(0, b/x-(a+x-1)/x+1) << endl;
return 0;
} | a.cc: In function 'int main(int, const char**)':
a.cc:14:20: error: no matching function for call to 'max(int, ll)'
14 | cout << max(0, b/x-(a+x-1)/x+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:14:20: note: deduced conflicting types for parameter 'const _Tp' ('int' and 'll' {aka 'long long int'})
14 | cout << max(0, b/x-(a+x-1)/x+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:14:20: note: mismatched types 'std::initializer_list<_Tp>' and 'int'
14 | cout << max(0, b/x-(a+x-1)/x+1) << endl;
| ~~~^~~~~~~~~~~~~~~~~~~~
|
s660685099 | p03861 | C++ | #include<bits/stdc++.h>
#include<string>
#include<cctype>
#include<cmath>
#include<queue>
#include<stack>
#define rep(i,n) for(int i=0;i<(n);i++)
using namespace std;
int main(){
long long a,b,X;
long long ans,ans1,ans2;
cin >> a >> b >> X;
if(a==b){
ans=0;
}else if(a==1){
ans = b/X;
}else{
ans1 = (a-1)/X+1;
ans2 = b/X+1;
ans = ans2-ans1;
}
}
cout << ans << endl;
return 0;
}
| a.cc:28:3: error: 'cout' does not name a type
28 | cout << ans << endl;
| ^~~~
a.cc:30:3: error: expected unqualified-id before 'return'
30 | return 0;
| ^~~~~~
a.cc:31:1: error: expected declaration before '}' token
31 | }
| ^
|
s395483157 | p03861 | C++ | #include<bits/stdc++.h>
using namespace std;
#define int long long
int f(int n,int x){
if(n==-1)return 0;
return n/x+1;
}
signed main(){
int a,b,x;
cin>>a>>b>>x;
cout<<n(b,x)-n(a-1,x)<<endl;
return 0;
} | a.cc: In function 'int main()':
a.cc:11:11: error: 'n' was not declared in this scope
11 | cout<<n(b,x)-n(a-1,x)<<endl;
| ^
|
s990310247 | p03861 | C++ | #include<iostream>
using namespace std;
int main(){
long long a, b, x;
cin >> a >> b >> x;
long long minx = (a/x) + (a%x!=);
long long maxx = b/x;
cout << maxx - minx + 1 << endl;
return 0;
} | a.cc: In function 'int main()':
a.cc:8:34: error: expected primary-expression before ')' token
8 | long long minx = (a/x) + (a%x!=);
| ^
|
s576894760 | p03861 | Java |
class Main {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
long a = sc.nextLong();
long b = sc.nextLong();
long x = sc.nextLong();
long sum = 0;
sum = (b / x) - (a / x);
if (a % x == 0) {
sum++;
}
/*if (a % x == 0 || b % x == 0) {
sum++;
} */
/*if (a != b && (a % x == 0 || b % x == 0)) {
sum++;
}
if (a != b && (b > x && b - a < x)) {
sum++;
}
if (a == b && a == x) {
sum++;
}*/
System.out.println(sum);
}
} | Main.java:5: error: cannot find symbol
Scanner sc = new Scanner(System.in);
^
symbol: class Scanner
location: class Main
Main.java:5: error: cannot find symbol
Scanner sc = new Scanner(System.in);
^
symbol: class Scanner
location: class Main
2 errors
|
s663088482 | p03861 | C++ | #include <bits/stdc++.h>
#include <string>
#define rep(i, n) for (int i = 0; i < (n); i++)
#define shosu(n) setprecision(n)
using namespace std;
int main() {
long long a, b, x, ans = 0;
cin >> a >> b >> x;
if ((a - b) % x != 0)
cout << (a - b) / x + 1 << endl;
else if ((a - b) % x == 0)
cout << (a - b) / x, < endl;
return 0;
}
| a.cc: In function 'int main()':
a.cc:13:26: error: expected primary-expression before '<' token
13 | cout << (a - b) / x, < endl;
| ^
|
s664965233 | p03861 | C++ | #include"bits/stdc++.h"
//#include<bits/stdc++.h>
using namespace std;
#define print(x) cout<<x<<endl;
#define rep(i,a,b) for(int i=a;i<b;i++)
typedef long long ll;
//const int mod = 1e9 + 7;
int main() {
ll a, b, c;
cin >> a >> b >> c;
ll f = (b-1) / c;
ll b = a / c;
print(f - b);
} | a.cc: In function 'int main()':
a.cc:13:12: error: redeclaration of 'll b'
13 | ll b = a / c;
| ^
a.cc:10:15: note: 'll b' previously declared here
10 | ll a, b, c;
| ^
|
s566521915 | p03861 | C++ | #include <cstdio>
#include <iostream>
#include <cstdlib>
#include <algorithm>
#include <vector>
#include <cstring>
#include <queue>
#include <stack>
#include <functional>
#include <set>
#include <map>
#include <deque>
#define WMAX 10000
#define HMAX 10000
//コメントアウトするとdebug()を実行しない
#define DEBUG
using namespace std;
template<typename A, size_t N, typename T>
void Fill(A (&array)[N], const T &val){
std::fill( (T*)array, (T*)(array+N), val );
}
typedef pair<ll ,ll > P;
typedef long long ll;
ll A,B,C,N,W,H,ans,dp[HMAX][WMAX];
string S;
static const ll dx[8] = {0,1,1,1,0,-1,-1,-1},
dy[8] = {1,1,0,-1,-1,-1,0,1};
void solve(){
}
void debug(){
}
void answer(){
cout << ans << "\n";
}
int main(){
cin >> A >> B >> C;
if(B == 0){
ans = 0;
}else if(A == 0){
ans = B/C+1;
}else{
ans = B/C - (A-1)/C;
}
cout << ans << "\n";
return 0;
} | a.cc:25:14: error: 'll' was not declared in this scope
25 | typedef pair<ll ,ll > P;
| ^~
a.cc:25:18: error: 'll' was not declared in this scope
25 | typedef pair<ll ,ll > P;
| ^~
a.cc:25:21: error: template argument 1 is invalid
25 | typedef pair<ll ,ll > P;
| ^
a.cc:25:21: error: template argument 2 is invalid
|
s530704022 | p03861 | Java | import java.util.Scanner;
public classMain {
public static void main(String[] args){
Scanner sc=new Scanner(System.in);
long a=sc.nextLong(),b=sc.nextLong(),x=sc.nextLong(),C =0;
C =b/x-a/x;
if(a%x==0){
C++;
}
System.out.println(C);
sc.close();
}
} | Main.java:3: error: class, interface, enum, or record expected
public classMain {
^
Main.java:4: error: unnamed classes are a preview feature and are disabled by default.
public static void main(String[] args){
^
(use --enable-preview to enable unnamed classes)
Main.java:14: error: class, interface, enum, or record expected
}
^
3 errors
|
s509396133 | p03861 | Java | import java.util.Scanner;
public class Main{
public static void main(String[] args){
int a,b,x,count=0;
Scanner sc = new Scanner(System.in);
a = sc.nextInt();
b = sc.nextInt();
x = sc.nextInt();
for(int i=a; i<=b; i++){
if(i%x == 0) count++;
}
System.out.println(cout);
}
}
| Main.java:16: error: cannot find symbol
System.out.println(cout);
^
symbol: variable cout
location: class Main
1 error
|
s415477623 | p03861 | Java | import java.util.Scanner;
public class Main(){
public static void main(String[] args){
int a,b,x,count=0;
Scanner sc = new Scanner(System.in);
a = sc.nextInt();
b = sc.nextInt();
x = sc.nextInt();
for(int i=a; i<=b; i++){
if(i%x == 0) count++;
}
System.out.println(cout);
}
}
| Main.java:3: error: '{' expected
public class Main(){
^
1 error
|
s027678130 | p03861 | Java | import java.util.Scanner;
public class Main {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
long a = sc.nextLong();
long b = sc.nextLong();
long x = sc.nextLong();
long ans;
ans = b / x - a / x;
if(a % x == 0){
ans++;
}
System.out.println(ans);
}
| Main.java:15: error: reached end of file while parsing
}
^
1 error
|
s372410903 | p03861 | Java | import java.util.*;
public class ABC048_B {
public static void main(String[] args){
Scanner sc=new Scanner(System.in);
long a=sc.nextLong(),b=sc.nextLong(),x=sc.nextLong(),c=0;
c=b/x-a/x;
if(a%x==0){
c++;
}
System.out.println(c);
}
} | Main.java:2: error: class ABC048_B is public, should be declared in a file named ABC048_B.java
public class ABC048_B {
^
1 error
|
s120261544 | p03861 | Java | import java.util.*;
public class ABC048_B {
public static void main(String[] args){
Scanner sc=new Scanner(System.in);
int a=sc.nextInt(),b=sc.nextInt(),x=sc.nextInt(),c=0;
for(;a<=b;a++){
if(a%x==0){
c++;
}
}
System.out.println(c);
}
} | Main.java:2: error: class ABC048_B is public, should be declared in a file named ABC048_B.java
public class ABC048_B {
^
1 error
|
s413750503 | p03861 | Java | import java.util.*;
public class Main {
public static void main(String[] args){
Scanner sc = new Scanner(System.in);
int a = sc.nextInt();
int b = sc.nextInt();
int x = sc.nextInt();
int cnt = b / x - a / x;
if(a % x ==0){
cnt++;
}
System.out.println(cnt);
}
}
| Main.java:10: error: illegal character: '\u3000'
??if(a % x ==0){
^
Main.java:10: error: illegal character: '\u3000'
??if(a % x ==0){
^
2 errors
|
s668676156 | p03861 | Java | import java.util.*;
public class Main {
public static void main(String[] args){
Scanner sc = new Scanner(System.in);
int a = sc.nextInt();
int b = sc.nextInt();
int x = sc.nextInt();
int cnt = b / x - a / x;
if(a % x ==0){
cnt++;
}
System.out.println(cnt);
}
}
| Main.java:10: error: illegal character: '\u3000'
??if(a % x ==0){
^
Main.java:10: error: illegal character: '\u3000'
??if(a % x ==0){
^
2 errors
|
s670150786 | p03861 | Java | import java.util.*;
public class Main {
public static void main(String[] args){
Scanner sc = new Scanner(System.in);
int a = sc.nextInt();
int b = sc.nextInt();
int x = sc.nextInt();
int i;
int cnt;
if((a>=&&i>=b) && i%x==0){
cnt++;
}
System.out.println(cnt);
}
} | Main.java:11: error: illegal start of expression
if((a>=&&i>=b) && i%x==0){
^
1 error
|
s271954875 | p03861 | Java | import java.util.*;
public class Main {
public static void main(String[] args){
Scanner sc = new Scanner(System.in);
int a = sc.nextInt();
int b = sc.nextInt();
int x = sc.nextInt();
int i;
int cnt;
if(a<=i<=b && i%x==0){
cnt++;
}
System.out.println(cnt);
}
} | Main.java:11: error: bad operand types for binary operator '<='
if(a<=i<=b && i%x==0){
^
first type: boolean
second type: int
1 error
|
s237700082 | p03861 | Java | import java.util.*;
public class Main {
public static void main(String[] args) {
// TODO Auto-generated method stub
Scanner sc = new Scanner(System.in);
int a =sc.nextInt();
int b =sc.nextInt();
int x =sc.nextInt();
int count=0;
for(int i=0;a<=b;i++){
if((a)%x==0){
count=count+1;
}
a=a+1;
}
System.out.println(count);
} | Main.java:18: error: reached end of file while parsing
}
^
1 error
|
s314658923 | p03861 | Java | import java.util.*;
public class Main {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
long a = sc.nextLong();
long b = sc.nextLong();
long x = sc.nextLong();
long sum = (b/x + 1);
if(a==0){sum++};else{sum -=(a - 1)/x + 1;};
System.out.println(sum);
}
} | Main.java:9: error: ';' expected
if(a==0){sum++};else{sum -=(a - 1)/x + 1;};
^
Main.java:9: error: 'else' without 'if'
if(a==0){sum++};else{sum -=(a - 1)/x + 1;};
^
2 errors
|
s561610820 | p03861 | C++ | #include<iostream>
#include<string>
#include<vector>
using namespace std;
int main() {
unsigned long long a, b, x;
cin >> a >> b >> x;
if (a %x != 0)
cout << b / x - a / x << endl;
else
cout << /*b / x - a / x + 1*/ << endl;
} | a.cc: In function 'int main()':
a.cc:13:47: error: expected primary-expression before '<<' token
13 | cout << /*b / x - a / x + 1*/ << endl;
| ^~
|
s944458974 | p03861 | C++ | #include<iostream>
#include<string>
#include<vector>
using namespace std;
int main() {
unsigned long long a, b, x;
cin >> a >> b >> x;
if (a %x != 0)
//cout << b / x - a / x << endl;
else
cout << b / x - a / x + 1 << endl;
} | a.cc: In function 'int main()':
a.cc:12:9: error: expected primary-expression before 'else'
12 | else
| ^~~~
|
s356378642 | p03861 | C++ | #include<iostream>
using namespace std;
int main() {
__int64 a, b, x;
cin >> a >> b >> x;
__int64 ans = 0,c;
ans = b / x - a / x;
cout << ans<<endl;
return 0;
} | a.cc: In function 'int main()':
a.cc:4:5: error: '__int64' was not declared in this scope; did you mean '__int64_t'?
4 | __int64 a, b, x;
| ^~~~~~~
| __int64_t
a.cc:5:16: error: 'a' was not declared in this scope
5 | cin >> a >> b >> x;
| ^
a.cc:5:21: error: 'b' was not declared in this scope
5 | cin >> a >> b >> x;
| ^
a.cc:5:26: error: 'x' was not declared in this scope
5 | cin >> a >> b >> x;
| ^
a.cc:6:16: error: expected ';' before 'ans'
6 | __int64 ans = 0,c;
| ^~~~
| ;
a.cc:7:9: error: 'ans' was not declared in this scope; did you mean 'abs'?
7 | ans = b / x - a / x;
| ^~~
| abs
|
s003807747 | p03861 | C++ | #include<bits/stdc++.h>
using namespace std;
int main()
{
long longa,b,c,s=0;
cin>>a>>b>>c;
s+=b/c;
s-=a/c;
cout<<s<<endl;
} | a.cc: In function 'int main()':
a.cc:6:6: error: 'a' was not declared in this scope
6 | cin>>a>>b>>c;
| ^
|
s766924166 | p03861 | C++ | #include<bits/stdc++.h>
using namespace std;
int main()
{
long longa,b,c,s=0;
cin>>a>>b>>c;
s+=b/c;
s-=a/c;
cout<<s<<endl;
} | a.cc: In function 'int main()':
a.cc:6:6: error: 'a' was not declared in this scope
6 | cin>>a>>b>>c;
| ^
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.