| ||||||||||
| Online Judge | Problem Set | Authors | Online Contests | User | ||||||
|---|---|---|---|---|---|---|---|---|---|---|
| Web Board Home Page F.A.Qs Statistical Charts | Current Contest Past Contests Scheduled Contests Award Contest | |||||||||
Re:bfs?In Reply To:bfs? Posted by:bluewind at 2006-08-14 22:01:06 贪心就可,最后一位为0或5(没有0,5就无解),(有0就是0)求出各数字和除3余数,然后从其余数字中去除一个或两个数,保证和能被3整除即可
025 ----〉0 去除两个
115 ----〉15 去除1个
记录个数字个数
/*
char s[1011];
int dig[10] = {0}, sum = 0;
scanf("%s",s);
for (int i = 0; s[i]; i++){
dig[s[i] - '0']++;
sum += s[i] - '0';
}
if (dig[0] + dig[5] == 0){
printf("impossible\n");
return 0;
}
*/
Followed by:
Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator