首页 > 耕种时间到!
头像 䟼䒌
发表于 2024-04-28 21:24:40
C.耕种时间到! 整个一个模拟 先不做处理计算等级为x的种子数量 然后模拟种植操作直到所有种子等级都小于x 时间复杂度O(n*log 1e9) #include<iostream> using namespace std; int n; int a[100010]; int s[1000 展开全文
头像 秃头程序员liu
发表于 2024-04-29 20:06:36
思路:反向推x可以由哪些等级的种子得到。 AC代码: ">#include<vector> #include<cstring> using namespace std; #define ll long long #define PLL pair<ll,ll> # 展开全文
头像 FoolBlade
发表于 2025-11-02 18:59:36
void solve(){ int n;cin>>n; vector<int> a(n+1); for(int i=1;i<=n;i++)cin>>a[i]; int x;cin>>x; vector< 展开全文
头像 小怪怪很酷
发表于 2024-05-09 20:35:01
#include<bits/stdc++.h> using namespace std; #define int long long #define endl '\n' signed main(){ int n; cin>>n; vector<i 展开全文
头像 奇奇莫拉qiqimora
发表于 2025-11-02 10:16:07
#include <iostream> #include <vector> #include <cmath> #include <algorithm> using namespace std; #define IOS ios::sync_with_s 展开全文
头像 PHarr
发表于 2025-11-02 13:22:14
用std::map<int,long long>维护当前种子的个数,暴力模拟即可。 虽然单词模拟复杂度是,但是因为种子的种类数每次是除 3,所以总的复杂度实际上不超过 #include <bits/stdc++.h> using namespace std; using 展开全文
头像 FZANOTFOUND
发表于 2025-11-02 16:08:15
注意到进行 轮后,所有的种子的等级会变成 。 因此模拟 轮(包括初始),统计每轮中有多少个等级为 的种子即可。 时间复杂度 。 // FZANOTFOUND #include <bits/stdc++.h> using namespace std; #define pb pus 展开全文