| # | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
|---|---|---|---|---|---|---|---|
| 1328527 | tomthuy123 | Let's Win the Election (JOI22_ho_t3) | C++20 | 1 ms | 344 KiB |
#include <bits/stdc++.h>
using namespace std;
#define ll long double
const ll MOD = 1e9 + 7;
ll AllNegative=1;
int main() {
ios::sync_with_stdio(false);
cin.tie(nullptr);
ll n,k;
cin >> n >> k;
vector<pair<ll,ll>> lst(n+1);
for(ll i=1;i<=n;i++){
cin >> lst[i].first >> lst[i].second;
if(lst[i].second!=-1) AllNegative=0;
}
sort(lst.begin(),lst.end());
ll total=0;
//cout << AllNegative << "\n";
for(ll i=1;i<=k;i++){
if(AllNegative==1){
total+=lst[i].first;
}
else{
total+=lst[i].first/i;
}
}
cout << total;
}
| # | Verdict | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
| # | Verdict | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
| # | Verdict | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
| # | Verdict | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
| # | Verdict | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
| # | Verdict | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
| # | Verdict | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
