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=int(input())
w=int(input())
if w>=s:
  print('unsafe')
else:
  print('safe')

Submission status: Runtime Error

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

s=int(s)
w=int(w)

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

Submission status: Runtime Error

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

W=int(W)

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

Submission status: Runtime Error

Solution code:
S,W=input().sep("")
S=int(S)

W=int(W)

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

Submission status: Runtime Error

Solution code:
S,W=input(),sep(",")
S=int(S)

W=int(W)

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

Submission status: Runtime Error

Solution code:
S,W=input(),sep(",")
S=int(S)

W=int(W)

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

Submission status: Runtime Error

Solution code:
S,W=input(),sep(",")
S=int(S)

W=int(W)

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

Submission status: Runtime Error

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

W=input()
W=int(W)

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

Submission status: Runtime Error

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

W=input()
W=int(W)

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

Submission status: Runtime Error

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

W=input()
W=int(W)

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

Submission status: Runtime Error

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

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

Submission status: Runtime Error

Solution code:
import sys
lines = sys.stdin.readlines()

S = str(input())

#10**nのmod計算
A = []
p =1
for i in range(len(S)):
  A.append(p)
  p = p*10%2019

#左からi文字以降の数字列のmod計算
X = []
a = 0
for i in range(len(S)):
  a = (a + int(S[len(S)-i-1])*A[i]) %2019
  X.append(a)
X.sort()
flag =1
n = 0

#modが同じになる組み合わせ、またはもともとmodが0になる数字列の個数の総和計算
for i in range(len(X)-1):
  if X[i]==0:
    n +=1
  if X[i]==X[i+1]:
    flag += 1
  else:
    n += flag*(flag-1)//2
    flag = 1
print(n)

Submission status: Runtime Error

Solution code:
s,w = map(int,input().split())
if w > s or 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  =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:
if S<=W:
    print('unsafe')
    
else:
    print('safe')

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
S, W = [int(s) for s in input.split()]
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:
seep, wolf = map(int, input().rstrip())

if seep > wolf:
  print('safe')
else:
  print('unsafe')

Submission status: Runtime Error

Solution code:
th,td,ah,ad = map(int,input().split())
x,y = (td+ah-1)//td,(ad+th-1)//ad
if(x<=y):print("Yes")
else:print("No")

Submission status: Runtime Error

Solution code:
from operator import mul
from functools import reduce

def ConZ(i):
    z_num = i+int(i*(i-1)/2)
    return z_num
#def ConN(i):
    #n_num = int(i*(i-1)/2)
    #return n_num

def cmb(n):
    over = reduce(mul, range(n, n - 2, -1))
    under = reduce(mul, range(1,2 + 1))
    return over // under


S = input()[::-1]
keta = 1
A_num = 0
x = 0
mod = [0]*2019
for i in range(len(S)):
    A_num += (int(S[i:i+1])*keta)%2019
    if A_num >= 2019:
        A_num = A_num%2019
    mod[A_num] +=1
    keta*=10
    
#print(mod)
x += ConZ(mod[0])
del mod[0]

for j in range(len(mod)):
    x+=cmb(mod[j])
print(x)

Submission status: Runtime Error

Solution code:
s, w = [int(s) for s in intput().split(" ")]
if w >= s:
  print("unsafe")
else:
  print("safe")

Submission status: Runtime Error

Solution code:
A = input()

S = 0
lis = [0] * 2019
lis[0] += 1
l = len(A)+1
d = 1

for n in reversed(A):
    S += int(n)*d
    sm = S % 2019
    lis[sm] += 1
    d *= 10

result = 0

for n in lis:
    result += (n*(n-1)/2)


print(int(result))

Submission status: Runtime Error

Solution code:
#include <bits/stdc++.h>
using namespace std;
using 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))

signed main() {

    int a, b;
    cin >> a >> b;
    if (a > b) cout << "safe" << endl;
    else cout << "unsafe" << endl;

}

Submission status: Runtime Error

Solution code:
S=[str(input()) for i in range(2*10^1-1)]
S.pop(0)
print(len(set(S)))

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

aoki_new = (a+d-1)/d
taka_new1 = (c+b-1)/b

if aoki_new >= taka_new1:
	print("Yes") #takahasi is loses because its heath is zero first
else:
	print("No")

Submission status: Runtime Error

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

aoki_new = (a+d-1)/d
taka_new1 = (a+b-1)/b

