Problem:


Score : 100 points

Problem Statement

There are S sheep and W wolves.

If the number of wolves is greater than or equal to that of sheep, the wolves will attack the sheep.

If the wolves will attack the sheep, print unsafe; otherwise, print safe.

Constraints

1 \leq S \leq 100

1 \leq W \leq 100

Input

Input is given from Standard Input in the following format:

S W

Output

If the wolves will attack the sheep, print unsafe; otherwise, print safe.

Sample Input 1

4 5

Sample Output 1

unsafe

There are four sheep and five wolves. The number of wolves is not less than that of sheep, so they will attack them.

Sample Input 2

100 2

Sample Output 2

safe

Many a sheep drive away two wolves.

Sample Input 3

10 10

Sample Output 3

unsafe



Sample input:
4 5


Sample output:
unsafe

Submission status: Runtime Error

Solution code:
S,W = input()
    if S < W
        print('unsafe'):
    else S > W
        print('safe'):

Submission status: Runtime Error

Solution code:
S,W = input()
    if S < W
        print('unsafe')
    else S > W
        print('safe')

Submission status: Runtime Error

Solution code:
s=input()

d=[0]*2019
dp=0
d[0]+=1
l=len(s)

for i in range(l-1,-1,-1):
	dp = (dp+int(s[i])*(10**(l-1-i)))%2019
	d[dp]+=1
res=0

for a in d:
	res+=a*(a-1)//2
	
print(res)

Submission status: Runtime Error

Solution code:
s,w = map(int,input.split())
if s > w:
  print("saffe")
else:
  print("unsafe")

Submission status: Runtime Error

Solution code:
s,w=map(int,input().split())
if n <= m:
  print('unsafe')
else:
  print('safe')

Submission status: Runtime Error

Solution code:
n,m =map(int.input().split())

if n <= m:
  print('unsafe')
else:
  print("safe")

Submission status: Runtime Error

Solution code:
S=int(input("羊の数を入力"))
W=inr(input("狼の数を入力"))
if W>=S:
   print("unsafe")
else:
   print("safe")

Submission status: Runtime Error

Solution code:
A, B, C, D = map(int,input().split())

while(A or C != 0):
    C = C - B
    if(C <= 0):
        print("Yes")
        break
    A = A - D
    if(A <= 0):
        print("No")
        break

Submission status: Runtime Error

Solution code:
from collections import deque
from collections import Counter
S = list((input()))
A = deque([0])
B = deque([])
for i in range(len(S)):
    n = int(''.join(S[len(S)-2-i:]))
    A.append(n)
for j in A:
    B.append(j%2019)
C = Counter(B)
cnt= 0
for v in C.values():
    cnt += v*(v-1)//2
print(cnt)

Submission status: Runtime Error

Solution code:
import sys
sys.setrecursionlimit(10000000)
s=input()
n=len(s)
def mod10(x):
    p=x//10000000
    q=x-10000000*p
    if p==0:
        return (10**q)%2019
    return ((10**q)*mod10(p))%2019

def T(i):
    if i==n-1:
        return int(s[n-1])
    return T(i+1)+10**(n-1-i)*int(s[i])
dict={}
def modi(i,dict):
    if i in dict.keys():
        return dict[i]
    else:
        if i==n-1:
            dict[i]=int(s[i])
            return int(s[i])
        else:
           # c=modi(i+1,dict)+(10**(n-1-i)*int(s[i]))
            c=modi(i+1,dict)+(mod10(n-1-i)*int(s[i]))
            c=c%2019
            dict[i]=c
            return c

modnum={}
for i in range(n):
    #print(T(i))
    if int(s[i])==0:
        continue
    x=modi(i,dict)
 #   print(T(i),x)
    if x not in modnum.keys():
        modnum[x]=1
    else:
        modnum[x]+=1
