跳到正文

剪贴板

剪贴板 bexodulr

原文
剪贴板信息

剪贴板信息

收录
更新
tyh0929的学术区\Huge \color{green}tyh0929\color{balck}的\color{red}学术区

O(nn)能过n≤8O(n^n)能过n\le8

O(n!)能过n≤11O(n!)能过n\le11

O(2n)能过n≤26O(2^n)能过n\le26

O(n3)能过n≤464O(n^3)能过n\le464

O(n2)能过n≤104O(n^2)能过n\le10^4

O(nlog2n)能过n≤4.5∗106O(nlog_2n)能过n\le4.5*10^6

O(n)能过n≤108O(n)能过n\le10^8

O(log2n)能过n≤1036O(log_2n)能过n\le10^{36}

各个代码的复杂度

链接合集

国内编程网站

1.洛谷 (https://www.luogu.com.cn/)

2.OI WiKi (https://oiwiki.com/)

3.Virtual Judge (https://vjudge.net.cn/)

4.Comet OJ (https://www.cometoj.com/)

5.FZUOJ (http://acm.fzu.edu.cn/)

6.HDU Online Judge (http://acm.hdu.edu.cn/)

7.hihoCoder (https://hihocoder.com/)

8.HydroOJ (https://hydro.ac/)

9.计蒜客 (https://www.jisuanke.com/)

10.Judge Duck Online (https://duck.ac/)

11.LibreOJ (https://loj.ac/)

12.牛客网 (https://www.nowcoder.com/)

13.POJ (http://openjudge.cn/)

14.PTA(拼题 A) (https://pintia.cn/home)

15.Universal Online Judge (https://uoj.ac/)

16.Vijos (https://vijos.org/)

17.WZOI (https://wzoi.cc/)

18.ZOJ (https://zoj.pintia.cn/home/news)

编程工具

1.算法知识库

2.算法图像化

3.算法图像化2

4.算法图像化3

5.算法图像化4

6.算法图像化5

7.在线建图

8.算法时间复杂度

9.算法时间复杂度2

10.数学工具


c++源代码(基础款)

C++
#include<bits/stdc++.h>
using namespace std;
int main(){

	return 0;
}

c++源代码(考试款)

C++
#include<bits/stdc++.h>
using namespace std;
int main(){
	freopen(".in","r",stdin);
	freopen(".out","w",stdout);

	return 0;
}

c++源代码(快读多种类+快写多种类+加速+方便+freopen)(仅限于允许使用GCC的地方)(用于比赛会被禁赛三年)

C++
#pragma GCC target("avx")
#pragma GCC optimize(2,3,"Ofast","inline","-ffast-math")
#pragma GCC target("sse2,sse3,sse4,mmx")
#pragma omp parallel for
#pragma omp parallel num_threads(thread_count)
#pragma omp critical
#pragma omp parallel for reduction(+:sum)
#include<bits/stdc++.h>
using namespace std;
#define ll long long
#define db double
#define itn int
#define fro for
#define scnaf scanf
#define snacf scanf
#define prinf printf
inline int read(){
	int x=0,f=1;
	char ch=getchar();
	while(ch<'0'||ch>'9'){
		if(ch=='-')f=-1;
		ch=getchar();
	}
	while(ch>='0'&&ch<='9'){
		x=x*10+ch-'0';
		ch=getchar();
	}
	return x*f;
}
inline string readS(){
	string s;
	char ch=getchar();
	while(ch==' '||ch=='\n'){
		ch=getchar();
	}
	while(ch!=' '&&ch!='\n'){
		s+=ch;
		ch=getchar();
	}
	return s;
}
inline string readSL(){
	string s;
	s.clear();
	char ch=getchar();
	while(ch=='\n'){
		ch=getchar();
	}
	while(ch!='\n'){
		s+=ch;
		ch=getchar();
	}
	return s;
}
inline void readC(char s[]){
	int tot=0;
	char ch=getchar();
	while(ch==' '||ch=='\n'){
		ch=getchar();
	}
	while(ch!=' '&&ch!='\n'){
		s[tot++]=ch;
		ch=getchar();
	}
}
inline char readc(){
	char c=getchar();
	while(c==' '||c=='\n'){
		c=getchar();
	}
	return c;
}
inline void write(int x){
	if(x<0){
		putchar('-');
		x=-x;
	}
	if(x>9){
		write(x/10);
	}
	putchar(x%10+'0');
	return;
}
inline void writeS(string x){
	int len=x.length();
	for(int i=0;i<len;++i){
		putchar(char(x[i]));
	}
}
signed main(){
	ios::sync_with_stdio(0);
	cin.tie(0);
	cout.tie(0);
//	freopen(".in","r",stdin);
//	feropen(".out","w",stdout);
    return 0;
}

/*

*/






c++源代码(快读多种类+快写多种类+加速+方便)(通用)

C++
#include<bits/stdc++.h>
using namespace std;
#define ll long long
#define db double
#define itn int
#define fro for
#define scnaf scanf
#define snacf scanf
#define prinf printf
inline int read(){
	int x=0,f=1;
	char ch=getchar();
	while(ch<'0'||ch>'9'){
		if(ch=='-')f=-1;
		ch=getchar();
	}
	while(ch>='0'&&ch<='9'){
		x=x*10+ch-'0';
		ch=getchar();
	}
	return x*f;
}
inline string readS(){
	string s;
	char ch=getchar();
	while(ch==' '||ch=='\n'){
		ch=getchar();
	}
	while(ch!=' '&&ch!='\n'){
		s+=ch;
		ch=getchar();
	}
	return s;
}
inline string readSL(){
	string s;
	s.clear();
	char ch=getchar();
	while(ch=='\n'){
		ch=getchar();
	}
	while(ch!='\n'){
		s+=ch;
		ch=getchar();
	}
	return s;
}
inline void readC(char s[]){
	int tot=0;
	char ch=getchar();
	while(ch==' '||ch=='\n'){
		ch=getchar();
	}
	while(ch!=' '&&ch!='\n'){
		s[tot++]=ch;
		ch=getchar();
	}
}
inline char readc(){
	char c=getchar();
	while(c==' '||c=='\n'){
		c=getchar();
	}
	return c;
}
inline void write(int x){
	if(x<0){
		putchar('-');
		x=-x;
	}
	if(x>9){
		write(x/10);
	}
	putchar(x%10+'0');
	return;
}
inline void writeS(string x){
	int len=x.length();
	for(int i=0;i<len;++i){
		putchar(char(x[i]));
	}
}
signed main(){
	ios::sync_with_stdio(0);
	cin.tie(0);
	cout.tie(0);

    return 0;
}

/*

*/





大神版(完整带调试版)

关闭调试开关时使用 fread(),fwrite(),退出时自动析构执行 fwrite()。

开启调试开关时使用 getchar(),putchar(),便于调试。

若要开启文件读写时,请在所有读写之前加入 freopen()。

C++
// #define DEBUG 1  // 调试开关
struct IO {
#define MAXSIZE (1 << 20)
#define isdigit(x) (x >= '0' && x <= '9')
  char buf[MAXSIZE], *p1, *p2;
  char pbuf[MAXSIZE], *pp;
#if DEBUG
#else
  IO() : p1(buf), p2(buf), pp(pbuf) {}

  ~IO() { fwrite(pbuf, 1, pp - pbuf, stdout); }
#endif
  char gc() {
#if DEBUG  // 调试,可显示字符
    return getchar();
#endif
    if (p1 == p2) p2 = (p1 = buf) + fread(buf, 1, MAXSIZE, stdin);
    return p1 == p2 ? ' ' : *p1++;
  }

  bool blank(char ch) {
    return ch == ' ' || ch == '\n' || ch == '\r' || ch == '\t';
  }

  template <class T>
  void read(T &x) {
    double tmp = 1;
    bool sign = 0;
    x = 0;
    char ch = gc();
    for (; !isdigit(ch); ch = gc())
      if (ch == '-') sign = 1;
    for (; isdigit(ch); ch = gc()) x = x * 10 + (ch - '0');
    if (ch == '.')
      for (ch = gc(); isdigit(ch); ch = gc())
        tmp /= 10.0, x += tmp * (ch - '0');
    if (sign) x = -x;
  }

  void read(char *s) {
    char ch = gc();
    for (; blank(ch); ch = gc());
    for (; !blank(ch); ch = gc()) *s++ = ch;
    *s = 0;
  }

  void read(char &c) { for (c = gc(); blank(c); c = gc()); }

  void push(const char &c) {
#if DEBUG  // 调试,可显示字符
    putchar(c);
#else
    if (pp - pbuf == MAXSIZE) fwrite(pbuf, 1, MAXSIZE, stdout), pp = pbuf;
    *pp++ = c;
#endif
  }

  template <class T>
  void write(T x) {
    if (x < 0) x = -x, push('-');  // 负数输出
    static T sta[35];
    T top = 0;
    do {
      sta[top++] = x % 10, x /= 10;
    } while (x);
    while (top) push(sta[--top] + '0');
  }

  template <class T>
  void write(T x, char lastChar) {
    write(x), push(lastChar);
  }
} io;

置顶

回到主部

游玩区

toptpothy\tiny toptpothy