oj mrJudge
Toggle navigation
  • Login
    • Forget Password
      Login
User Image

Hello, Stranger

Guest
  • Analysis Mode
  • Problems
    • All Problems
    • Latest Problems
  • Join Us Now
  • Registration
  • Contact Us
  • Infomation
  • About
    • Terms of Use
    • Technical Specifications
    • Credits

eleven Batch , stdin/stdout

Registered Users Only

Please login to utilize this feature.

Do note that this website only supports submissions in C++.

eleven.html

Problem Description

A number is divisible by 11 if the absolute difference between the sums of alternating digits is divisible by 11.

For example, 74954 is divisible by 11 because (7 + 9 + 4) - (4 + 5) = 11 is divisible by 11.

You are given a positive integer N. Determine if N is divisible by 11.

Input

The only line of input will contain one integer, N.

Output

Output 'YES' (without quotes) on a single line if N is divisible by 11. Otherwise, output 'NO' (without quotes).

Limits

Subtask 1 (20%): 1 ≤ N ≤ 1000000

Subtask 2 (80%): N contains at most 1000000 digits

Subtask 3 (0%): Sample Testcases

Sample Testcase 1

Input

74954

Output

YES

Sample Testcase 1

Input

20010

Output

NO

Tags

Syntax

Subtasks and Limits

Subtask Score #TC Time Memory Scoring
120271s32MBMinimum
280371s32MBMinimum
3021s32MBMinimum

Judge Compile Command

g++-8 ans.cpp -o eleven -Wall -Wshadow -static -O2 -lm -m64 -s -w -std=gnu++17 -fmax-errors=512

Accepted Submissions

subIDUserTimeMax Time

Past Submissions

subIDUserTimeScore
mrJudge 09.05.20
Copyright © 2020 mrJudge. All rights reserved.