This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
\documentclass[12pt,uft8]{ctexrep} | |
% \usepackage[underscores=false,hybrid]{markdown} | |
\usepackage{amsmath,amsfonts,amsthm} | |
\usepackage{xcolor} | |
\usepackage{physics} | |
\usepackage[many,documentation]{tcolorbox} | |
\usepackage{marginnote} | |
\newcommand{\dif}{\mathop{}\!\mathrm{d}} | |
\DeclareMathOperator{\Var}{Var} | |
\DeclareMathOperator{\Cov}{Cov} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <bits/stdc++.h> | |
using namespace std; | |
#define pb push_back | |
#define eb emplace_back | |
#define all(x) x.begin(), x.end() | |
#define debug(x) cerr << #x <<": " << (x) << endl | |
//在每个函数的入口处执行一次,出口处执行一次。然后就可以快速得知是哪个地方段错误了 | |
#define DEBUG printf("Passing [%s] in LINE %d\n",__FUNCTION__,__LINE__) | |
#ifdef LOCAL |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
\documentclass[12pt]{ctexart} | |
\usepackage{amsmath,mathtools,physics} | |
\DeclareMathOperator{\maxp}{maxp} | |
\newtheorem{lemma}{引理} | |
\title{洲阁筛学习笔记} | |
\date{2018/6/25} | |
\begin{document} | |
\maketitle | |
\section{前言} | |
``洲阁筛''是求一类特殊的积性函数的前缀和的算法。 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <iostream> | |
#include <iterator> | |
#include <vector> | |
#include <algorithm> | |
int main() { | |
std::vector<int> v{ 1, 3, 10, 8, 22 }; | |
std::sort(v.begin(), v.end()); | |
std::copy(v.begin(), v.end(), std::ostream_iterator<int>(std::cout, ", ")); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <bits/stdc++.h> | |
using namespace std; | |
#define pb push_back | |
#define eb emplace_back | |
#define all(x) x.begin(), x.end() | |
#define debug(x) cerr << #x <<": " << (x) << endl | |
//在每个函数的入口处执行一次,出口处执行一次。然后就可以快速得知是哪个地方段错误了 | |
#define DEBUG printf("Passing [%s] in LINE %d\n",__FUNCTION__,__LINE__) | |
#ifdef LOCAL |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <bits/stdc++.h> | |
using namespace std; | |
#define pb push_back | |
#define eb emplace_back | |
#define all(x) x.begin(), x.end() | |
#define debug(x) cerr << #x <<": " << (x) << endl | |
//在每个函数的入口处执行一次,出口处执行一次。然后就可以快速得知是哪个地方段错误了 | |
#define DEBUG printf("Passing [%s] in LINE %d\n",__FUNCTION__,__LINE__) | |
#ifdef LOCAL |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
両替を都市 i で行う場合、kenkoooo さんが払う金額は「s から i に円による支払いで移動する際の最小金額」円と「i から t にスヌークによる支払いで移動する際の最小金額」スヌークになります。これらの和を最小化するような都市 i を求めればよいです。「 i から t にスヌークによる支払いで移動する際の最小コスト」と「 t から i にスヌークによる支払いで移動する際の最小コスト」は同じであるため、「 s から i に円による支払いで移動する際の最小金額」と「 t から i にスヌークによる支払いで移動する際の最小金額」が求まれば良いです。「s から i に円による支払いで移動する際の最小金額」を求めるために、問題を n 頂点 m 辺の重み付きグラフの問題とみなします。このとき「s から i に円による支払いで移動する際の最小金額」は「s から i への最短経路帳」になります。s から各 i への最短経路長はダイクストラ法を用いると、O((n + m) log n) 程度で求めることができます。「t から i にスヌークによる支払いで移動する際の最小金額」も同様の方法で求めることができます。 | |
When exchanging money in city i, the amount paid by kenkoooo is "the minimum amount when moving from payment by yen to s from i" yen and "the minimum amount when moving by payment by snook to i from t to snook" Become. You can find a city i that minimizes these sums. "Minimum cost when moving with payment by snook to i from t" and "Minimum cost when moving with payment by snook to t from i" are the same, so "move from s to i by payment by yen Minimum amount of money "and" Minimum price when moving by payment |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <bits/stdc++.h> | |
using namespace std; | |
#define pb push_back | |
#define eb emplace_back | |
#define all(x) x.begin(), x.end() | |
#define debug(x) cerr << #x <<": " << (x) << endl | |
//在每个函数的入口处执行一次,出口处执行一次。然后就可以快速得知是哪个地方段错误了 | |
#define DEBUG printf("Passing [%s] in LINE %d\n",__FUNCTION__,__LINE__) | |
#ifdef LOCAL |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <bits/stdc++.h> | |
using namespace std; | |
#define pb push_back | |
#define eb emplace_back | |
#define all(x) x.begin(), x.end() | |
#define debug(x) cerr << #x <<": " << (x) << endl | |
//在每个函数的入口处执行一次,出口处执行一次。然后就可以快速得知是哪个地方段错误了 | |
#define DEBUG printf("Passing [%s] in LINE %d\n",__FUNCTION__,__LINE__) | |
#ifdef LOCAL |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <bits/stdc++.h> | |
using namespace std; | |
#define pb push_back | |
#define eb emplace_back | |
#define all(x) x.begin(), x.end() | |
#define debug(x) cerr << #x <<": " << (x) << endl | |
//在每个函数的入口处执行一次,出口处执行一次。然后就可以快速得知是哪个地方段错误了 | |
#define DEBUG printf("Passing [%s] in LINE %d\n",__FUNCTION__,__LINE__) | |
#ifdef LOCAL |
OlderNewer