結果
| 問題 |
No.254 文字列の構成
|
| コンテスト | |
| ユーザー |
maine_honzuki
|
| 提出日時 | 2021-05-04 17:32:28 |
| 言語 | C++17 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 450 bytes |
| コンパイル時間 | 1,931 ms |
| コンパイル使用メモリ | 193,768 KB |
| 最終ジャッジ日時 | 2025-01-21 06:44:10 |
|
ジャッジサーバーID (参考情報) |
judge2 / judge2 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 1 WA * 1 |
| other | WA * 30 |
ソースコード
//https://ncode.syosetu.com/n4830bu/254/
#include <bits/stdc++.h>
using namespace std;
int main() {
int N;
cin >> N;
string ans;
char c = 'a';
for (long long len = 1e5; len >= 1; len--) {
long long maine = len * (len + 1) / 2;
if (N >= maine) {
N -= maine;
for (int i = 0; i < len; i++) {
ans += c;
}
c++;
}
}
cout << ans << endl;
}
maine_honzuki