Uva 839 Not so Mobile
2014-07-18 10:56
387 查看
Not so Mobile |
#include<iostream> #include<string.h> #include<stdio.h> #include<ctype.h> #include<algorithm> #include<stack> #include<queue> #include<set> #include<math.h> #include<vector> #include<map> #include<deque> #include<list> using namespace std; bool solve(int& W) { int W1,D1,W2,D2; bool b1=true,b2=true; cin>>W1>>D1>>W2>>D2; if(!W1)b1=solve(W1); if(!W2)b2=solve(W2); W=W1+W2; return b1 && b2 && (W1*D1==W2*D2); } int main() { int T,W; cin>>T; while(T--) { if(solve(W)) cout<<"YES\n"; else cout<<"NO\n"; if(T) printf("\N"); } return 0; }
View Code
相关文章推荐
- UVA 839 - Not so Mobile
- UVA 839 Not so Mobile
- UVA839 - Not so Mobile
- UVA 839 Not so Mobile(二叉树经典题)
- UVA 839 Not so Mobile (贪心)
- UVa839 Not so Mobile
- UVA - 839 Not so Mobile
- UVA 839 Not so Mobile
- UVa 839 Not so Mobile
- uva 839 not so mobile——yhx
- uva 839 Not so Mobile
- uva 839 Not so Mobile-S.B.S.
- UVA 839 - Not so Mobile
- uva 839 not so mobile——yhx
- 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