/ SeriousOJ /

Record Detail

Wrong Answer


  
# Status Time Cost Memory Cost
#1 Accepted 1ms 532.0 KiB
#2 Wrong Answer 1ms 532.0 KiB
#3 Wrong Answer 1ms 532.0 KiB

Code

#include <bits/stdc++.h>
#define int long long
using namespace std;
/*
        OBSERVATIONS:


*/
signed main()
{
    ios::sync_with_stdio(false);
    cin.tie(nullptr);
    string s;
    cin >> s;
    vector<int> arr;
    for (char ch : s)
    {
        if (isdigit(ch))
        {
            arr.push_back(ch - '0');
        }
    }
    int n;
    cin >> n;
    int res = 2 * arr[0];
    res += (n - 1) * (arr[1] - arr[0]);
    res *= n;
    res /= 2;
    cout << res << endl;
    return 0;
}

Information

Submit By
Type
Submission
Problem
P1231 Busy Friend
Contest
LUCC Presents Intra LU Junior Programming Contest - Replay
Language
C++17 (G++ 13.2.0)
Submit At
2025-09-02 15:44:43
Judged At
2025-09-02 15:44:43
Judged By
Score
10
Total Time
1ms
Peak Memory
532.0 KiB