HomeVolumesContestsSectionsForumsUsersPrintHelpAbout

Contests > "Informatics Stars" Online Contests - 2011-2014 > problem:


2012-11-30. 50656 - Divisibility by 11

"Informatics Stars" Online Contests - 2011-2014

Start: Oct.20.2012 at 10:00:00 AM
Finish: Oct.20.2012 at 03:00:00 PM
The contest is finished!
• Contest scoreboard

Guest
• Review clarifications (2)

Contest problems

• 2012-02-7. 50704 - Connected?
• 2012-02-8. 50596 - Your Ride Is He...
• 2012-02-8. 50596 - Your Ride Is He...
• 2012-03-01. 50563 - Long Modulus
• 2012-03-02. 50567 - Input Data No...
• 2012-03-04. 50597 - Drawing Diam...
• 2012-10-02. 50555 - Frequency of L...
• 2012-10-04. 50598 - Minimum Sum
• 2012-11-30. 50656 - Divisibility...
• 2012-11-40. 50558 - Biggest Barn
• 2012-12-10. 50546 - Average Fuel P...
• 2012-12-20. 50574 - Triangular Nu...
• 2012-12-30. 50684 - Sum of prime ...
• 2013-01-10. 50584 - Total invoice ...
• 2013-01-30. 50599 - Sum of Squar...
• 2013-03-20. 50578 - Mersenne prime
• 2013-03-30. 50360 - National Elections

Feedback

If you notice incorrect translations in Contester, please let author know.

Time limit 2000/4000/4000/4000 ms. Memory limit 65000/65000/65000/65000 Kb.
Prepared by Ibrahim Mesecan.

Divisibility by 11

Shqip

A number is divisible by 11, if the difference between sum of odds digits and sum of even digits is 0 or a multiple of 11.
For example:
     34871903 (The number)
     3+8+1+0=12 (sum of odd digits)
     4+7+9+3=23 (sum of even digits)
     23-12=11 (the difference)
  The number is divisible by 11.
  Write a program that reads a number up to 1000 digits and finds out if the number is divisible by 11 or not.

Input specification
The first digit is non zero digit and the number has upto 1000 digits in one line ending with a semicolon (;)

Output specification
Say "YES" if the number is divisible by 11, "NO" otherwise.

Sample Input I     
5940;    

Sample Output I
YES
Sample Input II
10000000000000000000001;

Sample Output II
NO

Для отправки решений необходимо выполнить вход.

www.contester.ru