結果
| 問題 |
No.600 かい文回
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2020-03-09 16:50:04 |
| 言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 459 bytes |
| コンパイル時間 | 672 ms |
| コンパイル使用メモリ | 74,360 KB |
| 実行使用メモリ | 5,248 KB |
| 最終ジャッジ日時 | 2024-11-08 05:49:36 |
| 合計ジャッジ時間 | 2,062 ms |
|
ジャッジサーバーID (参考情報) |
judge5 / judge1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 20 WA * 1 |
コンパイルメッセージ
main.cpp:7:1: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type]
7 | main()
| ^~~~
ソースコード
#include<iostream>
#include<algorithm>
#include<vector>
using namespace std;
string s;
int N;
main()
{
cin>>N;
vector<int>bit;
while(N)
{
bit.push_back(N%2);
N>>=1;
}
reverse(bit.begin(),bit.end());
int cnt=0;
for(int i=0;i<bit.size();cnt++)
{
int j=i+1;
while(j<bit.size()&&bit[j]==0)j++;
int t=j-i;
i=j;
if(i<bit.size())t++;
if(cnt==0)t--;
s+=string(t,cnt%26+'a');
}
string t=s;
reverse(t.begin(),t.end());
cout<<t+s<<endl;
}