9152022-01-27 19:01:47kicsiboglarSzámjegy keveréscpp11Wrong answer 32/402ms1932 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)
    {
        j += (s[i] - 48);
    }
    ll db = s.size();
    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
base32/40
1Accepted0/02ms1816 KiB
2Accepted0/01ms1860 KiB
3Accepted0/01ms1904 KiB
4Accepted2/21ms1900 KiB
5Accepted2/21ms1904 KiB
6Accepted2/21ms1900 KiB
7Accepted2/21ms1904 KiB
8Accepted2/21ms1900 KiB
9Accepted2/21ms1904 KiB
10Accepted2/21ms1900 KiB
11Accepted4/41ms1904 KiB
12Wrong answer0/41ms1904 KiB
13Accepted2/21ms1928 KiB
14Accepted2/21ms1932 KiB
15Accepted2/21ms1932 KiB
16Wrong answer0/21ms1924 KiB
17Wrong answer0/21ms1924 KiB
18Accepted2/21ms1928 KiB
19Accepted3/31ms1924 KiB
20Accepted3/31ms1928 KiB