結果
問題 | No.254 文字列の構成 |
ユーザー |
|
提出日時 | 2020-03-06 11:41:20 |
言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 3 ms / 5,000 ms |
コード長 | 230 bytes |
コンパイル時間 | 589 ms |
コンパイル使用メモリ | 64,640 KB |
実行使用メモリ | 5,248 KB |
最終ジャッジ日時 | 2024-10-14 02:42:11 |
合計ジャッジ時間 | 1,791 ms |
ジャッジサーバーID (参考情報) |
judge3 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 2 |
other | AC * 30 |
コンパイルメッセージ
main.cpp:4:1: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type] 4 | main() | ^~~~
ソースコード
#include<iostream>using namespace std;int N;main(){cin>>N;string ans="";for(char c='a';N;c+=2){int L=1;while(L*L<=N)L++;L--;N-=L*L;char d=c+1;ans+=c;for(;--L;)ans+=d,ans+=c;}cout<<ans<<endl;}