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
|
---|---|---|---|---|---|---|---|---|---|---|
p02629 | u728200259 | 2,000 | 1,048,576 | 1000000000000001 dogs suddenly appeared under the roof of Roger's house, all of which he decided to keep. The dogs had been numbered 1 through 1000000000000001, but he gave them new names, as follows: * the dogs numbered 1,2,\cdots,26 were respectively given the names `a`, `b`, ..., `z`; * the dogs numbered 27,28,29,\cdots,701,702 were respectively given the names `aa`, `ab`, `ac`, ..., `zy`, `zz`; * the dogs numbered 703,704,705,\cdots,18277,18278 were respectively given the names `aaa`, `aab`, `aac`, ..., `zzy`, `zzz`; * the dogs numbered 18279,18280,18281,\cdots,475253,475254 were respectively given the names `aaaa`, `aaab`, `aaac`, ..., `zzzy`, `zzzz`; * the dogs numbered 475255,475256,\cdots were respectively given the names `aaaaa`, `aaaab`, ...; * and so on. To sum it up, the dogs numbered 1, 2, \cdots were respectively given the following names: `a`, `b`, ..., `z`, `aa`, `ab`, ..., `az`, `ba`, `bb`, ..., `bz`, ..., `za`, `zb`, ..., `zz`, `aaa`, `aab`, ..., `aaz`, `aba`, `abb`, ..., `abz`, ..., `zzz`, `aaaa`, ... Now, Roger asks you: "What is the name for the dog numbered N?" | ["N = int(input())\n\nnum2alpha = lambda c: chr(c)\nk = 100000\ntmp_N = N\nresult = ''\nwhile k > 0:\n k = int(tmp_N / 26)\n res = tmp_N % 26\n \n if k == 0:\n break\n print(res)\n result += num2alpha(res+64).lower()\n tmp_N = k\n\nm = N % 26\nresult += num2alpha(m+64).lower()", "N = int(input())\n\nnum2alpha = lambda c: chr(c)\nk = 100000\ntmp_N = N\nresult = ''\nwhile k > 0:\n k = int(tmp_N / 26)\n res = tmp_N % 26\n \n if k == 0:\n break\n result += num2alpha(res+64).lower()\n tmp_N = k\n\nm = N % 26\nresult += num2alpha(m+64).lower()", "N = int(input())\nimport math\n\nnum2alpha = lambda c: chr(c)\ntmp_N = N\nresult = ''\nwhile (tmp_N / 26) > 1.0:\n k = int(tmp_N / 26)\n res = tmp_N % 26\n if res == 0:\n res = 26\n k -= 1\n result += num2alpha(res+64).lower()\n tmp_N = k\nres = tmp_N % 26\nif res == 0:\n res = 26\n k -= 1\nresult += num2alpha(res+64).lower()\nnew_str = ''.join(list(reversed(result)))\nprint(new_str)"] | ['Wrong Answer', 'Wrong Answer', 'Accepted'] | ['s094630908', 's678003509', 's436747329'] | [9104.0, 9136.0, 9196.0] | [27.0, 26.0, 29.0] | [290, 275, 401] |
p02629 | u729086895 | 2,000 | 1,048,576 | 1000000000000001 dogs suddenly appeared under the roof of Roger's house, all of which he decided to keep. The dogs had been numbered 1 through 1000000000000001, but he gave them new names, as follows: * the dogs numbered 1,2,\cdots,26 were respectively given the names `a`, `b`, ..., `z`; * the dogs numbered 27,28,29,\cdots,701,702 were respectively given the names `aa`, `ab`, `ac`, ..., `zy`, `zz`; * the dogs numbered 703,704,705,\cdots,18277,18278 were respectively given the names `aaa`, `aab`, `aac`, ..., `zzy`, `zzz`; * the dogs numbered 18279,18280,18281,\cdots,475253,475254 were respectively given the names `aaaa`, `aaab`, `aaac`, ..., `zzzy`, `zzzz`; * the dogs numbered 475255,475256,\cdots were respectively given the names `aaaaa`, `aaaab`, ...; * and so on. To sum it up, the dogs numbered 1, 2, \cdots were respectively given the following names: `a`, `b`, ..., `z`, `aa`, `ab`, ..., `az`, `ba`, `bb`, ..., `bz`, ..., `za`, `zb`, ..., `zz`, `aaa`, `aab`, ..., `aaz`, `aba`, `abb`, ..., `abz`, ..., `zzz`, `aaaa`, ... Now, Roger asks you: "What is the name for the dog numbered N?" | ["n = int(input())\nans = ''\nfor i in range(1, 99):\n if N <= 26 ** i:\n N -= 1\n for j in range(i):\n ans += chr(ord('a') + N % 26)\n N //= 26\n break\n else:\n N -= 26 ** i\nprint(ans[::-1]) ", "N = int(input())\nans = ''\nfor i in range(1, 99):\n if N <= 26 ** i:\n N -= 1\n for j in range(i):\n ans += chr(ord('a') + N % 26)\n N //= 26\n break\n else:\n N -= 26 ** i\nprint(ans[::-1]) "] | ['Runtime Error', 'Accepted'] | ['s308284723', 's969089448'] | [9156.0, 9176.0] | [21.0, 31.0] | [205, 205] |
p02629 | u732870425 | 2,000 | 1,048,576 | 1000000000000001 dogs suddenly appeared under the roof of Roger's house, all of which he decided to keep. The dogs had been numbered 1 through 1000000000000001, but he gave them new names, as follows: * the dogs numbered 1,2,\cdots,26 were respectively given the names `a`, `b`, ..., `z`; * the dogs numbered 27,28,29,\cdots,701,702 were respectively given the names `aa`, `ab`, `ac`, ..., `zy`, `zz`; * the dogs numbered 703,704,705,\cdots,18277,18278 were respectively given the names `aaa`, `aab`, `aac`, ..., `zzy`, `zzz`; * the dogs numbered 18279,18280,18281,\cdots,475253,475254 were respectively given the names `aaaa`, `aaab`, `aaac`, ..., `zzzy`, `zzzz`; * the dogs numbered 475255,475256,\cdots were respectively given the names `aaaaa`, `aaaab`, ...; * and so on. To sum it up, the dogs numbered 1, 2, \cdots were respectively given the following names: `a`, `b`, ..., `z`, `aa`, `ab`, ..., `az`, `ba`, `bb`, ..., `bz`, ..., `za`, `zb`, ..., `zz`, `aaa`, `aab`, ..., `aaz`, `aba`, `abb`, ..., `abz`, ..., `zzz`, `aaaa`, ... Now, Roger asks you: "What is the name for the dog numbered N?" | ['def xxx(n):\n ans = ""\n i = 1\n\n while True:\n if n <= 26 ** i:\n n -= 1\n for j in range(i):\n ans = char(ord("a") + n%26) + ans\n n //= 26\n return ans\n else:\n n -= 26 ** i\n i += 1\n\n\nN = int(input())\nprint(xxx(N))', 'def xxx(n):\n alpha = "abcdefghijklmnopqrstuvwxyz"\n ans = ""\n i = 0\n\n while True:\n if n <= 26 ** i:\n n -= 1\n while N > 0:\n ans = alpha[N%26-1] + ans\n N //= 26\n return ans\n else:\n n -= 26 ** i\n\n \nN = int(input())\nprint(xxx(N))', 'def xxx(n):\n ans = ""\n i = 1\n\n while True:\n if n <= 26 ** i:\n n -= 1\n for j in range(i):\n ans = chr(ord("a") + n%26) + ans\n n //= 26\n return ans\n else:\n n -= 26 ** i\n i += 1\n\n\nN = int(input())\nprint(xxx(N))'] | ['Runtime Error', 'Runtime Error', 'Accepted'] | ['s466116159', 's954755147', 's012355286'] | [9216.0, 8892.0, 9180.0] | [27.0, 2205.0, 34.0] | [315, 335, 314] |
p02629 | u734274573 | 2,000 | 1,048,576 | 1000000000000001 dogs suddenly appeared under the roof of Roger's house, all of which he decided to keep. The dogs had been numbered 1 through 1000000000000001, but he gave them new names, as follows: * the dogs numbered 1,2,\cdots,26 were respectively given the names `a`, `b`, ..., `z`; * the dogs numbered 27,28,29,\cdots,701,702 were respectively given the names `aa`, `ab`, `ac`, ..., `zy`, `zz`; * the dogs numbered 703,704,705,\cdots,18277,18278 were respectively given the names `aaa`, `aab`, `aac`, ..., `zzy`, `zzz`; * the dogs numbered 18279,18280,18281,\cdots,475253,475254 were respectively given the names `aaaa`, `aaab`, `aaac`, ..., `zzzy`, `zzzz`; * the dogs numbered 475255,475256,\cdots were respectively given the names `aaaaa`, `aaaab`, ...; * and so on. To sum it up, the dogs numbered 1, 2, \cdots were respectively given the following names: `a`, `b`, ..., `z`, `aa`, `ab`, ..., `az`, `ba`, `bb`, ..., `bz`, ..., `za`, `zb`, ..., `zz`, `aaa`, `aab`, ..., `aaz`, `aba`, `abb`, ..., `abz`, ..., `zzz`, `aaaa`, ... Now, Roger asks you: "What is the name for the dog numbered N?" | ['\nn=int(input())\ndef num2alpha(num):\n if num<=26:\n return chr(64+num)\n elif num%26==0:\n return num2alpha(num//26-1)+chr(90)\n else:\n return num2alpha(num//26)+chr(64+num%26)\nprint(num2alpha(n))\n \n', 'n=int(input())\ndef num2alpha(num):\n if num<=26:\n return chr(64+num)\n elif num%26==0:\n return num2alpha(num//26-1)+chr(90)\n else:\n return num2alpha(num//26)+chr(64+num%26)\nprint(num2alpha(n).lower())\n \n'] | ['Wrong Answer', 'Accepted'] | ['s213926310', 's371962507'] | [9160.0, 9024.0] | [31.0, 33.0] | [207, 214] |
p02629 | u736470924 | 2,000 | 1,048,576 | 1000000000000001 dogs suddenly appeared under the roof of Roger's house, all of which he decided to keep. The dogs had been numbered 1 through 1000000000000001, but he gave them new names, as follows: * the dogs numbered 1,2,\cdots,26 were respectively given the names `a`, `b`, ..., `z`; * the dogs numbered 27,28,29,\cdots,701,702 were respectively given the names `aa`, `ab`, `ac`, ..., `zy`, `zz`; * the dogs numbered 703,704,705,\cdots,18277,18278 were respectively given the names `aaa`, `aab`, `aac`, ..., `zzy`, `zzz`; * the dogs numbered 18279,18280,18281,\cdots,475253,475254 were respectively given the names `aaaa`, `aaab`, `aaac`, ..., `zzzy`, `zzzz`; * the dogs numbered 475255,475256,\cdots were respectively given the names `aaaaa`, `aaaab`, ...; * and so on. To sum it up, the dogs numbered 1, 2, \cdots were respectively given the following names: `a`, `b`, ..., `z`, `aa`, `ab`, ..., `az`, `ba`, `bb`, ..., `bz`, ..., `za`, `zb`, ..., `zz`, `aaa`, `aab`, ..., `aaz`, `aba`, `abb`, ..., `abz`, ..., `zzz`, `aaaa`, ... Now, Roger asks you: "What is the name for the dog numbered N?" | ["def resolve():\n n = int(input())\n flag = 0\n name = []\n if n < 27:\n print(chr(i + 96))\n return\n while n > 0:\n c = n % 26\n name.append(c)\n n //= 26\n if n == 1:\n flag = 1\n\n print(''.join([chr(i + 96) for i in reversed(name)]))\n\nresolve()", "def resolve():\n n = int(input())\n name = []\n while n > 0:\n c = n % 26\n n //= 26\n if c == 0:\n name.append('z')\n n -= 1\n else:\n name.append(chr(c + 96))\n\n name.reverse()\n ans = ''.join(name)\n print(ans)\n\nresolve()"] | ['Runtime Error', 'Accepted'] | ['s666702464', 's420317583'] | [9212.0, 9168.0] | [30.0, 32.0] | [305, 290] |
p02629 | u737135713 | 2,000 | 1,048,576 | 1000000000000001 dogs suddenly appeared under the roof of Roger's house, all of which he decided to keep. The dogs had been numbered 1 through 1000000000000001, but he gave them new names, as follows: * the dogs numbered 1,2,\cdots,26 were respectively given the names `a`, `b`, ..., `z`; * the dogs numbered 27,28,29,\cdots,701,702 were respectively given the names `aa`, `ab`, `ac`, ..., `zy`, `zz`; * the dogs numbered 703,704,705,\cdots,18277,18278 were respectively given the names `aaa`, `aab`, `aac`, ..., `zzy`, `zzz`; * the dogs numbered 18279,18280,18281,\cdots,475253,475254 were respectively given the names `aaaa`, `aaab`, `aaac`, ..., `zzzy`, `zzzz`; * the dogs numbered 475255,475256,\cdots were respectively given the names `aaaaa`, `aaaab`, ...; * and so on. To sum it up, the dogs numbered 1, 2, \cdots were respectively given the following names: `a`, `b`, ..., `z`, `aa`, `ab`, ..., `az`, `ba`, `bb`, ..., `bz`, ..., `za`, `zb`, ..., `zz`, `aaa`, `aab`, ..., `aaz`, `aba`, `abb`, ..., `abz`, ..., `zzz`, `aaaa`, ... Now, Roger asks you: "What is the name for the dog numbered N?" | ['n = int(input())\nfor i in range(11):\n p = 0\n q = 0\n p = n%26\n if n==0 and p==0:\n l2[i]=""\n else:\n l2[i]=l[p]\n if p ==0:\n q = n - 26\n else:\n q = n - p\n n = q//26\nprint(l2[10]+l2[9]+l2[8]+l2[7]+l2[6]+l2[5]+l2[4]+l2[3]+l2[2]+l2[1]+l2[0])', 'l = ["z","a","b","c","d","e","f","g","h","i","j","k","l","m","n","o","p","q","r","s","t","u","v","w","x","y"]\nl2 = [0]*11\n\nn = int(input())\nfor i in range(11):\n p = 0\n q = 0\n p = n%26\n if n==0 and p==0:\n l2[i]=""\n else:\n l2[i]=l[p]\n if p ==0:\n q = n - 26\n else:\n q = n - p\n n = q//26\nprint(l2[10]+l2[9]+l2[8]+l2[7]+l2[6]+l2[5]+l2[4]+l2[3]+l2[2]+l2[1]+l2[0])'] | ['Runtime Error', 'Accepted'] | ['s458618055', 's358775370'] | [9084.0, 9240.0] | [25.0, 31.0] | [264, 387] |
p02629 | u741215420 | 2,000 | 1,048,576 | 1000000000000001 dogs suddenly appeared under the roof of Roger's house, all of which he decided to keep. The dogs had been numbered 1 through 1000000000000001, but he gave them new names, as follows: * the dogs numbered 1,2,\cdots,26 were respectively given the names `a`, `b`, ..., `z`; * the dogs numbered 27,28,29,\cdots,701,702 were respectively given the names `aa`, `ab`, `ac`, ..., `zy`, `zz`; * the dogs numbered 703,704,705,\cdots,18277,18278 were respectively given the names `aaa`, `aab`, `aac`, ..., `zzy`, `zzz`; * the dogs numbered 18279,18280,18281,\cdots,475253,475254 were respectively given the names `aaaa`, `aaab`, `aaac`, ..., `zzzy`, `zzzz`; * the dogs numbered 475255,475256,\cdots were respectively given the names `aaaaa`, `aaaab`, ...; * and so on. To sum it up, the dogs numbered 1, 2, \cdots were respectively given the following names: `a`, `b`, ..., `z`, `aa`, `ab`, ..., `az`, `ba`, `bb`, ..., `bz`, ..., `za`, `zb`, ..., `zz`, `aaa`, `aab`, ..., `aaz`, `aba`, `abb`, ..., `abz`, ..., `zzz`, `aaaa`, ... Now, Roger asks you: "What is the name for the dog numbered N?" | ["n = int(input())\ns = ''\nwhile n > 0:\n n-=1\n ans += chr(ord('a') + n%26)\n n//=26\n \nprint(ans[::-1])\n ", "n = int(input())\ns = ''\nwhile n > 0:\n n-=1\n s += chr(ord('a') + n%26)\n n//=26\n \nprint(s[::-1])"] | ['Runtime Error', 'Accepted'] | ['s380933257', 's610503819'] | [9104.0, 9000.0] | [27.0, 31.0] | [104, 97] |
p02629 | u751717561 | 2,000 | 1,048,576 | 1000000000000001 dogs suddenly appeared under the roof of Roger's house, all of which he decided to keep. The dogs had been numbered 1 through 1000000000000001, but he gave them new names, as follows: * the dogs numbered 1,2,\cdots,26 were respectively given the names `a`, `b`, ..., `z`; * the dogs numbered 27,28,29,\cdots,701,702 were respectively given the names `aa`, `ab`, `ac`, ..., `zy`, `zz`; * the dogs numbered 703,704,705,\cdots,18277,18278 were respectively given the names `aaa`, `aab`, `aac`, ..., `zzy`, `zzz`; * the dogs numbered 18279,18280,18281,\cdots,475253,475254 were respectively given the names `aaaa`, `aaab`, `aaac`, ..., `zzzy`, `zzzz`; * the dogs numbered 475255,475256,\cdots were respectively given the names `aaaaa`, `aaaab`, ...; * and so on. To sum it up, the dogs numbered 1, 2, \cdots were respectively given the following names: `a`, `b`, ..., `z`, `aa`, `ab`, ..., `az`, `ba`, `bb`, ..., `bz`, ..., `za`, `zb`, ..., `zz`, `aaa`, `aab`, ..., `aaz`, `aba`, `abb`, ..., `abz`, ..., `zzz`, `aaaa`, ... Now, Roger asks you: "What is the name for the dog numbered N?" | ["n = int(input())\n\nans = ''\n\nwhile n > 0:\n n -= 1\n ans += chr(ord('a') + n % 26)\n n //= 26", "n = int(input())\n\nans = ''\n\nwhile n > 0:\n n -= 1\n ans += chr(ord('a') + n % 26)\n n //= 26\n\nprint(ans[::-1])"] | ['Wrong Answer', 'Accepted'] | ['s242102453', 's823663381'] | [9124.0, 8936.0] | [31.0, 30.0] | [98, 116] |
p02629 | u755180064 | 2,000 | 1,048,576 | 1000000000000001 dogs suddenly appeared under the roof of Roger's house, all of which he decided to keep. The dogs had been numbered 1 through 1000000000000001, but he gave them new names, as follows: * the dogs numbered 1,2,\cdots,26 were respectively given the names `a`, `b`, ..., `z`; * the dogs numbered 27,28,29,\cdots,701,702 were respectively given the names `aa`, `ab`, `ac`, ..., `zy`, `zz`; * the dogs numbered 703,704,705,\cdots,18277,18278 were respectively given the names `aaa`, `aab`, `aac`, ..., `zzy`, `zzz`; * the dogs numbered 18279,18280,18281,\cdots,475253,475254 were respectively given the names `aaaa`, `aaab`, `aaac`, ..., `zzzy`, `zzzz`; * the dogs numbered 475255,475256,\cdots were respectively given the names `aaaaa`, `aaaab`, ...; * and so on. To sum it up, the dogs numbered 1, 2, \cdots were respectively given the following names: `a`, `b`, ..., `z`, `aa`, `ab`, ..., `az`, `ba`, `bb`, ..., `bz`, ..., `za`, `zb`, ..., `zz`, `aaa`, `aab`, ..., `aaz`, `aba`, `abb`, ..., `abz`, ..., `zzz`, `aaaa`, ... Now, Roger asks you: "What is the name for the dog numbered N?" | ['\nurl = "https://atcoder.jp//contests/abc165/tasks/abc165_c"\n\ndef main():\n al = [chr(i) for i in range(97, 97+26)]\n n = int(input())\n d = 0\n keta = 0\n while d < n:\n keta += 1\n d += 26**keta\n ans = [25]*keta\n idx = 0\n if d == n:\n for i in range(-1, (len(ans) * -1) - 1, -1):\n print(al[ans[i]], end="")\n exit()\n for _ in range(0, d-n):\n if ans[idx] == -1:\n for i in range(-1, (len(ans)*-1)-1, -1):\n if ans[i] == -1:\n ans[i+1] -= 1\n ans[i] = 25\n ans[idx] -= 1\n if ans[0] == -1:\n ans[0] = 0\n for i in range(-1, (len(ans)*-1)-1, -1):\n print(al[ans[i]], end="")\n\n\nif __name__ == \'__main__\':\n main()\n', '\ndef main2():\n n = int(input())\n d = 0\n keta = 0\n tmp = n\n ans = ""\n while n > 0:\n n -= 1\n ans += chr(ord(\'a\') + (n%26))\n n //= 26\n print(ans[::-1])\n\nif __name__ == \'__main__\':\n main2()'] | ['Wrong Answer', 'Accepted'] | ['s323998761', 's337921027'] | [9280.0, 9188.0] | [2206.0, 28.0] | [759, 230] |
p02629 | u756609156 | 2,000 | 1,048,576 | 1000000000000001 dogs suddenly appeared under the roof of Roger's house, all of which he decided to keep. The dogs had been numbered 1 through 1000000000000001, but he gave them new names, as follows: * the dogs numbered 1,2,\cdots,26 were respectively given the names `a`, `b`, ..., `z`; * the dogs numbered 27,28,29,\cdots,701,702 were respectively given the names `aa`, `ab`, `ac`, ..., `zy`, `zz`; * the dogs numbered 703,704,705,\cdots,18277,18278 were respectively given the names `aaa`, `aab`, `aac`, ..., `zzy`, `zzz`; * the dogs numbered 18279,18280,18281,\cdots,475253,475254 were respectively given the names `aaaa`, `aaab`, `aaac`, ..., `zzzy`, `zzzz`; * the dogs numbered 475255,475256,\cdots were respectively given the names `aaaaa`, `aaaab`, ...; * and so on. To sum it up, the dogs numbered 1, 2, \cdots were respectively given the following names: `a`, `b`, ..., `z`, `aa`, `ab`, ..., `az`, `ba`, `bb`, ..., `bz`, ..., `za`, `zb`, ..., `zz`, `aaa`, `aab`, ..., `aaz`, `aba`, `abb`, ..., `abz`, ..., `zzz`, `aaaa`, ... Now, Roger asks you: "What is the name for the dog numbered N?" | ['n=int(input())-1\nj=26\nwhile j<=n:\n n-=j\n j*=26\nj/=26\nret = ""\nwhile j:\n ret += "abcdefghijklmnopqrstuvwxyz"[n//j]\n n %= j\n j /= 26\nprint(ret)\n', 'n=int(input())-1\nj=26\nwhile j<=n:\n n-=j\n j*=26\nj//=26\nret = ""\nwhile j:\n ret += "abcdefghijklmnopqrstuvwxyz"[n//j]\n #print(f\'{n//j=}\')\n n %= j\n j //= 26\nprint(ret)\n'] | ['Runtime Error', 'Accepted'] | ['s137905051', 's058589890'] | [9224.0, 9160.0] | [32.0, 30.0] | [147, 170] |
p02629 | u758815106 | 2,000 | 1,048,576 | 1000000000000001 dogs suddenly appeared under the roof of Roger's house, all of which he decided to keep. The dogs had been numbered 1 through 1000000000000001, but he gave them new names, as follows: * the dogs numbered 1,2,\cdots,26 were respectively given the names `a`, `b`, ..., `z`; * the dogs numbered 27,28,29,\cdots,701,702 were respectively given the names `aa`, `ab`, `ac`, ..., `zy`, `zz`; * the dogs numbered 703,704,705,\cdots,18277,18278 were respectively given the names `aaa`, `aab`, `aac`, ..., `zzy`, `zzz`; * the dogs numbered 18279,18280,18281,\cdots,475253,475254 were respectively given the names `aaaa`, `aaab`, `aaac`, ..., `zzzy`, `zzzz`; * the dogs numbered 475255,475256,\cdots were respectively given the names `aaaaa`, `aaaab`, ...; * and so on. To sum it up, the dogs numbered 1, 2, \cdots were respectively given the following names: `a`, `b`, ..., `z`, `aa`, `ab`, ..., `az`, `ba`, `bb`, ..., `bz`, ..., `za`, `zb`, ..., `zz`, `aaa`, `aab`, ..., `aaz`, `aba`, `abb`, ..., `abz`, ..., `zzz`, `aaaa`, ... Now, Roger asks you: "What is the name for the dog numbered N?" | ['def calc(num):\n if num % 26 != 0:\n res.append(num % 26)\n else:\n res.append(26)\n\n if num // 26 > 0 and num != 26:\n calc(num // 26)\n\ndef printres():\n for obj in reversed(res):\n print(dic[obj], end="")\n\ndic = {1:"a", 2:"b", 3:"c", 4:"d", 5:"e", 6:"f", 7:"g", 8:"h", 9:"i", 10:"j", 11:"k", 12:"l", 13:"m", 14:"n", 15:"o", 16:"p", 17:"q", 18:"r", 19:"s", 20:"t", 21:"u", 22:"v", 23:"w", 24:"x", 25:"y", 26:"z"}\n\nres = []\n\n\n\nif __name__ == "__main__":\n N = int(input())\n\n calc(N)\n\n printres()', 'def calc(num):\n if num % 26 != 0:\n res.append(num % 26)\n else:\n res.append(26)\n num -= 26\n\n if num // 26 > 0:\n calc(num // 26)\n\ndef printres():\n for obj in reversed(res):\n print(dic[obj], end="")\n print()\n\ndic = {1:"a", 2:"b", 3:"c", 4:"d", 5:"e", 6:"f", 7:"g", 8:"h", 9:"i", 10:"j", 11:"k", 12:"l", 13:"m", 14:"n", 15:"o", 16:"p", 17:"q", 18:"r", 19:"s", 20:"t", 21:"u", 22:"v", 23:"w", 24:"x", 25:"y", 26:"z"}\n\nres = []\n\n\nN = int(input())\n\ncalc(N)\n\nprintres()'] | ['Wrong Answer', 'Accepted'] | ['s254651427', 's146613630'] | [9156.0, 9236.0] | [33.0, 30.0] | [535, 511] |
p02629 | u759510609 | 2,000 | 1,048,576 | 1000000000000001 dogs suddenly appeared under the roof of Roger's house, all of which he decided to keep. The dogs had been numbered 1 through 1000000000000001, but he gave them new names, as follows: * the dogs numbered 1,2,\cdots,26 were respectively given the names `a`, `b`, ..., `z`; * the dogs numbered 27,28,29,\cdots,701,702 were respectively given the names `aa`, `ab`, `ac`, ..., `zy`, `zz`; * the dogs numbered 703,704,705,\cdots,18277,18278 were respectively given the names `aaa`, `aab`, `aac`, ..., `zzy`, `zzz`; * the dogs numbered 18279,18280,18281,\cdots,475253,475254 were respectively given the names `aaaa`, `aaab`, `aaac`, ..., `zzzy`, `zzzz`; * the dogs numbered 475255,475256,\cdots were respectively given the names `aaaaa`, `aaaab`, ...; * and so on. To sum it up, the dogs numbered 1, 2, \cdots were respectively given the following names: `a`, `b`, ..., `z`, `aa`, `ab`, ..., `az`, `ba`, `bb`, ..., `bz`, ..., `za`, `zb`, ..., `zz`, `aaa`, `aab`, ..., `aaz`, `aba`, `abb`, ..., `abz`, ..., `zzz`, `aaaa`, ... Now, Roger asks you: "What is the name for the dog numbered N?" | ["import itertools\nimport math\n\ndef Base_10_to_n(X, n):\n if (int(X/n)):\n return Base_10_to_n(int(X/n), n)+str(X%n)\n return str(X%n)\n\nN = int(input())\nnum = Base_10_to_n(N,26)\ns = ['a','b','c','d','e','f','g','h','i','j','k','l','m','n','o','p','q','r','s','t','u','v','w','x','y','z']\n\nst = []\nwhile(N!=0):\n if N < 26:\n st.append(N%26)\n break\n st.append(N%26)\n N = N//26\n\n\nfor i in st[::-1]:\n print(s[i-1],end='')\n\n", "N = int(input())\ns = ['a','b','c','d','e','f','g','h','i','j','k','l','m','n','o','p','q','r','s','t','u','v','w','x','y','z']\n\ndef num2alpha(num):\n if num<=26:\n return chr(64+num)\n elif num%26==0:\n return num2alpha(num//26-1)+chr(90)\n else:\n return num2alpha(num//26)+chr(64+num%26)\n\nprint(num2alpha(N).lower())"] | ['Wrong Answer', 'Accepted'] | ['s296441328', 's996243166'] | [9072.0, 9216.0] | [29.0, 33.0] | [452, 342] |
p02629 | u760569096 | 2,000 | 1,048,576 | 1000000000000001 dogs suddenly appeared under the roof of Roger's house, all of which he decided to keep. The dogs had been numbered 1 through 1000000000000001, but he gave them new names, as follows: * the dogs numbered 1,2,\cdots,26 were respectively given the names `a`, `b`, ..., `z`; * the dogs numbered 27,28,29,\cdots,701,702 were respectively given the names `aa`, `ab`, `ac`, ..., `zy`, `zz`; * the dogs numbered 703,704,705,\cdots,18277,18278 were respectively given the names `aaa`, `aab`, `aac`, ..., `zzy`, `zzz`; * the dogs numbered 18279,18280,18281,\cdots,475253,475254 were respectively given the names `aaaa`, `aaab`, `aaac`, ..., `zzzy`, `zzzz`; * the dogs numbered 475255,475256,\cdots were respectively given the names `aaaaa`, `aaaab`, ...; * and so on. To sum it up, the dogs numbered 1, 2, \cdots were respectively given the following names: `a`, `b`, ..., `z`, `aa`, `ab`, ..., `az`, `ba`, `bb`, ..., `bz`, ..., `za`, `zb`, ..., `zz`, `aaa`, `aab`, ..., `aaz`, `aba`, `abb`, ..., `abz`, ..., `zzz`, `aaaa`, ... Now, Roger asks you: "What is the name for the dog numbered N?" | ["n=int(input())\n\ndef change(): \n\np=[]\nwhile n>0:\n a=n%26\n p.append(a)\n n=n//26\n\nfor i in range(len(p)):\n p[i]=change(p[i])\n\np.reverse() \n\nb=''\n\nfor i in range(len(p)):\n b += p[i]\n \nprint(b)", "n = int(input())\na = ['a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z']\nb = ''\ndef Base_10_to_n(X, n):\n X_dumy = X\n out = ''\n while X_dumy>0:\n out = a[X_dumy%n-1]+out\n if a[X_dumy%n-1] == 'z':\n X_dumy -= 26\n X_dumy = X_dumy//n\n return out\n\nz = Base_10_to_n(n, 26)\nprint(z)"] | ['Runtime Error', 'Accepted'] | ['s364367691', 's406371039'] | [8728.0, 9124.0] | [31.0, 30.0] | [276, 394] |
p02629 | u761062383 | 2,000 | 1,048,576 | 1000000000000001 dogs suddenly appeared under the roof of Roger's house, all of which he decided to keep. The dogs had been numbered 1 through 1000000000000001, but he gave them new names, as follows: * the dogs numbered 1,2,\cdots,26 were respectively given the names `a`, `b`, ..., `z`; * the dogs numbered 27,28,29,\cdots,701,702 were respectively given the names `aa`, `ab`, `ac`, ..., `zy`, `zz`; * the dogs numbered 703,704,705,\cdots,18277,18278 were respectively given the names `aaa`, `aab`, `aac`, ..., `zzy`, `zzz`; * the dogs numbered 18279,18280,18281,\cdots,475253,475254 were respectively given the names `aaaa`, `aaab`, `aaac`, ..., `zzzy`, `zzzz`; * the dogs numbered 475255,475256,\cdots were respectively given the names `aaaaa`, `aaaab`, ...; * and so on. To sum it up, the dogs numbered 1, 2, \cdots were respectively given the following names: `a`, `b`, ..., `z`, `aa`, `ab`, ..., `az`, `ba`, `bb`, ..., `bz`, ..., `za`, `zb`, ..., `zz`, `aaa`, `aab`, ..., `aaz`, `aba`, `abb`, ..., `abz`, ..., `zzz`, `aaaa`, ... Now, Roger asks you: "What is the name for the dog numbered N?" | ['def resolve():\n # 1000000000000001\n from collections import deque\n S = "abcdefghijklmnopqrstuvwxyz"\n N = int(input())\n tmp = N\n A = deque()\n\n while True:\n N, a = divmod(N, 26)\n A.append(a)\n if N == 0:\n break\n print(N, a, file=sys.stderr)\n if tmp % 26 == 0:\n A.pop()\n for a in reversed(A):\n print(S[a - 1], end="")\n print()\n\nresolve()', 'def resolve():\n from collections import deque\n S = "abcdefghijklmnopqrstuvwxyz"\n N = int(input())\n A = deque()\n while True:\n N -= 1\n N, a = divmod(N, 26)\n A.appendleft(a)\n if N == 0:\n break\n for a in A:\n print(S[a], end="")\n print()\n\n\nresolve()\n'] | ['Runtime Error', 'Accepted'] | ['s675446464', 's522580767'] | [9460.0, 9468.0] | [28.0, 29.0] | [412, 312] |
p02629 | u763103911 | 2,000 | 1,048,576 | 1000000000000001 dogs suddenly appeared under the roof of Roger's house, all of which he decided to keep. The dogs had been numbered 1 through 1000000000000001, but he gave them new names, as follows: * the dogs numbered 1,2,\cdots,26 were respectively given the names `a`, `b`, ..., `z`; * the dogs numbered 27,28,29,\cdots,701,702 were respectively given the names `aa`, `ab`, `ac`, ..., `zy`, `zz`; * the dogs numbered 703,704,705,\cdots,18277,18278 were respectively given the names `aaa`, `aab`, `aac`, ..., `zzy`, `zzz`; * the dogs numbered 18279,18280,18281,\cdots,475253,475254 were respectively given the names `aaaa`, `aaab`, `aaac`, ..., `zzzy`, `zzzz`; * the dogs numbered 475255,475256,\cdots were respectively given the names `aaaaa`, `aaaab`, ...; * and so on. To sum it up, the dogs numbered 1, 2, \cdots were respectively given the following names: `a`, `b`, ..., `z`, `aa`, `ab`, ..., `az`, `ba`, `bb`, ..., `bz`, ..., `za`, `zb`, ..., `zz`, `aaa`, `aab`, ..., `aaz`, `aba`, `abb`, ..., `abz`, ..., `zzz`, `aaaa`, ... Now, Roger asks you: "What is the name for the dog numbered N?" | ['n= int(input())\ns="abcdefghijklmnopqrstuvwxyz"\ndef fn(n):\n if(n<=26):\n return s[n-1]\n return f(n-1)//26+s[f(n-1)%26]\n \nprint(f(n)) ', "n = int(input())\nans = ''\nwhile n > 0:\n n -= 1\n ans += chr(ord('a') + n % 26)\n n//= 26\nprint(ans[::-1])"] | ['Runtime Error', 'Accepted'] | ['s455030131', 's666319233'] | [9100.0, 9176.0] | [28.0, 31.0] | [138, 112] |
p02629 | u763534217 | 2,000 | 1,048,576 | 1000000000000001 dogs suddenly appeared under the roof of Roger's house, all of which he decided to keep. The dogs had been numbered 1 through 1000000000000001, but he gave them new names, as follows: * the dogs numbered 1,2,\cdots,26 were respectively given the names `a`, `b`, ..., `z`; * the dogs numbered 27,28,29,\cdots,701,702 were respectively given the names `aa`, `ab`, `ac`, ..., `zy`, `zz`; * the dogs numbered 703,704,705,\cdots,18277,18278 were respectively given the names `aaa`, `aab`, `aac`, ..., `zzy`, `zzz`; * the dogs numbered 18279,18280,18281,\cdots,475253,475254 were respectively given the names `aaaa`, `aaab`, `aaac`, ..., `zzzy`, `zzzz`; * the dogs numbered 475255,475256,\cdots were respectively given the names `aaaaa`, `aaaab`, ...; * and so on. To sum it up, the dogs numbered 1, 2, \cdots were respectively given the following names: `a`, `b`, ..., `z`, `aa`, `ab`, ..., `az`, `ba`, `bb`, ..., `bz`, ..., `za`, `zb`, ..., `zz`, `aaa`, `aab`, ..., `aaz`, `aba`, `abb`, ..., `abz`, ..., `zzz`, `aaaa`, ... Now, Roger asks you: "What is the name for the dog numbered N?" | ['n = int(input())\n\nascii = \'abcdefghijklmnopqrstuvwxyz\'\n\nout = \'\'\nl = []\nwhile n > 0:\n l.append(n%26)\n out = str(n%26) + ", " + out\n n = int(n/26)\n# print(out)\n# print(l)\n\nflg = 0\nfor i in range(len(l)):\n if l[i] != 0:\n l[i] -= 1\n else:\n if i == len(l)-2:\n flg = 1\n l[i+1] = 0\n l[i] = 25\n\nif len(l)==1:\n l[0] -= 1\n\nname = ""\nfor i in range(len(l)-flg):\n name = ascii[l[i]] + name\nprint(name)\n', 'n = int(input()) # + 1\n\nascii = \'abcdefghijklmnopqrstuvwxyz\'\n\nout = \'\'\nl = []\nwhile n > 0:\n l.append(n%26)\n out = str(n%26) + ", " + out\n n = int(n/26)\n# print(out)\n# print(l)\n\nflg = 0\nfor i in range(len(l)-1):\n if l[i] != 0:\n l[i] -= 1\n else:\n if i == len(l)-2:\n flg = 1\n l[i+1] = 0\n l[i] = 25\n\nname = ""\nfor i in range(len(l)-flg):\n name = ascii[l[i]] + name\nprint(name)\n', 'n = int(input())\n\n\ni = 1\nwhile 1:\n # print(i)\n if n <= 26 ** i:\n break\n else:\n n -= 26**i\n i += 1\nprint(i)\n\nname = ""\nn -= 1\nfor j in range(i):\n name += chr(ord(\'a\') + n % 26)\n n //= 26\n\nprint(name[::-1])', 'n = int(input())\n\n\ni = 1\nwhile 1:\n # print(i)\n if n <= 26 ** i:\n break\n else:\n n -= 26**i\n i += 1\n\nname = ""\nn -= 1\nfor j in range(i):\n name += chr(ord(\'a\') + n % 26)\n n //= 26\n\nprint(name[::-1])'] | ['Runtime Error', 'Wrong Answer', 'Wrong Answer', 'Accepted'] | ['s298460022', 's374737585', 's436042843', 's865113658'] | [9216.0, 9148.0, 9184.0, 9164.0] | [35.0, 31.0, 31.0, 32.0] | [451, 430, 267, 258] |
p02629 | u765865533 | 2,000 | 1,048,576 | 1000000000000001 dogs suddenly appeared under the roof of Roger's house, all of which he decided to keep. The dogs had been numbered 1 through 1000000000000001, but he gave them new names, as follows: * the dogs numbered 1,2,\cdots,26 were respectively given the names `a`, `b`, ..., `z`; * the dogs numbered 27,28,29,\cdots,701,702 were respectively given the names `aa`, `ab`, `ac`, ..., `zy`, `zz`; * the dogs numbered 703,704,705,\cdots,18277,18278 were respectively given the names `aaa`, `aab`, `aac`, ..., `zzy`, `zzz`; * the dogs numbered 18279,18280,18281,\cdots,475253,475254 were respectively given the names `aaaa`, `aaab`, `aaac`, ..., `zzzy`, `zzzz`; * the dogs numbered 475255,475256,\cdots were respectively given the names `aaaaa`, `aaaab`, ...; * and so on. To sum it up, the dogs numbered 1, 2, \cdots were respectively given the following names: `a`, `b`, ..., `z`, `aa`, `ab`, ..., `az`, `ba`, `bb`, ..., `bz`, ..., `za`, `zb`, ..., `zz`, `aaa`, `aab`, ..., `aaz`, `aba`, `abb`, ..., `abz`, ..., `zzz`, `aaaa`, ... Now, Roger asks you: "What is the name for the dog numbered N?" | ['n=int(input())-1\nif n!=0:\n res=[]\n for b in reversed(basis):\n res.append(n//b)\n n=n%b\n\n ans=[]\n flag=False\n for x in res:\n if x!=0:\n flag=True\n if flag:\n ans.append(chr(ord("a")+x))\n\n print("".join(ans))\nelse:\n print("a")', 'n=int(input())\n\nans=[]\nwhile(n!=0):\n m=n%p\n n=n//p\n ans.append(m)\n\nres=list(map(lambda x: chr(ord("a")-1+x),ans))\n\nprint("".join(res))', 'n=int(input())\n# n=26*26+26+1\nbasis=[26**i for i in range(12)]\nl=[]\ns=0\nfor b in basis:\n s+=b\n l.append(s) \n\ni=0\nf=12\nwhile(f-i>1):\n# print(f-i)\n x=(i+f)//2\n if l[x]>n:\n f=x\n else:\n i=x\n\nlength=i+1\nk=n-(l[length-1]-1)\nx=k-1\nres=[]\nfor i in range(length):\n q=x//26\n r=x%26\n x=q\n res.append(r)\n\nans=list(map(lambda x: chr(ord("a")+x),list(reversed(res))))\nprint("".join(ans))'] | ['Runtime Error', 'Runtime Error', 'Accepted'] | ['s088966875', 's989474806', 's974830062'] | [9108.0, 9184.0, 9152.0] | [28.0, 25.0, 32.0] | [292, 143, 421] |
p02629 | u767664985 | 2,000 | 1,048,576 | 1000000000000001 dogs suddenly appeared under the roof of Roger's house, all of which he decided to keep. The dogs had been numbered 1 through 1000000000000001, but he gave them new names, as follows: * the dogs numbered 1,2,\cdots,26 were respectively given the names `a`, `b`, ..., `z`; * the dogs numbered 27,28,29,\cdots,701,702 were respectively given the names `aa`, `ab`, `ac`, ..., `zy`, `zz`; * the dogs numbered 703,704,705,\cdots,18277,18278 were respectively given the names `aaa`, `aab`, `aac`, ..., `zzy`, `zzz`; * the dogs numbered 18279,18280,18281,\cdots,475253,475254 were respectively given the names `aaaa`, `aaab`, `aaac`, ..., `zzzy`, `zzzz`; * the dogs numbered 475255,475256,\cdots were respectively given the names `aaaaa`, `aaaab`, ...; * and so on. To sum it up, the dogs numbered 1, 2, \cdots were respectively given the following names: `a`, `b`, ..., `z`, `aa`, `ab`, ..., `az`, `ba`, `bb`, ..., `bz`, ..., `za`, `zb`, ..., `zz`, `aaa`, `aab`, ..., `aaz`, `aba`, `abb`, ..., `abz`, ..., `zzz`, `aaaa`, ... Now, Roger asks you: "What is the name for the dog numbered N?" | ['N = int(input())\n\nM = 0\nwhile 26 ** (M+1) < N:\n M += 1\n\nans = ""\nfor m in range(M, -1, -1):\n ans += chr(ord("a") + N%26)\n N //= 26\n\nprint(ans)\n', 'N = int(input())\n\nans = ""\nwhile N > 0:\n ans += chr(ord("a") + N%26)\n N //= 26\n\nprint(ans[::-1])\n', 'N = int(input())\n\nM = 0\nwhile 26 ** (M+1) < N:\n M += 1\n\nans = ""\nfor m in range(M):\n ans += chr(ord("a") + N%26)\n N //= 26\n\nprint(ans[::-1])\n', 'N = int(input())\n\nans = ""\nwhile N > 0:\n N -= 1\n ans += chr(ord("a") + N%26)\n N //= 26\n\nprint(ans[::-1])\n'] | ['Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Accepted'] | ['s321199391', 's430623667', 's626508532', 's923338316'] | [9120.0, 9152.0, 9132.0, 9164.0] | [28.0, 30.0, 28.0, 27.0] | [152, 103, 150, 114] |
p02629 | u771007149 | 2,000 | 1,048,576 | 1000000000000001 dogs suddenly appeared under the roof of Roger's house, all of which he decided to keep. The dogs had been numbered 1 through 1000000000000001, but he gave them new names, as follows: * the dogs numbered 1,2,\cdots,26 were respectively given the names `a`, `b`, ..., `z`; * the dogs numbered 27,28,29,\cdots,701,702 were respectively given the names `aa`, `ab`, `ac`, ..., `zy`, `zz`; * the dogs numbered 703,704,705,\cdots,18277,18278 were respectively given the names `aaa`, `aab`, `aac`, ..., `zzy`, `zzz`; * the dogs numbered 18279,18280,18281,\cdots,475253,475254 were respectively given the names `aaaa`, `aaab`, `aaac`, ..., `zzzy`, `zzzz`; * the dogs numbered 475255,475256,\cdots were respectively given the names `aaaaa`, `aaaab`, ...; * and so on. To sum it up, the dogs numbered 1, 2, \cdots were respectively given the following names: `a`, `b`, ..., `z`, `aa`, `ab`, ..., `az`, `ba`, `bb`, ..., `bz`, ..., `za`, `zb`, ..., `zz`, `aaa`, `aab`, ..., `aaz`, `aba`, `abb`, ..., `abz`, ..., `zzz`, `aaaa`, ... Now, Roger asks you: "What is the name for the dog numbered N?" | ['#C\nimport bisect\nalphabet = "abcdefghijklmnopqrstuvwxyz"\nn = int(input())\ncnt = 0\namari = []\n\n\nniroku = [1]\nfor i in range(1,15):\n a = niroku[-1]\n niroku.append(a + 26**i)\n\nidx = bisect.bisect_left(niroku, n)\n\nn = n - niroku[idx-1] + 1\nz_cnt = idx-1\n#print(n)\nwhile n // 26 > 0:\n n_before = n\n amari.append(str(n%26))\n a = n % 26\n n = n // 26\n cnt += 1\n#print(a)\n#print(n)\n#print(cnt)\n\nif int("".join(amari)) != 0: \n amari.append(str(n))\namari.reverse()\n#print(amari)\nresult = []\n\nfor i in range(len(amari)):\n result.append(alphabet[int(amari[i])-1])\n\nfor i in range(z_cnt):\n result[i] = "z"\n\nprint("".join(result))\n', 'n = int(input())\nans = ""\nwhile n > 0:\n n -= 1\n ans += chr(ord(\'a\') + n%26)\n #print(ans)\n n = n // 26\nprint(ans[::-1])'] | ['Runtime Error', 'Accepted'] | ['s140902785', 's818903854'] | [9004.0, 9100.0] | [31.0, 31.0] | [656, 130] |
p02629 | u771167374 | 2,000 | 1,048,576 | 1000000000000001 dogs suddenly appeared under the roof of Roger's house, all of which he decided to keep. The dogs had been numbered 1 through 1000000000000001, but he gave them new names, as follows: * the dogs numbered 1,2,\cdots,26 were respectively given the names `a`, `b`, ..., `z`; * the dogs numbered 27,28,29,\cdots,701,702 were respectively given the names `aa`, `ab`, `ac`, ..., `zy`, `zz`; * the dogs numbered 703,704,705,\cdots,18277,18278 were respectively given the names `aaa`, `aab`, `aac`, ..., `zzy`, `zzz`; * the dogs numbered 18279,18280,18281,\cdots,475253,475254 were respectively given the names `aaaa`, `aaab`, `aaac`, ..., `zzzy`, `zzzz`; * the dogs numbered 475255,475256,\cdots were respectively given the names `aaaaa`, `aaaab`, ...; * and so on. To sum it up, the dogs numbered 1, 2, \cdots were respectively given the following names: `a`, `b`, ..., `z`, `aa`, `ab`, ..., `az`, `ba`, `bb`, ..., `bz`, ..., `za`, `zb`, ..., `zz`, `aaa`, `aab`, ..., `aaz`, `aba`, `abb`, ..., `abz`, ..., `zzz`, `aaaa`, ... Now, Roger asks you: "What is the name for the dog numbered N?" | ['n = int(input())\nn -= 1\nfor i in range(1, 15):\n if n >= 26**i :\n n -= 26**i\n continue \n ans = ""\n for j in range(i):\n d = n % 26\n ans += chr(ord("a")+d)\n n //= 26\n ans = ans[::-1]\nprint(ans)\n\n\n', 'n = int(input())\nn -= 1\nfor i in range(1, 15):\n if n >= 26**i :\n n -= 26**i\n continue \n ans = ""\n for j in range(i):\n d = n % 26\n ans += chr(ord("a")+d)\n n //= 26\n ans = ans[::-1]\n break\nprint(ans)\n\n\n\n'] | ['Wrong Answer', 'Accepted'] | ['s285414194', 's983899413'] | [9036.0, 9144.0] | [28.0, 30.0] | [240, 251] |
p02629 | u771383254 | 2,000 | 1,048,576 | 1000000000000001 dogs suddenly appeared under the roof of Roger's house, all of which he decided to keep. The dogs had been numbered 1 through 1000000000000001, but he gave them new names, as follows: * the dogs numbered 1,2,\cdots,26 were respectively given the names `a`, `b`, ..., `z`; * the dogs numbered 27,28,29,\cdots,701,702 were respectively given the names `aa`, `ab`, `ac`, ..., `zy`, `zz`; * the dogs numbered 703,704,705,\cdots,18277,18278 were respectively given the names `aaa`, `aab`, `aac`, ..., `zzy`, `zzz`; * the dogs numbered 18279,18280,18281,\cdots,475253,475254 were respectively given the names `aaaa`, `aaab`, `aaac`, ..., `zzzy`, `zzzz`; * the dogs numbered 475255,475256,\cdots were respectively given the names `aaaaa`, `aaaab`, ...; * and so on. To sum it up, the dogs numbered 1, 2, \cdots were respectively given the following names: `a`, `b`, ..., `z`, `aa`, `ab`, ..., `az`, `ba`, `bb`, ..., `bz`, ..., `za`, `zb`, ..., `zz`, `aaa`, `aab`, ..., `aaz`, `aba`, `abb`, ..., `abz`, ..., `zzz`, `aaaa`, ... Now, Roger asks you: "What is the name for the dog numbered N?" | ["n = int(input())\nalpha = [chr(x) for x in range(ord('a'), ord('z')+1)]\nname = ''\nwhile n:\n n -= 1\n r = int(n%26)\n n = n // 26\n print(n, r)\n name += alpha[r]\nprint(name[::-1])", "n = int(input())\nalpha = [chr(x) for x in range(ord('a'), ord('z')+1)]\nname = ''\nwhile n:\n n -= 1\n r = int(n%26)\n n = n // 26\n name += alpha[r]\nprint(name[::-1])"] | ['Wrong Answer', 'Accepted'] | ['s562350674', 's174731562'] | [9176.0, 9188.0] | [33.0, 32.0] | [179, 165] |
p02629 | u773440446 | 2,000 | 1,048,576 | 1000000000000001 dogs suddenly appeared under the roof of Roger's house, all of which he decided to keep. The dogs had been numbered 1 through 1000000000000001, but he gave them new names, as follows: * the dogs numbered 1,2,\cdots,26 were respectively given the names `a`, `b`, ..., `z`; * the dogs numbered 27,28,29,\cdots,701,702 were respectively given the names `aa`, `ab`, `ac`, ..., `zy`, `zz`; * the dogs numbered 703,704,705,\cdots,18277,18278 were respectively given the names `aaa`, `aab`, `aac`, ..., `zzy`, `zzz`; * the dogs numbered 18279,18280,18281,\cdots,475253,475254 were respectively given the names `aaaa`, `aaab`, `aaac`, ..., `zzzy`, `zzzz`; * the dogs numbered 475255,475256,\cdots were respectively given the names `aaaaa`, `aaaab`, ...; * and so on. To sum it up, the dogs numbered 1, 2, \cdots were respectively given the following names: `a`, `b`, ..., `z`, `aa`, `ab`, ..., `az`, `ba`, `bb`, ..., `bz`, ..., `za`, `zb`, ..., `zz`, `aaa`, `aab`, ..., `aaz`, `aba`, `abb`, ..., `abz`, ..., `zzz`, `aaaa`, ... Now, Roger asks you: "What is the name for the dog numbered N?" | ["N=int(input())\nK=26\n\nal = [chr(i) for i in range(97, 97+26)]\n\ndef change(N,shinsu):\n keta=0\n for i in range(10**9):\n if N<shinsu**i:\n keta+=i\n break\n ans=[0]*keta\n check=0\n for i in range(1,keta+1):\n j=N//(shinsu**(keta-i))\n ans[check]=j\n check+=1\n N-=(j)*(shinsu**(keta-i))\n return ans\n \nq = []\nfor i in change(N,K):\n print(al[i-1],end = '')\n ", 'n = int(input())\nalf = "0abcdefghijklmnopqrstuvwxyz"\nans = ""\n\nwhile n != 0:\n x = n%26\n \n if x == 0:\n x = 26\n \n ans += alf[x]\n n -= x\n n //= 26\n\nprint(ans[::-1])'] | ['Wrong Answer', 'Accepted'] | ['s819938420', 's639147860'] | [9192.0, 9160.0] | [30.0, 29.0] | [466, 193] |
p02629 | u779602548 | 2,000 | 1,048,576 | 1000000000000001 dogs suddenly appeared under the roof of Roger's house, all of which he decided to keep. The dogs had been numbered 1 through 1000000000000001, but he gave them new names, as follows: * the dogs numbered 1,2,\cdots,26 were respectively given the names `a`, `b`, ..., `z`; * the dogs numbered 27,28,29,\cdots,701,702 were respectively given the names `aa`, `ab`, `ac`, ..., `zy`, `zz`; * the dogs numbered 703,704,705,\cdots,18277,18278 were respectively given the names `aaa`, `aab`, `aac`, ..., `zzy`, `zzz`; * the dogs numbered 18279,18280,18281,\cdots,475253,475254 were respectively given the names `aaaa`, `aaab`, `aaac`, ..., `zzzy`, `zzzz`; * the dogs numbered 475255,475256,\cdots were respectively given the names `aaaaa`, `aaaab`, ...; * and so on. To sum it up, the dogs numbered 1, 2, \cdots were respectively given the following names: `a`, `b`, ..., `z`, `aa`, `ab`, ..., `az`, `ba`, `bb`, ..., `bz`, ..., `za`, `zb`, ..., `zz`, `aaa`, `aab`, ..., `aaz`, `aba`, `abb`, ..., `abz`, ..., `zzz`, `aaaa`, ... Now, Roger asks you: "What is the name for the dog numbered N?" | ['n = int(input())-1\nresult = ""\n\nif n!=0:\n while(1):\n tmp = n % 26\n result += chr(tmp+97)\n n = n // 26\n n -= 1\n if n==0: break\nprint(result[::-1])', 'n = int(input())-1\nresult = ""\n\nwhile(1):\n tmp = n % 26\n result += chr(tmp+97)\n n = n // 26\n if n==0: break\n n -= 1\n \nprint(result[::-1])'] | ['Wrong Answer', 'Accepted'] | ['s464673888', 's998906860'] | [15776.0, 9104.0] | [2206.0, 34.0] | [183, 155] |
p02629 | u790012205 | 2,000 | 1,048,576 | 1000000000000001 dogs suddenly appeared under the roof of Roger's house, all of which he decided to keep. The dogs had been numbered 1 through 1000000000000001, but he gave them new names, as follows: * the dogs numbered 1,2,\cdots,26 were respectively given the names `a`, `b`, ..., `z`; * the dogs numbered 27,28,29,\cdots,701,702 were respectively given the names `aa`, `ab`, `ac`, ..., `zy`, `zz`; * the dogs numbered 703,704,705,\cdots,18277,18278 were respectively given the names `aaa`, `aab`, `aac`, ..., `zzy`, `zzz`; * the dogs numbered 18279,18280,18281,\cdots,475253,475254 were respectively given the names `aaaa`, `aaab`, `aaac`, ..., `zzzy`, `zzzz`; * the dogs numbered 475255,475256,\cdots were respectively given the names `aaaaa`, `aaaab`, ...; * and so on. To sum it up, the dogs numbered 1, 2, \cdots were respectively given the following names: `a`, `b`, ..., `z`, `aa`, `ab`, ..., `az`, `ba`, `bb`, ..., `bz`, ..., `za`, `zb`, ..., `zz`, `aaa`, `aab`, ..., `aaz`, `aba`, `abb`, ..., `abz`, ..., `zzz`, `aaaa`, ... Now, Roger asks you: "What is the name for the dog numbered N?" | ["N = int(input())\nD = ['a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q',\n 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z']\na = 26\nb = 1\nwhile True:\n if N // (a + 1) == 0:\n break\n b += 1\n a += 26 ** b\nA = [0] * b\nfor i in range(b):\n N -= 26 ** i\nfor i in range(b - 1, -1, -1):\n A[i] = N // (26 ** i)\n N -= A[i] * (26 ** i)\nA = A[::-1]\nprint(A)\nfor a in A:\n print(D[a], end='')\nprint('')", "N = int(input())\nD = ['a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q',\n 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z']\na = 26\nb = 1\nwhile True:\n if N // (a + 1) == 0:\n break\n b += 1\n a += 26 ** b\nA = [0] * b\nfor i in range(b):\n N -= 26 ** i\nfor i in range(b - 1, -1, -1):\n A[i] = N // (26 ** i)\n N -= A[i] * (26 ** i)\nA = A[::-1]\nfor a in A:\n print(D[a], end='')\nprint('')"] | ['Wrong Answer', 'Accepted'] | ['s995815685', 's741561833'] | [9236.0, 9216.0] | [30.0, 26.0] | [447, 438] |
p02629 | u790710233 | 2,000 | 1,048,576 | 1000000000000001 dogs suddenly appeared under the roof of Roger's house, all of which he decided to keep. The dogs had been numbered 1 through 1000000000000001, but he gave them new names, as follows: * the dogs numbered 1,2,\cdots,26 were respectively given the names `a`, `b`, ..., `z`; * the dogs numbered 27,28,29,\cdots,701,702 were respectively given the names `aa`, `ab`, `ac`, ..., `zy`, `zz`; * the dogs numbered 703,704,705,\cdots,18277,18278 were respectively given the names `aaa`, `aab`, `aac`, ..., `zzy`, `zzz`; * the dogs numbered 18279,18280,18281,\cdots,475253,475254 were respectively given the names `aaaa`, `aaab`, `aaac`, ..., `zzzy`, `zzzz`; * the dogs numbered 475255,475256,\cdots were respectively given the names `aaaaa`, `aaaab`, ...; * and so on. To sum it up, the dogs numbered 1, 2, \cdots were respectively given the following names: `a`, `b`, ..., `z`, `aa`, `ab`, ..., `az`, `ba`, `bb`, ..., `bz`, ..., `za`, `zb`, ..., `zz`, `aaa`, `aab`, ..., `aaz`, `aba`, `abb`, ..., `abz`, ..., `zzz`, `aaaa`, ... Now, Roger asks you: "What is the name for the dog numbered N?" | ["n = int(input())-1\n\nans = []\nwhile n >= 0:\n n, y = divmod(n, 26)\n ans.append(y)\n n -= 1\nans.reverse()\nprint(ans)\n\n\ndef to_alpha(x):\n return chr(x+ord('a'))\n\n\nprint(''.join(map(to_alpha, ans)))", "n = int(input())-1\n\nans = []\nwhile n >= 0:\n n, y = divmod(n, 26)\n ans.append(y)\n n -= 1\nprint(''.join(map(lambda x: chr(x+ord('a')), ans[::-1])))\n"] | ['Wrong Answer', 'Accepted'] | ['s273225044', 's020685542'] | [9032.0, 9180.0] | [33.0, 26.0] | [204, 155] |
p02629 | u796044734 | 2,000 | 1,048,576 | 1000000000000001 dogs suddenly appeared under the roof of Roger's house, all of which he decided to keep. The dogs had been numbered 1 through 1000000000000001, but he gave them new names, as follows: * the dogs numbered 1,2,\cdots,26 were respectively given the names `a`, `b`, ..., `z`; * the dogs numbered 27,28,29,\cdots,701,702 were respectively given the names `aa`, `ab`, `ac`, ..., `zy`, `zz`; * the dogs numbered 703,704,705,\cdots,18277,18278 were respectively given the names `aaa`, `aab`, `aac`, ..., `zzy`, `zzz`; * the dogs numbered 18279,18280,18281,\cdots,475253,475254 were respectively given the names `aaaa`, `aaab`, `aaac`, ..., `zzzy`, `zzzz`; * the dogs numbered 475255,475256,\cdots were respectively given the names `aaaaa`, `aaaab`, ...; * and so on. To sum it up, the dogs numbered 1, 2, \cdots were respectively given the following names: `a`, `b`, ..., `z`, `aa`, `ab`, ..., `az`, `ba`, `bb`, ..., `bz`, ..., `za`, `zb`, ..., `zz`, `aaa`, `aab`, ..., `aaz`, `aba`, `abb`, ..., `abz`, ..., `zzz`, `aaaa`, ... Now, Roger asks you: "What is the name for the dog numbered N?" | ["N = int(input()) \n\nans='' \n\nwhile N>0:\n\tN -= 1\n\tans += chr(ord('a') + N % 26) \n N //= 26\n \nprint(ans[::-1])", 'n = int(input())\n\nans = ""\nal=[chr(ord(\'a\') + i) for i in range(26)]\n\nif 1<=n and n<=26:\n print(al[n-1])\nelse: \n while n>0 :\n \ta = n%26\n \tn = n//26\n \tans += str(al[a-1])\n \nprint(ans[::-1])', "N = int(input()) \n\nans='' \n\nwhile N>0:\n\tN -= 1\n\tans += chr(ord('a') + N % 26) \n N = N//26\n \nprint(ans[::-1])\n", "N = int(input()) \n\nans='' \n\nwhile N>0:\n\tN -= 1\n\tans += chr(ord('a') + N % 26) \n N //= 26\n \nprint(ans[::-1])\n", "N = int(input()) \n\nans='' \n\nwhile N>0:\n\tN -= 1\n\tans += chr(ord('a') + N % 26) \n\tN = N//26\n \nprint(ans[::-1])"] | ['Runtime Error', 'Wrong Answer', 'Runtime Error', 'Runtime Error', 'Accepted'] | ['s069751027', 's121088788', 's440603742', 's769915758', 's463419683'] | [8976.0, 9184.0, 9024.0, 8964.0, 9060.0] | [26.0, 28.0, 27.0, 28.0, 29.0] | [113, 195, 116, 114, 111] |
p02629 | u797755701 | 2,000 | 1,048,576 | 1000000000000001 dogs suddenly appeared under the roof of Roger's house, all of which he decided to keep. The dogs had been numbered 1 through 1000000000000001, but he gave them new names, as follows: * the dogs numbered 1,2,\cdots,26 were respectively given the names `a`, `b`, ..., `z`; * the dogs numbered 27,28,29,\cdots,701,702 were respectively given the names `aa`, `ab`, `ac`, ..., `zy`, `zz`; * the dogs numbered 703,704,705,\cdots,18277,18278 were respectively given the names `aaa`, `aab`, `aac`, ..., `zzy`, `zzz`; * the dogs numbered 18279,18280,18281,\cdots,475253,475254 were respectively given the names `aaaa`, `aaab`, `aaac`, ..., `zzzy`, `zzzz`; * the dogs numbered 475255,475256,\cdots were respectively given the names `aaaaa`, `aaaab`, ...; * and so on. To sum it up, the dogs numbered 1, 2, \cdots were respectively given the following names: `a`, `b`, ..., `z`, `aa`, `ab`, ..., `az`, `ba`, `bb`, ..., `bz`, ..., `za`, `zb`, ..., `zz`, `aaa`, `aab`, ..., `aaz`, `aba`, `abb`, ..., `abz`, ..., `zzz`, `aaaa`, ... Now, Roger asks you: "What is the name for the dog numbered N?" | ['import sys\n\nq = int(sys.stdin.readline())\nchars = []\nwhile q > 26:\n q, mod = divmod(q, 26)\n chars.append(chr(mod+96))\nchars.reverse()\nprint("".join(chars))\n', 'import sys\n\nq = int(sys.stdin.readline())\nchars = []\nwhile True:\n q, mod = divmod(q-1, 26)\n chars.append(chr(mod+97))\n if q < 1:\n break\nchars.reverse()\nprint("".join(chars))\n'] | ['Wrong Answer', 'Accepted'] | ['s604586925', 's175401454'] | [9152.0, 9172.0] | [33.0, 31.0] | [162, 190] |
p02629 | u798675549 | 2,000 | 1,048,576 | 1000000000000001 dogs suddenly appeared under the roof of Roger's house, all of which he decided to keep. The dogs had been numbered 1 through 1000000000000001, but he gave them new names, as follows: * the dogs numbered 1,2,\cdots,26 were respectively given the names `a`, `b`, ..., `z`; * the dogs numbered 27,28,29,\cdots,701,702 were respectively given the names `aa`, `ab`, `ac`, ..., `zy`, `zz`; * the dogs numbered 703,704,705,\cdots,18277,18278 were respectively given the names `aaa`, `aab`, `aac`, ..., `zzy`, `zzz`; * the dogs numbered 18279,18280,18281,\cdots,475253,475254 were respectively given the names `aaaa`, `aaab`, `aaac`, ..., `zzzy`, `zzzz`; * the dogs numbered 475255,475256,\cdots were respectively given the names `aaaaa`, `aaaab`, ...; * and so on. To sum it up, the dogs numbered 1, 2, \cdots were respectively given the following names: `a`, `b`, ..., `z`, `aa`, `ab`, ..., `az`, `ba`, `bb`, ..., `bz`, ..., `za`, `zb`, ..., `zz`, `aaa`, `aab`, ..., `aaz`, `aba`, `abb`, ..., `abz`, ..., `zzz`, `aaaa`, ... Now, Roger asks you: "What is the name for the dog numbered N?" | ["n=int(input())-1\nlst=[]\nif not n:lst=[0]\nwhile n:\n lst.append(n%26)\n n//=26\nfor i in range(1,len(lst)):\n lst[i]=(lst[i]-1)%26\nprint(lst)\nprint(''.join([chr(i+97) for i in lst][::-1]))", "n=int(input())-1\nm=n;i=0;lst=[]\nwhile m>=0:\n i+=1;k=m;m-=26**i\n k\nwhile k>0:\n lst.append(k%26)\n k//=26\nfor j in range(i-len(lst)):\n lst.append(0)\nprint(''.join([chr(b+97) for b in lst][::-1]))"] | ['Wrong Answer', 'Accepted'] | ['s975973671', 's856020418'] | [9188.0, 9188.0] | [34.0, 35.0] | [192, 207] |
p02629 | u798894056 | 2,000 | 1,048,576 | 1000000000000001 dogs suddenly appeared under the roof of Roger's house, all of which he decided to keep. The dogs had been numbered 1 through 1000000000000001, but he gave them new names, as follows: * the dogs numbered 1,2,\cdots,26 were respectively given the names `a`, `b`, ..., `z`; * the dogs numbered 27,28,29,\cdots,701,702 were respectively given the names `aa`, `ab`, `ac`, ..., `zy`, `zz`; * the dogs numbered 703,704,705,\cdots,18277,18278 were respectively given the names `aaa`, `aab`, `aac`, ..., `zzy`, `zzz`; * the dogs numbered 18279,18280,18281,\cdots,475253,475254 were respectively given the names `aaaa`, `aaab`, `aaac`, ..., `zzzy`, `zzzz`; * the dogs numbered 475255,475256,\cdots were respectively given the names `aaaaa`, `aaaab`, ...; * and so on. To sum it up, the dogs numbered 1, 2, \cdots were respectively given the following names: `a`, `b`, ..., `z`, `aa`, `ab`, ..., `az`, `ba`, `bb`, ..., `bz`, ..., `za`, `zb`, ..., `zz`, `aaa`, `aab`, ..., `aaz`, `aba`, `abb`, ..., `abz`, ..., `zzz`, `aaaa`, ... Now, Roger asks you: "What is the name for the dog numbered N?" | ["\n# created: 15.09.2020 21:11:53\n\nimport sys\n\nN = int(input())\nans = ''\nwhile N > 0:\nN -= 1\nans += chr(ord('a') + N % 26)\nN //= 26\nprint(ans[::-1])\n", "\n# created: 15.09.2020 21:11:53\n\nimport sys\n\nN = int(input())\nans = ''\nwhile N > 0:\n N -= 1\n ans += chr(ord('a') + N % 26)\n N //= 26\nprint(ans[::-1])\n"] | ['Runtime Error', 'Accepted'] | ['s664187983', 's716799097'] | [8900.0, 9064.0] | [25.0, 27.0] | [168, 180] |
p02629 | u801701525 | 2,000 | 1,048,576 | 1000000000000001 dogs suddenly appeared under the roof of Roger's house, all of which he decided to keep. The dogs had been numbered 1 through 1000000000000001, but he gave them new names, as follows: * the dogs numbered 1,2,\cdots,26 were respectively given the names `a`, `b`, ..., `z`; * the dogs numbered 27,28,29,\cdots,701,702 were respectively given the names `aa`, `ab`, `ac`, ..., `zy`, `zz`; * the dogs numbered 703,704,705,\cdots,18277,18278 were respectively given the names `aaa`, `aab`, `aac`, ..., `zzy`, `zzz`; * the dogs numbered 18279,18280,18281,\cdots,475253,475254 were respectively given the names `aaaa`, `aaab`, `aaac`, ..., `zzzy`, `zzzz`; * the dogs numbered 475255,475256,\cdots were respectively given the names `aaaaa`, `aaaab`, ...; * and so on. To sum it up, the dogs numbered 1, 2, \cdots were respectively given the following names: `a`, `b`, ..., `z`, `aa`, `ab`, ..., `az`, `ba`, `bb`, ..., `bz`, ..., `za`, `zb`, ..., `zz`, `aaa`, `aab`, ..., `aaz`, `aba`, `abb`, ..., `abz`, ..., `zzz`, `aaaa`, ... Now, Roger asks you: "What is the name for the dog numbered N?" | ["n = int(input())\n\nn -= 1\n\ncnt = 1\nnum = 26\nname = ''\nanum = 97\n\nwhile n >= num:\n name += chr(n%26+anum)\n n = int(n/26)\n\nname += chr(n%26+anum-1)\n\nname = name[::-1]\n\nprint(name)", "n = int(input())\n\nn -= 1\n\ncnt = 1\nnum = 26\nname = ''\nanum = 97\n\nwhile n >= num:\n name += chr(n%num+anum)\n n = int(n/26)\n n -= 1\n\nname += chr(n%num+anum)\n\nname = name[::-1]\n\nprint(name)"] | ['Wrong Answer', 'Accepted'] | ['s807157555', 's981173808'] | [9152.0, 9188.0] | [27.0, 31.0] | [182, 193] |
p02629 | u805586810 | 2,000 | 1,048,576 | 1000000000000001 dogs suddenly appeared under the roof of Roger's house, all of which he decided to keep. The dogs had been numbered 1 through 1000000000000001, but he gave them new names, as follows: * the dogs numbered 1,2,\cdots,26 were respectively given the names `a`, `b`, ..., `z`; * the dogs numbered 27,28,29,\cdots,701,702 were respectively given the names `aa`, `ab`, `ac`, ..., `zy`, `zz`; * the dogs numbered 703,704,705,\cdots,18277,18278 were respectively given the names `aaa`, `aab`, `aac`, ..., `zzy`, `zzz`; * the dogs numbered 18279,18280,18281,\cdots,475253,475254 were respectively given the names `aaaa`, `aaab`, `aaac`, ..., `zzzy`, `zzzz`; * the dogs numbered 475255,475256,\cdots were respectively given the names `aaaaa`, `aaaab`, ...; * and so on. To sum it up, the dogs numbered 1, 2, \cdots were respectively given the following names: `a`, `b`, ..., `z`, `aa`, `ab`, ..., `az`, `ba`, `bb`, ..., `bz`, ..., `za`, `zb`, ..., `zz`, `aaa`, `aab`, ..., `aaz`, `aba`, `abb`, ..., `abz`, ..., `zzz`, `aaaa`, ... Now, Roger asks you: "What is the name for the dog numbered N?" | ["def A(x):\n if ord(x) - ord('a') >= 0:\n print('a')\n else:\n print('A')\n\n\ndef B(n, k, p_list):\n p_list = sorted(p_list)\n print(sum(p_list[:k]))\n\n\ndef _get_base_x(n, x):\n a = [\n 'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o',\n 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z'\n ]\n b = []\n while True:\n s = n // x\n y = n % x\n b = b + [y]\n if s == 0:\n break\n n = s\n b.reverse()\n ret = []\n for i in b:\n ret.append(a[i - 1])\n print(''.join(ret))\n\n\ndef C(x):\n _get_base_x(x, 26)\n\n\ndef main():\n # letter = input()\n # A(letter)\n # for x in ['A', 'Z', 'a', 'z']:\n # A(x)\n\n \n # p_list = map(int, input().split())\n # B(n, k, p_list)\n C(bignum(input()))\n # C(475255)\n\n\nif __name__ == '__main__':\n main()\n", "def A(x):\n if ord(x) - ord('a') >= 0:\n print('a')\n else:\n print('A')\n\n\ndef B(n, k, p_list):\n p_list = sorted(p_list)\n print(sum(p_list[:k]))\n\n\ndef _get_base_x(n, x):\n a = [\n 'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o',\n 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z'\n ]\n b = []\n while True:\n s = n // x\n y = n % x\n b = b + [y]\n if s == 0:\n break\n n = s\n b.reverse()\n ret = []\n for i in b:\n ret.append(a[i - 1])\n print(''.join(ret))\n\n\ndef C(x):\n _get_base_x(x, 26)\n\n\ndef main():\n # letter = input()\n # A(letter)\n # for x in ['A', 'Z', 'a', 'z']:\n # A(x)\n\n \n # p_list = map(int, input().split())\n # B(n, k, p_list)\n C(long(input()))\n \n \n # print(str(num))\n # # C(int(str(num)))\n \n\n\nif __name__ == '__main__':\n main()\n", "def A(x):\n if ord(x) - ord('a') >= 0:\n print('a')\n else:\n print('A')\n\n\ndef B(n, k, p_list):\n p_list = sorted(p_list)\n print(sum(p_list[:k]))\n\n\ndef _get_base_x(n, x):\n a = [\n 'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o',\n 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z'\n ]\n b = []\n while True:\n s = n // x\n y = n % x\n b = b + [y]\n if s == 0:\n break\n n = s\n b.reverse()\n ret = []\n for i in b:\n ret.append(a[i - 1])\n print(''.join(ret))\n\n\ndef C(x):\n _get_base_x(x, 26)\n\n\ndef main():\n # letter = input()\n # A(letter)\n # for x in ['A', 'Z', 'a', 'z']:\n # A(x)\n\n \n # p_list = map(int, input().split())\n # B(n, k, p_list)\n C(input())\n\n\nif __name__ == '__main__':\n main()\n", "def A(x):\n if ord(x) - ord('a') >= 0:\n print('a')\n else:\n print('A')\n\n\ndef B(n, k, p_list):\n p_list = sorted(p_list)\n print(sum(p_list[:k]))\n\n\ndef C(N):\n for i in range(99):\n if N < 26**i:\n ans = []\n for j in range(i):\n ans += chr(ord('a') + N % 26)\n N //= 26\n return ''.join(ans[::-1])\n else:\n N -= 26**i\n\n\ndef main():\n # letter = input()\n # A(letter)\n # for x in ['A', 'Z', 'a', 'z']:\n # A(x)\n\n \n # p_list = map(int, input().split())\n # B(n, k, p_list)\n print(C(int(input())))\n \n # print(C(26 + i))\n # C(703)\n # C(18279)\n # C(475254)\n\n\nif __name__ == '__main__':\n main()\n"] | ['Runtime Error', 'Runtime Error', 'Runtime Error', 'Accepted'] | ['s204580064', 's375610273', 's381647241', 's083501513'] | [9168.0, 8912.0, 9168.0, 9140.0] | [24.0, 31.0, 33.0, 28.0] | [818, 910, 796, 698] |
p02629 | u810066979 | 2,000 | 1,048,576 | 1000000000000001 dogs suddenly appeared under the roof of Roger's house, all of which he decided to keep. The dogs had been numbered 1 through 1000000000000001, but he gave them new names, as follows: * the dogs numbered 1,2,\cdots,26 were respectively given the names `a`, `b`, ..., `z`; * the dogs numbered 27,28,29,\cdots,701,702 were respectively given the names `aa`, `ab`, `ac`, ..., `zy`, `zz`; * the dogs numbered 703,704,705,\cdots,18277,18278 were respectively given the names `aaa`, `aab`, `aac`, ..., `zzy`, `zzz`; * the dogs numbered 18279,18280,18281,\cdots,475253,475254 were respectively given the names `aaaa`, `aaab`, `aaac`, ..., `zzzy`, `zzzz`; * the dogs numbered 475255,475256,\cdots were respectively given the names `aaaaa`, `aaaab`, ...; * and so on. To sum it up, the dogs numbered 1, 2, \cdots were respectively given the following names: `a`, `b`, ..., `z`, `aa`, `ab`, ..., `az`, `ba`, `bb`, ..., `bz`, ..., `za`, `zb`, ..., `zz`, `aaa`, `aab`, ..., `aaz`, `aba`, `abb`, ..., `abz`, ..., `zzz`, `aaaa`, ... Now, Roger asks you: "What is the name for the dog numbered N?" | ['n = int(input())\n\nli = []\n\ncount = 0\nval = 1\n\nwhile(True):\n\n\tval *= 27\n\tcount += 1\n\n\tif (val > n):\n\t\tbreak\n\nfor i in range(count-1,-1,-1):\n\n\tval2 = n // pow(26,i)\n\tli.append(val2)\n\tn -= (val2 * pow(26,i))\n\nfor i in li:\n\tprint(chr(96+i),end="")', 'n = int(input())\n\nli = []\n\ncount = 0\nval = 1\n\nwhile(True):\n\n\tval *= 26\n\tcount += 1\n\n\tif (val > n):\n\t\tbreak\n\nfor i in range(count-1,-1,-1):\n\n\tval2 = n // pow(26,i)\n\t#print(val2)\n\tli.append(val2)\n\tn -= (val2 * pow(26,i))\n\nfor i in li:\n\tprint(chr(96+i),end="")', 'N = int(input())\nresult = ""\nwhile N >= 1:\n result = chr(((int(N) -1) % 26) + ord(\'a\')) + result\n N = (N-1) / 26\nprint(result)'] | ['Wrong Answer', 'Wrong Answer', 'Accepted'] | ['s558165816', 's883665355', 's113723447'] | [9144.0, 9140.0, 9032.0] | [30.0, 27.0, 30.0] | [243, 257, 128] |
p02629 | u811817592 | 2,000 | 1,048,576 | 1000000000000001 dogs suddenly appeared under the roof of Roger's house, all of which he decided to keep. The dogs had been numbered 1 through 1000000000000001, but he gave them new names, as follows: * the dogs numbered 1,2,\cdots,26 were respectively given the names `a`, `b`, ..., `z`; * the dogs numbered 27,28,29,\cdots,701,702 were respectively given the names `aa`, `ab`, `ac`, ..., `zy`, `zz`; * the dogs numbered 703,704,705,\cdots,18277,18278 were respectively given the names `aaa`, `aab`, `aac`, ..., `zzy`, `zzz`; * the dogs numbered 18279,18280,18281,\cdots,475253,475254 were respectively given the names `aaaa`, `aaab`, `aaac`, ..., `zzzy`, `zzzz`; * the dogs numbered 475255,475256,\cdots were respectively given the names `aaaaa`, `aaaab`, ...; * and so on. To sum it up, the dogs numbered 1, 2, \cdots were respectively given the following names: `a`, `b`, ..., `z`, `aa`, `ab`, ..., `az`, `ba`, `bb`, ..., `bz`, ..., `za`, `zb`, ..., `zz`, `aaa`, `aab`, ..., `aaz`, `aba`, `abb`, ..., `abz`, ..., `zzz`, `aaaa`, ... Now, Roger asks you: "What is the name for the dog numbered N?" | ["n=int(input())\nalphabet='abcdefghijklmnopqrstuvwxyz'\nbase=[26**i for i in range(12)]\ndigit=0\nflag=0\nfor i in range(12):\n if n%base[i]==0:\n flag=1\n elif base[i]>n:\n digit=i\n break\nanswer=''\nfor i in range(digit):\n t=n//base[-(13-digit)-i]\n answer+=alphabet[t-1]\n n=n%base[-(13-digit)-i]\nif flag==1:\n print(answer[1:])\nelse:\n print(answer)", '# -*- coding: utf-8 -*-\nN = int(input())\nascii_lowercase = \'abcdefghijklmnopqrstuvwxyz\'\n\nans = ""\nwhile(N > 0):\n N, mod = divmod(N, 26)\n if mod == 0:\n N -= 1\n ans = "z" + ans\n else:\n ans = ascii_lowercase[mod - 1] + ans\n\nprint(ans)'] | ['Wrong Answer', 'Accepted'] | ['s673832395', 's885236253'] | [9152.0, 9124.0] | [30.0, 28.0] | [379, 261] |
p02629 | u813890414 | 2,000 | 1,048,576 | 1000000000000001 dogs suddenly appeared under the roof of Roger's house, all of which he decided to keep. The dogs had been numbered 1 through 1000000000000001, but he gave them new names, as follows: * the dogs numbered 1,2,\cdots,26 were respectively given the names `a`, `b`, ..., `z`; * the dogs numbered 27,28,29,\cdots,701,702 were respectively given the names `aa`, `ab`, `ac`, ..., `zy`, `zz`; * the dogs numbered 703,704,705,\cdots,18277,18278 were respectively given the names `aaa`, `aab`, `aac`, ..., `zzy`, `zzz`; * the dogs numbered 18279,18280,18281,\cdots,475253,475254 were respectively given the names `aaaa`, `aaab`, `aaac`, ..., `zzzy`, `zzzz`; * the dogs numbered 475255,475256,\cdots were respectively given the names `aaaaa`, `aaaab`, ...; * and so on. To sum it up, the dogs numbered 1, 2, \cdots were respectively given the following names: `a`, `b`, ..., `z`, `aa`, `ab`, ..., `az`, `ba`, `bb`, ..., `bz`, ..., `za`, `zb`, ..., `zz`, `aaa`, `aab`, ..., `aaz`, `aba`, `abb`, ..., `abz`, ..., `zzz`, `aaaa`, ... Now, Roger asks you: "What is the name for the dog numbered N?" | ['N = int(input())\nk = []\n\nwhile N // 26 > 0:\n if N // 26 > 0:\n k.insert(0,N%26)\n N = N // 26\nk.insert(0,N)\n\nfor i in k:\n print(chr(i+96),end="")', 'N = int(input())\nans = []\n\nwhile N > 26:\n if N % 26 == 0:\n ans.insert(0,chr(122))\n N = N // 26-1\n else:\n ans.insert(0,chr(N%26+96))\n N = N // 26\nans.insert(0,chr(N+96))\n\nprint("".join(ans))'] | ['Wrong Answer', 'Accepted'] | ['s803151417', 's468372468'] | [9112.0, 9000.0] | [34.0, 32.0] | [163, 223] |
p02629 | u820087133 | 2,000 | 1,048,576 | 1000000000000001 dogs suddenly appeared under the roof of Roger's house, all of which he decided to keep. The dogs had been numbered 1 through 1000000000000001, but he gave them new names, as follows: * the dogs numbered 1,2,\cdots,26 were respectively given the names `a`, `b`, ..., `z`; * the dogs numbered 27,28,29,\cdots,701,702 were respectively given the names `aa`, `ab`, `ac`, ..., `zy`, `zz`; * the dogs numbered 703,704,705,\cdots,18277,18278 were respectively given the names `aaa`, `aab`, `aac`, ..., `zzy`, `zzz`; * the dogs numbered 18279,18280,18281,\cdots,475253,475254 were respectively given the names `aaaa`, `aaab`, `aaac`, ..., `zzzy`, `zzzz`; * the dogs numbered 475255,475256,\cdots were respectively given the names `aaaaa`, `aaaab`, ...; * and so on. To sum it up, the dogs numbered 1, 2, \cdots were respectively given the following names: `a`, `b`, ..., `z`, `aa`, `ab`, ..., `az`, `ba`, `bb`, ..., `bz`, ..., `za`, `zb`, ..., `zz`, `aaa`, `aab`, ..., `aaz`, `aba`, `abb`, ..., `abz`, ..., `zzz`, `aaaa`, ... Now, Roger asks you: "What is the name for the dog numbered N?" | ['aalphabets = [""] + [s for s in "abcdefghijklmnopqrstuvwxyz"]\n\ns = int(input())\n\nnums = []\n\nwhile s > 0:\n nums.append((s - 1) % 26 + 1)\n s = (s - 1) // 26\n\nres = ""\n \nfor _ in range(len(nums)):\n res = res + alphabets[nums.pop()]\n\nprint(res)', 'alphabets = [""] + [s for s in "abcdefghijklmnopqrstuvwxyz"]\n\ns = int(input())\n\nnums = []\n\nwhile s > 0:\n nums.append((s - 1) % 26 + 1)\n s = (s - 1) // 26\n\nres = ""\n \nfor _ in range(len(nums)):\n res = res + alphabets[nums.pop()]\n\nprint(res)'] | ['Runtime Error', 'Accepted'] | ['s658746172', 's761484181'] | [9176.0, 9180.0] | [32.0, 34.0] | [244, 243] |
p02629 | u821180083 | 2,000 | 1,048,576 | 1000000000000001 dogs suddenly appeared under the roof of Roger's house, all of which he decided to keep. The dogs had been numbered 1 through 1000000000000001, but he gave them new names, as follows: * the dogs numbered 1,2,\cdots,26 were respectively given the names `a`, `b`, ..., `z`; * the dogs numbered 27,28,29,\cdots,701,702 were respectively given the names `aa`, `ab`, `ac`, ..., `zy`, `zz`; * the dogs numbered 703,704,705,\cdots,18277,18278 were respectively given the names `aaa`, `aab`, `aac`, ..., `zzy`, `zzz`; * the dogs numbered 18279,18280,18281,\cdots,475253,475254 were respectively given the names `aaaa`, `aaab`, `aaac`, ..., `zzzy`, `zzzz`; * the dogs numbered 475255,475256,\cdots were respectively given the names `aaaaa`, `aaaab`, ...; * and so on. To sum it up, the dogs numbered 1, 2, \cdots were respectively given the following names: `a`, `b`, ..., `z`, `aa`, `ab`, ..., `az`, `ba`, `bb`, ..., `bz`, ..., `za`, `zb`, ..., `zz`, `aaa`, `aab`, ..., `aaz`, `aba`, `abb`, ..., `abz`, ..., `zzz`, `aaaa`, ... Now, Roger asks you: "What is the name for the dog numbered N?" | ["import string\n\nn = int(input())\nalphabets = string.ascii_lowercase\nanswer = []\nwhile n >= 1:\n\tn -= 1\n answer.append(alphabets[n % 26])\n n = n//26\nans = ''.join(list(reversed(answer)))\nprint(ans)\n", "import string\n\nn = int(input())\nalphabets = string.ascii_lowercase\nanswer = []\nwhile n >= 1:\n n -= 1\n answer.append(alphabets[n % 26])\n n = n//26\nans = ''.join(list(reversed(answer)))\nprint(ans)\n"] | ['Runtime Error', 'Accepted'] | ['s910433932', 's816669298'] | [8956.0, 9876.0] | [28.0, 35.0] | [201, 204] |
p02629 | u821969418 | 2,000 | 1,048,576 | 1000000000000001 dogs suddenly appeared under the roof of Roger's house, all of which he decided to keep. The dogs had been numbered 1 through 1000000000000001, but he gave them new names, as follows: * the dogs numbered 1,2,\cdots,26 were respectively given the names `a`, `b`, ..., `z`; * the dogs numbered 27,28,29,\cdots,701,702 were respectively given the names `aa`, `ab`, `ac`, ..., `zy`, `zz`; * the dogs numbered 703,704,705,\cdots,18277,18278 were respectively given the names `aaa`, `aab`, `aac`, ..., `zzy`, `zzz`; * the dogs numbered 18279,18280,18281,\cdots,475253,475254 were respectively given the names `aaaa`, `aaab`, `aaac`, ..., `zzzy`, `zzzz`; * the dogs numbered 475255,475256,\cdots were respectively given the names `aaaaa`, `aaaab`, ...; * and so on. To sum it up, the dogs numbered 1, 2, \cdots were respectively given the following names: `a`, `b`, ..., `z`, `aa`, `ab`, ..., `az`, `ba`, `bb`, ..., `bz`, ..., `za`, `zb`, ..., `zz`, `aaa`, `aab`, ..., `aaz`, `aba`, `abb`, ..., `abz`, ..., `zzz`, `aaaa`, ... Now, Roger asks you: "What is the name for the dog numbered N?" | ['n=int(input())\nchars = "Xabcdefghijklmnopqrstuvwxyz"\n\nn_rem = n\nans = ""\n\nwhile True:\n x = n_rem%26\n if x == 0:\n x = 26\n ans += chars[x]\n\n n_rem -= x\n\n if n_rem == 0:\n break\n\n n_rem //==26\n\nprint(ans[::-1])', 'n=int(input())\nchars = "Xabcdefghijklmnopqrstuvwxyz"\n\nn_rem = n\nans = ""\n\nwhile True:\n x = n_rem%26\n if x == 0:\n x = 26\n ans += chars[x]\n\n n_rem -= x\n\n if n_rem == 0:\n break\n\n n_rem //=26\n\nprint(ans[::-1])\n'] | ['Runtime Error', 'Accepted'] | ['s177318365', 's573018809'] | [8992.0, 9136.0] | [26.0, 28.0] | [238, 238] |
p02629 | u829203929 | 2,000 | 1,048,576 | 1000000000000001 dogs suddenly appeared under the roof of Roger's house, all of which he decided to keep. The dogs had been numbered 1 through 1000000000000001, but he gave them new names, as follows: * the dogs numbered 1,2,\cdots,26 were respectively given the names `a`, `b`, ..., `z`; * the dogs numbered 27,28,29,\cdots,701,702 were respectively given the names `aa`, `ab`, `ac`, ..., `zy`, `zz`; * the dogs numbered 703,704,705,\cdots,18277,18278 were respectively given the names `aaa`, `aab`, `aac`, ..., `zzy`, `zzz`; * the dogs numbered 18279,18280,18281,\cdots,475253,475254 were respectively given the names `aaaa`, `aaab`, `aaac`, ..., `zzzy`, `zzzz`; * the dogs numbered 475255,475256,\cdots were respectively given the names `aaaaa`, `aaaab`, ...; * and so on. To sum it up, the dogs numbered 1, 2, \cdots were respectively given the following names: `a`, `b`, ..., `z`, `aa`, `ab`, ..., `az`, `ba`, `bb`, ..., `bz`, ..., `za`, `zb`, ..., `zz`, `aaa`, `aab`, ..., `aaz`, `aba`, `abb`, ..., `abz`, ..., `zzz`, `aaaa`, ... Now, Roger asks you: "What is the name for the dog numbered N?" | ['# coding: utf-8\nn = int(input())\n# n = 26 + 26**2\n\nans = 0\n\ncount = 1\nwhile ans < n:\n ans += 26 ** count\n count += 1\n \ncount -= 1\n# print("coount:{}".format(count))\n\narray = []\ntmp = n\nfor i in range(count, -1, -1):\n # print(i, tmp)\n for j in range(26, 0, -1):\n if tmp >= 26 ** i * j:\n \n tmp -= 26 ** i * j\n j = 26 if j == 1 else j\n array.append(j)\n break\n \nnum2alpha = lambda x: chr(x+64)\nfor i in array:\n print(num2alpha(i).lower(), end="")', '# coding: utf-8\nn = int(input())\n\nans = 0\n\ncount = 1\nwhile ans <= n:\n ans += 26 ** count\n count += 1\n \ncount -= 1\n\narray = []\ntmp = n\nfor i in range(count, -1, -1):\n for j in range(26, 0, -1):\n if tmp >= 26 ** i * j:\n tmp -= 26 ** i * j\n array.append(j)\n break\n \nnum2alpha = lambda x: chr(x+64)\nfor i in array:\n print(num2alpha(i).lower(), end="")', '# coding: utf-8\n# Your code here!\ndef num2alpha(x):\n if x <= 26:\n return chr(x + 64).lower()\n elif x % 26 == 0:\n return num2alpha(x // 26 -1) + chr(90).lower()\n else:\n return num2alpha(x // 26) + chr(x % 26 + 64).lower() \n\ndef main():\n n = int(input())\n print(num2alpha(n))\n \nmain()'] | ['Wrong Answer', 'Wrong Answer', 'Accepted'] | ['s073164479', 's509134101', 's949378713'] | [9100.0, 8960.0, 9096.0] | [29.0, 30.0, 31.0] | [555, 409, 322] |
p02629 | u829796346 | 2,000 | 1,048,576 | 1000000000000001 dogs suddenly appeared under the roof of Roger's house, all of which he decided to keep. The dogs had been numbered 1 through 1000000000000001, but he gave them new names, as follows: * the dogs numbered 1,2,\cdots,26 were respectively given the names `a`, `b`, ..., `z`; * the dogs numbered 27,28,29,\cdots,701,702 were respectively given the names `aa`, `ab`, `ac`, ..., `zy`, `zz`; * the dogs numbered 703,704,705,\cdots,18277,18278 were respectively given the names `aaa`, `aab`, `aac`, ..., `zzy`, `zzz`; * the dogs numbered 18279,18280,18281,\cdots,475253,475254 were respectively given the names `aaaa`, `aaab`, `aaac`, ..., `zzzy`, `zzzz`; * the dogs numbered 475255,475256,\cdots were respectively given the names `aaaaa`, `aaaab`, ...; * and so on. To sum it up, the dogs numbered 1, 2, \cdots were respectively given the following names: `a`, `b`, ..., `z`, `aa`, `ab`, ..., `az`, `ba`, `bb`, ..., `bz`, ..., `za`, `zb`, ..., `zz`, `aaa`, `aab`, ..., `aaz`, `aba`, `abb`, ..., `abz`, ..., `zzz`, `aaaa`, ... Now, Roger asks you: "What is the name for the dog numbered N?" | ['#!/usr/bin/env python3\n# N,M = map(int,sys.stdin.readline().split())\n# a = tuple(map(int,sys.stdin.readline().split())) # single line with multi param\n# a = tuple(int(sys.stdin.readline()) for _ in range(N)) # multi line with single param\n# a = tuple(tuple(map(int,sys.stdin.readline().rstrip().split())) for _ in range(N)) # multi line with multi param\n\n# N = int(sys.stdin.readline())\n# INF = float("inf")\nimport sys,collections\n\nN = int(sys.stdin.readline())\nA = tuple(map(int,sys.stdin.readline().split())) # single line with multi param\nQ = int(sys.stdin.readline())\nBC = tuple(tuple(map(int,sys.stdin.readline().rstrip().split())) for _ in range(Q)) # multi line with multi param\nco = collections.Counter(A)\ns = sum(A)\n\nfor b,c in BC:\n if b in co:\n n = co[b]\n del(co[b])\n co[c] += n\n s += (c-b)*n\n print(s)', '#!/usr/bin/env python3\n# N,M = map(int,sys.stdin.readline().split())\n# a = tuple(map(int,sys.stdin.readline().split())) # single line with multi param\n# a = tuple(int(sys.stdin.readline()) for _ in range(N)) # multi line with single param\n# a = tuple(tuple(map(int,sys.stdin.readline().rstrip().split())) for _ in range(N)) # multi line with multi param\n\n# N = int(sys.stdin.readline())\n# INF = float("inf")\nimport sys\n\nN = int(sys.stdin.readline())\n\n\ndef Base_10_to_n(X, n):\n m = chr(X%n+ord("a"))\n if (X//n):\n return Base_10_to_n(X//n-1, n)+m\n return m\n\nprint(N)print(Base_10_to_n(N-1,26))', '#!/usr/bin/env python3\n# N,M = map(int,sys.stdin.readline().split())\n# a = tuple(map(int,sys.stdin.readline().split())) # single line with multi param\n# a = tuple(int(sys.stdin.readline()) for _ in range(N)) # multi line with single param\n# a = tuple(tuple(map(int,sys.stdin.readline().rstrip().split())) for _ in range(N)) # multi line with multi param\n\n# N = int(sys.stdin.readline())\n# INF = float("inf")\nimport sys\n\nN = int(sys.stdin.readline())\n\n\ndef Base_10_to_n(X, n):\n m = chr(X%n+ord("a"))\n if (X//n):\n return Base_10_to_n(X//n-1, n)+m\n return m\n\nprint(Base_10_to_n(N-1,26))\n'] | ['Runtime Error', 'Runtime Error', 'Accepted'] | ['s151245640', 's806909081', 's965784855'] | [9224.0, 9028.0, 9168.0] | [35.0, 30.0, 31.0] | [881, 642, 635] |
p02629 | u835095496 | 2,000 | 1,048,576 | 1000000000000001 dogs suddenly appeared under the roof of Roger's house, all of which he decided to keep. The dogs had been numbered 1 through 1000000000000001, but he gave them new names, as follows: * the dogs numbered 1,2,\cdots,26 were respectively given the names `a`, `b`, ..., `z`; * the dogs numbered 27,28,29,\cdots,701,702 were respectively given the names `aa`, `ab`, `ac`, ..., `zy`, `zz`; * the dogs numbered 703,704,705,\cdots,18277,18278 were respectively given the names `aaa`, `aab`, `aac`, ..., `zzy`, `zzz`; * the dogs numbered 18279,18280,18281,\cdots,475253,475254 were respectively given the names `aaaa`, `aaab`, `aaac`, ..., `zzzy`, `zzzz`; * the dogs numbered 475255,475256,\cdots were respectively given the names `aaaaa`, `aaaab`, ...; * and so on. To sum it up, the dogs numbered 1, 2, \cdots were respectively given the following names: `a`, `b`, ..., `z`, `aa`, `ab`, ..., `az`, `ba`, `bb`, ..., `bz`, ..., `za`, `zb`, ..., `zz`, `aaa`, `aab`, ..., `aaz`, `aba`, `abb`, ..., `abz`, ..., `zzz`, `aaaa`, ... Now, Roger asks you: "What is the name for the dog numbered N?" | ["def run(n):\n '''\n '''\n _base_array = string.ascii_lowercase\n results = []\n while n > 0:\n results.append(_base_array[n%26 - 1])\n if n%26 == 0:\n n = n//26 - 1\n continue\n n = n//26\n\n print(''.join(results[::-1]))\n\n\n\nif __name__ == '__main__':\n n = int(input())\n run(n)", "import string\n\ndef run(n):\n '''\n '''\n _base_array = string.ascii_lowercase\n results = []\n while n > 0:\n results.append(_base_array[n%26 - 1])\n if n%26 == 0:\n n = n//26 - 1\n continue\n n = n//26\n\n print(''.join(results[::-1]))\n\n\n\nif __name__ == '__main__':\n n = int(input())\n run(n)"] | ['Runtime Error', 'Accepted'] | ['s821114685', 's359748485'] | [9200.0, 9988.0] | [25.0, 40.0] | [332, 347] |
p02629 | u836311327 | 2,000 | 1,048,576 | 1000000000000001 dogs suddenly appeared under the roof of Roger's house, all of which he decided to keep. The dogs had been numbered 1 through 1000000000000001, but he gave them new names, as follows: * the dogs numbered 1,2,\cdots,26 were respectively given the names `a`, `b`, ..., `z`; * the dogs numbered 27,28,29,\cdots,701,702 were respectively given the names `aa`, `ab`, `ac`, ..., `zy`, `zz`; * the dogs numbered 703,704,705,\cdots,18277,18278 were respectively given the names `aaa`, `aab`, `aac`, ..., `zzy`, `zzz`; * the dogs numbered 18279,18280,18281,\cdots,475253,475254 were respectively given the names `aaaa`, `aaab`, `aaac`, ..., `zzzy`, `zzzz`; * the dogs numbered 475255,475256,\cdots were respectively given the names `aaaaa`, `aaaab`, ...; * and so on. To sum it up, the dogs numbered 1, 2, \cdots were respectively given the following names: `a`, `b`, ..., `z`, `aa`, `ab`, ..., `az`, `ba`, `bb`, ..., `bz`, ..., `za`, `zb`, ..., `zz`, `aaa`, `aab`, ..., `aaz`, `aba`, `abb`, ..., `abz`, ..., `zzz`, `aaaa`, ... Now, Roger asks you: "What is the name for the dog numbered N?" | ["n = int(input())\n\nsu=[26**i for i in range(1,20)]\nfrom itertools import accumulate\nwa = list(accumulate(su)) \nimport bisect\nc = 0\nn = n-1\nif n>26:\n c=bisect.bisect_left(wa, n)\n n=n-wa[c-1]\nm = n\nk=26\nbi=[]\nfor i in range(c+1):\n \n bi.append(n % k)\n n = (n-n%k)//k\nprint(bi)\nal=[chr(ord('a') + i) for i in range(26)]\n\nli = [al[i] for i in bi]\nli.reverse()\nif m in su:\n li.append('a')\n\nmojiretu = ''.join(li)\n\nprint(mojiretu)", "n = int(input())\n\nsu=[26**i for i in range(1,20)]\nfrom itertools import accumulate\nwa = list(accumulate(su)) \nimport bisect\nc = 0\nif n>27:\n c=bisect.bisect_left(wa, n)\n n=n-wa[c-1]-1\n\nk=26\nbi=[]\nfor i in range(c+1):\n \n bi.append(n % k)\n n = (n-n%k)//k\n\nal=[chr(ord('a') + i) for i in range(26)]\n\nli = [al[i] for i in bi]\nli.reverse()\n\nmojiretu = ''.join(li)\n\nprint(mojiretu)", "n = int(input())\n\nsu=[26**i for i in range(1,10)]\nfrom itertools import accumulate\nwa = list(accumulate(su)) \nimport bisect\nc = 0\nif n>27:\n c=bisect.bisect_left(wa, n)\n n=n-wa[c-1]-1\n\nk=26\nbi=[]\nfor i in range(c+1):\n \n bi.append(n % k)\n n = (n-n%k)//k\n\nal=[chr(ord('a') + i) for i in range(26)]\n\nli = [al[i] for i in bi]\nli.reverse()\n\nmojiretu = ''.join(li)\n\nprint(mojiretu)", "n = int(input())\n\nsu=[26**i for i in range(1,20)]\nfrom itertools import accumulate\nwa = list(accumulate(su)) \nimport bisect\nc = 0\nn = n-1\nif n>26:\n c=bisect.bisect_left(wa, n)\n n=n-wa[c-1]\nm = n\nk=26\nbi=[]\nfor i in range(c+1):\n \n bi.append(n % k)\n n = (n-n%k)//k\n \nal=[chr(ord('a') + i) for i in range(26)]\n\nli = [al[i] for i in bi]\nli.reverse()\nif m in su:\n li.append('a')\n\nmojiretu = ''.join(li)\n\nprint(mojiretu)"] | ['Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Accepted'] | ['s024655013', 's120172771', 's732101911', 's696158280'] | [9132.0, 9156.0, 9216.0, 9220.0] | [33.0, 26.0, 28.0, 28.0] | [442, 393, 393, 439] |
p02629 | u840570107 | 2,000 | 1,048,576 | 1000000000000001 dogs suddenly appeared under the roof of Roger's house, all of which he decided to keep. The dogs had been numbered 1 through 1000000000000001, but he gave them new names, as follows: * the dogs numbered 1,2,\cdots,26 were respectively given the names `a`, `b`, ..., `z`; * the dogs numbered 27,28,29,\cdots,701,702 were respectively given the names `aa`, `ab`, `ac`, ..., `zy`, `zz`; * the dogs numbered 703,704,705,\cdots,18277,18278 were respectively given the names `aaa`, `aab`, `aac`, ..., `zzy`, `zzz`; * the dogs numbered 18279,18280,18281,\cdots,475253,475254 were respectively given the names `aaaa`, `aaab`, `aaac`, ..., `zzzy`, `zzzz`; * the dogs numbered 475255,475256,\cdots were respectively given the names `aaaaa`, `aaaab`, ...; * and so on. To sum it up, the dogs numbered 1, 2, \cdots were respectively given the following names: `a`, `b`, ..., `z`, `aa`, `ab`, ..., `az`, `ba`, `bb`, ..., `bz`, ..., `za`, `zb`, ..., `zz`, `aaa`, `aab`, ..., `aaz`, `aba`, `abb`, ..., `abz`, ..., `zzz`, `aaaa`, ... Now, Roger asks you: "What is the name for the dog numbered N?" | ['n = int(input())\nlis = ["", "a", "b", "c", "d", "e", "f",\n "g", "h", "i", "j", "k", "l", "m",\n "n", "o", "p", "q", "r", "s", "t", \n "u", "v", "w", "y", "x", "z"]\nlis2 = []\nans = ""\n\nwhile True:\n if n % 26 == 0:\n lis2.append(26)\n n = n // 26\n if n == 1:\n break\n else:\n p = n % 26\n n = n // 26\n lis2.append(p)\n\nfor i in lis2[::-1]:\n ans += lis[i]\n\nprint(ans)\n', 'n = int(input())\nabc="abcdefghijklmnopqrstuvwxyz"\nans = ""\n\nwhile True:\n n -= 1\n m = n % 26\n ans += abc[m]\n n = n // 26\n if n == 0:\n break\n \nprint(ans[::-1])\n'] | ['Wrong Answer', 'Accepted'] | ['s749930547', 's377463841'] | [134140.0, 9124.0] | [2210.0, 29.0] | [401, 169] |
p02629 | u843135954 | 2,000 | 1,048,576 | 1000000000000001 dogs suddenly appeared under the roof of Roger's house, all of which he decided to keep. The dogs had been numbered 1 through 1000000000000001, but he gave them new names, as follows: * the dogs numbered 1,2,\cdots,26 were respectively given the names `a`, `b`, ..., `z`; * the dogs numbered 27,28,29,\cdots,701,702 were respectively given the names `aa`, `ab`, `ac`, ..., `zy`, `zz`; * the dogs numbered 703,704,705,\cdots,18277,18278 were respectively given the names `aaa`, `aab`, `aac`, ..., `zzy`, `zzz`; * the dogs numbered 18279,18280,18281,\cdots,475253,475254 were respectively given the names `aaaa`, `aaab`, `aaac`, ..., `zzzy`, `zzzz`; * the dogs numbered 475255,475256,\cdots were respectively given the names `aaaaa`, `aaaab`, ...; * and so on. To sum it up, the dogs numbered 1, 2, \cdots were respectively given the following names: `a`, `b`, ..., `z`, `aa`, `ab`, ..., `az`, `ba`, `bb`, ..., `bz`, ..., `za`, `zb`, ..., `zz`, `aaa`, `aab`, ..., `aaz`, `aba`, `abb`, ..., `abz`, ..., `zzz`, `aaaa`, ... Now, Roger asks you: "What is the name for the dog numbered N?" | ["import sys\nstdin = sys.stdin\nsys.setrecursionlimit(10**6)\nni = lambda: int(ns())\nna = lambda: list(map(int, stdin.readline().split()))\nnn = lambda: list(stdin.readline().split())\nns = lambda: stdin.readline().rstrip()\n\nn = ni()\n\ndef f(k):\n return chr(97+k)\n\nc = 0\ni = 1\nwhile True:\n d = c+pow(26,i)\n if c < n <= d:\n break\n c = d\n i+=1\n\nm = n-c-1\nprint(m)\nans = ''\nwhile m > 26:\n ans = f(m%26) + ans\n m = m//26\nans = f(m%26) + ans\n\nans = 'a'*(i-len(ans)) + ans\n\nprint(ans)", "import sys\nstdin = sys.stdin\nsys.setrecursionlimit(10**6)\nni = lambda: int(ns())\nna = lambda: list(map(int, stdin.readline().split()))\nnn = lambda: list(stdin.readline().split())\nns = lambda: stdin.readline().rstrip()\n\nn = ni()\n\ndef f(k):\n return chr(97+k)\n\nc = 0\ni = 1\nwhile True:\n d = c+pow(26,i)\n if c < n <= d:\n break\n c = d\n i+=1\n\nm = n-c-1\n\nans = ''\nwhile m >= 26:\n ans = f(m%26) + ans\n m = m//26\nans = f(m%26) + ans\n\nans = 'a'*(i-len(ans)) + ans\n\nprint(ans)"] | ['Wrong Answer', 'Accepted'] | ['s468032610', 's344022137'] | [9044.0, 9204.0] | [30.0, 33.0] | [499, 492] |
p02629 | u845573105 | 2,000 | 1,048,576 | 1000000000000001 dogs suddenly appeared under the roof of Roger's house, all of which he decided to keep. The dogs had been numbered 1 through 1000000000000001, but he gave them new names, as follows: * the dogs numbered 1,2,\cdots,26 were respectively given the names `a`, `b`, ..., `z`; * the dogs numbered 27,28,29,\cdots,701,702 were respectively given the names `aa`, `ab`, `ac`, ..., `zy`, `zz`; * the dogs numbered 703,704,705,\cdots,18277,18278 were respectively given the names `aaa`, `aab`, `aac`, ..., `zzy`, `zzz`; * the dogs numbered 18279,18280,18281,\cdots,475253,475254 were respectively given the names `aaaa`, `aaab`, `aaac`, ..., `zzzy`, `zzzz`; * the dogs numbered 475255,475256,\cdots were respectively given the names `aaaaa`, `aaaab`, ...; * and so on. To sum it up, the dogs numbered 1, 2, \cdots were respectively given the following names: `a`, `b`, ..., `z`, `aa`, `ab`, ..., `az`, `ba`, `bb`, ..., `bz`, ..., `za`, `zb`, ..., `zz`, `aaa`, `aab`, ..., `aaz`, `aba`, `abb`, ..., `abz`, ..., `zzz`, `aaaa`, ... Now, Roger asks you: "What is the name for the dog numbered N?" | ['\nN, K = map(int, input().split())\nA = list(map(int, input().split()))\n\n\n\nfor k in range(K): \n B = [0 for _ in range(N)] \n for i in range(N): \n start = max(0, i-A[i]) \n end = min(N, i+A[i]+1) \n B[start] += 1 \n if end <= N - 1:\n B[end] -= 1 \n amin = B[0]\n A[0] = B[0] \n for i in range(1, N): \n A[i] = B[i-1] + B[i]\n amin = min(A[i], amin) \n if amin == N: \n break\n\nprint(*A) ', 'N = int(input())\na = 26\ncounter = 1\nwhile a<N:\n N -= a\n counter += 1\n a *= 26\nans = []\nN=-1\nwhile N>26\n ans.append(N%26)\n N = N //26\nans.append(N)\ndic = ["a", "b", "c", "d", "e", "f", "g", "h", "i", "j", "k", "l", "m", "n", "o", "p", "q", "r", "s", "t", "u", "v", "w", "x", "y", "z"]\nans = [dic[i] for i in ans[::-1]]\nn = len(ans)\nprint("a"*(conter-n) + "".join(ans))', 'N = int(input())\na = 26\ncounter = 1\nwhile a<N:\n N -= a\n counter += 1\n a *= 26\nans = []\nN -= 1\nwhile N>=26:\n ans.append(N%26)\n N = N //26\nans.append(N)\ndic = ["a", "b", "c", "d", "e", "f", "g", "h", "i", "j", "k", "l", "m", "n", "o", "p", "q", "r", "s", "t", "u", "v", "w", "x", "y", "z"]\nans = [dic[i] for i in ans[::-1]]\nn = len(ans)\nprint("a"*(counter-n) + "".join(ans))'] | ['Runtime Error', 'Runtime Error', 'Accepted'] | ['s045015110', 's865371855', 's275598234'] | [9232.0, 9024.0, 9000.0] | [25.0, 26.0, 30.0] | [1156, 372, 377] |
p02629 | u849341325 | 2,000 | 1,048,576 | 1000000000000001 dogs suddenly appeared under the roof of Roger's house, all of which he decided to keep. The dogs had been numbered 1 through 1000000000000001, but he gave them new names, as follows: * the dogs numbered 1,2,\cdots,26 were respectively given the names `a`, `b`, ..., `z`; * the dogs numbered 27,28,29,\cdots,701,702 were respectively given the names `aa`, `ab`, `ac`, ..., `zy`, `zz`; * the dogs numbered 703,704,705,\cdots,18277,18278 were respectively given the names `aaa`, `aab`, `aac`, ..., `zzy`, `zzz`; * the dogs numbered 18279,18280,18281,\cdots,475253,475254 were respectively given the names `aaaa`, `aaab`, `aaac`, ..., `zzzy`, `zzzz`; * the dogs numbered 475255,475256,\cdots were respectively given the names `aaaaa`, `aaaab`, ...; * and so on. To sum it up, the dogs numbered 1, 2, \cdots were respectively given the following names: `a`, `b`, ..., `z`, `aa`, `ab`, ..., `az`, `ba`, `bb`, ..., `bz`, ..., `za`, `zb`, ..., `zz`, `aaa`, `aab`, ..., `aaz`, `aba`, `abb`, ..., `abz`, ..., `zzz`, `aaaa`, ... Now, Roger asks you: "What is the name for the dog numbered N?" | ['N = int(input())\n\nk = list()\nwhile(N >= 27):\n a = int(N%26)\n if a==0:\n a =26\n k.insert(0,a)\n N = (N-a)/26\n\nk.insert(0,int(N))\nans = str()\nfor i in range(len(k)):\n x = k[i] + 64 +32\n ans = ans + str(chr(x))\nprint(k)\nprint(ans)', 'N = int(input())\n\nk = list()\nwhile(N >= 27):\n a = int(N%26)\n if a==0:\n a =26\n k.insert(0,a)\n N = (N-a)/26\n\nk.insert(0,int(N))\nans = str()\nfor i in range(len(k)):\n x = k[i] + 64 +32\n ans = ans + str(chr(x))\n#print(k)\nprint(ans)'] | ['Wrong Answer', 'Accepted'] | ['s214091723', 's119262520'] | [9012.0, 9232.0] | [32.0, 27.0] | [234, 235] |
p02629 | u854962015 | 2,000 | 1,048,576 | 1000000000000001 dogs suddenly appeared under the roof of Roger's house, all of which he decided to keep. The dogs had been numbered 1 through 1000000000000001, but he gave them new names, as follows: * the dogs numbered 1,2,\cdots,26 were respectively given the names `a`, `b`, ..., `z`; * the dogs numbered 27,28,29,\cdots,701,702 were respectively given the names `aa`, `ab`, `ac`, ..., `zy`, `zz`; * the dogs numbered 703,704,705,\cdots,18277,18278 were respectively given the names `aaa`, `aab`, `aac`, ..., `zzy`, `zzz`; * the dogs numbered 18279,18280,18281,\cdots,475253,475254 were respectively given the names `aaaa`, `aaab`, `aaac`, ..., `zzzy`, `zzzz`; * the dogs numbered 475255,475256,\cdots were respectively given the names `aaaaa`, `aaaab`, ...; * and so on. To sum it up, the dogs numbered 1, 2, \cdots were respectively given the following names: `a`, `b`, ..., `z`, `aa`, `ab`, ..., `az`, `ba`, `bb`, ..., `bz`, ..., `za`, `zb`, ..., `zz`, `aaa`, `aab`, ..., `aaz`, `aba`, `abb`, ..., `abz`, ..., `zzz`, `aaaa`, ... Now, Roger asks you: "What is the name for the dog numbered N?" | ['N=int(input())\nA=list(map(int,input().split()))\nS=0\nB=[0]*10**5+1\nfor i in A:\n S+=i\n B[i]+=1 \nQ=int(input())\nC=[list(map(int,input().split())) for i in range(Q)]\nfor i in range(Q):\n S=S+(C[i][1]-C[i][0])*B[C[i][0]]\n B[C[i][1]]+=B[C[i][0]]\n B[C[i][0]]=0\n print(S)\n', 'N=int(input())-1\nL=[]\nS=[]\nA=[chr(i) for i in range(97,123)]\nX=""\nwhile N>=0:\n if N==0:\n L.append(N%26)\n N=N//26\n break\n elif N!=0:\n L.append(N%26)\n N=N//26-1\nS=list(reversed(L))\nfor i in range(len(S)):\n X+=A[S[i]]\nprint(str(X))\n\n '] | ['Runtime Error', 'Accepted'] | ['s132371320', 's697271930'] | [9128.0, 8996.0] | [31.0, 28.0] | [302, 250] |
p02629 | u854992222 | 2,000 | 1,048,576 | 1000000000000001 dogs suddenly appeared under the roof of Roger's house, all of which he decided to keep. The dogs had been numbered 1 through 1000000000000001, but he gave them new names, as follows: * the dogs numbered 1,2,\cdots,26 were respectively given the names `a`, `b`, ..., `z`; * the dogs numbered 27,28,29,\cdots,701,702 were respectively given the names `aa`, `ab`, `ac`, ..., `zy`, `zz`; * the dogs numbered 703,704,705,\cdots,18277,18278 were respectively given the names `aaa`, `aab`, `aac`, ..., `zzy`, `zzz`; * the dogs numbered 18279,18280,18281,\cdots,475253,475254 were respectively given the names `aaaa`, `aaab`, `aaac`, ..., `zzzy`, `zzzz`; * the dogs numbered 475255,475256,\cdots were respectively given the names `aaaaa`, `aaaab`, ...; * and so on. To sum it up, the dogs numbered 1, 2, \cdots were respectively given the following names: `a`, `b`, ..., `z`, `aa`, `ab`, ..., `az`, `ba`, `bb`, ..., `bz`, ..., `za`, `zb`, ..., `zz`, `aaa`, `aab`, ..., `aaz`, `aba`, `abb`, ..., `abz`, ..., `zzz`, `aaaa`, ... Now, Roger asks you: "What is the name for the dog numbered N?" | ["n = int(input())\n\nx = []\nfor i in range(1, 11):\n x.append(26 ** i)\n\ncount = 0\n\n\n# if n > i:\n# n = n - i\n# count += 1\n\nprint(n)\n\ndef base26(value): # 10 => 2\n try:\n tmp = int(value)\n except:\n raise ValueError('Invalid value:', value)\n \n \n result = []\n tmp = int(value)\n while tmp >= 26:\n result.append(str(tmp%26))\n tmp = int(tmp / 26)\n result.append(str(tmp%26))\n result = list(reversed(result))\n return result\n\nalp = [\n '0', 'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j',\n 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', \n 'v', 'w', 'x', 'y', 'z'\n]\n\nans = base26(n)\nans2 = []\n\nfor i in ans:\n ans2.append(alp[int(i)])\n\nprint(''.join(ans2))", "n = int(input())\n\nx = []\nfor i in range(1, 11):\n x.append(26 ** i)\n\ncount = 1\n\nfor i in x:\n if n > i:\n n = n - i\n count += 1\n\ndef base26(value): # 10 => 2\n x = 26\n try:\n tmp = int(value)\n except:\n raise ValueError('Invalid value:', value)\n \n result = []\n tmp = int(value)\n while tmp >= x:\n result.append(str(tmp%x))\n tmp = int(tmp / x)\n result.append(str(tmp%x))\n return result\n\nalp = [\n 'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j',\n 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', \n 'u', 'v', 'w', 'x', 'y', 'z'\n]\n\nans = base26(n-1)\nans2 = ['a'] * count\n\nfor i in range(len(ans)):\n ans2[i] = alp[int(ans[i])]\n\nans2 = list(reversed(ans2))\n\nprint(''.join(ans2))"] | ['Wrong Answer', 'Accepted'] | ['s302825751', 's856257556'] | [9256.0, 9272.0] | [30.0, 30.0] | [845, 751] |
p02629 | u855967722 | 2,000 | 1,048,576 | 1000000000000001 dogs suddenly appeared under the roof of Roger's house, all of which he decided to keep. The dogs had been numbered 1 through 1000000000000001, but he gave them new names, as follows: * the dogs numbered 1,2,\cdots,26 were respectively given the names `a`, `b`, ..., `z`; * the dogs numbered 27,28,29,\cdots,701,702 were respectively given the names `aa`, `ab`, `ac`, ..., `zy`, `zz`; * the dogs numbered 703,704,705,\cdots,18277,18278 were respectively given the names `aaa`, `aab`, `aac`, ..., `zzy`, `zzz`; * the dogs numbered 18279,18280,18281,\cdots,475253,475254 were respectively given the names `aaaa`, `aaab`, `aaac`, ..., `zzzy`, `zzzz`; * the dogs numbered 475255,475256,\cdots were respectively given the names `aaaaa`, `aaaab`, ...; * and so on. To sum it up, the dogs numbered 1, 2, \cdots were respectively given the following names: `a`, `b`, ..., `z`, `aa`, `ab`, ..., `az`, `ba`, `bb`, ..., `bz`, ..., `za`, `zb`, ..., `zz`, `aaa`, `aab`, ..., `aaz`, `aba`, `abb`, ..., `abz`, ..., `zzz`, `aaaa`, ... Now, Roger asks you: "What is the name for the dog numbered N?" | ['N = int(input())\nalf = [chr(i) for i in range(97, 97+26)]\nList = []\nfor i in range(100):\n if N > 26:\n N -= 1\n a = N % 26\n N = N // 26\n List.append(alf[a-1])\n else:\n break\n \n\nprint("".join(List))\n', 'N = int(input())\nalf = [chr(i) for i in range(97, 97+26)]\nList = []\nfor i in range(100):\n if N > 0:\n N -= 1\n a = N % 26\n N = N // 26\n List.append(alf[a])\n else:\n break\n \n\nprint("".join(List[::-1]))\n'] | ['Wrong Answer', 'Accepted'] | ['s151481335', 's518177877'] | [9120.0, 9112.0] | [30.0, 28.0] | [215, 218] |
p02629 | u856819253 | 2,000 | 1,048,576 | 1000000000000001 dogs suddenly appeared under the roof of Roger's house, all of which he decided to keep. The dogs had been numbered 1 through 1000000000000001, but he gave them new names, as follows: * the dogs numbered 1,2,\cdots,26 were respectively given the names `a`, `b`, ..., `z`; * the dogs numbered 27,28,29,\cdots,701,702 were respectively given the names `aa`, `ab`, `ac`, ..., `zy`, `zz`; * the dogs numbered 703,704,705,\cdots,18277,18278 were respectively given the names `aaa`, `aab`, `aac`, ..., `zzy`, `zzz`; * the dogs numbered 18279,18280,18281,\cdots,475253,475254 were respectively given the names `aaaa`, `aaab`, `aaac`, ..., `zzzy`, `zzzz`; * the dogs numbered 475255,475256,\cdots were respectively given the names `aaaaa`, `aaaab`, ...; * and so on. To sum it up, the dogs numbered 1, 2, \cdots were respectively given the following names: `a`, `b`, ..., `z`, `aa`, `ab`, ..., `az`, `ba`, `bb`, ..., `bz`, ..., `za`, `zb`, ..., `zz`, `aaa`, `aab`, ..., `aaz`, `aba`, `abb`, ..., `abz`, ..., `zzz`, `aaaa`, ... Now, Roger asks you: "What is the name for the dog numbered N?" | ['import sys\nfrom numba import njit\nfrom numba import prange\n\nimport re\n\ndef L(): return sys.stdin.readline().rstrip()\ndef I(): return int(sys.stdin.readline().rstrip())\ndef LI():return list(map(int,sys.stdin.readline().rstrip().split()))\ndef LS():return list(sys.stdin.readline().rstrip().split())\n\nalp = list("abcdefghijklmnopqrstuvwxyz")\n\ndef div26(N):\n #print("N=",N)\n a = N // 26\n b = N % 26\n #print(a,b)\n return [a,b]\n\ndef getAlp(N):\n if N==0:\n N = 26\n return alp[N-1]\n\nimport math\ndef solver(N):\n\n ans = ""\n\n x = div26(N)\n ans += getAlp(x[1])\n if x[1]==0:\n x[0] -= 1\n\n print("ans=",ans)\n\n while x[0] > 0:\n #print("in")\n x = div26(x[0])\n ans += getAlp(x[1])\n if x[1]==0:\n x[0] -= 1\n\n\n\n print(ans[::-1])\n\n\n\n\ndef main():\n N = I()\n #print(N,K,Pn)\n solver(N)\n\nif __name__ == \'__main__\':\n main()\n', 'import sys\n\ndef L(): return sys.stdin.readline().rstrip()\ndef I(): return int(sys.stdin.readline().rstrip())\ndef LI():return list(map(int,sys.stdin.readline().rstrip().split()))\ndef LS():return list(sys.stdin.readline().rstrip().split())\n\nalp = list("abcdefghijklmnopqrstuvwxyz")\n\ndef div26(N):\n #print("N=",N)\n a = N // 26\n b = N % 26\n #print(a,b)\n return [a,b]\n\ndef getAlp(N):\n if N==0:\n N = 26\n return alp[N-1]\n\ndef solver(N):\n\n ans = ""\n\n x = div26(N)\n ans += getAlp(x[1])\n if x[1]==0:\n x[0] -= 1\n\n #print("ans=",ans)\n\n while x[0] > 0:\n #print("in")\n x = div26(x[0])\n ans += getAlp(x[1])\n if x[1]==0:\n x[0] -= 1\n\n print(ans[::-1])\n\n\n\n\ndef main():\n N = I()\n #print(N,K,Pn)\n solver(N)\n\nif __name__ == \'__main__\':\n main()\n'] | ['Wrong Answer', 'Accepted'] | ['s119883361', 's504716486'] | [91740.0, 9008.0] | [412.0, 31.0] | [902, 830] |
p02629 | u863879653 | 2,000 | 1,048,576 | 1000000000000001 dogs suddenly appeared under the roof of Roger's house, all of which he decided to keep. The dogs had been numbered 1 through 1000000000000001, but he gave them new names, as follows: * the dogs numbered 1,2,\cdots,26 were respectively given the names `a`, `b`, ..., `z`; * the dogs numbered 27,28,29,\cdots,701,702 were respectively given the names `aa`, `ab`, `ac`, ..., `zy`, `zz`; * the dogs numbered 703,704,705,\cdots,18277,18278 were respectively given the names `aaa`, `aab`, `aac`, ..., `zzy`, `zzz`; * the dogs numbered 18279,18280,18281,\cdots,475253,475254 were respectively given the names `aaaa`, `aaab`, `aaac`, ..., `zzzy`, `zzzz`; * the dogs numbered 475255,475256,\cdots were respectively given the names `aaaaa`, `aaaab`, ...; * and so on. To sum it up, the dogs numbered 1, 2, \cdots were respectively given the following names: `a`, `b`, ..., `z`, `aa`, `ab`, ..., `az`, `ba`, `bb`, ..., `bz`, ..., `za`, `zb`, ..., `zz`, `aaa`, `aab`, ..., `aaz`, `aba`, `abb`, ..., `abz`, ..., `zzz`, `aaaa`, ... Now, Roger asks you: "What is the name for the dog numbered N?" | ['N = int(input())\n\ndef num10to26(num):\n if num<=26:\n return chr(64+num)\n elif num%26==0:\n return num10to26(num//26-1)+chr(90)\n else:\n return num10to26(num//26)+chr(64+num%26)\n\nprint(num10to26(N))', 'N = int(input())\n\ndef num10to26(num):\n if num<=26:\n return chr(64+num)\n elif num%26==0:\n return num10to26(num//26-1)+chr(90)\n else:\n return num10to26(num//26)+chr(64+num%26)\n\nprint(str.lower(num10to26(N)))'] | ['Wrong Answer', 'Accepted'] | ['s099755318', 's593511351'] | [9168.0, 9164.0] | [28.0, 35.0] | [224, 235] |
p02629 | u867200256 | 2,000 | 1,048,576 | 1000000000000001 dogs suddenly appeared under the roof of Roger's house, all of which he decided to keep. The dogs had been numbered 1 through 1000000000000001, but he gave them new names, as follows: * the dogs numbered 1,2,\cdots,26 were respectively given the names `a`, `b`, ..., `z`; * the dogs numbered 27,28,29,\cdots,701,702 were respectively given the names `aa`, `ab`, `ac`, ..., `zy`, `zz`; * the dogs numbered 703,704,705,\cdots,18277,18278 were respectively given the names `aaa`, `aab`, `aac`, ..., `zzy`, `zzz`; * the dogs numbered 18279,18280,18281,\cdots,475253,475254 were respectively given the names `aaaa`, `aaab`, `aaac`, ..., `zzzy`, `zzzz`; * the dogs numbered 475255,475256,\cdots were respectively given the names `aaaaa`, `aaaab`, ...; * and so on. To sum it up, the dogs numbered 1, 2, \cdots were respectively given the following names: `a`, `b`, ..., `z`, `aa`, `ab`, ..., `az`, `ba`, `bb`, ..., `bz`, ..., `za`, `zb`, ..., `zz`, `aaa`, `aab`, ..., `aaz`, `aba`, `abb`, ..., `abz`, ..., `zzz`, `aaaa`, ... Now, Roger asks you: "What is the name for the dog numbered N?" | ['\nimport collections\nimport sys\nimport copy\nimport re\n\n\ndef I(): return int(sys.stdin.readline().rstrip())\ndef LI(): return list(map(int, sys.stdin.readline().rstrip().split()))\ndef S(): return sys.stdin.readline().rstrip()\ndef LS(): return list(sys.stdin.readline().rstrip().split())\n\n\ndef main():\n N = I()\n ascii_lowercase = \'abcdefghijklmnopqrstuvwxyz\'\n name_roop = []\n\n level = 1\n\n ans = ""\n n = 26\n for i in range(30):\n if N > n:\n n += 26**(i+2)\n level += 1\n else:\n break\n\n for i in range(level, 1, -1):\n count = 0\n a = 26**(i-1)\n for _ in range(27):\n if N-a > 0:\n N -= a\n count += 1\n if N <= a:\n name_roop.append(count)\n break\n\n for i in name_roop:\n ans += ascii_lowercase[i-1]\n print(ans)\n\n\nif __name__ == \'__main__\':\n main()\n', '\nimport collections\nimport sys\nimport copy\nimport re\n\n\ndef I(): return int(sys.stdin.readline().rstrip())\ndef LI(): return list(map(int, sys.stdin.readline().rstrip().split()))\ndef S(): return sys.stdin.readline().rstrip()\ndef LS(): return list(sys.stdin.readline().rstrip().split())\n\n\ndef main():\n N = I()\n ascii_lowercase = \'abcdefghijklmnopqrstuvwxyz\'\n name_roop = []\n\n level = 1\n\n ans = ""\n n = 26\n for i in range(30):\n if N > n:\n n += 26**(i+2)\n level += 1\n else:\n break\n\n for i in range(level, 1, -1):\n count = 0\n a = 26**(i-1)\n for _ in range(26):\n if N-a > 0:\n N -= a\n count += 1\n if N <= a:\n name_roop.append(count)\n break\n\n for i in name_roop:\n ans += ascii_lowercase[i-1]\n print(ans)\n\n\nif __name__ == \'__main__\':\n main()\n', '\nimport collections\nimport sys\nimport copy\nimport re\n\n\ndef I(): return int(sys.stdin.readline().rstrip())\ndef LI(): return list(map(int, sys.stdin.readline().rstrip().split()))\ndef S(): return sys.stdin.readline().rstrip()\ndef LS(): return list(sys.stdin.readline().rstrip().split())\n\n\ndef main():\n N = I()\n ascii_lowercase = \'abcdefghijklmnopqrstuvwxyz\'\n name_roop = []\n\n level = 1\n\n ans = ""\n while N > 0:\n N -= 1\n n = N % 26\n ans += ascii_lowercase[n]\n N //= 26\n print(ans[::-1])\n \n # count = 0\n # a = 26**(i-1)\n # for j in range(26):\n # if N-a > 26**(i-2):\n # N -= a\n # count += 1\n # name_roop.append(count)\n\n # name_roop.append(N)\n \n # ans += ascii_lowercase[i-1]\n # print(ans)\n\n\nif __name__ == \'__main__\':\n main()\n'] | ['Runtime Error', 'Wrong Answer', 'Accepted'] | ['s034685822', 's878832286', 's010669198'] | [9860.0, 9768.0, 9856.0] | [39.0, 38.0, 42.0] | [957, 957, 947] |
p02629 | u868606077 | 2,000 | 1,048,576 | 1000000000000001 dogs suddenly appeared under the roof of Roger's house, all of which he decided to keep. The dogs had been numbered 1 through 1000000000000001, but he gave them new names, as follows: * the dogs numbered 1,2,\cdots,26 were respectively given the names `a`, `b`, ..., `z`; * the dogs numbered 27,28,29,\cdots,701,702 were respectively given the names `aa`, `ab`, `ac`, ..., `zy`, `zz`; * the dogs numbered 703,704,705,\cdots,18277,18278 were respectively given the names `aaa`, `aab`, `aac`, ..., `zzy`, `zzz`; * the dogs numbered 18279,18280,18281,\cdots,475253,475254 were respectively given the names `aaaa`, `aaab`, `aaac`, ..., `zzzy`, `zzzz`; * the dogs numbered 475255,475256,\cdots were respectively given the names `aaaaa`, `aaaab`, ...; * and so on. To sum it up, the dogs numbered 1, 2, \cdots were respectively given the following names: `a`, `b`, ..., `z`, `aa`, `ab`, ..., `az`, `ba`, `bb`, ..., `bz`, ..., `za`, `zb`, ..., `zz`, `aaa`, `aab`, ..., `aaz`, `aba`, `abb`, ..., `abz`, ..., `zzz`, `aaaa`, ... Now, Roger asks you: "What is the name for the dog numbered N?" | ['def num2alpha(num):\n if num<=26:\n return chr(64+num)\n elif num%26==0:\n return num2alpha(num//26-1)+chr(90)\n else:\n return num2alpha(num//26)+chr(64+num%26)\n \nprint(num2alpha(int(input())))', 'def num2alpha(num):\n if num<=26:\n return chr(64+num)\n elif num%26==0:\n return num2alpha(num//26-1)+chr(90)\n else:\n return num2alpha(num//26)+chr(64+num%26)\n \nprint(num2alpha(int(input())).lower())'] | ['Wrong Answer', 'Accepted'] | ['s208402638', 's692987368'] | [9172.0, 9172.0] | [31.0, 29.0] | [223, 231] |
p02629 | u869567753 | 2,000 | 1,048,576 | 1000000000000001 dogs suddenly appeared under the roof of Roger's house, all of which he decided to keep. The dogs had been numbered 1 through 1000000000000001, but he gave them new names, as follows: * the dogs numbered 1,2,\cdots,26 were respectively given the names `a`, `b`, ..., `z`; * the dogs numbered 27,28,29,\cdots,701,702 were respectively given the names `aa`, `ab`, `ac`, ..., `zy`, `zz`; * the dogs numbered 703,704,705,\cdots,18277,18278 were respectively given the names `aaa`, `aab`, `aac`, ..., `zzy`, `zzz`; * the dogs numbered 18279,18280,18281,\cdots,475253,475254 were respectively given the names `aaaa`, `aaab`, `aaac`, ..., `zzzy`, `zzzz`; * the dogs numbered 475255,475256,\cdots were respectively given the names `aaaaa`, `aaaab`, ...; * and so on. To sum it up, the dogs numbered 1, 2, \cdots were respectively given the following names: `a`, `b`, ..., `z`, `aa`, `ab`, ..., `az`, `ba`, `bb`, ..., `bz`, ..., `za`, `zb`, ..., `zz`, `aaa`, `aab`, ..., `aaz`, `aba`, `abb`, ..., `abz`, ..., `zzz`, `aaaa`, ... Now, Roger asks you: "What is the name for the dog numbered N?" | ['N = int(input())\nA = ["a", "b", "c", "d", "e", "f", "g", "h", "i", "j", "k", "l", "m", "n",\n "o", "p", "q", "r", "s", "t", "u", "v", "w", "x", "y", "z"]\nname = ""\ns = True\nwhile s:\n a = N % 26\n N = N // 26\n if N == 0:\n s = False\n else:\n name = A[a-1] + name\nprint(name)', 'N = int(input())\nA = ["a", "b", "c", "d", "e", "f", "g", "h", "i", "j", "k", "l", "m", "n",\n "o", "p", "q", "r", "s", "t", "u", "v", "w", "x", "y", "z"]\nname = ""\ns = True\nwhile s:\n a = N % 26\n if a == 0:\n a = 25\n else:\n a -= 1\n name = A[a] + name\n N = (N - a) // 26\n if N == 0:\n s = False\n\nprint(name)'] | ['Wrong Answer', 'Accepted'] | ['s922591625', 's583161977'] | [9192.0, 9232.0] | [31.0, 35.0] | [283, 321] |
p02629 | u876295560 | 2,000 | 1,048,576 | 1000000000000001 dogs suddenly appeared under the roof of Roger's house, all of which he decided to keep. The dogs had been numbered 1 through 1000000000000001, but he gave them new names, as follows: * the dogs numbered 1,2,\cdots,26 were respectively given the names `a`, `b`, ..., `z`; * the dogs numbered 27,28,29,\cdots,701,702 were respectively given the names `aa`, `ab`, `ac`, ..., `zy`, `zz`; * the dogs numbered 703,704,705,\cdots,18277,18278 were respectively given the names `aaa`, `aab`, `aac`, ..., `zzy`, `zzz`; * the dogs numbered 18279,18280,18281,\cdots,475253,475254 were respectively given the names `aaaa`, `aaab`, `aaac`, ..., `zzzy`, `zzzz`; * the dogs numbered 475255,475256,\cdots were respectively given the names `aaaaa`, `aaaab`, ...; * and so on. To sum it up, the dogs numbered 1, 2, \cdots were respectively given the following names: `a`, `b`, ..., `z`, `aa`, `ab`, ..., `az`, `ba`, `bb`, ..., `bz`, ..., `za`, `zb`, ..., `zz`, `aaa`, `aab`, ..., `aaz`, `aba`, `abb`, ..., `abz`, ..., `zzz`, `aaaa`, ... Now, Roger asks you: "What is the name for the dog numbered N?" | ["sum=26\ncount=0\nn = int(input())\nk = ord('a')-1\nwhile(sum<n) :\n count+=1\n sum+=26**(count+1)\n\ncurrent=n\nmozi=''\nmozi1=''\n\nlist1=[]\nfor i in reversed(range(count+1)) :\n c=current//26**i\n current = current % 26 ** i\n list1.append(c)\nprint(list1)\nfor i in range(1,count+1) :\n if list1[-i]<=0 :\n list1[-i]+=26\n list1[-i-1]-=1\nprint(list1)\nfor i in range(count+1) :\n mozi+=chr(list1[i]+k)\nprint(mozi)", "sum=26\ncount=0\nn = int(input())\nk = ord('a')-1\nwhile(sum<n) :\n count+=1\n sum+=26**(count+1)\n\ncurrent=n\nmozi=''\nmozi1=''\n\nlist1=[]\nfor i in reversed(range(count+1)) :\n c=current//26**i\n current = current % 26 ** i\n list1.append(c)\n\nfor i in range(1,count+1) :\n if list1[-i]<=0 :\n list1[-i]+=26\n list1[-i-1]-=1\n\nfor i in range(count+1) :\n mozi+=chr(list1[i]+k)\nprint(mozi)"] | ['Wrong Answer', 'Accepted'] | ['s840444344', 's174160151'] | [9152.0, 9072.0] | [34.0, 34.0] | [408, 384] |
p02629 | u880730787 | 2,000 | 1,048,576 | 1000000000000001 dogs suddenly appeared under the roof of Roger's house, all of which he decided to keep. The dogs had been numbered 1 through 1000000000000001, but he gave them new names, as follows: * the dogs numbered 1,2,\cdots,26 were respectively given the names `a`, `b`, ..., `z`; * the dogs numbered 27,28,29,\cdots,701,702 were respectively given the names `aa`, `ab`, `ac`, ..., `zy`, `zz`; * the dogs numbered 703,704,705,\cdots,18277,18278 were respectively given the names `aaa`, `aab`, `aac`, ..., `zzy`, `zzz`; * the dogs numbered 18279,18280,18281,\cdots,475253,475254 were respectively given the names `aaaa`, `aaab`, `aaac`, ..., `zzzy`, `zzzz`; * the dogs numbered 475255,475256,\cdots were respectively given the names `aaaaa`, `aaaab`, ...; * and so on. To sum it up, the dogs numbered 1, 2, \cdots were respectively given the following names: `a`, `b`, ..., `z`, `aa`, `ab`, ..., `az`, `ba`, `bb`, ..., `bz`, ..., `za`, `zb`, ..., `zz`, `aaa`, `aab`, ..., `aaz`, `aba`, `abb`, ..., `abz`, ..., `zzz`, `aaaa`, ... Now, Roger asks you: "What is the name for the dog numbered N?" | ['N = int(input())\nans = ""\nif N % 26 == 0:\n i = 1\n a = N\n while True:\n a = a//26\n if a <= 26:\n print("z"*i)\n break\n i+=1\nelse:\n a = N; b = N; i = 1\n while True:\n b = a % 26\n ans = chr(ord("a")+b-1) + ans\n a = a // 26\n if a <= 26:\n ans = chr(ord("a")+a-1) + ans\n break\n i += 1\nprint(ans)', 'N = int(input())\nans = ""\nwhile N > 0:\n N -=1\n ans = chr(ord("a") + (N%26)) + ans\n N //= 26\nprint(ans)'] | ['Wrong Answer', 'Accepted'] | ['s179438791', 's285698475'] | [9196.0, 9056.0] | [31.0, 26.0] | [400, 111] |
p02629 | u885722498 | 2,000 | 1,048,576 | 1000000000000001 dogs suddenly appeared under the roof of Roger's house, all of which he decided to keep. The dogs had been numbered 1 through 1000000000000001, but he gave them new names, as follows: * the dogs numbered 1,2,\cdots,26 were respectively given the names `a`, `b`, ..., `z`; * the dogs numbered 27,28,29,\cdots,701,702 were respectively given the names `aa`, `ab`, `ac`, ..., `zy`, `zz`; * the dogs numbered 703,704,705,\cdots,18277,18278 were respectively given the names `aaa`, `aab`, `aac`, ..., `zzy`, `zzz`; * the dogs numbered 18279,18280,18281,\cdots,475253,475254 were respectively given the names `aaaa`, `aaab`, `aaac`, ..., `zzzy`, `zzzz`; * the dogs numbered 475255,475256,\cdots were respectively given the names `aaaaa`, `aaaab`, ...; * and so on. To sum it up, the dogs numbered 1, 2, \cdots were respectively given the following names: `a`, `b`, ..., `z`, `aa`, `ab`, ..., `az`, `ba`, `bb`, ..., `bz`, ..., `za`, `zb`, ..., `zz`, `aaa`, `aab`, ..., `aaz`, `aba`, `abb`, ..., `abz`, ..., `zzz`, `aaaa`, ... Now, Roger asks you: "What is the name for the dog numbered N?" | ['# coding: utf-8\n\n\nx = int(input())\nremainder_list = []\nalphabet_list = "a b c d e f g h i j k l m n o p q r s t u v w x y z".split()\nif x <= 26:\n remainder_0 = x\n remainder_list.append(remainder_0)\nelse:\n while x / 26 > 0:\n remainder = x % 26\n if remainder == 0:\n remainder = 26\n remainder_list.append(remainder)\n x = x // 26 - 1\n else:\n remainder_list.append( remainder)\n x = x // 26\n\nremainder_list.reverse()\n\nprint(remainder_list)\nans =""\nfor i in remainder_list:\n\n ans += alphabet_list[i-1]\nprint(ans)', '# coding: utf-8\n\n\nx = int(input())\nremainder_list = []\nalphabet_list = "a b c d e f g h i j k l m n o p q r s t u v w x y z".split()\nif x <= 26:\n remainder_0 = x\n remainder_list.append(remainder_0)\nelse:\n while x / 26 > 0:\n remainder = x % 26\n if remainder == 0:\n remainder = 26\n remainder_list.append(remainder)\n x = x // 26 - 1\n else:\n remainder_list.append( remainder)\n x = x // 26\n\nremainder_list.reverse()\nans =""\nfor i in remainder_list:\n ans += alphabet_list[i-1]\nprint(ans)'] | ['Wrong Answer', 'Accepted'] | ['s102388070', 's653489691'] | [8972.0, 9052.0] | [28.0, 31.0] | [767, 743] |
p02629 | u886545507 | 2,000 | 1,048,576 | 1000000000000001 dogs suddenly appeared under the roof of Roger's house, all of which he decided to keep. The dogs had been numbered 1 through 1000000000000001, but he gave them new names, as follows: * the dogs numbered 1,2,\cdots,26 were respectively given the names `a`, `b`, ..., `z`; * the dogs numbered 27,28,29,\cdots,701,702 were respectively given the names `aa`, `ab`, `ac`, ..., `zy`, `zz`; * the dogs numbered 703,704,705,\cdots,18277,18278 were respectively given the names `aaa`, `aab`, `aac`, ..., `zzy`, `zzz`; * the dogs numbered 18279,18280,18281,\cdots,475253,475254 were respectively given the names `aaaa`, `aaab`, `aaac`, ..., `zzzy`, `zzzz`; * the dogs numbered 475255,475256,\cdots were respectively given the names `aaaaa`, `aaaab`, ...; * and so on. To sum it up, the dogs numbered 1, 2, \cdots were respectively given the following names: `a`, `b`, ..., `z`, `aa`, `ab`, ..., `az`, `ba`, `bb`, ..., `bz`, ..., `za`, `zb`, ..., `zz`, `aaa`, `aab`, ..., `aaz`, `aba`, `abb`, ..., `abz`, ..., `zzz`, `aaaa`, ... Now, Roger asks you: "What is the name for the dog numbered N?" | ["abc171c\nn=int(input())\ns=''\nwhile n:\n n-=1\n s+=chr(n%26+97)\n n//=26\nprint(s[::-1])\n", "#abc171c\nn=int(input())\ns=''\nwhile n:\n n-=1\n s+=chr(n%26+97)\n n//=26\nprint(s[::-1])\n"] | ['Runtime Error', 'Accepted'] | ['s924177440', 's785684252'] | [8948.0, 9136.0] | [29.0, 27.0] | [83, 84] |
p02629 | u887152994 | 2,000 | 1,048,576 | 1000000000000001 dogs suddenly appeared under the roof of Roger's house, all of which he decided to keep. The dogs had been numbered 1 through 1000000000000001, but he gave them new names, as follows: * the dogs numbered 1,2,\cdots,26 were respectively given the names `a`, `b`, ..., `z`; * the dogs numbered 27,28,29,\cdots,701,702 were respectively given the names `aa`, `ab`, `ac`, ..., `zy`, `zz`; * the dogs numbered 703,704,705,\cdots,18277,18278 were respectively given the names `aaa`, `aab`, `aac`, ..., `zzy`, `zzz`; * the dogs numbered 18279,18280,18281,\cdots,475253,475254 were respectively given the names `aaaa`, `aaab`, `aaac`, ..., `zzzy`, `zzzz`; * the dogs numbered 475255,475256,\cdots were respectively given the names `aaaaa`, `aaaab`, ...; * and so on. To sum it up, the dogs numbered 1, 2, \cdots were respectively given the following names: `a`, `b`, ..., `z`, `aa`, `ab`, ..., `az`, `ba`, `bb`, ..., `bz`, ..., `za`, `zb`, ..., `zz`, `aaa`, `aab`, ..., `aaz`, `aba`, `abb`, ..., `abz`, ..., `zzz`, `aaaa`, ... Now, Roger asks you: "What is the name for the dog numbered N?" | ['def num2alpha(num):\n if num<=26:\n return chr(64+num)\n elif num%26==0:\n return num2alpha(num//26-1)+chr(90)\n else:\n return num2alpha(num//26)+chr(64+num%26)\nn=int(input())\np=num2alpha(n)\np=p.lower()\np', 'def num2alpha(num):\n if num<=26:\n return chr(64+num)\n elif num%26==0:\n return num2alpha(num//26-1)+chr(90)\n else:\n return num2alpha(num//26)+chr(64+num%26)\nn=int(input())\np=num2alpha(n)\np=p.lower()\nprint(str(p))'] | ['Wrong Answer', 'Accepted'] | ['s597128604', 's239670643'] | [9164.0, 9180.0] | [34.0, 34.0] | [229, 241] |
p02629 | u889919275 | 2,000 | 1,048,576 | 1000000000000001 dogs suddenly appeared under the roof of Roger's house, all of which he decided to keep. The dogs had been numbered 1 through 1000000000000001, but he gave them new names, as follows: * the dogs numbered 1,2,\cdots,26 were respectively given the names `a`, `b`, ..., `z`; * the dogs numbered 27,28,29,\cdots,701,702 were respectively given the names `aa`, `ab`, `ac`, ..., `zy`, `zz`; * the dogs numbered 703,704,705,\cdots,18277,18278 were respectively given the names `aaa`, `aab`, `aac`, ..., `zzy`, `zzz`; * the dogs numbered 18279,18280,18281,\cdots,475253,475254 were respectively given the names `aaaa`, `aaab`, `aaac`, ..., `zzzy`, `zzzz`; * the dogs numbered 475255,475256,\cdots were respectively given the names `aaaaa`, `aaaab`, ...; * and so on. To sum it up, the dogs numbered 1, 2, \cdots were respectively given the following names: `a`, `b`, ..., `z`, `aa`, `ab`, ..., `az`, `ba`, `bb`, ..., `bz`, ..., `za`, `zb`, ..., `zz`, `aaa`, `aab`, ..., `aaz`, `aba`, `abb`, ..., `abz`, ..., `zzz`, `aaaa`, ... Now, Roger asks you: "What is the name for the dog numbered N?" | ["N = int(input())\nalpha = 'zabcdefghijklnmopqrstuvwxyz'\n\nans = ''\nwhile N != 0:\n i = N % 26\n N-=1\n ans += alpha[i]\n N //= 26\n print(N)\n \nprint(ans)", "N = int(input())\nalpha = 'zabcdefghijklnmopqrstuvwxyz'\n\nans = ''\nwhile N != 0:\n i = N % 26\n N-=1\n ans = alpha[i] + ans\n N //= 26\n print(N)\n \nprint(ans)", "N = int(input())\nalpha = ['z','a','b','c','d','e','f','g','h','i','j','k','l','m','n','o','p','q','r','s','t','u','v','w','x','y','z']\n\nans = ''\n\nz_list = [1]\ncount = 1\nadd = 1\nwhile add <= N:\n add = add + 26**count\n count += 1\n z_list.append(add)\n\nwhile N >= 1:\n if N in z_list:\n index = 0\n else:\n index = N % 26\n print(index)\n ans = alpha[index] + ans\n print(N)\n N = N // 26\nprint(ans)", "N = int(input())\nalpha = ['a','b','c','d','e','f','g','h','i','j','k','l','m','n','o','p','q','r','s','t','u','v','w','x','y','z']\nans = ''\n\nwhile N > 0:\n N-=1\n index = N%1\n ans = alpha[index] + ans\n N = N // 26\nprint(ans)", "N = int(input())\nalpha = ['a','b','c','d','e','f','g','h','i','j','k','l','m','n','o','p','q','r','s','t','u','v','w','x','y','z']\nans = ''\n\nwhile N > 0:\n N-=1\n index = N%26\n ans = alpha[index] + ans\n N = N // 26\nprint(ans)"] | ['Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Accepted'] | ['s099346940', 's475133526', 's477849359', 's576120181', 's660035754'] | [9064.0, 9088.0, 9208.0, 9188.0, 9084.0] | [29.0, 32.0, 32.0, 31.0, 30.0] | [164, 169, 428, 234, 235] |
p02629 | u891687930 | 2,000 | 1,048,576 | 1000000000000001 dogs suddenly appeared under the roof of Roger's house, all of which he decided to keep. The dogs had been numbered 1 through 1000000000000001, but he gave them new names, as follows: * the dogs numbered 1,2,\cdots,26 were respectively given the names `a`, `b`, ..., `z`; * the dogs numbered 27,28,29,\cdots,701,702 were respectively given the names `aa`, `ab`, `ac`, ..., `zy`, `zz`; * the dogs numbered 703,704,705,\cdots,18277,18278 were respectively given the names `aaa`, `aab`, `aac`, ..., `zzy`, `zzz`; * the dogs numbered 18279,18280,18281,\cdots,475253,475254 were respectively given the names `aaaa`, `aaab`, `aaac`, ..., `zzzy`, `zzzz`; * the dogs numbered 475255,475256,\cdots were respectively given the names `aaaaa`, `aaaab`, ...; * and so on. To sum it up, the dogs numbered 1, 2, \cdots were respectively given the following names: `a`, `b`, ..., `z`, `aa`, `ab`, ..., `az`, `ba`, `bb`, ..., `bz`, ..., `za`, `zb`, ..., `zz`, `aaa`, `aab`, ..., `aaz`, `aba`, `abb`, ..., `abz`, ..., `zzz`, `aaaa`, ... Now, Roger asks you: "What is the name for the dog numbered N?" | ["n = int(input())\n\nname = []\n\nwhile n > 0:\n n -= 1\n name.append(alp[n % 26])\n n //= 26\n\nname.reverse()\n\nprint(*name,sep='')", "n = int(input())\n\nalp = 'zabcdefghijklmnopqrstuvwxy'\n\nname = []\n\nwhile n > 0:\n n -= 1\n name.append(alp[n % 26])\n n //= 26\n\nname.reverse()\n\nprint(*name,sep='')", "n = int(input())\n\nalp = 'abcdefghijklmnopqrstuvwxyz'\n\nname = []\n\nwhile n > 0:\n n -= 1\n name.append(alp[n % 26])\n n //= 26\n\nname.reverse()\n\nprint(*name,sep='')"] | ['Runtime Error', 'Wrong Answer', 'Accepted'] | ['s138701565', 's504063478', 's755625263'] | [9028.0, 9068.0, 9152.0] | [25.0, 32.0, 28.0] | [131, 167, 167] |
p02629 | u892006633 | 2,000 | 1,048,576 | 1000000000000001 dogs suddenly appeared under the roof of Roger's house, all of which he decided to keep. The dogs had been numbered 1 through 1000000000000001, but he gave them new names, as follows: * the dogs numbered 1,2,\cdots,26 were respectively given the names `a`, `b`, ..., `z`; * the dogs numbered 27,28,29,\cdots,701,702 were respectively given the names `aa`, `ab`, `ac`, ..., `zy`, `zz`; * the dogs numbered 703,704,705,\cdots,18277,18278 were respectively given the names `aaa`, `aab`, `aac`, ..., `zzy`, `zzz`; * the dogs numbered 18279,18280,18281,\cdots,475253,475254 were respectively given the names `aaaa`, `aaab`, `aaac`, ..., `zzzy`, `zzzz`; * the dogs numbered 475255,475256,\cdots were respectively given the names `aaaaa`, `aaaab`, ...; * and so on. To sum it up, the dogs numbered 1, 2, \cdots were respectively given the following names: `a`, `b`, ..., `z`, `aa`, `ab`, ..., `az`, `ba`, `bb`, ..., `bz`, ..., `za`, `zb`, ..., `zz`, `aaa`, `aab`, ..., `aaz`, `aba`, `abb`, ..., `abz`, ..., `zzz`, `aaaa`, ... Now, Roger asks you: "What is the name for the dog numbered N?" | ['A = input()\ndef num2alpha(num):\n if num<=26:\n return chr(64+num)\n elif num%26==0:\n return num2alpha(num//26-1)+chr(90)\n else:\n return num2alpha(num//26)+chr(64+num%26)\n\nans =num2alpha(int(A))\nprint(ans)', 'A = input()\ndef num2alpha(num):\n if num<=26:\n return chr(64+num)\n elif num%26==0:\n return num2alpha(num//26-1)+chr(90)\n else:\n return num2alpha(num//26)+chr(64+num%26)\n\nans =num2alpha(int(A))\nprint(ans.lower())'] | ['Wrong Answer', 'Accepted'] | ['s713733006', 's464051296'] | [9128.0, 9112.0] | [37.0, 29.0] | [232, 240] |
p02629 | u892305365 | 2,000 | 1,048,576 | 1000000000000001 dogs suddenly appeared under the roof of Roger's house, all of which he decided to keep. The dogs had been numbered 1 through 1000000000000001, but he gave them new names, as follows: * the dogs numbered 1,2,\cdots,26 were respectively given the names `a`, `b`, ..., `z`; * the dogs numbered 27,28,29,\cdots,701,702 were respectively given the names `aa`, `ab`, `ac`, ..., `zy`, `zz`; * the dogs numbered 703,704,705,\cdots,18277,18278 were respectively given the names `aaa`, `aab`, `aac`, ..., `zzy`, `zzz`; * the dogs numbered 18279,18280,18281,\cdots,475253,475254 were respectively given the names `aaaa`, `aaab`, `aaac`, ..., `zzzy`, `zzzz`; * the dogs numbered 475255,475256,\cdots were respectively given the names `aaaaa`, `aaaab`, ...; * and so on. To sum it up, the dogs numbered 1, 2, \cdots were respectively given the following names: `a`, `b`, ..., `z`, `aa`, `ab`, ..., `az`, `ba`, `bb`, ..., `bz`, ..., `za`, `zb`, ..., `zz`, `aaa`, `aab`, ..., `aaz`, `aba`, `abb`, ..., `abz`, ..., `zzz`, `aaaa`, ... Now, Roger asks you: "What is the name for the dog numbered N?" | ["import math\n\n\ndef nextString(text, p):\n if text[p] != 'z':\n text[p] = chr(ord(text[p])+1)\n return text\n else:\n text[p] = 'a'\n nextString(text, p - 1)\n\nn = int(input())\nbase = 26\n\ndigit = math.floor(math.log(1+(base-1)*n, base))\n\nposition = int(n - (base**digit - 1) / (base - 1))\n\ntxt = 'a' * digit\n\ntxt = list(txt)\n\nfor i in range(digit):\n txt[digit - i - 1] = chr(ord(txt[digit - i - 1])+(position % base))\n position = position // base\n\nprint(txt)\n", "import math\nn=int(input())\nd=math.floor(math.log(1+(26-1)*n,26))\np=int(n-(26**d-1)/(26-1))\nt=list('a'*d)\nfor i in range(d):\n t[d-i-1]=chr(ord(t[d-i-1])+(p%26))\n p=p//26\nprint(''.join(t))"] | ['Wrong Answer', 'Accepted'] | ['s765560683', 's815753111'] | [9196.0, 9172.0] | [31.0, 33.0] | [491, 192] |
p02629 | u896609156 | 2,000 | 1,048,576 | 1000000000000001 dogs suddenly appeared under the roof of Roger's house, all of which he decided to keep. The dogs had been numbered 1 through 1000000000000001, but he gave them new names, as follows: * the dogs numbered 1,2,\cdots,26 were respectively given the names `a`, `b`, ..., `z`; * the dogs numbered 27,28,29,\cdots,701,702 were respectively given the names `aa`, `ab`, `ac`, ..., `zy`, `zz`; * the dogs numbered 703,704,705,\cdots,18277,18278 were respectively given the names `aaa`, `aab`, `aac`, ..., `zzy`, `zzz`; * the dogs numbered 18279,18280,18281,\cdots,475253,475254 were respectively given the names `aaaa`, `aaab`, `aaac`, ..., `zzzy`, `zzzz`; * the dogs numbered 475255,475256,\cdots were respectively given the names `aaaaa`, `aaaab`, ...; * and so on. To sum it up, the dogs numbered 1, 2, \cdots were respectively given the following names: `a`, `b`, ..., `z`, `aa`, `ab`, ..., `az`, `ba`, `bb`, ..., `bz`, ..., `za`, `zb`, ..., `zz`, `aaa`, `aab`, ..., `aaz`, `aba`, `abb`, ..., `abz`, ..., `zzz`, `aaaa`, ... Now, Roger asks you: "What is the name for the dog numbered N?" | ["N=int(input())\nans=''\nwhileN>0:\n N-=1\n ans+=chr(ord('a')+N%26)\n N//=26\nprint(ans[::-1])", "N=int(input())\nans=''\nwhileN>0:\n N-=15\n ans+=chr(ord('a')+N%26)\n N//=26\nprint(ans[::-1])", "N=int(input())\nans=''\nwhile N>0:\n N-=1\n ans+=chr(ord('a')+N%26)\n N//=26\nprint(ans[::-1])"] | ['Runtime Error', 'Runtime Error', 'Accepted'] | ['s272863723', 's736620683', 's765254653'] | [9012.0, 8940.0, 9164.0] | [28.0, 24.0, 27.0] | [90, 91, 91] |
p02629 | u896726004 | 2,000 | 1,048,576 | 1000000000000001 dogs suddenly appeared under the roof of Roger's house, all of which he decided to keep. The dogs had been numbered 1 through 1000000000000001, but he gave them new names, as follows: * the dogs numbered 1,2,\cdots,26 were respectively given the names `a`, `b`, ..., `z`; * the dogs numbered 27,28,29,\cdots,701,702 were respectively given the names `aa`, `ab`, `ac`, ..., `zy`, `zz`; * the dogs numbered 703,704,705,\cdots,18277,18278 were respectively given the names `aaa`, `aab`, `aac`, ..., `zzy`, `zzz`; * the dogs numbered 18279,18280,18281,\cdots,475253,475254 were respectively given the names `aaaa`, `aaab`, `aaac`, ..., `zzzy`, `zzzz`; * the dogs numbered 475255,475256,\cdots were respectively given the names `aaaaa`, `aaaab`, ...; * and so on. To sum it up, the dogs numbered 1, 2, \cdots were respectively given the following names: `a`, `b`, ..., `z`, `aa`, `ab`, ..., `az`, `ba`, `bb`, ..., `bz`, ..., `za`, `zb`, ..., `zz`, `aaa`, `aab`, ..., `aaz`, `aba`, `abb`, ..., `abz`, ..., `zzz`, `aaaa`, ... Now, Roger asks you: "What is the name for the dog numbered N?" | ["from collections import deque\n\n\n\n\n\nN = int(input())\nans = deque([])\n\nwhile True:\n N, mod = N//26, N%26\n ans.append(mod)\n if N==0:\n break\n\nwhile ans:\n mod = chr(ans.pop() + 96)\n print(mod, end='')", "N = int(input())\n\nans = ''\n\nwhile True:\n N -= 1\n N, mod = N//26, N%26\n ans += chr(ord('a') + mod)\n if N==0:\n break\n\nprint(ans[::-1])"] | ['Wrong Answer', 'Accepted'] | ['s740014404', 's672662472'] | [9396.0, 9160.0] | [39.0, 36.0] | [318, 151] |
p02629 | u904811150 | 2,000 | 1,048,576 | 1000000000000001 dogs suddenly appeared under the roof of Roger's house, all of which he decided to keep. The dogs had been numbered 1 through 1000000000000001, but he gave them new names, as follows: * the dogs numbered 1,2,\cdots,26 were respectively given the names `a`, `b`, ..., `z`; * the dogs numbered 27,28,29,\cdots,701,702 were respectively given the names `aa`, `ab`, `ac`, ..., `zy`, `zz`; * the dogs numbered 703,704,705,\cdots,18277,18278 were respectively given the names `aaa`, `aab`, `aac`, ..., `zzy`, `zzz`; * the dogs numbered 18279,18280,18281,\cdots,475253,475254 were respectively given the names `aaaa`, `aaab`, `aaac`, ..., `zzzy`, `zzzz`; * the dogs numbered 475255,475256,\cdots were respectively given the names `aaaaa`, `aaaab`, ...; * and so on. To sum it up, the dogs numbered 1, 2, \cdots were respectively given the following names: `a`, `b`, ..., `z`, `aa`, `ab`, ..., `az`, `ba`, `bb`, ..., `bz`, ..., `za`, `zb`, ..., `zz`, `aaa`, `aab`, ..., `aaz`, `aba`, `abb`, ..., `abz`, ..., `zzz`, `aaaa`, ... Now, Roger asks you: "What is the name for the dog numbered N?" | ['x = input()\n\ndef converter(x):\n if x <= 26:\n y = chr(x + 96)\n elif x % 26 == 0:\n y = converter(x // 26) + converter(26)\n else:\n y = converter(x // 26) + converter(x % 26)\n return y\n\nname = converter(x)\n\nprint(name)', 'x = int(input())\n\ndef converter(x):\n if x <= 26:\n y = chr(x + 96)\n elif x % 26 == 0:\n y = converter(x // 26 - 1) + chr(122)\n else:\n y = converter(x // 26) + chr(x % 26 + 96)\n return y\n\nname = converter(x)\n\nprint(name)'] | ['Runtime Error', 'Accepted'] | ['s019666135', 's213917060'] | [8996.0, 9144.0] | [26.0, 31.0] | [247, 250] |
p02629 | u907403674 | 2,000 | 1,048,576 | 1000000000000001 dogs suddenly appeared under the roof of Roger's house, all of which he decided to keep. The dogs had been numbered 1 through 1000000000000001, but he gave them new names, as follows: * the dogs numbered 1,2,\cdots,26 were respectively given the names `a`, `b`, ..., `z`; * the dogs numbered 27,28,29,\cdots,701,702 were respectively given the names `aa`, `ab`, `ac`, ..., `zy`, `zz`; * the dogs numbered 703,704,705,\cdots,18277,18278 were respectively given the names `aaa`, `aab`, `aac`, ..., `zzy`, `zzz`; * the dogs numbered 18279,18280,18281,\cdots,475253,475254 were respectively given the names `aaaa`, `aaab`, `aaac`, ..., `zzzy`, `zzzz`; * the dogs numbered 475255,475256,\cdots were respectively given the names `aaaaa`, `aaaab`, ...; * and so on. To sum it up, the dogs numbered 1, 2, \cdots were respectively given the following names: `a`, `b`, ..., `z`, `aa`, `ab`, ..., `az`, `ba`, `bb`, ..., `bz`, ..., `za`, `zb`, ..., `zz`, `aaa`, `aab`, ..., `aaz`, `aba`, `abb`, ..., `abz`, ..., `zzz`, `aaaa`, ... Now, Roger asks you: "What is the name for the dog numbered N?" | ['n = int(input())\nl = ["a","b","c","d","e","f","g","h","i","j","k","l","m","n","o","p","q","r","s","t","u","v","w","x","y","z"]\nanswer = []\nwhile n >= 1:\n n -= 1\n print(n)\n answer.append(l[n % 26])\n n = n//26\nans = \'\'.join(list(reversed(answer)))\nprint(ans)', 'n = int(input())\nl = ["a","b","c","d","e","f","g","h","i","j","k","l","m","n","o","p","q","r","s","t","u","v","w","x","y","z"]\nanswer = []\nwhile n >= 1:\n n -= 1\n answer.append(l[n % 26])\n n = n//26\nans = \'\'.join(list(reversed(answer)))\nprint(ans)'] | ['Wrong Answer', 'Accepted'] | ['s081085959', 's638838302'] | [9208.0, 9204.0] | [29.0, 28.0] | [268, 255] |
p02629 | u909991537 | 2,000 | 1,048,576 | 1000000000000001 dogs suddenly appeared under the roof of Roger's house, all of which he decided to keep. The dogs had been numbered 1 through 1000000000000001, but he gave them new names, as follows: * the dogs numbered 1,2,\cdots,26 were respectively given the names `a`, `b`, ..., `z`; * the dogs numbered 27,28,29,\cdots,701,702 were respectively given the names `aa`, `ab`, `ac`, ..., `zy`, `zz`; * the dogs numbered 703,704,705,\cdots,18277,18278 were respectively given the names `aaa`, `aab`, `aac`, ..., `zzy`, `zzz`; * the dogs numbered 18279,18280,18281,\cdots,475253,475254 were respectively given the names `aaaa`, `aaab`, `aaac`, ..., `zzzy`, `zzzz`; * the dogs numbered 475255,475256,\cdots were respectively given the names `aaaaa`, `aaaab`, ...; * and so on. To sum it up, the dogs numbered 1, 2, \cdots were respectively given the following names: `a`, `b`, ..., `z`, `aa`, `ab`, ..., `az`, `ba`, `bb`, ..., `bz`, ..., `za`, `zb`, ..., `zz`, `aaa`, `aab`, ..., `aaz`, `aba`, `abb`, ..., `abz`, ..., `zzz`, `aaaa`, ... Now, Roger asks you: "What is the name for the dog numbered N?" | ["import math\nN = int(input())\nans = ''\n\nfor i in range(1, 99):\n if N <= 26 ** i:\n for j in range(i):\n ans += chr(ord('a') + N % 26)\n N //= 26\n break\n else:\n N -= 26 ** i\n \nprint(ans[::-1])\n\n\n\n ", "import math\nN = int(input())\nans = ''\n\nfor i in range(1, 99):\n if N <= 26 ** i:\n N -= 1\n for j in range(i):\n ans += chr(ord('a') + N % 26)\n N //= 26\n break\n else:\n N -= 26 ** i\n \nprint(ans[::-1])\n\n\n\n "] | ['Wrong Answer', 'Accepted'] | ['s827941878', 's086731125'] | [8936.0, 9152.0] | [30.0, 27.0] | [219, 230] |
p02629 | u916242112 | 2,000 | 1,048,576 | 1000000000000001 dogs suddenly appeared under the roof of Roger's house, all of which he decided to keep. The dogs had been numbered 1 through 1000000000000001, but he gave them new names, as follows: * the dogs numbered 1,2,\cdots,26 were respectively given the names `a`, `b`, ..., `z`; * the dogs numbered 27,28,29,\cdots,701,702 were respectively given the names `aa`, `ab`, `ac`, ..., `zy`, `zz`; * the dogs numbered 703,704,705,\cdots,18277,18278 were respectively given the names `aaa`, `aab`, `aac`, ..., `zzy`, `zzz`; * the dogs numbered 18279,18280,18281,\cdots,475253,475254 were respectively given the names `aaaa`, `aaab`, `aaac`, ..., `zzzy`, `zzzz`; * the dogs numbered 475255,475256,\cdots were respectively given the names `aaaaa`, `aaaab`, ...; * and so on. To sum it up, the dogs numbered 1, 2, \cdots were respectively given the following names: `a`, `b`, ..., `z`, `aa`, `ab`, ..., `az`, `ba`, `bb`, ..., `bz`, ..., `za`, `zb`, ..., `zz`, `aaa`, `aab`, ..., `aaz`, `aba`, `abb`, ..., `abz`, ..., `zzz`, `aaaa`, ... Now, Roger asks you: "What is the name for the dog numbered N?" | ["N = int(input())\n\ns = []\nk = 0\nwhile N > 0:\n\tl = N % 26 //一番下のけた\n\ts.insert(0,chr(ord('a')+l-1))\n\tN = N // 26\n\tk +=1\n\nprint(s)\nprint(join(s))", "N = int(input())\n\ns = []\nk = 0\nwhile N > 0:\n\tl = N % 26 \n\tif l == 0:\n\t\tl = 26\n\ts.insert(0,chr(ord('a')+l-1))\n\tN = N-1\n\tN = N // 26\n\tk +=1\n\n\nprint(''.join(s))\n"] | ['Runtime Error', 'Accepted'] | ['s939992131', 's547602221'] | [9252.0, 9100.0] | [31.0, 33.0] | [152, 177] |
p02629 | u919235786 | 2,000 | 1,048,576 | 1000000000000001 dogs suddenly appeared under the roof of Roger's house, all of which he decided to keep. The dogs had been numbered 1 through 1000000000000001, but he gave them new names, as follows: * the dogs numbered 1,2,\cdots,26 were respectively given the names `a`, `b`, ..., `z`; * the dogs numbered 27,28,29,\cdots,701,702 were respectively given the names `aa`, `ab`, `ac`, ..., `zy`, `zz`; * the dogs numbered 703,704,705,\cdots,18277,18278 were respectively given the names `aaa`, `aab`, `aac`, ..., `zzy`, `zzz`; * the dogs numbered 18279,18280,18281,\cdots,475253,475254 were respectively given the names `aaaa`, `aaab`, `aaac`, ..., `zzzy`, `zzzz`; * the dogs numbered 475255,475256,\cdots were respectively given the names `aaaaa`, `aaaab`, ...; * and so on. To sum it up, the dogs numbered 1, 2, \cdots were respectively given the following names: `a`, `b`, ..., `z`, `aa`, `ab`, ..., `az`, `ba`, `bb`, ..., `bz`, ..., `za`, `zb`, ..., `zz`, `aaa`, `aab`, ..., `aaz`, `aba`, `abb`, ..., `abz`, ..., `zzz`, `aaaa`, ... Now, Roger asks you: "What is the name for the dog numbered N?" | ["n=int(input())\na=[]\nwhile n>0:\n b=n%26\n if b==0:\n b=26\n t=1\n c=lambda b:chr(b+64)\n a.append(c(b))\n n//=26\n if t==1:\n n-=1\n t=0\nd=len(a)\ne=[]\nfor i in range(d):\n e.append(a[-1-i])\nans=''.join(e)\nans=ans.lower()\nprint(ans)", "n=int(input())\na=[]\nwhile n>1:\n b=n%26\n if b==0:\n b=26\n c=lambda b:chr(b+64)\n a.append(c(b))\n n//=26\nd=len(a)\ne=[]\nfor i in range(d):\n e.append(a[-1-i])\nans=''.join(e)\nprint(ans)", "n=int(input())\na=[]\nwhile n>1:\n b=n%26\n c=lambda b:chr(b+64)\n a.append(c(b))\n n//=26\nd=len(a)\ne=[]\nfor i in range(d):\n e.append(a[-1-i])\nans=''.join(e)\nprint(ans)", "n=int(input())\na=[]\nt=0\nwhile n>0:\n b=n%26\n if b==0:\n b=26\n t=1\n c=lambda b:chr(b+64)\n a.append(c(b))\n n//=26\n if t==1:\n n-=1\n t=0\nd=len(a)\ne=[]\nfor i in range(d):\n e.append(a[-1-i])\nans=''.join(e)\nans=ans.lower()\nprint(ans)"] | ['Runtime Error', 'Wrong Answer', 'Wrong Answer', 'Accepted'] | ['s073830628', 's663878094', 's916297378', 's824873317'] | [9160.0, 9208.0, 9188.0, 9140.0] | [26.0, 30.0, 33.0, 37.0] | [269, 203, 177, 273] |
p02629 | u921156673 | 2,000 | 1,048,576 | 1000000000000001 dogs suddenly appeared under the roof of Roger's house, all of which he decided to keep. The dogs had been numbered 1 through 1000000000000001, but he gave them new names, as follows: * the dogs numbered 1,2,\cdots,26 were respectively given the names `a`, `b`, ..., `z`; * the dogs numbered 27,28,29,\cdots,701,702 were respectively given the names `aa`, `ab`, `ac`, ..., `zy`, `zz`; * the dogs numbered 703,704,705,\cdots,18277,18278 were respectively given the names `aaa`, `aab`, `aac`, ..., `zzy`, `zzz`; * the dogs numbered 18279,18280,18281,\cdots,475253,475254 were respectively given the names `aaaa`, `aaab`, `aaac`, ..., `zzzy`, `zzzz`; * the dogs numbered 475255,475256,\cdots were respectively given the names `aaaaa`, `aaaab`, ...; * and so on. To sum it up, the dogs numbered 1, 2, \cdots were respectively given the following names: `a`, `b`, ..., `z`, `aa`, `ab`, ..., `az`, `ba`, `bb`, ..., `bz`, ..., `za`, `zb`, ..., `zz`, `aaa`, `aab`, ..., `aaz`, `aba`, `abb`, ..., `abz`, ..., `zzz`, `aaaa`, ... Now, Roger asks you: "What is the name for the dog numbered N?" | ["N = int(input()) - 1\nketa = 1\ncumsum = 0\noldcumsum = 0\nwhile True:\n cumsum += 26 ** keta\n if cumsum > N:\n break\n else:\n oldcumsum = cumsum\n keta += 1\n\nN -= oldcumsum\n#N -= 1\nprint(keta)\n\nname = ''\nfor k in range(1,keta+1):\n ch_n = N // (26 ** (keta - k))\n ch = chr(ord('a') + ch_n)\n name += ch\n N -= ch_n * (26 ** (keta - k))\nprint(name)", "N = int(input())\nketa = 1\ncumsum = 0\noldcumsum = 0\nwhile True:\n cumsum += 26 ** keta\n if cumsum > N:\n break\n else:\n oldcumsum = cumsum\n keta += 1\nprint(keta)\n\nN -= oldcumsum\nN -= 1\n\nname = ''\nfor k in range(1,keta+1):\n ch_n = N // (26 ** (keta - k))\n ch = chr(ord('a') + ch_n)\n name += ch\n N -= ch_n * (26 ** (keta - k))\nprint(name)", "N = int(input()) - 1\nketa = 1\ncumsum = 0\noldcumsum = 0\nwhile True:\n cumsum += 26 ** keta\n if cumsum > N:\n break\n else:\n oldcumsum = cumsum\n keta += 1\n\nN -= oldcumsum\n#N -= 1\n#print(keta)\n\nname = ''\nfor k in range(1,keta+1):\n ch_n = N // (26 ** (keta - k))\n ch = chr(ord('a') + ch_n)\n name += ch\n N -= ch_n * (26 ** (keta - k))\nprint(name)"] | ['Wrong Answer', 'Wrong Answer', 'Accepted'] | ['s576434442', 's825930136', 's209017783'] | [9208.0, 9204.0, 9048.0] | [29.0, 31.0, 26.0] | [351, 346, 352] |
p02629 | u923172145 | 2,000 | 1,048,576 | 1000000000000001 dogs suddenly appeared under the roof of Roger's house, all of which he decided to keep. The dogs had been numbered 1 through 1000000000000001, but he gave them new names, as follows: * the dogs numbered 1,2,\cdots,26 were respectively given the names `a`, `b`, ..., `z`; * the dogs numbered 27,28,29,\cdots,701,702 were respectively given the names `aa`, `ab`, `ac`, ..., `zy`, `zz`; * the dogs numbered 703,704,705,\cdots,18277,18278 were respectively given the names `aaa`, `aab`, `aac`, ..., `zzy`, `zzz`; * the dogs numbered 18279,18280,18281,\cdots,475253,475254 were respectively given the names `aaaa`, `aaab`, `aaac`, ..., `zzzy`, `zzzz`; * the dogs numbered 475255,475256,\cdots were respectively given the names `aaaaa`, `aaaab`, ...; * and so on. To sum it up, the dogs numbered 1, 2, \cdots were respectively given the following names: `a`, `b`, ..., `z`, `aa`, `ab`, ..., `az`, `ba`, `bb`, ..., `bz`, ..., `za`, `zb`, ..., `zz`, `aaa`, `aab`, ..., `aaz`, `aba`, `abb`, ..., `abz`, ..., `zzz`, `aaaa`, ... Now, Roger asks you: "What is the name for the dog numbered N?" | ['N = input()\nN = int(N)\nprint(N)\nN-=1\n\ndit = [0 for _ in range(100)]\ni = 0\nwhile True:\n dit[i] = N % 26\n N = N // 26\n if N == 0:\n break\n else:\n N -= 1\n i+=1\n\nprint(dit)\nname = ""\nfor j in range(i,-1,-1):\n name += chr(97+dit[j])\n \nprint(name)', 'N = input()\nN = int(N)\n#print(N)\nN-=1\n\ndit = [0 for _ in range(100)]\ni = 0\nwhile True:\n dit[i] = N % 26\n N = N // 26\n if N == 0:\n break\n else:\n N -= 1\n i+=1\n\n#print(dit)\nname = ""\nfor j in range(i,-1,-1):\n name += chr(97+dit[j])\n \nprint(name)'] | ['Wrong Answer', 'Accepted'] | ['s390224815', 's983205713'] | [9004.0, 9188.0] | [31.0, 32.0] | [253, 255] |
p02629 | u926046014 | 2,000 | 1,048,576 | 1000000000000001 dogs suddenly appeared under the roof of Roger's house, all of which he decided to keep. The dogs had been numbered 1 through 1000000000000001, but he gave them new names, as follows: * the dogs numbered 1,2,\cdots,26 were respectively given the names `a`, `b`, ..., `z`; * the dogs numbered 27,28,29,\cdots,701,702 were respectively given the names `aa`, `ab`, `ac`, ..., `zy`, `zz`; * the dogs numbered 703,704,705,\cdots,18277,18278 were respectively given the names `aaa`, `aab`, `aac`, ..., `zzy`, `zzz`; * the dogs numbered 18279,18280,18281,\cdots,475253,475254 were respectively given the names `aaaa`, `aaab`, `aaac`, ..., `zzzy`, `zzzz`; * the dogs numbered 475255,475256,\cdots were respectively given the names `aaaaa`, `aaaab`, ...; * and so on. To sum it up, the dogs numbered 1, 2, \cdots were respectively given the following names: `a`, `b`, ..., `z`, `aa`, `ab`, ..., `az`, `ba`, `bb`, ..., `bz`, ..., `za`, `zb`, ..., `zz`, `aaa`, `aab`, ..., `aaz`, `aba`, `abb`, ..., `abz`, ..., `zzz`, `aaaa`, ... Now, Roger asks you: "What is the name for the dog numbered N?" | ['n=int(input())\n\n\n\nalp=[chr(ord(\'a\') + i) for i in range(26)]\nlst=[0]*11\n\nfor i in range(11):\n if n>=26**(10-i):\n a,n=divmod(n,26**(10-i))\n lst[i]=alp[a]\n\nswitch=0\nfor i in range(10):\n if lst[i]==0:\n if switch==0:\n lst.remove(0)\n else:\n lst[i]="a"\n else:\n switch=1\n\nprint("".join(lst))', 'n=int(input())\n \n\n \nalp=[chr(ord(\'a\') + i) for i in range(26)]\nlst=[0]*11\n \nfor i in range(11):\n if n>=26**(10-i):\n a,n=divmod(n,26**(10-i))\n lst[i]=alp[a-1]\n \nswitch=0\nfor i in range(10):\n if lst[i]==0:\n if switch==0:\n lst.remove(0)\n else:\n lst[i]="a"\n else:\n switch=1\n \nprint("".join(lst))', 'alp=[chr(i) for i in range(97,123)]\nn=int(input())\n\nfor i in range(1,12):\n if n>26**i:\n n-=26**i\n else:\n keta=i\n break\n\nn-=1\nlst=[]\n\nfor i in range(keta):\n p,n=divmod(n,26**(keta-i-1))\n lst.append(alp[p])\n \nprint("".join(lst))'] | ['Runtime Error', 'Runtime Error', 'Accepted'] | ['s417885822', 's883564908', 's364196881'] | [9216.0, 9180.0, 9132.0] | [27.0, 29.0, 30.0] | [368, 375, 362] |
p02629 | u928758473 | 2,000 | 1,048,576 | 1000000000000001 dogs suddenly appeared under the roof of Roger's house, all of which he decided to keep. The dogs had been numbered 1 through 1000000000000001, but he gave them new names, as follows: * the dogs numbered 1,2,\cdots,26 were respectively given the names `a`, `b`, ..., `z`; * the dogs numbered 27,28,29,\cdots,701,702 were respectively given the names `aa`, `ab`, `ac`, ..., `zy`, `zz`; * the dogs numbered 703,704,705,\cdots,18277,18278 were respectively given the names `aaa`, `aab`, `aac`, ..., `zzy`, `zzz`; * the dogs numbered 18279,18280,18281,\cdots,475253,475254 were respectively given the names `aaaa`, `aaab`, `aaac`, ..., `zzzy`, `zzzz`; * the dogs numbered 475255,475256,\cdots were respectively given the names `aaaaa`, `aaaab`, ...; * and so on. To sum it up, the dogs numbered 1, 2, \cdots were respectively given the following names: `a`, `b`, ..., `z`, `aa`, `ab`, ..., `az`, `ba`, `bb`, ..., `bz`, ..., `za`, `zb`, ..., `zz`, `aaa`, `aab`, ..., `aaz`, `aba`, `abb`, ..., `abz`, ..., `zzz`, `aaaa`, ... Now, Roger asks you: "What is the name for the dog numbered N?" | ['import os\nimport sys\nfrom collections import defaultdict, Counter\nfrom itertools import product, permutations,combinations, accumulate\nfrom operator import itemgetter\nfrom bisect import bisect_left,bisect\nfrom heapq import heappop,heappush,heapify\nfrom math import ceil, floor, sqrt\nfrom copy import deepcopy\n\ndef main():\n num = int(input())\n ans = ""\n for i in range(1,100):\n if num <= 26**i:\n num -= 1\n for j in range(i):\n ans += chr(65 + num%26)\n num //= 26\n break\n else:\n num -= 26**i\n \n print(ans)\n\n\nif __name__ == "__main__":\n main()', 'import os\nimport sys\nfrom collections import defaultdict, Counter\nfrom itertools import product, permutations,combinations, accumulate\nfrom operator import itemgetter\nfrom bisect import bisect_left,bisect\nfrom heapq import heappop,heappush,heapify\nfrom math import ceil, floor, sqrt\nfrom copy import deepcopy\n\ndef main():\n n = int(input())\n x = 0\n string = ""\n \n while(n > 0):\n x = n % 27\n string = chr(x+64) + string\n n //= 26\n if n < 26:\n break\n\n\n print(string)\n\nif __name__ == "__main__":\n main()', 'import os\nimport sys\nfrom collections import defaultdict, Counter\nfrom itertools import product, permutations,combinations, accumulate\nfrom operator import itemgetter\nfrom bisect import bisect_left,bisect\nfrom heapq import heappop,heappush,heapify\nfrom math import ceil, floor, sqrt\nfrom copy import deepcopy\n\ndef main():\n num = int(input())\n ans = ""\n for i in range(1,100):\n if num <= 26**i:\n \n num -= 1\n for j in range(i):\n ans += chr(65 + num%26)\n num //= 26\n break\n else:\n num -= 26**i\n \n ans = ans.lower()\n print(ans[::-1])\n\n\nif __name__ == "__main__":\n main()'] | ['Wrong Answer', 'Wrong Answer', 'Accepted'] | ['s422008327', 's994670971', 's988210962'] | [9640.0, 9444.0, 9512.0] | [36.0, 38.0, 37.0] | [653, 559, 694] |
p02629 | u929217794 | 2,000 | 1,048,576 | 1000000000000001 dogs suddenly appeared under the roof of Roger's house, all of which he decided to keep. The dogs had been numbered 1 through 1000000000000001, but he gave them new names, as follows: * the dogs numbered 1,2,\cdots,26 were respectively given the names `a`, `b`, ..., `z`; * the dogs numbered 27,28,29,\cdots,701,702 were respectively given the names `aa`, `ab`, `ac`, ..., `zy`, `zz`; * the dogs numbered 703,704,705,\cdots,18277,18278 were respectively given the names `aaa`, `aab`, `aac`, ..., `zzy`, `zzz`; * the dogs numbered 18279,18280,18281,\cdots,475253,475254 were respectively given the names `aaaa`, `aaab`, `aaac`, ..., `zzzy`, `zzzz`; * the dogs numbered 475255,475256,\cdots were respectively given the names `aaaaa`, `aaaab`, ...; * and so on. To sum it up, the dogs numbered 1, 2, \cdots were respectively given the following names: `a`, `b`, ..., `z`, `aa`, `ab`, ..., `az`, `ba`, `bb`, ..., `bz`, ..., `za`, `zb`, ..., `zz`, `aaa`, `aab`, ..., `aaz`, `aba`, `abb`, ..., `abz`, ..., `zzz`, `aaaa`, ... Now, Roger asks you: "What is the name for the dog numbered N?" | ['n = input()\n\ndata = ["a", "b", "c", "d", "e", "f", "g", "h", "i", "j", "k", "l", "m", "n", "o", "p", "q", "r", "s", "t", "u", "v", "w", "x", "y", "z"]\n\nq, mod = divmod(n-1, 26)\nprint(q, mod)\nanswer = data[mod]\n\nwhile q >= 1:\n q, mod = divmod(q-1, 26)\n print(q, mod)\n answer = data[mod] + answer\n\nprint(answer)\n\n', 'n = int(input())\n\nans = ""\nwhile n >= 26:\n n, mod = divmod(n-1, 26)\n ans = chr(ord("a")+mod) + ans\nif n != 0:\n ans = chr(ord("a")+n-1) + ans\n\nprint(ans)'] | ['Runtime Error', 'Accepted'] | ['s120056100', 's500262539'] | [9032.0, 9132.0] | [28.0, 31.0] | [320, 155] |
p02629 | u934529721 | 2,000 | 1,048,576 | 1000000000000001 dogs suddenly appeared under the roof of Roger's house, all of which he decided to keep. The dogs had been numbered 1 through 1000000000000001, but he gave them new names, as follows: * the dogs numbered 1,2,\cdots,26 were respectively given the names `a`, `b`, ..., `z`; * the dogs numbered 27,28,29,\cdots,701,702 were respectively given the names `aa`, `ab`, `ac`, ..., `zy`, `zz`; * the dogs numbered 703,704,705,\cdots,18277,18278 were respectively given the names `aaa`, `aab`, `aac`, ..., `zzy`, `zzz`; * the dogs numbered 18279,18280,18281,\cdots,475253,475254 were respectively given the names `aaaa`, `aaab`, `aaac`, ..., `zzzy`, `zzzz`; * the dogs numbered 475255,475256,\cdots were respectively given the names `aaaaa`, `aaaab`, ...; * and so on. To sum it up, the dogs numbered 1, 2, \cdots were respectively given the following names: `a`, `b`, ..., `z`, `aa`, `ab`, ..., `az`, `ba`, `bb`, ..., `bz`, ..., `za`, `zb`, ..., `zz`, `aaa`, `aab`, ..., `aaz`, `aba`, `abb`, ..., `abz`, ..., `zzz`, `aaaa`, ... Now, Roger asks you: "What is the name for the dog numbered N?" | ['import math\n\nn = int(input())\n\nans_list = []\n\ndef waru(n):\n amari = n%26\n kotae = n / 26\n ans_list.append(math.floor(amari))\n if kotae < 1:\n return 0\n else:\n waru(kotae)\n\nwaru(n)\n\nans_list.reverse()\n\nalph = [chr(i) for i in range(97, 97+26)]\n\n\nfor i in ans_list:\n print(alph[i-1], end="")\n \n', 'import math\n \nn = int(input())\n \nans_list = []\n \ndef waru(n):\n n -= 1\n amari = n%26\n kotae = n // 26\n ans_list.append(amari)\n if kotae < 1:\n return 0\n else:\n waru(kotae)\n \nwaru(n)\n \nans_list.reverse()', 'import math\n\nn = int(input())\n\nans_list = []\n\ndef waru(n):\n amari = n%26\n kotae = n // 26\n ans_list.append(amari)\n if kotae < 1:\n return 0\n else:\n waru(kotae)\n\nwaru(n)\n\nans_list.reverse()\n\nalph = [chr(i) for i in range(97, 97+26)]\n\n\nfor i in ans_list:\n print(alph[i-1], end="")\n \n', "n=int(input())\nans=''\ncheck='abcdefghijklmnopqrstuvwxyz'\nwhile n!=0:\n n-=1\n ans+=check[n%26]\n n//=26\nprint(ans[::-1])"] | ['Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Accepted'] | ['s098258405', 's394708220', 's923413518', 's274342252'] | [9184.0, 9156.0, 9168.0, 9112.0] | [35.0, 30.0, 31.0, 29.0] | [326, 232, 315, 120] |
p02629 | u935642171 | 2,000 | 1,048,576 | 1000000000000001 dogs suddenly appeared under the roof of Roger's house, all of which he decided to keep. The dogs had been numbered 1 through 1000000000000001, but he gave them new names, as follows: * the dogs numbered 1,2,\cdots,26 were respectively given the names `a`, `b`, ..., `z`; * the dogs numbered 27,28,29,\cdots,701,702 were respectively given the names `aa`, `ab`, `ac`, ..., `zy`, `zz`; * the dogs numbered 703,704,705,\cdots,18277,18278 were respectively given the names `aaa`, `aab`, `aac`, ..., `zzy`, `zzz`; * the dogs numbered 18279,18280,18281,\cdots,475253,475254 were respectively given the names `aaaa`, `aaab`, `aaac`, ..., `zzzy`, `zzzz`; * the dogs numbered 475255,475256,\cdots were respectively given the names `aaaaa`, `aaaab`, ...; * and so on. To sum it up, the dogs numbered 1, 2, \cdots were respectively given the following names: `a`, `b`, ..., `z`, `aa`, `ab`, ..., `az`, `ba`, `bb`, ..., `bz`, ..., `za`, `zb`, ..., `zz`, `aaa`, `aab`, ..., `aaz`, `aba`, `abb`, ..., `abz`, ..., `zzz`, `aaaa`, ... Now, Roger asks you: "What is the name for the dog numbered N?" | ['# -*- coding: utf-8 -*-\ndef conv(a): #convert the num to character\n a += 97\n return chr(a)\n\n\nn = int(input())\nname = \'\'\n\nwhile n>0:\n n -= 1\n print("nは{}で26で割って{}あまりは{}".format(n,n//26,n%26))\n name += conv(n%26)\n n //= 26\n\n\nprint(name[::-1])', "# -*- coding: utf-8 -*-\ndef conv(a): #convert the num to character\n a += 97\n return chr(a)\n\n\nn = int(input())\nname = ''\n\nwhile n>0:\n n -= 1\n name += conv(n%26)\n n //= 26\n\n\nprint(name[::-1])"] | ['Wrong Answer', 'Accepted'] | ['s029773817', 's382407676'] | [9140.0, 9092.0] | [27.0, 28.0] | [291, 219] |
p02629 | u938718404 | 2,000 | 1,048,576 | 1000000000000001 dogs suddenly appeared under the roof of Roger's house, all of which he decided to keep. The dogs had been numbered 1 through 1000000000000001, but he gave them new names, as follows: * the dogs numbered 1,2,\cdots,26 were respectively given the names `a`, `b`, ..., `z`; * the dogs numbered 27,28,29,\cdots,701,702 were respectively given the names `aa`, `ab`, `ac`, ..., `zy`, `zz`; * the dogs numbered 703,704,705,\cdots,18277,18278 were respectively given the names `aaa`, `aab`, `aac`, ..., `zzy`, `zzz`; * the dogs numbered 18279,18280,18281,\cdots,475253,475254 were respectively given the names `aaaa`, `aaab`, `aaac`, ..., `zzzy`, `zzzz`; * the dogs numbered 475255,475256,\cdots were respectively given the names `aaaaa`, `aaaab`, ...; * and so on. To sum it up, the dogs numbered 1, 2, \cdots were respectively given the following names: `a`, `b`, ..., `z`, `aa`, `ab`, ..., `az`, `ba`, `bb`, ..., `bz`, ..., `za`, `zb`, ..., `zz`, `aaa`, `aab`, ..., `aaz`, `aba`, `abb`, ..., `abz`, ..., `zzz`, `aaaa`, ... Now, Roger asks you: "What is the name for the dog numbered N?" | ['n=int(input())\ndef alpha2num(alpha):\n num=0\n for index,item in enumerate(list(alpha)):\n num+=pow(26,len(alpha)-index-1)*(ord(item)-ord("A")+1)\n return num\nif 1<=n<=26:\n n=n\n print(alpha2num(n))\nelif 27<=n<=702:\n n-=26\n print(alpha2num(n))\nelif 703<=n<=18278:\n n-=702\n print(alpha2num(n))\nelif 18279<=n<=475254:\n n-=18278\n print(alpha2num(n))\nelse:\n n-=475254\n print(alpha2num(n))', 'n=int(input())\ndef alpha2num(alpha):\n if alpha<=26:\n return chr(64+alpha)\n elif alpha%26==0:\n return alpha2num(alpha//26-1)+chr(90)\n else:\n return alpha2num(alpha//26)+chr(64+alpha%26)\nprint(alpha2num(n))', 'n=int(input())\ndef alpha2num(alpha):\n if alpha<=26:\n return chr(64+alpha)\n elif alpha%26==0:\n return alpha2num(alpha//26-1)+chr(90)\n else:\n return alpha2num(alpha//26)+chr(64+alpha%26)\nprint(alpha2num(n).lower())'] | ['Runtime Error', 'Wrong Answer', 'Accepted'] | ['s016277232', 's775504756', 's363691001'] | [9216.0, 9172.0, 9100.0] | [29.0, 27.0, 30.0] | [425, 234, 242] |
p02629 | u940533000 | 2,000 | 1,048,576 | 1000000000000001 dogs suddenly appeared under the roof of Roger's house, all of which he decided to keep. The dogs had been numbered 1 through 1000000000000001, but he gave them new names, as follows: * the dogs numbered 1,2,\cdots,26 were respectively given the names `a`, `b`, ..., `z`; * the dogs numbered 27,28,29,\cdots,701,702 were respectively given the names `aa`, `ab`, `ac`, ..., `zy`, `zz`; * the dogs numbered 703,704,705,\cdots,18277,18278 were respectively given the names `aaa`, `aab`, `aac`, ..., `zzy`, `zzz`; * the dogs numbered 18279,18280,18281,\cdots,475253,475254 were respectively given the names `aaaa`, `aaab`, `aaac`, ..., `zzzy`, `zzzz`; * the dogs numbered 475255,475256,\cdots were respectively given the names `aaaaa`, `aaaab`, ...; * and so on. To sum it up, the dogs numbered 1, 2, \cdots were respectively given the following names: `a`, `b`, ..., `z`, `aa`, `ab`, ..., `az`, `ba`, `bb`, ..., `bz`, ..., `za`, `zb`, ..., `zz`, `aaa`, `aab`, ..., `aaz`, `aba`, `abb`, ..., `abz`, ..., `zzz`, `aaaa`, ... Now, Roger asks you: "What is the name for the dog numbered N?" | ["N = int(input())\nalpha = ['a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z']\n\ndef find_name(tmp_N, p, keta, alpha):\n if keta == 1:\n for i in range(len(alpha)):\n #print(tmp_N + (i+1))\n if tmp_N + (i+1) == N:\n p.append(i)\n return p\n else:\n for i in range(len(alpha)):\n #print(tmp_N + 26**(keta-1)*i+1, tmp_N + 26**(keta-1)*(i+1))\n if tmp_N + 26**(keta-1)*i+1 <= N <= tmp_N + 26**(keta-1)*(i+1):\n #print(tmp_N + 26**(keta-1)*i+1, tmp_N + 26**(keta-1)*(i+1))\n p.append(i)\n tmp_N = tmp_N + 26**(keta-1)*i\n keta -= 1\n return find_name(tmp_N, p, keta, alpha)\n \n\nketa = 1\nwhile 1:\n tmp_N = 26**(keta-1)\n if tmp_N + 26**(keta-1)+1 <= N <= tmp_N + 26**keta:\n break\n else:\n keta += 1\n#print(keta)\n\ntmp_N = 0\nif keta == 1:\n tmp_N = 0\nelse:\n tmp_N = 26**(keta-1)\n#print(tmp_N)\np = []\np = find_name(tmp_N, p, keta, alpha)\nout = ''\n#print(p)\nfor i in range(len(p)):\n out += alpha[p[i]]\nprint(out)\n\n", "N = int(input())\nalpha = ['a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z']\n\ndef find_name(tmp_N, p, keta, alpha):\n if keta == 1:\n for i in range(len(alpha)):\n #print(tmp_N + (i+1))\n if tmp_N + (i+1) == N:\n p.append(i)\n return p\n else:\n for i in range(len(alpha)):\n if tmp_N + 26**(keta-1)*i+1 <= N <= tmp_N + 26**(keta-1)*(i+1):\n p.append(i)\n tmp_N = tmp_N + 26**(keta-1)*i\n keta -= 1\n return find_name(tmp_N, p, keta, alpha)\n \n\nketa = 1\ntmp_N = 0\nwhile 1:\n if tmp_N + 1 <= N <= tmp_N + 26**keta:\n break\n else:\n keta += 1\n tmp_N += 26**(keta-1)\n#print(keta)\n\np = []\np = find_name(tmp_N, p, keta, alpha)\nout = ''\n#print(p)\nfor i in range(len(p)):\n out += alpha[p[i]]\nprint(out)\n\n"] | ['Runtime Error', 'Accepted'] | ['s587191746', 's223980295'] | [9204.0, 9212.0] | [2206.0, 32.0] | [1071, 856] |
p02629 | u940765148 | 2,000 | 1,048,576 | 1000000000000001 dogs suddenly appeared under the roof of Roger's house, all of which he decided to keep. The dogs had been numbered 1 through 1000000000000001, but he gave them new names, as follows: * the dogs numbered 1,2,\cdots,26 were respectively given the names `a`, `b`, ..., `z`; * the dogs numbered 27,28,29,\cdots,701,702 were respectively given the names `aa`, `ab`, `ac`, ..., `zy`, `zz`; * the dogs numbered 703,704,705,\cdots,18277,18278 were respectively given the names `aaa`, `aab`, `aac`, ..., `zzy`, `zzz`; * the dogs numbered 18279,18280,18281,\cdots,475253,475254 were respectively given the names `aaaa`, `aaab`, `aaac`, ..., `zzzy`, `zzzz`; * the dogs numbered 475255,475256,\cdots were respectively given the names `aaaaa`, `aaaab`, ...; * and so on. To sum it up, the dogs numbered 1, 2, \cdots were respectively given the following names: `a`, `b`, ..., `z`, `aa`, `ab`, ..., `az`, `ba`, `bb`, ..., `bz`, ..., `za`, `zb`, ..., `zz`, `aaa`, `aab`, ..., `aaz`, `aba`, `abb`, ..., `abz`, ..., `zzz`, `aaaa`, ... Now, Roger asks you: "What is the name for the dog numbered N?" | ["import math\nimport string\nl = list(string.ascii_lowercase)\na = int(input())\nn = 26\ndef numalpha(num,s=''):\n if num < n:\n return l[num] + s\n else:\n return numalpha(num // n, l[num % n] + s)\nprint(numalpha(a))", 'n = int(input())\ndef num2alpha(num):\n if num<=26:\n return chr(96+num)\n elif num%26==0:\n return num2alpha(num//26-1)+chr(122)\n else:\n return num2alpha(num//26)+chr(96+num%26)\n \nprint(num2alpha(n))'] | ['Wrong Answer', 'Accepted'] | ['s233505814', 's524790912'] | [9988.0, 9196.0] | [40.0, 28.0] | [227, 232] |
p02629 | u942280986 | 2,000 | 1,048,576 | 1000000000000001 dogs suddenly appeared under the roof of Roger's house, all of which he decided to keep. The dogs had been numbered 1 through 1000000000000001, but he gave them new names, as follows: * the dogs numbered 1,2,\cdots,26 were respectively given the names `a`, `b`, ..., `z`; * the dogs numbered 27,28,29,\cdots,701,702 were respectively given the names `aa`, `ab`, `ac`, ..., `zy`, `zz`; * the dogs numbered 703,704,705,\cdots,18277,18278 were respectively given the names `aaa`, `aab`, `aac`, ..., `zzy`, `zzz`; * the dogs numbered 18279,18280,18281,\cdots,475253,475254 were respectively given the names `aaaa`, `aaab`, `aaac`, ..., `zzzy`, `zzzz`; * the dogs numbered 475255,475256,\cdots were respectively given the names `aaaaa`, `aaaab`, ...; * and so on. To sum it up, the dogs numbered 1, 2, \cdots were respectively given the following names: `a`, `b`, ..., `z`, `aa`, `ab`, ..., `az`, `ba`, `bb`, ..., `bz`, ..., `za`, `zb`, ..., `zz`, `aaa`, `aab`, ..., `aaz`, `aba`, `abb`, ..., `abz`, ..., `zzz`, `aaaa`, ... Now, Roger asks you: "What is the name for the dog numbered N?" | ["N=int(input())\nList='a b c d e f g h i j k l m n o p q r s t u v d x y z'.split()\nprint(List)\n\nAns=''\n\nwhile N>=1:\n Amari=N%26\n \n if Amari==0:\n Ans='z'+Ans\n else:\n Ans=List[Amari-1]+Ans\n \n N=(N-1)//26\n \nprint(Ans)", "N=int(input())\nList='abcdefghijklmnopqrstuvwxy'\n\nAns=''\n\nwhile N>=1:\n Amari=N%26\n \n if Amari==0:\n Ans='z'+Ans\n else:\n Ans=List[Amari-1]+Ans\n \n N=(N-1)//26\n \nprint(Ans)\n"] | ['Wrong Answer', 'Accepted'] | ['s791044844', 's644511273'] | [9168.0, 8768.0] | [29.0, 31.0] | [252, 207] |
p02629 | u944731949 | 2,000 | 1,048,576 | 1000000000000001 dogs suddenly appeared under the roof of Roger's house, all of which he decided to keep. The dogs had been numbered 1 through 1000000000000001, but he gave them new names, as follows: * the dogs numbered 1,2,\cdots,26 were respectively given the names `a`, `b`, ..., `z`; * the dogs numbered 27,28,29,\cdots,701,702 were respectively given the names `aa`, `ab`, `ac`, ..., `zy`, `zz`; * the dogs numbered 703,704,705,\cdots,18277,18278 were respectively given the names `aaa`, `aab`, `aac`, ..., `zzy`, `zzz`; * the dogs numbered 18279,18280,18281,\cdots,475253,475254 were respectively given the names `aaaa`, `aaab`, `aaac`, ..., `zzzy`, `zzzz`; * the dogs numbered 475255,475256,\cdots were respectively given the names `aaaaa`, `aaaab`, ...; * and so on. To sum it up, the dogs numbered 1, 2, \cdots were respectively given the following names: `a`, `b`, ..., `z`, `aa`, `ab`, ..., `az`, `ba`, `bb`, ..., `bz`, ..., `za`, `zb`, ..., `zz`, `aaa`, `aab`, ..., `aaz`, `aba`, `abb`, ..., `abz`, ..., `zzz`, `aaaa`, ... Now, Roger asks you: "What is the name for the dog numbered N?" | ["n = int(input())\nalpha_arr = [chr(i) for i in range(97, 97+26)]\nans = []\na, b = divmod(n, 26)\nif b != 0:\n ans.insert(0, alpha_arr[b - 1])\nelse:\n ans.insert(0, 'z')\nwhile True:\n a, b = divmod(a, 26)\n if b != 0:\n ans.insert(0, alpha_arr[b - 1])\n else:\n ans.insert(0, 'z')\n if a < 26:\n break\nprint(''.join(ans))", "n = int(input())\n# a, b = divmod(n, 26)\nalpha_arr = [chr(i) for i in range(97, 97+26)]\nans = []\n# if b != 0:\n# ans.append(alpha_arr[b - 1])\n# else:\n# ans.append('z')\na, b = divmod(n, 26)\nif b != 0:\n ans.insert(0, alpha_arr[b - 1])\nelse:\n ans.insert(0, 'z')\nwhile True:\n a, b = divmod(a, 26)\n if b != 0:\n ans.insert(0, alpha_arr[b - 1])\n else:\n ans.insert(0, 'z')\n if a < 26:\n break\nprint(''.join(ans))", "n = int(input())\nalpha_arr = [chr(i) for i in range(97, 97+26)]\nans = []\nwhile n > 0:\n n -= 1\n ans.insert(0, alpha_arr[n % 26])\n n //= 26\nprint(''.join(ans))"] | ['Wrong Answer', 'Wrong Answer', 'Accepted'] | ['s039383056', 's307732461', 's315594126'] | [9208.0, 9192.0, 9156.0] | [28.0, 28.0, 28.0] | [347, 448, 166] |
p02629 | u944886577 | 2,000 | 1,048,576 | 1000000000000001 dogs suddenly appeared under the roof of Roger's house, all of which he decided to keep. The dogs had been numbered 1 through 1000000000000001, but he gave them new names, as follows: * the dogs numbered 1,2,\cdots,26 were respectively given the names `a`, `b`, ..., `z`; * the dogs numbered 27,28,29,\cdots,701,702 were respectively given the names `aa`, `ab`, `ac`, ..., `zy`, `zz`; * the dogs numbered 703,704,705,\cdots,18277,18278 were respectively given the names `aaa`, `aab`, `aac`, ..., `zzy`, `zzz`; * the dogs numbered 18279,18280,18281,\cdots,475253,475254 were respectively given the names `aaaa`, `aaab`, `aaac`, ..., `zzzy`, `zzzz`; * the dogs numbered 475255,475256,\cdots were respectively given the names `aaaaa`, `aaaab`, ...; * and so on. To sum it up, the dogs numbered 1, 2, \cdots were respectively given the following names: `a`, `b`, ..., `z`, `aa`, `ab`, ..., `az`, `ba`, `bb`, ..., `bz`, ..., `za`, `zb`, ..., `zz`, `aaa`, `aab`, ..., `aaz`, `aba`, `abb`, ..., `abz`, ..., `zzz`, `aaaa`, ... Now, Roger asks you: "What is the name for the dog numbered N?" | ['alp=[\'a\',\'b\',\'c\',\'d\',\'e\',\'f\',\'g\',\'h\',\'i\',\'j\',\'k\',\'l\',\'m\',\'n\',\'o\',\'p\',\'q\',\'r\',\'s\',\'t\',\'u\',\'v\',\'w\',\'x\',\'y\',\'z\']\n \nn=int(input())\nans=""\nwhile n>0:\n a=n%26\n ans+=alp[a] \n n=int(n//26)\n \nprint(ans[::-1])', 'alp=[\'a\',\'b\',\'c\',\'d\',\'e\',\'f\',\'g\',\'h\',\'i\',\'j\',\'k\',\'l\',\'m\',\'n\',\'o\',\'p\',\'q\',\'r\',\'s\',\'t\',\'u\',\'v\',\'w\',\'x\',\'z\']\nn=int(input())\nans=""\nwhile n>0:\n n-=1\n a=n%26\n ans+=alp[a-1] \n n=int(n//26)\n\nprint(ans[::-1])', "alp=['a','b','c','d','e','f','g','h','i','j','k','l','m','n','o','p','q','r','s','t','u','v','w','z']\nif a<27:\n print(alp[a-1])\nelse:\n b=a//26\n c=a%26\n ans=[]\n for i in range(17):\n if b/(10^(i+1))>0:\n d=int(b/(10^(i+1)))\n ans.append(alp[d-1])\n else:\n break\n ans.append(alp[c-1])\n\n print(ans)\n", 'alp=[\'a\',\'b\',\'c\',\'d\',\'e\',\'f\',\'g\',\'h\',\'i\',\'j\',\'k\',\'l\',\'m\',\'n\',\'o\',\'p\',\'q\',\'r\',\'s\',\'t\',\'u\',\'v\',\'w\',\'x\',\'y\',\'z\']\nn=int(input())\nans=""\nwhile n>0:\n n-=1\n a=n%26\n ans+=alp[a] \n n=int(n//26)\n \nprint(ans[::-1])'] | ['Wrong Answer', 'Wrong Answer', 'Runtime Error', 'Accepted'] | ['s413827666', 's553088012', 's629175696', 's389302787'] | [9144.0, 9120.0, 9136.0, 9044.0] | [29.0, 30.0, 29.0, 31.0] | [199, 200, 303, 203] |
p02629 | u945335181 | 2,000 | 1,048,576 | 1000000000000001 dogs suddenly appeared under the roof of Roger's house, all of which he decided to keep. The dogs had been numbered 1 through 1000000000000001, but he gave them new names, as follows: * the dogs numbered 1,2,\cdots,26 were respectively given the names `a`, `b`, ..., `z`; * the dogs numbered 27,28,29,\cdots,701,702 were respectively given the names `aa`, `ab`, `ac`, ..., `zy`, `zz`; * the dogs numbered 703,704,705,\cdots,18277,18278 were respectively given the names `aaa`, `aab`, `aac`, ..., `zzy`, `zzz`; * the dogs numbered 18279,18280,18281,\cdots,475253,475254 were respectively given the names `aaaa`, `aaab`, `aaac`, ..., `zzzy`, `zzzz`; * the dogs numbered 475255,475256,\cdots were respectively given the names `aaaaa`, `aaaab`, ...; * and so on. To sum it up, the dogs numbered 1, 2, \cdots were respectively given the following names: `a`, `b`, ..., `z`, `aa`, `ab`, ..., `az`, `ba`, `bb`, ..., `bz`, ..., `za`, `zb`, ..., `zz`, `aaa`, `aab`, ..., `aaz`, `aba`, `abb`, ..., `abz`, ..., `zzz`, `aaaa`, ... Now, Roger asks you: "What is the name for the dog numbered N?" | ['n = int(input())\nresposta = ""\n\nwhile n > 26:\n resposta += alfabeto[(n%26) - 1]\n n = (n // 26) \n\n\nresposta += alfabeto[(n % 26) - 1]\nresposta = resposta[::-1]\n\nprint(resposta)\n', 'alfabeto = "abcdefghijklmnopqrstuvwxyz"\n\nn = int(input())\nresposta = ""\n\nfor i in range(1, 99):\n if n <= 26 ** i:\n n -= 1\n\n for j in range(i):\n resposta += chr(ord("a") + n % 26)\n n //= 26\n\n break\n\n else:\n n -= 26 ** i\n\nresposta = resposta[::-1]\n\nprint(resposta)\n'] | ['Runtime Error', 'Accepted'] | ['s366401088', 's160446928'] | [9068.0, 9176.0] | [29.0, 31.0] | [182, 319] |
p02629 | u945405878 | 2,000 | 1,048,576 | 1000000000000001 dogs suddenly appeared under the roof of Roger's house, all of which he decided to keep. The dogs had been numbered 1 through 1000000000000001, but he gave them new names, as follows: * the dogs numbered 1,2,\cdots,26 were respectively given the names `a`, `b`, ..., `z`; * the dogs numbered 27,28,29,\cdots,701,702 were respectively given the names `aa`, `ab`, `ac`, ..., `zy`, `zz`; * the dogs numbered 703,704,705,\cdots,18277,18278 were respectively given the names `aaa`, `aab`, `aac`, ..., `zzy`, `zzz`; * the dogs numbered 18279,18280,18281,\cdots,475253,475254 were respectively given the names `aaaa`, `aaab`, `aaac`, ..., `zzzy`, `zzzz`; * the dogs numbered 475255,475256,\cdots were respectively given the names `aaaaa`, `aaaab`, ...; * and so on. To sum it up, the dogs numbered 1, 2, \cdots were respectively given the following names: `a`, `b`, ..., `z`, `aa`, `ab`, ..., `az`, `ba`, `bb`, ..., `bz`, ..., `za`, `zb`, ..., `zz`, `aaa`, `aab`, ..., `aaz`, `aba`, `abb`, ..., `abz`, ..., `zzz`, `aaaa`, ... Now, Roger asks you: "What is the name for the dog numbered N?" | ['def print_ans(num):\n\n base = 26\n\n checker = True\n ind = 1\n while checker:\n if num > base ** ind:\n ind += 1\n else:\n checker = False\n ind -= 1\n\n pre_ans_num = []\n for i in range(ind):\n ind_2 = ind - i\n quot = num // base ** ind_2\n pre_ans_num.append(quot)\n num = num % base ** ind_2\n pre_ans_num.append(num)\n\n ans = ""\n \n# print(pre_ans_num)\n pre_ans_num2 = pre_ans_num.copy()\n for i , ans_num in enumerate(pre_ans_num):\n# print(i, ans_num)\n pre_ans_num2[i - 1] += -1\n \n for n in pre_ans_num2:\n if n==0:\n ans += "z"\n else:\n order = ord("a") + n - 1\n ans += chr(order)\n\n print(ans)\n\na = str(input())\nprint_ans(a)', 'num = int(input())\nbase = 26\n\nchecker = True\nind = 1\nwhile checker:\n if num > base ** ind:\n ind += 1\n else:\n checker = False\n ind += -1\n\npre_ans_num = []\nfor i in range(ind):\n ind_2 = ind - i\n quot = num // base ** ind_2\n pre_ans_list.append(quot)\n num = a % base ** ind_2\n\nans = ""\nfor n in pre_ans_num:\n if n==0:\n ans += "0"\n else:\n order = ord("a") + n - 1\n ans += chr(order)\n\nprint(ans)\n ', 'def print_ans(num):\n\n base = 26\n\n checker = True\n ind = 1\n while checker:\n if num > base ** ind:\n ind += 1\n else:\n checker = False\n ind -= 1\n\n pre_ans_num = []\n for i in range(ind):\n ind_2 = ind - i\n quot = num // base ** ind_2\n pre_ans_num.append(quot)\n num = num % base ** ind_2\n pre_ans_num.append(num)\n\n ans = ""\n \n# print(pre_ans_num)\n pre_ans_num2 = pre_ans_num.copy()\n for i , ans_num in enumerate(pre_ans_num):\n# print(i, ans_num)\n pre_ans_num2[i - 1] += -1\n \n for n in pre_ans_num2:\n if n==0:\n ans += "z"\n else:\n order = ord("a") + n - 1\n ans += chr(order)\n\n print(ans)\n \na = int(input())\nprint_ans(a)', 'num = int(input())\nbase = 26\n\nchecker = True\nind = 1\nwhile checker:\n if num > base ** ind:\n ind += 1\n else:\n checker = False\n ind += -1\n\npre_ans_num = []\nfor i in range(ind):\n ind_2 = ind - i\n quot = num // base ** ind_2\n pre_ans_num.append(quot)\n num = num % base ** ind_2\n\nans = ""\nfor n in pre_ans_num:\n if n==0:\n ans += "0"\n else:\n order = ord("a") + n - 1\n ans += chr(order)\n\nprint(ans)\n \n', 'N = int(input())\nans = \'\'\nfor i in range(1, 10000):\n# print(N)\n# print("-> ",26 ** i)\n if N <= 26 ** i: \n# print("ok")\n N += -1\n for j in range(i):\n# print("N:", N)\n# print("N % 26:", N % 26)\n ans += chr(ord(\'a\') + N % 26)\n N = N // 26 \n break\n else:\n N -= 26 ** i\n\nprint(ans[::-1])'] | ['Runtime Error', 'Runtime Error', 'Wrong Answer', 'Wrong Answer', 'Accepted'] | ['s394879718', 's500230611', 's584914575', 's688814516', 's316217778'] | [9088.0, 9136.0, 9184.0, 9200.0, 9040.0] | [23.0, 24.0, 27.0, 30.0, 30.0] | [820, 421, 824, 423, 398] |
p02629 | u952656646 | 2,000 | 1,048,576 | 1000000000000001 dogs suddenly appeared under the roof of Roger's house, all of which he decided to keep. The dogs had been numbered 1 through 1000000000000001, but he gave them new names, as follows: * the dogs numbered 1,2,\cdots,26 were respectively given the names `a`, `b`, ..., `z`; * the dogs numbered 27,28,29,\cdots,701,702 were respectively given the names `aa`, `ab`, `ac`, ..., `zy`, `zz`; * the dogs numbered 703,704,705,\cdots,18277,18278 were respectively given the names `aaa`, `aab`, `aac`, ..., `zzy`, `zzz`; * the dogs numbered 18279,18280,18281,\cdots,475253,475254 were respectively given the names `aaaa`, `aaab`, `aaac`, ..., `zzzy`, `zzzz`; * the dogs numbered 475255,475256,\cdots were respectively given the names `aaaaa`, `aaaab`, ...; * and so on. To sum it up, the dogs numbered 1, 2, \cdots were respectively given the following names: `a`, `b`, ..., `z`, `aa`, `ab`, ..., `az`, `ba`, `bb`, ..., `bz`, ..., `za`, `zb`, ..., `zz`, `aaa`, `aab`, ..., `aaz`, `aba`, `abb`, ..., `abz`, ..., `zzz`, `aaaa`, ... Now, Roger asks you: "What is the name for the dog numbered N?" | ['N = int(input())\nalpha = list(\'abcdefghijklmnopqrstuvwxyz\')\nans = []\n\nwhile N>0:\n N, d = N//26, N%26\n ans.append(alpha[d-1])\n print(N, d)\nans = list(reversed(ans))\nans = "".join(ans)\nprint(ans)', 'N = int(input())\nalpha = list(\'abcdefghijklmnopqrstuvwxyz\')\nans = []\nwhile N>0:\n N, d = N//26, N%26\n if N==0:\n break\n ans.append(alpha[d-1])\nans = list(reversed(ans))\nans = "".join(ans)\nprint(ans)', 'N = int(input())\nalpha = list(\'abcdefghijklmnopqrstuvwxyz\')\nans = []\nwhile N>0:\n N, d = N//26, N%26\n ans.append(alpha[d-1])\n print(N, d)\nans = list(reversed(ans))\nans = "".join(ans)\nprint(ans)', 'N = int(input())\nans = ""\nwhile N>0:\n N -= 1\n s = N%26\n ans += chr(s + 97)\n N = (N-s)//26\nprint(ans[::-1])'] | ['Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Accepted'] | ['s020170305', 's248907733', 's571088277', 's971743140'] | [9216.0, 9184.0, 9184.0, 9100.0] | [31.0, 31.0, 32.0, 29.0] | [202, 212, 201, 118] |
p02629 | u955248595 | 2,000 | 1,048,576 | 1000000000000001 dogs suddenly appeared under the roof of Roger's house, all of which he decided to keep. The dogs had been numbered 1 through 1000000000000001, but he gave them new names, as follows: * the dogs numbered 1,2,\cdots,26 were respectively given the names `a`, `b`, ..., `z`; * the dogs numbered 27,28,29,\cdots,701,702 were respectively given the names `aa`, `ab`, `ac`, ..., `zy`, `zz`; * the dogs numbered 703,704,705,\cdots,18277,18278 were respectively given the names `aaa`, `aab`, `aac`, ..., `zzy`, `zzz`; * the dogs numbered 18279,18280,18281,\cdots,475253,475254 were respectively given the names `aaaa`, `aaab`, `aaac`, ..., `zzzy`, `zzzz`; * the dogs numbered 475255,475256,\cdots were respectively given the names `aaaaa`, `aaaab`, ...; * and so on. To sum it up, the dogs numbered 1, 2, \cdots were respectively given the following names: `a`, `b`, ..., `z`, `aa`, `ab`, ..., `az`, `ba`, `bb`, ..., `bz`, ..., `za`, `zb`, ..., `zz`, `aaa`, `aab`, ..., `aaz`, `aba`, `abb`, ..., `abz`, ..., `zzz`, `aaaa`, ... Now, Roger asks you: "What is the name for the dog numbered N?" | ["N = int(input())\nMin = 1\nMax = 26\nCount = 0\nFlag = True\nwhile Flag:\n Count += 1\n if Min<=N<=Max:\n Disp = ['']*Count\n Flag = False\n Num = N-Min+1\n for T in range(0,Count-1):\n CHR = Num//pow(26,Count-T-1)\n Disp[T] = chr(97+CHR)\n Num = Num-CHR*pow(26,Count-T-1)\n Disp[-1] = chr(96+Num)\n else:\n Min = Max+1\n Max += pow(26,Count+1)\n''.join(Disp)", "N = int(input())\nMin = 1\nMax = 26\nCount = 0\nFlag = True\nwhile Flag:\n Count += 1\n if Min<=N<=Max:\n Disp = ['']*Count\n Flag = False\n Num = N-Min\n for T in range(1,Count+1):\n Disp[-T] = chr(97+Num%26)\n Num = Num//26\n else:\n Min = Max+1\n Max += pow(26,Count+1)\nprint(''.join(Disp))"] | ['Wrong Answer', 'Accepted'] | ['s041121668', 's375780337'] | [9212.0, 9188.0] | [31.0, 27.0] | [431, 350] |
p02629 | u963747475 | 2,000 | 1,048,576 | 1000000000000001 dogs suddenly appeared under the roof of Roger's house, all of which he decided to keep. The dogs had been numbered 1 through 1000000000000001, but he gave them new names, as follows: * the dogs numbered 1,2,\cdots,26 were respectively given the names `a`, `b`, ..., `z`; * the dogs numbered 27,28,29,\cdots,701,702 were respectively given the names `aa`, `ab`, `ac`, ..., `zy`, `zz`; * the dogs numbered 703,704,705,\cdots,18277,18278 were respectively given the names `aaa`, `aab`, `aac`, ..., `zzy`, `zzz`; * the dogs numbered 18279,18280,18281,\cdots,475253,475254 were respectively given the names `aaaa`, `aaab`, `aaac`, ..., `zzzy`, `zzzz`; * the dogs numbered 475255,475256,\cdots were respectively given the names `aaaaa`, `aaaab`, ...; * and so on. To sum it up, the dogs numbered 1, 2, \cdots were respectively given the following names: `a`, `b`, ..., `z`, `aa`, `ab`, ..., `az`, `ba`, `bb`, ..., `bz`, ..., `za`, `zb`, ..., `zz`, `aaa`, `aab`, ..., `aaz`, `aba`, `abb`, ..., `abz`, ..., `zzz`, `aaaa`, ... Now, Roger asks you: "What is the name for the dog numbered N?" | ['n=int(input())\nl=[]\nwhile(n):\n n-=1\n x=n%26\n l.insert(0,chr(( x-1) + ord(\'a\')))\n n//=26\nprint("".join(l))\n', 'n=int(input())\nl=[]\nwhile(n):\n n-=1\n x=n%26\n if x==0:\n l.insert(0,\'z\')\n n//=26\n else: \n l.insert(0,chr(( x-1) + ord(\'a\')))\n n//=26\nprint("".join(l))\n', 'n=int(input())\nl=[]\nwhile(n):\n n-=1\n x=n%26\n \n l.insert(0,chr(( x) + ord(\'a\')))\n n//=26\nprint("".join(l))'] | ['Wrong Answer', 'Wrong Answer', 'Accepted'] | ['s887707262', 's985185716', 's841349970'] | [9100.0, 9152.0, 9092.0] | [28.0, 28.0, 31.0] | [110, 166, 109] |
p02629 | u967822229 | 2,000 | 1,048,576 | 1000000000000001 dogs suddenly appeared under the roof of Roger's house, all of which he decided to keep. The dogs had been numbered 1 through 1000000000000001, but he gave them new names, as follows: * the dogs numbered 1,2,\cdots,26 were respectively given the names `a`, `b`, ..., `z`; * the dogs numbered 27,28,29,\cdots,701,702 were respectively given the names `aa`, `ab`, `ac`, ..., `zy`, `zz`; * the dogs numbered 703,704,705,\cdots,18277,18278 were respectively given the names `aaa`, `aab`, `aac`, ..., `zzy`, `zzz`; * the dogs numbered 18279,18280,18281,\cdots,475253,475254 were respectively given the names `aaaa`, `aaab`, `aaac`, ..., `zzzy`, `zzzz`; * the dogs numbered 475255,475256,\cdots were respectively given the names `aaaaa`, `aaaab`, ...; * and so on. To sum it up, the dogs numbered 1, 2, \cdots were respectively given the following names: `a`, `b`, ..., `z`, `aa`, `ab`, ..., `az`, `ba`, `bb`, ..., `bz`, ..., `za`, `zb`, ..., `zz`, `aaa`, `aab`, ..., `aaz`, `aba`, `abb`, ..., `abz`, ..., `zzz`, `aaaa`, ... Now, Roger asks you: "What is the name for the dog numbered N?" | ["N = int(input())\n\ns=''\nwhile N>0:\n if N<=26:\n s+=chr(64+N)\n N=0\n elif N%26==0:\n s+=chr(90)\n N=N//26-1\n else:\n s+=chr(64+N%26)\n N=N//26\n\nprint(s)", 'def num2alpha(num):\n if num<=26:\n return chr(96+num)\n elif num%26==0:\n return num2alpha(num//26-1)+chr(122)\n else:\n return num2alpha(num//26)+chr(96+num%26)\n\nN = int(input())\n\nprint(num2alpha(N))'] | ['Wrong Answer', 'Accepted'] | ['s521839215', 's520954242'] | [9060.0, 9172.0] | [31.0, 30.0] | [195, 225] |
p02629 | u968404618 | 2,000 | 1,048,576 | 1000000000000001 dogs suddenly appeared under the roof of Roger's house, all of which he decided to keep. The dogs had been numbered 1 through 1000000000000001, but he gave them new names, as follows: * the dogs numbered 1,2,\cdots,26 were respectively given the names `a`, `b`, ..., `z`; * the dogs numbered 27,28,29,\cdots,701,702 were respectively given the names `aa`, `ab`, `ac`, ..., `zy`, `zz`; * the dogs numbered 703,704,705,\cdots,18277,18278 were respectively given the names `aaa`, `aab`, `aac`, ..., `zzy`, `zzz`; * the dogs numbered 18279,18280,18281,\cdots,475253,475254 were respectively given the names `aaaa`, `aaab`, `aaac`, ..., `zzzy`, `zzzz`; * the dogs numbered 475255,475256,\cdots were respectively given the names `aaaaa`, `aaaab`, ...; * and so on. To sum it up, the dogs numbered 1, 2, \cdots were respectively given the following names: `a`, `b`, ..., `z`, `aa`, `ab`, ..., `az`, `ba`, `bb`, ..., `bz`, ..., `za`, `zb`, ..., `zz`, `aaa`, `aab`, ..., `aaz`, `aba`, `abb`, ..., `abz`, ..., `zzz`, `aaaa`, ... Now, Roger asks you: "What is the name for the dog numbered N?" | ['from collections import *\nfrom operator import mul\n\nn = int(input())\nA = list(map(int, input().split()))\nq = int(input())\n\n\nA_dic = Counter(A)\nA_sum = sum(A)\n\nfor _ in range(q):\n b, c = map(int, input().split())\n tmp = A_dic[b]\n A_dic[c] += tmp\n A_dic[b] = 0\n A_sum += tmp*(c - b)\n print(A_sum)', 'import sys\ninput=lambda :sys.stdin.readline().rstrip()\n\ndef num2alpha(num):\n if num<=26:\n return chr(96+num)\n elif num%26==0:\n return num2alpha(num//26-1)+chr(122)\n else:\n return num2alpha(num//26)+chr(96+num%26)\n\nn = int(input())\nprint(num2alpha(n))'] | ['Runtime Error', 'Accepted'] | ['s544966270', 's380167790'] | [9484.0, 9164.0] | [26.0, 34.0] | [312, 280] |
p02629 | u969081133 | 2,000 | 1,048,576 | 1000000000000001 dogs suddenly appeared under the roof of Roger's house, all of which he decided to keep. The dogs had been numbered 1 through 1000000000000001, but he gave them new names, as follows: * the dogs numbered 1,2,\cdots,26 were respectively given the names `a`, `b`, ..., `z`; * the dogs numbered 27,28,29,\cdots,701,702 were respectively given the names `aa`, `ab`, `ac`, ..., `zy`, `zz`; * the dogs numbered 703,704,705,\cdots,18277,18278 were respectively given the names `aaa`, `aab`, `aac`, ..., `zzy`, `zzz`; * the dogs numbered 18279,18280,18281,\cdots,475253,475254 were respectively given the names `aaaa`, `aaab`, `aaac`, ..., `zzzy`, `zzzz`; * the dogs numbered 475255,475256,\cdots were respectively given the names `aaaaa`, `aaaab`, ...; * and so on. To sum it up, the dogs numbered 1, 2, \cdots were respectively given the following names: `a`, `b`, ..., `z`, `aa`, `ab`, ..., `az`, `ba`, `bb`, ..., `bz`, ..., `za`, `zb`, ..., `zz`, `aaa`, `aab`, ..., `aaz`, `aba`, `abb`, ..., `abz`, ..., `zzz`, `aaaa`, ... Now, Roger asks you: "What is the name for the dog numbered N?" | ['n=int(input())\na=26\nb=1\nimport string\narray=list(string.ascii_lowercase)\nwhile n>a:\n b+=1\n a+=26**b\nif b==1:\n print(array[n+1])\nelse:\n c=b-1\n d=n-26**c\n for i in range(c-1):\n brray=[0]\n crray=[d]\n brray[i+1]=crray[i]//26**(c-i)\n crray[i+1]=crray[i]%26**(c-i)\n ans=array[brray[1]+1]\n if c>1:\n for j in range(2,c):\n ans=ans+brray[j]\n ans=ans+crray[c]\n print(ans)', 'n=int(input())\na=26\nb=1\nimport math\nimport string\narray=list(string.ascii_lowercase)\nwhile n>a:\n b+=1\n a+=26**b\nif b==1:\n print(array[n-1])\nelse:\n c=b-1\n d=n-a\n brray=[0]\n crray=[d]\n for i in range(c):\n brray.append(math.ceil(crray[i]/(26**(c-i))))\n crray.append(crray[i]%(26**(c-i)))\n ans=array[brray[1]-1]\n if c>1:\n for j in range(2,b):\n ans=ans+array[brray[j]-1]\n ans=ans+array[crray[c]-1]\n print(ans)'] | ['Runtime Error', 'Accepted'] | ['s911639681', 's866568197'] | [9984.0, 9912.0] | [32.0, 42.0] | [390, 430] |
p02629 | u970937288 | 2,000 | 1,048,576 | 1000000000000001 dogs suddenly appeared under the roof of Roger's house, all of which he decided to keep. The dogs had been numbered 1 through 1000000000000001, but he gave them new names, as follows: * the dogs numbered 1,2,\cdots,26 were respectively given the names `a`, `b`, ..., `z`; * the dogs numbered 27,28,29,\cdots,701,702 were respectively given the names `aa`, `ab`, `ac`, ..., `zy`, `zz`; * the dogs numbered 703,704,705,\cdots,18277,18278 were respectively given the names `aaa`, `aab`, `aac`, ..., `zzy`, `zzz`; * the dogs numbered 18279,18280,18281,\cdots,475253,475254 were respectively given the names `aaaa`, `aaab`, `aaac`, ..., `zzzy`, `zzzz`; * the dogs numbered 475255,475256,\cdots were respectively given the names `aaaaa`, `aaaab`, ...; * and so on. To sum it up, the dogs numbered 1, 2, \cdots were respectively given the following names: `a`, `b`, ..., `z`, `aa`, `ab`, ..., `az`, `ba`, `bb`, ..., `bz`, ..., `za`, `zb`, ..., `zz`, `aaa`, `aab`, ..., `aaz`, `aba`, `abb`, ..., `abz`, ..., `zzz`, `aaaa`, ... Now, Roger asks you: "What is the name for the dog numbered N?" | ['n=int(input())\nk=[]\ndef a(i):\n if i==0:\n return 26\n else:\n return i\nwhile n>26:\n k+=[chr(96+a(n%26))]\n if n%26==0:\n n=n//26-1\n else:\n n//=26\nk+=[chr(96+a(n))]\nprint(z+1,"".join(k[::-1]))', 'n=int(input())\nk=[]\ndef a(i):\n if i==0:\n return 26\n else:\n return i\nwhile n>26:\n k+=[chr(96+a(n%26))]\n if n%26==0:\n n=n//26-1\n else:\n n//=26\nk+=[chr(96+a(n))]\nprint("".join(k[::-1]))'] | ['Runtime Error', 'Accepted'] | ['s343420231', 's456517631'] | [9184.0, 9180.0] | [25.0, 29.0] | [229, 225] |
p02629 | u978167553 | 2,000 | 1,048,576 | 1000000000000001 dogs suddenly appeared under the roof of Roger's house, all of which he decided to keep. The dogs had been numbered 1 through 1000000000000001, but he gave them new names, as follows: * the dogs numbered 1,2,\cdots,26 were respectively given the names `a`, `b`, ..., `z`; * the dogs numbered 27,28,29,\cdots,701,702 were respectively given the names `aa`, `ab`, `ac`, ..., `zy`, `zz`; * the dogs numbered 703,704,705,\cdots,18277,18278 were respectively given the names `aaa`, `aab`, `aac`, ..., `zzy`, `zzz`; * the dogs numbered 18279,18280,18281,\cdots,475253,475254 were respectively given the names `aaaa`, `aaab`, `aaac`, ..., `zzzy`, `zzzz`; * the dogs numbered 475255,475256,\cdots were respectively given the names `aaaaa`, `aaaab`, ...; * and so on. To sum it up, the dogs numbered 1, 2, \cdots were respectively given the following names: `a`, `b`, ..., `z`, `aa`, `ab`, ..., `az`, `ba`, `bb`, ..., `bz`, ..., `za`, `zb`, ..., `zz`, `aaa`, `aab`, ..., `aaz`, `aba`, `abb`, ..., `abz`, ..., `zzz`, `aaaa`, ... Now, Roger asks you: "What is the name for the dog numbered N?" | ['n = int(input())\na = input().split()\nq = int(input())\n\nfor i in range(q):\n stdins = input().split()\n for j in range(n):\n a[j] = a[j].replace(stdins[0], stdins[1])\n ans = sum([int(an) for an in a])\n print(ans)\n', 'def int2char(i):\n return chr(ord("a") + i - 1)\n\nN = int(input())\n\nans = ""\nwhile (True):\n N_lsb_int = ((N - 1) % 26) + 1\n N_next = int((N - N_lsb_int)/26)\n ans = int2char(N_lsb_int) + ans\n if N_next == 0:\n break\n N = N_next\n\nprint(ans)'] | ['Runtime Error', 'Accepted'] | ['s978530705', 's229193919'] | [9120.0, 9180.0] | [24.0, 39.0] | [228, 260] |
p02629 | u983640934 | 2,000 | 1,048,576 | 1000000000000001 dogs suddenly appeared under the roof of Roger's house, all of which he decided to keep. The dogs had been numbered 1 through 1000000000000001, but he gave them new names, as follows: * the dogs numbered 1,2,\cdots,26 were respectively given the names `a`, `b`, ..., `z`; * the dogs numbered 27,28,29,\cdots,701,702 were respectively given the names `aa`, `ab`, `ac`, ..., `zy`, `zz`; * the dogs numbered 703,704,705,\cdots,18277,18278 were respectively given the names `aaa`, `aab`, `aac`, ..., `zzy`, `zzz`; * the dogs numbered 18279,18280,18281,\cdots,475253,475254 were respectively given the names `aaaa`, `aaab`, `aaac`, ..., `zzzy`, `zzzz`; * the dogs numbered 475255,475256,\cdots were respectively given the names `aaaaa`, `aaaab`, ...; * and so on. To sum it up, the dogs numbered 1, 2, \cdots were respectively given the following names: `a`, `b`, ..., `z`, `aa`, `ab`, ..., `az`, `ba`, `bb`, ..., `bz`, ..., `za`, `zb`, ..., `zz`, `aaa`, `aab`, ..., `aaz`, `aba`, `abb`, ..., `abz`, ..., `zzz`, `aaaa`, ... Now, Roger asks you: "What is the name for the dog numbered N?" | ['n = int(input())\n\nans = ""\n\nwhile(n > 0):\n tmp = n % 26\n if tmp > 0:\n ans += chr((tmp - 1) + ord(\'a\'))\n else:\n ans += \'z\'\n n -= 1\n n /= 26\n if n == 0:\n break\n\nprint(ans[::-1])\n', 'n = int(input())\n\nans = ""\n\nal = [\'a\', \'b\', \'c\', \'d\', \'e\', \'f\', \'g\', \'h\', \'i\', \'j\', \'k\', \'l\', \'m\',\n \'n\', \'o\', \'p\', \'q\', \'r\', \'s\', \'t\', \'u\', \'v\', \'w\', \'x\', \'y\', \'z\']\n\nwhile n > 0:\n tmp = n % 26\n if tmp > 0:\n ans += al[tmp-1]\n else:\n ans += \'z\'\n n -= 1\n n /= 26\n if n == 0:\n break\n\nprint(ans[::-1])\n', 'n = int(input())\n\nans = ""\n\nwhile(n > 0):\n tmp = n % 26\n if tmp > 0:\n ans += chr((tmp - 1) + ord(\'a\'))\n else:\n ans += \'z\'\n n -= 1\n n /= 26\n\nprint(ans[::-1])\n', 'n = int(input())\n\nans = ""\n\nal = [\'a\', \'b\', \'c\', \'d\', \'e\', \'f\', \'g\', \'h\', \'i\', \'j\', \'k\', \'l\', \'m\',\n \'n\', \'o\', \'p\', \'q\', \'r\', \'s\', \'t\', \'u\', \'v\', \'w\', \'x\', \'y\', \'z\']\n\nwhile n > 0:\n tmp = n % 26\n if tmp > 0:\n ans += al[tmp-1]\n else:\n ans += \'z\'\n n = n - 1\n n = n // 26\n\nprint(ans[::-1])\n'] | ['Runtime Error', 'Runtime Error', 'Runtime Error', 'Accepted'] | ['s230375665', 's244679248', 's493057730', 's691819963'] | [9160.0, 8976.0, 9168.0, 9184.0] | [24.0, 29.0, 25.0, 33.0] | [219, 345, 190, 323] |
p02629 | u996506712 | 2,000 | 1,048,576 | 1000000000000001 dogs suddenly appeared under the roof of Roger's house, all of which he decided to keep. The dogs had been numbered 1 through 1000000000000001, but he gave them new names, as follows: * the dogs numbered 1,2,\cdots,26 were respectively given the names `a`, `b`, ..., `z`; * the dogs numbered 27,28,29,\cdots,701,702 were respectively given the names `aa`, `ab`, `ac`, ..., `zy`, `zz`; * the dogs numbered 703,704,705,\cdots,18277,18278 were respectively given the names `aaa`, `aab`, `aac`, ..., `zzy`, `zzz`; * the dogs numbered 18279,18280,18281,\cdots,475253,475254 were respectively given the names `aaaa`, `aaab`, `aaac`, ..., `zzzy`, `zzzz`; * the dogs numbered 475255,475256,\cdots were respectively given the names `aaaaa`, `aaaab`, ...; * and so on. To sum it up, the dogs numbered 1, 2, \cdots were respectively given the following names: `a`, `b`, ..., `z`, `aa`, `ab`, ..., `az`, `ba`, `bb`, ..., `bz`, ..., `za`, `zb`, ..., `zz`, `aaa`, `aab`, ..., `aaz`, `aba`, `abb`, ..., `abz`, ..., `zzz`, `aaaa`, ... Now, Roger asks you: "What is the name for the dog numbered N?" | ["n=int(input())\nmlist=[]\n\nfor i in range(15):\n mm=n%26 \n m=mm if mm >0 else 26\n n = n//26\n mlist.insert(0,m)\n if n<26:\n m=n\n mlist.insert(0,m)\n break\n else:\n pass\n\nmlist_alph=[chr(i+96) for i in mlist]\nprint(''.join(mlist_alph))\n ", "n=int(input())\nmlist=[]\n\nfor i in range(11):\n m=n%26\n n = n//26\n mlist.insert(0,m)\n if n<26:\n m=n\n mlist.insert(0,m)\n break\n else:\n pass\nmlist_alph=[chr(i+96) for i in mlist]\nprint(''.join(mlist_alph))", "n=int(input())\nmlist=[]\n\nfor i in range(11):\n mm=n%26 \n m=mm if mm >0 else 26\n n = n//26\n mlist.insert(0,m)\n if n<26:\n m=n\n mlist.insert(0,m)\n break\n else:\n pass\n\nmlist_alph=[chr(i+96) for i in mlist]\nprint(''.join(mlist_alph))\n ", "n=int(input())\nmlist=[]\n\nfor i in range(15):\n mm=n%26 \n m=mm if mm >0 else 26\n n = n//26\n mlist.insert(0,m)\n if n<26:\n m=n if n >0 else 26\n mlist.insert(0,m)\n break\n else:\n pass\n\nmlist_alph=[chr(i+96) for i in mlist]\nprint(''.join(mlist_alph))", "n=int(input())\nmlist=[]\n\nfor i in range(15):\n mm=n%26 \n m=mm if mm >0 else 26\n n = n//26\n mlist.insert(0,m)\n if n<26:\n mm=n%26 \n m=mm if mm >0 else 26\n mlist.insert(0,m)\n break\n else:\n pass\n\nmlist_alph=[chr(i+96) for i in mlist]\nprint(''.join(mlist_alph))\n ", 'n=int(input())\nname=""\nfor i in range(15):\n n=n-1\n name=name+chr(97+n%26)\n n=n//26\n if n==0:\n break\nprint(name[::-1])'] | ['Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Accepted'] | ['s007078978', 's175348396', 's449649336', 's671955412', 's765559282', 's779924950'] | [9152.0, 9176.0, 9168.0, 9180.0, 9156.0, 9112.0] | [31.0, 29.0, 29.0, 27.0, 29.0, 30.0] | [248, 218, 248, 261, 279, 124] |
p02629 | u996665352 | 2,000 | 1,048,576 | 1000000000000001 dogs suddenly appeared under the roof of Roger's house, all of which he decided to keep. The dogs had been numbered 1 through 1000000000000001, but he gave them new names, as follows: * the dogs numbered 1,2,\cdots,26 were respectively given the names `a`, `b`, ..., `z`; * the dogs numbered 27,28,29,\cdots,701,702 were respectively given the names `aa`, `ab`, `ac`, ..., `zy`, `zz`; * the dogs numbered 703,704,705,\cdots,18277,18278 were respectively given the names `aaa`, `aab`, `aac`, ..., `zzy`, `zzz`; * the dogs numbered 18279,18280,18281,\cdots,475253,475254 were respectively given the names `aaaa`, `aaab`, `aaac`, ..., `zzzy`, `zzzz`; * the dogs numbered 475255,475256,\cdots were respectively given the names `aaaaa`, `aaaab`, ...; * and so on. To sum it up, the dogs numbered 1, 2, \cdots were respectively given the following names: `a`, `b`, ..., `z`, `aa`, `ab`, ..., `az`, `ba`, `bb`, ..., `bz`, ..., `za`, `zb`, ..., `zz`, `aaa`, `aab`, ..., `aaz`, `aba`, `abb`, ..., `abz`, ..., `zzz`, `aaaa`, ... Now, Roger asks you: "What is the name for the dog numbered N?" | ['N = int(input())\nn = []\nwhile N > 0:\n r = N%26\n if r == 0: r = 26\n # print(96+r)\n n.append(chr(96+r))\n N //= 26\nn.reverse()\nfor nn in n:\n print(nn, end="")', "N = int(input())\nans = ''\nwhile N > 0:\n N -= 1\n ans += chr(ord('a')+N%26)\n N //= 26\nprint(ans[::-1])"] | ['Wrong Answer', 'Accepted'] | ['s567336270', 's034380231'] | [9144.0, 9140.0] | [30.0, 30.0] | [161, 103] |
p02630 | u000037600 | 2,000 | 1,048,576 | You have a sequence A composed of N positive integers: A_{1}, A_{2}, \cdots, A_{N}. You will now successively do the following Q operations: * In the i-th operation, you replace every element whose value is B_{i} with C_{i}. For each i (1 \leq i \leq Q), find S_{i}: the sum of all elements in A just after the i-th operation. | ["input()\na=list(map(int,input().split()))\nb=int(input())\nfor i in range(b):\n c,d=map(int,input().split())\n a=[d if j==c else j for j in a]\nprint(' '.join(map(str, a)))", "input()\na=list(map(int,input().split()))\nb=int(input())\nfor i in range(b):\n c,d=map(int,input().split())\n a=[d if j==c else j for j in a]\n print(' '.join(map(str, a)))", 'from sys import stdin\ninput=stdin.readline\ninput()\na=input().strip()\nb=int(input())\nfor i in range(b):\n n,m=map(int,input().split())\n a.replace(str(n),str(m))\n print(sum(a))', "input()\na=list(map(int,input().split()))\nb=int(input())\nfor i in range(b):\n c,d=map(int,input().split())\n a=[d if j==c else j for j in a]\nprint(' '.join(map(str, a)))", 'from sys import stdin\ninput=stdin.readline\ninput()\na=list(map(int,input().split()))\nans=sum(a)\nb=[0]*(10**5+1)\nfor i in a:\n b[i]+=1\nc=int(input())\nfor i in range(c):\n n,m=map(int,input().split())\n if b[n]>0:\n x=b[n]\n if x>0:\n b[m]+=x\n b[n]=0\n ans+=(m-n)*x\n print(ans)'] | ['Wrong Answer', 'Wrong Answer', 'Runtime Error', 'Wrong Answer', 'Accepted'] | ['s219500559', 's323953715', 's939373117', 's991044639', 's034074808'] | [20768.0, 81984.0, 10396.0, 20828.0, 20280.0] | [2206.0, 3386.0, 25.0, 2206.0, 180.0] | [168, 170, 176, 168, 292] |
p02630 | u002663801 | 2,000 | 1,048,576 | You have a sequence A composed of N positive integers: A_{1}, A_{2}, \cdots, A_{N}. You will now successively do the following Q operations: * In the i-th operation, you replace every element whose value is B_{i} with C_{i}. For each i (1 \leq i \leq Q), find S_{i}: the sum of all elements in A just after the i-th operation. | ['n = int(input())\na = input().split()\nalist = set()\nadic = {}\nfor i in a:\n if int(i) in alist:\n adic[int(i)] = adic[int(i)] + 1\n else:\n alist.add(int(i))\n adic[int(i)] = 1\n\nq = int(input())\nans = []\n\nfor i in range(q):\n s = input().split()\n b = int(s[0])\n c = int(s[1])\n if b in alist:\n if not(c in alist):\n adic[c] = 0\n alist.add(c)\n adic[c] = adic[c] + adic[b]\n adic[b] = 0\n su = 0\n for j in adic:\n su += j * adic[j]\n ans.append(su)\n\nprint(ans)', 'n = int(input())\na = input().split()\nalist = set()\nadic = {}\nfor i in a:\n if int(i) in alist:\n adic[int(i)] = adic[int(i)] + 1\n else:\n alist.add(int(i))\n adic[int(i)] = 1\n\nq = int(input())\nans = []\n\n\nfor i in range(q):\n s = input().split()\n b = int(s[0])\n c = int(s[1])\n if b in alist:\n if not(c in alist):\n adic[c] = 0\n alist.add(c)\n adic[c] = adic[c] + adic[b]\n adic[b] = 0\n su = 0\n for j in adic:\n su += j * adic[j]\n #ans.append(sum(adic.values()))\n ans.append(su)\n #tt.append(adic)\n #print(adic)\n\nprint(ans)\n#print(tt)', 'n = int(input())\na = input().split()\nalist = set()\nadic = {}\nsu = 0\n\nfor i in a:\n su += int(i)\n if int(i) in alist:\n adic[int(i)] = adic[int(i)] + 1\n else:\n alist.add(int(i))\n adic[int(i)] = 1\n\nq = int(input())\nans = []\n\nfor i in range(q):\n s = input().split()\n b = int(s[0])\n c = int(s[1])\n if b in alist:\n if not(c in alist):\n adic[c] = 0\n alist.add(c)\n adic[c] = adic[c] + adic[b]\n su = su + (c * adic[b]) - (b * adic[b])\n adic[b] = 0\n\n ans.append(su)\nfor i in range(len(ans)):\n print(ans[i])'] | ['Runtime Error', 'Runtime Error', 'Accepted'] | ['s076868647', 's417026496', 's230675172'] | [25820.0, 25836.0, 31628.0] | [2206.0, 2206.0, 443.0] | [555, 649, 593] |
p02630 | u003644389 | 2,000 | 1,048,576 | You have a sequence A composed of N positive integers: A_{1}, A_{2}, \cdots, A_{N}. You will now successively do the following Q operations: * In the i-th operation, you replace every element whose value is B_{i} with C_{i}. For each i (1 \leq i \leq Q), find S_{i}: the sum of all elements in A just after the i-th operation. | ['from collections import Counter\n\nn = int(input())\na = list(map(int, input().split()))\nq = int(input())\n\nb = []\nc = []\nfor i in range(q):\n\tB, C = map(int, input().split())\n\tb.append(B)\n\tc.append(C)\n\narr = Counter(a)\n\ns = sum(arr)\n\nfor i in range(q):\n\ts -= b[i]*arr[b[i]]\n\ts += c[i]*arr[c[i]]\n\tans[c[i]] += ans[b[i]]\n\tans[b[i]] = 0\n\tprint(s)', 'from collections import Counter\n\nn = int(input())\na = list(map(int, input().split()))\nq = int(input())\n\nfor i in range(q):\n\tB, C = map(int, input().split())\n\tb.append(B)\n\tc.append(C)\n\ncnt = Counter(a)\n\ns = sum(cnt)\n\nfor i in range(q):\n\tb, c = map(int, input().split())\n\ts = s - b*cnt[b]\n\ts = s + c*cnt[b]\n\tcnt[c] += cnt[b]\n\tcnt[b] = 0\n\tprint(s)', 'from collections import Counter\n\nn = int(input())\na = list(map(int, input().split()))\nq = int(input())\n\nb = []\nc = []\nfor i in range(q):\n\tB, C = map(int, input().split())\n\tb.append(B)\n\tc.append(C)\n\ncnt = Counter(a)\n\ns = sum(arr)\n\nfor i in range(q):\n\ts -= b[i]*cnt[b[i]]\n\ts += c[i]*cnt[b[i]]\n\tcnt[c[i]] += cnt[b[i]]\n\tcnt[b[i]] = 0\n\tprint(s)', 'from collections import Counter\n\nn = int(input())\na = list(map(int, input().split()))\nq = int(input())\n\ncnt = Counter(a)\n\ns = sum(a)\n\nfor i in range(q):\n\tb, c = map(int, input().split())\n\ts = s - b*cnt[b]\n\ts = s + c*cnt[b]\n\tcnt[c] += cnt[b]\n\tcnt[b] = 0\n\tprint(s)'] | ['Runtime Error', 'Runtime Error', 'Runtime Error', 'Accepted'] | ['s515053507', 's681488349', 's737820326', 's532766495'] | [26028.0, 21484.0, 26156.0, 24220.0] | [232.0, 51.0, 235.0, 596.0] | [339, 344, 339, 262] |
p02630 | u008718882 | 2,000 | 1,048,576 | You have a sequence A composed of N positive integers: A_{1}, A_{2}, \cdots, A_{N}. You will now successively do the following Q operations: * In the i-th operation, you replace every element whose value is B_{i} with C_{i}. For each i (1 \leq i \leq Q), find S_{i}: the sum of all elements in A just after the i-th operation. | ['import collections as cl\nN = int(input())\nA = list(map(int, input().split()))\nQ = int(input())\n\nsum = 0\nfor i in range(N):\n sum += A[i]\ndic = cl.Counter(A)\n\nl = []\nfor _ in range(Q):\n b, c = map(int, input().split())\n x = dic.get(b)\n if x == None:\n l.append(sum)\n continue\n if b < c:\n sum += (c - b) * x\n else:\n sum -= (b- c) * x\n l.append(sum)\n if c not in dic:\n dic[c] = dic.pop(b)\n else:\n dic[c] = dic.pop(b) + dic[c]\n print(dic) \n\nfor s in l:\n print(s)', 'import collections as cl\nN = int(input())\nA = list(map(int, input().split()))\nQ = int(input())\n\nsum = 0\nfor i in range(N):\n sum += A[i]\ndic = cl.Counter(A)\nprint(A, dic, sum)\n\nl = []\nfor _ in range(Q):\n b, c = map(int, input().split())\n if dic.get(b) == None:\n continue\n if b < c:\n sum += (c - b) * dic[b]\n else:\n sum -= (b- c) * dic[b]\n l.append(sum)\n if c not in dic:\n dic[c] = dic.pop(b)\n else:\n dic[c] = dic.pop(b) + dic[c]\n print(dic) \n\n\nfor s in l:\n print(s)', 'import collections as cl\nN = int(input())\nA = list(map(int, input().split()))\nQ = int(input())\n\nsum = 0\nfor i in range(N):\n sum += A[i]\ndic = cl.Counter(A)\n\nl = []\nfor _ in range(Q):\n b, c = map(int, input().split())\n x = dic.get(b)\n if x == None:\n l.append(sum)\n continue\n if b < c:\n sum += (c - b) * x\n else:\n sum -= (b - c) * x\n l.append(sum)\n if c not in dic:\n dic[c] = dic.pop(b)\n else:\n dic[c] = dic.pop(b) + dic[c]\n\nfor s in l:\n print(s)\n'] | ['Wrong Answer', 'Wrong Answer', 'Accepted'] | ['s724150982', 's834492329', 's167443459'] | [67860.0, 69768.0, 21504.0] | [2335.0, 2298.0, 358.0] | [534, 532, 517] |
p02630 | u014562811 | 2,000 | 1,048,576 | You have a sequence A composed of N positive integers: A_{1}, A_{2}, \cdots, A_{N}. You will now successively do the following Q operations: * In the i-th operation, you replace every element whose value is B_{i} with C_{i}. For each i (1 \leq i \leq Q), find S_{i}: the sum of all elements in A just after the i-th operation. | ["from collections import Counter\ndicy = {}\ndef swap(a,b):\n\ttmp = 0\n\ttry:\n\t\ttmp = dicy.pop(a)\n\texcept Exception:\n\t\ttmp = 0\n\n\ttry:\n\t\tdicy[b] += tmp\n\texcept Exception:\n\t\tdicy[b] = tmp\n\n\treturn (int(b)-int(a)) * tmp\n \n\nmax = input()\ndicy = dict(Counter(input().split(' ')))\nresult = 0\nfor v,k in dicy.items():\n\tresult += int(v)*int(k)\nprint(result)\nnum_oper = int(input())\nfor i in range(num_oper):\n\ta,b = input().split(' ')\n\tdiff = swap(a,b)\n\tresult += diff\n\tprint(result)", "from collections import Counter\ndicy = {}\ndef swap(a,b):\n\ttmp = 0\n\ttry:\n\t\ttmp = dicy.pop(a)\n\texcept Exception:\n\t\ttmp = 0\n\n\ttry:\n\t\tdicy[b] += tmp\n\texcept Exception:\n\t\tdicy[b] = tmp\n\n\treturn (int(b)-int(a)) * tmp\n \n\nmax = input()\ndicy = dict(Counter(input().split(' ')))\nresult = 0\nfor v,k in dicy.items():\n\tresult += int(v)*int(k)\nnum_oper = int(input())\nfor i in range(num_oper):\n\ta,b = input().split(' ')\n\tdiff = swap(a,b)\n\tresult += diff\n\tprint(result)"] | ['Wrong Answer', 'Accepted'] | ['s833664249', 's388545364'] | [24420.0, 24396.0] | [569.0, 569.0] | [469, 455] |
Subsets and Splits
No saved queries yet
Save your SQL queries to embed, download, and access them later. Queries will appear here once saved.