結果
| 問題 |
No.327 アルファベット列
|
| コンテスト | |
| ユーザー |
FF256grhy
|
| 提出日時 | 2015-12-25 05:32:06 |
| 言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
| 結果 |
AC
|
| 実行時間 | 1 ms / 2,000 ms |
| コード長 | 296 bytes |
| コンパイル時間 | 273 ms |
| コンパイル使用メモリ | 22,272 KB |
| 実行使用メモリ | 5,248 KB |
| 最終ジャッジ日時 | 2024-10-06 22:11:41 |
| 合計ジャッジ時間 | 1,634 ms |
|
ジャッジサーバーID (参考情報) |
judge1 / judge2 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 50 |
コンパイルメッセージ
main.cpp: In function ‘int main()’:
main.cpp:7:14: warning: ignoring return value of ‘int scanf(const char*, ...)’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
7 | scanf("%lld", &n);
| ~~~~~^~~~~~~~~~~~
ソースコード
#include <stdio.h>
long long int n;
int ans[9];
int main(void) {
scanf("%lld", &n);
int c = 0;
long long int d = 1;
while(0 <= n) {
ans[c] = (n / d) % 26; c++;
d *= 26;
n -= d;
}
c--;
int i;
for(i = c; 0 <= i; i--) {
printf("%c", 'A' + ans[i]);
}
printf("\n");
return 0;
}
FF256grhy