10 2015 档案
摘要:起点是右下角 终点是左上角每次数据都是两行的点 输入n 表示有n列接下来来的2行是 列与列之间的距离最后一行是 行之间的距离枚举就行Sample test(s)input41 2 33 2 13 2 2 3output12input31 23 32 1 3output11input2111 1out...
阅读全文
摘要:Sample test(s)input50 1 0 1 1output4input71 0 1 0 0 1 0output4input10output0 1 # include 2 # include 3 # include 4 # include 5 # include 6 # incl...
阅读全文
摘要:旋转卡壳Sample Input40 00 11 11 0Sample Output2 1 # include 2 # include 3 # include 4 # include 5 # include 6 # include 7 # include 8 # def...
阅读全文
摘要:分治法Sample Input20 01 121 11 13-1.5 00 00 1.50 Sample Output0.710.000.75 1 # include 2 # include 3 # include 4 # include 5 # include 6 # include ...
阅读全文
摘要:题意:1-N带编号的盒子,当编号满足A>B && A非空 && (A + B) % 3 == 0 && (A + B) % 2 == 1则可以从A中取任意石头到B中,谁不能取了谁就输。Alice先手 阶梯博弈:博弈在一列阶梯上进行,每个阶梯上放着自然数个点,两个人进行阶梯博弈,每一步则是将一个集体...
阅读全文
摘要:n个硬币围成一个环 每次只能取1-K个硬币 最后取完者胜假如5个硬币 每次取1-2个情况1 先手取1个 后手取剩下4个中间2个 破坏了连续 虽然最后剩2个,但先手只能取一个 然后后再取一个 后手胜情况2 先手取2个 后手取剩下3个中间的那1个 然后同理 后手胜Sample Input23 ...
阅读全文
摘要:0代表可放 1带表不能放 每次放一个2*2的方块 不能放者败如果先手必胜则输出Yes必胜态:从当前状态所能到达的状态中存在一个必败态必败态:从当前状态所能达到的状态全部是必胜态Sample Input4 400000000000000004 40000001001000000 Sample Outp...
阅读全文
摘要:操作1 l r 是原序列l-r的和操作2 l r 是从小到大排序后的l-r的和input66 4 2 7 2 732 3 61 3 41 1 6output24928 1 # include 2 # include 3 # include 4 # include 5 # include ...
阅读全文
摘要:把一个字符串分成N个字符串 每个字符串长度为mSample Input12 5 // n mklmbbileay Sample Outputklmbbileay 1 # include 2 # include 3 # include 4 # include 5 # include 6 ...
阅读全文
摘要:100MB=10^5KB=10^8B100MB=100*2^10KB=100*2^20BSample Input2100[MB]1[B] Sample OutputCase #1: 4.63%Case #2: 0.00% 1 # include 2 # include 3 # include ...
阅读全文
摘要:给出有多少次操作 和MOD 初始值为1 操作1 y 表示乘上y操作2 y 表示除以第 y次操作乘的那个数线段树的叶子结点i 表示 第i次操作乘的数 将1替换成y遇到操作2 就把第i个结点的值 替换成1利用线段树的性质,对整个1~n的区间进行维护,每次输出sum[1]的值即可Sample Inp...
阅读全文
摘要:平面上有m个点,要从这m个点当中找出n个点,使得包含这n个点的圆的半径(圆心为n个点当中的某一点且半径为整数)最小,同时保证圆周上没有点。n > m 时要输出-1样例输入43 2 0 0 1 0 1.2 02 2 0 0 1 02 1 0 0 1.2 02 1 0 0 1 0样例输出121-1 1 ...
阅读全文
摘要:数据 表示每次到达某个位置的坐标和时间 计算出每对相邻点之间转移的速度(两点间距离距离/相隔时间) 输出最大值Sample Input252 1 9//t x y3 7 25 9 06 6 37 6 01011 35 6723 2 2929 58 2230 67 6936 56 9362 42 11...
阅读全文
摘要:n个格子排成一行,有m种颜色,问用恰好k种颜色进行染色,使得相邻格子颜色不同的方案数。integers n, m, k (1 ≤n, m ≤ 10^9, 1 ≤ k ≤ 10^6, k ≤ n, m).m种颜色取k种 C(m, k) 这个可以放最后乘 那么问题就变成只用k种颜色第一个格子有k种涂法 ...
阅读全文
摘要:两个圆环的内外径相同 给出内外径 和 两个圆心 求两个圆环相交的面积画下图可以知道 就是两个大圆交-2*小圆与大圆交+2小圆交Sample Input22 30 00 02 30 05 0 Sample OutputCase #1: 15.707963Case #2: 2.250778 1 # in...
阅读全文
摘要:把一个序列按从小到大排序 要执行多少次操作只需要从右往左统计,并且不断更新最小值,若当前数为最小值,则将最小值更新为当前数,否则sum+1Sample Input255 4 3 2 155 1 2 3 4 Sample OutputCase #1: 4Case #2: 1 1 # include ...
阅读全文
摘要:给出某个时刻对应的速度 求出相邻时刻的平均速度 输出最大值Sample Input23 // n2 2 //t v1 13 430 31 52 0 Sample OutputCase #1: 2.00Case #2: 5.00 1 # include 2 # include 3 # includ...
阅读全文