이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include <bits/stdc++.h>
#define ll long long
#define endl '\n'
using namespace std;
void solve(){
ll n; cin>>n;
vector<pair<ll,pair<ll,ll>>>v(n);
ll asum=0;
ll bsum=0;
for(int i=0;i<n;i++){
cin>>v[i].first>>v[i].second.first>>v[i].second.second;
if(v[i].second.first==1 || v[i].second.first==2 || v[i].second.first==3 || v[i].second.first==4){
asum+=100;
}
else{
bsum+=100;
}
}
vector<vector<ll>>cnt(8);
for(int i=0;i<n;i++){
for(int j=i+1;j<n;j++){
if(v[i].second.first==v[j].second.first){
cnt[v[i].second.first-1].push_back(v[j].first-v[i].first);
}
}
}
for(int i=0;i<8;i++){
for(int j=0;j<cnt[i].size();j++){
if(cnt[i][j]<=10){
if(i==0 || i==1 || i==2 || i==3){
asum+=50;
}
else{
bsum+=50;
}
}
}
}
cout<<asum<<' '<<bsum<<endl;
// ll n,k,b,s; cin>>n>>k>>b>>s;
// priority_queue<pair<ll,ll>,vector<pair<ll,ll>>,greater<pair<ll,ll>>>pq;
// ll arr[n+1];
// ll perm[n+1];
// for(int i=1;i<=n;i++){
// cin>>perm[i];
// }
// for(int i=1;i<=n;i++){
// cin>>arr[i];
// }
// pq.push({})
}
int main(){
ll tc; tc=1;
while(tc--){
solve();
}
}
컴파일 시 표준 에러 (stderr) 메시지
Main.cpp: In function 'void solve()':
Main.cpp:30:22: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<long long int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
30 | for(int j=0;j<cnt[i].size();j++){
| ~^~~~~~~~~~~~~~
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |