题意:求[a,b]与n互质的个数
思路:容斥原理的运用,提取n的素因子,先算出不与n互素的个数,容斥原理奇加偶减
#include
#include
#include
#include
#define ll long long
using namespace std;
const int MAXN = 70;
ll prime[MAXN];
ll a,b,n;
ll make(l...
分类:
其他好文 时间:
2014-07-22 23:05:55
阅读次数:
315
经常会在项目中用到 int to string
#include
#include
#include
using namespace std;
int main(void)
{
ostringstream num;
num << 123;
string str = num.str();
cout << str << endl;
return 0;
}...
分类:
编程语言 时间:
2014-07-22 23:04:54
阅读次数:
283
提交以后比赛结束了25秒,没交上,不解释其他的。
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#define INF 0x3fffffff
#include
using namespace std;
int main()
{
int t...
分类:
其他好文 时间:
2014-07-22 23:02:54
阅读次数:
211
#include #include using namespace std; struct
BTNode { int v; // default positive Integer. BTNode *pLeft; BTNode *pRight;
BTNode(int x) : v(x), pLeft(...
分类:
其他好文 时间:
2014-07-22 23:00:54
阅读次数:
294
#include #include #include #include #include
#define BUFF_LEN 1024using namespace std;long file_len(string file_name);void
init(string file_name){}voi...
分类:
其他好文 时间:
2014-07-22 23:00:54
阅读次数:
190
好奇一下。看来Object Pascal确实与Windows深入结合了。unit
Unit1;interfaceuses Windows, Messages, SysUtils, Variants, Classes, Graphics,
Controls, Forms, Dialogs, Std.....
分类:
其他好文 时间:
2014-05-02 00:02:51
阅读次数:
275
输入 1500 3150 300100 200 输出结果470 471100 200150
300470 471 #include #includeusing namespace std;struct node{ int a ; int
b;}s[100];int compare(const voi...
分类:
其他好文 时间:
2014-05-01 19:12:33
阅读次数:
358
类--构造函数【上】引言: 构造函数确保每个对象在创建时自动调用,以确保每个对象的数据成员都有合适的初始值。class Sales_item
{
public:
//其中isbn由string的默认构造函数提供初始化
Sales_item():units_sold(0),revenue(0){}
private:
std::string isbn;
unsi...
分类:
编程语言 时间:
2014-04-30 22:48:40
阅读次数:
347
实现用2dx画折线图,为以后用2dx开发应用做准备
下面记录下使用方法
auto lineView = DJLineChart::create();
std::vector vec;
vec.push_back(130);
vec.push_back(520);
vec.push_back(60);
vec.push_back(0);...
分类:
其他好文 时间:
2014-04-30 22:47:39
阅读次数:
322
#include "iostream"
using namespace std;
//class 关键字 //Circle 是类的名字
class Circle
{
int m_age;//什么都不加 默认为private;
private: //private 修饰的成员变量和成员函数,只能在类的内部使用;
double xiaosi; //私有成员属性,...
分类:
编程语言 时间:
2014-04-30 22:45:39
阅读次数:
313