Title: Boleyn salary (Python or cpp only) · Issue #116 · ArmanKumar21/python-cpp-html-programs-projects · GitHub
Open Graph Title: Boleyn salary (Python or cpp only) · Issue #116 · ArmanKumar21/python-cpp-html-programs-projects
X Title: Boleyn salary (Python or cpp only) · Issue #116 · ArmanKumar21/python-cpp-html-programs-projects
Description: Hey? Everyone... Help me with this problem. Boleyn Su runs a company called Acme. There are N employees in the company, and each one of them is represented by a unique employee id whose range lies in [1, N]. Being the head of company, Bo...
Open Graph Description: Hey? Everyone... Help me with this problem. Boleyn Su runs a company called Acme. There are N employees in the company, and each one of them is represented by a unique employee id whose range lies ...
X Description: Hey? Everyone... Help me with this problem. Boleyn Su runs a company called Acme. There are N employees in the company, and each one of them is represented by a unique employee id whose range lies ...
Opengraph URL: https://github.com/ArmanKumar21/python-cpp-html-programs-projects/issues/116
X: @github
Domain: patch-diff.githubusercontent.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Boleyn salary (Python or cpp only)","articleBody":"Hey? Everyone... Help me with this problem.\r\n\r\nBoleyn Su runs a company called Acme. There are N employees in the company, and each one of them is represented by a unique employee id whose range lies in [1, N]. Being the head of company, Boleyn's employee id is 1.\r\n\r\nEach employee, except Boleyn, has exactly one direct superior. This means that the hierarchial structure of the company is like a tree, where\r\n\r\nBoleyn, employee id 1, represents the root node.\r\nEach pair of employee is directly or indirectly connected to one another.\r\nThere is no cycle.\r\nLet's represent the salary by the array s = {s[1], s[2], s[3]..., s[N]}, where s[i] is the salary of the ith employee. Salary structure in the company is non-uniform. Even a subordinate may get a higher salary than her superior. Some of the employees in Acme are curious about who gets the kth lowest salary among her subordinates. Help them in solving their query.\r\n\r\nNote\r\n\r\n1st lowest salary is equivalent to lowest salary, 2nd lowest means lowest salary which is greater that 1st lowest salary, and so on.\r\nSalary of each employee is different.\r\nIt is not necessary that the people who are placed higher on hierarchy will have a greater salary than their subordinates.\r\nInput Format\r\nThe first line contains two space separated integers, N Q, where N is the number of employees in Acme, and Q is the number of queries.\r\nThen follows N-1 lines. Each of these lines contain two space separated integers, u p, where p is the superior of u. u and p are employees id.\r\nIn the next line there are N space separated integers, s[1] s[2] ... s[n], where s[i], i ∈ [1..N], is the salary of ith employee.\r\nThen, Q queries follow. Each query contains two space separated integers, v k. See output format for it's definition.\r\n\r\nOutput format\r\nFor the first query, print the id of employee who has the kth lowest salary among the subordinates of v.\r\nFor the subsequent queries, we need to find the kth lowest salary of the subordinates of v+d, where d is the answer of previous query.\r\n\r\nConstraints\r\n1 ≤ N ≤ 3*104\r\n1 ≤ Q ≤ 3*104\r\n1 ≤ s[ i ] ≤ 109, i ∈ [1..N]\r\ns[ i ] ≠ s[ j ], 1 ≤ i \u003c j ≤ N\r\n1 ≤ u, p ≤ N, u ≠ p\r\n-N ≤ d ≤ N\r\nFor 1st query, 1 ≤ v ≤ N\r\nFor later queries, 1 ≤ v+d ≤ N\r\nFor each query, 1 ≤ K ≤ Number_of_subordinates\r\n\r\nSample Input\r\n\r\n8 7\r\n2 1\r\n3 2\r\n4 2\r\n7 4\r\n8 4\r\n5 1\r\n6 5\r\n70 40 60 80 10 20 30 50\r\n2 1\r\n-6 5\r\n-4 1\r\n-5 3\r\n2 1\r\n-5 4\r\n2 2\r\nSample Output\r\n\r\n7\r\n8\r\n7\r\n3\r\n6\r\n2\r\n8","author":{"url":"https://github.com/ArmanKumar21","@type":"Person","name":"ArmanKumar21"},"datePublished":"2022-10-15T13:49:05.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":4},"url":"https://github.com/116/python-cpp-html-programs-projects/issues/116"}
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:7d6cb524-a8d2-54c9-7289-29c53d677858 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | E120:F6370:68A0613:8E42520:69786450 |
| html-safe-nonce | df419fb407b88be9c34e7f0768c3a3c4231bf4733700dd995c5fb090ce2f8289 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJFMTIwOkY2MzcwOjY4QTA2MTM6OEU0MjUyMDo2OTc4NjQ1MCIsInZpc2l0b3JfaWQiOiI3ODgyMzk0NDQ2MDY5MjYxMzkyIiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0= |
| visitor-hmac | 69e4f9ee1716f2ca752d7f263dfc6c6c2f50ed0a716771bb5795df26e19e1aa8 |
| hovercard-subject-tag | issue:1410173050 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/ArmanKumar21/python-cpp-html-programs-projects/116/issue_layout |
| twitter:image | https://opengraph.githubassets.com/a2ac7a97abd8c66e07ec2490fae89fd46ff1a825508249d2c38a3eb87483c505/ArmanKumar21/python-cpp-html-programs-projects/issues/116 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/a2ac7a97abd8c66e07ec2490fae89fd46ff1a825508249d2c38a3eb87483c505/ArmanKumar21/python-cpp-html-programs-projects/issues/116 |
| og:image:alt | Hey? Everyone... Help me with this problem. Boleyn Su runs a company called Acme. There are N employees in the company, and each one of them is represented by a unique employee id whose range lies ... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | ArmanKumar21 |
| hostname | github.com |
| expected-hostname | github.com |
| None | 2981c597c945c1d90ac6fa355ce7929b2f413dfe7872ca5c435ee53a24a1de50 |
| turbo-cache-control | no-preview |
| go-import | github.com/ArmanKumar21/python-cpp-html-programs-projects git https://github.com/ArmanKumar21/python-cpp-html-programs-projects.git |
| octolytics-dimension-user_id | 99328861 |
| octolytics-dimension-user_login | ArmanKumar21 |
| octolytics-dimension-repository_id | 547871299 |
| octolytics-dimension-repository_nwo | ArmanKumar21/python-cpp-html-programs-projects |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 547871299 |
| octolytics-dimension-repository_network_root_nwo | ArmanKumar21/python-cpp-html-programs-projects |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 520b65a872113b919c1bbdb03834a50af15859fd |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width