Submission #707976

#TimeUsernameProblemLanguageResultExecution timeMemory
707976TAhmed33Unija (COCI17_unija)C++98
40 / 100
1 ms468 KiB
#include <bits/stdc++.h> using namespace std; #define int long long int arr[3334] = {}; signed main () { int n; cin >> n; while (n--) { int x, y; cin >> x >> y; x /= 2; arr[x] = max(arr[x], y); } int ans = arr[3333]; for (int i = 3332; i >= 1; i--) { arr[i] = max(arr[i], arr[i + 1]); ans += arr[i]; } ans *= 2; cout << ans << '\n'; }
#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...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...