• ACM/CF赛制getstart模板


    (包含整型变量快速读入、简易循环和连续容器的迭代器循环的宏定义、调试时的运行时间输出(编译选项应有“DEBUG”宏定义)等)

     1 /*=============================================================================================================================*/
     2 /*======================================================Code by Asm.Def========================================================*/
     3 /*=============================================================================================================================*/
     4 #include <cstdio>
     5 #include <iostream>
     6 #include <algorithm>
     7 #include <cmath>
     8 #include <cctype>
     9 #include <memory.h>
    10 #include <vector>
    11 #include <set>
    12 #include <string>
    13 #include <cstring>
    14 #include <map>
    15 #include <queue>
    16 #include <deque>
    17 #include <stack>
    18 #include <ctime>
    19 #include <iterator>
    20 #include <functional>
    21 #include <cstdlib>
    22 using namespace std;
    23 /*===================================================CONVENIENT DIFINATIONS====================================================*/
    24 #define forall(it,v) for(__typeof(v.begin()) it = v.begin();it < v.end();++it) 
    25 #define pb push_back
    26 #define REP(i,j,k) for(i = j;i <= k;++i)
    27 #define REPD(i,j,k) for(i = j;i >= k;--i)
    28 /*===========================================================TYPES=============================================================*/
    29 typedef long long LL;
    30 
    31 /*======================================================GLOBAL VARIABLES=======================================================*/
    32 
    33 /*==========================================================FUNCTIONS==========================================================*/
    34 template<typename T>
    35     void getint(T &x){
    36     char c = getchar();
    37     while(!isdigit(c)))c = getchar();
    38     x = c - '0';
    39     while(isdigit(c = getchar()))x = x * 10 + c - '0';
    40 }
    41 void work(int T){
    42     
    43 }
    44 
    45 int main(){
    46     srand((int)time(0));
    47     #ifdef DEBUG
    48     assert(freopen("test","r",stdin));
    49     #endif
    50     //--------------------------------------------------variables-----------------------------------------------------------
    51     int T,i;
    52     //-----------------------------------------------------work-------------------------------------------------------------
    53     getint(T);
    54     REP(i,1,T)work(i);
    55 
    56     //----------------------------------------------------------------------------------------------------------------------
    57     #ifdef DEBUG
    58     cout << (double)clock() / CLOCKS_PER_SEC <<endl;
    59     #endif
    60     return 0;
    61 }
    62 /*=============================================================================================================================*/
  • 相关阅读:
    我的JAVA之旅(二)初识JAVA
    ORACLE并发处理
    我的JAVA之旅(一)安装配置
    我的JAVA之旅(三) 元素语法
    改变一生的五句话
    InstallShield集成安装MSDE2000最小版本(三) fishout特许授权发布
    IS2009修改XML File 奕婷特许授权发布
    SQL Server中多个表格求出相同列和不同列(答案来自CSDN上SQL专家的回答)
    InstallShield集成安装MSDE2000最小版本(二) fishout特许授权发布
    Installshield停止操作系统进程的代码 IS6及以上版本适用
  • 原文地址:https://www.cnblogs.com/Asm-Definer/p/4005406.html
Copyright © 2020-2023  润新知