zoukankan      html  css  js  c++  java
  • poj2894

    简单题

    View Code
    #include <iostream>
    #include <cstdlib>
    #include <cstring>
    #include <cstdio>
    using namespace std;

    #define maxn 30
    #define maxl 1005

    bool f[maxn][maxl];
    int n;

    void input()
    {
    memset(f, 0, sizeof(f));
    scanf("%d", &n);
    for (int i = 0; i < n; i++)
    {
    char st[4];
    int a, b;
    scanf("%s", st);
    scanf("%d%d", &a, &b);
    for (int j = a; j < b; j++)
    f[st[0] - 'A'][j] = true;
    }
    }

    void work()
    {
    for (int i = 0; i < 1000; i++)
    {
    int x = 0;
    for (int j = 0; j < 26; j++)
    x += f[j][i];
    if (x == 0)
    continue;
    putchar('A' + x - 1);
    }
    putchar('\n');
    }

    int main()
    {
    //freopen("t.txt", "r", stdin);
    int t;
    scanf("%d", &t);
    while (t--)
    {
    input();
    work();
    }
    return 0;
    }

  • 相关阅读:
    DevOps
    DevOps
    DevOps 教程
    Java 文件
    Java 包装类
    Java HashMap
    Java 包装类
    Java 文件
    Java ArrayList
    Java 日期与时间
  • 原文地址:https://www.cnblogs.com/rainydays/p/2199944.html
Copyright © 2011-2022 走看看