A

http://codeforces.com/contest/560/problem/A

推断给出的数能否组成全部自然数。

水题


int a[1010];
bool b[1000010]; int main()
{
int n;
while (scanf("%d", &n) != EOF)
{
memset(b,false,sizeof(b));
for (int i = 1; i <= n; i++)
{
scanf("%d", &a[i]);
b[a[i]] = true;
}
int ans = 0;
if (b[1] == false) ans = 1;
else if (b[1]) ans = -1; printf("%d\n",ans);
}
return 0;
}

B

http://codeforces.com/contest/560/problem/B

推断一个矩形能否装下另外两个矩形


int a1, a2, a3, b1, b2, b3; int main()
{
while (scanf("%d%d%d%d%d%d", &a1, &b1, &a2, &b2, &a3, &b3) != EOF)
{
int ok = 0; int t1 = max(b2, b3);
int r1 = max(a2, a3); if ((t1 <= a1 && (a2 + a3) <= b1)) ok = 1;
if ((t1 <= b1 && (a2 + a3) <= a1)) ok = 1;
if ((r1 <= a1 && (b2 + b3) <= b1)) ok = 1;
if ((r1 <= b1 && (b2 + b3) <= a1)) ok = 1; int t11 = max(b2, a3);
int r11 = max(a2, b3); if ((r11 <= a1 && (b2 + a3) <= b1)) ok = 1;
if ((r11 <= b1 && (b2 + a3) <= a1)) ok = 1;
if ((t11 <= a1 && (a2 + b3) <= b1)) ok = 1;
if ((t11 <= b1 && (a2 + b3) <= a1)) ok = 1; if (ok) puts("YES");
else puts("NO");
}
return 0;
}

C

http://codeforces.com/contest/560/problem/C

推断组成六边形须要的三角形个数

int a, b, c, d, e, f;

int main()
{
while (scanf("%d%d%d%d%d%d", &a, &b, &c, &d, &e, &f) != EOF)
{
printf("%d\n", (a + b + c)*(a + b + c) - (a*a + c*c + e*e));
}
return 0;
}

Codeforces Round #313 (Div. 2) ABC的更多相关文章

  1. Codeforces Round #366 (Div. 2) ABC

    Codeforces Round #366 (Div. 2) A I hate that I love that I hate it水题 #I hate that I love that I hate ...

  2. Codeforces Round #247 (Div. 2) ABC

    Codeforces Round #247 (Div. 2) http://codeforces.com/contest/431  代码均已投放:https://github.com/illuz/Wa ...

  3. Codeforces Round #313 (Div. 1)

    官方英文题解:http://codeforces.com/blog/entry/19237 Problem A: 题目大意: 给出内角和均为120°的六边形的六条边长(均为正整数),求最多能划分成多少 ...

  4. dp - Codeforces Round #313 (Div. 1) C. Gerald and Giant Chess

    Gerald and Giant Chess Problem's Link: http://codeforces.com/contest/559/problem/C Mean: 一个n*m的网格,让你 ...

  5. Codeforces Round #313 (Div. 1) B. Equivalent Strings

    Equivalent Strings Problem's Link: http://codeforces.com/contest/559/problem/B Mean: 给定两个等长串s1,s2,判断 ...

  6. Codeforces Round #313 (Div. 1) A. Gerald's Hexagon

    Gerald's Hexagon Problem's Link: http://codeforces.com/contest/559/problem/A Mean: 按顺时针顺序给出一个六边形的各边长 ...

  7. Codeforces Round #313 (Div. 2)B.B. Gerald is into Art

    B. Gerald is into Art Time Limit: 20 Sec Memory Limit: 256 MB 题目连接 http://codeforces.com/problemset/ ...

  8. Codeforces Round #313 (Div. 2) D. Equivalent Strings

    D. Equivalent Strings Time Limit: 2 Sec Memory Limit: 256 MB 题目连接 http://codeforces.com/contest/559/ ...

  9. Codeforces Round #313 (Div. 2) C. Gerald's Hexagon 数学

    C. Gerald's Hexagon Time Limit: 2 Sec Memory Limit: 256 MB 题目连接 http://codeforces.com/contest/559/pr ...

随机推荐

  1. stl vector 类

    目录 [-]说明构造方法例子vector 类中定义了4中种构造函数: · 默认构造函数,构造一个初始长度为0的空向量,如:vector<int> v1; · 带有单个整形参数的构造函数,此 ...

  2. Vue样式绑定、事件绑定

    1.样式绑定 1.1class类标签绑定 <p :class="对象"> <p :class="数组"> <p :class=&q ...

  3. rails提供的validators

    Instance Public methods attribute_method?(attribute)Link Returns true if attribute is an attribute m ...

  4. 服务器端查看图片库 eog

    eog 命令 eye of gnome,用来在服务器端查看图片. sudo apt-get install eog eog picname.jpg

  5. OpenCV For Java环境搭建与功能演示

    http://blog.csdn.net/jia20003/article/details/68944486

  6. BZOJ 4555 [Tjoi2016&Heoi2016]求和 ——分治 NTT 多项式求逆

    不想多说了,看网上的题解吧,我大概说下思路. 首先考察Stirling的意义,然后求出递推式,变成卷积的形式. 然后发现贡献是一定的,我们可以分治+NTT. 也可以直接求逆(我不会啊啊啊啊啊) #in ...

  7. LibreOJ2085 - 「NOI2016」循环之美

    Portal Description 给出\(n,m(n,m\leq10^9)\)和\(k(k\leq2000)\),求在\(k\)进制下,有多少个数值不同的纯循环小数可以表示成\(\dfrac{x} ...

  8. js中的clientHeight和offsetHeight的区别如

    如图所示:

  9. 方格取数(hdu 1565)

    Problem Description 给你一个n*n的格子的棋盘,每个格子里面有一个非负数.从中取出若干个数,使得任意的两个数所在的格子没有公共边,就是说所取的数所在的2个格子不能相邻,并且取出的数 ...

  10. P1340 送礼物

    时间: 1000ms / 空间: 131072KiB / Java类名: Main 描述 作为惩罚,GY被遣送去帮助某神牛给女生送礼物(GY:貌似是个好差事)但是在GY看到礼物之后,他就不这么认为了. ...