Codeforces Round #478 C. Valhalla Siege】的更多相关文章

C. Valhalla Siege time limit per test 2 seconds memory limit per test 256 megabytes input standard input output standard output Ivar the Boneless is a great leader. He is trying to capture Kattegat from Lagertha. The war has begun and wave after wave…
题目链接:http://codeforces.com/contest/975 A. Aramic script time limit per test:1 second memory limit per test:256 megabytes input:standard input output:standard output In Aramic language words can only represent objects. Words in Aramic have special pro…
A. Aramic script time limit per test 1 second memory limit per test 256 megabytes input standard input output standard output In Aramic language words can only represent objects. Words in Aramic have special properties: A word is a root if it does no…
A. Aramic script 题目大意:   对于每个单词,定义一种集合,这个集合包含且仅包含单词中出现的字母.给你一堆单词,问有多少种这种集合. 题解:   状压,插入set,取size #include <iostream> #include <cstdio> #include <cstdlib> #include <cstring> #include <algorithm> #include <set> #include &…
传送门 题意:给你一条直线的斜率a和截距b,和某一时刻n个在直线上的点的横坐标,以及沿坐标轴方向的速度.问你这些点在(-∞,+∞)的时间内的碰撞次数. solution 设两个点在t时刻相碰,有: x1+vx1t=x2+vx2tx1+vx1t=x2+vx2t y1+vy1t=y2+vy2ty1+vy1t=y2+vy2t 消去t,可以得到 x1−x2vx2−vx1=y1−y2vy2−vy1x1−x2vx2−vx1=y1−y2vy2−vy1 而在直线上有 y1−y2=a(x1−x2)y1−y2=a(…
题意:给你一条直线以及初始时刻这条直线上的一些人的坐标,以及他们的速度矢量.让你对每个人计算他在过去无限远到将来无限远的时间内会与多少人处于同一个点,然后对每个人的这个值求和. 列方程组:两个人i,j相撞的条件是: a*x(i)+b+t*vy(i)=a*xj+b+t*vy(j) x(i)+t*vx(i)=xj+t*vx(j) 化简得vy(i)-a*vx(i)=vy(j)-a*vx(j),对这个值排序,就能统计了.别忘了减去vx相等的点对贡献的答案(这种情况画个图出来,显然永远不会相撞). #in…
#include <bits/stdc++.h> using namespace std; ; typedef long long ll; ll a[maxn]; ll b[maxn]; int main(){ ;i < maxn;i++){ cin >> a[i]; } ll ans = -; ;i < maxn;i++){ ;j < maxn;j++) b[j] = a[j]; b[i] = ; int x = a[i] / maxn; int y = a[i…
Codeforces Round #366 (Div. 2) A I hate that I love that I hate it水题 #I hate that I love that I hate it n = int(raw_input()) s = "" a = ["I hate that ","I love that ", "I hate it","I love it"] for i in ran…
Codeforces Round #354 (Div. 2) Problems     # Name     A Nicholas and Permutation standard input/output 1 s, 256 MB    x3384 B Pyramid of Glasses standard input/output 1 s, 256 MB    x1462 C Vasya and String standard input/output 1 s, 256 MB    x1393…
直达–>Codeforces Round #368 (Div. 2) A Brain’s Photos 给你一个NxM的矩阵,一个字母代表一种颜色,如果有”C”,”M”,”Y”三种中任意一种就输出”#Color”,如果只有”G”,”B”,”W”就输出”#Black&White”. #include <cstdio> #include <cstring> using namespace std; const int maxn = 200; const int INF =…