problem_id stringlengths 6 6 | user_id stringlengths 10 10 | time_limit float64 1k 8k | memory_limit float64 262k 1.05M | problem_description stringlengths 48 1.55k | codes stringlengths 35 98.9k | status stringlengths 28 1.7k | submission_ids stringlengths 28 1.41k | memories stringlengths 13 808 | cpu_times stringlengths 11 610 | code_sizes stringlengths 7 505 |
|---|---|---|---|---|---|---|---|---|---|---|
p03037 | u463655976 | 2,000 | 1,048,576 | We have N ID cards, and there are M gates. We can pass the i-th gate if we have one of the following ID cards: the L_i- th, (L_i+1)-th, ..., and R_i-th ID cards. How many of the ID cards allow us to pass all the gates alone? | ['N, M = map(int, input().split())\n\nallL = 1\nallR = N\nfor L, R in map(int, input().split()) in range(M):\n allL = max(allL, L)\n allR = min(allR, R)\n\nprint(max(allR - allL + 1, 0))\n', 'N, M = map(int, input().split())\n\nallL = 1\nallR = N\nfor L, R in (map(int, input().split()) for _ in range(M)):\n allL = m... | ['Runtime Error', 'Accepted'] | ['s699632945', 's387245097'] | [3060.0, 3188.0] | [21.0, 333.0] | [179, 187] |
p03037 | u470189643 | 2,000 | 1,048,576 | We have N ID cards, and there are M gates. We can pass the i-th gate if we have one of the following ID cards: the L_i- th, (L_i+1)-th, ..., and R_i-th ID cards. How many of the ID cards allow us to pass all the gates alone? | ['import sys\nimport numpy as np\nN,M= (int(i) for i in input().split(" ")) \n\nLR= np.array([[int(i) for i in input().split()] for i in range(M)]) \n\nL=LR[-1,0]\nR=LR[0,1]\n\nprint(int(abs(L-R+1)))', 'import sys\nimport numpy as np\nN,M= (int(i) for i in input().split(" ")) \n\nLR= np.array([[int(i) for i in input(... | ['Wrong Answer', 'Wrong Answer', 'Accepted'] | ['s017749028', 's126764995', 's069371321'] | [31664.0, 31648.0, 31664.0] | [495.0, 458.0, 472.0] | [189, 245, 276] |
p03037 | u471181540 | 2,000 | 1,048,576 | We have N ID cards, and there are M gates. We can pass the i-th gate if we have one of the following ID cards: the L_i- th, (L_i+1)-th, ..., and R_i-th ID cards. How many of the ID cards allow us to pass all the gates alone? | ['l_lst, r_lst = [], []\nfor i in range(m):\n l,r = map(int, input().split())\n l_lst.append(l)\n r_lst.append(r)\nres = min(r_lst)-max(l_lst)+1\nif res > 0:\n print(res)\nelse:\n print(0)', 'n,m = map(int, input().split())\nl_lst, r_lst = [], []\nfor i in range(m):\n l,r = map(int, input().split())\n l_lst.appe... | ['Runtime Error', 'Accepted'] | ['s448044524', 's845603115'] | [2940.0, 11052.0] | [17.0, 295.0] | [182, 214] |
p03037 | u478266845 | 2,000 | 1,048,576 | We have N ID cards, and there are M gates. We can pass the i-th gate if we have one of the following ID cards: the L_i- th, (L_i+1)-th, ..., and R_i-th ID cards. How many of the ID cards allow us to pass all the gates alone? | ['import numpy as np\n\nN, M = [int(i) for i in input().split()]\n\nLR = np.ones([M,2])\n\nfor i in range(M):\n LR[i][0],LR[i][1] = [int(i) for i in input().split()]\n \nmax_L = max(LR[:,0])\nmin_R = min(LR[:,1])\nif max_L < min_R:\n ans = int(min_R - max_L)\nelse:\n ans =0\n \nprint(ans)\n', 'import num... | ['Wrong Answer', 'Accepted'] | ['s943703612', 's215184954'] | [15964.0, 14032.0] | [592.0, 579.0] | [287, 290] |
p03037 | u480300350 | 2,000 | 1,048,576 | We have N ID cards, and there are M gates. We can pass the i-th gate if we have one of the following ID cards: the L_i- th, (L_i+1)-th, ..., and R_i-th ID cards. How many of the ID cards allow us to pass all the gates alone? | ['#!/usr/bin/env python3\n\nimport sys\n# import math\n# import re # re.compile(pattern) => ptn obj; p.search(s), p.match(s), p.finditer(s) => match obj; p.sub(after, s)\n\n# from collections import defaultdict # subclass of dict. defaultdict(facroty)\n# from collections impo... | ['Runtime Error', 'Accepted'] | ['s400095504', 's573579344'] | [11056.0, 10992.0] | [173.0, 177.0] | [2588, 2588] |
p03037 | u488178971 | 2,000 | 1,048,576 | We have N ID cards, and there are M gates. We can pass the i-th gate if we have one of the following ID cards: the L_i- th, (L_i+1)-th, ..., and R_i-th ID cards. How many of the ID cards allow us to pass all the gates alone? | ['#ABC 127 C Prison\nN,M= map(int,input().split())\nMIN=None\nMAX=None\nfor i in range(M):\n L,R= map(int,input().split())\n if MIN is None:\n MIN=L\n MAX=R\n elif MIN <L:\n MIN=L\n elif MAX > R:\n MAX =R\n print()\nprint(MAX-MIN+1)', '#ABC 127 C Prison\nN,M= map(int,input().s... | ['Wrong Answer', 'Accepted'] | ['s191420856', 's565032118'] | [3060.0, 3060.0] | [765.0, 318.0] | [259, 183] |
p03037 | u488611616 | 2,000 | 1,048,576 | We have N ID cards, and there are M gates. We can pass the i-th gate if we have one of the following ID cards: the L_i- th, (L_i+1)-th, ..., and R_i-th ID cards. How many of the ID cards allow us to pass all the gates alone? | ['N, M = map(int, input().split())\n\nfor i in range(M):\n L, R = map(int, input().split())\n pass_card = [i for i in range(L, R+1)]\n if i == 0:\n ans = pass_card\n elif i > 0:\n ans = list(set(pass_card[i - 1]) & set(pass_card[i]))\n\nprint(len(ans))', 'N, M = map(int, input().split())\n\nL_list = []\nR_li... | ['Runtime Error', 'Accepted'] | ['s585223533', 's194653967'] | [11056.0, 10996.0] | [28.0, 302.0] | [251, 229] |
p03037 | u490489966 | 2,000 | 1,048,576 | We have N ID cards, and there are M gates. We can pass the i-th gate if we have one of the following ID cards: the L_i- th, (L_i+1)-th, ..., and R_i-th ID cards. How many of the ID cards allow us to pass all the gates alone? | ['10 3\n3 6\n5 7\n6 9', '#C\nn, m = map(int, input().split())\nl = []\nr = []\nfor _ in range(m):\n tmp=list(map(int,input().split()))\n l.append(tmp[0])\n r.append(tmp[1])\nlmax = max(l)\nrmin = min(r)\n# print(lmax,rmin)\nif rmin >= lmax:\n print(rmin -lmax + 1)\nelse:\n print(0)\n'] | ['Runtime Error', 'Accepted'] | ['s031602417', 's730250661'] | [2940.0, 11040.0] | [17.0, 340.0] | [16, 259] |
p03037 | u491539020 | 2,000 | 1,048,576 | We have N ID cards, and there are M gates. We can pass the i-th gate if we have one of the following ID cards: the L_i- th, (L_i+1)-th, ..., and R_i-th ID cards. How many of the ID cards allow us to pass all the gates alone? | ['import numpy as np\nn,m=map(int,input().split())\npost_b = 0\npost_c = n\nfor i in range(m):\n b,c=map(int,input().split())\n if post_b < b:\n post_b = b\n if post_c > c:\n post_c = c\n\nprint(c-b+1)\n', 'import numpy as np\nn,m=map(int,input().split())\npost_b = 0\npost_c = n\nfor i in range(m... | ['Wrong Answer', 'Wrong Answer', 'Accepted'] | ['s401013718', 's420168101', 's745970158'] | [12472.0, 13624.0, 12504.0] | [417.0, 1034.0, 432.0] | [212, 301, 279] |
p03037 | u495678669 | 2,000 | 1,048,576 | We have N ID cards, and there are M gates. We can pass the i-th gate if we have one of the following ID cards: the L_i- th, (L_i+1)-th, ..., and R_i-th ID cards. How many of the ID cards allow us to pass all the gates alone? | ["N, M = map(int, input().split(' '))\nL_list=[]\nR_list=[]\n\nfor i in range(M):\n l,r = map(int, input().split(' '))\n L_list.append(l)\n R_list.append(r)\n\n\nall_list=[]\nnum_list = range(1,len(L_list))\n\n\ncnt = 0\nall_uniq = range(L_list[0],R_list[0]+1)\nprint(all_uniq)\nfor i in range(1,M):\n tmp_ra... | ['Wrong Answer', 'Accepted'] | ['s647433535', 's586359557'] | [35752.0, 11420.0] | [2105.0, 383.0] | [500, 311] |
p03037 | u497046426 | 2,000 | 1,048,576 | We have N ID cards, and there are M gates. We can pass the i-th gate if we have one of the following ID cards: the L_i- th, (L_i+1)-th, ..., and R_i-th ID cards. How many of the ID cards allow us to pass all the gates alone? | ['N, M = map(int, input().split())\nLs = []\nRs = []\nfor _ in range(M):\n L, R = map(int, input().split())\n Ls.append(L)\n Rs.append(R+1)\nL_max = max(Ls)\nR_min = min(Rs)\nprint(max(R_min - L_max, 0)', 'N, M = map(int, input().split())\nLs = []\nRs = []\nfor _ in range(M):\n L, R = map(int, input().split... | ['Runtime Error', 'Accepted'] | ['s865630085', 's536095464'] | [2940.0, 11024.0] | [17.0, 324.0] | [200, 201] |
p03037 | u499381410 | 2,000 | 1,048,576 | We have N ID cards, and there are M gates. We can pass the i-th gate if we have one of the following ID cards: the L_i- th, (L_i+1)-th, ..., and R_i-th ID cards. How many of the ID cards allow us to pass all the gates alone? | ['n, k = list(map(int, input().split()))\nmin_list = []\nmax_list = []\nfor i in range(k):\n j, l = list(map(int, input().split())):\n min_list.append(j)\n max_list.append(l)\n\n\nprint(max(0, min(max_list) - max(min_list) + 1))', 'n, k = list(map(int, input().split()))\nmin_list = []\nmax_list = []\nfor i in ... | ['Runtime Error', 'Accepted'] | ['s987942040', 's688412959'] | [2940.0, 11076.0] | [17.0, 343.0] | [226, 225] |
p03037 | u500297289 | 2,000 | 1,048,576 | We have N ID cards, and there are M gates. We can pass the i-th gate if we have one of the following ID cards: the L_i- th, (L_i+1)-th, ..., and R_i-th ID cards. How many of the ID cards allow us to pass all the gates alone? | ['N = int(input())\nA = []\nB = []\nfor _ in range(N):\n a, b = map(int, input().split())\n A.append(a)\n B.append(b)\nans = min(B) - max(A) + 1\n\nif ans < 1:\n print(0)\nelse:\n print(ans)', 'N, M = map(int, input().split())\nA = []\nB = []\nfor _ in range(M):\n a, b = map(int, input().split())\n ... | ['Runtime Error', 'Accepted'] | ['s672321688', 's051758439'] | [3064.0, 11052.0] | [19.0, 300.0] | [191, 207] |
p03037 | u502028059 | 2,000 | 1,048,576 | We have N ID cards, and there are M gates. We can pass the i-th gate if we have one of the following ID cards: the L_i- th, (L_i+1)-th, ..., and R_i-th ID cards. How many of the ID cards allow us to pass all the gates alone? | ['n,m = map(int,input().split())\na = list(map(int,input().split()))\nfor i in range(m):\n b,c = map(int,input().split())\n a.extend([c] * b)\na.sort(reverse=True)\nprint(sum(a[:n]))', 'n,m = map(int,input().split())\nL = []\nR = []\nfor i in range(m):\n l,r = map(int,input().split())\n L.append(l)\n R.a... | ['Runtime Error', 'Accepted'] | ['s489785901', 's454292321'] | [2092076.0, 10996.0] | [2240.0, 309.0] | [180, 237] |
p03037 | u502731482 | 2,000 | 1,048,576 | We have N ID cards, and there are M gates. We can pass the i-th gate if we have one of the following ID cards: the L_i- th, (L_i+1)-th, ..., and R_i-th ID cards. How many of the ID cards allow us to pass all the gates alone? | ['\nn, m = map(int, input().split())\nL = [0] * m\nR = [0] * def funcname(self, parameter_list):\n pass\nfor i in range(m):\n L[i], R[i] = map(int, input().split())\nprint(min(R) - max(L) + 1)', '\nn, m = map(int, input().split())\nL = [0] * m\nR = [0] * m\nfor i in range(m):\n L[i], R[i] = map(int, input().sp... | ['Runtime Error', 'Runtime Error', 'Accepted'] | ['s206692099', 's282873534', 's956321786'] | [2940.0, 3060.0, 10868.0] | [17.0, 17.0, 299.0] | [189, 173, 173] |
p03037 | u503111914 | 2,000 | 1,048,576 | We have N ID cards, and there are M gates. We can pass the i-th gate if we have one of the following ID cards: the L_i- th, (L_i+1)-th, ..., and R_i-th ID cards. How many of the ID cards allow us to pass all the gates alone? | ['N,M = map(int,input().split())\nX = []\nfor i in range(M):\n L,R = map(int,input().split())\n for j in range (R-L+1):\n A = L + j\n X.append(A)\nX_duplicate = [x for x in set(X) if X.count(x) > 1]\nL=[str(a) for a in X_duplicate]\nL=" ".join(L)\nprint(L)', 'N,M = map(int,input().split())\nL= 0\nR = 10 ** 5\nf... | ['Wrong Answer', 'Accepted'] | ['s078473282', 's308996818'] | [515632.0, 3060.0] | [2138.0, 320.0] | [252, 183] |
p03037 | u504562455 | 2,000 | 1,048,576 | We have N ID cards, and there are M gates. We can pass the i-th gate if we have one of the following ID cards: the L_i- th, (L_i+1)-th, ..., and R_i-th ID cards. How many of the ID cards allow us to pass all the gates alone? | ['N, M = [int(i) for i in input().split()]\nL = 1\nR = 100000\nfor _ in range(M):\n l, r = [int(i) for i in input().split()]\n L = max(L, l)\n R = min(R, r)\nif L <= R:\n print(0)\nelse:\n print(R-L+1)', 'N, M = [int(i) for i in input().split()]\nL = 1\nR = 100000\nfor _ in range(M):\n l, r = [int(i) ... | ['Wrong Answer', 'Accepted'] | ['s521160549', 's273882498'] | [3060.0, 3060.0] | [329.0, 335.0] | [204, 203] |
p03037 | u514136877 | 2,000 | 1,048,576 | We have N ID cards, and there are M gates. We can pass the i-th gate if we have one of the following ID cards: the L_i- th, (L_i+1)-th, ..., and R_i-th ID cards. How many of the ID cards allow us to pass all the gates alone? | ['N, M = map(int, input().split())\nl_max = -float("inf")\nr_min = float("inf")\n\nfor i in range(M):\n l, r = map(int, input().split())\n if l > l_max:\n l_max = l\n if r < r_min:\n r_min = r\nif r_min>N:\n r_min = N\nlen(range(l_max, r_min+1))', 'N, M = map(int, input().split())\nl_max = -fl... | ['Wrong Answer', 'Accepted'] | ['s959805124', 's213788709'] | [3064.0, 3060.0] | [282.0, 283.0] | [257, 264] |
p03037 | u514222361 | 2,000 | 1,048,576 | We have N ID cards, and there are M gates. We can pass the i-th gate if we have one of the following ID cards: the L_i- th, (L_i+1)-th, ..., and R_i-th ID cards. How many of the ID cards allow us to pass all the gates alone? | ["# -*- coding: utf-8 -*-\nimport sys\n\ns = (input().split(' '))\n\nn,m = [int(i) for i in s]\n\nl_list = []\nr_list = []\n\nfor i in range(m):\n s = (input().split(' '))\n l,r = [int(i) for i in s]\n l_list.append(l)\n r_list.append(r)\n\nrange = (max(l_list), min(r_list))\n\nprint(min(0, range[1] - range... | ['Wrong Answer', 'Runtime Error', 'Accepted'] | ['s118259615', 's173977336', 's151056292'] | [11020.0, 3064.0, 10996.0] | [316.0, 17.0, 325.0] | [309, 349, 348] |
p03037 | u517152997 | 2,000 | 1,048,576 | We have N ID cards, and there are M gates. We can pass the i-th gate if we have one of the following ID cards: the L_i- th, (L_i+1)-th, ..., and R_i-th ID cards. How many of the ID cards allow us to pass all the gates alone? | ['#\nimport sys\nimport math\nimport numpy as np\nimport itertools\n\n\n\nn, m = (int(i) for i in input().split()) \n\n\n\nlr = [[int(i) for i in input().split()] for i in range(m)] \n\nl=1\nr=n\nfor i in range(m):\n l=max(l,lr[i][0])\n r=min(r,lr[i][1])\n\nprint(l,r)\n\na=r-l+1\nif a < 0:\n a=0\nprint(a)\n\n... | ['Wrong Answer', 'Accepted'] | ['s581530959', 's955665876'] | [30072.0, 30096.0] | [502.0, 492.0] | [347, 348] |
p03037 | u519968172 | 2,000 | 1,048,576 | We have N ID cards, and there are M gates. We can pass the i-th gate if we have one of the following ID cards: the L_i- th, (L_i+1)-th, ..., and R_i-th ID cards. How many of the ID cards allow us to pass all the gates alone? | ['n,m=map(int,input().split())\nl=1\nr=m\nfor _ in range(m):\n l2,r2=map(int,input().split())\n l=max(l,l2)\n r=min(r,r2)\nprint(r-l+1)\n', 'n,m=map(int,input().split())\nl=1\nr=10**5\nfor _ in range(m):\n l2,r2=map(int,input().split())\n l=max(l,l2)\n r=min(r,r2)\nprint(max(r-l+1,0))\n'] | ['Wrong Answer', 'Accepted'] | ['s651125892', 's558983652'] | [3060.0, 3060.0] | [321.0, 322.0] | [130, 141] |
p03037 | u521323621 | 2,000 | 1,048,576 | We have N ID cards, and there are M gates. We can pass the i-th gate if we have one of the following ID cards: the L_i- th, (L_i+1)-th, ..., and R_i-th ID cards. How many of the ID cards allow us to pass all the gates alone? | ['n, m = map(int, input().split())\n\nans=set()\nl, r = map(int, input().split())\nfor j in range(l,r+1):\n ans.add(j)\n\nfor i in range(m-1):\n l, r = map(int, input().split())\n temp=set()\n lm=min(list(ans))\n rm=min(list(ans))\n for j in range(min(l,lm), min(r,rm)+1):\n temp.add(j)\n ans=temp & ans\n\np... | ['Runtime Error', 'Accepted'] | ['s770865653', 's586944388'] | [11884.0, 3060.0] | [2104.0, 318.0] | [316, 193] |
p03037 | u522293645 | 2,000 | 1,048,576 | We have N ID cards, and there are M gates. We can pass the i-th gate if we have one of the following ID cards: the L_i- th, (L_i+1)-th, ..., and R_i-th ID cards. How many of the ID cards allow us to pass all the gates alone? | ['n,k = map(int,input().split())\nrc = [list(map(int,input().split())) for i in range(k)]\n\ntmp = set(range(1,n+1))\n\nfor i in rc:\n tmp = tmp & set(range(i[0],i[1]))\n\nprint(len(tmp))\n', 'n,k = map(int,input().split())\nrc = [list(map(int,input().split())) for i in range(k)]\ntranspose = [x for x in zip(*rc)]\n... | ['Wrong Answer', 'Accepted'] | ['s475234201', 's992322209'] | [46192.0, 36040.0] | [2106.0, 355.0] | [181, 212] |
p03037 | u527261492 | 2,000 | 1,048,576 | We have N ID cards, and there are M gates. We can pass the i-th gate if we have one of the following ID cards: the L_i- th, (L_i+1)-th, ..., and R_i-th ID cards. How many of the ID cards allow us to pass all the gates alone? | ['n,m=map(int,input().split())\nl=[]\nr=[]\nfor i in range(m):\n a,b=map(int,input().split())\n l.append(a)\n r.append(b)\nlm=max(l)\nrm=min(r)\nif lm-rm<0:\n print(0)\nelse:\n print(lm-rm+1)\n', 'n,m=map(int,input().split())\nL=100000\nR=100000\nfor i in range(m):\n l=int(input())\n r=int(input())\n L=max(L,l)... | ['Wrong Answer', 'Runtime Error', 'Runtime Error', 'Runtime Error', 'Runtime Error', 'Runtime Error', 'Wrong Answer', 'Accepted'] | ['s009879428', 's407790126', 's427488559', 's616657855', 's784787357', 's849639043', 's941391317', 's378244646'] | [10996.0, 3060.0, 3060.0, 3060.0, 3060.0, 3060.0, 3060.0, 3060.0] | [301.0, 17.0, 17.0, 18.0, 17.0, 17.0, 321.0, 314.0] | [183, 150, 150, 153, 157, 153, 147, 142] |
p03037 | u527311983 | 2,000 | 1,048,576 | We have N ID cards, and there are M gates. We can pass the i-th gate if we have one of the following ID cards: the L_i- th, (L_i+1)-th, ..., and R_i-th ID cards. How many of the ID cards allow us to pass all the gates alone? | ['n,m = map(int, input().split())\n\nl = []\nr = []\n\nfor i in range(M):\n ln, rn = map(int, input().split())\n l.append(ln)\n r.append(rn)\n \nlmax = max(l)\nrmin = min(r)\n\nans = rmin - lmax + 1\n\nprint(ans)\n', 'n,m = map(int, input().split())\n\nl, r = []\n\nfor i in range(M):\n ln, rn = map(int, input().sp... | ['Runtime Error', 'Runtime Error', 'Accepted'] | ['s294045957', 's909156477', 's473532584'] | [3060.0, 3060.0, 10996.0] | [17.0, 17.0, 310.0] | [200, 195, 226] |
p03037 | u529012223 | 2,000 | 1,048,576 | We have N ID cards, and there are M gates. We can pass the i-th gate if we have one of the following ID cards: the L_i- th, (L_i+1)-th, ..., and R_i-th ID cards. How many of the ID cards allow us to pass all the gates alone? | ['N, M = map(int, input().split())\nL_list = []\nR_list = []\n\nfor i in range(M):\n l, r = map(int, input().split())\n L = max(L, l)\n R = min(R, r)\n\nprint(L - R + 1)', 'N, M = map(int, input().split())\nL = 0\nR = N\nfor i in range(M):\n l, r = map(int, input().split())\n L = max(L, l)\n R = min(R... | ['Runtime Error', 'Wrong Answer', 'Wrong Answer', 'Accepted'] | ['s007230722', 's103372496', 's550722542', 's261530324'] | [3060.0, 3060.0, 3060.0, 3188.0] | [17.0, 317.0, 318.0, 300.0] | [167, 154, 162, 215] |
p03037 | u536560967 | 2,000 | 1,048,576 | We have N ID cards, and there are M gates. We can pass the i-th gate if we have one of the following ID cards: the L_i- th, (L_i+1)-th, ..., and R_i-th ID cards. How many of the ID cards allow us to pass all the gates alone? | ['N, M = map(int, input().split())\nL = [0] * M\nR = [0] * M\nL, R = map(int, input().split())\nans = set(list(range(L, R+1)))\nfor i in range(M-1):\n L, R = map(int, input().split())\n ans = ans & set(list(range(L, R+1)))\n if len(ans) == 0:\n print(0)\nprint(len(ansN, M = map(int, input().split())\nL = [0] * M\... | ['Runtime Error', 'Accepted'] | ['s469606744', 's366675877'] | [3064.0, 12408.0] | [17.0, 300.0] | [424, 182] |
p03037 | u540698208 | 2,000 | 1,048,576 | We have N ID cards, and there are M gates. We can pass the i-th gate if we have one of the following ID cards: the L_i- th, (L_i+1)-th, ..., and R_i-th ID cards. How many of the ID cards allow us to pass all the gates alone? | ['from sys import stdin\n\nn, m = (int(x) for x in stdin.readline().rstrip().split())\nlr = [stdin.readline().rstrip().split() for _ in range(m)]\nl = max([i[0] for i in lr])\nr = min([i[1] for i in lr])\n\nif l <= r:\n print(r-l+1)\nelse:\n print(0)\n', 'from sys import stdin\n\nn, m = (int(x) for x in stdin.rea... | ['Runtime Error', 'Accepted'] | ['s180192847', 's168191072'] | [33124.0, 36196.0] | [119.0, 152.0] | [245, 254] |
p03037 | u542506429 | 2,000 | 1,048,576 | We have N ID cards, and there are M gates. We can pass the i-th gate if we have one of the following ID cards: the L_i- th, (L_i+1)-th, ..., and R_i-th ID cards. How many of the ID cards allow us to pass all the gates alone? | ['n, m = map(int, input().split())\n\nimport numpy as np\n\nrets = np.array([0] * n)\nlmax = n\nrmin = 0\nfor _ in range(m):\n l, r = map(int, input().split())\n lmax = max(l, lmax)\n rmin = min(r, rmin)\nprint(rmin - lmax + 1 if rmin - lmax + 1 > 0 else 0)\n\n\n', 'n, m = map(int, input().split())\n\nimport numpy a... | ['Wrong Answer', 'Accepted'] | ['s902613881', 's470961487'] | [14024.0, 14024.0] | [463.0, 463.0] | [250, 250] |
p03037 | u543894008 | 2,000 | 1,048,576 | We have N ID cards, and there are M gates. We can pass the i-th gate if we have one of the following ID cards: the L_i- th, (L_i+1)-th, ..., and R_i-th ID cards. How many of the ID cards allow us to pass all the gates alone? | ['from sys import stdin\nN, M = [int(x) for x in stdin.readline().rstrip().split()]\nl = [[int(x) for x in stdin.readline().rstrip().split()] for _ in range(M)]\n\nsMax = 0\neMin = 0\nfor s, e in l:\n if sMax < s or sMax == 0:\n sMax = s\n if eMin > e or eMin == 0:\n eMin = e\n\nprint(len(range(eMin, sMax))+1)'... | ['Wrong Answer', 'Wrong Answer', 'Accepted'] | ['s240576280', 's510382287', 's357341596'] | [21156.0, 21156.0, 3060.0] | [200.0, 187.0, 320.0] | [305, 282, 205] |
p03037 | u545368057 | 2,000 | 1,048,576 | We have N ID cards, and there are M gates. We can pass the i-th gate if we have one of the following ID cards: the L_i- th, (L_i+1)-th, ..., and R_i-th ID cards. How many of the ID cards allow us to pass all the gates alone? | ['\nN, M = map(int,input().split())\n\nfrom itertools import accumulate\nimos = [0]*(N+1)\nfor i in range(M):\n L,R = map(int,input().split())\n imos[L] += 1\n imos[R+1] -= 1\nacc = list(accumulate(imos))\nprint(sum([1 for a in acc if a == M]))', '\n\nN, M = map(int,input().split())\nfrom itertools import accu... | ['Runtime Error', 'Accepted'] | ['s248261826', 's963919999'] | [7868.0, 8636.0] | [323.0, 339.0] | [253, 253] |
p03037 | u547167033 | 2,000 | 1,048,576 | We have N ID cards, and there are M gates. We can pass the i-th gate if we have one of the following ID cards: the L_i- th, (L_i+1)-th, ..., and R_i-th ID cards. How many of the ID cards allow us to pass all the gates alone? | ['n,m=map(int,input().split())\nL,R=10**18,0\nfor i in range(m):\n l,r=map(int,input().split())\n L=max(L,l)\n R=min(R,r)\nif R<L:\n print(0)\nelse:\n print(R-L+1)', 'n,m=map(int,input().split())\nL,R=0,10**18\nfor i in range(m):\n l,r=map(int,input().split())\n L=max(L,l)\n R=min(R,r)\nif R<L:\n print(0)\nels... | ['Wrong Answer', 'Accepted'] | ['s385709335', 's835020459'] | [3060.0, 3060.0] | [322.0, 318.0] | [157, 158] |
p03037 | u547608423 | 2,000 | 1,048,576 | We have N ID cards, and there are M gates. We can pass the i-th gate if we have one of the following ID cards: the L_i- th, (L_i+1)-th, ..., and R_i-th ID cards. How many of the ID cards allow us to pass all the gates alone? | ['N,M=map(int,input().split())\nLR=[list(map(int,input().split())) for _ in range(M)]\n\nl=1\nr=N\n\nfor i in LR:\n print(i)\n if i[0]>l:\n l=i[0]\n if i[1]<r:\n r=i[1]\n\nif r>=l:\n print(r-l+1)\nelse:\n print(0)', 'N,M=map(int,input().split())\nLR=[list(map(int,input().split())) for _ in ... | ['Wrong Answer', 'Accepted'] | ['s319321915', 's241127908'] | [29488.0, 27344.0] | [462.0, 348.0] | [224, 225] |
p03037 | u548178442 | 2,000 | 1,048,576 | We have N ID cards, and there are M gates. We can pass the i-th gate if we have one of the following ID cards: the L_i- th, (L_i+1)-th, ..., and R_i-th ID cards. How many of the ID cards allow us to pass all the gates alone? | ["isstr=input()\nn,m = [int(i) for i in isstr.split(' ')]\ngate=[0]*m\nfor i in range(m):\n a,b=[int(i) for i in input().split(' ')]\n gate[i]=set([j for j in range(a,b+1)])\nresult=reduce(lambda x,y:x&y, gate)\ncount=0\nfor re in result:\n if re <=n:\n count+=1\nprint(count)\n \t", "isstr=input()\nn,m = [in... | ['Runtime Error', 'Runtime Error', 'Runtime Error', 'Wrong Answer', 'Accepted'] | ['s154923655', 's328942611', 's820381746', 's901293754', 's264605848'] | [2080192.0, 2940.0, 2940.0, 12916.0, 10868.0] | [2228.0, 24.0, 17.0, 2104.0, 291.0] | [277, 550, 553, 227, 210] |
p03037 | u548308904 | 2,000 | 1,048,576 | We have N ID cards, and there are M gates. We can pass the i-th gate if we have one of the following ID cards: the L_i- th, (L_i+1)-th, ..., and R_i-th ID cards. How many of the ID cards allow us to pass all the gates alone? | ["\n\nv = [int(d) for d in input().split()]\n\nLM = []\nfor d in range(v[1]):\n LM.append([int(d) for d in input().split()])\n\nL = [d[0] for d in LM]\nM = [d[1] for d in LM]\nL.sort()\nM.sort()\nif M[0] <= L[-1]:\n if M[0] <= v[0]:\n print(M[0]-L[-1]+1)\n exit()\n else:\n print(v[0]-L[-1]+... | ['Wrong Answer', 'Accepted'] | ['s988657142', 's094882234'] | [23244.0, 23244.0] | [441.0, 403.0] | [339, 339] |
p03037 | u548545174 | 2,000 | 1,048,576 | We have N ID cards, and there are M gates. We can pass the i-th gate if we have one of the following ID cards: the L_i- th, (L_i+1)-th, ..., and R_i-th ID cards. How many of the ID cards allow us to pass all the gates alone? | ['n, m = map(int, input().split())\nl, r = map(int, input().split())\nfor i in range(m-1):\n l, _ = map(int, input().split()) \nprint(max(l-r+1, 0))\n', 'n, m = map(int, input().split())\nl, r = map(int, input().split())\nfor i in range(m-1):\n l_c, r_c = map(int, input().split()) \n l = max(l, l_c)\n r = m... | ['Wrong Answer', 'Accepted'] | ['s814011698', 's590946789'] | [3060.0, 3060.0] | [268.0, 315.0] | [146, 189] |
p03037 | u548834738 | 2,000 | 1,048,576 | We have N ID cards, and there are M gates. We can pass the i-th gate if we have one of the following ID cards: the L_i- th, (L_i+1)-th, ..., and R_i-th ID cards. How many of the ID cards allow us to pass all the gates alone? | ['N, M = map(int, input().split())\nl = []\nr = []\nfor _ in range(M):\n s, t = map(int, input().split())\n l.append(s)\n r.append(t)\n \nlm = max(l)\nrm = min(r)\nprint(max[rm - lm + 1, 0])', 'N, M = map(int, input().split())\nl = []\nr = []\nfor _ in range(M):\n s, t = map(int, input().split())\n l.append(s)\n ... | ['Runtime Error', 'Accepted'] | ['s509168808', 's523151692'] | [11032.0, 10996.0] | [300.0, 296.0] | [182, 184] |
p03037 | u554954744 | 2,000 | 1,048,576 | We have N ID cards, and there are M gates. We can pass the i-th gate if we have one of the following ID cards: the L_i- th, (L_i+1)-th, ..., and R_i-th ID cards. How many of the ID cards allow us to pass all the gates alone? | ['N,M=map(int,input().split())\nL=[]\nR=[]\nfor i in range(M):\n l,r=map(int,input().split())\n L.append(l)\n R.append(r)\nmax_l=max(L)\nmin_r=min(R)\nif max_l-min_r>=0:\n print(max_l-min_r+1)\nelse:\n print(0)', 'N,M=map(int,input().split())\nL=[]\nR=[]\nfor i in range(M):\n l,r=map(int,input().split... | ['Wrong Answer', 'Accepted'] | ['s676169468', 's537627908'] | [10996.0, 10980.0] | [298.0, 296.0] | [211, 211] |
p03037 | u556589653 | 2,000 | 1,048,576 | We have N ID cards, and there are M gates. We can pass the i-th gate if we have one of the following ID cards: the L_i- th, (L_i+1)-th, ..., and R_i-th ID cards. How many of the ID cards allow us to pass all the gates alone? | ['n,m = map(int,input().split())\nls = [[int(x) for x in input().split()]for i in range(m)]\nlst = []\nans = 0\nans_2 = 0\nfor i in range(m):\n a,b = ls[i][0],ls[i][1]\n for j in range(n):\n if a<=j<=b:\n lst.append(j)\n if lst(j) == m:\n break\nfor k in range(n):\n if (lst.co... | ['Runtime Error', 'Runtime Error', 'Accepted'] | ['s192552471', 's376785811', 's055932262'] | [21156.0, 2940.0, 16896.0] | [312.0, 17.0, 206.0] | [350, 301, 213] |
p03037 | u558452954 | 2,000 | 1,048,576 | We have N ID cards, and there are M gates. We can pass the i-th gate if we have one of the following ID cards: the L_i- th, (L_i+1)-th, ..., and R_i-th ID cards. How many of the ID cards allow us to pass all the gates alone? | ['N,M=map(int,input().split())\nL=[0]*M\nR=[0]*M\nfor i range(M):\n L[i],R[i]=map(int,input().split())\n\ndef prison(N,M,L,R):\n count=0\n for n in range(N):\n num_of_truth=0\n for l,r in zip(L,R):\n if l<=(n+1)<=r:\n num_of_truth+=1\n if num_of_truth==M:\n ... | ['Runtime Error', 'Runtime Error', 'Accepted'] | ['s567434987', 's934613955', 's908759797'] | [2940.0, 2940.0, 10960.0] | [18.0, 17.0, 310.0] | [356, 320, 243] |
p03037 | u561358604 | 2,000 | 1,048,576 | We have N ID cards, and there are M gates. We can pass the i-th gate if we have one of the following ID cards: the L_i- th, (L_i+1)-th, ..., and R_i-th ID cards. How many of the ID cards allow us to pass all the gates alone? | ['i = input().split(" ")\n\nN = int(i[0])\nM = int(i[1])\n\nmi = 0\nma = N\n\nfor j in range(M):\n\ti = input().split(" ")\n\tl = int(i[0])\n\tr = int(i[1])\n\tif l > mi:\n\t\tmi = l\n\tif r < ma:\n\t\tma = r\n\tprint(mi, ma)\n\nprint(ma - mi + 1)\n', 'i = input().split(" ")\n\nN = int(i[0])\nM = int(i[1])\n\nmi = 0\nm... | ['Wrong Answer', 'Wrong Answer', 'Accepted'] | ['s335098226', 's844542713', 's489009336'] | [4212.0, 4212.0, 3064.0] | [830.0, 859.0, 289.0] | [218, 254, 239] |
p03037 | u562015767 | 2,000 | 1,048,576 | We have N ID cards, and there are M gates. We can pass the i-th gate if we have one of the following ID cards: the L_i- th, (L_i+1)-th, ..., and R_i-th ID cards. How many of the ID cards allow us to pass all the gates alone? | ['N,M = map(int,input().split())\nmin = 0\nmax = N\n\nfor _ in range(M):\n L_i,R_i = map(int,input().split())\n if L_i > min:\n min = L_i\n if R_i < max:\n max = R_i\n\nif min > max:\n print("0")\nelse:\n print(max - max + 1)\n\n', 'N,M = map(int,input().split())\nmin = 0\nmax = N\n\nfor _ ... | ['Wrong Answer', 'Wrong Answer', 'Accepted'] | ['s884530211', 's889814196', 's697581843'] | [3060.0, 3060.0, 3060.0] | [289.0, 287.0, 286.0] | [240, 238, 238] |
p03037 | u564770050 | 2,000 | 1,048,576 | We have N ID cards, and there are M gates. We can pass the i-th gate if we have one of the following ID cards: the L_i- th, (L_i+1)-th, ..., and R_i-th ID cards. How many of the ID cards allow us to pass all the gates alone? | ['n,m = map(int,input().split())\nls = [i for i in range(m)]\nrs = [i for i in range(m)]\ncnt = 0\nfor _ in range(m):\n ls[_],rs[_] = map(int,input().split())\n\nmaxl = max(ls)\nminr = min(rs)\n\nfor nn in range(1,n+1):\n if maxl <= nn or minr >= nn:\n cnt += 1\n\nprint(cnt)', 'n,m = map(int,input().split(... | ['Wrong Answer', 'Accepted'] | ['s083466250', 's014734602'] | [11056.0, 11056.0] | [314.0, 309.0] | [272, 272] |
p03037 | u568595296 | 2,000 | 1,048,576 | We have N ID cards, and there are M gates. We can pass the i-th gate if we have one of the following ID cards: the L_i- th, (L_i+1)-th, ..., and R_i-th ID cards. How many of the ID cards allow us to pass all the gates alone? | ['N, M = map(int, input().split())\nL = []\nR = []\n\nfor _ in range(M):\n l, r = map(int, input().split())\n L.append(l)\n R.append(r)\nprint(max(L)-min(R)+1)', 'N, M = map(int, input().split())\nL = []\nR = []\n\nfor _ in range(M):\n l, r = map(int, input().split())\n L.append(l)\n R.append(r)\nans ... | ['Wrong Answer', 'Accepted'] | ['s774563816', 's347226887'] | [10996.0, 10996.0] | [303.0, 296.0] | [158, 184] |
p03037 | u572940434 | 2,000 | 1,048,576 | We have N ID cards, and there are M gates. We can pass the i-th gate if we have one of the following ID cards: the L_i- th, (L_i+1)-th, ..., and R_i-th ID cards. How many of the ID cards allow us to pass all the gates alone? | ['N,M = map(int,input().split())\nL = []\nR = []\nLR = [list(map(int,input().split())) for _ in range(M)]\nfor i in range(M):\n L.append(LR[i][0])\ncountL = 0\ncountL = max(L)\nfor j in range(M):\n R.append(LR[j][1])\ncountR = 0\ncountR = min(R)\nif countR >= countL:\n print(0)\nelse:\n print(countR-countL+... | ['Wrong Answer', 'Accepted'] | ['s727360188', 's885469511'] | [29032.0, 29032.0] | [365.0, 361.0] | [319, 327] |
p03037 | u573754721 | 2,000 | 1,048,576 | We have N ID cards, and there are M gates. We can pass the i-th gate if we have one of the following ID cards: the L_i- th, (L_i+1)-th, ..., and R_i-th ID cards. How many of the ID cards allow us to pass all the gates alone? | ["n,m=map(int,input().split())\na=0\nb=float('inf')\nfor i in range(m):\n c,d=map(int,input().spilt())\n a=max(a,c)\n b=min(b,d)\nprint(max(0,b-a+1))\n", 'n,m=map(int,input().split())\nll=0\nrr=n+1\nfor i in range(m):\n l,r=map(int,input().split())\n ll=max(ll,l)\n rr=min(rr,r)\n\nif rr<ll:\n ... | ['Runtime Error', 'Accepted'] | ['s761589880', 's681439871'] | [3060.0, 3060.0] | [17.0, 322.0] | [156, 176] |
p03037 | u575750790 | 2,000 | 1,048,576 | We have N ID cards, and there are M gates. We can pass the i-th gate if we have one of the following ID cards: the L_i- th, (L_i+1)-th, ..., and R_i-th ID cards. How many of the ID cards allow us to pass all the gates alone? | ['t = input().split()\nn = int(t[0])\nm = int(t[1])\n\nlow = 0\nhigh = n\nfor i in range(0, m):\n tmp = input().split()\n if int(tmp[0]) > low:\n low = int(tmp[0])\n if int(tmp[1]) < high:\n high = int(tmp[1])\n\nif high =< low:\n num = 0\nelse:\n num = high-low+1\nprint(num)', 't = input().split()\nn = int(... | ['Runtime Error', 'Accepted'] | ['s064463831', 's640627008'] | [2940.0, 3064.0] | [18.0, 268.0] | [268, 269] |
p03037 | u577138895 | 2,000 | 1,048,576 | We have N ID cards, and there are M gates. We can pass the i-th gate if we have one of the following ID cards: the L_i- th, (L_i+1)-th, ..., and R_i-th ID cards. How many of the ID cards allow us to pass all the gates alone? | ['N, M = map(int, input().split())\nx_min, x_max = [], []\nfor i in range(M):\n L, R = map(int, input().split())\n x_min.append(L)\n x_max.append(R)\n \nprint(max(x_max) - min(x_min) + 1)', 'N, M = map(int, input().split())\nx_min, x_max = [], []\nfor i in range(M):\n L, R = map(int, input().split())\n x_min.ap... | ['Wrong Answer', 'Accepted'] | ['s318371609', 's721321152'] | [11052.0, 11052.0] | [302.0, 295.0] | [183, 235] |
p03037 | u580697892 | 2,000 | 1,048,576 | We have N ID cards, and there are M gates. We can pass the i-th gate if we have one of the following ID cards: the L_i- th, (L_i+1)-th, ..., and R_i-th ID cards. How many of the ID cards allow us to pass all the gates alone? | ['#coding:utf-8\nn, m = map(int, input().split())\nl, r = 0, 10**6\nfor i in range(m):\n a, b = map(int, input().split())\n l = max(l, a)\n r = min(r, b)\nprint(r - l + 1 if r <= l else 0)', '# coding: utf-8\nN, M = map(int, input().split())\nL, R = 0, 10**6\ncard = []\nfor i in range(M):\n l, r = map(int, ... | ['Wrong Answer', 'Accepted'] | ['s044072393', 's457994858'] | [3188.0, 3064.0] | [320.0, 319.0] | [188, 200] |
p03037 | u581187895 | 2,000 | 1,048,576 | We have N ID cards, and there are M gates. We can pass the i-th gate if we have one of the following ID cards: the L_i- th, (L_i+1)-th, ..., and R_i-th ID cards. How many of the ID cards allow us to pass all the gates alone? | ['card, gate = map(int, input().split())\nmax_l = 0\nmin_r = 100000\nfor i in range(gate):\n l, r = map(int, input().split())\n max_l = max(max_l, l)\n min_r = min(min_r, r)\nprint(max_l, min_r) \nprint(len(range(max_l, min_r+1)))', 'N, M = map(int, input().split())\n\nL = []\nR = []\nfor _ in range(M):\n l, r =... | ['Wrong Answer', 'Accepted'] | ['s798420506', 's705276553'] | [3060.0, 11124.0] | [320.0, 306.0] | [226, 198] |
p03037 | u581403769 | 2,000 | 1,048,576 | We have N ID cards, and there are M gates. We can pass the i-th gate if we have one of the following ID cards: the L_i- th, (L_i+1)-th, ..., and R_i-th ID cards. How many of the ID cards allow us to pass all the gates alone? | ['n, m = map(int, input().split())\nl = []\nfor i in range(m):\n l, r = map(int, input().split())\n l.append(list(range(l, m + 1)))\nc = [0] * n\nfor i in range(m):\n for j in range(n):\n if (j + 1) in l[i]:\n c[j] += 1\ncounr = 0\nfor i in c:\n if m == c[i]:\n count += 1\nprint(cou... | ['Runtime Error', 'Accepted'] | ['s840458113', 's075479070'] | [3064.0, 11020.0] | [17.0, 301.0] | [307, 213] |
p03037 | u585181206 | 2,000 | 1,048,576 | We have N ID cards, and there are M gates. We can pass the i-th gate if we have one of the following ID cards: the L_i- th, (L_i+1)-th, ..., and R_i-th ID cards. How many of the ID cards allow us to pass all the gates alone? | ['# -*- coding: utf-8 -*-\n# IMPORT ###############################################################################################################\nimport sys \nsys.setrecursionlimit(10**6) \nfrom collections import deque, Counter ... | ['Runtime Error', 'Time Limit Exceeded', 'Accepted'] | ['s566662089', 's811852800', 's024356255'] | [1326920.0, 22688.0, 3064.0] | [2112.0, 2108.0, 328.0] | [2889, 2865, 2891] |
p03037 | u585498238 | 2,000 | 1,048,576 | We have N ID cards, and there are M gates. We can pass the i-th gate if we have one of the following ID cards: the L_i- th, (L_i+1)-th, ..., and R_i-th ID cards. How many of the ID cards allow us to pass all the gates alone? | ['N, M = map(int, input().split())\nL_ans = 1\nR_ans = N\n\nfor _ in range(M):\n L, R = map(int, input().split())\n L_ans = max(L, L_ans) \n R_ans = min(R, R_ans) \n print(L_ans, R_ans)\n\n if L_ans > R_ans:\n print(0)\n exit()\n\nprint(R_ans - L_ans + 1)\n', 'N, M = map(int, input().split(... | ['Wrong Answer', 'Accepted'] | ['s831561759', 's293773130'] | [4212.0, 3060.0] | [901.0, 321.0] | [320, 296] |
p03037 | u588558668 | 2,000 | 1,048,576 | We have N ID cards, and there are M gates. We can pass the i-th gate if we have one of the following ID cards: the L_i- th, (L_i+1)-th, ..., and R_i-th ID cards. How many of the ID cards allow us to pass all the gates alone? | ['n,m=map(int,input().split())\na=[list(map(int,input().split())) for _ in range(n)]\nmi=1\nma=n\nfor i in range(n):\n mi=max(mi,a[i][0])\n ma=min(ma,a[i][1])\n\nif mi>ma:\n print("0")\nelse:\n print(ma-mi+1)\n\n', 'n,m=map(int,input().split())\na=[list(map(int,input().split())) for _ in range(m)]\nmi=1\nma=n\nfor ... | ['Runtime Error', 'Runtime Error', 'Accepted'] | ['s073422615', 's356699090', 's627990499'] | [27332.0, 27332.0, 27332.0] | [386.0, 378.0, 376.0] | [201, 201, 201] |
p03037 | u589578850 | 2,000 | 1,048,576 | We have N ID cards, and there are M gates. We can pass the i-th gate if we have one of the following ID cards: the L_i- th, (L_i+1)-th, ..., and R_i-th ID cards. How many of the ID cards allow us to pass all the gates alone? | ['10 3\n3 6\n5 7\n6 9', 'n, m = map(int,input().split())\n\nlefts = [0] * m\nrights = [0] * m\n\nfor i in range(m):\n\tl, m = map(int,input().split())\n\tlefts[i] = l\n\trights[i] = r\n\nlefts_max = max(lefts)\nrithts_min = min(rights)\n\nresult = rights_min - lefts_max + 1\n\nprint(max(result,0))\n\n', 'n, m = map(int... | ['Runtime Error', 'Runtime Error', 'Accepted'] | ['s179671970', 's750270942', 's573386314'] | [2940.0, 4596.0, 10996.0] | [17.0, 20.0, 331.0] | [16, 257, 255] |
p03037 | u593567568 | 2,000 | 1,048,576 | We have N ID cards, and there are M gates. We can pass the i-th gate if we have one of the following ID cards: the L_i- th, (L_i+1)-th, ..., and R_i-th ID cards. How many of the ID cards allow us to pass all the gates alone? | ['N,M = map(int,input().split())\nLR = [[int(x) for x in input().split()] for _ in range(M)]\nL = 1\nR = N\nfor l,r in LR:\n L = max(L,l)\n R = max(R,r)\n \nif L > R:\n print(0)\nelse:\n print(R-L+1)\n', 'N,M = map(int,input().split())\nLR = [[int(x) for x in input().split()] for _ in range(M)]\nL = 1\nR = N\nfor ... | ['Wrong Answer', 'Accepted'] | ['s386049194', 's413077576'] | [21156.0, 21156.0] | [345.0, 351.0] | [192, 192] |
p03037 | u599547273 | 2,000 | 1,048,576 | We have N ID cards, and there are M gates. We can pass the i-th gate if we have one of the following ID cards: the L_i- th, (L_i+1)-th, ..., and R_i-th ID cards. How many of the ID cards allow us to pass all the gates alone? | ['from itertools import accumulate\n\nN, M = map(int, input().split(" "))\nLR = [list(map(int, input().split(" "))) for _ in range(M)]\n\nq = [0] * (N+1)\nfor l, r in LR:\n print(l, r)\n q[l-1] += 1\n q[r] -= 1\n\n\n\nprint(sum(M == m for m in list(accumulate(q))[:-1]))', 'from itertools import accumulate\n\nN... | ['Wrong Answer', 'Accepted'] | ['s171409606', 's358680868'] | [34684.0, 33208.0] | [511.0, 384.0] | [295, 297] |
p03037 | u600153083 | 2,000 | 1,048,576 | We have N ID cards, and there are M gates. We can pass the i-th gate if we have one of the following ID cards: the L_i- th, (L_i+1)-th, ..., and R_i-th ID cards. How many of the ID cards allow us to pass all the gates alone? | ['N,M = map(int, input().split())\nar = [0,N]\nfor m in range(M):\n l,r = map(int, input().split())\n if l>ar[0]:\n ar[0] = l\n if r<ar[1]:\n ar[1]=r\nprint(max([0,ar[1]-ar[0]+1])', 'N,M = map(int, input().split())\nar = [0,N]\nfor m in range(M):\n l,r = map(int, input().split())\n if l>ar[... | ['Runtime Error', 'Accepted'] | ['s923952323', 's005195684'] | [3060.0, 3060.0] | [17.0, 290.0] | [192, 193] |
p03037 | u602677143 | 2,000 | 1,048,576 | We have N ID cards, and there are M gates. We can pass the i-th gate if we have one of the following ID cards: the L_i- th, (L_i+1)-th, ..., and R_i-th ID cards. How many of the ID cards allow us to pass all the gates alone? | ['number = input().split()\ni = 1\ncard_list = []\n\nfor i in range(int(number[1])):\n card = input().split()\n LR = int(card[1]) - int(card[0]) + 1\n j = 0\n if number[1] == "1":\n print(number[0])\n break\n while LR > 0:\n card_list.append(int(card[0]) + j)\n j += 1\n ... | ['Wrong Answer', 'Accepted'] | ['s142365692', 's975015586'] | [97648.0, 25892.0] | [2110.0, 322.0] | [498, 330] |
p03037 | u602773379 | 2,000 | 1,048,576 | We have N ID cards, and there are M gates. We can pass the i-th gate if we have one of the following ID cards: the L_i- th, (L_i+1)-th, ..., and R_i-th ID cards. How many of the ID cards allow us to pass all the gates alone? | ['\ndef input2():\n\treturn map(int,input().split())\n\nN,M=input2()\nL,R=[],[]\nfor i in range(M):\n\tl,r=input2()\n\tL.append(l)\n\tR.append(r)\n\nMIN=0\nMAX=N\n\nfor j in range(M):\n\tif L[j]>MIN and :\n\t\tMIN=L[j]\n\tif R[j]<MAX:\n\t\tMAX=R[j]\n\nif MAX<MIN:\n\tprint(0)\nelse:\n\tprint((MAX-MIN)+1)', '\ndef input2... | ['Runtime Error', 'Accepted'] | ['s296756876', 's163950003'] | [8968.0, 16808.0] | [29.0, 229.0] | [290, 286] |
p03037 | u612636296 | 2,000 | 1,048,576 | We have N ID cards, and there are M gates. We can pass the i-th gate if we have one of the following ID cards: the L_i- th, (L_i+1)-th, ..., and R_i-th ID cards. How many of the ID cards allow us to pass all the gates alone? | ['N, M = map(int, input().split())\nL = []\nR = []\nlan = 0\nran = 0\nans = 0\nfor i in range(M):\n l, r = map(int, input().split())\n L.append(l)\n R.append(r)\n\nprint(R)\nprint(L)\ni = 0\nfor i in range(M):\n for j in range(M):\n if L[i] >= L[j] and L[i] <= R[j]:\n lan += 1\n if ... | ['Wrong Answer', 'Wrong Answer', 'Accepted'] | ['s277781574', 's366509354', 's568349896'] | [14256.0, 11044.0, 11020.0] | [2104.0, 2104.0, 304.0] | [498, 625, 205] |
p03037 | u613401788 | 2,000 | 1,048,576 | We have N ID cards, and there are M gates. We can pass the i-th gate if we have one of the following ID cards: the L_i- th, (L_i+1)-th, ..., and R_i-th ID cards. How many of the ID cards allow us to pass all the gates alone? | ['from operator import itemgetter\n \n\nN, M = map(int, input().split())\n#A = input().split()\n#A = list(map(int, A))\n#print(A)\n#A.sort()\n#print(A)\n\ncng = []\nL_max=0\nR_min=1000000000000\nfor i in range(M):\n L, R = map(int, input().split())\n if(L_max<=L):\n L_max=L\n if(R_min>=R):\... | ['Wrong Answer', 'Accepted'] | ['s477072581', 's970025869'] | [3064.0, 3064.0] | [295.0, 296.0] | [387, 311] |
p03037 | u616468898 | 2,000 | 1,048,576 | We have N ID cards, and there are M gates. We can pass the i-th gate if we have one of the following ID cards: the L_i- th, (L_i+1)-th, ..., and R_i-th ID cards. How many of the ID cards allow us to pass all the gates alone? | ["N, M = map(int, input().split(' '))\n\ndata = []\nl = 1\nr = 10**5\nfor m in range(M):\n li, ri = map(int, input().split(' '))\n if li > l:\n l = li\n if ri < r:\n r = ri\n\nif l<= N <= r:\n cnt = (N - l) + 1\nelif r >= N:\n cnt = (r - l) + 1\nelse N < l:\n cnt = 0\n ", "N, M = map(int, input()... | ['Runtime Error', 'Accepted'] | ['s033417968', 's995611968'] | [2940.0, 3064.0] | [17.0, 275.0] | [273, 300] |
p03037 | u617037231 | 2,000 | 1,048,576 | We have N ID cards, and there are M gates. We can pass the i-th gate if we have one of the following ID cards: the L_i- th, (L_i+1)-th, ..., and R_i-th ID cards. How many of the ID cards allow us to pass all the gates alone? | ['N,M = map(int,input().split())\nL = []\nR = []\nfor i in range(M):\n l,r = map(int,input().split())\n L.append(l)\n R.append(r)\nprint(min(R)-min(L)+1)', 'N,M = map(int,input().split())\na,b = map(int,input().split())\nfor i in range(M-1):\n c,d = map(int,input().split())\n a = max(a,c)\n b = min(b,d)\nif... | ['Wrong Answer', 'Accepted'] | ['s684104379', 's887644309'] | [10996.0, 3060.0] | [296.0, 328.0] | [147, 191] |
p03037 | u617640347 | 2,000 | 1,048,576 | We have N ID cards, and there are M gates. We can pass the i-th gate if we have one of the following ID cards: the L_i- th, (L_i+1)-th, ..., and R_i-th ID cards. How many of the ID cards allow us to pass all the gates alone? | ['# -*- coding: utf-8 -*-\nn, m = map(int, input().split())\n\nlst1 = [i for i in range(1, n + 1)]\nprint(lst1)\n\nfor i in range(m):\n l, r = map(int, input().split())\n lst = [l + j for j in range(r)]\n lst1 = lst if len(lst1) == 0 else list(set(lst1) & set(lst))\n print(lst)\n\nprint(len(lst1))\n', '# -*- coding... | ['Wrong Answer', 'Accepted'] | ['s299483861', 's634479385'] | [101804.0, 3064.0] | [2105.0, 357.0] | [289, 492] |
p03037 | u624613992 | 2,000 | 1,048,576 | We have N ID cards, and there are M gates. We can pass the i-th gate if we have one of the following ID cards: the L_i- th, (L_i+1)-th, ..., and R_i-th ID cards. How many of the ID cards allow us to pass all the gates alone? | ['n,m = map(int,input().split())\nl_max=0\nr_min=n \nfor i in range(n):\n l,r = map(int,input().split())\n l_max = max(l_max,l)\n r_min = min(r_min,r)\nprint(r_min - l_max)', 'n,m = map(int,input().split())\nl_max=1\nr_min=10**5 \nfor i in range(m):\n l,r = map(int,input().split())\n l_max = max(l_max,l)\n r_min ... | ['Runtime Error', 'Accepted'] | ['s163710467', 's923520623'] | [9200.0, 9192.0] | [214.0, 222.0] | [166, 204] |
p03037 | u626224620 | 2,000 | 1,048,576 | We have N ID cards, and there are M gates. We can pass the i-th gate if we have one of the following ID cards: the L_i- th, (L_i+1)-th, ..., and R_i-th ID cards. How many of the ID cards allow us to pass all the gates alone? | ["isstr=input()\nn,m = [int(i) for i in isstr.split(' ')]\nl=[0]*m\nr=[0]*m\nfor i in range(m):\n l[i],r[i]=[int(i) for i in input().split(' ')]\na=[0]*n\nfor i in range(m):\n a[l[i]-1]=1\n a[l[i]]=1\n a[r[i]-1]=1\nprint(sum(a))", "isstr=input()\nn,m = [int(i) for i in isstr.split(' ')]\nl=[0]*m\nr=[0]*m\nf... | ['Runtime Error', 'Runtime Error', 'Runtime Error', 'Accepted'] | ['s470702008', 's811595342', 's861895928', 's291665012'] | [11636.0, 11636.0, 13684.0, 10868.0] | [339.0, 2108.0, 2104.0, 311.0] | [227, 232, 255, 190] |
p03037 | u628581330 | 2,000 | 1,048,576 | We have N ID cards, and there are M gates. We can pass the i-th gate if we have one of the following ID cards: the L_i- th, (L_i+1)-th, ..., and R_i-th ID cards. How many of the ID cards allow us to pass all the gates alone? | ['c = []\nd = []\nn,m = map(int, input().split())\nfor i in range(m):\n a,b = map(int,input().split())\n c.append(a)\n d.append(b)\nminl = max(c) \nmaxr = min(d)\nif min1>maxr:\n print(0)\nelse:\n print(maxr-minl+1)', 'a = []\nb = []\nn,m = map(int, input().split())\nfor i in range(m):\n a,b = map(i... | ['Runtime Error', 'Runtime Error', 'Accepted'] | ['s649783659', 's794347064', 's263299155'] | [11020.0, 3060.0, 10980.0] | [303.0, 18.0, 301.0] | [218, 179, 218] |
p03037 | u634079249 | 2,000 | 1,048,576 | We have N ID cards, and there are M gates. We can pass the i-th gate if we have one of the following ID cards: the L_i- th, (L_i+1)-th, ..., and R_i-th ID cards. How many of the ID cards allow us to pass all the gates alone? | ['import sys\nimport os\n\n\ndef main():\n if os.getenv("LOCAL"):\n sys.stdin = open("input.txt", "r")\n\n N, M = list(map(int, sys.stdin.buffer.readline().split()))\n LR = [list(map(int, sys.stdin.buffer.readline().split())) for _ in range(M)]\n mi = 0\n mx = 10 ** 5 + 1\n\n for lr in LR:\n ... | ['Wrong Answer', 'Accepted'] | ['s337107900', 's249962744'] | [28732.0, 3060.0] | [321.0, 156.0] | [471, 396] |
p03037 | u635974378 | 2,000 | 1,048,576 | We have N ID cards, and there are M gates. We can pass the i-th gate if we have one of the following ID cards: the L_i- th, (L_i+1)-th, ..., and R_i-th ID cards. How many of the ID cards allow us to pass all the gates alone? | ['N, M = list(map(int, input().split()))\nLs, Rs = [], []\nfor i in range(M):\n n, m = list(map(int, input().split()))\n Ls.append(n)\n Rs.append(m)\n\n\n# rr =Rs[0]\n\n\n# rr = min(rr, Rs[i])\n#\n\nprint(min(0, min(Rs) - max(Ls) + 1))\n\n', 'N, M = list(map(int, input().split()))\nLs, Rs = [], []\nfor i ... | ['Wrong Answer', 'Accepted'] | ['s527041355', 's682080468'] | [11024.0, 11028.0] | [340.0, 331.0] | [312, 312] |
p03037 | u637918426 | 2,000 | 1,048,576 | We have N ID cards, and there are M gates. We can pass the i-th gate if we have one of the following ID cards: the L_i- th, (L_i+1)-th, ..., and R_i-th ID cards. How many of the ID cards allow us to pass all the gates alone? | ["N, M = map(int, input().split())\ngate = [input().split() for i in range(M)]\n\nMIN = 0\nMAX = float('inf')\n\nfor i in range(M):\n MIN = max(MIN, int(gate[i][0]))\n MAX = min(MAX, int(gate[i][1]))\n print(MIN, MAX)\n\nprint(max(MAX - MIN + 1, 0))", "N, M = map(int, input().split())\ngate = [input().split() ... | ['Wrong Answer', 'Accepted'] | ['s492464983', 's784364775'] | [33600.0, 32152.0] | [398.0, 303.0] | [245, 225] |
p03037 | u638456847 | 2,000 | 1,048,576 | We have N ID cards, and there are M gates. We can pass the i-th gate if we have one of the following ID cards: the L_i- th, (L_i+1)-th, ..., and R_i-th ID cards. How many of the ID cards allow us to pass all the gates alone? | ['N,M=map(int, input().split())\n\nL=[]\nR=[]\n\nfor i in range(M):\n a,b=map(int, input().split())\n L.append(a)\n R.append(b)\n\n\nans=max(R)-max(L)+1\nif ans<0:\n print(0)\nelse:\n prnit(ans)', 'N,M=map(int, input().split())\n\nL=[]\nR=[]\n\nfor i in range(M):\n a,b=map(int, input().split())\n L.app... | ['Runtime Error', 'Wrong Answer', 'Accepted'] | ['s236316187', 's868847574', 's741899020'] | [10996.0, 10996.0, 10996.0] | [294.0, 306.0, 302.0] | [188, 150, 177] |
p03037 | u640319601 | 2,000 | 1,048,576 | We have N ID cards, and there are M gates. We can pass the i-th gate if we have one of the following ID cards: the L_i- th, (L_i+1)-th, ..., and R_i-th ID cards. How many of the ID cards allow us to pass all the gates alone? | ['N, M = map(int, input().split())\ngates = [tuple(map(int, input().split())) for _ in range(M)]\n\nlmax = max(gates, key=lambda x: x[0])[0]\nrmin = min(gates, key=lambda x: x[1])[1]\n\nprint(max(rmin-lmax+1), 0)', 'N, M = map(int, input().split())\ngates = [tuple(map(int, input().split())) for _ in range(M)]\n\nlmax =... | ['Runtime Error', 'Accepted'] | ['s177746435', 's681426237'] | [16616.0, 16592.0] | [314.0, 320.0] | [204, 204] |
p03037 | u642012866 | 2,000 | 1,048,576 | We have N ID cards, and there are M gates. We can pass the i-th gate if we have one of the following ID cards: the L_i- th, (L_i+1)-th, ..., and R_i-th ID cards. How many of the ID cards allow us to pass all the gates alone? | ['N, M = list(map(int,input().split()))\n\nNmin = 1\nNmax = N\n\nfor i in range(M):\n L, R = list(map(int,input().split()))\n Nmin = max(L,Nmin)\n Nmax = min(R,Nmax)\n\nprint(max(Nmax-Nmin+1),0)', 'N, M = list(map(int,input().split()))\n\nNmin = 1\nNmax = N\n\nfor i in range(M):\n L, R = list(map(int,input(... | ['Runtime Error', 'Accepted'] | ['s662406896', 's527741735'] | [3060.0, 3060.0] | [349.0, 356.0] | [191, 191] |
p03037 | u644360640 | 2,000 | 1,048,576 | We have N ID cards, and there are M gates. We can pass the i-th gate if we have one of the following ID cards: the L_i- th, (L_i+1)-th, ..., and R_i-th ID cards. How many of the ID cards allow us to pass all the gates alone? | ['N,M = map(int,input().split())\ncount = 0\nfor i in range(M):\n a,b = map(int,input().split())\n if count == 0:\n min = a\n max = b\n count = 1\n else:\n if min < a && a<max:\n min =a\n else:\n break\n if max > b && b >min:\n max = b\n els... | ['Runtime Error', 'Runtime Error', 'Runtime Error', 'Runtime Error', 'Runtime Error', 'Accepted'] | ['s100733411', 's133951227', 's412309316', 's513780529', 's735221532', 's922326961'] | [2940.0, 3064.0, 2940.0, 3064.0, 2940.0, 3064.0] | [17.0, 17.0, 17.0, 282.0, 17.0, 289.0] | [376, 375, 389, 379, 324, 375] |
p03037 | u645538982 | 2,000 | 1,048,576 | We have N ID cards, and there are M gates. We can pass the i-th gate if we have one of the following ID cards: the L_i- th, (L_i+1)-th, ..., and R_i-th ID cards. How many of the ID cards allow us to pass all the gates alone? | ['\nN,M=map(int,input().split())\n\nresult=0\nLR=[]\nfor i in range(M):\n LR.append(input().split())\n\n\nnumbers=[]\nfor i in range(N+1):\n numbers.append(i)\n\n\n\n\nLmax=0\nRmax=0\nfor j in LR:\n\n L=int(j[0])\n R=int(j[1])\n\n if Lmax<L:\n Lmax=L\n if Rmax<R:\n Rmax=R\nfor i in n... | ['Wrong Answer', 'Wrong Answer', 'Accepted'] | ['s228327516', 's942902394', 's356414716'] | [36200.0, 32168.0, 36216.0] | [295.0, 210.0, 285.0] | [384, 415, 396] |
p03037 | u648212584 | 2,000 | 1,048,576 | We have N ID cards, and there are M gates. We can pass the i-th gate if we have one of the following ID cards: the L_i- th, (L_i+1)-th, ..., and R_i-th ID cards. How many of the ID cards allow us to pass all the gates alone? | ['N,M = map(int,input().split())\nX = [list(map,int(input().split())) for i in range(M)]\n\nkeymax = 10**6\nkeymin = 0\nfor i in range(M):\n\tif X[i][0] > keymin:\n\t\tkeymin = X[i][0]\n\tif X[i][1] < keymax:\n\t\tkeymax = X[i][1]\n\nprint(keymax-keymin+1)', 'N,M = map(int,input().split())\nX = [list(map(int,input().sp... | ['Runtime Error', 'Accepted'] | ['s188822568', 's916321641'] | [3060.0, 27332.0] | [17.0, 347.0] | [237, 277] |
p03037 | u648315264 | 2,000 | 1,048,576 | We have N ID cards, and there are M gates. We can pass the i-th gate if we have one of the following ID cards: the L_i- th, (L_i+1)-th, ..., and R_i-th ID cards. How many of the ID cards allow us to pass all the gates alone? | ['from itertools import accumulate\nN, M = map(int, input().split())\n\nleft = 1\nright = M\n\nfor i in range(M):\n a,b = map(int, input().split())\n left = max(left,a)\n right = min(right, b)\n\nprint(max(0,right-left+1))\n\n\n\n\n# l, r = map(int, input().split())\n\n\n#\n\n#\n# ans = 0\n# for im in imos... | ['Wrong Answer', 'Accepted'] | ['s045618078', 's804783420'] | [9096.0, 13800.0] | [221.0, 216.0] | [448, 440] |
p03037 | u648901783 | 2,000 | 1,048,576 | We have N ID cards, and there are M gates. We can pass the i-th gate if we have one of the following ID cards: the L_i- th, (L_i+1)-th, ..., and R_i-th ID cards. How many of the ID cards allow us to pass all the gates alone? | ['n,m= map(int,input().split())\nlr = [0]*m\nimport numpy as np\nfor i in range(m):\n lr[i]=list(map(int, input().split()))\n\n#1~10**5\n# print(10**5)\nallcount = np.zeros(10**5,dtype=np.int)\n# print(allcount)\nfor i in range(m):\n st = lr[i][0]-1\n g = lr[i][1]\n allcount=np.hstack((allcount[:st],allcoun... | ['Time Limit Exceeded', 'Accepted'] | ['s383627004', 's325828292'] | [39384.0, 27348.0] | [2110.0, 374.0] | [409, 379] |
p03037 | u651109406 | 2,000 | 1,048,576 | We have N ID cards, and there are M gates. We can pass the i-th gate if we have one of the following ID cards: the L_i- th, (L_i+1)-th, ..., and R_i-th ID cards. How many of the ID cards allow us to pass all the gates alone? | ['n, m = map(int, input().split())\n\nl, r = [], []\nfor i in range(m):\n tmpa, tmpb = map(int, input().split())\n l.append(tmpa)\n r.append(tmpb)\n\nprint(min(r) - max(l) + 1 if min(r) < max(l) else 0)\n', 'n, m = map(int, input().split())\n\nl, r = [], []\nfor i in range(m):\n tmpa, tmpb = map(int, input(... | ['Wrong Answer', 'Accepted'] | ['s840161150', 's409470862'] | [10996.0, 11020.0] | [302.0, 297.0] | [202, 203] |
p03037 | u652656291 | 2,000 | 1,048,576 | We have N ID cards, and there are M gates. We can pass the i-th gate if we have one of the following ID cards: the L_i- th, (L_i+1)-th, ..., and R_i-th ID cards. How many of the ID cards allow us to pass all the gates alone? | ['n,m = map(int,input().split())\nl_max,r_min = 0,n\nfor i in range(m):\n l,r = map(int,input().split())\n l_max = max(l,ll)\n r_min = min(r,rr)\nprint(max(r_min - l_max +1 , 0))\n', 'n,m = map(int,input().split())\nans = 0\nfor i in range(m):\n l,r = map(int,input().split())\n d = range(l,r+1)\n for j in r... | ['Runtime Error', 'Wrong Answer', 'Accepted'] | ['s209177663', 's216631648', 's907052635'] | [3060.0, 3060.0, 3060.0] | [18.0, 2104.0, 326.0] | [180, 173, 186] |
p03037 | u661576386 | 2,000 | 1,048,576 | We have N ID cards, and there are M gates. We can pass the i-th gate if we have one of the following ID cards: the L_i- th, (L_i+1)-th, ..., and R_i-th ID cards. How many of the ID cards allow us to pass all the gates alone? | ['a, b= map(int, input().split())\nA=[]\nA = [list(input().split()) for i in range(a)]\nB=[]\nfor i in A:\n s=int(i[0])\n v=int(i[1])+1\n for j in range(s,v):\n B.append(j)\nC = [x for x in set(B) if B.count(x) > 1]\nprint(len(C))\n ', 'n,m = [int(i) for i in input().split()]\nrang = []\nlmax = 0\nrmin = 10**10... | ['Runtime Error', 'Accepted'] | ['s510463759', 's668474598'] | [793252.0, 3316.0] | [2153.0, 337.0] | [228, 213] |
p03037 | u663561584 | 2,000 | 1,048,576 | We have N ID cards, and there are M gates. We can pass the i-th gate if we have one of the following ID cards: the L_i- th, (L_i+1)-th, ..., and R_i-th ID cards. How many of the ID cards allow us to pass all the gates alone? | ['N,M = list(map(int,input().split()))\nans = [0 for i in range(N)]\nanss = 0\n\nfor i in range(M):\n L,R = list(map(int,input().split()))\n if L == R:\n ans[L-1]+=1\n else:\n for j in range(L-1,R,1):\n ans[j]+=1\n\nmaxn = 0\nfor i in range(M):\n if ans[i] > maxn:\n maxn = ans[i]\n ... | ['Runtime Error', 'Wrong Answer', 'Runtime Error', 'Accepted'] | ['s394466949', 's469362400', 's658765456', 's234641893'] | [5424.0, 4212.0, 5500.0, 3060.0] | [2104.0, 901.0, 2104.0, 335.0] | [380, 199, 388, 261] |
p03037 | u668705838 | 2,000 | 1,048,576 | We have N ID cards, and there are M gates. We can pass the i-th gate if we have one of the following ID cards: the L_i- th, (L_i+1)-th, ..., and R_i-th ID cards. How many of the ID cards allow us to pass all the gates alone? | ['import numpy as np\n\nn,m = map(int, input().split())\nLR = [list(map(int, input().split())) for _ in range(m)]\nn = np.array([0]*n)\nfor l,r in LR:\n n[l-1:r] += 1.\nprint(sum(n == m))', 'n,m = map(int, input().split())\nLR = [list(map(int, input().split())) for _ in range(m)]\nL = max([i[0] for i in LR])\nR = min(... | ['Time Limit Exceeded', 'Accepted'] | ['s762328124', 's019942677'] | [37852.0, 28264.0] | [2113.0, 335.0] | [179, 164] |
p03037 | u671861352 | 2,000 | 1,048,576 | We have N ID cards, and there are M gates. We can pass the i-th gate if we have one of the following ID cards: the L_i- th, (L_i+1)-th, ..., and R_i-th ID cards. How many of the ID cards allow us to pass all the gates alone? | ['N, M = list(map(int, input().split()))\nL, R = [], []\nfor i in range(M):\n L[i], R[i] = list(map(int, input().split()))\n\nans = min(R) - max(L) + 1\nif ans < 0:\n ans = 0\nprint(ans)', 'N, M = list(map(int, input().split()))\nL, R = [None] * M, [None] * M\nfor i in range(M):\n L[i], R[i] = list(map(int, in... | ['Runtime Error', 'Accepted'] | ['s714151422', 's021925863'] | [3060.0, 10996.0] | [17.0, 345.0] | [182, 198] |
p03037 | u681444474 | 2,000 | 1,048,576 | We have N ID cards, and there are M gates. We can pass the i-th gate if we have one of the following ID cards: the L_i- th, (L_i+1)-th, ..., and R_i-th ID cards. How many of the ID cards allow us to pass all the gates alone? | ['N,M = map(int,input().split())\nl=[]\nr=[]\nfor i in range(M):\n a,b=map(int,input().split())\n l.append(a)\n r.append(b)\n \n \nans=min(b)-max(a)+1\nprint(ans)', 'N,M = map(int,input().split())\nl=[]\nr=[]\nfor i in range(N):\n a,b=map(int,input().split())\n l.append(a)\n r.append(b)\n \n \nans=min(r)-max(... | ['Runtime Error', 'Runtime Error', 'Runtime Error', 'Wrong Answer', 'Runtime Error', 'Accepted'] | ['s134926112', 's269623892', 's591231499', 's896101380', 's939730837', 's037320250'] | [10996.0, 11016.0, 10996.0, 30388.0, 3188.0, 29088.0] | [294.0, 317.0, 309.0, 2105.0, 17.0, 351.0] | [155, 155, 155, 295, 287, 180] |
p03037 | u684625036 | 2,000 | 1,048,576 | We have N ID cards, and there are M gates. We can pass the i-th gate if we have one of the following ID cards: the L_i- th, (L_i+1)-th, ..., and R_i-th ID cards. How many of the ID cards allow us to pass all the gates alone? | ['ID_num, gate_num = tuple([int(i) for i in input().split(" ")])\nmin_list = []\nmax_list = []\nfor i in range(gate_num):\n \tmin_ID, max_ID = tuple([int(i) for i in input().split(" ")])\n min_list.append(min_ID)\n max_list.append(max_ID)\nprint(min(max_list) - max(min_list))', 'ID_num, gate_num = tuple([int(i) ... | ['Runtime Error', 'Runtime Error', 'Accepted'] | ['s241617383', 's759603410', 's810837394'] | [3188.0, 3064.0, 11020.0] | [18.0, 18.0, 338.0] | [273, 277, 348] |
p03037 | u685662874 | 2,000 | 1,048,576 | We have N ID cards, and there are M gates. We can pass the i-th gate if we have one of the following ID cards: the L_i- th, (L_i+1)-th, ..., and R_i-th ID cards. How many of the ID cards allow us to pass all the gates alone? | ['N,M=map(int, input().split())\npass_id = range(1,N+1)\n\nfor i in range(M):\n L,R=map(int, input().split())\n for id in pass_id:\n if not id in range(L,R+1):\n pass_id.pop(pass_id.index(id))\nprint(len(pass_id))', 'N, M = map(int, input().split())\nl, r = 1, N\nfor i in range(M):\n L, R = m... | ['Runtime Error', 'Accepted'] | ['s097665805', 's562056050'] | [3060.0, 3060.0] | [2104.0, 317.0] | [227, 163] |
p03037 | u687929074 | 2,000 | 1,048,576 | We have N ID cards, and there are M gates. We can pass the i-th gate if we have one of the following ID cards: the L_i- th, (L_i+1)-th, ..., and R_i-th ID cards. How many of the ID cards allow us to pass all the gates alone? | ['n, m = map(int,input().split())\n \nl_p = 1\nr_p = n\n \nfor j in range(m+1):\n l, r = map(int,input().split())\n if l > l_p:\n l_p = l\n if r < r_p:\n r_p = r\n\na = r_p - l_p + 1\n\nprint(a)', 'n, m = map(int,input().split())\n \nl_p = 1\nr_p = n\n \nfor j in range(m):\n l, r = map(int,input().split())\n ... | ['Runtime Error', 'Accepted'] | ['s234565337', 's949429315'] | [3060.0, 3060.0] | [276.0, 282.0] | [187, 214] |
p03037 | u689626103 | 2,000 | 1,048,576 | We have N ID cards, and there are M gates. We can pass the i-th gate if we have one of the following ID cards: the L_i- th, (L_i+1)-th, ..., and R_i-th ID cards. How many of the ID cards allow us to pass all the gates alone? | ['N, M = map(int, input().split())\n\nhashset = None\n\nfor _ in range(M):\n\tfor L, R in map(int, input().split()):\n if hashset is None:\n hashset = set(range(L, R+1))\n else:\n hashset = hashset & set(range(L, R+1))\n\nprint(len(hashset))', 'N, M = map(int, input().split())\n \nleft, right = ... | ['Runtime Error', 'Accepted'] | ['s502397419', 's866268405'] | [2940.0, 3060.0] | [18.0, 324.0] | [251, 218] |
p03037 | u690781906 | 2,000 | 1,048,576 | We have N ID cards, and there are M gates. We can pass the i-th gate if we have one of the following ID cards: the L_i- th, (L_i+1)-th, ..., and R_i-th ID cards. How many of the ID cards allow us to pass all the gates alone? | ['n, m = map(int, input().split())\nmi, ma = 1, n\nfor _ in range(m):\n l, r = map(int, input().split())\n mi = max(l, mi)\n ma = min(r, ma)\nprint(ma - mi)', 'n, m = map(int, input().split())\nmi, ma = 1, n\nfor _ in range(m):\n l, r = map(int, input().split())\n mi = max(l, mi)\n ma = min(r, ma)\npr... | ['Wrong Answer', 'Accepted'] | ['s766801944', 's620119344'] | [3060.0, 3060.0] | [316.0, 326.0] | [157, 170] |
p03037 | u691979766 | 2,000 | 1,048,576 | We have N ID cards, and there are M gates. We can pass the i-th gate if we have one of the following ID cards: the L_i- th, (L_i+1)-th, ..., and R_i-th ID cards. How many of the ID cards allow us to pass all the gates alone? | ['\nn,m = map(int, input().split())\nmaxlist = []\nminlist = []\n\nfor i in range(m):\n\t\n\tl , r = list(map(int, input().split()))\n\tminlist.append(l)\n\tif r > 0:\n\t\tmaxlist.append(r)\n\nminid = max(minlist)\nmaxid = min(maxlist)\nokgate = maxid - minid + 1\n\nif okegate >= 0:\n\tprint(okgate)\nelse:\n\tprint(0)'... | ['Runtime Error', 'Accepted'] | ['s176319712', 's274454228'] | [11048.0, 11020.0] | [347.0, 360.0] | [364, 363] |
p03037 | u693694535 | 2,000 | 1,048,576 | We have N ID cards, and there are M gates. We can pass the i-th gate if we have one of the following ID cards: the L_i- th, (L_i+1)-th, ..., and R_i-th ID cards. How many of the ID cards allow us to pass all the gates alone? | ['N, M = map(int, input().split())\nLR = [list(map(int,input().split())) for i in range(M)]\n\nG=[]\nfor i in range(N):\n G.append(0)\n\nfor i in LR:\n G[i[0]-1]=G[i[0]-1]+1\n G[i[1]-1]=G[i[1]-1]+1\n\nG.count(max(G))\n\n', 'LL=[]\nRR=[]\nN,M=map(int,input().split())\nfor i in range(M):\n L,R=map(int,input()... | ['Wrong Answer', 'Accepted'] | ['s597327977', 's061499746'] | [28272.0, 10984.0] | [391.0, 295.0] | [214, 201] |
p03037 | u698837729 | 2,000 | 1,048,576 | We have N ID cards, and there are M gates. We can pass the i-th gate if we have one of the following ID cards: the L_i- th, (L_i+1)-th, ..., and R_i-th ID cards. How many of the ID cards allow us to pass all the gates alone? | ['import numpy as np\nN,M = map(int,input().split())\nmin_num,max_num = 0,10**6\nfor i in range(M):\n n_i,n_j = map(int,input().split())\n min_num = n_i if n_i > min_num else min_num\n max_num = n_j if n_j < max_num else max_num\n\nif max_num - min_num > 0:\n print(0)\nelse:\n print(max_num - min_num +1)', 'import... | ['Wrong Answer', 'Accepted'] | ['s937493719', 's540474580'] | [18640.0, 12504.0] | [432.0, 430.0] | [297, 297] |
p03037 | u698919163 | 2,000 | 1,048,576 | We have N ID cards, and there are M gates. We can pass the i-th gate if we have one of the following ID cards: the L_i- th, (L_i+1)-th, ..., and R_i-th ID cards. How many of the ID cards allow us to pass all the gates alone? | ['N, M = map(int, input().split())\n\nL = []\nR = []\n\nfor i in range(M):\n inp = input().split()\n L.append(inp[0])\n R.append(inp[1])\n \nif max(L) <= min(R):\n print(min(R)-max(L)+1)\nelse:\n print(0)', 'N, M = map(int, input().split())\n\nL = []\nR = []\n\nfor i in range(M):\n inp = input().sp... | ['Runtime Error', 'Accepted'] | ['s404643754', 's055276245'] | [15732.0, 10996.0] | [198.0, 271.0] | [207, 217] |
p03037 | u700499791 | 2,000 | 1,048,576 | We have N ID cards, and there are M gates. We can pass the i-th gate if we have one of the following ID cards: the L_i- th, (L_i+1)-th, ..., and R_i-th ID cards. How many of the ID cards allow us to pass all the gates alone? | ['n,m= input().split()\nn = int(n)\nm = int(m)\ng=[input().split() for i in range(m)]\nav =[0,1000000]\nfor i in range(m):\n av[0] = max(int(g[i][0]),av[0])\n av[1] = min(int(g[i][1]),av[1])\nprint(av[1])\nprint(av[0])\nprint(av[1] -av[0]+1)', 'n,m= input().split()\nn = int(n)\nm = int(m)\ng=[input().split() for i in... | ['Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Runtime Error', 'Accepted'] | ['s055857861', 's143270918', 's379730855', 's810534191', 's455676010'] | [32148.0, 32148.0, 32148.0, 32148.0, 32148.0] | [293.0, 290.0, 303.0, 209.0, 296.0] | [231, 227, 203, 200, 213] |
p03037 | u700636661 | 2,000 | 1,048,576 | We have N ID cards, and there are M gates. We can pass the i-th gate if we have one of the following ID cards: the L_i- th, (L_i+1)-th, ..., and R_i-th ID cards. How many of the ID cards allow us to pass all the gates alone? | [' import sys\n \n def main():\n sinputl = sys.stdin.readline\n \n num_card, num_gate = [int(x) for x in sinputl().split()]\n input = [[int(x) for x in sinputl().split()] for _ in range(num_gate)]\n \n under_limit = [x[0] for x in input]\n over_limit = [x[1] for x in... | ['Runtime Error', 'Accepted'] | ['s304786651', 's142959986'] | [2940.0, 22848.0] | [17.0, 155.0] | [442, 395] |
p03037 | u700705777 | 2,000 | 1,048,576 | We have N ID cards, and there are M gates. We can pass the i-th gate if we have one of the following ID cards: the L_i- th, (L_i+1)-th, ..., and R_i-th ID cards. How many of the ID cards allow us to pass all the gates alone? | ['n, m = map(int, input().split())\nl = [0]*m\nr = [0]*m\nfor i in range(m):\n l[i], r[i] = map(int, input().split())\n\nprint(max(min(r) - max(l)+1, n))\n', 'n, m = map(int, input().split())\nl = [0]*m\nr = [0]*m\nfor i in range(m):\n l[i], r[i] = map(int, input().split())\n\nprint(max(min(r) - max(l)+1, 0))'] | ['Wrong Answer', 'Accepted'] | ['s677136979', 's500242149'] | [10996.0, 10868.0] | [289.0, 281.0] | [149, 148] |
p03037 | u702018889 | 2,000 | 1,048,576 | We have N ID cards, and there are M gates. We can pass the i-th gate if we have one of the following ID cards: the L_i- th, (L_i+1)-th, ..., and R_i-th ID cards. How many of the ID cards allow us to pass all the gates alone? | ['n,m=map(int,input().split())\nL=[list(map(int,input().split()) for _ in range(m)]\n \na=max(L)\nb=min(M)\nif a<=b:\n print(b-a+1)\nelse:\n print(0)', 'n,m=map(int,input().split())\nl=[]\nm=[]\nfor i in range(m):\n ll,mm=map(int,input().split())\n l.append(ll)\n m.append(mm)\na=max(l)\nb=min(m)\nif a<=b:\n prin... | ['Runtime Error', 'Runtime Error', 'Accepted'] | ['s882664696', 's945389242', 's918890492'] | [2940.0, 3060.0, 11088.0] | [17.0, 17.0, 296.0] | [142, 179, 178] |
p03037 | u702322609 | 2,000 | 1,048,576 | We have N ID cards, and there are M gates. We can pass the i-th gate if we have one of the following ID cards: the L_i- th, (L_i+1)-th, ..., and R_i-th ID cards. How many of the ID cards allow us to pass all the gates alone? | ['N, M = map(int, input().split())\nL, R = 1, N\n\nimport math\n\ndef merge_list(list):\n L = list[-1][0]\n R = sorted(data, key=lambda x: x[1])[-1][1]\n return (L, R)\n\ndata = []\nfor i in range(0, M):\n l, r = input().split()\n data.append((int(l), int(r)))\ndata = sorted(data, key=lambda x: x[0])\n\n... | ['Runtime Error', 'Runtime Error', 'Runtime Error', 'Wrong Answer', 'Runtime Error', 'Runtime Error', 'Runtime Error', 'Runtime Error', 'Accepted'] | ['s033123118', 's150360250', 's225587291', 's248627175', 's257915642', 's421816839', 's637089058', 's706962292', 's195608718'] | [29764.0, 29556.0, 49680.0, 18976.0, 18944.0, 27380.0, 29596.0, 25820.0, 10996.0] | [574.0, 569.0, 444.0, 342.0, 329.0, 502.0, 615.0, 462.0, 267.0] | [588, 553, 835, 310, 665, 559, 563, 584, 217] |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.