日韩性视频-久久久蜜桃-www中文字幕-在线中文字幕av-亚洲欧美一区二区三区四区-撸久久-香蕉视频一区-久久无码精品丰满人妻-国产高潮av-激情福利社-日韩av网址大全-国产精品久久999-日本五十路在线-性欧美在线-久久99精品波多结衣一区-男女午夜免费视频-黑人极品ⅴideos精品欧美棵-人人妻人人澡人人爽精品欧美一区-日韩一区在线看-欧美a级在线免费观看

歡迎訪問 生活随笔!

生活随笔

當前位置: 首頁 > 编程资源 > 编程问答 >内容正文

编程问答

codeforce 606A - Magic Spheres

發布時間:2023/12/10 编程问答 34 豆豆
生活随笔 收集整理的這篇文章主要介紹了 codeforce 606A - Magic Spheres 小編覺得挺不錯的,現在分享給大家,幫大家做個參考.

題意:a,b,c三種球,能把倆個一樣的球變成另一顏色不一樣的球。給你目標x,y,z,問能否經過變化至少達打目標。

1 #include<iostream> 2 #include<stdio.h> 3 #include<stdlib.h> 4 #include<memory.h> 5 #include<string.h> 6 #include<algorithm> 7 #include<cmath> 8 const int N = 30; 9 const int inf=-100000; 10 using namespace std; 11 int ans; 12 void fun(int x) 13 { 14 if(x>=0) 15 { 16 ans+=x/2; 17 } 18 else 19 { 20 ans+=x; 21 } 22 } 23 24 int main() 25 { 26 int a[3]; 27 int b[3]; 28 while(~scanf("%d%d%d",&a[0],&a[1],&a[2])) 29 { 30 scanf("%d%d%d",&b[0],&b[1],&b[2]); 31 ans=0; 32 fun(a[0]-b[0]); 33 //cout<<ans<<endl; 34 fun(a[1]-b[1]); 35 //cout<<ans<<endl; 36 fun(a[2]-b[2]); 37 //cout<<ans<<endl; 38 if(ans>=0) 39 { 40 cout<<"Yes"<<endl; 41 } 42 else 43 { 44 cout<<"No"<<endl; 45 } 46 } 47 return 0; 48 } View Code

?

轉載于:https://www.cnblogs.com/ITUPC/p/5035618.html

總結

以上是生活随笔為你收集整理的codeforce 606A - Magic Spheres的全部內容,希望文章能夠幫你解決所遇到的問題。

如果覺得生活随笔網站內容還不錯,歡迎將生活随笔推薦給好友。