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

Re:水个短代码

Posted by w624611338 at 2019-11-19 10:47:48 on Problem 1017
In Reply To:水个短代码 Posted by:602651749 at 2019-09-26 15:57:24
> #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