Problem:


Score : 100 points

Problem Statement

How many hours do we have until New Year at M o'clock (24-hour notation) on 30th, December?

Constraints

1≤M≤23

M is an integer.

Input

Input is given from Standard Input in the following format:

M

Output

If we have x hours until New Year at M o'clock on 30th, December, print x.

Sample Input 1

21

Sample Output 1

27

We have 27 hours until New Year at 21 o'clock on 30th, December.

Sample Input 2

12

Sample Output 2

36



Sample input:
21


Sample output:
27

Submission status: Runtime Error

Solution code:
x = int(input())

pritn(24 + (24 - x))

Submission status: Runtime Error

Solution code:
m = input()
print(48 - m)

Submission status: Runtime Error

Solution code:
def calc_prime(n):
    primes = set(list(range(3, n, 2)))
    primes.add(2)
    for a in range(3, n, 2):
        for i in range(a, n):
            x = a * i
            if x >= n:
                break
            if x in primes:
                primes.remove(x)

    return primes


def collect_likes(ps):
    likes = set([p for p in ps if (p + 1) / 2 in ps])
    return likes


def line(xs, n):
    ps = list(xs)
    ps.sort()
    cs = [0] * n
    s = 0
    for i in range(n):
        if i in xs:
            cs[i] = s
            s += 1
        else:
            cs[i] = s

    return cs


def main():
    n = 10 ** 5
    primes = calc_prime(n)
    likes = collect_likes(primes)
    cums = line(likes, n)
    #print(sorted(list(primes))[:100])
    #print(sorted(list(likes))[:100])
    #print(cums[:10])

    q = int(input())
    for _ in range(q):
        l, r = [int(x) for x in input().split()]
        ans = cums[r + 1] - cums[l]
        print(ans)


main()

Submission status: Runtime Error

Solution code:
is_prime = [1]*101010
is_prime[0] = 0
is_prime[1] = 0
max = 101010

for i in range(2,max):
    if is_prime[i]:
        j = i*2
        while j <= max-1:
            is_prime[j] = 0
            j += i

a = [0]*max
for i in range(max):
    if(i%2==0): 
        continue
    if(is_prime[i]==1 and is_prime[(i+1)//2]==1):
        a[i]=1

s = [0]*(max+1)
for i in range(max):
    s[i+1] = s[i]+a[i]


q = int(input())
for i in range(q):
    l, r = map(int, input().split())
    r += 1
    
    print(s[r]-s[l])

Submission status: Runtime Error

Solution code:
a = int(input())
prnt(48 - a)

Submission status: Runtime Error

Solution code:
    M = int(input())
    print(48-M)

Submission status: Runtime Error

Solution code:
print(48 -int(input())

Submission status: Runtime Error

Solution code:
N = input()

if (N[0] == N[1] and N[1] == N[2]) or (N[1] == N[2] and N[1] == N[3]):
    print('Yes')
else:
    print('No')

Submission status: Runtime Error

Solution code:
#include <bits/stdc++.h>
using namespace std;
 
int main() {
    int M ;
    cin >> M;
    cout << (24 - M) + 24;
}

Submission status: Runtime Error

Solution code:
1<=M<=23
print(48 - M)

Submission status: Runtime Error

Solution code:
M>=1 and M<=23
print(M + 24)

Submission status: Runtime Error

Solution code:
m = int(input())

print(24-m+24

Submission status: Runtime Error

Solution code:
def ii(): return int(sys.stdin.readline())

M = ii()

print(48-M)

Submission status: Runtime Error

Solution code:
import sys
import math
import bisect

def main():
	n = int(input())
    print(48 - n)

if __name__ == "__main__":
    main()

Submission status: Runtime Error

Solution code:
numbers_like_2017 = [3, 5, 13, 37, 61, 73, 157, 193, 277, 313, 397, 421, 457, 541, 613, 661, 673, 733, 757, 877, 997, 1093, 1153, 1201, 1213, 1237, 1321, 1381, 1453, 1621, 1657, 1753, 1873, 1933, 1993, 2017, 2137, 2341, 2473, 2557, 2593, 2797, 2857, 2917, 3061, 3217, 3253, 3313, 3517, 3733, 4021, 4057, 4177, 4261, 4273, 4357, 4441, 4561, 4621, 4933, 5077, 5101, 5113, 5233, 5413, 5437, 5581, 5701, 
6037, 6073, 6121, 6133, 6217, 6337, 6361, 6373, 6637, 6661, 6781, 6997, 7057, 7213, 7393, 7417, 7477, 7537, 7753, 7933, 8053, 8101, 8221, 8317, 8353, 8461, 8521, 8677, 8713, 8893, 9013, 9133, 9181, 9241, 9277, 9601, 9661, 9721, 9817, 9901, 9973, 10333, 10357, 10453, 10837, 10861, 10957, 11113, 11161, 11317, 11497, 11677, 11701, 12073, 12157, 12241, 12301, 12421, 12433, 12457, 12541, 12553, 12601, 12721, 12757, 12841, 12853, 13093, 13381, 13417, 13681, 13921, 13933, 14437, 14593, 14737, 14821, 15013, 15073, 15121, 15241, 15277, 15361, 15373, 15733, 15901, 16033, 16333, 16381, 16417, 16573, 16633, 16657, 16921, 17041, 17053, 17077, 17257, 17293, 17377, 17881, 18013, 18097, 18133, 18181, 18217, 18253, 18301, 18313, 18397, 18481, 18553, 18637, 18793, 19237, 19441, 19477, 19717, 19801, 19813, 19861, 20353, 20533, 20641, 20857, 21001, 21061, 21193, 
21277, 21313, 21577, 21661, 21673, 21817, 22093, 22501, 22573, 22621, 22993, 23053, 23173, 23557, 23677, 23773, 23917, 24097, 24421, 24481, 24781, 24841, 25033, 25153, 25237, 25561, 25657, 25933, 26017, 26293, 26317, 26437, 26497, 26821, 26833, 26881, 26953, 27073, 27253, 27337, 27361, 27457, 27997, 28057, 28297, 28393, 28813, 28837, 28921, 29101, 29473, 29641, 30181, 30241, 30517, 30553, 30577, 30637, 30661, 30697, 30781, 30853, 31081, 31237, 31321, 31333, 31357, 31477, 31573, 31873, 31981, 32173, 32377, 32497, 32533, 32833, 33037, 33301, 33457, 33493, 33757, 33961, 34057, 34213, 34273, 34381, 34513, 34897, 34981, 35317, 35521, 35677, 35977, 36097, 36241, 
36433, 36457, 36793, 36877, 36901, 36913, 37273, 37321, 37357, 37573, 37717, 37957, 38281, 38461, 38833, 38953, 38977, 39217, 39373, 39397, 39733, 40093, 40177, 40213, 40693, 40813, 41017, 41221, 41281, 41413, 41617, 41893, 42061, 42337, 42373, 42793, 42961, 43117, 43177, 43201, 43321, 43573, 43597, 43633, 43717, 44053, 44101, 44221, 44257, 44293, 44893, 45061, 45337, 45433, 45481, 45553, 45613, 45841, 46021, 46141, 46261, 46861, 46993, 47017, 47161, 47353, 47521, 47533, 47653, 47713, 47737, 47797, 47857, 48121, 48193, 48337, 48673, 48757, 48781, 49033, 49261, 49393, 49417, 49597, 49681, 49957, 50221, 50341, 50377, 50821, 50893, 51157, 51217, 51241, 51481, 
51517, 51637, 52057, 52081, 52237, 52321, 52453, 52501, 52813, 52861, 52957, 53077, 53113, 53281, 53401, 53917, 54121, 54133, 54181, 54217, 54421, 54517, 54541, 54673, 54721, 54973, 55057, 55381, 55501, 55633, 55837, 55921, 55933, 56053, 56101, 56113, 56197, 56401, 56437, 56701, 56773, 56821, 56857, 56893, 57073, 57097, 57193, 57241, 57373, 57457, 57853, 58153, 58417, 58441, 58537, 58573, 58693, 59053, 59197, 59221, 59281, 59341, 59833, 60217, 60337, 60373, 60637, 60733, 60937, 61057, 61153, 61261, 61297, 61561, 61657, 61681, 61717, 61861, 62137, 62473, 62497, 62533, 62653, 62773, 63313, 63397, 63541, 63697, 63781, 63913, 64153, 64237, 64381, 64513, 64717, 
65173, 65293, 65413, 65437, 65497, 65557, 65677, 65881, 66301, 66361, 66601, 66697, 66853, 66973, 67057, 67153, 67273, 67477, 67537, 67741, 67777, 67933, 67993, 68113, 68281, 68521, 68737, 69001, 69073, 69457, 69493, 69697, 69877, 70117, 70177, 70297, 70501, 70621, 70921, 70981, 71233, 71341, 71353, 71593, 71821, 72073, 72481, 72613, 72901, 72937, 73141, 73417, 73477, 73561, 73693, 74077, 74317, 74377, 74713, 75013, 75133, 75181, 75721, 75793, 75913, 76333, 76561, 76597, 76753, 77137, 77641, 78157, 78193, 78277, 78877, 78901, 79333, 79357, 79537, 79657, 79693, 79801, 79873, 80077, 80173, 80221, 80473, 80701, 80713, 80917, 81013, 81181, 81517, 81637, 81853, 
82021, 82153, 82261, 82561, 82981, 83077, 83221, 83233, 83437, 83617, 83701, 83773, 84121, 84313, 84673, 84697, 84793, 84913, 85297, 85333, 85453, 85717, 85933, 86353, 86413, 87181, 87253, 87337, 87421, 87433, 87517, 87553, 87973, 88117, 88177, 88237, 88261, 88513, 88741, 88897, 88993, 89293, 89833, 89917, 90121, 91081, 91381, 91393, 91513, 91957, 92041, 92557, 92761, 92821, 92893, 92941, 93097, 93133, 93493, 93637, 93913, 94033, 94117, 94273, 94321, 94441, 94573, 94777, 94837, 94993, 95257, 95317, 95401, 95581, 95617, 95713, 95737, 96097, 96157, 96181, 96493, 96517, 96973, 97081, 97177, 97501, 97561, 97777, 97813, 98017, 98737, 98953, 99277, 99577, 99661, 
99877]

Q = int(input())
for _ in range(Q):
    l, r = map(int, input().split())
    print(bisect.bisect_right(numbers_like_2017, r) - bisect.bisect_left(numbers_like_2017, l))

Submission status: Runtime Error

Solution code:
  M = int(input())
    
  print(48-M)

Submission status: Runtime Error

Solution code:
  M = int(input())
    
    print(48-M)

Submission status: Runtime Error

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

int M;

int main() {
  cout<< 48-M <<endl;
}

Submission status: Runtime Error

Solution code:
print(48-M)

Submission status: Runtime Error

Solution code:
m=int(input())
  print(48-m)

Submission status: Runtime Error

Solution code:
import numpy as np
from math import factorial
from collections import Counter

n = int(input())
a = np.array(input().split(), np.int32)
S = np.zeros(n + 1, np.int32)
S[1:] = np.cumsum(a)

cnt = Counter(S)
ans = 0
for x in cnt:
    # nC2
    if cnt[x] > 1:
        ans += cnt[x] * (cnt[x] - 1) // 2
print(ans)

Submission status: Runtime Error

Solution code:
x=input()
print(48-x)

Submission status: Runtime Error

Solution code:
Q = int(input())

def is_prime(n):
    if n == 1: return False
    for k in range(2, int(n**0.5)+1):
        if n % k == 0:
            return 0
    return n

prime_numbers = [is_prime(i) for i in range(2, 10**5 + 1) if is_prime(i) != 0]
same = [0]*(10**5 + 1)
for n in prime_numbers:
    if (n+1) // 2 in prime_numbers:
        same[n] += 1

for i in range(10**5):
    same[i+1] += same[i]

ans = []
for _ in range(Q):
    l, r = map(int, input().split())
    N = same[r] - same[l-1]
    ans.append(N)

print(*ans, sep='\n')

Submission status: Runtime Error

Solution code:
A,B=map(int,input().split())
S=input()
if (S[0:A].isdecimal()==True) and (S[A+1:-1].isdecimal()==True) and (S[A]=='-') and len(S)==x+y+1:
    print('Yes')
else:
    print('No')

Submission status: Runtime Error

Solution code:
import sys
sys.setrecursionlimit(10**8)
def ii(): return int(sys.stdin.readline())
def mi(): return map(int, sys.stdin.readline().split())
def li(): return list(map(int, sys.stdin.readline().split()))
def li2(N): return [list(map(int, sys.stdin.readline().split())) for _ in range(N)]
def dp2(ini, i, j): return [[ini]*i for _ in range(j)]
def dp3(ini, i, j, k): return [[[ini]*i for _ in range(j)] for _ in range(k)]
#import bisect #bisect.bisect_left(B, a)
#from collections import defaultdict #d = defaultdict(int) d[key] += value
from itertools import accumulate #list(accumulate(A))

Q = ii()
lr = li2(Q)
from collections import deque
que = deque()

def is_prime(n):
    if n == 1:
        return False
    for i in range(2,int(n**0.5)+1):
        if n % i == 0:
            return False
    return True

prime = [0]*(10**5+1)
flag = [0]*(10**5+1)
prime[2] = 1

for i in range(3, 10**5+1, 2):
    if is_prime(i):
        prime[i] = 1

for i in range(3, 10**5+1, 2):
    if prime[i] and prime[(i+1)//2]:
        flag[i] = 1

ans = list(accumulate(flag))

for i in range(Q):
    print(ans[lr[i][1]]-ans[lr[i][0]-1])

Submission status: Runtime Error

Solution code:
print(48-{})

Submission status: Runtime Error

Solution code:
from bisect import bisect, bisect_left


size = 10 ** 5 + 1

is_prime = [True] * size
is_prime[0] = is_prime[1] = False

# √size まで
for i in range(2, 317):
  j = 2 * i
  while j < size:
    is_prime[j] = False
    j += i

like_numbers = [
  i 
  for i, x in enumerate(is_prime)
  if x and (i + 1) % 2 == 0 and is_prime[(i + 1) // 2]
]

Q = int(input())

for _ in range(Q):
  l, r = map(int, input().split())
  if l == r:
    print(1 if l in like_numbers else 0)
  else:
    print(bisect(like_numbers, r) - bisect_left(like_numbers, l))

Submission status: Runtime Error

Solution code:
x = (48 - M )

Submission status: Runtime Error

Solution code:
t = int(input())
x = 48 - t

return x

Submission status: Runtime Error

Solution code:
t = int(input())

return 48-t

Submission status: Runtime Error

Solution code:
print(48-int(input())

Submission status: Runtime Error

Solution code:
a,b = list(map(int,input().split()))
s = input()
num = s[:a] + s[a+1]
print('Yes' if s[a+1] == '-' and len(s) == a+b+1 and ('-' not in num) else 'No')

Submission status: Runtime Error

Solution code:
import math
import string


def readints():
    return list(map(int, input().split()))


def nCr(n, r):
    return math.factorial(n)//math.factorial(n-r)*math.factorial(r)


m = int(input)
print(24+(24-m))

Submission status: Runtime Error

Solution code:
import math
import string


def readints():
    return list(map(int, input().split()))


def nCr(n, r):
    return math.factorial(n)//math.factorial(n-r)*math.factorial(r)


m = int(input)
print(24+(24-m)s)

Submission status: Runtime Error

Solution code:
M=input("type a number")
x=48-M
print(x)

Submission status: Runtime Error

Solution code:
M = input()
M = int(M)
print(48 - M)
hibiki@hibiki-M

Submission status: Runtime Error

Solution code:
print(48-int(open(0)))

Submission status: Runtime Error

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

int main() {
  int a;
  cin >> a;
  cout << 48-a << endl;
}

Submission status: Runtime Error

Solution code:

N = int(input())
M = [list(map(int, input().split())) for _ in range(N-1)]

for i in range(N-1):
    tm = 0 #時刻を表す
    for j in range(i, N-1):
        if tm < M[j][1]: #開通していない
            tm = M[j][1]
        elif tm % M[j][2] != 0: #発車していない
            tm += M[j][2] - (tm % M[j][2])
 
        tm += M[j][0]
 
    print(tm)
print(0)

Submission status: Runtime Error

Solution code:
print(24+24-int(input())

Submission status: Runtime Error

Solution code:
fn main() {
    let m: isize = read();
    let ans = 24 + 24 - m;
    println!("{}", ans);
}

// 以下関数

use std::io::*;
use std::str::FromStr;
pub fn read<T: FromStr>() -> T {
    let stdin = stdin();
    let stdin = stdin.lock();
    let token: String = stdin
        .bytes()
        .map(|c| c.expect("failed to read char") as char)
        .skip_while(|c| c.is_whitespace())
        .take_while(|c| !c.is_whitespace())
        .collect();
    token.parse().ok().expect("failed to parse token")
}

pub const MOD: u64 = 10e9 as u64 + 7;

pub fn is_prime(n: i32) -> bool {
    if n < 2 {
        return false;
    } else if n == 2 {
        return true;
    }
    let mut i = 2;
    while i * i < n {
        if n % i == 0 {
            return false;
        } else {
            i += 1;
            continue;
        }
    }
    true
}

pub fn lcm(mut n: i32, mut m: i32) -> i32 {
    n = if n > m { m } else { n };
    m = if n > m { n } else { m };
    let mut i = n;
    while i % m != 0 {
        i += n;
    }
    i
}

Submission status: Runtime Error

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

S =  input()


if  S[A] == "-" and S.count("-") == 1:
    ans = "Yes"
else:
    ans = "No"

print(ans)

Submission status: Runtime Error

Solution code:
n = int(input())
C, S, F = [], [], []
for _ in range(n-1):
    c, s, f = map(int, input().split())
    C.append(c)
    S.append(s)
    F.append(f)

for i in range(n-1):
    #i=0, 1つめの駅発を対象とする
    time = S[i] + C[i]
    for j in range(i+1, n-1):
        if time <= S[j]:
            time = S[j] + C[j]
        else:
            #timeに到着して次の出発までにかかる時間は、
            time += (time - S[j])% F[j] + C[j]
    print(time)
print(0)

Submission status: Runtime Error

Solution code:
m = input().split()
print(48-m)

Submission status: Runtime Error

Solution code:
a=input()
print(24+a)

Submission status: Runtime Error

Solution code:
m = input()
print(24 - m)

Submission status: Runtime Error

Solution code:
q=int(input())
for i in range(q):
  a,b=map(int,input().split())
  h=0
  for j in range(a,b+1):
    for v in range(2,round(j**0.5)):
      if j%v==0:
        for k in range(2,round(((j+1)/2)**0.5)):
          if j%k==0:
            h+=1
          else:
            pass
      else:
        pass
      
  print(h)

Submission status: Runtime Error

Solution code:
int m = 0
cin << m
cout >> 24-m >> endl

Submission status: Runtime Error

Solution code:
a = int(input)
print(48-a)

Submission status: Runtime Error

Solution code:
n = input()
print(48-n)

Submission status: Runtime Error

Solution code:
M=input(int())
print(24+(24-M))

Submission status: Runtime Error

Solution code:
n=input()
print(48-n)

Submission status: Runtime Error

Solution code:
print(48-int(input))

Submission status: Runtime Error

Solution code:
M = map(int, input().split())
X = 24 + (24-M)
print(X)

Submission status: Runtime Error

Solution code:
M = map(int,input().split())
print(48 - M)

Submission status: Runtime Error

Solution code:
M = map(int,input())
print(48 - M)

Submission status: Runtime Error

Solution code:
M = map(int,input())
a = 48 - M
print(a)

Submission status: Runtime Error

Solution code:
M =int(input())
prnt(48-M)

Submission status: Runtime Error

Solution code:
M = input()
print(24 - M + 24)

Submission status: Runtime Error

Solution code:
k=input()
print(48-k)

Submission status: Runtime Error

Solution code:
k=input(int())
print(48-k)

Submission status: Runtime Error

Solution code:
h = int(input())

print(24 + (24 - h)

Submission status: Runtime Error

Solution code:
#coding: utf-8

a = input()

print((24 - a) + 24)

Submission status: Runtime Error

Solution code:
#coding: utf-8

a = input()

print(24 - a + 24)

Submission status: Runtime Error

Solution code:
#coding: utf-8

print(24 - M + 24)

Submission status: Runtime Error

Solution code:
#coding: utf-8

print(23 - M + 24)

Submission status: Runtime Error

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

if S[A] == "-" and S.count("-") == 1:
  print("Yes")
else:
  print("No")

Submission status: Runtime Error

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

if s[a+1] == "-":
    s2 = s[:a+1] + s[a+2:]
    for i in range(a+b):
        if s2[i] not in ["0","1","2","3","4","5","6","7","8","9"]:
            print("No")
            break
    else:
        print("Yes")
else:
    print("No")

Submission status: Runtime Error

Solution code:
I = int(intput())
print(24+24-I)

Submission status: Runtime Error

Solution code:
A,B=map(int,input().split())
S=input()
ass=True
for i in range(len(S)):
  if i==A:
    if S[i]!='-':
      ass=False
      break
  else:
    if S[i]=='-':
      ass=False
      break
if ass:
  print('Yes')
else:
  print('No')

Submission status: Runtime Error

Solution code:
A, B = map(int, input().split())
S = input() 
if S[A] == "-" and (S[0:A]+S[A+1:B]).isdigit():
    print("Yes")
else:
    print("No")

Submission status: Runtime Error

Solution code:
n=int(input)
print(48-n)

Submission status: Runtime Error

Solution code:
M=io.read("n")
print(48-M)

Submission status: Runtime Error

Solution code:
a,b=map(int,input().split())
s=input()
if s[:a].isdigit() and s[a:b]=='-' and s[b:].isdigit():
    print("True")
else:
    print("No")

Submission status: Runtime Error

Solution code:
a, b = map(int,input().split())
s = input().split("-")
print("Yes" if len(s[0])==a and len(s[1])==b else "No")

Submission status: Runtime Error

Solution code:
A,B = map(int,input().split())
S = str(input())
if len(S) > A+B+1:
        print("No1")
        exit()
if len(S[A+1:]) != B:
        print("No2")
        exit()
if S == S[0:A]+"-"+S[A+1:] and "-" not in S[0:A] and "-" not in S[A+1:] :
        print("Yes")
else:
        print("No")

Submission status: Runtime Error

Solution code:
from itertools import accumulate

N = 100000
prime = [True]*(N+1)

prime[0] = prime[1] = False

for i in range(N+1):
    if prime[i]:
        for j in range(2*i, N+1, i):
            prime[j] = False

prime2 = [0] * (N+1)

for i in range(N+1):
    if prime[i] and prime[(i+1)//2]:
        prime2[i] = 1

acc = list(accumulate(prime2))

Q = int(input())
for _ in range(Q):
    l, r = map(int, input().split())
    print(acc[r]-acc[l-1])

Submission status: Runtime Error

Solution code:
print(24 - int(input())

Submission status: Runtime Error

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

a=input()

s=48-a

print(s)

Submission status: Runtime Error

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

int a=input()

print(48-a)

Submission status: Runtime Error

Solution code:
a,b = map(int,input().split())
s = input()
if s[a] == "-" and len(s) == a+b+1:
  if str.isdecimal(s[:a]) == True and str.isdecimal(s[:a+1]) == True:
    print("Yes")
else:
  print("No")

Submission status: Runtime Error

Solution code:
# !/usr/bin/env python
# -*- coding: utf-8 -*-
import math


def generate_prime(p_max):
    prime = set([2])
    for i in range(3, p_max + 1):
        for p in prime:
            if i % p == 0:
                break
            if p > int(math.sqrt(i)):
                prime.add(i)
                break
    return prime


def main():
    prime = generate_prime(10**5)
    prime2 = set()
    for p in prime:
        if (p + 1) / 2 in prime:
            prime2.add(p)
    ans = [0] * (10**5 + 1)
    for i in range(1, 10**5 + 1):
        if i in prime2:
            ans[i] = ans[i - 1] + 1
        else:
            ans[i] = ans[i - 1]

    q = int(input())
    queries = [[int(i) for i in input().split()] for _ in range(q)]
    for query in queries:
        print(ans[query[1]] - ans[query[0] - 1])


if __name__ == '__main__':
    main()

Submission status: Runtime Error

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

int main(){
	int M;
	cin>>M;
	cout<<48-M<<endl;
}

Submission status: Runtime Error

Solution code:
M = int(input())
print(48-N)

Submission status: Runtime Error

Solution code:
a,b=map(int,input().split());s=input();print(['No','Yes'][s[a]=='-'and s.count('-')>0])

Submission status: Runtime Error

Solution code:
n = int(input())
c = [0] * n
s = [0] * n
f = [0] * n
for i in range(n - 1):
    c[i], s[i], f[i] = map(int, input().split())

for i in range(n - 1):
    total = 0
    for j in range(i, n - 1):
        if total < s[j]:
            total = s[j]
        elif (total - s[j]) % f[j] == 0:
            total += f[j] - total % f[j]
        total += c[j]

    print(total)

print(0)

Submission status: Runtime Error

Solution code:
import bisect
def mark(s, x):
    for i in xrange(x + x, len(s), x):
        s[i] = False

def sieve(n):
    s = [True] * n
    for x in xrange(2, int(n**0.5) + 1):
        if s[x]: mark(s, x)
    return [i for i in xrange(0,n) if s[i] and i > 1]


primes = sieve(10**5)
likes = []
for i in primes:
	if primes[bisect.bisect_left(primes,(i+1)/2)] == (i+1)/2:
		likes.append(i)

cs = [0 for i in range(10**5+1)]

i = 1
j = 0

while i < 10**5+1 and j < len(likes):
	if likes[j] > i:
		cs[i] = cs[i-1]

	else:
		cs[i] = cs[i-1]+1
		j +=1
	i += 1
t = cs[i-1]
while i < 10**5+1:
	cs[i] = t
	i += 1

q = int(input())
print len(likes)
for i in range(q):
	l,r = map(int,raw_input().split())
	print cs[r+1]- cs[l-1]

Submission status: Runtime Error

Solution code:
import sys

# 関数 solve は，もちろん，問題に応じて書き換える
def solve( lst_a, lst_b,n):
    if n.count("-")==1:
        answer= "No"
    else:
        N,NN=n.split("-")
        if lst_a == len(N) and lst_b == len(NN):
            answer = "Yes"
        else:
            answer = "No"
    return answer

# ここから下は，入力・出力形式が同じであれば，変えなくて良い．
def readQuestion():
    line1 = sys.stdin.readline().rstrip()
    [str_n, str_i] = line1.split(' ')
    line2 = sys.stdin.readline().rstrip()
    return (int(str_n), int(str_i), line2)

def main():
    n, i, s = readQuestion()
    answer = solve(n, i, s)
    print(answer)
    
if __name__ == '__main__':
    main()

Submission status: Runtime Error

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

int main(int argc, char const* argv[])
{
  int m;
  cin >> m;
  cout << 48 - m << endl;

  return 0;
}

Submission status: Runtime Error

Solution code:
import math
import bisect
Q=int(input())

querys = [list(map(int,input().split())) for x in range(Q)]

def siever(x):
  nums = [a for a in range(2,x+1)]
  primes = []
  while nums[0] <= int(math.sqrt(x))+1:
    tmp = nums.pop(0)
    primes.append(tmp)
    for num in nums:
      if num%tmp == 0:
        nums.remove(num)
        continue
  
  return (primes+nums)

L = 0
for query in querys:
  L = max(L,query[1])
primes = siever(L)
L2017= []
for prime in primes:
  if (prime+1)//2 in primes:
    L2017.append(prime)
result = [0]*(max(L2017)+1)
for l in L2017:
  result[l] = 1
for i in range(1,len(result)):
  result[i] += result[i-1]
for query in querys:
  if query[0] == query[1] and query[0] in L2017:
    print(1)
  else:
    if len(result) <= query[0]:
      print(0)
    elif len(result) <= query[1]:
      print(result[-1]-result[query[0]-1])
    else:
      print(result[query[1]]-result[query[0]-1])

Submission status: Runtime Error

Solution code:
a,b = map(int,input().split())
S = input()
def crazy(a,b,S):
    num = "0123456789"
    S = S[:A] + S[A+1:]
    if S[a] != "-":
        return False
    for i in S[:a]:
        if i not in num:
            return False
    return True

if crazy(a,b,S):
    print("Yes")
else:
    print("No")

Submission status: Runtime Error

Solution code:
date = input()
date = list(date)
date[3] = '8'
date = ''.join(date)
print(date)

Submission status: Runtime Error

Solution code:
d1 = 24 - M
ans = d1 + 24
print ans

Submission status: Runtime Error

Solution code:
#coding: utf-8
import re
A,B = map(int,input().split())
S = input()
find_underscore = re.findall("\-",S[A])
find_num_a = re.findall("[0-9]",S[:A-1])
find_num_b = re.findall("[0-9]",S[A+1:])
if find_underscore and find_num_a and find_num_b:
    print("Yes")
else:
    print("No")

Submission status: Runtime Error

Solution code:
print(int(input()-24)

Submission status: Runtime Error

Solution code:
m = input()
n = 48 - m
print(n)

Submission status: Runtime Error

Solution code:
M=input(int())

print(M+24)

Submission status: Runtime Error

Solution code:
N = int(input())
print(48-M)

Submission status: Runtime Error

Solution code:
import re
a,b = input().split()
ans = ["No", "Yes"]
print( ans[  re.match( '[0-9]{' + a + '}-[0-9]{' + b  + '}'  , input()) != None  ])

Submission status: Runtime Error

Solution code:
 print(48-map(int, input()))

Submission status: Runtime Error

Solution code:
M = map(int, input())
print 48-M

Submission status: Runtime Error

Solution code:
iko

Submission status: Runtime Error

Solution code:
n = int(input())
t = 0
st = 0
cn = []
sn = []
fn = []

for i in range(n-1):
  c,s,f = map(int,input().split())
  cn.append(c)
  sn.append(s)
  fn.append(f)

for j in range(n-1):
    t = 0
    for i in range(j,n-1):
      st = sn[i]
      if t <= sn[i]:
        t = sn[i]
      if t%fn[i] != 0:
          t += fn[i]-t%fn[i]
      t += cn[i]
    print(t)


print(0)

Submission status: Runtime Error

Solution code:
print((24 = M) + 24)

Submission status: Runtime Error

Solution code:
print(M-input())

Submission status: Runtime Error

Solution code:
M=input()
M=48-M
print(M)

Submission status: Runtime Error

Solution code:
N=input()
print(48-N)

Submission status: Runtime Error

Solution code:
N=input()
M=48-N
print(M)

Submission status: Runtime Error

Solution code:
def isprime(z):
    if z < 2:return False
    if z == 2:return True
    i = 2
    while i*i <= z:
        if z % i == 0:
            return False
        i+=1
    return True
n = int(input())
for i in range(n):
    l, r = map(int, input().split())
    c = 0
    for j in range(l, r+1):
        if isprime(j) and isprime((j+1)/2):
            c+=1
    print(c)

Submission status: Runtime Error

Solution code:
import math

def isPrime(num):
    if num < 2:
        return False
    else:
        rootNum = math.floor(math.sqrt(num))
        for i in range(2,rootNum+1):
            if num % i == 0:
                return False
    return True

def solve():
    lst = []
    count = int(input())
    for i in range(count):
        ans = 0
        l, r = map(int, input().split())
        t = l
        while k <= r
            if isPrime(k) and isPrime((k+1)/2):
                ans += 1
            k += 2
        lst.append(str(ans))
    print('\n'.join(lst))
solve()

Submission status: Runtime Error

Solution code:
i = input()
i = 24+i
print("{}".format(i))

Submission status: Runtime Error

Solution code:
i = input()
print(24+i)

Submission status: Runtime Error

Solution code:
a = int(raw_input())
print(48 - a)

Submission status: Runtime Error

Solution code:
import re

A, B = input().split()
A, B = int(A), int(B)
S = input()

if re.match(r"\d{%d}-\d{%d}"%(A, B), S):
    print("Yes")
else:
    print("No")

Submission status: Runtime Error

Solution code:

xs = sorted(map(int, input().split()))

if xs[0] != xs[1]:
    print(xs[0])
if xs[1] != xs[2]:
    print(xs[2])

Submission status: Runtime Error

Solution code:

xs = sorted(map(int, raw_input().split()))

if xs[0] != xs[1]:
    print(xs[0])
if xs[1] != xs[2]:
    print(xs[2])

Submission status: Runtime Error

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

if __name__ == '__main__':
  import sys
  argvs = sys.argv
  input = eval(argvs[1])
  if not isinstance(input, int):
    print 'not int'

  print (48 - input)

Submission status: Runtime Error

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

sliceA = S[0:A]
sliceB = S[A+1:A+B+1]

if sliceA.isdigit() and sliceB.isdigit() and S.find("-") == A and len(sliceA) == A and len(sliceB) == B:
    print("yes")
else:
    print("no")

Submission status: Runtime Error

Solution code:
m = int(input())
return 24-m+24

Submission status: Runtime Error

Solution code:
m = int(input())
return 24-m

Submission status: Runtime Error

Solution code:
import math

def is_prime_sqrt(q): #合成数xはp<=sqrt(x)を満たす素因子pを持つ
    if q == 1: #1は素数ではない
        return False
    if q == 2: #2は素数
        return True
    elif q % 2 == 0: #2以外の偶数は合成数
        return False
    for divisor in range(3, math.floor(math.sqrt(q))+1, 2): #繰り返しの上限は平方根
        if q % divisor == 0: #平方根までに約数があれば合成数
            return False
    return True

Q = int(input())

for i in range(Q):
    l, r = map(int, input().split())
    n = 0
    for q in range(l,r+1,2):
        if is_prime_sqrt(q) and is_prime_sqrt((q+1)/2):
            n += 1
    print(n)

Submission status: Runtime Error

Solution code:
a, b = map(int, input().split())
s = input()
try:
    first, second = s.split("-")
    if len(first) == a and len(second) == b:
        print("Yes")
    else:  
        print("No")
except:
    print("No")

Submission status: Runtime Error

Solution code:
a, b = map(int, input().split())
s = input()
first, second = s.split("-")
if len(first) == a and len(second) == b:
    print("Yes")
else:
    print("No")

Submission status: Runtime Error

Solution code:
m=input()
print(48-m)

Submission status: Runtime Error

Solution code:
print str(48 - int(raw_input))

Submission status: Runtime Error

Solution code:
n = int(input())
cc = []
ss = []
ff = []
for i in range(n-1):
    c, s, f = list(map(int, input().split()))
    cc.append(c)
    ss.append(s)
    ff.append(f)
for l in range(n-1):
    ans = ss[l]+cc[l]
    for k in range(l+1, n-1):
        temp = ss[k]
        while temp < ans:
            temp += ff[k]
        ans = temp + cc[k]
    print(ans)
print(0)

Submission status: Runtime Error

Solution code:
l = input().split()
a=input()

b=a.split("-")


if len(b[0]) == l[0] and len(b[1])==l[1] and and len(b)<3:
    print('YES')
else:
    print('NO')

Submission status: Runtime Error

Solution code:
Q = int(input())


M = 10**5 + 5
primes = [True] * M
primes[0] = False
primes[1] = False


for i in range(2, M):
    if primes[i]:
        for j in range(2, M//i):
            primes[i*j] = False

cnt = [0] * M

for i in range(3, M):
    cnt[i] = cnt[i-1]
    if primes[i] and primes[(i+1)//2]:
        cnt[i] += 1

for q in range(Q):
    l, r = map(int, input().split())
    print(cnt[r] - cnt[l-1])

Submission status: Runtime Error

Solution code:
print(48-int(input().split())