随笔分类 - cf
摘要:https://codeforces.com/contest/1272 A题 。。年轻人老想不一样的姿势。。。折腾半天直接枚举不香吗? 呸, 真香B题。。。没仔细看题 WA到自闭 C题。。题目都告诉公式 n*(n+1)/2 了, 折腾半天发现不是 2^n-1不是组合数-{n,0} 然后推出 题目给的
阅读全文
摘要:https://codeforces.com/contest/1263 enmmmmmm 手速快是真的很有优势, C题 (看了卿学姐的视频)还可以用二分查找,每次将 i (1~n) x=n/i 压入, 然后查找等于 x 的最大下标, 缩小空间 代码如下 #include <bits/stdc++.h
阅读全文
摘要:https://codeforces.com/contest/1257 A題 取個max(b-a+x, n-1) B題 儅x>3 時就可以變成任意y, 儅 n <= 3 時 討論下 C題 用數組記錄下沒個數的出現位置, 取與上一次位置的最小距離為答案 1 1 1 2 2 2 也可以, ans = 2
阅读全文
摘要:https://codeforces.com/contest/1243A題 給n個數, 問能構成最大的方形邊長,n<=1e3, 用個桶排 逆序輸出最大邊值 B1題 給兩個字符串 問只交換一次能否使兩字符串相等,直接模擬 B2題 給兩個長度為n的小寫字母字符串s t, 問能否交換兩個字符串中使得兩字符
阅读全文
摘要:https://codeforces.com/contest/1236/problem/A https://codeforces.com/contest/1236/problem/B First, we can think about putting one present in m boxs, e
阅读全文
摘要:cf遭到了 ddos 攻击, 所有三天内的所有比赛 unrated, 难受~~~ wxhtxdy(破音~~~) https://codeforces.com/contest/1223/problem/A 观察以后会发现 n 为奇数时可以变成 1 + x = n-x (x=(n-1)/2) 输出1 ,
阅读全文
摘要:https://codeforces.com/contest/1220/problem/A Input 4 ezor Input Output 0 Output https://codeforces.com/contest/1220/problem/B 注意溢出, 精度问题 https://code
阅读全文
摘要:https://codeforces.com/contest/1228/problem/A input 121 130 input output 123 output input 98766 100000 input output -1 output https://codeforces.com/c
阅读全文
摘要:https://codeforces.com/contest/1191/problem/D cf573div2a:
阅读全文
摘要:https://codeforces.com/contest/1180 A. Alex and a Rhombus 找规律,不难发现 a[i] = a[i-1]+4*(i-1) 或者 a[n] = 2*n*n-2*n+1 #include<bits/stdc++.h> using namespace
阅读全文
摘要:977A - Wrong Subtraction http://codeforces.com/contest/977/problem/A 简单题 题意如果尾数为0 除10 否则-1 977B - Two-gram http://codeforces.com/contest/977/problem/B
阅读全文

浙公网安备 33010602011771号