9472022-02-03 20:46:28nmarciSzámjegy keveréscpp11Wrong answer 32/402ms1988 KiB
#include <iostream>
#include <vector>
#include <map>
#include <queue>
#include <string>
#include <set>
#include <algorithm>
#include <list>
using namespace std;
using ll = long long int;

int main(){
    string s;
    cin >> s;
    ll answ = 0;
    if(s.size() > 1){
        ll sum = 0;
        for(ll i = 0; i < s.size(); ++i){
            sum += atoi(s.substr(i,1).c_str());
        }
        answ = sum + ((s.size() - 1) * (s.size())) * 9 / 2;
        cout << answ << endl;
    }
    else{
        cout << atoi(s.c_str()) << endl;
    }
    return 0;
}
SubtaskSumTestVerdictTimeMemory
base32/40
1Accepted0/02ms1740 KiB
2Accepted0/01ms1848 KiB
3Accepted0/01ms1840 KiB
4Accepted2/21ms1844 KiB
5Accepted2/21ms1856 KiB
6Accepted2/21ms1856 KiB
7Accepted2/21ms1864 KiB
8Accepted2/21ms1864 KiB
9Accepted2/21ms1864 KiB
10Accepted2/21ms1872 KiB
11Accepted4/41ms1876 KiB
12Wrong answer0/41ms1880 KiB
13Accepted2/21ms1908 KiB
14Accepted2/21ms1916 KiB
15Accepted2/21ms1932 KiB
16Wrong answer0/21ms1940 KiB
17Wrong answer0/21ms1956 KiB
18Accepted2/21ms1964 KiB
19Accepted3/31ms1984 KiB
20Accepted3/32ms1988 KiB