結果
問題 |
No.2773 Wake up Record 1
|
ユーザー |
![]() |
提出日時 | 2024-09-10 00:00:08 |
言語 | C (gcc 13.3.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 1,279 bytes |
コンパイル時間 | 424 ms |
コンパイル使用メモリ | 31,104 KB |
実行使用メモリ | 6,948 KB |
最終ジャッジ日時 | 2024-09-10 00:00:13 |
合計ジャッジ時間 | 4,255 ms |
ジャッジサーバーID (参考情報) |
judge3 / judge5 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | WA * 3 |
other | WA * 4 RE * 18 |
コンパイルメッセージ
main.c:8:15: warning: built-in function 'exp' declared as non-function [-Wbuiltin-declaration-mismatch] 8 | const int32_t exp[] = { 100000, 10000, 1000, 100, 10, 1 }; | ^~~
ソースコード
#pragma GCC diagnostic ignored "-Wunused-result" #pragma GCC optimize "Ofast" #include <stdint.h> #include <stdio.h> #include <string.h> const int32_t exp[] = { 100000, 10000, 1000, 100, 10, 1 }; uint8_t c, ostr[1000000], *optr = ostr; int64_t n = 0; int main() { fseek(stdin, 0, 2); int64_t istrlen = ftell(stdin); uint8_t istr[istrlen], *iptr = istr; fseek(stdin, 0, 0); fread(istr, 1, istrlen, stdin); while ((c = *iptr++) >= '0') n = n * 10 + (c - '0'); for (int64_t i = 2; i <= n; ) { if (*(int16_t*)iptr == 0x6F78) { iptr += 2; if (i == 100000) { memcpy(optr, "100000", 6); optr += 6; } if (i > 9999) { for (uint8_t j = 0; j < 5; ++j) *optr++ = i % exp[j] / exp[j + 1] + '0'; } else if (i > 999) { for (uint8_t j = 1; j < 5; ++j) *optr++ = i % exp[j] / exp[j + 1] + '0'; } else if (i > 99) { for (uint8_t j = 2; j < 5; ++j) *optr++ = i % exp[j] / exp[j + 1] + '0'; } else if (i > 9) { for (uint8_t j = 3; j < 5; ++j) *optr++ = i % exp[j] / exp[j + 1] + '0'; } else { *optr++ = i + '0'; } *optr++ = ' '; } else { ++i; ++iptr; } } fwrite(ostr, 1, optr - ostr, stdout); return 0; }