URAL 1969. Hong Kong Tram】的更多相关文章

有一个trick就是没想到,枚举第二段时间后,要检测该火车能否继续跑一圈来判断,不能先检测前半圈能不能跑加进去后在检测后半段: // **** 部分不能放在那个位置: 最近代码导致的错误总是找不出,贴下代码权当提醒吧!! #include<cstdio> #include<cstring> #include<iostream> #include<cmath> #include<cstdlib> #include<vector> #in…
Internet giant Google Inc. has scrapped a plan to build its own data center in Hong Kong and will instead expand its facilities in Taiwan and Singapore. “While we see tremendous opportunity and potential in Hong Kong…we will not be moving ahead with…
Hong Kong's rapacious consumption and waste production is straining its natural resources and could leave the city vulnerable to global price swings and supply shortages, the World Wide Fund for Nature warns. The organization's latest report notes Ho…
Neon Lights in Hong Kong Neon is to Hong Kong as red phone booths are to London and fog is to San Francisco. 霓虹灯之于香港,就像红色电话亭之与伦敦,雾之与旧金山一样. When night falls, red and blue and other colors cast a hazy glow over a city lit up by tens of thousands of neo…
A. Colourful Graph 可以在$2n$步之内实现交换任意两个点的颜色,然后就可以构造出方案. #include <bits/stdc++.h> using namespace std ; typedef long long LL; const int mod=1e9+7,Maxn=222; const LL Inf=1LL<<60; int n,m,K; int col[Maxn],col2[Maxn]; int done[Maxn],pre[Maxn]; vecto…
Classrooms 传送门 The new semester is about to begin, and finding classrooms for orientation activities is always a headache. There are \(k\) classrooms on campus and \(n\) proposed activities that need to be assigned a venue. Every proposed activity ha…
题解: https://files.cnblogs.com/files/clrs97/19HKEditorial-V1.zip Code:(Part) A. Axis of Symmetry #include<cstdio> #include<algorithm> #include<vector> using namespace std; typedef long long ll; const int N=100010,inf=1000000010; int Case,…
A. Axis of Symmetry B. Binary Tree n 的奇偶性决定胜负. C. Constructing Ranches 路径上点权之和大于,极大值两倍,这是路径上点能拼出多边形的充要条件. 树分治,进行路径统计即可. 有请 F0_0H 讲解下怎样卡常. D. Defining Labels 签到 E. Erasing Numbers 考虑第 \(i\) 位的答案,因为我们只关心被删掉的元素和 \(a[i]\) 大小关系,把比 \(a[i]\) 小的元素设为 0,比 \(a[…
题目链接 题目大意 要你在[l,r]中找到有多少个数满足\(x\equiv f(x)(mod\; m)\) \(f(x)=\sum_{i=1}^{k-1} \sum_{j=i+1}^{k}d(x,i)*d(x,j)\) \(d(x,i)表示x的第i位数\) 题目思路 显然是数位dp,然而这个数位dp不能同时存x%m 和f(x)%m 这样会内存太大存不了,所以存差值即可 还有这个dfs的时候取模只取一次,不然会t,卡常严重 代码 #include<set> #include<map>…
J - 皇后像廣場 题目连接: http://acm.hust.edu.cn/vjudge/contest/123332#problem/J Description Vova was walking along the Statue Square (皇后像廣場) in Hong Kong, when he noticed that the square was paved with multi-colored square tiles. Vova took a careful look at t…