| 比赛 |
寒假集训4 |
评测结果 |
WWWWWWWWWW |
| 题目名称 |
金币 |
最终得分 |
0 |
| 用户昵称 |
梦那边的追忆SB |
运行时间 |
0.204 s |
| 代码语言 |
C++ |
内存使用 |
13.22 MiB |
| 提交时间 |
2026-02-28 11:17:51 |
显示代码纯文本
#include<bits/stdc++.h>
using namespace std;
#define ll long long
#define foru(a,b,c) for(ll a=b;a<=c;a++)
ll n,k;
bool b[10000005];
int main(){
freopen("Gold_coin","r",stdin);
freopen("Gold_coin.out","w",stdout);
ios::sync_with_stdio(0);
cin.tie(0);
cin>>n>>k;
foru(i,1,1e7)b[i]=1;
ll sum=n;
while(sum>1){
ll cnt=0;
for(ll i=1;i<=n&&sum>1;i++){
cnt+=b[i];
if(cnt%k==1&&b[i]){
b[i]=0;
sum--;
}
}
}
foru(i,1,n)if(b[i])cout<<i;
return 0;
}//20 10007 20 0