if taka_new1 <= aoki_new :
	print("Yes") #takahasi is loses because its heath is zero first
else:
	print("No")

Submission status: Runtime Error

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

aoki_new = (a+d-1)/d
taka_new1 = (a+b-1)/b

if taka_new1 < aoki_new :
	print("No") #takahasi is loses because its heath is zero first
else:
	print("Yes")

Submission status: Runtime Error

Solution code:
#include <bits/stdc++.h>
using namespace std;

#define int long long

int32_t main(){
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    cout.tie(NULL);

    int s, w;
    cin >> s >> w;
    if(s <= w) cout << "unsafe" << endl;
    else cout << "safe" << endl;
}

Submission status: Runtime Error

Solution code:
a, b, c, d = map(int, input().split())
attack = True
win = True

while a < 0 | c < 0:
	if attack:
		c -= b
		attack = False
	else:
		a -= d
		attack = True
		if a < 0:
			win = False
            
print("Yes") if win else print('No')

Submission status: Runtime Error

Solution code:
a, b, c ,d = map(int, input().split())
attack = True
win = True

while True:
	if attack:
		c -= b
		attack = False
		if c < 0:
			break
	else:
		a -= d
		attack = True
		if a < 0:
			win = False 
			break


print("Yes") if win else print('No')

Submission status: Runtime Error

Solution code:
s = input()[::-1]
n = len(s)
cnt = [0] * 2019
cnt[0] = 1
total = 0
ans = 0
x = 1
for i in range(n):
    total += int(s[i]) * x
    total %= 2019
    x *= 10 % 2019
    ans += cnt[total]
    cnt[total] += 1print(ans)

Submission status: Runtime Error

Solution code:
a, b, c ,d = map(int, input().split())
attack = True
win = True

while True:
	if attack:
		c -= b
		attack = False
		if c < 0:
			break
	else:
		a -= d
		attack = True
		if a < 0:
			win = False 
			break


print("Yes") if win else print('No')

Submission status: Runtime Error

Solution code:
x = input().split()


if(x[0] > x[1]):print(unsafe)
else:print(safe)

Submission status: Runtime Error

Solution code:
a,b=map(int,input().sprit())
if a<=b:print('unsafe')
else:print('safe')

Submission status: Runtime Error

Solution code:
a,b=map(int,input().sprit())
if a>b:print('unsafe')
else:print('safe')

Submission status: Runtime Error

Solution code:
a,b,c,d=map(int,input().split())
taka=c/b
ao=a/d
taka=taka if taka==c//b else int(taka)+1
ao=ao if ao==a//d else int(ao)+1
print("Yes" if taka<=ao else "No")

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
#include <bits/stdc++.h>

using namespace std;
typedef long long ll;

int main()
{
    int s, w;
    cin >> s >> w;
    if (s <= w) {
        cout << "unsafe" << endl;
    } else {
        cout << "safe" << endl;
    }



    return 0;
}

Submission status: Runtime Error

Solution code:
#include <bits/stdc++.h>

using namespace std;
typedef long long ll;

int main()
{
    int s, w;
    if (s <= w) {
        cout << "unsafe" << endl;
    } else {
        cout << "safe" << endl;
    }



    return 0;
}

Submission status: Runtime Error

