一个初中蒟蒻的提问
查看原帖
一个初中蒟蒻的提问
524899
littleblackQwQ楼主2022/8/20 18:31

求助各位神犇,RE,帮忙看一下,谢谢

// Problem: A. Required Remainder
// Contest: Codeforces - Codeforces Round #653 (Div. 3)
// URL: https://codeforces.com/problemset/problem/1374/A
// Memory Limit: 256 MB
// Time Limit: 1000 ms
// 
// Powered by CP Editor (https://cpeditor.org)

#include<bits/stdc++.h>
#define rep(a,b,c) for(int a=b;a<c;a++)
#define REP(a,b,c) for(int a=b;a<=c;a++)
#define int long long
#define vec vector
#define pb push_back
#define owo ios_base::sync_with_stdio(false);cin.tie(0);cout.tie(0);

using namespace std;

int t,x,y,n,k,cnt;
vec<int>ans;

signed main(){
	owo;
	cin>>t;
	rep(i,0,t){
		x=y=n=cnt=0;
		cin>>x>>y>>n;
		while(ans[cnt]<=n){
			ans.pb(cnt*x+y);
			cnt++;
		}
		cout<<ans[cnt];
		ans.clear();
	}
	return 0;
}
2022/8/20 18:31
加载中...