Number of Amidakuji 思路:dp dp[i][j]表示经过(i, j) 这个点的方案数 然后一层一层地转移, 对于某一层, 用二进制枚举这一层的连接情况, 判断连接是否符合题意, 然后再进行转移 代码: #pragma GCC optimize(2) #pragma GCC optimize(3) #pragma GCC optimize(4) #include<bits/stdc++.h> using namespace std; #define fi first #def…
C - ID Time limit : 2sec / Memory limit : 1024MB Score: 300 points Problem Statement In Republic of Atcoder, there are N prefectures, and a total of M cities that belong to those prefectures. City i is established in year Yi and belongs to Prefecture…
A - Discount Fare Time limit : 2sec / Memory limit : 1024MB Score: 100 points Problem Statement There is a train going from Station A to Station B that costs X yen (the currency of Japan). Also, there is a bus going from Station B to Station C that c…
B - Palace Time limit : 2sec / Memory limit : 1024MB Score: 200 points Problem Statement A country decides to build a palace. In this country, the average temperature of a point at an elevation of x meters is T−x×0.006 degrees Celsius. There are N pl…
A - Happy Birthday! Time limit : 2sec / Memory limit : 1000MB Score: 100 points Problem Statement E869120's and square1001's 16-th birthday is coming soon.Takahashi from AtCoder Kingdom gave them a round cake cut into 16 equal fan-shaped pieces. E869…
A - ABC/ARC Time limit : 2sec / Memory limit : 256MB Score : 100 points Problem Statement Smeke has decided to participate in AtCoder Beginner Contest (ABC) if his current rating is less than 1200, and participate in AtCoder Regular Contest (ARC) oth…
AtCoder Beginner Contest 064 D - Insertion Problem Statement You are given a string S of length N consisting of ( and ). Your task is to insert some number of ( and ) into S to obtain a correct bracket sequence.Here, a correct bracket sequence is def…
A - ABCxxx Time limit : 2sec / Memory limit : 256MB Score : 100 points Problem Statement This contest, AtCoder Beginner Contest, is abbreviated as ABC. When we refer to a specific round of ABC, a three-digit number is appended after ABC. For example,…
人生第一场 AtCoder,纪念一下 话说年后的 AtCoder 比赛怎么这么少啊(大雾 AtCoder Beginner Contest 154 题解 A - Remaining Balls We have A balls with the string S written on each of them and B balls with the string T written on each of them. From these balls, Takahashi chooses one…
比赛链接:https://atcoder.jp/contests/abc161/tasks AtCoder Beginner Contest 161 第一次打AtCoder的比赛,因为是日本的网站终于不用倒时差了233. A - ABC Swap 可以直接按照交换后的顺序输出. #include <bits/stdc++.h> using namespace std; int main() { int a,b,c; cin>>a>>b>>c; cout<…