9072022-01-27 11:43:45kicsiboglarSzámjegy keveréscpp11Wrong answer 18/402ms2052 KiB
#include <iostream>
#include <vector>
#include <set>

#define ll long long 
using namespace std;

ll n, i, j, a;
multiset<ll> v;

int main()
{
    ios::sync_with_stdio(false);
    cin >> n;
    a = n;
    ll db = 0;
    while (a > 0)
    {
        j += a % 10;
        db++;
        v.insert(a % 10);
        a /= 10;
    }

    cout << j +(( (db - 1)*db)/2)*9;
}

// Run program: Ctrl + F5 or Debug > Start Without Debugging menu
// Debug program: F5 or Debug > Start Debugging menu

// Tips for Getting Started: 
//   1. Use the Solution Explorer window to add/manage files
//   2. Use the Team Explorer window to connect to source control
//   3. Use the Output window to see build output and other messages
//   4. Use the Error List window to view errors
//   5. Go to Project > Add New Item to create new code files, or Project > Add Existing Item to add existing code files to the project
//   6. In the future, to open this project again, go to File > Open > Project and select the .sln file
    
SubtaskSumTestVerdictTimeMemory
base18/40
1Accepted0/02ms1824 KiB
2Accepted0/01ms1864 KiB
3Wrong answer0/01ms1928 KiB
4Accepted2/21ms1924 KiB
5Accepted2/21ms1932 KiB
6Accepted2/21ms1932 KiB
7Accepted2/21ms1936 KiB
8Accepted2/21ms1944 KiB
9Accepted2/21ms1944 KiB
10Accepted2/21ms1952 KiB
11Accepted4/42ms1952 KiB
12Wrong answer0/41ms1956 KiB
13Wrong answer0/21ms1972 KiB
14Wrong answer0/21ms1984 KiB
15Wrong answer0/22ms1992 KiB
16Wrong answer0/21ms2000 KiB
17Wrong answer0/21ms2016 KiB
18Wrong answer0/21ms2028 KiB
19Wrong answer0/31ms2040 KiB
20Wrong answer0/31ms2052 KiB