Wrong Answer
Code
/// Md Abdur Rahman Salman ///
#include<bits/stdc++.h>
using namespace std;
#define endl "\n"
#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;
int a = s[0] - '0';
int y = s[2] - '0';
int d = y - a;
long long 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 15:52:46
- Judged At
- 2025-09-02 15:52:46
- Judged By
- Score
- 10
- Total Time
- 1ms
- Peak Memory
- 480.0 KiB