VK Cup 2017 Round 3 + Codeforces Round #412
A 讀題題
B 就是你排名第p,得了x分,而最終至少需要y分,你需要最少的successful hack,使得最終得分s>=y,且由s隨機取25個數,使p被選中。
(1)暴力枚舉hack成功幾次,失敗幾次就好了
(2)另解:枚舉盡可能小的s,使|s-x|=0(mod 50),分類討論
If s?≤?x, we need 0 successful hacks, since we can just make (x?-?s)?/?50 unsuccessful hacks.
If s?>?x and s?-?x is divisible by 100, we need exactly (s?-?x)?/?100 successful hacks.
If s?>?x and s?-?x is not divisible by 100, we need (s?-?x?+?50)?/?100 successful hacks and one unsuccessful hack.
C 一看到題就打了exgcd,調了一晚上,各種看錯,最後發現爆long long了。。
其實列個不等式解就好了
VK Cup 2017 Round 3 + Codeforces Round #412
相關推薦
VK Cup 2017 Round 3 + Codeforces Round #412
for not 暴力枚舉 exgcd sin round ack success 分類討論 A 讀題題 B 就是你排名第p,得了x分,而最終至少需要y分,你需要最少的successful hack,使得最終得分s>=y,且由s隨機取25個數,使p被選中。 (1)暴力枚
Codeforces Round #412 (rated, Div. 2, base on VK Cup 2017 Round 3) B. T-Shirt Hunt
seconds ack ble pseudo lose tinc += repeat ac代碼 B. T-Shirt Hunt time limit per test2 seconds memory limit per test256 megabytes inputsta
Codeforces Round #412 (rated, Div. 2, base on VK Cup 2017 Round 3) E. Prairie Partition 二分+貪心
必須 could col clas == show with str ati E. Prairie Partition It can be shown that any positive integer x can be uniquely re
Codeforces Round #424 (Div. 2, rated, based on VK Cup Finals) Problem F (Codeforces 831F) - 數論 - 暴力
push_back pla ota round problem ont first push note Vladimir wants to modernize partitions in his office. To make the offic
VK CUP 2017 CString Reconstruction
def base pre putchar size 區間 bsp const can Codeforces Round #423 (Div. 2, rated, based on VK Cup Finals) 從給出信息片段,得出字典序最小的一個字符串,題目保證答案存在 信
Codeforces Round #477 (rated, Div. 2, based on VK Cup 2018 Round 3) C. Stairs and Elevators【二分查找】
section wal cstring describe test mathjax tar include max In the year of 30XX30XX participants of some world programming champi
Codeforces Round #423 (Div. 2, rated, based on VK Cup Finals) Problem A - B
initial index 技術 ble continue efi whole ret rem Pronlem A In a small restaurant there are a tables for one person and b tables for t
Codeforces Round #423 (Div. 2, rated, based on VK Cup Finals) B. Black Square
con style its als name lac 思路 amp include 題意:問是否可以形成一個全黑正方形 思路:可以找出正方形的邊,然後判斷下這個矩陣是否容得下,n,m都比邊短,比賽的時候寫麻煩了,還去找了這個正方形究竟在哪個位置,這樣的話得考慮很多情況,不如
Codeforces Round #423 (Div. 2, rated, based on VK Cup Finals) C. String Reconstruction
題意 一個 () max 字典序 log class its 位置 題意:給出各個字符串出現的起始位置,問整個的字符串是什麽,(字典序最小) 思路:開始寫的是用set+優先隊列存取每個位置出現的最長字符串,然後遍歷,爆內存。。。爆。。。內。。。存。。。我們可以用並查集,已經
Codeforces Round #424 (Div. 2, rated, based on VK Cup Finals)
std amp tin keys art div codeforce 小寫 pan D題fst了,生無可戀。第二場rated的CF,打得精神恍惚 A. Unimodal Array 題意:判斷數列是否是單峰的。 像題意那樣分為三個階段隨便判一判就好了 #in
Codeforces Round #423 (Div. 2, rated, based on VK Cup Finals) E DNA Evolution
一段 har 字符串 n) str end space col span DNA Evolution 題目讓我們聯想到樹狀數組或者線段樹,但是如果像普通那樣子統計一段的和,空間會爆炸。 所以我們想怎樣可以表示一段區間的字符串。 學習一發大佬的解法。 開一個C[10][10]
Codeforces Round #423 (Div. 2, rated, based on VK Cup Finals) E. DNA Evolution 樹狀數組
數組 start let ted posit printf stat output limit E. DNA Evolution time limit per test 2 seconds memory limit per test
Codeforces Round #424 (Div. 2, rated, based on VK Cup Finals) Cards Sorting(樹狀數組)
property void example ++ ger imu sorting 一次 base Cards Sorting time limit per test 1 second memory limit per test 256 megabytes input
Codeforces Round #472 (rated, Div. 2, based on VK Cup 2018 Round 2)
com 要求 double href etc eve war urn ring A. Tritonic Iridescence 題解:分類討論。註意題目要求,至少有兩種方案。 1 #pragma warning(disable:4996) 2 #include<
Codeforces Round #393 (Div. 2) (8VC Venture Cup 2017 - Final Round Div. 2 Edition) D - Travel Card
second 隊列 In code ref %d mod nbsp using D - Travel Card 思路:dp,類似於單調隊列優化。 其實可以寫的更簡單。。。 #include<bits/stdc++.h> #define LL long
Codeforces Round #393 (Div. 2) (8VC Venture Cup 2017 - Final Round Div. 2 Edition) E - Nikita and stack 線段樹好題
long long 但是 make div 計算 space its void lse http://codeforces.com/contest/760/problem/E 題目大意:現在對棧有m個操作,但是順序是亂的,現在每輸入一個操作要求你輸出當前的棧頂, 註意,
Codeforces Round #505 (rated, Div. 1 + Div. 2, based on VK Cup 2018 Final) -B C(GCD,最長連續交替序列)
all clas 拼接 true 序列 -s light scan inf B. Weakened Common Divisor time limit per test 1.5 seconds memory limit per test 256 mega
E - Down or Right Codeforces Round #504 (rated, Div. 1 + Div. 2, based on VK Cup 2018 Final)
its rcm base long long std ont return down fflush http://codeforces.com/contest/1023/problem/E 交互題 1 #include <cstdio> 2 #inc
Codeforces Round #504 (rated, Div. 1 + Div. 2, based on VK Cup 2018 Final) D. Array Restoration
ring amp val ons urn pos cup eof oid 從最大的數開始討論 如果最大的數中間有斷開的地方,那麽就需要從0裏面選,把他填上 需要使用樹狀數組 #include <iostream> #include <cstdio>
Codeforces Round #504 (rated, Div. 1 + Div. 2, based on VK Cup 2018 Final) E. Down or Right
ans 距離 bit ++i flush string 多條 codeforce names 從(1,1,n,n)每次只變一個坐標,進行詢問。 如果問到對角線有距離限制, 再從(1,1,n/2,n/2)詢問到(n/2,n/2,n,n) 記住前半部分貪心忘上走,後本部分貪心往