結果

問題 No.2198 Concon Substrings (COuNt-CONstruct Version)
ユーザー Navier_BoltzmannNavier_Boltzmann
提出日時 2023-01-27 23:19:32
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 1,104 bytes
コンパイル時間 361 ms
コンパイル使用メモリ 87,064 KB
実行使用メモリ 81,692 KB
最終ジャッジ日時 2023-09-10 17:05:00
合計ジャッジ時間 22,428 ms
ジャッジサーバーID
(参考情報)
judge11 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 113 ms
73,328 KB
testcase_01 AC 110 ms
72,896 KB
testcase_02 AC 110 ms
72,948 KB
testcase_03 AC 111 ms
73,476 KB
testcase_04 AC 110 ms
73,084 KB
testcase_05 AC 113 ms
73,432 KB
testcase_06 AC 113 ms
73,416 KB
testcase_07 AC 111 ms
73,212 KB
testcase_08 AC 111 ms
73,356 KB
testcase_09 AC 114 ms
75,212 KB
testcase_10 WA -
testcase_11 WA -
testcase_12 AC 126 ms
78,448 KB
testcase_13 AC 132 ms
81,692 KB
testcase_14 AC 130 ms
79,480 KB
testcase_15 AC 123 ms
78,712 KB
testcase_16 AC 113 ms
73,184 KB
testcase_17 AC 111 ms
73,184 KB
testcase_18 AC 111 ms
73,204 KB
testcase_19 AC 109 ms
73,200 KB
testcase_20 AC 112 ms
73,284 KB
testcase_21 AC 117 ms
75,388 KB
testcase_22 WA -
testcase_23 WA -
testcase_24 AC 126 ms
78,480 KB
testcase_25 AC 130 ms
81,608 KB
testcase_26 AC 128 ms
79,172 KB
testcase_27 AC 139 ms
80,724 KB
testcase_28 AC 120 ms
73,232 KB
testcase_29 AC 113 ms
73,304 KB
testcase_30 AC 112 ms
73,496 KB
testcase_31 AC 117 ms
73,232 KB
testcase_32 AC 115 ms
73,508 KB
testcase_33 AC 117 ms
73,284 KB
testcase_34 AC 114 ms
73,460 KB
testcase_35 AC 116 ms
73,084 KB
testcase_36 AC 115 ms
73,200 KB
testcase_37 AC 113 ms
73,284 KB
testcase_38 AC 114 ms
73,184 KB
testcase_39 AC 115 ms
73,080 KB
testcase_40 AC 112 ms
73,316 KB
testcase_41 AC 115 ms
73,304 KB
testcase_42 AC 115 ms
73,352 KB
testcase_43 AC 115 ms
73,352 KB
testcase_44 AC 116 ms
73,504 KB
testcase_45 AC 114 ms
73,372 KB
testcase_46 WA -
testcase_47 WA -
testcase_48 WA -
testcase_49 WA -
testcase_50 WA -
testcase_51 WA -
testcase_52 WA -
testcase_53 AC 128 ms
80,236 KB
testcase_54 AC 130 ms
78,380 KB
testcase_55 AC 128 ms
81,436 KB
testcase_56 AC 123 ms
78,192 KB
testcase_57 AC 123 ms
78,396 KB
testcase_58 AC 125 ms
79,908 KB
testcase_59 AC 123 ms
78,516 KB
testcase_60 AC 126 ms
78,904 KB
testcase_61 AC 127 ms
80,228 KB
testcase_62 AC 123 ms
78,460 KB
testcase_63 AC 125 ms
80,740 KB
testcase_64 AC 128 ms
81,156 KB
testcase_65 AC 128 ms
80,652 KB
testcase_66 AC 128 ms
80,720 KB
testcase_67 AC 133 ms
81,400 KB
testcase_68 AC 126 ms
81,080 KB
testcase_69 AC 129 ms
79,364 KB
testcase_70 AC 157 ms
80,248 KB
testcase_71 WA -
testcase_72 AC 133 ms
79,392 KB
testcase_73 AC 125 ms
79,972 KB
testcase_74 AC 131 ms
80,908 KB
testcase_75 AC 164 ms
80,504 KB
testcase_76 AC 137 ms
80,424 KB
testcase_77 AC 130 ms
80,948 KB
testcase_78 AC 195 ms
80,476 KB
testcase_79 AC 133 ms
78,556 KB
testcase_80 AC 132 ms
81,660 KB
testcase_81 AC 166 ms
78,920 KB
testcase_82 AC 130 ms
80,516 KB
testcase_83 AC 132 ms
80,816 KB
testcase_84 AC 127 ms
80,056 KB
testcase_85 AC 128 ms
81,232 KB
testcase_86 AC 133 ms
80,124 KB
testcase_87 AC 195 ms
81,324 KB
testcase_88 AC 126 ms
80,144 KB
testcase_89 AC 131 ms
78,612 KB
testcase_90 AC 166 ms
80,868 KB
testcase_91 WA -
testcase_92 AC 170 ms
78,920 KB
testcase_93 AC 123 ms
79,612 KB
testcase_94 AC 159 ms
81,164 KB
testcase_95 AC 163 ms
79,116 KB
testcase_96 AC 174 ms
80,468 KB
testcase_97 WA -
testcase_98 WA -
testcase_99 AC 131 ms
78,992 KB
testcase_100 AC 196 ms
80,260 KB
testcase_101 AC 162 ms
80,120 KB
testcase_102 AC 130 ms
79,512 KB
testcase_103 AC 130 ms
79,476 KB
testcase_104 AC 207 ms
81,508 KB
testcase_105 AC 170 ms
81,316 KB
testcase_106 WA -
testcase_107 AC 134 ms
79,320 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

from collections import *
from itertools import *
from functools import *
from heapq import *
import sys,math
input = sys.stdin.readline

M = int(input())

def fcr(n):
    
    ng = math.ceil(n**(1/3)) + 100
    
    ok = math.ceil(n**(1/3)) - 100
    while ng-ok>1:
        mid = (ng+ok)//2
        
        if mid**3<=n:
            ok = mid
        else:
            ng = mid
    return ok
if M <= 10**6:
    N = fcr(M)
    delta = M - N**3
    if N**3+N > M:
        N -= 1
    
    Y = N-1
    Z = N
    W = N
    X = M - N**3 - N
    ans = ['c','o'] + ['n']*X + ['c']*Y + ['o']*Z + ['n']*W
    print(''.join(ans))
    exit()
    
N = fcr(M)
for k in range(-1,2):
    W = N + k
    flg = False
    for i in range(-1000,1000):
        Z = N+i
        for j in range(-1000,1000):
            Y = N+j
            if (1< M - W*((Y+1)*Z+1) + W + Y + Z<=59998)&(M >= W*((Y+1)*Z+1)):
                flg = True
                break
        if flg:
            break
    if flg:
        break

    
    
    
X = M - W*(Z*(Y+1)+1)
ans = ['c','o'] + ['n']*X + ['c']*Y + ['o']*Z + ['n']*W
print(''.join(ans))
0