제출 #643262

#제출 시각아이디문제언어결과실행 시간메모리
643262kkkkkkkkLjeto (COCI21_ljeto)C++14
50 / 50
1 ms300 KiB
#include <bits/stdc++.h> using namespace std; int main() { int n; cin >> n; int t[n],a[n],b[n]; vector<int> v[9]; for (int i=0;i<n;i++) { cin >> t[i] >> a[i] >> b[i]; v[a[i]].push_back(t[i]); } for (int i=1;i<=8;i++) sort(v[i].begin(),v[i].end()); int tim_a=0,tim_b=0; for (int i=1;i<=8;i++) { int posl=-100,vk=0; for (int j=0;j<v[i].size();j++) { vk+=100; if (v[i][j]<=posl+10) vk+=50; posl=v[i][j]; } if (i<=4) tim_a+=vk; else tim_b+=vk; } cout << tim_a << " " << tim_b; return 0; }

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

Main.cpp: In function 'int main()':
Main.cpp:23:23: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   23 |         for (int j=0;j<v[i].size();j++)
      |                      ~^~~~~~~~~~~~
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...