This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <bits/stdc++.h> | |
using namespace std; | |
using ll = long long; | |
inline bool can(vector<ll>& points, ll max_dist, int c) { | |
ll curr_dist = 0; | |
int cc = 1; | |
for (int i = 1; i < points.size(); ++i) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <bits/stdc++.h> | |
using namespace std; | |
using ll = long long; | |
ll gcd(ll a, ll b) { | |
return !b ? a : gcd(b, a % b); | |
} | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import java.io.BufferedReader; | |
import java.io.IOException; | |
import java.io.InputStream; | |
import java.io.InputStreamReader; | |
import java.io.PrintWriter; | |
import java.util.ArrayList; | |
import java.util.BitSet; | |
import java.util.Deque; | |
import java.util.LinkedList; | |
import java.util.List; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <bits/stdc++.h> | |
using namespace std; | |
using ll = long long; | |
int main(int argc, char **argv) { | |
ios::sync_with_stdio(false); | |
srand(time(0)); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <bits/stdc++.h> | |
using namespace std; | |
using ll = long long; | |
ll GetNum(vector<int>& digits) { | |
while (!digits.empty() && digits[0] == 0) digits.erase(begin(digits)); | |
ll ans = 0; | |
for (auto digit: digits) ans = ans * 10 + digit; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <bits/stdc++.h> | |
using namespace std; | |
using ll = long long; | |
int main(int argc, char **argv) { | |
// ios::sync_with_stdio(false); | |
srand(time(0)); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <bits/stdc++.h> | |
using namespace std; | |
using ll = long long; | |
ll getAt(ll x, ll cl, ll cr, ll pos) { | |
if (x < 2) { | |
return x; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <bits/stdc++.h> | |
using namespace std; | |
using ll = long long; | |
ll getAt(ll x, ll cl, ll cr, ll pos) { | |
if (cl == cr && cl == pos) { | |
return x; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <cmath> | |
#include <cstdio> | |
#include <vector> | |
#include <iostream> | |
#include <algorithm> | |
using namespace std; | |
inline bool match(const string& s, string pattern) { | |
int i = 0; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@Override | |
public boolean interpret(String expression, String actorId) { | |
String[] checks = expression.split(AND); | |
for (String check : checks) { | |
String[] operands = check.split(COLON); | |
String scopeId = operands[0].trim(); | |
String permissionName = operands[1].trim(); | |
boolean value; | |
if (scopeId.equals(ANY)) { |