제출 #1251718

#제출 시각아이디문제언어결과실행 시간메모리
1251718mngoc._.Ljeto (COCI21_ljeto)C++20
50 / 50
0 ms328 KiB
#include <bits/stdc++.h> using namespace std; #define int long long #define FOR(i, l, r) for (int i = (l); i <= (r); ++i) #define FOD(i, r, l) for (int i = (r), _l = (l); i >= _l; i--) #define pii pair<int,int> #define endl '\n' #define pb push_back #define TIME (1.0 * clock() / CLOCKS_PER_SEC) #define Konosuba tuple<int , int , int, int> #define fi first #define se second const int N = 3e5 + 5; const int MOD = 1e9 + 7; const int block = 330; const int LOG = 30; const int MAXN = 1e6 + 1; const int INF = 1e14; const int base = 311; template<class A, class B> bool umin(A& var, const B& val){ return (val < var) ? (var = val, true) : false; } template<class A, class B> bool umax(A& var, const B& val){ return (var < val) ? (var = val, true) : false; } mt19937 rng(chrono::steady_clock::now().time_since_epoch().count()); template<class X, class Y> int random(const int& l, const int& r) { return uniform_int_distribution<int>(l,r)(rng); } int n; struct query{ int a , b , t; } queries[N]; vector<pii> t1; vector<pii> t2; int last[9]; void solve(void){ cin >> n; FOR(i , 1 , n){ int a , b , t; cin >> t >> a >> b; if(a >= 5 && a <= 8) t2.push_back({t , a}); else t1.push_back({t , a}); } int res1 = 0 , res2 = 0; FOR(i , 1 , 8) last[i] = -INF; FOR(i , 0 , (int)t1.size() - 1){ if(abs(last[t1[i].second] - t1[i].first) <= 10) res1 += 150; else res1 += 100; last[t1[i].second] = t1[i].first; } FOR(i , 0 , (int)t2.size() - 1){ if(abs(last[t2[i].second] - t2[i].first) <= 10) res2 += 150; else res2 += 100; last[t2[i].second] = t2[i].first; } cout << res1 << " " << res2 << endl; } signed main(void) { if (fopen("smod.INP", "r")) { freopen("smod.INP", "r", stdin); freopen("smod.OUT", "w", stdout); } ios_base::sync_with_stdio(false); cin.tie(NULL); int testCase = 1; //cin >> testCase; FOR(i , 1 , testCase){ solve(); } cerr << "Time elapsed: " << TIME << "s.\n"; return (0); }

컴파일 시 표준 에러 (stderr) 메시지

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