博文

目前显示的是 八月, 2020的博文

ATC ABC176

图片
本场ABC难度 from  AtCoder Problems A - Takoyaki  Editorial  /  Time Limit: 2 sec / Memory Limit: 1024 MB Problem Statement Takahashi loves takoyaki - a ball-shaped snack. With a takoyaki machine, he can make at most $X$ pieces of takoyaki at a time, taking $T$ minutes regardless of the number of pieces to make. How long does it take to make $N$  takoyaki? Constraints $1 \leq N,X,T \leq 1000$ All values in input are integers.                     Takahashi一次可以做$X$个章鱼烧,需要花费$T$分钟,求出做$N$个章鱼烧Takahashi需要的时间。                    我们只需求出Takahashi需要做几次章鱼烧(即$\left(N-1)\right/X+1$次),再将次数$\times T$就好了。      #include <bits/stdc++.h> using   namespace   std;      int   n,x,t;       int   main() {      scanf ( "%d%d%d" ,&n,&x,&t);      printf ( "%d\n" ,((n-1)/x+1)*t);      return   0; } B - Multiple of 9  Editorial  /  Time Limit: 2 sec / Memory Limit: 1024 MB Problem Statement An integer $N$    is a multiple of $9$   if and only if the sum of the digits in the decimal