제출 #1127840

#제출 시각아이디문제언어결과실행 시간메모리
1127840totoroPyramids (IOI24_pyramids)C++20
100 / 100
76 ms5064 KiB
#include "pyramids.h" #include <cassert> std::vector<long long> preA, preB; void init(std::vector<int> A, std::vector<int> B) { preA.resize(A.size() + 1, 0); preB.resize(B.size() + 1, 0); assert(A.size() == B.size()); int n = A.size(); for (int i = 0; i < n; ++i) { preA[i + 1] = preA[i] + A[i]; preB[i + 1] = preB[i] + B[i]; } } bool can_transform(int L, int R, int X, int Y) { return (preA[R + 1] - preA[L]) == (preB[Y + 1] - preB[X]); }
#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...