結果
| 問題 |
No.2773 Wake up Record 1
|
| コンテスト | |
| ユーザー |
ななり
|
| 提出日時 | 2024-09-10 00:08:30 |
| 言語 | C (gcc 13.3.0) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 1,426 bytes |
| コンパイル時間 | 379 ms |
| コンパイル使用メモリ | 31,360 KB |
| 実行使用メモリ | 6,948 KB |
| 最終ジャッジ日時 | 2024-09-10 00:08:33 |
| 合計ジャッジ時間 | 2,625 ms |
|
ジャッジサーバーID (参考情報) |
judge2 / judge4 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | WA * 3 |
| other | WA * 14 RE * 8 |
コンパイルメッセージ
main.c:9:15: warning: built-in function 'exp' declared as non-function [-Wbuiltin-declaration-mismatch]
9 | 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 <stdlib.h>
#include <string.h>
const int32_t exp[] = { 100000, 10000, 1000, 100, 10, 1 };
uint8_t c, ostr[100000], *optr = ostr;
int64_t n = 0;
int main() {
fseek(stdin, 0, 2);
int64_t istrlen = ftell(stdin);
uint8_t *istr = (uint8_t*)malloc(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';
*optr++ = ' ';
}
else if (i > 999) {
for (uint8_t j = 1; j < 5; ++j) *optr++ = i % exp[j] / exp[j + 1] + '0';
*optr++ = ' ';
}
else if (i > 99) {
for (uint8_t j = 2; j < 5; ++j) *optr++ = i % exp[j] / exp[j + 1] + '0';
*optr++ = ' ';
}
else if (i > 9) {
for (uint8_t j = 3; j < 5; ++j) *optr++ = i % exp[j] / exp[j + 1] + '0';
*optr++ = ' ';
}
else {
*optr++ = i + '0';
*optr++ = ' ';
}
i += 2;
}
else {
++i;
++iptr;
}
}
fwrite(ostr, 1, optr - ostr, stdout);
return 0;
}
ななり