蒲公英的約定

2021-08-29 12:22:05 字數 881 閱讀 5416

考試時以為是一道高次同餘方程題,然後只打了乙個暴力。

最後db發現只需要通過輸入中的最後一行倒推回去就行了。首先根據題目我們知道,輸入中的最後一行中b等於0。那麼就是        c ^ lastans = 0。根據異或的性質我們知道c = lastans。於是最後乙個答案一定是c。

那麼就可以知道倒數第二行中的x = c,即

#include#include#include#include#include#include#include#include#include#define maxa 100500

using namespace std;

typedef long long ll;

int mod;

ll fastpow(ll a,ll b)

return ans;

}vectorans;

int a[maxa],c[maxa],cnt = 1,lastx,b;

int main()

cnt--;

ans.push_back(c[cnt]);

lastx = c[cnt];

for(int i=cnt-1;i>=2;i--)

for(int i=ans.size()-1;i>=0;i--)

printf("%d\n",ans[i]);}/*

172 8

8 11

5 54 12

*/

蒲公英,飛舞在我們的約定

好聽的 qq個性網名 分享 瀰漫著硝煙的記憶揮之不去 珴要變成大淑女 帥鍋!男人 你的心裡有過誰 對邇旳獨佔慾強 塞巴斯蒂娜 等 一種幸福的到來 討厭 哦 嗯 呵呵 額。塞巴斯蒂安 訪問 慢慢走進內心寂寞的空城 紫墨年華輕淡語 尋覓久了終無結果 想要回去 卻只有祭奠 顛覆,當初的溫柔 冷眼對上你眸子...

蒲公英 分塊

在鄉下的小路旁種著許多蒲公英,而我們的問題正是與這些蒲公英有關。為了簡化起見,我們把所有的蒲公英看成乙個長度為 n 的序列a1,a2,an,其中ai為乙個正整數,表示第 i 棵蒲公英的種類編號。而每次詢問乙個區間 l,r 你需要回答區間裡出現次數最多的是哪種蒲公英,如果有若干種蒲公英出現次數相同,則...

分塊 蒲公英

include include include include define maxn 40005 using namespace std int rd return x partition section int a maxn blk maxn sizb int tmplwb maxn 離散化的輔...