Skip to content

Instantly share code, notes, and snippets.

🎯
Busy

Thameem Karakkoth thameemk612

🎯
Busy
Block or report user

Report or block thameemk612

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View config.php
<?php
defined('BASEPATH') OR exit('No direct script access allowed');
/*
|--------------------------------------------------------------------------
| Base Site URL
|--------------------------------------------------------------------------
|
| URL to your CodeIgniter root. Typically this will be your base URL,
| WITH a trailing slash:
View database.php
<?php
defined('BASEPATH') OR exit('No direct script access allowed');
$active_group = 'default';
$query_builder = TRUE;
$db['default'] = array(
'dsn' => '',
'hostname' => 'localhost',
'username' => 'root',
View 111
T=input()
a=[]
b=[]
c=[]
d=[]
for i in range(int(T)):
N=int(input())
for num in range(N,2**N):
prime = True
for i in range(2,num):
View Links
View css links
View 8
Some years ago, there lived a farmer named Duncan in a far away land. Duncan had a cow named Wowie and he was deeply attached to her. Duncan would spend the whole summer stocking hay to feed Wowie in winter. Duncan collected hay and put it into haystack. As Duncan was a bright farmer, he collected the hay into cubical hay blocks of the same size and stored the blocks in his barn. After a summer spent in hard toil, Duncan stored A·B·C hay blocks and stored them in a barn as a rectangular parallelepiped A layers high. Each layer had B rows and each row had C blocks.
At the end of the autumn Duncan came into the barn to admire one more time the hay he'd been stacking during this hard summer. Unfortunately, Duncan was shocked to see that the hay blocks had been carelessly scattered around the barn. The place was a complete mess. As it turned out, thieves had sneaked into the barn. They completely dissembled and took away a layer of blocks from the parallelepiped's front, back, top and sides. As a result, the bar
View 7
Manu needs money and decides to open his uncle’s locker. He knows that the passcode of the locker consists of n numbers, and every number is a 0 or 1. Manu has made m attempts to enter the code. After each attempt the system told him in how many position stand the right numbers. It is not said in which positions the wrong numbers stand. Manu has been so unlucky that he hasn’t entered the code where would be more than 5 correct numbers. Now Manu is completely bewildered: he thinks there’s a mistake in the system and it is self-contradictory. Calculate how many possible code variants are left that do not contradict the previous system responses.
Input The first input line contains two integers n and m which represent the number of numbers in the code and the number of attempts made by Manu. Then follow m lines, each containing space-separated si and ci which correspondingly indicate Manu’s attempt (a line containing n numbers which are 0 or 1) and the system’s response (an integer from 0 to 5 inclusively).
Ou
View 6
In a very large firm in South London, there is a cloakroom with a coat hanger. It has n hooks positioned in a row. The hooks are numbered with positive integers from 1 to n from left to right.
The firm workers have a very complex work schedule. At the beginning of a work day, all the workers are not there and the coat hanger in the cloakroom is empty. At some moments of time the workers arrive and some of them leave.
When some employee arrives, he hangs his cloak on one of the available hooks. To be of as little discomfort to his colleagues as possible, the hook where the coat will hang, is chosen like this. First the employee chooses the longest segment among available hooks following in a row. If there are several of such segments, then he chooses the one closest to the right. After that the coat is hung on the hook located in the middle of this segment. If the segment has an even number of hooks, then among two central hooks we choose the one closest to the right.
When an employee leaves, he takes his c
View 5
You have got a new job, and it's very interesting, you are a ship captain. Your first task is to move your ship from one point to another point, and for sure you want to move it at the minimum cost.
And it's well known that the shortest distance between any 2 points is the length of the line segment between these 2 points. But unfortunately there is an island in the sea, so sometimes you won't be able to move your ship in the line segment between the 2 points.
You can only move to safe points. A point is called safe if it's on the line segment between the start and end points, or if it's on the island's edge.
But you are too lucky, you have got some clever and strong workers and they can help you in your trip, they can help you move the ship in the sea and they will take 1 Egyptian pound for each moving unit in the sea, and they can carry the ship (yes, they are very strong) and walk on the island and they will take 2 Egyptian pounds for each moving unit in the island. The money which you will give to them
View 4
Find the greatest common divisor d between two integers a and b that is in a given range from low to high (inclusive), i.e. low ≤ d ≤ high. It also is possible that there is no common divisor in the given range.
You will be given the two integers a and b, then n queries. Each query is a range from low to high and you have to answer each query.
Input The first line contains two integers a and b, the two integers as described above (1 ≤ a, b ≤ 109). The second line contains one integer n, the number of queries (1 ≤ n ≤ 104). Then n lines follow, each line contains one query consisting of two integers, low and high (1 ≤ low ≤ high ≤ 109).
Output Print n lines. The i-th of them should contain the result of the i-th query in the input. If there is no common divisor in the given range for any query, you should print -1 as a result for this query.
Input Format
You can’t perform that action at this time.