
2019ICPC南京网络赛
ACgay_caoyue
菜鸡*CPCer
展开
-
【2019ICPC南京网络赛】A.The beautiful values of the palace 离线树状数组
A.The beautiful values of the palace比赛时候的多组输入,忘清空数组了,WA了无数发,赛后清空一发过,现在的心情十分的差。这题乍一看二维的,不就是个CDQ分治 || 树套树嘛…但是,再一看,我们可以发现,对坐标的x排序后,就可以用树状数组通过四个前缀和询问答案了。难点在螺旋矩阵通过坐标算出权值吧…#include <bits/stdc++.h>...原创 2019-09-02 11:50:02 · 522 阅读 · 0 评论 -
【2019ICPC南京网络赛】D. Robots 概率dp
传送门概率dp#include <bits/stdc++.h>using namespace std;const int maxn = 1e5+7;int n,m;vector<int> G[maxn];int deg[maxn];double dp1[maxn],dp2[maxn];double topsort1(int x){ if(x==n) r...原创 2019-09-02 17:21:08 · 449 阅读 · 0 评论 -
【2019ICPC南京网络赛】B.Super_log 欧拉降幂
传送门观察题目中的公式可以发现,这个题目本质上就是求a的a的a的a的a … (b个) 幂次 % p直接欧拉降幂,公式如下根据上面公式,重写下Mod函数即可。#include <bits/stdc++.h>using namespace std;typedef long long ll;const int maxn = 1e6+7;int pri[maxn],phi[m...原创 2019-09-02 18:24:49 · 286 阅读 · 0 评论