C.Cheering To boost contestants' performances in the 20th La Salle - Pui Ching Programming Challenge, the organizers have bought N robots to cheer for them. Each robot is supposed to display cheering slogans, letter by letter. Unfortunately, due to s…
A. Ambiguous Dates There are two popular formats for representing a date: day/month/year or month/day/year. For example, today can be represented as 15/8/2017 or 8/15/2017. Sometimes (like on today), using one way or another should pose no confusion…
D.Distribution of Days The Gregorian calendar is internationally the most widely used civil calendar. It is named after Pope Gregory XIII, who introduced it in October 1582. In the Gregorian calendar, there are 28 days in February in a common year an…
西瓜队(划掉),Kuma Rider久违的第一场训练,四小时瞎打.jpg A.水题,排序 #include<cstdio> #include<iostream> #include<algorithm> #include<queue> #include<cstring> #include<string> #include<vector> #include<map> #include<functional&g…
链接:http://codeforces.com/gym/101116 学弟写的,以后再补 #include <iostream> #include <algorithm> #include <stdio.h> #include <cstring> #include <map> #include <vector> using namespace std; map<string,int>v,ans; vector<in…
链接:http://codeforces.com/gym/101116 题意:给出n个点,要求一个矩形框将(n/2)+1个点框住,要面积最小 解法:先根据x轴选出i->j之间的点,中间的点(包括两边)按照y排序,固定一边X=(xj-xi),Y就枚举点两端的Y坐标,细节是注意要取(n/2)+1个点 事实上这样取里面一定符合要求 #include <iostream> #include <cstdio> #include <algorithm> #include &l…
链接:http://codeforces.com/gym/101116 题意:选六个数,必须出现次数最多,且数字最小,如果出现7优先加入7 解法:排序,出现7优先加入7,最后再将6个数排序 #include<bits/stdc++.h> using namespace std; struct P { int num,pos,M; }He[1000]; bool cmd(P a,P b) { if(a.pos==b.pos) { return a.M<b.M; } else { retur…
链接:http://codeforces.com/gym/101116 学弟做的,以后再补 #include <iostream> #include <stdio.h> #include <cstring> #include <string> using namespace std; int a[505]; int main(){ int T; cin>>T; string s[505]; while(T--){ memset(a,0,sizeo…
题目链接:D. Frets On Fire 思路:明明可以离散化+二分写,思路硬是歪到了线段树上,自闭了,真实弟弟,怪不得其他人过得那么快 只和查询的区间长度有关系,排完序如果相邻的两个点的差值小于等于查询的区间长度,那么给结果带来的变化就会新增差值个数,如果大于区间长度那么就会新增区间长度个数 维护的话,线段树和二分都可以,二分需要离散化处理,再给差值排个序,每次找到第一个大于当前区间长度的差值位置就好了,(没实现,但是理论上应该没问题) 线段树直接动态开点可以不用离散化.. 实现代码: #i…
I.Yet another A + B You are given three numbers. Is there a way to replace variables A, B and C with these numbers so the equality A + B = C is correct? Input There are three numbers X1, X2 and X3 (1 ≤ Xi ≤ 10100), each on a separate line of input. O…