Solution code:
s = input()
si = int(s)
ans = 0
 
 
for i in range(1,300000//2019):
    d = 0
    while 1:
        if s.find(str(2019*i), d) != -1:
            ans = ans+1
            d = s.find(str(2019*i), d)+1
        else:
            break
 
print(ans)

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
W, S = input()

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

Submission status: Runtime Error

Solution code:
S = input()

count = 0
mod_check = {}
mod_check[0] = 1
check_S = 0
for i in reversed(S):
    check_S += int(i) * (10 ** count)
    mod = check_S % 2019
    mod_check.setdefault(mod, 0)
    mod_check[mod] += 1
    count += 1
mod_match = 0
for x in mod_check.values():
    mod_match += x * (x - 1) // 2
print(mod_match)

Submission status: Runtime Error

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

Submission status: Runtime Error

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

if 1<=S<=100 and 1<=W<=100:
    if W<=S:
        print(safe)
    elif W>S:
        print(unsafe)
else:
    pass

Submission status: Runtime Error

Solution code:
S,W=map(int,input().split())
If 1<=S<=100 and 1<=W<=100:
  If S>=W:
    print(safe)
  Else:
    print(unsafe)

Submission status: Runtime Error

Solution code:
S,W=map(int,input().split())
If 1<=S<=100 and 1<=W<=100:
  If S>=W:
    print(safe)
  Else:
    print(unsafe)
Else:
  break

Submission status: Runtime Error

Solution code:
S = input()
leng = len(S)

count = [0] * 2019
count[0] = 1

for i in range(leng):
    remainder = int(S[i:]) % 2019
    count[remainder] += 1

res = 0
for cnt in count:
    res += cnt * (cnt - 1) // 2
    
print(res)

Submission status: Runtime Error

Solution code:
S = input()
l = len(S)
count = 0
for i in range(4,l+1):
  for j in range(l-i+1):
    if float(S[j:j+i]) % 2019 == 0:
      count += 1
print(count)

Submission status: Runtime Error

Solution code:
N = int(input())
#景品リスト作成
keihin = []

#かぶってなければ箱へ
for i in range(N):
    if keihin.count(input()) == 0:
        keihin.append(input())

#出力
print(len(keihin))

Submission status: Runtime Error

Solution code:
#入力
HPlist = list(map(int, input().split()))
HPlist[0] = A
HPlist[1] = B
HPlist[2] = C
HPlist[3] = D

int aokiDeath
int takahashiDeath

#高橋の攻撃何発分か
if C % B == 0:
    aokiDeath = C // B
else:
    aokiDeath = C // B + 1 

#青木の攻撃何回分か
if A % D == 0:
    takahashiDeath = A // D
else:
    takahashiDeath = A // D + 1

if aokiDeath <= takahashiDeath:
    print("Yes")
else:
    print("No")

Submission status: Runtime Error

Solution code:
#入力
HPlist = list(map(int, input().split()))
HPlist[0] = A
HPlist[1] = B
HPlist[2] = C
HPlist[3] = D


#高橋の攻撃何発分か
if C % B == 0:
    aokiDeath = C // B
else:
    aokiDeath = C // B + 1 

#青木の攻撃何回分か
if A % D == 0:
    takahashiDeath = A // D
else:
    takahashiDeath = A // D + 1

if aokiDeath <= takahashiDeath:
    print("Yes")
else:
    print("No")

Submission status: Runtime Error

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


#高橋の攻撃何発分か
if C % B == 0:
    aokiDeath = C // B
else:
    aokiDeath = C // B + 1 

#青木の攻撃何回分か
if A % D == 0:
    takahashiDeath = A // D
else:
    takahashiDeath = A // D + 1

if aokiDeath <= takahashiDeath:
    print("Yes")
else:
    print("No")

Submission status: Runtime Error

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

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

Submission status: Runtime Error

Solution code:
#(B)Battle
A,B,C,D=map(int,input().split())
while True:
    C -= B
    if C<=0:
        print('Yes')
        break
    A -= D
    if A<=0:
        print('No')
        break

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:
A, B, C, D = map(int, input().split())

n = int(A/D)
m = int(C/B)

if n<=m:
    print('No')
elif n>m:
    print('Yes')

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
from itertools import combinations

S = input()[::-1] # 入力文字列を逆順でsに格納

counts = [0] * 2019
counts[0] = 1

a = 1
d = 0

for s in S:
    d = d + int(s)*a
    num = d%2019
    counts[num] += 1
    a *= 10

ans = 0

for i in counts:
    if i >=2:
        x = len(list(combinations(list(range(i)),2)))
        ans += x

print(ans)

Submission status: Runtime Error

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

if S<W:
    print('unsafe')
elif S>W :
    print('safe')

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
cnt=0
S=str(input())
mc=[0]*2019
L=len(S)

tg=0
digit=1
for s in S[::-1]:
    tg+=int(s)*digit
    mt=tg%2019
    if mt==0:cnt+=1
    cnt+=mc[mt]
    mc[mt]+=1
    digit*=10
    
print(cnt)

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 S<=W:
  print("unsafe")
else:
  print("safe")

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

n = int(A/D)
m = int(C/B)

if n>m:
    x = n
else :
    x = m
    
for i in range(1, x+1):
    a = C - B
    t = A - D
    if a <= 0:
        print('Yes')
        break
    elif t <= 0:
        print('No')
        break

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:
import collections
s = input()
l = len(s)

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

ans = 0
for v in collections.Counter(d).values():
  ans += v*(v-1)/2

print(int(ans))

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:
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 >= s:
  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:
#include <iostream>
#include <vector>
#include <algorithm>
#include<functional>
using namespace std;

int main(){
    int s,w;
    cin>>s>>w;
    if(s>w){
        cout<<"safe"<<endl;
    }else{
        cout<<"unsafe"<<endl;
    }
    
}

Submission status: Runtime Error

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

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(sheeps:)
W=input(wolfs:)

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

Submission status: Runtime Error

Solution code:
x,y,z,w=map(int,input().split())

while True:
    z=z-y
    if z<=0:
        print("Yes")
        break
    x=x-w
    if x<=0:
        print("No")
        break

Submission status: Runtime Error

Solution code:
if S <= W:
  return "unsafe"
else:
  return "safe"

Submission status: Runtime Error

Solution code:
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 = int(input())
w = int(input())
if(s> w):
  print("safe")
 else:
  print("unsafe")

Submission status: Runtime Error

Solution code:
a, b = raw_input()
if a < b:
  print(unsafe)
else:
  print(safe)

Submission status: Runtime Error

Solution code:
a, b = input()
if a < b:
  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:
S,W = map(int, input().split())
if S > W:
  print(safe)
 else :
  print(unsafe)

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 w>=s:
  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:
# -*- coding: utf-8 -*-
 
s = input()
counter = 0

for i in range(len(s) - 4):
  for j in range(4, len(s) + 1):
      if int(float(s[i:j])) % 2019 == 0:
        counter += 1
        
print(counter)

Submission status: Runtime Error

Solution code:
#abc164a

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

Submission status: Runtime Error

Solution code:
#abc164a

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

Submission status: Runtime Error

Solution code:
import collections

N = int(input())
S = [input() for i in range(N)]

ans = collections.Counter(S)
print(len(ans))

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()
w=input()
if(s<w) 
  print("unsafe")
else
  print("safe")

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:

def solve():
    s = int(input())
    w = int(input())
    
    if (w >= s):
        print('unsafe')
    else :
        print('safe')
    
    return 

if __name__ == '__main__':
    solve()

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
n = int(input())
s = [str(input()) for i in range(n)]
print(len(set(s)))

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
S = [int(a) for a in input()[::-1]]
m = 2019
N = len(S)
s = 0
p = 1
X = [0] * 2019
X[0] = 1
ans = 0


for a in S:

    s = (s + a * p) % m
    ans += X[s]
    X[s] += 1
    p = p * 10 % m
 
print(ans)

Submission status: Runtime Error

Solution code:
#!/usr/bin/python3
# -*- coding:utf-8 -*-

from collections import Counter

def main():
  s = input().strip()
  remains = Counter([int(s[-i:]) % 2019 for i in range(1, len(s)+1)]).items()

  cnt = 0
  for k, v in remains:
    cnt += (v * (v - 1)) // 2
    if k == 0:
      cnt += v
  print(cnt)
  
if __name__=='__main__':
  main()

Submission status: Runtime Error

Solution code:
import collections
s = input()

l = [int(s[-1])]
d = 10
for i in range(len(s)-2, -1, -1):
  l.append((l[-1] + int(s[i])*d) % 2019)
  d *= 10
  d %= 2019
c = collections.Counter(l)
ans = 0  
for i in c.values():
  ans += i*(i-1)//2

ans += c[0]

print(ans)

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 = list(input())
n = len(s)
#s_cu = [] 
counter = [0] * 2019

counter[0] += 1
temp=""
for i in range(1, n+1):
    c=s.pop()
    temp = c + (temp if i != 1 else "")
    #s_cu.append(temp)
    counter[int(temp) % 2019] += 1

ans = 0
for i in counter:
    ans += (i * (i - 1)) // 2

print(ans)

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
S=input()
N=len(S)
Slis=[]
for i in range(N):
  Slis+=[int(S[i])]
T=[0 for i in range(N+1)]#T[i]はi桁より右側の数字


def kaizyou(n):
  c=1
  c=c*10**n
  return c%2019


for i in range(N):
  T[N-i-1]=(T[N-i]+kaizyou(i)*Slis[N-i-1])%2019

MOD=[0 for i in range(2019)]
for i in range(N+1):
  tmp=T[i]%2019
  MOD[tmp]+=1


  
ans=0

for i in range(2019):
  tmp=MOD[i]
  ans+=tmp*(tmp-1)//2
print(ans)

Submission status: Runtime Error

Solution code:
import numpy as np
s = input()
cnt = 0
ss = []
nums = np.array([(i+1)*2019 for i in range(200000//2019) if not "0" in str((i+1)*2019)])
for start in range(len(s)):
  end = start + 3
  while(end+1<=len(s)):
    if int(s[start:end+1]) in nums:
      cnt += 1
    end += 1
print(cnt)

Submission status: Runtime Error

Solution code:
N = int(input())
ct=0
p=0
str_list = [input() for _ in range(N)]
for p in range(N):
	for k in range(p+1):
		if str_list[p]==str_list[k] and p==k:
			ct=ct+1
		elif str_list[p]==str_list[k] and p!=k:
			break


print(ct)

Submission status: Runtime Error

Solution code:
S = list(map(int, input()))
if len(S) < 4:
  print(0)
else:
  N = len(S)
  x = 0
  d = [0]*2019
  d[0] = 1
  for i, s in enumerate(reversed(S)):
    x += s*(10**i)
    d[x%2019] += 1
  ans = 0
  for m in d:
    ans += m*(m-1)//2
  print(ans)

Submission status: Runtime Error

Solution code:
n=input()
length=len(n)
rs=0
for i in range(1,length-2):
    num=0
    start=0
    end=length-i
    gap=length-end
    for j in range(i):
        num=int(n[start+j:end+1+j])
        if num%2019==0:
            rs+=1
print(rs)

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
S=input()
mem_mod = [0 for i in range(0,2019,1)]
N = len(S)
counter = 0
S_num_tmp = list(S)
S_num = list(map(int, S_num_tmp))
tmp=10

for i in range(1,N,1):
    S_num[N-i-1] = S_num[N-i] + S_num[N-i-1]*pow(10,i,2019)

for i in range(0,N,1):
    X = S_num[N-i-1] % 2019
    if X==0:
        counter+=1
    counter += mem_mod[X]
    mem_mod[X] += 1
print(counter)

Submission status: Runtime Error

Solution code:
def Sol(taka_health,taka_stregnth,aoki_health,aoki_stregnth):
    
    if taka_health%aoki_stregnth != 0:
        moves_taka = int(taka_health/aoki_stregnth) + 1
    else:
        moves_taka = int(taka_health/aoki_stregnth)
    
    if aoki_health%taka_stregnth != 0:
        moves_aoki =int(aoki_health/taka_stregnth) + 1
    else:
        moves_aoki = int(aoki_health/taka_stregnth)
    
    print(moves_aoki,moves_taka)
    if moves_taka > moves_aoki:
        print("Yes")
    else:
        print("No")
    return

    

#for t in range(int(input())):
n,k,d,c = map(int,input().split())
#n = int(input())
#arr = []
#for i in range(n):
#    time = list(map(int,input().split()))
#    time = time[0] + (time[1]/60)
#    arr.append(time)
#arr = list(map(int,input().split()))
#k = input()
#n = int(input())
Sol(n,k,d,c)

Submission status: Runtime Error

Solution code:
def Sol(taka_health,taka_stregnth,aoki_health,aoki_stregnth):
    
    if taka_health%aoki_stregnth != 0:
        moves_taka = int(taka_health/aoki_stregnth) + 1
    else:
        moves_taka = int(taka_health/aoki_stregnth)
    
    if aoki_health%taka_stregnth != 0:
        moves_aoki =int(aoki_health/taka_stregnth) + 1
    else:
        moves_aoki = int(taka_health/aoki_stregnth)
    
    print(moves_aoki,moves_taka)
    if moves_taka > moves_aoki:
        print("Yes")
    else:
        print("No")
    return

    

#for t in range(int(input())):
n,k,d,c = map(int,input().split())
#n = int(input())
#arr = []
#for i in range(n):
#    time = list(map(int,input().split()))
#    time = time[0] + (time[1]/60)
#    arr.append(time)
#arr = list(map(int,input().split()))
#k = input()
#n = int(input())
Sol(n,k,d,c)

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
S=input()
mem_mod = [0 for i in range(0,2019,1)]
N = len(S)
counter = 0
S_num_tmp = list(S)
S_num = list(map(int, S_num_tmp))
tmp=10

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
s = input()
count = 0
for i in range(len(s)+1):
    for j in range(i+1, len(s)+1):
        if (int(s[i:j])%3 == 0 and int(s[i:j])%673 == 0):
            count += 1
            #print("ok", s[i:j])
print(count)

Submission status: Runtime Error

Solution code:
import bisect

s = input()
n = len(s)

s2 = [0 for _ in range(n)]

zero = []
one = []
two = []

for i in range(n):
  s2[i] = int(s[i]) % 3

for i in range(1,n):
  s2[i] += s2[i-1]
  s2[i] %= 3

for i in range(n):
  if s2[i] == 0:
    zero.append(i)
  elif s2[i] == 1:
    one.append(i)
  elif s2[i] == 2:
    two.append(i)
ans = 0
length = len(zero)
for i in range(length):
    if int(s[:zero[i]+1]) % 2019 == 0:
      ans += 1
length = len(zero)
for i in range(length-1):
  tmp = s[zero[i]+1:]
  for j in range(i+1,length):
    if int(tmp[:zero[j]-zero[i]]) % 2019 == 0:
      ans += 1

length = len(one)
for i in range(length-1):
  tmp = s[one[i]+1:]
  for j in range(i+1,length):
    if int(tmp[:one[j]-one[i]]) % 2019 == 0:
      ans += 1

length = len(two)
for i in range(length-1):
  tmp = s[two[i]+1:]
  for j in range(i+1,length):
    if int(tmp[:two[j]-two[i]]) % 2019 == 0:
      ans += 1
print(ans)

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
S = list(input())
N = len(S)
 
 
l = [0] * 2019
index = 0
temp = 0
for i in range(N-1, -1, -1):
    temp += int(S[i]) * 10**index
    l[temp%2019] += 1
    index += 1
 
ans = l[0]
 
for i in range(1, 2019):
    v = l[i]
    ans += v * (v-1) // 2
 
print(ans)

Submission status: Runtime Error

Solution code:
from sys import stdin
import numpy as np


def merge_sort(lst, low, high):
    if low >= high:
        return
    mid = int((low+high)/2)
    merge_sort(lst, low, mid)
    merge_sort(lst, mid+1, high)
    for i in range(low, mid+1):
        tmp_array[i] = lst[i]
    j = high
    for i in range(mid+1, high+1):
        tmp_array[i] = lst[j]
        j -= 1
    i = low
    j = high
    for k in range(low, high+1):
        if tmp_array[i] <= tmp_array[j]:
            lst[k] = tmp_array[i]
            i += 1
        else:
            lst[k] = tmp_array[j]
            j -= 1


S = stdin.readline().rstrip()
N = len(S)
Sp = S

res_map = [0 for _ in range(N)]

aa_list2 = [1]
for i in range(1,N):
    aa_list2.append((aa_list2[i-1]*10)%2019)

tmp_array = [None for _ in range(N)]
res_map[N-1] = int(S[N-1])
index=1
for i in range(N-2,-1,-1):
    res_map[i] = (int(S[i])*aa_list2[index] + res_map[i+1])%2019
    index+=1
#merge_sort(res_map,0,N-1)
#res_map = list(np.sort(np.array(res_map)))
res_map.sort()
temp_num=res_map[0]
index=1
tot = 0

for i in range(1,N):
    if temp_num==res_map[i]:
        index+=1
        continue
    else:
        if temp_num==0:
            tot += int(index*(index+1)/2)
        elif index>1:
            tot += int(index*(index-1)/2)
            #tot += index/2
        index=1
        temp_num=res_map[i]





print(tot)

Submission status: Runtime Error

Solution code:
s = input()
num = len(s)

dp = [0]*num
temp = [0]*2019
for i in range(num):
    temp[int(s[i:]) % 2019] += 1

ans = temp[0]
for t in temp:
    if t > 1:
        ans += t*(t-1)/2

print(int(ans))

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:
a, b, c, d = map(int, input().split())
if c // b >= a // d:
    print('Yes')
else:
    print('No')

Submission status: Runtime Error

Solution code:
S = input()
N = len(S)

l = [0] * 2019
for i in range(N):
    l[int(S[i:N])%2019] += 1

ans = l[0]

for i in range(1, 2019):
    ans += l[i] * (l[i]-1) // 2

print(ans)

Submission status: Runtime Error

Solution code:
from collections import defaultdict
S = input()
N = len(S)

D=defaultdict()
prev=0
ans=0
for i,s in enumerate(reversed(S)):
    cur=prev+pow(10,i,2019)*int(s)%2019
    ans+=D[cur]
    D[cur]+=1
    prev=cur
print(ans)