結果
| 問題 |
No.254 文字列の構成
|
| コンテスト | |
| ユーザー |
sugim48
|
| 提出日時 | 2015-07-14 23:15:42 |
| 言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 261 bytes |
| コンパイル時間 | 1,095 ms |
| コンパイル使用メモリ | 157,520 KB |
| 実行使用メモリ | 5,376 KB |
| 最終ジャッジ日時 | 2024-07-08 07:30:40 |
| 合計ジャッジ時間 | 5,927 ms |
|
ジャッジサーバーID (参考情報) |
judge3 / judge1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 1 WA * 1 |
| other | AC * 1 WA * 29 |
ソースコード
#include <bits/stdc++.h>
using namespace std;
int f(int n) {
return n * (n + 1) / 2;
}
int main() {
int N; cin >> N;
char a = 'a';
while (N > 0) {
int n;
for (n = 1; f(n + 1) <= N; n++);
N -= f(n);
while (n--) cout << a;
a++;
}
cout << endl;
}
sugim48