🔥 Burn Fat Fast. Discover How! 💪

CODING_SOLUTION_HELP

Logo of telegram channel coding_solution_help — CODING_SOLUTION_HELP C
Logo of telegram channel coding_solution_help — CODING_SOLUTION_HELP
Channel address: @coding_solution_help
Categories: Technologies
Language: English
Subscribers: 141.08K
Description from channel

Codingsolution_it
#coding
#codingsolution
#codingsolutionhelp
#codingsolutionit
#coding_solution_help
#codingsolutionhelpit
Codingsolution
#Coding_solution
#Coding_solution_it
#Coding solution help
Codingsolutionhelp
#Coding solution it
#codingsol
coding

Ratings & Reviews

3.33

3 reviews

Reviews can be left only by registered users. All reviews are moderated by admins.

5 stars

0

4 stars

2

3 stars

0

2 stars

1

1 stars

0


The latest Messages 7

2021-10-20 17:16:52
#include
#include

void main()
{
char s[200];
int count = 0, i;

printf("Enter the string:\n");
scanf("%[^\n]s", s);
for (i = 0;s[i] != '\0';i++)
{
if (s[i] == ' ' && s[i+1] != ' ')
count++;
}
printf("Number of words in given string are: %d\n", count + 1);
}

Telegram - t.me/coding_solution_help
11.6K views14:16
Open / Comment
2021-10-20 17:13:30 CRT_SECURE_NO_WARNINGS

#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include

#define y0 sdkfaslhagaklsldk

#define y1 aasdfasdfasdf
#define yn askfhwqriuperikldjk
#define j1 assdgsdgasghsf
#define tm sdfjahlfasfh
#define lr asgasgash
#define norm asdfasdgasdgsd
#define have adsgagshdshfhds

#define eps 1e-6
#define M_PI 3.141592653589793
#define bs 1000000007
#define bsize 350

using namespace std;

const int INF = 1e9;
const int N = 531;
const int M = 600031;

int n, m, ar[N][N];
int x1[M], y1[M], x2[M], y2[M];

vector > > val_list;
int l[M], r[M];

vector qu_list[M];
int w[M];

int get(int x)
{
if (x == w[x])
return x;
return w[x] = get(w[x]);
}

bool outside(int a, int b)
{
if (a < 0 || a >= n || b < 0 || b >= n)
return true;
return false;
}

void merge(int a, int b)
{
w[a] = b;
}

bool is_inside(int a, int b)
{
return (a >=0 && a < n&&b >= 0 && b < n);
}

void run_merger(int a, int b)
{
for (int dx = -1; dx <= 1; dx++)
{
for (int dy = -1; dy <= 1; dy++)
{
if (abs(dx) + abs(dy) != 1)
continue;
if (outside(a + dx, b + dy))
continue;
if (ar[a + dx][b + dy] > ar[a][b])
continue;
int id1 = a*n + b;
int id2 = (a + dx)*n + (b + dy);
id1 = get(id1);
id2 = get(id2);
merge(id1, id2);
}
}
}

int main(){
ios_base::sync_with_stdio(0);
//cin.tie(0);

//cin >> n >> m;
assert(cin >> n >> m);

assert(2 <= n &&n <= 500);
assert(m >= 1 && m <= 1e5);

for (int i = 1; i <= n; i++)
{
for (int j = 1; j <= n; j++)
{
//cin >> ar[i - 1][j - 1];
assert(cin >> ar[i - 1][j - 1]);
assert(ar[i - 1][j - 1] >= 1 && ar[i - 1][j - 1] <= 1e6);
}
}

for (int i = 1; i <= m; i++)
{
// cin >> x1[i] >> y1[i] >> x2[i] >> y2[i];
assert(cin >> x1[i] >> y1[i] >> x2[i] >> y2[i]);
assert(x1[i] != x2[i] || y1[i] != y2[i]);
assert(is_inside(x1[i], y1[i]));
assert(is_inside(x2[i], y2[i]));
}

for (int i = 1; i <= n; i++)
{
for (int j = 1; j <= n; j++)
{
val_list.push_back(make_pair(ar[i - 1][j - 1], make_pair(i - 1, j - 1)));
}
}

sort(val_list.begin(), val_list.end());

for (int i = 1; i <= m; i++)
{
l[i] = 0;
r[i] = val_list.size() - 1;
}

int I = 0;

while (true)
{
for (int i = 0; i < val_list.size(); i++)
qu_list[i].clear();

int flag = 0;

for (int i = 1; i <= m; i++)
{
if (l[i] == r[i])
continue;
flag = 1;
int mid = l[i] + r[i];
mid /= 2;
qu_list[mid].push_back(i);
}

++I;
if (flag == 0)
break;

for (int i = 0; i < n; i++)
{
for (int j = 0; j < n; j++)
{
w[i*n + j] = i*n + j;
}
}

for (int i = 0; i < val_list.size(); i++)
{
int qi = val_list[i].second.first;
int qj = val_list[i].second.second;

run_merger(qi, qj);

for (int j = 0; j < qu_list[i].size(); j++)
{
int id = qu_list[i][j];
int ps1 = x1[id] * n + y1[id];
int ps2 = x2[id] * n + y2[id];
// cout << ps1 << "%" << ps2 << endl;
ps1 = get(ps1);
ps2 = get(ps2);
// cout << id << "%" << i << endl;
if (ps1 == ps2)
r[id] = i;
else
l[id] = i + 1;
}
}
}

for (int i = 1; i <= m; i++)
{
cout << val_list[l[i]].first << endl;
}

cin.get(); cin.get();
return 0;
}

