Submission #849797

# Submission time Handle Problem Language Result Execution time Memory
849797 2023-09-15T11:37:24 Z Ne0n Ljeto (COCI21_ljeto) C++14
50 / 50
3 ms 7268 KB
/*
                            -> Authored By : Ахмад <-
                              ->IM COMING BACKK<-
*/
#include "bits/stdc++.h"
using namespace std;
typedef long long ll;
#define F first
#define S second
#define endl '\n'
#define pb emplace_back
#define sqrt sqrtl
#define clr(A, Val) memset(A, Val, sizeof(A));
#define what_is(x) cerr << "->" << (#x) << " = " << x << endl
const int mod = 1e9 + 7, mod2 = 1e9 + 9, OO = 0x3f3f3f3f;
const long long lOO = 0x3f3f3f3f3f3f3f3f;
int add(ll a, ll b) { return (a + b) % mod; }
int mul(ll a, ll b) { return 1LL * a * b % mod; }
long long intlog(ll base, ll x) { return (log(x) / log(base)); }
long long Ceil(ll a, ll b) { return (a + b - 1) / b; }
template <typename T>
int32_t size_i(T &container) {
  return static_cast<int32_t>(container.size());
}
// MIST!?!?!?!?!?
struct custom_hash {
  static uint64_t splitmix64(uint64_t x) {
    x += 0x9e3779b97f4a7c15;
    x = (x ^ (x >> 30)) * 0xbf58476d1ce4e5b9;
    x = (x ^ (x >> 27)) * 0x94d049bb133111eb;
    return x ^ (x >> 31);
  }

  size_t operator()(uint64_t x) const {
    static const uint64_t FIXED_RANDOM =
        chrono::steady_clock::now().time_since_epoch().count();
    return splitmix64(x + FIXED_RANDOM);
  }
};
//->  U Sure?!
template <typename T1, typename T2>
using safe_map = unordered_map<T1, T2, custom_hash>;

template <typename T>
istream &operator>>(istream &istream, vector<T> &v) {
  for (auto &it : v) cin >> it;
  return istream;
}
template <typename T>
ostream &operator<<(ostream &ostream, vector<T> &C) {
  for (auto &it : C) cout << it << " ";
  return ostream;
}
// Think again?!
void ________________________________() {
  int ____ = 0;
#ifndef ONLINE_JUDGE
  ____ = 1;
#endif
  if (____ == 0) {
    cin.tie(0)->sync_with_stdio(0);
  }
}
ll power(ll b, ll p) {
  if (p == 0) return 1;
  ll temp = power(b, p / 2);
  temp = temp * temp;
  if (p & 1) temp = temp * b;
  return temp;
}
//    OK?!
const int N = 3e5 + 1, BASE = 26, BASE2 = 37;
struct sus {
  ll T;
  ll A;
  ll B;
};
vector<sus> arr(N);
void TestCases() {
  ll n;
  cin >> n;
  for (ll i = 0; i < n; ++i) cin >> arr[i].T >> arr[i].A >> arr[i].B;
  ll ansa = 0, ansb = 0;
  ll lsta[10], lstb[10];
  clr(lsta, -lOO);
  clr(lstb, -lOO);
  for (ll i = 0; i < n; ++i) {
    if (arr[i].A <= 4) ansa += 100;
    if (arr[i].A > 4) ansb += 100;
    if (arr[i].A <= 4 and arr[i].T - lsta[arr[i].A] <= 10) ansa += 50;
    if (arr[i].A > 4 and arr[i].T - lstb[arr[i].A] <= 10) ansb += 50;
    if (arr[i].A <= 4)
      lsta[arr[i].A] = arr[i].T;
    else
      lstb[arr[i].A] = arr[i].T;
  }
  cout << ansa << " " << ansb << endl;
}

int main() {
  ________________________________();
  ll ____________ = 1;
  // cin >> ____________;
  cout << fixed << setprecision(12);
  while ((____________)--) {
    TestCases();
  }
  return 0;
}

Compilation message

Main.cpp: In function 'void TestCases()':
Main.cpp:85:13: warning: overflow in conversion from 'long long int' to 'int' changes value from '-4557430888798830399' to '-1061109567' [-Woverflow]
   85 |   clr(lsta, -lOO);
      |             ^~~~
Main.cpp:13:31: note: in definition of macro 'clr'
   13 | #define clr(A, Val) memset(A, Val, sizeof(A));
      |                               ^~~
Main.cpp:86:13: warning: overflow in conversion from 'long long int' to 'int' changes value from '-4557430888798830399' to '-1061109567' [-Woverflow]
   86 |   clr(lstb, -lOO);
      |             ^~~~
Main.cpp:13:31: note: in definition of macro 'clr'
   13 | #define clr(A, Val) memset(A, Val, sizeof(A));
      |                               ^~~
# Verdict Execution time Memory Grader output
1 Correct 2 ms 7260 KB Output is correct
2 Correct 2 ms 7268 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 3 ms 7260 KB Output is correct
2 Correct 2 ms 7256 KB Output is correct
3 Correct 2 ms 7256 KB Output is correct
4 Correct 2 ms 7256 KB Output is correct
5 Correct 2 ms 7256 KB Output is correct
6 Correct 3 ms 7256 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 2 ms 7260 KB Output is correct
2 Correct 2 ms 7268 KB Output is correct
3 Correct 3 ms 7260 KB Output is correct
4 Correct 2 ms 7256 KB Output is correct
5 Correct 2 ms 7256 KB Output is correct
6 Correct 2 ms 7256 KB Output is correct
7 Correct 2 ms 7256 KB Output is correct
8 Correct 3 ms 7256 KB Output is correct
9 Correct 2 ms 7256 KB Output is correct
10 Correct 3 ms 7260 KB Output is correct
11 Correct 2 ms 7260 KB Output is correct
12 Correct 1 ms 7260 KB Output is correct
13 Correct 2 ms 7256 KB Output is correct