結果
| 問題 | No.2132 1 or X Game |
| コンテスト | |
| ユーザー |
👑 tails
|
| 提出日時 | 2022-11-28 15:21:57 |
| 言語 | C90 (gcc 15.2.0) |
| 結果 |
CE
(最新)
AC
(最初)
|
| 実行時間 | - |
| コード長 | 1,263 bytes |
| 記録 | |
| コンパイル時間 | 102 ms |
| コンパイル使用メモリ | 26,808 KB |
| 最終ジャッジ日時 | 2026-02-24 01:11:14 |
|
ジャッジサーバーID (参考情報) |
judge3 / judge2 |
(要ログイン)
コンパイルエラー時のメッセージ・ソースコードは、提出者また管理者しか表示できないようにしております。(リジャッジ後のコンパイルエラーは公開されます)
ただし、clay言語の場合は開発者のデバッグのため、公開されます。
ただし、clay言語の場合は開発者のデバッグのため、公開されます。
コンパイルメッセージ
main.c: In function 'mkwd':
main.c:14:20: warning: multi-character character constant [-Wmultichar]
14 | unsigned v='0000';
| ^~~~~~
main.c:6:18: error: 'for' loop initial declarations are only allowed in C99 or C11 mode
6 | #define rep(v,e) for(long v=0;v<e;++v)
| ^~~
main.c:16:9: note: in expansion of macro 'rep'
16 | rep(a,10){
| ^~~
main.c:6:18: note: use option '-std=c99', '-std=gnu99', '-std=c11' or '-std=gnu11' to compile your code
6 | #define rep(v,e) for(long v=0;v<e;++v)
| ^~~
main.c:16:9: note: in expansion of macro 'rep'
16 | rep(a,10){
| ^~~
main.c:6:18: error: 'for' loop initial declarations are only allowed in C99 or C11 mode
6 | #define rep(v,e) for(long v=0;v<e;++v)
| ^~~
main.c:17:17: note: in expansion of macro 'rep'
17 | rep(b,10){
| ^~~
main.c:6:18: error: 'for' loop initial declarations are only allowed in C99 or C11 mode
6 | #define rep(v,e) for(long v=0;v<e;++v)
| ^~~
main.c:18:25: note: in expansion of macro 'rep'
18 | rep(c,10){
| ^~~
main.c:6:18: error: 'for' loop initial declarations are only allowed in C99 or C11 mode
6 | #define rep(v,e) for(long v=0;v<e;++v)
| ^~~
main.c:19:33: note: in expansion of macro 'rep'
19 | rep(d,10){
| ^~~
ソースコード
#pragma GCC optimize("Ofast")
#pragma GCC target("avx2")
#define rd_skip() while(*rp++>=48)
#define rd() ({long _v=0,_c;while(_c=*rp++-48,_c>=0)_v=_v*10+_c;_v;})
#define rep(v,e) for(long v=0;v<e;++v)
#define MD 998244353
typedef unsigned long ulong;
char wbuf[1<<25];
unsigned wd[10000];
void mkwd(){
unsigned v='0000';
long i=0;
rep(a,10){
rep(b,10){
rep(c,10){
rep(d,10){
wd[i++]=v;
v+=1<<24;
}
v+=(1<<16)-(10<<24);
}
v+=(1<<8)-(10<<16);
}
v+=(1<<0)-(10<<8);
}
}
int main(){
mkwd();
char*mmap();
char*rp=mmap(0l,1l<<25,1,2,0,0ll);
char*wp=wbuf;
rd_skip();
while(*rp){
ulong n=rd();
ulong x=rd();
ulong z=n+1;
if(!(x&1)){
z+=(n+3)/(x+3);
}
z>>=1;
unsigned y=z%MD;
if(y>=100000000){
*wp++='0'+y/100000000;
y%=100000000;
*(int*)wp=wd[y/10000];
wp+=4;
*(int*)wp=wd[y%10000];
wp+=4;
}else if(y>=10000){
unsigned q=y/10000; y%=10000;
if(q>=1000) *wp++='0'+q/1000;
if(q>=100) *wp++='0'+q/100%10;
if(q>=10) *wp++='0'+q/10%10;
*wp++='0'+q%10;
*(int*)wp=wd[y];
wp+=4;
}else{
if(y>=1000) *wp++='0'+y/1000;
if(y>=100) *wp++='0'+y/100%10;
if(y>=10) *wp++='0'+y/10%10;
*wp++='0'+y%10;
}
*wp++='\n';
}
write(1,wbuf,wp-wbuf);
_exit(0);
}
tails