problem_id stringclasses 100
values | submission_id stringlengths 10 10 | status stringclasses 2
values | code stringlengths 6 806 |
|---|---|---|---|
p03861 | s200856242 | Accepted | a,b,x=map(int,input().split())
print(b//x-((a-1)//x)) |
p03861 | s514746443 | Accepted | a, b, x = map(int, input().split())
n = b // x
m = (a-1) // x
print(n-m) |
p03861 | s977051697 | Accepted | a, b, x = map(int, input().split())
bb = b // x
aa = (a - 1) // x
print(bb - aa)
|
p03861 | s277150024 | Accepted | a, b, x = map(int, input().split())
d=b//x-a//x
if a%x==0:
d=d+1
print(d)
else:
print(d) |
p03861 | s060352036 | Accepted | a, b, x = map(int, input().split())
i = a// x
j = b// x
p = i* x
q = j* x
while i* x < a:
i+= 1
p = i* x
while j* x < b:
j+= 1
q = (j- 1)* x
ans = int((q- p)// x)+ 1
if(ans<= 0):
print(0)
else:
print(ans) |
p03861 | s267829470 | Accepted | a, b, x = 4, 8, 3
a, b, x = 0, 5, 1
a, b, x = 9, 9, 2
a, b, x = 1, 1000000000000000000, 3
a, b, x = map(int,input().split())
def calculate(a, b, x):
s1 = (a - 1) // x
if s1 < 0:
s1 = 0
else:
s1 += 1
s2 = b // x + 1
print(s2 - s1)
calculate(a, b, x)
|
p03861 | s562138785 | Accepted | a,b,x = map(int,input().split())
mx = b//x
mn = (a-1)//x
print(mx-mn) |
p03861 | s373236954 | Accepted | import sys
readline = sys.stdin.buffer.readline
a,b,x = map(int,readline().split())
import math
low = (a+x-1)//x
high = b//x
print(high-low+1)
|
p03861 | s562316600 | Accepted | #!/usr/bin/env python3
a, b, x = map(int, input().split())
print((b // x) - ((a - 1) // x))
|
p03861 | s312540020 | Accepted | import math
a,b,c=[int(i) for i in input().split()]
print(b//c - (a-1)//c)
|
p03861 | s800243487 | Accepted | a,b,x = map(int,input().split())
l,r = 0,0
if a%x == 0:
l = a//x
else:
l = a//x + 1
r = b//x
print(r-l + 1)
|
p03861 | s262172718 | Accepted |
a,b,x = map(int,input().split())
r = b // x
l = a // x
if a % x == 0:
print(r-l+1)
else:
print(r-l)
|
p03861 | s363470721 | Accepted | a, b, x = map(int,input().split())
if a % x == 0:
print(b//x - a//x + 1)
else:
print(b//x - a//x) |
p03861 | s071129220 | Accepted | import decimal
import math
a, b, x = map(decimal.Decimal, input().split())
min_x_fac = math.floor(a / x)
max_x_fac = math.floor(b / x)
count = max_x_fac - min_x_fac
if a % x == 0:
count += 1
print(count) |
p03861 | s859401257 | Accepted | a,b,x = map(int,input().split())
ans = b // x
a-=1
ans -= (a // x)
print(ans) |
p03861 | s379510416 | Accepted | a,b,x = map(int,input().split())
print(b//x-a//x if a%x!=0 else b//x-a//x+1)
|
p03861 | s351179623 | Accepted | a, b, x = map(int, input().split())
result = b//x-a//x
if a % x == 0:
result +=1
print(result) |
p03861 | s554614201 | Accepted | a, b, x = map(int, input().split())
print(b // x - (a - 1) // x)
|
p03861 | s901486101 | Accepted | a, b, x = map(int, input().split())
print(b//x - (a-1)//x)
|
p03861 | s619579434 | Accepted | a, b, x = map(int, input().split())
b_ans = b // x
a_ans = (a - 1) // x
print(b_ans - a_ans) |
p03861 | s211296715 | Accepted | # https://atcoder.jp/contests/abc048/tasks/abc048_b
a, b, x = map(int, input().split())
l = a // x
r = b // x
ans = r - l
if a % x == 0:
ans += 1
print(ans) |
p03861 | s219333790 | Accepted | a, b, x = map(int, input().split())
bd = b // x
ad = (a-1) // x
print(bd - ad)
|
p03861 | s795044317 | Accepted | import sys
import itertools
sys.setrecursionlimit(1000000000)
from heapq import heapify,heappop,heappush,heappushpop
import math
import collections
MOD = 10**9+7
a,b,x = map(int,input().split())
if a == 0:
ans = b//x + 1
else:
ans = b//x - (a-1)//x
print(ans) |
p03861 | s553498434 | Accepted | import sys
#import numpy as np
import math
from fractions import Fraction
import itertools
input=sys.stdin.readline
a,b,x=map(int,input().split())
ans=b//x-(a-1)//x
print(ans) |
p03861 | s780164951 | Accepted | a,b,x = map(int, input().split())
print(b//x-(a-1)//x) |
p03861 | s394926442 | Accepted | a,b,c = map(int,input().split())
print(b//c-(a-1)//c)
|
p03861 | s571774942 | Accepted | a,b,x = map(int,input().split())
print(b//x-(a-1)//x) |
p03861 | s445576412 | Accepted | a, b, x = map(int, input().split())
print(b // x - (a // x + int(a % x != 0)) + 1) |
p03861 | s115876834 | Accepted | a, b, x = map( int, input().split())
print( b//x - (a-1)//x) |
p03861 | s589099277 | Accepted | from sys import stdin
def ceil(a,b):
return (a+b-1)//b
def floor(a,b):
return a//b
if __name__ == "__main__":
_in = [_.rstrip() for _ in stdin.readlines()]
a,b,x = list(map(int,_in[0].split(' '))) # type:list(int)
# vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv
cnt = floor(b,x)-ceil(a,x)+1
# ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
print(cnt)
|
p03861 | s441864572 | Accepted | a,b,x=map(int,input().split())
if a%x==0:
print(b//x-a//x+1)
else:
print(b//x-a//x) |
p03861 | s545967360 | Accepted | a,b,x=[int(i) for i in input().split()]
print(b//x-(a-1)//x) |
p03861 | s273316323 | Accepted | def solve(a, b, x):
return b // x - (a - 1) // x
_a, _b ,_x = map(int, input().split())
print(solve(_a, _b, _x))
|
p03861 | s052436291 | Accepted | a,b,x=map(int,input().split());print((b//x)-((a-1)//x)) |
p03861 | s534486004 | Accepted | a, b, x = map(int, input().split())
a_x = a // x
b_x = b // x
if a % x == 0:
print(b_x - a_x + 1)
else:
print(b_x - a_x)
|
p03861 | s935166207 | Accepted | import sys
def main():
a,b,x=tuple(map(int,sys.stdin.readline().split()))
res=b//x-a//x if a%x!=0 else b//x-a//x+1
print(res)
if __name__=='__main__':main() |
p03861 | s676238445 | Accepted | a,b,x = map(int,input().split())
print(b//x-(a-1)//x)
|
p03861 | s249143962 | Accepted | """
author : halo2halo
date : 2, Feb, 2020
"""
import sys
import itertools
import numpy as np
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines
a, b, x = map(int, readline().split())
print(b // x - (a + x - 1) // x + 1)
|
p03861 | s922773972 | Accepted | def resolve():
a, b, x = map(int, input().split())
print(b // x - (a-1) // x)
resolve() |
p03861 | s227078027 | Accepted | import sys
input = sys.stdin.buffer.readline
#sys.setrecursionlimit(10**9)
#from functools import lru_cache
def RD(): return sys.stdin.read()
def II(): return int(input())
def MI(): return map(int,input().split())
def MF(): return map(float,input().split())
def LI(): return list(map(int,input().split()))
def LF(): return list(map(float,input().split()))
def TI(): return tuple(map(int,input().split()))
# rstrip().decode()
def main():
a,b,x=MI()
ans=(b-a)//x
c=a+x*ans
if b//x*x==-(-c//x)*x:
ans+=1
print(ans)
if __name__ == "__main__":
main()
|
p03861 | s604419435 | Accepted | a,b,x=map(int,input().split())
aw=a//x
bw=b//x
ans=bw-aw
if a%x==0:
ans+=1
print(ans) |
p03861 | s971143520 | Accepted | a, b, x = map(int, input().split())
print(b // x - (a - 1) // x) |
p03861 | s842116840 | Accepted | a,b,x=map(int,input().split())
if a%x==0:
print(b//x-a//x+1)
else:
print(b//x-a//x) |
p03861 | s576189873 | Accepted | a,b,x=map(int,input().split())
num1=-(a//-x)
num2=b//x
print(num2-num1+1)
|
p03861 | s585096638 | Accepted | a,b,x = map(int,input().split())
print((b//x)-((a-1)//x)) |
p03861 | s521387747 | Accepted | a,b,x = map(int,input().split())
print(b // x - (a-1) // x)
|
p03861 | s990762206 | Accepted | if __name__ == '__main__':
a, b, x = map(int, input().split())
l = b // x
r = (a-1) // x
print(l - r) |
p03861 | s153012663 | Accepted | a, b, x = map(int, input().split())
if a>0:
print(b//x-(a-1)//x)
else:
print(b//x+1) |
p03861 | s968478858 | Accepted | a,b,x=map(int,input().split())
# print(a)
# print(b)
# print(x)
if a%x==0:
print((b//x)-(a//x)+1)
else:
print((b//x)-(a//x))
|
p03861 | s854910230 | Accepted | a, b, x = map(int, input().split())
print(b//x-(a-1)//x) |
p03861 | s752804537 | Accepted | a,b,x = map(int,input().split())
def func(n):
if n > -1:
return n//x + 1
else:
return 0
print(func(b)-func(a-1)) |
p03861 | s073391733 | Accepted | a, b, x = map(int, input().split())
c = b // x + 1
d = 0
if a - 1 > -1:
d = (a - 1) // x + 1
else:
d = 0
print(c - d) |
p03861 | s219297104 | Accepted | a, b, x = map(int, input().split())
ans = b//x - a//x
if a%x == 0:
print(ans+1)
else:
print(ans) |
p03861 | s759531166 | Accepted | a, b, x = map(int, input().split())
ans = (b-a)//x
if (x-a % x) % x+(b % x) < x:
ans += 1
print(ans)
|
p03861 | s394974353 | Accepted | a, b, x = map(int, input().split(' '))
print(b//x-(a-1)//x) |
p03861 | s215680748 | Accepted | a,b,x = map(int,input().split())
b = b // x + 1
a = (a - 1) // x + 1
print(b - a) |
p03861 | s901610414 | Accepted | (a, b, x) = map(int, input().split())
n_lt_a = a // x + 1
n_lt_b = b // x + 1
if a % x == 0:
ans = n_lt_b - n_lt_a + 1
else:
ans = n_lt_b - n_lt_a
print(ans)
|
p03861 | s248987365 | Accepted | a,b,x = map(int,input().split())
print((b//x+1)-((a-1)//x+1)) |
p03861 | s438487718 | Accepted | a, b, x = map(int, input().split())
x_min = (a - 1) // x
x_max = b // x
if x_max >= x_min:
print(x_max - x_min) |
p03861 | s351787205 | Accepted | a, b, x = map(int, input().split())
if a == 0:
print(b // x + 1)
else:
print(b // x - (a - 1) // x) |
p03861 | s639891878 | Accepted | from math import ceil,floor,comb,factorial,gcd,pow,sqrt,log2,cos,sin,tan,pi,inf
from itertools import accumulate,permutations,combinations,product,combinations_with_replacement
from collections import deque,defaultdict,Counter
from bisect import bisect_left,bisect_right
from operator import itemgetter
from heapq import heappop,heappush
from copy import deepcopy
from time import time
import string
import sys
sys.setrecursionlimit(10 ** 7)
def input() : return sys.stdin.readline().strip()
def INT() : return int(input())
def MAP() : return map(int,input().split())
def LIST() : return list(MAP())
a, b, x = MAP()
print(b//x-a//x+1 if a%x==0 else b//x-a//x) |
p03861 | s269768393 | Accepted | a, b, x = map(int, input().split())
ans = b//x -(a-1) //x
print(ans)
|
p03861 | s011782373 | Accepted | a, b, x = map(int, input().split())
res = int(b//x - (a-1)//x)
print(res) |
p03861 | s625324226 | Accepted | # ABC048 B Between a and b...
a, b, x = map(int,input().split())
_a = a//x
m_a = a%x
_b = b//x
if m_a == 0:
print(_b - _a + 1)
else:
print(_b - _a) |
p03861 | s912836911 | Accepted |
a, b, x = map(int,input().split())
print(b // x - (a - 1) // x) |
p03861 | s365244531 | Accepted | a,b,x=map(int,input().split())
if a<=b<x:
if a==0:
print(1)
else:
print(0)
else:
s=(a-1)//x
t=b//x
print(t-s)
|
p03861 | s551095132 | Accepted | a,b,c=map(int,input().split())
mini = 0
m = a % c
if m == 0:
mini = a/c
else:
mini = (c-m + a)/c
maxi = 0
M = b % c
if M == 0:
maxi = b//c
else:
maxi = (b-M)//c
res = int(maxi) - int(mini) + 1
print(res) |
p03861 | s596169449 | Accepted | a, b, x = map(int, input().split())
print(b//x - (a-1)//x)
|
p03861 | s342406797 | Accepted | # ABC 048: B – Between a and b ...
a, b, x = map(int, input().split())
print(b // x - (a - 1) // x) |
p03861 | s140880343 | Accepted | a,b,k = map(int,input().split())
temp =(a - 1 )//k
if a == 0:
temp = -1
print(b//k - temp) |
p03861 | s734428034 | Accepted | import math
a, b, x = map(int, input().split())
xa = -(-a // x)
xb = b // x
print(xb - xa + 1) |
p03861 | s648899795 | Accepted | a,b,x = map(int,input().split())
ans = 0
ad = a//x*x
bd = b//x*x
if ad == a:
ans += 1
ans += (bd - ad) // x
print(ans) |
p03861 | s127613894 | Accepted | a, b, x = map(int, input().split())
print(b // x - a // x + (1 if a % x == 0 else 0)) |
p03861 | s774455409 | Accepted | a,b,x = map(int,input().split())
ansa = 0
if a==0:
ansa=-1
else:
ansa=(a-1)//x
ansb = b//x
print(ansb-ansa) |
p03861 | s637380310 | Accepted | a,b,x = map(int,input().split())
t = b//x
if a == 0:
print(t+1)
else:
print(t-(a-1)//x) |
p03861 | s278058511 | Accepted | a, b, x = map(int, input().split())
def f(n):
if n == -1:
return 0
return n // x + 1
print(f(b)-f(a-1)) |
p03861 | s426293016 | Accepted | a,b,x = map(int,input().split())
q_b = b//x
q_a = a//x
r_a = a%x
if x==1:
print(b-a+1)
else:
if r_a == 0:
print(q_b-q_a + 1 )
else:
print(q_b-q_a) |
p03861 | s109262353 | Accepted | def sol(x,m):
if x<=0:
return 0
else:
return x//m
a,b,n = map(int,input().split())
if a==0:
print(sol(b,n)+1)
# elif a==1:
# print(sol(b,n))
else:
print(sol(b,n)-sol(a-1,n)) |
p03861 | s902220674 | Accepted | a,b,x = map(int, input().split())
print(b//x-(a-1)//x) |
p03861 | s162216836 | Accepted | a, b, x = map(int, input().split())
print( b//x - (a-1)//x) |
p03861 | s952964342 | Accepted | a, b, x = map(int, input().split())
ans = b//x - a//x
if a % x == 0:
ans += 1
print(ans)
|
p03861 | s357046417 | Accepted | a,b,x = map(int,input().split())
print(b//x - (a-1)//x) |
p03861 | s172084902 | Accepted | a,b,x = map(int,input().split())
print((b//x)-(a//x)+(a%x == 0)) |
p03861 | s081445777 | Accepted | a, b, x = map(int, input().split())
start=a
if (a%x!=0):
start=a+x-a%x
print(len(range(start, b+1, x)))
|
p03861 | s258967431 | Accepted | a, b, x = map(int,input().split())
ans = b // x - a // x
if (a % x == 0):
ans += 1
print(ans)
|
p03861 | s692502038 | Accepted | A,B,X = map(int,input().split())
mA, mB = (A-1) // X, B // X
print(mB-mA) |
p03861 | s499354254 | Accepted | a,b,x=map(int,input().split())
def f_mod(a,x):
return a//x+1
print(f_mod(b,x)-f_mod(a-1,x)) |
p03861 | s104299971 | Accepted | # -*- coding: utf-8 -*-
"""
Created on Sat May 30 12:02:39 2020
@author: naoki
"""
a,b,x = map(int,input().split()) # 整数a,b及び割る数xを入力
if a!=0:
print((b//x+1) - ((a-1)//x+1))
else:
print(b//x + 1) |
p03861 | s442385302 | Accepted | if __name__ == '__main__':
# n = int(input())
a, b, x = map(int, input().split())
c = b//x - a//x
if a%x == 0:
c = c+1
print(c)
|
p03861 | s961989426 | Accepted | a,b,x = map(int, input().split())
b=b//x + 1
if a!=0:
a=(a-1)//x + 1
print(b-a) |
p03861 | s210347648 | Accepted | a, b, x = map(int,input().split())
print(b//x - (a-1)//x) |
p03861 | s196156380 | Accepted | a,b,x = map(int,input().split())
result = b//x - a//x
if a%x == 0:
result +=1
print(result) |
p03861 | s171479833 | Accepted | a, b, x = map(int, input().split())
an = a%x
if an != 0:
an = x - an
if a + an > b:
ans = 0
else:
ans = (b-a-an)//x + 1
print(ans) |
p03861 | s541340447 | Accepted | a,b,x=map(int,input().split())
print(b//x-(a-1)//x) |
p03861 | s911537307 | Accepted | import math
from decimal import Decimal
a, b, x = list(map(int, input().split()))
print(math.floor(Decimal(b)/x) - math.ceil(Decimal(a)/x) + 1) |
p03861 | s084782938 | Accepted | a,b,x=map(int,input().split())
if a%x==0:
print(b//x-a//x+1)
else:
print(b//x-a//x) |
p03861 | s504097511 | Accepted | a,b,x = map(int, input().split())
print(b//x-(a-1)//x) |
p03861 | s714555340 | Accepted | a,b,x=map(int,input().split())
#a以上b以下でxで割り切れる個数
a_ans=(a-1)//x
b_ans=b//x
print(b_ans-a_ans) |
p03861 | s506307749 | Accepted | a, b, x = map(int, input().split())
a = -(-a // x) * x
b = (b // x) * x
print(max(0, (b - a) // x + 1)) |
p03861 | s248871842 | Accepted | a,b,x = map(int,input().split())
print(b//x - (a-1)//x) |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.