Solve AtCoder Beginner Contest 150 in java

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

Unfortunately it's Unrated again ...

To commemorate the creation of my GitHub.com account, I also committed the AtCoder code I started a while ago after the contest was over. Here In addition, I will write a commentary article.

For the first time in competitive programming, I can only write about java as a language, so I use java. (Why are there so many people using Python or C in competition pros ...)

Problem A

The problem of multiplying and comparing. I don't think any explanation is necessary.

Problem B

The problem of finding out how many ABCs are in order. I didn't have to worry about the performance, so I simply picked up three and checked if they matched.

Problem C

I think there is a better way, but ... I converted the two sequences by "what number is the largest number", compared the two sequences, and multiplied each digit by the corresponding factorial value.

I can't explain it in letters very well. I think it's easier to understand if you look at the code.

Problem D

The least common multiple problem. I don't know why it's wrong!

As a basic policy --Least common multiple calculation --Output the value obtained by dividing the given m + least common multiple / 2 by the least common multiple

I did it at. However, if the sequence is 2/4/6, the answer will be 0. Because there is no such thing as "the power of 2". 2 * (p + 0.5) is not a multiple of 2, but 4 * (p + 0.5) is a multiple of 2. As you can see, all the numbers in the sequence need to be the power of two.

However, the answer is incorrect. I was struggling with this problem and ended up ... https://github.com/ko-flavor/atcoder-java/blob/master/atcoder/src/abc/abc150/MainD.java

I didn't know how much I thought about it today, so I'd like to see it again at a later date!

(Addition) I found a bug in the program and fixed it to AC.

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 182 Participation Article
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
Make Blackjack 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
Create JSON in Java