Solve M-SOLUTIONS Procon Open 2020 with java

M-SOLUTIONS Procon Open 2020 Thank you for your hard work! Official page

The code I wrote this time is here The result was AC up to A-D. I managed to get 4 questions AC, I struggled with problem D ...

I will explain briefly below.

Problem A

The problem of finding the condition of what grade at a specific score. You can use the if statement as it is, but if you look closely, it is separated by 200 points, so You can easily find it by dividing the score by 200 and subtracting the remainder from 10.

Problem B

Given 3 numbers, double the number within K times Red numbers <green numbers <blue numbers ... (condition *) The question of whether it can be done.

Since the number was 7 or less, I simply counted the number of operations to satisfy the condition * and compared it with K to answer.

Problem C

The problem of determining whether a test score has been raised by multiplying it by the last K times. Even though it is the most recent multiplication of K times, K-1 is common among the number of K that can be multiplied.

A × B × C × D \\
B × C × D × E

In the case of the above figure, it is OK if you compare A and E.

Problem D

Given the fluctuations in stock prices, the question of how much money can be made. I'm not sure how to solve it, but I solved it steadily because the period is 80.

--Find the minimum stock price --Buy stock price for the amount you have --Find the maximum value of the stock price --Sell off all the stocks you have

I looped that with a while statement.

Also, this was full of digits and became WA, so I changed it to long. I didn't realize that it was overwhelming.

Problem E

I didn't read the question because the correct answer rate was low ...

Problem F

The constraint of 200,000 is impossible! If it is the amount of calculation of N ^ 2, I could solve it, but ... well, it will not be in time.


Impressions

I was able to participate for the first time in a long time. .. After all it is fun. The rating has changed from 978 to 967, and I think it's coming around ... I want to recapture 1000 next time: cry:

It's a pity that the speed to the D problem was not good because the E problem was difficult.

Thank you for reading to the end!

Recommended Posts

Solve M-SOLUTIONS Procon Open 2020 with java
Install java with Homebrew
Change seats with java
Install Java with Ansible
Comfortable download with JAVA
Switch java with direnv
Download Java with Ansible
Let's scrape with Java! !!
Build Java with Wercker
Endian conversion with JAVA
Easy BDD with (Java) Spectrum?
Use Lambda Layers with Java
Java multi-project creation with Gradle
Getting Started with Java Collection
Java Config with Spring MVC
Basic Authentication with Java 11 HttpClient
Let's experiment with Java inlining
Run batch with docker-compose with Java batch
[Template] MySQL connection with Java
Rewrite Java try-catch with Optional
Install Java 7 with Homebrew (cask)
[Java] JSON communication with jackson
Java to play with Function
Try DB connection with Java
Enable Java EE with NetBeans 9
[Java] JavaConfig with Static InnerClass
Try gRPC with Java, Maven
Let's operate Excel with Java! !!
Version control Java with SDKMAN
RSA encryption / decryption with java 8
Paging PDF with Java + PDFBox.jar
Sort strings functionally with java
Object-oriented (java) with Strike Gundam
[Java] Content acquisition with HttpCliient
Java version control with jenv
Troubleshooting with Java Flight Recorder
Streamline Java testing with Spock
Connect to DB with Java
Connect to MySQL 8 with Java
Error when playing with java
Using Mapper with Java (Spring)
Java study memo 2 with Progate
Getting Started with Java Basics
Seasonal display with Java switch
Use SpatiaLite with Java / JDBC
Study Java with Progate Note 1
Compare Java 8 Optional with Swift
HTML parsing with JAVA (scraping)
Run Java VM with WebAssembly
Screen transition with swing, java
Java unit tests with Mockito