#4199
flowers
Grădina Academiei Shuchi’in are forma unui pătrat cu latura de N
metri și este împărțit în N × N
parcele pătrate cu dimensiunea de 1
metru. Harta grădinii arată că parcelele sunt aranjate pe linii și coloane și sunt notate cu perechi (r, c)
, unde r
este linia și c
coloana pe care o ocupă parcela. Unele parcele, marcate cu 0
pe harta grădinii, conțin copaci străvechi care nu au putut fi mutați sau tăiați când grădina a fost restaurată. Alte parcele, marcate cu 1
, conțin flori. Notăm cu F
numărul total de parcele care conțin flori. Kaguya definește gradul de înflorire a unei parcele ca fiind suma distanțelor de la parcela curentă la cele mai apropiate K
parcele care conțin flori. Ea vrea să știe gradul de înflorire al fiecărei parcele.
Problema | flowers | Operații I/O | tastatură/ecran |
---|---|---|---|
Limita timp | 0.5 secunde | Limita memorie |
Total: 256 MB
/
Stivă 64 MB
|
Id soluție | #55107070 | Utilizator | |
Fișier | flowers.cpp | Dimensiune | 4.75 KB |
Data încărcării | 24 Decembrie 2024, 14:26 | Scor / rezultat | Eroare de compilare |
flowers.cpp:2:0: warning: ignoring #pragma GCC optimization [-Wunknown-pragmas] #pragma GCC optimization("unroll-loops") ^ flowers.cpp:25:8: warning: attribute ignored [-Wattributes] static alignas(32) Point flowers[MAXF]; // Align for SIMD ^ flowers.cpp:25:8: note: an attribute that appertains to a type-specifier is ignored flowers.cpp:26:8: warning: attribute ignored [-Wattributes] static alignas(32) KDNode tree[400000]; ^ flowers.cpp:26:8: note: an attribute that appertains to a type-specifier is ignored flowers.cpp:35:8: warning: attribute ignored [-Wattributes] static alignas(32) Candidate best_buffer[1000]; // Pre-allocated buffer for candidates ^ flowers.cpp:35:8: note: an attribute that appertains to a type-specifier is ignored flowers.cpp: In function 'int build_kdtree(Point*, int, int)': flowers.cpp:37:43: error: inlining failed in call to always_inline 'int build_kdtree(Point*, int, int)': recursive inlining __attribute__((always_inline)) inline int build_kdtree(Point *pts, int size, int depth) { ^ flowers.cpp:50:57: error: called from here tree[idx].left = build_kdtree(pts, median, depth + 1); ^ flowers.cpp:37:43: error: inlining failed in call to always_inline 'int build_kdtree(Point*, int, int)': recursive inlining __attribute__((always_inline)) inline int build_kdtree(Point *pts, int size, int depth) { ^ flowers.cpp:51:82: error: called from here tree[idx].right = build_kdtree(pts + median + 1, size - median - 1, depth + 1); ^ flowers.cpp:37:43: error: inlining failed in call to always_inline 'int build_kdtree(Point*, int, int)': recursive inlining __attribute__((always_inline)) inline int build_kdtree(Point *pts, int size, int depth) { ^ flowers.cpp:50:57: error: called from here tree[idx].left = build_kdtree(pts, median, depth + 1); ^ flowers.cpp:37:43: error: inlining failed in call to always_inline 'int build_kdtree(Point*, int, int)': recursive inlining __attribute__((always_inline)) inline int build_kdtree(Point *pts, int size, int depth) { ^ flowers.cpp:51:82: error: called from here tree[idx].right = build_kdtree(pts + median + 1, size - median - 1, depth + 1); ^ flowers.cpp:37:43: error: inlining failed in call to always_inline 'int build_kdtree(Point*, int, int)': recursive inlining __attribute__((always_inline)) inline int build_kdtree(Point *pts, int size, int depth) { ^ flowers.cpp:50:57: error: called from here tree[idx].left = build_kdtree(pts, median, depth + 1); ^ flowers.cpp:37:43: error: inlining failed in call to always_inline 'int build_kdtree(Point*, int, int)': recursive inlining __attribute__((always_inline)) inline int build_kdtree(Point *pts, int size, int depth) { ^ flowers.cpp:51:82: error: called from here tree[idx].right = build_kdtree(pts + median + 1, size - median - 1, depth + 1); ^ flowers.cpp:37:43: error: inlining failed in call to always_inline 'int build_kdtree(Point*, int, int)': recursive inlining __attribute__((always_inline)) inline int build_kdtree(Point *pts, int size, int depth) { ^ flowers.cpp:50:57: error: called from here tree[idx].left = build_kdtree(pts, median, depth + 1); ^ flowers.cpp:37:43: error: inlining failed in call to always_inline 'int build_kdtree(Point*, int, int)': recursive inlining __attribute__((always_inline)) inline int build_kdtree(Point *pts, int size, int depth) { ^ flowers.cpp:51:82: error: called from here tree[idx].right = build_kdtree(pts + median + 1, size - median - 1, depth + 1); ^ flowers.cpp:37:43: error: inlining failed in call to always_inline 'int build_kdtree(Point*, int, int)': recursive inlining __attribute__((always_inline)) inline int build_kdtree(Point *pts, int size, int depth) { ^ flowers.cpp:50:57: error: called from here tree[idx].left = build_kdtree(pts, median, depth + 1); ^ flowers.cpp:37:43: error: inlining failed in call to always_inline 'int build_kdtree(Point*, int, int)': recursive inlining __attribute__((always_inline)) inline int build_kdtree(Point *pts, int size, int depth) { ^ flowers.cpp:51:82: error: called from here tree[idx].right = build_kdtree(pts + median + 1, size - median - 1, depth + 1); ^ flowers.cpp:37:43: error: inlining failed in call to always_inline 'int build_kdtree(Point*, int, int)': recursive inlining __attribute__((always_inline)) inline int build_kdtree(Point *pts, int size, int depth) { ^ flowers.cpp:51:82: error: called from here tree[idx].right = build_kdtree(pts + median + 1, size - median - 1, depth + 1); ^ flowers.cpp:37:43: error: inlining failed in call to always_inline 'int build_kdtree(Point*, int, int)': recursive inlining __attribute__((always_inline)) inline int build_kdtree(Point *pts, int size, int depth) { ^ flowers.cpp:50:57: error: called from here tree[idx].left = build_kdtree(pts, median, depth + 1); ^ flowers.cpp:37:43: error: inlining failed in call to always_inline 'int build_kdtree(Point*, int, int)': recursive inlining __attribute__((always_inline)) inline int build_kdtree(Point *pts, int size, int depth) { ^ flowers.cpp:51:82: error: called from here tree[idx].right = build_kdtree(pts + median + 1, size - median - 1, depth + 1); ^ flowers.cpp: In function 'void knn_search(int, int, int, int, Candidate*, int&)': flowers.cpp:84:44: error: inlining failed in call to always_inline 'void knn_search(int, int, int, int, Candidate*, int&)': recursive inlining __attribute__((always_inline)) inline void knn_search(const int root_idx, const int tx, const int ty, const int K, Candidate *best, int &count) { ^ flowers.cpp:99:48: error: called from here knn_search(primary, tx, ty, K, best, count); ^ flowers.cpp: In function 'int main()': flowers.cpp:37:43: error: inlining failed in call to always_inline 'int build_kdtree(Point*, int, int)': recursive inlining __attribute__((always_inline)) inline int build_kdtree(Point *pts, int size, int depth) { ^ flowers.cpp:50:57: error: called from here tree[idx].left = build_kdtree(pts, median, depth + 1); ^ flowers.cpp:37:43: error: inlining failed in call to always_inline 'int build_kdtree(Point*, int, int)': recursive inlining __attribute__((always_inline)) inline int build_kdtree(Point *pts, int size, int depth) { ^ flowers.cpp:51:82: error: called from here tree[idx].right = build_kdtree(pts + median + 1, size - median - 1, depth + 1); ^ flowers.cpp:37:43: error: inlining failed in call to always_inline 'int build_kdtree(Point*, int, int)': recursive inlining __attribute__((always_inline)) inline int build_kdtree(Point *pts, int size, int depth) { ^ flowers.cpp:50:57: error: called from here tree[idx].left = build_kdtree(pts, median, depth + 1); ^ flowers.cpp:37:43: error: inlining failed in call to always_inline 'int build_kdtree(Point*, int, int)': recursive inlining __attribute__((always_inline)) inline int build_kdtree(Point *pts, int size, int depth) { ^ flowers.cpp:51:82: error: called from here tree[idx].right = build_kdtree(pts + median + 1, size - median - 1, depth + 1); ^ flowers.cpp:37:43: error: inlining failed in call to always_inline 'int build_kdtree(Point*, int, int)': recursive inlining __attribute__((always_inline)) inline int build_kdtree(Point *pts, int size, int depth) { ^ flowers.cpp:50:57: error: called from here tree[idx].left = build_kdtree(pts, median, depth + 1); ^ flowers.cpp:37:43: error: inlining failed in call to always_inline 'int build_kdtree(Point*, int, int)': recursive inlining __attribute__((always_inline)) inline int build_kdtree(Point *pts, int size, int depth) { ^ flowers.cpp:51:82: error: called from here tree[idx].right = build_kdtree(pts + median + 1, size - median - 1, depth + 1); ^ flowers.cpp:37:43: error: inlining failed in call to always_inline 'int build_kdtree(Point*, int, int)': recursive inlining __attribute__((always_inline)) inline int build_kdtree(Point *pts, int size, int depth) { ^ flowers.cpp:50:57: error: called from here tree[idx].left = build_kdtree(pts, median, depth + 1); ^ flowers.cpp:37:43: error: inlining failed in call to always_inline 'int build_kdtree(Point*, int, int)': recursive inlining __attribute__((always_inline)) inline int build_kdtree(Point *pts, int size, int depth) { ^ flowers.cpp:51:82: error: called from here tree[idx].right = build_kdtree(pts + median + 1, size - median - 1, depth + 1); ^ flowers.cpp:37:43: error: inlining failed in call to always_inline 'int build_kdtree(Point*, int, int)': recursive inlining __attribute__((always_inline)) inline int build_kdtree(Point *pts, int size, int depth) { ^ flowers.cpp:50:57: error: called from here tree[idx].left = build_kdtree(pts, median, depth + 1); ^ flowers.cpp:37:43: error: inlining failed in call to always_inline 'int build_kdtree(Point*, int, int)': recursive inlining __attribute__((always_inline)) inline int build_kdtree(Point *pts, int size, int depth) { ^ flowers.cpp:51:82: error: called from here tree[idx].right = build_kdtree(pts + median + 1, size - median - 1, depth + 1); ^ flowers.cpp:37:43: error: inlining failed in call to always_inline 'int build_kdtree(Point*, int, int)': recursive inlining __attribute__((always_inline)) inline int build_kdtree(Point *pts, int size, int depth) { ^ flowers.cpp:51:82: error: called from here tree[idx].right = build_kdtree(pts + median + 1, size - median - 1, depth + 1); ^ flowers.cpp:37:43: error: inlining failed in call to always_inline 'int build_kdtree(Point*, int, int)': recursive inlining __attribute__((always_inline)) inline int build_kdtree(Point *pts, int size, int depth) { ^ flowers.cpp:50:57: error: called from here tree[idx].left = build_kdtree(pts, median, depth + 1); ^ flowers.cpp:37:43: error: inlining failed in call to always_inline 'int build_kdtree(Point*, int, int)': recursive inlining __attribute__((always_inline)) inline int build_kdtree(Point *pts, int size, int depth) { ^ flowers.cpp:51:82: error: called from here tree[idx].right = build_kdtree(pts + median + 1, size - median - 1, depth + 1); ^ flowers.cpp:37:43: error: inlining failed in call to always_inline 'int build_kdtree(Point*, int, int)': recursive inlining __attribute__((always_inline)) inline int build_kdtree(Point *pts, int size, int depth) { ^ flowers.cpp:50:57: error: called from here tree[idx].left = build_kdtree(pts, median, depth + 1); ^ flowers.cpp:37:43: error: inlining failed in call to always_inline 'int build_kdtree(Point*, int, int)': recursive inlining __attribute__((always_inline)) inline int build_kdtree(Point *pts, int size, int depth) { ^ flowers.cpp:51:82: error: called from here tree[idx].right = build_kdtree(pts + median + 1, size - median - 1, depth + 1); ^ flowers.cpp:37:43: error: inlining failed in call to always_inline 'int build_kdtree(Point*, int, int)': recursive inlining __attribute__((always_inline)) inline int build_kdtree(Point *pts, int size, int depth) { ^ flowers.cpp:50:57: error: called from here tree[idx].left = build_kdtree(pts, median, depth + 1); ^ flowers.cpp:37:43: error: inlining failed in call to always_inline 'int build_kdtree(Point*, int, int)': recursive inlining __attribute__((always_inline)) inline int build_kdtree(Point *pts, int size, int depth) { ^ flowers.cpp:51:82: error: called from here tree[idx].right = build_kdtree(pts + median + 1, size - median - 1, depth + 1); ^ flowers.cpp:37:43: error: inlining failed in call to always_inline 'int build_kdtree(Point*, int, int)': recursive inlining __attribute__((always_inline)) inline int build_kdtree(Point *pts, int size, int depth) { ^ flowers.cpp:50:57: error: called from here tree[idx].left = build_kdtree(pts, median, depth + 1); ^ flowers.cpp:37:43: error: inlining failed in call to always_inline 'int build_kdtree(Point*, int, int)': recursive inlining __attribute__((always_inline)) inline int build_kdtree(Point *pts, int size, int depth) { ^ flowers.cpp:51:82: error: called from here tree[idx].right = build_kdtree(pts + median + 1, size - median - 1, depth + 1); ^ flowers.cpp:37:43: error: inlining failed in call to always_inline 'int build_kdtree(Point*, int, int)': recursive inlining __attribute__((always_inline)) inline int build_kdtree(Point *pts, int size, int depth) { ^ flowers.cpp:50:57: error: called from here tree[idx].left = build_kdtree(pts, median, depth + 1); ^ flowers.cpp:37:43: error: inlining failed in call to always_inline 'int build_kdtree(Point*, int, int)': recursive inlining __attribute__((always_inline)) inline int build_kdtree(Point *pts, int size, int depth) { ^ flowers.cpp:51:82: error: called from here tree[idx].right = build_kdtree(pts + median + 1, size - median - 1, depth + 1); ^ flowers.cpp:37:43: error: inlining failed in call to always_inline 'int build_kdtree(Point*, int, int)': recursive inlining __attribute__((always_inline)) inline int build_kdtree(Point *pts, int size, int depth) { ^ flowers.cpp:50:57: error: called from here tree[idx].left = build_kdtree(pts, median, depth + 1); ^ flowers.cpp:37:43: error: inlining failed in call to always_inline 'int build_kdtree(Point*, int, int)': recursive inlining __attribute__((always_inline)) inline int build_kdtree(Point *pts, int size, int depth) { ^ flowers.cpp:51:82: error: called from here tree[idx].right = build_kdtree(pts + median + 1, size - median - 1, depth + 1); ^ flowers.cpp:37:43: error: inlining failed in call to always_inline 'int build_kdtree(Point*, int, int)': recursive inlining __attribute__((always_inline)) inline int build_kdtree(Point *pts, int size, int depth) { ^ flowers.cpp:51:82: error: called from here tree[idx].right = build_kdtree(pts + median + 1, size - median - 1, depth + 1); ^ flowers.cpp:37:43: error: inlining failed in call to always_inline 'int build_kdtree(Point*, int, int)': recursive inlining __attribute__((always_inline)) inline int build_kdtree(Point *pts, int size, int depth) { ^ flowers.cpp:50:57: error: called from here tree[idx].left = build_kdtree(pts, median, depth + 1); ^ flowers.cpp:37:43: error: inlining failed in call to always_inline 'int build_kdtree(Point*, int, int)': recursive inlining __attribute__((always_inline)) inline int build_kdtree(Point *pts, int size, int depth) { ^ flowers.cpp:51:82: error: called from here tree[idx].right = build_kdtree(pts + median + 1, size - median - 1, depth + 1); ^ flowers.cpp:84:44: error: inlining failed in call to always_inline 'void knn_search(int, int, int, int, Candidate*, int&)': recursive inlining __attribute__((always_inline)) inline void knn_search(const int root_idx, const int tx, const int ty, const int K, Candidate *best, int &count) { ^ flowers.cpp:99:48: error: called from here knn_search(primary, tx, ty, K, best, count); ^ flowers.cpp: At global scope: flowers.cpp:35:30: warning: 'best_buffer' defined but not used [-Wunused-variable] static alignas(32) Candidate best_buffer[1000]; // Pre-allocated buffer for candidates ^
www.pbinfo.ro permite evaluarea a două tipuri de probleme:
Problema flowers face parte din prima categorie. Soluția propusă de tine va fi evaluată astfel:
Suma punctajelor acordate pe testele utilizate pentru verificare este 100. Astfel, soluția ta poate obține cel mult 100 de puncte, caz în care se poate considera corectă.