Submission #46586430


Source Code Expand

n = int(input())
s = "".join(sorted(list(input())))

ans = 0
i = 0
while i * i < 10 ** n:
    t = list(str(i * i))
    t += ["0"] * (n - len(t))
    t = "".join(sorted(t))

    if s == t:
        ans += 1

    i += 1

print(ans)

Submission Info

Submission Time
Task D - Square Permutation
User hnkz_hnkz
Language Python (PyPy 3.10-v7.3.12)
Score 425
Code Size 247 Byte
Status AC
Exec Time 1941 ms
Memory 83116 KiB

Judge Result

Set Name Sample All
Score / Max Score 0 / 0 425 / 425
Status
AC × 3
AC × 46
Set Name Test Cases
Sample 00_sample_00.txt, 00_sample_01.txt, 00_sample_02.txt
All 00_sample_00.txt, 00_sample_01.txt, 00_sample_02.txt, 01_random_03.txt, 01_random_04.txt, 01_random_05.txt, 01_random_06.txt, 01_random_07.txt, 01_random_08.txt, 01_random_09.txt, 01_random_10.txt, 01_random_11.txt, 01_random_12.txt, 01_random_13.txt, 01_random_14.txt, 01_random_15.txt, 01_random_16.txt, 01_random_17.txt, 01_random_18.txt, 01_random_19.txt, 01_random_20.txt, 01_random_21.txt, 01_random_22.txt, 02_max_23.txt, 02_max_24.txt, 02_max_25.txt, 02_max_26.txt, 02_max_27.txt, 02_max_28.txt, 02_max_29.txt, 02_max_30.txt, 02_max_31.txt, 02_max_32.txt, 02_max_33.txt, 02_max_34.txt, 02_max_35.txt, 03_small_36.txt, 03_small_37.txt, 03_small_38.txt, 03_small_39.txt, 03_small_40.txt, 03_small_41.txt, 03_small_42.txt, 03_small_43.txt, 03_small_44.txt, 03_small_45.txt
Case Name Status Exec Time Memory
00_sample_00.txt AC 57 ms 76364 KiB
00_sample_01.txt AC 56 ms 76564 KiB
00_sample_02.txt AC 1941 ms 82980 KiB
01_random_03.txt AC 1919 ms 82888 KiB
01_random_04.txt AC 71 ms 81708 KiB
01_random_05.txt AC 57 ms 76356 KiB
01_random_06.txt AC 1930 ms 82744 KiB
01_random_07.txt AC 1933 ms 82888 KiB
01_random_08.txt AC 1878 ms 82700 KiB
01_random_09.txt AC 1893 ms 82648 KiB
01_random_10.txt AC 1934 ms 82584 KiB
01_random_11.txt AC 1908 ms 82596 KiB
01_random_12.txt AC 1935 ms 82608 KiB
01_random_13.txt AC 107 ms 82356 KiB
01_random_14.txt AC 77 ms 82740 KiB
01_random_15.txt AC 57 ms 76620 KiB
01_random_16.txt AC 1892 ms 82872 KiB
01_random_17.txt AC 1899 ms 82652 KiB
01_random_18.txt AC 1932 ms 82692 KiB
01_random_19.txt AC 1898 ms 82940 KiB
01_random_20.txt AC 1923 ms 82752 KiB
01_random_21.txt AC 1868 ms 82600 KiB
01_random_22.txt AC 1927 ms 82828 KiB
02_max_23.txt AC 1932 ms 82936 KiB
02_max_24.txt AC 1930 ms 83048 KiB
02_max_25.txt AC 1940 ms 83100 KiB
02_max_26.txt AC 1921 ms 82700 KiB
02_max_27.txt AC 1940 ms 83116 KiB
02_max_28.txt AC 1859 ms 82948 KiB
02_max_29.txt AC 1901 ms 82836 KiB
02_max_30.txt AC 1880 ms 82888 KiB
02_max_31.txt AC 1868 ms 82432 KiB
02_max_32.txt AC 1866 ms 82864 KiB
02_max_33.txt AC 1860 ms 82612 KiB
02_max_34.txt AC 1873 ms 82452 KiB
02_max_35.txt AC 1848 ms 82684 KiB
03_small_36.txt AC 57 ms 76552 KiB
03_small_37.txt AC 57 ms 76472 KiB
03_small_38.txt AC 56 ms 76576 KiB
03_small_39.txt AC 56 ms 76564 KiB
03_small_40.txt AC 56 ms 76536 KiB
03_small_41.txt AC 56 ms 76540 KiB
03_small_42.txt AC 57 ms 76564 KiB
03_small_43.txt AC 56 ms 76536 KiB
03_small_44.txt AC 56 ms 76400 KiB
03_small_45.txt AC 56 ms 76712 KiB