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 lang_xp at 2010-09-19 02:40:35 on Problem 1242
int getX(bool isfront,int options,int val){
	switch (options) {
	case 0:return (val-1)/n;
	case 1:if(isfront)return (val-1)%n;else return (n-1)-(val-1)%n;
	case 2:return (n-1)-(val-1)/n;
	case 3:if(isfront)return (n-1)-(val-1)%n;else return (val-1)%n;
	}
}
int getY(bool isfront,int options,int val){
	switch (options) {
	case 0:if(isfront)return (val-1)%n;else return (n-1)-(val-1)%n;
	case 1:return (n-1)-(val-1)/n;
	case 2:if(isfront)return  (n-1)-(val-1)%n;else return (val-1)%n;
	case 3:return (val-1)/n;
	}
}

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