思维
夕伤夜残
Stay hungry,Stay foolish.
展开
专栏收录文章
- 默认排序
- 最新发布
- 最早发布
- 最多阅读
- 最少阅读
-
2019-2020 ICPC North-Western Russia Regional Contest H题(High Load Database)
High Load Database #include<bits/stdc++.h> using namespace std; const int N=1e6+100; int ans[N],sum[N],size[N],mx=-1e9; int n,T,v,k; int solve(int k){ if(k<mx) return -1; if(ans[k]) ...原创 2019-11-17 11:56:03 · 608 阅读 · 0 评论 -
Educational Codeforces Round 76 D. Yet Another Monster Killing Problem (思维题)
Educational Codeforces Round 76 #include <bits/stdc++.h> using namespace std; const int N=2e5+10; int n,m,a[N],b[N]; int main() { ios::sync_with_stdio(false); int tc; cin >> tc; ...原创 2019-11-14 22:47:10 · 217 阅读 · 0 评论 -
LightOJ1245(思维)
思路简单但有几个细节要注意一下。 法1. #include <iostream> #include <cstdio> #include <algorithm> #include <cstring> #include <cmath> using namespace std; typedef long long ll; int main(...原创 2019-05-07 20:06:37 · 210 阅读 · 0 评论 -
2019河北省大学生程序设计竞赛(部分题解)
2019河北省大学生程序设计竞赛(补题) B.Icebound and Sequence 当时一看题面想着用欧拉降幂做(其实不用这样做,因为幂不是一个大整数,貌似算欧拉函数还更耗时间),做半天也做不出,因为不知道在模运算下怎么处理等比数列分母。 赛后听别人说是个模板题,思想类似快速幂(还是题目做少了QAQ) 题目分析在这里:等比数列二分求和 //B解法1 #include <iostre...原创 2019-06-02 10:42:06 · 1498 阅读 · 0 评论 -
记录01串所有连续'1'段的位置(开始和结尾)
再刷思维题时经常碰到这样的问题。这里提供一种记录方法 #include<bits/stdc++.h> #include<vector> using namespace std; string s; vector<pair<int,int>>ve; int main(){ cin>>s; int len= s.size(); fo...原创 2019-09-27 15:29:21 · 442 阅读 · 0 评论
分享