█████████ ████ ███░░░░░███ ░░███ ███ ░░░ ██████ ███████ ██████ ██████ ░███ ███░░███ ███░░███ ███░░███ ███░░███ ░███ ░███ ░███░███ ░███ ░███████ ░███ ░███ ░░███ ███░███ ░███░███ ░███ ░███░░░ ░███ ░███ ░░█████████ ░░██████ ░░████████░░██████ ░░██████ ░░░░░░░░░ ░░░░░░ ░░░░░░░░ ░░░░░░ ░░░░░░

Envío 6774

Problema 0xcc - La Liebre y la Tortuga en un arreglo circular

  • Autor: danidiaztech
  • Fecha: 2022-11-15 03:05:25 UTC (Hace más de 1 año)
Caso # Resultado Tiempo Memoria
#1
Correcto
0.004 s 1 KBi
#2
Correcto
0.003 s 1 KBi
#3
Correcto
0.004 s 1 KBi
#4
Correcto
0.006 s 1 KBi
#5
Correcto
0.004 s 1 KBi
#6
Correcto
0.005 s 1 KBi
#7
Correcto
0.006 s 1 KBi
#8
Correcto
0.004 s 1 KBi
#9
Correcto
0.004 s 1 KBi
#10
Correcto
0.005 s 1 KBi
#11
Correcto
0.004 s 1 KBi
#12
Correcto
0.006 s 1 KBi
#13
Correcto
0.004 s 1 KBi
#14
Correcto
0.004 s 1 KBi
#15
Correcto
0.004 s 1 KBi
#16
Correcto
0.004 s 1 KBi
#17
Correcto
0.004 s 1 KBi
#18
Correcto
0.007 s 1 KBi
#19
Correcto
0.004 s 1 KBi
#20
Correcto
0.003 s 1 KBi
#21
Tiempo límite excedido
1.057 s 1 KBi
#22
Correcto
0.006 s 1 KBi
#23
Tiempo límite excedido
1.078 s 2 KBi
#24
Tiempo límite excedido
1.075 s 1 KBi
#25
Tiempo límite excedido
1.067 s 1 KBi
#26
Tiempo límite excedido
1.079 s 1 KBi
#27
Correcto
0.465 s 1 KBi
#28
Tiempo límite excedido
1.088 s 1 KBi
#29
Tiempo límite excedido
1.018 s 1 KBi
#30
Tiempo límite excedido
1.034 s 1 KBi
#31
Correcto
0.874 s 1 KBi
#32
Correcto
0.486 s 1 KBi
#33
Correcto
0.399 s 1 KBi
#34
Tiempo límite excedido
1.072 s 1 KBi
#35
Tiempo límite excedido
1.075 s 1 KBi
#36
Tiempo límite excedido
1.088 s 1 KBi
#37
Tiempo límite excedido
1.086 s 1 KBi
Puntos totales: 68 / 100

Código

// Made by Daniel Diaz (@Danidiaztech)
#include <bits/stdc++.h>
using namespace std;

#define endl '\n'
#define fastInp cin.tie(0); cout.tie(0); ios_base::sync_with_stdio(0);
#define forn(i, n) for (int i = 0; i < n; i++) // for in range in python
#define FOR(i, a, b) for (int i = a; i < b; i++) // for in range in python
#define int long long int
#define double long double
#define pb push_back
#define ff first
#define ss second
#define mk make_pair

typedef pair<int, int> pii;

const int MAX = 1e6;
const int MIN = -MAX;
const int INF = LLONG_MAX;
const int MINF = LLONG_MIN;
const int MOD = 1e9 + 7;

// int arr[MAX];
void solve(){
  int n, t, r;
  cin >> n >> t >> r;
  int i = 0;
  while (r != t){
    t = (t + 1) % n;
    r = (r + 2) % n;
    i++;
  }
  cout << i << endl;
}

int32_t main() {
  fastInp;
  #if LOCAL
    freopen("input.txt", "r", stdin);
    freopen("output.txt", "w", stdout);
  #endif

  int tc = 1;
  // cin >> tc;

  for (int t = 1; t <= tc; t++){
    // cout << "Case #" << t << ": ";
    solve();
  }
  return 0;
}