铜a 数学 B站讲解视频 https://www.bilibili.com/video/BV1sZ4y1g74R?p=1
#include<bits/stdc++.h> using namespace std; typedef long long ll; typedef double db; typedef vector<int> vii; typedef vector<ll> vll; typedef pair<int,int> PII; #define so sizeof #define pb push_back #define fi first #define se second #define mp make_pair #define lb lower_bound #define ub upper_bound const db esp=1e-5; const int N=1e5+10,M=1e2+10,Max=1e5+5,inf=0x3f3f3f3f,mod=1e9+7; const ll INF=0x3f3f3f3f3f3f3f3f; class Solution { public: /** * 代码中的类名、方法名、参数名已经指定,请勿修改,直接返回方法规定的值即可 * 返回满足条件的最大的x。 * @param a int整型 代表题意中的a * @param b int整型 代表题意中的b * @param n int整型 代表题意中的n * @return int整型 */ int solve(int a, int b, int n) { // write code here int c=n/a; int ans=a*c+b; if(ans>n) ans-=a; return ans; } }T;