Gym 102346H. Hour for a Run (暴力)
程序员文章站
2022-06-03 21:07:39
...
Description
Solution
暴力
Code
int ans[12];
int main() {
int r,tot;scanf("%d%d",&r,&tot);
int lim = r * tot, p = 1;
for(int i = 1;i <= lim;++i)
while(1.0*i / lim >= p / 10.0 && ans[p] == 0 && p <= 9) ans[p] = i;p++;
for(int i = 1;i < 9;++i) if(ans[i+1] == 0) ans[i+1] = ans[i];
for(int i = 1;i <= 9;++i) printf("%d ", ans[i]);
printf("\n");
return 0;
}