結果
問題 | No.2198 Concon Substrings (COuNt-CONstruct Version) |
ユーザー |
![]() |
提出日時 | 2023-01-20 21:40:07 |
言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 907 bytes |
コンパイル時間 | 1,806 ms |
コンパイル使用メモリ | 170,648 KB |
実行使用メモリ | 6,944 KB |
最終ジャッジ日時 | 2024-06-23 09:33:58 |
合計ジャッジ時間 | 5,986 ms |
ジャッジサーバーID (参考情報) |
judge5 / judge3 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 4 |
other | AC * 102 WA * 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;}}