結果
問題 |
No.2198 Concon Substrings (COuNt-CONstruct Version)
|
ユーザー |
|
提出日時 | 2023-01-27 23:17:38 |
言語 | PyPy3 (7.3.15) |
結果 |
WA
|
実行時間 | - |
コード長 | 871 bytes |
コンパイル時間 | 179 ms |
コンパイル使用メモリ | 82,040 KB |
実行使用メモリ | 71,672 KB |
最終ジャッジ日時 | 2024-06-28 08:08:33 |
合計ジャッジ時間 | 16,654 ms |
ジャッジサーバーID (参考情報) |
judge5 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 2 WA * 2 |
other | AC * 69 WA * 35 |
ソースコード
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 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))