結果
問題 | No.2752 文字列の数え上げ mod 998244353 |
ユーザー |
![]() |
提出日時 | 2024-05-10 23:23:33 |
言語 | C90 (gcc 12.3.0) |
結果 |
AC
|
実行時間 | 34 ms / 2,000 ms |
コード長 | 1,653 bytes |
コンパイル時間 | 1,081 ms |
コンパイル使用メモリ | 24,960 KB |
実行使用メモリ | 6,820 KB |
最終ジャッジ日時 | 2024-12-20 07:42:57 |
合計ジャッジ時間 | 2,094 ms |
ジャッジサーバーID (参考情報) |
judge3 / judge5 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 25 |
コンパイルメッセージ
main.c: In function ‘main’: main.c:101:9: warning: implicit declaration of function ‘write’ [-Wimplicit-function-declaration] 101 | write(1,wbuf,wp-wbuf); | ^~~~~ main.c:102:9: warning: implicit declaration of function ‘_exit’ [-Wimplicit-function-declaration] 102 | _exit(0); | ^~~~~ main.c:102:9: warning: incompatible implicit declaration of built-in function ‘_exit’ [-Wbuiltin-declaration-mismatch]
ソースコード
#pragma GCC optimize("Ofast")#pragma GCC target("avx2")#define rd_init() char*rp=({char*mmap();mmap(0l,1l<<25,1,2,0,0ll);})#define rd() ({int _v=0,_c;while(_c=*rp++-48,_c>=0)_v=_v*10+_c;_v;})#define rd_long() ({long _v=0,_c;while(_c=*rp++-48,_c>=0)_v=_v*10+_c;_v;})#define WTHI(v) {unsigned _z=v,_n=0;ulong _d=0;while(++_n,_d=_d<<8|0x30|_z%10,_z/=10);*(ulong*)wp=_d;wp+=_n;}#define WTLO(v) {unsigned _z=v,_n=8;ulong _d=0;while(_d=_d<<8|0x30|_z%10,_z/=10,--_n);*(ulong*)wp=_d;wp+=8;}#define wt(v) if(v>=100000000){WTLO(v/10);*wp++=v%10+'0';}else{WTHI(v);}#define aaa(x) ({ulong _r=x;_r-(_r<MD?0:MD);})#define MD 998244353typedef unsigned long ulong;char wbuf[1<<25];unsigned const tbl[]={26,676,456976,193994799,229410391,172145017,58663464,520752034,310255649,21292268,17714050,435724833,659011181,671526670,544153302,379370758,944368488,747103536,368772981,25615497,685619638,979577925,339353240,480750826,852127815,737081821,148579152,820873187,255016623,640755667,678702777,598597635,917380677,346033774,539618490,395868439,515592166,378817861,470355006,289156217,955499538,626269029,122371506,155543970,301496519,220050301,658891113,480750826,852127815,737081821,148579152,820873187,255016623,640755667,678702777,598597635,917380677,346033774,539618490,395868439,515592166,378817861,470355006,};int main(){char*wp=wbuf;rd_init();int t=rd();while(t--){ulong x=319438194;ulong i=0;for(ulong l=rd_long();l;l>>=1){if(l&1){x=x*tbl[i]%MD;}++i;}x=aaa(x+(MD-319438194));wt(x);*wp++='\n';}write(1,wbuf,wp-wbuf);_exit(0);}