반응형
[codeforces] Lucky Division
알고리즘(Python,Java)2019. 11. 29. 13:42[codeforces] Lucky Division

Petya loves lucky numbers. Everybody knows that lucky numbers are positive integers whose decimal representation contains only the lucky digits 4 and 7. For example, numbers 47, 744, 4 are lucky and 5, 17, 467 are not. Petya calls a number almost lucky if it could be evenly divided by some lucky number. Help him find out if the given number n is almost lucky. Input The single line contains an in..

[codeforces] A. Boy or Girl
알고리즘(Python,Java)2019. 11. 22. 02:26[codeforces] A. Boy or Girl

Those days, many boys use beautiful girls' photos as avatars in forums. So it is pretty hard to tell the gender of a user at the first glance. Last year, our hero went to a forum and had a nice chat with a beauty (he thought so). After that they talked very often and eventually they became a couple in the network. But yesterday, he came to see "her" in the real world and found out "she" is actua..

[codeforces] A. Beautiful Matrix
알고리즘(Python,Java)2019. 8. 26. 09:33[codeforces] A. Beautiful Matrix

problem You've got a 5 × 5 matrix, consisting of 24 zeroes and a single number one. Let's index the matrix rows by numbers from 1 to 5 from top to bottom, let's index the matrix columns by numbers from 1 to 5 from left to right. In one move, you are allowed to apply one of the two following transformations to the matrix: Swap two neighboring matrix rows, that is, rows with indexes i and i + 1 fo..

[codeforces] A. Helpful Maths
알고리즘(Python,Java)2019. 8. 24. 17:23[codeforces] A. Helpful Maths

problem Xenia the beginner mathematician is a third year student at elementary school. She is now learning the addition operation. The teacher has written down the sum of multiple numbers. Pupils should calculate the sum. To make the calculation easier, the sum only contains numbers 1, 2 and 3. Still, that isn't enough for Xenia. She is only beginning to count, so she can calculate a sum only if..

[codeforces] A. Petya and Strings
알고리즘(Python,Java)2019. 8. 22. 20:32[codeforces] A. Petya and Strings

problem Little Petya loves presents. His mum bought him two strings of the same size for his birthday. The strings consist of uppercase and lowercase Latin letters. Now Petya wants to compare those two strings lexicographically. The letters' case does not matter, that is an uppercase letter is considered equivalent to the corresponding lowercase letter. Help Petya perform the comparison. Input E..

[codeforces] A. Bit++
알고리즘(Python,Java)2019. 8. 22. 18:20[codeforces] A. Bit++

problem The classic programming language of Bitland is Bit++. This language is so peculiar and complicated. The language is that peculiar as it has exactly one variable, called x. Also, there are two operations: Operation ++ increases the value of variable x by 1. Operation -- decreases the value of variable x by 1. A statement in language Bit++ is a sequence, consisting of exactly one operation..

반응형
image