zoukankan      html  css  js  c++  java
  • URAL 2073 Log Files (模拟)

    题意:给定 n 场比赛让你把名称,时间,比赛情况按要求输出。

    析:很简单么,按照要求输出就好,注意如果曾经AC的题再交错了,结果也是AC的。

    代码如下:

    #pragma comment(linker, "/STACK:1024000000,1024000000")
    #include <cstdio>
    #include <string>
    #include <cstdlib>
    #include <cmath>
    #include <iostream>
    #include <cstring>
    #include <set>
    #include <queue>
    #include <algorithm>
    #include <vector>
    #include <map>
    #include <cctype>
    #include <cmath>
    #include <stack>
    #include <sstream>
    #include <list>
    #include <assert.h>
    #include <bitset>
    #include <numeric>
    #define debug() puts("++++")
    #define gcd(a, b) __gcd(a, b)
    #define lson l,m,rt<<1
    #define rson m+1,r,rt<<1|1
    #define fi first
    #define se second
    #define pb push_back
    #define sqr(x) ((x)*(x))
    #define ms(a,b) memset(a, b, sizeof a)
    #define sz size()
    #define pu push_up
    #define pd push_down
    #define cl clear()
    //#define all 1,n,1
    #define FOR(i,x,n)  for(int i = (x); i < (n); ++i)
    #define freopenr freopen("in.txt", "r", stdin)
    #define freopenw freopen("out.txt", "w", stdout)
    using namespace std;
    
    typedef long long LL;
    typedef unsigned long long ULL;
    typedef pair<int, int> P;
    const int INF = 0x3f3f3f3f;
    const LL LNF = 1e17;
    const double inf = 1e20;
    const double PI = acos(-1.0);
    const double eps = 1e-8;
    const int maxn = 100 + 10;
    const int maxm = 3e5 + 10;
    const LL mod = 1e9 + 7LL;
    const int dr[] = {-1, 1, 0, 0, 1, 1, -1, -1};
    const int dc[] = {0, 0, 1, -1, 1, -1, 1, -1};
    const char *de[] = {"0000", "0001", "0010", "0011", "0100", "0101", "0110", "0111", "1000", "1001", "1010", "1011", "1100", "1101", "1110", "1111"};
    int n, m;
    const int mon[] = {0, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};
    const int monn[] = {0, 31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};
    inline bool is_in(int r, int c) {
      return r >= 0 && r < n && c >= 0 && c < m;
    }
    
    char s[maxn];
    char ans[maxn];
    
    int main(){
      int T;
      while(scanf("%d", &T) == 1){
        puts("+------------------------------+--------+-------------+");
        puts("|Contest name                  |Date    |ABCDEFGHIJKLM|");
        puts("+------------------------------+--------+-------------+");
        getchar();
        while(T--){
          gets(s);  printf("|%-30s", s);
          gets(s);  printf("|%s|", s);
          scanf("%d %d", &n, &m);
          getchar();
          for(int i = 0; i < n; ++i)  ans[i] = '.';
          for(int i = n; i < 13; ++i)  ans[i] = ' ';
          while(m--){
            gets(s);
            if(s[2] == 'A')  ans[s[0]-'A'] = 'o';
            else if(ans[s[0]-'A'] != 'o') ans[s[0]-'A'] = 'x';
          }
          printf("%s|
    ", ans);
          puts("+------------------------------+--------+-------------+");
        }
      }
      return 0;
    }
    

      

      

  • 相关阅读:
    redis主从之过期key判断
    PHP之回调、匿名函数
    调试printf,fprintf (转)
    第一天,来报道
    hdu 4464 browsing history
    腾讯编程马拉松2012第一题
    今天面试悲剧了,看来面试前看考题是很关键的.
    JQuery访问WebService(可访问Java[Xfire])
    自己留备份,不解释.
    MYSQL UNION AND UNION ALL 的区别!
  • 原文地址:https://www.cnblogs.com/dwtfukgv/p/5796820.html
Copyright © 2011-2022 走看看