Wrong Answer
Code
#include <bits/stdc++.h>
using namespace std;
#define endl '\n'
int main()
{
ios_base::sync_with_stdio(0);
cin.tie(0);
string s;
cin >> s;
long long x = s[0] - '0';
long long y = s[2] - '0';
long long dif = y - x;
long long n;
cin >> n;
long long part1 = (n - 1) * x + x;
long long sum = (n * (n - 1) / 2) * dif;
sum += part1;
cout << sum << 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 16:05:56
- Judged At
- 2025-09-02 16:05:56
- Judged By
- Score
- 10
- Total Time
- 1ms
- Peak Memory
- 532.0 KiB