Wrong Answer
Code
#include <bits/stdc++.h>
#define nl '\n'
#define ll long long
#define all(c) c.begin(),c.end()
#define print(c) for(auto e : c) cout << e << " "; cout << nl
using namespace std;
int main()
{
ios_base::sync_with_stdio(false); cin.tie(NULL);
string s; cin >> s;
int n; cin >> n;
int firstNum = s[0] - '0';
int d = (s[2] - '0') - (s[0] - '0');
cerr << firstNum << " " << d << nl;
ll sum = (n * (2 * firstNum + (n - 1) * d)) / 2;
cout << sum << nl;
return 0;
}
Information
- Submit By
- Type
- Submission
- Problem
- P1231 Busy Friend
- Language
- C++17 (G++ 13.2.0)
- Submit At
- 2025-09-18 14:22:05
- Judged At
- 2025-09-18 14:22:05
- Judged By
- Score
- 10
- Total Time
- 1ms
- Peak Memory
- 536.0 KiB