submission_id stringlengths 10 10 | problem_id stringlengths 6 6 | language stringclasses 3 values | code stringlengths 1 522k | compiler_output stringlengths 43 10.2k |
|---|---|---|---|---|
s835827230 | p03861 | C++ | #include<iostream>
using namespace std;
int main(){
ll a,b,c;
cin >> a >> b >> c;
ll count = 0;
for(int i = a;i <=b;i++){
if(i%c == 0)count++;
}
cout << count << endl;
}
| a.cc: In function 'int main()':
a.cc:4:3: error: 'll' was not declared in this scope
4 | ll a,b,c;
| ^~
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;
| ^
a.cc:6:5: error: expected ';' before 'count'
6 | ll count = 0;
| ^~~~~~
| ;
a.cc:8:17: error: 'count' was not declared in this scope
8 | if(i%c == 0)count++;
| ^~~~~
a.cc:10:11: error: 'count' was not declared in this scope
10 | cout << count << endl;
| ^~~~~
|
s566035878 | p03861 | C++ | #include <bits/stdc++.h>
using namespace std;
const long long mod = pow(10, 9) + 7;
const long long INF = 1LL << 60;
template <class T> bool chmin(T& a, T b){if (a > b) {a = b; return true;} return false;}
template <class T> bool chmax(T& a, T b){if (a < b) {a = b; return true;} return false;}
int divCeil(int A, int B) {return (A + (B - 1)) / B;}
long long divCeil(long long A, int B) {return (A + (B - 1)) / B;}
long long divCeil(int A, long long B) {return (A + (B - 1)) / B;}
long long divCeil(long long A, long long B) {return (A + (B - 1)) / B;}
int main()
{
long long a, b, x;
cin >> a >> b >> x;
long long ans = (b / x + 1) - (max(a - 1, 0) / x + 1);
cout << ans << endl;
} | a.cc: In function 'int main()':
a.cc:17:37: error: no matching function for call to 'max(long long int, int)'
17 | long long ans = (b / x + 1) - (max(a - 1, 0) / x + 1);
| ~~~^~~~~~~~~~
In file included from /usr/include/c++/14/algorithm:60,
from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:51,
from a.cc: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:17:37: note: deduced conflicting types for parameter 'const _Tp' ('long long int' and 'int')
17 | long long ans = (b / x + 1) - (max(a - 1, 0) / x + 1);
| ~~~^~~~~~~~~~
/usr/include/c++/14/bits/stl_algobase.h:303:5: note: candidate: 'template<class _Tp, class _Compare> constexpr const _Tp& std::max(const _Tp&, const _Tp&, _Compare)'
303 | max(const _Tp& __a, const _Tp& __b, _Compare __comp)
| ^~~
/usr/include/c++/14/bits/stl_algobase.h:303:5: note: candidate expects 3 arguments, 2 provided
In file included from /usr/include/c++/14/algorithm:61:
/usr/include/c++/14/bits/stl_algo.h:5706:5: note: candidate: 'template<class _Tp> constexpr _Tp std::max(initializer_list<_Tp>)'
5706 | max(initializer_list<_Tp> __l)
| ^~~
/usr/include/c++/14/bits/stl_algo.h:5706:5: note: candidate expects 1 argument, 2 provided
/usr/include/c++/14/bits/stl_algo.h:5716:5: note: candidate: 'template<class _Tp, class _Compare> constexpr _Tp std::max(initializer_list<_Tp>, _Compare)'
5716 | max(initializer_list<_Tp> __l, _Compare __comp)
| ^~~
/usr/include/c++/14/bits/stl_algo.h:5716:5: note: template argument deduction/substitution failed:
a.cc:17:37: note: mismatched types 'std::initializer_list<_Tp>' and 'long long int'
17 | long long ans = (b / x + 1) - (max(a - 1, 0) / x + 1);
| ~~~^~~~~~~~~~
|
s863364121 | p03861 | C++ | #include <bits/stdc++.h>
using namespace std;
int main() {
long long a, b; cin >> a >> b >> x;
long long ans= b / x - (a - 1) / x;
if (a == 0) ans++
cout << ans << "\n";
}
| a.cc: In function 'int main()':
a.cc:5:36: error: 'x' was not declared in this scope
5 | long long a, b; cin >> a >> b >> x;
| ^
a.cc:7:20: error: expected ';' before 'cout'
7 | if (a == 0) ans++
| ^
| ;
8 | cout << ans << "\n";
| ~~~~
|
s622057528 | p03861 | C++ | #include <bits/stdc++.h>
using namespace std;
int main() {
long long a, b, x; cin >> a >> b >> x;
long long minx = (a - 1) / x + 1, maxx = b / x;
cout << max(0,maxx - minx + 1) << "\n";
}
| a.cc: In function 'int main()':
a.cc:7:14: error: no matching function for call to 'max(int, long long int)'
7 | cout << max(0,maxx - minx + 1) << "\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:7:14: note: deduced conflicting types for parameter 'const _Tp' ('int' and 'long long int')
7 | cout << max(0,maxx - minx + 1) << "\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:7:14: note: mismatched types 'std::initializer_list<_Tp>' and 'int'
7 | cout << max(0,maxx - minx + 1) << "\n";
| ~~~^~~~~~~~~~~~~~~~~~~
|
s985696593 | p03861 | C++ | #include <bits/stdc++.h>
using namespace std;
int main() {
long long a, b, x; cin >> a >> b >> x;
long long minx = (a - 1) / x + 1, maxx = b / x;
cout << max(0,maxx - minx + 1) << "\n";
}
| a.cc: In function 'int main()':
a.cc:7:14: error: no matching function for call to 'max(int, long long int)'
7 | cout << max(0,maxx - minx + 1) << "\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:7:14: note: deduced conflicting types for parameter 'const _Tp' ('int' and 'long long int')
7 | cout << max(0,maxx - minx + 1) << "\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:7:14: note: mismatched types 'std::initializer_list<_Tp>' and 'int'
7 | cout << max(0,maxx - minx + 1) << "\n";
| ~~~^~~~~~~~~~~~~~~~~~~
|
s284825685 | p03861 | C++ | #include <bits/stdc++.h>
using namespace std;
int main() {
long long a, b, x; cin >> a >> b >> x;
minx = (a - 1) / x + 1; maxx = b / x;
cout << maxx - minx + 1 << "\n";
}
| a.cc: In function 'int main()':
a.cc:6:3: error: 'minx' was not declared in this scope
6 | minx = (a - 1) / x + 1; maxx = b / x;
| ^~~~
a.cc:6:27: error: 'maxx' was not declared in this scope
6 | minx = (a - 1) / x + 1; maxx = b / x;
| ^~~~
|
s022995920 | p03861 | C++ | #include <iostream>
using namespace std;
typedef long long int ll;
int main(){
ll a,b,x;
cin >> a >> b >> x;
ll count = 0;
if(a == 0){
cout << b/x << endl;
return 0;
}
#include <iostream>
using namespace std;
typedef long long int ll;
int main(){
ll a,b,x;
cin >> a >> b >> x;
ll count = 0;
if(a == 0){
cout << b/x << endl;
return 0;
}
ll a_r = (a-1)/x;
ll b_r = b/x;
cout << b_r - a_r << endl;
return 0;
}
| a.cc: In function 'int main()':
a.cc:20:9: warning: empty parentheses were disambiguated as a function declaration [-Wvexing-parse]
20 | int main(){
| ^~
a.cc:20:9: note: remove parentheses to default-initialize a variable
20 | int main(){
| ^~
| --
a.cc:20:9: note: or replace parentheses with braces to value-initialize a variable
a.cc:20:11: error: a function-definition is not allowed here before '{' token
20 | int main(){
| ^
a.cc:39:2: error: expected '}' at end of input
39 | }
| ^
a.cc:5:11: note: to match this '{'
5 | int main(){
| ^
|
s068635209 | p03861 | C++ | #include<iostream>
using namespace std;
int main() {
unsigned long long int A,B,N;
cin >> A >> B >> N;
if(A = 0 || A % N = 0) {
cout << B / N - A / N + 1<< endl;
}
else{
cout << B / N - A / N << endl;
}
}
| a.cc: In function 'int main()':
a.cc:7:12: error: lvalue required as left operand of assignment
7 | if(A = 0 || A % N = 0) {
| ~~^~~~~~~~
|
s939293831 | p03861 | C++ | #include<iostream>
using namespace std;
int main() {
unsigned long long intA,B,N;
cin >> A >> B >> N;
if(A = 0) {
cout << B / N - A / N + 1<< endl;
}
else{
cout << B / N - A / N << endl;
}
}
| a.cc: In function 'int main()':
a.cc:6:11: error: 'A' was not declared in this scope
6 | cin >> A >> B >> N;
| ^
|
s703404112 | p03861 | C++ | #include<iostream>
using namespace std;
int main() {
int A B N;
cin >> A >> B >> N;
if(A = 0) {
cout << B / N - A / N + 1<< endl;
}
else{
cout << B / N - A / N << endl;
}
}
| a.cc: In function 'int main()':
a.cc:5:10: error: expected initializer before 'B'
5 | int A B N;
| ^
a.cc:6:11: error: 'A' was not declared in this scope
6 | cin >> A >> B >> N;
| ^
a.cc:6:16: error: 'B' was not declared in this scope
6 | cin >> A >> B >> N;
| ^
a.cc:6:21: error: 'N' was not declared in this scope
6 | cin >> A >> B >> N;
| ^
|
s658013975 | p03861 | C++ | #include<iostream>
#include<string>
using namespace std;
int main()
{
int a;
int b;
int x;
cin>>a>>b>>x
cout<< (b-a+1)/x <<endl;
} | a.cc: In function 'int main()':
a.cc:10:15: error: expected ';' before 'cout'
10 | cin>>a>>b>>x
| ^
| ;
11 | cout<< (b-a+1)/x <<endl;
| ~~~~
|
s241297777 | p03861 | C++ | #include<iostream>
#include<string>
#define int longlong
using namespace std;
int main()
{
int a;
int b;
int x;
cin>>a>>b>>x
cout<< (b-a+1)/x <<endl;
} | a.cc:3:13: error: 'longlong' does not name a type
3 | #define int longlong
| ^~~~~~~~
a.cc:6:1: note: in expansion of macro 'int'
6 | int main()
| ^~~
|
s457525780 | p03861 | C++ | #include<iostream>
#include<cmath>
#include<vector>
#include<set>
#include<algorithm>
#include<tuple>
#include<utility>
#include<cctype>
#include<climits>
#include<map>
#include<queue>
#include<functional>
using namespace std;
#define REP(i,a,n) for(int i=a;i<n;++i)
#define RUP(a,b) ((a+b-1)/(b))
#define ENT "\n"
#define SRTVG(v) sort(v.begin(),v.end(),greater<>())
#define SRTAG(a,n) sort(a,a+n,greater<>())
#define MOD 1000000007
typedef long long ll;
typedef tuple<int,int,bool> Tb;
template<class T> void chmax(T& a, T b) {if(a < b){a=b;}}
template<class T> void chmin(T& a, T b) {if(a > b){a=b;}}
template<class T> void YesNo(T& a) {if(a){cout << "Yes" << ENT;}else{cout << "No" << ENT;}}
template<class T> void YESNO(T& a) {if(a){cout << "YES" << ENT;}else{cout << "NO" << ENT;}}
ll f(n,x){if(n<0) return 0;
else return n/x+1;}
int atcoder(){
ll a,b,x;
cin >> a >> b >> x;
cout << f(b,x)-f(a-1,x) << ENT;
return 0;
}
int main() {
cin.tie(0);
ios::sync_with_stdio(false);
atcoder();
return 0;
}
| a.cc:31:6: error: 'n' was not declared in this scope; did you mean 'yn'?
31 | ll f(n,x){if(n<0) return 0;
| ^
| yn
a.cc:31:8: error: 'x' was not declared in this scope
31 | ll f(n,x){if(n<0) return 0;
| ^
a.cc:31:9: error: expression list treated as compound expression in initializer [-fpermissive]
31 | ll f(n,x){if(n<0) return 0;
| ^
a.cc: In function 'int atcoder()':
a.cc:38:14: error: 'f' cannot be used as a function
38 | cout << f(b,x)-f(a-1,x) << ENT;
| ~^~~~~
a.cc:38:21: error: 'f' cannot be used as a function
38 | cout << f(b,x)-f(a-1,x) << ENT;
| ~^~~~~~~
|
s699471686 | p03861 | C++ | #include<bits/stdc++.h>
using namespace std;
long long main(){
long long a,b,x,v=0;
cin>>a>>b;
cin>>x;
for(long long i=a;i<=b;i++){
if(i%x==0){
v++;
}
}
cout<<v;
return 0;
} | cc1plus: error: '::main' must return 'int'
|
s661907944 | p03861 | C++ | #include <cmath>
#include <iostream>
#include <stdio.h>
#include <string>
#include <sstream>
#include <iomanip>
#include <algorithm>
#include <vector>
#include <set>
#include <limits.h>
#include <map>
#include <numeric>
namespace test {
std::string to_string (char val) {
return std::string (1, val);
// return std::string{val};
}
//if( str.find ("r") != string::npos)
}
using namespace std;
typedef long long int llint;
llint f (llint n, llint x) {
if (n == -1) {
return 0;
}
return n/x + 1
}
int main (void) {
llint a, b,x; cin >> a >> b >> x;
llint count = f(b, x) - f(a-1,x);
cout << count << endl;
return 0;
} | a.cc: In function 'llint f(llint, llint)':
a.cc:29:23: error: expected ';' before '}' token
29 | return n/x + 1
| ^
| ;
30 | }
| ~
|
s403986111 | p03861 | C++ | #include<iostream>
using namespace std;
int main(){
int a,b,x,count=0;
cin>>a>>b>>x;
for(int i=a;i<=b;++i){
if((double)i%(double)x==0)++count;
}
cout<<count<<endl;
return 0;
} | a.cc: In function 'int main()':
a.cc:8:19: error: invalid operands of types 'double' and 'double' to binary 'operator%'
8 | if((double)i%(double)x==0)++count;
| ~~~~~~~~~^~~~~~~~~~
| | |
| double double
|
s127342675 | p03861 | C++ | #include<iostream>
using namespace std;
int main(){
int a,b,x,count=0;
cin>>a>>b>>x;
for(int i=a;i<=b;++i){
if((double)i%x==0)++count;
}
cout<<count<<endl;
return 0;
} | a.cc: In function 'int main()':
a.cc:8:19: error: invalid operands of types 'double' and 'int' to binary 'operator%'
8 | if((double)i%x==0)++count;
| ~~~~~~~~~^~
| | |
| double int
|
s429264230 | p03861 | C++ | #include <bits/stdc++.h>
using namespace std;
int main() {
int a,b,x;
cin << a << b << x;
int count = 0;
int N;
a <= N <= b;
for (int i = 0; i < b-a; i++) {
if (N % x == 0) {
count++;
}
cout << count << endl;
}
}
| a.cc: In function 'int main()':
a.cc:6:7: error: no match for 'operator<<' (operand types are 'std::istream' {aka 'std::basic_istream<char>'} and 'int')
6 | cin << a << b << x;
| ~~~ ^~ ~
| | |
| | int
| std::istream {aka std::basic_istream<char>}
a.cc:6:7: note: candidate: 'operator<<(int, int)' (built-in)
6 | cin << a << b << x;
| ~~~~^~~~
a.cc:6:7: note: no known conversion for argument 1 from 'std::istream' {aka 'std::basic_istream<char>'} to 'int'
In file included from /usr/include/c++/14/regex:68,
from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:181,
from a.cc:1:
/usr/include/c++/14/bits/regex.h:1715:5: note: candidate: 'template<class _Ch_type, class _Ch_traits, class _Bi_iter> std::basic_ostream<_CharT, _Traits>& std::__cxx11::operator<<(std::basic_ostream<_CharT, _Traits>&, const sub_match<_Bi_iter>&)'
1715 | operator<<(basic_ostream<_Ch_type, _Ch_traits>& __os,
| ^~~~~~~~
/usr/include/c++/14/bits/regex.h:1715:5: note: template argument deduction/substitution failed:
a.cc:6:10: note: 'std::istream' {aka 'std::basic_istream<char>'} is not derived from 'std::basic_ostream<_CharT, _Traits>'
6 | cin << a << b << x;
| ^
In file included from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:41:
/usr/include/c++/14/cstddef:125:5: note: candidate: 'template<class _IntegerType> constexpr std::__byte_op_t<_IntegerType> std::operator<<(byte, _IntegerType)'
125 | operator<<(byte __b, _IntegerType __shift) noexcept
| ^~~~~~~~
/usr/include/c++/14/cstddef:125:5: note: template argument deduction/substitution failed:
a.cc:6:3: note: cannot convert 'std::cin' (type 'std::istream' {aka 'std::basic_istream<char>'}) to type 'std::byte'
6 | cin << a << b << x;
| ^~~
In file included from /usr/include/c++/14/bits/basic_string.h:47,
from /usr/include/c++/14/string:54,
from /usr/include/c++/14/bitset:52,
from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:52:
/usr/include/c++/14/string_view:763:5: note: candidate: 'template<class _CharT, class _Traits> std::basic_ostream<_CharT, _Traits>& std::operator<<(basic_ostream<_CharT, _Traits>&, basic_string_view<_CharT, _Traits>)'
763 | operator<<(basic_ostream<_CharT, _Traits>& __os,
| ^~~~~~~~
/usr/include/c++/14/string_view:763:5: note: template argument deduction/substitution failed:
a.cc:6:10: note: 'std::istream' {aka 'std::basic_istream<char>'} is not derived from 'std::basic_ostream<_CharT, _Traits>'
6 | cin << a << b << x;
| ^
/usr/include/c++/14/bits/basic_string.h:4077:5: note: candidate: 'template<class _CharT, class _Traits, class _Alloc> std::basic_ostream<_CharT, _Traits>& std::operator<<(basic_ostream<_CharT, _Traits>&, const __cxx11::basic_string<_CharT, _Traits, _Allocator>&)'
4077 | operator<<(basic_ostream<_CharT, _Traits>& __os,
| ^~~~~~~~
/usr/include/c++/14/bits/basic_string.h:4077:5: note: template argument deduction/substitution failed:
a.cc:6:10: note: 'std::istream' {aka 'std::basic_istream<char>'} is not derived from 'std::basic_ostream<_CharT, _Traits>'
6 | cin << a << b << x;
| ^
/usr/include/c++/14/bitset:1687:5: note: candidate: 'template<class _CharT, class _Traits, long unsigned int _Nb> std::basic_ostream<_CharT, _Traits>& std::operator<<(basic_ostream<_CharT, _Traits>&, const bitset<_Nb>&)'
1687 | operator<<(std::basic_ostream<_CharT, _Traits>& __os,
| ^~~~~~~~
/usr/include/c++/14/bitset:1687:5: note: template argument deduction/substitution failed:
a.cc:6:10: note: 'std::istream' {aka 'std::basic_istream<char>'} is not derived from 'std::basic_ostream<_CharT, _Traits>'
6 | cin << a << b << x;
| ^
In file included from /usr/include/c++/14/bits/ios_base.h:46,
from /usr/include/c++/14/streambuf:43,
from /usr/include/c++/14/bits/streambuf_iterator.h:35,
from /usr/include/c++/14/iterator:66,
from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:54:
/usr/include/c++/14/system_error:339:5: note: candidate: 'template<class _CharT, class _Traits> std::basic_ostream<_CharT, _Traits>& std::operator<<(basic_ostream<_CharT, _Traits>&, const error_code&)'
339 | operator<<(basic_ostream<_CharT, _Traits>& __os, const error_code& __e)
| ^~~~~~~~
/usr/include/c++/14/system_error:339:5: note: template argument deduction/substitution failed:
a.cc:6:10: note: 'std::istream' {aka 'std::basic_istream<char>'} is not derived from 'std::basic_ostream<_CharT, _Traits>'
6 | cin << a << b << x;
| ^
In file included from /usr/include/c++/14/memory:80,
from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:56:
/usr/include/c++/14/bits/shared_ptr.h:70:5: note: candidate: 'template<class _Ch, class _Tr, class _Tp, __gnu_cxx::_Lock_policy _Lp> std::basic_ostream<_CharT, _Traits>& std::operator<<(basic_ostream<_CharT, _Traits>&, const __shared_ptr<_Tp, _Lp>&)'
70 | operator<<(std::basic_ostream<_Ch, _Tr>& __os,
| ^~~~~~~~
/usr/include/c++/14/bits/shared_ptr.h:70:5: note: template argument deduction/substitution failed:
a.cc:6:10: note: 'std::istream' {aka 'std::basic_istream<char>'} is not derived from 'std::basic_ostream<_CharT, _Traits>'
6 | cin << a << b << x;
| ^
In file included from /usr/include/c++/14/istream:41,
from /usr/include/c++/14/sstream:40,
from /usr/include/c++/14/complex:45,
from /usr/include/c++/14/ccomplex:39,
from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:127:
/usr/include/c++/14/ostream:563:5: note: candidate: 'template<class _CharT, class _Traits> std::basic_ostream<_CharT, _Traits>& std::operator<<(basic_ostream<_CharT, _Traits>&, _CharT)'
563 | operator<<(basic_ostream<_CharT, _Traits>& __out, _CharT __c)
| ^~~~~~~~
/usr/include/c++/14/ostream:563:5: note: template argument deduction/substitution failed:
a.cc:6:10: note: 'std::istream' {aka 'std::basic_istream<char>'} is not derived from 'std::basic_ostream<_CharT, _Traits>'
6 | cin << a << b << x;
| ^
/usr/include/c++/14/ostream:573:5: note: candidate: 'template<class _CharT, class _Traits> std::basic_ostream<_CharT, _Traits>& std::operator<<(basic_ostream<_CharT, _Traits>&, char)'
573 | operator<<(basic_ostream<_CharT, _Traits>& __out, char __c)
| ^~~~~~~~
/usr/include/c++/14/ostream:573:5: note: template argument deduction/substitution failed:
a.cc:6:10: note: 'std::istream' {aka 'std::basic_istream<char>'} is not derived from 'std::basic_ostream<_CharT, _Traits>'
6 | cin << a << b << x;
| ^
/usr/include/c++/14/ostream:579:5: note: candidate: 'template<class _Traits> std::basic_ostream<char, _Traits>& std::operator<<(basic_ostream<char, _Traits>&, char)'
579 | operator<<(basic_ostream<char, _Traits>& __out, char __c)
| ^~~~~~~~
/usr/include/c++/14/ostream:579:5: note: template argument deduction/substitution failed:
a.cc:6:10: note: 'std::istream' {aka 'std::basic_istream<char>'} is not derived from 'std::basic_ostream<char, _Traits>'
6 | cin << a << b << x;
| ^
/usr/include/c++/14/ostream:590:5: note: candidate: 'template<class _Traits> std::basic_ostream<char, _Traits>& std::operator<<(basic_ostream<char, _Traits>&, signed char)'
590 | operator<<(basic_ostream<char, _Traits>& __out, signed char __c)
| ^~~~~~~~
/usr/include/c++/14/ostream:590:5: note: template argument deduction/substitution failed:
a.cc:6:10: note: 'std::istream' {aka 'std::basic_istream<char>'} is not derived from 'std::basic_ostream<char, _Traits>'
6 | cin << a << b << x;
| ^
/usr/include/c++/14/ostream:595:5: note: candidate: 'template<class _Traits> std::basic_ostream<char, _Traits>& std::operator<<(basic_ostream<char, _Traits>&, unsigned char)'
595 | operator<<(basic_ostream<char, _Traits>& __out, unsigned char __c)
| ^~~~~~~~
/usr/include/c++/14/ostream:595:5: note: template argument deduction/substitution failed:
a.cc:6:10: note: 'std::istream' {aka 'std::basic_istream<char>'} is not derived from 'std::basic_ostream<char, _Traits>'
6 | cin << a << b << x;
| ^
/usr/include/c++/14/ostream:654:5: note: candidate: 'template<class _CharT, class _Traits> std::basic_ostream<_CharT, _Traits>& std::operator<<(basic_ostream<_CharT, _Traits>&, const _CharT*)'
654 | operator<<(basic_ostream<_CharT, _Traits>& __out, const _CharT* __s)
| ^~~~~~~~
/usr/include/c++/14/ostream:654:5: note: template argument deduction/substitution failed:
a.cc:6:10: note: 'std::istream' {aka 'std::basic_istream<char>'} is not derived from 'std::basic_ostream<_CharT, _Traits>'
6 | cin << a << b << x;
| ^
In file included from /usr/include/c++/14/ostream:1022:
/usr/include/c++/14/bits/ostream.tcc:307:5: note: candidate: 'template<class _CharT, class _Traits> std::basic_ostream<_CharT, _Traits>& std::operator<<(basic_ostream<_CharT, _Traits>&, const char*)'
307 | operator<<(basic_ostream<_CharT, _Traits>& __out, const char* __s)
| ^~~~~~~~
/usr/include/c++/14/bits/ostream.tcc:307:5: note: template argument deduction/substitution failed:
a.cc:6:10: note: 'std::istream' {aka 'std::basic_istream<char>'} is not derived from 'std::basic_ostream<_CharT, _Traits>'
6 | cin << a << b << x;
| ^
/usr/include/c++/14/ostream:671:5: note: candidate: 'template<class _Traits> std::basic_ostream<char, _Traits>& std::operator<<(basic_ostream<char, _Traits>&, const char*)'
671 | operator<<(basic_ostream<char, _Traits>& __out, const char* __s)
| ^~~~~~~~
/usr/include/c++/14/ostream:671:5: note: template argument deduction/substitution failed:
a.cc:6:10: note: 'std::istream' {aka 'std::basic_istream<char>'} is not derived from 'std::basic_ostream<char, _Traits>'
6 | cin << a << b << x;
| ^
/usr/include/c++ |
s093650218 | p03861 | C++ | #include <iostream>
#include <string>
#include <algorithm>
using namespace std;
int main() {
unsigned long long a, b, x;
unsigned long long answ = 0;
cin >> a >> b >> x;
if(a%x==0){
answ=(b-a)/x+1;
}else{
answ=(b-(a+x-a%x))/x+1;
cout << answ << endl;
}
| a.cc: In function 'int main()':
a.cc:20:2: error: expected '}' at end of input
20 | }
| ^
a.cc:7:12: note: to match this '{'
7 | int main() {
| ^
|
s757177024 | p03861 | C++ | #include<stdio.h>
#include<stdlib.h>
#include<iostream>
#include<string>
#include<algorithm>
#include<vector>
#include<limits>
#include<numeric>
#include<type_traits>
#include<math.h>
using namespace std;
typedef long long ll;
#define rep(i, n) for(int i = 0; i < (int)(n); i++)
#define repi(i,a,b) for(int i = (int)(a); i < (int)(b); i++)
#define in(x) cin >> x
#define out(str) cout << str << endl
template<class T>bool chmax(T &a, const T &b) { if (a<b) { a=b; return 1; } return 0; }
template<class T>bool chmin(T &a, const T &b) { if (b<a) { a=b; return 1; } return 0; }
ll a,b,x;
int main(){
cin>>a>>b>>x;
out(b/x-max(a-1,0)/x);
}
| a.cc: In function 'int main()':
a.cc:26:16: error: no matching function for call to 'max(ll, int)'
26 | out(b/x-max(a-1,0)/x);
| ~~~^~~~~~~
a.cc:17:26: note: in definition of macro 'out'
17 | #define out(str) cout << str << endl
| ^~~
In file included from /usr/include/c++/14/string:51,
from /usr/include/c++/14/bits/locale_classes.h:40,
from /usr/include/c++/14/bits/ios_base.h:41,
from /usr/include/c++/14/ios:44,
from /usr/include/c++/14/ostream:40,
from /usr/include/c++/14/iostream:41,
from a.cc:3:
/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:26:16: note: deduced conflicting types for parameter 'const _Tp' ('long long int' and 'int')
26 | out(b/x-max(a-1,0)/x);
| ~~~^~~~~~~
a.cc:17:26: note: in definition of macro 'out'
17 | #define out(str) cout << str << endl
| ^~~
/usr/include/c++/14/bits/stl_algobase.h:303:5: note: candidate: 'template<class _Tp, class _Compare> constexpr const _Tp& std::max(const _Tp&, const _Tp&, _Compare)'
303 | max(const _Tp& __a, const _Tp& __b, _Compare __comp)
| ^~~
/usr/include/c++/14/bits/stl_algobase.h:303:5: note: candidate expects 3 arguments, 2 provided
In file included from /usr/include/c++/14/algorithm:61,
from a.cc:5:
/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:26:16: note: mismatched types 'std::initializer_list<_Tp>' and 'long long int'
26 | out(b/x-max(a-1,0)/x);
| ~~~^~~~~~~
a.cc:17:26: note: in definition of macro 'out'
17 | #define out(str) cout << str << endl
| ^~~
|
s220132428 | p03861 | C++ | #include<bits/stdc++.h>
using namespace std;
int main()
{
long long a,b,n;
long long p,r;
cin>>a>>b>>n;
if(a%x==0)
p=a/x;
else
p=a/n+1;
r=b/n;
cout<<r-p+1<<endl;
return 0;
}
| a.cc: In function 'int main()':
a.cc:8:10: error: 'x' was not declared in this scope
8 | if(a%x==0)
| ^
|
s368161100 | p03861 | C++ | #include<bits/stdc++.h>
int main()
{
long long a,b,n;
long long p,r;
cin>>a>>b>>n;
if(a%x==0)
p=a/x;
else
p=a/n+1;
r=b/n;
cout<<r-p+1<<endl;
return 0;
}
| a.cc: In function 'int main()':
a.cc:6:5: error: 'cin' was not declared in this scope; did you mean 'std::cin'?
6 | cin>>a>>b>>n;
| ^~~
| std::cin
In file included from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:146,
from a.cc:1:
/usr/include/c++/14/iostream:62:18: note: 'std::cin' declared here
62 | extern istream cin; ///< Linked to standard input
| ^~~
a.cc:7:10: error: 'x' was not declared in this scope
7 | if(a%x==0)
| ^
a.cc:12:5: error: 'cout' was not declared in this scope; did you mean 'std::cout'?
12 | cout<<r-p+1<<endl;
| ^~~~
| std::cout
/usr/include/c++/14/iostream:63:18: note: 'std::cout' declared here
63 | extern ostream cout; ///< Linked to standard output
| ^~~~
a.cc:12:18: error: 'endl' was not declared in this scope; did you mean 'std::endl'?
12 | cout<<r-p+1<<endl;
| ^~~~
| std::endl
In file included from /usr/include/c++/14/istream:41,
from /usr/include/c++/14/sstream:40,
from /usr/include/c++/14/complex:45,
from /usr/include/c++/14/ccomplex:39,
from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:127:
/usr/include/c++/14/ostream:744:5: note: 'std::endl' declared here
744 | endl(basic_ostream<_CharT, _Traits>& __os)
| ^~~~
|
s507366095 | p03861 | C++ | #include<bits/stdc++.h>
using namespace std;
int main()
{
long long a,b,x;
long long s,t;
cin>>a>>b>>c;
if(a%x==0)
s=a/x;
else
s=a/x+1;
t=b/x;
cout<<t-s+1<<endl;
return 0;
} | a.cc: In function 'int main()':
a.cc:7:16: error: 'c' was not declared in this scope
7 | cin>>a>>b>>c;
| ^
|
s281346854 | p03861 | Java | import java.util.*;
public class Main{
public static void main(String[] args){
Scanner sc = new Scanner(System.in);
long a = sc.nextInt();
long b = sc.nextInt();
int x = sc.nextInt();
long count = 0;
for(int i = a;i <= b;i++){
if(i%x == 0){
count++;
}
}
System.out.println(count);
}
}
| Main.java:10: error: incompatible types: possible lossy conversion from long to int
for(int i = a;i <= b;i++){
^
1 error
|
s696935947 | p03861 | C++ | #include<iostream>
using namespace std;
int main(void){
long long A, B, N;
cin >> A >> B >> C;
cout << (B + N) / N - (A + N - 1) << endl;
return 0;
} | a.cc: In function 'int main()':
a.cc:6:20: error: 'C' was not declared in this scope
6 | cin >> A >> B >> C;
| ^
|
s419326954 | p03861 | C++ | #include<bits/stdc++.h>
using namespace std;
#define int long long
singed main(){
int a, b, x; cin >> a >> b >> x;
cout << b / x - a / x << endl;
return 0;
} | a.cc:6:1: error: 'singed' does not name a type; did you mean 'signed'?
6 | singed main(){
| ^~~~~~
| signed
|
s196656523 | p03861 | C++ | #include<bits/stdc++.h>
int main()
{
long long a,b,x;
long long s,t;
cin>>a>>b>>c;
if(a%x==0)
s=a/x;
else
s=a/x+1;
t=b/x;
cout<<t-s+1<<endl;
return 0;
} | a.cc: In function 'int main()':
a.cc:6:5: error: 'cin' was not declared in this scope; did you mean 'std::cin'?
6 | cin>>a>>b>>c;
| ^~~
| std::cin
In file included from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:146,
from a.cc:1:
/usr/include/c++/14/iostream:62:18: note: 'std::cin' declared here
62 | extern istream cin; ///< Linked to standard input
| ^~~
a.cc:6:16: error: 'c' was not declared in this scope
6 | cin>>a>>b>>c;
| ^
a.cc:12:5: error: 'cout' was not declared in this scope; did you mean 'std::cout'?
12 | cout<<t-s+1<<endl;
| ^~~~
| std::cout
/usr/include/c++/14/iostream:63:18: note: 'std::cout' declared here
63 | extern ostream cout; ///< Linked to standard output
| ^~~~
a.cc:12:18: error: 'endl' was not declared in this scope; did you mean 'std::endl'?
12 | cout<<t-s+1<<endl;
| ^~~~
| std::endl
In file included from /usr/include/c++/14/istream:41,
from /usr/include/c++/14/sstream:40,
from /usr/include/c++/14/complex:45,
from /usr/include/c++/14/ccomplex:39,
from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:127:
/usr/include/c++/14/ostream:744:5: note: 'std::endl' declared here
744 | endl(basic_ostream<_CharT, _Traits>& __os)
| ^~~~
|
s129530986 | p03861 | C++ | #include <bits/stdc++.h>
using namespace std;
int main() {
long a, b, x;
cin >> a >> b >> x;
long ans;
if (a == 0) {
ans = b / x + 1;
} else {
ans = (b / x + 1) - ((a - 1) / x + 1);
}
cout << res << endl;
return 0;
}
| a.cc: In function 'int main()':
a.cc:13:13: error: 'res' was not declared in this scope
13 | cout << res << endl;
| ^~~
|
s606106560 | p03861 | C | #include<stdio.h>
int main(){
int num=0,i,j,n,N,a,b,x;
scanf("%d%d%d",&a,&b,&x);
for(i=a;i<=b;i++){
if(i%x==0)
num+=;
}
printf("%d",num);
return 0;
} | main.c: In function 'main':
main.c:7:22: error: expected expression before ';' token
7 | num+=;
| ^
|
s174535736 | p03861 | C | int main(void){
double a,b,c,d=0,count;
scanf("%lf",&a);
scanf("%lf",&b);
scanf("%lf",&c);
for(count=a;count==b;count++){
if(count%c==0){d++;}
}
printf("%f",d);
return 0;
}
| main.c: In function 'main':
main.c:3:3: error: implicit declaration of function 'scanf' [-Wimplicit-function-declaration]
3 | scanf("%lf",&a);
| ^~~~~
main.c:1:1: note: include '<stdio.h>' or provide a declaration of 'scanf'
+++ |+#include <stdio.h>
1 | int main(void){
main.c:3:3: warning: incompatible implicit declaration of built-in function 'scanf' [-Wbuiltin-declaration-mismatch]
3 | scanf("%lf",&a);
| ^~~~~
main.c:3:3: note: include '<stdio.h>' or provide a declaration of 'scanf'
main.c:7:11: error: invalid operands to binary % (have 'double' and 'double')
7 | if(count%c==0){d++;}
| ^
main.c:9:3: error: implicit declaration of function 'printf' [-Wimplicit-function-declaration]
9 | printf("%f",d);
| ^~~~~~
main.c:9:3: note: include '<stdio.h>' or provide a declaration of 'printf'
main.c:9:3: warning: incompatible implicit declaration of built-in function 'printf' [-Wbuiltin-declaration-mismatch]
main.c:9:3: note: include '<stdio.h>' or provide a declaration of 'printf'
|
s998278496 | p03861 | C | int main(void){
double a,b,c,d=0,count;
scanf("%lf %lf %lf",&a,&b,&c);
for(count=a;count==b;count++){
if(count%c==0){d++;}
}
printf("%f",&d);
return 0;
}
| main.c: In function 'main':
main.c:3:3: error: implicit declaration of function 'scanf' [-Wimplicit-function-declaration]
3 | scanf("%lf %lf %lf",&a,&b,&c);
| ^~~~~
main.c:1:1: note: include '<stdio.h>' or provide a declaration of 'scanf'
+++ |+#include <stdio.h>
1 | int main(void){
main.c:3:3: warning: incompatible implicit declaration of built-in function 'scanf' [-Wbuiltin-declaration-mismatch]
3 | scanf("%lf %lf %lf",&a,&b,&c);
| ^~~~~
main.c:3:3: note: include '<stdio.h>' or provide a declaration of 'scanf'
main.c:5:11: error: invalid operands to binary % (have 'double' and 'double')
5 | if(count%c==0){d++;}
| ^
main.c:7:3: error: implicit declaration of function 'printf' [-Wimplicit-function-declaration]
7 | printf("%f",&d);
| ^~~~~~
main.c:7:3: note: include '<stdio.h>' or provide a declaration of 'printf'
main.c:7:3: warning: incompatible implicit declaration of built-in function 'printf' [-Wbuiltin-declaration-mismatch]
main.c:7:3: note: include '<stdio.h>' or provide a declaration of 'printf'
|
s144559710 | p03861 | C++ | #include<iostream>
using namespace std;
int main(){
ll a, b, x; cin>>a>>b>>x;
ll res = (b-a)/x;
if(a%x==0)res++;
return 0;
} | a.cc: In function 'int main()':
a.cc:4:3: error: 'll' was not declared in this scope
4 | ll a, b, x; cin>>a>>b>>x;
| ^~
a.cc:4:20: error: 'a' was not declared in this scope
4 | ll a, b, x; cin>>a>>b>>x;
| ^
a.cc:4:23: error: 'b' was not declared in this scope
4 | ll a, b, x; cin>>a>>b>>x;
| ^
a.cc:4:26: error: 'x' was not declared in this scope
4 | ll a, b, x; cin>>a>>b>>x;
| ^
a.cc:5:5: error: expected ';' before 'res'
5 | ll res = (b-a)/x;
| ^~~~
| ;
a.cc:6:13: error: 'res' was not declared in this scope
6 | if(a%x==0)res++;
| ^~~
|
s636582567 | p03861 | C++ | #include <iostream>
using namespace std;
int main(){
unsigned long a,b,x;
cin >> a >> b >> x;
if (a % x == 0)
cout << ( b / x - a / x + 1 );
else cout << ( b / x - a / x );
| a.cc: In function 'int main()':
a.cc:11:34: error: expected '}' at end of input
11 | else cout << ( b / x - a / x );
| ^
a.cc:5:11: note: to match this '{'
5 | int main(){
| ^
|
s937145459 | p03861 | C++ | #include <iostream>
using namespace std;
int main(){
unsigned long a,b,x;
cin >> a >> b >> x;
if (a % x = 0)
cout << ( b / x - a / x + 1 );
else cout << ( b / x - a / x ); | a.cc: In function 'int main()':
a.cc:9:9: error: lvalue required as left operand of assignment
9 | if (a % x = 0)
| ~~^~~
a.cc:11:34: error: expected '}' at end of input
11 | else cout << ( b / x - a / x );
| ^
a.cc:5:11: note: to match this '{'
5 | int main(){
| ^
|
s927752064 | p03861 | C | #include<stdio.h>
int main(){
int num=0,i,j,n,N,a,b,x;
scanf("%d%d%d",&a,&b,&x);
for(i=a;i<=b;i++){
if(i%x==0)
num+=;
}
printf("%d",num);
return 0;
} | main.c: In function 'main':
main.c:7:22: error: expected expression before ';' token
7 | num+=;
| ^
|
s585813226 | p03861 | C++ | #include<bits/stdc++.h>
#include<vector>
#include<string>
#include<iomanip>
#include<algorithm>
using namespace std;
int main() {
unsigned long long a,b,x,n,m;
cin >> a >> b >> x;
ans = 0;
n = b/x+1;
m = (a-1)/x+1;
cout << n-m << endl;
} | a.cc: In function 'int main()':
a.cc:11:3: error: 'ans' was not declared in this scope; did you mean 'abs'?
11 | ans = 0;
| ^~~
| abs
|
s862870051 | p03861 | C | #include<stdio.h>
int main(){
int num=0,i,j,n,N,a,b,x;
scanf("%d%d%d",&a,&b,&x);
for(i=a;i<=b;i++){
if(i%x==0)
num+=;
}
printf("%d",num);
return 0;
} | main.c: In function 'main':
main.c:7:22: error: expected expression before ';' token
7 | num+=;
| ^
|
s311871978 | p03861 | C | #include<stdio.h>
int main(){
int num=0,i,j,n,N,a,b,x,num=0;
scanf("%d%d%d",&a,&b,&x);
for(i=a;i<=b;i++){
if(i%x==0)
num+=;
}
printf("%d",num);
return 0;
} | main.c: In function 'main':
main.c:3:33: error: redefinition of 'num'
3 | int num=0,i,j,n,N,a,b,x,num=0;
| ^~~
main.c:3:13: note: previous definition of 'num' with type 'int'
3 | int num=0,i,j,n,N,a,b,x,num=0;
| ^~~
main.c:7:22: error: expected expression before ';' token
7 | num+=;
| ^
|
s012933022 | p03861 | C++ | #include<iostream>
using namespace std;
int main(){
unsigned __int64 a,b,x;
cin>>a>>b>>x;
int count=0;
for(;a<=b;a++){
if(a%x==0){
count++;
}
}
cout<<count<<endl;
return 0;
} | a.cc: In function 'int main()':
a.cc:4:26: error: expected initializer before 'a'
4 | unsigned __int64 a,b,x;
| ^
a.cc:5:14: error: 'a' was not declared in this scope
5 | cin>>a>>b>>x;
| ^
a.cc:5:17: 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;
| ^
|
s086167761 | p03861 | C | #include<stdio.h>
int main(){
int a, b, x, i, count = 0;
scanf("%d %d %d", &a, &b, &x)
for(i = a; i <= b; i++){
if(i%x == 0){
count++;
}
}
printf("%d\n", count);
return 0;
} | main.c: In function 'main':
main.c:6:32: error: expected ';' before 'for'
6 | scanf("%d %d %d", &a, &b, &x)
| ^
| ;
7 |
8 | for(i = a; i <= b; i++){
| ~~~
|
s124699778 | p03861 | C++ | #include <bits/stdc++.h>
using namespace std;
int main(){
int a,b,x;
cin >> a >> b >>x;
int count = 0;
for(int i = a ;i =< b;i++){
if(i % x ==0){
count++;
}
}
cout << count <<endl;
} | a.cc: In function 'int main()':
a.cc:8:19: error: expected primary-expression before '<' token
8 | for(int i = a ;i =< b;i++){
| ^
|
s001237423 | p03861 | C++ | #include <bits/stdc++.h>
using namespace std;
int main(){
int a,b,x;
cin >> a >> b >>x;
int count = 0;
for(int i = a ;i < b;i++){
if(i / x=0){
count++;
}
}
cout << count <<endl;
} | a.cc: In function 'int main()':
a.cc:9:11: error: lvalue required as left operand of assignment
9 | if(i / x=0){
| ~~^~~
|
s433951521 | p03861 | C++ | #include <bits/stdc++.h>
using namespace std;
int main(){
int a,b,x;
cin >> a >> b >>x;
int count = 0;
for(i = a ;i < b;i++){
if(i / x=0){
count++;
}
}
cout << count <<endl;
} | a.cc: In function 'int main()':
a.cc:8:5: error: 'i' was not declared in this scope
8 | for(i = a ;i < b;i++){
| ^
|
s545401310 | 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();
int geta = (a==0) ? 1 : 0:
System.out.println(b/x-a/x +geta);
}
} | Main.java:8: error: ';' expected
int geta = (a==0) ? 1 : 0:
^
1 error
|
s366599690 | p03861 | C++ | #include <bits/stdc++.h>
using namespace std;
int main(){
int a, b, x;
cin >> a >> b >>x;
int p, q;
p = x*(a/x+1);
q = x*(b/x-1):
cout << (q-p)/x << endl;
} | a.cc: In function 'int main()':
a.cc:10:16: error: expected ';' before ':' token
10 | q = x*(b/x-1):
| ^
| ;
|
s854254988 | p03861 | C++ | #include <stdio.h>
int main()
{
long long a,b,x,ans=0;
scanf("%lld%lld%lld",&a,&b,&x);
for(long long i=a,i<=b;i++)
{
if(i%x==0)
{
ans++;
}
}
printf("%lld",ans);
return 0;
} | a.cc: In function 'int main()':
a.cc:6:24: error: expected ';' before '<=' token
6 | for(long long i=a,i<=b;i++)
| ^~
| ;
a.cc:6:24: error: expected primary-expression before '<=' token
6 | for(long long i=a,i<=b;i++)
| ^~
|
s029276393 | p03861 | C++ | #include<iostream>
#include<algorithm>
using namespace std;
int main{
int a,b,x;
cin>>a>>b>>x;
int c=b/x;
int d=a/x;
cout<<c-d<<endl;
} | a.cc:4:5: error: cannot declare '::main' to be a global variable
4 | int main{
| ^~~~
a.cc:5:3: error: expected primary-expression before 'int'
5 | int a,b,x;
| ^~~
a.cc:5:3: error: expected '}' before 'int'
a.cc:4:9: note: to match this '{'
4 | int main{
| ^
a.cc:6:3: error: 'cin' does not name a type
6 | cin>>a>>b>>x;
| ^~~
a.cc:7:9: error: 'b' was not declared in this scope
7 | int c=b/x;
| ^
a.cc:7:11: error: 'x' was not declared in this scope
7 | int c=b/x;
| ^
a.cc:8:9: error: 'a' was not declared in this scope
8 | int d=a/x;
| ^
a.cc:8:11: error: 'x' was not declared in this scope
8 | int d=a/x;
| ^
a.cc:9:3: error: 'cout' does not name a type
9 | cout<<c-d<<endl;
| ^~~~
a.cc:10:1: error: expected declaration before '}' token
10 | }
| ^
|
s463843106 | p03861 | C++ | #include<iostream>
#include<algorithm>
using namespace std;
int main{
int a,b,x;
cin>>a>>b>>x;
cout<<b/x-a/x<<endl;
} | a.cc:4:5: error: cannot declare '::main' to be a global variable
4 | int main{
| ^~~~
a.cc:5:3: error: expected primary-expression before 'int'
5 | int a,b,x;
| ^~~
a.cc:5:3: error: expected '}' before 'int'
a.cc:4:9: note: to match this '{'
4 | int main{
| ^
a.cc:6:3: error: 'cin' does not name a type
6 | cin>>a>>b>>x;
| ^~~
a.cc:7:3: error: 'cout' does not name a type
7 | cout<<b/x-a/x<<endl;
| ^~~~
a.cc:8:1: error: expected declaration before '}' token
8 | }
| ^
|
s232180283 | p03861 | Java |
import java.util.*;
public class Main {
public static void main(String[] args) throws Exception {
// Your code here!
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+1; i++){
if(i%x == 0){
count ++;
}
} | Main.java:18: error: reached end of file while parsing
}
^
1 error
|
s414886856 | p03861 | C++ | #include<iostream>
using namespace std;
int main(){
float a,b,x;
float ans =0;
cin>>a>>b>>x;
for(int i =a;i<=b;i++){
if(!(i%x))ans++;
}
cout<<ans;
} | a.cc: In function 'int main()':
a.cc:8:11: error: invalid operands of types 'int' and 'float' to binary 'operator%'
8 | if(!(i%x))ans++;
| ~^~
| | |
| | float
| int
|
s785793224 | p03861 | C++ | #include <bits/stdc++.h>
using namespace std;
using ll = long long;
inline ll cnt(ll x, ll y) { return max(0, x / y + 1); }
int main() {
cin.tie(0); ios::sync_with_stdio(false);
ll a, b, x;
cin >> a >> b >> x;
cout << cnt(b, x) - cnt(a - 1, x) << endl;
return 0;
}
| a.cc: In function 'll cnt(ll, ll)':
a.cc:7:39: error: no matching function for call to 'max(int, ll)'
7 | inline ll cnt(ll x, ll y) { return max(0, x / y + 1); }
| ~~~^~~~~~~~~~~~~~
In file included from /usr/include/c++/14/algorithm:60,
from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:51,
from a.cc: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:39: note: deduced conflicting types for parameter 'const _Tp' ('int' and 'll' {aka 'long long int'})
7 | inline ll cnt(ll x, ll y) { return max(0, x / y + 1); }
| ~~~^~~~~~~~~~~~~~
/usr/include/c++/14/bits/stl_algobase.h:303:5: note: candidate: 'template<class _Tp, class _Compare> constexpr const _Tp& std::max(const _Tp&, const _Tp&, _Compare)'
303 | max(const _Tp& __a, const _Tp& __b, _Compare __comp)
| ^~~
/usr/include/c++/14/bits/stl_algobase.h:303:5: note: candidate expects 3 arguments, 2 provided
In file included from /usr/include/c++/14/algorithm:61:
/usr/include/c++/14/bits/stl_algo.h:5706:5: note: candidate: 'template<class _Tp> constexpr _Tp std::max(initializer_list<_Tp>)'
5706 | max(initializer_list<_Tp> __l)
| ^~~
/usr/include/c++/14/bits/stl_algo.h:5706:5: note: candidate expects 1 argument, 2 provided
/usr/include/c++/14/bits/stl_algo.h:5716:5: note: candidate: 'template<class _Tp, class _Compare> constexpr _Tp std::max(initializer_list<_Tp>, _Compare)'
5716 | max(initializer_list<_Tp> __l, _Compare __comp)
| ^~~
/usr/include/c++/14/bits/stl_algo.h:5716:5: note: template argument deduction/substitution failed:
a.cc:7:39: note: mismatched types 'std::initializer_list<_Tp>' and 'int'
7 | inline ll cnt(ll x, ll y) { return max(0, x / y + 1); }
| ~~~^~~~~~~~~~~~~~
|
s467815781 | p03861 | C | #include <stdio.h>
int main(void){
long long int a,b,x,d;
scanf("%lld %lld %lld\n",&a,&b,&x);
e=a/x-b/x;
if(a%x==0){
e++;
}
printf("%lld\n",d);
}
| main.c: In function 'main':
main.c:6:5: error: 'e' undeclared (first use in this function)
6 | e=a/x-b/x;
| ^
main.c:6:5: note: each undeclared identifier is reported only once for each function it appears in
|
s203951400 | p03861 | C++ | #include<iostream>
#include<string>
#include<vector>
#include<algorithm>
#include<cmath>
using namespace std;
int main()
{
long long int a, b, c;
cin >> a >> b >>c;
int ans = 0;
if (a == 0)
{
cout << (b/c)+1 << endl;
}
else
{
cout << (b - (a - a % c)) / x << endl;
}
} | a.cc: In function 'int main()':
a.cc:18:45: error: 'x' was not declared in this scope
18 | cout << (b - (a - a % c)) / x << endl;
| ^
|
s972273196 | p03861 | C++ | #include <iostream>
using namespace std;
long long a,b,x;
int main(){
cin >> a >> b >> x;
if(a==0) cout << b/x << endl;
else cout << max(b/x - (a-1)/x,0) << endl;
}
| a.cc: In function 'int main()':
a.cc:8:19: error: no matching function for call to 'max(long long int, int)'
8 | else cout << max(b/x - (a-1)/x,0) << endl;
| ~~~^~~~~~~~~~~~~~~~~
In file included from /usr/include/c++/14/string:51,
from /usr/include/c++/14/bits/locale_classes.h:40,
from /usr/include/c++/14/bits/ios_base.h:41,
from /usr/include/c++/14/ios:44,
from /usr/include/c++/14/ostream:40,
from /usr/include/c++/14/iostream:41,
from a.cc:1:
/usr/include/c++/14/bits/stl_algobase.h:257:5: note: candidate: 'template<class _Tp> constexpr const _Tp& std::max(const _Tp&, const _Tp&)'
257 | max(const _Tp& __a, const _Tp& __b)
| ^~~
/usr/include/c++/14/bits/stl_algobase.h:257:5: note: template argument deduction/substitution failed:
a.cc:8:19: note: deduced conflicting types for parameter 'const _Tp' ('long long int' and 'int')
8 | else cout << max(b/x - (a-1)/x,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
|
s459325771 | p03861 | C | #include<stdio.h>
int fn(int n,int x)
{
if(n < 0){return 0;}
else{return n/(x+1)}
}
int main(void)
{
int a,b,x;
scanf("%d%d%d",&a,&b,&x);
printf("%d",fn(b,x) - fn(a-1,x));
return 0;
}
| main.c: In function 'fn':
main.c:6:22: error: expected ';' before '}' token
6 | else{return n/(x+1)}
| ^
| ;
|
s733296275 | p03861 | C++ | #include <iostream>
using namespace std;
int main(){
long a, b, x;
cin >> a >> b >> x;
if(a % x == 0){
cout << ( b - a ) / x + 1 << endl;
}else{
cout << ( b - ( a - a % x ) / x << endl;
}
} | a.cc: In function 'int main()':
a.cc:10:37: error: invalid operands of types 'long int' and '<unresolved overloaded function type>' to binary 'operator<<'
10 | cout << ( b - ( a - a % x ) / x << endl;
| ~~~~~~~~~~~~~~~~~~~~~~^~~~~~~
a.cc:10:44: error: expected ')' before ';' token
10 | cout << ( b - ( a - a % x ) / x << endl;
| ~ ^
| )
|
s472772997 | 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 ans = b/x + 1;
if(l != 0){
ans += a/x + 1;
}
System.out.println(ans);
}
} | Main.java:11: error: cannot find symbol
if(l != 0){
^
symbol: variable l
location: class Main
1 error
|
s815029079 | p03861 | C++ | #include <iostream>
#include <string>
#include <math.h>
#define MOD 1000000007
using namespace std;
string replace_with_str(string str, string str_from, string str_to) {
string::size_type pos = 0;
while (pos = str.find(str_from, pos), pos != string::npos) {
str.replace(pos, str_from.length(), str_to);
pos += str_to.length();
}
return str;
}
int main(int argc, char const *argv[]){
unsigned long a, b, x, ans=0;
scanf("%lu %lu %lu",&a, &b, &x);
for(unsigned long i=a, i<=b; i++){
if(i%x == 0){
ans += 1;
}
}
printf("%lu\n", ans);
return 0;
} | a.cc: In function 'int main(int, const char**)':
a.cc:21:29: error: expected ';' before '<=' token
21 | for(unsigned long i=a, i<=b; i++){
| ^~
| ;
a.cc:21:29: error: expected primary-expression before '<=' token
21 | for(unsigned long i=a, i<=b; i++){
| ^~
|
s292088595 | p03861 | C++ | #include <iostream>
#include <string>
#include <math.h>
#define MOD 1000000007
using namespace std;
string replace_with_str(string str, string str_from, string str_to) {
string::size_type pos = 0;
while (pos = str.find(str_from, pos), pos != string::npos) {
str.replace(pos, str_from.length(), str_to);
pos += str_to.length();
}
return str;
}
int main(int argc, char const *argv[]){
long a, b, x, ans=0;
scanf("%d %d %d",&a, &b, &x);
for(int i=a, i<=b; i++){
if(i%x == 0){
ans += 1;
}
}
printf("%d\n", ans);
return 0;
} | a.cc: In function 'int main(int, const char**)':
a.cc:21:19: error: expected ';' before '<=' token
21 | for(int i=a, i<=b; i++){
| ^~
| ;
a.cc:21:19: error: expected primary-expression before '<=' token
21 | for(int i=a, i<=b; i++){
| ^~
|
s204468750 | p03861 | C++ | #include <iostream>
#include <string>
#include <math.h>
#define MOD 1000000007
using namespace std;
string replace_with_str(string str, string str_from, string str_to) {
string::size_type pos = 0;
while (pos = str.find(str_from, pos), pos != string::npos) {
str.replace(pos, str_from.length(), str_to);
pos += str_to.length();
}
return str;
}
int main(int argc, char const *argv[]){
int a, b, x, ans=0;
scanf("%d %d %d",&a, &b, &x);
for(int i=a, i<=b; i++){
if(i%x == 0){
ans += 1;
}
}
printf("%d\n", ans);
return 0;
} | a.cc: In function 'int main(int, const char**)':
a.cc:21:19: error: expected ';' before '<=' token
21 | for(int i=a, i<=b; i++){
| ^~
| ;
a.cc:21:19: error: expected primary-expression before '<=' token
21 | for(int i=a, i<=b; i++){
| ^~
|
s621603506 | p03861 | C++ | #include <iostream>
using namespace std;
int main(){
long long a,b,c;
long long cc=0;
cin>>a>>b>>c;
for(long long i=a;i<=b;i++){
if(i%x==0){
cc++;
}
}
cout<<cc;
return 0;
} | a.cc: In function 'int main()':
a.cc:10:14: error: 'x' was not declared in this scope
10 | if(i%x==0){
| ^
|
s736204542 | p03861 | C++ | #include<bits/stdc++.h>
using namespace std;
int main() {
cin.tie(0);
ios::sync_with_stdio(false);
ll a, b, x;
cin >> a >> b >> x;
cout << b/x+1-(a>0?(a-1)/x+1:0) << endl;
return 0;
} | a.cc: In function 'int main()':
a.cc:7:9: error: 'll' was not declared in this scope
7 | ll a, b, x;
| ^~
a.cc:8:16: error: 'a' was not declared in this scope
8 | cin >> a >> b >> x;
| ^
a.cc:8:21: error: 'b' was not declared in this scope
8 | cin >> a >> b >> x;
| ^
a.cc:8:26: error: 'x' was not declared in this scope
8 | cin >> a >> b >> x;
| ^
|
s192227955 | p03861 | C++ | #include <iostream>
using namespace std;
int main() {
long long a, b, x, i, total;
cin >> a >> b >> x;
total = 0;
for (i = a; i <= b; i++) {
if (i%x == 0) toatal += 1;
}
cout << total << endl;
return 0;
} | a.cc: In function 'int main()':
a.cc:10:19: error: 'toatal' was not declared in this scope; did you mean 'total'?
10 | if (i%x == 0) toatal += 1;
| ^~~~~~
| total
|
s121569957 | p03861 | C++ | #include <iostream>
using namespace std;
int main() {
long long a, b, x, i, toatal;
cin >> a >> b >> x;
total = 0;
for (i = a; i <= b; i++) {
if (i%x == 0) toatal += 1;
}
cout << total << endl;
return 0;
} | a.cc: In function 'int main()':
a.cc:7:3: error: 'total' was not declared in this scope; did you mean 'toatal'?
7 | total = 0;
| ^~~~~
| toatal
|
s614336188 | p03861 | C++ | #include <iostream>
using namespace std;
int main() {
long long a, b, x, i, toatal;
cin >> a >> b >> x;
total = 0
for (i = a; i <= b; i++) {
if (i%x == 0) toatal += 1;
}
cout << total << endl;
return 0;
} | a.cc: In function 'int main()':
a.cc:7:3: error: 'total' was not declared in this scope; did you mean 'toatal'?
7 | total = 0
| ^~~~~
| toatal
a.cc:9:26: error: expected ';' before ')' token
9 | for (i = a; i <= b; i++) {
| ^
| ;
|
s186350669 | p03861 | C++ | #include <iostream>
using namespace std;
int main() {
long long a, b, x, i toatal;
cin >> a >> b >> x;
total = 0
for (i = a; i <= b; i++) {
if (i%x == 0) toatal += 1;
}
cout << total << endl;
return 0;
} | a.cc: In function 'int main()':
a.cc:5:24: error: expected initializer before 'toatal'
5 | long long a, b, x, i toatal;
| ^~~~~~
a.cc:7:3: error: 'total' was not declared in this scope
7 | total = 0
| ^~~~~
a.cc:9:15: error: 'i' was not declared in this scope
9 | for (i = a; i <= b; i++) {
| ^
|
s385950253 | p03861 | C | #include<bits/stdc++.h>
using namespace std;
int main(){
long long int s,a,b,n=0,x,c,d;
scanf("%lld%lld%lld",&a,&b,&x);
c=a/x;
if(a>c*x){
n++;
}
d=b/x;
s=d-c-n+1;
printf("%lld\n",s);
return 0;
}
| main.c:1:9: fatal error: bits/stdc++.h: No such file or directory
1 | #include<bits/stdc++.h>
| ^~~~~~~~~~~~~~~
compilation terminated.
|
s338245383 | 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:6:18: error: no matching function for call to 'max(int, long long int)'
6 | 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:6:18: note: deduced conflicting types for parameter 'const _Tp' ('int' and 'long long int')
6 | 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:6:18: note: mismatched types 'std::initializer_list<_Tp>' and 'int'
6 | cout << b/x-max(0,(a-1))/x << endl;
| ~~~^~~~~~~~~
|
s411814083 | p03861 | C++ | #include <iostream>
#include <string>
#define FOR(i, n) for(int i = 0;i <n;i++)
#define RFOR(i, n) for(int i = n;i >= 0;i--)
#define REP(i, m, n) for(int i = m;i < n;i++)
#define RREP(i, m, n) for(int i = m;i >= n;i--)
#define INF 999999999
using namespace std;
int main(int argc, char const *argv[])
{
int a,b,c;
double x;
c = 0;
cin >>a>>b>>x;
REP(i,a,b+1)
{
if(i%x == 0 )
c++;
}
cout<<c<<endl;
return 0;
}
| a.cc: In function 'int main(int, const char**)':
a.cc:18:9: error: invalid operands of types 'int' and 'double' to binary 'operator%'
18 | if(i%x == 0 )
| ~^~
| | |
| | double
| int
|
s204517027 | p03861 | C++ |
#include<string>
using namespace std;
int main(){
long int a,b,x;
cin >> a >> b >> x;
long int aa, bb;
aa = a /x;
bb = b / x;
if (a%x==0){
aa--;
}
cout << bb - aa << endl;
} | a.cc: In function 'int main()':
a.cc:6:2: error: 'cin' was not declared in this scope
6 | cin >> a >> b >> x;
| ^~~
a.cc:3:1: note: 'std::cin' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
2 | #include<string>
+++ |+#include <iostream>
3 | using namespace std;
a.cc:13:2: error: 'cout' was not declared in this scope
13 | cout << bb - aa << endl;
| ^~~~
a.cc:13:2: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
a.cc:13:21: error: 'endl' was not declared in this scope
13 | cout << bb - aa << endl;
| ^~~~
a.cc:3:1: note: 'std::endl' is defined in header '<ostream>'; this is probably fixable by adding '#include <ostream>'
2 | #include<string>
+++ |+#include <ostream>
3 | using namespace std;
|
s969328872 | p03861 | C++ |
#include<string>
using namespace std;
int main(){
long int a,b,x;
cin >> a >> b >> x;
long int aa, bb;
aa = a /x;
bb = b / x;
if (a%x==0){
aa--;
}
cout << bb - aa << endl;
} | a.cc: In function 'int main()':
a.cc:6:2: error: 'cin' was not declared in this scope
6 | cin >> a >> b >> x;
| ^~~
a.cc:3:1: note: 'std::cin' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
2 | #include<string>
+++ |+#include <iostream>
3 | using namespace std;
a.cc:13:2: error: 'cout' was not declared in this scope
13 | cout << bb - aa << endl;
| ^~~~
a.cc:13:2: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
a.cc:13:21: error: 'endl' was not declared in this scope
13 | cout << bb - aa << endl;
| ^~~~
a.cc:3:1: note: 'std::endl' is defined in header '<ostream>'; this is probably fixable by adding '#include <ostream>'
2 | #include<string>
+++ |+#include <ostream>
3 | using namespace std;
|
s347450739 | p03861 | C++ | /// Containers Start
#include <iostream>
#include <string>
#include <sstream>
#include <set>
#include <map>
#include <unordered_map>
#include <stack>
#include <queue>
#include <vector>
#include <utility>
#include <iomanip>
#include <sstream>
#include <bitset>
#include <cstdlib>
#include <iterator>
#include <algorithm>
#include <functional>
#include <random>
/// C Header Files
#include <stdio.h>
#include <cstdio>
#include <cctype>
#include <cmath>
#include <math.h>
#include <ctime>
#include <cstring>
/// Containers End
using namespace std;
/// Math Start
#define PI acos(-1.0)
#define Pi 3.141592653589793
#define EPS (1e-7)
#define INF (0x3f3f3f3f)
/// Math End
/// Extra Start
#define nn '\n'
#define pb push_back
#define SS stringstream
#define ull unsigned long long
#define mod 1000000007
#define SIZE 2000001
#define _cin \
ios_base::sync_with_stdio(0); \
cin.tie(0);
#define sz(a) int((a).size())
#define space " "
#define All(x) (x).begin(), (x).end()
#define rall(x) (x).rbegin(), (x).rend()
#define Ignore cin.ignore()
#define StringToInt \
if (!(istringstream(s) >> n)) \
n = 0;
#define SORT(c) sort(All((c)))
#define RSORT(c) sort(rall((c)))
/// Extra End
/// Functions Start
template <class T>
T gcd(T a, T b)
{
if (b == 0)
return a;
return gcd(b, a % b);
}
template <class T>
T lcm(T a, T b) { return a / gcd(a, b) * b; }
template <class T>
string converter(T n)
{
SS x;
x << n;
return x.str();
}
string itos(int a)
{
string s = to_string(a);
return s;
}
template <class T>
T mod_pow(T x, T n)
{
T res = 1;
while (n > 0)
{
if (n & 1)
res = res * x % mod;
x = x * x % mod;
n >>= 1;
}
return res;
}
std::vector<std::string> split(const std::string &str, char sep)
{
std::vector<std::string> v;
std::stringstream ss(str);
std::string buffer;
while (std::getline(ss, buffer, sep))
{
v.push_back(buffer);
}
return v;
}
#define rep(i, n) for (int i = 0; i < n; i++)
#define FOR(i, a, b) for (int i = (a); i <= (b); i++)
#define for_arr(array) for (auto &i : array)
#define FORD(i, a, b) for (int i = (a); i >= (b); i--)
#define FORA(arr) for (auto &i : arr)
#define Cin(a) cin >> a;
#define Cin2(a, b) cin >> a >> b;
#define Cin3(a, b, c) cin >> a >> b >> c;
#define Cin4(a, b, c, d) cin >> a >> b >> c >> d;
#define Cini(a) \
int a; \
cin >> a;
#define Cinii(a, b) \
int a, b; \
cin >> a >> b;
#define Ciniii(a, b, c) \
int a, b, c; \
cin >> a >> b >> c;
#define Cins(s) \
string s; \
cin >> s;
#define Cinc(c) \
char c; \
cin >> c;
/// Functions End
/// Array Start
#define SET(a) memset(a, -1, sizeof a)
#define CLR(a) memset(a, 0, sizeof a)
#define MEM(a, val) memset(a, val, sizeof a)
/// Array End
/// Debug Start
#define deb(x) cout << #x << ": " << x << endl
#define deb2(x, y) cout << #x << ": " << x << '\t' << #y << ": " << y << endl
#define deb3(x, y, z) cout << #x << ": " << x << '\t' << #y << ": " << y << '\t' << #z << ": " << z << end
/// Debug End
/// TypeDef Start
typedef long long int ll;
typedef map<string, int> msi;
typedef map<int, int> mii;
typedef map<ll, ll> mll;
typedef map<char, int> mci;
typedef map<int, string> mis;
typedef pair<int, int> pii;
typedef pair<string, int> psi;
typedef pair<string, string> pss;
typedef vector<int> vi;
typedef vector<string> vs;
typedef vector<char> vc;
typedef vector<bool> vb;
typedef vector<pii> vii;
/// TypeDef End
int dx[] = {-1, 0, 1, 0};
int dy[] = {0, -1, 0, 1};
/**>>>>>>>>>>>>>>>>>>> END <<<<<<<<<<<<<<<<<<**/
///topcoder template
bool mysort(pair<int, int> a, pair<int, int> b)
{
return a.second > b.second;
}
int main(void)
{
ll a,b,x;
cin >> a >> b >> x;
cout << b/x -max((a-1),0)/x << nn;
return 0;
}
| a.cc: In function 'int main()':
a.cc:184:21: error: no matching function for call to 'max(ll, int)'
184 | cout << b/x -max((a-1),0)/x << nn;
| ~~~^~~~~~~~~
In file included from /usr/include/c++/14/string:51,
from /usr/include/c++/14/bits/locale_classes.h:40,
from /usr/include/c++/14/bits/ios_base.h:41,
from /usr/include/c++/14/ios:44,
from /usr/include/c++/14/ostream:40,
from /usr/include/c++/14/iostream:41,
from a.cc:2:
/usr/include/c++/14/bits/stl_algobase.h:257:5: note: candidate: 'template<class _Tp> constexpr const _Tp& std::max(const _Tp&, const _Tp&)'
257 | max(const _Tp& __a, const _Tp& __b)
| ^~~
/usr/include/c++/14/bits/stl_algobase.h:257:5: note: template argument deduction/substitution failed:
a.cc:184:21: note: deduced conflicting types for parameter 'const _Tp' ('long long int' and 'int')
184 | cout << b/x -max((a-1),0)/x << nn;
| ~~~^~~~~~~~~
/usr/include/c++/14/bits/stl_algobase.h:303:5: note: candidate: 'template<class _Tp, class _Compare> constexpr const _Tp& std::max(const _Tp&, const _Tp&, _Compare)'
303 | max(const _Tp& __a, const _Tp& __b, _Compare __comp)
| ^~~
/usr/include/c++/14/bits/stl_algobase.h:303:5: note: candidate expects 3 arguments, 2 provided
In file included from /usr/include/c++/14/algorithm:61,
from a.cc:17:
/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:184:21: note: mismatched types 'std::initializer_list<_Tp>' and 'long long int'
184 | cout << b/x -max((a-1),0)/x << nn;
| ~~~^~~~~~~~~
|
s203245827 | p03861 | C++ | #include<iostream>
#include<cstdio>
#include<cstring>
#include<cmath>
using namespace std;
#define f(i,a,b,1) for(int i=a;i<=b;i++)
#define f(i,a,b,-1) for(int i=a;i>=b;i--)
int main()
{
int a,b,x,ans=0;
cin>>a>>b>>x;
f(i,a,b,1)
{ if(i%x==0) ans++;}
cout<<ans<<endl;return 0;
} | a.cc:6:17: error: expected parameter name, found "1"
6 | #define f(i,a,b,1) for(int i=a;i<=b;i++)
| ^
a.cc:7:17: error: expected parameter name, found "-"
7 | #define f(i,a,b,-1) for(int i=a;i>=b;i--)
| ^
a.cc: In function 'int main()':
a.cc:12:11: error: 'i' was not declared in this scope
12 | f(i,a,b,1)
| ^
a.cc:12:9: error: 'f' was not declared in this scope
12 | f(i,a,b,1)
| ^
|
s500008053 | p03861 | C++ | #include <cstdio>
int main()
{
long long int a,b,x,s=0,i;
scanf("%lld %lld %lld",&a,&b,&x);
i=b;
while(i<=b&&i>=a)
{
if(i%x!=0){i--;}
else{
s=(i/d);}
}
printf("%lld",s);
return 0;} | a.cc: In function 'int main()':
a.cc:11:22: error: 'd' was not declared in this scope
11 | s=(i/d);}
| ^
|
s422142922 | p03861 | C++ | #include <cstdio>
int main()
{
long long int a,b,x,s=0,i;
scanf("%lld %lld %lld",&a,&b,&x);
i=(a+b)/2;
while(i<=b&&i>=a)
{
if(i%x!=0){i--;}
else{
s=(i/d);}
}
printf("%lld",s);
return 0;} | a.cc: In function 'int main()':
a.cc:11:22: error: 'd' was not declared in this scope
11 | s=(i/d);}
| ^
|
s219574812 | p03861 | C++ | #include <cstdio>
int main()
{
int a=0,b=0,x=0,i=0,s=0;
scanf("%d %d %d",&a,&b,&x);
if(i%x!=0)
{i++;}
for(i=a&&s=o;a<=i&&i<=b&&i%x==0;i++,s++)
printf("%d",s);
return 0;} | a.cc: In function 'int main()':
a.cc:9:20: error: 'o' was not declared in this scope
9 | for(i=a&&s=o;a<=i&&i<=b&&i%x==0;i++,s++)
| ^
|
s309532087 | p03861 | C++ | #include<bits/stdc++.h>
int main() {
int a, b, x;
cin >> a >> b >> x;
int A, B, ans;
A = a / x;
B = b / x;
ans = B - A;
if (a%x == 0) {
ans++;
}
cout << ans << endl;
} | a.cc: In function 'int main()':
a.cc:4:9: error: 'cin' was not declared in this scope; did you mean 'std::cin'?
4 | cin >> a >> b >> x;
| ^~~
| std::cin
In file included from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:146,
from a.cc:1:
/usr/include/c++/14/iostream:62:18: note: 'std::cin' declared here
62 | extern istream cin; ///< Linked to standard input
| ^~~
a.cc:13:9: error: 'cout' was not declared in this scope; did you mean 'std::cout'?
13 | cout << ans << endl;
| ^~~~
| std::cout
/usr/include/c++/14/iostream:63:18: note: 'std::cout' declared here
63 | extern ostream cout; ///< Linked to standard output
| ^~~~
a.cc:13:24: error: 'endl' was not declared in this scope; did you mean 'std::endl'?
13 | cout << ans << endl;
| ^~~~
| std::endl
In file included from /usr/include/c++/14/istream:41,
from /usr/include/c++/14/sstream:40,
from /usr/include/c++/14/complex:45,
from /usr/include/c++/14/ccomplex:39,
from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:127:
/usr/include/c++/14/ostream:744:5: note: 'std::endl' declared here
744 | endl(basic_ostream<_CharT, _Traits>& __os)
| ^~~~
|
s839433928 | p03861 | C++ | #include <stdio.h>
int main()
{
long long a,b,x,m,n;
scanf ("%lld %lld %lld",&a,&b,&x);
m = (a-1)/x;
n = b/x;
printf ("%lld\n",n-m);*/
return 0;
} | a.cc: In function 'int main()':
a.cc:8:29: error: expected primary-expression before '/' token
8 | printf ("%lld\n",n-m);*/
| ^
a.cc:9:9: error: expected primary-expression before 'return'
9 | return 0;
| ^~~~~~
|
s576134397 | p03861 | C++ | #include <cstdio>
int main()
{
int a=0,b=0,x=0,i=0,s=0;
scanf("%d %d %d",&a,&b,&x);
i=a;
s=0;
while(a<=i&&i<=b){
if(i%x==0)
{i++;
s++;}
else {i++;}
}
printf("%d",s);
r | a.cc: In function 'int main()':
a.cc:16:9: error: 'r' was not declared in this scope
16 | r
| ^
a.cc:16:10: error: expected '}' at end of input
16 | r
| ^
a.cc:4:1: note: to match this '{'
4 | {
| ^
|
s568241935 | p03861 | C++ | #include <cstdio>
int main()
{
int a,b,x,i,s=0;
scanf("%d %d %d",&a,&b,&x);
i=a;
s=0;
while(a<=i&&i<=b){
if(i%x==0)
{i++;
s++;}
else {i++;}
}
printf("%d",s);
r | a.cc: In function 'int main()':
a.cc:16:9: error: 'r' was not declared in this scope
16 | r
| ^
a.cc:16:10: error: expected '}' at end of input
16 | r
| ^
a.cc:4:1: note: to match this '{'
4 | {
| ^
|
s425647330 | p03861 | C++ | #include <bits/stdc++.h>
using namespace std;
long long a, b, x, cnt = 0;
int main() {
cin >> a >> b >> x;
cout << b / x - max(0, (a - 1)) / x << endl;
return 0;
} | a.cc: In function 'int main()':
a.cc:8:22: error: no matching function for call to 'max(int, long long int)'
8 | cout << b / x - max(0, (a - 1)) / x << endl;
| ~~~^~~~~~~~~~~~
In file included from /usr/include/c++/14/algorithm:60,
from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:51,
from a.cc:1:
/usr/include/c++/14/bits/stl_algobase.h:257:5: note: candidate: 'template<class _Tp> constexpr const _Tp& std::max(const _Tp&, const _Tp&)'
257 | max(const _Tp& __a, const _Tp& __b)
| ^~~
/usr/include/c++/14/bits/stl_algobase.h:257:5: note: template argument deduction/substitution failed:
a.cc:8:22: note: deduced conflicting types for parameter 'const _Tp' ('int' and 'long long int')
8 | cout << b / x - max(0, (a - 1)) / x << endl;
| ~~~^~~~~~~~~~~~
/usr/include/c++/14/bits/stl_algobase.h:303:5: note: candidate: 'template<class _Tp, class _Compare> constexpr const _Tp& std::max(const _Tp&, const _Tp&, _Compare)'
303 | max(const _Tp& __a, const _Tp& __b, _Compare __comp)
| ^~~
/usr/include/c++/14/bits/stl_algobase.h:303:5: note: candidate expects 3 arguments, 2 provided
In file included from /usr/include/c++/14/algorithm:61:
/usr/include/c++/14/bits/stl_algo.h:5706:5: note: candidate: 'template<class _Tp> constexpr _Tp std::max(initializer_list<_Tp>)'
5706 | max(initializer_list<_Tp> __l)
| ^~~
/usr/include/c++/14/bits/stl_algo.h:5706:5: note: candidate expects 1 argument, 2 provided
/usr/include/c++/14/bits/stl_algo.h:5716:5: note: candidate: 'template<class _Tp, class _Compare> constexpr _Tp std::max(initializer_list<_Tp>, _Compare)'
5716 | max(initializer_list<_Tp> __l, _Compare __comp)
| ^~~
/usr/include/c++/14/bits/stl_algo.h:5716:5: note: template argument deduction/substitution failed:
a.cc:8:22: note: mismatched types 'std::initializer_list<_Tp>' and 'int'
8 | cout << b / x - max(0, (a - 1)) / x << endl;
| ~~~^~~~~~~~~~~~
|
s436289281 | p03861 | C++ | #include <bits/stdc++.h>
using namespace std;
int main(){
long long int a,b,x;
cin >>a>>b>>x;
cout <<b/x-(a-1)/x <<endl;
} | a.cc:4:12: error: extended character is not valid in an identifier
4 | int main(){
| ^
a.cc: In function 'int main()':
a.cc:4:12: error: '\U00003000' was not declared in this scope
4 | int main(){
| ^~
a.cc:6:9: error: 'a' was not declared in this scope
6 | cin >>a>>b>>x;
| ^
a.cc:6:12: error: 'b' was not declared in this scope
6 | cin >>a>>b>>x;
| ^
a.cc:6:15: error: 'x' was not declared in this scope
6 | cin >>a>>b>>x;
| ^
|
s006986796 | p03861 | C++ | #include <iostream>
using namespace std;
typedef long long ll;
inline ll f(ll n)
{
if(-1==n)
{
return 0;
}
else
{
return n/x+1;
}
}
int main()
{
ll a,b,x;
cin>>a>>b>>x;
cout<<f(b)-f(a-1)<<endl;
return 0;
} | a.cc: In function 'll f(ll)':
a.cc:13:26: error: 'x' was not declared in this scope
13 | return n/x+1;
| ^
|
s681399543 | p03861 | C++ | #include <iostream>
using namespace std;
typedef long long ll;
inline f(ll n)
{
if(-1==n)
{
return 0;
}
else
{
return n/x+1;
}
}
int main()
{
ll a,b,x;
cin>>a>>b>>x;
cout<<f(b)-f(a-1)<<endl;
return 0;
} | a.cc:5:8: error: ISO C++ forbids declaration of 'f' with no type [-fpermissive]
5 | inline f(ll n)
| ^
a.cc: In function 'int f(ll)':
a.cc:13:26: error: 'x' was not declared in this scope
13 | return n/x+1;
| ^
|
s778193062 | p03861 | C++ | #include <iostream>
using namespace std;
typedef long long ll;
ll a,b,x;
inline f(ll n)
{
if(-1==n)
{
return 0;
}
else
{
return n/x+1;
}
}
int main()
{
cin>>a>>b>>x;
cout<<f(b)-f(a-1)<<endl;
return 0;
} | a.cc:5:8: error: ISO C++ forbids declaration of 'f' with no type [-fpermissive]
5 | inline f(ll n)
| ^
|
s303928050 | p03861 | C++ | #include <iostream>
using namespace std;
typedef long long ll;
ll a,b,x;
inline f(ll n)
{
if(-1==n)
{
return 0;
}
else
{
return n/x+1;
}
}
int main()
{
cin>>a>>b>>x;
cout<<f(b)-f(a-1)<<endl;
return 0;
} | a.cc:5:8: error: ISO C++ forbids declaration of 'f' with no type [-fpermissive]
5 | inline f(ll n)
| ^
|
s283779712 | p03861 | C++ | #include<bits/stdc++.h>
using namespace std;
long long a,b,x;
inline long long f(long long n) {
if(-1==n){
return 0;
}else{
return n/x+1;
}
}
int main(){
cin>>a>>b>>c;
cout<<f(b)-f(a-1)<<endl;
return 0;
}
| a.cc: In function 'int main()':
a.cc:13:20: error: 'c' was not declared in this scope
13 | cin>>a>>b>>c;
| ^
|
s092335143 | p03861 | C++ | #include <iostream>
using namespace std;
typedef long long ll;
ll f(ll n)
{
if(-1==n)
{
return 0;
}
else
{
return n/x+1;
}
}
int main()
{
int a,b,x;
cin>>a>>b>>x;
cout<<f(b)-f(a-1)<<endl;
return 0;
} | a.cc: In function 'll f(ll)':
a.cc:12:26: error: 'x' was not declared in this scope
12 | return n/x+1;
| ^
|
s286351808 | p03861 | C++ | #include <iostream>
using namespace std;
typedef long long ll;
ll f(ll n)
{
if(-1==n){
return 0;
}else{
return n/x+1;
}
}
int main()
{
cin>>a>>b>>x;
cout<<f(b)-f(a-1)<<endl;
return 0;
}
| a.cc: In function 'll f(ll)':
a.cc:9:26: error: 'x' was not declared in this scope
9 | return n/x+1;
| ^
a.cc: In function 'int main()':
a.cc:14:14: error: 'a' was not declared in this scope
14 | cin>>a>>b>>x;
| ^
a.cc:14:17: error: 'b' was not declared in this scope
14 | cin>>a>>b>>x;
| ^
a.cc:14:20: error: 'x' was not declared in this scope
14 | cin>>a>>b>>x;
| ^
|
s760998456 | p03861 | C++ | #include<bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef long double ld;
typedef unsigned long long ull;
inline ll f(ll n){
if(-1==n){
return 0;
}else{
return n/x+1
}
}
int main(){
ull a,b,x;
cin>>a>>b>>x;
cout<<f(b)-f(a-1)<<endl;
return 0;
} | a.cc: In function 'll f(ll)':
a.cc:10:26: error: 'x' was not declared in this scope
10 | return n/x+1
| ^
a.cc:10:29: error: expected ';' before '}' token
10 | return n/x+1
| ^
| ;
11 | }
| ~
|
s521319957 | p03861 | C++ | #include<bits/stdc++.h>
using namespace std;
int a[101]
int main(){
int n,i,j,x,sum=0;
cin>>n>>x;
for(i=1;i<=n;i++)
cin>>a[i];
for(i=1;i<n;i++)
for(j=2;j<=n;j++)
if(a[j]-a[i]>xa[i]-a[j]>x) sum++;
cout<<sum;
return 0;
}
| a.cc:4:1: error: expected initializer before 'int'
4 | int main(){
| ^~~
|
s821457504 | p03861 | C++ | #include<bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef long double ld;
typedef unsigned long long ull;
int main(){
ull a,b,x;
if(b%x==0&&a%x==0)
cout<<(b-a)/x+1;
return 0;
}
cout<<(b-a)/x+(a-b)/x;
return 0;
} | a.cc:12:5: error: 'cout' does not name a type
12 | cout<<(b-a)/x+(a-b)/x;
| ^~~~
a.cc:13:9: error: expected unqualified-id before 'return'
13 | return 0;
| ^~~~~~
a.cc:15:1: error: expected declaration before '}' token
15 | }
| ^
|
s421423333 | p03861 | C++ | #include<bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef long double ld;
typedef unsigned long long ull;
int main(){
ull a,b,x;
if((b-a)%x==0){
cout<<(b-a)/c+1;
return 0;
}
cout<<(b-a)/x;
return 0;
} | a.cc: In function 'int main()':
a.cc:9:29: error: 'c' was not declared in this scope
9 | cout<<(b-a)/c+1;
| ^
|
s589621369 | p03861 | C++ | #include<bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef long double ld;
typedef unsigned long long ull;
int main(){
ull a,b,x;
cout<<(a-b)/x;
return 0;
| a.cc: In function 'int main()':
a.cc:9:18: error: expected '}' at end of input
9 | return 0;
| ^
a.cc:6:11: note: to match this '{'
6 | int main(){
| ^
|
s336872637 | p03861 | C++ | #include<bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef long double ld;
typedef unsigned long long ull;
int main(){
ull a,b,x;
if((a-b)%x==0){
cout<<(a-b)/x;
return 0;
}
else cout<<(a-b)/x;
return 0;
| a.cc: In function 'int main()':
a.cc:13:18: error: expected '}' at end of input
13 | return 0;
| ^
a.cc:6:11: note: to match this '{'
6 | int main(){
| ^
|
s307446287 | p03861 | C++ | #include <iostream>
#include <cstring>
#include <algorithm>
#include <vector>
using namespace std;
int main(void){
long long a,b,x;
cin>>a>>b>>x;
long long ans=0;
if(b-a>=x) {
if(a%x==0) {ans=b/x-a/x+1;}
else {ans=b/x-a/x;}
}
else {
if(a/x==b/x&&a%x!=0&&b%x!=0) ans=0;
else ans=1;
}
}
cout<<ans;
return 0;
}
| a.cc:19:1: error: 'cout' does not name a type
19 | cout<<ans;
| ^~~~
a.cc:20:1: error: expected unqualified-id before 'return'
20 | return 0;
| ^~~~~~
a.cc:21:1: error: expected declaration before '}' token
21 | }
| ^
|
s431696499 | p03861 | C++ | #include <iostream>
#include <cstring>
#include <algorithm>
#include <vector>
using namespace std;
int main(void){
long long a,b,x;
cin>>a>>b>>x;
long long ans=0;
if(b-a>=x) {
if(a%x==0) {ans=b/x-a/x+1;}
else {ans=b/x-a/x;}
}
else {
if(a/x==b/x&&a%x!=0&&b%x!=0) ans=0;
else ans=1;
}
}
cout<<ans;
return 0;
}
| a.cc:19:1: error: 'cout' does not name a type
19 | cout<<ans;
| ^~~~
a.cc:20:1: error: expected unqualified-id before 'return'
20 | return 0;
| ^~~~~~
a.cc:21:1: error: expected declaration before '}' token
21 | }
| ^
|
s054508823 | p03861 | C++ | #include <iostream>
#include <cstring>
#include <algorithm>
#include <vector>
using namespace std;
int main(void){
long long a,b,x;
cin>>a>>b>>x;
long long ans=0;
if(b-a>=x) {
if(a%x==0) {ans=b/x-a/x+1;}
else {ans=b/x-a/x;}
}
else {for(int i=a;i<=b;i++){
if(i%x==0) ans++;
}
cout<<ans;
return 0;
}
| a.cc: In function 'int main()':
a.cc:19:2: error: expected '}' at end of input
19 | }
| ^
a.cc:6:15: note: to match this '{'
6 | int main(void){
| ^
|
s999665502 | p03861 | C++ | #include<bits/stdc++.h>
using ll = long long;
#define int ll
#define rep(i,n) for(int i=0;i<n;i++)
#define loop(i,s,n) for(int i=s;i<n;i++)
#define erep(e,v) for(auto && e :v)
#define all(in) in.begin(), in.end()
#define MP make_pair
#define INF (sizeof(int) == 4 ? (int)1e9:(int)1e18)
#define EPS 0.0000000001
using namespace std;
template<class T, class S> void cmin(T &a, const S &b) { if (a > b)a = b; }
template<class T, class S> void cmax(T &a, const S &b) { if (a < b)a = b; }
template<typename Head, typename Value> auto vectors(const Head &head, const Value &v) { return vector<Value>(head, v); }
template<typename Head, typename... Tail> auto vectors(Head x, Tail... tail) { auto inner = vectors(tail...); return vector<decltype(inner)>(x, inner); }
template<class T> void join(T a){for(auto itr :a){if(itr != *a.begin())cout << " "; cout << itr;} }
using ld = long double;
using pii = pair<int,int>;
using piii = pair<int,pii>;
int W,H;
int dx[]={0,0,1,-1}, dy[]={1,-1,0,0};
bool valid(int x,int y){return (0<=x&&x<W)&&(0<=y&&y<H);}
signed main(){
int a,b,x;cin>>a>>b>>x;
cout << (b/x-a/x+(a%x?0LL:1LL)<<endl;
}
| a.cc: In function 'int main()':
a.cc:25:35: error: invalid operands of types 'll' {aka 'long long int'} and '<unresolved overloaded function type>' to binary 'operator<<'
25 | cout << (b/x-a/x+(a%x?0LL:1LL)<<endl;
| ~~~~~~~~~~~~~~~~~~~~~^~~~~~
a.cc:25:41: error: expected ')' before ';' token
25 | cout << (b/x-a/x+(a%x?0LL:1LL)<<endl;
| ~ ^
| )
|
s331738037 | p03861 | C++ | #include<stdio.h>
int main()
{
int a,b,x,i;
scanf("%d%d%d",&a,&b,&x);
for(int i=a,i<=b,i++);
{
if(i%x==0);
printf("%d\n",i);
}
return 0;
} | a.cc: In function 'int main()':
a.cc:6:18: error: expected ';' before '<=' token
6 | for(int i=a,i<=b,i++);
| ^~
| ;
a.cc:6:18: error: expected primary-expression before '<=' token
6 | for(int i=a,i<=b,i++);
| ^~
a.cc:6:25: error: expected ';' before ')' token
6 | for(int i=a,i<=b,i++);
| ^
| ;
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.