Wrong Answer
Code
#include<bits/stdc++.h>
using namespace std;
#define ll long long
#define endl '\n'
#define print(v) for(auto e:v) cout<<e<<" "; cout<<endl;
void solve() {
string s ; cin >>s;
int n; cin >> n ;
int a = s[0] -'0';
int b = s[2]-'0';
ll dif = b - a;
ll ki = (n - 1) * dif;
ki += (2*a);
ki *= n;
ki /= 2;
cout << ki << endl;}
int main() {
ios::sync_with_stdio(false);
cin.tie(0);
int t = 1;// cin >> t;
while(t--){
solve();
}
return 0;
}
Information
- Submit By
- Type
- Submission
- Problem
- P1231 Busy Friend
- Contest
- LUCC Presents Kick & Code Intra LU Programming Contest
- Language
- C++17 (G++ 13.2.0)
- Submit At
- 2025-09-01 05:37:04
- Judged At
- 2025-09-01 05:37:04
- Judged By
- Score
- 10
- Total Time
- 1ms
- Peak Memory
- 532.0 KiB