Online JudgeProblem SetAuthorsOnline ContestsUser
Web Board
Home Page
F.A.Qs
Statistical Charts
Problems
Submit Problem
Online Status
Prob.ID:
Register
Update your info
Authors ranklist
Current Contest
Past Contests
Scheduled Contests
Award Contest
User ID:
Password:
  Register

水个短代码

Posted by 602651749 at 2019-09-26 15:57:24 on Problem 1017
#include <iostream>
using namespace std;
int main(){
	int a,s,d,f,g,r;
	while(1){
		cin>>a>>s>>d>>f>>g>>r;
		if(a+s+d+f+g+r==0) break;
		r+=g+f+(d+3)/4;
		a-=11*g;
		s-=5*f;
		if(g=d%4){
			s-=7-2*g;
			a-=8-g;
		}
		if(s>0){
			r+=(s+8)/9;
			a-=4*(9-(s%9));
		} else a+=4*s;
		if(a>0) r+=(a+35)/36;
		cout<<r<<endl;
	}
}

Followed by:

Post your reply here:
User ID:
Password:
Title:

Content:

Home Page   Go Back  To top


All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator