TLE 两个点 求优化
查看原帖
TLE 两个点 求优化
778802
Xssion37_XY楼主2023/1/11 21:51
#include <iostream>
using namespace std;
int main(){
	int a;
	cin>>a;
	for(int i = 0;i < a;i ++){
		for(int j = i;j < a;j ++){
			if(((i + j)*(j - i + 1)/2) == a){
				cout<<i<<" "<<j<<endl;
			}
		}
	}
}
2023/1/11 21:51
加载中...