求改题解
  • 板块灌水区
  • 楼主lutaoquan2012
  • 当前回复9
  • 已保存回复9
  • 发布时间2023/8/17 16:39
  • 上次更新2023/11/3 03:07:02
查看原帖
求改题解
952033
lutaoquan2012楼主2023/8/17 16:39

链接

## 试题 A :双阶乘

从 1加到 2021,因为是双阶乘,所以每次加 2,因要保留 5位所以模 100000。

```cpp
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
ll ans=1;
int main(){
     for(int i=1;i<=2021;i+=2) ans=ans*i%100000;
     cout<<ans;
     return 0;
}

最后得出答案为:59375。

试题 B:格点

双重循环,暴力枚举 xx 和 yy 的位置。

#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
ll ans;
int main(){
     for(int i=1;i<=2021;i++){
          for(int j=1;j<=2021;j++){
               if(i*j<=2021) ans++;
          }
     }
     cout<<ans;
     return 0;
}

最后得出答案为:15698。

试题 C :整数分解

暴力枚举四重循环,最后一个数不用枚举,直接可以依据前 4个数算出。

最后得出答案为:691677274345。

试题 D:城邦

最小生成树,然后枚举每一个的权值,加起来。

最后得出答案为:691677274345。

试题 E:游戏

递推,每个 n\sqrt{n} 都要找到对应的因数,这样乘积就会等于 nn 。

最后得出答案为:1352184317599。

2023/8/17 16:39
加载中...