| # | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
|---|---|---|---|---|---|---|---|
| 1340015 | caveeee | Tezina (COCI26_tezina) | C++20 | 2094 ms | 3408 KiB |
#include <iostream>
#include <vector>
#include <algorithm>
#include <map>
using namespace std;
int main(){
ios_base::sync_with_stdio(false); cin.tie(nullptr);
int N, k; cin >> N >> k;
map<int, int>m;
for(int i = 0; i<N; i++){
int temp; cin >> temp;
m[temp]++;
}
long long ans = 0;
for(auto[weight, ocurrances]: m){
//cout << key << " " << val << '\n';
for(int i = 1; i<=k; i++){
if(i > weight){
break;
}
long long temp = weight/i;
long long str = min(temp*(weight+2), (long long)1e8);
ans += str*ocurrances;
}
}
cout << ans << '\n';
return 0;
}| # | 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... | ||||
