結果
問題 |
No.2198 Concon Substrings (COuNt-CONstruct Version)
|
ユーザー |
![]() |
提出日時 | 2023-01-20 21:42:00 |
言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
結果 |
RE
|
実行時間 | - |
コード長 | 940 bytes |
コンパイル時間 | 1,531 ms |
コンパイル使用メモリ | 172,340 KB |
実行使用メモリ | 6,940 KB |
最終ジャッジ日時 | 2024-06-23 09:36:59 |
合計ジャッジ時間 | 5,563 ms |
ジャッジサーバーID (参考情報) |
judge4 / judge5 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 4 |
other | AC * 102 RE * 2 |
ソースコード
#include <bits/stdc++.h> using namespace std; int main(){ long long M; cin >> M; if (M == 0){ cout << "a" << endl; } else { vector<long long> A(4); A[0] = 1; A[1] = pow(M, (double) 1 / 3); A[2] = pow(M, (double) 2 / 3); A[3] = M; string ans; while (A[3] >= A[2]){ ans += 'n'; A[3] -= A[2]; } while (A[2] >= A[1] * 2){ ans += 'o'; A[2] -= A[1]; } while (A[3] >= A[2]){ ans += 'n'; A[3] -= A[2]; } while (A[1] > A[0]){ ans += 'c'; A[1] -= A[0]; } while (A[2] > A[1]){ ans += 'o'; A[2] -= A[1]; } while (A[3] >= A[2]){ ans += 'n'; A[3] -= A[2]; } while (A[2] >= A[1]){ ans += 'o'; A[2] -= A[1]; } while (A[1] >= A[0]){ ans += 'c'; A[1] -= A[0]; } reverse(ans.begin(), ans.end()); cout << ans << endl; assert(ans.size() <= 60000); } }