Блог пользователя Mohamed_Saad62

Автор Mohamed_Saad62, история, 19 месяцев назад, По-английски

How to find number of values x which achieve GCD(n, x) = 1
n is constant
x <= m
m can be bigger than n
the related problem to this question that I am trying to solve:

https://codeforces.net/contest/1750/problem/D

Полный текст и комментарии »

  • Проголосовать: нравится
  • +8
  • Проголосовать: не нравится

Автор Mohamed_Saad62, история, 3 года назад, По-английски

If I have a Program.exe that takes input and print it.
If I want to run this program from the cmd I will go to its directory and write Program.exe (enter).
And what is going to happen a new line and waiting for the input.
But what if I want to give the input at the same line like that :

c:\Users\abc> Program.exe input
and that's it the program doesn't ask for input(as I gave it at the same line when I invoked the program) and print the output and terminate

I am working with c++.

Полный текст и комментарии »

  • Проголосовать: нравится
  • -4
  • Проголосовать: не нравится

Автор Mohamed_Saad62, история, 4 года назад, По-английски

AT this problem https://codeforces.net/gym/102470/problem/A (short statment below)
after three days of coding to avoid runtime error I get TLE on a binary search solution can someone explain what is wrong with my solution

the short statement : You are given set of points (x,y) find point on (y = 0) which all point can go to this point in minimum time and all have the same speed which is one meter per second

my code : https://codeforces.net/contest/1445/submission/98270485 (the code has comments :)

Полный текст и комментарии »

  • Проголосовать: нравится
  • +6
  • Проголосовать: не нравится

Автор Mohamed_Saad62, история, 4 года назад, По-английски

I really want to know how to solve this problem :

You are given two positive integers d and s. Find minimal positive integer n which is divisible by d and has sum of digits equal to s.

the link : https://codeforces.net/contest/1070/problem/A

Полный текст и комментарии »

  • Проголосовать: нравится
  • -7
  • Проголосовать: не нравится

Автор Mohamed_Saad62, история, 4 года назад, По-английски

If I am calling too many functions which is more than allowed in the memory limit I will get run time error or memory limit exceeded ? like in this code https://codeforces.net/contest/1067/submission/85187079

UPD If I am calling too many functions which is more than the stack size I will get run time error or memory limit exceeded ?

Полный текст и комментарии »

  • Проголосовать: нравится
  • +4
  • Проголосовать: не нравится

Автор Mohamed_Saad62, история, 4 года назад, По-английски

Can someone provide a tutorial on how to use prefix sum with dynamic programming ?

Полный текст и комментарии »

  • Проголосовать: нравится
  • +1
  • Проголосовать: не нравится

Автор Mohamed_Saad62, история, 5 лет назад, По-английски

Given a string consist just of the letter 'u' ,if we can consider every two adjacent 'u' -->' w' and every u can be used only once in how many ways the string can appear ?

example : uuu can be uuu or wu or u w so the answer is 3 .

I am asking this question because at the last contest I was trying to solve this problem https://codeforces.net/contest/1245/problem/C and I claim the solution is every continuous 'u' or 'n' I save in how many ways it can appear in a vector and then multiply all the numbers and this is the answer .

Полный текст и комментарии »

  • Проголосовать: нравится
  • +5
  • Проголосовать: не нравится