제출 #824861

#제출 시각아이디문제언어결과실행 시간메모리
824861alvingogo메기 농장 (IOI22_fish)C++17
0 / 100
20 ms5472 KiB
#include "fish.h" #include <bits/stdc++.h> #define fs first #define sc second #define p_q priority_queue using namespace std; long long max_weights(int n, int m, vector<int> x, vector<int> y, vector<int> w) { long long ans=0; vector<vector<pair<int,int> > > v(n); for(int i=0;i<m;i++){ v[x[i]].push_back({y[i],w[i]}); } for(int i=0;i<n;i++){ if(v[i].size() && ((i-1>=0 && !v[i-1].size()) || (i+1<n && !v[i+1].size()))){ ans+=v[i][0].sc; } } return ans; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...