Off Campus Job Update
6.52K subscribers
313 photos
3 videos
22 files
968 links
500+ Placement & Competitive Exam Materials
75+ Companies Materials
100+ JOB Updates in a Month

๐Ÿš€DM for Promotion @Wren_0
๐Ÿš€Placement Updates: @offcampusjobs_0
๐ŸŒŸ Placment Material: @placement_materials0
Download Telegram
#include<bits/stdc++.h>
using namespace std;
#define ll long long
#define MOD 998244353
#define add(x,y) ((x+y)%MOD)
#define mul(x,y) ((x*y)%MOD)
#define sub(x,y) ((MOD+x-y)%MOD)
ll fastpow(ll x, ll y){
ll temp = 1;
while(y){
if(y&1)
temp = mul(temp, x);
x = mul(x, x);
y>>=1;
}
return temp;
}

ll inv(ll x){
return fastpow(x,MOD-2);
}

ll frac[200100];

ll C(ll n, ll i){
return mul(frac[n], inv(mul(frac[i], frac[n-i])));
}

int main(){
ios::sync_with_stdio(0);
cin.tie(0);
cout.tie(0);

int n,k;
cin>>n>>k;

if(k>=n){
cout<<0<<endl;
return 0;
}

ll ans = 0;
frac[0] = 1;
for(int i=1;i<=n;++i){
frac[i] = mul(i, frac[i-1]);
}
for(int i=0;i<=n-k;++i){
ll temp = mul(C(n-k,i), fastpow(n-k-i,n));
if(i&1)
ans = sub(ans, temp);
else
ans = add(ans,temp);
}

ans = mul(ans, C(n, n-k));
if(k)
ans = mul(ans, 2);
cout<<ans<<endl;
}

CHESS GAME CODE

Telegram - https://t.me/Coding_solution_0
Channel name was changed to ยซTCS NQT 7 JAN SOLUTION / ALL EXAM SOLUTIONยป
class Solution:

def calculateMinimumHP(self, dungeon: List[List[int]]) -> int:
def oneIfNotPos(a):
return a if a > 0 else 1

def f(i: int, j: int) -> int:
cached = self.cache.get((i, j))
if cached:
return cached

answer = min(oneIfNotPos(f(i, j + 1) - dungeon[i][j]), \
oneIfNotPos(f(i + 1, j) - dungeon[i][j]))

self.cache[(i, j)] = answer
return answer

m = len(dungeon)
n = len(dungeon[0])

# init cache to remove ifs from f
self.cache = {(m - 1, n - 1): oneIfNotPos(1 - dungeon[m - 1][n - 1])}
for i in range(0, m):
self.cache[(i, n)] = 1000 000000 # inf
for j in range(0, n):
self.cache[(m, j)] = 10000 00000 # inf

return f(0, 0)

Python
Dungeon Hunters

Telegram -https://t.me/Coding_solution_0
Forwarded from Off Campus Job Update
class Solution:

def calculateMinimumHP(self, dungeon: List[List[int]]) -> int:
def oneIfNotPos(a):
return a if a > 0 else 1

def f(i: int, j: int) -> int:
cached = self.cache.get((i, j))
if cached:
return cached

answer = min(oneIfNotPos(f(i, j + 1) - dungeon[i][j]), \
oneIfNotPos(f(i + 1, j) - dungeon[i][j]))

self.cache[(i, j)] = answer
return answer

m = len(dungeon)
n = len(dungeon[0])

# init cache to remove ifs from f
self.cache = {(m - 1, n - 1): oneIfNotPos(1 - dungeon[m - 1][n - 1])}
for i in range(0, m):
self.cache[(i, n)] = 1000 000000 # inf
for j in range(0, n):
self.cache[(m, j)] = 10000 00000 # inf

return f(0, 0)

Python
Dungeon Hunters

Telegram -https://t.me/Coding_solution_0
Tcs coding

1.D
2.break
3.arrayindexout
4.B
5.B
6.D

Telegram - https://t.me/Coding_solution_0
Tcs coding

1.D
2.break
3.arrayindexout
4.B
5.B
6.D
7.change control

Telegram -https://t.me/Coding_solution_0
Tcs coding

1.D
2.break
3.arrayindexout
4.B
5.B
6.D
7.change control
8.37

Telegram - https://t.me/Coding_solution_0
Tcs coding

1.D
2.break
3.arrayindexout
4.B
5.B
6.D
7.change control
8.37

https://t.me/Coding_solution_0
9.10
โœ…Working with codes

โœ…
Tcs coding

1.D
2.break
3.arrayindexout
4.B
5.B
6.D
7.change control
8-37
9-10
10-2

Telegram - https://t.me/Coding_solution_0
C language
N Numbers Code
Telegram -
C language
N Numbers Code
Telegram -
โœ…Working with codes

โœ…Guys if you cant send messages in discussion group

Join this the problem will resolve
https://t.me/company_0
https://t.me/company_0
https://t.me/company_0
C language
N Numbers Code
Telegram -
https://t.me/company_0
https://t.me/company_0
Channel name was changed to ยซINFOSYS JAN SOLUTION / ALL EXAM SOLUTIONยป
max_li=[]
def longest_subarray(arr, d):
(i, j, e) = (0, 1, 0)
for i in range(d - 1):
if arr[i] == arr[i + 1]:
j += 1
else:
j = 1
if e < j:
e = j
return e
temp=li.copy()
for each in li:
max_li.append(longest_subarray(temp, len(temp)))
temp=li.copy()
while(True):
try:
temp.remove(each)
except:
break
print(max(max_li))

Python
Ali army
Telegram-
https://t.me/Coding_solution_0
INFOSYS EXAM ALL SLOTS SOLUTION GROUP ๐Ÿ‘‡

Telegram - https://t.me/Coding_solution_0

Telegram - GROUP
https://t.me/good_coders

โœ… Share post in ur college Whatsapp grps.