結果
問題 |
No.2198 Concon Substrings (COuNt-CONstruct Version)
|
ユーザー |
|
提出日時 | 2023-01-27 23:16:14 |
言語 | PyPy3 (7.3.15) |
結果 |
WA
|
実行時間 | - |
コード長 | 716 bytes |
コンパイル時間 | 332 ms |
コンパイル使用メモリ | 81,812 KB |
実行使用メモリ | 71,244 KB |
最終ジャッジ日時 | 2024-06-28 08:07:39 |
合計ジャッジ時間 | 26,073 ms |
ジャッジサーバーID (参考情報) |
judge5 / judge3 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 2 WA * 2 |
other | AC * 11 WA * 93 |
ソースコード
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) W = N-1 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)): break X = M - W*(Z*(Y+1)+1) ans = ['c','o'] + ['n']*X + ['c']*Y + ['o']*Z + ['n']*W print(''.join(ans))