11 2014 档案
摘要:#include #include using namespace std;long long gcd(long long a, long long b) { long long r; while (r = (a % b)) { a = b; b = r; ...
阅读全文
摘要:#include #include #include #include #include using namespace std;int main() { int N, M; scanf("%d%d", &N, &M); vector nums(N); vector ...
阅读全文
摘要:#include #include #include #include using namespace std;bool mycmp(const string& a, const string& b) { string ta = a + b; string tb = b + a; ...
阅读全文
摘要:有一个两分的case出现段错误,真是没救了,估计是要写bfs的形式,可能栈溢出了#include #include #include #include #include #include using namespace std;int G[1001][1001] = {0};class Man {p...
阅读全文
摘要:#include #include #include #include using namespace std;int main() { int N,p; scanf("%d%d", &N, &p); if (N seq(N); for (int i=0; i m ...
阅读全文
摘要:题是别人出的,不按她的想法来也没办法,真心想k一顿#include #include using namespace std;const char* days[] = {"MON", "TUE", "WED", "THU", "FRI", "SAT", "SUN"};inline bool is_...
阅读全文
摘要:#include #include #include #include using namespace std;int main() { int N; double mcap, dist, davg; scanf("%lf%lf%lf%d", &mcap, &dist, &dav...
阅读全文
摘要:#include #include #include #include #include using namespace std;const char* d2cn[] = {"ling", "yi", "er", "san", "si", "wu", "liu", "qi", "ba", "jiu"...
阅读全文
摘要:#include #include #include using namespace std;int swap(vector &numpos, int va, int vb) { //printf("swap(%d at %d, %d at %d)\n", va, numpos[va], vb...
阅读全文
摘要:#include #include #include using namespace std;class MinStack2 {private: vector > mins; vector stack;public: void push(int x) { stack....
阅读全文
摘要:#include #include #include using namespace std;// 4 5 1 2// 1 2class Solution {public: int findMin(vector &num) { int len = num.size(); ...
阅读全文
摘要:又是考输入输出#include #include #include #include #include #include using namespace std;char buf[1048577];bool is_alphanumerical(char &ch) { if (ch >= '0'...
阅读全文
摘要:完全考输入输出#include #include #include #include #include #include #include using namespace std;unordered_map > idx_title;unordered_map > idx_author;unorder...
阅读全文
摘要:昨天做了一题通过率比这个高的居然没有全对,可是这题得多水相比之下#include #include #include using namespace std;const int NUM_RANGE = 10001;int tbl[NUM_RANGE];int main() { int N; ...
阅读全文
摘要:two sum题目,算是贪婪吧#include #include #include #include using namespace std;int main() { int N, M; scanf("%d%d", &N, &M); vector coins(N); ...
阅读全文
摘要:#include #include #include #include using namespace std;class Stu {public: char id[8]; char name[10]; char grade;};bool cmp_id(const Stu* a, ...
阅读全文
摘要:标准10背包#include #include #include #include using namespace std;const int ROWS = 10002;const int COLS = 102;char dp[ROWS][COLS];bool dfs(vector &coins, ...
阅读全文
摘要:#include #include #include using namespace std;int min_dist(vector &dsum, int a, int b) { if (a == b) return 0; if (a > b) { int t = a; ...
阅读全文
摘要:我觉得做人最重要的是把事情讲清楚,尤其是规则,如果法律条例不清楚,就可以寻租了#include #include #include #include using namespace std;int ensure(int n) { if (n = b) return true; retu...
阅读全文
摘要:反正知道了就是知道,不知道也想不到,很快#include #include #include using namespace std;inline void print_prime_k(long long p, long long k) { printf("%lld", p); ...
阅读全文
摘要:#include #include #include using namespace std;class Item {public: char uid[12]; char pwd[12];};char tbl[256];void init_tbl() { for (int i=0;...
阅读全文
摘要:题目意思能搞成这样我也是服了这个女人了#include #include #include #include using namespace std;int main() { int N = 0; double D = 0; scanf("%d%lf", &N, &D); v...
阅读全文
摘要:#include #include #include #include const double LO_BOUND = -1.0 + INT_MIN;const double HI_BOUND = +1.0 + INT_MAX;using namespace std;class Node {publ...
阅读全文
摘要:#include #include #include #include #include #include using namespace std;class Man {public: char id[14]; int location; int score; int loc...
阅读全文
摘要:使用DP,递推关系见代码,先使用大空间的dp数组#include #include #include using namespace std;int max(int a, int b) {return a>b?a:b;}int main() { int N, M, L, tmp; sca...
阅读全文
摘要:#include #include #include #include #include using namespace std;class Man {public: char id[10]; int talent; int virtue;};bool mycmp(const Ma...
阅读全文
摘要:#include #include using namespace std;#define COL 10#define ROW 10int tbl[ROW][COL];void print(int* tbl) { for (int i=0; i<ROW; i++) { for (...
阅读全文
摘要:#include #include using namespace std;int str2num(const char* str) { int v = 0; int i = 0; while (str[i] != '\0') { v = v * 10 + str[i...
阅读全文
摘要:#include #include using namespace std;int main() { bool tbl[256] = {0}; char line[10009]; int len = 0; char ch; while (true) { s...
阅读全文
摘要:#include #include #include #include using namespace std;void print(vector &v) { int len = v.size(); for (int i=0; i C(NC); for (int i=0; i P(...
阅读全文
摘要:#include #include class Node {public: Node* L; Node* R; int height; int data; Node(int val, Node* l = NULL, Node* r = NULL, int h = 0):...
阅读全文
摘要:#include #include #include #include using namespace std;vector* > paths;class Node {public: vector child; int weight; Node(int w = 0) : weigh...
阅读全文
摘要:#include #include using namespace std;char line[1001];char line2[2003];int syslen(char str[], int start) { int len = 1; int p = start - 1; in...
阅读全文
摘要:#include #include #include #include #include using namespace std;list::iterator group_pick(list &player, list::iterator &cur, int group_size, vector &...
阅读全文
摘要:#include #include #include using namespace std;char linea[82];char lineb[82];bool tbl[256];char cap(char ch) { if (ch >= 'a' && ch broken; cha...
阅读全文
摘要:#include #include #include #include #include #include #include #define CMB(ID1, ID2) (((ID1) adj; int dist; City(int d = INT_MAX): dist(d){}};ty...
阅读全文
摘要:#include #include using namespace std;class Stu { public: char name[12]; char id[12];};int main() { int N = 0; // because all t...
阅读全文
摘要:#include #include #include using namespace std;bool push_validate(int &pre_push, int max_push, int cur, vector& stack, int mcap) { if (pre_push >= ...
阅读全文
摘要:#include #include using namespace std;class Number {public: int a; int b; int c; Number(int _a = 0, int _b = 0, int _c = 0): a(_a), b(_b),...
阅读全文
摘要:#include #include #include using namespace std;char tbl[5] = {'S', 'H', 'C', 'D', 'J'};void shuffle(vector &card, vector &rnd) { int rlen= rnd.size...
阅读全文
摘要:#include #include #include using namespace std;char line[82];char space[82];int main() { scanf("%s", line); int len = strlen(line); int side_...
阅读全文
摘要:#include #include #include using namespace std;char tbl[] = { '0', '1', '2', '3', '4', '5', '6', '7', '8', '9', 'A',...
阅读全文