5 条题解
-
0
#include<bits/stdc++.h> #define int long long const int N=1e5+10; using namespace std; int n,a[N],x=100000,i=1; signed main(){ cin>>n; while(1){ int z=0;//z为其余各家的门牌号之和 i++; for(int j=1;j<=i;j++){ z+=j; } // cout<<z<<endl; for(int j=1;j<=i;j++){//设j为我家的门牌号 if(z-j-j*2==n){ cout<<j<<" "<<i<<endl; break; } } if(z-i*2>n) break; } return 0; }
信息
- ID
- 962
- 时间
- 1000ms
- 内存
- 128MiB
- 难度
- 8
- 标签
- 递交数
- 578
- 已通过
- 107
- 上传者