CyaNgw_DyG @ 2021-08-13 20:09:25
#include<bits/stdc++.h>
using namespace std;
int main(){
int a,b;
cin>>a>>b;
if(b<=0)for(int i=0;i>b;i--)a+=-1;
else for(int i=1;i<=b;i++)a+=1;
cout<<a;
}
by 零殇 @ 2021-08-13 20:11:08
1e9不卡你卡谁?
by wbs200 @ 2021-08-13 20:11:52
1e9的for循环不卡TLE都怪了
by CyaNgw_DyG @ 2021-08-13 20:11:53
卡卡西
by songxiao @ 2021-08-13 20:12:40
开O2就过了
https://www.luogu.com.cn/record/55819929
by Justin090102 @ 2021-08-13 20:13:20
@dyg_Teaf_offorz 可以先找到b的最大质因数,再加
by CyaNgw_DyG @ 2021-08-13 20:13:59
我的意思是教大家别像我一样做,我知道可以开O2
by wbs200 @ 2021-08-13 20:14:27
@Justin090102 做个A+B谷民都做出花样了。。。
by CyaNgw_DyG @ 2021-08-13 20:14:38
@Justin090102 应该是找最小公倍数吧doge
by OrezTsim @ 2021-08-13 20:15:00
我下次优化时间复杂度 N=100000 N^3 开个 O2 肯定过了
by songxiao @ 2021-08-13 20:15:12
开O2跑的飞快,10ms
普通代码也要15ms
就离谱