A lot of battleships of evil are arranged in a line before the battle. Our commander decides to use our secret weapon to eliminate the battleships. Each of the battleships can be marked a value of endurance. For every attack of our secret weapon, it…
Can you answer these queries? Time Limit: 4000/2000 MS (Java/Others) Memory Limit: 65768/65768 K (Java/Others) Total Submission(s): 16260 Accepted Submission(s): 3809 Problem Description A lot of battleships of evil are arranged in a line befor…
F. String Set Queries time limit per test:3 seconds memory limit per test:768 megabytes input:standard input output:standard output You should process m queries over a set D of strings. Each query is one of three kinds: Add a string s to the set D. I…
Save the Students Time Limit:134MS Memory Limit:0KB 64bit IO Format:%lld & %llu Description Hogwarts is under attack by the Dark Lord, He-Who-Must-Not-Be-Named. To protect the students, Harry Potter must cast protective spells so that those…
You are given a sequence A[1], A[2], ..., A[N] . ( |A[i]| ≤ 15007 , 1 ≤ N ≤ 50000 ). A query is defined as follows: Query(x,y) = Max { a[i]+a[i+1]+...+a[j] ; x ≤ i ≤ j ≤ y }. Given M queries, your program must output the results of these queries. Inp…