08 2015 档案
摘要:https://leetcode.com/problems/bitwise-and-of-numbers-range/[n,m]区间的合取总值就是n,m对齐后前面一段相同的数位的值比如5:1017:111结果就是4:100class Solution {public: int rangeBit...
阅读全文
摘要:https://leetcode.com/problems/longest-substring-without-repeating-characters/思路:从某点结束所能取到的最早开头是到目前出现倒数第二次的字符的最末位置后一位如图:(S代表起点,T代表终点)abcabcab**S*T假设现在在...
阅读全文
摘要:https://leetcode.com/problems/add-two-numbers/You are given two linked lists representing two non-negative numbers. The digits are stored in reverse o...
阅读全文
摘要:https://leetcode.com/problems/nth-highest-salary/ATTENTION:limit 子句只能接受int常量,不能接受运算式CREATE FUNCTION getNthHighestSalary(N INT) RETURNS INTBEGINSET N =...
阅读全文
摘要:https://leetcode.com/problems/second-highest-salary/Write a SQL query to get the second highest salary from theEmployeetable.+----+--------+| Id | Sal...
阅读全文
摘要:https://leetcode.com/problems/combine-two-tables/Combine Two TablesTable: Person+-------------+---------+| Column Name | Type |+-------------+-----...
阅读全文
摘要:https://leetcode.com/problems/two-sum/class Solution {public: vector twoSum(vector& nums, int target) { vector index(2,0); vector n2;...
阅读全文
摘要:https://leetcode.com/problems/length-of-last-word/int lengthOfLastWord(char* s) { int ans = 0; int fans = 0; for(int i = 0;s[i];i++){ ...
阅读全文
摘要:https://leetcode.com/problems/excel-sheet-column-number/class Solution {public: int titleToNumber(string s) { int ans = 0; for(int i ...
阅读全文
摘要:https://leetcode.com/problems/min-stack/#include #include #include #include using namespace std;class MinStack {public: vector vec; priority_que...
阅读全文
摘要:1.pycharm 自动换行,显示行号,缩进向导在代码右侧右键2.自动注释/取消注释 ctrl + /
阅读全文
摘要:http://poj.org/problem?id=3020 1 #include 2 #include 3 #include 4 using namespace std; 5 char maz[62][62]; 6 int e[500][500]; 7 int d[4][2]={0,1,0,...
阅读全文
摘要:http://poj.org/problem?id=3041#include #include #include using namespace std;int e[1004][1004];bool vis[1004];vector G[1004];int n,m;int dfs(int s){ ...
阅读全文
摘要:http://poj.org/problem?id=1094#include #include #include using namespace std;int in[27],out[27];char index[27];bool vis[27];int mem[27][27];int n,m;in...
阅读全文
摘要:http://poj.org/problem?id=2240用log化乘法为加法找正圈c++ 110ms,g++tle#include #include #include #include #include #include using namespace std;const int maxn = ...
阅读全文
摘要:http://poj.org/problem?id=1125#include #include using namespace std;int d[101][101];// dag ATTENTIONint num[101];//the number of contractsint edge[101...
阅读全文
摘要:http://poj.org/problem?id=2253#include #include #include #include using namespace std;queue que;int co[202][2];double d[202][202],u[202][202];int n;i...
阅读全文
摘要:http://poj.org/problem?id=1062#include #include #include using namespace std;int m,n;struct adjlist{ int c[101],t[101];}a[101];int d[101],tm[101],l...
阅读全文
摘要:http://poj.org/problem?id=1860#include //#include //#include #include using namespace std;#define MAXM 202#define MAXN 101int n,m;int first[MAXN];int ...
阅读全文
摘要:#define ONLINE_JUDGE#include#include #include using namespace std;int A,B,sx,sy;char maz[101][101];int vis[101][101];const int dx[4]={0,1,0,-1};const ...
阅读全文
摘要:http://poj.org/problem?id=2632#include#include #include using namespace std;int A,B,n,m;int robot[101][3];char rbuff[10];int dir[255];const int dx[4]=...
阅读全文
摘要:http://poj.org/problem?id=1068#include#include using namespace std;int ind[45];bool used[45];int r[21];int l[21];int len,n,llen;int w[21];int main(){ ...
阅读全文
摘要:Tail-f NCS 作为网络配置程序和基础设备之间的接口,能够展现各种服务,修改各开发商不相同的设备配置,同时能及时同步网络设备状态到cdb(configuration database,配置数据库),还能够提供rest,python,netconf,java等apiNCS包括两个层次,一个是设备...
阅读全文
摘要:http://poj.org/problem?id=1328思路:1.肯定y大于d的情况下答案为-1,其他时候必定有非负整数解2.x,y同时考虑是较为麻烦的,想办法消掉y,用d^2-y^2获得圆心允许范围,问题转化为在许多圆心允许范围内取尽可能少的点,也即在许多线段上取尽可能少的点,使得所有线段上都...
阅读全文
摘要:http://poj.org/problem?id=3094 1 #include 2 #include 3 using namespace std; 4 int main() 5 { 6 string str; 7 getline(cin,str); 8 while(st...
阅读全文
摘要:import os,sys,django;sys.path.append("\\path\\to\\mysite")#ATTETION!,Err: "unable to configure filter 'special'django.core.exceptions.ImproperlyConfig...
阅读全文