{ int n, d; cin >> n >> d; vector<int> w(n + 1); double s = 0; for (int i = 1; i <= n; i++) { cin >> w[i]; s += w[i]; } double avg = s / d; int t = 2000000; double ans = 1e18; while (t--) { int k = 1; s = 0; vector<int> b(d + 1...
A - First ABC 2 解题思路 签到 Code #include <bits/stdc++.h> using namespace std; typedef long long LL; void solve() { int n; cin >> n; string s;
A.First ABC 2模拟即可。 inlinevoidqfl_zzz(){ll n=read();string s=sread();for(ll i=1;i<=n-2;++i)if(s[i]=='A'&&s[i+1]=='B'&&s[i+2]=='C'){writen(i);return;}writen(-1);} B.Prefix and Suffix模拟即可。 inlinevoidqfl_zzz(){ll n=read(),m=read();string s=sr...
AtCoder Beginner Contest 322 Cranewilliams 天青色等烟雨,而我在等你 A - First ABC 2 c++库函数substr B - Prefix and Suffix c++库函数substr(没错,你没看错,同上) C - Festival 倒着维护一个dp值 D - Polyomino 有意思的一道模拟题 方格4*4,给足了想象空间。 我的思路很 simple 就是,枚举三个图...
【赛题讲解】【AtCoder Beginner Contest 319 讲解(一)】D-MinimumWidth二分E-Bus https://www.bilibili.com/video/BV1yj411C7Jr/ Atcoder ABC321 A-F讲解 https://www.bilibili.com/video/BV1n8411i7mn/ AtCoder Beginner Contest 322 A 至 F 題讲解 by dreamoon ...
atcoder D - AtCoder Express 2(DP + 思维) https://abc106.contest.atcoder.jp/tasks/abc106_d 真是个牛批的题 题意; 给一个长度n 编号 1-n 的数组, m个操作, 每次操作选定 [L,R] 搞一次, q个查询,每次查询问[L,R] 严格子区间内,搞了几回 。例如: 操作 [1,1] [2,2] [1,2] , ...
ABC320 ABC321 ABC322 ABC323 ABC324 ABC325 ABC326 ABC327 ABC328 ABC329 ABC330 ABC331 ABC332 ABC333 ABC334 ABC335 ABC336 ABC337 ABC338 ABC339 ABC340 A.cpp B.cpp C.cpp D.cpp E.cpp ABC341 ABC342 ABC343 ABC344 ABC345 ABC346 ABC347 ABC347_20240330 ABC348 ABC349 ABC350 ABC351 ABC...
https://atcoder.jp/contests/abc120/tasks/abc120_d) 正しくインストールされている場合、ページ下部のコードスニペットにコードが標準で埋め込まれている (atcoder-toolsの対応言語のみ) Analysis https://kyuridenamida.github.io/atcoder-tools/ 各問題ごとの解析結果などが載っています。
D 水题: 就是分析一下,当n<b时,后面那个为整体0,所以最大就是n取最大就行了, 否则就是取b-1跟取n比较一下取较大值就行了。 代码语言:javascript 代码运行次数:0 运行 AI代码解释 #include<bits/stdc++.h> #define inf 0x3f3f3f3f using namespace std; typedef long long ll; int main(){ ll...
本文最后更新于 213 天前,其中的信息可能已经有所发展或是发生改变。 A - Sequence of Strings Original Link 题目大意: 输入N个字符串,倒序输出。 思想: 签到题。 代码: 代码语言:javascript 代码运行次数:0 运行 AI代码解释 #include<iostream>#include<cstring>#include<cstdio>#include<algorithm>#include<c...