- 题解
题解,嗯对
- @ 2025-12-20 16:14:31
发题解
4 条评论
-
miaoshengxiang LV 8 @ 2025-12-20 16:48:02题号:1598 GESP1级2303 计算长方形可能的个数 解:
#include <bits/stdc++.h> using namespace std; int main() { int n,x=0; cin>>n; for(int i=1;i<=sqrt(n);i++) { if(n%i==0) x++; } cout<<x; return 0; } -
@ 2025-12-20 16:22:16
//有点意思 -
@ 2025-12-20 16:17:43
试题名称:⾦字塔 时间限制:1.0 s 内存限制:512.0 MB 解:
#include<bits/stdc++.h> using namespace std; long long jc(int o) { return o*o; } int main(){ int n; long long m=0; cin>>n; for(;n>0;n--) { m+=jc(n); } cout<<m; return 0; } -
@ 2025-12-20 16:16:40
试题名称:商店折扣 时间限制:1.0 s 内存限制:512.0 MB 解:
#include<bits/stdc++.h> using namespace std; double _f1(int x,int y,int p) { return 1.0*p-y; } double _f2(int n,int p) { return 0.1*p*n; } int main(){ int x,y,n,p; cin>>x>>y>>n>>p; double f1,f2; if(p>=x) f1=_f1(x,y,p); f2=_f2(n,p); if(f1<f2) cout<<fixed<<setprecision(2)<<f1; else cout<<fixed<<setprecision(2)<<f2; return 0; }
- 1