Wrong Answer
Code
/// Md Abdur Rahman Salman ///
#include<bits/stdc++.h>
using namespace std;
#define endl "\n"
#define ll long long
#define bug(x) cout << #x << ": " << x << endl
int32_t main()
{
ios_base::sync_with_stdio(0);
cin.tie(0); cout.tie(0);
string s; cin >> s;
int n; cin >> n;
if(n == 1)
{
cout << s[0] << endl;
return 0;
}
ll a = s[0] - '0';
ll y = s[2] - '0';
ll d = y - a;
ll sum = (1LL * n * (2 * a + (n - 1) * d)) / 2;
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:00:27
- Judged At
- 2025-09-02 16:00:27
- Judged By
- Score
- 10
- Total Time
- 1ms
- Peak Memory
- 532.0 KiB