好得很程序员自学网

<tfoot draggable='sEl'></tfoot>

CodeforcesRound#277.5(Div.2)C??GivenLengthandSumof

C. Given Length and Sum of Digits...


#include  #include  #include  #include  #include  #include  #include  #include  #include  #include  #include using namespace std;int s1[110], s2[110];int main(){	int m, s;	while (~scanf("%d%d", &m, &s))	{		if (s == 0 && m == 1)		{			printf("0 0\n");			continue;		}		if (m * 9  = dis)			{				s1[cnt] += dis;				break;			}			dis -= (9 - s1[cnt]);			s1[cnt] = 9;			cnt--;		}		for (int i = 1; i  = dis)			{				s2[cnt] -= dis;				break;			}			dis -= (s2[cnt]);			s2[cnt] = 0;			cnt--;		}		for (int i = 1; i  

查看更多关于CodeforcesRound#277.5(Div.2)C??GivenLengthandSumof的详细内容...

  阅读:66次