#include <iostream>
#include <cstdio>
#include <algorithm>
#include <string>
#include <cstring>
#include <sstream>
#include <vector>
#include <set>
#include <list>
#include <stack>
#include <queue>
#include <cmath>
#include <map>
#define LL long long
#define MOD 1000000007
#define INF 0x3f3f3f3f
using namespace std;
const int MAXN = 1e5 + 10;
一、头文件
1 #include<iostream> 2 #include<cstdio> 3 #include<algorithm> 4 #include<cstring> 5 #include<sstream> 6 #include<vector> 7 #include<stack> 8 #include<queue> 9 #include<cmath> 10 #include<map> 11 #define LL long long 12 #define N 1000100 13 #define MOD 1000000007 14 #define FOR(i,l,r) for(int i = (l);i<=l;i++) 15 #define INF 0x7fffffff 16 #define pb push_back 17 #define X first 18 #define Y second 19 using namespace std;
二、常用输入模板
1 while(scanf("%d%d",&n,&m) != EOF)
三、简化代码
FOR(i,1,n) scanf("%d",&a[i]); FOR(i,1,k){ //代码段 }