Submission #48407928


Source Code Expand

#include <bits/stdc++.h>
using namespace std;
#include <atcoder/all>
using namespace atcoder;
using ll = long long;
using ld = long double;
using vl = vector<ll>;
using vll = vector<vl>;
using Pll = pair<ll, ll>;
#define rep(i, n) for (ll i = 0; i < (ll)(n); i++)
#define Rep(i, j, n) for (ll i = (ll)(j); i <= (ll)(n); ++i)
#define all(v) v.begin(), v.end()
#define sz(x) ((int)x.size())
#define eb emplace_back
#define pb push_back
#define mp make_pair
#define mt make_tuple
#define F first
#define S second
const int MOD = 1e9 + 7;
const int mod = 998244353;
const ll INF = 2e15;
template <class T>
void print(const T& t) {
  cout << t << endl;
}
template <class T>
inline bool chmax(T& a, T b) {
  if (a < b) {
    a = b;
    return 1;
  }
  return 0;
}
template <class T>
inline bool chmin(T& a, T b) {
  if (a > b) {
    a = b;
    return 1;
  }
  return 0;
}
ll gcd(ll a, ll b) { return b ? gcd(b, a % b) : a; }

/*
ll ti=clock();
cout<<("Execution Time: %.4lf sec", 1.0 * (clock() - ti) /
CLOCKS_PER_SEC)<<endl;
*/

int main(){
  ll n,s,k;
  cin>>n>>s>>k;
  ll sum=0;
  rep(i,n){
    ll p,q;
    cin>>p>>q;
    sum+=p*q;
  }
  if(sum<s){
    sum+=k;
  }
  cout<<sum<<endl;
}

Submission Info

Submission Time
Task A - Online Shopping
User replica
Language C++ 20 (gcc 12.2)
Score 100
Code Size 1247 Byte
Status AC
Exec Time 1 ms
Memory 3712 KiB

Judge Result

Set Name Sample All
Score / Max Score 0 / 0 100 / 100
Status
AC × 3
AC × 26
Set Name Test Cases
Sample example_00.txt, example_01.txt, example_02.txt
All example_00.txt, example_01.txt, example_02.txt, hand_00.txt, hand_01.txt, hand_02.txt, random_00.txt, random_01.txt, random_02.txt, random_03.txt, random_04.txt, random_05.txt, random_06.txt, random_07.txt, random_08.txt, random_09.txt, random_10.txt, random_11.txt, random_12.txt, random_13.txt, random_14.txt, random_15.txt, random_16.txt, random_17.txt, random_18.txt, random_19.txt
Case Name Status Exec Time Memory
example_00.txt AC 1 ms 3664 KiB
example_01.txt AC 1 ms 3644 KiB
example_02.txt AC 1 ms 3448 KiB
hand_00.txt AC 1 ms 3708 KiB
hand_01.txt AC 1 ms 3480 KiB
hand_02.txt AC 1 ms 3584 KiB
random_00.txt AC 1 ms 3516 KiB
random_01.txt AC 1 ms 3520 KiB
random_02.txt AC 1 ms 3708 KiB
random_03.txt AC 1 ms 3476 KiB
random_04.txt AC 1 ms 3568 KiB
random_05.txt AC 1 ms 3584 KiB
random_06.txt AC 1 ms 3476 KiB
random_07.txt AC 1 ms 3584 KiB
random_08.txt AC 1 ms 3524 KiB
random_09.txt AC 1 ms 3484 KiB
random_10.txt AC 1 ms 3664 KiB
random_11.txt AC 1 ms 3572 KiB
random_12.txt AC 1 ms 3448 KiB
random_13.txt AC 1 ms 3516 KiB
random_14.txt AC 1 ms 3580 KiB
random_15.txt AC 1 ms 3528 KiB
random_16.txt AC 1 ms 3712 KiB
random_17.txt AC 1 ms 3448 KiB
random_18.txt AC 1 ms 3580 KiB
random_19.txt AC 1 ms 3536 KiB