sum=0
for md in modnum.keys():
    a=modnum[md]
    if md==0:
        sum+=a
        sum+=-(a*(a-1)//2)
   # print(a*(a-1)//2)
    sum+=a*(a-1)//2
#print(modnum)
print(sum)

Submission status: Runtime Error

Solution code:
S,W=map(int,input().split())
if S <= W:
  print('unsafe')
else
  print('safe')

Submission status: Runtime Error

Solution code:
S,W=map(int,input.split())
if S <= W:
  print('unsafe')
else
  print('safe')

Submission status: Runtime Error

Solution code:
s, w = int(input().split)

if w >= s:
  print('unsafe')
else:
  print('safe')

Submission status: Runtime Error

Solution code:
s, w = int(input().split)

if w <= s:
  print('unsafe')
else:
  print('safe')

Submission status: Runtime Error

Solution code:
S, W = map(int, input().split())
if S =< W:
  print("unsafe")
else:
  print("safe")

Submission status: Runtime Error

Solution code:
S = input()
n = len(S)
dp = {0:1}
q = 1
p = 0
for i in range(n):
    p += int(S[n-1-i])*q
    q *= 10
    q = q % 2019
    p = p % 2019
    if p not in dp:
        dp[p] = 1
    else:
        dp[p] += 1
print(dp)
print(sum(dp[i]*(dp[i]-1)//2 for i in dp))

Submission status: Runtime Error

Solution code:
import collections
s_str = input()
s = [int(s_str[i]) for i in range(len(s_str))] #リスト型に文字列を格納します
n = len(s_str)
s_block = []
for k in range(n):
    a = sum(s[i]*10**(n-i-1) for i in range(k,n)) % 2019
    s_block.append(a)
s_dict = list(dict(collections.Counter(s_block)).values())
ans = sum(s_dict[i]*(s_dict[i]-1)/2 for i in range(len(s_dict)))
print(int(ans))

Submission status: Runtime Error

Solution code:
1 2
a, b= map(int , input().split())
print (a)
print (b)
unsafe
s = input()
print(s)

Submission status: Runtime Error

Solution code:
import math
A, B, C, D = map(int,input().split())
hpa = math.ceil(A / D)
hhb = math.ceil(C / B)
if (hpa >= hpb):
    print('Yes')
else:
    print('No')

Submission status: Runtime Error

Solution code:
S,W=int(input()),int(input())
if S <= W:
  print('unsafe')
else:
  print('safe')

Submission status: Runtime Error

Solution code:
def main():
    S = input()[::-1]
    ans = 0
    mods = [0] * 2019
    mods[0] = 1
    current = 0
    x = 1
    for s in S:
        current = (current + x * int(s)) % 2019
        mods[current % 2019] += 1
        x = x * 10 %2019
    
    for i in len(mods):
        ans += mods[i] * (mods[i]-1)//2
 
if __name__ == '__main__':
    main()

Submission status: Runtime Error

Solution code:
# -*- coding: utf-8 -*-

N = int(input())

hash = [[0], [0], [0], [0], [0], [0], [0], [0], [0], [0]]

count=0
b=0
for i in range(N):
    b=0
    S = input()
    for j in range(len(hash[len(S)-1])):
        #print("{} {}".format(j,hash[len(S)-1][j]))
        if  hash[len(S)-1][j] == S:
            b=1
    if b==0:
        hash[len(S)-1].append(S)
        count=count+1

#print("{}".format(hash))
print("{}".format(count))

Submission status: Runtime Error

Solution code:
n = int(input())
d = []
for i in range(n):
    s = input()
    if not(s in d): d.append(s)

print(len(d))

Submission status: Runtime Error

Solution code:
import math

a,b,c,d=map(int,input().split())
x=int((a+d-1)/d)
y=int((c+b-1)/c)
 
if x>=y:
  print("Yes")
else:
  print("No")

Submission status: Runtime Error

Solution code:
a,b,c,d=map(int,input().split())
x=int((a+d-1)/d)
y=int((c+b-1)/c)
 
if x>=y:
  print("Yes")
else:
  print("No")

Submission status: Runtime Error

Solution code:
a,b,c,d=map(int,input().split())
x=(a+d-1)/d
y=(c+b-1)/c
 
if x>=y:
  print("yes")
else:
  print("no")

Submission status: Runtime Error

Solution code:
a,b,c,d=map(int,input().split())
x=float(a-1/d)
y=float(c-1/b)

if x>=y:
  print("yes")
else:
  print("no")

Submission status: Runtime Error

Solution code:
a,b,c,d=map(int,input().split())
x=float(a/d)
y=float(c/b)

if x>=y:
  print("yes")
else:
  print("no")

Submission status: Runtime Error

Solution code:
j,k = input()
if  j > k
print("safe")
else 
print("unsafe")

Submission status: Runtime Error

Solution code:
S = str(input())

data = []

count = 0
for i in range(len(S)):
    for j in range(i+4, min(i+9,len(S)+1)):
        if(int(S[i:j]) % 2019 == 0):
            count += 1
            data.append([i,j])

for i in range(len(data) - 1):
    if(data[i][1] == data[i+1][0]):
        count += 1

print(count)

Submission status: Runtime Error

Solution code:
S = str(input())

data = []

count = 0
for i in range(len(S)):
    for j in range(i+4, min(i+7,len(S)+1)):
        if(int(S[i:j]) % 2019 == 0):
            count += 1
            data.append([i,j])

for i in range(len(data) - 1):
    if(data[i][1] == data[i+1][0]):
        count += 1

print(count)

Submission status: Runtime Error

Solution code:
S = int(input())

W = int(input())

if W >= S:
    print("unsafe")
else:
    print("safe")

Submission status: Runtime Error

Solution code:
if W >= S:print('unsafe')
else: print('safe')

Submission status: Runtime Error

Solution code:
S = int(input())

W = int(input())

if W >= S:
  print("unsafe")
else:
  print("safe")

Submission status: Runtime Error

Solution code:
S = int(input())

W = int(input())

if W >= S:
  print("unsafe")
  
else:
  print("safe")

Submission status: Runtime Error

Solution code:
S = int(input())

W = int(input())

if W >= S/2:
  print("unsafe")
  
else:
  print("safe")

Submission status: Runtime Error

Solution code:
S = int(input())

W = int(input())

if S >= W/2:
  print("unsafe")
  
else:
  print("safe")

Submission status: Runtime Error

Solution code:
import math
a,b,c,d = map(int,input().split())

cb = -(-c//d)
ad = -(-a//d)
if ad < cb :
    print('No')
else:
    print('Yes')

Submission status: Runtime Error

Solution code:
S, W = int(input())
if S > W:
	print('safe')
else:
	print('unsafe')

Submission status: Runtime Error

Solution code:
import sys
def main():
	A,B,C,D = map(int, input().split())
	while True:
		C - B
		if C <= 0:
			print("Yes")
		A - D
		if A <= 0:
			print("No")
			sys.exit()
main()

Submission status: Runtime Error

Solution code:
S,W = map(int, input().split())
if W >= S:
 print('unsafe')
else
 print('safe')

Submission status: Runtime Error

Solution code:
S=input() W=input()
print("unsafe" if int(W) >= int(S) else "safe")

Submission status: Runtime Error

Solution code:
S = input() W = input()
if(int(W)>=int(S)):
  print('unsafe')
else:
  print('safe')

Submission status: Runtime Error

Solution code:
a,b = map(int,input().split())
if b > a:
    priant("unsafe")
elif a > b:
    print("safe")

Submission status: Runtime Error

Solution code:
N=int(input())
S=[input() for i in range(N)]
print(len(set(S)))

Submission status: Runtime Error

Solution code:
suuji = list(input())
count = 0
for i in range(0, len(suuji)):
  for j in range(i+3, len(suuji) + 1):
    if (int)(''.join(suuji[i:j])) % 2019 == 0:
      count += 1
print(count)

Submission status: Runtime Error

Solution code:
s,w = map(int,input().split())

if s<=W:
  print('unsafe')
else:
  print('safe')

Submission status: Runtime Error

Solution code:
S, W = map(int, input().split())
if S > W:
  print("safe")
  else:
    print("unsafe")

Submission status: Runtime Error

Solution code:
X=input()
a=list()
for i in range(len(X)):
    a.append(int(X[i:len(X)])%2019)
S=a.count(0)
for j in range(1,2018):
    b=a.count(j)
    S+=int(b*(b-1)/2)
print(S)

Submission status: Runtime Error

Solution code:
import sys
from collections import deque
from collections import defaultdict
import math
import copy
#input = sys.stdin.readline
sys.setrecursionlimit(20000000)
s = input()
s = s[::-1]
n = len(s)
dp = [0]*(n+1)
k = 1
a = defaultdict(int)
a[0]+=1
for i in range(n):
  dp[i] = (dp[i-1]+int(s[i])*k)%2019
  k*=10
  k%=2019
  a[dp[i]] += 1
ans = 0
for i in a.keys():
  ans += a[i]*(a[i]-1)/2
print(int(ans))

Submission status: Runtime Error

Solution code:
A, B, C, D = map(int, input().split())

for _ in range(10000):
  C -= B
  if C <= 0:
    print("Yes")
    exit()

  A -= D
  if A <= 0:
    print("No")
    exit()

Submission status: Runtime Error

Solution code:
S,W = map(int, input.split())

        if S > W :
            print("safe")
        else :
            print("unsafe")

Submission status: Runtime Error

Solution code:
s,w = map(int,input().split())
 
if s > w:
  print(safe)
else:
  print(unsafe)

Submission status: Runtime Error

Solution code:
s_str = input()
# print(s_str)
# print(type(s_str))
# print()

# s_len = len(s_str)
# print(s_len)
# print(type(s_len))
# print()

list = []
for i in range(len(s_str)-1):
  s_new = s_str[i]
  # print('i=' + str(i))
  for j in range(i, len(s_str)):
    # print(s_new)
    if int(s_new) % 2019 == 0:
      # print('2019 * n number.')
      list.append(s_new)
    j = j + 1
    if j == len(s_str):
      break
    else:
      s_new = s_new + s_str[j]
  # print()
  i = i + 1

# print()
# print(list)
print(len(list))

Submission status: Runtime Error

Solution code:
s,w = map(int,input().split())

if s >= w:
  print(safe)
else:
  print(unsafe)

Submission status: Runtime Error

Solution code:
A,B,C,D=map(int,input().split())
while A>0:
  C-=B
  if C<=0:
    print("Yes")
    exit()
  A-=D
print("No")

Submission status: Runtime Error

Solution code:
def main():
    s = input()
    c = 0
    for i in range(len(s)-3):
        for j in range(i+3, len(s)):
            if int(s[i:j+1]) % 2019 == 0:
                c += 1

    print(c)

if __name__ == '__main__':
    main()

Submission status: Runtime Error

Solution code:
A, B, C, D = map(int, input().split())
if (C//B) < (A//D):
  print("No")
else:
  print("Yes")

Submission status: Runtime Error

Solution code:
S = int(input())
W = int(input())
if S <= W :
  print('unsafe')
else :
  print('safe')

Submission status: Runtime Error

Solution code:
S = int(input())
W = int(input())
if S <= W:
  print('unsafe')
else:
  print('safe')

Submission status: Runtime Error

Solution code:
うんし

Submission status: Runtime Error

Solution code:
S, W = map(int, input().split())if W >= S:  print("unsafe")else:  print("safe")

Submission status: Runtime Error

Solution code:
S, W = map(int, input().split())

if W &gt;= S:
  print("unsafe")
else:
  print("safe")

Submission status: Runtime Error

Solution code:
n,b=input().split()
n,b=int(n),int(b)
def b(n,b):
    return "safe" if n>b else "No"
print(b(n,b))

Submission status: Runtime Error

Solution code:
n,b=input().split()
def b(n,b):
    return "safe" if n>b else "No"
print(b(n,b))

Submission status: Runtime Error

Solution code:
s, w = map(int, input().split())

if(s>w):
    print('safe')
else
    print('unsafe')

Submission status: Runtime Error

Solution code:
s, w = map(int, input().sprit())

if(s>w):
    print('safe')
else
    print('unsafe')

Submission status: Runtime Error

Solution code:
s, w = map(int, input().sprit())

if(s>=w):
    print(safe)
else
    print(unsafe)

Submission status: Runtime Error

Solution code:
S=int(input())
W=int(input())
if S>W:
  print("safe")
else:
  print("unsafe")

Submission status: Runtime Error

Solution code:
if S > W:
  print('safe')
  else:
    print('safe')

Submission status: Runtime Error

Solution code:
a,b,c,d = (int(x) for x in input().split())

x=int(a/d)+1
y=int(b/c)+1

if x>=y:
    print("Yes")
else:
    print("No")

Submission status: Runtime Error

Solution code:
import sys
import math


def main():
    input = sys.stdin.readline
    a, b = (int(i) for i in input().split())
    if a <= b:
        print("unsafe")
    else:
        print("safe)


main()

Submission status: Runtime Error

Solution code:
def is_safe(s, w):
  if w >= s:
    print("unsafe")
  else:
    print("safe")
    
 s, w = list(map(int, input().split()))
is_safe(s, w)

Submission status: Runtime Error

Solution code:
s,w=int(input()),int(input())
if w>=s:
  print("unsafe")
else:
  print("safe")

Submission status: Runtime Error

Solution code:
s=input()
w=input()
ss=int(s)
ww=int(w)
if ww>=ss:
  print("unsafe")
else:
  print("safe")

Submission status: Runtime Error

Solution code:
s = int(input())
w = int(input())

if s > w:
  print("safe")
  
  
else:
  print("unsafe")

Submission status: Runtime Error

Solution code:
s = int(input("羊の数"))
w = int(input("狼の数"))

if s > w :
  print("safe")
  
else:
  print("unsafe")

Submission status: Runtime Error

Solution code:
if W>=S:
  print("unsafe")
else:
  print("safe")

Submission status: Runtime Error

Solution code:
s = input()[::-1]
length = len(s)
a = [0] * length
d = [0] * length
ans = [0] * 2019
x = 10

a[0] = int(s[0])
d[0] = a[0]
ans[d[0]] += 1

for i in range(1, length):
    a[i] = int(s[i]) * x % 2019
    d[i] = (d[i-1] + a[i]) % 2019
    ans[d[i]] += 1
    x = x * 10 % 2019

print(int(sum([ans[i] * (ans[i]-1) for i in range(2019)]) / 2) + ans[0])

Submission status: Runtime Error

Solution code:
import sys

def main():
    args = sys.argv
    if int(args[0]) <= int(args[1]):
        print("unsafe")
    else:
        print("safe")

if __name__ == "__main__":
    main()

Submission status: Runtime Error

Solution code:
import sys

def main():
    args = sys.argv
    if int(args[1]) <= int(args[2]):
        print("unsafe")
    else:
        print("safe")

if __name__ == "__main__":
    main()

Submission status: Runtime Error

Solution code:
N = int(input())
l = []
for i in range(N):
  Si = input()
  if not Si in l:
    l.append(Si)
print(len(l))

Submission status: Runtime Error

Solution code:
S = input(str())
W = input(str())

if S > W:
    print('safe')

elif S < W:
    print('unsafe')

Submission status: Runtime Error

Solution code:
S, W = map(int, input().split())
if W >= S:
	print(unsafe)
else:
	print(safe)

Submission status: Runtime Error

Solution code:
S = input()[::-1]
n = len(S)
dp = [0]*2019
dp[0] = 1
X = 0
Y = 1
for s in S:
    Z=(int(s)*Y)%2019
    X = (X+Z)%2019
    dp[X] += 1
    Y *= 10
    Y %= 2019
answer = 0
for i in range(2019):
    answer += dp[i]*(dp[i]-1)/2
print(int(answer))

Submission status: Runtime Error

Solution code:
a

Submission status: Runtime Error

Solution code:
S, W = map(int, input().split())
if S <= w:
	print("unsafe")
else:
    print("safe")

Submission status: Runtime Error

Solution code:
S, W = map(int, input().split())
if S <= W 
	print("unsafe")
else:
    print("safe")

Submission status: Runtime Error

Solution code:
def main():
    s=input()
    c=0
    for i in range(len(s)):
        for j in range(i+5, len(s)+1):
            if int(s[i:j])%2019==0:
                c+=1
    print(c)
main()

Submission status: Runtime Error

Solution code:
S = int(input())
W = int(input())
if S <= W :
  print("unsafe")
else:
  print("safe")

Submission status: Runtime Error

Solution code:
S,W = int(input())
if S <= W : print("unsafe")
else: print("safe")

Submission status: Runtime Error

Solution code:
S = int(input())
W = int(input())
if S <= W : print("unsafe")
else: print("safe")

Submission status: Runtime Error

Solution code:
s, w = map(int, input().split())
if (s <= w):
  print('unsafe')
 else:
  print('safe')

Submission status: Runtime Error

Solution code:
S = int(input())
W = int(input())
if S <= W : print("safe")
else: print("unsafe")

Submission status: Runtime Error

Solution code:
S = int(input())
W = int(input())
if S >= W : print('safe')
else: print('unsafe')

Submission status: Runtime Error

Solution code:
S = int(input())
W = int(input())
if S >= W : print("safe")
else: print("unsafe")

Submission status: Runtime Error

Solution code:
s = input()
b = len(s)
c = 0
f = 0
while True:
    if f == b:
        break
    elif b - f <= 2:
        f = 0
        b -= 1
    else:
        if int(s[f:b]) % 2019 == 0:
            c += 1
            f += 1
        else:
            f += 1
print(c)

Submission status: Runtime Error

Solution code:
S, W = map(int, input().split())
if W>=S:
  print("unsafe")
 else:
  print("safe")

Submission status: Runtime Error

Solution code:
  1 SW = list(map(int,input().split()))
SW = list(map(int,input().split()))
if (SW[0] > SW[1]):
  print("safe")
else:
  print("unsafe")

Submission status: Runtime Error

Solution code:
S = int(input())
W = int(input())
if (S > W):
  print("safe")
else:
  print("unsafe")

Submission status: Runtime Error

Solution code:
python3 make.py abc 999 --num 6

S, W = [int(x) for x in input().split()]

if S > W:
  print('safe')
else:
  print('unsafe')

Submission status: Runtime Error

Solution code:
S = input(str())
W = input(str())

if S > W:
    print('safe')

elif S < W:
    print('unsafe')

Submission status: Runtime Error

Solution code:
S, W = list(map(int, input().split))

if W >= S:
  print("unsafe")

else:
  print("safe")

Submission status: Runtime Error

Solution code:
S,W=int(input().split())
if W>=S:
    print("unsafe")
else:
    print("safe")

Submission status: Runtime Error

Solution code:
# -*- encode utf-8 -*-
#羊の数と狼の数を入力
S,W = int(input())
狼の数が羊の数以上のとき、羊は狼に襲われてしまいます。
if 2W >= S:
	print(unsafe)
else:
	print(safe)

Submission status: Runtime Error

Solution code:
N = int(input())
S = [int(input()) for _ in N]
print(len(set(s)))

Submission status: Runtime Error

Solution code:
A,B,C,D = map(int,input().split())
while A > 0 and C > 0:
    C -= B
    if C <= 0:
        print("Yes")
    else:
        A -= D
        if A <= 0:
            print("No")

Submission status: Runtime Error

Solution code:
x = list(map(int,input().split()))
if x[0] < x[1] :
  print("safe")
  else:
    print("unsafe")

Submission status: Runtime Error

Solution code:
S, W = input().split()
if int(S) =< int(W):
  print("safe")
else:
  print("unsafe")

Submission status: Runtime Error

Solution code:
s, w = map(int, input().split()) # split()で空白区切りでリスト化、その際map()でint型にキャストし変数に代入。
if s > w
	print("safe")
else
	print("unsafe")

Submission status: Runtime Error

Solution code:
s, w = map(int, input().split()) # split()で空白区切りでリスト化、その際map()でint型にキャストし変数に代入。
if s > w
	print ("safe")
else print ("unsafe")

Submission status: Runtime Error

Solution code:
from sys import stdin

s = int(stdin.readline().rstrip())

sl = len(str(s))
cnt = 0

for i in range(sl - 3):
    for j in range(i + 3, sl):
        num = s % (10 ** (sl - i)) // (10 ** (sl - j - 1))
        if num % 2019 == 0 and num > 0:
            cnt += 1

print(cnt)

Submission status: Runtime Error

Solution code:
n = int(input())
s = []
for _ in range(n):
  s.append(input())
print(len(set(s))

Submission status: Runtime Error

Solution code:
import numpy as np


def count_multi(s, d):
  m = a = np.array([int(c) for c in s])  # .astype(np.int)
  keta = 1
  count = np.count_nonzero(m == 0)
  while len(m) > 1:
    m = (m[:-1]*10 + a[keta:]) % d
    keta += 1
    count += np.count_nonzero(m == 0)
  return count
        
print(count_multi(input().strip(), 2019))

Submission status: Runtime Error

Solution code:
import numpy as np


def count_multi(s, d):
  m = a = np.array([c for c in s]).astype(np.int)
  keta = 1
  count = np.count_nonzero(m == 0)
  while len(m) > 1:
    m = (m[:-1]*10 + a[keta:]) % d
    keta += 1
    count += np.count_nonzero(m == 0)
  return count
        
print(count_multi(input().strip(), 2019))

Submission status: Runtime Error

Solution code:
import numpy as np


def count_multi(s, d):
  a = np.array([c for c in s]).astype(np.int)
  m = a  # % d
  keta = 1
  count = np.count_nonzero(m == 0)
  while len(m) > 1:
    m = (10*m[:-1] + a[keta:]) % d
    keta += 1
    count += np.count_nonzero(m == 0)
  return count
        
print(count_multi(input().strip(), 2019))

Submission status: Runtime Error

Solution code:
a = input("羊の数")
b = input("狼の数")

S = int(a)
W = int(b)

if S <= W:
  print("unsafe")
else:
  print("safe")

Submission status: Runtime Error

Solution code:
a,b,c,d=map(int,input().split())
while a or c >0:
  c=c-b
  if c<=0:
    print('Yes')
    break
  a=a-d
  if a<=0:
    print('No')
    break

Submission status: Runtime Error

Solution code:
S,W=map(int, input().split())
 
if S>W:
	print("safe")
if S<W:
	print("unsafe")
if S=W:
	print("unsafe")

Submission status: Runtime Error

Solution code:
S=int(input())
W=10
 
if S>W:
	print("safe")
if S<W:
	print("unsafe")
if S=W:
	print("unsafe")

Submission status: Runtime Error

Solution code:
S=int(input())
W=10

if S>W:
	print("safe")
if S<W:
	print("unsafe")

Submission status: Runtime Error

Solution code:
S=input()
W=10
if S>W:
	print("safe")
if W>S:
	print("unsafe")

Submission status: Runtime Error

Solution code:
strS = input()
S = int(strS)
lenS = len(strS)
 
ans = 0
for i in range(lenS - 3):
    for j in range(i+3, lenS):
#        print(i,j)
        if int(strS[i:j+1])%2019 == 0:
#            print(int(str(S)[i:j]), i, j)
            ans += 1
print(ans)

Submission status: Runtime Error

Solution code:
strS = input()
S = int(strS)
lenS = len(strS)

ans = 0
for i in range(lenS):
    if i+3 <= lenS:
        for j in range(i+3, lenS):
#            print(i,j)
            if int(strS[i:j+1])%2019 == 0:
#                print(int(str(S)[i:j]), i, j)
                ans += 1
print(ans)

Submission status: Runtime Error

Solution code:
S = int(input())
lenS = len(str(S))

ans = 0
for i in range(lenS):
    if i+3 <= lenS:
        for j in range(i+3, lenS):
#            print(i,j)
            if int(str(S)[i:j+1])%2019 == 0:
#                print(int(str(S)[i:j]), i, j)
                ans += 1
print(ans)

Submission status: Runtime Error

Solution code:
s,w =int(input())
if w>=s:
  print('UNSAFE')
else:
  print("SAFE")

Submission status: Runtime Error

Solution code:
def main():

    n = int(input())
    db = []
    kinds = 0

    for i in range(10):
        tmp = []
        db.append(tmp)

    for i in range(n):
        str = input()
        num = len(str)

        if(not(str in db[num-1])):
            db[num-1].append(str)
            kinds = kinds + 1

    print(kinds)

main()

Submission status: Runtime Error

Solution code:
a = list(map(int,input().split()))
 
A = a[0]
B = a[1]
C = a[2]
D = a[3]
 
while B>0 and D>0:
  D = D - A
  if D <= 0:
    print("No")
    break
  B = B - D
  if B <= 0:
    print("Yes")
    break

Submission status: Runtime Error

Solution code:
s,w = map(input().split(), int)
print("unsafe" if w >= s else "safe")

Submission status: Runtime Error

Solution code:
s = int(input())
w = int(input())
print "unsafe" if w>=s else "safe"

Submission status: Runtime Error

Solution code:
S,W = map(int,input().split)
if S >= W:
  print('unsafe')
else:
  print('safe')

Submission status: Runtime Error

Solution code:
S = input()
n = len(S)
dp = [0 for _ in range(n+1)]
count = [0 for _ in range(2019)]
count[0] = 1
for i in range(1,n+1):
    dp[i] = (dp[i-1]+int(S[n-i])*10**(i-1)) % 2019
    count[dp[i]] += 1

for i in range(2019):
    count[i] = count[i]*(count[i]-1)/2

print(int(sum(count)))

Submission status: Runtime Error

Solution code:
In [93]: s, w  = map(int,input().split()) 
    ...: if s <= w: 
    ...:     print("unsafe") 
    ...: else : 
    ...:     print("safe")

Submission status: Runtime Error

Solution code:
In [93]: s, w  = map(int,input().split()) 
    ...: print("{} {}".format(s,w)) 
    ...: if s <= w: 
    ...:     print("unsafe") 
    ...: else : 
    ...:     print("safe")

Submission status: Runtime Error

Solution code:
S = int(input())
W = int(input())
if W >= S :
    print('unsafe')
else :
    print('safe')

Submission status: Runtime Error

Solution code:
s,w=map(int,input().split())
 
if s>w:
	return("safe")
else:
	return("unsafe")

Submission status: Runtime Error

Solution code:
s,w=map(int(),input().split())
 
if s>w:
	return("safe")
else:
	return("unsafe")

Submission status: Runtime Error

Solution code:
s,w=map(int(),input().split())
 
if s>w:
  print("safe")
else:
  print("unsafe")

Submission status: Runtime Error

Solution code:
s,w=map(int(),input().split())
 
if s>w:
  return("safe")
else:
  return("unsafe")

Submission status: Runtime Error

Solution code:
s,w=map(int(),input().split())

if s>w:
  return "safe"
else:
  return "unsafe"

Submission status: Runtime Error

Solution code:
a, b, c, d = map(int, input().split())
takahashi = [a, b] if a>b else [b, a]
aoki = [c, d] if c>d else [d, c]
attackers = [takahashi, aoki]
attacker = 0

while 0 not in takahashi and 0 not in aoki:
  attackers[attacker^1][1] = max(0, attackers[attacker^1][1]-attackers[attacker][0])
  attackers[attacker^1].sort(reverse=True)
  attacker = attacker^1

if 0 in attackers[0]:
  print('No')
else:
  print('Yes')

Submission status: Runtime Error

Solution code:
s = input()
w = input()
if s <= w:
    print("unsafe")
else:
    print("safe")

Submission status: Runtime Error

Solution code:
s=input();c=0
for i in range(len(s)):
    for j in range(1,len(s)+1):
        if s[i:j]:
            if int(s[i:j])%2019==0:
                c+=1
print(c)

Submission status: Runtime Error

Solution code:
s,w=map(int,input().split())
if s <= w:
  print("unsafe")
 else:
  print("safe")

Submission status: Runtime Error

Solution code:
import tensorflow
S, W = map(int, input().split())
def f():
  if W >= S:
    return "unsafe"
  else:
    return "safe"
print(f())

Submission status: Runtime Error

Solution code:
s = input()
 
counter_list = [0] * 2019
counter_list[0] = 1
cumulative_sum_list = [0] * (len(s) + 1)
 
for i in range(len(s)):
    cumulative_sum_list[i + 1] = int(s[len(s)-i-1:len(s)]) % 2019
    counter_list[cumulative_sum_list[i + 1]] += 1
 
ans = 0
 
for i in counter_list:
    ans += i * (i - 1) // 2

Submission status: Runtime Error

Solution code:
s, w = input()
if s <= w:
  print('unsafe')
else:
  print('safe')

Submission status: Runtime Error

Solution code:
import sys
args = sys.argv

s = int(args[0])
w = int(args[1])

if s <= w:
    print('unsafe')
else:
    print('safe')

Submission status: Runtime Error

Solution code:
s=int(input())
w=int(input())
if s>w:
  print("safe")
else:
  print("unsafe")

Submission status: Runtime Error

Solution code:
S=input()
count=0
#S3=''

#for i in range(len(S)):
#    S3+=str(int(S[i])%3)
for i in range(0,len(S)-4):
    check3=int(S[i])+int(S[i+1])+int(S[i+2])+int(S[i+3])
    for j in range(i+5,len(S)+1):
        check3+=int(S[j-1])
        check3%=3
        if check3==0:
            if int(S[i:j])%673==0:
                count+=1
                
print(str(count))

Submission status: Runtime Error

Solution code:
S=input()
count=0

for i in range(0,len(S)-4):
    check3=int(S[i])+int(S[i+1])+int(S[i+2])+int(S[i+3])
    for j in range(i+5,len(S)+1):
        check3+=int(S[j-1])
        check3%=3
        if check3==0:
            if int(S[i:j])%673==0:
                count+=1
                
print(str(count))

Submission status: Runtime Error

Solution code:
A,B,C,D = map(int, input().split())

check = True
while True:
    if check:
        c -= b
        if c <= 0:
            print("Yes")
            break

else:
    a -= d
    if a<= 0:
        print("No")
        break

    check = not check

Submission status: Runtime Error

Solution code:
s, w = map(int, input())
print("unsafe" if s <= w else "safe")

Submission status: Runtime Error

Solution code:
s = input()
# print(s[2:len(s)])
l = len(s)
count = 0


# for i, j in itertools.combinations(range(len(s)+1), 2):
#     if(int(s[i:j]) % 2019 == 0):
#         count = count + 1
#
# print(count)

for i in range(2019):
    count2 = 0
    for j in range(l):
        if int(s[j:l]) % 2019 == i:
            count2 = count2 + 1
    count = count + (count2 * (count2 - 1)) / 2
print(int(count))

Submission status: Runtime Error

Solution code:
s = input()
count = 0

for i in range(len(s)):
    for j in range(len(s) - i):
        if int(s[i:i+j+1]) % 2019 == 0:
            count = count + 1

print(count)

Submission status: Runtime Error

Solution code:
S, W = map (int, input (). Split ())
print (("safe", "unsafe") [W> = S])

Submission status: Runtime Error

Solution code:
n, a, b, c = (int(x) for x in input().split())
while n > 0 and b > 0:
    n -= c
    if n < 0:
        print("No")
        break
    b -= a
    if b < 0:
        print("Yes")
        break

Submission status: Runtime Error

Solution code:

s,w=map(int,input().split())


if s>w:
    print(safe)
else:
    print(unsafe)

Submission status: Runtime Error

Solution code:

s,w=map(int,input.split())


if s>w:
    print(safe)
else:
    print(unsafe)

Submission status: Runtime Error

Solution code:

A=list(map(int,input.split()))
s=A[0]
w=A[1]

if s>w:
    print(safe)
else:
    print(unsafe)

Submission status: Runtime Error

Solution code:
A=list(map(int,input.split()))
s=A[0]
w=A[1]

if s>w:
    return safe
else:
    return unsafe

Submission status: Runtime Error

Solution code:
s=int(input())
w=int(input())
if w>=s:
  print('unsafe')
else:
  print('safe')