#include<iostream>
#include <utility>
using namespace std;
int main() {
int n, k;
cin >> n >> k;
int a[1000];
for (int i = 0; i < n; i++) {
a[i] = i + 1;
}
int num = 0;
if (n == 1) {
cout << 1;
return 0;
}
if (k == 1) {
cout << a[n - 1];
return 0;
}
while (n!=1) {
for (int i = 0; i < n; i++) {
num = num + 1;
if (num % k == 0 || num % 10 == k) {
n = n - 1;
for (int j = i; j < n; j++) {
a[j] = a[j + 1];
}
if (n == 1) {
cout << a[0];
return 0;
}
i--;
}
}
}
return 0;
}
ccf csp 游戏 100分代码 0ms
最新推荐文章于 2025-05-23 09:27:58 发布