Accolite python Help βοΈ π±
Test accomplished β€οΈ || Offcampus
DM for any placement Help
@Mrtrueliving_ix @Mrtrueliving_ix
#Accolite #2026Batch #Offcampus
Test accomplished β€οΈ || Offcampus
DM for any placement Help
@Mrtrueliving_ix @Mrtrueliving_ix
#Accolite #2026Batch #Offcampus
Please open Telegram to view this post
VIEW IN TELEGRAM
Please open Telegram to view this post
VIEW IN TELEGRAM
π Form Alternating String β TCS CodeVita Round 1 (Zone 1)
---
#include <bits/stdc++.h>
using namespace std;
int main() {
string s;
cin >> s;
int n = s.length(), mrtrueliving_ix = 0;
vector<int> v(n);
for (int i = 0; i < n; ++i) cin >> v[i];
// π₯ Join Telegram Channel for more codes: https://t.me/Code_alphix π₯
int le = s[0] - '0', pl = v[0];
for (int i = 1; i < n; ++i) {
if (s[i] - '0' == le) {
mrtrueliving_ix += min(pl, v[i]);
pl = max(pl, v[i]);
} else {
le = s[i] - '0';
pl = v[i];
}
}
cout << mrtrueliving_ix;
return 0;
}
--
β 100% Correct Solution (C++)
π¬ @Mrtrueliving_ix
π More codes: @Code_alphix
---
#include <bits/stdc++.h>
using namespace std;
int main() {
string s;
cin >> s;
int n = s.length(), mrtrueliving_ix = 0;
vector<int> v(n);
for (int i = 0; i < n; ++i) cin >> v[i];
// π₯ Join Telegram Channel for more codes: https://t.me/Code_alphix π₯
int le = s[0] - '0', pl = v[0];
for (int i = 1; i < n; ++i) {
if (s[i] - '0' == le) {
mrtrueliving_ix += min(pl, v[i]);
pl = max(pl, v[i]);
} else {
le = s[i] - '0';
pl = v[i];
}
}
cout << mrtrueliving_ix;
return 0;
}
--
β 100% Correct Solution (C++)
π¬ @Mrtrueliving_ix
π More codes: @Code_alphix
import heapq
from collections import defaultdict
def roll_e(t, l, f):
b = 7 - t
e = 7 - l
w = l
n = 7 - f
s = f
nt = w
nw = b
ne = t
nb = e
nn = n
ns = s
nl = nw
nf = ns
return (nt, nl, nf)
def roll_w(t, l, f):
b = 7 - t
e = 7 - l
w = l
n = 7 - f
s = f
nt = e
nw = t
ne = b
nb = w
nn = n
ns = s
nl = nw
nf = ns
return (nt, nl, nf)
def roll_s(t, l, f):
b = 7 - t
e = 7 - l
w = l
n = 7 - f
s = f
nt = n
nb = s
nn = b
ns = t
ne = e
nw = w
nl = nw
nf = ns
return (nt, nl, nf)
def roll_n(t, l, f):
b = 7 - t
e = 7 - l
w = l
n = 7 - f
s = f
nt = s
nb = n
nn = t
ns = b
ne = e
nw = w
nl = nw
nf = ns
return (nt, nl, nf)
def main():
n = int(input().strip())
pl = []
for _ in range(n):
a, b, d = input().strip().split()
pl.append((int(a), int(b), d))
pl.sort(key=lambda x: (x[0], x[1]))
pid = {1: (0, 0)}
idp = {(0, 0): 1}
dr = {"right": (1, 0), "left": (-1, 0), "top": (0, 1), "down": (0, -1)}
for a, b, d in pl:
if a not in pid:
continue
x, y = pid[a]
dx, dy = dr[d]
nx, ny = x + dx, y + dy
if (nx, ny) in idp:
oid = idp[(nx, ny)]
del pid[oid]
idp[(nx, ny)] = b
pid[b] = (nx, ny)
g = defaultdict(list)
for c, (x, y) in pid.items():
for d, (dx, dy) in dr.items():
nx, ny = x + dx, y + dy
if (nx, ny) in idp:
g[c].append((idp[(nx, ny)], d))
s, d = map(int, input().strip().split())
t, l, f = map(int, input().strip().split())
pq = []
heapq.heappush(pq, (0, s, t, l, f))
dist = defaultdict(lambda: float('inf'))
dist[(s, t, l, f)] = 0
while pq:
cst, u, t, l, f = heapq.heappop(pq)
if u == d:
print(cst)
return
if cst > dist[(u, t, l, f)]:
continue
for v, dr in g[u]:
if dr == "right":
nt, nl, nf = roll_e(t, l, f)
elif dr == "left":
nt, nl, nf = roll_w(t, l, f)
elif dr == "top":
nt, nl, nf = roll_n(t, l, f)
elif dr == "down":
nt, nl, nf = roll_s(t, l, f)
nc = cst + nt
if nc < dist[(v, nt, nl, nf)]:
dist[(v, nt, nl, nf)] = nc
heapq.heappush(pq, (nc, v, nt, nl, nf))
print(-1)
if __name__ == "__main__":
main()
Roll the dice β
Please open Telegram to view this post
VIEW IN TELEGRAM
#include <bits/stdc++.h>
using namespace std;
map<char,int> led={{'0',0b1111110},{'1',0b0110000},{'2',0b1101101},{'3',0b1111001},{'4',0b0110011},
{'5',0b1011011},{'6',0b1011111},{'7',0b1110000},{'8',0b1111111},{'9',0b1111011}};
bool valid(string t){
int h=stoi(t.substr(0,2)),m=stoi(t.substr(3,2));
return h>=1&&h<=12&&m>=0&&m<60;
}
int diffCost(string a,string b,int X,int Y){
int h1=stoi(a.substr(0,2)),m1=stoi(a.substr(3,2));
int h2=stoi(b.substr(0,2)),m2=stoi(b.substr(3,2));
int hd=abs(h1-h2);hd=min(hd,12-hd);
int md=abs(m1-m2);md=min(md,60-md);
return hd*60*X+md*Y;
}
int main(){
string time;cin>>time;
int X,Y;cin>>X>>Y;
vector<int> idx={0,1,3,4};
string best="";int bestCost=INT_MAX;
for(int i:idx){
char c=time[i];
for(int d='0';d<='9';d++){
if(d==c!led.count(c)!led.count(d))continue;
int x=led[c]^led[d];
if(__builtin_popcount(x)==1){
string t=time;t[i]=d;
if(valid(t)){
int cost=diffCost(time,t,X,Y);
if(cost<bestCost||(cost==bestCost&&t<best)){
best=t;bestCost=cost;
}
}
}
}
}
if(best=="")cout<<"No closest valid time possible";
else cout<<best;
return 0;
}
Interview bit // codevita β
β€1
#include <bits/stdc++.h>
using namespace std;
https://t.me/Code_alphix
struct Command{int existing,newCube;string dir;};
int main(){
int N;cin>>N;
vector<Command> cmds(N);
https://t.me/Code_alphix
for(int i=0;i<N;i++)cin>>cmds[i].existing>>cmds[i].newCube>>cmds[i].dir;
/* =========================================
π‘ Verified Solution π―
Question: Nidhi Construction
Contest: TCS CodeVita
Telegram Page: https://t.me/Mrtrueliving_ix
========================================= */
https://t.me/Code_alphix
int query;cin>>query;
sort(cmds.begin(),cmds.end(),[](const Command&a,const Command&b){
if(a.existing==b.existing)return a.newCube<b.newCube;
return a.existing<b.existing;
});
https://t.me/Code_alphix
map<pair<int,int>,int> grid;
map<int,pair<int,int>> pos;
pos[cmds[0].existing]={0,0};
grid[{0,0}]=cmds[0].existing;
https://t.me/Code_alphix
for(auto &cmd:cmds){
if(pos.find(cmd.existing)==pos.end())continue;
int x=pos[cmd.existing].first,y=pos[cmd.existing].second;
if(cmd.dir=="top"||cmd.dir=="up")x--;
else if(cmd.dir=="down")x++;
else if(cmd.dir=="left")y--;
else if(cmd.dir=="right")y++;
if(grid.count({x,y})){int old=grid[{x,y}];pos.erase(old);}
grid[{x,y}]=cmd.newCube;
pos[cmd.newCube]={x,y};
https://t.me/Code_alphix
}
if(pos.find(query)==pos.end()){cout<<"-1 -1 -1 -1";return 0;}
auto [x,y]=pos[query];
vector<pair<int,int>>dirs={{x-1,y},{x+1,y},{x,y-1},{x,y+1}};
https://t.me/Code_alphix
for(int i=0;i<4;i++){
if(grid.count(dirs[i]))cout<<grid[dirs[i]]<<" ";
else cout<<"-1 ";
}
return 0;
}
- @Mrtrueliving_ix @Mrtrueliving_ix
Telegram
π πΏ.π§πΏππ²ππΆππΆπ»π΄_IX
π― Living with purpose.π₯· Silent moves. β‘
Placement Help available...
=> Infosys SE - 9 am
=> Infosys Sp - am
=> Accolite Offcampus
=> Virtusa Hackthon
=> Accenture ONCAMPUS
DM those who need π― test Clearance
DM @Mrtrueliving_ix @Mrtrueliving_ix
For π― test Clearance Guarantee
Limited slots are available asap book your slot now
Please open Telegram to view this post
VIEW IN TELEGRAM
Please open Telegram to view this post
VIEW IN TELEGRAM
Ubs QA Help done β || Offcampus β
Coding+ SQL + Selenium problem β + MCQs
DM for any placement Help available
@Mrtrueliving_ix @Mrtrueliving_ix
#Ubs #Offcampus #QA
Placement Help available { on // off campus}
DM for π― test Clearance β€οΈ
@Mrtrueliving_ix @Mrtrueliving_ix
High success rate with solid Test Clearance
You can check previous helping proofs
Please open Telegram to view this post
VIEW IN TELEGRAM
from collections import defaultdict, deque
def min_energy(n, t_input, s, d):
g = defaultdict(list)
t_map = {}
t_id = 0
for line in t_input:
if line == "break":
t_id += 1
continue
spots = list(map(int, line.split()))
p = spots[0]
for c in spots[1:]:
g[p].append(c)
t_map[c] = t_id
e_cost = {}
q = deque([(s, 0)])
e_cost[s] = 0
while q:
cur, cur_e = q.popleft()
if cur == d:
return cur_e
for c in g[cur]:
if c not in e_cost or cur_e + 1 < e_cost[c]:
e_cost[c] = cur_e + 1
q.append((c, cur_e + 1))
for neighbor in g:
if neighbor != cur and neighbor in e_cost:
e_next = cur_e + 1
if neighbor not in e_cost or e_next < e_cost[neighbor]:
e_cost[neighbor] = e_next
q.append((neighbor, e_next))
return float('inf')
n = int(input())
t_input = []
for _ in range(n):
t_input.append(input().strip())
s, d = map(int, input().split())
result = min_energy(n, t_input, s, d)
print(result)
Hybrid banana β // codevita β
def min_energy(n, t_input, s, d):
g = defaultdict(list)
t_map = {}
t_id = 0
for line in t_input:
if line == "break":
t_id += 1
continue
spots = list(map(int, line.split()))
p = spots[0]
for c in spots[1:]:
g[p].append(c)
t_map[c] = t_id
e_cost = {}
q = deque([(s, 0)])
e_cost[s] = 0
while q:
cur, cur_e = q.popleft()
if cur == d:
return cur_e
for c in g[cur]:
if c not in e_cost or cur_e + 1 < e_cost[c]:
e_cost[c] = cur_e + 1
q.append((c, cur_e + 1))
for neighbor in g:
if neighbor != cur and neighbor in e_cost:
e_next = cur_e + 1
if neighbor not in e_cost or e_next < e_cost[neighbor]:
e_cost[neighbor] = e_next
q.append((neighbor, e_next))
return float('inf')
n = int(input())
t_input = []
for _ in range(n):
t_input.append(input().strip())
s, d = map(int, input().split())
result = min_energy(n, t_input, s, d)
print(result)
Hybrid banana β // codevita β
successfully offline infosys Help Done β
From imneo β
Infosys Sp( Trainee-9.5 Lpa)β
Test accomplished β€οΈ || Offcampus β
Test accomplished
All placement help available
DM @MRTRUELIVING_IX
@MRTRUELIVING_IX
#Infosys #Sp #offline #imneoβ
Please open Telegram to view this post
VIEW IN TELEGRAM