题解:AtCoder Beginner Contest 189 C - Mandarin Orange 提供一种不一样的 O(nlogn)O(nlogn) 的方法。 设对于第 ii 个位置,左边第一个大于它的位置记为 LiLi ,右边第一个大于它的位置记为 RiRi。 发现对于第 ii 个位置的值作为 xx 时的最优解即为 (Ri−Li−1)×vali(Ri−Li−1)×...
每瓶酒的容量和浓度为vi和pi,摄入x的时候喝醉。依次喝下每瓶酒,问是否喝醉/第几杯醉。模拟一下即可,注意用浮点数的时候有精度误差。 C-Mandarin Orange 柱形图最大矩形面积,按理说应该是一个单调栈的板子题,但是数据量小,据说可以O(n2)过。 D-Logical Expression 给定N个逻辑与和逻辑或运算,问有2N+1种取值...
AtCoder Beginner Contest 189 Personal Editorial 第一次参加 AtCoder 的比赛,感觉还挺简单。 比赛链接:https://atcoder.jp/contests/abc189 A - Slot // Author : RioTian // Time : 21/01/23 #include <bits/stdc++.h> using namespace std; typedef long long ll; const int N = 1e5 + 10; in...
1、今晚(5月17日)20点在B站开始 AtCoder 初学者竞赛 353 比赛题解直播讲解 2、本周日(5月19日)晚上19点在B站开始 AtCoder Beginner Contest 354的题解直播讲解 3、观看方式: 复制下方链接或直接扫描二维码,PC端建议使用chrome浏览器 https://live.bilibili.com/21371611?live_from=84002 或识别下方二维码查看:...
We will hold AtCoder Beginner Contest 199(Sponsored by Panasonic). ,satashunYoshikaMiyafuji Rated range: ~ 1999 The point values will be 100-200-300-400-500-600. We are looking forward to your participation! If any of the vertices of a component have degree 3 or higher so our total answ...
代码 #include<bits/stdc++.h>usingnamespacestd;//#define int long longstructnode{intx,y;};vector<node>v1;vector<node>v2;vector<node>v3;vector<node>v4;vector<node>v5;boolcmp(nodei,nodej){if(i.x==j.x){returni.y<j.y;}else{returni.x<j.x;}}boolcheck(vector<node>vv1,vector<nod...
AtCoder Beginner Contest 402(A-F详细题解) A 思路:我们直接输出字符串中的大写字母即可。 代码:#include<bits/stdc++.h> using namespace std; #define int long long #define N 500010 signed main(){ string s;cin>>… 秋日薄雾 Win10+MinGw编译可被Python调用的dll库 最近在项目中碰到...
AtCoder Beginner Contest 169(题解) AtCoder Beginner Contest 169(题解)E - Count Median结论题给定nnn个xi∈[ai,bi]x_i\in[a_i,b_i]xi∈[ai,bi],求中位数的个数。定义:k=⌊n2⌋k=\lfloor\dfrac{n}{2}\rfloork=⌊2n⌋,对a,ba,ba,b进行排序后,为ak+1a_{k+1}ak...
比赛链接:https://atcoder.jp/contests/abc196 官方题解:https://atcoder.jp/contests/abc196/editorial 赛中过题情况 A. Difference Max 题意: , ,求 的最大值。 题解: #include<bits/stdc++.h>//code by cjj490168650usingnamespacestd;inta,b,c,d;intmain(){cin>>a>>b>>c>>d;cout<<b-c;...
This is the approach I implemented during the contest. Of course, I'm (mostly--I actually did do this during the contest) joking, and I'll now describe the solution I assume was intended. The basic idea is that there are two cases to deal with. First, two points form a diameter of...