博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
日常模板
阅读量:6082 次
发布时间:2019-06-20

本文共 5258 字,大约阅读时间需要 17 分钟。

简洁版

#include
#define Pair pair
#define MP(x, y) make_pair(x, y)#define fi first#define se second//#define int long long #define LL long long #define Fin(x) {freopen(#x".in","r",stdin);}#define Fout(x) {freopen(#x".out","w",stdout);}using namespace std;const int MAXN = 1e6 + 10, mod = 1e9 + 7, INF = 1e9 + 10;const double eps = 1e-9;template
inline bool chmin(A &a, B b){if(a > b) {a = b; return 1;} return 0;}template
inline bool chmax(A &a, B b){if(a < b) {a = b; return 1;} return 0;}template
inline LL add(A x, B y) {if(x + y < 0) return x + y + mod; return x + y >= mod ? x + y - mod : x + y;}template
inline void add2(A &x, B y) {if(x + y < 0) x = x + y + mod; else x = (x + y >= mod ? x + y - mod : x + y);}template
inline LL mul(A x, B y) {return 1ll * x * y % mod;}template
inline void mul2(A &x, B y) {x = (1ll * x * y % mod + mod) % mod;}template
inline void debug(A a){cout << a << '\n';}template
inline LL sqr(A x){return 1ll * x * x;}inline int read() { char c = getchar(); int x = 0, f = 1; while(c < '0' || c > '9') {if(c == '-') f = -1; c = getchar();} while(c >= '0' && c <= '9') x = x * 10 + c - '0', c = getchar(); return x * f;}signed main() { return 0;}/*7-1 160 -200014 82 61 85 41 10 34*/

完整版

/**/#include
//#include
/*#include
#include
#include
#include
#include
#include
#include
#include
#include
*///#include
//#include
#define Pair pair
#define MP(x, y) make_pair(x, y)#define fi first#define se second//#define int long long #define LL long long #define ull unsigned long long #define rg register #define pt(x) printf("%d ", x);#define Fin(x) {freopen(#x".in","r",stdin);}#define Fout(x) {freopen(#x".out","w",stdout);}//#define getchar() (p1 == p2 && (p2 = (p1 = buf) + fread(buf, 1, 1<<22, stdin), p1 == p2) ? EOF : *p1++)//char buf[(1 << 22)], *p1 = buf, *p2 = buf;//char obuf[1<<24], *O = obuf;//void print(int x) {if(x > 9) print(x / 10); *O++ = x % 10 + '0';}//#define OS *O++ = ' ';//#define fout fwrite(obuf, O-obuf, 1 , stdout);using namespace std;//using namespace __gnu_pbds;const int MAXN = 1e6 + 10, INF = 1e9 + 10, mod = 1e9 + 7;const double eps = 1e-9;inline int read() { char c = getchar(); int x = 0, f = 1; while(c < '0' || c > '9') {if(c == '-') f = -1; c = getchar();} while(c >= '0' && c <= '9') x = x * 10 + c - '0', c = getchar(); return x * f;}struct InputOutputStream { enum { SIZE = 1000001 }; char ibuf[SIZE], *s, *t, obuf[SIZE], *oh; InputOutputStream() : s(), t(), oh(obuf) {} ~InputOutputStream() { fwrite(obuf, 1, oh - obuf, stdout); } inline char read() { if (s == t) t = (s = ibuf) + fread(ibuf, 1, SIZE, stdin); return s == t ? -1 : *s++; } template
inline InputOutputStream &operator>>(T &x) { static char c; static bool iosig; for (c = read(), iosig = false; !isdigit(c); c = read()) { if (c == -1) return *this; iosig |= c == '-'; } for (x = 0; isdigit(c); c = read()) x = x * 10 + (c ^ '0'); if (iosig) x = -x; return *this; } inline void print(char c) { if (oh == obuf + SIZE) { fwrite(obuf, 1, SIZE, stdout); oh = obuf; } *oh++ = c; } template
inline void print(T x) { static int buf[23], cnt; if (x != 0) { if (x < 0) print('-'), x = -x; for (cnt = 0; x; x /= 10) buf[++cnt] = x % 10 | 48; while (cnt) print((char)buf[cnt--]); } else print('0'); } template
inline InputOutputStream &operator<<(const T &x) { print(x); return *this; }} io;main() { return 0;}/**/
#include
#include
#include
#include
#include
using namespace std;#define problem "a" //输出文件名 #define prename "a" //更改之前的文件名 char ak[1000];int cases = 10;//数据组数 int mode = 1;//造数据 / 重新编号 int getrand() { return (rand() << 15) + rand() + 1;}long long getlong() { return ((long long)getrand() << 31) + getrand();}const int MAXN = 1e5 + 10;#define int long long#define ch(x, y) (test >= x && test <= y)void make_data(int test) { int N, K, A, B, Lim; A = getrand() % Lim, B = getrand() % Lim; if(ch(1, 4)) Lim = 1e3; else if(ch(5, 6)) Lim = 1e7; else Lim = 1e13; N = rand() % Lim + 1, K = rand() % Lim + 1; if(test == 4) N = 1e13, K = 1; cout << N << " " << K << " " << A << " " << B;}#undef int main() { //srand(time(0)); for (int a = 1; a <= cases; a++) { fprintf(stderr, "%d\n", a); if (mode == 1) { sprintf(ak, problem "%d.in", a); freopen(ak, "w", stdout); make_data(a); fclose(stdout);#ifdef unix sprintf(ak, "./" problem " < " problem "%d.in > " problem "%d.out", a, a);#else sprintf(ak, problem ".exe < " problem "%d.in > " problem "%d.out", a, a);#endif system(ak); } if (mode == 2) {#ifdef unix sprintf(ak, "mv " prename "%d.in " problem "%d.in", a, a);#else sprintf(ak, "rename " prename "%d.in " problem "%d.in", a, a);#endif system(ak);#ifdef unix sprintf(ak,"mv " prename "%d.out " problem "%d.out", a, a);#else sprintf(ak, "rename " prename "%d.out " problem "%d.out", a, a);#endif system(ak); } } return 0;}

转载地址:http://vukwa.baihongyu.com/

你可能感兴趣的文章
工作是什么
查看>>
Linux 中cpu通略
查看>>
服务器端创建账户收件箱规则--将邮件复制到指定文件夹中
查看>>
java中简单集合框架(二)
查看>>
函数返回局部变量的一些问题
查看>>
Solaris11性能监控--处理器
查看>>
内存模型
查看>>
如何快速开发网站?
查看>>
tomcat等服务器返回给页面的数字分别表示的意思!
查看>>
我的友情链接
查看>>
个人博客
查看>>
我的友情链接
查看>>
mysql 参数 innodb_flush_log_at_trx_commit
查看>>
Windows Server 2012 远程桌面,你需要具有通过远程桌面服务进行登录的权限
查看>>
Linux流量监控工具 – iftop
查看>>
【VMCloud云平台】SCCM(八)OSD(四)
查看>>
JavaTM Virtual Machine Profiler Interface (JVMPI)
查看>>
使用IKAnalyzer分词计算文章关键字并分享几个分词词典
查看>>
分布式进程管理
查看>>
Python下用List对员工信息表进行模糊匹配
查看>>