제출 #872747

#제출 시각아이디문제언어결과실행 시간메모리
872747tsumondaiLjeto (COCI21_ljeto)C++14
50 / 50
2 ms8284 KiB
#include <bits/stdc++.h> using namespace std; #define int long long #define fi first #define se second #define pb push_back #define mp make_pair #define foru(i, l, r) for(int i = l; i <= r; i++) #define ford(i, r, l) for(int i = r; i >= l; i--) #define __TIME (1.0 * clock() / CLOCKS_PER_SEC) typedef pair<int, int> ii; typedef pair<ii, int> iii; typedef pair<ii, ii> iiii; const int N = 1e6 + 5; const int oo = 1e18, mod = 1e9 + 7; int n, m, k, cnta=0, cntb=0, resa=0, resb=0, recent[N]; string s; vector<iii> quer[3]; void process() { cin >> n; foru(i,1,n) { int t,a,b; cin >> t >> a >> b; if (a<=4) quer[1].pb({{t, a}, b}); else quer[2].pb({{t, a}, b}); } memset(recent,0,sizeof(recent)); cnta=quer[1].size(); cntb=quer[2].size(); foru(i,0,cnta-1) { int fr=quer[1][i].fi.se, to=quer[1][i].se, tim=quer[1][i].fi.fi; resa+=100; if (recent[fr]==0) { recent[fr]=tim; continue; } if (tim-recent[fr]<=10) resa+=50; //cout << tim << ' ' << recent[fr] << '\n'; recent[fr]=tim; } memset(recent,0,sizeof(recent)); foru(i,0,cntb-1) { int fr=quer[2][i].fi.se, to=quer[2][i].se, tim=quer[2][i].fi.fi; resb+=100; //cout << fr << ' ' << to << ' ' << tim << '\n'; if (recent[fr]==0) { recent[fr]=tim; continue; } if (tim-recent[fr]<=10) resb+=50; recent[fr]=tim; } cout << resa << ' ' << resb; return; } signed main() { cin.tie(0)->sync_with_stdio(false); //freopen(".inp", "r", stdin); //freopen(".out", "w", stdout); process(); cerr << "Time elapsed: " << __TIME << " s.\n"; return 0; }

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

Main.cpp: In function 'void process()':
Main.cpp:36:28: warning: unused variable 'to' [-Wunused-variable]
   36 |   int fr=quer[1][i].fi.se, to=quer[1][i].se, tim=quer[1][i].fi.fi;
      |                            ^~
Main.cpp:48:28: warning: unused variable 'to' [-Wunused-variable]
   48 |   int fr=quer[2][i].fi.se, to=quer[2][i].se, tim=quer[2][i].fi.fi;
      |                            ^~
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...