#include <bits/stdc++.h> using namespace std; using i64 = long long; const int maxn = 5e5 + 10; int dp[30]; bool ok[30][30], vis[30]; char s[maxn], t[maxn]; int main() { #ifndef ONLINE_JUDGE freopen("in.txt", "r", stdin); freopen("out.txt", "w", stdout);...
(v.begin(), v.end()); // 按分数降序排 map<string, int> cnt; vector<int> ans(n); int cur = 0; for (int i = 0; i < n; i++) { if (cnt[v[i].ut] < minn) // v[i]所属大学的名额还有 { cur++; cnt[v[i].ut]++; } ans[v[i].id] = cur; } for...
A. Gambling on Choosing Regionals 一个显然的贪心:最坏排名就是你去哪高手去哪,只用考虑最小赛站。 #include<bits/stdc++.h>#define int long longusingstd::cin;usingstd::cout;usingstd::vector;usingstd::string;usingstd::endl;structteam{intx,id;stringname;friendoperator<(teamA,teamB){returnA.x...
The 2024 ICPC Asia EC Regionals Online Contest (II) 目录 写在前面 F 签到 A 枚举 J 贪心 I 构造,二进制 L 数学,三分 G 数学,辗转相除 E 结论,最短路 C 字符串,kmp,结论 写在最后写在前面补题地址:https://codeforces.com/gym/105358。以下按个人向难度排序。
我们发现我们可以用前缀和计算1 - i的区间贡献,我们单循环扫一遍即可。但是一个左右端点都不确定的区间的贡献是不是s[r] - s[l - 1]呢?显然因为有环的存在,是不对的。加入有这样一个区间111000111,其实实际上有6个1连续,贡献为3,但是我们可能会把贡献算成2 + 2。因此不对的,差分算区间一定要保证两端都...
The 2021 ICPC Asia Regionals Online Contest (II) G Limit(300分) Description Given\(2n\)integers,\(a_1,a_2 ,…,a_n ,b_1 ,b_2 ,…,b_n\), and an integer t. You need to calculate: \(lim _{x→0}\frac{∑_{i=1}^na_i⋅ln(1+b_i⋅x)}{x^t}\). ...
Just a few hours ago, The 2021 ICPC Asia Regionals Online Contest (I) was held onhttps://pintia.cn/. This contest(and the next on 26th) will determine the WHOLE Asia-East Division‘s quota. And how fantastic(according to some coaches) of these problems in this online contest? I uploa...
【ICPC 2021网络赛2】The 2021 ICPC Asia Regionals Online Contest (II)签到题5题,M.Addition题意:给出n,接下来三行,每行n位二进制数,分别表示符号sgn{-1,1}和a{0,1},b{0,1}。令c=a+b(a和sgn每位相乘得到数a),最后将c拆成每一位输出。思路:暴力把va和vb算出来,得
Just a few hours ago, The 2021 ICPC Asia Regionals Online Contest (I) was held on https://pintia.cn/. This contest(and the next on 26th) will determine the WHOLE Asia-East Division‘s quota. And how fantastic(according to some coaches) of these problems in this online contest? I upl...
The 2021 ICPC Asia Regionals Online Contest (II) H.Set随机。hljs #include <bits/stdc++.h> using namespace std; int main(int argc, char *argv[]) { ios::sync_with_stdio(false), cin.tie(0), cout.tie(0); int k, r; cin >> k >> r; vector<int> T; int cnt1 = (512 - 1...