Print the maximum possible area of the rectangle. If no rectangle can be formed, print0. 题意:选出四个点能组成矩形,且面积最大 解法:选4个一样的点或者是选两个出现两次以上的最大数字 1#include<bits/stdc++.h>2usingnamespacestd;3map<int,int>Mp,mp,ap;4intn;5longlongA[123456];6intans;...
题目链接http://abc071.contest.atcoder.jp/ ABC都水题。 C题因为数据比较大,不知道为什么用long long 有点问题,赛后发现是x,y用的是int 相乘会溢出了。比赛的时候用的是大数乘法。 A题代码: 1#include<iostream>2#include<stdio.h>3#include<algorithm>4#include<string.h>5#include<math.h>6usingnames...
AtCoder Beginner Contest 071 D - Coloring Dominoes Problem Statement We have a board with a2×Ngrid. Snuke covered the board withNdominoes without overlaps. Here, a domino can cover a1×2or2×1square. Then, Snuke decided to paint these dominoes using three colors: red, cyan and green. Tw...
AtCoder Beginner Contest 071 (CD) C - Make a Rectangle 思路:排序后 m a p map map统计即可。 D - Coloring Dominoes 思路:考虑只有两种排列方式。 从左到右进行乘法原理计算。 先考虑最左边,若为方式1,则有 3 3 3种,否则有 6 6 6种。 接下来有4种情况: 1. 1 → 2 1.\ 1\rightarrow2 1....
·AtCoder Beginner Contest (ABC) 这是最频繁且最简单的入门赛,通常情况下每月至少举行2次。2019年4月27日(含)之前,每场比赛共4题,时长100分钟,满分1000分且Rating超过1199的选手不计Rating值。自2019年5月19日起改版升级为6道题目,时长不变,满分2100分且Rating值超过1999的选手不计Rating值。改版之后比赛质量...
for(int i=1;i<=n;i++) { dt[i]=aa[i]; yl[aa[i]]=i; } //先添 for(int i=1;i<=n;i++) { for(int j=i+1;j<=n;j++) { if(bj[i][j]==1 and bjj[dt[i]][dt[j]]==0 and bjj[dt[j]][dt[i]]==0)
先将a_i出现次数记录到sum[a_i]中。从大到小递推可得sum[i]=sum[i+1]+i*sum[i] 代码: #include <bits/stdc++.h> using namespace std; typedef long long LL; const int N = 1e6 + 10; int main() { int n; cin >> n; vector<ll> sum(N), a(n); for (int i = 0; i < n...
AtCoder Beginner Contest 151的数学推导难不难? 组合数在AtCoder Beginner Contest 151中怎么运用? AtCoder Beginner Contest 151有哪些数论相关的题? 思路统计最大值出现的次数,和最小值出现的次数。虽然是每次都是MAX-MIN,我们先求MAX的和,然后再求MIN的和,做差。 这次代码写的真的很漂亮 题目地址: 代码语言...
最近总感觉有点惆怅,打完之后一直在发懵也没马上写题解,不知道在干嘛qwq A.Tomorrow 模拟即可。 inlinevoidqfl_zzz(){ll m=read(),d=read();ll Y=read(),M=read(),D=read();++D;if(D>d)++M,D=1;if(M>m)++Y,M=1;writet(Y),writet(M),writen(D);} ...
Atcoder Beginner Contest 079 C题目链接:C - Train Ticket 题意:你现在有(a,b,c,d)四个数字,你想通过在(a,b)、(b,c)、(c,d)之间添加(+)或(-)(必须添加),是这四个数的运算结果为7,保证有解,求这个式子(如有多个,输出其中一个即可)。 题解:一道十分明显的暴搜题,只需要二进制枚举一下就可以...