結果
問題 | No.327 アルファベット列 |
ユーザー |
![]() |
提出日時 | 2015-12-20 23:09:10 |
言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
結果 |
AC
|
実行時間 | 1 ms / 2,000 ms |
コード長 | 349 bytes |
コンパイル時間 | 415 ms |
コンパイル使用メモリ | 34,248 KB |
実行使用メモリ | 5,248 KB |
最終ジャッジ日時 | 2024-10-06 21:59:00 |
合計ジャッジ時間 | 1,557 ms |
ジャッジサーバーID (参考情報) |
judge2 / judge3 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 50 |
コンパイルメッセージ
main.cpp: In function ‘int main()’: main.cpp:7:26: warning: ignoring return value of ‘int scanf(const char*, ...)’ declared with attribute ‘warn_unused_result’ [-Wunused-result] 7 | long long a;scanf("%lld",&a); | ~~~~~^~~~~~~~~~~
ソースコード
#include<stdio.h>#include<algorithm>using namespace std;char ret[100];long long req[13];int main(){long long a;scanf("%lld",&a);int len=1;long long c=a;req[1]=26;for(int i=2;i<13;i++){req[i]=req[i-1]*26;}while(c>=req[len]){c-=req[len++];}for(int i=len-1;i>=0;i--){ret[i]=(c%26)+'A';c/=26;}printf("%s\n",ret);}