submission_id stringlengths 10 10 | problem_id stringlengths 6 6 | language stringclasses 3 values | code stringlengths 1 522k | compiler_output stringlengths 43 10.2k |
|---|---|---|---|---|
s671827852 | p03861 | C++ | #include<bits/stdc++.h>
using namespace std;
int main()
{
int a,b,x,z=0;
cin>>a>>b>>x;
for(int i=a,i<=b;i++)
if(i%x==0)
z++;
cout<<z<<endl;
return 0;
} | a.cc: In function 'int main()':
a.cc:7:22: error: expected ';' before '<=' token
7 | for(int i=a,i<=b;i++)
| ^~
| ;
a.cc:7:22: error: expected primary-expression before '<=' token
7 | for(int i=a,i<=b;i++)
| ^~
|
s246896540 | p03861 | C++ | #include<bits/stdc++.h>
using namespace std;
int main()
{
int a,b,x,z=0;
cin>>a>>b>>x;
for(int i=a,i<=b;i++)
if(i%x==0)
z++;
cout<<z<<endl;
return 0;
} | a.cc: In function 'int main()':
a.cc:7:22: error: expected ';' before '<=' token
7 | for(int i=a,i<=b;i++)
| ^~
| ;
a.cc:7:22: error: expected primary-expression before '<=' token
7 | for(int i=a,i<=b;i++)
| ^~
|
s450233571 | p03861 | C++ | #include <bits/stdc++.h>
using namespace std;
using ll = long long;
using P = pair<ll,ll>;
#define rep(i,n) for(int (i)=0;(i)<(n);(i)++)
#define rep2(i,m,n) for(int (i)=(m);(i)<(n);(i)++)
int main(){
ios::sync_with_stdio(false);
cin.tie(0);
ll a,b,x;cin>>a>>b>>x;b+=x;a+=x;
cout<<b/x-(a-1)/x<<endl;
return 0; | a.cc: In function 'int main()':
a.cc:15:14: error: expected '}' at end of input
15 | return 0;
| ^
a.cc:9:11: note: to match this '{'
9 | int main(){
| ^
|
s970503792 | p03861 | C++ | #include<bits/stdc++.h>
using namespace std;
constexpr int64_t mod=1e9+7;
int main()
{
int64_t a,b,x;
cin>>a>>b>>x;
int64_t ans=b/x-a/x;
if(a%x==0s) ans++;
cout<<ans;
} | a.cc: In function 'int main()':
a.cc:10:9: error: no match for 'operator==' (operand types are 'int64_t' {aka 'long int'} and 'std::chrono::seconds' {aka 'std::chrono::duration<long int>'})
10 | if(a%x==0s) ans++;
| ~~~^~~~
| | |
| | std::chrono::seconds {aka std::chrono::duration<long int>}
| int64_t {aka long 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:10:11: note: mismatched types 'const std::__cxx11::sub_match<_BiIter>' and 'int64_t' {aka 'long int'}
10 | if(a%x==0s) ans++;
| ^~
/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:10:11: note: mismatched types 'std::__cxx11::__sub_match_string<_Bi_iter, _Ch_traits, _Ch_alloc>' and 'int64_t' {aka 'long int'}
10 | if(a%x==0s) ans++;
| ^~
/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:10:11: note: mismatched types 'const std::__cxx11::sub_match<_BiIter>' and 'int64_t' {aka 'long int'}
10 | if(a%x==0s) ans++;
| ^~
/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:10:11: note: 'std::chrono::seconds' {aka 'std::chrono::duration<long int>'} is not derived from 'const std::__cxx11::sub_match<_BiIter>'
10 | if(a%x==0s) ans++;
| ^~
/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:10:11: note: mismatched types 'const std::__cxx11::sub_match<_BiIter>' and 'int64_t' {aka 'long int'}
10 | if(a%x==0s) ans++;
| ^~
/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:10:11: note: 'std::chrono::seconds' {aka 'std::chrono::duration<long int>'} is not derived from 'const std::__cxx11::sub_match<_BiIter>'
10 | if(a%x==0s) ans++;
| ^~
/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:10:11: note: mismatched types 'const std::__cxx11::sub_match<_BiIter>' and 'int64_t' {aka 'long int'}
10 | if(a%x==0s) ans++;
| ^~
/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:10:11: note: mismatched types 'const std::__cxx11::match_results<_BiIter, _Alloc>' and 'int64_t' {aka 'long int'}
10 | if(a%x==0s) ans++;
| ^~
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:10:11: note: mismatched types 'const std::pair<_T1, _T2>' and 'int64_t' {aka 'long int'}
10 | if(a%x==0s) ans++;
| ^~
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:10:11: note: mismatched types 'const std::reverse_iterator<_Iterator>' and 'int64_t' {aka 'long int'}
10 | if(a%x==0s) ans++;
| ^~
/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:10:11: note: mismatched types 'const std::reverse_iterator<_Iterator>' and 'int64_t' {aka 'long int'}
10 | if(a%x==0s) ans++;
| ^~
/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:10:11: note: mismatched types 'const std::move_iterator<_IteratorL>' and 'int64_t' {aka 'long int'}
10 | if(a%x==0s) ans++;
| ^~
/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:10:11: note: mismatched types 'const std::move_iterator<_IteratorL>' and 'int64_t' {aka 'long int'}
10 | if(a%x==0s) ans++;
| ^~
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:10:11: note: mismatched types 'const std::fpos<_StateT>' and 'int64_t' {aka 'long int'}
10 | if(a%x==0s) ans++;
| ^~
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:10:11: note: mismatched types 'const std::allocator<_CharT>' and 'int64_t' {aka 'long int'}
10 | if(a%x==0s) ans++;
| ^~
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<basic_string_view<_CharT, _Traits> >)'
629 | operator==(basic_string_view<_CharT, _Traits> __x,
| ^~~~~~~~
/usr/include/c++/14/string_view:629:5: note: template argument deduction/substitution failed:
a.cc:10:11: note: mismatched types 'std::basic_string_view<_CharT, _Traits>' and 'long int'
10 | if(a%x==0s) ans++;
| ^~
/usr/include/c++/14/string_view:637:5: note: candidate: 'template<class _CharT, class _Traits> constexpr bool std::operator==(basic_string_view<_CharT, _Traits>, basic_string_view<_CharT, _Traits>)'
637 | operat |
s810557221 | p03861 | C++ | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
int main() {
ll a,b,x;
cin>>a>>b>>x;
cout<<b/x-max(0,a-1)/x<<endl;
return 0;
} | a.cc: In function 'int main()':
a.cc:8:18: error: no matching function for call to 'max(int, ll)'
8 | cout<<b/x-max(0,a-1)/x<<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:8:18: note: deduced conflicting types for parameter 'const _Tp' ('int' and 'll' {aka 'long long int'})
8 | 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:
/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:18: note: mismatched types 'std::initializer_list<_Tp>' and 'int'
8 | cout<<b/x-max(0,a-1)/x<<endl;
| ~~~^~~~~~~
|
s840395430 | p03861 | C++ | #include<bits/stdc++.h>
#define int long long
using namespace std;
int a,b,x,y,n=0;
int main()
{
cin>>a>>b>>x;
for(int i=a;i<=b;i++)
{
y=i;
if(y%x==0)n++;
}
cout<<n<<endl;
} | cc1plus: error: '::main' must return 'int'
|
s583169797 | p03861 | C++ | #include<bits/stdc++.h>
using namespace std;
unsigned long long
int main () {
unsigned long long a, b, x, count = 0;
cin >> a >> b >> x;
for (unsigned long long i = a; i <= b; i++){
if ((i%x) == 0){
count++;
}
}
cout << count << endl;
} | a.cc:6:1: error: '::main' must return 'int'
6 | int main () {
| ^~~
|
s663786193 | p03861 | C++ | #include<bits/stdc++.h>
using namespace std;
unsigned long long a, b, x, count = 0;
int main () {
cin >> a >> b >> x;
for (unsigned long long i = a; i <= b; i++){
if ((i%x) == 0){
count++;
}
}
cout << count << endl;
} | a.cc: In function 'int main()':
a.cc:10:7: error: reference to 'count' is ambiguous
10 | count++;
| ^~~~~
In file included from /usr/include/c++/14/algorithm:86,
from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:51,
from a.cc:1:
/usr/include/c++/14/pstl/glue_algorithm_defs.h:101:1: note: candidates are: 'template<class _ExecutionPolicy, class _ForwardIterator, class _Tp> __pstl::__internal::__enable_if_execution_policy<_ExecutionPolicy, typename std::iterator_traits<_II>::difference_type> std::count(_ExecutionPolicy&&, _ForwardIterator, _ForwardIterator, const _Tp&)'
101 | count(_ExecutionPolicy&& __exec, _ForwardIterator __first, _ForwardIterator __last, const _Tp& __value);
| ^~~~~
In file included from /usr/include/c++/14/algorithm:61:
/usr/include/c++/14/bits/stl_algo.h:4025:5: note: 'template<class _IIter, class _Tp> typename std::iterator_traits< <template-parameter-1-1> >::difference_type std::count(_IIter, _IIter, const _Tp&)'
4025 | count(_InputIterator __first, _InputIterator __last, const _Tp& __value)
| ^~~~~
a.cc:4:29: note: 'long long unsigned int count'
4 | unsigned long long a, b, x, count = 0;
| ^~~~~
a.cc:13:11: error: reference to 'count' is ambiguous
13 | cout << count << endl;
| ^~~~~
/usr/include/c++/14/pstl/glue_algorithm_defs.h:101:1: note: candidates are: 'template<class _ExecutionPolicy, class _ForwardIterator, class _Tp> __pstl::__internal::__enable_if_execution_policy<_ExecutionPolicy, typename std::iterator_traits<_II>::difference_type> std::count(_ExecutionPolicy&&, _ForwardIterator, _ForwardIterator, const _Tp&)'
101 | count(_ExecutionPolicy&& __exec, _ForwardIterator __first, _ForwardIterator __last, const _Tp& __value);
| ^~~~~
/usr/include/c++/14/bits/stl_algo.h:4025:5: note: 'template<class _IIter, class _Tp> typename std::iterator_traits< <template-parameter-1-1> >::difference_type std::count(_IIter, _IIter, const _Tp&)'
4025 | count(_InputIterator __first, _InputIterator __last, const _Tp& __value)
| ^~~~~
a.cc:4:29: note: 'long long unsigned int count'
4 | unsigned long long a, b, x, count = 0;
| ^~~~~
|
s028594936 | p03861 | C++ | #include<bits/stdc++.h>
using namespace std;
unsigned long long a, b, x, count = 0;
int main () {
cin >> a >> b >> x;
for (unsigned long long i = a; i <= b; i++){
if (i%x == 0)
count++;
}
cout << count << endl;
} | a.cc: In function 'int main()':
a.cc:10:7: error: reference to 'count' is ambiguous
10 | count++;
| ^~~~~
In file included from /usr/include/c++/14/algorithm:86,
from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:51,
from a.cc:1:
/usr/include/c++/14/pstl/glue_algorithm_defs.h:101:1: note: candidates are: 'template<class _ExecutionPolicy, class _ForwardIterator, class _Tp> __pstl::__internal::__enable_if_execution_policy<_ExecutionPolicy, typename std::iterator_traits<_II>::difference_type> std::count(_ExecutionPolicy&&, _ForwardIterator, _ForwardIterator, const _Tp&)'
101 | count(_ExecutionPolicy&& __exec, _ForwardIterator __first, _ForwardIterator __last, const _Tp& __value);
| ^~~~~
In file included from /usr/include/c++/14/algorithm:61:
/usr/include/c++/14/bits/stl_algo.h:4025:5: note: 'template<class _IIter, class _Tp> typename std::iterator_traits< <template-parameter-1-1> >::difference_type std::count(_IIter, _IIter, const _Tp&)'
4025 | count(_InputIterator __first, _InputIterator __last, const _Tp& __value)
| ^~~~~
a.cc:4:29: note: 'long long unsigned int count'
4 | unsigned long long a, b, x, count = 0;
| ^~~~~
a.cc:12:11: error: reference to 'count' is ambiguous
12 | cout << count << endl;
| ^~~~~
/usr/include/c++/14/pstl/glue_algorithm_defs.h:101:1: note: candidates are: 'template<class _ExecutionPolicy, class _ForwardIterator, class _Tp> __pstl::__internal::__enable_if_execution_policy<_ExecutionPolicy, typename std::iterator_traits<_II>::difference_type> std::count(_ExecutionPolicy&&, _ForwardIterator, _ForwardIterator, const _Tp&)'
101 | count(_ExecutionPolicy&& __exec, _ForwardIterator __first, _ForwardIterator __last, const _Tp& __value);
| ^~~~~
/usr/include/c++/14/bits/stl_algo.h:4025:5: note: 'template<class _IIter, class _Tp> typename std::iterator_traits< <template-parameter-1-1> >::difference_type std::count(_IIter, _IIter, const _Tp&)'
4025 | count(_InputIterator __first, _InputIterator __last, const _Tp& __value)
| ^~~~~
a.cc:4:29: note: 'long long unsigned int count'
4 | unsigned long long a, b, x, count = 0;
| ^~~~~
|
s611787858 | p03861 | C++ | #include<bits/stdc++.h>
unsigned long long a, b, x, count = 0;
int main () {
cin >> a >> b >> x;
for (unsigned long long i = a; i <= b; i++){
if (i%x == 0)
count++;
}
cout << count << endl;
} | a.cc: In function 'int main()':
a.cc:6:3: error: 'cin' was not declared in this scope; did you mean 'std::cin'?
6 | 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:11:3: error: 'cout' was not declared in this scope; did you mean 'std::cout'?
11 | cout << count << 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:21: error: 'endl' was not declared in this scope; did you mean 'std::endl'?
11 | cout << count << 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)
| ^~~~
|
s613177089 | p03861 | C++ | #include<bits/stdc++.h>
unsigned long long a, b, x, count = 0;
int main () {
cin >> a >> b >> x;
for (unsigned long long i = a; i <= b; i++){
if (i%x == 0)
count++
}
cout << count << endl;
} | a.cc: In function 'int main()':
a.cc:6:3: error: 'cin' was not declared in this scope; did you mean 'std::cin'?
6 | 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:14: error: expected ';' before '}' token
9 | count++
| ^
| ;
10 | }
| ~
a.cc:11:3: error: 'cout' was not declared in this scope; did you mean 'std::cout'?
11 | cout << count << 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:21: error: 'endl' was not declared in this scope; did you mean 'std::endl'?
11 | cout << count << 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)
| ^~~~
|
s908806154 | p03861 | C++ | #include<bits/stdc++.h>
unsigned long long a, b, count = 0;
int main () {
cin >> a >> b;
for (unsigned long long i = a; i <= b; i++){
if (i%x == 0)
count++
}
cout << count << endl;
} | a.cc: In function 'int main()':
a.cc:6:3: error: 'cin' was not declared in this scope; did you mean 'std::cin'?
6 | cin >> 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:8:11: error: 'x' was not declared in this scope
8 | if (i%x == 0)
| ^
a.cc:9:14: error: expected ';' before '}' token
9 | count++
| ^
| ;
10 | }
| ~
a.cc:11:3: error: 'cout' was not declared in this scope; did you mean 'std::cout'?
11 | cout << count << 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:21: error: 'endl' was not declared in this scope; did you mean 'std::endl'?
11 | cout << count << 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)
| ^~~~
|
s517155619 | p03861 | C++ | #include<bits/stdc++.h>
using namespace std;
int main(void) {
long long a, b, x;
cin >> a >> b >> x;
if (a == 0) {
ans = b / x + 1;
cout << ans << endl;
}
else {
ans = b / x - (a - 1) / 2;
cout << ans << endl;
}
} | a.cc: In function 'int main()':
a.cc:9:5: error: 'ans' was not declared in this scope; did you mean 'abs'?
9 | ans = b / x + 1;
| ^~~
| abs
a.cc:14:5: error: 'ans' was not declared in this scope; did you mean 'abs'?
14 | ans = b / x - (a - 1) / 2;
| ^~~
| abs
|
s533052446 | p03861 | C++ | include<bits/stdc++.h>
using namespace std;
int main(void) {
long long a, b, x;
cin >> a >> b >> x;
if (a == 0) {
ans = b / x + 1;
cout << ans << endl;
}
else {
ans = b / x - (a - 1) / 2;
cout << ans << endl;
}
} | a.cc:1:1: error: 'include' does not name a type
1 | include<bits/stdc++.h>
| ^~~~~~~
a.cc: In function 'int main()':
a.cc:6:3: error: 'cin' was not declared in this scope
6 | cin >> a >> b >> x;
| ^~~
a.cc:9:5: error: 'ans' was not declared in this scope
9 | ans = b / x + 1;
| ^~~
a.cc:10:5: error: 'cout' was not declared in this scope
10 | cout << ans << endl;
| ^~~~
a.cc:10:20: error: 'endl' was not declared in this scope
10 | cout << ans << endl;
| ^~~~
a.cc:14:5: error: 'ans' was not declared in this scope
14 | ans = b / x - (a - 1) / 2;
| ^~~
a.cc:15:5: error: 'cout' was not declared in this scope
15 | cout << ans << endl;
| ^~~~
a.cc:15:20: error: 'endl' was not declared in this scope
15 | cout << ans << endl;
| ^~~~
|
s352019043 | p03861 | C++ | #include <bits/stdc++.h>
#define SORT(x) sort((x).begin(),(x).end())
#define ALL(x) x.begin(),x.end()
#define db(x) cout<<#x<<"="<<x<<endl
#define rep(i, n) for(int i = 0; i < n; i++)
#define reps(i, m, n) for(int i = m; i < n; i++)
#define repr(i, m, n) for(int i = m; i >= n; i--)
#define INF (1e9)
#define PI (acos(-1))
#define MOD 1000000007
using namespace std;
typedef long long ll;
void Main(){
ll a,b;
ll x;
cin>>a>b>>x;
cout << (b/x)-((a-1)/x)<<"\n";
}
//-----------------------------------
int main(){
cin.tie(nullptr);
ios_base::sync_with_stdio(false);
cout << fixed << setprecision(15);
Main();
}
//-----------------------------------
| a.cc: In function 'void Main()':
a.cc:20:9: error: no match for 'operator>' (operand types are 'std::basic_istream<char>::__istream_type' {aka 'std::basic_istream<char>'} and 'll' {aka 'long long int'})
20 | cin>>a>b>>x;
| ~~~~~~^~~~~
| | |
| | ll {aka long long int}
| std::basic_istream<char>::__istream_type {aka std::basic_istream<char>}
a.cc:20:9: note: candidate: 'operator>(int, ll {aka long long int})' (built-in)
20 | cin>>a>b>>x;
| ~~~~~~^~~~~
a.cc:20:9: note: no known conversion for argument 1 from 'std::basic_istream<char>::__istream_type' {aka 'std::basic_istream<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:1176:5: note: candidate: 'template<class _BiIter> bool std::__cxx11::operator>(const sub_match<_BiIter>&, const sub_match<_BiIter>&)'
1176 | operator>(const sub_match<_BiIter>& __lhs, const sub_match<_BiIter>& __rhs)
| ^~~~~~~~
/usr/include/c++/14/bits/regex.h:1176:5: note: template argument deduction/substitution failed:
a.cc:20:13: note: 'std::basic_istream<char>::__istream_type' {aka 'std::basic_istream<char>'} is not derived from 'const std::__cxx11::sub_match<_BiIter>'
20 | cin>>a>b>>x;
| ^
/usr/include/c++/14/bits/regex.h:1236: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>&)'
1236 | operator>(const __sub_match_string<_Bi_iter, _Ch_traits, _Ch_alloc>& __lhs,
| ^~~~~~~~
/usr/include/c++/14/bits/regex.h:1236:5: note: template argument deduction/substitution failed:
a.cc:20:13: note: 'std::basic_istream<char>::__istream_type' {aka 'std::basic_istream<char>'} is not derived from 'std::__cxx11::__sub_match_string<_Bi_iter, _Ch_traits, _Ch_alloc>'
20 | cin>>a>b>>x;
| ^
/usr/include/c++/14/bits/regex.h:1329: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>&)'
1329 | operator>(const sub_match<_Bi_iter>& __lhs,
| ^~~~~~~~
/usr/include/c++/14/bits/regex.h:1329:5: note: template argument deduction/substitution failed:
a.cc:20:13: note: 'std::basic_istream<char>::__istream_type' {aka 'std::basic_istream<char>'} is not derived from 'const std::__cxx11::sub_match<_BiIter>'
20 | cin>>a>b>>x;
| ^
/usr/include/c++/14/bits/regex.h:1403:5: note: candidate: 'template<class _Bi_iter> bool std::__cxx11::operator>(const typename std::iterator_traits<_Iter>::value_type*, const sub_match<_BiIter>&)'
1403 | operator>(typename iterator_traits<_Bi_iter>::value_type const* __lhs,
| ^~~~~~~~
/usr/include/c++/14/bits/regex.h:1403:5: note: template argument deduction/substitution failed:
a.cc:20:13: note: mismatched types 'const std::__cxx11::sub_match<_BiIter>' and 'll' {aka 'long long int'}
20 | cin>>a>b>>x;
| ^
/usr/include/c++/14/bits/regex.h:1497:5: note: candidate: 'template<class _Bi_iter> bool std::__cxx11::operator>(const sub_match<_BiIter>&, const typename std::iterator_traits<_Iter>::value_type*)'
1497 | operator>(const sub_match<_Bi_iter>& __lhs,
| ^~~~~~~~
/usr/include/c++/14/bits/regex.h:1497:5: note: template argument deduction/substitution failed:
a.cc:20:13: note: 'std::basic_istream<char>::__istream_type' {aka 'std::basic_istream<char>'} is not derived from 'const std::__cxx11::sub_match<_BiIter>'
20 | cin>>a>b>>x;
| ^
/usr/include/c++/14/bits/regex.h:1573:5: note: candidate: 'template<class _Bi_iter> bool std::__cxx11::operator>(const typename std::iterator_traits<_Iter>::value_type&, const sub_match<_BiIter>&)'
1573 | operator>(typename iterator_traits<_Bi_iter>::value_type const& __lhs,
| ^~~~~~~~
/usr/include/c++/14/bits/regex.h:1573:5: note: template argument deduction/substitution failed:
a.cc:20:13: note: mismatched types 'const std::__cxx11::sub_match<_BiIter>' and 'll' {aka 'long long int'}
20 | cin>>a>b>>x;
| ^
/usr/include/c++/14/bits/regex.h:1673:5: note: candidate: 'template<class _Bi_iter> bool std::__cxx11::operator>(const sub_match<_BiIter>&, const typename std::iterator_traits<_Iter>::value_type&)'
1673 | operator>(const sub_match<_Bi_iter>& __lhs,
| ^~~~~~~~
/usr/include/c++/14/bits/regex.h:1673:5: note: template argument deduction/substitution failed:
a.cc:20:13: note: 'std::basic_istream<char>::__istream_type' {aka 'std::basic_istream<char>'} is not derived from 'const std::__cxx11::sub_match<_BiIter>'
20 | cin>>a>b>>x;
| ^
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:1058:5: note: candidate: 'template<class _T1, class _T2> constexpr bool std::operator>(const pair<_T1, _T2>&, const pair<_T1, _T2>&)'
1058 | operator>(const pair<_T1, _T2>& __x, const pair<_T1, _T2>& __y)
| ^~~~~~~~
/usr/include/c++/14/bits/stl_pair.h:1058:5: note: template argument deduction/substitution failed:
a.cc:20:13: note: 'std::basic_istream<char>::__istream_type' {aka 'std::basic_istream<char>'} is not derived from 'const std::pair<_T1, _T2>'
20 | cin>>a>b>>x;
| ^
In file included from /usr/include/c++/14/bits/stl_algobase.h:67:
/usr/include/c++/14/bits/stl_iterator.h:462:5: note: candidate: 'template<class _Iterator> constexpr bool std::operator>(const reverse_iterator<_Iterator>&, const reverse_iterator<_Iterator>&)'
462 | operator>(const reverse_iterator<_Iterator>& __x,
| ^~~~~~~~
/usr/include/c++/14/bits/stl_iterator.h:462:5: note: template argument deduction/substitution failed:
a.cc:20:13: note: 'std::basic_istream<char>::__istream_type' {aka 'std::basic_istream<char>'} is not derived from 'const std::reverse_iterator<_Iterator>'
20 | cin>>a>b>>x;
| ^
/usr/include/c++/14/bits/stl_iterator.h:507:5: note: candidate: 'template<class _IteratorL, class _IteratorR> constexpr bool std::operator>(const reverse_iterator<_Iterator>&, const reverse_iterator<_IteratorR>&)'
507 | operator>(const reverse_iterator<_IteratorL>& __x,
| ^~~~~~~~
/usr/include/c++/14/bits/stl_iterator.h:507:5: note: template argument deduction/substitution failed:
a.cc:20:13: note: 'std::basic_istream<char>::__istream_type' {aka 'std::basic_istream<char>'} is not derived from 'const std::reverse_iterator<_Iterator>'
20 | cin>>a>b>>x;
| ^
/usr/include/c++/14/bits/stl_iterator.h:1714:5: note: candidate: 'template<class _IteratorL, class _IteratorR> constexpr bool std::operator>(const move_iterator<_IteratorL>&, const move_iterator<_IteratorR>&)'
1714 | operator>(const move_iterator<_IteratorL>& __x,
| ^~~~~~~~
/usr/include/c++/14/bits/stl_iterator.h:1714:5: note: template argument deduction/substitution failed:
a.cc:20:13: note: 'std::basic_istream<char>::__istream_type' {aka 'std::basic_istream<char>'} is not derived from 'const std::move_iterator<_IteratorL>'
20 | cin>>a>b>>x;
| ^
/usr/include/c++/14/bits/stl_iterator.h:1774:5: note: candidate: 'template<class _Iterator> constexpr bool std::operator>(const move_iterator<_IteratorL>&, const move_iterator<_IteratorL>&)'
1774 | operator>(const move_iterator<_Iterator>& __x,
| ^~~~~~~~
/usr/include/c++/14/bits/stl_iterator.h:1774:5: note: template argument deduction/substitution failed:
a.cc:20:13: note: 'std::basic_istream<char>::__istream_type' {aka 'std::basic_istream<char>'} is not derived from 'const std::move_iterator<_IteratorL>'
20 | cin>>a>b>>x;
| ^
In file included from /usr/include/c++/14/bits/basic_string.h:47,
from /usr/include/c++/14/string:54,
from /usr/include/c++/14/bitset:52,
from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:52:
/usr/include/c++/14/string_view:695:5: note: candidate: 'template<class _CharT, class _Traits> constexpr bool std::operator>(basic_string_view<_CharT, _Traits>, basic_string_view<_CharT, _Traits>)'
695 | operator> (basic_string_view<_CharT, _Traits> __x,
| ^~~~~~~~
/usr/include/c++/14/string_view:695:5: note: template argument deduction/substitution failed:
a.cc:20:13: note: 'std::basic_istream<char>' is not derived from 'std::basic_string_view<_CharT, _Traits>'
20 | cin>>a>b>>x;
| ^
/usr/include/c++/14/string_view:702:5: note: candidate: 'template<class _CharT, class _Traits> constexpr bool std::operator>(basic_string_view<_CharT, _Traits>, __type_identity_t<basic_string_view<_CharT, _Traits> >)'
702 | operator> (basic_string_view<_CharT, _Traits> __x,
| ^~~~~~~~
/usr/include/c++/14/string_view:702:5: note: template argument deduction/substitution failed:
a.cc:20:13: note: 'std::basic_istream<char>' is not derived from 'std::basic_string_view<_CharT, _Traits>'
20 | cin>>a>b>>x;
| ^
/usr/include/c++/14/string_view:710:5: note: candidate: 'template<class _CharT, class _Traits> constexpr bool std::operator>(__type_identity_t<basic_string_view<_CharT, _Traits> >, basic_string_view<_CharT, _Traits>)'
710 | operator> (__type_identity_t<basic_string_view<_CharT, _Traits>> __x,
| ^~~~~~~~
/usr/include/c++/14/string_view:710:5: note: template argument deduction/substitution failed:
a.cc:20:13: note: mismatched types 'std::basic_string_view<_CharT, _Traits>' and 'long long int'
20 | cin>>a>b>>x;
| ^
/usr/include/c++/14/bits/basic_string.h:3915:5: note: candidate: 'template<class _CharT, class _Traits, class _Alloc> bool std::operator>(const __cxx11::basic_string<_CharT, _Traits, _Allocator>&, const __cxx11::basic_string<_CharT, _Tr |
s787352825 | p03861 | C++ | include <bits/stdc++.h>
using namespace std;
int main(void){
long long int a,b,x,c=0;
cin >> a >> b >> x;
if(a==0) c=1;
cout << b/x-(a-1)/x+c << endl;
} | a.cc:1:1: error: 'include' does not name a type
1 | include <bits/stdc++.h>
| ^~~~~~~
a.cc: In function 'int main()':
a.cc:6:3: error: 'cin' was not declared in this scope
6 | cin >> a >> b >> x;
| ^~~
a.cc:8:3: error: 'cout' was not declared in this scope
8 | cout << b/x-(a-1)/x+c << endl;
| ^~~~
a.cc:8:28: error: 'endl' was not declared in this scope
8 | cout << b/x-(a-1)/x+c << endl;
| ^~~~
|
s679296358 | p03861 | C | #include<stdio.h>
int main()
{
int a,b,m,i,count=0;
scanf("%d %d %d",&a,&b,&m);
for(i=a;i<=b;i++)
{
if((i%m)==0)
{
count++;
i;
}}
printf("%d\n",count);
printf("There are %d integers between %d and %d, inclusive, that are divisible by %d:",count,a,b,m);
for(i=a;i<=b;i++)
{
if((i%m)==0)
printf("%d,",i);
}
| main.c: In function 'main':
main.c:25:5: error: expected declaration or statement at end of input
25 | }
| ^
|
s772839732 | p03861 | C | #include<stdio.h>
int main()
{
long long int a,x,b,d;
int count=0
scanf("%lld%lld%lld",&a,&b,&x);
c=b/x-a/x;
if(a%x==0)
count++;
printf("%lld",c+count);
return 0;
}
| main.c: In function 'main':
main.c:6:5: error: expected ',' or ';' before 'scanf'
6 | scanf("%lld%lld%lld",&a,&b,&x);
| ^~~~~
main.c:7:5: error: 'c' undeclared (first use in this function)
7 | c=b/x-a/x;
| ^
main.c:7:5: note: each undeclared identifier is reported only once for each function it appears in
|
s222095044 | p03861 | C |
#include<bits/stdc++.h>
#define ll long long
using namespace std;
int main()
{
ll a,b,x,result;
cin>>a>>b>>x;
while(a%x!=0 && a<=b)
{
a++;
}
result=(b-a)/x;
if(result!=0)
cout<<result+1<<endl;
else cout<<result<<endl;
}
| main.c:2:9: fatal error: bits/stdc++.h: No such file or directory
2 | #include<bits/stdc++.h>
| ^~~~~~~~~~~~~~~
compilation terminated.
|
s577901137 | p03861 | C++ | #include <bits/stdc++.h>
using namespace std;
int main() {
int64_t a,b,x;
cin>>a>>b>>x;
if(b-a>0&&(b-a)/x>=1){
cout<<(b-a)/x<<endl;
}
if(b-a>0&&(b-a)/x==0){
if((b/x-a/x)==1){
cout<<1<<endl;
}
else{
cout<<0<<endl;
}
if(a==b){
if(a%x==0){
cout<<1<<endl;
}
else{
cout<<0<<endl;
}
}
}
| a.cc: In function 'int main()':
a.cc:25:2: error: expected '}' at end of input
25 | }
| ^
a.cc:4:12: note: to match this '{'
4 | int main() {
| ^
|
s951237662 | p03861 | C++ | #include <bits/stdc++.h>
using namespace std;
int main() {
int64_t a,b;
cin>>a>>b;
if(b-a>0){
cout<<(b-a)/x)<<endl;
}
else{
cout<<0<<endl;
}
} | a.cc: In function 'int main()':
a.cc:8:17: error: 'x' was not declared in this scope
8 | cout<<(b-a)/x)<<endl;
| ^
|
s830999015 | p03861 | C | #include<stdio.h>
int main(){
int a,b,x;
scanf("%d %d %d",&a,&b,&c);
int i,j=0;
for(i=a;i<=b;i++){
if(i%x==0)j++;
}
printf("%d",j);
return 0;
} | main.c: In function 'main':
main.c:4:27: error: 'c' undeclared (first use in this function)
4 | scanf("%d %d %d",&a,&b,&c);
| ^
main.c:4:27: note: each undeclared identifier is reported only once for each function it appears in
|
s271399866 | p03861 | C++ | #include<bits/stdc++.h>
using namespace std;
int _main() {
long int a, b, x;
cin >> a >> b >> x;
long int n_a = a / x;
if(a % x == 0) --n_a;
long int n_b = b / x;
long int answer = n_b - n_a;
cout << answer << endl;
} | a.cc: In function 'int _main()':
a.cc:13:1: warning: no return statement in function returning non-void [-Wreturn-type]
13 | }
| ^
/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
|
s313740905 | p03861 | C++ | #include "stdafx.h"
#include<math.h>
#include<map>
#include<iostream>
#include <algorithm>
#include <string>
#include<vector>
#include<array>
#include<tuple>
#include<queue>
#include<stack>
#include<iomanip>
#include<bitset>
#include <list>
#include<numeric>
//AtCoderC++.cpp
using namespace std;
inline int ceiling(int n, int d) {
return n % d == 0 ? n / d : n / d + 1;
}
int main() {
long long a, b, x; cin >> a >> b >> x;
long long answer = (b - a + 1) / x;
if (a%x == 0 || b % x == 0)++answer;
cout << answer << endl;
}
| a.cc:1:10: fatal error: stdafx.h: No such file or directory
1 | #include "stdafx.h"
| ^~~~~~~~~~
compilation terminated.
|
s145184455 | p03861 | C++ | #include "stdafx.h"
#include<math.h>
#include<map>
#include<iostream>
#include <algorithm>
#include <string>
#include<vector>
#include<array>
#include<tuple>
#include<queue>
#include<stack>
#include<iomanip>
#include<bitset>
#include <list>
#include<numeric>
//AtCoderC++.cpp
using namespace std;
inline int ceiling(int n, int d) {
return n % d == 0 ? n / d : n / d + 1;
}
int main() {
long long a, b, x; cin >> a >> b >> x;
long long answer = (b - a + 1) / x;
if (a%x == 0 || b % x == 0)++answer;
cout << answer << endl;
}
| a.cc:1:10: fatal error: stdafx.h: No such file or directory
1 | #include "stdafx.h"
| ^~~~~~~~~~
compilation terminated.
|
s871431969 | p03861 | C++ | #include <bits/stdc++.h>
using namespace std;
int main()
{
long long a,b,x,s,e;
cin>>a>>b>>x);
if(a%x==0)
s=a/x;
else
s=a/x+1;
e=b/x;
cout<<e-s+1<<endl;
return 0;
} | a.cc: In function 'int main()':
a.cc:6:17: error: expected ';' before ')' token
6 | cin>>a>>b>>x);
| ^
| ;
|
s377222609 | p03861 | C++ | #include<cstdio>
long long a,b,x,s,e;
int main()
{
cin>>a>>b>>x);
if(a%x==0)
s=a/x;
else
s=a/x+1;
e=b/x;
cout<<e-s+1<<endl;
return 0;
} | a.cc: In function 'int main()':
a.cc:5:5: error: 'cin' was not declared in this scope
5 | cin>>a>>b>>x);
| ^~~
a.cc:11:5: error: 'cout' was not declared in this scope
11 | cout<<e-s+1<<endl;
| ^~~~
a.cc:11:18: error: 'endl' was not declared in this scope
11 | cout<<e-s+1<<endl;
| ^~~~
|
s806477681 | p03861 | C++ | x,y,z = int(map(input().split))
print(y//z-(x-1)//z) | a.cc:1:1: error: 'x' does not name a type
1 | x,y,z = int(map(input().split))
| ^
|
s714778708 | p03861 | C++ | nclude<bits/stdc++.h>
using namespace std;
int main(){
long a,b,x;
cin>>a>>b>>x;
long ans;
if(a>0){
ans=(b/x)-(a-1)/x;
cout<<ans;
}
else{
ans=(b/x)+1;
cout<<ans;
}
} | a.cc:1:1: error: 'nclude' does not name a type
1 | nclude<bits/stdc++.h>
| ^~~~~~
a.cc: In function 'int main()':
a.cc:5:1: error: 'cin' was not declared in this scope
5 | cin>>a>>b>>x;
| ^~~
a.cc:9:1: error: 'cout' was not declared in this scope
9 | cout<<ans;
| ^~~~
a.cc:13:1: error: 'cout' was not declared in this scope
13 | cout<<ans;
| ^~~~
|
s988485819 | p03861 | C++ | nclude<bits/stdc++.h>
using namespace std;
int main(){
long a,b,x;
cin>>a>>b>>x;
long ans;
if(a>0){
ans=(b/x)-(a-1)/x;
cout<<ans;
}
else{
ans=(b/x)+1;
cout<<ans;
}
} | a.cc:1:1: error: 'nclude' does not name a type
1 | nclude<bits/stdc++.h>
| ^~~~~~
a.cc: In function 'int main()':
a.cc:5:1: error: 'cin' was not declared in this scope
5 | cin>>a>>b>>x;
| ^~~
a.cc:9:1: error: 'cout' was not declared in this scope
9 | cout<<ans;
| ^~~~
a.cc:13:1: error: 'cout' was not declared in this scope
13 | cout<<ans;
| ^~~~
|
s435912241 | p03861 | C++ | #include<bits/stdc++.h>
using namespace std;
int main(){
long a,b,x;
cin>>a>>b>>x;
long ans;
if(a>0){
ans=(b/x)-(a-1)/2;
cout<<ans;
}
else{
ans=(b/2)+1
cout<<ans;
}
} | a.cc: In function 'int main()':
a.cc:12:12: error: expected ';' before 'cout'
12 | ans=(b/2)+1
| ^
| ;
13 | cout<<ans;
| ~~~~
|
s438824887 | p03861 | C++ | #include<bits/std c++.h>
using namespace std;
int main()
{
long long a,b,x;
scan f("%lld %lld %lld",&a,&b,&x);
long long ans;
if(a==0){
ans=(b/x)+1;
}
else{
ans=b/x-(a-1)/x;
}
printf("%lld",ans);
return 0;
} | a.cc:1:9: fatal error: bits/std c++.h: No such file or directory
1 | #include<bits/std c++.h>
| ^~~~~~~~~~~~~~~~~
compilation terminated.
|
s444203586 | p03861 | C++ | #include <bits/stdc++.h>
using namespace std;
long double a,b,c,ans,m=1;
int main(){
while(m){
cin>>a>>b>>c;
ans=(b-a)/c;;;;;;;
if(a%c==0)
ans++;
cout<<ans;
}
}
| a.cc: In function 'int main()':
a.cc:12:13: error: invalid operands of types 'long double' and 'long double' to binary 'operator%'
12 | if(a%c==0)
| ~^~
| | |
| | long double
| long double
|
s970897629 | p03861 | C++ | #include<bits/stdc++.h>
using namespace std;
int main(){
int a , x , c = 0 ;
long long y;
scanf("%ll %ll %ll", &a , &y , &x);
//cin>>a>>y>>x;
if((0<=a && c <= 10^18) && (1<=x<=10^18))
{
for(long long i = a ; i <= y ; i++)
{
if(i % x == 0)
{
c++;
}
}
}
printf("%d" , c);a
return 0;
} | a.cc: In function 'int main()':
a.cc:22:27: error: expected ';' before 'return'
22 | printf("%d" , c);a
| ^
| ;
23 |
24 | return 0;
| ~~~~~~
|
s205448579 | p03861 | C++ | #include<iostream>
using namespace std;
int main()
{
long long a,b,x,sum=0;
cin>>a>>b>>x;
if(a==b)
{cout<<"0";}
if(a!=b)
{
if((a%x!)=0)
{
if((b%x)==0)
{sum=((b-a)/x)+1;}
if((b%x)!=0)
{sum=(b-a)/x;}}
if(a%x==0)
{sum=((b-a)/x)+1;}
cout<<sum;}
return 0;} | a.cc: In function 'int main()':
a.cc:11:8: error: expected ')' before '!' token
11 | if((a%x!)=0)
| ~ ^
| )
a.cc:16:16: error: expected ')' before 'if'
16 | {sum=(b-a)/x;}}
| ^
| )
17 | if(a%x==0)
| ~~
a.cc:11:3: note: to match this '('
11 | if((a%x!)=0)
| ^
|
s920377914 | p03861 | C++ | #include<iostream>
using namespace std;
int main()
{
long long a,b,x,sum=0;
cin>>a>>b>>x;
if(a==b)
{cout<<"0";}
else
{
if(a%x!=0)
{
if(b%x==0)
{sum=((b-a)/x)+1;
else
sum=(b-a)/x;}
if(a%x==0)
sum=((b-a)/x)+1;
cout<<sum;}
return 0;} | a.cc: In function 'int main()':
a.cc:15:1: error: expected '}' before 'else'
15 | else
| ^~~~
a.cc:14:1: note: to match this '{'
14 | {sum=((b-a)/x)+1;
| ^
|
s545519018 | p03861 | C++ | #include<bits/stdc++.h>
using namespace std;
int main(){
long long a, b, x;
cin >> a >> b >> x;
long long c = b / x;
long long d = a / x;
long long ans = c - d + 1; | a.cc: In function 'int main()':
a.cc:9:35: error: expected '}' at end of input
9 | long long ans = c - d + 1;
| ^
a.cc:4:11: note: to match this '{'
4 | int main(){
| ^
|
s154257934 | p03861 | C++ | #include <iostream>
#include <stdio.h>namespace std;
int main(){
long long a,b,x;
scanf("%lld%lld%lld",&a,&b,&x);
cout<<(b/x-(a-1)/x);
}
| a.cc:2:29: warning: extra tokens at end of #include directive
2 | #include <stdio.h>namespace std;
| ^~~
a.cc:2:10: fatal error: stdio.h>namespac: No such file or directory
2 | #include <stdio.h>namespace std;
| ^~~~~~~~~~~~~~~~~~
compilation terminated.
|
s029443496 | p03861 | C++ | #include <iostream>
using namespace std;
int main(){
long long a,b,x;
cin>>a,b,x;
cout<<(b/x-(a-1)/x);
return0;}
| a.cc: In function 'int main()':
a.cc:8:1: error: 'return0' was not declared in this scope
8 | return0;}
| ^~~~~~~
|
s859121608 | p03861 | C++ | #include <iostream>
#include <stdio.h>
using namespace std;
int main(){
long long a,b,x;
scanf("%lld%lld%lld",&a,&b,&x);
cout<<(b/x-(a-1)/x);
return0;}
| a.cc: In function 'int main()':
a.cc:8:1: error: 'return0' was not declared in this scope
8 | return0;}
| ^~~~~~~
|
s238275817 | p03861 | C++ | #include <iostream>
using namespace std;
int main(){
long long a,b,x;
scanf("%lld%lld%lld",&a,&b,&x);
cout<<( b/x-(a-1)/x);
return0;
| a.cc: In function 'int main()':
a.cc:7:1: error: 'return0' was not declared in this scope
7 | return0;
| ^~~~~~~
a.cc:7:9: error: expected '}' at end of input
7 | return0;
| ^
a.cc:3:11: note: to match this '{'
3 | int main(){
| ^
|
s967564195 | p03861 | C++ | #include <iostream>
#include <stdio.h>
using namespace std;
int main(){
long long a,b,x;
scanf("%lld%lld%lld",&a,&b,&x);
printf(b/x-(a-1)/x);
return0;
| a.cc: In function 'int main()':
a.cc:7:11: error: invalid conversion from 'long long int' to 'const char*' [-fpermissive]
7 | printf(b/x-(a-1)/x);
| ~~~^~~~~~~~
| |
| long long int
In file included from /usr/include/c++/14/cstdio:42,
from /usr/include/c++/14/ext/string_conversions.h:45,
from /usr/include/c++/14/bits/basic_string.h:4154,
from /usr/include/c++/14/string:54,
from /usr/include/c++/14/bits/locale_classes.h:40,
from /usr/include/c++/14/bits/ios_base.h:41,
from /usr/include/c++/14/ios:44,
from /usr/include/c++/14/ostream:40,
from /usr/include/c++/14/iostream:41,
from a.cc:1:
/usr/include/stdio.h:363:43: note: initializing argument 1 of 'int printf(const char*, ...)'
363 | extern int printf (const char *__restrict __format, ...);
| ~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~
a.cc:8:1: error: 'return0' was not declared in this scope
8 | return0;
| ^~~~~~~
a.cc:8:9: error: expected '}' at end of input
8 | return0;
| ^
a.cc:4:11: note: to match this '{'
4 | int main(){
| ^
|
s791414607 | p03861 | C++ | #include <iostream>
using namespace std;
int main(){
long long a,b,x;
scanf("%lld%lld%lld",&a,&b,&x);
printf(b/x-(a-1)/x);
return0; | a.cc: In function 'int main()':
a.cc:6:11: error: invalid conversion from 'long long int' to 'const char*' [-fpermissive]
6 | printf(b/x-(a-1)/x);
| ~~~^~~~~~~~
| |
| long long int
In file included from /usr/include/c++/14/cstdio:42,
from /usr/include/c++/14/ext/string_conversions.h:45,
from /usr/include/c++/14/bits/basic_string.h:4154,
from /usr/include/c++/14/string:54,
from /usr/include/c++/14/bits/locale_classes.h:40,
from /usr/include/c++/14/bits/ios_base.h:41,
from /usr/include/c++/14/ios:44,
from /usr/include/c++/14/ostream:40,
from /usr/include/c++/14/iostream:41,
from a.cc:1:
/usr/include/stdio.h:363:43: note: initializing argument 1 of 'int printf(const char*, ...)'
363 | extern int printf (const char *__restrict __format, ...);
| ~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~
a.cc:7:1: error: 'return0' was not declared in this scope
7 | return0;
| ^~~~~~~
a.cc:7:9: error: expected '}' at end of input
7 | return0;
| ^
a.cc:3:11: note: to match this '{'
3 | int main(){
| ^
|
s153067524 | p03861 | C++ | #include <iostream>
using namespace std;
int main (){
long long a,b,x;
scanf("%lld%lld%lld",&a,&b,&x);
printf(b/x-(a-1)/x);
return 0;
| a.cc: In function 'int main()':
a.cc:6:11: error: invalid conversion from 'long long int' to 'const char*' [-fpermissive]
6 | printf(b/x-(a-1)/x);
| ~~~^~~~~~~~
| |
| long long int
In file included from /usr/include/c++/14/cstdio:42,
from /usr/include/c++/14/ext/string_conversions.h:45,
from /usr/include/c++/14/bits/basic_string.h:4154,
from /usr/include/c++/14/string:54,
from /usr/include/c++/14/bits/locale_classes.h:40,
from /usr/include/c++/14/bits/ios_base.h:41,
from /usr/include/c++/14/ios:44,
from /usr/include/c++/14/ostream:40,
from /usr/include/c++/14/iostream:41,
from a.cc:1:
/usr/include/stdio.h:363:43: note: initializing argument 1 of 'int printf(const char*, ...)'
363 | extern int printf (const char *__restrict __format, ...);
| ~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~
a.cc:7:10: error: expected '}' at end of input
7 | return 0;
| ^
a.cc:3:12: note: to match this '{'
3 | int main (){
| ^
|
s192393912 | p03861 | Java | import java.util.*;
class Main {
public static void main(String[] args) {
Scanner in = new Scanner(System.in);
long a = in.nextLong();
long b = in.nextLong();
long x = in.nextLong();
long count=0;
for(int i=a;i<b;i++){
if(i%x==0){
count++;
}
}
System.out.println(count);
}
} | Main.java:9: error: incompatible types: possible lossy conversion from long to int
for(int i=a;i<b;i++){
^
1 error
|
s144371846 | p03861 | C++ | #include<iostream>
using namespace std;
int main()
{
long long a,b,x;
int cnt;
printf("Enter a value for a , b and x\n");
scanf("%lld%lld%lld",&a,&b,&x);
if(a==0){
ans=(b/x)+1;}
else
{
ans=((b/x)-(a-1)/x);
}
return 0;
} | a.cc: In function 'int main()':
a.cc:10:17: error: 'ans' was not declared in this scope; did you mean 'abs'?
10 | ans=(b/x)+1;}
| ^~~
| abs
a.cc:13:17: error: 'ans' was not declared in this scope; did you mean 'abs'?
13 | ans=((b/x)-(a-1)/x);
| ^~~
| abs
|
s915533450 | p03861 | C++ | #include <iostream>
using namespace std;
int main()
{
long long a,b,x;
int cnt;
printf("Enter a value for a , b and x\n");
scanf("%lld%lld%lld",&a,&b,&x);
if(a==0){
ans=(b/x)+1;}
else
{
ans=((b/x)-(a-1)/x);
}
return 0;
} | a.cc: In function 'int main()':
a.cc:10:17: error: 'ans' was not declared in this scope; did you mean 'abs'?
10 | ans=(b/x)+1;}
| ^~~
| abs
a.cc:13:17: error: 'ans' was not declared in this scope; did you mean 'abs'?
13 | ans=((b/x)-(a-1)/x);
| ^~~
| abs
|
s794910705 | p03861 | Java | package vjudge;
import java.math.BigInteger;
import java.util.Scanner;
class Vjudge.java {
public static void main(String[] args) {
int one = 1;
BigInteger a;
BigInteger b;
BigInteger r;
int d;
Scanner input;
input = new Scanner(System.in);
a = input.nextBigInteger();
b = input.nextBigInteger();
d = input.nextInt();
BigInteger c = b.subtract(a);
BigInteger s = c.add(BigInteger.valueOf(one));
r = s.divide(BigInteger.valueOf(d));
System.out.println(r);
}
} | Main.java:6: error: '{' expected
class Vjudge.java {
^
1 error
|
s226834547 | p03861 | Java | package vjudge;
import java.math.BigInteger;
import java.util.Scanner;
public class Vjudge {
public static void main(String[] args) {
// TODO code application logic here
int one = 1;
BigInteger a;
BigInteger b;
BigInteger r;
int d;
Scanner input;
input = new Scanner(System.in);
a = input.nextBigInteger();
b = input.nextBigInteger();
d = input.nextInt();
BigInteger c = b.subtract(a);
BigInteger s = c.add(BigInteger.valueOf(one));
r = s.divide(BigInteger.valueOf(d));
System.out.println(r);
}
} | Main.java:6: error: class Vjudge is public, should be declared in a file named Vjudge.java
public class Vjudge {
^
1 error
|
s330890296 | p03861 | Java | import java.math.BigInteger;
import java.util.Scanner;
public class Vjudge {
public static void main(String[] args) {
// TODO code application logic here
int one = 1;
BigInteger a;
BigInteger b;
BigInteger r;
int d;
Scanner input;
input = new Scanner(System.in);
a = input.nextBigInteger();
b = input.nextBigInteger();
d = input.nextInt();
BigInteger c = b.subtract(a);
BigInteger s = c.add(BigInteger.valueOf(one));
r = s.divide(BigInteger.valueOf(d));
System.out.println(r);
}
} | Main.java:4: error: class Vjudge is public, should be declared in a file named Vjudge.java
public class Vjudge {
^
1 error
|
s513204889 | p03861 | C++ | #include<iostream>
using namespace std;
int main()
{
long long a,b,x;
int ans;
cout<<"enter a:";
cin>>a;
cout<<"enter b:";
cin>>b;
cout<<"enter x:";
cin>>x;
if (a==0)
cout<<"wrong answer";
else
ans=b/x-(a-1)/x;
cout<<ans; | a.cc: In function 'int main()':
a.cc:17:11: error: expected '}' at end of input
17 | cout<<ans;
| ^
a.cc:4:1: note: to match this '{'
4 | {
| ^
|
s920586824 | p03861 | C++ | #include<iostream>
using namespace std;
int main()
{
long long a,b,x,sum=0;
cin>>a>>b>>x;
if(x>0&&a<=b)
{if(a!=0){
if(a%x==0)
sum=((b-a)/x)+1;
else
sum=(b-a)/x;
}
cout<<sum;
if(a==0)
{if(a%x==0)
sum=((b-a)/x);
else
sum=((b-a)/x)-1;
}
cout<<sum;
} | a.cc: In function 'int main()':
a.cc:22:2: error: expected '}' at end of input
22 | }
| ^
a.cc:4:1: note: to match this '{'
4 | {
| ^
|
s477052827 | p03861 | C++ | #include<bits/stdc++.h>
using namespace std;
int main(){
int y=0;
long long a,b;
int x;
scanf("%lld%lld%d",&a &b &x);
for (int i =a;i<=b;i++)
{
if(a<=b&&a>=0){
if(a%x==0){
y++;
}
}
a++;
}
printf("%d",y);
}
| a.cc: In function 'int main()':
a.cc:7:23: error: invalid operands of types 'long long int*' and 'long long int' to binary 'operator&'
7 | scanf("%lld%lld%d",&a &b &x);
| ~~ ^~
| | |
| | long long int
| long long int*
|
s599576659 | p03861 | C++ | #include <bits/stdc++.h>
using namespace std;
int main() {
long A, B, X; //ここをlongにしないせいでずっとエラー吐いてた
long CC = 0;
cin >> A >> B >> X;
if (A > 0){
A -=;
CC = (B - A) / X;
}
else{
CC = B / X;
CC ++;
}
cout << CC << endl;
/* int i = 0;
int count = 0;
if (B < X){
cout << 0 << endl;
exit(0);
}
while ((i <= X) and ((A+i) < B)){
if ((A + i) % X == 0){
CC = A + i;
count = 1;
break;
}
i++;
}
if (CC == 0) and (count == 0)){
cout << CC;
}
else{
cout << (B - CC)/X + 1 << endl;
}
*/
//以上愚策、while使ったのが運の尽き
return 0;
} | a.cc: In function 'int main()':
a.cc:9:9: error: expected primary-expression before ';' token
9 | A -=;
| ^
|
s809457686 | p03861 | C++ | #include <bits/stdc++.h>
using namespace std;
#define ll long long int
#define REP(i, n) for(int i = 0; i < (n); i++)
#define SREP(i, s) for(int i = 0; i < (s.size()); i++)
#define SORT(v, n) sort(v, v+n);
#define GSORT(v, n) sort(v, v+n, greater<int>());
#define VSORT(v) sort(v.begin(),v.end());
#define VGSORT(v) sort(v.begin(),v.end(),greater<int>());
#define REV(a) reverse(begin(a),end(a));
#define FIND(v,i) find(v.begin(),v.end(),i);
int main(){
ios::sync_with_stdio(false);cin.tie(0);
////////////////////////////////////////////
ll a,b,c;
cin >> a >> b >> c;
int ans=0;
if(a==0) ans=1;
cout << (b/c)-max(0,((a-1)/c))+ans << endl;
/////////////////////////////////////////////
} | a.cc: In function 'int main()':
a.cc:23:22: error: no matching function for call to 'max(int, long long int)'
23 | cout << (b/c)-max(0,((a-1)/c))+ans << 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:23:22: note: deduced conflicting types for parameter 'const _Tp' ('int' and 'long long int')
23 | cout << (b/c)-max(0,((a-1)/c))+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
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:23:22: note: mismatched types 'std::initializer_list<_Tp>' and 'int'
23 | cout << (b/c)-max(0,((a-1)/c))+ans << endl;
| ~~~^~~~~~~~~~~~~
|
s242756122 | p03861 | C++ | #include <iostream>using namespace std;int main(){ long long a,b,x; int N=0; cin>>a,b;
if(b>=a&&a>0&&b>0&&x>0){
cin>>x;}
for(long long i=x;i<=b;i++){
if(i%x==0)
N=N+1;}
cout<<N;
return 0;
} | a.cc:1:26: warning: extra tokens at end of #include directive
1 | #include <iostream>using namespace std;int main(){ long long a,b,x; int N=0; cin>>a,b;
| ^~~~~~~~~
a.cc:1:10: fatal error: iostream>usin: No such file or directory
1 | #include <iostream>using namespace std;int main(){ long long a,b,x; int N=0; cin>>a,b;
| ^~~~~~~~~~~~~~~
compilation terminated.
|
s771500348 | p03861 | C++ | #include <iostream>
using namespace std;
int main(){
lon}g long a,b,x;
int n=0;
cin>>a,b,x;
for(long ongi=x; i<=b;i++){
if(b>=a&&i%x==0 )
n=n+1;}
cout<<n;
return 0;}
| a.cc: In function 'int main()':
a.cc:4:1: error: 'lon' was not declared in this scope; did you mean 'long'?
4 | lon}g long a,b,x;
| ^~~
| long
a.cc: At global scope:
a.cc:4:5: error: 'g' does not name a type
4 | lon}g long a,b,x;
| ^
a.cc:6:1: error: 'cin' does not name a type
6 | cin>>a,b,x;
| ^~~
a.cc:7:1: error: expected unqualified-id before 'for'
7 | for(long ongi=x; i<=b;i++){
| ^~~
a.cc:7:18: error: 'i' does not name a type
7 | for(long ongi=x; i<=b;i++){
| ^
a.cc:7:23: error: 'i' does not name a type
7 | for(long ongi=x; i<=b;i++){
| ^
a.cc:10:1: error: 'cout' does not name a type
10 | cout<<n;
| ^~~~
a.cc:11:2: error: expected unqualified-id before 'return'
11 | return 0;}
| ^~~~~~
a.cc:11:11: error: expected declaration before '}' token
11 | return 0;}
| ^
|
s995703696 | p03861 | C++ | #include <iostream>
using namespace std;
int main(){
long long a,b,x;
int n=0;
cin>>a,b,x;
for(long long i=x; i<=y;i++){
if(b>=a&&i%x==0 )
n=n+1;}
cout<<n;
return 0;
} | a.cc: In function 'int main()':
a.cc:7:23: error: 'y' was not declared in this scope
7 | for(long long i=x; i<=y;i++){
| ^
|
s407763404 | p03861 | C++ | #include <iostream>
using namespace std;
int main(){
long long a,b,x;
int n=0;
cin>>a,b,x;
for(int i=x; i<=y;i++){
if(b>=a&&i%x==0 )
n++;}
cout<<n;
return 0;
}
| a.cc: In function 'int main()':
a.cc:7:17: error: 'y' was not declared in this scope
7 | for(int i=x; i<=y;i++){
| ^
|
s868174585 | p03861 | C++ | #include <stdio.h>
#include <iostream>
using namespace std ;
int main ( )
{
long long a,b;
int x ;
cin>>a>>b>>c;
int y =(b/x) - ((a-1)/x) ;
cout <<y ;
return 0 ;
} | a.cc: In function 'int main()':
a.cc:9:20: error: 'c' was not declared in this scope
9 | cin>>a>>b>>c;
| ^
|
s789182581 | p03861 | C++ | #include<iostream>
using namespace std;
int main(){
double a,b,c;
long int r,o=0 ,s;
cin>>a>>b;
if((a>=0&&b>0))
if( (a<=b)&&(b<=(10^18)))
cin>>c;
if((c>=1)&&(c<=(10^18)))
if(a==b)
cout<<"0";
else
for(double h=a;h<=b;h++){
s=h;
r=c;
if(s%r==0)
o++;}
cout<<o;
return 0 ; | a.cc: In function 'int main()':
a.cc:8:24: warning: result of '10^18' is 24; did you mean '1e18'? [-Wxor-used-as-pow]
8 | if( (a<=b)&&(b<=(10^18)))
| ^
| ---
| 1e
a.cc:8:22: note: you can silence this warning by using a hexadecimal constant (0xa rather than 10)
8 | if( (a<=b)&&(b<=(10^18)))
| ^~
| 0xa
a.cc:10:19: warning: result of '10^18' is 24; did you mean '1e18'? [-Wxor-used-as-pow]
10 | if((c>=1)&&(c<=(10^18)))
| ^
| ---
| 1e
a.cc:10:17: note: you can silence this warning by using a hexadecimal constant (0xa rather than 10)
10 | if((c>=1)&&(c<=(10^18)))
| ^~
| 0xa
a.cc:20:11: error: expected '}' at end of input
20 | return 0 ;
| ^
a.cc:3:11: note: to match this '{'
3 | int main(){
| ^
|
s238547226 | p03861 | C++ | #include<iostream>
using namespace std;
int main(){
double a,b,c;
int r,o=0 ,s;
cin>>a>>b;
if((a>=0&&b>0))
if( (a<=b)&&(b<=(10^18)))
cin>>c;
if((c>=1)&&(c<=(10^18)))
if(a==b)
cout<<"0";
else
for(double h=a;h<=b;h++){
s=h;
r=c;
if(s%r==0)
o++;}
cout<<o;
return 0 ; | a.cc: In function 'int main()':
a.cc:8:24: warning: result of '10^18' is 24; did you mean '1e18'? [-Wxor-used-as-pow]
8 | if( (a<=b)&&(b<=(10^18)))
| ^
| ---
| 1e
a.cc:8:22: note: you can silence this warning by using a hexadecimal constant (0xa rather than 10)
8 | if( (a<=b)&&(b<=(10^18)))
| ^~
| 0xa
a.cc:10:19: warning: result of '10^18' is 24; did you mean '1e18'? [-Wxor-used-as-pow]
10 | if((c>=1)&&(c<=(10^18)))
| ^
| ---
| 1e
a.cc:10:17: note: you can silence this warning by using a hexadecimal constant (0xa rather than 10)
10 | if((c>=1)&&(c<=(10^18)))
| ^~
| 0xa
a.cc:20:11: error: expected '}' at end of input
20 | return 0 ;
| ^
a.cc:3:11: note: to match this '{'
3 | int main(){
| ^
|
s761509245 | p03861 | C++ | #include<iostream>
using namespace std;
int main(){
double a,b,c;
int s;
cin>>a>>b>>c;
if((a>=0&&b>=0)
if( (a<=b)&&(b<=(10^18))
if((c>=1)&&(c<=(10^18)))
if(a==b)
cout<<"0";
else
s=(a+b)/c;
cout<<s;
return 0 ;
} | a.cc: In function 'int main()':
a.cc:7:24: error: expected ')' before 'if'
7 | if((a>=0&&b>=0)
| ~ ^
| )
8 | if( (a<=b)&&(b<=(10^18))
| ~~
|
s133738232 | p03861 | C++ | #include<bits/stdc++.h>
using namespace std;
int main(){
int y=0;
long long a,b;
int x;
scanf("%lld%lld%d",&a &b &x);
for (int i =a;i<=b;i++)
{
if(a<=b&&a>=0){
if(a%x==0){
y++;
}
}
a++;
}
printf("%d",y);
} | a.cc: In function 'int main()':
a.cc:7:23: error: invalid operands of types 'long long int*' and 'long long int' to binary 'operator&'
7 | scanf("%lld%lld%d",&a &b &x);
| ~~ ^~
| | |
| | long long int
| long long int*
|
s258927315 | p03861 | C++ | #include<bits\stdc++.h>
using namespace std;
int main()
{
long long a=0,b=0,x=0,c=0;
cin>>a>>b>>x;
if(a>0) {
a-=1;
c=(b/x)-(a/x);
}
else{
c=b/x;
c++;
}
cout<<c;
return 0;
}
| a.cc:1:9: fatal error: bits\stdc++.h: No such file or directory
1 | #include<bits\stdc++.h>
| ^~~~~~~~~~~~~~~
compilation terminated.
|
s592029614 | p03861 | C++ | #include<bits\stdc++.h>
using namespace std;
int main(){
int a,b,x,c=0;
cin>>a>>b>>x;
if(a>0&&b>0&&b>a&&x>0)
//scanf("%d%d%d",&a,&b,&x);
for(int i=a;i<=b;i++)
if(i%x==0)
c++;
cout<<c;
}
| a.cc:1:9: fatal error: bits\stdc++.h: No such file or directory
1 | #include<bits\stdc++.h>
| ^~~~~~~~~~~~~~~
compilation terminated.
|
s165379843 | p03861 | C++ | #include<bits\stdc++.h>
using namespace std;
int main(){
int a,b,x,c=0;
cin>>a>>b>>x;
if(a>0&&b>0&&b>a&&x>0)
//scanf("%d%d%d",&a,&b,&x);
for(int i=a;i<=b;i++)
if(i%x==0)
c++;
cout<<c;
}
| a.cc:1:9: fatal error: bits\stdc++.h: No such file or directory
1 | #include<bits\stdc++.h>
| ^~~~~~~~~~~~~~~
compilation terminated.
|
s235062814 | p03861 | C++ | #include<bits/stdc++.h>
using namespace std;
int main(){
int y=0;
long long a,b;
int x;
scanf("%lld%lld%d",&a &b &x);
for (int i =a;i<=b;i++)
{
if(a<=b&&a>=0){
if(a%x==0){
y++;
}
}
a++;
}
printf("%d",y);
} | a.cc: In function 'int main()':
a.cc:7:23: error: invalid operands of types 'long long int*' and 'long long int' to binary 'operator&'
7 | scanf("%lld%lld%d",&a &b &x);
| ~~ ^~
| | |
| | long long int
| long long int*
|
s682929099 | p03861 | C++ | #include<bits/stdc++.h>
using namespace std;
int main(){
int y=0;
long long a,b;
int x;
scanf("%lld%lld%d",&a &b &x);
for (int i =a;i<=b;i++)
{
if(a<=b&&a>=0){
if(a%x==0){
y++;
}
}
a++;
}
printf("%d",y);
} | a.cc: In function 'int main()':
a.cc:7:23: error: invalid operands of types 'long long int*' and 'long long int' to binary 'operator&'
7 | scanf("%lld%lld%d",&a &b &x);
| ~~ ^~
| | |
| | long long int
| long long int*
|
s209381116 | p03861 | C++ | #include<iostream>
using namespace std;
int main(){
int y=0;
long long a,b;
int x;
scanf("%lld%lld%d",&a &b &x);
for (int i =a;i<=b;i++)
{
if(a<=b&&a>=0){
if(a%x==0){
y++;
}
}
a++;
}
printf("%d",y);
} | a.cc: In function 'int main()':
a.cc:7:23: error: invalid operands of types 'long long int*' and 'long long int' to binary 'operator&'
7 | scanf("%lld%lld%d",&a &b &x);
| ~~ ^~
| | |
| | long long int
| long long int*
|
s980013236 | p03861 | C++ | #include<iostream>
using namespace std;
int main(){
int y=0;
long long a,b;
int x;
scanf("%lld%lld%d",&a &b &x);
for (int i =a;i<=b;i++)
{
if(a<=b&&a>=0){
if(a%x==0){
y++;
}
}
a++;
}
printf("%d",y);
}
| a.cc: In function 'int main()':
a.cc:7:23: error: invalid operands of types 'long long int*' and 'long long int' to binary 'operator&'
7 | scanf("%lld%lld%d",&a &b &x);
| ~~ ^~
| | |
| | long long int
| long long int*
|
s764644234 | p03861 | C | #include <bits/stdc++.h>
using namespace std;
int main(){
int a,b,x,c=0;
scanf("%d%d%d",&a,&b,&x);
for(int i=a;i<=b;i++){
if(i%x==0)
c+=1;
}
printf("%d",c);
return 0;
} | main.c:1:10: fatal error: bits/stdc++.h: No such file or directory
1 | #include <bits/stdc++.h>
| ^~~~~~~~~~~~~~~
compilation terminated.
|
s942181730 | p03861 | C | #include <bits/stdc++.h>
using namespace std;
int main(){
int a,b,x,c=0;
scanf("%d%d%d",&a,&b,&x);
for(int i=a;i<=b;i++){
if(i%x==0)
c+=1;
}
printf("%d",c);
return 0;
} | main.c:1:10: fatal error: bits/stdc++.h: No such file or directory
1 | #include <bits/stdc++.h>
| ^~~~~~~~~~~~~~~
compilation terminated.
|
s580171944 | p03861 | C++ | #include <stdio.h>
#include <iostream>
using namespace std ;
int main ( )
{
long long a,b;
int x ;
cin>>a>>b>>c;
int y =(b/x) - ((a-1)/x) ;
cout <<y ;
return 0 ;
} | a.cc: In function 'int main()':
a.cc:9:20: error: 'c' was not declared in this scope
9 | cin>>a>>b>>c;
| ^
|
s366569241 | p03861 | C++ | #include <string.h>
#include <iostream>
#include <bits/stdc++.h>
#include<conio.h>
using namespace std;
long long fun(long long a ,long long b ,long long x )
{
int count=0;
int i=a;
while(i<=b ){
if(i%x==0)
count++;
i++;
}
return count;
}
int main()
{
long long a,b,x;
cin>>a>>b>>x;
cout<<fun(a,b,x);
} | a.cc:4:9: fatal error: conio.h: No such file or directory
4 | #include<conio.h>
| ^~~~~~~~~
compilation terminated.
|
s524358180 | p03861 | C++ | #include<iostream>
using namespace std;
int main(){
double a,b,x=0,c=0,k=0;
cin>>a>>b>>x;
if(((a>=0)&&(a<=b) &&(b<=10^18))&&((x>=1)&&(x<=10^18)))
for(c=a;c<=b;c++)
if(c%x==0)
++k;
cout<<k;
return 0;
}
| a.cc: In function 'int main()':
a.cc:8:21: error: invalid operands of types 'double' and 'double' to binary 'operator%'
8 | if(c%x==0)
| ~^~
| | |
| | double
| double
|
s571597917 | p03861 | C | #include <iostream>
using namespace std;
int main(){
int a,b,x,c=0;
cin>>a>>b>>x;
for(int i=a;i<=b;i++){
if(i%x==0)
c+=1;
}
cout<<c;
return 0;
} | main.c:1:10: fatal error: iostream: No such file or directory
1 | #include <iostream>
| ^~~~~~~~~~
compilation terminated.
|
s266601527 | p03861 | C | #include <iostream>
using namespace std;
int main(){
int a,b,x,c=0;
cin>>a>>b>>x;
for(int i=a;i<=b;i++){
if(i%x==0)
c+=1;
}
cout<<c;
return 0;
} | main.c:1:10: fatal error: iostream: No such file or directory
1 | #include <iostream>
| ^~~~~~~~~~
compilation terminated.
|
s910447189 | p03861 | C++ | #include<bits/stdc++.h>
using namespace std;
int main()
{long long a,b;cin>>a>>b>>x;int c,x;
if(a>0&&b>a)
{
for(int i=a;i<=b;i++)
{
if(i%x==0)
{c++;}
}
cout<<c;
}
return 0;
} | a.cc: In function 'int main()':
a.cc:4:27: error: 'x' was not declared in this scope
4 | {long long a,b;cin>>a>>b>>x;int c,x;
| ^
|
s082329262 | p03861 | C++ | #include<iostream>
using namespace std;
int main(){
int x;
double long a;
double long b;
double long c=0 ;
cin>>a;
cin>>b;
cin>>x;
for(double long i=a;i<=b;i++){
if(i%x==0)
c++;
}
cout<<c;
return 0;
} | a.cc: In function 'int main()':
a.cc:12:21: error: invalid operands of types 'long double' and 'int' to binary 'operator%'
12 | if(i%x==0)
| ~^~
| | |
| | int
| long double
|
s956936774 | p03861 | C++ | #include<bits/stdc++.h>
using namespace std;
int main()
{long long a,b,x;cin>>a>>b>>x;
if(a>0&&b>a)
{for(int i=a;i<=b;i++)
{if(i%x==0)
{c++;}
}
cout<<c;
}
return 0;
} | a.cc: In function 'int main()':
a.cc:8:2: error: 'c' was not declared in this scope
8 | {c++;}
| ^
a.cc:11:7: error: 'c' was not declared in this scope
11 | cout<<c;
| ^
|
s737201286 | p03861 | C++ | #include<bits/stdc++.h>
using namespace std;
int main(){
long long a,b,x, r;
scanf("%lld%lld%lld",&a,&b,&x);
if(a==0){
r=(b/x)+1;
else
r=(b/x)-(a-1)/x;
printf("%lld",r);
} | a.cc: In function 'int main()':
a.cc:10:26: error: expected '}' before 'else'
10 | else
| ^~~~
a.cc:8:33: note: to match this '{'
8 | if(a==0){
| ^
|
s022542324 | p03861 | C | #include <stido.h>
using namespace std;
int countDivisibles(int A, int B, int M)
{
int counter = 0;
for (int i = A; i <= B; i++)
if (i % M == 0)
counter++;
return counter;
}
int main()
{
int A , B , M ;
scanf("%d %d %d ", &A , &B , &M );
printf(" %d ", countDivisibles(A,B,M));
return 0;
}
| main.c:1:10: fatal error: stido.h: No such file or directory
1 | #include <stido.h>
| ^~~~~~~~~
compilation terminated.
|
s671624816 | p03861 | C | #include <bits/stdc++.h>
using namespace std;
int countDivisibles(int A, int B, int M)
{
int counter = 0;
for (int i = A; i <= B; i++)
if (i % M == 0)
counter++;
return counter;
}
int main()
{
int A , B , M ;
scanf("%d %d %d ", &A , &B , &M );
printf(" %d ", countDivisibles(A,B,M));
return 0;
}
| main.c:1:10: fatal error: bits/stdc++.h: No such file or directory
1 | #include <bits/stdc++.h>
| ^~~~~~~~~~~~~~~
compilation terminated.
|
s273596923 | p03861 | C++ | #include<bits/stdc++.h>
using namespace std;
int main(){
long long a,b,x;
int n=0;
scanf("%lld%lld%lld",&a,&b,&x);
for(int i=a ;i<=b ; i++){
if(i%x==0){
n++;}
printf("%d",n);
} | a.cc: In function 'int main()':
a.cc:15:2: error: expected '}' at end of input
15 | }
| ^
a.cc:3:11: note: to match this '{'
3 | int main(){
| ^
|
s628903590 | p03861 | C++ | #include<bits/stdc++.h>
using namespace std;
int main(){
long long a,b,x;
int n=0;
scanf("%dl%dl%dl",&a,&b,&x);
for(int i=a ;i<=b ; i++){
if(i%x==0){
n++;}
printf("%d",n);
} | a.cc: In function 'int main()':
a.cc:15:2: error: expected '}' at end of input
15 | }
| ^
a.cc:3:11: note: to match this '{'
3 | int main(){
| ^
|
s939389165 | p03861 | C++ | #include<bits/stdc++.h>
using namespace std;
int main(){
long long a,b,x;
int n=0;
scanf("%ll%ll%ll",&a,&b,&x);
for(int i=a ;i<=b ; i++){
if(i%x==0){
n++;}
printf("%d",n);
} | a.cc: In function 'int main()':
a.cc:15:2: error: expected '}' at end of input
15 | }
| ^
a.cc:3:11: note: to match this '{'
3 | int main(){
| ^
|
s980579928 | p03861 | C++ | #include<bits/stdc++.h>
using namespace std;
int main(){
long long a,b,x;
int n=0;
scanf("%dll%dll%dll",&a,&b,&x);
for(int i=a ;i<=b ; i++){
if(i%x==0){
n++;}
printf("%d",n);
} | a.cc: In function 'int main()':
a.cc:15:2: error: expected '}' at end of input
15 | }
| ^
a.cc:3:11: note: to match this '{'
3 | int main(){
| ^
|
s967516839 | p03861 | C++ | #include <iostream>
#include <algorithm>
#include <cmath>
#include <vector>
#include <string>
using namespace std;
int main(){
long long int a,b,x;
cin>>a>>b>>x;
long long int count=0;
long long int k=b/x+1;
long long int j=(a-1)/x+1;
if(a==0){
j=0;
}
count = x-y;
cout<<count<<endl;
/*for(int i=b;i>=a;i--){
count++;
}
cout<<count<<endl;*/
}
| a.cc: In function 'int main()':
a.cc:21:19: error: 'y' was not declared in this scope
21 | count = x-y;
| ^
|
s397431011 | p03861 | C++ | long long z=0;
cin>>a>>b>>x;
if(a>=0 && a<=b)
{
if(b>=a && b<=pow(10,18))
{
if (1<=x){
if(a<b){
for(int i=a;i<=b;i++)
z=(b/x)-(a/x);
if(a%x==0){
z++;
cout<<z;
}
}
else if(a=b){
cout<<z;
}
}
}
}
return 0;
} | a.cc:2:9: error: 'cin' does not name a type
2 | cin>>a>>b>>x;
| ^~~
a.cc:3:9: error: expected unqualified-id before 'if'
3 | if(a>=0 && a<=b)
| ^~
a.cc:24:9: error: expected unqualified-id before 'return'
24 | return 0;
| ^~~~~~
a.cc:25:1: error: expected declaration before '}' token
25 | }
| ^
|
s682987246 | p03861 | C++ | #include<bits/stdc++.h>
using namespace std;
int main()
{
long long a, b, x;
long long z=0;
cin>>a>>b>>x;
if(a>=0 && a<=b)
{
if(b>=a && b<=pow(10,18))
{
if (1<=x){
if(a<b){
for(int i=a;i<=b;i++)
z=(b/x)-(a/x);
if(a%x==0){
z++;
cout<<z;
}
}
else if(a=b){
cout<<z;
}
}
return 0;
} | a.cc: In function 'int main()':
a.cc:28:2: error: expected '}' at end of input
28 | }
| ^
a.cc:9:9: note: to match this '{'
9 | {
| ^
a.cc:28:2: error: expected '}' at end of input
28 | }
| ^
a.cc:4:1: note: to match this '{'
4 | {
| ^
|
s448800875 | p03861 | C | #include<bits\stdc++.h>
using namespace std;
int main(){
int a;
int b;
char x;
cin>>a>>x>>b;
// scanf("%d%c%d",&a,&x,&b);
switch(x){
case '-':
cout<<a-b;
break;
case '+':
cout<<a+b;
break;
}
return 0;
} | main.c:1:9: fatal error: bits\stdc++.h: No such file or directory
1 | #include<bits\stdc++.h>
| ^~~~~~~~~~~~~~~
compilation terminated.
|
s650646368 | p03861 | C++ | #include<bits/stdc++.h>
using namespace std;
int main() {
long long int a,b,x,n;
scanf("%lld %lld %lld" ,&a,&b,&x);
n=(b/x) - (a/x);
if(a%x == 0)
++n;
printf("%lld\n",n);
return 0;
} | a.cc:11:10: error: extended character is not valid in an identifier
11 | }
| ^
a.cc:11:10: error: '\U0000200f' does not name a type
11 | }
|
|
s123685919 | p03861 | C++ | #include <bits/stdc++.h>
using namespace std;
int main() {
long long a,b,x,n;
scanf("%lld %lld %lld" ,&a,&b,&x);
n=(b/x) - (a/x);
if(a%x == 0)
++n;
printf("%lld\n",n);
return 0;
} | a.cc:11:10: error: extended character is not valid in an identifier
11 | }
| ^
a.cc:11:10: error: '\U0000200f' does not name a type
11 | }
|
|
s673910156 | p03861 | C | #include<bits/stdc++.h>
using namespace std;
int main(){
long long a,b,x ,n=0;
scanf("%lld%lld%lld",&a,&b,&x);
for(int i=a ;i<=b ; i++){
if(i%x==0){
n++;}
}
printf("%lld",n);
} | main.c:1:9: fatal error: bits/stdc++.h: No such file or directory
1 | #include<bits/stdc++.h>
| ^~~~~~~~~~~~~~~
compilation terminated.
|
s225668233 | p03861 | C++ | #include<bits/stdc++.h>
using namespace std;
int main() {
long long a,b,x,n;
scanf("%lld %lld %lld" ,&a,&b,&x);
n=(b/x) - (a/x);
if(a%x == 0)
++n;
printf("%lld\n",n);
return 0;
} | a.cc:11:10: error: extended character is not valid in an identifier
11 | }
| ^
a.cc:11:10: error: '\U0000200f' does not name a type
11 | }
|
|
s763540602 | p03861 | C++ | #include<bits/stdc++.h>
using namespace std;
int main() {
long long a,b,x,n;
scanf("%lld %lld %lld" ,&a,&b,&x);
n=(b/x) - (a/x);
if(a%x == 0)
++n;
printf("%lld\n",n);
return 0;
} | a.cc:11:10: error: extended character is not valid in an identifier
11 | }
| ^
a.cc:11:10: error: '\U0000200f' does not name a type
11 | }
|
|
s617206929 | p03861 | C++ | #include<bits/stdc++.h>
using namespace std;
int main() {
long long a,b,x,n;
scanf("%lld %lld %lld" ,&a,&b,&x);
n=(b/x) - (a/x);
if(a%x == 0)
++n;
printf("%lld\n",n);
}
| a.cc:10:10: error: extended character is not valid in an identifier
10 | }
| ^
a.cc:10:10: error: '\U0000200f' does not name a type
10 | }
|
|
s971519815 | p03861 | C++ | #include<bits/stdc++.h>
using namespace std;
int main(){
long long a,b,x;
scanf("%lld%lld%lld",&a&b&x);
if(a<0)
printf("%lld",(b/x)-(a-1)/x);
else
printf("%lld",(b/x)+1;
} | a.cc: In function 'int main()':
a.cc:5:32: error: invalid operands of types 'long long int*' and 'long long int' to binary 'operator&'
5 | scanf("%lld%lld%lld",&a&b&x);
| ~~^~
| | |
| | long long int
| long long int*
a.cc:9:22: error: expected ')' before ';' token
9 | printf("%lld",(b/x)+1;
| ~ ^
| )
|
s827555772 | p03861 | C++ | #include<bits/stdc++.h>
uing namespace std;
int main(){
long long a,b,x;
scanf("%lld%lld%lld",&a&b&x);
if(a>0)
printf("%lld",(b/x)-(a-1)/x);
else
printf("%lld",(b/x)+1;
} | a.cc:2:1: error: 'uing' does not name a type; did you mean 'uint'?
2 | uing namespace std;
| ^~~~
| uint
a.cc: In function 'int main()':
a.cc:5:32: error: invalid operands of types 'long long int*' and 'long long int' to binary 'operator&'
5 | scanf("%lld%lld%lld",&a&b&x);
| ~~^~
| | |
| | long long int
| long long int*
a.cc:9:22: error: expected ')' before ';' token
9 | printf("%lld",(b/x)+1;
| ~ ^
| )
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.