#include<iostream> #include<cstdio> #include<string> #include<cstring> #include<algorithm> #include<cmath> #define ll long long using namespace std; ; ; struct edge{ int to; int nxt; }; ],col[maxn]; int cnt,head[maxn];…
直接抄ppt好了--来自lyd 注意只用对根判断是否哟留下儿子 #include<iostream> #include<cstdio> using namespace std; const int N=100005; long long n,ans,h[N],cnt,fa[N],dis[N],d1,d2,l1,l2,c1,at[N],bt[N],a[N],b[N],tota,totb,nw,tmp,g[N]; bool del[N]; struct qwe { long long…
11.1 NOIP 模拟赛 期望得分:50:实际得分:50: 思路:暴力枚举 + 快速幂 #include <algorithm> #include <cstring> #include <cstdio> using namespace std; typedef long long LL; ; int n, m; LL ans; LL qpow(LL a, LL b) { LL res = ; while (b) { ) res = res * a % Mod; a =…
NOIP 模拟赛 思路:求 n , m 的 gcd,然后用 n , m 分别除以 gcd:若 n 或 m 为偶数,则输出 1/2. 特别的,当 n = m = 1 时,应输出 1/1 #include <algorithm> #include <iostream> #include <cstring> #include <cstdio> using namespace std; typedef long long LL; LL n, m; LL gcd(LL…
数据 http://files.cnblogs.com/htfy/data.zip 简要题解 桌球碰撞 纯模拟,注意一开始就在袋口和v=0的情况.v和坐标可以是小数.为保险起见最好用extended/double类型. program prob1; var ans:array[0..6,0..600] of longint; n,i,j:longint; a0,r0,px,py,vx,vy,left,t,newp:extended; flag:boolean; function dist(x1,…