UVA 839 Not so Mobile
来源:互联网 发布:招聘游戏程序员 编辑:程序博客网 时间:2024/05/17 06:32
#include <cstdio>int judge() {int wl, dl, wr, dr;scanf("%d%d%d%d", &wl, &dl, &wr, &dr);if (wl == 0) //判断左边是否有子天平wl = judge();if (wr == 0) //判断右边是否有子天平wr = judge();if (wl == 0 || wr == 0) //假如左边或右边的重量为 0, 说明子天平不平衡, 返回 0,判断结束 return 0;return wl * dl == wr * dr ? wl + wr : 0; //假如天平平衡,则把天平的重量返回给上一级; 假如天平不平衡, 则返回 0;}int main() {int t;scanf("%d", &t);while (t--) {judge() ? printf("YES\n") : printf("NO\n");if (t) printf("\n");}return 0;}
0 0
- uva 839 - Not so Mobile
- uva 839 Not so Mobile
- uva 839 - Not so Mobile
- UVa 839 - Not so Mobile
- UVa 839 - Not so Mobile
- uva-839 Not so Mobile
- uva 839 - Not so Mobile
- UVA 839 Not so Mobile
- uva 839 Not so Mobile
- Not so Mobile UVA 839
- uva 839 - Not so Mobile
- uva 839 Not so Mobile
- UVa 839 - Not so Mobile
- UVA - 839 Not so Mobile
- UVA 839 Not so Mobile
- UVA - 839 Not so Mobile
- UVA 839 - Not so Mobile
- UVA - 839 Not so Mobile
- The 36th ACM/ICPC Asia Regional Dalian Site —— Online Contest(套题HDU4001-4010)
- Fibnacci序列2
- 程序员笑话
- 暑期实训第四课(无线串口模块进行通讯)
- qt学习笔记
- UVA 839 Not so Mobile
- 说说Web Service
- hdu1272- 小希的迷宫
- POJ 1405 Heritage(高精度)
- poj 2396 有下界的最大流(填充矩阵)
- 智能家居远程监控系统的设计及实现
- 【TOJ 2211】Copying Books【DP】
- CI持续集成服务器搭建创建bot服务实现自动构建
- 用link方式在Eclipse中安装SVN