Submission #968928

#TimeUsernameProblemLanguageResultExecution timeMemory
968928CyberCowA Difficult(y) Choice (BOI21_books)C++17
0 / 100
1 ms604 KiB
#include "books.h" #include <vector> #include <algorithm> #include <map> using namespace std; const int N = 100010; long long v[N]; map<long long, int> arj; void solve(int n, int k, long long a, int s) { for (int i = 1; i <= n; i++) { v[i] = skim(i); arj[v[i]] = i; } int st = 1; for (int i = 1; i <= n; i++) { for (int j = i + 1; j <= n; j++) { if (!st && v[i] + v[j] <= a && a - v[i] - v[j] != v[i] && a - v[i] - v[j] != v[j]) { if (arj[a - v[i] - v[j]]) { st = 1; vector<int> ans; ans.push_back(i); ans.push_back(j); ans.push_back(arj[a - v[i] - v[j]]); sort(ans.begin(), ans.end()); answer({ ans }); } } } } if (st == 0) { impossible(); } }
#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...