日韩性视频-久久久蜜桃-www中文字幕-在线中文字幕av-亚洲欧美一区二区三区四区-撸久久-香蕉视频一区-久久无码精品丰满人妻-国产高潮av-激情福利社-日韩av网址大全-国产精品久久999-日本五十路在线-性欧美在线-久久99精品波多结衣一区-男女午夜免费视频-黑人极品ⅴideos精品欧美棵-人人妻人人澡人人爽精品欧美一区-日韩一区在线看-欧美a级在线免费观看

歡迎訪問 生活随笔!

生活随笔

當前位置: 首頁 > 人文社科 > 生活经验 >内容正文

生活经验

第十二周 11.15-11.21

發布時間:2023/11/27 生活经验 21 豆豆
生活随笔 收集整理的這篇文章主要介紹了 第十二周 11.15-11.21 小編覺得挺不錯的,現在分享給大家,幫大家做個參考.

11.15

補個BC。

HDU 5565?Clarke and baton

沒太懂題解怎么搞。反正挺暴力過了。

 1 #include <iostream>
 2 #include <cstdio>
 3 #include <map>
 4 #include <vector>
 5 #include <algorithm>
 6 using namespace std;
 7 typedef long long LL;
 8 const int maxn=1e7+10;
 9 
10 bool cmp(int a,int b)
11 {
12     return a>b;
13 }
14 
15 LL seed;
16 int a[maxn];
17 int rand(int l, int r) {
18     static long long mo=1e9+7, g=78125;
19     return l+((seed*=g)%=mo)%(r-l+1);
20 }
21 
22 int main(void)
23 {
24     int T;scanf("%d",&T);
25     while(T--)
26     {
27         int n,q;
28         scanf("%d%d%I64d",&n,&q,&seed);
29         int sum=rand(q, 10000000);
30         for(int i=1; i<=n; i++) {
31             a[i]=rand(0, sum/(n-i+1));
32             sum-=a[i];
33         }
34         a[rand(1, n)]+=sum;
35         map< int,vector<int> > M;
36         for(int i=1;i<=n;i++) M[a[i]].push_back(i);
37         map< int,vector<int> >::iterator it=M.end();
38         while(1)
39         {
40             it--;
41             vector<int> & t=(*it).second;
42             sort(t.begin(),t.end(),cmp);
43             for(int i=t.size()-1;i>=0;i--)
44             {
45                 if(q==0) break; q--;
46                 int x=(*it).first,y=t[i];
47                 M[x-1].push_back(y);
48                 M[x].pop_back();
49             }
50             if(q==0||it==M.begin()) break;
51         }
52         int ans=0;
53         for(it=M.begin();it!=M.end();it++)
54         {
55             vector<int> & t=(*it).second;
56             for(int i=t.size()-1;i>=0;i--) ans^=(*it).first+t[i];
57         }
58         printf("%d\n",ans);
59     }
60     return 0;
61 }
Aguin

?

11.16-11.20

什么都沒干。

?

11.21

去了個白發錢的地方。

?

這周BC都沒打 還懶得補 沒寫題的一周 然而感覺只會越來越忙 哭

轉載于:https://www.cnblogs.com/Aguin/p/4966707.html

總結

以上是生活随笔為你收集整理的第十二周 11.15-11.21的全部內容,希望文章能夠幫你解決所遇到的問題。

如果覺得生活随笔網站內容還不錯,歡迎將生活随笔推薦給好友。