2010 Asia Fuzhou Regional Contest】的更多相关文章

Description Aliens on planet Pandora also write computer programs like us. Their programs only consist of capital letters (‘A’ to ‘Z’) which they learned from the Earth. On planet Pandora, hackers make computer virus, so they also have anti-virus sof…
A hard Aoshu Problem http://acm.hdu.edu.cn/showproblem.php?pid=3699 用深搜写排列,除法要注意,还有不能有前导零.当然可以5个for,但是如果有很多个,dfs还是好的. #include<cstdio> #include<cstring> #include<iostream> #include<map> #define mt(a,b) memset(a,b,sizeof(a)) using n…
Description Plain of despair was once an ancient battlefield where those brave spirits had rested in peace for thousands of years. Actually no one dare step into this sacred land until the rumor that “there is a huge gold mine underneath the plain” s…
Description     A new Semester is coming and students are troubling for selecting courses. Students select their course on the web course system. There are n courses, the ith course is available during the time interval (Ai,Bi). That means, if you wa…
Description Math Olympiad is called “Aoshu” in China. Aoshu is very popular in elementary schools. Nowadays, Aoshu is getting more and more difficult. Here is a classic Aoshu problem: ABBDE __ ABCCC = BDBDEIn the equation above, a letter stands for a…
Description “Farm Game” is one of the most popular games in online community. In the community each player has a virtual farm. The farmer can decide to plant some kinds of crops like wheat or paddy, and buy the corresponding crop seeds. After they gr…
Problem Description Josh Lyman is a gifted painter. One of his great works is a glass painting. He creates some well-designed lines on one side of a thick and polygonal glass, and renders it by some special dyes. The most fantastic thing is that it c…
Problem Description City C is really a nightmare of all drivers for its traffic jams. To solve the traffic problem, the mayor plans to build a RTQS (Real Time Query System) to monitor all traffic situations. City C is made up of N crossings and M roa…
Xiangqi http://acm.hdu.edu.cn/showproblem.php?pid=4121 模拟,用高内聚低耦合的思想来写模拟题还是很好的,提高了函数的可重用性,程序的可读性,正确性,总而言之,写函数麻烦,总比debug麻烦来的好. #include<cstdio> ; struct point{ int x,y; }p[M]; char has[M][M],op[M]; bool vis[M][M]; ,,,}; ,,-,}; bool insidemap(const po…
感慨一下,区域赛的题目果然很费脑啊!!不过确实是一道不可多得的好题目!! 题目大意:给你一棵有n个节点的树,让你移动树中一条边的位置,即将这条边连接到任意两个顶点(边的大小不变),要求使得到的新树的直径最小. 解题思路:此题先求出原始树的直径maxr1,并记录直径上的各个节点.很容易想到要移动的边一定是直径上的边,只有这样才有可能使树的直径减小!! 接着就是枚举直径上的每条边,并用这条边作为分隔将原始树分割成两棵子树(即子树一和子树二),然后分别求子树一的直径maxr2 和子树二的直径maxr3…
Description You are given an undirected graph with N vertexes and M edges. Every vertex in this graph has an integer value assigned to it at the beginning. You're also given a sequence of operations and you need to process them as requested. Here's a…
Description Could you imaging a monkey writing computer programs? Surely monkeys are smart among animals. But their limited intelligence is no match for our human beings. However, there is a theorem about monkeys, and it states that monkeys can write…
Conquer a New Region Time Limit: 5 Seconds      Memory Limit: 32768 KB The wheel of the history rolling forward, our king conquered a new region in a distant continent. There are N towns (numbered from 1 to N) in this region connected by several road…
摘要 本文主要给出了2018 ACM-ICPC Asia Beijing Regional Contest的部分题解,意即熟悉区域赛题型,保持比赛感觉. Jin Yong’s Wukong Ranking List 题意 输入关系组数n和n组关系,每组关系是s1 > s2,问第一出现矛盾的组,或者没有矛盾就输出0. 解题思路 第一感觉是拓扑排序,未完,又写了一个深搜的传递闭包,1 A,和2018年河南省赛的题很像. 代码 #include <cstdio> #include <ma…
摘要 本文主要给出了2014-2015 ACM-ICPC, Asia Xian Regional Contest的部分题解,说明了每题的题意.解题思路和代码实现,意即熟悉区域赛比赛题型. Built with Qinghuai and Ari Factor 题意 判断是否是Q数列,只要数列中每个数均能够被3整除就是Q数列. 解题思路 需要特判一下0的情况. 代码 #include <cstdio> int main() { int T; int n; ; scanf("%d"…
摘要: 本文是The 2018 ACM-ICPC Asia Qingdao Regional Contest(青岛现场赛)的部分解题报告,给出了出题率较高的几道题的题解,希望熟悉区域赛的题型,进而对其他区域赛的准备有借鉴意义. Function and Function 题意 给出x和k,计算gk(x). 解题思路 通过观察发现,g函数经过一定次数的递推一定会在0和1之间变换,所以循环内加判断提前结束递推即可. 易错分析 注意计算f(0)返回的是1的问题,下面的写法避免了这种错误. 代码实现 #…
The 2018 ACM-ICPC Asia Qingdao Regional Contest 青岛总体来说只会3题 C #include<bits/stdc++.h> using namespace std; #define maxn 3000005 char a[maxn],b[maxn]; int c[maxn],ll[maxn],rr[maxn]; int main(){ int t; cin>>t; while(t--){ int n; scanf("%d&qu…
2017-2018 ACM-ICPC, Asia Tsukuba Regional Contest A Secret of Chocolate Poles 思路:暴力枚举黑巧克力的个数和厚黑巧克力的个数 代码: #pragma GCC optimize(2) #pragma GCC optimize(3) #pragma GCC optimize(4) #include<bits/stdc++.h> using namespace std; #define fi first #define s…
GCC Time Limit: 1000/1000 MS (Java/Others)    Memory Limit: 131072/131072 K (Java/Others) Total Submission(s): 3867    Accepted Submission(s): 1272 Problem Description The GNU Compiler Collection (usually shortened to GCC) is a compiler system produc…
The 2014 ACM-ICPC Asia Mudanjiang Regional Contest A.Average Score B.Building Fire Stations C.Card Game D.Domination E.Excavator Contest F.Fiber-optic Network G.Garden and Sprinklers H.Hierarchical Notation I.Information Entropy J.Jacobi Pattern K.Kn…
WHUgirls Time Limit: 3000/2000 MS (Java/Others)    Memory Limit: 131072/131072 K (Java/Others) Total Submission(s): 2068    Accepted Submission(s): 785 Problem Description There are many pretty girls in Wuhan University, and as we know, every girl lo…
The 2014 ACM-ICPC Asia Mudanjiang Regional Contest 题目链接 没去现场.做的网络同步赛.感觉还能够,搞了6题 A:这是签到题,对于A堆除掉.假设没剩余在减一.B堆直接除掉 + 1就能够了 B:二分贪心,二分长度.然后会发现本质上是在树上最长链上找两点,那么有二分出来的长度了,就从两端分别往里移动那么长,那两个位置就是放置位置.然后在推断一下就能够了 D:概率DP.首先知道放一个棋子.能够等价移动到右上角区域,那么就能够dp[x][y][k],表示…
Sum of divisors Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 32768/32768 K (Java/Others) Total Submission(s): 4318    Accepted Submission(s): 1382 Problem Description mmm is learning division, she's so proud of herself that she can figure…
2014-2015 ACM-ICPC, Asia Tokyo Regional Contest A B C D E F G H I J K O O O O   O O         A - Bit String Reordering 签到 #include <bits/stdc++.h> using namespace std; ; ]; int temp[N]; int put(int opt) { ] = {}; ; ; i <= m; i++) { int num = p[i];…
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…
ACM-ICPC Asia Beijing Regional Contest 2018 Reproduction hihocoder1870~1879 A 签到,dfs 或者 floyd 都行. #include<bits/stdc++.h> using namespace std; typedef long long LL; typedef long double LD; typedef pair<int,int> pii; typedef pair<LL,int>…
$$2017-2018\ ACM-ICPC,\ Asia\ Daejeon\ Regional\ Contest$$ \(A.Broadcast\ Stations\) \(B.Connect3\) BFS+哈希判重,哈希就用一个16位的三进制数表示即可 //#pragma comment(linker, "/STACK:1024000000,1024000000") #include<bits/stdc++.h> using namespace std; function…
The Problem to Slow Down You Time Limit: 1 Sec Memory Limit: 256 MB 题目连接 http://acm.hust.edu.cn/vjudge/contest/view.action?cid=93645#problem/G Description http://7xjob4.com1.z0.glb.clouddn.com/76e435d3c21fa3cbeef1e76780086dc4 Input   Output Sample In…
https://vjudge.net/contest/259447#problem/E bfs,k个限制条件以数组的额外k维呈现. #include <bits/stdc++.h> using namespace std; #define ll long long #define minv 1e-6 #define inf 1e9 #define pi 3.1415926536 #define nl 2.7182818284 ; ; ],qy[maxn*],num[maxn*],step[ma…
A. Harmonic Matrix Counter (3/19) B. Binary Tree (1/14) C. Asa's Chess Problem (21/65) [ Problem ] 给出一个棋盘格,里面的格子两两分为一组,组内的格子可以交换位置, 同一组格子一定在同一行或者同一列,每个格子为白色或者黑色, 现在要求每行中黑色的格子数量在rL到rR之间,每列中黑色的格子数量在cL到cR之间, 现在要求求出最少的交换次数使得要求被满足,不能满足则输出-1 [ Solution ] 我…