Park Lighting CodeForces - 1358A
思路:水题不解释。
代码如下:

#include<bits/stdc++.h>
#define ll long long
using namespace std;int n,m;int main()
{int t;scanf("%d",&t);while(t--){scanf("%d%d",&n,&m);ll ans=(n/2)*m+((n%2==0)?0:(m/2+((m%2==0)?0:1)));cout<<ans<<endl;}return 0;
}

Maria Breaks the Self-isolation CodeForces - 1358B
思路:排序之后,遍历就可以了。注意细节
代码如下:

#include<bits/stdc++.h>
#define ll long long
using namespace std;const int maxx=1e5+100;
int a[maxx];
int n;int main()
{int t;scanf("%d",&t);while(t--){scanf("%d",&n);for(int i=1;i<=n;i++) scanf("%d",&a[i]);sort(a+1,a+1+n);int ans=1;int cnt=1;for(int i=1;i<=n;i++){if(cnt>=a[i]) ans=cnt+1;cnt++;}cout<<ans<<endl;}return 0;
}

努力加油a啊,(o)/~

Codeforces Round #645 (Div. 2)(AB)相关推荐

  1. Codeforces Round #642 (Div. 3)(AB)

    Most Unstable Array CodeForces - 1353A 思路:最大是2*m,特判n= =1和n==2的情况. 代码如下: #include<bits/stdc++.h> ...

  2. Codeforces Round #643 (Div. 2)(AB)

    A: 思路:只有数字中出现0,那么后面就不会变动了.直接循环就可以,出现了0就退出. 代码如下: #include<bits/stdc++.h> #define ll long long ...

  3. Codeforces Round #639 (Div. 2)(AB)

    A: 思路:其实题目已经很仁至义尽了,2* 2的情况给了,如果包含一个2*2的,那么之后的再也不可能构成了.1的时候特殊判断. 代码如下: #include<bits/stdc++.h> ...

  4. Codeforces Round #249 (Div. 2) (模拟)

    Codeforces Round #249 (Div. 2) (模拟) C. Cardiogram time limit per test 1 second memory limit per test ...

  5. Codeforces Round #791 (Div. 2)(A-D)

    Codeforces Round #791 (Div. 2)(A-D) A. AvtoBus 题意: 给你 n, 问满足 4x+6y=n4x+6y=n4x+6y=n 的 x+yx+yx+y的最小值和最 ...

  6. Codeforces Round #613 (Div. 2)(B-D)

    Codeforces Round #613 (Div. 2) B -抢时间&手感生疏->(第n + 1次)被long long卡掉- C 又一次败给了常识-EC的M题也是一个关于素数的暴 ...

  7. Codeforces Round #736 (Div. 2)(B-C)

    Codeforces Round #736 (Div. 2) 花了十分钟帮朋友写了B,C就睡觉了,自己没打 B 先看上,再看左后看右 #include <iostream> #includ ...

  8. Codeforces Round #735 (Div. 2)(A-D)没有B

    Codeforces Round #735 (Div. 2) A 一道小思维题 #include <bits/stdc++.h> using namespace std; #define ...

  9. Codeforces Round #644 (Div. 3)(A-E)

    这场的A-E都是水题,就简单记录一下吧. Minimal Square CodeForces - 1360A 思路:我们令b=max(a,b),a=min(a,b). 如果b>=2*a的话,最终 ...

最新文章

  1. Awcing算法--双指针
  2. 自动化监控--zabbix-get安装使用详解
  3. 机器学习/梯度下降算法
  4. STL 里 resize 和 reserve 的区别
  5. android tag的使用方法,Android:如何使用Html.TagHandler?
  6. 几年不联系的前女友,加我就为说这……
  7. 人生价值观的培养和建立
  8. react native在static中使用this方法
  9. 笑傲江湖手3D游服务器端文件,武林大会即将拉开序幕《笑傲江湖3D手游》12月公测来袭...
  10. NMAKE makefile内容和功能(1):描述块
  11. python移动文件,将某一文件夹下的文件移至另一个文件夹下
  12. C语言:Fibonacci数列打印
  13. 酷!有人把火星车都造出来了,教程全面开源
  14. 2020年欧空局10m土地覆盖数据数据分享
  15. qt的cross comple相关
  16. win11如何开启电脑高性能模式?
  17. 使用Oracle Enterprise Manager波折记录
  18. 论文笔记 NAACL 2021|Document-level Event Extraction with Efficient End-to-end Learning of Cross-event De
  19. 指针c语言与数组,C语言指针与数组
  20. CString 判断存在中文,大小写字母及标点

热门文章

  1. 外观模式和代理模式的联系和区别_java23种设计模式-结构型模式之外观模式
  2. linux内核 mpls,将MPLS编译进linux内核中
  3. flask 模板 php,Flask四之模板
  4. python开发pandas_二、Python开发---33、pandas(1)
  5. graphpad如何检测方差齐_如何选择方差分析中“多重比较”的方法?
  6. 设置qt的QChart曲线背景色透明
  7. Android开发之将AndroidX项目改为非androidX(android.v7.support)的方法
  8. Android开发之EdittText输入0开头金额的限制算法
  9. 王小云计算机,王小云学者主页-科技工作者之家
  10. 《迷人的8051单片机》---- 1.2小元器件有大智慧