제출 #899205

#제출 시각아이디문제언어결과실행 시간메모리
899205Nahian9696A Difficult(y) Choice (BOI21_books)C++17
0 / 100
1 ms600 KiB
#include <bits/stdc++.h> #include "books.h" using namespace std; typedef long double ld; typedef long long lli; typedef vector<int32_t> vi; typedef vector<ld> vld; typedef vector<lli> vlli; typedef pair<lli, lli> pii; // #define int int64_t #define endl "\n" #define inp(n) lli n; cin >> n #define inpstr(s) string s; cin >> s #define inp2(a,b) lli a,b; cin >> a >> b #define inparr(arr,n) lli arr[n]; f0(t_ind, n) cin >> arr[t_ind] #define f0(i,n) for(int32_t i = 0; i < (n); i++) #define f1(i,n) for(int32_t i = 1; i <= (n); i++) #define testIn cin >> test #define tests for(int32_t testNo=1; testNo <= (test); testNo++) #define all(x) (x).begin(), (x).end() #define rall(x) (x).rbegin(), (x).rend() #define len(a) ((int64_t)(a).size()) #define lcm(a, b) (((a)*(b))/gcd(a,b)) #define ff first #define ss second #define Yes cout << "Yes" << endl #define No cout << "No" << endl #define YES cout << "YES" << endl #define NO cout << "NO" << endl #define finish return 0 #define clean fflush(stdout) #define Inf (lli)(1e9) #define Eps (ld)(1e-9) #define PI (ld)(3.141592653589793238462643383279502884197169L) #define MOD (int32_t)(1e9+7) // // --- Sample implementation for the task books --- // // To compile this program with the sample grader, place: // books.h books_sample.cpp sample_grader.cpp // in a single folder and run: // g++ books_sample.cpp sample_grader.cpp // in this folder. // void solve(int N, int K, long long A, int S) { // TODO implement this function vi books; f1(i, N) { books.push_back(skim(i)); } f1(mid, N-2) { int32_t i = 0, j = N-1; while(i < mid && mid < j) { if(books[i] + books[mid] + books[j] > 2*A) { j--; } else if(books[i] + books[mid] + books[j] < A) { i++; } else { answer({i+1, j+1, mid+1}); return; } } } }
#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...