首页 > 年轮广场
头像 墨白.
发表于 2021-04-17 14:18:24
不会什么高级算法,就用一个双层循环写一下吧#include<iostream>#include<cmath>using namespace std;int n,m,a[1000],sum=0,MIN=100000;int main(){ while(cin>> 展开全文
头像 小小辣子鸡
发表于 2022-04-18 15:31:39
很简单的枚举题,具体往下看注释部分 #include<bits/stdc++.h> using namespace std; #define ll long long const int maxn=1e3+10; const int inf=0x3f3f3f3f; int a[max 展开全文
头像 俯瞰思绪万千
发表于 2022-03-13 16:36:10
本题只需要了解循环数组怎么确定最小距离 #include <bits/stdc++.h> using namespace std; /* 暴力求解,遍历每一个位置,选择到所有人距离最大值最小的位置 */ const int MAXN = 1000 + 5; int arr[M 展开全文
头像 coder+9
发表于 2021-10-30 17:51:28
2021.10.30 出差错题目 一直在排查mod n的问题,最终还是用朴素方法 位置是1 - n 不是 0 到 n-1 不能用mod运算 比如1+4modn 就坏了 其次是局部变量 maxtime 要在第二层循环时进行初始化,不让还是上一轮结果。 #include<cmath> 展开全文