标签:os io ar for cti sp amp on line
A group of survivors has arrived by helicopter to an isolated island. The island is made up of a long5 1 0 0 1 1 0 1 1 0 0 1 0 0 1 1 1 0 0 0
模拟的水题。
#include<iostream> #include<cstdio> #include<cstring> #include<algorithm> #include<limits.h> typedef long long LL; using namespace std; int num[25]; int main() { int t; cin>>t; while(t--) { for(int i=1;i<=20;i++) scanf("%d",&num[i]); int sum=0,temp; for(int i=20;i>=1;i--) { temp=num[i]+sum; sum=temp/2; if(temp%2) num[i]=1; else num[i]=0; } cout<<temp; for(int i=2;i<=20;i++) cout<<" "<<num[i]; cout<<endl; } return 0; }
UVA 6480 Zombie Invasion(模拟退火)
标签:os io ar for cti sp amp on line
原文地址:http://blog.csdn.net/u013582254/article/details/38965783