結果

問題 No.2198 Concon Substrings (COuNt-CONstruct Version)
ユーザー 鴨志田卓
提出日時 2023-02-22 17:50:03
言語 C++14
(gcc 13.3.0 + boost 1.87.0)
結果
AC  
実行時間 3 ms / 2,000 ms
コード長 465 bytes
コンパイル時間 1,792 ms
コンパイル使用メモリ 170,608 KB
実行使用メモリ 5,376 KB
最終ジャッジ日時 2024-07-22 19:09:48
合計ジャッジ時間 6,970 ms
ジャッジサーバーID
(参考情報)
judge1 / judge4
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 4
other AC * 104
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using pii = pair<int, int>;

using i64 = long long;

int main() {
    i64 m;
    cin >> m;
    stack<char> stk;
    for(int i = 10000; i >= 1; i --) {
        i64 w = i * (i + 1ll) / 2;
        while(m >= w) {
            stk.push('n');
            m -= w;
        }
        stk.push('o');
        stk.push('c');
    }
    while(stk.size()) {
        cout << stk.top();
        stk.pop();
    }
}
0