/ SeriousOJ /

Record Detail

Wrong Answer


  
# Status Time Cost Memory Cost
#1 Accepted 2ms 540.0 KiB
#2 Wrong Answer 2ms 480.0 KiB
#3 Wrong Answer 2ms 444.0 KiB
#4 Wrong Answer 3ms 612.0 KiB
#5 Wrong Answer 8ms 624.0 KiB
#6 Wrong Answer 68ms 1.453 MiB
#7 Wrong Answer 68ms 1.262 MiB
#8 Wrong Answer 68ms 1.387 MiB
#9 Wrong Answer 68ms 1.461 MiB
#10 Wrong Answer 2ms 328.0 KiB

Code

#include <bits/stdc++.h>
using namespace std;

#define fastio ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL);
#define ll long long
#define ull unsigned long long
#define vi vector<int>
#define vll vector<ll>
#define pii pair<int, int>
#define pll pair<ll, ll>
#define vii vector<pii>
#define vllp vector<pll>
#define pb push_back
#define mp make_pair
#define all(v) (v).begin(), (v).end()
#define rall(v) (v).rbegin(), (v).rend()
#define sz(x) (int)(x).size()
#define rep(i, a, b) for (int i = (a); i < (b); ++i)
#define rrep(i, a, b) for (int i = (a); i >= (b); --i)
#define endl '\n'

const int INF = 1e9 + 5;
const ll LINF = 1e18 + 5;
const double EPS = 1e-9;
const int MOD = 1e9 + 7;

#define YES cout << "YES" << endl;
#define NO cout << "NO" << endl;
#define Yes cout << "Yes" << endl;
#define No cout << "No" << endl;

template<typename T>
void print_vector(const vector<T>& vec) {
    for (const auto& val : vec) cout << val << ' ';
    cout << endl;
}


ll gcd(ll a, ll b) { return b ? gcd(b, a % b) : a; }
ll lcm(ll a, ll b) { return (a / gcd(a, b)) * b; }


bool is_prime(int n) {
    if (n < 2) return false;
    for (int i = 2; i * i <= n; i++) {
        if (n % i == 0) return false;
    }
    return true;
}


vector<bool> sieve(int n) {
    vector<bool> is_prime(n + 1, true);
    is_prime[0] = is_prime[1] = false;
    for (int i = 2; i * i <= n; ++i) {
        if (is_prime[i]) {
            for (int j = i * i; j <= n; j += i)
                is_prime[j] = false;
        }
    }
    return is_prime;
}


int binary_search(const vi& arr, int x) {
    int l = 0, r = sz(arr) - 1;
    while (l <= r) {
        int m = l + (r - l) / 2;
        if (arr[m] == x) return m;
        if (arr[m] < x) l = m + 1;
        else r = m - 1;
    }
    return -1;
}


ll mod_exp(ll base, ll exp, ll mod) {
    ll result = 1;
    while (exp > 0) {
        if (exp % 2 == 1) result = (result * base) % mod;
        base = (base * base) % mod;
        exp /= 2;
    }
    return result;
}

ll mod_inverse(ll a, ll mod) {
    return mod_exp(a, mod - 2, mod);
}


int euler_totient(int n) {
    int result = n;
    for (int p = 2; p * p <= n; ++p) {
        if (n % p == 0) {
            while (n % p == 0) n /= p;
            result -= result / p;
        }
    }
    if (n > 1) result -= result / n;
    return result;
}



void solve(){
     
     ll n,m,a,b;
     cin>>n>>m>>a>>b;
     cout<<(m*a)+((n-m)*b)<<endl;
     
}
     
int main() {
    fastio;

    int t ; 
     cin >> t; 
    while (t--) {
       solve(); 
    }

}

Information

Submit By
Type
Submission
Problem
P1090 Summer trip
Contest
Brain Booster #5
Language
C++17 (G++ 13.2.0)
Submit At
2024-09-05 15:40:16
Judged At
2024-10-03 13:10:55
Judged By
Score
10
Total Time
68ms
Peak Memory
1.461 MiB