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 =…
目录 2018.11.7 NOIP模拟 A 序列sequence(two pointers) B 锁lock(思路) C 正方形square(埃氏筛) 考试代码 B C 2018.11.7 NOIP模拟 时间:3.5h 期望得分:100+0+40 实际得分:100+0+40 A 序列sequence(two pointers) 其实我们只要处理每个数与哪些数相加,会产生进位就行了. 把数排序后,枚举一个数x,容易想到满足使x+y进位的y是单调的(要求y<=x).所以可以二分. 但是单调,好像只需…
数据 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,…
A.数三角形 题目:http://www.contesthunter.org/contest/CH%20Round%20%2348%20-%20Streaming%20%233%20(NOIP模拟赛Day1)/数三角形 题解:暴力枚举三元组,判断是否共线即可,用叉积 代码: type cp=record x,y:double; end; ..] of cp; i,j,k,n,ans:longint; function cross(a,b,c:cp):double; begin cross:=(b…