/ SeriousOJ /

Record Detail

Wrong Answer


  
# Status Time Cost Memory Cost
#1 Accepted 1ms 532.0 KiB
#2 Wrong Answer 1ms 324.0 KiB
#3 Wrong Answer 1ms 532.0 KiB

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