Solve AtCoder Beginner Contest 151 in java

AtCoder Beginner Contest 151 Thank you for your hard work! Official page

The code I wrote this time is here I will explain briefly below.

Problem A

Problem printing the next alphabet of the input string. I knew that the char of java would be the next char when incremented, so I wrote it as it is.

Problem B

The question is how many points should be given to reach the target point given the test points. All you have to do is add the test scores in order and subtract from the target score.

Please note that you may not be able to reach the target point even if you try hard, or you may have already reached it.

Problem C

I personally had a little bone. A question that counts the number of correct questions and the number of penalties given the question number and ʻAC or WA`.

Note that the penalty number applies only to the correct question. (This was once incorrect.)

Problem D

Untouched

Problem E

The problem of selecting a specific number from a combination of numbers and adding the difference between the maximum and minimum values by the number of combinations. It was TLE without the idea of finding the maximum and minimum values separately.

After the contest, I changed to ask for the maximum value and the minimum value separately, but I gave up because I entered the labyrinth as WA without TLE being fixed. I learned that there is an idea to find the maximum value and the minimum value separately, so I'm going to say Yoshi. (I wonder if the calculation method of the binomial coefficient is slow ...)

(Added on 2020/01/16) I got advice in the comment section, corrected it and became AC!

Problem F

The problem is to find the radius of the smallest circle that contains a certain number of points. I halved the maximum length of all points, but that wasn't enough consideration.

Since the number of points was 50, I should have noticed that the amount of calculation could be expanded a little ... sorry.


Unfortunately, the rating has dropped for the first time this time. Up until now, I've been trying with a round waist, but I'm thinking of starting to learn theory little by little. ..

Recommended Posts

Solve AtCoder Beginner Contest 151 in java
Solve AtCoder Beginner Contest 150 in java
Solve AtCoder Beginner Contest 153 in java
Solve AtCoder Beginner Contest 175 in java
Solve AtCoder Beginner Contest 160 in java
Solve AtCoder Beginner Contest 152 in java
Solve AtCoder Beginner Contest 156 in java
AtCoder Beginner Contest 168
AtCoder Beginner Contest 167 C Problem (Java)
AtCoder Beginner Contest 132 D Problem
java beginner 4
java beginner 3
java beginner
AtCoder dwango Programming Contest B in Ruby, Perl and Java
AtCoder ARC 081 C hash to solve in Ruby, Perl and Java
Try to solve Project Euler in Java
Partization in Java
Changes in Java 11
Sorting AtCoder ABC 111 C hashes to solve in Ruby, Perl and Java
Rock-paper-scissors in Java
Java Beginner Exercises
Pi in Java
FizzBuzz in Java
Java Exercise "Beginner"
AtCoder Beginner Contest 169 A, B, C with ruby
Basics of threads and Callable in Java [Beginner]
[AtCoder Problem-ABC001] C-Do wind observation in Java [Code]
How to solve an Expression Problem in Java
[Beginner] Install java development tool in cloud9 development environment.
A story about a super beginner participating in the AtCoder contest for the first time (AtCoder Beginner Contest 140)
[java] sort in list
Read JSON in Java
Interpreter implementation in Java
Make Blackjack in Java
Rock-paper-scissors app in Java
Constraint programming in Java
Put java8 in centos7
NVL-ish guy in Java
Combine arrays in Java
"Hello World" in Java
Callable Interface in Java
It's late! Try implementing Android Notification in Java (Beginner)
Comments in Java source
Azure functions in java
Format XML in Java
AtCoder Beginner Contest 170 A, B, C up to ruby
Simple htmlspecialchars in Java
Boyer-Moore implementation in Java
Hello World in Java
Use OpenCV in Java
webApi memorandum in java
Type determination in Java
Ping commands in Java
Various threads in java
Heapsort implementation (in java)
Zabbix API in Java
ASCII art in Java
Compare Lists in Java
POST JSON in Java
Express failure in Java
Try to solve a restricted FizzBuzz problem in Java