submission_id stringlengths 10 10 | problem_id stringlengths 6 6 | language stringclasses 3 values | code stringlengths 1 522k | compiler_output stringlengths 43 10.2k |
|---|---|---|---|---|
s756764200 | p03861 | C++ | int main() {
long int a, b, x;
cin >> a >> b >> x;
long int count = 0;
for (int i = a; i < b; i++) {
if(i % x == 0){
count += 1;
}
}
cout << count << endl;
} | a.cc: In function 'int main()':
a.cc:3:3: error: 'cin' was not declared in this scope
3 | cin >> a >> b >> x;
| ^~~
a.cc:12:3: error: 'cout' was not declared in this scope; did you mean 'count'?
12 | cout << count << endl;
| ^~~~
| count
a.cc:12:20: error: 'endl' was not declared in this scope
12 | cout << count << endl;
| ^~~~
|
s873347124 | p03861 | C++ | #include<cstdio>
using namespace std;
int main(){
unsigned long long a,b,e,x,s;
cin>>a>>b>>x;
if(a%x==0)s=a/x;
else s=a/x+1;
e=b/x;
cout<<e-s+1;
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:2:1: note: 'std::cin' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
1 | #include<cstdio>
+++ |+#include <iostream>
2 | using namespace std;
a.cc:9:5: error: 'cout' was not declared in this scope
9 | cout<<e-s+1;
| ^~~~
a.cc:9:5: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
|
s228982568 | p03861 | C++ | #include <iostream>
int main(){long a,b,x;cin>>a>>b>>x;cout<<b/x-a/x+(a%x==0);}
| a.cc: In function 'int main()':
a.cc:2:23: error: 'cin' was not declared in this scope; did you mean 'std::cin'?
2 | int main(){long a,b,x;cin>>a>>b>>x;cout<<b/x-a/x+(a%x==0);}
| ^~~
| std::cin
In file included from a.cc:1:
/usr/include/c++/14/iostream:62:18: note: 'std::cin' declared here
62 | extern istream cin; ///< Linked to standard input
| ^~~
a.cc:2:36: error: 'cout' was not declared in this scope; did you mean 'std::cout'?
2 | int main(){long a,b,x;cin>>a>>b>>x;cout<<b/x-a/x+(a%x==0);}
| ^~~~
| std::cout
/usr/include/c++/14/iostream:63:18: note: 'std::cout' declared here
63 | extern ostream cout; ///< Linked to standard output
| ^~~~
|
s770306942 | p03861 | C++ | #include <iostream>
std::int main(){std::long a,b,x;cin>>a>>b>>x;cout<<b/x-a/x+(a%x==0);} | a.cc:2:6: error: expected unqualified-id before 'int'
2 | std::int main(){std::long a,b,x;cin>>a>>b>>x;cout<<b/x-a/x+(a%x==0);}
| ^~~
|
s456155473 | p03861 | C++ | #include <bits/stdc++.h>
using namespace std;
main(){
long long a,b,x;
cin>>a>>b>>x;
cout<<b/x-(a-1)/x + a==0;
}
| a.cc:3:1: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type]
3 | main(){
| ^~~~
a.cc: In function 'int main()':
a.cc:6:24: error: no match for 'operator==' (operand types are 'std::basic_ostream<char>::__ostream_type' {aka 'std::basic_ostream<char>'} and 'int')
6 | cout<<b/x-(a-1)/x + a==0;
| ~~~~~~~~~~~~~~~~~~~~~^~~
| | |
| | int
| std::basic_ostream<char>::__ostream_type {aka std::basic_ostream<char>}
a.cc:6:24: note: candidate: 'operator==(int, int)' (built-in)
6 | cout<<b/x-(a-1)/x + a==0;
| ~~~~~~~~~~~~~~~~~~~~~^~~
a.cc:6:24: note: no known conversion for argument 1 from 'std::basic_ostream<char>::__ostream_type' {aka 'std::basic_ostream<char>'} to 'int'
In file included from /usr/include/c++/14/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:6:26: note: 'std::basic_ostream<char>::__ostream_type' {aka 'std::basic_ostream<char>'} is not derived from 'const std::__cxx11::sub_match<_BiIter>'
6 | cout<<b/x-(a-1)/x + a==0;
| ^
/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:6:26: note: 'std::basic_ostream<char>::__ostream_type' {aka 'std::basic_ostream<char>'} is not derived from 'std::__cxx11::__sub_match_string<_Bi_iter, _Ch_traits, _Ch_alloc>'
6 | cout<<b/x-(a-1)/x + a==0;
| ^
/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:6:26: note: 'std::basic_ostream<char>::__ostream_type' {aka 'std::basic_ostream<char>'} is not derived from 'const std::__cxx11::sub_match<_BiIter>'
6 | cout<<b/x-(a-1)/x + a==0;
| ^
/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:6:26: note: mismatched types 'const std::__cxx11::sub_match<_BiIter>' and 'int'
6 | cout<<b/x-(a-1)/x + a==0;
| ^
/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:6:26: note: 'std::basic_ostream<char>::__ostream_type' {aka 'std::basic_ostream<char>'} is not derived from 'const std::__cxx11::sub_match<_BiIter>'
6 | cout<<b/x-(a-1)/x + a==0;
| ^
/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:6:26: note: mismatched types 'const std::__cxx11::sub_match<_BiIter>' and 'int'
6 | cout<<b/x-(a-1)/x + a==0;
| ^
/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:6:26: note: 'std::basic_ostream<char>::__ostream_type' {aka 'std::basic_ostream<char>'} is not derived from 'const std::__cxx11::sub_match<_BiIter>'
6 | cout<<b/x-(a-1)/x + a==0;
| ^
/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:6:26: note: 'std::basic_ostream<char>::__ostream_type' {aka 'std::basic_ostream<char>'} is not derived from 'const std::__cxx11::match_results<_BiIter, _Alloc>'
6 | cout<<b/x-(a-1)/x + a==0;
| ^
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:6:26: note: 'std::basic_ostream<char>::__ostream_type' {aka 'std::basic_ostream<char>'} is not derived from 'const std::pair<_T1, _T2>'
6 | cout<<b/x-(a-1)/x + a==0;
| ^
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:6:26: note: 'std::basic_ostream<char>::__ostream_type' {aka 'std::basic_ostream<char>'} is not derived from 'const std::reverse_iterator<_Iterator>'
6 | cout<<b/x-(a-1)/x + a==0;
| ^
/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:6:26: note: 'std::basic_ostream<char>::__ostream_type' {aka 'std::basic_ostream<char>'} is not derived from 'const std::reverse_iterator<_Iterator>'
6 | cout<<b/x-(a-1)/x + a==0;
| ^
/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:6:26: note: 'std::basic_ostream<char>::__ostream_type' {aka 'std::basic_ostream<char>'} is not derived from 'const std::move_iterator<_IteratorL>'
6 | cout<<b/x-(a-1)/x + a==0;
| ^
/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:6:26: note: 'std::basic_ostream<char>::__ostream_type' {aka 'std::basic_ostream<char>'} is not derived from 'const std::move_iterator<_IteratorL>'
6 | cout<<b/x-(a-1)/x + a==0;
| ^
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:6:26: note: 'std::basic_ostream<char>::__ostream_type' {aka 'std::basic_ostream<char>'} is not derived from 'const std::fpos<_StateT>'
6 | cout<<b/x-(a-1)/x + a==0;
| ^
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>&, |
s530841322 | p03861 | C++ | #include <bits/stdc++.h>
#define rep(i,n) for (int i = 0; i < (n); i++)
using namespace std;
typedef long long ll;
const int inf = 1001001001;
int main(){
ll a,b,x;
cin >> a >> b >>x;
ll ans = (b-a)/x;
if(a%x == 0) ans++;
if(b%x == 0) ans++:
cout << ans << endl;
} | a.cc: In function 'int main()':
a.cc:12:21: error: expected ';' before ':' token
12 | if(b%x == 0) ans++:
| ^
| ;
|
s109335134 | p03861 | C++ | #include<bits/stdc++.h>
#define int long long
using namespace std;
int a,b,x;
int main()
{
scanf("%lld%lld%lld",&a,&b,&x);
printf("%lld",!(a%x)?b/x-a/x+1:b/x-a/x);
return 0;
} | cc1plus: error: '::main' must return 'int'
|
s805453341 | p03861 | C++ | #include<bits/stdc++.h>
using namespace std;
long long a,b,x,ans;
int main(){
scanf("%164d%164d%164d",&a,&b,&x)
for(long long i=a;i<=b;i++){
if(i%x==0) ans++;
}
printf("%164d",ans);
return 0;
} | a.cc: In function 'int main()':
a.cc:5:38: error: expected ';' before 'for'
5 | scanf("%164d%164d%164d",&a,&b,&x)
| ^
| ;
6 | for(long long i=a;i<=b;i++){
| ~~~
a.cc:6:23: error: 'i' was not declared in this scope
6 | for(long long i=a;i<=b;i++){
| ^
|
s538494544 | p03861 | C++ | #include <bits/stdc++.h>
using namespace std;
int main(){
long long int a,b,x,s;
cin>>a>>b>>x;
s=(b-b%x)/x-(a-a%x)/x+1
cout<<s<<endl;
} | a.cc: In function 'int main()':
a.cc:6:26: error: expected ';' before 'cout'
6 | s=(b-b%x)/x-(a-a%x)/x+1
| ^
| ;
7 | cout<<s<<endl;
| ~~~~
|
s626299060 | p03861 | C++ | #include <bits/stdc++.h>
using namespace std;
int main(void){
long long a,b,x;
cin>>a>>b>>x;
if(a==0){
cout<<b/x+1<<endl;
return0;
}
cout<<b/x-(a-1)/x<<endl;
}
| a.cc: In function 'int main()':
a.cc:9:9: error: 'return0' was not declared in this scope
9 | return0;
| ^~~~~~~
|
s975829953 | p03861 | C++ | #include<bits/stdc++.h>
using namespace std;
int main(){
int_64t a,b,c;
cin << a << b << c;
cout << (int_64t)(b-a)/c << endl;
} | a.cc: In function 'int main()':
a.cc:4:3: error: 'int_64t' was not declared in this scope; did you mean 'int64_t'?
4 | int_64t a,b,c;
| ^~~~~~~
| int64_t
a.cc:5:10: error: 'a' was not declared in this scope
5 | cin << a << b << c;
| ^
a.cc:5:15: error: 'b' was not declared in this scope
5 | cin << a << b << c;
| ^
a.cc:5:20: error: 'c' was not declared in this scope
5 | cin << a << b << c;
| ^
|
s460122714 | p03861 | C++ | #include <bits/stdc++.h>
using namespace std;
int main(){
int a;
int b;
int n;
int a_n;
int b_n;
cin>>a>>b>>n;
a_n=ceil(a/n);
b_n=b/n;
cout<<b_n-a_n+1<<endl
return 0;
} | a.cc: In function 'int main()':
a.cc:13:24: error: expected ';' before 'return'
13 | cout<<b_n-a_n+1<<endl
| ^
| ;
14 |
15 | return 0;
| ~~~~~~
|
s721196129 | p03861 | C++ | #include <bits/stdc++.h>
using namespace std;
#define rep(i,n) for(int i = 0; i < (int)(n); i++)
#define all(vec) vec.begin(), vec.end()
#define END return 0
typedef int64_t ll;
const int mod7 = 1e9 + 7;
const int mod9 = 1e9 + 9;
const int inf = 1 << 30;
const ll INF = 1LL << 60;
template<typename T> T gcd(T a, T b) {return b ? gcd(b, a % b) : abs(a);}
template<typename T> T lcm(T a, T b) {return a / gcd(a, b) * b;}
template<typename T> bool chmax(T &a, T b) {if (a < b) {a = b; return true;} return false;}
template<typename T> bool chmin(T &a, T b) {if (a > b) {a = b; return true;} return false;}
template<typename A, size_t N, typename T> void Fill(A (&array)[N], const T &val) {fill((T*)array, (T*)(array+N), val);}
int main() {
ll a, b, x;
cin >> a >> b >> x;
cout << b / x - max(a - 1, 0LL) / x << endl;
} | a.cc: In function 'int main()':
a.cc:20:24: error: no matching function for call to 'max(ll, long long int)'
20 | cout << b / x - max(a - 1, 0LL) / 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:20:24: note: deduced conflicting types for parameter 'const _Tp' ('long int' and 'long long int')
20 | cout << b / x - max(a - 1, 0LL) / 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:20:24: note: mismatched types 'std::initializer_list<_Tp>' and 'long int'
20 | cout << b / x - max(a - 1, 0LL) / x << endl;
| ~~~^~~~~~~~~~~~
|
s111341478 | p03861 | C++ | //
#include<bits/stdc++.h>
long long a,b,x;
int main()
{
scanf("%lld%lld%lld",%a,&b,&x);
printf("%lld\n",!(a%x)?b/x-a/x+1:b/x-a/x);
return 0;
} | a.cc: In function 'int main()':
a.cc:6:26: error: expected primary-expression before '%' token
6 | scanf("%lld%lld%lld",%a,&b,&x);
| ^
|
s777622301 | p03861 | C | #include <iostream>
using namespace std;
using ll = long long;
ll A, B, X;
int main() {
cin >> A >> B >> X;
ll ans = 0;
if (A % X != 0 && B % X != 0) {
ans = (B - A) / X;
} else {
ans = (B - A) / X + 1;
}
cout << ans << endl;
return 0;
} | main.c:1:10: fatal error: iostream: No such file or directory
1 | #include <iostream>
| ^~~~~~~~~~
compilation terminated.
|
s744723198 | p03861 | C++ | #include <bits/stdc++.h>
using namespace std;
int main() {
int a,b,x;
cin>>a>>b>>x;
int64_t ans;
for (int i=a;i<b+1;i++){
if(i%x ==0;)
ans +=1;
}
cout<<ans<<endl;
}
| a.cc: In function 'int main()':
a.cc:9:20: error: expected primary-expression before ')' token
9 | if(i%x ==0;)
| ^
|
s558487966 | p03861 | C++ | package main
import (
"bufio"
"bytes"
"fmt"
"io"
"os"
"strconv"
)
// -----------------------------------------------------------------------------
// IO helper functions
// Returns next token from input. It must be initialized by SetInput()
// before the first call.
var nextToken func() ([]byte, error)
var nextLine func() ([]byte, error)
// Holds a buffer for output. It must be initialized by SetOutput().
// All IO fucntions (read*() and [e]print*()) should write to OutputWriter
// instead of this.
var OutputBuffer *bufio.Writer
// Holds an io.Writer. It must be initialized by SetOutput()
var OutputWriter io.Writer
// Set IO functions for interactive input/output.
func SetInteractive(w io.Writer, r io.Reader) {
SetUnbefferedInput(r)
OutputBuffer = nil
OutputWriter = w
}
// Setup OutputBuffer and OutputWriter.
func SetOutput(w io.Writer) {
OutputBuffer = bufio.NewWriter(w)
OutputWriter = OutputBuffer
}
// Flushes OutputBuffer
func Flush() {
if OutputBuffer != nil {
OutputBuffer.Flush()
}
}
// Returns true if c is a white space
func IsSpace(c byte) bool {
switch c {
case '\t', '\n', '\v', '\f', '\r', ' ':
return true
}
return false
}
func IsNewLine(c byte) bool {
switch c {
case '\n', '\r':
return true
}
return false
}
// Setup nextToken with input buffer.
func SetInput(r io.Reader) {
buf := new(bytes.Buffer)
var b []byte
var i int
rest := func() ([]byte, error) {
for i < len(b) && IsSpace(b[i]) {
i++
}
if i == len(b) {
return nil, io.ErrUnexpectedEOF
}
j := i
for i < len(b) && !IsSpace(b[i]) {
i++
}
return b[j:i], nil
}
initial := func() ([]byte, error) {
io.Copy(buf, r)
b = buf.Bytes()
nextToken = rest
return rest()
}
nextToken = initial
restLn := func() ([]byte, error) {
for i < len(b) && IsNewLine(b[i]) {
i++
}
if i == len(b) {
return nil, io.ErrUnexpectedEOF
}
j := i
for i < len(b) && !IsNewLine(b[i]) {
i++
}
return b[j:i], nil
}
initialLn := func() ([]byte, error) {
io.Copy(buf, r)
b = buf.Bytes()
nextLine = restLn
return restLn()
}
nextLine = initialLn
}
// Setup nextToken without input buffer.
func SetUnbefferedInput(r io.Reader) {
buf := bufio.NewReader(r)
var b []byte
var i int
nextToken = func() ([]byte, error) {
var err error
if i == len(b) {
b, err = buf.ReadBytes('\n')
if err != nil {
return nil, err
}
i = 0
j := len(b) - 1
for 0 <= j && IsSpace(b[j]) {
j--
}
b = b[0 : j+1]
}
for i < len(b) && IsSpace(b[i]) {
i++
}
j := i
for i < len(b) && !IsSpace(b[i]) {
i++
}
if i == j {
return nil, io.ErrUnexpectedEOF
}
return b[j:i], nil
}
}
// -----------------------------------------------------------------------------
// IO functions
// Reads next token and return it as []byte
func readb() []byte {
b, err := nextToken()
if err != nil {
panic(err)
}
return b
}
// Reads next token and return it as string
func reads() string {
return string(readb())
}
// Read next line as []byte
func readbln() []byte {
b, err := nextLine()
if err != nil {
panic(err)
}
return b
}
// Read next line as string
func readsln() string {
return string(readbln())
}
// Reads next token and return it as int64
func readll() int64 {
i, err := strconv.ParseInt(reads(), 10, 64)
if err != nil {
panic(err.Error())
}
return i
}
// Reads next token and return it as int
func readi() int {
return int(readll())
}
// Reads next token and return it as float64
func readf() float64 {
f, err := strconv.ParseFloat(reads(), 64)
if err != nil {
panic(err.Error())
}
return f
}
// Write args to OutputWriter with the format f
func printf(f string, args ...interface{}) (int, error) {
return fmt.Fprintf(OutputWriter, f, args...)
}
// Write args to OutputWriter without format
func println(args ...interface{}) (int, error) {
return fmt.Fprintln(OutputWriter, args...)
}
// Write args to stderr with the format f
func eprintf(f string, args ...interface{}) (int, error) {
return fmt.Fprintf(os.Stderr, f, args...)
}
// Write args to stderr without format
func eprintln(args ...interface{}) (int, error) {
return fmt.Fprintln(os.Stderr, args...)
}
// -----------------------------------------------------------------------------
// Simple math functions
const (
// big prime
INF = 1000000007
INF2 = 1000000009
INF3 = 998244353
)
func min(a, b int) int {
if a < b {
return a
}
return b
}
func minll(a, b int64) int64 {
if a < b {
return a
}
return b
}
func max(a, b int) int {
if a < b {
return b
}
return a
}
func maxll(a, b int64) int64 {
if a < b {
return b
}
return a
}
func abs(a int) int {
if a < 0 {
return -a
}
return a
}
func absll(a int64) int64 {
if a < 0 {
return -a
}
return a
}
// egcd(a, b) returns d, x, y:
// d is gcd(a,b)
// x, y are integers that satisfy ax + by = d
func egcd(a, b int) (int, int, int) {
if b == 0 {
return a, 1, 0
}
d, x, y := egcd(b, a%b)
return d, y, x - a/b*y
}
func egcdll(a, b int64) (int64, int64, int64) {
if b == 0 {
return a, 1, 0
}
d, x, y := egcdll(b, a%b)
return d, y, x - a/b*y
}
func gcd(a, b int) int {
d, _, _ := egcd(a, b)
return d
}
func gcdll(a, b int64) int64 {
d, _, _ := egcdll(a, b)
return d
}
// set up IO functions
func init() {
// for non-interactive
SetInput(os.Stdin)
SetOutput(os.Stdout)
// Enable below when interactive. Its ok to leave above intact.
// SetInteractive(os.Stdout, os.Stdin)
}
func main() {
defer Flush()
a := readi()
b := readi()
x := readi()
a1 := (a - 1) / x
b1 := b / x
println(b1 - a1)
}
| a.cc:1:1: error: 'package' does not name a type
1 | package main
| ^~~~~~~
a.cc:37:1: error: 'func' does not name a type
37 | func SetOutput(w io.Writer) {
| ^~~~
a.cc:43:1: error: 'func' does not name a type
43 | func Flush() {
| ^~~~
a.cc:50:1: error: 'func' does not name a type
50 | func IsSpace(c byte) bool {
| ^~~~
a.cc:58:1: error: 'func' does not name a type
58 | func IsNewLine(c byte) bool {
| ^~~~
a.cc:67:1: error: 'func' does not name a type
67 | func SetInput(r io.Reader) {
| ^~~~
a.cc:117:1: error: 'func' does not name a type
117 | func SetUnbefferedInput(r io.Reader) {
| ^~~~
a.cc:155:1: error: 'func' does not name a type
155 | func readb() []byte {
| ^~~~
a.cc:164:1: error: 'func' does not name a type
164 | func reads() string {
| ^~~~
a.cc:169:1: error: 'func' does not name a type
169 | func readbln() []byte {
| ^~~~
a.cc:178:1: error: 'func' does not name a type
178 | func readsln() string {
| ^~~~
a.cc:183:1: error: 'func' does not name a type
183 | func readll() int64 {
| ^~~~
a.cc:192:1: error: 'func' does not name a type
192 | func readi() int {
| ^~~~
a.cc:197:1: error: 'func' does not name a type
197 | func readf() float64 {
| ^~~~
a.cc:206:1: error: 'func' does not name a type
206 | func printf(f string, args ...interface{}) (int, error) {
| ^~~~
a.cc:206:42: error: expected unqualified-id before ')' token
206 | func printf(f string, args ...interface{}) (int, error) {
| ^
a.cc:211:1: error: 'func' does not name a type
211 | func println(args ...interface{}) (int, error) {
| ^~~~
a.cc:211:33: error: expected unqualified-id before ')' token
211 | func println(args ...interface{}) (int, error) {
| ^
a.cc:216:1: error: 'func' does not name a type
216 | func eprintf(f string, args ...interface{}) (int, error) {
| ^~~~
a.cc:216:43: error: expected unqualified-id before ')' token
216 | func eprintf(f string, args ...interface{}) (int, error) {
| ^
a.cc:221:1: error: 'func' does not name a type
221 | func eprintln(args ...interface{}) (int, error) {
| ^~~~
a.cc:221:34: error: expected unqualified-id before ')' token
221 | func eprintln(args ...interface{}) (int, error) {
| ^
a.cc:231:12: error: expected ')' before '=' token
231 | INF = 1000000007
| ^ ~
| )
a.cc:229:7: note: to match this '('
229 | const (
| ^
a.cc:243:1: error: 'func' does not name a type
243 | func minll(a, b int64) int64 {
| ^~~~
a.cc:250:1: error: 'func' does not name a type
250 | func max(a, b int) int {
| ^~~~
a.cc:257:1: error: 'func' does not name a type
257 | func maxll(a, b int64) int64 {
| ^~~~
a.cc:264:1: error: 'func' does not name a type
264 | func abs(a int) int {
| ^~~~
a.cc:271:1: error: 'func' does not name a type
271 | func absll(a int64) int64 {
| ^~~~
a.cc:281:1: error: 'func' does not name a type
281 | func egcd(a, b int) (int, int, int) {
| ^~~~
a.cc:289:1: error: 'func' does not name a type
289 | func egcdll(a, b int64) (int64, int64, int64) {
| ^~~~
a.cc:297:1: error: 'func' does not name a type
297 | func gcd(a, b int) int {
| ^~~~
a.cc:302:1: error: 'func' does not name a type
302 | func gcdll(a, b int64) int64 {
| ^~~~
a.cc:308:1: error: 'func' does not name a type
308 | func init() {
| ^~~~
a.cc:317:1: error: 'func' does not name a type
317 | func main() {
| ^~~~
|
s480109527 | p03861 | C++ | #include <bits/stdc++.h>
using namespace std;
int main(){
long long a,b,x;
cin >> a >> b >> x;
long long ans=0;
if(a%c == 0)ans++;
b = b/x;
a = a/x;
ans += b-a;
cout << ans << endl;
}
| a.cc: In function 'int main()':
a.cc:8:8: error: 'c' was not declared in this scope
8 | if(a%c == 0)ans++;
| ^
|
s726588107 | p03861 | C++ | #include <bits/stdc++.h>
using namespace std;
int main(){
long long a,b,c;
cin >> a >> b >> c;
long long ans=0;
if(a%c == 0)ans++;
b = b/x;
a = a/x;
ans += b-a;
cout << ans << endl;
} | a.cc: In function 'int main()':
a.cc:9:9: error: 'x' was not declared in this scope
9 | b = b/x;
| ^
|
s747391428 | p03861 | C++ | 1 1000000000000000000 3 | a.cc:1:1: error: expected unqualified-id before numeric constant
1 | 1 1000000000000000000 3
| ^
|
s188441205 | p03861 | C++ | #include<bits/stdc++.h>
using namespace std;
#define int long long
#define fo(a,b) for(int a=0;a<b;a++)
#define Sort(a) sort(a.begin(),a.end())
#define rev(a) reverse(a.begin(),a.end())
#define fi first
#define se second
#define co(a) cout<<a<<endl
#define sz size()
#define bgn begin()
#define en end()
#define pb(a) push_back(a)
#define pp() pop_back()
#define V vector
#define P pair
#define V2(a,b,c) V<V<int>> a(b,V<int>(c))
#define V2a(a,b,c,d) V<V<int>> a(b,V<int>(c,d))
#define incin(a) int a; cin>>a
#define yuko(a) setprecision(a)
#define uni(a) a.erase(unique(a.begin(),a.end()),a.end())
//#define min min<int>
//#define max max<int>
template<class T>
void cou(vector<vector<T>> a){
int b=a.size();
int c=a[0].size();
fo(i,b){
fo(j,c){
cout<<a[i][j];
if(j==c-1)
cout<<endl;
else
cout<<' ';
}
}
}
/*template<>
void cou(vector<vector<char>> a){
int b=a.size();
int c=a[0].size();
fo(i,b){
fo(j,c){
cout<<a[i][j];
if(j==c-1)
cout<<endl;
else
cout<<' ';
}
}
}*/
int wari(int a,int b) {
if(a%b==0)
return a/b;
else
return a/b+1;
}
int keta(int a){
double b=a;
b=log10(b);
int c=b;
return c+1;
}
int souwa(int a){
return a*(a+1)/2;
}
/*int lcm(int a,int b){
int d=a,e=b,f;
if(a<b)
swap(a,b);
int c,m=1;
while(m){
c=a%b;
if(c==0){
f=b;
m--;
}
else{
a=b;
b=c;
}
}
return d*e/f;
}
int gcm(int a,int b){
int d=a,e=b,f;
if(a<b)
swap(a,b);
int c,m=1;
while(m){
c=a%b;
if(c==0){
f=b;
m--;
}
else{
a=b;
b=c;
}
}
return f;
}*/
bool prime(int a){
if(a<2)
return false;
else if(a==2)
return true;
else if(a%2==0)
return false;
double b=sqrt(a);
for(int i=3;i<=b;i+=2){
if(a%i==0){
return false;
}
}
return true;
}
struct Union{
vector<int> par;
Union(int a){
par= vector<int>(a,-1);
}
int find(int a){
if(par[a]<0)
return a;
else
return par[a]=find(par[a]);
}
bool same(int a,int b){
return find(a)==find(b);
}
int Size(int a){
return -par[find(a)];
}
void unite(int a,int b){
a=find(a);
b=find(b);
if(a==b)
return;
if(Size(b)>Size(a))
swap<int>(a,b);
par[a]+=par[b];
par[b]=a;
}
};
int ketas(int a){
string b=to_string(a);
int c=0;
fo(i,keta(a)){
c+=b[i]-'0';
}
return c;
}
int gcm(int a,int b){
if(b==0)
return a;
return gcm(b,a%b);
}
int lcm(int a,int b){
return a/gcm(a,b)*b;
}
/*struct aa{
vector<int> gt;
aa(int n){
gt= vector<int>(n, 1);
}
void c(V<int> d,int b){
if(d[b]==0){
gt[d[b]-1]++;
gt[gt.sz-1]++;
}
else{
gt[d[b]-1]++;
c(d,d[d[b]]-1);
}
}
void cok(int a){
cout<<gt[a-1]<<endl;
fo(i,a-1)
cout<<gt[i]<<endl;
}
};
*/
/*struct dfs(){
}*/
signed main(){
int a,b,c;
cin>>a>>b>>c;
if(a==0)
cout<<b/c+1<<endl;
else
cout<<b/c-(a-1)/x<<endl;
} | a.cc: In function 'int main()':
a.cc:193:21: error: 'x' was not declared in this scope
193 | cout<<b/c-(a-1)/x<<endl;
| ^
|
s422616399 | p03861 | Java | import java.util.Scanner;
public class B {
public static void main(String[] args) {
Scanner scan = new Scanner(System.in);
int a = scan.nextInt();
int b = scan.nextInt();
int x = scan.nextInt();
scan.close();
int cnt=0;
for(int i=a;i<=b;i++) {
if(i%x==0)cnt++;
}
System.out.println(cnt);
}
} | Main.java:3: error: class B is public, should be declared in a file named B.java
public class B {
^
1 error
|
s152140684 | p03861 | C++ | #include<bits/stdc++.h>
#include <iostream>
#include <string>
#include <cmath>
using namespace std;
#define ll long long
#define rep(i, n) for (ll i = 0; i < (n); i++)
#define FOR(i,a,b) for(ll i=(a);i<(b);i++)
#define FORR(i,a,b)for(ll i=(a);i<=(b);i++)
#define repR(i,n) for(ll i=n;i>=0;i--)
#define all(v)(v).begin(),(v).end()
#define rall(v)(v).rbegin(),(v).rend()
#define F first
#define S second
#define pb push_back
#define pu push
#define COUT(x) cout<<(x)<<endl
#define PQ priority_queue<ll>
#define PQR priority_queue<ll,vector<ll>,greater<ll>>
#define YES(n) cout << ((n) ? "YES" : "NO" ) << endl
#define Yes(n) cout << ((n) ? "Yes" : "No" ) << endl
#define mp make_pair
#define maxs(x,y) (x = max(x,y))
#define mins(x,y) (x = min(x,y))
#define sz(x) (int)(x).size()
typedef pair<int,int> pii;
typedef pair<ll,ll> pll;
const ll MOD = 1000000007LL;
const ll INF = 1LL << 60;
using vll = vector<ll>;
using vb = vector<bool>;
using vvb = vector<vb>;
using vvll = vector<vll>;
using vstr = vector<string>;
using pll = pair<ll, ll>;
int main(){
ll a,b,x;
cin>>a>>b>>x;
ans=0;
if(b-a<x){
if(a%x>b%x){
COUT(1);
}
else COUT(0);
}
else{
ll k=x-a%x;
if(a%x==0) k=0;
a+=k;
ll ans=(b-a)/x;
COUT(ans);
}
}
| a.cc: In function 'int main()':
a.cc:39:3: error: 'ans' was not declared in this scope; did you mean 'abs'?
39 | ans=0;
| ^~~
| abs
|
s587234082 | p03861 | C++ | #include<bits/stdc++.h>
#include <iostream>
#include <string>
#include <cmath>
using namespace std;
#define ll long long
#define rep(i, n) for (ll i = 0; i < (n); i++)
#define FOR(i,a,b) for(ll i=(a);i<(b);i++)
#define FORR(i,a,b)for(ll i=(a);i<=(b);i++)
#define repR(i,n) for(ll i=n;i>=0;i--)
#define all(v)(v).begin(),(v).end()
#define rall(v)(v).rbegin(),(v).rend()
#define F first
#define S second
#define pb push_back
#define pu push
#define COUT(x) cout<<(x)<<endl
#define PQ priority_queue<ll>
#define PQR priority_queue<ll,vector<ll>,greater<ll>>
#define YES(n) cout << ((n) ? "YES" : "NO" ) << endl
#define Yes(n) cout << ((n) ? "Yes" : "No" ) << endl
#define mp make_pair
#define maxs(x,y) (x = max(x,y))
#define mins(x,y) (x = min(x,y))
#define sz(x) (int)(x).size()
typedef pair<int,int> pii;
typedef pair<ll,ll> pll;
const ll MOD = 1000000007LL;
const ll INF = 1LL << 60;
using vll = vector<ll>;
using vb = vector<bool>;
using vvb = vector<vb>;
using vvll = vector<vll>;
using vstr = vector<string>;
using pll = pair<ll, ll>;
int main(){
ll a,b,x;
cin>>a>>b>>x;
ans=0;
if(b-a<x){
if(a%x>b%x){
COUT(1);
}
else COUT(0);
}
else{
ll k=x-a%x;
if(a%x==0) k=0;
a+=k;
ans=(b-a)/x;
COUT(ans);
}
} | a.cc: In function 'int main()':
a.cc:39:3: error: 'ans' was not declared in this scope; did you mean 'abs'?
39 | ans=0;
| ^~~
| abs
|
s175235610 | p03861 | C++ | a,b,x=map(int,input().split())
ans=(b-a+1)/x
print(round(ans)) | a.cc:1:1: error: 'a' does not name a type
1 | a,b,x=map(int,input().split())
| ^
|
s175990403 | p03861 | C++ | #pragma gcc optimize("Ofast")
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
#define FOR(i, a, b) for (int i = (a); i < (b); ++i)
#define REP(i, n) for (int i = 0; i < (n); ++i)
#define SORT(V) sort((V).begin(),(V).end())
#define pb push_back
#define endl '\n'
#define int long long
const int MOD = 1000000007;
const int INF = 1061109567;
const double EPS = 1e-10;
const double PI = acos(-1.0);
// 変数定義
int a,b,x,count=0;
//
signed main() {
cin.tie(0);
ios::sync_with_stdio(false);
cin >> a >> b >> x;
FOR(i,a,b+1) {
if (i % x == 0) {
count += 1;
}
}
cout << count << endl;
} | a.cc: In function 'int main()':
a.cc:29:7: error: reference to 'count' is ambiguous
29 | count += 1;
| ^~~~~
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:2:
/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:20:11: note: 'long long int count'
20 | int a,b,x,count=0;
| ^~~~~
a.cc:32:11: error: reference to 'count' is ambiguous
32 | 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:20:11: note: 'long long int count'
20 | int a,b,x,count=0;
| ^~~~~
|
s275991506 | p03861 | C++ | #pragma gcc optimize("Ofast")
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
#define FOR(i, a, b) for (int i = (a); i < (b); ++i)
#define REP(i, n) for (int i = 0; i < (n); ++i)
#define SORT(V) sort((V).begin(),(V).end())
#define pb push_back
#define endl '\n'
#define int long long
const int MOD = 1000000007;
const int INF = 1061109567;
const double EPS = 1e-10;
const double PI = acos(-1.0);
// 変数定義
int a,b,x,count=0;
//
signed main() {
cin.tie(0);
ios::sync_with_stdio(false);
cin >> a >> b >> x;
FOR(i,a,b+1) {
if (i % x == 0) {
count++;
}
}
cout << count << endl;
} | a.cc: In function 'int main()':
a.cc:29:7: error: reference to 'count' is ambiguous
29 | 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:2:
/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:20:11: note: 'long long int count'
20 | int a,b,x,count=0;
| ^~~~~
a.cc:32:11: error: reference to 'count' is ambiguous
32 | 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:20:11: note: 'long long int count'
20 | int a,b,x,count=0;
| ^~~~~
|
s719158604 | p03861 | C++ | a, b, x = gets.chomp.split.map(&:to_i)
puts ((b-a) / x) + (a / x > 0 || a == 0 ? 1 : 0) | a.cc:1:1: error: 'a' does not name a type
1 | a, b, x = gets.chomp.split.map(&:to_i)
| ^
|
s074239498 | p03861 | C++ | #include <bits/stdc++.h>
using namespace std;
int main() {
int64_t a,b,c,ans=0;
cin>>a>>b>>c;
for(int i=a; i<=b; i++){
if(c%==0){ans++;}
}
cout<<ans<<endl;
}
| a.cc: In function 'int main()':
a.cc:10:11: error: expected primary-expression before '=' token
10 | if(c%==0){ans++;}
| ^
|
s862846401 | p03861 | C++ | #include<iostream>
#include<cmath>
using namespace std;
long a,b,x;
f(n){
if(n=-1) return 0;
else return n/x+1;
}
int main()
{
cin >> a >> b >> x;
long ans=0;
ans = f(a)-f(b-1)
cout << ans << endl;
} | a.cc:5:2: error: expected constructor, destructor, or type conversion before '(' token
5 | f(n){
| ^
a.cc: In function 'int main()':
a.cc:15:9: error: 'f' was not declared in this scope
15 | ans = f(a)-f(b-1)
| ^
|
s089678799 | p03861 | C++ | #include<bits/stdc++.h>
using namespace std;
#define rep(i, n) for(int i = 0; i < (int)(n); i++)
int main(){
long long a, b, x;
cin >> a >> b >> x;
if(a == 0){
cout << b / x + 1
}
else{
cout << b / x - ((a - 1) / x) << endl;
}
} | a.cc: In function 'int main()':
a.cc:10:22: error: expected ';' before '}' token
10 | cout << b / x + 1
| ^
| ;
11 | }
| ~
|
s422189629 | p03861 | C++ | #include <bits/stdc++.h>
using namespace std;
int main(){
int64_t a, b, x;
cin >> a >> b >> x;
int64_t count=0
for(int64_t i=a; i <(b+1); i++){
if(i % x == 0){
count++;
}
}
cout << count << endl;
} | a.cc: In function 'int main()':
a.cc:10:3: error: expected ',' or ';' before 'for'
10 | for(int64_t i=a; i <(b+1); i++){
| ^~~
a.cc:10:20: error: 'i' was not declared in this scope
10 | for(int64_t i=a; i <(b+1); i++){
| ^
|
s541086447 | p03861 | C++ | #include<bits/stdc++.h>
using namespace std;
using ll=long long;
ll f(ll n,ll d){
if(n<0)return0;
return n/d+1;
}
void solve(){
ll a,b,x;
cin>>a>>b>>x;
cout<<f(b,x)-f(a-1,x)<<endl;
}
signed main(){
//while(1)
solve();
} | a.cc: In function 'll f(ll, ll)':
a.cc:7:16: error: 'return0' was not declared in this scope
7 | if(n<0)return0;
| ^~~~~~~
|
s942637448 | p03861 | C | #include<stdio.h>
int main(void){
int a,b,x,i;
scanf("%d %d %d",&a,&b,&x);
while(1){
a++;
if(a % x == 0) break;
}
i = (b - a) / x
printf("%d",i);
return 0;
}
| main.c: In function 'main':
main.c:9:18: error: expected ';' before 'printf'
9 | i = (b - a) / x
| ^
| ;
10 | printf("%d",i);
| ~~~~~~
|
s667806768 | p03861 | C++ | #include<bits/stdc++.h>
using namespace std;
#define fast ios_base::sync_stdio(0); cin.tie(0); cout.tie(0);
long long int f(int n, int x)
{
if(n >= 0)
return (n/x)+1;
if(n == -1)
return 0;
}
int main()
{
fast;
int a, b, x;
cin>>a>>b>>x;
cout<<f(b, x) - f((a-1),x)<<"\n";
return 0;
}
| a.cc: In function 'int main()':
a.cc:3:24: error: 'sync_stdio' is not a member of 'std::ios_base'
3 | #define fast ios_base::sync_stdio(0); cin.tie(0); cout.tie(0);
| ^~~~~~~~~~
a.cc:15:9: note: in expansion of macro 'fast'
15 | fast;
| ^~~~
a.cc: In function 'long long int f(int, int)':
a.cc:11:1: warning: control reaches end of non-void function [-Wreturn-type]
11 | }
| ^
|
s710741671 | p03861 | C++ | #include<bits/stdc++.h>
#define fast ios_base::sync_stdio(0); cin.tie(0); cout.tie(0);
using namespace std;
long long int f(int n, int x)
{
if(n >= 0)
return (n/x)+1;
if(n == -1)
return 0;
}
int main()
{
fast;
int a, b, x;
cin>>a>>b>>x;
cout<<f(b, x) - f((a-1),x)<<"\n";
return 0;
}
| a.cc: In function 'int main()':
a.cc:2:24: error: 'sync_stdio' is not a member of 'std::ios_base'
2 | #define fast ios_base::sync_stdio(0); cin.tie(0); cout.tie(0);
| ^~~~~~~~~~
a.cc:15:9: note: in expansion of macro 'fast'
15 | fast;
| ^~~~
a.cc: In function 'long long int f(int, int)':
a.cc:11:1: warning: control reaches end of non-void function [-Wreturn-type]
11 | }
| ^
|
s029634718 | p03861 | C++ | #include<iostream>
using namespace std;
int main(){
int a,b,x;
int res = 0;
for (int i=a; a =< i =<b;i++){
if(i%x == 0)res++;
}
} | a.cc: In function 'int main()':
a.cc:7:26: error: expected primary-expression before '<' token
7 | for (int i=a; a =< i =<b;i++){
| ^
a.cc:7:31: error: expected primary-expression before '<' token
7 | for (int i=a; a =< i =<b;i++){
| ^
|
s832262995 | p03861 | C | #include<stdio.h>
int main(void)
{
long long int a,b,x,ans1,ans2,result=0;
char str[128];
fgets(str,sizeof(str),stdin);
sscanf(str,"%lld %lld %lld",&a,&b,&x);
ans1 = b/x;
ans2 = a-1/x;
if(a == 0)ans2 = 0;
count = ans1 - ans2;
printf("%lld",result);
return 0;
} | main.c: In function 'main':
main.c:15:3: error: 'count' undeclared (first use in this function)
15 | count = ans1 - ans2;
| ^~~~~
main.c:15:3: note: each undeclared identifier is reported only once for each function it appears in
|
s195986643 | p03861 | C++ | #include <bits/stdc++.h>
using namespace std;int main(){long long a,b,x;cin>>a>>b>>x;cout<<a?b/x-(a-1)/x:b/x+1<<endl;} | a.cc: In function 'int main()':
a.cc:2:86: error: invalid operands of types 'long long int' and '<unresolved overloaded function type>' to binary 'operator<<'
2 | using namespace std;int main(){long long a,b,x;cin>>a>>b>>x;cout<<a?b/x-(a-1)/x:b/x+1<<endl;}
| ~~~~~^~~~~~
|
s732332015 | p03861 | C++ | #include<bits/stdc++.h>
using namespace std;
#define ll long long int
int main() {
ios_base::sync_with_stdio(0);
cin.tie(0);
ll a,b,x; cin >> a >> b >> x;
if(x > b)cout << (a == 0) << '\n';
else cout << (b/x) - max(0,(a-1)/x) << '\n';
return 0;
} | a.cc: In function 'int main()':
a.cc:15:33: error: no matching function for call to 'max(int, long long int)'
15 | else cout << (b/x) - max(0,(a-1)/x) << '\n';
| ~~~^~~~~~~~~~~
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:15:33: note: deduced conflicting types for parameter 'const _Tp' ('int' and 'long long int')
15 | else cout << (b/x) - max(0,(a-1)/x) << '\n';
| ~~~^~~~~~~~~~~
/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:15:33: note: mismatched types 'std::initializer_list<_Tp>' and 'int'
15 | else cout << (b/x) - max(0,(a-1)/x) << '\n';
| ~~~^~~~~~~~~~~
|
s089319071 | p03861 | C++ | #include <cmath>
#include <iostream>
using namespace std;
int main() {
long int a, b, x;
cin >> a >> b >> x;
cout << max(0, floor(b / x) + 1 - (!a ? 0 : floor((a - 1) / x) + 1)) << endl;
return 0;
}
| a.cc: In function 'int main()':
a.cc:7:14: error: no matching function for call to 'max(int, __gnu_cxx::__enable_if<true, double>::__type)'
7 | cout << max(0, floor(b / x) + 1 - (!a ? 0 : floor((a - 1) / x) + 1)) << endl;
| ~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from /usr/include/c++/14/bits/specfun.h:43,
from /usr/include/c++/14/cmath:3906,
from a.cc:1:
/usr/include/c++/14/bits/stl_algobase.h:257:5: note: candidate: 'template<class _Tp> constexpr const _Tp& std::max(const _Tp&, const _Tp&)'
257 | max(const _Tp& __a, const _Tp& __b)
| ^~~
/usr/include/c++/14/bits/stl_algobase.h:257:5: note: template argument deduction/substitution failed:
a.cc:7:14: note: deduced conflicting types for parameter 'const _Tp' ('int' and '__gnu_cxx::__enable_if<true, double>::__type' {aka 'double'})
7 | cout << max(0, floor(b / x) + 1 - (!a ? 0 : floor((a - 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
|
s985480025 | p03861 | C | #include<stdio..h>
int main()
{
long long a,b,i,x;
int count=0;
scanf("%lld%lld%lld",&a,&b,&x);
for(i=a;i<=b;i++)
{
if(a%x==0)
count++;
a++;
}
printf("%d\n",count);
return 0;
}
| main.c:1:9: fatal error: stdio..h: No such file or directory
1 | #include<stdio..h>
| ^~~~~~~~~~
compilation terminated.
|
s759604524 | p03861 | C | #include<include.h>
int main()
{
long long a,b,i,x;
int count=0;
scanf("%lld%lld%lld",&a,&b,&x);
for(i=a;i<=b;i++)
{
if(a%x==0)
count++;
a++;
}
printf("%d\n",count);
return 0;
}
| main.c:1:9: fatal error: include.h: No such file or directory
1 | #include<include.h>
| ^~~~~~~~~~~
compilation terminated.
|
s686925761 | p03861 | C | #include<iostream>
int main()
{
long long a,b,i,x;
int count=0;
scanf("%d%d%d",&a,&b,&x);
for(i=a;i<=b;i++)
{
if(a%x==0)
count++;
a++;
if(a%x!=0)
continue;
}
printf("%d\n",count);
return 0;
}
| main.c:1:9: fatal error: iostream: No such file or directory
1 | #include<iostream>
| ^~~~~~~~~~
compilation terminated.
|
s170184798 | p03861 | C++ | #include<bits/stdc++.h>
using namespace std;
using ll = long long;
int main(){
ll a,b,x;
cin >> a >> b >> x;
if(a == 0){
cout << b%x + 1 << endl;
}else{
cout << b%x-(a-1)%x<<endl;
} | a.cc: In function 'int main()':
a.cc:11:2: error: expected '}' at end of input
11 | }
| ^
a.cc:4:11: note: to match this '{'
4 | int main(){
| ^
|
s589422398 | p03861 | C++ | #include<bits/stdc++.h>
using namespace std;
using ll = long long;
int main(){
ll a,b,x;
cin >> a >> b >> x;
if(a == 0){
cout << b%x + 1 << endl;
}else{
cout << b%x+1-(a-1)%x-1<<endl;
} | a.cc: In function 'int main()':
a.cc:11:2: error: expected '}' at end of input
11 | }
| ^
a.cc:4:11: note: to match this '{'
4 | int main(){
| ^
|
s765535508 | p03861 | C++ | #include<bits/stdc++.h>
using namespace std;
using ll = long long;
int main(){
ll a,b,x;
cin >> a >> b >> x;
if(a == 0){
cout << b%x + 1 << endl;
}else{
cout << b%x+1-(a-1)%x-1<<endl;
} | a.cc: In function 'int main()':
a.cc:11:2: error: expected '}' at end of input
11 | }
| ^
a.cc:4:11: note: to match this '{'
4 | int main(){
| ^
|
s886836352 | p03861 | C++ | #include<bits/stdc++>
using namespace std;
int main(){
int a,b,x;
cin >> a >> b >> x;
int counter = 0;
for(int i = a;i <= b; i ++){
if(i % x == 0){
counter ++;
}
}
cout << counter << endl;
} | a.cc:1:9: fatal error: bits/stdc++: No such file or directory
1 | #include<bits/stdc++>
| ^~~~~~~~~~~~~
compilation terminated.
|
s326284762 | p03861 | C++ | #include<bits/stdc++.h>
using namespace std;
int main(){
long long a. b. x, ans=0;
cin >> a >> b >> x;
ans=b/x;
ans=ans-(a-1)/x;
cout << ans <<endl;
return 0;
}
| a.cc: In function 'int main()':
a.cc:4:12: error: expected initializer before '.' token
4 | long long a. b. x, ans=0;
| ^
a.cc:5:10: error: 'a' was not declared in this scope
5 | cin >> a >> b >> x;
| ^
a.cc:5:15: error: 'b' was not declared in this scope
5 | cin >> a >> b >> x;
| ^
a.cc:5:20: error: 'x' was not declared in this scope
5 | cin >> a >> b >> x;
| ^
a.cc:6:3: error: 'ans' was not declared in this scope; did you mean 'abs'?
6 | ans=b/x;
| ^~~
| abs
|
s079895732 | p03861 | C++ | #include <iostream>
#include <algorithm>
#include <vector> //動的配列
#include <string>
#include <list> //双方向リスト
#include <map> //連想配列
#include <set> //集合
#include <stack>
#include <queue>
#include <deque>
#include <cmath>
#include <bitset>
#include <numeric>
#include <tuple>
typedef long long ll;
using namespace std;
typedef pair<int, int> P;
#define FOR(i,a,b) for(int i=(int)(a) ; i < (int) (b) ; ++i )
#define rep(i,n) FOR(i,0,n)
#define sz(x) int(x.size())
template <class T>ostream &operator<<(ostream &o,const vector<T>&v)
{o<<"{";for(int i=0;i<(int)v.size();i++)o<<(i>0?", ":"")<<v[i];o<<"}";return o;}
// n次元配列の初期化。第2引数の型のサイズごとに初期化していく。
template<typename A, size_t N, typename T>
void Fill(A (&array)[N], const T &val){
std::fill( (T*)array, (T*)(array+N), val );
}
//小さい順から取り出すヒープ
//priority_queue<ll, vector<ll>, greater<ll> > pque1;
int main(){
ll a,b,x,ans;
cin>>a>>b>>x;
if (a==0) ans=b/x+1;
else ans=(b/x+1)-(a-1)/x+1);
cout<<ans;
return 0;
}
| a.cc: In function 'int main()':
a.cc:48:31: error: expected ';' before ')' token
48 | else ans=(b/x+1)-(a-1)/x+1);
| ^
| ;
|
s528377631 | p03861 | C++ | #include <bits/stdc++.h>
using namespace std;
int main() {
long long int a,b,x;
cin >> a >> b >> x;
cout << (b/x)-(max(0,(a-1))/x) << endl;
} | a.cc: In function 'int main()':
a.cc:7:21: error: no matching function for call to 'max(int, long long int)'
7 | 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:7:21: note: deduced conflicting types for parameter 'const _Tp' ('int' and 'long long int')
7 | 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:7:21: note: mismatched types 'std::initializer_list<_Tp>' and 'int'
7 | cout << (b/x)-(max(0,(a-1))/x) << endl;
| ~~~^~~~~~~~~
|
s448824578 | p03861 | C++ | #include <bits/stdc++.h>
#include <math.h>
using namespace std;
int main(){
printf(%ld,floorl(1.0*b/x)-ceill(1.0*a/x)+1);
} | a.cc: In function 'int main()':
a.cc:8:10: error: expected primary-expression before '%' token
8 | printf(%ld,floorl(1.0*b/x)-ceill(1.0*a/x)+1);
| ^
a.cc:8:11: error: 'ld' was not declared in this scope
8 | printf(%ld,floorl(1.0*b/x)-ceill(1.0*a/x)+1);
| ^~
a.cc:8:25: error: 'b' was not declared in this scope
8 | printf(%ld,floorl(1.0*b/x)-ceill(1.0*a/x)+1);
| ^
a.cc:8:27: error: 'x' was not declared in this scope
8 | printf(%ld,floorl(1.0*b/x)-ceill(1.0*a/x)+1);
| ^
a.cc:8:40: error: 'a' was not declared in this scope
8 | printf(%ld,floorl(1.0*b/x)-ceill(1.0*a/x)+1);
| ^
|
s781764091 | p03861 | C++ | #include <bits/stdc++.h>
#include<math.h>
using namespace std;
int main(){
printf(%ld,floorl(1.0*b/x)-ceill(1.0*a/x)+1);
} | a.cc: In function 'int main()':
a.cc:8:10: error: expected primary-expression before '%' token
8 | printf(%ld,floorl(1.0*b/x)-ceill(1.0*a/x)+1);
| ^
a.cc:8:11: error: 'ld' was not declared in this scope
8 | printf(%ld,floorl(1.0*b/x)-ceill(1.0*a/x)+1);
| ^~
a.cc:8:25: error: 'b' was not declared in this scope
8 | printf(%ld,floorl(1.0*b/x)-ceill(1.0*a/x)+1);
| ^
a.cc:8:27: error: 'x' was not declared in this scope
8 | printf(%ld,floorl(1.0*b/x)-ceill(1.0*a/x)+1);
| ^
a.cc:8:40: error: 'a' was not declared in this scope
8 | printf(%ld,floorl(1.0*b/x)-ceill(1.0*a/x)+1);
| ^
|
s364580659 | p03861 | C++ | using namespace std;
int main(){
long long int a,b,x;
cin >> a >> b >> x;
if((b-a+1)>x){
long long int ans = (b-a)/x;
if(a%x==0&&b%x==0) ans++;
cout << ans << endl;}
else if((b-a+1)==x) cout << 1 << endl;
else{
if(a/x!=b/x)cout << 1 << endl;
else cout << 0 << endl;
}
} | a.cc: In function 'int main()':
a.cc:5:15: error: 'cin' was not declared in this scope
5 | 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:9:15: error: 'cout' was not declared in this scope
9 | cout << ans << endl;}
| ^~~~
a.cc:9:15: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
a.cc:9:30: error: 'endl' was not declared in this scope
9 | cout << 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;
a.cc:10:35: error: 'cout' was not declared in this scope
10 | else if((b-a+1)==x) cout << 1 << endl;
| ^~~~
a.cc:10:35: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
a.cc:10:48: error: 'endl' was not declared in this scope
10 | else if((b-a+1)==x) cout << 1 << endl;
| ^~~~
a.cc:10:48: note: 'std::endl' is defined in header '<ostream>'; this is probably fixable by adding '#include <ostream>'
a.cc:12:32: error: 'cout' was not declared in this scope
12 | if(a/x!=b/x)cout << 1 << endl;
| ^~~~
a.cc:12:32: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
a.cc:12:45: error: 'endl' was not declared in this scope
12 | if(a/x!=b/x)cout << 1 << endl;
| ^~~~
a.cc:12:45: note: 'std::endl' is defined in header '<ostream>'; this is probably fixable by adding '#include <ostream>'
a.cc:13:25: error: 'cout' was not declared in this scope
13 | else cout << 0 << endl;
| ^~~~
a.cc:13:25: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
a.cc:13:38: error: 'endl' was not declared in this scope
13 | else cout << 0 << endl;
| ^~~~
a.cc:13:38: note: 'std::endl' is defined in header '<ostream>'; this is probably fixable by adding '#include <ostream>'
|
s940003773 | p03861 | C++ | 4 8 2#include<bits/stdc++.h>
using namespace std;
#define int long long
#define double long double
#define fo(a,b) for(int a=0;a<b;a++)
#define Sort(a) sort(a.begin(),a.end())
#define rev(a) reverse(a.begin(),a.end())
#define fi first
#define se second
#define co(a) cout<<a<<endl
#define sz size()
#define bgn begin()
#define en end()
#define pb(a) push_back(a)
#define pp() pop_back()
#define V vector
#define P pair
#define V2(a,b,c) V<V<int>> a(b,V<int>(c))
#define V2a(a,b,c,d) V<V<int>> a(b,V<int>(c,d))
#define incin(a) int a; cin>>a
#define yuko(a) setprecision(a)
#define uni(a) a.erase(unique(a.begin(),a.end()),a.end())
#define pri priority_queue
#define syo <int,V<int>
#define ff fi.fi
#define fs fi.se
#define sf se.fi
#define ss se.se
#define all(a) (a).begin(),(a).end()
#define Pi P<int,int>
#define elif else if
//#define min min<int>
//#define max max<int>
int low(V<int> a,int b){
decltype(a)::iterator c=lower_bound(a.begin(),a.end(),b);
int d=c-a.bgn;
return d;
}
int upp(V<int> a,int b){
decltype(a)::iterator c=upper_bound(a.begin(),a.end(),b);
int d=c-a.bgn;
return d;
}
template<class T>
void cou(vector<vector<T>> a){
int b=a.size();
int c=a[0].size();
fo(i,b){
fo(j,c){
cout<<a[i][j];
if(j==c-1)
cout<<endl;
else
cout<<' ';
}
}
}
/*template<>
void cou(vector<vector<char>> a){
int b=a.size();
int c=a[0].size();
fo(i,b){
fo(j,c){
cout<<a[i][j];
if(j==c-1)
cout<<endl;
else
cout<<' ';
}
}
}*/
int wari(int a,int b) {
if(a%b==0)
return a/b;
else
return a/b+1;
}
int keta(int a){
double b=a;
b=log10(b);
int c=b;
return c+1;
}
int souwa(int a){
return a*(a+1)/2;
}
/*int lcm(int a,int b){
int d=a,e=b,f;
if(a<b)
swap(a,b);
int c,m=1;
while(m){
c=a%b;
if(c==0){
f=b;
m--;
}
else{
a=b;
b=c;
}
}
return d*e/f;
} */
int gcm(int a,int b){
if(a%b==0)
return b;
return gcm(b,a%b);
}
bool prime(int a){
if(a<2)
return false;
else if(a==2)
return true;
else if(a%2==0)
return false;
double b=sqrt(a);
for(int i=3;i<=b;i+=2){
if(a%i==0){
return false;
}
}
return true;
}
struct Union{
vector<int> par;
Union(int a){
par= vector<int>(a,-1);
}
int find(int a){
if(par[a]<0)
return a;
else
return par[a]=find(par[a]);
}
bool same(int a,int b){
return find(a)==find(b);
}
int Size(int a){
return -par[find(a)];
}
void unite(int a,int b){
a=find(a);
b=find(b);
if(a==b)
return;
if(Size(b)>Size(a))
swap<int>(a,b);
par[a]+=par[b];
par[b]=a;
}
};
int ketas(int a){
string b=to_string(a);
int c=0;
fo(i,keta(a)){
c+=b[i]-'0';
}
return c;
}
/*int gcm(int a,int b){
if(b==0)
return a;
return gcm(b,a%b);
}*/
int lcm(int a,int b){
return a/gcm(a,b)*b;
}
/*struct aa{
vector<int> gt;
aa(int n){
gt= vector<int>(n, 1);
}
void c(V<int> d,int b){
if(d[b]==0){
gt[d[b]-1]++;
gt[gt.sz-1]++;
}
else{
gt[d[b]-1]++;
c(d,d[d[b]]-1);
}
}
void cok(int a){
cout<<gt[a-1]<<endl;
fo(i,a-1)
cout<<gt[i]<<endl;
}
};
*/
/*struct dfs(){
}*/
bool fe(int a,int b){
a%=10;
b%=10;
if(a==0)
a=10;
if(b==0)
b=10;
if(a>b)
return true;
else
return false;
}
int INF=1000000007;
struct edge{int s,t,d; };
V<int> mojisyu(string a){
V<int> b(26,0);
fo(i,a.sz){
b[a[i]-'a']++;
}
return b;
}
int wa2(int a){
if(a%2==1)
return a/2;
return a/2-1;
}
/*signed main(){
int a,b,c;
cin>>a>>b>>c;
V<V<edge>> d(a);
fo(i,b){
edge e;
cin>>e.s>>e.t>>e.d;
d[e.s].pb(e);
}
V<int> e(a,INF);
e[c]=0;
priority_queue<P<int,int>,V<P<int,int>>,greater<P<int,int>>> f;
f.push({0,c});
int h=INF;
while(!f.empty()){
P<int,int> g;
g=f.top();
f.pop();
int v = g.second, i = g.first;
for(edge l : d[v]){
if(e[l.t] > i + l.d){
e[l.t] = i + l.d;
f.push({i+l.d , l.t});
}
}
}
fo(i,a){
if(e[i]==INF)
cout<<"INF"<<endl;
else
cout<<e[i]<<endl;
}
}
?*/
signed main(){
int a,b,x;
cin>>a>>b>>x;
a--;
cout<<b/x-a/x<<endl;
}
| a.cc:1:6: error: stray '#' in program
1 | 4 8 2#include<bits/stdc++.h>
| ^
a.cc:1:1: error: expected unqualified-id before numeric constant
1 | 4 8 2#include<bits/stdc++.h>
| ^
a.cc:16:11: error: 'vector' was not declared in this scope
16 | #define V vector
| ^~~~~~
a.cc:34:9: note: in expansion of macro 'V'
34 | int low(V<int> a,int b){
| ^
a.cc:3:13: error: expected primary-expression before 'long'
3 | #define int long long
| ^~~~
a.cc:34:11: note: in expansion of macro 'int'
34 | int low(V<int> a,int b){
| ^~~
a.cc:3:13: error: expected primary-expression before 'long'
3 | #define int long long
| ^~~~
a.cc:34:18: note: in expansion of macro 'int'
34 | int low(V<int> a,int b){
| ^~~
a.cc:34:23: error: expression list treated as compound expression in initializer [-fpermissive]
34 | int low(V<int> a,int b){
| ^
a.cc:16:11: error: 'vector' was not declared in this scope
16 | #define V vector
| ^~~~~~
a.cc:39:9: note: in expansion of macro 'V'
39 | int upp(V<int> a,int b){
| ^
a.cc:3:13: error: expected primary-expression before 'long'
3 | #define int long long
| ^~~~
a.cc:39:11: note: in expansion of macro 'int'
39 | int upp(V<int> a,int b){
| ^~~
a.cc:3:13: error: expected primary-expression before 'long'
3 | #define int long long
| ^~~~
a.cc:39:18: note: in expansion of macro 'int'
39 | int upp(V<int> a,int b){
| ^~~
a.cc:39:23: error: expression list treated as compound expression in initializer [-fpermissive]
39 | int upp(V<int> a,int b){
| ^
a.cc:45:7: error: variable or field 'cou' declared void
45 | void cou(vector<vector<T>> a){
| ^~~
a.cc:45:11: error: 'vector' was not declared in this scope
45 | void cou(vector<vector<T>> a){
| ^~~~~~
a.cc:45:18: error: 'vector' was not declared in this scope
45 | void cou(vector<vector<T>> a){
| ^~~~~~
a.cc:45:26: error: expected primary-expression before '>>' token
45 | void cou(vector<vector<T>> a){
| ^~
a.cc:45:29: error: 'a' was not declared in this scope
45 | void cou(vector<vector<T>> a){
| ^
a.cc: In function 'long long int keta(long long int)':
a.cc:80:5: error: 'log10' was not declared in this scope
80 | b=log10(b);
| ^~~~~
a.cc: In function 'bool prime(long long int)':
a.cc:117:13: error: 'sqrt' was not declared in this scope
117 | double b=sqrt(a);
| ^~~~
a.cc: At global scope:
a.cc:127:3: error: 'vector' does not name a type
127 | vector<int> par;
| ^~~~~~
a.cc: In constructor 'Union::Union(long long int)':
a.cc:129:3: error: 'par' was not declared in this scope
129 | par= vector<int>(a,-1);
| ^~~
a.cc:129:8: error: 'vector' was not declared in this scope
129 | par= vector<int>(a,-1);
| ^~~~~~
a.cc:3:13: error: expected primary-expression before 'long'
3 | #define int long long
| ^~~~
a.cc:129:15: note: in expansion of macro 'int'
129 | par= vector<int>(a,-1);
| ^~~
a.cc: In member function 'long long int Union::find(long long int)':
a.cc:132:8: error: 'par' was not declared in this scope
132 | if(par[a]<0)
| ^~~
a.cc: In member function 'long long int Union::Size(long long int)':
a.cc:141:13: error: 'par' was not declared in this scope
141 | return -par[find(a)];
| ^~~
a.cc: In member function 'void Union::unite(long long int, long long int)':
a.cc:149:7: error: 'swap' was not declared in this scope
149 | swap<int>(a,b);
| ^~~~
a.cc:3:13: error: expected primary-expression before 'long'
3 | #define int long long
| ^~~~
a.cc:149:12: note: in expansion of macro 'int'
149 | swap<int>(a,b);
| ^~~
a.cc:150:5: error: 'par' was not declared in this scope
150 | par[a]+=par[b];
| ^~~
a.cc: In function 'long long int ketas(long long int)':
a.cc:155:3: error: 'string' was not declared in this scope
155 | string b=to_string(a);
| ^~~~~~
a.cc:158:8: error: 'b' was not declared in this scope
158 | c+=b[i]-'0';
| ^
a.cc: At global scope:
a.cc:16:11: error: 'vector' does not name a type
16 | #define V vector
| ^~~~~~
a.cc:209:1: note: in expansion of macro 'V'
209 | V<int> mojisyu(string a){
| ^
a.cc: In function 'int main()':
a.cc:257:3: error: 'cin' was not declared in this scope
257 | cin>>a>>b>>x;
| ^~~
a.cc:259:3: error: 'cout' was not declared in this scope
259 | cout<<b/x-a/x<<endl;
| ^~~~
a.cc:259:18: error: 'endl' was not declared in this scope; did you mean 'en'?
259 | cout<<b/x-a/x<<endl;
| ^~~~
| en
|
s235134320 | p03861 | C++ | #include <bits/stdc++.h>
using namespace std;
#define ALL(a) (a).begin(),(a).end()
#define rALL(a) (a).rbegin(),(a).rend()
typedef pair<int, int> Pint;
typedef pair<int64_t, int64_t> Pll;
int main() {
int64_t a, b, x;
cin >> a >> b >> x;
b = b / x + 1;
a = (a - 1) / x + 1
if (a == 0) {
a = 1;
}
cout << b - a << endl;
} | a.cc: In function 'int main()':
a.cc:12:24: error: expected ';' before 'if'
12 | a = (a - 1) / x + 1
| ^
| ;
13 | if (a == 0) {
| ~~
|
s621066155 | p03861 | C++ | #include <bits/stdc++.h>
using namespace std;
#define ALL(a) (a).begin(),(a).end()
#define rALL(a) (a).rbegin(),(a).rend()
typedef pair<int, int> Pint;
typedef pair<int64_t, int64_t> Pll;
int main() {
int64_t a, b, x;
cin >> a >> b >> x;
b = b / x + 1
a = (a - 1) / x + 1
if (a == 0) {
a = 1;
}
cout << b - a << endl;
} | a.cc: In function 'int main()':
a.cc:11:18: error: expected ';' before 'a'
11 | b = b / x + 1
| ^
| ;
12 | a = (a - 1) / x + 1
| ~
|
s445537290 | p03861 | Java | import java.util.*;
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 ax;
if(a != 0){
ax = (a -1) / x;
}else{
ax = 0;
}
long bx = b / x;
long ans = bx - ax;
if(ans == 0&&a % x == 0){
ans == 1;
}
System.out.println(ans);
}
} | Main.java:19: error: not a statement
ans == 1;
^
1 error
|
s665235348 | p03861 | C++ | 4 8 2 | a.cc:1:1: error: expected unqualified-id before numeric constant
1 | 4 8 2
| ^
|
s882582828 | p03861 | C++ | #include <iostream>
using namespace std;
int main(void)
{
long long int a,b,x,z,t;
cin>>a>>b>>x;
z=(b/x)-(a/x);
if(a%x==0)
{
z++;
} | a.cc: In function 'int main()':
a.cc:12:8: error: expected '}' at end of input
12 | }
| ^
a.cc:5:1: note: to match this '{'
5 | {
| ^
|
s359586534 | p03861 | C++ | #include <iostream>
using namespace std;
int main(void)
{
long long int a,b,x,z,t;
cin>>a>>b>>x;
z=(b/x)-(a/x);
if(a%x==0)
{
z++;
}
cout<<z; | a.cc: In function 'int main()':
a.cc:13:9: error: expected '}' at end of input
13 | cout<<z;
| ^
a.cc:5:1: note: to match this '{'
5 | {
| ^
|
s162040124 | p03861 | C++ | #include <iostream>
using namespace std;
int main()
{
long long a,b,c,r;
cin>>a>>b>>c;
r = (b/c)-((a)/c)
if(a%c == 0){
cout<<r++<<endl;
}
cout<<r<<endl;
return 0;
}
| a.cc: In function 'int main()':
a.cc:11:22: error: expected ';' before 'if'
11 | r = (b/c)-((a)/c)
| ^
| ;
12 |
13 | if(a%c == 0){
| ~~
|
s741329042 | p03861 | C++ | #include <iostream>
using namespace std;
int main()
{
long long int a,b,c;
cin>>a>>b>>c;
int i = b/c;
if (a!=0){
int j = (a-1)/c;
}
j = a;
cout<<i-j<<endl;
}
| a.cc: In function 'int main()':
a.cc:13:9: error: 'j' was not declared in this scope
13 | j = a;
| ^
|
s176112683 | p03861 | C++ | #include <bits/stdc++.h>
using namespace std;
void waru(int &A,int &B,int &X,int &Count){
for ( int i = A; A <= B; i++){
if ( i % X == 0){
Count++;
}
}
}
int main(){
int a,b,x;
cin >> a >> b >> x;
int count = waru(a,b,x,count);
cout << count << endl;
} | a.cc: In function 'int main()':
a.cc:15:19: error: void value not ignored as it ought to be
15 | int count = waru(a,b,x,count);
| ~~~~^~~~~~~~~~~~~
|
s189313946 | p03861 | C++ | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
ll func(ll a,ll x){
ans = 0;
if(a > -1){
ans = a/x +1;
}
return ans;
}
int main() {
long long a,b,x;
cin >> a >> b >> x;
long long ans;
ans = func(b,x) - func(a-1,x);
cout << ans << endl;
return 0;
}
| a.cc: In function 'll func(ll, ll)':
a.cc:6:3: error: 'ans' was not declared in this scope; did you mean 'abs'?
6 | ans = 0;
| ^~~
| abs
|
s701458927 | p03861 | C++ | #include<bits/stdc++.h>
//macros
using namespace std;
typedef long long ll;
typedef pair<int, int > Pii;
typedef pair<ll, ll> Pll;
typedef vector<int> Vi;
typedef vector<ll> Vll;
#define pb push_back
#define rs resize
#define rep(i, a, b) for(int i=(a); i<(b); i++)
const long long int mod = 1e9 + 7;
#define Yes cout << "Yes" << endl
#define No cout << "No" << endl
#define YES cout << "YES" << endl;
#define NO cout << "NO" << endl;
#define COUT(a) cout << a << endl;
int main(){
ll a, b, x , res =0;
cin >> a >> b >>x;
ll tmp0 = a%x==0 ? a : x*(a/x)+x;
ll tmp1 = b%x==0 ? b : x*(b/x);
res = (tmp1-tmp0)/x+1;
cout << max(res,0) << endl;
}
| a.cc: In function 'int main()':
a.cc:25:16: error: no matching function for call to 'max(ll&, int)'
25 | cout << max(res,0) << endl;
| ~~~^~~~~~~
In file included from /usr/include/c++/14/algorithm:60,
from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:51,
from a.cc:1:
/usr/include/c++/14/bits/stl_algobase.h:257:5: note: candidate: 'template<class _Tp> constexpr const _Tp& std::max(const _Tp&, const _Tp&)'
257 | max(const _Tp& __a, const _Tp& __b)
| ^~~
/usr/include/c++/14/bits/stl_algobase.h:257:5: note: template argument deduction/substitution failed:
a.cc:25:16: note: deduced conflicting types for parameter 'const _Tp' ('long long int' and 'int')
25 | cout << max(res,0) << endl;
| ~~~^~~~~~~
/usr/include/c++/14/bits/stl_algobase.h:303:5: note: candidate: 'template<class _Tp, class _Compare> constexpr const _Tp& std::max(const _Tp&, const _Tp&, _Compare)'
303 | max(const _Tp& __a, const _Tp& __b, _Compare __comp)
| ^~~
/usr/include/c++/14/bits/stl_algobase.h:303:5: note: candidate expects 3 arguments, 2 provided
In file included from /usr/include/c++/14/algorithm:61:
/usr/include/c++/14/bits/stl_algo.h:5706:5: note: candidate: 'template<class _Tp> constexpr _Tp std::max(initializer_list<_Tp>)'
5706 | max(initializer_list<_Tp> __l)
| ^~~
/usr/include/c++/14/bits/stl_algo.h:5706:5: note: candidate expects 1 argument, 2 provided
/usr/include/c++/14/bits/stl_algo.h:5716:5: note: candidate: 'template<class _Tp, class _Compare> constexpr _Tp std::max(initializer_list<_Tp>, _Compare)'
5716 | max(initializer_list<_Tp> __l, _Compare __comp)
| ^~~
/usr/include/c++/14/bits/stl_algo.h:5716:5: note: template argument deduction/substitution failed:
a.cc:25:16: note: mismatched types 'std::initializer_list<_Tp>' and 'long long int'
25 | cout << max(res,0) << endl;
| ~~~^~~~~~~
|
s232551695 | p03861 | C++ | #include <iostream>
using namespace std;
#include<bits/stdc++.h>
#include<cstring>
#include<cmath>
#include<cstdio>
#include<string>
#include<stdio.h>
#include<vector>
#include<map>
#include<algorithm>
int main()
{
long long int a,b,x;
cin >> a >> b >> x;
if(a==b==x)
{
cout << 1 << endl;
}
else if(a==b && ((x==a) || (x==1) ))
{
cout << 1 <<endl;
}#include <iostream>
using namespace std;
#include<bits/stdc++.h>
#include<cstring>
#include<cmath>
#include<cstdio>
#include<string>
#include<stdio.h>
#include<vector>
#include<map>
#include<algorithm>
int main()
{
long long int a,b,x;
cin >> a >> b >> x;
if(a==b==x)
{
cout << 2 << endl;
}
else if(a==b && ((x==a) || (x==1) ))
{
cout << 1 <<endl;
}
else if(a==b && (x!=a || x!= 1) )
{
cout << 0 << endl;
}
else
{
if(a%x==0)
{
cout << (b-a)/x + 1 << endl;
}
else
{
cout <<(b-a)/x << endl;
}
}
}
else if(a==b && (x!=a || x!= 1) )
{
cout << 0 << endl;
}
else
{
if(a%x==0)
{
cout << (b-a)/x + 1 << endl;
}
else
{
cout <<(b-a)/x << endl;
}
}
}
| a.cc:26:6: error: stray '#' in program
26 | }#include <iostream>
| ^
a.cc: In function 'int main()':
a.cc:26:7: error: 'include' was not declared in this scope
26 | }#include <iostream>
| ^~~~~~~
a.cc:26:24: error: expected primary-expression before '>' token
26 | }#include <iostream>
| ^
a.cc:27:1: error: expected primary-expression before 'using'
27 | using namespace std;
| ^~~~~
a.cc:40:9: warning: empty parentheses were disambiguated as a function declaration [-Wvexing-parse]
40 | int main()
| ^~
a.cc:40:9: note: remove parentheses to default-initialize a variable
40 | int main()
| ^~
| --
a.cc:40:9: note: or replace parentheses with braces to value-initialize a variable
a.cc:41:1: error: a function-definition is not allowed here before '{' token
41 | {
| ^
a.cc:81:5: error: 'else' without a previous 'if'
81 | else if(a==b && (x!=a || x!= 1) )
| ^~~~
|
s007695294 | p03861 | C++ | #include<iostream>
#include<vector>
#include<algorithm>
#include<string>
#include<set>
#include<map>
#include<queue>
#define REP(i,a) for (int i = 0;i < (a);++i)
#define FOR(i,a,b) for (int i = (a);i < (b); ++i)
#define FORR(i,a,b) for (int i = (a);i >= (b); --i)
#define ALL(obj) (obj).begin(),(obj).end()
#define SORT(list) sort(ALL((list)));
#define MOD 1000000007
using namespace std;
using ll = long long;
int main(){
ll a,b,x;
cin >> a >> b >> x;
ll tmp = 0;
if(a == b){
if(a == x)cout << 1 << endl;
else cout << 0 <<endl;
}
if((b-a+1)%x!=0)tmp=1;
cout << (b-a+1)% | a.cc: In function 'int main()':
a.cc:25:19: error: expected primary-expression at end of input
25 | cout << (b-a+1)%
| ^
a.cc:25:19: error: expected '}' at end of input
a.cc:16:11: note: to match this '{'
16 | int main(){
| ^
|
s815411667 | p03861 | C++ | a,b,x=map(int,(input().split()))
print(b//x-(a-1)//x)
#0 100000000000000000 1 | a.cc:3:4: error: "100000000000000000" is not a valid filename
3 | #0 100000000000000000 1
| ^~~~~~~~~~~~~~~~~~
a.cc:1:1: error: 'a' does not name a type
1 | a,b,x=map(int,(input().split()))
| ^
|
s983774435 | p03861 | Java | import java.util.*;
public class Main {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
int a = sc.nextLong();
int b = sc.nextLong();
int x = sc.nextLong();
int count = 0;
count =(b / x) - (a / x);
if(a % x == 0){
count++;
}
System.out.println(count);
}
}
| Main.java:6: error: incompatible types: possible lossy conversion from long to int
int a = sc.nextLong();
^
Main.java:7: error: incompatible types: possible lossy conversion from long to int
int b = sc.nextLong();
^
Main.java:8: error: incompatible types: possible lossy conversion from long to int
int x = sc.nextLong();
^
3 errors
|
s493850481 | 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 count = 0;
for(long i = a ; i <= b; i++){
if(i % x == 0){
count++;
}
System.out.println(count);
}
}
| Main.java:18: error: reached end of file while parsing
}
^
1 error
|
s262168449 | 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) << endl;
} | a.cc: In function 'int main()':
a.cc:6:6: error: expected ';' before 'a'
6 | cin a >> b >> x;
| ^~
| ;
|
s128975304 | p03861 | C++ | #include <iostream>
#include <vector>
using namespace std;
int main(){
int64_t = a, b, ;c
cin >> a >> b >> c;
if((a != 0) &&(a%c ==0) && (b%c == 0)){
cout << (b-a)/c +1 <<endl;
}
else if((a != 0) &&(a%c ==0) && (b%c != 0)){
cout << (b-a)/c+1 <<endl;
}
else if((a != 0) &&(a%c !=0) && (b%c == 0)){
cout <<(b-a)/c+1 << endl;
}
else if ((a != 0) &&(a%c !=0) && (b%c != 0)){
cout <<(b-a)/c <<endl;
}
else if ((a == 0) &&(b%c ==0)){
cout << (b/c) <<endl;
}
else if ((a==0)&&(b%C != 0)){
cout << (b/c) <<endl;
}
}
| a.cc: In function 'int main()':
a.cc:7:11: error: expected unqualified-id before '=' token
7 | int64_t = a, b, ;c
| ^
a.cc:7:20: error: 'c' was not declared in this scope
7 | int64_t = a, b, ;c
| ^
a.cc:10:7: error: 'a' was not declared in this scope
10 | if((a != 0) &&(a%c ==0) && (b%c == 0)){
| ^
a.cc:10:31: error: 'b' was not declared in this scope
10 | if((a != 0) &&(a%c ==0) && (b%c == 0)){
| ^
a.cc:25:25: error: 'C' was not declared in this scope
25 | else if ((a==0)&&(b%C != 0)){
| ^
|
s358509653 | p03861 | C++ | include<bits/stdc++.h>
#define double long long
using namespace std;
double a,b,x;
signed main(){
scanf("%lld%lld%lld",&a,&b,&x);
printf("%lld",!(a%x)?b/x-a/x+1:b/x-a/x);
return 0;
} | 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:5: error: 'scanf' was not declared in this scope
6 | scanf("%lld%lld%lld",&a,&b,&x);
| ^~~~~
a.cc:7:5: error: 'printf' was not declared in this scope
7 | printf("%lld",!(a%x)?b/x-a/x+1:b/x-a/x);
| ^~~~~~
a.cc:1:1: note: 'printf' is defined in header '<cstdio>'; this is probably fixable by adding '#include <cstdio>'
+++ |+#include <cstdio>
1 | include<bits/stdc++.h>
|
s915927649 | p03861 | C | #include<stdio.h>
int main(void) {
unsigned int a, b, x;
int flag;
scanf("%d %d %d", &a, &b, &x);
for(a;a<b;a++) {
if(a % x == 0) {
flag++;
}
}
printf("%d", flag)
return 0;
} | main.c: In function 'main':
main.c:14:21: error: expected ';' before 'return'
14 | printf("%d", flag)
| ^
| ;
15 | return 0;
| ~~~~~~
|
s614266773 | p03861 | C | #include <stdio.h>
int main(void){
int a,b,c,x,i,ans=0;
scanf("%d¥n",&a);
scanf("%d¥n",&b);
scanf("%d¥n",&x);
ans = (b-a)/x;
if(ans>0){
printf("%d",ans+1);
}else{
printf("%d",ans);
return 0;
} | main.c: In function 'main':
main.c:15:1: error: expected declaration or statement at end of input
15 | }
| ^
|
s370944407 | p03861 | Java | import java.util.*;
import java.math.BigInteger;
class Main{
public static void main(String args[]){
Scanner sc = new Scanner(System.in);
long a = sc.nextInt();
long b = sc.nextInt();
long x = sc.nextInt();
long count = 0;
System.out.println(f(b,x) - f(a-1,x));
}
public static long f(long n,long d){
if(n == -1){
return 0;
}else{
return f2(n,d);
}
}
public statis long f2(long n, long d){
for(long i=1;i<=n;i++){
if(i%d == 0){
count += 1;
}
}
return count;
}
} | Main.java:24: error: <identifier> expected
public statis long f2(long n, long d){
^
1 error
|
s843203658 | p03861 | C | #include <stdio.h>
int main(){
int a,b,x;
scanf("%d %d %d", &a, &b, &c);
int num=0;
for(int i=a, i<=b,i++){
if(i%x==0){
num++;
}
}
print(num);
} | main.c: In function 'main':
main.c:5:32: error: 'c' undeclared (first use in this function)
5 | scanf("%d %d %d", &a, &b, &c);
| ^
main.c:5:32: note: each undeclared identifier is reported only once for each function it appears in
main.c:7:19: error: expected '=', ',', ';', 'asm' or '__attribute__' before '<=' token
7 | for(int i=a, i<=b,i++){
| ^~
main.c:12:5: error: implicit declaration of function 'print'; did you mean 'printf'? [-Wimplicit-function-declaration]
12 | print(num);
| ^~~~~
| printf
main.c:13:1: error: expected expression before '}' token
13 | }
| ^
main.c:13:1: error: expected expression before '}' token
|
s298655508 | p03861 | C | #include <stdio.h>
int main(void){
int a,b,,c,x,i,ans=0;
scanf("%d¥n",&a);
scanf("%d¥n",&b);
scanf("%d¥n",&x);
for(i=a;i<=b;i++){
c=i%x;
if(c=0){
ans = i;
printf("%d",ans);
}
}
if(ans==0){
printf("%d",ans);
}
return 0;
} | main.c: In function 'main':
main.c:4:11: error: expected identifier or '(' before ',' token
4 | int a,b,,c,x,i,ans=0;
| ^
main.c:7:17: error: 'x' undeclared (first use in this function)
7 | scanf("%d¥n",&x);
| ^
main.c:7:17: note: each undeclared identifier is reported only once for each function it appears in
main.c:8:7: error: 'i' undeclared (first use in this function)
8 | for(i=a;i<=b;i++){
| ^
main.c:9:5: error: 'c' undeclared (first use in this function)
9 | c=i%x;
| ^
main.c:11:7: error: 'ans' undeclared (first use in this function)
11 | ans = i;
| ^~~
|
s000563799 | p03861 | C | #include <stdio.h>
int main(void){
int a,b,x,i,ans=0;
scanf("%d¥n",&a);
scanf("%d¥n",&b);
scanf("%d¥n",&x);
for(i=a;i<=b;i++){
if(i/x%=0){
ans = i;
printf("%d",ans);
}
}
if(ans==0){
printf("%d",ans);
}
return 0;
} | main.c: In function 'main':
main.c:9:11: error: lvalue required as left operand of assignment
9 | if(i/x%=0){
| ^~
|
s217361243 | p03861 | C | #include <stdio.h>
int main(void){
int a,b,x,ans=0;
scanf("%d¥n",&a);
scanf("%d¥n",&b);
scanf("%d¥n",&x);
for(i=a;i<=b;i++){
if(i/x%=0){
ans = i;
printf("%d",ans);
}
}
if(ans==0){
printf("%d",ans);
}
return 0;
} | main.c: In function 'main':
main.c:8:7: error: 'i' undeclared (first use in this function)
8 | for(i=a;i<=b;i++){
| ^
main.c:8:7: note: each undeclared identifier is reported only once for each function it appears in
|
s521137175 | p03861 | C | #include <stdio.h>
int main(void){
long long int a, b, x;
int i, sum = 0;
sacnf("%lu", &a);
sacnf("%lu", &b);
sacnf("%lu", &x);
for(i = a; i <= b; i++){
if(i % x == 0){
sum = sum + 1;
}
}
printf("%d", sum);
return 0;
} | main.c: In function 'main':
main.c:6:3: error: implicit declaration of function 'sacnf'; did you mean 'scanf'? [-Wimplicit-function-declaration]
6 | sacnf("%lu", &a);
| ^~~~~
| scanf
|
s195408117 | p03861 | C | #include <stdio.h>
int main(void){
long long int a, b, x;
int i, sum = 0;
sacnf("%lu", &a);
sacnf("%lu", &b);
sacnf("%lu", &x);
for(i = a; i <= b; i++){
if(i % x = 0){
sum = sum + 1;
}
}
printf("%d", sum);
return 0;
} | main.c: In function 'main':
main.c:6:3: error: implicit declaration of function 'sacnf'; did you mean 'scanf'? [-Wimplicit-function-declaration]
6 | sacnf("%lu", &a);
| ^~~~~
| scanf
main.c:11:14: error: lvalue required as left operand of assignment
11 | if(i % x = 0){
| ^
|
s594452058 | p03861 | C | #include <stdio.h>
int main(void){
long long int a, b, x;
int sum = 0;
sacnf("%lu", &a);
sacnf("%lu", &b);
sacnf("%lu", &x);
for(i = a; i <= b; i++){
if(i % x = 0){
sum = sum + 1;
}
}
printf("%d", sum);
return 0;
} | main.c: In function 'main':
main.c:6:3: error: implicit declaration of function 'sacnf'; did you mean 'scanf'? [-Wimplicit-function-declaration]
6 | sacnf("%lu", &a);
| ^~~~~
| scanf
main.c:10:7: error: 'i' undeclared (first use in this function)
10 | for(i = a; i <= b; i++){
| ^
main.c:10:7: note: each undeclared identifier is reported only once for each function it appears in
|
s535310866 | p03861 | Java | import java.util.*;
import java.math.BigInteger;
class Main{
public static void main(String args[]){
Scanner sc = new Scanner(System.in);
long a = sc.nextInt();
long b = sc.nextInt();
long x = sc.nextInt();
long count = 0;
BigInteger num = BigInteger.valueOf(count);
for(long i=a;i<=b;i++){
if(i%x == 0){
num += 1;
}
}
System.out.println(num);
}
} | Main.java:15: error: bad operand types for binary operator '+'
num += 1;
^
first type: BigInteger
second type: int
1 error
|
s862320168 | p03861 | Java | import java.util.*;
class Main{
public static void main(String args[]){
Scanner sc = new Scanner(System.in);
long a = sc.nextInt();
long b = sc.nextInt();
long x = sc.nextInt();
long count = 0;
BigInteger num = BigInteger.valueOf(count);
for(long i=a;i<=b;i++){
if(i%x == 0){
count += 1;
}
}
System.out.println(count);
}
} | Main.java:11: error: cannot find symbol
BigInteger num = BigInteger.valueOf(count);
^
symbol: class BigInteger
location: class Main
Main.java:11: error: cannot find symbol
BigInteger num = BigInteger.valueOf(count);
^
symbol: variable BigInteger
location: class Main
2 errors
|
s195064066 | p03861 | Java | import java.util.*;
class Main{
public static void main(String args[]){
Scanner sc = new Scanner(System.in);
long a = sc.nextInt();
long b = sc.nextInt();
long x = sc.nextInt();
long count = 0;
for(long i=a;i<=b;i++){
if(i%x == 0){
count += 1;
}
}
System.out.println(BigInteger.valueOf(count));
}
} | Main.java:17: error: cannot find symbol
System.out.println(BigInteger.valueOf(count));
^
symbol: variable BigInteger
location: class Main
1 error
|
s735272527 | p03861 | C++ | #include<bits/stdc++.h>
# define speed ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL)
using namespace std;
unsigned long long int a,b,x;
int main(){
speed;
cin >> a >> b >> x;
/*
for (int i = a;i <= b;i++){
if (i % x == 0){
ans++;
}
}
cout << ans;
*/
long long double h1 = (a-1)/x;
long long double h2 = (b/x);
round(h1);
round(h2);
cout << h2 - h1;
}
| a.cc: In function 'int main()':
a.cc:16:9: error: 'long long' specified with 'double'
16 | long long double h1 = (a-1)/x;
| ^~~~
a.cc:17:10: error: 'long long' specified with 'double'
17 | long long double h2 = (b/x);
| ^~~~
|
s371805400 | p03861 | Java | #include <bits/stdc++.h>
using namespace std;
int main() {
long a, b, x;
cin >> a >> b >> x;
long a_ = a / x;
if (a % x == 0) {
a_--;
}
long b_ = b / x;
cout << b_ - a_ << endl;
} | Main.java:1: error: illegal character: '#'
#include <bits/stdc++.h>
^
Main.java:1: error: class, interface, enum, or record expected
#include <bits/stdc++.h>
^
Main.java:7: error: not a statement
cin >> a >> b >> x;
^
Main.java:17: error: not a statement
cout << b_ - a_ << endl;
^
Main.java:4: error: unnamed classes are a preview feature and are disabled by default.
int main() {
^
(use --enable-preview to enable unnamed classes)
5 errors
|
s637928083 | p03861 | C++ | #include <iostream>
using namespace std;
int f(int n, int x);
int main(void) {
long long ans;
long long i;
long long a, b, x;
// get input ----------------------------------
cin >> a >> b >> x;
// calc ---------------------------------------
ans = f(b) - f(a - 1);
// disp answer ---------------------------------
cout << ans << endl;
return 0;
}
int f(int n, int x) {
if (n == -1) {
return 0;
}
return n / x + 1;
}
| a.cc: In function 'int main()':
a.cc:14:16: error: too few arguments to function 'int f(int, int)'
14 | ans = f(b) - f(a - 1);
| ~^~~
a.cc:5:5: note: declared here
5 | int f(int n, int x);
| ^
a.cc:14:23: error: too few arguments to function 'int f(int, int)'
14 | ans = f(b) - f(a - 1);
| ~^~~~~~~
a.cc:5:5: note: declared here
5 | int f(int n, int x);
| ^
|
s977594978 | p03861 | C++ | #include <bits/stdc++.h>
using namespace std;
int main(){
long long a,b,x;cin>>a>>b>>x;
cout<<b/x-max(0,(a-1)/x);
} | a.cc: In function 'int main()':
a.cc:6:16: error: no matching function for call to 'max(int, long long int)'
6 | cout<<b/x-max(0,(a-1)/x);
| ~~~^~~~~~~~~~~
In file included from /usr/include/c++/14/algorithm:60,
from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:51,
from a.cc:1:
/usr/include/c++/14/bits/stl_algobase.h:257:5: note: candidate: 'template<class _Tp> constexpr const _Tp& std::max(const _Tp&, const _Tp&)'
257 | max(const _Tp& __a, const _Tp& __b)
| ^~~
/usr/include/c++/14/bits/stl_algobase.h:257:5: note: template argument deduction/substitution failed:
a.cc:6:16: note: deduced conflicting types for parameter 'const _Tp' ('int' and 'long long int')
6 | cout<<b/x-max(0,(a-1)/x);
| ~~~^~~~~~~~~~~
/usr/include/c++/14/bits/stl_algobase.h:303:5: note: candidate: 'template<class _Tp, class _Compare> constexpr const _Tp& std::max(const _Tp&, const _Tp&, _Compare)'
303 | max(const _Tp& __a, const _Tp& __b, _Compare __comp)
| ^~~
/usr/include/c++/14/bits/stl_algobase.h:303:5: note: candidate expects 3 arguments, 2 provided
In file included from /usr/include/c++/14/algorithm:61:
/usr/include/c++/14/bits/stl_algo.h:5706:5: note: candidate: 'template<class _Tp> constexpr _Tp std::max(initializer_list<_Tp>)'
5706 | max(initializer_list<_Tp> __l)
| ^~~
/usr/include/c++/14/bits/stl_algo.h:5706:5: note: candidate expects 1 argument, 2 provided
/usr/include/c++/14/bits/stl_algo.h:5716:5: note: candidate: 'template<class _Tp, class _Compare> constexpr _Tp std::max(initializer_list<_Tp>, _Compare)'
5716 | max(initializer_list<_Tp> __l, _Compare __comp)
| ^~~
/usr/include/c++/14/bits/stl_algo.h:5716:5: note: template argument deduction/substitution failed:
a.cc:6:16: note: mismatched types 'std::initializer_list<_Tp>' and 'int'
6 | cout<<b/x-max(0,(a-1)/x);
| ~~~^~~~~~~~~~~
|
s132053817 | p03861 | C | #include <bits/stdc++.h>
using namespace std;
int main()
{
long int a;
long long int b,x,ans;
cin>>a>>b>>x;
ans=((b/x) - ((a-1)/x));
cout<<ans<<endl;
return 0;
}
| main.c:1:10: fatal error: bits/stdc++.h: No such file or directory
1 | #include <bits/stdc++.h>
| ^~~~~~~~~~~~~~~
compilation terminated.
|
s387843520 | p03861 | C++ | #include<bits/stdc++.h>
using namespace std;
#define int long long
int main(){
int a,b,c,d;
cin>>a>>b>>c;
d=b-a;
d=(d+1)/c;
cout<<d<<"\n";
} | cc1plus: error: '::main' must return 'int'
|
s861455603 | p03861 | C++ | #include <bits/stdc++.h>
using namespace std;
#define ll long long
#define rep(i,n) for(int (i) = 0; (i) < (n); (i)++)
int main(){
ll a, b, c;
cin >> a >> b >> c;
cout << b/c - (a%c ? a/x+1 : a/x) +1 << endl;
}
| a.cc: In function 'int main()':
a.cc:9:28: error: 'x' was not declared in this scope
9 | cout << b/c - (a%c ? a/x+1 : a/x) +1 << endl;
| ^
|
s474152643 | p03861 | C++ | #include <algorithm>
#include <cmath>
#include <deque>
#include <iostream>
#include <numeric>
#include <queue>
#include <sstream>
#include <string>
#include <string.h>
#include <tuple>
#include <vector>
#define REP(i,x) for(int i{ 0 }; i < (int)(x); i++)
#define REPC(i,x) for(int i{ 0 }; i <= (int)(x); i++)
#define RREP(i,x) for(int i{ (int)(x) - 1 }; i >= 0 ;i--)
#define RREPC(i,x) for(int i{ (int)(x)}; i >= 0; i--)
#define REP1O(i,x) for(int i{ 1 }; i < (int)(x); i++)
#define REP1C(i,x) for(int i{ 1 }; i <= (int)(x); i++)
#define PB push_back
#define MP make_pair
#define F first
#define S second
#define SZ(x) ((int)(x).size())
#define ALL(x) (x).begin(),(x).end()
using namespace std;
typedef int64_t ll;
typedef vector<int> vi;
typedef vector<ll> vll;
typedef vector<vector<int>> vvi;
typedef vector<vector<ll>> vvll;
typedef pair<int, int> pii;
typedef tuple<int, int, int> tupiii;
typedef tuple<ll, ll, ll> tuplll;
const int INTMAX = 2147483647;
const ll LLMAX = 9223372036854775807;
const int MOD = 1000000007;
template<class T> inline bool chmax(T& a, const T& b) { if (a < b) { a = b; return 1; } return 0; }
template<class T> inline bool chmin(T& a, const T& b) { if (b < a) { a = b; return 1; } return 0; }
inline void swap(ll& a, ll& b) { a ^= b; b ^= a; a ^= b; }
inline void swap(int& a, int& b) { a ^= b; b ^= a; a ^= b; }
int main()
{
ll a, b, x;
cin >> a >> b >> x;
cout << (b / x) - (max(0LL, (a - 1)) / x) << endl;
}
| a.cc: In function 'int main()':
a.cc:54:31: error: no matching function for call to 'max(long long int, ll)'
54 | cout << (b / x) - (max(0LL, (a - 1)) / x) << endl;
| ~~~^~~~~~~~~~~~~~
In file included from /usr/include/c++/14/algorithm:60,
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:54:31: note: deduced conflicting types for parameter 'const _Tp' ('long long int' and 'll' {aka 'long int'})
54 | cout << (b / x) - (max(0LL, (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:54:31: note: mismatched types 'std::initializer_list<_Tp>' and 'long long int'
54 | cout << (b / x) - (max(0LL, (a - 1)) / x) << endl;
| ~~~^~~~~~~~~~~~~~
|
s924163784 | p03861 | C++ | #include <algorithm>
#include <cmath>
#include <deque>
#include <iostream>
#include <numeric>
#include <queue>
#include <sstream>
#include <string>
#include <string.h>
#include <tuple>
#include <vector>
#define REP(i,x) for(int i{ 0 }; i < (int)(x); i++)
#define REPC(i,x) for(int i{ 0 }; i <= (int)(x); i++)
#define RREP(i,x) for(int i{ (int)(x) - 1 }; i >= 0 ;i--)
#define RREPC(i,x) for(int i{ (int)(x)}; i >= 0; i--)
#define REP1O(i,x) for(int i{ 1 }; i < (int)(x); i++)
#define REP1C(i,x) for(int i{ 1 }; i <= (int)(x); i++)
#define PB push_back
#define MP make_pair
#define F first
#define S second
#define SZ(x) ((int)(x).size())
#define ALL(x) (x).begin(),(x).end()
using namespace std;
typedef int64_t ll;
typedef vector<int> vi;
typedef vector<ll> vll;
typedef vector<vector<int>> vvi;
typedef vector<vector<ll>> vvll;
typedef pair<int, int> pii;
typedef tuple<int, int, int> tupiii;
typedef tuple<ll, ll, ll> tuplll;
const int INTMAX = 2147483647;
const ll LLMAX = 9223372036854775807;
const int MOD = 1000000007;
template<class T> inline bool chmax(T& a, const T& b) { if (a < b) { a = b; return 1; } return 0; }
template<class T> inline bool chmin(T& a, const T& b) { if (b < a) { a = b; return 1; } return 0; }
inline void swap(ll& a, ll& b) { a ^= b; b ^= a; a ^= b; }
inline void swap(int& a, int& b) { a ^= b; b ^= a; a ^= b; }
int main()
{
ll a, b, x;
cout << (b / x) - (max(0LL, (a - 1)) / x) << endl;
}
| a.cc: In function 'int main()':
a.cc:53:31: error: no matching function for call to 'max(long long int, ll)'
53 | cout << (b / x) - (max(0LL, (a - 1)) / x) << endl;
| ~~~^~~~~~~~~~~~~~
In file included from /usr/include/c++/14/algorithm:60,
from a.cc:1:
/usr/include/c++/14/bits/stl_algobase.h:257:5: note: candidate: 'template<class _Tp> constexpr const _Tp& std::max(const _Tp&, const _Tp&)'
257 | max(const _Tp& __a, const _Tp& __b)
| ^~~
/usr/include/c++/14/bits/stl_algobase.h:257:5: note: template argument deduction/substitution failed:
a.cc:53:31: note: deduced conflicting types for parameter 'const _Tp' ('long long int' and 'll' {aka 'long int'})
53 | cout << (b / x) - (max(0LL, (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:53:31: note: mismatched types 'std::initializer_list<_Tp>' and 'long long int'
53 | cout << (b / x) - (max(0LL, (a - 1)) / x) << endl;
| ~~~^~~~~~~~~~~~~~
|
s664642798 | p03861 | C++ | #include <bits/stdc++.h>
using namespace std;
int main() {
long long a, b, x;
cin >> a >> b >> x;
long long count=0;
for (i=a; i<=b; i++){
if(i%x == 0) count++;
}
cout << count << endl;
return 0;
}
| a.cc: In function 'int main()':
a.cc:9:8: error: 'i' was not declared in this scope
9 | for (i=a; i<=b; i++){
| ^
|
s625119259 | p03861 | C++ | #include<iostream>
using namespace std;
int f(unsinged long a, unsigned long x){
if(a==-1) return 0;
else return a/x;
}
int main(){
unsigned long a, b, x;
cin >> a >> b >> x;
unsigned long ans;
ans = f(b, x) - f(a-1,x);
cout << ans << endl;
return 0;
} | a.cc:3:7: error: 'unsinged' was not declared in this scope; did you mean 'unsigned'?
3 | int f(unsinged long a, unsigned long x){
| ^~~~~~~~
| unsigned
a.cc:3:24: error: expected primary-expression before 'unsigned'
3 | int f(unsinged long a, unsigned long x){
| ^~~~~~~~
a.cc:3:39: error: expression list treated as compound expression in initializer [-fpermissive]
3 | int f(unsinged long a, unsigned long x){
| ^
a.cc: In function 'int main()':
a.cc:12:10: error: 'f' cannot be used as a function
12 | ans = f(b, x) - f(a-1,x);
| ~^~~~~~
a.cc:12:20: error: 'f' cannot be used as a function
12 | ans = f(b, x) - f(a-1,x);
| ~^~~~~~~
|
s552966562 | p03861 | C++ | #include<iostream>
using namespace std;
int f(a, x){
if(a==-1) return 0;
else return a/x;
}
int main(){
unsigned long a, b, x;
cin >> a >> b >> x;
unsigned long ans;
ans = f(b, x) - f(a-1,x);
cout << ans << endl;
return 0;
} | a.cc:3:7: error: 'a' was not declared in this scope
3 | int f(a, x){
| ^
a.cc:3:10: error: 'x' was not declared in this scope
3 | int f(a, x){
| ^
a.cc:3:11: error: expression list treated as compound expression in initializer [-fpermissive]
3 | int f(a, x){
| ^
a.cc: In function 'int main()':
a.cc:12:10: error: 'f' cannot be used as a function
12 | ans = f(b, x) - f(a-1,x);
| ~^~~~~~
a.cc:12:20: error: 'f' cannot be used as a function
12 | ans = f(b, x) - f(a-1,x);
| ~^~~~~~~
|
s223449390 | p03861 | C++ | #include <bits/stdc++.h>
using namespace std;
int64_t func(int64_t n,int64_t x) {
if(n == -1) {
return 0;
}else {
return n / x + 1;
}
}
int main() {
int64_t a,b,x;
cin >> a >> b >> x;
cout << func(b) - func(a - 1) << endl;
} | a.cc: In function 'int main()':
a.cc:13:15: error: too few arguments to function 'int64_t func(int64_t, int64_t)'
13 | cout << func(b) - func(a - 1) << endl;
| ~~~~^~~
a.cc:3:9: note: declared here
3 | int64_t func(int64_t n,int64_t x) {
| ^~~~
a.cc:13:25: error: too few arguments to function 'int64_t func(int64_t, int64_t)'
13 | cout << func(b) - func(a - 1) << endl;
| ~~~~^~~~~~~
a.cc:3:9: note: declared here
3 | int64_t func(int64_t n,int64_t x) {
| ^~~~
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.