Wrong Answer
Code
#include <bits/stdc++.h>
using namespace std;
#define all(x) (x).begin(), (x).end()
using ll = long long;
int main()
{
ios::sync_with_stdio(false);
cin.tie(0);
string str;
cin >> str;
int n;
cin >> n;
int a = str[0] - '0', two = str[2] - '0';
int d = two - a;
int sum = ((2 * a + d * n - d) * n) / 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:37:37
- Judged At
- 2025-09-02 16:37:37
- Judged By
- Score
- 10
- Total Time
- 1ms
- Peak Memory
- 532.0 KiB