| 比赛 |
ICPC复现(AI数据) |
评测结果 |
AAAAAAAAAA |
| 题目名称 |
赚的越多,赚的越少 |
最终得分 |
100 |
| 用户昵称 |
李金泽 |
运行时间 |
0.047 s |
| 代码语言 |
C++ |
内存使用 |
4.02 MiB |
| 提交时间 |
2026-05-26 20:59:59 |
显示代码纯文本
#include<iostream>
#include<cstdio>
#include<cstdlib>
#include<cstring>
#include<algorithm>
#include<map>
#define N
#define int long long
#define ui unsigned
#define ul unsigned long long
#define db double
#define fo(i,l,r) for(int i=l;i<=r;i++)
#define rf(i,r,l) for(int i=r;i>=l;i--)
#define mem(x) memset(x,0,sizeof(x));
using namespace std;
int T,n,m,k,ans,op,x,y,z;
map<int,int>mp;
void swap(int &x,int &y){int t=x;x=y;y=t;}
int max(int x,int y){return x>y?x:y;}
int min(int x,int y){return x<y?x:y;}
int read(){
int sum=0;bool f=0;char c=getchar();
for(;c<48||c>57;c=getchar())if(c==45)f=1;
for(;c>=48&&c<=57;c=getchar())sum=sum*10+(c&15);
return f?-sum:sum;
}
signed main(){
freopen("zhuan.in","r",stdin);freopen("zhuan.out","w",stdout);
ios::sync_with_stdio(0);
cin.tie(0);
int X,K;
n=read();X=read();K=read();
fo(i,1,n){
x+=X-(x+X)/K;
if(mp[x])n%=i-mp[x];
mp[x]=i;
}
printf("%lld",x);
return 0;
}