Submission

Status:

[PPPPPPPPPP]

Subtask/Task Score:

{100/100}

Score: 100

User: kakcode

Problemset: บาร์โค้ด

Language: cpp

Time: 0.002 second

Submitted On: 2025-11-11 22:26:44

/*
TASK: c1_bkk64_6
LANG: C++
AUTHOR: ICE
*/
#include <bits/stdc++.h>
using ll = long long;
#define forr(i, a, n) for (int i = a; i < n; i++)
const ll inf = 10e9;
#define int ll
using namespace std;
using pii = pair<int,int>;
signed main() {
    ios::sync_with_stdio(false);
    cin.tie(nullptr);
    string code;
    cin >> code;
    int suma = 0;
    int sumb = 0;
    for(int i=code.length()-2;i>=0;i--){
        if(i % 2 == 0)suma+=code[i]-'0';
        else sumb += code[i]-'0';
    }
    int ans = code[code.length()-1]-'0' + suma + sumb*3;
    if(ans % 10 == 0)cout << "YES";
    else cout << "NO";
    return 0;
}