您好,欢迎访问一九零五行业门户网

Codeforces Round #234 (Div. 2)

problems # name a inna and choose options standard input/output 1 s, 256 mb x1942 b inna and new matrix of candies standard input/output 1 s, 256 mb x1556 c inna and huge candy matrix standard input/output 2 s, 256 mb x1114 d dima and bact
problems
#name  
a
inna and choose options
standard input/output
1 s, 256 mb    x1942
b
inna and new matrix of candies
standard input/output
1 s, 256 mb    x1556
c
inna and huge candy matrix
standard input/output
2 s, 256 mb    x1114
d
dima and bacteria
standard input/output
2 s, 256 mb    x371
e
inna and binary logic
standard input/output
3 s, 256 mb    x169
a题:直接暴力枚举每种情况即可。水题
b题:记录下s,g的距离,每种距离只要一次,开个vis数组标记,最后遍历一遍看又几个即可
c题:模拟旋转即可。
d题:并查集+floyd,把w=0的边的点并查集处理,判断同种类是否都在一个集合内,不是就no,剩下的就利用floyd求出最短路即可。
e题:位运算,每个数字对应的每个位向左和向右延生,这个区间内向下的那个三角形区间一定是会增加(1
代码:
a题:
#include #include int t, n;char str[15];char save[15][15];bool judge(int a, int b) { int i, j; for (i = 0; i
b题:#include #include #include using namespace std;const int n = 1005;int n, m, i, j, vis[n];char g[n][n];int main() { scanf(%d%d, &n, &m); for (i = 0; i
c题:#include #include #include using namespace std;int n, m, x, y, z, p, i, j;struct point { int x, y;} po[100005];void at(point &a) { int x = a.x, y = a.y; a.y = n - x + 1; a.x = y;}void ht(point &a) { int x = a.x, y = a.y; a.y = m - y + 1; a.x = x;}void ct(point &a) { int x = a.x, y = a.y; a.y = x; a.x = m - y + 1;}int main() { scanf(%d%d%d%d%d%d, &n, &m, &x, &y, &z, &p); x %= 4; y %= 2; z %= 4; for (i = 0; i
d题:#include #include #include #define inf 0x3f3f3f3f#define min(a,b) ((a) w) { f[type[u]][type[v]] = w; f[type[v]][type[u]] = w; } if (w == 0) { int pu = find(u); int pv = find(v); if (pu != pv) fa[pv] = pu; } } for (i = 2; i
e题:#include #include const int n = 100005;const int m = 20;int n, m, i, j, b;int a[n][m];__int64 sum, mi[32];int main() { mi[0] = 1; for (i = 1; i

其它类似信息

推荐信息