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 |
|---|---|---|---|---|---|---|---|---|---|---|
p02790 | u791013618 | 2,000 | 1,048,576 | Given are 1-digit positive integers a and b. Consider these two strings: the concatenation of b copies of the digit a, and the concatenation of a copies of the digit b. Which of these is lexicographically smaller? | ['a, b = input().split()\n\naa = str(a*int(b))\nbb = str(b*int(a))\n\naa = str(1000)\nbb = str(111)\n\nif aa <= bb:\n print(aa)\nelse:\n print(bb)', 'a, b = input().split()\n\naa = str(a*int(b))\nbb = str(b*int(a))\n\nif aa <= bb:\n print(aa)\nelse:\n print(bb)'] | ['Wrong Answer', 'Accepted'] | ['s992859905', 's919923863'] | [2940.0, 2940.0] | [17.0, 18.0] | [135, 105] |
p02790 | u793666115 | 2,000 | 1,048,576 | Given are 1-digit positive integers a and b. Consider these two strings: the concatenation of b copies of the digit a, and the concatenation of a copies of the digit b. Which of these is lexicographically smaller? | ['a,b = map(int,input().split())\na1=str(a)*b\nb1=str(b)*a\n\nif a>=b:\n print(b1)\nelif a<b:\n print(a1)', 'li = input().split()\n\nif li[0]>=li[1]:\n print(li[1]*int(li[0]))\nelse:\n print(li[0]*int(li[1]))\n', 'a,b = input().split()\n\nif a>=b:\n print(b*int(a))\nelse:\n print(a*int(b))\n', 'li = input().split()\n\nif li[0]>=li[1]:\n print(li[1] *int(li[0]))\nelse:\n print(li[0] *int(li[1]))\n'] | ['Runtime Error', 'Runtime Error', 'Runtime Error', 'Accepted'] | ['s125211625', 's162884832', 's236758793', 's192033158'] | [2940.0, 2940.0, 2940.0, 2940.0] | [17.0, 17.0, 17.0, 17.0] | [102, 101, 78, 99] |
p02790 | u795987907 | 2,000 | 1,048,576 | Given are 1-digit positive integers a and b. Consider these two strings: the concatenation of b copies of the digit a, and the concatenation of a copies of the digit b. Which of these is lexicographically smaller? | ['a, b = list(input().split())\n\nab = a * int(b)\nba = b * int(a)\n\nif ab <= ab:\n print(ab)\nelse:\n print(ba)', 'a, b = list(input().split())\n\nab = a * int(b)\nba = b * int(a)\n\nif ab <= ba:\n print(ab)\nelse:\n print(ba)'] | ['Wrong Answer', 'Accepted'] | ['s637023834', 's953805288'] | [2940.0, 3060.0] | [17.0, 18.0] | [105, 105] |
p02790 | u796708718 | 2,000 | 1,048,576 | Given are 1-digit positive integers a and b. Consider these two strings: the concatenation of b copies of the digit a, and the concatenation of a copies of the digit b. Which of these is lexicographically smaller? | ['inp = input().split("")\nlis = [,]\nfor i in range(inp[0]):\n lis[1] += inp[1]\nfor i in range(inp[1]):\n lis[0] += inp[0]\nlis.sort()\nprint(lis[0])', 'hoge = input().split(" ")\na=""\nb=""\nfor i in range(int(hoge[1])):\n a += hoge[0]\nfor i in range(int(hoge[0])):\n b += hoge[1]\ntxt = [a,b]\ntxt.sort\nprint(txt[0])', 'hoge = input().split(" ")\na=""\nb=""\nfor i in range(int(hoge[1])):\n a += hoge[0]\nfor i in range(int(hoge[0])):\n b += hoge[1]\ntxt = [a,b]\ntxt.sort\nprint(str(txt[0]))', 'hoge = input().split(" ")\nfor i in range(int(hoge[1])):\n a += hoge[0]\nfor i in range(int(hoge[0])):\n b += hoge[1]\ntxt = [a,b]\ntxt.sort\nprint(a[0])', 'txt = input().split(" ")\ntxt.sort\nprint(a[0])', 'hoge = input().split(" ")\na=""\nb=""\nfor i in range(int(hoge[1])):\n a += hoge[0]\nfor i in range(int(hoge[0])):\n b += hoge[1]\ntxt = [a,b]\ntxt.sort()\nprint(txt[0])'] | ['Runtime Error', 'Wrong Answer', 'Wrong Answer', 'Runtime Error', 'Runtime Error', 'Accepted'] | ['s023127161', 's243215177', 's337387142', 's337472045', 's847481732', 's265661195'] | [2940.0, 3060.0, 3060.0, 3064.0, 2940.0, 3060.0] | [18.0, 17.0, 17.0, 19.0, 18.0, 17.0] | [144, 160, 165, 148, 45, 162] |
p02790 | u796789068 | 2,000 | 1,048,576 | Given are 1-digit positive integers a and b. Consider these two strings: the concatenation of b copies of the digit a, and the concatenation of a copies of the digit b. Which of these is lexicographically smaller? | ['a, b= map(int,input().split())\n\nif a < b:\n print(str(a)*b)\nelif b > a:\n print(str(b)*a)\nelse:\n print(str(a)*b)\n', 'a, b= map(int,input().split())\n\nif a < b:\n print(str(a)*b)\nelif a > b:\n print(str(b)*a)\nelse:\n print(str(a)*b)\n'] | ['Wrong Answer', 'Accepted'] | ['s610405770', 's445817016'] | [2940.0, 2940.0] | [17.0, 17.0] | [120, 120] |
p02790 | u797796416 | 2,000 | 1,048,576 | Given are 1-digit positive integers a and b. Consider these two strings: the concatenation of b copies of the digit a, and the concatenation of a copies of the digit b. Which of these is lexicographically smaller? | ["n, m = map(int,input().strip().split())\nfor i in range(0, n):\n print(m,end='')", "n, m = map(int,input().strip().split())\ntemp = int('{}'.format(n)*m)\nm = int('{}'.format(m)*n)\ntemp = str(temp)\nm = str(m)\nif temp==m:\n print(temp)\nelif temp[0]<m[0]:\n print(temp)\nelse:\n print(m)"] | ['Wrong Answer', 'Accepted'] | ['s260552890', 's657859631'] | [2940.0, 3060.0] | [20.0, 17.0] | [81, 204] |
p02790 | u799428010 | 2,000 | 1,048,576 | Given are 1-digit positive integers a and b. Consider these two strings: the concatenation of b copies of the digit a, and the concatenation of a copies of the digit b. Which of these is lexicographically smaller? | ['a,b=map(int, input().split())\nA=str(a);B=str(b);\nif a>=b:\n print(A*b)\nelse :\n print(B*a)', 'a,b=map(int, input().split())\nA=str(a);B=str(b);\nif a<=b:\n print(A*b)\nelse :\n print(B*a)'] | ['Wrong Answer', 'Accepted'] | ['s645816905', 's506995052'] | [8944.0, 8924.0] | [32.0, 26.0] | [94, 94] |
p02790 | u814781830 | 2,000 | 1,048,576 | Given are 1-digit positive integers a and b. Consider these two strings: the concatenation of b copies of the digit a, and the concatenation of a copies of the digit b. Which of these is lexicographically smaller? | ['a, b = input().split()\natxt, btxt = "", ""\nfor i in range(int(b)):\n atxt += a\nfor i in range(int(a)):\n btxt += a\nif atxt <= btxt:\n print(atxt)\nelse:\n print(btxt)', 'a, b = input().split()\natxt, btxt = "", ""\nfor i in range(int(b)):\n atxt += a\nfor i in range(int(a)):\n btxt += b\nif atxt <= btxt:\n print(atxt)\nelse:\n print(btxt)\n'] | ['Wrong Answer', 'Accepted'] | ['s038855849', 's438937781'] | [2940.0, 2940.0] | [17.0, 17.0] | [165, 166] |
p02790 | u816171517 | 2,000 | 1,048,576 | Given are 1-digit positive integers a and b. Consider these two strings: the concatenation of b copies of the digit a, and the concatenation of a copies of the digit b. Which of these is lexicographically smaller? | ['a,b=map(int,input().split())\n\nif a>=b:\n\n print(str(a)*b)\nelse:\n print(str(b)*a)\n', 'a,b=map(int,input().split())\n\nif a>=b:\n\n print(str(b)*a)\nelse:\n print(str(a)*b)\n'] | ['Wrong Answer', 'Accepted'] | ['s727981444', 's117868965'] | [2940.0, 2940.0] | [17.0, 17.0] | [86, 86] |
p02790 | u816631826 | 2,000 | 1,048,576 | Given are 1-digit positive integers a and b. Consider these two strings: the concatenation of b copies of the digit a, and the concatenation of a copies of the digit b. Which of these is lexicographically smaller? | ["a=[v for v in input().split()]\nu=int(a[0])\nfor i in range (0,u):\n print(a[1],end='')", 'a,b=map(int,input().split())\nprint(str(min(a,b))*max(a,b))'] | ['Wrong Answer', 'Accepted'] | ['s740077632', 's215212841'] | [9044.0, 9044.0] | [25.0, 22.0] | [87, 58] |
p02790 | u818078165 | 2,000 | 1,048,576 | Given are 1-digit positive integers a and b. Consider these two strings: the concatenation of b copies of the digit a, and the concatenation of a copies of the digit b. Which of these is lexicographically smaller? | ['a,b = map(int,input().split())\n\n\ns1 = ""\ns2 = ""\nfor i in range(b):\n s1 = s1 + str(a)\n\nfor i in range(a):\n s2 = s2 + str(b)\n\nans = min(s1,s2)', 'a,b = map(int,input().split())\n\n\ns1 = ""\ns2 = ""\nfor i in range(b):\n s1 = s1 + str(a)\n\nfor i in range(a):\n s2 = s2 + str(b)\n\nans = min(s1,s2)\nprint(ans)'] | ['Wrong Answer', 'Accepted'] | ['s127888572', 's144915489'] | [2940.0, 3060.0] | [17.0, 20.0] | [147, 158] |
p02790 | u819593641 | 2,000 | 1,048,576 | Given are 1-digit positive integers a and b. Consider these two strings: the concatenation of b copies of the digit a, and the concatenation of a copies of the digit b. Which of these is lexicographically smaller? | ['a,b = map(int, input().split())\nif a > b:\n print(str(a)*b)\nelse:\n print(str(b)*a)', 'a,b = map(int, input().split())\nif a > b:\n print(str(b)*a)\nelse:\n print(str(a)*b)\n'] | ['Wrong Answer', 'Accepted'] | ['s394423906', 's158608550'] | [2940.0, 2940.0] | [17.0, 18.0] | [83, 84] |
p02790 | u825769322 | 2,000 | 1,048,576 | Given are 1-digit positive integers a and b. Consider these two strings: the concatenation of b copies of the digit a, and the concatenation of a copies of the digit b. Which of these is lexicographically smaller? | ['n,m = map(int,input().split())\n\nfor _ in range(m):\n a += str(n)\nfor _ in range(n):\n b += str(m)\n\nprint(a if n <= m else b)', "import itertools\nn,m = map(int,input().split())\na = b = ''\nfor _ in range(m):\n a += str(n)\nfor _ in range(n):\n b += str(m)\nans = [a,b]\nprint(list(itertools.permutations(ans))[0][0])", "n,m = map(int,input().split())\na = b = ''\nfor _ in range(m):\n a += str(n)\nfor _ in range(n):\n b += str(m)\n\nprint(a if n <= m else b)"] | ['Runtime Error', 'Wrong Answer', 'Accepted'] | ['s173705161', 's862062606', 's239686090'] | [2940.0, 3060.0, 2940.0] | [17.0, 17.0, 17.0] | [128, 187, 138] |
p02790 | u828277092 | 2,000 | 1,048,576 | Given are 1-digit positive integers a and b. Consider these two strings: the concatenation of b copies of the digit a, and the concatenation of a copies of the digit b. Which of these is lexicographically smaller? | ["a, b = map(int, input().split())\n\naa = ''.join([str(a) for i in range(b)])\nbb = ''.join([str(b) for j in range(a)])\n\nlst = [aa, bb]\nprint(sorted(lst))", "a, b = map(int, input().split())\n\naa = ''.join([str(a) for i in range(b)])\nbb = ''.join([str(b) for j in range(a)])\n\nlst = [aa, bb]\nprint(sorted(lst)[0])"] | ['Wrong Answer', 'Accepted'] | ['s155972585', 's186806252'] | [2940.0, 2940.0] | [17.0, 17.0] | [150, 153] |
p02790 | u831752983 | 2,000 | 1,048,576 | Given are 1-digit positive integers a and b. Consider these two strings: the concatenation of b copies of the digit a, and the concatenation of a copies of the digit b. Which of these is lexicographically smaller? | ['n,m=[int(i) for i in input().split()]\nans=""\nif n>=m:\n for i in range(n):\n ans+=m\nelse:\n for i in range(m):\n ans+=n\nprint(ans)', 'n,m=[int(i) for i in input().split()]\nans=""\nif n>=m:\n for i in range(n):\n ans+=str(m)\nelse:\n for i in range(m):\n ans+=str(n)\nprint(ans)\n\n'] | ['Runtime Error', 'Accepted'] | ['s017611575', 's762723813'] | [2940.0, 2940.0] | [17.0, 17.0] | [134, 146] |
p02790 | u835090251 | 2,000 | 1,048,576 | Given are 1-digit positive integers a and b. Consider these two strings: the concatenation of b copies of the digit a, and the concatenation of a copies of the digit b. Which of these is lexicographically smaller? | ['a,b=map(int,input().split())\nif str(a)*b>str(b)*a:\n print(str(a)*b)\nelse:\n print(str(b)*a)\n', 'a,b=map(int,input().split())\nif a**b>b**a:\n print(a**b)\nelse:\n print(b**a)', 'a,b=map(int,input().split())\nc=int(str(a)*b)\nd=int(str(b)*a)\nif c>d:\n print(str(a)*b)\nelse:\n print(str(b)*a)\n'] | ['Wrong Answer', 'Wrong Answer', 'Accepted'] | ['s198089824', 's880317163', 's805804768'] | [9108.0, 8812.0, 9116.0] | [28.0, 22.0, 26.0] | [93, 76, 111] |
p02790 | u838869282 | 2,000 | 1,048,576 | Given are 1-digit positive integers a and b. Consider these two strings: the concatenation of b copies of the digit a, and the concatenation of a copies of the digit b. Which of these is lexicographically smaller? | ['a,b=input().split()\nif int(a)>int(b):\n print(b*str(a))\nelse:\n print(a*str(b))', 'a,b=input().split()\nif int(a)>int(b):\n print(b*int(a))\nelse:\n print(a*int(b))'] | ['Runtime Error', 'Accepted'] | ['s670117528', 's892746876'] | [2940.0, 2940.0] | [18.0, 17.0] | [79, 79] |
p02790 | u841568901 | 2,000 | 1,048,576 | Given are 1-digit positive integers a and b. Consider these two strings: the concatenation of b copies of the digit a, and the concatenation of a copies of the digit b. Which of these is lexicographically smaller? | ['a,b = map(input().split())\nnum_a = int(a)\nnum_b = int(b)\n\nif num_a < num_b:\n print(a*num_b)\nelse:\n print(b*num_a)', 'a, b = input().split()\nprint(min(a*b, b*a))', 'a, b = input().split()\nprint(min(a*int(b), b*int(a)))'] | ['Runtime Error', 'Runtime Error', 'Accepted'] | ['s197385718', 's591174970', 's311931924'] | [2940.0, 2940.0, 2940.0] | [17.0, 17.0, 17.0] | [115, 43, 53] |
p02790 | u843506660 | 2,000 | 1,048,576 | Given are 1-digit positive integers a and b. Consider these two strings: the concatenation of b copies of the digit a, and the concatenation of a copies of the digit b. Which of these is lexicographically smaller? | ['a,b =map(int, input().split())\nprint(a*int(b) if a<=b else b*int(a))', 'a, b=map(int, input().split())\nprint(str(min(a,b))*max(a,b))'] | ['Wrong Answer', 'Accepted'] | ['s686491313', 's873496186'] | [2940.0, 2940.0] | [16.0, 17.0] | [68, 60] |
p02790 | u845822532 | 2,000 | 1,048,576 | Given are 1-digit positive integers a and b. Consider these two strings: the concatenation of b copies of the digit a, and the concatenation of a copies of the digit b. Which of these is lexicographically smaller? | ['a, b = list(map(int, input().split()))\n\n if a > b:\n print(str(b)*a)\n else:\n print(str(a)*b)', 'a, b = list(map(int, input().split()))\n\nif a > b:\n print(str(b)*a)\nelse:\n print(str(a)*b)'] | ['Runtime Error', 'Accepted'] | ['s231101345', 's068937897'] | [2940.0, 2940.0] | [17.0, 18.0] | [111, 95] |
p02790 | u851447314 | 2,000 | 1,048,576 | Given are 1-digit positive integers a and b. Consider these two strings: the concatenation of b copies of the digit a, and the concatenation of a copies of the digit b. Which of these is lexicographically smaller? | ["from sys import stdin\ndef solve():\n a,b=map(int,stdin.readline().split())\n sa='a'*b\n sb='b'*a\n print(min(sa,sb))\nsolve()", 'a,b=map(int,input().split())\nsa=str(a)*b\nsb=str(b)*a\nprint(min(sa,sb))\n'] | ['Wrong Answer', 'Accepted'] | ['s642674302', 's943305603'] | [2940.0, 2940.0] | [17.0, 17.0] | [124, 71] |
p02790 | u852210959 | 2,000 | 1,048,576 | Given are 1-digit positive integers a and b. Consider these two strings: the concatenation of b copies of the digit a, and the concatenation of a copies of the digit b. Which of these is lexicographically smaller? | ['# -*- coding: utf-8 -*-\n\n\n\ndef input_int():\n return int(input())\n\n\n\ndef int1(x):\n return int(x) - 1\n\n\n\ndef input_to_int_map():\n return map(int, input().split())\n\n\n\ndef input_to_int_tuple():\n return tuple(map(int, input().split()))\n\n\n\ndef input_to_int_tuple_minus1():\n return tuple(map(int1, input().split()))\n\n\ndef main():\n a, b = input_to_int_map()\n import itertools\n _a = itertools.repeat(str(a), b)\n _b = itertools.repeat(str(b), a)\n ret = _b\n if _a < _b:\n ret = _a\n\n return ret\n\n\nif __name__ == "__main__":\n print(main())\n', '# -*- coding: utf-8 -*-\n\n\n\ndef input_int():\n return int(input())\n\n\n\ndef int1(x):\n return int(x) - 1\n\n\n\ndef input_to_int_map():\n return map(int, input().split())\n\n\n\ndef input_to_int_tuple():\n return tuple(map(int, input().split()))\n\n\n\ndef input_to_int_tuple_minus1():\n return tuple(map(int1, input().split()))\n\n\ndef main():\n a, b = input_to_int_map()\n import itertools\n _a = "".join(itertools.repeat(str(a), b))\n _b = "".join(itertools.repeat(str(b), a))\n ret = _b\n if _a < _b:\n ret = _a\n\n return ret\n\n\nif __name__ == "__main__":\n print(main())\n'] | ['Runtime Error', 'Accepted'] | ['s395813013', 's519528671'] | [3064.0, 3064.0] | [18.0, 18.0] | [884, 902] |
p02790 | u855393458 | 2,000 | 1,048,576 | Given are 1-digit positive integers a and b. Consider these two strings: the concatenation of b copies of the digit a, and the concatenation of a copies of the digit b. Which of these is lexicographically smaller? | ['a, b = (int(x) for x in input().split())\naa = str(a) * a\nbb = str(b) * b\nif aa > bb:\n print(aa)\nelse:\n print(bb)', 'a, b = (int(x) for x in input().split())\naa = str(a) * b\nbb = str(b) * a\nif aa < bb:\n print(aa)\nelse:\n print(bb)'] | ['Wrong Answer', 'Accepted'] | ['s387576222', 's084759599'] | [2940.0, 2940.0] | [17.0, 17.0] | [118, 118] |
p02790 | u857330600 | 2,000 | 1,048,576 | Given are 1-digit positive integers a and b. Consider these two strings: the concatenation of b copies of the digit a, and the concatenation of a copies of the digit b. Which of these is lexicographically smaller? | ['a,b=map(int,input().split())\nif a>=b:\n tmp=a\n a=b\n b=tmp\nreturn a*((10**b-1)/9)', 'a,b=map(int,input().split())\nif a>=b:\n tmp=a\n a=b\n b=tmp\nprint(a*((10**(b+1)-1)//9))', 'a,b=map(int,input().split())\nif a>=b:\n tmp=a\n a=b\n b=tmp\nprint(a*((10**b-1)//9))'] | ['Runtime Error', 'Wrong Answer', 'Accepted'] | ['s035505558', 's617412311', 's584403157'] | [2940.0, 2940.0, 2940.0] | [17.0, 17.0, 17.0] | [82, 87, 83] |
p02790 | u860966226 | 2,000 | 1,048,576 | Given are 1-digit positive integers a and b. Consider these two strings: the concatenation of b copies of the digit a, and the concatenation of a copies of the digit b. Which of these is lexicographically smaller? | ['data = input().split()\n\na = data[0]\nb = data[1]\n\nans = min(a, b) * max(a, b)\n\nprint(ans)\n', 'data = input().split()\n \na = data[0]\nb = data[1]\n \nans = min(a, b) * int(max(a, b))\n \nprint(ans)\n'] | ['Runtime Error', 'Accepted'] | ['s088084103', 's543522304'] | [2940.0, 2940.0] | [17.0, 17.0] | [89, 97] |
p02790 | u864989756 | 2,000 | 1,048,576 | Given are 1-digit positive integers a and b. Consider these two strings: the concatenation of b copies of the digit a, and the concatenation of a copies of the digit b. Which of these is lexicographically smaller? | ['a,b = map(int, input().split())\n\nstr_a = [a] * b\nstr_b = [b] * a\n\nif str_a > str_b:\n print(*str_b)\nelse:\n print(*str_a)', 'a,b = map(int, input().split())\n\nstr_a = [a] * a\nstr_b = [b] * b\n\nif str_a > str_b:\n print(*str_b)\nelse:\n print(*str_a)', "a,b = map(int, input().split())\n\nstr_a = [a] * b\nstr_b = [b] * a\n\nif str_a > str_b:\n print(''.join(map(str, str_b)))\nelse:\n print(''.join(map(str, str_a)))"] | ['Wrong Answer', 'Wrong Answer', 'Accepted'] | ['s098419024', 's786222206', 's662179096'] | [2940.0, 2940.0, 2940.0] | [17.0, 18.0, 18.0] | [125, 125, 161] |
p02790 | u869267486 | 2,000 | 1,048,576 | Given are 1-digit positive integers a and b. Consider these two strings: the concatenation of b copies of the digit a, and the concatenation of a copies of the digit b. Which of these is lexicographically smaller? | ['A,B=map(int,input().split())\n\na="";b=""\na=str(A)*B;b=str(B)*A\nif A=<B:\n print(a)\nelif A>B:\n print(b)', 'A,B=map(int,input().split())\n\na="";b=""\na=str(A)*B;b=str(B)*A\nif A<=B:\n print(a)\nelif A>B:\n print(b)'] | ['Runtime Error', 'Accepted'] | ['s001689855', 's798361331'] | [2940.0, 2940.0] | [17.0, 17.0] | [106, 106] |
p02790 | u869917163 | 2,000 | 1,048,576 | Given are 1-digit positive integers a and b. Consider these two strings: the concatenation of b copies of the digit a, and the concatenation of a copies of the digit b. Which of these is lexicographically smaller? | ["a , b = input().split()\n \nX = 0\nY = 0\n\nfor i in b:\n X = 'X' + 'a'\n \nfor v in a:\n Y = 'Y' + 'b'\n \nif 'X' < 'Y':\n print('X')\nelse:\n print('Y')", "a , b = map(int(),input().split())\n\nX = 0\nY = 0\n\nlist = [X,Y]\n\nfor i in b:\n X = X + 'a'\n \nfor v in a:\n Y = Y + 'b'\n \nif 'X' < 'Y':\n print(X)\nelse:\n print(Y)", 'a , b =input().split()\n \nif a <= b:\n\tfor i in b:\n print(a*int(b))\n \nelse:\n\tfor v in a:\n\tprint(b*int(a))', "a , b = map(int(),input().split())\n \nX = 0\nY = 0\n\nfor i in b:\n X = 'X' + 'a'\n \nfor v in a:\n Y = 'Y' + 'b'\n \nif 'X' <= 'Y':\n print('X')\nelse:\n print('Y')", "a , b = map(int(),input().split())\n \nX = 0\nY = 0\n \nif a < b:\n\tfor i in b:\n\t\tX = 'X' + 'a'\n print(X)\n \nelse:\n\tfor v in a:\n\t\tY = 'Y' + 'b'\n\tprint(Y)", "a , b = input().split()\n \nX = 0\nY = 0\n\nfor i in b:\n X = 'X' + 'a'\n \nfor v in a:\n Y = 'Y' + 'b'\n \nif 'X' < 'Y':\n print('X')\nelse:\n print('Y')", "a , b = map(int(),input().split())\n \nX = 0\nY = 0\n\nfor i in b:\n X = 'X' + 'a'\n \nfor v in a:\n Y = 'Y' + 'b'\n \nif 'X' < 'Y':\n print(X)\nelse:\n print(Y)", "a , b = input().split()\n \nX = 0\nY = 0\n\nfor i in b:\n X = 'X' + 'a'\n \nfor v in a:\n Y = 'Y' + 'b'\n \nif 'X' <= 'Y':\n print('X')\nelse:\n print('Y')", "a , b = input().split()\n \nX = 0\nY = 0\n\nfor i in b:\n X = 'X' + 'a'\n \nfor v in a:\n Y = 'Y' + 'b'\n \nif 'X' < 'Y':\n print(X)\nelse:\n print(Y)", "a , b = map(int(),input().split())\n \nX = ''\nY = ''\n \nif a < b:\n\tfor i in b:\n\t\tX = 'X' + 'a'\n print(X)\n \nelse:\n\tfor v in a:\n\t\tY = 'Y' + 'b'\n\tprint(Y)", 'a , b =int(),input().split()\n\nif a <= b:\n\tfor i in b:\n print(a*int(b))\n \nelse:\n\tfor v in a:\n\tprint(b*int(a))', "a , b = map(int(),input().split())\n\nX = 0\nY = 0\n\nif a < b:\n\tfor i in b:\n\t\tX = 'X' + 'a'\n print(X)\n\nelse:\n\tfor v in a:\n\t\tY = 'Y' + 'b'\n\tprint(Y)", 'a , b =input().split()\n \nif a <= b:\n print(a*int(b))\nelse:\n\tprint(b*int(a))'] | ['Wrong Answer', 'Runtime Error', 'Runtime Error', 'Runtime Error', 'Runtime Error', 'Wrong Answer', 'Runtime Error', 'Wrong Answer', 'Wrong Answer', 'Runtime Error', 'Runtime Error', 'Runtime Error', 'Accepted'] | ['s037695406', 's080246791', 's239917167', 's255267941', 's294719630', 's669586254', 's758368296', 's830407743', 's835452334', 's904866215', 's913279425', 's987424798', 's427472834'] | [2940.0, 3060.0, 2940.0, 3188.0, 2940.0, 2940.0, 3064.0, 2940.0, 2940.0, 2940.0, 2940.0, 2940.0, 2940.0] | [17.0, 17.0, 17.0, 18.0, 17.0, 17.0, 17.0, 17.0, 17.0, 17.0, 16.0, 17.0, 17.0] | [146, 162, 106, 158, 149, 146, 153, 147, 142, 151, 111, 146, 78] |
p02790 | u870518235 | 2,000 | 1,048,576 | Given are 1-digit positive integers a and b. Consider these two strings: the concatenation of b copies of the digit a, and the concatenation of a copies of the digit b. Which of these is lexicographically smaller? | ['a, b = map(int, input().split())\nA = int(str(a)**b)\nB = int(str(b)**a)\n\nif A >= B:\n print(A)\nelse:\n print(B)', 'a, b = map(int, input().split())\nA = int(str(a)*b)\nB = int(str(b)*a)\n\nif A >= B:\n print(A)\nelse:\n print(B)\n'] | ['Runtime Error', 'Accepted'] | ['s099036492', 's044719679'] | [2940.0, 2940.0] | [17.0, 17.0] | [114, 113] |
p02790 | u870684607 | 2,000 | 1,048,576 | Given are 1-digit positive integers a and b. Consider these two strings: the concatenation of b copies of the digit a, and the concatenation of a copies of the digit b. Which of these is lexicographically smaller? | ['a,b = map(int,input().split())\nif a > b:\n print ((str(b)*a))\nif a == b: print (str(a)*a)\nelse: print(str(a)*b)', 'a,b = map(int,input().split())\nif a > b:\n print (int(str(b)*a))\nif a == b: print (int(str(a)*a))\nelse: print(int(str(a)*b))\n', 'a,b = map(int,input().split())\nif a > b: print (int(str(b)*a))\nif a < b: print (int(str(a)*b))\nif a == b: print(int(str(a)*a))\n'] | ['Wrong Answer', 'Wrong Answer', 'Accepted'] | ['s121875540', 's248476277', 's701014039'] | [2940.0, 2940.0, 2940.0] | [17.0, 17.0, 17.0] | [113, 127, 127] |
p02790 | u873839198 | 2,000 | 1,048,576 | Given are 1-digit positive integers a and b. Consider these two strings: the concatenation of b copies of the digit a, and the concatenation of a copies of the digit b. Which of these is lexicographically smaller? | ['a, b = map(int, input().split())\nss = []\nss.append(str(a) * b)\nss.append(str(b) * a)\nprint(sorted(ss))\n', 'a, b = map(int, input().split())\nss = []\nss.append(str(a) * b)\nss.append(str(b) * a)\nprint(sorted(ss)[0])'] | ['Wrong Answer', 'Accepted'] | ['s354739469', 's974101824'] | [2940.0, 2940.0] | [17.0, 17.0] | [103, 105] |
p02790 | u875449556 | 2,000 | 1,048,576 | Given are 1-digit positive integers a and b. Consider these two strings: the concatenation of b copies of the digit a, and the concatenation of a copies of the digit b. Which of these is lexicographically smaller? | ['a,b = map(int, input().split())\n\nl = "a"*b\nm = "b"*a\n\nif l < m:\n print(l)\nelse:\n print(m)', 'a,b = map(int, input().split())\n\nl = str(a)*b\nm = str(b)*a\n\nif l < m:\n print(l)\nelse:\n print(m)'] | ['Wrong Answer', 'Accepted'] | ['s740849251', 's920990110'] | [2940.0, 2940.0] | [17.0, 17.0] | [95, 101] |
p02790 | u877428733 | 2,000 | 1,048,576 | Given are 1-digit positive integers a and b. Consider these two strings: the concatenation of b copies of the digit a, and the concatenation of a copies of the digit b. Which of these is lexicographically smaller? | ['a,b = input().split()\nA = a*int(b)\nB = b*int(a)\n\nif A > B:\n print(A)\nelif A < B:\n print(B)\nelse:\n print(A)', 'a,b = input().split()\nA = a*int(b)\nB = b*int(a)\n\nif A > B:\n print(B)\nelif A < B:\n print(A)\nelse:\n print(A)\n\n\n\n\n\n\n \n '] | ['Wrong Answer', 'Accepted'] | ['s145617742', 's930398662'] | [2940.0, 2940.0] | [19.0, 20.0] | [115, 135] |
p02790 | u878849567 | 2,000 | 1,048,576 | Given are 1-digit positive integers a and b. Consider these two strings: the concatenation of b copies of the digit a, and the concatenation of a copies of the digit b. Which of these is lexicographically smaller? | ['a, b = input().split()\na_w = a * int(b)\nb_w = b * int(a)\n\nif a => b:\n print(b_w)\nelse:\n print(a_w)', 'a, b = input().split()\na_w = a * int(b)\nb_w = b * int(a)\n\nif a > b:\n print(b_w)\nelse:\n print(a_w)'] | ['Runtime Error', 'Accepted'] | ['s165586599', 's603141512'] | [2940.0, 2940.0] | [17.0, 17.0] | [100, 99] |
p02790 | u881816188 | 2,000 | 1,048,576 | Given are 1-digit positive integers a and b. Consider these two strings: the concatenation of b copies of the digit a, and the concatenation of a copies of the digit b. Which of these is lexicographically smaller? | ['a,b=map(int,input().split())\nif a<=b:\n print(str(a)*a)\nelse:\n print(str(b)*b)', 'a,b=map(int,input().split())\nif a<=b:\n print(str(a)*b)\nelse:\n print(str(b)*a)'] | ['Wrong Answer', 'Accepted'] | ['s736564575', 's358495972'] | [2940.0, 2940.0] | [17.0, 18.0] | [83, 83] |
p02790 | u893270619 | 2,000 | 1,048,576 | Given are 1-digit positive integers a and b. Consider these two strings: the concatenation of b copies of the digit a, and the concatenation of a copies of the digit b. Which of these is lexicographically smaller? | ['a, b = input().split()\nprint(min(int(a*int(b)), int(b*int(a))\n', 'a, b = input().split()\nprint(max(int(a*int(b)), int(b*int(a))', 'a, b = input().split()\nprint(max(int(a*int(b)), int(b*int(a))))'] | ['Runtime Error', 'Runtime Error', 'Accepted'] | ['s490243817', 's659731850', 's791161269'] | [2940.0, 2940.0, 2940.0] | [17.0, 17.0, 16.0] | [62, 61, 63] |
p02790 | u896741788 | 2,000 | 1,048,576 | Given are 1-digit positive integers a and b. Consider these two strings: the concatenation of b copies of the digit a, and the concatenation of a copies of the digit b. Which of these is lexicographically smaller? | ['l=list(map(int,input().split()));print(min(l)*max(l))', 'l=list(map(int,input().split()));print(str(min(l))*max(l))'] | ['Wrong Answer', 'Accepted'] | ['s634295202', 's102218577'] | [2940.0, 2940.0] | [17.0, 17.0] | [53, 58] |
p02790 | u897940702 | 2,000 | 1,048,576 | Given are 1-digit positive integers a and b. Consider these two strings: the concatenation of b copies of the digit a, and the concatenation of a copies of the digit b. Which of these is lexicographically smaller? | ['a, b = map(int, input().split())\nif a >= b:\n print(b)\nelse:\n print(a)\n', 'a, b = map(str, input().split())\nif int(a) >= int(b):\n b = b*int(a)\n print(int(b))\nelse:\n a = a*int(b)\n print(int(a))'] | ['Wrong Answer', 'Accepted'] | ['s316115260', 's023250737'] | [2940.0, 2940.0] | [17.0, 18.0] | [76, 129] |
p02790 | u898109279 | 2,000 | 1,048,576 | Given are 1-digit positive integers a and b. Consider these two strings: the concatenation of b copies of the digit a, and the concatenation of a copies of the digit b. Which of these is lexicographically smaller? | ['a, b = map(int, input().split())\nif a < b:\n print(a * int(b))\nelse:\n print(b * int(a))', 'a, b = input().split()\na_str = a * int(b)\nb_str = b * int(a)\n\nif a_str < b_str:\n print(a_str)\nelse:\n print(b_str)\n'] | ['Wrong Answer', 'Accepted'] | ['s612021062', 's623002176'] | [9096.0, 8960.0] | [24.0, 30.0] | [88, 116] |
p02790 | u904269060 | 2,000 | 1,048,576 | Given are 1-digit positive integers a and b. Consider these two strings: the concatenation of b copies of the digit a, and the concatenation of a copies of the digit b. Which of these is lexicographically smaller? | ['a,b=map(int,input().split())\nif a==b:\n for i in range(a):\n \tsum=a*pow(10,i)\n print(sum)\nelif a<b:\n for i in range(b):\n \tsum=a*pow(10,i)\n print(sum)\nelif b<a:\n for i in range(a):\n \tsum=b*pow(10,i)\n print(sum)', 'a,b=map(int,input().split())\nsum=0\nif a==b:\n for i in range(a):\n \tsum+=a*pow(10,i)\n print(sum)\nelif a<b:\n for i in range(b):\n \tsum+=a*pow(10,i)\n print(sum)\nelif b<a:\n for i in range(a):\n \tsum+=b*pow(10,i)\n print(sum)'] | ['Wrong Answer', 'Accepted'] | ['s141902139', 's441803682'] | [3060.0, 3060.0] | [17.0, 18.0] | [219, 228] |
p02790 | u916637712 | 2,000 | 1,048,576 | Given are 1-digit positive integers a and b. Consider these two strings: the concatenation of b copies of the digit a, and the concatenation of a copies of the digit b. Which of these is lexicographically smaller? | ['a,b=map(str,input().split())\nA=""\nfor i in range(int(a)):\n A=A+a\nB=""\nfor i in range(int(b)):\n B=B+b\n#print(A)\n#\nprint(min(A,B))', 'a,b=map(str,input().split())\nA=""\nfor i in range(int(b)):\n A=A+a\nB=""\nfor i in range(int(a)):\n B=B+b\n#print(A)\n#\nprint(min(A,B))'] | ['Wrong Answer', 'Accepted'] | ['s161489101', 's479388431'] | [2940.0, 2940.0] | [17.0, 18.0] | [134, 134] |
p02790 | u917444023 | 2,000 | 1,048,576 | Given are 1-digit positive integers a and b. Consider these two strings: the concatenation of b copies of the digit a, and the concatenation of a copies of the digit b. Which of these is lexicographically smaller? | ['a,b=map(int,input().split())\nif a>=b:\n print(b*a)\nelse:\n print(a*b)', 'a,b=map(int,input().split())\nif a>=b:\n print(str(b)*a)\nelse:\n print(str(a)*b)'] | ['Wrong Answer', 'Accepted'] | ['s290501670', 's846215149'] | [2940.0, 2940.0] | [17.0, 18.0] | [69, 79] |
p02790 | u918714262 | 2,000 | 1,048,576 | Given are 1-digit positive integers a and b. Consider these two strings: the concatenation of b copies of the digit a, and the concatenation of a copies of the digit b. Which of these is lexicographically smaller? | ['a, b = map(int, input.split())\nprint(max(int(str(a)*b), int(str(b)*a)))', 'a, b = map(int, input().split())\nprint(max(int(str(a)*b), int(str(b)*a)))'] | ['Runtime Error', 'Accepted'] | ['s579004683', 's380789239'] | [2940.0, 2940.0] | [18.0, 17.0] | [71, 73] |
p02790 | u923010184 | 2,000 | 1,048,576 | Given are 1-digit positive integers a and b. Consider these two strings: the concatenation of b copies of the digit a, and the concatenation of a copies of the digit b. Which of these is lexicographically smaller? | ['import numpy as np\na,b = map(int,input().split())\nif (a*10**b) > (b*10**a):\n print(np.ceil(a * (10**b + 10**(b-1) + 10**(b-2) + 10**(b-3) + 10**(b-4) + 10**(b-5) + 10**(b-6) + 10**(b-7) + 10**(b-8) + 10**(b-9))))\nelse:\n print(np.ceil(b * (10**a + 10**(a-1) + 10**(a-2) + 10**(a-3) + 10**(a-4) + 10**(a-5) + 10**(a-6) + 10**(a-7) + 10**(a-8) + 10**(a-9))))', 'import numpy as np\na,b = map(int,input().split())\nif (a*10^b) > (b*10^a):\n print(np.ceil(a * (10^b + 10^(b-1) + 10^(b-2) + 10^(b-3) + 10^(b-4) + 10^(b-5) + 10^(b-6) + 10^(b-7) + 10^(b-8) + 10^(b-9))))\nelse:\n print(np.ceil(b * (10^a + 10^(a-1) + 10^(a-2) + 10^(a-3) + 10^(a-4) + 10^(a-5) + 10^(a-6) + 10^(a-7) + 10^(a-8) + 10^(a-9))))', 'import numpy as np\na,b = map(int,input().split())\nif (a*10**b) > (b*10**a):\n print(int(a * (10**(b-1) + 10**(b-2) + 10**(b-3) + 10**(b-4) + 10**(b-5) + 10**(b-6) + 10**(b-7) + 10**(b-8) + 10**(b-9))))\nelse:\n print(int(b * (10**(a-1) + 10**(a-2) + 10**(a-3) + 10**(a-4) + 10**(a-5) + 10**(a-6) + 10**(a-7) + 10**(a-8) + 10**(a-9))))'] | ['Wrong Answer', 'Wrong Answer', 'Accepted'] | ['s023142135', 's149462141', 's808499677'] | [21268.0, 12392.0, 12392.0] | [295.0, 148.0, 148.0] | [361, 339, 337] |
p02790 | u923270446 | 2,000 | 1,048,576 | Given are 1-digit positive integers a and b. Consider these two strings: the concatenation of b copies of the digit a, and the concatenation of a copies of the digit b. Which of these is lexicographically smaller? | ['input_numbers = list(map(int,input().split()))\na = input_numbers[0]\nb = input_numbers[1]\nA = a\nB = b\nx = 0\ny = 0\nwhile A >= 0:\n x += 10 ** A * b\n A -= 1\nwhile B >= 0:\n y += 10 ** B * a\n B -= 1\nif x > y:\n ptint(x)\nelse:\n print(y)', 'a, b = input().split()\nlist1 = [a * int(b), b * int(a)]\nL = sorted(list1)\nprint(L[0])'] | ['Runtime Error', 'Accepted'] | ['s546912044', 's294134026'] | [3064.0, 2940.0] | [17.0, 17.0] | [234, 85] |
p02790 | u926073965 | 2,000 | 1,048,576 | Given are 1-digit positive integers a and b. Consider these two strings: the concatenation of b copies of the digit a, and the concatenation of a copies of the digit b. Which of these is lexicographically smaller? | ['input_line=input().rstrip().slpit()\nnum1 = int(input_line[0])\nnum2 = int(input_line[1])\n\nif (num1 > num2):\n print(str(num2)*num1)\nelif (num1 < num2):\n print(str(num1)*num2)\nelif (num1 == num2):\n print(str(num1)*num2)', 'input_line=input().rstrip().slpit()\nnum1 = int(input_line[0])\nnum2 = int(input_line[1])\nlist1 = []\nlist2 = []\nfor i in range (num2):\n list1.append(num1)\nlist_num1 = join(map(str, list1))\nlist_int_num1 = int(list_num1)\n\nfor i in range (num1):\n list2.append(num2)\nlist_num2 = join(map(str, list2))\nlist_int_num2 = int(list_num2)\n\nif (list_int_num1 > list_int_num2):\n print(list_int_num2)\nelif(list_int_num1 < list_int_num2):\n print(list_int_num1)\nelif(list_int_num1 == list_int_num2):\n print(list_int_num1)', 'input_line=input().rstrip().slpit()\nnum1 = int(input_line[0])\nnum2 = int(input_line[1])\nif (num1>num2):\n num = num2\nelif(num1<num2):\n num = num1\nelif(num1=num2):\n num = num1\ncount = num\nfor i in range(count):\n print(num)', 'input_line=input().rstrip().slpit()\nnum1 = int(input_line[0])\nnum2 = int(input_line[1])\nlist1 = []\nlist2 = []\nif (num1 > num2):\n for i in range(num1):\n list1.append(num2)\n list_num1 = join(map(str, list1))\n list_int_num1 = int(list_num1)\n print(list_num_num1)\nelif (num1 < num2):\n for j in range(num2):\n list1.append(num1)\n list_num2 = join(map(str, list2))\n list_int_num2 = int(list_num2)\n print(list_num_num2)\nelif (num1 == num2):\n for k in range(num2):\n list1.append(num1)\n list_num2 = join(map(str, list2))\n list_int_num2 = int(list_num2)\n print(list_num_num2)', 'input_line=input().rstrip().slpit()\nnum1 = int(input_line[0])\nnum2 = int(input_line[1])\nif (num1>num2):\n num = num2\nelif(num<num2):\n num = num1\nelif(num1=num2):\n num = num1\ncount = num\nfor i in range(count):\n print(num)', 'input_line=input().rstrip().split()\nnum1 = int(input_line[0])\nnum2 = int(input_line[1])\n \nif (num1 > num2):\n print(str(num2)*num1)\nelif (num1 < num2):\n print(str(num1)*num2)\nelif (num1 == num2):\n print(str(num1)*num2)'] | ['Runtime Error', 'Runtime Error', 'Runtime Error', 'Runtime Error', 'Runtime Error', 'Accepted'] | ['s077458081', 's178812280', 's341965522', 's440908501', 's891421178', 's016861508'] | [9056.0, 8856.0, 8724.0, 9072.0, 8976.0, 9116.0] | [22.0, 22.0, 24.0, 24.0, 23.0, 25.0] | [219, 509, 224, 585, 223, 220] |
p02790 | u929217794 | 2,000 | 1,048,576 | Given are 1-digit positive integers a and b. Consider these two strings: the concatenation of b copies of the digit a, and the concatenation of a copies of the digit b. Which of these is lexicographically smaller? | ['# B Comparing Strings\n\na, b = input().split()\n\ns = []\ns.append(a * int(b))\ns.append(b * int(a))\ns.sort\n\nprint(s[0])', '# B Comparing Strings\n\na, b = map(int, input().split())\n\nif a >= b:\n print(str(b) * a)\nelse:\n print(str(a) * b)\n'] | ['Wrong Answer', 'Accepted'] | ['s672304830', 's518361367'] | [9104.0, 9156.0] | [25.0, 28.0] | [115, 114] |
p02790 | u934868410 | 2,000 | 1,048,576 | Given are 1-digit positive integers a and b. Consider these two strings: the concatenation of b copies of the digit a, and the concatenation of a copies of the digit b. Which of these is lexicographically smaller? | ['a,b = map(int,input().split())\nprint(str(max(a,b))*min(a,b))', 'a,b = map(int,input().split())\nprint(str(min(a,b))*max(a,b))'] | ['Wrong Answer', 'Accepted'] | ['s447398137', 's890110344'] | [2940.0, 2940.0] | [17.0, 18.0] | [60, 60] |
p02790 | u935840914 | 2,000 | 1,048,576 | Given are 1-digit positive integers a and b. Consider these two strings: the concatenation of b copies of the digit a, and the concatenation of a copies of the digit b. Which of these is lexicographically smaller? | ['a,b = map(int, input().split())a, b = map(int, input().split())\nif a[0] < b[0]:\n print(a)\nelse:\n print(b)', 'a, b = input().split()\nif int(a[0]) < int(b[0]):\n print(a * int(b))\nelse:\n print(b * int(a))\n'] | ['Runtime Error', 'Accepted'] | ['s062138395', 's058118874'] | [2940.0, 2940.0] | [17.0, 17.0] | [111, 99] |
p02790 | u936885469 | 2,000 | 1,048,576 | Given are 1-digit positive integers a and b. Consider these two strings: the concatenation of b copies of the digit a, and the concatenation of a copies of the digit b. Which of these is lexicographically smaller? | ['a = list(map(int, input().split()))\n\nvar1 = 0\nvar2 = 0\n\nfor i in range(a[1]):\n var1 = var1 * 10 + a[0]\n\nfor i in range(a[0]):\n var2 = var2 * 10 + a[1]\n\nif var1 < var2:\n print(var1)\nelse:\n print(var2)\n', 'a = list(map(int, input().split()))\n\nvar1 = 0\nvar2 = 0\n\nfor i in range(a[1]):\n var1 = var1 * 10 + a[0]\n\nfor i in range(a[0]):\n var2 = var2 * 10 + a[1]\n\nif var1 <= var2:\n print(var1)\nelse:\n print(var2)\n', 'a = list(map(int, input().split()))\n\nvar1 = 0\nvar2 = 0\n\nfor i in range(a[1]):\n var1 = var1 * 10 + a[0]\n\nfor i in range(a[0]):\n var2 = var2 * 10 + a[1]\n\nif a[0] <= a[1]:\n print(var1)\nelse:\n print(var2)\n'] | ['Wrong Answer', 'Wrong Answer', 'Accepted'] | ['s144037856', 's399553781', 's455375801'] | [2940.0, 2940.0, 2940.0] | [18.0, 17.0, 18.0] | [212, 213, 213] |
p02790 | u944637843 | 2,000 | 1,048,576 | Given are 1-digit positive integers a and b. Consider these two strings: the concatenation of b copies of the digit a, and the concatenation of a copies of the digit b. Which of these is lexicographically smaller? | ['x,y=map(int,input().split())\nif x<y:\n z=0\n for i in range(0,x):\n z+=10**i*x\n print(z)\nelse:\n z=0\n for i in range(0,y):\n z+=10**i*y\n print(z)', 'x,y=map(int,input().split())\nif x<y:\n z=0\n for i in range(0,y):\n z+=10**i*x\n print(z)\nelse:\n z=0\n for i in range(0,x):\n z+=10**i*y\n print(z)'] | ['Wrong Answer', 'Accepted'] | ['s852017685', 's666624031'] | [3060.0, 3060.0] | [17.0, 17.0] | [152, 152] |
p02790 | u944643608 | 2,000 | 1,048,576 | Given are 1-digit positive integers a and b. Consider these two strings: the concatenation of b copies of the digit a, and the concatenation of a copies of the digit b. Which of these is lexicographically smaller? | ["a, b = map(int,input().split())\nif a >= b:\n print('b'*a)\nelse:\n print('a'*b)", "a, b = map(int,input().split())\nif a >= b:\n print('a'*b)\nelse:\n print('b'*a)\n", "a, b = map(int,input().split())\nif a >= b:\n print('a'*a)\nelse:\n print('b'*b)\n", 'a, b = map(int,input().split())\nif a >= b:\n print(str(b)*a)\nelse:\n print(str(a)*b)\n'] | ['Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Accepted'] | ['s129989646', 's779095829', 's819811509', 's428653616'] | [2940.0, 2940.0, 2940.0, 2940.0] | [17.0, 17.0, 19.0, 17.0] | [78, 79, 79, 85] |
p02790 | u947327691 | 2,000 | 1,048,576 | Given are 1-digit positive integers a and b. Consider these two strings: the concatenation of b copies of the digit a, and the concatenation of a copies of the digit b. Which of these is lexicographically smaller? | ['a,b = map(str,input().split())\n\naa=a*int(b)\nbb=b*int(a)\n\nprint(aa if a>b else bb)', 'a,b = map(str,input().split())\n\naa=a*int(b)\nbb=b*int(a)\n\nprint(bb if a>b else aa)'] | ['Wrong Answer', 'Accepted'] | ['s149736991', 's100295048'] | [2940.0, 2940.0] | [17.0, 17.0] | [81, 81] |
p02790 | u955691979 | 2,000 | 1,048,576 | Given are 1-digit positive integers a and b. Consider these two strings: the concatenation of b copies of the digit a, and the concatenation of a copies of the digit b. Which of these is lexicographically smaller? | ['a = input()\nb = input()\n\nlist_a = [0]*int(b)\nlist_b = [0]*int(a)\n\nfor i in range(0,int(b)):\n list_a[i] = int(a)*10**i\n\nfor i in range(0,int(a)):\n list_b[i] = int(b)*10**i\n \na_r = sum(list_a) \nb_r =sum(list_b)\n\nif(a<b):\n print(a_r)\nelif(a>b):\n print(b_r)\nelse:\n print(a_r)', 'a = input()\nb = input()\n\nlist_a = [0]*int(b)\nlist_b = [0]*int(a)\n\nfor i in range(0,int(b)):\n list_a[i] = int(a)*10**i\n\nfor i in range(0,int(a)):\n list_b[i] = int(b)*10**i\n \na_r = sum(list_a) \nb_r =sum(list_b)\n\nif(int(a_r)<int(b_r)):\n print(str(a_r))\nelif(int(a_r)>int(b_r)):\n print(str(b_r))\nelse:\n print(str(a_r))\n', 'a = input()\nb = input()\n\nlist_a = [0]*int(b)\nlist_b = [0]*int(a)\n\nfor i in range(0,int(b)):\n list_a[i] = int(a)*10**i\n\nfor i in range(0,int(a)):\n list_b[i] = int(b)*10**i\n \na_r = sum(list_a) \nb_r =sum(list_b)\n\nif(a<b):\n print(str(a_r))\nelif(a>b):\n print(str(b_r))\nelse:\n print(str(a_r))', 'a, b = input().split()\n\nlist_a = [0]*int(b)\nlist_b = [0]*int(a)\n\nfor i in range(0,int(b)):\n list_a[i] = int(a)*10**i\n\nfor i in range(0,int(a)):\n list_b[i] = int(b)*10**i\n \na_r = sum(list_a) \nb_r =sum(list_b)\n\nif(a<b):\n print(str(a_r))\nelif(a>b):\n print(str(b_r))\nelse:\n print(str(a_r))'] | ['Runtime Error', 'Runtime Error', 'Runtime Error', 'Accepted'] | ['s374064196', 's504217689', 's648240155', 's177709946'] | [3064.0, 3064.0, 3064.0, 3064.0] | [17.0, 17.0, 17.0, 17.0] | [289, 333, 304, 303] |
p02790 | u957843607 | 2,000 | 1,048,576 | Given are 1-digit positive integers a and b. Consider these two strings: the concatenation of b copies of the digit a, and the concatenation of a copies of the digit b. Which of these is lexicographically smaller? | ['a, b = input().split()\nif a >= b:\n print(a)\nelse:\n print(b)', 'a, b = input().split()\nA = a*int(b)\nB = b*int(a)\nif A >= B:\n print(A)\nelse:\n print(B)', 'a, b = input().split()\nA = a*int(b)\nB = b*int(a)\n\nlis = [A, B]\nnew_lis = sorted(lis)\nprint(new_lis[0])'] | ['Wrong Answer', 'Wrong Answer', 'Accepted'] | ['s192017154', 's792873974', 's897938059'] | [2940.0, 2940.0, 2940.0] | [17.0, 17.0, 17.0] | [61, 87, 102] |
p02790 | u958210291 | 2,000 | 1,048,576 | Given are 1-digit positive integers a and b. Consider these two strings: the concatenation of b copies of the digit a, and the concatenation of a copies of the digit b. Which of these is lexicographically smaller? | ['a,b = input().split()\na = int(a)\nb = int(b)\nastr = ""\nbstr = ""\nfor i in range(0,a):\n\tastr += str(a)\n\nfor i in range(0,b):\n\tbstr += str(b)\n\nif ord(astr[:1]) > ord(bstr[:1]):\n\tprint(bstr)\nelif ord(astr[:1]) < ord(bstr[:1]):\n\tprint(astr)\nelse:\n\tprint(astr)', 'a,b = input().split()\na = int(a)\nb = int(b)\nastr = ""\nbstr = ""\nfor i in range(0,a):\n\tastr += str(b)\n\nfor i in range(0,b):\n\tbstr += str(a)\n\nif ord(astr[:1]) > ord(bstr[:1]):\n\tprint(bstr)\nelif ord(astr[:1]) < ord(bstr[:1]):\n\tprint(astr)\nelse:\n\tprint(astr)'] | ['Wrong Answer', 'Accepted'] | ['s467620324', 's632300191'] | [3064.0, 3064.0] | [17.0, 17.0] | [254, 254] |
p02790 | u958789802 | 2,000 | 1,048,576 | Given are 1-digit positive integers a and b. Consider these two strings: the concatenation of b copies of the digit a, and the concatenation of a copies of the digit b. Which of these is lexicographically smaller? | ["# -*- coding: utf-8 -*-\n\n\n\ndef main():\n a,b = map(int, input().split())\n all_a = str(a) * b\n all_b = str(b) * a\n\n print(all_a)\n print(all_b)\n\n if (all_a < all_b):\n print(all_a)\n else :\n print(all_b)\n\nif __name__ == '__main__':\n main()\n", "# -*- coding: utf-8 -*-\n\n\n\ndef main():\n a,b = map(int, input().split())\n all_a = str(a) * b\n all_b = str(b) * a\n\n # print(all_a)\n # print(all_b)\n\n if (all_a < all_b):\n print(all_a)\n else :\n print(all_b)\n\nif __name__ == '__main__':\n main()"] | ['Wrong Answer', 'Accepted'] | ['s264949231', 's581085238'] | [3060.0, 2940.0] | [17.0, 18.0] | [320, 323] |
p02790 | u960171798 | 2,000 | 1,048,576 | Given are 1-digit positive integers a and b. Consider these two strings: the concatenation of b copies of the digit a, and the concatenation of a copies of the digit b. Which of these is lexicographically smaller? | ['#problem-b\na,b = map(int, input().split())\nprint(str(a)*b if a>=b else str(b)*a)', '#problem-b\na,b = map(int, input().split())\nprint(str(a)*b if a<=b else str(b)*a)\n'] | ['Wrong Answer', 'Accepted'] | ['s231792158', 's711402512'] | [2940.0, 2940.0] | [17.0, 17.0] | [80, 81] |
p02790 | u963949936 | 2,000 | 1,048,576 | Given are 1-digit positive integers a and b. Consider these two strings: the concatenation of b copies of the digit a, and the concatenation of a copies of the digit b. Which of these is lexicographically smaller? | ['a, b = [input() for i in range(2)]\na_array = []\nfor i in range(int(b)):\n a_array.append(a)\na_str = "".join(a_array)\n\nb_array = []\nfor i in range(int(a)):\n b_array.append(b)\nb_str = "".join(b_array)\n\n\nif a_str < b_str:\n print(a_str)\nelif b_str < a_str:\n print(b_str)\nelse:\n print(a_str)\n', 'a, b = input().split()\n\na_array = []\nfor i in range(int(b)):\n a_array.append(a)\na_str = "".join(a_array)\n\nb_array = []\nfor i in range(int(a)):\n b_array.append(b)\nb_str = "".join(b_array)\n\n\nif a_str < b_str:\n print(a_str)\nelif b_str < a_str:\n print(b_str)\nelse:\n print(a_str)\n'] | ['Runtime Error', 'Accepted'] | ['s069499411', 's619349458'] | [3060.0, 3316.0] | [17.0, 20.0] | [301, 290] |
p02790 | u964521959 | 2,000 | 1,048,576 | Given are 1-digit positive integers a and b. Consider these two strings: the concatenation of b copies of the digit a, and the concatenation of a copies of the digit b. Which of these is lexicographically smaller? | ['\nA, B = map(int, input().split())\n\nans = ""\nif(A>B):\n for i in range(A):\n ans = ans + B\nelse:\n for i in range(B):\n ans = ans + A\n \n \n \nprint(ans)', '\nA, B = map(int, input().split())\n\nans = ""\nif(A>B):\n for i in range(A):\n ans = ans + str(B)\nelse:\n for i in range(B):\n ans = ans + str(A)\n \n \n \nprint(ans)\n\n'] | ['Runtime Error', 'Accepted'] | ['s872527463', 's710409156'] | [3060.0, 2940.0] | [18.0, 18.0] | [202, 214] |
p02790 | u969190727 | 2,000 | 1,048,576 | Given are 1-digit positive integers a and b. Consider these two strings: the concatenation of b copies of the digit a, and the concatenation of a copies of the digit b. Which of these is lexicographically smaller? | ['a,b=map(int,input().split())\nans=""\nif a<=b:\n ans=str(a)*b\nelse:\n ans=str(b)*a\n', 'a,b=map(int,input().split())\nans=""\nif a<b:\n ans=str(a)*b\nelse:\n ans=str(b)*a\nprint(ans)'] | ['Wrong Answer', 'Accepted'] | ['s075453878', 's390523943'] | [2940.0, 2940.0] | [17.0, 17.0] | [81, 90] |
p02790 | u969211566 | 2,000 | 1,048,576 | Given are 1-digit positive integers a and b. Consider these two strings: the concatenation of b copies of the digit a, and the concatenation of a copies of the digit b. Which of these is lexicographically smaller? | ['a,b = map(int,input().split())\nnumlist = []\nif a > b:\n for i in range(a):\n numlist.append(str(a))\nelse:\n for i in range(b):\n numlist.append(str(b))\nprint("".join(numlist))', 'a,b = map(int,input().split())\nif a < b:\n print(str(a)*b)\nelse:\n print(str(b)*a)'] | ['Wrong Answer', 'Accepted'] | ['s749624088', 's205941954'] | [2940.0, 2940.0] | [17.0, 17.0] | [179, 86] |
p02790 | u971124021 | 2,000 | 1,048,576 | Given are 1-digit positive integers a and b. Consider these two strings: the concatenation of b copies of the digit a, and the concatenation of a copies of the digit b. Which of these is lexicographically smaller? | ['N = int(input())\nP = list(map(int,input().split()))\n\nres = [False for x in range(N)]\nfor i in range(1,N):\n if P[i-1] > P[i] :\n res[i] = True\n \nprint(sum(res)+1)', 'N = int(input())\nP = list(map(int,input().split()))\n\nres = [False for x in range(N)]\nfor i in range(1,N):\n if P[i-1] >= P[i] :\n res[i] = True\n\nprint(int(sum(res)+1))', 'N = int(input())\nP = list(map(int,input().split()))\n\nres = [False for x in range(N)]\nfor i in range(1,N):\n if P[i-1] >= P[i] :\n res[i] = True\n \nprint(sum(res)+1)', 'a,b = list(map(int,input().split()))\n\nab = str(a) *b\nba = str(b) *a\n\nprint(min([ab,ba]))\n'] | ['Runtime Error', 'Runtime Error', 'Runtime Error', 'Accepted'] | ['s054193084', 's251341991', 's305702796', 's867851780'] | [3060.0, 3064.0, 3060.0, 2940.0] | [17.0, 17.0, 17.0, 18.0] | [165, 169, 166, 89] |
p02790 | u974231963 | 2,000 | 1,048,576 | Given are 1-digit positive integers a and b. Consider these two strings: the concatenation of b copies of the digit a, and the concatenation of a copies of the digit b. Which of these is lexicographically smaller? | ["\na, b = input().split()\n\nint_a = int(a)\nint_b = int(b)\n\na_List = ''\nb_List = ''\n\nfor i in range(int_a):\n b_List = b_List + b\n\nfor i in range(int_b):\n a_List = a_List + a\n\n\n# print('a_List : ' + a_List)\n# print('b_List : ' + b_List)\n\na_List = int(a_List)\nb_List = int(b_List)\n\nif a_List => b_List:\n print(a_List)\n\nelse:\n print(b_List)", "\n\na, b = input().split()\n\nint_a = int(a)\nint_b = int(b)\n\na_List = ''\nb_List = ''\n\nfor i in range(int_a):\n b_List = b_List + b\n\nfor i in range(int_b):\n a_List = a_List + a\n\n\nprint('a_List : ' + a_List)\nprint('b_List : ' + b_List)\n\n# a_List = int(a_List)\n# b_List = int(b_List)\n\n\nif a_List => b_List:\n print(a_List)\n\nelse:\n print(b_List)", "\n\na, b = input().split()\n\nint_a = int(a)\nint_b = int(b)\n\na_List = ''\nb_List = ''\n\nfor i in range(int_a):\n b_List = b_List + b\n\nfor i in range(int_b):\n a_List = a_List + a\n\n\nprint('a_List : ' + a_List)\nprint('b_List : ' + b_List)\n\n# a_List = int(a_List)\n# b_List = int(b_List)\n\n\nif a_List => b_List:\n print(a_List)\n\nelse:\n print(b_List)", "\na, b = input().split()\n\nint_a = int(a)\nint_b = int(b)\n\na_List = ''\nb_List = ''\n\nfor i in range(int_a):\n b_List = b_List + b\n\nfor i in range(int_b):\n a_List = a_List + a\n\n\n# print('a_List : ' + a_List)\n# print('b_List : ' + b_List)\n\na_List = int(a_List)\nb_List = int(b_List)\n\nif a_List >= b_List:\n print(a_List)\n\nelse:\n print(b_List)"] | ['Runtime Error', 'Runtime Error', 'Runtime Error', 'Accepted'] | ['s103991328', 's201298041', 's299124966', 's960704344'] | [2940.0, 2940.0, 2940.0, 3064.0] | [17.0, 17.0, 17.0, 17.0] | [345, 347, 347, 345] |
p02790 | u975517333 | 2,000 | 1,048,576 | Given are 1-digit positive integers a and b. Consider these two strings: the concatenation of b copies of the digit a, and the concatenation of a copies of the digit b. Which of these is lexicographically smaller? | ['a, b = map(int, input().split())\nif a < b: \n print(b*a)\nelse:\n print(a*b)', 'a, b = map(int, input().split())\nif a < b: \n print(b*str(a))\nelse:\n print(a*str(b))'] | ['Wrong Answer', 'Accepted'] | ['s725048379', 's668843610'] | [2940.0, 2940.0] | [17.0, 18.0] | [75, 85] |
p02790 | u977982384 | 2,000 | 1,048,576 | Given are 1-digit positive integers a and b. Consider these two strings: the concatenation of b copies of the digit a, and the concatenation of a copies of the digit b. Which of these is lexicographically smaller? | ['a,b=input().split()\nA=int(a)\nB=int(b)\naa=a\nbb=b\nfor i in range(B-1):\n aa+=a\nfor j in range(A-1):\n bb+=b\nif int(aa) >= int(bb):\n print(bb)\nelse:\n print(aa)', 'a,b=input().split()\nA=int(a)\nB=int(b)\naa=a\nbb=b\nfor i in range(B-1):\n aa+=a\nfor j in range(A-1):\n bb+=b\nif aa >= bb:\n print(bb)\nelse:\n print(aa)'] | ['Wrong Answer', 'Accepted'] | ['s361656899', 's270298050'] | [9180.0, 9140.0] | [27.0, 30.0] | [166, 156] |
p02790 | u982152304 | 2,000 | 1,048,576 | Given are 1-digit positive integers a and b. Consider these two strings: the concatenation of b copies of the digit a, and the concatenation of a copies of the digit b. Which of these is lexicographically smaller? | ['N,M = input().split(" ")\nif N > M:\n \n str = str(M)\n print(str*N)\n\nelse:\n str = str(N)\n print(str*M)\n\n\n', 'N,M = input().split(" ")\nif N > M:\n str = str(M)\n print(str*N)\nelse:\n str = str(N)\n print(str*M)', 'N,M = input().split(" ")\nif N > M:\n str = M\n print(str*int(N))\nelse:\n str = N\n print(str*int(M))'] | ['Runtime Error', 'Runtime Error', 'Accepted'] | ['s352622396', 's683523271', 's791930102'] | [2940.0, 2940.0, 2940.0] | [17.0, 17.0, 17.0] | [115, 100, 100] |
p02790 | u982749462 | 2,000 | 1,048,576 | Given are 1-digit positive integers a and b. Consider these two strings: the concatenation of b copies of the digit a, and the concatenation of a copies of the digit b. Which of these is lexicographically smaller? | ['b, c = map(int, input().split())\nif b >= c:\n print(str(b) * c)\nelse:\n print(str(c) * b)', 'b, c = map(int, input().split())\nif b >= c:\n print(str(c) * b)\nelse:\n print(str(b) * c)'] | ['Wrong Answer', 'Accepted'] | ['s213980046', 's920107584'] | [2940.0, 2940.0] | [18.0, 17.0] | [89, 89] |
p02790 | u986237475 | 2,000 | 1,048,576 | Given are 1-digit positive integers a and b. Consider these two strings: the concatenation of b copies of the digit a, and the concatenation of a copies of the digit b. Which of these is lexicographically smaller? | ['a, b = [int(x) for x in input().split()]\n\nas = str(a) * b\nbs = str(b) * a\n\nprint(as if as < b else bs)', 'a, b = [int(x) for x in input().split()]\n\nAs = str(a) * b\nBs = str(b) * a\n\nprint(min(As, Bs))'] | ['Runtime Error', 'Accepted'] | ['s921714622', 's695950697'] | [2940.0, 2940.0] | [17.0, 17.0] | [102, 93] |
p02790 | u994988729 | 2,000 | 1,048,576 | Given are 1-digit positive integers a and b. Consider these two strings: the concatenation of b copies of the digit a, and the concatenation of a copies of the digit b. Which of these is lexicographically smaller? | ['a,b=map(int,input().split())\n\nif a>b:\n print("b"*a)\nelse:\n print("a"*b)\n', 'a, b = map(int, input().split())\n\nif a < b:\n ans = str(a) * b\nelse:\n ans = str(b) * a\nprint(ans)\n'] | ['Wrong Answer', 'Accepted'] | ['s537422914', 's473925689'] | [2940.0, 2940.0] | [17.0, 17.0] | [74, 103] |
p02790 | u998008108 | 2,000 | 1,048,576 | Given are 1-digit positive integers a and b. Consider these two strings: the concatenation of b copies of the digit a, and the concatenation of a copies of the digit b. Which of these is lexicographically smaller? | ['a,b=map(int,input().split())\nzz=str(a)*int(b)\nyy=str(b)*int(a)\nprint(zz)\nprint(yy)\nif(zz<yy):\n print(zz)\nelse:\n print(yy)', 'n,m=map(int,input().split())\nif(n<m):\n print(str(n)*int(m))\nelse:\n print(str(m)*int(n))\n'] | ['Wrong Answer', 'Accepted'] | ['s380655631', 's729614280'] | [2940.0, 2940.0] | [18.0, 17.0] | [123, 90] |
p02790 | u998867748 | 2,000 | 1,048,576 | Given are 1-digit positive integers a and b. Consider these two strings: the concatenation of b copies of the digit a, and the concatenation of a copies of the digit b. Which of these is lexicographically smaller? | ['a,b = input().split()\n\nA = a*int(b)\nB = b*int(a)\n\nprint(min(int(A),int(B)))\n', 'a,b = input().split()\n\nA = a*int(b)\nB = b*int(a)\n\nprint(str(max(int(A),int(B))))\n'] | ['Wrong Answer', 'Accepted'] | ['s587453951', 's148751986'] | [2940.0, 2940.0] | [18.0, 17.0] | [76, 81] |
p02792 | u007808656 | 2,000 | 1,048,576 | Given is a positive integer N. Find the number of pairs (A, B) of positive integers not greater than N that satisfy the following condition: * When A and B are written in base ten without leading zeros, the last digit of A is equal to the first digit of B, and the first digit of A is equal to the last digit of B. | ['\ndef cnt(b,e,n_str):\n res=0\n for i in range(int(n_str)+1):\n if int(str(i)[0])==b and i%10==e:\n res+=1\n return res\ndef sol():\n n_str=input()\n return sum(cnt(b,e,n_str)*cnt(e,b,n_str) \n for b,e in product(range(1,10),repeat=2))\n\nprint(sol()) \n', 'from itertools import product\nfrom functools import reduce\nimport operator\ndef prod(iterable):\n return reduce(operator.mul, iterable, 1)\ndef cnt_samelen(b,e,n_str):\n n0=int(n_str[0])\n if b>n0 or len(n_str)==1:\n return 0\n if b<n0:\n return b*int(10**(len(n_str)-2))\n \n return (int(n_str[1:-1])+1 if len(n_str)>2 else 1)-(1 if e>int(n_str[-1]) else 0)\ndef cnt(b,e,n_str):\n res=0\n l=len(n_str)\n if b==e and int(n_str)>=b:\n res+=1\n for i in range(l-2):\n res+=10**(i)\n res+=cnt_samelen(b,e,n_str)\n return res\ndef sol():\n n_str=input()\n return sum(cnt(b,e,n_str)*cnt(e,b,n_str) \n for b,e in product(range(1,10),repeat=2))\n\nprint(sol()) '] | ['Runtime Error', 'Accepted'] | ['s804838403', 's254101695'] | [3060.0, 3572.0] | [17.0, 23.0] | [267, 670] |
p02792 | u014779044 | 2,000 | 1,048,576 | Given is a positive integer N. Find the number of pairs (A, B) of positive integers not greater than N that satisfy the following condition: * When A and B are written in base ten without leading zeros, the last digit of A is equal to the first digit of B, and the first digit of A is equal to the last digit of B. | ['import numpy as np\n\n\n#N = int(input())\nN =200000\n\ncountup = np.zeros(100, dtype=int)\n\nfor x in range(1,N+1):\n sx = str(x)\n A = int(sx[0])\n B = int(sx[-1])\n countup[A*10+B] += 1\n\nans = 0\nfor x in range(1,N+1):\n sx = str(x)\n A = int(sx[0])\n B = int(sx[-1])\n ans += countup[B*10+A]\n\nprint(ans)\n', 'import numpy as np\n\n\nN = int(input())\n\ncountup = np.zeros(100, dtype=int)\n\nfor x in range(1,N+1):\n sx = str(x)\n A = int(sx[0])\n B = int(sx[-1])\n countup[A*10+B] += 1\n\nans = 0\nfor x in range(1,N+1):\n sx = str(x)\n A = int(sx[0])\n B = int(sx[-1])\n ans += countup[B*10+A]\n\nprint(ans)\n'] | ['Wrong Answer', 'Accepted'] | ['s177103781', 's196123627'] | [21628.0, 12504.0] | [1004.0, 925.0] | [322, 311] |
p02792 | u018990794 | 2,000 | 1,048,576 | Given is a positive integer N. Find the number of pairs (A, B) of positive integers not greater than N that satisfy the following condition: * When A and B are written in base ten without leading zeros, the last digit of A is equal to the first digit of B, and the first digit of A is equal to the last digit of B. | ['N = int(input())\nmax_N = 2 * 10 ** 5\n\nd = [[0] * 10 for _ in range(10)]\nfor i in range(1,int(n)):\n k = str(i)\n d[int(k[0])][int(k[-1])] += 1\n\nans = 0\nfor i in range(10):\n for j in range(10):\n ans += d[i][j] * d[j][i]\nprint(ans)', 'n = input()\n \nd = [ [0] * 10 for _ in range(10) ]\nfor i in range( 1, int( n ) + 1 ):\n k = str(i)\n d[ int( k[ 0 ])][ int( k[ -1 ])] += 1\n\nans = 0\nfor i in range(10):\n for j in range(10):\n ans += d[i][j] * d[j][i]\nprint(ans)'] | ['Runtime Error', 'Accepted'] | ['s995607697', 's898232395'] | [3064.0, 3064.0] | [17.0, 184.0] | [239, 228] |
p02792 | u021019433 | 2,000 | 1,048,576 | Given is a positive integer N. Find the number of pairs (A, B) of positive integers not greater than N that satisfy the following condition: * When A and B are written in base ten without leading zeros, the last digit of A is equal to the first digit of B, and the first digit of A is equal to the last digit of B. | ['r = range(1, 10)\nn = int(input())\na = [None] + [[0] * 10 for _ in r]\nfor i in r:\n if i <= n:\n a[i][j] += 1\nfor i in r:\n for j in r:\n k = 1\n while 10 * k * i + j <= n:\n a[i][j] += min(k, (n - j) // 10 - k * i + 1)\n k *= 10\nprint(sum(a[i][j] * a[j][i] for i in r for j in r))\n', 'n = int(input())\nr = range(1, 10)\na = [[0] * 9 for _ in r]\nfor i in r:\n if i <= n:\n a[i - 1][i - 1] += 1\nfor i in r:\n for j in r:\n k = 1\n while 10 * k * i + j <= n:\n a[i - 1][j - 1] += min(k, (n - 10 * k * i + j) // 10)\n k *= 10\nprint(sum(a[i][j] * a[j][i] for i in range(9) for j in range(9)))\n', 'n = int(input())\nr = range(1, 10)\na = [[0] * 9 for _ in r]\nfor i in r:\n if i <= n:\n a[i - 1][i - 1] += 1\nfor i in r:\n for j in r:\n k = 1\n while 10 * k * i + j <= n:\n a[i - 1][j - 1] += min(k, (n + 1 - j) // 10 - k * i)\n k *= 10\nprint(sum(a[i][j] * a[j][i] for i in range(9) for j in range(9)))\n', 'n = int(input())\nr = range(1, min(9, n) + 1)\na = [None]\nfor i in r:\n a.append([None])\n for j in r:\n a[i].append(i == j)\n k = 1\n while 10 * k * i + j <= n:\n a[i][j] += min(k, (n - j) // 10 - k * i + 1)\n k *= 10\nprint(sum(a[i][j] * a[j][i] for i in r for j in r))'] | ['Runtime Error', 'Wrong Answer', 'Wrong Answer', 'Accepted'] | ['s130883719', 's321236693', 's368220232', 's405572590'] | [3064.0, 3064.0, 3060.0, 3188.0] | [17.0, 18.0, 17.0, 19.0] | [295, 316, 315, 282] |
p02792 | u025241948 | 2,000 | 1,048,576 | Given is a positive integer N. Find the number of pairs (A, B) of positive integers not greater than N that satisfy the following condition: * When A and B are written in base ten without leading zeros, the last digit of A is equal to the first digit of B, and the first digit of A is equal to the last digit of B. | ['from functools import reduce\nimport fractions\n\ndef lcm_base(x, y):\n return (x * y) // fractions.gcd(x, y)\n\ndef lcm_list(numbers):\n return reduce(lcm_base, numbers, 1)\n\n\nN=int(input())\na=list(map(int,input().split()))\n\nkobai=lcm_list(a)\n\nsumN=0\nfor i in a:\n sumN+=int(kobai/i)\n \nsumN=int(sumN%(1e9+7))\n\nprint(sumN)', 'N=int(input())\n\na_list= [[0 for i in range(10)] for j in range(10)]\nb_list= [[0 for i in range(10)] for j in range(10)]\nfor i in range(N+1):\n a=int(str(i)[0])\n b=int(str(i)[-1])\n a_list[a][b]+=1\n b_list[b][a]+=1\n\ncount=0\nfor i in range(1,10):\n for j in range(1,10):\n count+=a_list[i][j]*b_list[i][j]\n\nprint(count)'] | ['Runtime Error', 'Accepted'] | ['s206234977', 's682570881'] | [5128.0, 3064.0] | [36.0, 254.0] | [324, 335] |
p02792 | u036340997 | 2,000 | 1,048,576 | Given is a positive integer N. Find the number of pairs (A, B) of positive integers not greater than N that satisfy the following condition: * When A and B are written in base ten without leading zeros, the last digit of A is equal to the first digit of B, and the first digit of A is equal to the last digit of B. | ['n = int(input())\np = [[0 for _ in range(10)] for _2 in range(10)]\nans = 0\nfor i in range(1, n+1):\n l = int(str(i)[0])\n r = int(str(i)[-1])\n p[l][r] += 1\n ans += p[r][l]\nprint(ans)', 'n = int(input())\np = [[0 for _ in range(10)] for _2 in range(10)]\nans = 0\nfor i in range(1, n+1):\n l = int(str(i)[0])\n r = int(str(i)[-1])\n ans += 2 * p[r][l]\n p[l][r] += 1\n if l == r:\n ans += 1\nprint(ans)'] | ['Wrong Answer', 'Accepted'] | ['s516648372', 's233368155'] | [3060.0, 3064.0] | [282.0, 288.0] | [183, 213] |
p02792 | u046158516 | 2,000 | 1,048,576 | Given is a positive integer N. Find the number of pairs (A, B) of positive integers not greater than N that satisfy the following condition: * When A and B are written in base ten without leading zeros, the last digit of A is equal to the first digit of B, and the first digit of A is equal to the last digit of B. | ['n=int(input())\nans=0\npower=0\nfor i in range(1,n+1):\n if i>=10**(power+1):\n power+=1\n a=i%10\n if a==0:\n continue\n b=(i-i%(10**power))//(10**power)\n if a==b:\n ans+=1\n if power>0:\n ans+=2\n r=max(0,((i-(b*(10**power))-a)//10))\n ans+=2*r\n for j in range(0,power-1):\n ans+=2*(10**j)\n elif a<b:\n for j in range(0,power-1):\n ans+=2*(10**j)\n else:\n for j in range(0,power):\n ans+=2*(10**j)\nprint(ans)', 'n=int(input())\nans=0\ncurrentpower=0\nfor i in range(1,n+1):\n if i>=10**(currentpower+1):\n currentpower+=1\n b=i%10\n a=(i-i%(10**currentpower))//(10**currentpower)\n if b==0:\n continue\n if a==b:\n ans+=1\n if currentpower>0:\n ans+=2\n r=max(0,((i-(a*(10**currentpower))-b)//10))\n ans+=2*r\n for j in range(0,currentpower-1):\n ans+=2*(10**j)\n elif a<b:\n for j in range(0,currentpower-1):\n ans+=2*(10**j)\n else:\n for j in range(0,currentpower):\n ans+=2*(10**j)\nprint(ans)\n'] | ['Wrong Answer', 'Accepted'] | ['s969676952', 's115515893'] | [3064.0, 3064.0] | [553.0, 546.0] | [445, 516] |
p02792 | u046187684 | 2,000 | 1,048,576 | Given is a positive integer N. Find the number of pairs (A, B) of positive integers not greater than N that satisfy the following condition: * When A and B are written in base ten without leading zeros, the last digit of A is equal to the first digit of B, and the first digit of A is equal to the last digit of B. | ["from itertools import product\n\n\ndef solve(string):\n l = len(string)\n *s, = map(int, string)\n print(s, l)\n t = [[0] * 10 for _ in range(10)]\n for a, b in product(range(1, 10), repeat=2):\n for i in range(l):\n if i < l - 1:\n if i == 0 and a == b:\n t[a][b] += 1\n elif i > 0:\n t[a][b] += 10**(i - 1)\n else:\n if a < s[0]:\n t[a][b] += 10**(i - 1)\n elif a == s[0]:\n tmp = 1\n for _s in s[1:-1]:\n tmp *= _s + 1\n t[a][b] += tmp - (b > s[-1])\n return str(sum(t[i][j] * t[j][i] for i, j in product(range(10), repeat=2)))\n\n\nif __name__ == '__main__':\n import sys\n print(solve(sys.stdin.read().strip()))\n", 'from itertools import product\n\n\ndef solve(string):\n d = len(string)\n if d == 1:\n return string\n s0, ss, sn = int(string[0]), int(string[1:-1] or 0), int(string[-1])\n t = [[0] * 10] + [[int("1" * (d - 2) or 0)] * 10 for _ in range(9)]\n for i in range(1, 10):\n t[i][i] += 1\n for i, j in product(range(1, s0), range(10)):\n t[i][j] += 10**(d - 2)\n for j in range(10):\n t[s0][j] += ss + 1 if j <= sn else ss\n return str(sum(t[i][j] * t[j][i] for i, j in product(range(1, 10), repeat=2)))\n\n\nif __name__ == \'__main__\':\n import sys\n print(solve(sys.stdin.read().strip()))\n'] | ['Wrong Answer', 'Accepted'] | ['s969741090', 's379837174'] | [3188.0, 3064.0] | [18.0, 18.0] | [839, 622] |
p02792 | u050708958 | 2,000 | 1,048,576 | Given is a positive integer N. Find the number of pairs (A, B) of positive integers not greater than N that satisfy the following condition: * When A and B are written in base ten without leading zeros, the last digit of A is equal to the first digit of B, and the first digit of A is equal to the last digit of B. | ["n = int(input())\nc = 0\n\ndef count(i):\n h = str(i)\n s = lambda j, k, l: int('{}{}{}'.format(j, k, j))\n if len(set(h)) == 1:\n h = h[0]\n c = 1\n s = h * 1\n while int(s) <= n:\n c += 1\n s = h * c\n return c - 1\n if h[-1] == '0' or s(h[-1], '', h[0]) > n:\n return 0\n d = 1\n while s(h[-1], '0' * d, h[0]) <= n:\n d += 1\n for i in range(10):\n if s(h[-1], i, h[0]) > n:\n break\n return 11 * (d - 1) + 1\n\ns = 0\nfor i in range(1, n+1):\n c = count(i)\n print(f'{i} = {c}')\n s += c\nprint(s)\n", "n = int(input())\nd = {}\n\nfor a in range(1, n+1):\n a = str(a)\n f, l = a[0], a[-1]\n if '0' in [f, l]:\n continue\n if (f, l) in d:\n d[(f, l)] += 1\n else:\n d[(f, l)] = 1\n\nans = 0\nfor b in range(1, n+1):\n b = str(b)\n f, l = b[-1], b[0]\n if (f, l) in d:\n ans += d[(f, l)]\nprint(ans)"] | ['Runtime Error', 'Accepted'] | ['s463288124', 's643554962'] | [3064.0, 3064.0] | [18.0, 362.0] | [595, 327] |
p02792 | u060694763 | 2,000 | 1,048,576 | Given is a positive integer N. Find the number of pairs (A, B) of positive integers not greater than N that satisfy the following condition: * When A and B are written in base ten without leading zeros, the last digit of A is equal to the first digit of B, and the first digit of A is equal to the last digit of B. | ['N = int(input())\n\nprint([0 for i in range(9)])\n ', 'N = int(input())\n\nnmap = [[0 for i in range(10)] for j in range(10)]\n\nanswer = 0\nfor n in range(1, N + 1):\n first = int(str(n)[0])\n last = int(str(n)[-1])\n nmap[first][last] += 1\n\nfor n in range(1, N + 1):\n _last = int(str(n)[0])\n _first = int(str(n)[-1])\n answer += nmap[_first][_last]\n \nprint(answer)\n'] | ['Wrong Answer', 'Accepted'] | ['s333297261', 's460683289'] | [2940.0, 3064.0] | [18.0, 450.0] | [49, 310] |
p02792 | u062189367 | 2,000 | 1,048,576 | Given is a positive integer N. Find the number of pairs (A, B) of positive integers not greater than N that satisfy the following condition: * When A and B are written in base ten without leading zeros, the last digit of A is equal to the first digit of B, and the first digit of A is equal to the last digit of B. | ["N = int(input())\n\ncnt=0\nfor i in range(1,N+1):\n new = [int(d) for d in str(i)]\n print(new)\n sento=new[0]\n matu=new[-1]\n keta=len(new)\n\n if matu!='0':\n new[0]=matu\n new[-1]=sento\n comb=''.join(new)\n if matu==sento:\n cnt+=max(0,len(new)-1)\n elif comb>N:\n for j in range(0,keta-2):\n cnt+=9**j\n elif comb<N:\n for j in range(0,keta-1):\n cnt+=9**j\n\n\n\n\n\n\n\nprint(cnt)\n", 'N = int(input())\n\nA = [list(0 for i in range(9)) for _ in range(9)]\n\nfor i in range(1,N+1):\n new = [int(d) for d in str(i)]\n if new[-1]!=0:\n A[new[0]-1][new[-1]-1]+=1\n\ncnt=0\nfor i in range(9):\n for j in range(9):\n cnt+=A[i][j]*A[j][i]\n\nprint(cnt)\n'] | ['Runtime Error', 'Accepted'] | ['s094262162', 's943354350'] | [3064.0, 3064.0] | [17.0, 389.0] | [483, 271] |
p02792 | u079427319 | 2,000 | 1,048,576 | Given is a positive integer N. Find the number of pairs (A, B) of positive integers not greater than N that satisfy the following condition: * When A and B are written in base ten without leading zeros, the last digit of A is equal to the first digit of B, and the first digit of A is equal to the last digit of B. | ["n = int(input())\nd = [[0] * 10 for _ in range(10)]\n\nfor i in range(1, n + 1):\n s = str(i)\n if s[-1] == '0':\n continue\n d[int(s[0])][int(s[-1])] += 1\n\nresult = 0\nfor i in range(1, 10):\n for j in range(1, 10):\n result = d[i][j] * d[j][i]\nprint(result)\n", "n = int(input())\nd = [[0] * 10 for _ in range(10)]\n\nfor i in range(1, n + 1):\n s = str(i)\n if s[-1] == '0':\n continue\n d[int(s[0])][int(s[-1])] += 1\n\nresult = 0\nfor i in range(1, 10):\n for j in range(1, 10):\n result += d[i][j] * d[j][i]\nprint(result)\n"] | ['Wrong Answer', 'Accepted'] | ['s854907430', 's357537852'] | [3060.0, 3060.0] | [192.0, 196.0] | [260, 261] |
p02792 | u088078693 | 2,000 | 1,048,576 | Given is a positive integer N. Find the number of pairs (A, B) of positive integers not greater than N that satisfy the following condition: * When A and B are written in base ten without leading zeros, the last digit of A is equal to the first digit of B, and the first digit of A is equal to the last digit of B. | ['n=int(input())\na=0\nfor i in range(1,n+1):\n for j in range(i,n+1):\n if str(i)[0]==str(j)[-1] and str(j)[0]==str(i)[-1]:\n a+=1\nprint(a)', 'n=int(input())\na=0\nfor i in range(1,n+1):\n for j in range(i,n+1):\n if str(i)[0]==str(j)[-1] and str(j)[0]==str(i)[-1]:\n a++\nprint(a)', 'n=int(input())\nt=[[0]*10 for _ in range(10)]\nfor i in range(1,n+1):\n t[int(str(i)[0])][i%10]+=1\na=0\nfor i in range(10):\n for j in range(10):\n a+=t[i][j]*t[j][i]\nprint(a)'] | ['Wrong Answer', 'Runtime Error', 'Accepted'] | ['s898985200', 's937435173', 's830559211'] | [2940.0, 2940.0, 3060.0] | [2104.0, 17.0, 162.0] | [142, 141, 174] |
p02792 | u089142196 | 2,000 | 1,048,576 | Given is a positive integer N. Find the number of pairs (A, B) of positive integers not greater than N that satisfy the following condition: * When A and B are written in base ten without leading zeros, the last digit of A is equal to the first digit of B, and the first digit of A is equal to the last digit of B. | ['N=int(input())\nK=[[0 for i in range(9)] for j in range(9)]\n\nfor i in range(1,N+1):\n if int(str(i)[-1])==0:\n pass\n else:\n h=int(str(i)[0])\n t=int(str(i)[-1])\n K[h-1][t-1] += 1\n \nans=0\nfor i in range(9):\n for j in range(i+1):\n if i!=j:\n ans += 2*K[i][j]* K[j][i]\n print(i+1,j+1)\n else:\n ans += K[i][j]**2\n #print(i,j,K[i][j],K[j][i],K[i][j]*K[j][i])\n \nprint(ans)', 'N=int(input())\nK=[[0 for i in range(9)] for j in range(9)]\n\nfor i in range(1,N+1):\n if int(str(i)[-1])==0:\n pass\n else:\n h=int(str(i)[0])\n t=int(str(i)[-1])\n K[h-1][t-1] += 1\n\n\nans=0\nfor i in range(9):\n for j in range(i+1):\n if i==j:\n ans += K[i][j]* K[j][i]\n else:\n ans += 2*K[i][j]* K[j][i]\n #print(i,j,K[i][j],K[j][i],K[i][j]*K[j][i])\n \nprint(ans)'] | ['Wrong Answer', 'Accepted'] | ['s540813795', 's890243407'] | [3064.0, 3064.0] | [323.0, 332.0] | [405, 391] |
p02792 | u104005543 | 2,000 | 1,048,576 | Given is a positive integer N. Find the number of pairs (A, B) of positive integers not greater than N that satisfy the following condition: * When A and B are written in base ten without leading zeros, the last digit of A is equal to the first digit of B, and the first digit of A is equal to the last digit of B. | ['n = int(input())\nc = [[0 for i in range(10)] for j in range(10)]\n\nfor i in range(n):\n x = str(n + 1)\n c[int(x[0])][int(x[-1])] += 1\nans = 0\nfor i in range(10):\n for j in range(10):\n ans += c[i][j] * c[j][i]\nprint(ans)', 'n = int(input())\nc = [[0 for i in range(10)] for j in range(10)]\n\nfor i in range(n):\n x = str(n + 1)\n c[int(x[0])][int(x[-1])] += 1\nans = 0\nfor i in range(n):\n for j in range(n):\n ans += c[i][j] * c[j][i]\nprint(ans)', 'n = int(input())\nc = [[0 for i in range(10)] for j in range(10)]\n\nfor i in range(n):\n x = str(i + 1)\n c[int(x[0])][int(x[-1])] += 1\nans = 0\nfor i in range(10):\n for j in range(10):\n ans += c[i][j] * c[j][i]\nprint(ans)'] | ['Wrong Answer', 'Runtime Error', 'Accepted'] | ['s343348807', 's441207117', 's998977344'] | [3060.0, 3064.0, 3064.0] | [193.0, 193.0, 198.0] | [232, 230, 232] |
p02792 | u106778233 | 2,000 | 1,048,576 | Given is a positive integer N. Find the number of pairs (A, B) of positive integers not greater than N that satisfy the following condition: * When A and B are written in base ten without leading zeros, the last digit of A is equal to the first digit of B, and the first digit of A is equal to the last digit of B. | ["def main(n):\n cnt=0\n for i in range(1,n+1):\n i_list=list(str(i))\n for j in range(1,n+1):\n j_list=list(str(j))\n if i_list[1]==j_list[-1] and i_list[-1]==j_list[1]:\n cnt+=1\n print(cnt) \n \n\n \nif __name__=='__main__':\n main(int(input()))", "def main(n):\n c=[[0]*10 for _ in range(10)]\n for k in range(1,n+1):\n n=str(k)\n i = int(n[0])\n j = int(n[-1])\n c[i][j] += 1\n ans =0\n for i in range(10):\n ans+=sum(c[i])\n print(ans)\n \nif __name__=='__main__':\n main(int(input()))", "def main(n):\n c=[[0]*10 for _ in range(10)]\n for k in range(1,n+1):\n n=str(k)\n i = int(n[0])\n j = int(n[-1])\n c[i][j] += 1\n ans =0\n for i in range(10):\n for j in range(10):\n ans+=c[i][j]*c[j][i]\n print(ans)\n \nif __name__=='__main__':\n main(int(input()))"] | ['Runtime Error', 'Wrong Answer', 'Accepted'] | ['s108715337', 's698335740', 's588102482'] | [3064.0, 3064.0, 3064.0] | [17.0, 160.0, 171.0] | [313, 291, 329] |
p02792 | u115110170 | 2,000 | 1,048,576 | Given is a positive integer N. Find the number of pairs (A, B) of positive integers not greater than N that satisfy the following condition: * When A and B are written in base ten without leading zeros, the last digit of A is equal to the first digit of B, and the first digit of A is equal to the last digit of B. | ['n= int(input())\n\nans = 0\nfor i in range(1,n+1):\n if str(i)[0]==str(i)[-1]:\n ans += 1\n \nprint(ans)', 'n= int(input())\n\nmat = [[0]*(10)]*(10)\n\nfor i in range(1,n+1):\n a,b = str(i)[0],str(i)[-1]:\n mat[a][b] += 1\n\nans = 0\nfor i in range(1,10):\n for j in range(1,10):\n ans += mat[i][j]*mat[j][i]\nprint(ans)\n', 'n= int(input())\n\nmat = [ [0]*10 for i in range(10)]\n\nfor i in range(1,n+1):\n a,b = int(str(i)[0]), i%10\n mat[a][b] += 1\n\nans = 0\nfor i in range(1,10):\n for j in range(1,10):\n ans += mat[i][j]*mat[j][i]\n\nprint(ans)\n\n'] | ['Wrong Answer', 'Runtime Error', 'Accepted'] | ['s464507625', 's486693388', 's935559147'] | [2940.0, 2940.0, 3060.0] | [126.0, 18.0, 163.0] | [104, 207, 221] |
p02792 | u116233709 | 2,000 | 1,048,576 | Given is a positive integer N. Find the number of pairs (A, B) of positive integers not greater than N that satisfy the following condition: * When A and B are written in base ten without leading zeros, the last digit of A is equal to the first digit of B, and the first digit of A is equal to the last digit of B. | ['n=str(input())\nH=n[0]\nT=n[-1]\nketa=len(n)\nn=int(n)\nans=0\nif keta==1:\n print(1)\n exit()\nfor i in range(1,n+1):\n s=str(i)\n h=s[0]\n t=s[-1]\n if h!="0" and t!="0":\n ans+=(10**(keta-2)-1)//9\n if h==t:\n ans+=1\n if int(t)<=int(H):\n ans+=(10**(keta-2))*(int(H)-int(t))\n ans+=max(0,(n-10**(keta-1)*int(H)-int(h))//10)\n \nprint(ans)', 'n=str(input())\nH=n[0]\nT=n[-1]\nketa=len(n)\nn=int(n)\nans=0\nif keta==1:\n print(1)\n exit()\nelif keta==2:\n for i in range(1,n+1):\n s=str(i)\n for j in range(1,n+1):\n S=str(j)\n if S[0]==s[-1] and S[-1]==s[0]:\n ans+=1 \nelse:\n for i in range(1,n+1):\n s=str(i)\n h=s[0]\n t=s[-1]\n if h!="0" and t!="0":\n ans+=(10**(keta-2)-1)//9\n if h==t:\n ans+=1\n if int(t)<int(H):\n ans+=(10**(keta-2))*(int(H)-int(t))\n elif int(t)==int(H):\n ans+=max(0,((n-10**(keta-1)*int(H)-int(h))//10)+1)\n \nprint(ans)\n\n\n'] | ['Wrong Answer', 'Accepted'] | ['s831702482', 's252163959'] | [3064.0, 3064.0] | [348.0, 381.0] | [396, 674] |
p02792 | u130900604 | 2,000 | 1,048,576 | Given is a positive integer N. Find the number of pairs (A, B) of positive integers not greater than N that satisfy the following condition: * When A and B are written in base ten without leading zeros, the last digit of A is equal to the first digit of B, and the first digit of A is equal to the last digit of B. | ['def main(n):\n l=[i for i in range(1,n+1)]\n ans=0\n for i in l:\n for j in l: \n if str(i)[0]==str(j)[-1] and str(j)[0]==str(i)[-1]:\n # print(i,j)\n ans+=1\n \n print(ans)\nn=init(input())\nmain(n)', 'n=int(input())\ncnt=[[0 for i in range(10)] for j in range(10)]\n\nfor i in range(1,n+1):\n s=str(i)\n head=int(s[0])\n tail=int(s[-1])\n cnt[head][tail]+=1\n\nans=0\nfor h in range(0,10):\n for t in range(0,10):\n ans+=cnt[h][t]*cnt[t][h]\nprint(ans)'] | ['Runtime Error', 'Accepted'] | ['s003107716', 's041816618'] | [2940.0, 3064.0] | [17.0, 190.0] | [266, 246] |
p02792 | u137542041 | 2,000 | 1,048,576 | Given is a positive integer N. Find the number of pairs (A, B) of positive integers not greater than N that satisfy the following condition: * When A and B are written in base ten without leading zeros, the last digit of A is equal to the first digit of B, and the first digit of A is equal to the last digit of B. | ['from collections import defaultdict\n\nd = defaultdict(int)\n\nfor n in range(N):\n n = str(n)\n\n a = n[0]\n b = n[-1]\n\n d[(a, b)] += 1\n\n\ns = 0\nfor i in range(1, 10):\n for j in range(10):\n\n s += d[(str(j), str(i))] * d[(str(i), str(j))]\n\nprint(s)\n\n', 'from collections import defaultdict\n\nd = defaultdict(int)\nN = int(input())\n\nfor n in range(1, N + 1):\n n = str(n)\n\n a = n[0]\n b = n[-1]\n\n d[(a, b)] += 1\n\n\ns = 0\nfor i in range(10):\n for j in range(10):\n\n s += d[(str(j), str(i))] * d[(str(i), str(j))]\n\nprint(s)\n'] | ['Runtime Error', 'Accepted'] | ['s563802707', 's190918618'] | [3316.0, 3316.0] | [20.0, 147.0] | [263, 283] |
p02792 | u151785909 | 2,000 | 1,048,576 | Given is a positive integer N. Find the number of pairs (A, B) of positive integers not greater than N that satisfy the following condition: * When A and B are written in base ten without leading zeros, the last digit of A is equal to the first digit of B, and the first digit of A is equal to the last digit of B. | ["n = int(input())\ns0=list(str(n))\nans=0\n\nif len(s0)==1:\n print(n)\n exit()\n\nfor i in range(1,n+1):\n s1=list(str(i))\n if s1[-1]=='0':\n continue\n if s1[0]==s1[-1]:\n ans+=1\n for j in range(2,len(s0)):\n ans+=10**(j-2)\n if int(s0[0])>int(s1[-1]):\n ans+=10**(len(s0)-2)\n elif s0[0]==s1[-1]:\n ans+=int(''.join(s0[1:len(s0)-1]))+1\n if int(s0[-1])<int(s1[0]):\n ans-=1\nprint(ans)\n", "n = int(input())\ns0=list(str(n))\nans=0\n\nif len(s0)==1:\n print(n)\n exit()\n\nif len(s0)==2:\n for i in range(1,n+1):\n s1=list(str(i))\n if s1[-1]=='0':\n continue\n if s1[0]==s1[-1]:\n ans+=1\n if int(s1[-1])*10+int(s1[0])<=n:\n ans+=1\n print(ans)\n exit()\n\nfor i in range(1,n+1):\n s1=list(str(i))\n if s1[-1]=='0':\n continue\n if s1[0]==s1[-1]:\n ans+=1\n for j in range(2,len(s0)):\n ans+=10**(j-2)\n if int(s0[0])>int(s1[-1]):\n ans+=10**(len(s0)-2)\n elif s0[0]==s1[-1]:\n ans+=int(''.join(s0[1:len(s0)-1]))+1\n if int(s0[-1])<int(s1[0]):\n ans-=1\nprint(ans)\n"] | ['Runtime Error', 'Accepted'] | ['s048551017', 's321337728'] | [3064.0, 3064.0] | [636.0, 640.0] | [610, 853] |
p02792 | u155687575 | 2,000 | 1,048,576 | Given is a positive integer N. Find the number of pairs (A, B) of positive integers not greater than N that satisfy the following condition: * When A and B are written in base ten without leading zeros, the last digit of A is equal to the first digit of B, and the first digit of A is equal to the last digit of B. | ['import numpy as np\nn = int(input())\nketa = len(str(n))\nfield = np.array([[0 for _ in range(0)] for _ in range(9)])\ndef cmb(n, r):\n if n - r < r: r = n - r\n if r == 0: return 1\n if r == 1: return n\n\n numerator = [n - r + k + 1 for k in range(r)]\n denominator = [k + 1 for k in range(r)]\n\n for p in range(2,r+1):\n pivot = denominator[p - 1]\n if pivot > 1:\n offset = (n - r) % p\n for k in range(p-1,r,p):\n numerator[k - offset] /= pivot\n denominator[k] /= pivot\n\n result = 1\n for k in range(r):\n if numerator[k] > 1:\n result *= int(numerator[k])\n\n return result\n\n\nfor k in range(1, n+1):\n i = int(str(k)[0])\n j = int(str(k)[1])\n field[i, j] += 1\ntotal = 0\nfor i in range(9):\n val = field[i,i]\n total += cmb(val+1, 2)\nfor i in range(9):\n for j in range(9):\n if i==j:\n continue\n else:\n val = field[i,j]\n total += 2*cmb(val, 2)\nprint(val)', 'import numpy as np\ndef cmb(n, r):\n if n<r:\n return 0\n if n - r < r: r = n - r\n if r == 0: return 1\n if r == 1: return n\n\n numerator = [n - r + k + 1 for k in range(r)]\n denominator = [k + 1 for k in range(r)]\n\n for p in range(2,r+1):\n pivot = denominator[p - 1]\n if pivot > 1:\n offset = (n - r) % p\n for k in range(p-1,r,p):\n numerator[k - offset] /= pivot\n denominator[k] /= pivot\n\n result = 1\n for k in range(r):\n if numerator[k] > 1:\n result *= int(numerator[k])\n\n return result\n\nn = int(input())\nfield = np.array([[0 for _ in range(9)] for _ in range(9)])\n\nfor i in range(1, n+1):\n stri = str(i)\n mae = int(stri[0])\n ushiro = int(stri[-1])\n if mae != 0 and ushiro != 0:\n field[mae-1, ushiro-1] += 1\n\ntotal = 0\nfor i in range(9):\n val = field[i, i]\n #print(val)\n #print(cmb(val, 2))\n total += val\n total += 2*cmb(val, 2)\n\nfor i in range(9):\n for j in range(i, 9):\n if i==j:\n continue\n else:\n total += 2*field[i,j]*field[j,i]\n#print(field)\nprint(total)'] | ['Runtime Error', 'Accepted'] | ['s604935999', 's987133315'] | [12484.0, 12424.0] | [158.0, 665.0] | [1008, 1146] |
p02792 | u183383816 | 2,000 | 1,048,576 | Given is a positive integer N. Find the number of pairs (A, B) of positive integers not greater than N that satisfy the following condition: * When A and B are written in base ten without leading zeros, the last digit of A is equal to the first digit of B, and the first digit of A is equal to the last digit of B. | ['import math,sys\nfrom collections import Counter, defaultdict, deque\nfrom sys import stdin, stdout\ninput = stdin.readline\nlili=lambda:list(map(int,sys.stdin.readlines()))\nli = lambda:list(map(int,input().split()))\n\nI=lambda:int(input())\nS=lambda:input().strip()\nmod = 1000000007\n\na=[]\nn=I()\nfor i in range(1,10):\n k=[]\n for j in range(1,10):\n k.append(0)\n a.append(k)\n \n\nfor i in range(1,n+1):\n if(i%10==0):\n continue\n k=str(i)\n p=int(k[0])-1\n q=int(k[-1])-1\n a[p][q]+=1\nans=0\nfor i in a:\n print(*i)\nfor i in range(0,9):\n for j in range(0,9):\n ans+=a[i][j]*a[j][i]\nprint(ans)\n', 'import math,sys\nfrom collections import Counter, defaultdict, deque\nfrom sys import stdin, stdout\ninput = stdin.readline\nlili=lambda:list(map(int,sys.stdin.readlines()))\nli = lambda:list(map(int,input().split()))\n\nI=lambda:int(input())\nS=lambda:input().strip()\nmod = 1000000007\n\na=[]\nn=I()\nfor i in range(1,10):\n k=[]\n for j in range(1,10):\n k.append(0)\n a.append(k)\n \n\nfor i in range(1,n+1):\n if(i%10==0):\n continue\n k=str(i)\n p=int(k[0])-1\n q=int(k[-1])-1\n a[p][q]+=1\nans=0\n\nfor i in range(0,9):\n for j in range(0,9):\n ans+=a[i][j]*a[j][i]\nprint(ans)\n'] | ['Wrong Answer', 'Accepted'] | ['s630131658', 's645913699'] | [3316.0, 3316.0] | [203.0, 212.0] | [689, 664] |
p02792 | u186838327 | 2,000 | 1,048,576 | Given is a positive integer N. Find the number of pairs (A, B) of positive integers not greater than N that satisfy the following condition: * When A and B are written in base ten without leading zeros, the last digit of A is equal to the first digit of B, and the first digit of A is equal to the last digit of B. | ['n = int(input())\n\nd = [[0]*10 for i in range(10)]\n\nfor i in range(1, n+1):\n i_ = str(i)\n x = int(i_[0])\n y = int(i_[-1])\n d[x][y] += 1\n \nprint(d)\nans = 0\nfor i in range(10):\n for j in range(10):\n ans += d[i][j]*d[j][i]\n \nprint(ans)', 'n = int(input())\n\nL = [[0]*10 for j in range(10)]\n\nfor i in range(1, n+1):\n p = int(str(i)[0])\n s = int(str(i)[-1])\n L[p][s] += 1\n\nans = 0\nfor i in range(1, 10):\n for j in range(1, 10):\n ans += L[i][j] * L[j][i]\nprint(ans)'] | ['Wrong Answer', 'Accepted'] | ['s354416894', 's816672190'] | [3064.0, 3060.0] | [194.0, 260.0] | [243, 241] |
p02792 | u197922478 | 2,000 | 1,048,576 | Given is a positive integer N. Find the number of pairs (A, B) of positive integers not greater than N that satisfy the following condition: * When A and B are written in base ten without leading zeros, the last digit of A is equal to the first digit of B, and the first digit of A is equal to the last digit of B. | ['N = int(input()) + 1\n\nans_list = [[0 for i in range(10)] for j in range(10)]\nprint(ans_list)\n\nfor i in range(N):\n s = str(i)\n ans_list[int(s[0])][int(s[-1])] += 1\n\nans = 0\nfor i in range(0,10):\n for j in range(0,10):\n ans += ans_list[i][j]*ans_list[j][i]\n\nprint(ans)', 'N = int(input()) + 1\n\nans_list = [[0 for i in range(10)] for j in range(10)]\n\nfor i in range(N):\n s = str(i)\n ans_list[int(s[0])][int(s[-1])] += 1\n\nans = 0\nfor i in range(0,10):\n for j in range(0,10):\n ans += ans_list[i][j]*ans_list[j][i]\n\nprint(ans)', 'N = int(input())\n\nans_list = [[0 for i in range(10)] for i in range(10)]\n\nfor i in range(N):\n s = str(i)\n ans_list[int(s[0])][int(s[-1])] += 1\n\nans = 0\nfor i in range(0,10):\n for j in range(0,10):\n ans += ans_list[i][j]*ans_list[j][i]\n\nprint(ans)', 'N = int(input()) + 1\n\nans_list = [[0 for i in range(10)] for j in range(10)]\n\nfor i in range(1,N):\n s = str(i)\n ans_list[int(s[0])][int(s[-1])] += 1\n\nans = 0\nfor i in range(0,10):\n for j in range(0,10):\n ans += ans_list[i][j]*ans_list[j][i]\n\nprint(ans)'] | ['Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Accepted'] | ['s044342936', 's050335410', 's224926391', 's473828691'] | [3064.0, 3064.0, 3064.0, 3064.0] | [190.0, 183.0, 189.0, 183.0] | [282, 266, 262, 268] |
p02792 | u214561383 | 2,000 | 1,048,576 | Given is a positive integer N. Find the number of pairs (A, B) of positive integers not greater than N that satisfy the following condition: * When A and B are written in base ten without leading zeros, the last digit of A is equal to the first digit of B, and the first digit of A is equal to the last digit of B. | ['import math\ndef combinations_count(n, r):\n return math.factorial(n) // (math.factorial(n - r) * math.factorial(r))\nn = int(input())\nans_dict = {}\nans = 0\nfor i in range(1,10):\n for j in range(1,10):\n ans_dict[i*10+j]=0\nfor num in range(1,n+1):\n num_str = str(num)\n i = int(num_str[len(num_str)-1])\n j = int(num_str[0])\n if (i!=0) & (j!=0):\n ans_dict[i*10+j] +=1\nfor key_ in ans_dict.keys():\n if str(key_)[0] == str(key_)[1]:\n ans += ans_dict[key_]**2\n else:\n key_s = key_//10+int(str(key_)[1])*10\n ans += ans_dict[key_] * ans_dict[key_s]\n ans_dict[key_s] = 0\nprint(ans)', 'import math\ndef combinations_count(n, r):\n return math.factorial(n) // (math.factorial(n - r) * math.factorial(r))\nn = int(input())\nans_dict = {}\nans = 0\nfor i in range(1,10):\n for j in range(1,10):\n ans_dict[i*10+j]=0\nfor num in range(1,n+1):\n num_str = str(num)\n i = int(num_str[len(num_str)-1])\n j = int(num_str[0])\n if (i!=0) & (j!=0):\n ans_dict[i*10+j] +=1\nprint(ans_dict)\nfor key_ in ans_dict.keys():\n if str(key_)[0] == str(key_)[1]:\n ans += ans_dict[key_]**2\n else:\n key_s = key_//10+int(str(key_)[1])*10\n ans += ans_dict[key_] * ans_dict[key_s]*2\n ans_dict[key_s] = 0\nprint(ans)', 'import math\ndef combinations_count(n, r):\n return math.factorial(n) // (math.factorial(n - r) * math.factorial(r))\nn = int(input())\nans_dict = {}\nans = 0\nfor i in range(1,10):\n for j in range(1,10):\n ans_dict[i*10+j]=0\nfor num in range(1,n+1):\n num_str = str(num)\n i = int(num_str[len(num_str)-1])\n j = int(num_str[0])\n if (i!=0) & (j!=0):\n ans_dict[i*10+j] +=1\nfor key_ in ans_dict.keys():\n if str(key_)[0] == str(key_)[1]:\n ans += ans_dict[key_]**2\n else:\n key_s = key_//10+int(str(key_)[1])*10\n ans += ans_dict[key_] * ans_dict[key_s]*2\n ans_dict[key_s] = 0\nprint(ans)'] | ['Wrong Answer', 'Wrong Answer', 'Accepted'] | ['s657920150', 's807685096', 's046005813'] | [3064.0, 3064.0, 3064.0] | [255.0, 244.0, 258.0] | [636, 654, 638] |
p02792 | u225493896 | 2,000 | 1,048,576 | Given is a positive integer N. Find the number of pairs (A, B) of positive integers not greater than N that satisfy the following condition: * When A and B are written in base ten without leading zeros, the last digit of A is equal to the first digit of B, and the first digit of A is equal to the last digit of B. | ['import numpy as np\n\nN = int(input())\n\nl = np.zeros((9,9), dtype=np.int)\n\n\nfor k in range(N):\n x = str(k+1)\n i = int(x[0]) - 1\n j = int(x[-1]) - 1\n\n l[i][j] += 1\n\nans = 0\nfor i in range(9):\n for j in range(i,9):\n if i == j:\n n = l[i][j]\n ans += n**2\n else:\n ans += l[i][j] * l[j][i] * 2\n \n\nprint(ans)\n\n\n\n\n\n\n\n', '#import numpy as np\n\nN = int(input())\n\nl = [ [ 0 for i in range(9) ] for j in range(9) ]\n\n\n\nfor k in range(N):\n x = str(k+1)\n i = int(x[0])\n j = int(x[-1])\n\n #print(i,j)\n\n if i == 0 or j == 0:\n continue\n l[i-1][j-1] += 1\n\nans = 0\nfor i in range(9):\n for j in range(i,9):\n if i == j:\n n = l[i][j]\n ans += n**2\n else:\n ans += l[i][j] * l[j][i] * 2\n \n\nprint(ans)\n\n\n\n\n\n\n\n'] | ['Wrong Answer', 'Accepted'] | ['s851978282', 's903645498'] | [12392.0, 3064.0] | [768.0, 227.0] | [427, 534] |
p02792 | u239528020 | 2,000 | 1,048,576 | Given is a positive integer N. Find the number of pairs (A, B) of positive integers not greater than N that satisfy the following condition: * When A and B are written in base ten without leading zeros, the last digit of A is equal to the first digit of B, and the first digit of A is equal to the last digit of B. | ['# E\nimport fractions\nN = int(input()) \nA = list(map(int, input().split()))\n\ndef main():\n value = A[0]\n for i in range(1, N):\n value = value * A[i] // fractions.gcd(value, A[i])\n\n z = 10**9+7\n ans = 0\n for i in A:\n ans += (value//i) % z\n\n print(ans % z)\n\nif __name__=="__main__":\n main()', 'N = int(input()) \n\nans=0\nd = [10*[0] for _ in range(10)]\n\nfor i in range(1, N+1):\n s = str(i)\n if s[0]=="0" or s[-1]=="0":\n continue\n d[int(s[0])][int(s[-1])]+=1\n \nfor i in range(10):\n for j in range(10):\n ans+=d[i][j]*d[j][i]\nprint(ans)\n'] | ['Runtime Error', 'Accepted'] | ['s379700522', 's064049710'] | [5048.0, 3060.0] | [35.0, 222.0] | [321, 267] |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.