'commit'
This commit is contained in:
17
TangDou/CSP-J/J1_2020/3_Test
Normal file
17
TangDou/CSP-J/J1_2020/3_Test
Normal file
@@ -0,0 +1,17 @@
|
||||
for (long long i = 0; i < n; ++i) {
|
||||
++d[0];
|
||||
for (int j = 0; j + 1 < len; ++j) {
|
||||
if (d[j] == k) {
|
||||
d[j] = 0;
|
||||
d[j + 1] += 1;
|
||||
++ans;
|
||||
}
|
||||
}
|
||||
if (d[len - 1] == k) {
|
||||
d[len - 1] = 0;
|
||||
d[len] = 1;
|
||||
++len;
|
||||
++ans;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user