CCF 模拟2-1 夏令营
发布日期:2021-05-12 21:27:08 浏览次数:10 分类:精选文章

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

        #include 
#include
#include
#include
#include
#include
#include
#define ll long long #define PII pair
#define MSI map
#define TLE ios::sync_with_stdio(0), cin.tie(0) #define mod 1000000007 const int INF = 0x3f3f3f3f; using namespace std; bool idx[105] = { 0 }; int main() { int n; cin >> n; while (n--) { int p; cin >> p; int t = p, t_j = 0, flag = 0; for (int i = 1; i <= 100; i += 5) { t = p; for (int j = i; j < i + 5; j++) { if (idx[j] == 0) { t--; if (t == 0) { t_j = j; // break; } } else { t = p; } } if (t == 0) { for (int j = t_j - p + 1; j <= t_j; j++) { cout << j << " "; idx[j] = 1; } cout << endl; flag = 1; break; } } if (flag == 0) { for (int i = 1; i <= 100; i++) { if (p == 0) break; if (idx[i] == 0) { cout << i << " "; idx[i] = 1; p--; } } cout << endl; } } }

���������������������������

  • ������������������������div������
  • ������������������C++������������
  • ���������������������������
  • ���������������������������
  • ���������������������������������
  • ������������������������������
  • ���������������������������������
  • ������������������������������������������
  • ���������������������������
  • ��������������� ������������������������������������������
  • ���������������������������������������������������������������������������������������������������������������������������������������������������������

    上一篇:CCF 模拟2-2 导医护士
    下一篇:CCF 模拟2-3 找呀找呀找朋友

    发表评论

    最新留言

    逛到本站,mark一下
    [***.202.152.39]2025年04月05日 05时19分59秒

    关于作者

        喝酒易醉,品茶养心,人生如梦,品茶悟道,何以解忧?唯有杜康!
    -- 愿君每日到此一游!

    推荐文章

    解决TomCat中文乱码和InteliJ IDEA中文乱码问题 2021-05-13
    pyhon中安装win32com模块 2021-05-13
    C++错误笔记 2021-05-13
    解决 MySQL 8.0 客户端连接 caching_sha2_password 问题 2021-05-13
    GZIP压缩和解压缩不删除原始文件 2021-05-13
    【无线通信模块】GPRS DTU不稳定和容易掉线原因 2021-05-13
    CSS(六)|页面布局之定位 2021-05-13
    比特币(BSV)知识库:身份-BSVAlias 2021-05-13
    比特币(BSV)知识库:网络-比特币测试用区块链(Bitcoin Test Blockchains) 2021-05-13
    设计模式 - 2) 策略模式 2021-05-13
    SpringBoot使用RedisTemplate简单操作Redis的五种数据类型 2021-05-13
    国标流媒体服务器以ROOT身份运行提示“permission denide”报错解决 2021-05-13
    国标流媒体服务器在linux系统运行提示fork/exec ……/redis/redis-server错误解决方案 2021-05-13
    国标GB28181协议视频推流平台EasyGBD在Linux下编译报“UINT64_C在此作用领域中尚未声明”错误 2021-05-13
    视频流媒体服务器RTSP拉流、RTMP推流流媒体服务器授权方案之加密机运行后无法授权问题解决 2021-05-13
    安防摄像机网页无插件直播方案EasyNVR关于接口调用出现401 Unauthorized问题的解决方法 2021-05-13
    如何在农业或大棚内布置互联网安防监控系统实现智慧农业? 2021-05-13
    【视频教程】EasyNVR如何将老版本的EasyNVR的数据迁移到4.0.0以上版本 2021-05-13
    LeetCode 872 叶子相似的树[DFS 二叉树] HERODING的LeetCode之路 2021-05-13
    qt中转到槽后如何取消信号与槽关联 2021-05-13