結果
問題 | No.701 ひとりしりとり |
ユーザー |
![]() |
提出日時 | 2018-06-24 04:46:30 |
言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
結果 |
AC
|
実行時間 | 130 ms / 2,000 ms |
コード長 | 542 bytes |
コンパイル時間 | 663 ms |
コンパイル使用メモリ | 74,320 KB |
実行使用メモリ | 6,944 KB |
最終ジャッジ日時 | 2024-06-30 18:36:45 |
合計ジャッジ時間 | 1,648 ms |
ジャッジサーバーID (参考情報) |
judge4 / judge5 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 12 |
コンパイルメッセージ
main.cpp: In function ‘int main()’: main.cpp:20:14: warning: ignoring return value of ‘int scanf(const char*, ...)’ declared with attribute ‘warn_unused_result’ [-Wunused-result] 20 | scanf("%d", &n); | ~~~~~^~~~~~~~~~
ソースコード
#include <cstdio>#include <cstring>#include <iostream>#include <string>#include <cmath>#include <bitset>#include <vector>#include <map>#include <set>#include <queue>#include <deque>#include <algorithm>using namespace std;typedef long long int ll;int main(){int n;scanf("%d", &n);if(n==1){cout<<"doraemon"<<endl;return 0;}for(int i=0; i<n-1; i++){string str;str+='a';int i0=i;while(i0>0){str+=(char)('a'+(i0%26));i0/=26;}str+='a';cout<<str<<endl;}cout<<"an"<<endl;return 0;}