(一維前綴和) 洛谷P1614 愛與愁的心痛

題目 洛谷P1614 愛與愁的心痛 利用一維前綴和能夠輕鬆求解。c++ 代碼以下:web #include<bits/stdc++.h> const int N=3e3+5, inf=0x3f3f3f3f; int a[N],sum[N]={ 0}; using namespace std; int main(){ int n,m; cin>>n>>m; for(in
相關文章
相關標籤/搜索