CRT_SECURE_NO_WARNINGS
Telegram - t.me/coding_solution_help
9.6K views14:13
Open / Comment
2021-10-20 17:12:06
#include
using namespace std;

int maxnumber(int n, int k)
{

for (int j = 0; j < k; j++)
{

int ans = 0;
int i = 1;


while (n / i > 0)
{


int temp = (n / (i * 10)) * i + (n % i);
i *= 10;

ans = max(ans, temp);
}

n = ans;
}


return n;
}


int main()
{
int n ;
cin>>n;
int k = 1;

cout << maxnumber(n, k) << endl;
return 0;
}

Telegram - t.me/coding_solution_help
7.6K views14:12
Open / Comment
2021-10-20 16:55:53 KPIT EXAM TODAY DISCUSSION GROUP



@kpit_exam_wipro_colortokens_exam
7.0K views13:55
Open / Comment
2021-10-20 16:51:01
#include

int main() {
int n;
scanf("%d",&n);
int addition(int a)
{
int sum=0;
if(a<=9 && a>=1)
{
printf("%d",a);
}
else
{
while(a!=0)
{
int rem = a%10;
sum+=rem;
a=a/10;
}
return addition(sum);
}
}
addition(n);

return 0;
}

C language
Telegram - t.me/coding_solution_help
7.8K views13:51
Open / Comment
2021-10-20 16:47:11
#include #define MAX_SIZE 100 // Maximum string size int main() { char str[MAX_SIZE]; int i, words; /* Input string from user */ printf("Enter any string: "); gets(str); i = 0; words = 1; /* Runs a loop till end of string */ while(str[i] != '\0') { /* If the current character(str[i]) is white space */ if(str[i]==' ' || str[i]=='\n' || str[i]=='\t') { words++; } i++; } printf("Total number of words = %d", words); return 0; }

C language
KPIT
Telegram - t.me/coding_solution_help
7.5K views13:47
Open / Comment
2021-10-20 16:38:53
#include

#include

 

void main()

{

int num1, num2, i, j, flag, temp, count = 0;

 

printf("Enter the value of num1 and num2 \n");

scanf("%d %d", &num1, &num2);

if (num2 < 2)

{

printf("There are no primes upto %d\n", num2);

exit(0);

}

printf("Prime numbers are \n");

temp = num1;

if ( num1 % 2 == 0)

{

num1++;

}

for (i = num1; i <= num2; i = i + 2)

{

flag = 0;

for (j = 2; j <= i / 2; j++)

{

if ((i % j) == 0)

{

flag = 1;

break;

}

}

if (flag == 0)

{

printf("%d\n", i);

count++;

}

}

printf("Number of primes between %d & %d = %d\n", temp, num2, count);

}

KPIT
Telegram - t.me/coding_solution_help
8.1K views13:38
Open / Comment
2021-10-20 16:35:24
Python
KPIT
Telegram - t.me/coding_solution_help
7.8K views13:35
Open / Comment
2021-10-20 16:33:40
Python
KPIT
Telegram - t.me/coding_solution_help
8.1K views13:33
Open / Comment
2021-10-20 16:24:26
C++ language
KPIT
Telegram - t.me/coding_solution_help
9.4K views13:24
Open / Comment