zoukankan      html  css  js  c++  java
  • 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 /*=============================================================================================================================*/
  • 相关阅读:
    poj 3277 City Horizon (线段树 扫描线 矩形面积并)
    HDU 1255 覆盖的面积 (扫描线 线段树 离散化 矩形面积并)
    Codeforces Round #260 (Div. 2)
    poj 1151 Atlantis (离散化 + 扫描线 + 线段树 矩形面积并)
    CF1237F Balanced Domino Placements
    CF954H Path Counting
    AT2395 [ARC071C] TrBBnsformBBtion
    AT2400 [ARC072B] Alice&Brown
    AT2401 [ARC072C] Alice in linear land
    [国家集训队]阿狸和桃子的游戏
  • 原文地址:https://www.cnblogs.com/Asm-Definer/p/4005406.html
Copyright © 2011-2022 走看看