now,dep+1); if(tot[edge[i].v]>maxson) maxson=tot[edge[i].v],son[now]=edge[i].v; } return tot[now]; } void update(int k) { T[k].w=T[ls].w+T[rs].w; } void Build(int k,int ll,int rr) { T[k].l=ll;T[k].r=rr;T[k].siz=rr-ll+1; if(ll==rr) { ...
AtCoder Beginner Contest 138 https://atcoder.jp/contests/abc138 今天做的,f非常有意思,状态设计很巧妙,是限定范围内的数位dp;e还不知道为什么错,感觉思路没问题。 A - Red or Not #include <bits/stdc++.h> using namespace std; int main () { int n; string s; cin >> n >> s; if (n ...
https://img.atcoder.jp/abc138/editorial.pdf → Reply ronaldocr7 6 years ago, # | 0 can anyone please explain logic behind Question D . It will be very helpful → Reply shivanshu1333 6 years ago, # | -11 In question D, my BFS solution got AC but now it is failing ...
私がよくAtCoderでよく使う関数をまとめました。 以下、upしたファイルの一つである「general_tree.c」を元に見方を解説します。 概要 /* 二分木とは限らない一般の木構造(子がいくつかが決まってない)を記述する 問題:AtCoder ABC138-D (使用例) 入力:(上記問題の入力例1のグラフ) 4 1 ...
abc234 D - Prefix K-th Max Heap, Binary Indexed Tree chokudai_S001 J - 転倒数 Binary Indexed Tree abc185 F - Range Xor Query Binary Indexed Tree arc033 C - データ構造 Binary Indexed Tree abc035 C - オセロ 累積和, いもす法 abc014 C - AtColor 累積和, いもす法 abc138 D -...
E - Strings of Impurity 题目链接:https://atcoder.jp/contests/abc138/tasks/abc138_e Problem Statement Given are two strings s and t consisting of lowercase English letters. Determ...AtCoder Beginner Contest 136 E - Max GCD Time Limit: 2 sec / Memory Limit: 1024 MB Score : 500 points...
这个要加上,不然会有run time error的报错 输出的时候根据树枝的两端顶点进行的编号,使用python的dictionary完成对于树枝信息的高速读取和输出 python 阅读2k更新于2020-02-11 伟大不DIAO 1声望1粉丝 Done is better than perfect « 上一篇 AtCoder ContextABC 126 C Typical Stairs(经典爬楼梯问题) ...
Atcoder ABC138 A .Red or Not 一道网速题。 大于3200输出原字符串,否则就输出red。 #include<iostream> #include<cstdio> #include<cstring> #include<algorithm> using namespace std; #define LL long long int a; string ch; int main() {
problem F , need a counter example why my code fails=>https://atcoder.jp/contests/abc167/submissions/13105666 → Reply » walleeva 5 years ago, # | 0 Detail explanation and code for C D and E → Reply » siddhugzp 5 years ago, # | ← Rev. 5 +26 Solution for ...
大意是一个横列,每个点可以跳一步或者跳两步,每个格子是空地或者石头,要求每一步不能走到石头或者有人的格子上,求是否能把\(A\)移动到\(C\),\(B\)移动到\(D\),\(A < C,B < D,A < B\) 看\(A\)到\(C\)和\(B\)到\(D\)的路上有没有两个连在一起的石头,有就不合法 如果\(A\)需要...