• 【比赛】AISing Programming Contest 2019


    题意/题解

    A Bulletin Board

    • 题意:给你一个 (n imes n) 的空位, 给你一个 (h imes w) 的物品,问有多少种方法把物品完全放在空位中,(h) 只能作为高
    • 题解:答案是 ((n - h + 1) imes (n - w + 1))

    B Contests

    • 题意:给你一串正整数,然后分为是哪个部分小于等于 (A) 的,大于 (A) 小于等于 (B) 的以及大于 (B) 的。问你能从中选出几组,每一组都是由三部分中的各一个组成,选过的不能再选
    • 题解:答案就是三部分中最小的那个的数量。

    C Alternating Path

    • 题意:咕咕咕
    • 题解:咕咕咕

    D Nearest Card Game

    • 题意:咕咕咕
    • 题解:咕咕咕

    E Attack to a Tree

    • 题意:咕咕咕
    • 题解:咕咕咕

    代码

    A Bulletin Board

    #include <cstdio>
    #include <cstring>
    #include <string>
    #include <iostream>
    #include <algorithm>
    
    int n, h, w;
    
    int main() {
    	scanf("%d %d %d", &n, &h, &w);
    	printf("%d
    ", (n - h + 1) * (n - w + 1));
    	return 0;
    }
    

    B Contests

    #include <cstdio>
    #include <cstring>
    #include <string>
    #include <iostream>
    #include <algorithm>
    
    int n, a, b, num1, num2;
    
    int min(int a, int b) { return a < b ? a : b; }
    
    int main() {
    	scanf("%d %d %d", &n, &a, &b);
    	for (int i = 1, x; i <= n; ++i) {
    		scanf("%d", &x);
    		if (x <= a) ++num1;
    		if (x > a && x <= b) ++num2;
    	}
    	printf("%d
    ", min(num1, min(num2, n - num1 - num2)));
    	return 0;
    }
    

    战况:

    AC 了 A 和 B 之后就去看 C,没思路看了 D、E,都没思路回头想 C 一个半小时没想出来/kk

    反思:

    • 太菜了。
    • 做这个比赛是为了明天的 AISing Programming Contest 2020,先了解一下大体的难度,看这个样子明天做出三题以上才会提交不然多半掉分
  • 相关阅读:
    PyTorch之前向传播函数自动调用forward
    pytorch 调用forward 的具体流程
    Xcode5下使用纯代码构建简单的HelloWorld程序
    浅谈iOS 5的StoryBoard
    iOS单例
    instancetype 对比 id 的好处
    JSP的7个动作指令
    IOS UIView子类UIScrollView
    XCODE4.6从零开始添加视图
    NSSet类型 以及与NSArray区别
  • 原文地址:https://www.cnblogs.com/poi-bolg-poi/p/13281196.html
Copyright © 2020-2023  润新知