Posts

Showing posts from August, 2022
                                                                               A. George and Accommodation time limit per test 1 second memory limit per test 256 megabytes input standard input output standard output George has recently entered the BSUCP (Berland State University for Cool Programmers). George has a friend Alex who has also entered the university. Now they are moving into a dormitory. George and Alex want to live in the same room. The dormitory has  n  rooms in total. At the moment the  i -th room has  p i  people living in it and the room can accommodate  q i  people in total ( p i  ≤  q i ). Your task is to count how many rooms has free place for both George and Alex. Input The first line contains a single integer  n   (1 ≤  n  ≤...
                                                                                    B. Colourblindness time limit per test 1 second memory limit per test 256 megabytes input standard input output standard output Vasya has a grid with  2 2  rows and  n n  columns. He colours each cell red, green, or blue. Vasya is colourblind and can't distinguish green from blue. Determine if Vasya will consider the two rows of the grid to be coloured the same. Input The input consists of multiple test cases. The first line contains an integer  t t  ( 1 ≤ t ≤ 100 1 ≤ t ≤ 100 ) — the number of test cases. The description of the test cases follows. The first line of each test case contains an integer  n n  ( 1 ≤ n ≤ 100 1 ≤ n ≤ 100 ) — the number of ...
Image
 Linked List Data structure with C++ linked list(LL) is a linear data structure that includes a series of connected nodes. Here, each node stores the data and the address of the next node. For example,                                                                                                                   fig: Data Structure