题意简述:在平面上有一个坐标 \((x_c,y_c)\) 和半径 \(r\) 都是整数的圆 \((1\leq r_c\leq \sqrt{x_c^2+y_c^2}-1)\),你可以询问不超过 \(60\) 次一个从原点出发的射线 \((0,0)\to (x,y)\) 与圆的距离(若相交,则返回 \(0\)).确定圆的坐标和半径. \(|x_c|,|y_c|,r\le 10^5\),你需要保证 \(|x|,|y|\leq 10^6\). 一道有趣的计算几何,思维含量并不是很高(*3300 有点离谱…
题目链接: 2018 ICPC Pacific Northwest Regional Contest - I-Inversions 题意 给出一个长度为\(n\)的序列,其中的数字介于0-k之间,为0表示这个位置是空的.现在可以在这些空的位置上任意填入1-k之间的数字(可以重复).问最多可以总共有多少对逆序对.(如果\(i<j,p_i>p_j\),则称\((i,j)\)是一对逆序对) \(1\leq n\leq 2*10^5,\ 1\leq k\leq 100\) 思路 第一步,先证明最优的填…
Problem G. Garden Gathering Input file: standard input Output file: standard output Time limit: 3 seconds Memory limit: 512 megabytes Many of you may have been to St. Petersburg, but have you visited Peterhof Palace? It is a collection of splendid pa…
Problem D. Delay Time Input file: standard input Output file: standard output Time limit: 1 second Memory limit: 512 megabytes Petr and Egor are measuring the gravitational acceleration g on their physics lessons using a special device. An electromag…
目录 2018-2019 ICPC, NEERC, Southern Subregional Contest (Codeforces 1070) A.Find a Number(BFS) C.Cloud Computing(线段树) D.Garbage Disposal(模拟) E.Getting Deals Done(二分) F.Debate(贪心) H.BerOS File Suggestion(后缀自动机) I.Privatization of Roads in Berland(网络流)…
ACM ICPC Central Europe Regional Contest 2013 Jagiellonian University Kraków Problem A: Rubik’s RectangleProblem B: What does the fox say?Problem C: Magical GCDProblem D: SubwayProblem E: EscapeProblem F: DraughtsProblem G: History courseProblem H: C…
2018-2019 ICPC, NEERC, Southern Subregional Contest 闲谈: 被操哥和男神带飞的一场ACM,第一把做了这么多题,荣幸成为7题队,虽然比赛的时候频频出锅,差点被鸽,但还算打完了5h 总的来说这场还是不算难的,7题还是少了点 A 题目: 给出a,b,求出一个数满足是a的倍数,且数字和为b 题解: 男神懒得写博客就甩锅了 直接宽搜,宽搜时队列中的状态保存为x,y,x表示当前的数%a==x,y表示数字和 然后记录状态和方案就行了 参考代码: #inclu…
2016 NEERC, Moscow Subregional Contest K. Knights of the Old Republic 题意:有一张图,第i个点被占领需要ai个兵,而每个兵传送至该点需要bi的费用.占领第i条边需要其两端点的兵数之和大等于ci.对于已占领的点或边可以免费通行.因此兵达到一个点的手段有传送和沿路走.图上的兵可以在已占领的点.边随意调度. 求占领所有点的最小花费. 思路:将边按ci进行升序排列,对于每条边两端点所在的连通块进行合并,合并细节见代码.这里有一点值得思…
2019-2020 ICPC, Asia Jakarta Regional Contest (Online Mirror, ICPC Rules, Teams Preferred) easy: ACEGHK medium-easy: BJL medium: D ?????: I A. B. C. 对 \(R[],C[]\) 分别按奇偶性分段. 网! D. 考虑 check 一个串,枚举右走对应的前缀 pre,下走对应的后缀 suf. 把每行反串拼接中间连特殊字符,建 SA,能 match 上 p…
目录 ICPC North Central NA Contest 2018 1. 题目分析 2. 题解 A.Pokegene B.Maximum Subarrays C.Rational Ratio D.Travel the Skies E. Euler's Number F. Lipschitz Constant G. Tima goes to Xentopia H. New Salaries I. Other Side J.Kaleidoscopic Palindromes ICPC Nor…
人生第一场 AtCoder,纪念一下 话说年后的 AtCoder 比赛怎么这么少啊(大雾 AtCoder Beginner Contest 154 题解 A - Remaining Balls We have A balls with the string S written on each of them and B balls with the string T written on each of them. From these balls, Takahashi chooses one…
目录 AtCoder Beginner Contest 153 题解 A - Serval vs Monster 题意 做法 程序 B - Common Raccoon vs Monster 题意 做法 程序 C - Fennec vs Monster 做法 程序 D - Caracal vs Monster 做法 程序 E - Crested Ibis vs Monster 做法 程序 F - Silver Fox vs Monster 做法 程序 感谢 AtCoder Beginner Co…
AtCoder Beginner Contest 177 题解 目录 AtCoder Beginner Contest 177 题解 A - Don't be late B - Substring C - Sum of product of pairs D - Friends E - Coprime F - I hate Shortest Path Problem A - Don't be late 问你能不能在时间\(T\)内用不高于\(S\)的速度走过\(D\)的路程,转化为判断\(ST\)…
AtCoder Beginner Contest 184 题解 目录 AtCoder Beginner Contest 184 题解 A - Determinant B - Quizzes C - Super Ryuma D - increment of coins E - Third Avenue F - Programming Contest 这把怎么感觉题目都比以往的ABC水啊,拜此所赐我只是程序写得慢就排名狂掉( A - Determinant 求二阶矩阵的行列式,是小学常见自定义题目(…
M-SOLUTIONS Programming Contest 2020 题解 目录 M-SOLUTIONS Programming Contest 2020 题解 A - Kyu in AtCoder B - Magic 2 C - Marks D - Road to Millionaire E - M's Solution F - Air Safety 题目质量好高啊,做完感觉好难涨智商了诶.(除了某一道程序又臭又长的F) A - Kyu in AtCoder 我们可以放很多个if来判断,但…
AtCoder Beginner Contest 173 题解 目录 AtCoder Beginner Contest 173 题解 A - Payment B - Judge Status Summary C - H and V D - Chat in a Circle E - Multiplication 4 F - Intervals on Tree A - Payment 首先我们可以把所有不用找零的部分都付掉,这样就只剩下了\(A \mod 1000\)这样一个"\(A\)除以\(10…
AtCoder Beginner Contest 172 题解 目录 AtCoder Beginner Contest 172 题解 A - Calc B - Minor Change C - Tsundoku D - Sum of Divisors E - NEQ F - Unfair Nim A - Calc 程序如下(真的有人需要嘛): #include<bits/stdc++.h> using namespace std; int main(){ ios::sync_with_stdi…
AtCoder Beginner Contest 169 题解 这场比赛比较简单,证明我没有咕咕咕的时候到了! A - Multiplication 1 没什么好说的,直接读入两个数输出乘积就好了. #include<bits/stdc++.h> using namespace std; int main(){ int a,b; cin>>a>>b; cout<<a*b; return 0; } B - Multiplication 2 让你连乘,同时在答案…
目录 AtCoder Beginner Contest 148 题解 前言 A - Round One 题意 做法 程序 B - Strings with the Same Length 题意 做法 程序 C - Snack 题意 做法 程序 D - Brick Break 题意 做法 程序 E - Double Factorial 题意 做法 程序 F - Playing Tag on Tree 题意 做法 程序 结束语 AtCoder Beginner Contest 148 题解 前言 包…
A. Altitude 从小到大加入每个数,用set查找前驱和后继即可. 时间复杂度$O(n\log n)$. #include <bits/stdc++.h> using namespace std ; const int Maxn=100020,Inf=1e9; typedef pair<int,int>pi; int n; int a[Maxn]; vector<pi>V; set<int>S; int ans,rep1,rep2,rep3; int…
C. Colder-Hotter time limit per test 1 second memory limit per test 512 megabytes input standard input output standard output This is an interactive problem. Egor and Petr are playing a game called «Colder-Hotter» on a 2D plane. At the beginning of t…
题目描述 Peter returned from the recently held ACM ICPC World finals only to find that his return flight was overbooked and he was bumped from the flight! Well, at least he wasn’t beat up by the airline and he’s received a voucher for one free flight bet…
题目:https://vj.69fa.cn/12703be72f729288b4cced17e2501850?v=1552995458 dp这个题目网上说是dp+离散化这个题目要对这些数字先处理然后进行dp,这个处理值得学习一下,就是把数字范围为1~1e9,转化成一个顺序列表,这个顺序列表每一个不同的位置含有不同的难度,dp[i][j]代表前面i种选出j种的方案数. #include <cstdio> #include <iostream> #include <cstdlib…
Problem K. KMC Attacks 题目连接: http://codeforces.com/gym/100714 Description Warrant VI is a remote planet located in the Koprulu Sector. Warrant VI features a strange huge field, which was discovered by the Kel-Morian Combine (KMC). The KMC is involved…
Problem D. Distance 题目连接: http://codeforces.com/gym/100714 Description In a large city a cellular network operator is holding a competition for subscribers to promote their new "pedestrian navigator" service. The main prize will be awarded to th…
Problem C. Contest 题目连接: http://codeforces.com/gym/100714 Description The second round of the annual student collegiate programming contest is being held in city N. To be prepared for the inrush of participants, the jury needs to know the number of t…
题目来源:http://codeforces.com/group/aUVPeyEnI2/contest/229511 时间限制:1s 空间限制:512MB 题目大意: 给定一个n 随后跟着2n行输入 "+ t":表示在t时刻获得了一样东西 "- t":表示在t时刻使用了一样东西 求每件东西等待时间的期望(得到的东西无先后顺序) 数据范围: 1 ≤ n ≤ 100 000 t ≤ 1e9 样例: 题目解法: 使用递推式从后往前推 代码: #include <al…
目录 Contest Info Solutions A. Copying Homework C. Even Path E. Songwriter G. Performance Review H. Twin Buildings J. Tiling Terrace K. Addition Robot Contest Info Practice Link Solved A B C D E F G H I J K L 7/12 O - O - O - O O - O O - O 在比赛中通过 Ø 赛后通…
As you might already know, space has always been a problem in ICPC Jakarta. To cope with this, ICPC Jakarta is planning to build two new buildings. These buildings should have a shape of a rectangle of the same size. Now, their problem is to find lan…
目录 注意!!此题解存在大量假算法,请各位巨佬明辨! Problem A Digits Are Not Just Characters 题面 题意 思路 代码 Problem B Arithmetic Progressions 题面 代码 Problem C Emergency Evacuation 题意 题解 代码 Problem D Shortest Common Non-Subsequence 题面 代码 Problem E Eulerian Flight Tour Problem G W…