//
// main.c
// shuzu_gongyushu
//
// Created by jereh123 on 15/7/22.
// Copyright (c) 2015年 jerehedu. All rights reserved.
//#include
//最大公约数
int getMaxCommonDivisor(int num1,int num2);...
分类:
编程语言 时间:
2015-07-22 13:14:42
阅读次数:
101
如果包含非系统提供的头文件并且你可以修改这个头文件,你做好要添加extern “C” {…} 逻辑块在这个头文件中,以便使用者可以#include包含在他们的C++代码中很好地使用它们。C编译器不能失败extern “C” {…},所以使用宏定义__cplusplus,这样C编译器就不能看到给部分代码。
语法结构#ifdef __cplusplus
extern "C" {
#endif
// 添...
分类:
其他好文 时间:
2015-07-22 13:08:00
阅读次数:
99
// 集训终于开始了,来到水题先
#include
#include
#include
#include
using namespace std;
int a[23];
int d[23][100000];
int flag[23];
int W,n;
void init(){
cin >> n;
for (int i=1;i...
分类:
其他好文 时间:
2015-07-22 13:06:05
阅读次数:
135
给出长度为n的字符串,m个操作。
每个操作有三个值 l,r,op。
op==1,表示将字符串中[ l ,r ]的部分按照升序排列。
op==0,表示将字符串中[ l ,r ]的部分按照降序排列。
输出最终的字符串
按小写字母建26颗线段树
对于每次修改,先记录[l,r]区间内各个字母出现的次数,并对相应区间清空,然后按照升序或者降序从新更新
#include "std...
分类:
编程语言 时间:
2015-07-22 13:02:42
阅读次数:
168
我的老项目是vs2010下的项目。最近安装vs2013后,打开sln解决方案,调试运行报错C:\Program Files (x86)\Windows Kits\8.0\Include\um\winsdkver.h(21): fatal error C1083: 无法打开包括文件:“winapifa...
分类:
Windows程序 时间:
2015-07-22 12:56:19
阅读次数:
4787
不断枚举除数即可,水的很,注意判断循环条件。具体代码如下:#include#includeusing namespace std;int main() { int n, t = 0; while (scanf("%d", &n) && n) { if (t++) printf("\n"); bool...
分类:
其他好文 时间:
2015-07-22 12:47:45
阅读次数:
108
需要注意的是这个题不仅有边权还有点权,起点和终点的点权不算。思路还是一样,只是把路过的点的点权也加上再松弛即可。另外,距离相等的时候需要判断一下,选择字典序小的链连到这个点,方法就是把这个点以及之前的点放到栈里比较。 1 #include 2 #include 3 #include 4...
分类:
其他好文 时间:
2015-07-22 12:44:40
阅读次数:
86
最长公共子序列#include#include#include#includeusing namespace std;const int maxn=1111;int dp[maxn][maxn];char s[maxn],t[maxn];int lens,lent;int main(){ in...
分类:
其他好文 时间:
2015-07-22 12:31:44
阅读次数:
74
我们有下面的测试代码: 1 #include 2 using namespace std; 3 4 5 int main() 6 { 7 int num1=7; 8 cout>2: ">2)>1: ">1)>2: ">2)<<endl;14 return 0;15 }对...
分类:
其他好文 时间:
2015-07-22 12:26:53
阅读次数:
147
Problem : 1698 ( Just a Hook ) Judge Status : Accepted Language : G++ Author : dayang#include#include#include#define MID(a,b) ((a + b) >> 1)#d...
分类:
其他好文 时间:
2015-07-22 12:23:02
阅读次数:
87