This is ok:
for(int i = 1; i <= floor(sqrt(n)); i++) {
//code
}
#include <iostream> | |
#include <vector> | |
#include <set> | |
using namespace std; | |
int T[100]; | |
vector<set<int> > V; | |
bool test(int C, set<int> &X, set<int> &Y) { | |
int count = 0; |
#!/usr/bin/env python2 | |
from collections import defaultdict | |
import requests, json, zipfile | |
PREFIX = 'https://ieee.hackerrank.com/rest/contests/ieeextreme10' | |
USER='PUT USERNAME HERE' | |
PASS='PUT PASSWORD HERE' | |
EXT = {'python': 'py'} |
import java.lang.reflect.Array; | |
import java.util.Arrays; | |
import java.util.Comparator; | |
import java.util.HashMap; | |
import java.util.Iterator; | |
public class UpdateHeap<V> implements Iterable<V> { | |
private final Comparator<V> comparator; | |
private final HashMap<V, Entry> map; | |
private Entry[] heap; |
def push(stack, el): stack+(el,); | |
def pop(stack): (stack:take(len(stack)-1), stack:get(len(stack)-1)); | |
def memset(state, key, value): (state |> @filter({0}!=key)) + ((key, value),); | |
def memget(state, key): state |> last({1}):if({0}==key)# ?? 0; | |
def memadd(state, key, value): memset(state, key, memget(state, key)+value); | |
def findclosing(code, i): | |
(1, i+1):unfold(fun(count, i): | |
i >= len(code) or count == 0 ? null, | |
code:get(i) == '[' ? (i, (count+1, i+1)), |
package example; | |
import java.util.concurrent.ExecutorService; | |
import java.util.concurrent.Executors; | |
import java.util.concurrent.atomic.AtomicInteger; | |
public class Main { | |
public static void main(String... args) throws Exception { | |
ObjectPool<ExpensiveObject> pool = new ObjectPool<ExpensiveObject>() { | |
@Override |
#include <iostream> | |
#include <vector> | |
#include <cstring> | |
using namespace std; | |
struct Dist { | |
int node, d; | |
Dist(int node, int d) : node(node), d(d) { } | |
}; |
100 1073741823 | |
1 1 | |
1 1 1 1 | |
1 1 1 1 | |
1 1 1 1 | |
1 1 1 1 | |
1 1 1 1 | |
1 1 1 1 | |
1 1 1 1 | |
1 1 1 1 |
def next_digit(value, base): | |
return value + str(sum(int(a)*b for a,b in zip(value, base))%11%10) | |
def make_valid(value, ap2, base): | |
return next_digit(next_digit(value, base), ap2+base) | |
def is_valid_cpf(cpf): | |
return make_valid(cpf[:9], [0], [1,2,3,4,5,6,7,8,9]) == cpf | |
def is_valid_cnpj(cnpj): |
# -*- coding: utf-8 -*- | |
from __future__ import print_function | |
import timeit, random, sys | |
if sys.version_info >= (3, ): xrange=range | |
def partition(data, begin, end): | |
value = data[end-1] | |
pivot = begin |