Mostly, it is students from English mediun schools who appear in this competition
@allcoding1_official
@allcoding1_official
How many pairs of letters are there in the word "DYNASTY" which has as many letters between them (from both the sides) as in the alphabets from A to Z?
A) 2
@allcoding1_official
A) 2
@allcoding1_official
In MS Word, how can a document be split into multiple parts such that each part can have different formats and layouts
Ans)By creating sections
@allcoding1_official
Ans)By creating sections
@allcoding1_official
Which of the statement(s) given below is/are correct?
1)Routers can be static or dynamic
2)Routers connect two or more separate networks,
Ans) both 1 and 2
@allcoding1_official
1)Routers can be static or dynamic
2)Routers connect two or more separate networks,
Ans) both 1 and 2
@allcoding1_official
X(1), (2)
int count;
// Line 1
Antint i) { count 1)
int getcount () {return count)
// Line 5
public class Book
public static void main(String[] args)
System.out.println(AB.X.count + AB.Y.count); // Line 10
Ans)Compile time error at "// Line 10"
@allcoding1_official
int count;
// Line 1
Antint i) { count 1)
int getcount () {return count)
// Line 5
public class Book
public static void main(String[] args)
System.out.println(AB.X.count + AB.Y.count); // Line 10
Ans)Compile time error at "// Line 10"
@allcoding1_official
👍2
allcoding1_official
Photo
class TreeNode:
def init(self, val):
self.val = val
self.children = []
def build_tree(units, relationships):
nodes = {i: TreeNode(units[i]) for i in range(len(units))}
for rel in relationships:
parent, child = rel
nodes[parent].children.append(nodes[child])
return nodes[0]
def max_electricity_per_floor(root):
max_electricity = 0
floor_electricity = {}
def dfs(node, level):
nonlocal max_electricity
if level not in floor_electricity:
floor_electricity[level] = 0
floor_electricity[level] += node.val
max_electricity = max(max_electricity, floor_electricity[level])
for child in node.children:
dfs(child, level + 1)
dfs(root, 0)
return max_electricity
num = int(input())
units = list(map(int, input().split()))
numRel, memConnect = map(int, input().split())
relationships = [tuple(map(int, input().split())) for _ in range(numRel)]
root = build_tree(units, relationships)
result = max_electricity_per_floor(root)
print(result)
Apartment one
@allcoding1_official
def init(self, val):
self.val = val
self.children = []
def build_tree(units, relationships):
nodes = {i: TreeNode(units[i]) for i in range(len(units))}
for rel in relationships:
parent, child = rel
nodes[parent].children.append(nodes[child])
return nodes[0]
def max_electricity_per_floor(root):
max_electricity = 0
floor_electricity = {}
def dfs(node, level):
nonlocal max_electricity
if level not in floor_electricity:
floor_electricity[level] = 0
floor_electricity[level] += node.val
max_electricity = max(max_electricity, floor_electricity[level])
for child in node.children:
dfs(child, level + 1)
dfs(root, 0)
return max_electricity
num = int(input())
units = list(map(int, input().split()))
numRel, memConnect = map(int, input().split())
relationships = [tuple(map(int, input().split())) for _ in range(numRel)]
root = build_tree(units, relationships)
result = max_electricity_per_floor(root)
print(result)
Apartment one
@allcoding1_official
👍4
int main() {
ll N;
cin >> N;
vector<ll> w(N);
for(ll i = 0; i < N; ++i) {
cin >> w[i];
}
vector<ll> s(N, 15);
for(ll i = N-2; i >= 0; --i) {
for(ll j = i+1; j < N; ++j) {
if(w[i] < w[j]) {
s[i] = 10;
for(ll k = j+1; k < N; ++k) {
if(w[j] > w[k]) {
s[i] = 5;
break;
}
}
break;
}
}
}
ll g = 0;
for(ll sc : s) {
g += sc;
}
cout << g << endl;
return 0;
}
chair manufacture
@allcoding1_official
ll N;
cin >> N;
vector<ll> w(N);
for(ll i = 0; i < N; ++i) {
cin >> w[i];
}
vector<ll> s(N, 15);
for(ll i = N-2; i >= 0; --i) {
for(ll j = i+1; j < N; ++j) {
if(w[i] < w[j]) {
s[i] = 10;
for(ll k = j+1; k < N; ++k) {
if(w[j] > w[k]) {
s[i] = 5;
break;
}
}
break;
}
}
}
ll g = 0;
for(ll sc : s) {
g += sc;
}
cout << g << endl;
return 0;
}
chair manufacture
@allcoding1_official
👍2