Submission #728202

#TimeUsernameProblemLanguageResultExecution timeMemory
728202jampmFortune Telling 2 (JOI14_fortune_telling2)C++17
4 / 100
3076 ms1744 KiB
#include <bits/stdc++.h> using namespace std; using ll = long long int; //stress test brute force int main() { ll n, k, ans = 0, idx = 0; cin >> n >> k; ll card[2][n], oper[k]; for (int i = 0; i < n; i++) cin >> card[0][i] >> card[1][i]; for (int i = 0; i < k; i++) cin >> oper[i]; for (int i = 0; i < n; i++, idx = 0) { for (int j = 0; j < k; j++) { idx ^= (card[idx][i] <= oper[j]); } ans += card[idx][i]; } cout << ans << endl; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...