Submission #652792

#TimeUsernameProblemLanguageResultExecution timeMemory
6527924EVERLjeto (COCI21_ljeto)C++11
10 / 50
1 ms212 KiB
/****************************** * author : @yayayaya * * date : 21 / 10 / 2022 * ******************************/ /* (≈ㅇᆽㅇ≈)♡ (≈ㅇᆽㅇ≈)♡ (≈ㅇᆽㅇ≈)♡ (≈ㅇᆽㅇ≈)♡ (≈ㅇᆽㅇ≈)♡ */ /* /^--^\ /^--^\ /^--^\ \____/ \____/ \____/ / \ / \ / \ | | | | | | \__ __/ \__ __/ \__ __/ |^|^|^|^|^|^|^|^|^|^|^|^\ \^|^|^|^/ /^|^|^|^|^\ \^|^|^|^|^|^|^|^|^|^|^|^| | | | | | | | | | | | | |\ \| | |/ /| | | | | |\ \| | | | | | | | | | | | | | | | | | | | | | | | |/ /| | |\ \| | | | | |/ /| | | | | | | | | | | | | | | | | | | | | | | | |\/ | | | \/| | | | | |\/ | | | | | | | | | | | | ######################################################################### | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | */ /******************************************************************************************* * ################################################################# * * # _` # * * # _ooOoo_ # * * # o8888888o # * * # 88" . "88 # * * # (| -_- |) # * * # O\ = /O # * * # ____/`---'\____ # * * # .' \| |// `. # * * # / \||| : |||// \ # * * # / _||||| -:- |||||_ \ # * * # | | \ - /'| | | # * * # | \_| `\`---'// |_/ | # * * # \ .-\__ `-. -'__/-. / # * * # ___`. .' /--.--\ `. .'___ # * * # ."" '< `.___\_<|>_/___.' _> \"". # * * # | | : `- \`. ;`. _/; .'/ / .' ; | # * * # \ \ `-. \_\_`. _.'_/_/ -' _.' / # * * #=============`-.`___`-.__\ \___ /__.-'_.'_.-'=================# * * `=--=-' * * * * /\_/\* * * ( -.-) * * _.-/`) / >O \>1 _.-/`) * * // / / ) // / / ) * * .=// / / / ) /\_/\ /\_/\ .=// / / / ) * * //`/ / / / / ( -.-) ( -.-) //`/ / / / / * * // / ` / / >O \>1 / >O \>1 // / ` / * * \ / \ / * * )) .' /\_/\ /\_/\ /\_/\ )) .' * * // / ( -.-) ( -.-) ( -.-) // / * * / / >O \>1 / >O \>1 / >O \>1 / * * * *******************************************************************************************/ #include <bits/stdc++.h> // #pragma GCC optimize("O2") // #pragma GCC target("avx,avx2,fma") // #pragma GCC optimize ("O3,unroll-loops,no-stack-protector") // #pragma GCC target ("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native") using namespace std; mt19937 rng(chrono::steady_clock::now().time_since_epoch().count()); #define PB push_back #define ALL(i_) i_.begin(), i_.end() #define LOG2(x) (31 - __builtin_clz(x)) #define getBit(x, i) ((x >> i) & 1) #define rd(l, r) (l + rng() % (r - l + 1)) #define FOR(i_, a_, b_) for(int i_ = (int) (a_); i_ <= (int) (b_); ++i_) #define FORD(i_, a_, b_) for(int i_ = (int) (a_); i_ >= (int) (b_); --i_) #define db(val) "["#val" = "<<(val)<<"] " typedef long long ll; typedef long double ld; typedef pair<int, int> ii; template<class X, class Y> bool minimize(X &x, const Y &y){ X eps = 1e-9; if (x > y + eps) { x = y; return 1; } return 0; } template<class X, class Y> bool maximize(X &x, const Y &y) { X eps = 1e-9; if (x + eps < y) { x = y; return 1; } return 0; } template<class T> T Abs(const T &x) { return (x < 0 ? -x : x); } const int mod = (int) 1e9 + 7; const int oo = (int) 1e9 + 99; const int LOG = (int) 20; const ii dxy8[] = { {-1, 0}, {1, 0}, {0, 1}, {0, -1}, {1, -1}, {1, 1}, {-1, 1}, {-1, -1} }; const ii dxy4[] = { {-1, 0}, {1, 0}, {0, 1}, {0, -1} }; const int maxn = (int) 1e2 + 1; int n; array<int, 3> a[maxn]; int type(const array<int, 3> &a){ return (a[1] > a[2]); } int main(){ ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0); #define TASK "LJETO" if(fopen(TASK".inp", "r")) { freopen(TASK".inp", "r", stdin); freopen(TASK".out", "w", stdout); } cin >> n; FOR(i, 1, n) cin >> a[i][0] >> a[i][1] >> a[i][2]; sort(a + 1, a + n + 1); array<int, 2> res = {0, 0}; FOR(i, 1, n){ int j = i; while(j < n && a[j + 1][0] - a[j][0] <= 10 && (type(a[j + 1]) == type(a[i]))) ++j; res[type(a[i])] += (j - i + 1) * 100 + (j - i) * 50; i = j; } cout << res[0] << " " << res[1]; return 0; } /// CONCACOCONCACOCONCACOCONCACOCONCACOCONCACOCONCACOCONCACOCONCACO ///

Compilation message (stderr)

Main.cpp: In function 'int main()':
Main.cpp:117:16: warning: ignoring return value of 'FILE* freopen(const char*, const char*, FILE*)' declared with attribute 'warn_unused_result' [-Wunused-result]
  117 |         freopen(TASK".inp", "r", stdin);
      |         ~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~
Main.cpp:118:16: warning: ignoring return value of 'FILE* freopen(const char*, const char*, FILE*)' declared with attribute 'warn_unused_result' [-Wunused-result]
  118 |         freopen(TASK".out", "w", stdout);
      |         ~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...