9132022-01-27 18:58:05kicsiboglarSzámjegy keveréscpp11Hibás válasz 32/402ms1936 KiB
#include <iostream>
#include <vector>
#include <algorithm>
#include <string>

#define ll long long 
using namespace std;

ll n, i, j, a;
string s;

int main()
{
    ios::sync_with_stdio(false);
    cin >> s;
    for (i = 0; i < s.size(); ++i)
    {
        //cout << s[i] - 48 << " ";
        j += s[i] - 48;
       // a *= 10;
        //a += s[i] - 48;
    }
    //a = n;
    ll db = s.size();
   /*while (a > 0)
    {
        j += a % 10;
        db++;
        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
RészfeladatÖsszpontTesztVerdiktIdőMemória
base32/40
1Elfogadva0/02ms1824 KiB
2Elfogadva0/01ms1840 KiB
3Elfogadva0/01ms1904 KiB
4Elfogadva2/21ms1900 KiB
5Elfogadva2/21ms1904 KiB
6Elfogadva2/21ms1904 KiB
7Elfogadva2/21ms1900 KiB
8Elfogadva2/21ms1904 KiB
9Elfogadva2/21ms1904 KiB
10Elfogadva2/21ms1904 KiB
11Elfogadva4/41ms1900 KiB
12Hibás válasz0/41ms1904 KiB
13Elfogadva2/21ms1932 KiB
14Elfogadva2/21ms1924 KiB
15Elfogadva2/21ms1928 KiB
16Hibás válasz0/21ms1932 KiB
17Hibás válasz0/21ms1928 KiB
18Elfogadva2/21ms1924 KiB
19Elfogadva3/31ms1928 KiB
20Elfogadva3/31ms1936 KiB