2 051
Subscribers
No data24 hours
No data7 days
No data30 days
Posts Archive
Hi Marcus Join Our Channel for daily Off-Campus Job Updates ❤️
👇👇
@offcampusjobs_0
@offcampusjobs_0
03 Oct 2021, 13:41
Hi Sanjeev Welcome to this Community. Join Our Channel for daily Off-Campus Job Updates ❤️
👇👇
@placement_0
@placement_0
17 Apr 2021, 03:00
!!!!!!!!!!!!!!!Accolite coding round answers- join the link in my bio!!!!!!!!!!!!!!!!!!!!!!!
13 May 2021, 00:31
Hi Manohar Welcome to this Community. Join Our Channel for daily Off-Campus Job Updates ❤️
👇👇
@offcampusjobs_0
@offcampusjobs_0
24 Jan 2022, 08:14
Hi Moin , Welcome to this Community for 2022 Batch Daily Off Campus Jobs Updates join this channel ✅
👇👇
@offcampusjobs_0
@offcampusjobs_0
03 Apr 2021, 03:16
Pokemon trainer
#include <bits/stdc++.h>
using namespace std;
const int maxn = 300011;
char s[maxn];
int deg[maxn], d[maxn];
vector<int> w[maxn];
int Find(int u, int c) {
if (d[u] != -1) return d[u];
d[u] = 0;
for (int v : w[u]) {
d[u] = max(d[u], Find(v, c));
}
d[u] += (s[u] == c + 'a');
return d[u];
}
int main() {
int n, m;
scanf("%d%d", &n, &m);
scanf("%s", s + 1);
for (int i = 1; i <= m; ++i) {
int u, v;
scanf("%d%d", &u, &v);
w[u].push_back(v);
++deg[v];
}
int ct = 0;
queue<int> que;
for (int i = 1; i <= n; ++i) {
if (!deg[i])
que.push(i), ++ct;
}
while (!que.empty()) {
int u = que.front();
que.pop();
for (int v : w[u]) {
if (--deg[v] == 0)
que.push(v), ++ct;
}
}
if (ct < n) {
puts("-1");
} else {
int ans = 0;
for (int c = 0; c < 26; ++c) {
memset(d, 0xff, sizeof d);
for (int i = 1; i <= n; ++i)
ans = max(ans, Find(i, c));
}
printf("%dn", ans);
}
return 0;
}
09 May 2021, 06:28
Hi Rushikesh Welcome to this Community. Join Our Channel for daily Off-Campus Job Updates ❤️
👇👇
@offcampusjobs_0
@offcampusjobs_0
04 Feb 2022, 23:17
Any of you need Coursera plus 1 year valid account with all paid courses unlocked with certificates on your mail, dm
30 Aug 2023, 07:21
