-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbee2379.cpp
More file actions
41 lines (34 loc) · 768 Bytes
/
Copy pathbee2379.cpp
File metadata and controls
41 lines (34 loc) · 768 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
/**
* Contest : Beecrowd
* Problem : 2379 - Dança Indígena
* Link : https://judge.beecrowd.com/pt/problems/view/2379
* Time : O(???)
*/
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
#define fastio ios::sync_with_stdio(0); cin.tie(0);
int main() {
fastio
int n, e;
cin >> n >> e;
vector<int> inicial(n), indio(n), dir(n);
for (int i = 0; i < n; ++i) {
cin >> inicial[i] >> dir[i];
indio[i] = inicial[n];
}
int cnt = 0;
auto giveAnt = [&](int i, int d) {
int ant = i-d;
if (ant < 0) return n-1;
if (ant >= n) return 0;
return ant;
};
auto giveProx = [&](int i, int d) {
int prox = i+d;
if (prox < 0) return n-1;
if (prox >= n) return 0;
return prox;
};
return 0;
}