原创 gym/101149/ Of Zorcs and Axes set it->second; it = s.lower_bound( make_pair(u[

#include<bits/stdc++.h> #include <algorithm> #include <vector> #define inf 0x3f3f3f3f const int maxn = 2e5 + 5; #defin

原创 寒假訓練(2)——貪心 D - Moving Tables

題目 https://vjudge.net/contest/149236#problem/D 首先 scanf時就swap 排序 很方便 for(int j=0; j<N; j++) { scanf("%d %d",&begin

原创 寒假訓練(2)——貪心 E - Wooden Sticks

There is a pile of n wooden sticks. The length and weight of each stick ar

原创 枚舉-生成元3.5Digit generator

#include<cstdio> #include<cstring> #include<algorithm> #include<ctime> #define maxn 100005 #define mem(a,b) memset((a),

原创 gym/101149/ Right Build 有向spfa

#include<bits/stdc++.h> #include <algorithm> #include <vector> #define inf 0x3f3f3f3f const int maxn = 2e5 + 5; #defin

原创 #109D Colliders 素數篩 統計質數因子 data[j][ ++data[j][0] ] = prime[i];

#include<bits/stdc++.h> #include <algorithm> #include <vector> #define inf 0x3f3f3f3f #define maxn 100010 #define fin f

原创 數組開小了會TLE

用 double 不用 float

原创 不要62 strstr(str,s)!=NULL sprintf(str,"%d",i) itoa(i,str,10)

杭州人稱那些傻乎乎粘嗒嗒的人爲62(音:laoer)。 杭州交通管理局經常會擴充一些的士車牌照,新近出來一個好消息,以後上牌照,不再含有不吉利的數字了,這樣一來,就可以消除個別的士司機和乘客的心理障礙,更安全地服務大衆。 不吉利的數字爲所

原创 兩個元素的快排 NDU.i

#include<cstdio> #include<cstring> #include<algorithm> #include<ctime> #define maxn 26+5 using namespace std; char str[

原创 環形字符串比較-環狀序列3.6circular sequence

#include<cstdio> #include<cstring> using namespace std; const int N = 150; char s[N], ans[N], c; int t, l;

原创 gym/100812E World of Knights struct vector< pair > s;

#include <bits/stdc++.h> typedef long long ll; typedef unsigned long long ull; #define IO ios_base::sync_with_stdio(0),

原创 狀態壓縮 位運算

獲得 n 的第 i 位的數據(0還是1),判斷(n&(1<<i)),若真,爲1,假,爲0; 設置 n 的第 i 位爲1,n=(n |(1<<i));                                            

原创 gym/101086J Smooth Developer DFS遍歷各結點

#include <bits/stdc++.h> #define INF 0x7fffffff #define maxn 1001000 #define eps 1e-6 #define pi acos(-1.0) #define e 2

原创 gym/101086 M Stairway to Heaven map set string、int對應 綜合應用

#include<bits/stdc++.h> #include <iostream> #include <algorithm> typedef long long ll; typedef unsigned long long ull;

原创 G - Tian Ji -- The Horse Racing

https://vjudge.net/contest/149236#problem/G http://blog.csdn.net/lawrencesgj/article/details/8001638 dovebs:動態規劃