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 t... |
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 namesp... |
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: ... |
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-... |
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... |
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 ... |
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) {r... | 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+... |
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 n... | 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 | fu... |
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) pu... | 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(),... | 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(),... | 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... | 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/gl... |
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... | 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_... |
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 'l... |
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 'l... |
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... |
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 inclu... |
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 >> ... |
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;... | 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/std... |
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: '... |
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: '... |
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... | 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 | ... |
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()
#... | 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... |
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 ... | 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 =... | 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... | 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 <... | 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,
... |
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;
... | 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 <... |
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(... | 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){
... | 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 t... |
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){
... | 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... | 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 ... |
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... |
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));
}
... | 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 '=', ',', ';', ... |
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 ... |
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++){
| ^
... |
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);
... | 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++){... | 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
... |
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;
... | 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;
*... | 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;
... |
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 -----------------------------... | 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 | ... |
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,
... |
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 RR... | 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/... |
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 RR... | 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/... |
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){
| ... |
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.... |
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... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.