8 条题解
-
1
#include<bits/stdc++.h> using namespace std; int main(){ int a,minn =32768 ,maxn = -1; cin>>a; for(int i= 0;i<a;i++){ for(int j = 0;j<a;j++){ if(4i+j2==a){ if(i+j>maxn) maxn = i+j; if(i+j<minn) minn = i+j; } } } if(minn ==32768 or maxn == -1) cout<<0<<" "<<0; else cout<<minn <<" "<<maxn;
return 0;
}
-
0
-
0
```#include<bits/stdc++.h> using namespace std; int main(){ int a,minn =32768 ,maxn = -1; cin>>a; for(int i= 0;i<a;i++){ for(int j = 0;j<a;j++){ if(4*i+j*2==a){ if(i+j>maxn) maxn = i+j; if(i+j<minn) minn = i+j; } } } if(minn ==32768 or maxn == -1) cout<<0<<" "<<0; else cout<<minn <<" "<<maxn; return 0; }
-
-1
#include<bits/stdc++.h> using namespace std; int main(){ int a,minn=32768,maxn=0; cin>>a; for(int i = 0;i<=a;i++){ for(int j = 0;j<=a;j++){ if(i4+2j == a){ if(i+j>maxn){ maxn=i+j; } if(i+j<minn){ minn=i+j; } } } } if(minn32768 or maxn0){ cout<<0<<" "<<0; }else{ cout<<minn<<" "<<maxn; } return 0;
} -
-2
#include<bits/stdc++.h> using namespace std; int main(){ int i,j,maxn=-1,minn=32768; long long a; cin>>a; for(i=0;i<a;i++){ for(j=0;j<a;j++){ if(i4+j2==a){ if(i+j<minn) minn=i+j; if(i+j>maxn) maxn=i+j;
} } } if(maxn==-1 or minn==32768) cout<<"0"<<" "<<"0"; else cout<<minn<<" "<<maxn; return 0;
}
- 1
信息
- ID
- 789
- 时间
- 1000ms
- 内存
- 64MiB
- 难度
- 7
- 标签
- 递交数
- 404
- 已通过
- 101
- 上传者