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

Автор dnazirzhanov05, история, 4 года назад, По-русски

#include <bits/stdc++.h>

using namespace std;

double area(int x1, int y1, int x2, int y2, int x3, int y3) {

return fabs(1.*(x2 — x1)*(y3 — y1)-(1.*(x3 — x1)*(y2 — y1)))/2.;

}

main() {

int x1, y1, x2, y2, x3, y3, a, b, c;

cin >> x1 >> y1 >> x2 >> y2 >> x3 >> y3;

cout << fixed << area(x1, y1, x2, y2, x3, y3);

}

In this code I don't understand what does 1. mean.

Thank you for your advice!

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

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

Автор dnazirzhanov05, история, 4 года назад, По-русски

Who can solve this problem ?

Closest Point of Approach

Two spaceships start flying each on its own straight way at different speeds from different locations. You are to determine when

they will be as close to each other as possible. For example, if the first spaceship starts from point (0,0,0) with speed vector

(1,0,0) and the second spaceship starts from (4,2,0) with speed vector (-1,0,0) then after 2 seconds they will be at points

(2,0,0) and (2,2,0) — this is the closest point of their approach.

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

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

Автор dnazirzhanov05, история, 4 года назад, По-русски

Hello , Codeforces Community !!!

I can't understand array into another array , for example , like this :

    int n;cin>>n;

    vector<int> v(n);

    vector<int> cnt(101,0);

    for(int i=0;i<n;i++)

    {
       cin>>v[i];

       cnt[v[i]]++;  ---> I don't understand cases like this

    }

--------------------------------------OR----------------------------------------------

    int n;

    cin >> n;

    int cnt[101];

    for(int i = 0; i <= 100; i++){

       cnt[i] = 0;

    }

    for(int i = 0; i < n; i++){

       int x;

       cin >> x;

       cnt[x]++; ---> I don't understand cases like this

    }

Can you explain what does this mean ?

Thank you for your advice

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

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

Автор dnazirzhanov05, история, 4 года назад, По-русски

Hi , everyone ! Can you help me with this problem ,please ?

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

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

Автор dnazirzhanov05, история, 4 года назад, По-русски

Hello , everyone!

I wanted to code on Sublime Text 3.

How can I run (input/output) code in Sublime Text 3 ? I downloaded and installed mingw-get-setup , and went to Tools --> Build System --> New Build System... and there I did some changes , but still , I can not work(input) with Sublime Text 3.

Please, help with your advises .

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

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

Автор dnazirzhanov05, история, 4 года назад, По-русски

Hello , everyone !!!

I want to improve my programmig skills , and that is why I want to read some books about programming . Can you prefer some free online-books about programming ?

Thanks a lot . Have a nice day !!!

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

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

Автор dnazirzhanov05, история, 4 года назад, перевод, По-русски

Please , help to solve this problem.

Flag

The ratio of length to width of the national flag of Berland is 5:3.For a given natural number K (the length or width of the flag), find its area (as a natural number or a mixed fraction with the lowest possible denominator).

Input data format :** natural number K, 2 <= K <= 100. If K <= 50, this is the width, otherwise it is the length.

Output format : a single integer or three natural numbers (the integer part, the numerator and denominator) Examples : 8 ---> 106 2 3

75 ---> 3375

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

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

Автор dnazirzhanov05, история, 4 года назад, По-русски

ИНТЕРЕСНЫЕ ЧИСЛА. Назовём натуральное число X (X > 9) "интересным", если цифры в его десятичной записи ненулевые, попарно взаимно простые и их попарные суммы — простые числа. Например, число 114 является интересным, а числа 115, 124 — нет.
Найдите N-ое (1 <= N <= 2018) интересное число. Пример: 3 -> 14

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

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