NO.7 ABC276E是道很有趣但是又有点恼人的题...初看就很简单,但是感觉好像也不是很好判断...然后想了半天,一直在bfs和dfs之间纠结,最后发现了一种比较好维护的bfs方法。因为其实如果能形成回路,那么一定存在一个一进一出,所以可以考虑先把出发点四周的四个临近的点标上不同的号,然后进行bfs,如果发现有两个...
后来逼迫自己冷静下来,又在草稿纸上画了几下,思路便逐渐清晰,于是便改对了。 到了赛点的后三题后,我其实刚刚松一口气,看到 E 题又自闭了,毕竟概率题上次就栽过,是ABC342F,这次又看到,心里一紧,只好先尝试 F 题。 F 题读完题后没多久就想到了 dfs,然而实现中还是有一些小错误,如for循环里更新i的话,它实...
abc143 E - Travel by Car Floyd-Warshall arc001 B - リモコン BFS abc123 D - Cake 123 Heap abc137 D - Summer Vacation Heap abc141 D - Powerful Discount Tickets Heap past202004-open F - タスクの消化 Heap past202004-open L - 辞書順最小 Heap abc052 C - Factors of Factorial 素因数...
Search or jump to... Search code, repositories, users, issues, pull requests... Provide feedback We read every piece of feedback, and take your input very seriously. Include my email address so I can be contacted Cancel Submit feedback Saved searches Use saved searches to filter your...
W)brute which fits into the time limit pretty easily. foriin[1,H]:forjin[1,W]:if(i,j)isnotcovered:tryto place thenexttilewithits top left corner at(i,j)
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 enter, print Bad; otherwise, print Good. ...
abc出现次数的最大值和最小值相差不超过1 代码 #include <bits/stdc++.h> #define fi first #define se second #define pii pair<int,int> #define pdi pair<db,int> #define mp make_pair #define pb push_back #define enter putchar('\n') #define space putchar(' ') #define eps 1e-8 #...
https://atcoder.jp/contests/abc143/tasks/abc143_e 双关键字dijkstradijkstra https://atcoder.jp/contests/abc143/tasks/abc143_f 双指针,从大到小求解,求解每次拿ii个时,将出现次数小于等于ii的看做随意放置的填充物,出现次数大于ii的每种每次拿一个。
Problem Statement The window of Takahashi's room has a width of A. There are two curtains hung over the window, each of which has a horizontal length of B. (Vertically, the curtains are long enough to cover the whole window.) We will close the window so as to minimize the total horiz...
abc111 abc112 abc113 abc114 abc115 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 abc...