涂抹果酱 题目分析:这道题跟上一道题有点像,不过这题有三种,所以想到三进制,而不是二进制了,然后把1,2,3化成0,1,2;然后,相应的比较部分换一下就好了 AC_Code: 1 #include <bits/stdc++.h> 2 using namespace std; 3 typedef lo ...
分类:
其他好文 时间:
2020-07-10 21:04:16
阅读次数:
77
hdu3625 第一类Stirling数 组合数学 计数 简单的习题 ...
分类:
其他好文 时间:
2020-07-10 17:02:16
阅读次数:
58
先求一下lca,之后比较一下给定两点的lca与所求点的关系后分类讨论 #include<bits/stdc++.h> using namespace std; typedef long long ll; const int N=2e5+10; int h[N],ne[N],e[N],idx; int ...
分类:
其他好文 时间:
2020-07-09 23:58:04
阅读次数:
88
今天是小学期的最后一天,我终于完成了小学期的第个程序题,并且借用今天的程序代码使我懂得了更多关于链表的知识,今日的问题是关于约瑟夫问题的求解,我的代码如下:#include<iostream>using namespace std;typedef struct node{ int data; str ...
分类:
其他好文 时间:
2020-07-09 22:36:41
阅读次数:
77
今天是小学期的最后一天题目是约瑟夫问题的求解,代码如下:#include<iostream>using namespace std;typedef struct node{ int data; struct node* next;};node* create(){ int n; node* head ...
分类:
其他好文 时间:
2020-07-09 22:15:59
阅读次数:
86
2020年7月9日: 今天是小学期的最后一天,我终于完成了小学期的第个程序题,并且借用今天的程序代码使我懂得了更多关于链表的知识,今日的问题是关于约瑟夫问题的求解,我的代码如下: #include<iostream>using namespace std;typedef struct node{ i ...
分类:
其他好文 时间:
2020-07-09 22:14:17
阅读次数:
89
#include <stdio.h> typedef enum {FALSE, TRUE} Boolean; Boolean isEven(int i) { if ( i % 2 == 0 ) return TRUE; else return FALSE; } int main() { int i ...
分类:
编程语言 时间:
2020-07-09 20:58:12
阅读次数:
73
#pragma once #include <windows.h> #include <dbghelp.h> #pragma comment(lib, "dbghelp.lib") typedef void(__stdcall *PF_CallBack)(const char* msg); clas ...
分类:
编程语言 时间:
2020-07-09 19:40:17
阅读次数:
84
因为题目已知至少要k-2个 假设我们取了k个,使得答案最大 那么因为对于每个数来说至少k-2个数在这位是1 因此我们只要任意选三个数,都能保证在每一位上都有至少一个数为1 #include<bits/stdc++.h> using namespace std; typedef long long l ...
分类:
其他好文 时间:
2020-07-09 15:12:45
阅读次数:
67
最短路模型 #include<cstring> #include<iostream> #include<algorithm> using namespace std; typedef pair<int,int> PII; const int N = 110; int n,m; int g[N][N] ...