제출 #646926

#제출 시각아이디문제언어결과실행 시간메모리
646926GudStonksLjeto (COCI21_ljeto)C++17
15 / 50
1 ms300 KiB
#include<bits/stdc++.h> using namespace std; int main() { int n; cin>>n; vector<pair<int, pair<int, int> > >v; for(int i = 1, t, a, b; i <= n; i++) { cin>>t>>a>>b; v.push_back({t, {a, b}}); } int ans = 0, ans1 = 0, ar[9] = {-1, -1, -1, -1, -1, -1, -1, -1, -1}; sort(v.begin(), v.end()); for(int i = 0; i < n; i++) { int t = v[i].first, a = v[i].second.first, b = v[i].second.second; if(a <= 4) ans += 100 + (((ar[a] != -1) && (t - ar[a]) <= 10) ? 50 : 0); else ans1 += 100 + (((ar[a] != -1) && (t - ar[a] + 1) <= 10) ? 50 : 0); ar[a] = t; } cout<<ans<<" "<<ans1; }

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

Main.cpp: In function 'int main()':
Main.cpp:17:46: warning: unused variable 'b' [-Wunused-variable]
   17 |   int t = v[i].first, a = v[i].second.first, b = v[i].second.second;
      |                                              ^
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...