結果
問題 |
No.600 かい文回
|
ユーザー |
![]() |
提出日時 | 2017-11-26 12:27:49 |
言語 | D (dmd 2.109.1) |
結果 |
WA
|
実行時間 | - |
コード長 | 581 bytes |
コンパイル時間 | 685 ms |
コンパイル使用メモリ | 98,360 KB |
実行使用メモリ | 6,944 KB |
最終ジャッジ日時 | 2024-06-12 22:42:06 |
合計ジャッジ時間 | 3,077 ms |
ジャッジサーバーID (参考情報) |
judge2 / judge5 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 6 WA * 15 |
ソースコード
void main(){ import std.stdio, std.string, std.conv, std.algorithm; import std.array; int n; rd(n); char[] fun(int m){ if(m==1) return ['a']; char[] ret; if(m&1){ ret=fun(m-1); for(char c='a'; c<='z'; c++){ if(c!=ret[0]){ret=c~ret~c; break;} } }else{ ret=fun(m/2); ret=ret[0]~ret~ret[$-1]; } return ret; } writeln(fun(n)); } void rd(T...)(ref T x){ import std.stdio, std.string, std.conv; auto l=readln.split; assert(l.length==x.length); foreach(i, ref e; x){ e=l[i].to!(typeof(e)); } }