首页 > 数据库 > mysql教程 > Codeforces Round #234 (Div. 2)

Codeforces Round #234 (Div. 2)

WBOY
发布: 2016-06-07 15:44:27
原创
975 人浏览过

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

Codeforces Round #234 (Div. 2)

 

 

# Name    
A

Inna and Choose Options

standard input/output

1 s, 256 MB
Codeforces Round #234 (Div. 2) Codeforces Round #234 (Div. 2) Codeforces Round #234 (Div. 2) x1942
B

Inna and New Matrix of Candies

standard input/output

1 s, 256 MB
Codeforces Round #234 (Div. 2) Codeforces Round #234 (Div. 2) Codeforces Round #234 (Div. 2) x1556
C

Inna and Huge Candy Matrix

standard input/output

2 s, 256 MB
Codeforces Round #234 (Div. 2) Codeforces Round #234 (Div. 2) Codeforces Round #234 (Div. 2) x1114
D

Dima and Bacteria

standard input/output

2 s, 256 MB
Codeforces Round #234 (Div. 2) Codeforces Round #234 (Div. 2) Codeforces Round #234 (Div. 2) x371
E

Inna and Binary Logic

standard input/output

3 s, 256 MB
Codeforces Round #234 (Div. 2) Codeforces Round #234 (Div. 2) Codeforces Round #234 (Div. 2) x169

A题:直接暴力枚举每种情况即可。水题

B题:记录下S,G的距离,每种距离只要一次,开个vis数组标记,最后遍历一遍看又几个即可

C题:模拟旋转即可。

D题:并查集+floyd,把w=0的边的点并查集处理,判断同种类是否都在一个集合内,不是就No,剩下的就利用floyd求出最短路即可。

E题:位运算,每个数字对应的每个位向左和向右延生,这个区间内向下的那个三角形区间一定是会增加(1

代码:

A题:

#include <stdio.h>
#include <string.h>

int t, n;
char str[15];
char save[15][15];

bool judge(int a, int b) {
    int i, j;
    for (i = 0; i <br>
B题:
<pre class="brush:php;toolbar:false">#include <stdio.h>
#include <string.h>
#include <algorithm>
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 <br>
C题:
<pre class="brush:php;toolbar:false">#include <stdio.h>
#include <string.h>
#include <algorithm>
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 <br>
D题:
<pre class="brush:php;toolbar:false">#include <stdio.h>
#include <string.h>
#include <vector>
#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 <br>
E题:
<pre class="brush:php;toolbar:false">#include <stdio.h>
#include <string.h>

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 <br>
<br>



</string.h></stdio.h>
登录后复制
相关标签:
来源:php.cn
本站声明
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系admin@php.cn
热门教程
更多>
最新下载
更多>
网站特效
网站源码
网站素材
前端模板