結果

問題 No.2717 Sum of Subarray of Subsequence
ユーザー tailstails
提出日時 2024-04-06 16:27:45
言語 C90
(gcc 11.4.0)
結果
WA  
実行時間 -
コード長 827 bytes
コンパイル時間 1,001 ms
コンパイル使用メモリ 24,960 KB
実行使用メモリ 6,676 KB
最終ジャッジ日時 2024-04-06 16:27:47
合計ジャッジ時間 1,533 ms
ジャッジサーバーID
(参考情報)
judge13 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 WA -
testcase_01 WA -
testcase_02 WA -
testcase_03 WA -
testcase_04 WA -
testcase_05 WA -
testcase_06 WA -
testcase_07 WA -
testcase_08 WA -
testcase_09 WA -
testcase_10 WA -
testcase_11 WA -
testcase_12 WA -
testcase_13 WA -
testcase_14 WA -
testcase_15 WA -
testcase_16 WA -
testcase_17 WA -
testcase_18 WA -
testcase_19 WA -
testcase_20 WA -
testcase_21 WA -
testcase_22 WA -
testcase_23 WA -
権限があれば一括ダウンロードができます
コンパイルメッセージ
main.c: In function ‘main’:
main.c:7:59: warning: implicit declaration of function ‘write’ [-Wimplicit-function-declaration]
    7 | #define wt1(v) ({char wbuf[64],*wp=wbuf+sizeof wbuf;wt(v);write(1,wp,wbuf+sizeof wbuf-wp);})
      |                                                           ^~~~~
main.c:28:9: note: in expansion of macro ‘wt1’
   28 |         wt1(v);
      |         ^~~
main.c:29:9: warning: implicit declaration of function ‘_exit’ [-Wimplicit-function-declaration]
   29 |         _exit(0);
      |         ^~~~~
main.c:29:9: warning: incompatible implicit declaration of built-in function ‘_exit’ [-Wbuiltin-declaration-mismatch]

ソースコード

diff #

#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 wt(v) ({ulong _z=v;do*--wp=_z%10+48;while(_z/=10);})
#define wt1(v) ({char wbuf[64],*wp=wbuf+sizeof wbuf;wt(v);write(1,wp,wbuf+sizeof wbuf-wp);})
#define rep(v,e) for(typeof(e) v=0;v<e;++v)
#define MD 998244353

typedef unsigned long ulong;

unsigned p2[]={2,4,16,256,65536,301989884,932051910,299560064,169907034,60241440,595200811,819041188,954185916,830057642,679814667,167578608,683753077,918327899/*,24717300*/,0};

int main(){
	rd_init();
	int n=rd();
	unsigned __int128 a;
	rep(i,n){
		a+=(ulong)(i+2)*(n+1-i)*rd();
	}
	ulong v=a*873463809%MD;
	rep(i,18){
		if(n&1<<i){
			v=v*p2[i]%MD;
		}
	}
	wt1(v);
	_exit(0);
}
0