Wrong Answer
Code
#include <bits/stdc++.h>
using namespace std;
#define fast ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);
#define ll long long
int main()
{
fast
/*ll t;
cin>>t;
while(t--) solve*/
string s;
long long n;
cin>>s>>n;
vector <long long> num;
num.push_back(s[0]-'0');
num.push_back(s[2]-'0');
long long d = num[1]-num[0];
long long f = num[0], sum=0;
for (long long i=0; i<n; i++){
sum+=f;
f+=d;
}
cout<<sum<<endl;
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 07:38:38
- Judged At
- 2025-09-01 07:38:38
- Judged By
- Score
- 10
- Total Time
- 1ms
- Peak Memory
- 548.0 KiB