| # | Time | Username | Problem | Language | Result | Execution time | Memory | 
|---|---|---|---|---|---|---|---|
| 377146 | marat0210 | Lun (COCI19_lun) | C++14 | 1 ms | 364 KiB | 
This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
#include <bits/stdc++.h>
using namespace std;
int main()
{
    int n;
    string s;
    cin >>n>>s;
    long long sum = 0;
    for (int i = 0; i < n; ++i) {
        if (i % 2 == 1 and s[i] != 'x') {
            long long k = (s[i] - '0') * 2;
            if (k > 9) {
                sum += (1 + k % 10);
            }
            else {
                sum += k;
            }
        }
        else {
            if (s[i] != 'x') {
                sum += (s[i] - '0');
            }
        }
    }
    long long res = (sum * 9) % 10;
    cout <<res<<endl;
}
| # | Verdict | Execution time | Memory | Grader output | 
|---|---|---|---|---|
| Fetching results... | ||||
