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
|
---|---|---|---|---|---|---|---|---|---|---|
p02693 | u876169782 | 2,000 | 1,048,576 | Takahashi the Jumbo will practice golf. His objective is to get a carry distance that is a multiple of K, while he can only make a carry distance of between A and B (inclusive). If he can achieve the objective, print `OK`; if he cannot, print `NG`. | ['n = int(input())\ns,d = map(int,input().split())\n\nc = 0\nfor i in range(s,d):\n if i % s == 0:\n \tc = c + 1\n\n\nif c != 0:\n \tprint("YES")\nelse:\n \tprint("NO")\n ', 'n = int(input())\ns,d = map(int,input().split())\n\nc = 0\nfor i in range(s,d+1:\n if i % s == 0:\n \tc = c + 1\n\n\nif c != 0:\n \tprint("YES")\nelse:\n \tprint("NO")\n ', 'n = int(input())\ns,d = map(int,input().split())\n\nc = 0\nfor i in range(s,d+1):\n if i % s == 0:\n \tc = c + 1\n\n\nif c != 0:\n \tprint("YES")\nelse:\n \tprint("NO")', 'n = int(input())\ns,d = map(int,input().split())\n\nc = 0\nfor i in range(s,d+1):\n if i % s == 0:\n \tc = c + 1\n\n\nif c != 0:\n \tprint("OK"\nelse:\n \tprint("NG")', 'n = int(input())\ns,d = map(int,input().split())\n\nc = 0\nfor i in range(s,d+1):\n if i % n == 0:\n \tc = c + 1\n else:\n c = c\n \nif c != 0:\n \tprint("OK")\nelse:\n \tprint("NG")'] | ['Wrong Answer', 'Runtime Error', 'Wrong Answer', 'Runtime Error', 'Accepted'] | ['s291417311', 's356404821', 's438127896', 's847524332', 's711356424'] | [9052.0, 8996.0, 9096.0, 9060.0, 9092.0] | [20.0, 20.0, 21.0, 20.0, 21.0] | [159, 160, 156, 154, 176] |
p02693 | u883237011 | 2,000 | 1,048,576 | Takahashi the Jumbo will practice golf. His objective is to get a carry distance that is a multiple of K, while he can only make a carry distance of between A and B (inclusive). If he can achieve the objective, print `OK`; if he cannot, print `NG`. | ['k = int(input())\na, b = map(int, input().split())\n\na_div_k = a // k\nb_div_k = b // k\n\nif b < k:\n print("NG")\nelif k == 1:\n print("OK")\nelif k == b:\n print("OK")\nelif a_div_k == b_div_k:\n print("NG")\nelse:\n print("NG")\n', 'if k >= 1:\n print("OK")\n\nif b - a + 2 >= k:\n print("OK")\nelse:\n print("NG")\n', 'k = int(input())\na, b = map(int, input().split())\n\na_div_k = a // k\nb_div_k = b // k\n\na_mod_k = a % k\nb_mod_k = b % k\n\nif b < k:\n print("NG")\nelif k == 1:\n print("OK")\nelif k == b:\n print("OK")\nelif (a_mod_k == 0) or (b_mod_k == 0) and (a_div_k == b_div_k):\n print("OK")\nelif (k < a) and (a_div_k == b_div_k):\n print("NG")\nelse:\n print("OK")\n'] | ['Wrong Answer', 'Runtime Error', 'Accepted'] | ['s216969360', 's778226618', 's024429052'] | [9128.0, 9072.0, 9196.0] | [22.0, 21.0, 23.0] | [233, 85, 360] |
p02693 | u883866798 | 2,000 | 1,048,576 | Takahashi the Jumbo will practice golf. His objective is to get a carry distance that is a multiple of K, while he can only make a carry distance of between A and B (inclusive). If he can achieve the objective, print `OK`; if he cannot, print `NG`. | ["k = int(input())\nk_under, k_over = map(int,input(),split())\nresult\u3000= 1\ncnt = 0\nwhile k * cnt > k_over:\n\tif k * cnt > k_under:\n print('OK')\n result = 0\n cnt += 1\n\nif result == 1:\n\tprint('NG')\n ", "k = int(input())\nk_under, k_over = map(int,input().split())\n\nif (k_under // k + ((k_under % k != 0) * 1)) * k > k_over:\n print('NG')\nelse:\n print('OK')"] | ['Runtime Error', 'Accepted'] | ['s199998712', 's277282648'] | [8928.0, 9140.0] | [21.0, 21.0] | [210, 157] |
p02693 | u887222798 | 2,000 | 1,048,576 | Takahashi the Jumbo will practice golf. His objective is to get a carry distance that is a multiple of K, while he can only make a carry distance of between A and B (inclusive). If he can achieve the objective, print `OK`; if he cannot, print `NG`. | ['K = int(input())\nA,B = map(int, input().split())\nfor i in range(A, B+1):\n if i % K == 0:\n print("OK")\n else:\n print("NG")', 'k = int(input())\na,b = map(int, input().split())\nfor i in range(a,b+1):\n if i%k==0:\n print("OK")\n else:\n print("NG")', 'K = int(input())\nA,B = map(int, input().split())\nfor i in range(A, B+1):\n if i % K == 0:\n print("OK")\nprint("NG")', 'K = int(input())\nA,B = map(int, input().split())\nstr = "NG"\nfor i in range(A, B+1):\n str = "OK" if i % K == 0 else None\nprint(str)\n ', 'K = int(input())\nA,B = map(int, input().split())\nfor i in range(A, B+1):\n if i % K == 0:\n print("OK")\nelse:\n print("NG")', 'k = int(input())\na,b = map(int, input().split())\nfor i in range(a,b+1):\n if i%k==0:\n print("Yes")\n else:\n print("NG")', 'K = int(input())\nA,B = map(int, input().split())\nstr = "NG"\nfor i in range(A, B+1):\n if i % K == 0:\n str = "OK"\nprint(str)'] | ['Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Accepted'] | ['s047823293', 's429576589', 's442377870', 's520596867', 's588218309', 's821866860', 's564502780'] | [9168.0, 9168.0, 9108.0, 9160.0, 9164.0, 9180.0, 9168.0] | [22.0, 22.0, 24.0, 21.0, 23.0, 20.0, 22.0] | [141, 136, 123, 138, 133, 137, 132] |
p02693 | u888546350 | 2,000 | 1,048,576 | Takahashi the Jumbo will practice golf. His objective is to get a carry distance that is a multiple of K, while he can only make a carry distance of between A and B (inclusive). If he can achieve the objective, print `OK`; if he cannot, print `NG`. | ['# -*- coding: utf-8 -*-\nimport math\n\nk = int(input())\n\n\n# a, b = map(int, input().split())\n\nn = 0\na=100\nwhile a < k:\n a= round(a*1.01)\n print(a)\n n+=1\nprint(n)\n', '# -*- coding: utf-8 -*-\nimport math\n\nk = int(input())\n\n\n# a, b = map(int, input().split())\n\nn = 0\na=100\nwhile a < k:\n a= math.floor(a*1.01)\n n+=1\nprint(n)\n', '# -*- coding: utf-8 -*-\n\nk = int(input())\n\n\na, b = map(int, input().split())\n\nif k==1:\n print("OK")\nelif a%k == 0:\n print("OK")\nelif abs(a-b) + a%k >= k:\n print("OK")\n# elif a//k != b//k:\n# print("OK")\nelse:\n print("NG")\n'] | ['Wrong Answer', 'Wrong Answer', 'Accepted'] | ['s247962808', 's614467879', 's790819998'] | [9152.0, 9152.0, 9172.0] | [20.0, 20.0, 25.0] | [169, 161, 237] |
p02693 | u888933875 | 2,000 | 1,048,576 | Takahashi the Jumbo will practice golf. His objective is to get a carry distance that is a multiple of K, while he can only make a carry distance of between A and B (inclusive). If he can achieve the objective, print `OK`; if he cannot, print `NG`. | ["k=int(input())\na,b=map(int,input().split())\nfor i in range(a,b+1):\n if i%k == 0:\n print('OK')\n break\n else:\n print('NG')", "k=int(input())\na,b=map(int,input().split())\nfor i in range(a,b+1):\n if i%k == 0:\n print('OK')\n break\nelse:\n print('NG')"] | ['Wrong Answer', 'Accepted'] | ['s356658807', 's126085459'] | [9168.0, 9080.0] | [26.0, 30.0] | [123, 122] |
p02693 | u891202624 | 2,000 | 1,048,576 | Takahashi the Jumbo will practice golf. His objective is to get a carry distance that is a multiple of K, while he can only make a carry distance of between A and B (inclusive). If he can achieve the objective, print `OK`; if he cannot, print `NG`. | ['N=int(input())\nA=list(map(int,input().split()))\nif 0 in A:\n print(0)\nketa=1\nfor i in A:\n keta*=i\n if keta>1000000000000000000:\n print(-1)\n else:\n print(keta)', 'K=int(input())\nA,B=map(int,input().split())\nif (B//K)*K>=A:\n print("OK")\nelse:\n print("NG")'] | ['Wrong Answer', 'Accepted'] | ['s398358212', 's415107218'] | [9172.0, 9156.0] | [19.0, 24.0] | [183, 97] |
p02693 | u891422384 | 2,000 | 1,048,576 | Takahashi the Jumbo will practice golf. His objective is to get a carry distance that is a multiple of K, while he can only make a carry distance of between A and B (inclusive). If he can achieve the objective, print `OK`; if he cannot, print `NG`. | ["k = int(input())\na,b = map(int, input().split())\ni=a\nwhile i<=b:\n if i%k==0:\n print('Yes')\n exit(0)\n i+=1\nprint('No')", "k = int(input())\na,b = map(int, input().split())\ni=a\nwhile i<=b:\n if i%k==0:\n print('OK')\n exit(0)\n i+=1\nprint('NG')"] | ['Wrong Answer', 'Accepted'] | ['s728489379', 's977411885'] | [9112.0, 9168.0] | [23.0, 21.0] | [125, 124] |
p02693 | u894172792 | 2,000 | 1,048,576 | Takahashi the Jumbo will practice golf. His objective is to get a carry distance that is a multiple of K, while he can only make a carry distance of between A and B (inclusive). If he can achieve the objective, print `OK`; if he cannot, print `NG`. | ['k = int(input())\n\ndata = input().split()\na = int(data[0])\nb = int(data[1])\n\nif a % k == 0 or b % k == 0:\n print("OK")\nelif b%k - a%k >= k:\n print("OK")\nelse:\n print("NO")', 'k = int(input())\n\ndata = input().split()\na = int(data[0])\nb = int(data[1])\n\nwhile b >= a:\n if b % k == 0:\n print("OK",b)\n break\n b -= 1\n \nif b < a:\n print("NO")', 'k = int(input())\n\ndata = input().split()\na = int(data[0])\nb = int(data[1])\n\nlargest = b //k * k\nif largest >= a:\n print("OK")\nelse:\n print("NG")'] | ['Wrong Answer', 'Wrong Answer', 'Accepted'] | ['s408290905', 's674901470', 's212801617'] | [9180.0, 9096.0, 9068.0] | [24.0, 20.0, 22.0] | [179, 186, 150] |
p02693 | u897633035 | 2,000 | 1,048,576 | Takahashi the Jumbo will practice golf. His objective is to get a carry distance that is a multiple of K, while he can only make a carry distance of between A and B (inclusive). If he can achieve the objective, print `OK`; if he cannot, print `NG`. | ['k =int(input())\na, b = map(int, input().split())\n\nfor i in range(a, b):\n if(i%k==0):\n print("OK")\n break\n else:\n print("NG")', 'k =int(input())\na, b = map(int, input().split())\n \nfor i in range(a, b):\n if (i % k == 0):\n break\n if(i % k == 0):\n print("OK")\n else:\n print("NG")', 'k =int(input())\na, b = map(int, input().split())\n \nfor i in range(a, b):\n if (i%k == 0):\n break\n print("OK")\n else:\n print("NG")', 'k =int(input())\na, b = map(int, input().split())\n\nfor i in range(a, b):\n if(i%k==0):\n break\n\nif(break): \n print("OK")\nelse:\n print("NG")', 'k =int(input())\na, b = map(int, input().split())\n\nfor i in range(a, b):\n if(i%k==0):\n print("OK")\n else:\n print("NG")', 'k =int(input())\na, b = map(int, input().split())\n \nfor i in range(a, b):\n if (i % k == 0):\n break\n j = i % k \nif(j == 0):\n print("OK")\nelse:\n print("NG")', 'k =int(input())\na, b = map(int, input().split())\n \nfor i in range(a, b+1):\n if (i % k == 0):\n print("OK")\n break\nelse:\n print("NG")'] | ['Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Runtime Error', 'Wrong Answer', 'Runtime Error', 'Accepted'] | ['s028814531', 's114955599', 's157393162', 's275568423', 's287990482', 's443174453', 's121354583'] | [9176.0, 9180.0, 9108.0, 8960.0, 9160.0, 9172.0, 9168.0] | [22.0, 20.0, 21.0, 25.0, 22.0, 22.0, 23.0] | [151, 177, 153, 154, 137, 172, 151] |
p02693 | u900139929 | 2,000 | 1,048,576 | Takahashi the Jumbo will practice golf. His objective is to get a carry distance that is a multiple of K, while he can only make a carry distance of between A and B (inclusive). If he can achieve the objective, print `OK`; if he cannot, print `NG`. | ['A, B, N = map(int, input().split())\nYmax=0\nif A*N < B:\n print(0)\nelse:\n x = B-1\n Ymax = A*x//B - A*(x//B)\n print(Ymax)', "K = int(input())\nA, B = map(int, input().split())\nflag=0\nfor i in range(A,B+1):\n if i%K==0:\n print('OK')\n flag=1\n break\nif flag==0:\n\tprint('NG')"] | ['Runtime Error', 'Accepted'] | ['s749024765', 's269075116'] | [9160.0, 9176.0] | [22.0, 23.0] | [122, 154] |
p02693 | u902800815 | 2,000 | 1,048,576 | Takahashi the Jumbo will practice golf. His objective is to get a carry distance that is a multiple of K, while he can only make a carry distance of between A and B (inclusive). If he can achieve the objective, print `OK`; if he cannot, print `NG`. | ['X = int(input())\nx = 100\ni = 0\nwhile x < X:\n x += x//100 \n i += 1\n\nprint(i)', 'import sys\nK = int(input())\nA, B = map(int, input().split())\n\nfor i in range(1000):\n s = K * i\n if A <= s <= B:\n print("OK")\n sys.exit()\nprint("NG")'] | ['Wrong Answer', 'Accepted'] | ['s892001061', 's790053633'] | [9004.0, 9120.0] | [23.0, 22.0] | [81, 168] |
p02693 | u906501980 | 2,000 | 1,048,576 | Takahashi the Jumbo will practice golf. His objective is to get a carry distance that is a multiple of K, while he can only make a carry distance of between A and B (inclusive). If he can achieve the objective, print `OK`; if he cannot, print `NG`. | ['def main():\n k = int(input())\n a, b = map(int, input().split())\n for i in range(a, b+1):\n if i%k == 0:\n print("Yes")\n return\n print("No")\n\nif __name__ == "__main__":\n main()', 'def main():\n k = int(input())\n a, b = map(int, input().split())\n for i in range(a, b+1):\n if i%k == 0:\n print("OK")\n return\n print("NG")\n\nif __name__ == "__main__":\n main()'] | ['Wrong Answer', 'Accepted'] | ['s986230676', 's973743362'] | [9164.0, 9112.0] | [31.0, 30.0] | [217, 216] |
p02693 | u906769651 | 2,000 | 1,048,576 | Takahashi the Jumbo will practice golf. His objective is to get a carry distance that is a multiple of K, while he can only make a carry distance of between A and B (inclusive). If he can achieve the objective, print `OK`; if he cannot, print `NG`. | ['K=int(input())\nA,B=list(map(int,input().split()))\ncount=0\nfor i in range(A,B):\n\tif i%K==0:\n\t\tcount+=1\n\t\tbreak\nif count==0:\n\tprint("No")\nelse:\n\tprint("Yes")', 'K=int(input())\nA,B=list(map(int,input().split()))\ncount=0\nfor i in range(A,B+1):\n\tif i%K==0:\n\t\tcount+=1\n\t\tbreak\nif count==0:\n\tprint("NG")\nelse:\n\tprint("OK")'] | ['Wrong Answer', 'Accepted'] | ['s719565639', 's724882309'] | [9056.0, 9072.0] | [31.0, 28.0] | [155, 156] |
p02693 | u907403674 | 2,000 | 1,048,576 | Takahashi the Jumbo will practice golf. His objective is to get a carry distance that is a multiple of K, while he can only make a carry distance of between A and B (inclusive). If he can achieve the objective, print `OK`; if he cannot, print `NG`. | ['k = int(input())\na, b = map(int, input().split())\nif a//k > b//k:\n print("OK")\nelse:\n print("NG")', 'k = int(input())\na, b = map(int, input().split())\nif a//k < b//k or a%k == 0 or b%k == 0:\n print("OK")\nelse:\n print("NG")'] | ['Wrong Answer', 'Accepted'] | ['s085908878', 's402457239'] | [9156.0, 9168.0] | [20.0, 20.0] | [103, 127] |
p02693 | u911531682 | 2,000 | 1,048,576 | Takahashi the Jumbo will practice golf. His objective is to get a carry distance that is a multiple of K, while he can only make a carry distance of between A and B (inclusive). If he can achieve the objective, print `OK`; if he cannot, print `NG`. | ['import math\naccount = 100\ngoal = int(input())\ncount = 0\n\nwhile True:\n count += 1\n account = math.floor(account * 1.01)\n if account >= goal:\n \tbreak\nprint(count)', 'account = 100\ngoal = int(input())\ncount = 0\n\nwhile True:\n count += 1\n account *= 1.01\n if account >= goal:\n \tbreak\nprint(count)', 'import math\naccount = 100\ngoal = int(input())\ncount = 0\n\nwhile True:\n count += 1\n account = math.floor(account * 1.01)\n if account >= goal:\n \tbreak\nprint(count)', "base = int(input())\nmin,max = map(int, input().split())\nfor num in range(min,max+1):\n if num % base == 0:\n print('OK')\n break\nelse:\n print('NG')"] | ['Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Accepted'] | ['s255928664', 's336497828', 's751082994', 's317141709'] | [9152.0, 9168.0, 9048.0, 9160.0] | [23.0, 24.0, 22.0, 20.0] | [164, 131, 164, 152] |
p02693 | u916242112 | 2,000 | 1,048,576 | Takahashi the Jumbo will practice golf. His objective is to get a carry distance that is a multiple of K, while he can only make a carry distance of between A and B (inclusive). If he can achieve the objective, print `OK`; if he cannot, print `NG`. | ['K = int(input())\nA,B =list(map(int,input().split()))\ncount =0\nwhile count * K<A:\n\tcount +=1\nif count *K <=B:\n\tprint("OK")\nelse\n\tprint("NG")', 'K = int(input())\nA,B =list(map(int,input().split()))\ncount =0\nwhile count * K<A:\n\tcount +=1\nif count *K <=B:\n\tprint("OK")\nelse:\n\tprint("NG")\n'] | ['Runtime Error', 'Accepted'] | ['s914943653', 's638619308'] | [8960.0, 9100.0] | [23.0, 20.0] | [139, 141] |
p02693 | u916662650 | 2,000 | 1,048,576 | Takahashi the Jumbo will practice golf. His objective is to get a carry distance that is a multiple of K, while he can only make a carry distance of between A and B (inclusive). If he can achieve the objective, print `OK`; if he cannot, print `NG`. | ['K = int(input())\nA , B = (int(x) for x in input().split())\n\n\nfor i in range(1000):\n if A >= i*K >= B:\n print("OK")\n break\n elif i*K > B:\n print("NG")\n break\n', 'K = int(input())\nA , B = (int(x) for x in input().split())\n\n\nfor i in range(1000):\n if B >= i * K >= A:\n print("OK")\n break\n elif i*K > B:\n print("NG")\n break\n\n'] | ['Wrong Answer', 'Accepted'] | ['s488600596', 's905212124'] | [9164.0, 9156.0] | [20.0, 22.0] | [191, 194] |
p02693 | u917444023 | 2,000 | 1,048,576 | Takahashi the Jumbo will practice golf. His objective is to get a carry distance that is a multiple of K, while he can only make a carry distance of between A and B (inclusive). If he can achieve the objective, print `OK`; if he cannot, print `NG`. | ['x=int(input())\nn=100\nans=0\nwhile True:\n if 10000*(pow(1.01,ans)-1)>=x:\n print(ans)\n exit()\n ans+=1', "k=int(input())\na,b=map(int,input().split())\nfor i in range(a,b+1):\n if i%k==0:\n print('OK')\n exit()\nprint('NG')"] | ['Wrong Answer', 'Accepted'] | ['s638577153', 's067845957'] | [9432.0, 9100.0] | [20.0, 24.0] | [106, 128] |
p02693 | u917734688 | 2,000 | 1,048,576 | Takahashi the Jumbo will practice golf. His objective is to get a carry distance that is a multiple of K, while he can only make a carry distance of between A and B (inclusive). If he can achieve the objective, print `OK`; if he cannot, print `NG`. | ["S = int(input())\nA,B = map(int,input().split())\ncheck = false\nans = 0\ni = 1\nwhile S <= B:\n ans = S * i\n if A <= ans and B >= ans:\n check = true\n break\nif check:\n print('OK')\nelse:\n print('NG')\n", "S = int(input())\nA,B = map(int,input().split())\ncheck = false\nwhile S <= B:\n S *= S\n if A <= S and B >= S:\n check = true\n break\nif check:\n print('OK')\nelse:\n print('NG')", "S = int(input())\nA,B = map(int,input().split())\ncheck = False\nans = 0\ni = 1\nwhile ans <= B:\n ans = S * i\n if A <= ans and B >= ans:\n check = True\n break\n i += 1\nif check:\n print('OK')\nelse:\n print('NG')"] | ['Runtime Error', 'Runtime Error', 'Accepted'] | ['s676271805', 's785913973', 's673022943'] | [9172.0, 9112.0, 9060.0] | [22.0, 20.0, 22.0] | [203, 179, 213] |
p02693 | u918120636 | 2,000 | 1,048,576 | Takahashi the Jumbo will practice golf. His objective is to get a carry distance that is a multiple of K, while he can only make a carry distance of between A and B (inclusive). If he can achieve the objective, print `OK`; if he cannot, print `NG`. | ['K=int(input())\nA,B = map(int, input("").split())\nfor i in range(A,B):\n if i%K==0:\n print("OK")\n break\n else:sum=1\nif sum==1:\n print("NG")', 'K=int(input())\nA,B = map(int, input("").split())\nhey="NG"\nfor i in range(A,B+1):\n if i%K==0:\n hey="OK"\n break\nprint(hey)'] | ['Wrong Answer', 'Accepted'] | ['s328138175', 's187247284'] | [9172.0, 9164.0] | [23.0, 23.0] | [160, 137] |
p02693 | u921729430 | 2,000 | 1,048,576 | Takahashi the Jumbo will practice golf. His objective is to get a carry distance that is a multiple of K, while he can only make a carry distance of between A and B (inclusive). If he can achieve the objective, print `OK`; if he cannot, print `NG`. | ['A, B, N = map(int, input().split())\nf = [int(A*x/B) - (A * int(x/B)) for x in range(N+1)]\nprint(max(f))', "K = int(input())\nA, B = map(int, input().split())\njudge = False\nfor i in range(A, B+1):\n if i % K == 0:\n print('OK')\n judge = True\n break\nif !judge:\n print('NG')", "K = int(input())\nA, B = map(int, input().split())\nlargest = int(B/K) * K\nif largest >= A:\n print('OK')\nelse:\n print('NG')"] | ['Runtime Error', 'Runtime Error', 'Accepted'] | ['s148367454', 's879114961', 's013404963'] | [9172.0, 9028.0, 9152.0] | [23.0, 23.0, 23.0] | [103, 172, 123] |
p02693 | u923010184 | 2,000 | 1,048,576 | Takahashi the Jumbo will practice golf. His objective is to get a carry distance that is a multiple of K, while he can only make a carry distance of between A and B (inclusive). If he can achieve the objective, print `OK`; if he cannot, print `NG`. | ['K = int(input())\nA,B = map(int,input().split())\n\nif (A-B) >= K:\n print("OK")\nelse:\n for a in range(1000):\n if a * K >= A:\n if a * K <= B:\n print("OK")\n else:\n print("NG")\n', 'K = int(input())\nA,B = map(int,input().split())\n\nfor a in range(1000):\n if a * K >= A:\n if a * K <= B:\n print("OK")\n break\nelse:\n print("NG")'] | ['Wrong Answer', 'Accepted'] | ['s410758460', 's591671892'] | [9172.0, 9176.0] | [21.0, 24.0] | [220, 176] |
p02693 | u924182136 | 2,000 | 1,048,576 | Takahashi the Jumbo will practice golf. His objective is to get a carry distance that is a multiple of K, while he can only make a carry distance of between A and B (inclusive). If he can achieve the objective, print `OK`; if he cannot, print `NG`. | ['K = int(input())\nA,B = map(int,input().split())\nflag = False\n\nif A==B:\n if A % K ==0:\n flag = True\nfor i in range(A,B+1,1):\n print(i)\n if i % K == 0:\n flag = True\n\nif flag:\n print("OK")\nelse:\n print("NG")', 'K = int(input())\nA,B = map(int,input().split())\nflag = False\n\n# if A==B:\n# if A % K ==0:\n\nfor i in range(A,B+1,1):\n print(i)\n if i % K == 0:\n flag = True\n\nif flag:\n print("OK")\nelse:\n print("NG")', 'K = int(input())\nA,B = map(int,input().split())\nflag = False\n\n# if A==B:\n# if A % K ==0:\n\nfor i in range(A,B+1,1):\n #print(i)\n if i % K == 0:\n flag = True\n\nif flag:\n print("OK")\nelse:\n print("NG")'] | ['Wrong Answer', 'Wrong Answer', 'Accepted'] | ['s136848883', 's666309902', 's142586785'] | [9120.0, 9116.0, 9112.0] | [21.0, 19.0, 20.0] | [233, 239, 240] |
p02693 | u924828749 | 2,000 | 1,048,576 | Takahashi the Jumbo will practice golf. His objective is to get a carry distance that is a multiple of K, while he can only make a carry distance of between A and B (inclusive). If he can achieve the objective, print `OK`; if he cannot, print `NG`. | ['k = int(input)\na,b = [int(x) for x in input().split()]\nans = "NG"\nfor i in range(1000):\n if a <= i * k and i * k <= b:\n ans = "OK"\n break\nprint(ans)', 'k = int(input())\na,b = [int(x) for x in input().split()]\nans = "NG"\nfor i in range(1000):\n if a <= i * k and i * k <= b:\n ans = "OK"\n break\nprint(ans)'] | ['Runtime Error', 'Accepted'] | ['s934864691', 's136564322'] | [8908.0, 9132.0] | [24.0, 28.0] | [155, 157] |
p02693 | u926080943 | 2,000 | 1,048,576 | Takahashi the Jumbo will practice golf. His objective is to get a carry distance that is a multiple of K, while he can only make a carry distance of between A and B (inclusive). If he can achieve the objective, print `OK`; if he cannot, print `NG`. | ["k=int(input())\na,b=map(int, input().split())\nok=False\nfor i in range(a, b+1):\n ok = ok or i % k\nprint(['NG','OK'][ok])", "k=int(input())\na,b=map(int, input().split())\nok=False\nfor i in range(a, b+1):\n ok = ok or (i % k == 0)\nprint(['NG','OK'][ok])"] | ['Runtime Error', 'Accepted'] | ['s328132151', 's575970720'] | [9004.0, 9168.0] | [28.0, 26.0] | [119, 126] |
p02693 | u927282564 | 2,000 | 1,048,576 | Takahashi the Jumbo will practice golf. His objective is to get a carry distance that is a multiple of K, while he can only make a carry distance of between A and B (inclusive). If he can achieve the objective, print `OK`; if he cannot, print `NG`. | ['K=int(input())\nA,B=list(map(int,input().split()))\nn=int(A/K)\nm=int(B/K)\nif K==1:\n print("OK")\nelif n-m>=1:\n print("OK")\nelse:\n print("NG")', 'K=int(input())\nA,B=list(map(int,input().split()))\nn=int(A/K)\nm=int(B/K)\nif K==1:\n print("OK")\nelif A/K-n==0.0 or B/K-m==0.0:\n print("OK")\nelif n-m>=1:\n print("OK")\nelse:\n print("NG")', 'K=int(input())\nA,B=list(map(int,input().split()))\nn=int(A/K)\nm=int(B/K)\nif n-m>=1:\n print("OK")\nelse:\n print("NG")', 'K=int(input())\nA,B=list(map(int,input().split()))\nn=int(A/K)\nm=int(B/K)\nif K==1:\n print("OK")\nelif A/K-n==0.0 or B/K-m==0.0:\n print("OK")\nelif m-n>=1:\n print("OK")\nelse:\n print("NG")'] | ['Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Accepted'] | ['s173459713', 's197964323', 's554693594', 's421977012'] | [9120.0, 9188.0, 9168.0, 9184.0] | [25.0, 22.0, 24.0, 23.0] | [141, 186, 116, 186] |
p02693 | u927373043 | 2,000 | 1,048,576 | Takahashi the Jumbo will practice golf. His objective is to get a carry distance that is a multiple of K, while he can only make a carry distance of between A and B (inclusive). If he can achieve the objective, print `OK`; if he cannot, print `NG`. | ['K = int(input())\nA, B = map(int,input().split())\nflag = 0\n\nwhile(K <= B):\n if(K >= A):\n print("OK")\n flag = 1\n break\n else:\n K += K\nif(flag == 0):\n print("NG")\n\n ', 'K = int(input())\nA, B = map(int,input().split())\nflag = 0\nnum = K\n\nwhile(K <= B):\n if(K >= A):\n print("OK")\n flag = 1\n break\n else:\n K += num\nif(flag == 0):\n print("NG")\n\n \n\n'] | ['Wrong Answer', 'Accepted'] | ['s850483525', 's150989599'] | [9164.0, 9172.0] | [22.0, 24.0] | [178, 190] |
p02693 | u927807968 | 2,000 | 1,048,576 | Takahashi the Jumbo will practice golf. His objective is to get a carry distance that is a multiple of K, while he can only make a carry distance of between A and B (inclusive). If he can achieve the objective, print `OK`; if he cannot, print `NG`. | ['k = input()\na,b = map(int,input().split())\nfor i in range(a,b,1):\n if (i%k) == 0:\n han = True\nif han == True:\n print("OK")\nelse:\n print("No")', 'k = input()\na,b = map(int,input().split())\nhan = False\nfor i in range(a,b,1):\n if i%k == 0:\n han = True\nif han == True:\n print("OK")\nelse:\n print("NG")', 'k = input()\na,b = map(int,input().split())\nfor i in range(a,b,1):\n if i%k == 0:\n han = True\nif han == True:\n print("OK")\nelse:\n print("No")', 'k = int(input())\na,b = map(int,input().split())\nhan = False\nfor i in range(a,b+1):\n if i%k == 0:\n han = True\nif han == True:\n print("OK")\nelse:\n print("NG")'] | ['Runtime Error', 'Runtime Error', 'Runtime Error', 'Accepted'] | ['s135663465', 's411980737', 's637947583', 's245072398'] | [9168.0, 9104.0, 9172.0, 9168.0] | [20.0, 21.0, 22.0, 20.0] | [157, 167, 155, 172] |
p02693 | u927860986 | 2,000 | 1,048,576 | Takahashi the Jumbo will practice golf. His objective is to get a carry distance that is a multiple of K, while he can only make a carry distance of between A and B (inclusive). If he can achieve the objective, print `OK`; if he cannot, print `NG`. | ['a=int(input())\nb,c=map(int,input().split())\njuge=0\n\nfor i in range(b,c+1):\n if i%a==0:\n juge=+1\n break\n else:\n continue\n\nprint("Yes" if juge==1 else "NG")', 'a=int(input())\nb,c=map(int,input().split())\nX=[]\n\nfor i in range(b,c+1):\n X.append(i%a)\n\nif 0.0 in X:\n print("Yes")\nelse:\n print("NG")', 'a=int(input())\nb,c=map(int,input().split())\nX=[]\n\nfor i in range(b,c+1):\n X.append(i%a)\n\nif 0 in set(X):\n print("Yes")\nelse:\n print("NG")', 'a=int(input())\nb,c=map(int,input().split())\njuge=0\n\nfor i in range(b,c+1):\n if i%a==0:\n juge=+1\n break\n else:\n continue\n\nprint("Yes" if juge==1 else "NG")', 'a=int(input())\nb,c=map(int,input().split())\nX=[]\n\nfor i in range(b,c+1):\n X.append(int(i%a))\n\nif 0 in X:\n print("Yes")\nelse:\n print("NG")', 'a=int(input())\nb,c=map(int,input().split())\njuge=0\n\nfor i in range(b,c+1):\n if i%a==0:\n juge=+1\n break\n\nprint("OK" if juge==1 else "NG")\n'] | ['Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Accepted'] | ['s123507125', 's311671999', 's599455570', 's699933438', 's903443315', 's009563910'] | [9176.0, 9160.0, 9144.0, 9072.0, 9176.0, 9108.0] | [22.0, 20.0, 20.0, 20.0, 22.0, 20.0] | [181, 143, 146, 181, 146, 154] |
p02693 | u927870520 | 2,000 | 1,048,576 | Takahashi the Jumbo will practice golf. His objective is to get a carry distance that is a multiple of K, while he can only make a carry distance of between A and B (inclusive). If he can achieve the objective, print `OK`; if he cannot, print `NG`. | ["k=int(input())\na=list(map(int,input().split()))\nb=k*(a[0]//k)\nprint(b)\nif b==a[1]:\n print('OK')\nelif b+k<=a[1]:\n print('OK')\nelse:\n print('NG')", "k=int(input())\na=list(map(int,input().split()))\nb=k*(a[0]//k)\nif b==a[0]:\n print('OK')\nelif b+k<=a[1]:\n print('OK')\nelse:\n print('NG')"] | ['Wrong Answer', 'Accepted'] | ['s739759136', 's485517359'] | [9120.0, 9084.0] | [22.0, 24.0] | [160, 151] |
p02693 | u928758473 | 2,000 | 1,048,576 | Takahashi the Jumbo will practice golf. His objective is to get a carry distance that is a multiple of K, while he can only make a carry distance of between A and B (inclusive). If he can achieve the objective, print `OK`; if he cannot, print `NG`. | ['import os\nimport sys\nfrom collections import deque\nfrom collections import Counter\nfrom heapq import heappop,heappush\n\ndef main():\n\tk = int(input())\n\ta,b = map(int, input().split())\n\tif a == b:\t\n\t\tprint("Yes")\n\t\tsys.exit()\n\tif b - a >= k:\n\t\tprint("Yes")\n\telse:\n\t\tprint("NO")\n\nif __name__ == "__main__":\n\tmain()\n', 'import os\nimport sys\nfrom collections import deque\nfrom collections import Counter\nfrom heapq import heappop,heappush\n\ndef main():\n\tk = int(input())\n\ta,b = map(int, input().split())\n\tif b - a >= k or b - a == 0:\n\t\tprint("Yes")\n\telse:\n\t\tprint("NO")\n\nif __name__ == "__main__":\n\tmain()\n', 'import os\nimport sys\nfrom collections import deque\nfrom collections import Counter\nfrom heapq import heappop,heappush\n\ndef main():\n\tk = int(input())\n\ta,b = map(int, input().split())\n\tsub = b - a\n\tif sub == 0:\n\t\tprint("OK")\n\t\tsys.exit()\n\tif sub <= k:\n\t\tprint("OK")\n\t\tsys.exit()\n\telse:\n\t\tprint("NG")\n\t\tsys.exit()\n\n\n\nif __name__ == "__main__":\n\tmain()\n', 'import os\nimport sys\n\ndef main():\n\tk = int(input())\n\ta,b = map(int, input().split())\n\tlist_a = []\n\tif b == a:\n\t\tprint("OK")\n\t\tsys.exit()\n\n\tfor i in range(b,a-1,-1):\n\t\tlist_a.append(i)\n\tprint(list_a)\n\tfor i in list_a:\n\t\tif i%k == 0:\n\t\t\tprint("OK")\n\t\t\tsys.exit()\n\tprint("NG")\n\nif __name__ == "__main__":\n\tmain()\n', 'import os\nimport sys\nfrom collections import deque\nfrom collections import Counter\nfrom heapq import heappop,heappush\n\ndef main():\n\tk = int(input())\n\ta,b = map(int, input().split())\n\tfor i in range(b, a-1, -1):\n\t\tif i % k == 0:\n\t\t\tprint("OK")\n\t\t\tsys.exit()\n\tprint("NG")\n\nif __name__ == "__main__":\n\tmain()\n\n'] | ['Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Accepted'] | ['s013302406', 's410321223', 's594145914', 's675129256', 's108545889'] | [9456.0, 9464.0, 9460.0, 9192.0, 9456.0] | [24.0, 22.0, 21.0, 21.0, 23.0] | [311, 284, 349, 310, 307] |
p02693 | u932868243 | 2,000 | 1,048,576 | Takahashi the Jumbo will practice golf. His objective is to get a carry distance that is a multiple of K, while he can only make a carry distance of between A and B (inclusive). If he can achieve the objective, print `OK`; if he cannot, print `NG`. | ["k=int(input())\na,b=map(int,input().split())\nn=1\nwhile k*n<=b:\n n+=1\nprint('OK' if 100<=(n-1)*k<=120 else 'NG')", "k=int(input())\na,b=map(int,input().split())\nn=1\nwhile k*n<=b:\n n+=1\nprint('OK' if a<=(n-1)*k<=b else 'NG')"] | ['Wrong Answer', 'Accepted'] | ['s711556908', 's590189679'] | [9164.0, 9168.0] | [22.0, 21.0] | [111, 107] |
p02693 | u933129390 | 2,000 | 1,048,576 | Takahashi the Jumbo will practice golf. His objective is to get a carry distance that is a multiple of K, while he can only make a carry distance of between A and B (inclusive). If he can achieve the objective, print `OK`; if he cannot, print `NG`. | ['k = int(input())\na, b = map(int, input().split())\ni = 0\nwhile i*k <= b:\n print(i*k)\n if a <= i*k <= b:\n print("OK")\n break\n i += 1\nelse:\n print("NG")\n', 'k = int(input())\na, b = map(int, input().split())\ni = 0\nwhile i*k <= b:\n if a <= i*k <= b:\n print("OK")\n break\n i += 1\nelse:\n print("NG")\n'] | ['Wrong Answer', 'Accepted'] | ['s017903699', 's701821183'] | [9168.0, 9032.0] | [26.0, 24.0] | [176, 161] |
p02693 | u933929042 | 2,000 | 1,048,576 | Takahashi the Jumbo will practice golf. His objective is to get a carry distance that is a multiple of K, while he can only make a carry distance of between A and B (inclusive). If he can achieve the objective, print `OK`; if he cannot, print `NG`. | ['k = int(input())\na, b = map(int, input().split())\nflag = 0\nfor i in range(a, b+1)\n\tif i%k == 0:\n \tflag = 1\nif flag == 1:\n\tprint("OK")\nelse:\n\tprint("NG")', 'k = int(input())\na, b = map(int, input().split())\nflag = 0\nfor i in range(a, b+1):\n if i%k == 0:\n flag = 1\nif flag == 1:\n\tprint("OK")\nelse:\n\tprint("NG")'] | ['Runtime Error', 'Accepted'] | ['s301120570', 's569604100'] | [9024.0, 9176.0] | [19.0, 23.0] | [155, 162] |
p02693 | u940332739 | 2,000 | 1,048,576 | Takahashi the Jumbo will practice golf. His objective is to get a carry distance that is a multiple of K, while he can only make a carry distance of between A and B (inclusive). If he can achieve the objective, print `OK`; if he cannot, print `NG`. | ['K = input()\nA,B=input().split()\n\nk = int(K)\na = int(A)\nb = int(B)\nwhile True:\n\n for i in range(1000):\n kk = k * i\n if kk >= a and kk <= b:\n p = "OK"\n break\np = "NG"\n\n\nprint(p)', 'K = input()\nA,B=input().split()\n\nk = int(K)\na = int(A)\nb = int(B)\n\np = "NG"\nfor i in range(1000):\n kk = k * i\n if (kk >= a and kk <= b) or k == 1:\n p = "OK"\n\n\n\nprint(p)\n'] | ['Wrong Answer', 'Accepted'] | ['s155054120', 's865221100'] | [9168.0, 9176.0] | [20.0, 25.0] | [206, 182] |
p02693 | u940402366 | 2,000 | 1,048,576 | Takahashi the Jumbo will practice golf. His objective is to get a carry distance that is a multiple of K, while he can only make a carry distance of between A and B (inclusive). If he can achieve the objective, print `OK`; if he cannot, print `NG`. | ['a,b,n=map(int,input().split())\nmaxs=0\nif a>=b:\n if n>=b:\n maxs=a/b*(b-1)-(a%b*(b-1))%b/b\n else:\n maxs=a/b*n-(a%b*n)%b/b\nelse:\n if n>=b:\n maxs=(a*(b-1))//b\n else:\n maxs=(a*n)//b\nprint(int(maxs))', "k=int(input())\na,b=map(int,input().split())\nif a//k*k+k>=b:\n print('OK')\nelse:\n print('NG')\n ", 'a,b,n=map(int,input().split())\nmaxs=0\nif a>=b:\n if n>=b:\n maxs=a/b*(b-1)-(a%b*(b-1))%b/b\n else:\n maxs=a/b*n-(a%b*n)%b/b\nelse:\n if n>=b:\n maxs={a*(b-1)}//b\n else:\n maxs={a*n}//b\nprint(int(maxs))', "k=int(input())\na,b=map(int,input().split())\nif a%k==0:\n print('OK')\nelse:\n \n if a//k*k+k<=b:\n print('OK')\n else:\n print('NG')"] | ['Runtime Error', 'Wrong Answer', 'Runtime Error', 'Accepted'] | ['s246822747', 's515610789', 's848687455', 's276012903'] | [9128.0, 9152.0, 9060.0, 9168.0] | [22.0, 22.0, 20.0, 21.0] | [233, 102, 233, 151] |
p02693 | u942051624 | 2,000 | 1,048,576 | Takahashi the Jumbo will practice golf. His objective is to get a carry distance that is a multiple of K, while he can only make a carry distance of between A and B (inclusive). If he can achieve the objective, print `OK`; if he cannot, print `NG`. | ['K=int(input())\nA,B=map(int,input().split())\nflag=True\nfor i in range(A:B+1):\n if i%K==0:\n print("OK")\n flag=False\n break\nif flag:\n print("NG")', 'K=int(input())\nA,B=map(int,input().split())\nflag=True\nfor i in range(A,B+1):\n if i%K==0:\n print("OK")\n flag=False\n break\nif flag:\n print("NG")'] | ['Runtime Error', 'Accepted'] | ['s997477232', 's593016599'] | [8992.0, 9072.0] | [24.0, 20.0] | [169, 169] |
p02693 | u943798729 | 2,000 | 1,048,576 | Takahashi the Jumbo will practice golf. His objective is to get a carry distance that is a multiple of K, while he can only make a carry distance of between A and B (inclusive). If he can achieve the objective, print `OK`; if he cannot, print `NG`. | ['#!/usr/bin/env python3\n\nimport random\nimport numpy as np\n\n\nN, M = [int(x) for x in input().split()]\n\n\ndef try_get(N: int, M: int) -> (bool, list):\n used_flag = np.zeros(N)\n stage_marks = [] # [(v1,v2)]\n ones = np.ones(N)\n for length in reversed(range(1, M+1)):\n numbers = np.arange(N - length) + 1\n numbers = numbers[np.logical_and(used_flag[:(N-length)]==0,used_flag[length:N]==0)]\n if len(numbers) == 0:\n return False, []\n num = np.random.choice(numbers)\n stage_marks.append((num, num + length))\n used_flag[num-1] = 1\n used_flag[num+length-1] = 1\n\n return True, stage_marks\n\n\nok = False\nmarks = []\nwhile not ok:\n ok, marks = try_get(N, M)\n\nfor src, dst in marks:\n print("{} {}".format(src, dst))\n', '#!/usr/bin/env python3\n\nimport random\nimport numpy as np\n\n\nN, M = [int(x) for x in input().split()]\n\n\ndef try_get(N: int, M: int) -> (bool, list):\n used_flag = np.zeros(N)\n stage_marks = [] # [(v1,v2)]\n ones = np.ones(N)\n for length in reversed(range(1, M+1)):\n numbers = np.arange(N - length) + 1\n numbers = numbers[np.logical_and(used_flag[:(N-length)]==0,used_flag[length:N]==0)]\n if len(numbers) == 0:\n return False, []\n num = np.random.choice(numbers)\n stage_marks.append((num, num + length))\n used_flag[num-1] = 1\n used_flag[num+length-1] = 1\n\n return True, stage_marks\n\n\nok = False\nmarks = []\nwhile not ok:\n ok, marks = try_get(N, M)\n\nfor src, dst in marks:\n print("{} {}".format(src, dst))\n', '\nK = int(input())\nA, B = [int(x) for x in input().split()]\n\nprint("OK" if A // K < B // K or A % K == 0 or B % K == 0 else "NG")'] | ['Runtime Error', 'Runtime Error', 'Accepted'] | ['s030863334', 's986758877', 's911622935'] | [27024.0, 27112.0, 9168.0] | [109.0, 100.0, 23.0] | [780, 780, 128] |
p02693 | u944886577 | 2,000 | 1,048,576 | Takahashi the Jumbo will practice golf. His objective is to get a carry distance that is a multiple of K, while he can only make a carry distance of between A and B (inclusive). If he can achieve the objective, print `OK`; if he cannot, print `NG`. | ['k=int(input())\na,b=map(int,input().split())\n \nfor i in 1000:\n if a<=k*i<=b:\n print("OK")\n else:\n pass\nprint("NG")', 'k=int(input())\na,b=map(int,input().split())\n \nfor i in range(10000):\n if a<=k*i<=b:\n print("OK")\n else:\n pass\nprint("NG")', 'k=int(input())\na,b=map(int,input().split())\n \nfor i in range(1000):\n if a<=k*i<=b:\n print("OK")\n else:\n pass\nprint("NG")', 'k=int(input())\na,b=map(int,input().split())\n\nfor i in 1000:\n if a<=k*i<=b:\n print("OK")\n else:\n pass\nprint("NG")', 'k=int(input())\na,b=map(int,input().split())\n \nfor i in range(10000):\n if a<=k*i<=b:\n print("OK")\n exit()\n else:\n pass\nprint("NG")'] | ['Runtime Error', 'Wrong Answer', 'Wrong Answer', 'Runtime Error', 'Accepted'] | ['s032923813', 's278278483', 's484134018', 's631104200', 's682053422'] | [9064.0, 9096.0, 9104.0, 9164.0, 9072.0] | [27.0, 27.0, 26.0, 23.0, 30.0] | [115, 123, 122, 114, 132] |
p02693 | u945460548 | 2,000 | 1,048,576 | Takahashi the Jumbo will practice golf. His objective is to get a carry distance that is a multiple of K, while he can only make a carry distance of between A and B (inclusive). If he can achieve the objective, print `OK`; if he cannot, print `NG`. | ['k = int(input())\na, b = list(map(int, input().split()))\n\nfor i in range(1000):\n if k*i >= a and k*i=<b:\n print("OK")\n exit()\n if k*i > b:\n break\n\nprint("NG")', 'k = int(input())\na, b = list(map(int, input().split()))\n\nfor i in range(1001):\n if k*i >= a and k*i<=b:\n print("OK")\n exit()\n if k*i > b:\n break\n\nprint("NG")'] | ['Runtime Error', 'Accepted'] | ['s825751773', 's335827750'] | [9024.0, 9180.0] | [19.0, 22.0] | [184, 184] |
p02693 | u947047288 | 2,000 | 1,048,576 | Takahashi the Jumbo will practice golf. His objective is to get a carry distance that is a multiple of K, while he can only make a carry distance of between A and B (inclusive). If he can achieve the objective, print `OK`; if he cannot, print `NG`. | ['a = A//K\n# b = B//K\nC = K * (a+1)\n\n# if K > B:\n # print ("NG")\n\n\nif C <= B:\n print ("OK")\nelse:\n print ("NG")', 'import math\n\n# K = 1\n# A, B = 11, 11\n\nK = int(input())\nA, B = map(int, input().split())\n\na = math.ceil(A/K)\n# b = B//K\nC = K * (a)\n\n# if K > B:\n # print ("NG")\n\n\nif C <= B:\n print ("OK")\nelse:\n print ("NG")'] | ['Runtime Error', 'Accepted'] | ['s017560788', 's814787265'] | [9092.0, 9168.0] | [22.0, 21.0] | [118, 215] |
p02693 | u948233576 | 2,000 | 1,048,576 | Takahashi the Jumbo will practice golf. His objective is to get a carry distance that is a multiple of K, while he can only make a carry distance of between A and B (inclusive). If he can achieve the objective, print `OK`; if he cannot, print `NG`. | ['K=int(input())\nA,B=list(map(int,input().split()))\nc=K\nwhile c<=B:\n if c>=A and c<=B:\n print("OK")\n break\nelse:\n print("NG")', 'K=int(input())\nA,B=list(map(int,input().split()))\nc=K\nwhile c<=B:\n if c>=A and c<=B:\n print("OK")\n break\n else:\n c += K\nelse:\n print("NG")\n'] | ['Time Limit Exceeded', 'Accepted'] | ['s145453209', 's493758541'] | [9168.0, 9164.0] | [2205.0, 23.0] | [131, 151] |
p02693 | u948521599 | 2,000 | 1,048,576 | Takahashi the Jumbo will practice golf. His objective is to get a carry distance that is a multiple of K, while he can only make a carry distance of between A and B (inclusive). If he can achieve the objective, print `OK`; if he cannot, print `NG`. | ['import math\nA,B,N = map(int,input().split())\nmaxn = 0\nsec =False\nfor x in range(1,N+1):\n tmp = math.floor((A*x)/B)-A*(math.floor(x/B))\n if maxn < tmp:\n maxn = tmp\n if tmp == 0:\n if sec ==True:\n break\n else:\n sec =True\n \nprint(maxn)', '\nN = int(input())\nA,B = map(int,input().split())\nans =0\n\nfor x in range(A,B+1):\n if x%N ==0:\n ans =1\n break\nif ans ==1:\n print("Yes")\nelse:\n print("No")', '#A\nN = int(input())\nA,B = map(int,input().split())\nans =0\n\nfor x in range(A,B+1):\n if x%N ==0:\n ans =1\n break\nif ans ==1:\n print("OK")\nelse:\n print("NG")\n'] | ['Runtime Error', 'Wrong Answer', 'Accepted'] | ['s012311057', 's667215155', 's539364322'] | [9188.0, 9176.0, 9164.0] | [26.0, 22.0, 20.0] | [286, 175, 177] |
p02693 | u954774382 | 2,000 | 1,048,576 | Takahashi the Jumbo will practice golf. His objective is to get a carry distance that is a multiple of K, while he can only make a carry distance of between A and B (inclusive). If he can achieve the objective, print `OK`; if he cannot, print `NG`. | ['def solve():\n k=int(input())\n a,b=map(int,input().split())\n ans=\'NG\'\n for i in range(a,b+1):\n if(k%i==0):\n ans="OK"\n break\n print(ans)\nsolve()\n', 'def solve():\n k=int(input())\n a,b=map(int,input().split())\n ans=\'NG\'\n for i in range(a,b+1):\n if(i%k==0):\n ans="OK"\n break\n print(ans)\nsolve()'] | ['Wrong Answer', 'Accepted'] | ['s117281841', 's798389682'] | [9192.0, 9160.0] | [20.0, 22.0] | [187, 186] |
p02693 | u954954040 | 2,000 | 1,048,576 | Takahashi the Jumbo will practice golf. His objective is to get a carry distance that is a multiple of K, while he can only make a carry distance of between A and B (inclusive). If he can achieve the objective, print `OK`; if he cannot, print `NG`. | ['K=int(input())\nans=False\nM,N = map(int,input().rstrip().split(" ")) \n\nfor number in range(M,N+1):\n if number%K==0:\n ans=True\nif ans:\n print("YES")\nelse:\n print("NG")', 'K=int(input())\nans = False\nM,N = map(int,input().rstrip().split(" ")) \n\nfor number in range(M,N+1):\n if number%K==0:\n ans = True\nif ans:\n print("YES")\nelse:\n print("NG")', 'K=int(input())\nM,N = map(int,input().rstrip().split(" ")) \n\nfor number in range(M,N+1):\n if number%K==0:\n ans=True\nif ans:\n print("YES")\nelse:\n print("NG")', 'K=int(input())\nans = False\nM,N = map(int,input().rstrip().split(" ")) \n\nfor number in range(M,N+1):\n if number%K==0:\n ans = True\nif ans:\n print("OK")\nelse:\n print("NG")'] | ['Wrong Answer', 'Wrong Answer', 'Runtime Error', 'Accepted'] | ['s497582739', 's697252625', 's912734864', 's029466433'] | [9144.0, 9028.0, 9096.0, 9136.0] | [29.0, 30.0, 29.0, 29.0] | [194, 198, 184, 197] |
p02693 | u955474478 | 2,000 | 1,048,576 | Takahashi the Jumbo will practice golf. His objective is to get a carry distance that is a multiple of K, while he can only make a carry distance of between A and B (inclusive). If he can achieve the objective, print `OK`; if he cannot, print `NG`. | ['k = input()\na, b = map(int, input().split())\nif (b % k) - (a % k) <= 0 or b - a >= 0:\n print("OK")\nelse:print("NG")\n', 'k = input()\na, b = map(int, input().split())\nka = a // k\nkb = b // k\nif b - a >= k - 1:\n print("OK")\nelif kb - ka > 0:\n print("OK")\nelse:\n print("NG")', 'k = input()\na, b = map(int, input().split())\nif b//k - a//k <= 0 or b - a >= 0:\n print("OK")\nelse:print("NG")', 'k = int(input())\na, b = map(int, input().split())\nka = a // k\nkb = b // k\nif b - a >= k - 1:\n print("OK")\nelif kb - ka > 0:\n print("OK")\nelif a % k == 0 or b % k == 0:\n print("OK")\nelse:\n print("NG")\n'] | ['Runtime Error', 'Runtime Error', 'Runtime Error', 'Accepted'] | ['s237245808', 's603110741', 's637945162', 's431626512'] | [9100.0, 9116.0, 9092.0, 9060.0] | [21.0, 24.0, 22.0, 21.0] | [117, 153, 110, 204] |
p02693 | u956547804 | 2,000 | 1,048,576 | Takahashi the Jumbo will practice golf. His objective is to get a carry distance that is a multiple of K, while he can only make a carry distance of between A and B (inclusive). If he can achieve the objective, print `OK`; if he cannot, print `NG`. | ['x=int(input())\nresult=100\ncount=0\nwhile x>result:\n count+=1\n result+=result//100\nprint(count)', "k=int(input())\na,b=map(int,input.split())\nif b-a>k:\n print('OK')\nelse:\n print('NG')", "k=int(input())\na,b=map(int,input().split())\nx=b%k\ny=b-x\nif b-a>k:\n print('OK')\nelif y>a:\n print('OK')\nelif a%k==0:\n print('OK')\nelse:\n print('NG')"] | ['Wrong Answer', 'Runtime Error', 'Accepted'] | ['s284382861', 's395548431', 's285545795'] | [9108.0, 9136.0, 9176.0] | [24.0, 23.0, 20.0] | [99, 89, 158] |
p02693 | u960046508 | 2,000 | 1,048,576 | Takahashi the Jumbo will practice golf. His objective is to get a carry distance that is a multiple of K, while he can only make a carry distance of between A and B (inclusive). If he can achieve the objective, print `OK`; if he cannot, print `NG`. | ["k = int(input())\na, b = map(int, input().split())\ncnt = 0\n\nfor i in range(a, b+1):\n if i % k == 0:\n print('OK!')\n cnt += 1\n break\n\nif cnt == 0:\n print('NG')", "k = int(input())\na, b = map(int, input().split())\ncnt = 0\n\nfor i in range(a, b+1):\n if i % k == 0:\n print('OK')\n cnt += 1\n break\n\nif cnt == 0:\n print('NG')"] | ['Wrong Answer', 'Accepted'] | ['s266867261', 's500251877'] | [9112.0, 9112.0] | [22.0, 19.0] | [183, 182] |
p02693 | u961288441 | 2,000 | 1,048,576 | Takahashi the Jumbo will practice golf. His objective is to get a carry distance that is a multiple of K, while he can only make a carry distance of between A and B (inclusive). If he can achieve the objective, print `OK`; if he cannot, print `NG`. | ['import itertools\nN, M, Q = map(int, input().split())\na = [0]*Q\nb = [0]*Q\nc = [0]*Q\nd = [0]*Q\nfor i in range(Q):\n a[i], b[i], c[i], d[i] = map(int, input().split())\nans = 0\nfor A in combinations_with_replacement(range(1, M+1), N):\n tmp = 0\n for i in range(Q):\n if A[b[i]-1] - A[a[i]-1] == c[i]:\n tmp += d[i]\n ans = max(ans, tmp)\nprint(ans)', "K = int(input())\nA, B =map(int, input().split())\nnum = 0\n\nfor i in range(A, B+1):\n if i%K ==0:\n num +=1\n\nprint('OK' if num >0 else 'NG')"] | ['Runtime Error', 'Accepted'] | ['s971494572', 's562291949'] | [9224.0, 9160.0] | [22.0, 24.0] | [369, 146] |
p02693 | u961423750 | 2,000 | 1,048,576 | Takahashi the Jumbo will practice golf. His objective is to get a carry distance that is a multiple of K, while he can only make a carry distance of between A and B (inclusive). If he can achieve the objective, print `OK`; if he cannot, print `NG`. | ['K = input()\n(A, B) = map(int, input().split())\nbuf = True\nfor i in range(A, B + 1):\n if(i % K == 0):\n print("OK")\n\treturn \nprint("NG")', 'K = input()\n(A, B) = map(int, input.split())\nbuf = True\nfor i in range(A, B + 1):\n if(i % K == 0):\n print("OK")\n\treturn \nprint("NG")', 'K = int(input())\n(A, B) = map(int, input().split())\nbuf = True\nfor i in range(A, B + 1):\n if(i % K == 0):\n print("OK")\n buf = False\n break\nif buf:\n print("NG")'] | ['Runtime Error', 'Runtime Error', 'Accepted'] | ['s703170116', 's718483900', 's325747822'] | [9028.0, 9028.0, 9124.0] | [20.0, 24.0, 20.0] | [138, 136, 170] |
p02693 | u961867996 | 2,000 | 1,048,576 | Takahashi the Jumbo will practice golf. His objective is to get a carry distance that is a multiple of K, while he can only make a carry distance of between A and B (inclusive). If he can achieve the objective, print `OK`; if he cannot, print `NG`. | ["K = int(input())\nA, B = map(int, input().split())\n\ni = B - A\n\nfor i in range(A, B + 1):\n if i % K == 0:\n c = 1\n\nif c == 1:\n orint('OK')\nelse:\n print('NG')", "K = int(input())\nA, B = map(int, input().split())\n\ni = B - A\nc = 0\n\nfor i in range(A, B + 1):\n if i % K == 0:\n c = 1\n\nif c == 1:\n print('OK')\nelse:\n print('NG')"] | ['Runtime Error', 'Accepted'] | ['s553255983', 's496298827'] | [9180.0, 9184.0] | [24.0, 21.0] | [170, 176] |
p02693 | u962175226 | 2,000 | 1,048,576 | Takahashi the Jumbo will practice golf. His objective is to get a carry distance that is a multiple of K, while he can only make a carry distance of between A and B (inclusive). If he can achieve the objective, print `OK`; if he cannot, print `NG`. | ["from inspect import k\n\nK= map(int, input().split())\na,b = map(int, input().split())\n\nfor i in range(a,b):\n if i % k ==0:\n print('OK')\n break\nelse:\n print('NG')", "k= int(input())\na,b = map(int, input().split())\n\nfor i in range(a,b+1):\n if i % k ==0:\n print('OK')\n break\nelse:\n print('NG')\n \n"] | ['Wrong Answer', 'Accepted'] | ['s973815151', 's487982408'] | [10416.0, 9156.0] | [31.0, 18.0] | [179, 154] |
p02693 | u962718741 | 2,000 | 1,048,576 | Takahashi the Jumbo will practice golf. His objective is to get a carry distance that is a multiple of K, while he can only make a carry distance of between A and B (inclusive). If he can achieve the objective, print `OK`; if he cannot, print `NG`. | ["K = int(input())\nA,B = map(int,input().split())\nif A == B:\n if K%A == 0:\n print('OK')\n else:\n print('NG')\nelse:\n if K//A == K//B:\n print('NG')\n else:\n print('OK')\n", "K = int(input())\nA,B = map(int,input().split())\n\nif K//A == K//B:\n print('NG')\nelse:\n print('OK')", "K = int(input())\nA,B = map(int,input().split())\nif A == B:\n\tif K//A == 0:\n print('OK')\n\telse:\n print('NG')\nelse:\n\tif K//A == K//B:\n\t\tprint('NG')\n\telse:\n\t\tprint('OK')\n", "K = int(input())\nA,B = map(int,input().split())\nif A == B:\n\tif K//A == 0:\n print('OK')\n else:\n\t\tif K//A == K//B:\n\t\t\tprint('NG')\n\t\telse:\n\t\t\tprint('OK')", "K = int(input())\nA,B = map(int,input().split())\n\nfor i in range(1000):\n if K*i >= A and K*i <= B:\n print('OK')\n break\nelse:\n print('NG')"] | ['Wrong Answer', 'Wrong Answer', 'Runtime Error', 'Runtime Error', 'Accepted'] | ['s185973247', 's445397324', 's491797845', 's563292934', 's324054035'] | [9104.0, 9168.0, 8996.0, 8912.0, 9148.0] | [24.0, 25.0, 24.0, 23.0, 23.0] | [179, 99, 180, 160, 144] |
p02693 | u963747475 | 2,000 | 1,048,576 | Takahashi the Jumbo will practice golf. His objective is to get a carry distance that is a multiple of K, while he can only make a carry distance of between A and B (inclusive). If he can achieve the objective, print `OK`; if he cannot, print `NG`. | ["from math import ceil\nfrom math import floor\nk=int(input())\na,b=map(int,input().split())\nl=ceil(a/k)\nprint(l)\nr=floor(b/k)\nprint(r)\nif l<=r:\n print('OK')\nelse:\n print('NG')", "a=int(input())\nb,c=map(int,input().split())\nnum=0\nres=b//a\nrem=b%a\nif rem!=0:\n num=res+rem\n if num>b and num<c:\n print('OK')\nelif((b+a)> b and (b+a)<c):\n print('OK')\nelse:\n print('NG')\n ", 'k=int(input())\na,b=map(int,input().split())\nlargest=(b//k)*k\nif a<=largest:\n print(\'OK\')\nelse:\n print("NG")'] | ['Wrong Answer', 'Wrong Answer', 'Accepted'] | ['s883713579', 's929697923', 's783740974'] | [9176.0, 9184.0, 9164.0] | [26.0, 23.0, 22.0] | [178, 196, 113] |
p02693 | u965075144 | 2,000 | 1,048,576 | Takahashi the Jumbo will practice golf. His objective is to get a carry distance that is a multiple of K, while he can only make a carry distance of between A and B (inclusive). If he can achieve the objective, print `OK`; if he cannot, print `NG`. | ['k = int(input())\na, b = [int(i) for i in input().split()]\n\nfor i in range(a, b+1):\n if i % k == 0:\n print("OK")\nelse:\n print("NG")', 'k = int(input())\na, b = [int(i) for i in input().split()]\n \nfor i in range(a, b+1):\n if i % k == 0:\n print("OK")\n break\nelse:\n print("NG")'] | ['Wrong Answer', 'Accepted'] | ['s972748698', 's469079709'] | [8992.0, 9168.0] | [20.0, 21.0] | [135, 146] |
p02693 | u966207392 | 2,000 | 1,048,576 | Takahashi the Jumbo will practice golf. His objective is to get a carry distance that is a multiple of K, while he can only make a carry distance of between A and B (inclusive). If he can achieve the objective, print `OK`; if he cannot, print `NG`. | ["K = int(input())\nA, B = map(int, input().split())\nans = 'NG'\nfor i in range(A, B+1):\n if i % K == 0:\n print('OK')\n break\n \nprint(ans)", "K = int(input())\nA, B = map(int, input().split())\n\nfor i in range(A, B+1):\n if i % K == 0:\n print('OK')\n else:\n print('NG')", "K = int(input())\nA, B = map(int, input().split())\nans = 'NG'\nfor i in range(A, B+1):\n if i % K == 0:\n print('OK')\n break\nelse:\n print(ans)"] | ['Wrong Answer', 'Wrong Answer', 'Accepted'] | ['s561279048', 's885930119', 's333956253'] | [9068.0, 9148.0, 9156.0] | [25.0, 21.0, 23.0] | [153, 143, 158] |
p02693 | u966836999 | 2,000 | 1,048,576 | Takahashi the Jumbo will practice golf. His objective is to get a carry distance that is a multiple of K, while he can only make a carry distance of between A and B (inclusive). If he can achieve the objective, print `OK`; if he cannot, print `NG`. | ["# A\nK = int(input())\nA, B = map(int,input().split())\n\nif(A%K==0 and B%K==0 and B-A=>K):\n print('OK')\nelse:\n print('NG')", "# A\nK = int(input())\nA, B = map(int,input().split())\n\nif(A%K==0 and B%K==0 and B-A>=K):\n print('OK')\nelse:\n print('NG')", "# A\nK = int(input())\nA, B = map(int,input().split())\n\nif(A%K==0 or B%K==0 or (B-A>=K and B!=A):\n print('OK')\nelse:\n print('NG')", "# A\nK = int(input())\nA, B = map(int,input().split())\n\nif(A%K==0 or B%K==0):\n print('OK')\nelif(B-A >= K - A%K):\n print('OK')\nelse:\n print('NG')"] | ['Runtime Error', 'Wrong Answer', 'Runtime Error', 'Accepted'] | ['s483804135', 's633415889', 's885640381', 's614383107'] | [8968.0, 9108.0, 8964.0, 9152.0] | [23.0, 22.0, 20.0, 24.0] | [125, 125, 133, 151] |
p02693 | u966891144 | 2,000 | 1,048,576 | Takahashi the Jumbo will practice golf. His objective is to get a carry distance that is a multiple of K, while he can only make a carry distance of between A and B (inclusive). If he can achieve the objective, print `OK`; if he cannot, print `NG`. | ["def main():\n k = int(input())\n a, b = map(int,input().split())\n if a%k==0 or b%k==0 or b-a<k:\n print('OK')\n else:\n print('NG')\n\nif __name__ == '__main__':\n main()\n", "def main():\n k = int(input())\n a, b = map(int,input().split())\n if a%k==0 or b%k==0 or b-a >= abs(k-a%k):\n print('OK')\n else:\n print('NG')\n\nif __name__ == '__main__':\n main()\n"] | ['Wrong Answer', 'Accepted'] | ['s344605917', 's685877668'] | [9160.0, 9168.0] | [23.0, 26.0] | [174, 186] |
p02693 | u967807394 | 2,000 | 1,048,576 | Takahashi the Jumbo will practice golf. His objective is to get a carry distance that is a multiple of K, while he can only make a carry distance of between A and B (inclusive). If he can achieve the objective, print `OK`; if he cannot, print `NG`. | ['import math\n\nx = int(input())\n\nprint(math.ceil(math.log(x / 100, 1.01)))', 'import math\n\nx = int(input())\n\ni = 0\nn = 100\nwhile n < x:\n n = math.floor(n * 1.01)\n i += 1\n\nprint(i)', 'k = int(input())\na, b = [int(i) for i in input().split(" ")]\n\nkk = k\nok = False\nwhile not ok:\n if kk >= a and kk <= b:\n print("OK")\n ok = True\n if kk > b:\n print("NG")\n ok = True\n kk = kk + k'] | ['Wrong Answer', 'Wrong Answer', 'Accepted'] | ['s600160454', 's664944418', 's244075968'] | [9288.0, 9160.0, 9180.0] | [22.0, 22.0, 22.0] | [72, 107, 228] |
p02693 | u969061565 | 2,000 | 1,048,576 | Takahashi the Jumbo will practice golf. His objective is to get a carry distance that is a multiple of K, while he can only make a carry distance of between A and B (inclusive). If he can achieve the objective, print `OK`; if he cannot, print `NG`. | ['money = int(input())\nkane = 100\nyears = 0\n\nwhile kane <= money:\n\n kane = kane * 1.01 \n math.floor(kane)\n years = years + 1\nprint(years)', 'hage = input()\nhoge = input()\n\nrenji = hoge[0] - hoge[1]\n\ne = hage\n\nwhile e <= hage[1];\n \tif hoge[0] <= e and hage[1] >= e;\n \t\tprint("OK")\n \tbreak\n\te = e + hage\nif e > hage[1] or e < hage[0];\n\tprint("NG")\n \n\t', '# coding: utf-8\n\nhage = int(input())\nhoge = input().split()\n \nhoge[0] = int(hoge[0])\nhoge[1] = int(hoge[1])\n\nrenji = int(hoge[0]) - int(hoge[1])\n \ne = hage\n \nwhile e <= hoge[1]:\n if hoge[0] <= e and hoge[1] >= e:\n print("OK")\n break\n e = e + hage\nif e > hoge[1] or e < hoge[0]:\n print("NG")'] | ['Runtime Error', 'Runtime Error', 'Accepted'] | ['s012764274', 's332494149', 's583706365'] | [9164.0, 9028.0, 9200.0] | [21.0, 23.0, 20.0] | [144, 216, 313] |
p02693 | u969080040 | 2,000 | 1,048,576 | Takahashi the Jumbo will practice golf. His objective is to get a carry distance that is a multiple of K, while he can only make a carry distance of between A and B (inclusive). If he can achieve the objective, print `OK`; if he cannot, print `NG`. | ['K=int(input())\nA,B=map(int,input().split())\nfor i in range(1001):\n K+=K\n if A<=K and K<=B:\n print("OK")\n break\n if 1000<K:\n print("No")\n break', 'K=int(input())\nA,B=map(int,input().split())\nfor i in range(1001):\n s=i*K\n if A<=s and s<=B:\n print("OK")\n break\n if 1000<s:\n print("NG")\n break'] | ['Wrong Answer', 'Accepted'] | ['s041822881', 's600643674'] | [9108.0, 9176.0] | [22.0, 19.0] | [157, 158] |
p02693 | u969081133 | 2,000 | 1,048,576 | Takahashi the Jumbo will practice golf. His objective is to get a carry distance that is a multiple of K, while he can only make a carry distance of between A and B (inclusive). If he can achieve the objective, print `OK`; if he cannot, print `NG`. | ["x = int(input())\na, b = map(int, input().split())\nans=0\nfor i in range(a,b+1):\n if x%i==0:\n ans=1\n break\nif ans==1:\n print('OK')\nelse:\n print('NG')", "x = int(input())\na, b = map(int, input().split())\nfor i in range(a,b+1):\n if x%i==0:\n print('OK')\n else:\n print('NG')", "K=int(input())\nA,B=map(int,input().split)\nc=B-A\nd=c-K\nif d>-2:\n print('OK')\nelse:\n print('NG')", "x = int(input())\na, b = map(int, input().split())\nans=0\nfor i in range(a,b+1):\n if x%i==0:\n ans=1\nif ans==1:\n print('OK')\nelse:\n print('NG')", "x = int(input())\na, b = map(int, input().split())\nans=0\nfor i in range(a,b+1):\n if i%x==0:\n ans=1\n break\nif ans==1:\n print('OK')\nelse:\n print('NG')"] | ['Wrong Answer', 'Wrong Answer', 'Runtime Error', 'Wrong Answer', 'Accepted'] | ['s291561677', 's819152396', 's846937063', 's876347697', 's541553299'] | [8996.0, 9164.0, 9052.0, 9152.0, 9004.0] | [30.0, 27.0, 26.0, 27.0, 31.0] | [156, 125, 96, 146, 156] |
p02693 | u969708690 | 2,000 | 1,048,576 | Takahashi the Jumbo will practice golf. His objective is to get a carry distance that is a multiple of K, while he can only make a carry distance of between A and B (inclusive). If he can achieve the objective, print `OK`; if he cannot, print `NG`. | ['M,A,B=(int(x) for x in input().split())\nif B//M-A//M>=1:\n print("OK")\nelif A%M=0:\n print("OK")\nelse:\n print("NO")', 'M,A,B=(int(x) for x in input().split())\nif B//M-A//M>=1:\n print("OK")\nelif A%M=0:\n print("OK")\nelse:\n print("NG")', 'import sys\nN=int(input())\na,b=map(int,input().split())\nfor i in range(a,b+1):\n if i%N==0:\n print("OK")\n sys.exit()\nprint("NG")'] | ['Runtime Error', 'Runtime Error', 'Accepted'] | ['s075996642', 's197627769', 's948111535'] | [8968.0, 8968.0, 9184.0] | [21.0, 21.0, 24.0] | [116, 116, 133] |
p02693 | u970809473 | 2,000 | 1,048,576 | Takahashi the Jumbo will practice golf. His objective is to get a carry distance that is a multiple of K, while he can only make a carry distance of between A and B (inclusive). If he can achieve the objective, print `OK`; if he cannot, print `NG`. | ["n=int(input())\na,b=map(int,input().split())\nans='NG'\nfor i in range(a,b+1):\n if i%k==0:\n ans='OK'\nprint(ans)", "n=int(input())\na,b=map(int,input().split())\nans='NG'\nfor i in range(a,b+1):\n if i%n==0:\n ans='OK'\nprint(ans)"] | ['Runtime Error', 'Accepted'] | ['s329851427', 's860882551'] | [9100.0, 9164.0] | [26.0, 27.0] | [112, 112] |
p02693 | u973108807 | 2,000 | 1,048,576 | Takahashi the Jumbo will practice golf. His objective is to get a carry distance that is a multiple of K, while he can only make a carry distance of between A and B (inclusive). If he can achieve the objective, print `OK`; if he cannot, print `NG`. | ["k = int(input())\nl = input().split()\nA, B = int(l[0]), int(l[1])\n\ni = 0\nwhile i * k <= B:\n print(i*k)\n if A <= i*k <= B:\n print('OK')\n break\n i += 1\nelse:\n print('NG')", "k = input()\nl = input().split()\nA, B = l[0], l[1]\n\ni = 0\nwhile i * k <= B:\n if A<= i*k <= B:\n print('OK')\n\nprint('NG')", "k = int(input())\nl = input().split()\nA, B = int(l[0]), int(l[1])\n\n\ni = 0\nnum = i*k\nwhile i * k <= B:\n print(i*k)\n if A <= i*k <= B:\n print('OK')\n break\n i += 1\nelse:\n print('NG')\n", "k = input()\nl = input().split()\nA, B = l[0], l[1]\n\ni = 0\nwhile i * k <= B:\n if A <= i*k <= B:\n print('OK')\n break\n i += 1\nelse:\n print('NG')", "k = int(input())\nl = input().split()\nA, B = int(l[0]), int(l[1])\n\ni = 0\nwhile i * k <= B:\n if A <= i*k <= B:\n print('OK')\n break\n i += 1\nelse:\n print('NG')"] | ['Wrong Answer', 'Time Limit Exceeded', 'Wrong Answer', 'Wrong Answer', 'Accepted'] | ['s049349820', 's221751029', 's535693143', 's678067113', 's126920798'] | [9184.0, 8944.0, 9168.0, 9536.0, 9052.0] | [23.0, 2205.0, 22.0, 2205.0, 22.0] | [177, 122, 189, 149, 164] |
p02693 | u975719989 | 2,000 | 1,048,576 | Takahashi the Jumbo will practice golf. His objective is to get a carry distance that is a multiple of K, while he can only make a carry distance of between A and B (inclusive). If he can achieve the objective, print `OK`; if he cannot, print `NG`. | ['k = int(input())\na, b = map(int, input().split())\n\nfor i in range(a, b + 1):\n if i % k == 0:\n print("OK")\nprint("NG")\n', 'k = int(input())\na, b = map(int, input().split())\n\nfor i in range(a, b):\n if i % k ==0:\n print("OK")\n else:\n print("NO")', 'k = int(input())\na, b = map(int, input().split())\n\nfor i range(a, b):\n if i % k ==0:\n print("OK")\n else:\n print("NO")', "k=int(input())\na,b=map(int,input().split())\nfor n in range(a, b+1):\n if n%k==0:\n print('OK')\n exit()\nprint('NG')\n"] | ['Wrong Answer', 'Wrong Answer', 'Runtime Error', 'Accepted'] | ['s891953682', 's952738007', 's994851251', 's243355750'] | [9080.0, 9016.0, 9004.0, 9056.0] | [21.0, 26.0, 20.0, 21.0] | [122, 128, 125, 130] |
p02693 | u976169012 | 2,000 | 1,048,576 | Takahashi the Jumbo will practice golf. His objective is to get a carry distance that is a multiple of K, while he can only make a carry distance of between A and B (inclusive). If he can achieve the objective, print `OK`; if he cannot, print `NG`. | ['import random\nimport math\nLI = lambda: list(map(int,input().split()))\nMI = lambda: map(int,input().split())\nyes = lambda: print("Yes")\nno = lambda: print("No")\nI = lambda: list(input())\nJ = lambda x: "".join(x)\nII = lambda: int(input())\nSI = lambda: input()\n#---khan17---template\nt = II()\na,b = MI()\nboo = False\nfor i in range(a,b+1):\n\tif a%t == 0:\n\t\tboo = True\n\t\tbreak\nprint("OK" if boo else "NG")', 'import random\nimport math\nLI = lambda: list(map(int,input().split()))\nMI = lambda: map(int,input().split())\nyes = lambda: print("Yes")\nno = lambda: print("No")\nI = lambda: list(input())\nJ = lambda x: "".join(x)\nII = lambda: int(input())\nSI = lambda: input()\n#---khan17---template\nt = II()\na,b = MI()\nboo = False\nfor i in range(a,b+1):\n\tif i%t == 0:\n\t\tboo = True\n\t\tbreak\nprint("OK" if boo else "NG")'] | ['Wrong Answer', 'Accepted'] | ['s496326700', 's356555992'] | [9568.0, 9572.0] | [23.0, 22.0] | [398, 398] |
p02693 | u977490411 | 2,000 | 1,048,576 | Takahashi the Jumbo will practice golf. His objective is to get a carry distance that is a multiple of K, while he can only make a carry distance of between A and B (inclusive). If he can achieve the objective, print `OK`; if he cannot, print `NG`. | ['a, b, n = map(int, input().split())\n\ntemp_prev = 0\ntemp_curr = 0\nx = min(n, b-1)\n\nwhile x <= n:\n temp_prev = temp_curr\n temp_curr = int(a * x / b) - a * int(x / b)\n x += 1.0\n\n if temp_curr <= temp_prev:\n break\n\nprint(max(temp_curr, temp_prev))', 'k = int(input())\na, b = map(int, input().split())\n\nflag = 0\n\ni = 1\nwhile i * k <= b:\n if i*k >= a and i*k <=b:\n flag = 1\n \n i += 1\n\nif flag:\n print("OK")\nelse:\n print("NG") '] | ['Runtime Error', 'Accepted'] | ['s377608173', 's062755621'] | [9192.0, 9184.0] | [23.0, 19.0] | [262, 195] |
p02693 | u978531093 | 2,000 | 1,048,576 | Takahashi the Jumbo will practice golf. His objective is to get a carry distance that is a multiple of K, while he can only make a carry distance of between A and B (inclusive). If he can achieve the objective, print `OK`; if he cannot, print `NG`. | ['k = int(input())\na, b = map(int, input().split())\n\nr = "NG"\nfor i in range(a, b+1):\n if i % k == 0:\n r = "ok"\n\nprint(r)\nprint(k, a,b)', 'k = int(input())\na, b = map(int, input().split())\n\nr = "NG"\nfor i in range(a, b+1):\n if i % k == 0:\n r = "ok"\n\nprint(r)', 'import math\n\nk = int(input())\na,b=map(int, input().split())\n\nlargest = math.floor((b/k)) * k\nif (a <= largest):\n print("OK")\nelse:\n print("NG")'] | ['Wrong Answer', 'Wrong Answer', 'Accepted'] | ['s666310755', 's891718786', 's408203579'] | [9168.0, 9092.0, 9164.0] | [22.0, 22.0, 21.0] | [137, 123, 145] |
p02693 | u983367697 | 2,000 | 1,048,576 | Takahashi the Jumbo will practice golf. His objective is to get a carry distance that is a multiple of K, while he can only make a carry distance of between A and B (inclusive). If he can achieve the objective, print `OK`; if he cannot, print `NG`. | ['# coding: utf-8\n# Your code here!\n\nk=int(input())\na,b=map(int,input().split())\nc=a-b\nif(c>=k-1):\n print("OK")\nelif(a%k+c>=k):\n print("OK")\nelse:\n print("NG")\n', 'k=int(input())\na,b=map(int,input().split())\nc=b-a\nif(a%k+c>=k)or(a%k==0):\n print("OK")\nelse:\n print("NG")\n'] | ['Wrong Answer', 'Accepted'] | ['s585454592', 's800027139'] | [9168.0, 8980.0] | [23.0, 22.0] | [167, 112] |
p02693 | u983853152 | 2,000 | 1,048,576 | Takahashi the Jumbo will practice golf. His objective is to get a carry distance that is a multiple of K, while he can only make a carry distance of between A and B (inclusive). If he can achieve the objective, print `OK`; if he cannot, print `NG`. | ['\ndef main():\n K = int(input())\n A, B = map(int, input().split())\n\n if B-A+1 >= K:\n print("Yes")\n else:\n print("No")\n\n\nif __name__ == \'__main__\':\n main()\n', '\ndef main():\n K = int(input())\n A, B = map(int, input().split())\n\n for num in range(0,B+1,K):\n if A<=num and num <=B:\n print("OK")\n return\n\n print("NG")\n\n\nif __name__ == \'__main__\':\n main()\n'] | ['Wrong Answer', 'Accepted'] | ['s780011672', 's720640070'] | [9160.0, 9164.0] | [23.0, 25.0] | [182, 234] |
p02693 | u984989720 | 2,000 | 1,048,576 | Takahashi the Jumbo will practice golf. His objective is to get a carry distance that is a multiple of K, while he can only make a carry distance of between A and B (inclusive). If he can achieve the objective, print `OK`; if he cannot, print `NG`. | ["k = int(input())\na,b = map(int,input().split())\n\nans = 'NG'\n\nfor i in range(a,k+1):\n if i % k == 0:\n ans = 'OK'\nprint(ans)\n", "k = int(input())\na,b = map(int,input().split())\n\nans = 'NG'\n\nfor i in range(a,b+1):\n if i % k == 0:\n ans = 'OK'\nprint(ans)\n"] | ['Wrong Answer', 'Accepted'] | ['s697330231', 's750054708'] | [9156.0, 9160.0] | [24.0, 22.0] | [133, 133] |
p02693 | u985041094 | 2,000 | 1,048,576 | Takahashi the Jumbo will practice golf. His objective is to get a carry distance that is a multiple of K, while he can only make a carry distance of between A and B (inclusive). If he can achieve the objective, print `OK`; if he cannot, print `NG`. | ['k = int(input())\na,b = list(map(int,input().slplit()))\nret = ""\nq = a//k\nif a <= q*k or (q+1)*k <= b:\n ret = "OK"\nelse:\n ret ="NG"\nprint(ret)', 'k = int(input())\na,b = list(map(int,input().split()))\nret = ""\nq = a//k\nif a <= q*k or (q+1)*k <= b:\n ret = "OK"\nelse:\n ret ="NG"\nprint(ret)'] | ['Runtime Error', 'Accepted'] | ['s930980812', 's673611030'] | [9176.0, 9116.0] | [19.0, 23.0] | [147, 146] |
p02693 | u985419292 | 2,000 | 1,048,576 | Takahashi the Jumbo will practice golf. His objective is to get a carry distance that is a multiple of K, while he can only make a carry distance of between A and B (inclusive). If he can achieve the objective, print `OK`; if he cannot, print `NG`. | ["K = int(input())\na,b = map(int,input().split())\nc = 'NG'\nfor i in range(a,b+1):\n if i % K == 0:\n c = 'OK'\n break\nprint(c)\n", "K = int(input())\nA,B = map(int,input().split())\nfor i in range(a,b+1)\nif i%K == 0\n print('OK')\nelse:\n print('No')", "K = int(input())\na,b = map(int,input().split())\nc = 'NO'\nfor i in range(a,b+1):\n if i % K == 0:\n c = 'OK'\n break\nprint(c)", "K = int(input())\na,b = map(int,input().split())\nfor i in range(a,b+1):\n if i%K == 0:\n print('OK')\n else:\n print('No')", "K = int(input())\na,b = map(int,input().split())\nfor i in range(a,b+1)\nif i%K == 0\n print('OK')\nelse:\n print('No')\n", "K = int(input())\na,b = map(int,input().split())\nfor i in range(a,b+1):\n if i%K == 0:\n print('OK')\nelse:\n print('No')\n", "K = int(input())\na,b = map(int,input().split())\nc = 'NG'\nfor i in range(a,b+1):\n if i % K == 0:\n c = 'OK'\n break\nprint(c)\n", "K = int(input())\na,b = map(int,input().split())\nfor i in range(a,b+1):\n if i%K == 0:\n print('OK')\n else:\n print('No')\n return", "K = int(input())\na,b = map(int,input().split())\nc = 'NG'\nfor i in range(a,b+1):\n if i % K == 0:\n c = 'OK'\n break\nprint(c)\n"] | ['Wrong Answer', 'Runtime Error', 'Wrong Answer', 'Runtime Error', 'Runtime Error', 'Runtime Error', 'Wrong Answer', 'Runtime Error', 'Accepted'] | ['s017366739', 's241944475', 's276873367', 's414463865', 's426818977', 's491350378', 's530377899', 's888834299', 's954653503'] | [9160.0, 9016.0, 9160.0, 8984.0, 9020.0, 9028.0, 9156.0, 9024.0, 9156.0] | [24.0, 23.0, 23.0, 24.0, 25.0, 24.0, 20.0, 27.0, 21.0] | [127, 115, 126, 121, 116, 120, 127, 130, 129] |
p02693 | u985949234 | 2,000 | 1,048,576 | Takahashi the Jumbo will practice golf. His objective is to get a carry distance that is a multiple of K, while he can only make a carry distance of between A and B (inclusive). If he can achieve the objective, print `OK`; if he cannot, print `NG`. | ["K = int(input())\nA, B = map(int, input().split())\n\na = int(A/K)\nif A <= a*K <= B:\n print('OK')\nelse:\n print('NG')\n", "K = int(input())\nA, B = map(int, input().split())\n\na = int(A/K)\nif A <= (a+1)*K <= B or A <= a*K <=B:\n print('OK')\nelse:\n print('NG')\n\n"] | ['Wrong Answer', 'Accepted'] | ['s617074213', 's127834712'] | [9148.0, 9088.0] | [22.0, 21.0] | [120, 141] |
p02693 | u986237475 | 2,000 | 1,048,576 | Takahashi the Jumbo will practice golf. His objective is to get a carry distance that is a multiple of K, while he can only make a carry distance of between A and B (inclusive). If he can achieve the objective, print `OK`; if he cannot, print `NG`. | ["k = int(input())\na, b = [int(x) for x in input().split()]\n\nc = a // k\nc += 0 if c*k == a else 1\nd = c * k\n\nprint(d)\nif a <= d <= b:\n\tprint('OK')\nelse:\n\tprint('NG')", "k = int(input())\na, b = [int(x) for x in input().split()]\n\nc = a // k\nc += 0 if c*k == a else 1\nd = c * k\n\nif a <= d <= b:\n\tprint('OK')\nelse:\n\tprint('NG')\n"] | ['Wrong Answer', 'Accepted'] | ['s427106274', 's250544153'] | [9176.0, 9104.0] | [23.0, 23.0] | [163, 155] |
p02693 | u988661952 | 2,000 | 1,048,576 | Takahashi the Jumbo will practice golf. His objective is to get a carry distance that is a multiple of K, while he can only make a carry distance of between A and B (inclusive). If he can achieve the objective, print `OK`; if he cannot, print `NG`. | ["K=int(input())\nA,B=map(int,input().split())\n\nfor i in range(A,B+1):\n if i%K==0:\n print('OK')\n else:\n print('NG') ", "K=int(input())\nA,B=map(int,input().split())\nn=0\nfor i in range(A,B+1):\n if i%K==0:\n n+=1\n\nif n==0:\n print('NG')\nelse:\n print('OK') \n"] | ['Wrong Answer', 'Accepted'] | ['s463350234', 's781040369'] | [9176.0, 9164.0] | [22.0, 26.0] | [134, 166] |
p02693 | u995914787 | 2,000 | 1,048,576 | Takahashi the Jumbo will practice golf. His objective is to get a carry distance that is a multiple of K, while he can only make a carry distance of between A and B (inclusive). If he can achieve the objective, print `OK`; if he cannot, print `NG`. | ['k=int(input())\ns=input().split()\na=int(s[0])\nb=int(s[1])\nfor i in range(a,b+1):\n if i%k==0:\n print("OK")\n break\nprint("NG")', 'k=int(input())\ns=input().split()\na=int(s[0])\nb=int(s[1])\nfor i in range(a,b+1):\n if i%k==0:\n print("OK")\nprint("NG")', 'k=int(input())\ns=input().split()\na=int(s[0])\nb=int(s[1])\nfor i in range(a,b+1):\n if i%k==0:\n print("OK")\n exit()\nprint("NG")'] | ['Wrong Answer', 'Wrong Answer', 'Accepted'] | ['s649230523', 's704529522', 's887870625'] | [9180.0, 9076.0, 9136.0] | [21.0, 20.0, 21.0] | [130, 120, 131] |
p02693 | u998262711 | 2,000 | 1,048,576 | Takahashi the Jumbo will practice golf. His objective is to get a carry distance that is a multiple of K, while he can only make a carry distance of between A and B (inclusive). If he can achieve the objective, print `OK`; if he cannot, print `NG`. | ['a,b,n=map(int,input().split())\na1=int(a*n/b)-a*int(n/b)\nprint(a1)', 'K=int(input())\nA,B=map(int,input().split())\nfor n in range(A,B+1):\n if n%K==0:\n print("OK")\n exit()\nprint("NG")\n'] | ['Runtime Error', 'Accepted'] | ['s079844582', 's846960738'] | [9164.0, 9156.0] | [21.0, 21.0] | [65, 129] |
p02695 | u003644389 | 2,000 | 1,048,576 | Given are positive integers N, M, Q, and Q quadruples of integers ( a_i , b_i , c_i , d_i ). Consider a sequence A satisfying the following conditions: * A is a sequence of N positive integers. * 1 \leq A_1 \leq A_2 \le \cdots \leq A_N \leq M. Let us define a score of this sequence as follows: * The score is the sum of d_i over all indices i such that A_{b_i} - A_{a_i} = c_i. (If there is no such i, the score is 0.) Find the maximum possible score of A. | ['import math\n\na, b, n = map(int, input().split())\nx = min(n, b-1)\nprint(math.floor(a*x/b)-a*math.floor(x/b))', 'import math\n\na, b, n = map(int, input().split())\n\nif n>=b:\n\tn1 = n//b*b-1\n\tans = max((a*n//b)-a*(n//b), (a*n1//b)-a*(n1//b))\nelse:\n\tans = (a*n//b)-a*(n//b)\nprint(ans)', "import itertools\n\nn, m, q = map(int, input().split())\n\na = [0]*q\nb = [0]*q\nc = [0]*q\nd = [0]*q\n\nfor i in range(q):\n\ta[i], b[i], c[i], d[i] = map(int, input().split())\n\nans = 0\n\nfor comb in itertools.combinations_with_replacement(range(1, m+1), n):\n\tj = 0\n\tfor i in range(q):\n\t\tif comb[b[i]-1]-comb[a[i]-1] == c[i]:\n\t\t\tj += d[i]\n\t#print('{} {}'.format(comb, j))\n\tans = max(ans, j)\n\nprint(ans)"] | ['Wrong Answer', 'Wrong Answer', 'Accepted'] | ['s635624394', 's905209213', 's622709108'] | [9084.0, 9192.0, 9056.0] | [20.0, 23.0, 1272.0] | [107, 166, 391] |
p02695 | u017624958 | 2,000 | 1,048,576 | Given are positive integers N, M, Q, and Q quadruples of integers ( a_i , b_i , c_i , d_i ). Consider a sequence A satisfying the following conditions: * A is a sequence of N positive integers. * 1 \leq A_1 \leq A_2 \le \cdots \leq A_N \leq M. Let us define a score of this sequence as follows: * The score is the sum of d_i over all indices i such that A_{b_i} - A_{a_i} = c_i. (If there is no such i, the score is 0.) Find the maximum possible score of A. | ['N, M, Q = list(map(int, input().split()))\nabcd = [list(map(int, input().split())) for i in range(Q)]\nprint(N, M, Q)\n# print(abcd)\n\ndef calculate(A):\n total = 0\n for abcdi in abcd:\n a = abcdi[0] - 1\n b = abcdi[1] - 1\n c = abcdi[2]\n d = abcdi[3]\n if A[b] - A[a] == c:\n total += d\n \n\n return total\n\nmaximum = 0\nfor i in range(1, M + 1):\n if N == 1:\n maximum = max(calculate([i]), maximum)\n for j in range(i, M + 1):\n if N == 2:\n maximum = max(calculate([i, j]), maximum)\n for k in range(j, M + 1):\n if N == 3:\n maximum = max(calculate([i, j, k]), maximum)\n for l in range(k, M + 1):\n if N == 4:\n maximum = max(calculate([i, j, k, l]), maximum)\n for m in range(l, M + 1):\n if N == 5:\n maximum = max(calculate([i, j, k, l, m]), maximum)\n for n in range(m, M + 1):\n if N == 6:\n maximum = max(calculate([i, j, k, l, m, n]), maximum)\n for o in range(n, M + 1):\n if N == 7:\n maximum = max(calculate([i, j, k, l, m, n, o]), maximum)\n for p in range(o, M + 1):\n if N == 8:\n maximum = max(calculate([i, j, k, l, m, n, o, p]), maximum)\n for q in range(p, M + 1):\n if N == 9:\n maximum = max(calculate([i, j, k, l, m, n, o, p, q]), maximum)\n for r in range(q, M + 1):\n if N == 10:\n maximum = max(calculate([i, j, k, l, m, n, o, p, q, r]), maximum)\n\nprint(maximum)\n', 'N, M, Q = list(map(int, input().split()))\nabcd = [list(map(int, input().split())) for i in range(Q)]\n# print(N, M, Q)\n# print(abcd)\n\nfor i in range(1, M + 1):\n if M == 1: break\n for j in range(i, M + 1):\n if M == 2: break\n for k in range(j, M + 1):\n if M == 3: break\n for l in range(k, M + 1):\n if M == 4: break\n for m in range(l, M + 1):\n if M == 5: break\n for n in range(m, M + 1):\n if M == 6: break\n for o in range(n, M + 1):\n if M == 7: break\n for p in range(o, M + 1):\n if M == 8: break\n for q in range(p, M + 1):\n if M == 9: break\n for r in range(q, M + 1):\n if M == 10: break\n\nprint(1)\n', 'import itertools\n\nN, M, Q = list(map(int, input().split()))\nabcd = [list(map(int, input().split())) for i in range(Q)]\n# print(N, M, Q)\n# print(abcd)\n\ndef calculate(A, abcd):\n total = 0\n for abcdi in abcd:\n a = abcdi[0] - 1\n b = abcdi[1] - 1\n c = abcdi[2]\n d = abcdi[3]\n if A[b] - A[a] == c:\n total += d\n \n\n return total\n\nA = list(itertools.combinations_with_replacement(range(1, M + 1), N))\n# print(A)\n\nmaximum = max([calculate(Ai, abcd) for Ai in A])\n\nprint(maximum)\n'] | ['Wrong Answer', 'Wrong Answer', 'Accepted'] | ['s123156311', 's126189840', 's604056485'] | [9352.0, 9076.0, 25260.0] | [807.0, 45.0, 830.0] | [1955, 974, 544] |
p02695 | u022871813 | 2,000 | 1,048,576 | Given are positive integers N, M, Q, and Q quadruples of integers ( a_i , b_i , c_i , d_i ). Consider a sequence A satisfying the following conditions: * A is a sequence of N positive integers. * 1 \leq A_1 \leq A_2 \le \cdots \leq A_N \leq M. Let us define a score of this sequence as follows: * The score is the sum of d_i over all indices i such that A_{b_i} - A_{a_i} = c_i. (If there is no such i, the score is 0.) Find the maximum possible score of A. | ['from itertools import combinations_with_replacement\nn, m, q = map(int, input().split())\nA = combinations_with_replacement(range(1, m), n)\nL = []\n\nfor _ in range(q):\n L.append(list(map(int, input().split())))\n\nr = 0\nfor a in A:\n t = 0\n for l in L:\n if a[l[1] - 1] - a[l[0] - 1] == l[2]:\n t += l[3]\n if t > r:\n r = t\nprint(r)\n', 'from itertools import combinations_with_replacement\nn, m, q = map(int, input().split())\nA = combinations_with_replacement(range(m), n)\nL = []\n\nfor _ in range(q):\n L.append(list(map(int, input().split())))\n\nr = 0\nfor a in A:\n t = 0\n for l in L:\n if a[l[1] - 1] - a[l[0] - 1] == l[2]:\n t += l[3]\n if t > r:\n r = t\nprint(r)\n'] | ['Wrong Answer', 'Accepted'] | ['s771432289', 's174521933'] | [9096.0, 9060.0] | [458.0, 1080.0] | [361, 358] |
p02695 | u028014940 | 2,000 | 1,048,576 | Given are positive integers N, M, Q, and Q quadruples of integers ( a_i , b_i , c_i , d_i ). Consider a sequence A satisfying the following conditions: * A is a sequence of N positive integers. * 1 \leq A_1 \leq A_2 \le \cdots \leq A_N \leq M. Let us define a score of this sequence as follows: * The score is the sum of d_i over all indices i such that A_{b_i} - A_{a_i} = c_i. (If there is no such i, the score is 0.) Find the maximum possible score of A. | ['import sys\nimport itertools\nimport numpy as np\n\nread = sys.stdin.buffer.read\nreadline = sys.stdin.buffer.readline\nreadlines = sys.stdin.buffer.readlines\n\nN, M, Q = map(int, readline().split())\n\n\n\nA = np.array(list(itertools.combinations_with_replacement(range(1, M + 1), N)))\n\nn = len(A) \nscore = np.zeros(n) \n\nm = map(int, read().split())\nfor a, b, c, d in zip(m, m, m, m):\n cond = A[:, b - 1] - A[:, a - 1] == c\n score += d * cond\n\nprint(score.max())', '\nimport sys\nimport itertools\nimport numpy as np\n\nread = sys.stdin.buffer.read\nreadline = sys.stdin.buffer.readline\nreadlines = sys.stdin.buffer.readlines\n\nN, M, Q = map(int, readline().split())\n\n\n\nA = np.array(list(itertools.combinations_with_replacement(range(1, M + 1), N)))\n\nn = len(A) \nscore = np.zeros(n) [0,0,...,0] \n\nm = map(int, read().split())\nfor a, b, c, d in zip(m, m, m, m):\n cond = A[:, b - 1] - A[:, a - 1] == c\n score += d * cond\n\nprint(score.max())', 'import sys\nimport itertools\nimport numpy as np\n\nread = sys.stdin.buffer.read\nreadline = sys.stdin.buffer.readline\nreadlines = sys.stdin.buffer.readlines\n\nN, M, Q = map(int, readline().split())\n\n\n\nA = np.array(list(itertools.combinations_with_replacement(range(1, M + 1), N)))\n\nn = len(A) \nscore = np.zeros(n, np.int32) \n\nm = map(int, read().split())\nfor a, b, c, d in zip(m, m, m, m):\n cond = A[:, b - 1] - A[:, a - 1] == c\n score += d * cond\n\nprint(score.max())'] | ['Wrong Answer', 'Runtime Error', 'Accepted'] | ['s176210352', 's387972225', 's704322255'] | [46752.0, 46644.0, 46648.0] | [234.0, 201.0, 228.0] | [677, 677, 687] |
p02695 | u038408819 | 2,000 | 1,048,576 | Given are positive integers N, M, Q, and Q quadruples of integers ( a_i , b_i , c_i , d_i ). Consider a sequence A satisfying the following conditions: * A is a sequence of N positive integers. * 1 \leq A_1 \leq A_2 \le \cdots \leq A_N \leq M. Let us define a score of this sequence as follows: * The score is the sum of d_i over all indices i such that A_{b_i} - A_{a_i} = c_i. (If there is no such i, the score is 0.) Find the maximum possible score of A. | ['import itertools\nn, m, q = map(int, input().split())\nabcd = [tuple(map(int, input().split())) for _ in range(q)]\nMax = 0\nfor A in itertools.combinations_with_replacement(range(1, m + 1) n):\n #score = sum([d for a, b, c, d in abcd if C[b - 1] - C[a - 1] == c])\n score = 0\n for ai, bi, ci, di in abcd:\n if A[bi - 1] - A[ai - 1] == ci:\n score += di\n Max = max(Max, score)\n #print(C)\nprint(Max)', 'import itertools\nn, m, q = map(int, input().split())\nabcd = [tuple(map(int, input().split())) for _ in range(q)]\nMax = 0\nfor A in itertools.combinations_with_replacement(range(1, m + 1), n):\n #score = sum([d for a, b, c, d in abcd if C[b - 1] - C[a - 1] == c])\n score = 0\n for ai, bi, ci, di in abcd:\n if A[bi - 1] - A[ai - 1] == ci:\n score += di\n Max = max(Max, score)\n #print(C)\nprint(Max)\n'] | ['Runtime Error', 'Accepted'] | ['s303262071', 's218738253'] | [9028.0, 9192.0] | [23.0, 1081.0] | [423, 425] |
p02695 | u042113240 | 2,000 | 1,048,576 | Given are positive integers N, M, Q, and Q quadruples of integers ( a_i , b_i , c_i , d_i ). Consider a sequence A satisfying the following conditions: * A is a sequence of N positive integers. * 1 \leq A_1 \leq A_2 \le \cdots \leq A_N \leq M. Let us define a score of this sequence as follows: * The score is the sum of d_i over all indices i such that A_{b_i} - A_{a_i} = c_i. (If there is no such i, the score is 0.) Find the maximum possible score of A. | ['import itertools\nN, M, Q = input().split()\nN = int(N)\nM = int(M)\nQ = int(Q)\nnum = [0]*Q\nfor i in range(Q):\n num[i] = [list(map(int,input().split()))]\nnum = list(range(1, M+1))\nA = []\nfor v in itertools.combinations(num, N):\n A.append(list(v))\nscore = 0\nfor w in A:\n scoreX = 0\n for j in range(Q):\n b = num[j][1]\n a = num[j][0]\n if num[j][2] == w[b-1]-w[a-1]:\n scoreX += num[j][3]\n if scoreX > score:\n score = scoreX\nprint(str(score))', 'import itertools\nN, M, Q = input().split()\nN = int(N)\nM = int(M)\nQ = int(Q)\nNum = [0 for i in range(Q)]\nfor i in range(Q):\n Num[i] = list(map(int,input().split()))\nnum = list(range(1, M+1))\nA = []\nfor v in itertools.combinations_with_replacement(num, N):\n A.append(list(v))\nscore = 0\nfor w in A:\n scoreX = 0\n for j in range(Q):\n b = Num[j][1]\n a = Num[j][0]\n if Num[j][2] == w[b-1]-w[a-1]:\n scoreX += Num[j][3]\n if scoreX > score:\n score = scoreX\nprint(str(score))'] | ['Runtime Error', 'Accepted'] | ['s758209897', 's294420233'] | [9240.0, 22976.0] | [22.0, 1580.0] | [455, 486] |
p02695 | u046158516 | 2,000 | 1,048,576 | Given are positive integers N, M, Q, and Q quadruples of integers ( a_i , b_i , c_i , d_i ). Consider a sequence A satisfying the following conditions: * A is a sequence of N positive integers. * 1 \leq A_1 \leq A_2 \le \cdots \leq A_N \leq M. Let us define a score of this sequence as follows: * The score is the sum of d_i over all indices i such that A_{b_i} - A_{a_i} = c_i. (If there is no such i, the score is 0.) Find the maximum possible score of A. | ['n,m,q=map(int,input().split())\na=[]\nb=[]\nc=[]\nd=[]\nfor i in range(q):\n A,B,C,D=map(int,input().split())\n a.append(A)\n b.append(B)\n c.append(C)\n d.append(D)\nans=0\nM=[0,0,0,0,0,0,0,0,0,0,0]\nfor i in range(n):\n M[i]=1\ncursor=n\nbreakflag=0\nwhile True:\n ev=0\n for i in range(q):\n if M[b[i]-1]-M[a[i]-1]==c[i]:\n ev+=d[i]\n if ev>ans:\n ans=ev\n while True:\n if M[cursor-1]<m:\n M[cursor-1]+=1\n for i in range(cursor,n):\n M[i]=M[cursor-1]\n break\n cursor-=1\n if cursor==0:\n breakflag=1\n break\n if breakflag==1:\n break\nprint(ans)\n ', 'n,m,q=map(int,input().split())\na=[]\nb=[]\nc=[]\nd=[]\nfor i in range(q):\n A,B,C,D=map(int,input().split())\n a.append(A)\n b.append(B)\n c.append(C)\n d.append(D)\nans=0\nM=[0,0,0,0,0,0,0,0,0,0,0]\nfor i in range(n):\n M[i]=1\ncursor=n\nbreakflag=0\nwhile True:\n ev=0\n for i in range(q):\n if M[b[i]-1]-M[a[i]-1]==c[i]:\n ev+=d[i]\n if ev>ans:\n ans=ev\n while True:\n if M[cursor-1]<m:\n M[cursor-1]+=1\n for i in range(cursor,n):\n M[i]=M[cursor-1]\n cursor=n\n break\n cursor-=1\n if cursor==0:\n breakflag=1\n break\n if breakflag==1:\n break\nprint(ans)\n \n '] | ['Wrong Answer', 'Accepted'] | ['s154789589', 's467075270'] | [9264.0, 9268.0] | [22.0, 1143.0] | [587, 607] |
p02695 | u057415180 | 2,000 | 1,048,576 | Given are positive integers N, M, Q, and Q quadruples of integers ( a_i , b_i , c_i , d_i ). Consider a sequence A satisfying the following conditions: * A is a sequence of N positive integers. * 1 \leq A_1 \leq A_2 \le \cdots \leq A_N \leq M. Let us define a score of this sequence as follows: * The score is the sum of d_i over all indices i such that A_{b_i} - A_{a_i} = c_i. (If there is no such i, the score is 0.) Find the maximum possible score of A. | ['n, m, q = map(int, input().split())\ncnt = 0\nfor _ in range(q):\n a, b, c, d = list(map(int, input().split()))\nfor i in range(m-n+1):\n if b[i] - a[i] + (m-n) == c[i]:\n cnt += d[i]\nprint(cnt)', 'n, m, q = map(int, input().split())\na = [0]*q\nb = [0]*q\nc = [0]*q\nd = [0]*q\nfor i in range(q):\n a[i],b[i],c[i],d[i] = map(int,input().split())\n a[i] -= 1\n b[i] -= 1\n\ndef score(A):\n tmp = 0\n for ai, bi, ci, di in zip(a, b, c, d): \n if A[bi] - A[ai] == ci: \n tmp += di \n return tmp \n \n # if A[b[i]]-A[a[i]] == c[i]:\n # tmp += d[i]\n # return tmp\n\ndef dfs(A):\n if len(A) == n:\n return score(A) \n res = 0\n if len(A) > 0: # prev_last = A[-1] if len(A) > 0 else 0\n prev_last = A[-1] \n else:\n prev_last = 0\n for i in range(prev_last, m):\n A.append(i)\n res = max(res, dfs(A)) \n A.pop()\n return res\n\nprint(dfs([]))'] | ['Runtime Error', 'Accepted'] | ['s057774849', 's902564192'] | [9184.0, 9212.0] | [21.0, 577.0] | [201, 886] |
p02695 | u059210959 | 2,000 | 1,048,576 | Given are positive integers N, M, Q, and Q quadruples of integers ( a_i , b_i , c_i , d_i ). Consider a sequence A satisfying the following conditions: * A is a sequence of N positive integers. * 1 \leq A_1 \leq A_2 \le \cdots \leq A_N \leq M. Let us define a score of this sequence as follows: * The score is the sum of d_i over all indices i such that A_{b_i} - A_{a_i} = c_i. (If there is no such i, the score is 0.) Find the maximum possible score of A. | ["# encoding:utf-8\nimport copy\nimport random\nimport bisect \nimport fractions \nimport math\nimport sys\nimport collections\n\nmod = 10**9+7\nsys.setrecursionlimit(mod) \n\nd = collections.deque()\ndef LI(): return list(map(int, sys.stdin.readline().split()))\nN, M, Q = LI()\n\nabcd = []\nfor i in range(Q):\n a, b, c, d = LI()\n a -= 1\n b -= 1\n abcd.append([a, b, c, d])\nans = 0\nif Q <= 2:\n for q in range(Q):\n ans += abcd[q][-1]\n print(ans)\n sys.exit()\n\ndef cal_ans(A):\n ans = 0\n for i in range(Q):\n a, b, c, d = abcd[i]\n if A[b] - A[a] == c:\n ans += d\n return ans\n\ndef n2kdigit(n, k):\n bi=''\n before = 1\n while n!=0:\n if before <= (n % k):\n # print(n)\n bi+=str(n%abs(k))\n before = n % k\n if k<0:n=-(-n//k)\n else:n=n//k\n else:\n return None\n if len(bi[::-1]) < N:\n return None\n return bi\nans = 0\nfor i in range(M ** (N)):\n A = n2kdigit(i, M)\n if A is not None:\n ans = max(ans, cal_ans([int(i) for i in A]))\nans = max(ans, cal_ans([0 for i in range(N)]))\nprint(ans)", "# encoding:utf-8\nimport copy\nimport random\nimport bisect \nimport fractions \nimport math\nimport sys\nimport itertools\nimport collections\n\nmod = 10**9+7\nsys.setrecursionlimit(mod) \n\nd = collections.deque()\ndef LI(): return list(map(int, sys.stdin.readline().split()))\nN, M, Q = LI()\n\nabcd = []\n\nall = 0\nfor i in range(Q):\n a, b, c, d = LI()\n a -= 1\n b -= 1\n abcd.append([a, b, c, d])\n all += d\n\nabcd = sorted(abcd, key= lambda x:x[3], reverse= True)\nans = 0\nif Q <= 2:\n for q in range(Q):\n ans += abcd[q][-1]\n print(ans)\n sys.exit()\n\ndef cal_ans(A):\n ans = 0\n for i in range(Q):\n a, b, c, d = abcd[i]\n if A[b] - A[a] == c:\n ans += d\n return ans\n\ndef n2kdigit(n, k):\n bi=''\n before = 1\n while n!=0:\n if before <= (n % k):\n # print(n)\n bi+=str(n%abs(k))\n before = n % k\n if k<0:n=-(-n//k)\n else:n=n//k\n else:\n return None\n if len(bi) < N:\n return None\n return bi\nans = 0\n\nfor i in itertools.combinations_with_replacement(range(1, M+1), N):\n # print(i)\n ans = max(ans, cal_ans(i))\nprint(ans)"] | ['Wrong Answer', 'Accepted'] | ['s773995062', 's661782717'] | [10804.0, 10836.0] | [2206.0, 582.0] | [1259, 1292] |
p02695 | u059238013 | 2,000 | 1,048,576 | Given are positive integers N, M, Q, and Q quadruples of integers ( a_i , b_i , c_i , d_i ). Consider a sequence A satisfying the following conditions: * A is a sequence of N positive integers. * 1 \leq A_1 \leq A_2 \le \cdots \leq A_N \leq M. Let us define a score of this sequence as follows: * The score is the sum of d_i over all indices i such that A_{b_i} - A_{a_i} = c_i. (If there is no such i, the score is 0.) Find the maximum possible score of A. | ['#c\nimport itertools\n\nn, m, q = map(int, input().split())\nlslist = []\n\nfor i in range(q):\n a, b, c, d = map(int, input().split())\n lslist.append([a, b, c, d])\nprint(lslist)\n\n# n=3\n# m=4\n\n# ls1 = [1, 3, 3, 100]\n# ls2 = [1, 2, 2, 10]\n# ls3 = [1, 1, 0, 1000]\n# lslist = [ls1, ls2, ls3]\n\nacomn = list(itertools.combinations_with_replacement(list(range(m)), n))\n\ndef tensu(ls, a):\n if a[ls[1]-1] - a[ls[0]-1] == ls[2]:\n return ls[3]\n else:\n return 0\n\ndef tensu2(lslist, a):\n return sum(list(map(lambda x: tensu(x, a), lslist)))\n\nprint(max(list(map(lambda a: tensu2(lslist, a), acomn))))', '#c\nimport itertools\n\nn, m, q = map(int, input().split())\nlslist = []\n\nfor i in range(q):\n a, b, c, d = map(int, input().split())\n lslist.append([a, b, c, d])\n\n# n=3\n# m=4\n\n# ls1 = [1, 3, 3, 100]\n# ls2 = [1, 2, 2, 10]\n# ls3 = [1, 1, 0, 1000]\n# lslist = [ls1, ls2, ls3]\n\nacomn = list(itertools.combinations_with_replacement(list(range(m)), n))\n\ndef tensu(ls, a):\n if a[ls[1]-1] - a[ls[0]-1] == ls[2]:\n return ls[3]\n else:\n return 0\n\ndef tensu2(lslist, a):\n return sum(list(map(lambda x: tensu(x, a), lslist)))\n\nprint(max(list(map(lambda a: tensu2(lslist, a), acomn))))'] | ['Wrong Answer', 'Accepted'] | ['s303190147', 's816155641'] | [25116.0, 25256.0] | [1176.0, 1190.0] | [614, 600] |
p02695 | u060938295 | 2,000 | 1,048,576 | Given are positive integers N, M, Q, and Q quadruples of integers ( a_i , b_i , c_i , d_i ). Consider a sequence A satisfying the following conditions: * A is a sequence of N positive integers. * 1 \leq A_1 \leq A_2 \le \cdots \leq A_N \leq M. Let us define a score of this sequence as follows: * The score is the sum of d_i over all indices i such that A_{b_i} - A_{a_i} = c_i. (If there is no such i, the score is 0.) Find the maximum possible score of A. | ['# -*- coding: utf-8 -*-\n"""\nCreated on Sat May 2 20:59:14 2020\n"""\n\nimport sys\n#import numpy as np\nimport itertools\nsys.setrecursionlimit(10 ** 9)\n\nN, M, Q = map(int,input().split())\nabcd = [list(map(int,input().split())) for _ in range(Q)]\n\nA = itertools.combinations_with_replacement([i for i in range(1,M)],N)\n\nans = 0\nfor l in A:\n tmp = 0\n for a,b,c,d in abcd:\n if l[b-1] - l[a-1] == c:\n tmp += d\n ans = max(ans, tmp)\nprint(ans)\n\n', '# -*- coding: utf-8 -*-\n"""\nCreated on Sat May 2 20:59:14 2020\n"""\n\nimport sys\n#import numpy as np\nimport itertools\nsys.setrecursionlimit(10 ** 9)\n\nN, M, Q = map(int,input().split())\nabcd = [list(map(int,input().split())) for _ in range(Q)]\n\nA = itertools.combinations_with_replacement([i for i in range(1,M+1)],N)\n\nans = 0\nfor l in A:\n tmp = 0\n for a,b,c,d in abcd:\n if l[b-1] - l[a-1] == c:\n tmp += d\n ans = max(ans, tmp)\nprint(ans)\n\n'] | ['Wrong Answer', 'Accepted'] | ['s175594950', 's900793275'] | [9112.0, 9116.0] | [488.0, 984.0] | [462, 464] |
p02695 | u065040863 | 2,000 | 1,048,576 | Given are positive integers N, M, Q, and Q quadruples of integers ( a_i , b_i , c_i , d_i ). Consider a sequence A satisfying the following conditions: * A is a sequence of N positive integers. * 1 \leq A_1 \leq A_2 \le \cdots \leq A_N \leq M. Let us define a score of this sequence as follows: * The score is the sum of d_i over all indices i such that A_{b_i} - A_{a_i} = c_i. (If there is no such i, the score is 0.) Find the maximum possible score of A. | ['import itertools\n\nN,M,Q = map(int,input().split())\nnum = [[0 for i in range(4)] for j in range(Q)]\ntest = list()\n\nk = 1\nfor i in range(M):\n test.append(k)\n k += 1\n\nk = 0\nfor i in range(Q):\n num[k][0], num[k][1], num[k][2], num[k][3] = map(int,input().split())\n k += 1\n\nk = 0\nscore = 0\nmaxscore = 0\nfor list in itertools.combinations(test, N):\n for i in range(Q):\n if list[num[k][1]-1] - list[num[k][0]-1] == num[k][2]:\n score += num[k][3]\n k += 1\n if score > maxscore:\n maxscore = score\n print(list)\n print(score)\n score = 0\n k = 0\n\nprint(maxscore)\n', 'import itertools\n\nN,M,Q = map(int,input().split())\nnum = [[0 for i in range(4)] for j in range(Q)]\ntest = list()\n\nk = 1\nfor i in range(M):\n test.append(k)\n k += 1\n\nk = 0\nfor i in range(Q):\n num[k][0], num[k][1], num[k][2], num[k][3] = map(int,input().split())\n k += 1\n\nk = 0\nscore = 0\nmaxscore = 0\nfor list in itertools.combinations_with_replacement(test, N):\n for i in range(Q):\n if list[num[k][1]-1] - list[num[k][0]-1] == num[k][2]:\n score += num[k][3]\n k += 1\n if score > maxscore:\n maxscore = score\n score = 0\n k = 0\n\nprint(maxscore)\n'] | ['Wrong Answer', 'Accepted'] | ['s019787717', 's441500817'] | [9252.0, 9180.0] | [23.0, 1710.0] | [623, 603] |
p02695 | u075304271 | 2,000 | 1,048,576 | Given are positive integers N, M, Q, and Q quadruples of integers ( a_i , b_i , c_i , d_i ). Consider a sequence A satisfying the following conditions: * A is a sequence of N positive integers. * 1 \leq A_1 \leq A_2 \le \cdots \leq A_N \leq M. Let us define a score of this sequence as follows: * The score is the sum of d_i over all indices i such that A_{b_i} - A_{a_i} = c_i. (If there is no such i, the score is 0.) Find the maximum possible score of A. | ['import numpy as np\nimport math\nimport scipy\nimport itertools\n\ndef score(arr):\n hoge = 0\n for ai,bi,ci,di in zip(a, b, c, d):\n if arr[bi-1]-arr[ai-1] == ci:\n hoge += di\n return hoge\n\ndef dfs(arr):\n if len(arr) == n:\n return score(arr)\n last = arr[-1] if len(arr) > 0 else 0\n res = 0\n for i in range(last, m+1):\n a.append(i)\n res = max(res, dfs(arr))\n a.pop()\n return res\n\ndef solve():\n global a, b, c, d, n, m, q\n n, m, q = map(int, input().split())\n a, b, c, d = [0]*q, [0]*q, [0]*q, [0]*q\n for i in range(q):\n a[i], b[i], c[i], d[i] = map(int, input().split())\n print(dfs([]))\n return 0\n\nif __name__ == "__main__":\n solve()\n', 'import numpy as np\nimport math\nimport scipy\nimport itertools\n\ndef score(arr):\n hoge = 0\n for ai,bi,ci,di in zip(a, b, c, d):\n if arr[bi-1]-arr[ai-1] == ci:\n hoge += di\n return hoge\n\ndef dfs(arr):\n if len(arr) == n:\n return score(arr)\n last = arr[-1] if len(arr) > 0 else 0\n res = 0\n for i in range(last, m):\n arr.append(i)\n res = max(res, dfs(arr))\n arr.pop()\n return res\n\ndef solve():\n global a, b, c, d, n, m, q\n n, m, q = map(int, input().split())\n a, b, c, d = [0]*q, [0]*q, [0]*q, [0]*q\n for i in range(q):\n a[i], b[i], c[i], d[i] = map(int, input().split())\n print(dfs([]))\n return 0\n\nif __name__ == "__main__":\n solve()\n'] | ['Runtime Error', 'Accepted'] | ['s837113844', 's924720861'] | [31396.0, 31156.0] | [127.0, 793.0] | [723, 725] |
p02695 | u079022693 | 2,000 | 1,048,576 | Given are positive integers N, M, Q, and Q quadruples of integers ( a_i , b_i , c_i , d_i ). Consider a sequence A satisfying the following conditions: * A is a sequence of N positive integers. * 1 \leq A_1 \leq A_2 \le \cdots \leq A_N \leq M. Let us define a score of this sequence as follows: * The score is the sum of d_i over all indices i such that A_{b_i} - A_{a_i} = c_i. (If there is no such i, the score is 0.) Find the maximum possible score of A. | ['from sys import stdin\nimport itertools\nimport numpy as np\nfrom numba import njit\n\n\nreadline=stdin.readline\nN,M,Q=map(int,readline().split())\na=np.zeros(Q,dtype=np.int64)\nb=np.zeros(Q,dtype=np.int64)\nc=np.zeros(Q,dtype=np.int64)\nd=np.zeros(Q,dtype=np.int64)\nfor i in range(Q):\n a[i],b[i],c[i],d[i]=map(int,readline().split())\n\narrays=np.array(list(itertools.combinations_with_replacement(range(1,M+1),N)),dtype=np.int64)\nl=len(arrays)\n\n@njit\ndef f():\n max_res=0\n for i in range(l):\n res=0\n for i in range(Q):\n if arrays[i][b[i]-1]-arrays[i][a[i]-1]==c[i]:\n res+=d[i]\n max_res=max(max_res,res)\n return max_res\n\nprint(f())', 'from sys import stdin\nimport itertools\nimport numpy as np\nfrom numba import njit\n\ndef main():\n\n readline=stdin.readline\n N,M,Q=map(int,readline().split())\n a=np.zeros(Q,dtype=np.int64)\n b=np.zeros(Q,dtype=np.int64)\n c=np.zeros(Q,dtype=np.int64)\n d=np.zeros(Q,dtype=np.int64)\n for i in range(Q):\n a[i],b[i],c[i],d[i]=map(int,readline().split())\n\n arrays=np.array(list(itertools.combinations_with_replacement(range(1,M+1),N)),dtype=np.int64)\n l=len(arrays)\n\n print(f(l,Q,a,b,c,d,arrays))\n \n@njit("i8(i8,i8,i8[:],i8[:],i8[:],i8[:],i8[:,:])",cache=True)\ndef f(l,Q,a,b,c,d,arrays):\n max_res=0\n for i in range(l):\n res=0\n for j in range(Q):\n if arrays[i][b[j]-1]-arrays[i][a[j]-1]==c[j]:\n res+=d[j]\n max_res=max(max_res,res)\n return max_res\n\nif __name__=="__main__":\n\tmain()'] | ['Wrong Answer', 'Accepted'] | ['s427400408', 's643525401'] | [136036.0, 125468.0] | [773.0, 663.0] | [685, 871] |
p02695 | u094191970 | 2,000 | 1,048,576 | Given are positive integers N, M, Q, and Q quadruples of integers ( a_i , b_i , c_i , d_i ). Consider a sequence A satisfying the following conditions: * A is a sequence of N positive integers. * 1 \leq A_1 \leq A_2 \le \cdots \leq A_N \leq M. Let us define a score of this sequence as follows: * The score is the sum of d_i over all indices i such that A_{b_i} - A_{a_i} = c_i. (If there is no such i, the score is 0.) Find the maximum possible score of A. | ['import random\nfrom copy import deepcopy\n\nn,m,q=map(int,input().split())\nl=[list(map(int,input().split())) for i in range(q)]\n\ngene_length=n\nindividual_length=n*10\ngeneration=100\nelite_gene=1\nindividual_mutation=0.01\ngene_mutation=0.01\n\ndef get_population():\n pop=[]\n for i in range(individual_length):\n pop.append([random.randrange(1,m+1) for j in range(gene_length)])\n return pop\n\n\ndef get_fitness(indiv):\n fitness=0\n for a,b,c,d in l:\n a-=1\n b-=1\n if indiv[b]-indiv[a]==c:\n fitness+=d\n return fitness\n\n\ndef elite_selection(pop):\n pop.sort(reverse=True, key=lambda x:x[1])\n return pop[:elite_gene+1]\n\n\ndef two_point_crossover(parent1,parent2):\n r1=random.randint(0,gene_length-1)\n r2=random.randint(0,gene_length-1)\n child=deepcopy(parent1)\n child[r1:r2]=parent2[r1:r2]\n return child\n\n\npop=[[p,get_fitness(p)] for p in get_population()]\npop.sort(reverse=True,key=lambda x:x[1])\n\nfor g in range(generation):\n elites=elite_selection(pop)\n pop=elites\n while len(pop)<individual_length:\n if random.random()<individual_mutation:\n child=[random.randrange(1,m+1) for j in range(gene_length)]\n else:\n m1=random.randint(0,len(elites)-1)\n m2=random.randint(0,len(elites)-1)\n child=two_point_crossover(elites[m1][0],elites[m2][0])\n pop.append([child,get_fitness(child)])\n\n n_pop=[]\n for i in pop:\n if i not in n_pop:\n n_pop.append(i)\n pop=n_pop\n\n pop.sort(reverse=True,key=lambda x:x[1])\n\nans=pop[0][1]\nprint(ans)', 'import sys\nsys.setrecursionlimit(10**9)\n\nn,m,q=map(int,input().split())\nl=[list(map(int,input().split())) for i in range(q)]\n\ndef dfs(a_l):\n if len(a_l)==n:\n global ans\n t_ans=0\n for a,b,c,d in l:\n a-=1\n b-=1\n if (a_l[b]-a_l[a]==c):\n t_ans+=d\n ans=max(ans,t_ans)\n\n return\n\n a_last=a_l[-1]\n for i in range(a_last,m+1):\n dfs(a_l+[i])\n\nans=0\nfor i in range(1,m+1):\n dfs([i])\n\nprint(ans)'] | ['Time Limit Exceeded', 'Accepted'] | ['s183567672', 's796702573'] | [9652.0, 9220.0] | [2206.0, 612.0] | [1487, 427] |
p02695 | u095021077 | 2,000 | 1,048,576 | Given are positive integers N, M, Q, and Q quadruples of integers ( a_i , b_i , c_i , d_i ). Consider a sequence A satisfying the following conditions: * A is a sequence of N positive integers. * 1 \leq A_1 \leq A_2 \le \cdots \leq A_N \leq M. Let us define a score of this sequence as follows: * The score is the sum of d_i over all indices i such that A_{b_i} - A_{a_i} = c_i. (If there is no such i, the score is 0.) Find the maximum possible score of A. | ['N, M, Q=map(int, input().split())\nabcd=[list(map(int, input().split())) for _ in range(Q)]\n\ndef f(nums):\n out=0\n for samp in abcd:\n if nums[samp[1]-1]-nums[samp[0]-1]==samp[2]:\n out+=samp[3]\n return out\n\ndef g(nums):\n if nums[-1]<M:\n nums[-1]+=1\n return nums, False\n \n i=N-1\n while i>=0 and nums[i]==M:\n i-=1\n if i<0:\n return None, True\n \n nums=nums[:i]+[nums[i]+1 for _ in range(N-i)]\n return nums, False\n\nnums=[1]*N\nfi=False\nans=0\n\nwhile fi==False:\n p=f(nums)\n if ans<p:\n ans=p\n print(nums)\n nums, fi=g(nums)\n \nprint(ans)\n\n\n ', 'N, M, Q=map(int, input().split())\nabcd=[list(map(int, input().split())) for _ in range(Q)]\n\ndef f(nums):\n out=0\n for samp in abcd:\n if nums[samp[1]-1]-nums[samp[0]-1]==samp[2]:\n out+=samp[3]\n return out\n\ndef g(nums):\n if nums[-1]<M:\n nums[-1]+=1\n return nums, False\n \n i=N-1\n while i>=0 and nums[i]==M:\n i-=1\n if i<0:\n return None, True\n \n nums=nums[:i]+[nums[i]+1 for _ in range(N-i)]\n return nums, False\n\nnums=[1]*N\nfi=False\nans=0\n\nwhile fi==False:\n p=f(nums)\n if ans<p:\n ans=p\n nums, fi=g(nums)\n \nprint(ans)\n\n\n '] | ['Wrong Answer', 'Accepted'] | ['s230395318', 's922203851'] | [9236.0, 9080.0] | [856.0, 744.0] | [567, 553] |
p02695 | u103341055 | 2,000 | 1,048,576 | Given are positive integers N, M, Q, and Q quadruples of integers ( a_i , b_i , c_i , d_i ). Consider a sequence A satisfying the following conditions: * A is a sequence of N positive integers. * 1 \leq A_1 \leq A_2 \le \cdots \leq A_N \leq M. Let us define a score of this sequence as follows: * The score is the sum of d_i over all indices i such that A_{b_i} - A_{a_i} = c_i. (If there is no such i, the score is 0.) Find the maximum possible score of A. | ['import itertools\n\nN,M,Q = map(int,input().split())\n\nA = [[ int(n) for n in input().split()] for _ in range(Q) ]\nn = [i for i in range(1,M+1)]\nnumbers = list(itertools.combinations_with_replacement(n, N))\nans = [0 for _ in range(len(numbers))]\n\nq = Q\nwhile q> 0:\n q -= 1\n a, b, c, d = A[q][0], A[q][1], A[q][2], A[q][3]\n print(a,b,c,d)\n\n for i in range(len(numbers)):\n if numbers[i][b-1] - numbers[i][a-1] == c:\n ans[i] += d\n\n\nprint(max(ans))\n', 'import itertools\n\nN,M,Q = map(int,input().split())\n\nA = [[ int(n) for n in input().split()] for _ in range(Q) ]\nn = [i for i in range(1,M+1)]\nnumbers = list(itertools.combinations_with_replacement(n, N))\nans = [0 for _ in range(len(numbers))]\n\nq = Q\nwhile q> 0:\n q -= 1\n a, b, c, d = A[q][0], A[q][1], A[q][2], A[q][3]\n\n for i in range(len(numbers)):\n if numbers[i][b-1] - numbers[i][a-1] == c:\n ans[i] += d\n\n\nprint(max(ans))'] | ['Wrong Answer', 'Accepted'] | ['s393343512', 's892634698'] | [25396.0, 25076.0] | [1066.0, 979.0] | [473, 453] |
p02695 | u103902792 | 2,000 | 1,048,576 | Given are positive integers N, M, Q, and Q quadruples of integers ( a_i , b_i , c_i , d_i ). Consider a sequence A satisfying the following conditions: * A is a sequence of N positive integers. * 1 \leq A_1 \leq A_2 \le \cdots \leq A_N \leq M. Let us define a score of this sequence as follows: * The score is the sum of d_i over all indices i such that A_{b_i} - A_{a_i} = c_i. (If there is no such i, the score is 0.) Find the maximum possible score of A. | ['n,m,q = map(int,input().split())\nnums = [tuple(map(int,input().split())) for _ in range(q)]\n\nfrom itertools import combinations_with_replacement\n\ncands = list(combinations_with_replacement(range(1,m+1), n))\nprint(cands)', 'n,m,q = map(int,input().split())\nnums = []\nfor _ in range(q):\n a,b,c,d = map(int,input().split())\n a,b = a-1, b-1\n nums.append((a,b,c,d))\n\n\nfrom itertools import combinations_with_replacement\n\ncands = list(combinations_with_replacement(range(1,m+1), n))\n\nans = 0\n\nfor cand in cands:\n score = 0\n for a,b,c,d in nums:\n if cand[b] - cand[a] == c:\n score += d\n ans = max(ans, score)\nprint(ans)'] | ['Wrong Answer', 'Accepted'] | ['s492437268', 's267245606'] | [27600.0, 21620.0] | [118.0, 948.0] | [219, 403] |
p02695 | u112007848 | 2,000 | 1,048,576 | Given are positive integers N, M, Q, and Q quadruples of integers ( a_i , b_i , c_i , d_i ). Consider a sequence A satisfying the following conditions: * A is a sequence of N positive integers. * 1 \leq A_1 \leq A_2 \le \cdots \leq A_N \leq M. Let us define a score of this sequence as follows: * The score is the sum of d_i over all indices i such that A_{b_i} - A_{a_i} = c_i. (If there is no such i, the score is 0.) Find the maximum possible score of A. | ['import itertools\nn, m, q = map(int, input().split(" "))\nasset = []\nfor i in range(q):\n asset.append(list(map(int, input().split(" "))))\nA = []\n\n\nmax = 0\nprint (asset)\nfor a in itertools.product(list(range(1, m + 1)), repeat = n):\n A.append((list(a)))\nfor i in range(len(A)):\n total = 0\n for j in range(0, n):\n if A[j] <= A[j - 1]:\n continue\n for j in range(q):\n if A[i][asset[j][1] - 1] - A[i][asset[j][0] - 1] == asset[j][2]:\n total += asset[j][3]\n max = total if total > max else max\nprint(max)\n', 'import itertools\n\nn,m,q = map(int, input().split(" "))\na,b,c,d = [],[],[],[]\nfor i in range(q):\n inpu = input()\n a.append((int)(inpu.split(" ")[0]))\n b.append((int)(inpu.split(" ")[1]))\n c.append((int)(inpu.split(" ")[2]))\n d.append((int)(inpu.split(" ")[3]))\n\nballs = list(itertools.combinations_with_replacement(range(1, m + 1), n))\n#print(balls)\nmax = 0\nfor i in range(len(balls)):\n temp = 0\n for j in range(q):\n if balls[i][b[j] - 1] - balls[i][a[j] - 1] == c[j]:\n temp += d[j]\n if temp > max:\n max = temp\nprint(max)'] | ['Runtime Error', 'Accepted'] | ['s627777683', 's680882953'] | [452148.0, 21544.0] | [2220.0, 1363.0] | [551, 539] |
p02695 | u119012830 | 2,000 | 1,048,576 | Given are positive integers N, M, Q, and Q quadruples of integers ( a_i , b_i , c_i , d_i ). Consider a sequence A satisfying the following conditions: * A is a sequence of N positive integers. * 1 \leq A_1 \leq A_2 \le \cdots \leq A_N \leq M. Let us define a score of this sequence as follows: * The score is the sum of d_i over all indices i such that A_{b_i} - A_{a_i} = c_i. (If there is no such i, the score is 0.) Find the maximum possible score of A. | ['\nfrom itertools import combinations_with_replacement\nn, m, q = map(int, input().split())\nlst = []\nfor i in range(q):\n a = list(map(int, input().split()))\n lst.append(a)\n\nx = 0\n\nfor i in combinations_with_replacement(range(1, m + 1), n):\n s = 0\n for j in a:\n if i[j[1] - 1] - i[j[0] - 1] == j[2]:\n s += j[3]\n if x < s:\n x = s\nprint(x)', '\nfrom itertools import combinations_with_replacement\nfrom itertools import accumulate\nn, m, q = map(int, input().split())\na = []\nfor i in range(q):\n a.append(list(map(int, input().split())))\n\n\nx = 0\nfor i in combinations_with_replacement(range(1, m + 1), n):\n ans = []\n for j in a:\n if i[j[1] - 1] - i[j[0] - 1] == j[2]:\n ans.append(j[3])\n if x < sum(ans):\n x = sum(ans)\nprint(x)\n\n'] | ['Runtime Error', 'Accepted'] | ['s613116071', 's849996026'] | [9200.0, 9076.0] | [23.0, 964.0] | [430, 475] |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.