参考代码:
#include<bits/stdc.h>
using namespace std;
typedef long long ll;
int array[100005], t[100005]; //array记录每个元素值,t记录取余k,各余数对应前缀和的数量 int main()
{ios::sync_with_stdio(false); ll sum 0, c…
参考代码:
#include<bits/stdc.h>
#define INF 0x3f3f3f3f
using namespace std;
typedef long long ll;
int cost[2005]; //记录每个作物杂交所需要的时间
int dis[2005]; //记录每个作物到t点的最短时间 struct node{ //结构体存储每种杂交方案 int a…
参考代码:
#include<bits/stdc.h>
#define INF 0x3f3f3f3f
using namespace std;
typedef long long ll;
ll cnt 0;
int a[100005], b[100005], c[100005];int main()
{ios::sync_with_stdio(false); int n;cin >> n;for(int i 0; i < n; i)cin…