NO.7 ABC276E是道很有趣但是又有点恼人的题...初看就很简单,但是感觉好像也不是很好判断...然后想了半天,一直在bfs和dfs之间纠结,最后发现了一种比较好维护的bfs方法。因为其实如果能形成回路,那么一定存在一个一进一出,所以可以考虑先把出发点四周的四个临近的点标上不同的号,然后进行bfs,如果发现有两个...
https://atcoder.jp/contests/abc143/tasks/abc143_e 双关键字dijkstradijkstra https://atcoder.jp/contests/abc143/tasks/abc143_f 双指针,从大到小求解,求解每次拿ii个时,将出现次数小于等于ii的看做随意放置的填充物,出现次数大于ii的每种每次拿一个。
I actually tried implementing the same thing but I got WA x13 #include<bits/stdc++.h>usingnamespacestd;#defineintlonglongtypedeflongdoubleld;#defineall(x)x.begin(),x.end()#definepb push_backsignedmain(){strings;cin>>s;set<char>a;intn=s.size();vector<int>suffix(n);suffix[n-1]=0...
LC(23524⋅31)=2max(3,4)⋅3max(51L(23⋅35,24⋅31)=2max(3,4⋅,1). FactorizeMMand computenumi=primeexponentiinumi=primeiexponentiinMM. If someaiaidoes not divideMM, we can ignoreaiai(the exponent of some prime is bigger inaiaithan inMM). For eachaiaithat divides M, let's...
[伪上蓝名]Atcoder ABC 299 ABCDE 35分钟5题,打开通告板被告知unrate,怒关电脑,两周直接损失80分,痛失蓝名! 503 -- 24:24 App Atcoder abc 290 ABCDE(手滑点成重录了,录屏只剩E题了) 我的评价是比Qual A简单亿点点 215 -- 1:13:29 App [可惜局]Atcoder ABC 276 ABCDEF 取模每周一猜!可大惜...
ABC349\(\tiny\color{blue}1693\color{green}+67\color{black}=\color{blue}1760\) A ~ D 都比較順暢,D 題盲猜\(\text{lowbit}\)喜提機房一血,E 題沒開long long喜提一發罰時與機房一血 然後就坐著與 F & G 乾瞪眼,F 先是用 cdq 嘗試水分,後來將不是\(M\)因數的刪掉了,還是不行 ...
ABCABCDEFGHAlgorithm & Data Structure 001 --- 002 ---TriangleArea(C), BitFullSearch(D) 003 ---PIE(D) 004 --- 005 --- 006 ---LIS(D) 007 ---BFS(C) 008 ---DP(D) 124 --- 125 --- 126 --UnionFind(E) 127 --StarrySkyTree(F)...
Problem Statement The door of Snuke's laboratory is locked with a security code. The security code is a 44-digit number. We say the security code ishard to enterwhen it contains two consecutive digits that are the same. You are given the current security code SS. If SS is hard to ente...
abc116 abc117 abc118 abc119 abc120 abc121 A.cpp B.cpp C.cpp D.cpp abc122 abc123 abc124 abc125 abc126 abc127 abc128 abc129 abc130 abc131 abc132 abc133 abc134 abc135 abc136 abc137 abc138 abc139 abc140 abc141 abc142 abc143 abc144 abc145 abc146 abc147 abc148 abc149 abc150 abc...
E - Combination Lock 题解 处理成差分,对称位置的差分和为0 例如abcba 可以得到的差分是 相当于数列 0123210 111-1-1-1 而有区间加呢,相当于在前面打了一个+1,后面打了一个-1 我们把这两个位置连边 并且给所有对称位置连边 合法的情况仅当一个联通块和为0 代码 AI检测代码解析 #include <bits/stdc++...