uuid string | repo_name string | relative_path string | content string | category string | algo_rel_score float64 | quality_score float64 |
|---|---|---|---|---|---|---|
a6f63ac2-a925-4b36-8558-ce3edac10010 | hwang131/BOJ | 10000-19999/16000-16999/16236.cpp | // 16236 ์๊ธฐ ์์ด
// https://www.acmicpc.net/problem/16236
#include <iostream>
#include <queue>
#include <vector>
#include <utility>
using namespace std;
#define DEBUG 0
int side;
int shark_count = 0;
int shark_size = 2;
int shark_eat_fish = 0;
bool visited[21][21];
bool break_flag = true;
int SEA[21][21];
int fish_coun... | ALGO | 0.99998 | 4.224953 |
3bb4aa27-2ced-4095-841c-67e0ee5571b6 | rishiyadav23/Competitive-Programming | Maths/fastModIterative.cpp | /*
Fast Modulo Exponentiation
--------------------------
a^n % MOD { 1 <= a <= 10^9, 1 <= n <= 10^8
MOD = 1000000009
Brute Force O(n)
int ans = 1;
for (int i = 1;i <=m; i++)
ans = (1LL * ans * a)% MOD;
Using Fast Modular Exponentiation - O(log n)
(Divide and Conquer)
a^n ------->(n = even) ----> (a^(n/2))^2
\
\
... | ALGO | 0.999985 | 5.289202 |
101208d4-e254-4cf0-9ba7-15aab6b45656 | ChuyX3/angsys | branch/old_angsys/angsys_beta1/source/angsys/angsys.shared/source/collections/vector.cpp | /*********************************************************************************************************************/
/* File Name: vector.cpp */
/* Author: Ing. Jesus Rocha <<EMAIL>>, July 2016. ... | TOOL | 0.865321 | 5.976255 |
b771e06c-8174-488d-be33-9f13d57966b6 | Aoniii/CPP-Module | Module08/ex01/Span.cpp | /* ************************************************************************** */
/* */
/* ::: :::::::: */
/* Span.cpp :+: :+: :+: ... | ALGO | 0.955888 | 4.961519 |
ec628b6e-0d81-4413-bc98-4ad8e57e9ef7 | nikhil4u8/Leetcode-solutions | Leetcode Solutions/202. Happy Number.cpp | class Solution {
public:
//USING HASH-MAP
bool isHappy(int n) {
unordered_map<int,int> tmp;
while(n != 1)
{
if(tmp[n] == 0)
tmp[n]++;
else
return false;
int sum = 0;
while(n != 0)
... | ALGO | 0.99993 | 6.235467 |
bbe8b81e-ca51-448c-9a73-0318635b6c0a | Coobeliues/pp1 | Documents/Code/pp1/a/lab11/e.cpp | #include <iostream>
#include <set>
#include <map>
using namespace std;
int main(){
set<char> t;
map<char, int> m;
int n; cin>>n;
bool p=false;
for(int i=0; i<n; i++){
string s; cin>>s;
for(int j=0; j<s.size(); j++){
t.insert(s[j]);
}
for(auto k : t){
... | ALGO | 0.999947 | 4.301336 |
6ba60c7b-f54c-4dd5-b11e-eb9fe9223dca | suhaninayal/mostly_asked_leetcode | largest_rectangle_histograph.cpp | //largest rectangle in a histograph
#include<bits/stdc++.h>
using namespace std;
int main()
{
vector<int> arr={2,3,5,6,7};
int n=5;
stack<int> st;
int maxi=0;
for(int i=0;i<n;i++)
{
while(!st.empty() && arr[i]<arr[st.top()])
{
int ele=st.top();
st.pop();
... | ALGO | 0.999838 | 4.214452 |
b54b67c4-687f-45ad-9a8d-f907740d0938 | zilliztech/knowhere | thirdparty/faiss/demos/demo_weighted_kmeans.cpp | #include <cstdio>
#include <cstdlib>
#include <memory>
#include <faiss/Clustering.h>
#include <faiss/IndexFlat.h>
#include <faiss/IndexHNSW.h>
#include <faiss/utils/distances.h>
#include <faiss/utils/random.h>
namespace {
enum WeightedKMeansType {
WKMT_FlatL2,
WKMT_FlatIP,
WKMT_FlatIP_spherical,
WKMT... | ALGO | 0.998237 | 6.633204 |
7e5717f3-f6fc-4c71-b4c3-373bf0bef5cb | ssuleimenovv/pp1 | pp1/holidays/holidays.cpp | #include <bits/stdc++.h>
using namespace std;
int main(){
string d[7] = {"SUN" , "MON" , "TUE" , "WED" , "THU" , "FRI" , "SAT" };
string s;
cin >> s;
for(int i=1;i<7;i++){
if(d[i] == s){
cout << 7-i << endl;
break;
}
}
} | ALGO | 0.999924 | 3.396993 |
ba3dd8f0-9084-437c-9d64-b8acd8e3723d | LeKSuS-04/Competitive-Programming | UVa-problems/294.cpp | /* UVa 294 - Divisors */
// https://onlinejudge.org/index.php?option=com_onlinejudge&Itemid=8&category=24&page=show_problem&problem=230
// Date: 2021-09-23 04:37:16
// Runtime: 0.000
// Verdict: AC
#include <bitset>
#include <iostream>
#include <vector>
using namespace std;
const int MAX = 32e3;
bitset<MAX+10> is_pri... | ALGO | 0.999571 | 5.986901 |
57530b70-5ac8-44d4-adcf-40e76122e9db | dreeimbuka/2023-final-year-project | HabitTrackerFlutter-main/windows/runner/utils.cpp | #include "utils.h"
#include <flutter_windows.h>
#include <io.h>
#include <stdio.h>
#include <windows.h>
#include <iostream>
void CreateAndAttachConsole() {
if (::AllocConsole()) {
FILE *unused;
if (freopen_s(&unused, "CONOUT$", "w", stdout)) {
_dup2(_fileno(stdout), 1);
}
if (freopen_s(&unuse... | TOOL | 0.998528 | 6.785996 |
f494b28a-2072-48fb-aa0a-81217e3d7b05 | aliceteee/Lista-de-Exercicios-de-Logica-em-C | Ativ. 1 - Par ou รญmpar.cpp | #include <stdio.h>
int main() {
int num; // Declarei uma variรกvel int porque um nรบmero nรฃo precisa de decimais
printf("Digite um numero: ");
scanf("%d", &num);
// Aqui usei % para pegar o **resto** da divisรฃo por 2, se o resto for 0, significa que o nรบmero รฉ par, entรฃo usei if para isso... | ALGO | 0.99782 | 3.842483 |
5017a462-aec0-4474-8377-8d49a24cc1e6 | ignite312/Algorithms | Graph/ArticulationPoints.cpp | #include <bits/stdc++.h>
using namespace std;
const int N = 500 + 5;
vector<int> G[N + 5];
int disc[N + 5], low[N + 5], visited[N + 5], isAP[N + 5];
void ArticulationPoints(int vertex, int &time, int parent) {
int children = 0;
visited[vertex] = 1;
disc[vertex] = low[vertex] = ++time;
for (auto child :... | ALGO | 0.999987 | 5.637983 |
034156bc-f033-4813-be9c-1431d16f1529 | wwt17/BZOJ | 4007 [JLOI2015]ๆไบ่ฐๅบฆ(DP+ๅไฝ).cpp | #include <cstdio>
const int N=9;
inline void maxi(int &a,const int b){
if(b>a) a=b;
}
int n,m;
int w[1<<N][N][2];
int f[1<<(N+1)][1<<(N+1)];
int lg[1<<N];
int main(){
scanf("%d%d",&n,&m); n--;
for(int flag=1;flag>=0;flag--)
for(int i=0;i<1<<n;i++)
for(int j=n-1;j>=0;j--) scanf("%d",&w[i][j][flag]);
for(in... | ALGO | 0.99994 | 3.647165 |
f2e0dd91-a606-4ea8-8c79-a1f3fd139577 | arkc1009/DoungJin_Algorithm | C++/11724.cpp | #include <iostream>
#include <stack>
//11724
//-ยฅ ศฐ,, าดยต,,
//DFS ุบฯฑ DFS ืท ัด ิต
// ,, สผ,, DFS ฬด.
using namespace std;
bool graph[1001][1001]={false};
bool cheak[1001];
int N, M;
void dfs(int idx) {
cheak[idx]=true;
for(int i=1; i<=N; i++) {
if(graph[idx][i] && !cheak[i]) {
dfs(i);
}
}
}
... | ALGO | 0.999861 | 4.976312 |
edadfb13-d853-4a75-9f65-4f6f919bd28e | abhishekdagar/Code_Practice | how_many_times_array_roatated.cpp | #include<bits/stdc++.h>
using namespace std;
//https://www.codingninjas.com/studio/problems/rotation_7449070
//if we find the minimum in rotated sorted array then if we observe we can find that it's rotated at it's index
void rotated(vector<int> &arr, int n) {
int low = 0;
int high = n - 1;
int index = -1;
int ans ... | ALGO | 0.999986 | 5.560617 |
9e661dee-f15c-4643-853e-3de8c18e7945 | ritwizsinha/PROGRAMMING-SOLUTIONS | CODEFORCES-B/158.cpp | #include<iostream>
#include<string>
#include<vector>
#include<algorithm>
#include<chrono>
#define MIN3(a,b,c) (a)<(b)?((a)<(c)?(a):(c)):((b)<(c)?(b):(c))
#define endl "\n"
#define int long long
#define forn(i,n) for(long long i = 0; i < long long (n); ++i)
#define IOS ios_base::sync_with_stdio(false); cin.tie(0); cout.... | ALGO | 0.999583 | 3.552408 |
50d7bb20-a315-4f7e-b589-15e8db928a39 | tuhinjubcse/MetaphorGenNAACL2021 | fairseq/fairseq/clib/libnat/edit_dist.cpp | #include <torch/torch.h> // @manual=//caffe2:torch_extension
#include <pybind11/detail/common.h>
#include <pybind11/pybind11.h>
#include <vector>
#include <algorithm>
#include <cstdint>
#include <iosfwd>
#include <memory>
#include <new>
#include <string>
#include <utility>
using namespace ::std;
vector<vector<uint32_... | ALGO | 0.996768 | 7.077992 |
1f891dc9-bbad-4ff4-affe-0944765ee2fd | scalyvladimir/algorithms_and_data_structures | contests/1sem/diht_contest/C.cpp | #include <iostream>
using namespace std;
int64_t modular_pow(int64_t &base, int64_t &exponent, const int64_t &modulus);
int main() {
int64_t x, y, p;
cin >> x >> y >> p;
cout << modular_pow(x, y, p) << endl;
return 0;
}
int64_t modular_pow(int64_t &base, int64_t &exponent, const int64_t &modulus) {
... | ALGO | 0.999991 | 5.257458 |
7638e049-bcd0-459f-b155-5e416ffc86fa | tony-ku/exercises | 02_17_25/diameter_of_binary_tree.cpp |
/* Diameter of Binary Tree
Given the root of a binary tree, return the length of the diameter of the tree.
The diameter of a binary tree is the length of the longest path between any two nodes in a tree. This path may or may not pass through the root.
The length of a path between two nodes is represented by the nu... | ALGO | 0.999968 | 6.759984 |
95c676c4-994d-4096-a725-3438b68b3cc8 | ishandutta2007/codeforces | siberian/normal/1207/C.cpp | #include <bits/stdc++.h>
using namespace std;
#define int long long
#define pb push_back
#define all(x) x.begin(), x.end()
template <typename T1, typename T2> inline void chkmin(T1 &x, const T2 & y) {if (x > y) x = y;}
template <typename T1, typename T2> inline void chkmax(T1 &x, const T2 & y) {if (x < y) x = y;}
co... | ALGO | 0.999435 | 3.835618 |
020294ae-795c-4471-a788-92e0cbf72a2b | DevM4rk/algorithm-Baekjoon-OJ | 2021_06/1654.cpp | #include <bits/stdc++.h>
#define endl "\n"
#define all(v) v.begin(), v.end()
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
typedef pair<int, int> pii;
typedef pair <ll, ll> pll;
typedef vector<int> vi;
typedef vector <ll> vl;
int N, K, target;
int main(){
ios_base::sync_with_stdio(... | ALGO | 0.999969 | 4.058368 |
d8bde695-fe36-48a1-a161-4b998bcec9f2 | fison67s/vlc-mmt-plugin | modules/access/dshow/crossbar.cpp | /*****************************************************************************
* Preamble
*****************************************************************************/
#ifdef HAVE_CONFIG_H
# include "config.h"
#endif
#include <vlc_common.h>
#ifndef _MSC_VER
/* Work-around a bug in w32api-2.5 */
# define QAC... | TOOL | 0.947032 | 5.231729 |
8ebf22b5-31b5-46b5-83e4-1e4d1aa11f6f | brahmaneya/WorkerEvaluationGeneral | Worker_General/eigen/bench/bench_gemm.cpp |
// g++-4.4 bench_gemm.cpp -I .. -O2 -DNDEBUG -lrt -fopenmp && OMP_NUM_THREADS=2 ./a.out
// icpc bench_gemm.cpp -I .. -O3 -DNDEBUG -lrt -openmp && OMP_NUM_THREADS=2 ./a.out
#include <iostream>
#include <Eigen/Core>
#include <bench/BenchTimer.h>
using namespace std;
using namespace Eigen;
#ifndef SCALAR
// #define... | TOOL | 0.9796 | 6.004661 |
dd05017e-ed36-44fe-a2da-d1551da7ec63 | rashhhhh/HacktoberFest22 | DSA/Top_View_Of_BT.cpp | //{ Driver Code Starts
//Initial Template for C++
#include <bits/stdc++.h>
using namespace std;
// Tree Node
struct Node
{
int data;
Node* left;
Node* right;
};
// Utility function to create a new Tree Node
Node* newNode(int val)
{
Node* temp = new Node;
temp->data = val;
temp->left = NULL;
... | ALGO | 0.999767 | 6.989119 |
0ff19752-2673-498f-bcf1-e11e589ae624 | MarkelAlvarez/Practicas-FdI-UCM | 2ยบ/1ยบ semestre/FAL/Varios/4.- Vuelta atras/nReinas.cpp | #include <iostream>
using namespace std;
void escribeTablero(int fila[], int n);
void escribeTodas(int solParcial[], int k, int n);
bool esPrometedora(int tablero[], int cuantas);
int main()
{
int sol[100], consulta = 4;
cout << "CON UN TABLERO DE " << consulta << "x" << consulta << "HAY" << cuantas(sol, 0, 4) << ... | ALGO | 0.995548 | 4.300177 |
f027b564-3005-45e5-bf96-cbac7a4f175e | ozu-201/graph-puzzle-game-erenerismis | src/Array/Heap/Heap.cpp | //
// Created by Olcay Taner YILDIZ on 24.04.2023.
//
#include "Heap.h"
Heap::Heap(int N) {
array = new HeapNode[N];
count = 0;
this->N = N;
}
bool Heap::isEmpty() const {
return count == 0;
}
bool Heap::isFull() const {
return count == N;
}
void Heap::swapNode(int index1, int index2) {
Hea... | ALGO | 0.961199 | 4.509274 |
1d15a194-1dde-49e3-959a-1693bcd180bb | TriMickTri/elements-of-programming-interviews | Longest_increasing_subarray.cpp | #include <algorithm>
#include <cassert>
#include <iostream>
#include <random>
#include <utility>
#include <vector>
using std::cout;
using std::default_random_engine;
using std::endl;
using std::pair;
using std::random_device;
using std::uniform_int_distribution;
using std::vector;
// @include
pair<int, int> find_long... | ALGO | 0.999773 | 4.679532 |
31154714-4e70-4353-a275-5deeb06a8e9c | haozha111/crack_ctci | ch04/4.3.cpp | #include "../header/BinaryTree.hpp"
#include "../ctci.h"
using namespace std;
Tnode<int>* _BuildMinHeightBST(vector<int>& vec, int low, int high){
if (low > high){
return NULL;
}
int mid = (high + low) / 2;
Tnode<int>* root = new Tnode<int>(vec[mid]);
root->lchild = _BuildMinHeightBST(vec, low, mid - 1... | ALGO | 0.999955 | 5.356894 |
7e0500e2-4e17-46f9-a6c1-0682748a86d7 | bitrig/bitrig | contrib/llvm/lib/CodeGen/InterferenceCache.cpp | #include "InterferenceCache.h"
#include "llvm/CodeGen/LiveIntervalAnalysis.h"
#include "llvm/Support/ErrorHandling.h"
#include "llvm/Target/TargetRegisterInfo.h"
using namespace llvm;
#define DEBUG_TYPE "regalloc"
// Static member used for null interference cursors.
const InterferenceCache::BlockInterference
Int... | ALGO | 0.962907 | 7.761746 |
02ef32cf-f60e-487d-9efd-a36e52d74eec | StefanTodoran/a-star-search | heuristics.cpp | #include <vector>
#include <stdlib.h>
#include "logic.h"
#include "search.h"
#include "heuristics.h"
int manhattanDistance(Position positionA, Position positionB) {
return abs(positionA.x - positionB.x) + abs(positionA.y - positionB.y);
}
std::vector<Position> getTilePositions(const Board board, TileType type) {
... | ALGO | 0.999849 | 5.801558 |
01c039b9-7e96-4edf-8671-e2d180e3cc32 | stbrumme/microsat-cpp | examples/microlink.cpp | // compile:
// g++ microlink.cpp -o microlink -std=c++11
#include "../microsat-cpp.h"
#include "../cnfwriter.h"
#include <vector>
#include <string>
#include <set>
#include <iostream>
// see https://de.wikipedia.org/wiki/Slitherlink
auto wiki1 = "1223"
" 113"
"3113"
... | ALGO | 0.999874 | 5.356275 |
4b50afad-8dcc-453b-b984-3cd26f769fda | yangzheng2115/hashcomp | utils/DistributionTool.cpp | //
// Created by lwh on 19-6-16.
//
#include <iostream>
#include <sstream>
#include <string>
#include <vector>
#include <fstream>
#include <unordered_map>
#include <algorithm>
#include <map>
#include <iterator>
using namespace std;
enum COM {
READ,
INSERT,
UPDATE,
DELETE
};
string TYPES[] = {"READ",... | TOOL | 0.921024 | 4.21908 |
478dfdfb-51c5-45f9-a54e-fae7a7bbe8ce | Gabyoliver606/POO__CC | 12_Agenda e Cinema/agenda_map.cpp | #include <iostream>
#include <vector>
#include <sstream>
#include <string>
#include <algorithm>
#include <map>
using namespace std;
class Fone {
private:
string id;
string numero;
public:
Fone(string id, string numero) : id{id}, numero{numero}{}
friend ostream &operator<<(ost... | TOOL | 0.954544 | 5.040224 |
aceb8e39-b2d8-4cfb-8340-0e3d1e8dc27a | Shriyanshu1/DSA | ARRAYS/6.Union of two arrays .cpp |
#include <bits/stdc++.h>
using namespace std;
class Solution{
public:
//Function to return the count of number of elements in union of two arrays.
int doUnion(int a[], int n, int b[], int m) {
unordered_map<int,int> count;
for(int i=0; i<n; i++){
count[a[i]]++;
}
... | ALGO | 0.999506 | 4.969965 |
6da7a514-311d-4da7-80b1-359a9eb9dd7b | syncfusion/SfQtWebKit | qtwebkit/Source/WebKit2/WebProcess/WebPage/FindController.cpp | #include "config.h"
#include "FindController.h"
#include "PluginView.h"
#include "ShareableBitmap.h"
#include "WKPage.h"
#include "WebCoreArgumentCoders.h"
#include "WebPage.h"
#include "WebPageProxyMessages.h"
#include <WebCore/DocumentMarkerController.h>
#include <WebCore/FloatQuad.h>
#include <WebCore/FocusControll... | TOOL | 0.977923 | 7.835231 |
5adf89e7-1baf-4028-aef9-a4b7d0ed2285 | minjichoii/study_cpp | basic_2/baekjoon2576.cpp | #include <iostream>
#include <algorithm>
using namespace std;
int main() {
int arr[7];
int cnt=0;
int sum=0;
for (int i=0; i<7; i++) {
cin >> arr[i];
}
sort(arr, arr+7);
int answer=0;
for (int i=0; i<7; i++){
if (arr[i]%2==1) {
sum+=arr[i];
c... | ALGO | 0.999756 | 3.424772 |
7b1ed79e-82e2-415c-9cd4-1ac1305dd318 | ermine27/competitive-programming | src/atcoder/abc/262/262-b.cpp | #include <bits/stdc++.h>
using namespace std;
#define reps(i,s,n) for(int i = (int)(s); i < (int)(n); ++i)
#define rep(i,n) reps(i,0,n)
#define repf(i,n) reps(i,1,n+1)
using vi = vector<int>;
using vvi = vector<vi>;
int main(){
int n, m;
cin >> n >> m;
vvi s(n, vi(n));
rep(i, m) {
int u, v;
... | ALGO | 0.999931 | 3.978913 |
03df7a9a-0dcf-417b-948a-177b21d9e104 | apachecn-archive/EAStdC | source/EAFixedPoint.cpp | ///////////////////////////////////////////////////////////////////////////////
// See the header file for documentation and example usage.
///////////////////////////////////////////////////////////////////////////////
#include <EAStdC/internal/Config.h>
#include <EAStdC/EAFixedPoint.h>
#include <EAAssert/eaassert.h>... | ALGO | 0.962815 | 6.990736 |
310ca1f3-8752-4ee1-8ab5-54a341c8659c | toacoin/TOA | src/addrman.cpp | #include "addrman.h"
using namespace std;
int CAddrInfo::GetTriedBucket(const std::vector<unsigned char> &nKey) const
{
CDataStream ss1(SER_GETHASH, 0);
std::vector<unsigned char> vchKey = GetKey();
ss1 << nKey << vchKey;
uint64_t hash1 = Hash(ss1.begin(), ss1.end()).Get64();
CDataStream ss2(SER_... | ALGO | 0.971193 | 6.271472 |
64252e6c-78e8-4e5d-878a-b12b6554b0a3 | wenliangsun/LeetCode | ๅ่ฐ้ๅๅ่ฐๆ /ๆปๅจ็ชๅฃๆๅคงๅผ.cpp | #include <bits/stdc++.h>
using namespace std;
/**
* ๆปๅจ็ชๅฃ็ๆๅคงๅผ
*
* ๅ่ฐ้ๅ
*/
class Solution {
public:
vector<int> maxSlidingWindow(vector<int>& nums, int k) {
vector<int> res;
deque<int> q;
for (int i = 0; i < nums.size(); i++) {
// ๅคๆญ้ๅคดๆฏๅฆ้่ฆๅบ้
if (q.size() && i... | ALGO | 0.999972 | 5.81029 |
3e1f0358-cfba-4774-a167-94c17049b099 | lleviackermann/CpCodes | codeforces/A_Meaning_Mean.cpp | #include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
using namespace std;
using namespace __gnu_pbds;
template <typename T>
using ordered_set = tree<T, null_type, less<T>, rb_tree_tag, tree_order_statistics_node_update>;
#define endl "\n"
#define fo(i, n) for (i = 0;... | ALGO | 0.999894 | 5.194387 |
1bebd816-f578-4bf4-8ccc-9c5055ae6a05 | ssaraf0702/DSA | Code/RMNTREV.cpp | #include<iostream>
#include<algorithm>
using namespace std;
int main(){
ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);
int T;
cin >> T;
while(T--)
{
int n,k;
string s;
cin >> n >> k >> s;
string str="";
int start = 0;
int end = k-1,falg=1;
... | ALGO | 0.999899 | 3.745078 |
0efdc96c-744e-419a-83f9-bdfeaf6268db | Veljko28/cpp-data-algrtms | codeforces/70/GameWithString.cpp | #include <iostream>
#include <cmath>
#include <vector>
#include <algorithm>
#include <iterator>
#include <numeric>
#include <string>
#include <cstring>
#include <ctime>
#include <set>
#include <list>
#include <sstream>
#include <iomanip>
#include <map>
#include <stack>
#include <unordered_map>
#include <deque>
#include... | ALGO | 0.999993 | 4.063044 |
4931b019-0f6e-4015-8ee2-56df71c99d36 | tianyu-z/CPP_Programming_for_MFE | 1.7/1.7.3/1.7.3/Predict.cpp | // Purpose: Predict what will be printed on the screen
// Author Tianyu Zhang
// 26/04/18
#include <stdio.h>
#define PRD(a) printf("%d", (a) ) // Print decimal
#define NL printf("\n"); // Print new line
// Create and initialse array
int a[] = { 0, 1, 2, 3, 4 };
int main()
{
int i;
int* p;
for (i = 0; i <= 4;... | ALGO | 0.982043 | 3.397346 |
522b4b63-9b68-4a23-b2ac-6169467243fc | 731676158/lidar1_pcl | apps/src/openni_klt.cpp | #define MEASURE_FUNCTION_TIME
#include <pcl/common/time.h> //fps calculations
#include <pcl/io/openni_grabber.h>
#include <pcl/visualization/boost.h>
#include <pcl/visualization/image_viewer.h>
#include <pcl/console/print.h>
#include <pcl/console/parse.h>
#include <pcl/console/time.h>
#include <pcl/tracking/pyramidal_k... | TOOL | 0.854185 | 6.198592 |
47d5bfce-4134-4b8e-8867-cf2e46aca740 | SiYouDi/xdoj | n็kๆฌกๆน.cpp | #include<stdio.h>
float pow(int n,int k)
{
if(k==1)
{
return n;
}
else if(k>1)
{
return n*pow(n,k-1);
}
else if(k<1)
{
return pow(n,k+1)*1.0/n;
}
}
int main()
{
int n = 0;
int k = 0;
scanf("%d %d",&n,&k);
float num = pow(n,k);
printf("%f",num);
return 0;
}
| ALGO | 0.999862 | 3.256988 |
7822b139-17ec-4b64-9ae2-9662f082b1b4 | s0urav6529/Codeforces-Solutions | 706D.cpp | #include<bits/stdc++.h>
using namespace std;
using ll=long long;
using ld=long double;
#define fast ios::sync_with_stdio(0);cin.tie(0);cout.tie(0);
#define null NULL
/// Vasiliy's Multiset : https://codeforces.com/contest/706/problem/D
struct trie{
int val,cnt;
trie* childs[2];
};
trie* get_node(){
trie* temp=... | ALGO | 0.999835 | 4.29679 |
ded4ec7d-6b93-4198-bc69-a18ba5169eeb | alexandraback/datacollection | solutions_5706278382862336_0/C++/abhilak/B.cpp |
#include<iostream>
#include<cstdio>
#include<cstdlib>
#include<vector>
#include<queue>
#include<map>
#include<algorithm>
#include<cstring>
#include<cmath>
#include<stack>
#include<string>
#include<cctype>
#include<list>
#include<set>
#include<deque>
#include<queue>
#include<bitset>
#include<functional>
#include<numeri... | ALGO | 0.997878 | 4.191621 |
cc6da53d-fff2-446b-8863-84bef4336d96 | st-tqt/code-ptit | C++/CPP0121 - ฦฏแปC Sแป CHUNG - BแปI Sแป CHUNG.cpp | #include <iostream>
using namespace std;
long long gcd(long long a, long long b){
if (b == 0) return a;
else return gcd(b, a % b);
}
int main(){
int t; cin >> t;
while (t--){
long long a, b; cin >> a >> b;
cout << (a*b)/gcd(a,b) << " " << gcd(a,b) << endl;
}
return 0;
} | ALGO | 0.999823 | 5.392575 |
99536e44-3e63-4457-ba38-1c0d79d2674f | notehg/C- | Project_C++/exemplo.cpp | #include<iostream>
using namespace std;
int main(){
int n1,n2,soma; //declarao de tipos de variaveis
//entrada de dados
cout <<"Digite o valor 1: ";
cin>> n1;
cout <<"Digite o valor 2: s";
cin>> n2;
//processando dados-efetuar soma
soma = n1+n2;
//saida de daodsss
cout<<"soma ="<<soma<<endl;
retu... | TOOL | 0.973463 | 3.074853 |
92399455-871c-477b-ae51-53146f191873 | longjianjiang/LeetOJ | addition/offer_44.cpp | #include <iostream>
#include <vector>
#include <string>
#include <stack>
#include <queue>
#include <map>
#include <set>
#include <unordered_set>
#include <unordered_map>
using namespace std;
// ่พๅ
ฅไธไธช่ฑๆๅฅๅญ๏ผ็ฟป่ฝฌๅฅๅญไธญๅ่ฏ็้กบๅบ๏ผไฝๅ่ฏๅ
ๅญ็ฌฆ็้กบๅบไธๅใไธบ็ฎๅ่ตท่ง๏ผๆ ็น็ฌฆๅทๅๆฎ้ๅญๆฏไธๆ ทๅค็ใไพๅฆ่พๅ
ฅๅญ็ฌฆไธฒ"I am a student. "๏ผๅ่พๅบ"student. a am I"ใ
// 1> ้ๅๅณๅฏ๏ผๆณจๆ็ฉบๆ ผ็ๅคๅฎ๏ผ
clas... | ALGO | 0.99971 | 4.81193 |
a1b70ff8-0b45-4054-84bd-253069780c32 | ishandutta2007/codeforces | rush_d_cat/normal/613/A.cpp | #include <iostream>
#include <algorithm>
#include <cmath>
using namespace std;
typedef long long LL;
const int NICO = 100002;
int n;
double px, py, x[NICO], y[NICO];
double mn = 1e9, mx = 0;
struct Point
{
LL x, y;
Point() {}
Point(int x_, int y_) { x = x_; y = y_; }
Point operator - (const P... | ALGO | 0.999679 | 4.030911 |
356b231a-9c61-4ebf-b1f2-37e357a7cec2 | yanchingyu/data-structure-class-learning | Postfix and Eval and infix_Eval function.cpp | #include <iostream>
using namespace std;
#define size 100
struct token
{
int number;
char op;
int type; //typeY0Ynumber,1hoperator
void Add(int n, int t, char c)
{
number = n; op = c; type = t;
}
};
template<class T>
class Bag
{
protected:
T *array;
int capacity;
int top;
public:
Bag(int bagCapacity)... | ALGO | 0.998552 | 3.492136 |
c91db4ee-4733-4b78-a417-0756d950d4ca | IITH-Compilers/LLVM-Loop-Profiler | tools/clang/lib/Frontend/MultiplexConsumer.cpp | #include "clang/Frontend/MultiplexConsumer.h"
#include "clang/AST/ASTMutationListener.h"
#include "clang/AST/DeclGroup.h"
#include "clang/Serialization/ASTDeserializationListener.h"
using namespace clang;
namespace clang {
// This ASTDeserializationListener forwards its notifications to a set of
// child listeners.
... | TOOL | 0.921917 | 7.634627 |
76865c8e-768e-418f-8464-a3d067fced9e | viniciusomarcos/IC-projeto | ACM_HPP.cpp | #ifndef ACM_HPP
#define ACM_HPP
#include <iostream>
#include <vector>
#include <array>
#include <string>
using namespace std;
class Grafo {
private:
int numVertices;
vector<vector<double>> matrizAdj;
public:
Grafo(int n);
void adicionarAresta3(double origem, double destino, double custo); //usado na ... | ALGO | 0.964185 | 4.06635 |
b7c1697b-e21b-49aa-8354-bdc8c42cb6f1 | Fredtonyvel/HackerRank | Cracking_the_coding_interview/array_leftRotation.cpp | #include <map>
#include <set>
#include <list>
#include <cmath>
#include <ctime>
#include <deque>
#include <queue>
#include <stack>
#include <string>
#include <bitset>
#include <cstdio>
#include <limits>
#include <vector>
#include <climits>
#include <cstring>
#include <cstdlib>
#include <fstream>
#include <numeric>
#inc... | ALGO | 0.99997 | 3.018285 |
8e667635-38f2-490a-97aa-3d74500a6c64 | thanoschild/Leetcode | 1325-delete-leaves-with-a-given-value/1325-delete-leaves-with-a-given-value.cpp | /**
* Definition for a binary tree node.
* struct TreeNode {
* int val;
* TreeNode *left;
* TreeNode *right;
* TreeNode() : val(0), left(nullptr), right(nullptr) {}
* TreeNode(int x) : val(x), left(nullptr), right(nullptr) {}
* TreeNode(int x, TreeNode *left, TreeNode *right) : val(x), l... | ALGO | 0.999961 | 6.583187 |
effd9fa6-9852-4ebd-92cb-f797cb8305a2 | Arup20MA20010/Codes | Greedy/squaredSum.cpp | #include<bits/stdc++.h>
using namespace std;
#define int long long
#define nline '\n'
void solve(){
int n;cin>>n;
int arr[n];
int sum=0;
for(int i=0;i<n;i++){
cin>>arr[i];
sum+=arr[i];
}
int ch1=sum/n;int ch2=(sum/n)+1;
int ans1=0,ans2=0;
for(int i=0;i<n;i++){
ans1+=(ch1-arr[i])*(ch1-arr[i]);
ans2+=(ch2... | ALGO | 0.999561 | 4.046491 |
fffc657a-9c1c-41aa-97df-98856c2bcf09 | MoncefMhasni/Kattis | MCPC_RR_Week_1/T/khalilw1.cpp | #include <iostream>
#include <algorithm>
#include <cmath>
#include <iomanip>
#include <cstring>
using namespace std;
const int N = 16;
const double inf = 1e18;
int n;
double m, dp[N][1 << N], v;
bool seen[N][1 << N];
int x[N], y[N], s[N];
const double eps = 1e-11;
inline long long sqr(int a) {
return a * (lon... | ALGO | 0.999959 | 4.644713 |
4bf70c5b-56c1-4081-bd0a-9e63804ad9c8 | lokesh-chand-30/DSA-Pro | Vectors/reverseme.cpp | #include<iostream>
#include<vector>
#include<algorithm>
using namespace std;
void reverse(vector<int>& vec)
{
int size=vec.size();
int start=0;
int end=size-1;
while(start<end)
{
swap(vec[start],vec[end]);
start++;
end--;
}
}
int main()
{
vector<int>vec={1,2,3,4};
reverse(ve... | ALGO | 0.999553 | 4.717194 |
99c08e3b-e702-42ee-9792-4ce07116c9a7 | TusharChauhan09/DSA-cpp | Algorithms/Dynamic Programing/DP-4/Q02_Matrix_Chain_Multiplication.cpp | #include <iostream>
#include <vector>
#include <climits>
using namespace std;
int memo(int i,int j,vector<int>&arr,vector<vector<int>>&dp){
if(i==j || i+1==j) return 0;
if(dp[i][j]!=-1) return dp[i][j];
int mini = INT_MAX;
for(int k=i+1;k<j;k++){
mini = min(mini, memo(i,k,arr,dp)+ memo(k,j,arr,d... | ALGO | 0.999965 | 4.22576 |
72b6def2-1651-4112-bcee-33c623538aa5 | codeSprinterss/codeSprinterss | Goraniiii/Tree/BOJ_2250.cpp | /*
BOJ 2250
Tree
ํธ๋ฆฌ์ ๋ถ๋ชจ ์ฐพ๊ธฐ
S2
*/
#include <iostream>
#include <vector>
using namespace std;
vector<int> tree[10001];
int depth[10001];
int width[10001];
int maxWidth = 0;
int maxDepth = 0;
void dfs(int node, int dep) {
depth[node] = dep;
width[dep]++;
if (width[dep] > maxWidth) {
maxWidth =... | ALGO | 0.999929 | 4.277896 |
c51494de-d52f-4d65-8110-4292686a6692 | Sam91/vmc_general | isingstate.cpp |
#include "randoma.h"
#include "isingstate.h"
//na : number of states per site
//sys: linear size of the D-dimensional bravais lattice
//q : number of sites per sublattice
isingstate::isingstate(int sys)
{
init(sys);
}
/*
isingstate::isingstate(int sys, int ucell)
{
init(sys, ucell);
}*/
isingstate::isingstate(... | ALGO | 0.987104 | 3.617261 |
00727f56-fa66-4e51-9cf3-711900d1c693 | Rakibul-Hassan-1/XPSC_Batch_03 | Club Contest/Practice Contest 1 - Div 4/F_Colorful_Stamp.cpp | //....................................<In the name of Allah>...............................//
//.................................<Bismillahir Rahmanir Rahim>...................................//
// Author : Rakibul Hassan
#include <bits/stdc++.h>
#define ll long long
#define nl endl
#define pii pair<int, int>
#define... | ALGO | 0.999685 | 4.769169 |
bed1397f-6015-4669-86d0-f1709702df7e | Subhammodi/coding | Others/orienteering.cpp | /*
WORKS APP ASSIGNMENT
---
NAME - Subham Modi
BRANCH/PROGRAMME - CSE/Dual(BT-MT)
URN - 10327729
COLLEGE - IIT Kanpur
Question-1 - Orienteering Game
*/
/*Header files required to use C++ standard library*/
#include <cstdio> //stdin stdout
#include <vector> //vector STL container
#include <cstring> //memset
#include <... | ALGO | 0.999649 | 3.408125 |
4a716def-c351-4416-a31a-081989a7d59a | ricardo27637/primer-semestre-programas-c- | invertir cadena.cpp | #include <iostream> //Ricardo Emanuel Quiรฑones Castillo 24041218
#include <cstring>
using namespace std;
void invertirCadena(char* cadena) {
int n = strlen(cadena);
char* inicio = cadena;
char* fin = cadena + n - 1;
char temp;
while (inicio < fin) {
temp = *inicio;
*inicio = *fin... | ALGO | 0.999625 | 3.852287 |
10883e5d-a945-4f32-ad21-cd8700be47b3 | prafull321/DSA | Recursion/generatesubsets.cpp | #include<bits/stdc++.h>
using namespace std;
void subsets(string s,string curr="",int i=0)
{
if(s.length()==i)
{
cout<<curr<<" ";
return;
}
subsets(s,curr,i+1);
subsets(s,curr+s[i],i+1);
}
int main()
{
string s;
cin>>s;
string curr="";
int i=0;
subsets(s,"",0);
} | ALGO | 0.999975 | 4.170038 |
0c021cf0-fefd-4074-949f-a29f502dba0d | phamnutuyetan/DictwithOCR | Image2Text/libraries/tess-two/jni/com_googlecode_tesseract_android/src/cube/search_node.cpp | #include "search_node.h"
namespace tesseract {
// The constructor updates the best paths and costs:
// mean_char_reco_cost_ (returned by BestRecoCost()) is the mean
// char_reco cost of the best_path, including this node.
// best_path_reco_cost is the total char_reco_cost of the best_path,
// but excludes the... | ALGO | 0.99969 | 6.551874 |
c2a38a18-3daf-4f19-99dc-e9849ac66188 | ttsugriy/acmp.ru | 491.cpp | #include <iostream>
#include <string>
int main() {
std::string s; std::cin >> s;
bool all_same = true;
for (int i = 1; i < s.size(); ++i) {
all_same = all_same && s[i] == s[0];
}
if (all_same) {
std::cout << "NO SOLUTION";
return 0;
}
for (int left = 0, right = s.siz... | ALGO | 0.999969 | 4.682611 |
544c2fb6-c12f-4366-9305-6bd03873dd05 | 5ko99/FMI-Semester-6 | check/exam1-2021-04-17/1030/82153.cpp | //
// ". "
//
// - 2020/21
// 1
//
// :
// : 82153
// :
// : 1
// : 2
// , : 17.04.2021
// : 10:30
// : GCC
//
// ( )
// - Visual C++.
// , .
// strlen, strcmp .. deprecated,
// :
//
// *
// (strlen_s, strcmp_s ..).
// - #define .
//
// * _CRT_SEC... | TEST | 0.973283 | 4.073732 |
4c15d538-7391-4828-8a6e-6f2d7be9a35c | madhur3u/DSA-Questions | Arrays/Leaders_in_array.cpp | // https://practice.geeksforgeeks.org/problems/leaders-in-an-array-1587115620/1?utm_source=youtube&utm_medium=collab_striver_ytdescription&utm_campaign=leaders-in-an-array
/*
If we think carefully, we want to compare the elements on the right side only.
So, what if we start from the last element.
That is, weโll try t... | ALGO | 0.999991 | 5.285051 |
b11118c2-4eb6-4069-83c6-8b94efc646d7 | heavenMOJANG/ICPC | programmes_C_Cpp/luogu/P1168 ไธญไฝๆฐ.cpp | #pragma GCC optimize(1)
#pragma GCC optimize(2)
#pragma GCC optimize(3,"Ofast","inline")
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
typedef pair<ll,ll> pll;
const ll inf=0x3f3f3f3f;
ll n,a[100010],b[100010],t[400010];
void update(ll u,ll l,ll r,ll k){
if(l==r)... | ALGO | 0.999998 | 3.619992 |
388fc00e-3911-46bd-825e-c61f3ffac47c | sagar-barapatre/Data-Structures-and-Algorithms | DP/Longest Increasing Subsequence/longest_bitonic_subsequence.cpp | #include <iostream>
#include <vector>
using namespace std;
// Function to find Longest Bitonic Subsequence in an array
int calculateLBS(vector<int> arr)
{
// I[i] stores the length of the longest increasing subsequence
// ending with arr[i]
vector<int> I(arr.size());
// D[i] stores the length of the longest decre... | ALGO | 0.999973 | 5.54945 |
b3d8bc5d-6846-453c-8495-93f36d76ad37 | Isha-101/DSA-TechNeeds-Assignment2 | Q20.cpp | #include<iostream>
using namespace std;
int main()
{
int num;
cout << "Enter number";
cin >> num;
for (int i=0;i<num;i++)
{
for (int j=0;j<num;j++)
{
if (j==0 || j==num-1 || (i>=num/2 && (i==j || i+j==num-1)))
{
cout<<"* ";
}... | ALGO | 0.999731 | 3.513293 |
9356f029-a0df-47a8-9c67-7238461b6439 | jaypatil22/algorithmic-toolbox | week5_dynamic_programming1/2_primitive_calculator/primitive_calculator.cpp | #include <iostream>
#include <vector>
#include <algorithm>
#include <bits/stdc++.h>
using std::vector;
vector<int> optimal_sequence(int n) {
std::vector<int> sequence;
std::vector<int> v(n+1,INT_MAX);
v[0] = v[1] = 0;
for(int i=2;i<=n;i++) {
int t1 = INT_MAX,t2=INT_MAX,t3=INT_MAX;
t1 = v[i-1] + 1;
... | ALGO | 0.999997 | 4.670811 |
dce53466-1cd4-4110-8c83-349ee575cdc4 | amruthg/cses_problem_set | coin_combinations_1.cpp | #include<bits/stdc++.h>
using namespace std;
#define mod 1000000007
int main(){
long long n;
cin>>n;
long long x;
cin>>x;
vector<long long> coins(n);
for(int i=0;i<n;i++){
cin>>coins[i];
}
vector<long long> ways(x+1);
//ways[x]=sigma ways[x-t] where t belongs to coins
... | ALGO | 0.999979 | 4.201879 |
e8fb73b7-7085-4529-a2a0-ddea09cf518c | YimianDai/OMAR | src/OCMU_Functions/ocmu_gradient.cpp | #include <opencv2/opencv.hpp>
#include <iostream>
void ocmu_gradient(cv::Mat img, cv::Mat_<double> &Gx, cv::Mat_<double> &Gy)
{
cv::Mat_<double> dImg;
img.convertTo(dImg, CV_64F);
int rows = img.rows;
int cols = img.cols;
cv::Mat_<double> xTopVec = dImg.col(1) - dImg.col(0);
cv::Mat_<double> xBotVec = dImg.col(... | ALGO | 0.995355 | 5.266057 |
2fb79831-cde6-4333-b77d-cd69ed53156f | jtiger0303/BaekJoonAlgo | DP/BOJ11060.cpp | #include <iostream>
#include <algorithm>
using namespace std;
int dp[1001], val[1001], n;
int main()
{
cin >> n;
//dp[i]=i๋ฒ์งธ ์นธ๊น์ง ์ฌ ์ ์๋ ์ต์ ์ ํ ์
for (int i = 1; i <= n; i++) {
cin >> val[i];
dp[i] = 987654321;
}
dp[1] = 0;
for (int i = 1; i <= n; i++) {
for (int j = 0... | ALGO | 0.999966 | 3.921302 |
5cbc4073-2645-4f83-9343-679ce4940301 | SINGHxTUSHAR/DSA-SINGHxTUSHAR | Practise cpp Codes/Revision_CPP/test_case45.cpp | #include<iostream>
using namespace std;
int binarySearch(int arr[], int size, int key) {
int start = 0;
int end = size-1;
int mid = start + (end-start)/2;
while(start <= end) {
if(arr[mid] == key) {
return mid;
}
//go to right wala part
if(key > arr[mid]... | ALGO | 0.999959 | 5.559894 |
0c21b953-7da3-4335-b82f-acb67c6d8cf2 | rifathasanpriyo/competitive-Programming | codeforces/A. Stones on the Table.cpp | #include<iostream>
#include<string>
using namespace std;
int main()
{
int n,count=0;
cin>>n;
string s;
cin>>s;
int i,j;
for(i=0;i<n;i++)
{
if(s[i]==s[i+1])
{
count++;
}
}
cout<<count;
}
| ALGO | 0.999916 | 3.314714 |
853269c2-1bc8-4221-9c81-b0bd199ea1eb | lilinxi/RayTracingWeekend | NextWeek/test_texture_1.cpp | #include <iostream>
#include <fstream>
#include <vector>
#include <chrono>
#include "ray.hpp"
#include "hitable.hpp"
#include "camera.hpp"
#include "material.hpp"
using namespace std;
Vector3d lerp(double t, Vector3d start, Vector3d end) {
return (1.0 - t) * start + t * end;
}
Vector3d color(const Ray &ray, Hita... | ALGO | 0.959661 | 4.596095 |
47b348d3-6dd6-4f88-8adb-69f2f5c6c6fe | Dhruvkelkar/YBIPROJECT | map.cpp | /*
Represent a given graph using adjacency matrix/list to perform DFS and using adjacency
list to perform BFS. Use the map of the area around the college as the graph. Identify the
prominent land marks as nodes and perform DFS and BFS on that.
*/
#include <iostream>
#include <queue>
#include <stack>
using namespace ... | ALGO | 0.998255 | 4.810531 |
20f53513-8620-43c8-98a5-53b08f6cfe69 | ishandutta2007/codeforces | zyb/normal/357/A.cpp | #include<stdio.h>
using namespace std;
int i,j,k,l,s,m,n,x,y;
int a[100005],f[100005];;
int main()
{
scanf("%d",&n);
for (i=1;i<=n;i++)
{
scanf("%d",&a[i]);
f[i]=f[i-1]+a[i];
}
int s=f[n];
scanf("%d%d",&x,&y);
for (i=1;i<=n;i++)
if (f[i-1]>=x&&f[i-1]<=y)
if (s-f[i-1]>=x&&s-f[i-1]<=y)
{
printf("%d\n",i);... | ALGO | 0.999993 | 3.039253 |
e27afeff-0c12-4137-8f39-53b6602e85b9 | galibhaskar/Programming_Pathsala_Problem_Solving_Practice | arrays_and_vectors/sum_of_2d_subarrays_queries(rev_lookup)/a.cpp | #include <bits/stdc++.h>
using namespace std;
typedef long long int llt;
#define mod 1000000007
template <typename T>
vector<vector<T>> scan_2d_vector()
{
int m, n, i = 0, j;
cin >> m >> n;
vector<vector<T>> arr(m, vector<T>(n));
T input;
for (auto i = 0; i < m; i++)
{
for (auto ... | ALGO | 0.999686 | 4.840058 |
5f82e7d2-2a67-46b8-aa78-75d34fd24b66 | Coondinator/Simple-SPH | New Unity Project/Library/PackageCache/com.unity.ide.visualstudio@2.0.12/Editor/COMIntegration/COMIntegration~/COMIntegration.cpp | #include <iostream>
#include <sstream>
#include <string>
#include <filesystem>
#include <windows.h>
#include <shlwapi.h>
#include "BStrHolder.h"
#include "ComPtr.h"
#include "dte80a.tlh"
constexpr int RETRY_INTERVAL_MS = 150;
constexpr int TIMEOUT_MS = 10000;
// Often a DTE call made to Visual Studio can fail after ... | TOOL | 0.969899 | 6.969462 |
fa9ef238-b98f-4de7-86df-83bdb166ce8c | CagesThrottleUs/CodeForcesSolution | CodeForces/110A/main.cpp | /**
* Sort your headers here
*/
#include <array> // for std::array
#include <cstddef> // for std::size_t
#include <cstdint> // for std::uint8_t, std::int64_t
#include <iostream> // for std::cin, std::cout
/**
* Template for fast I/O for competitive programming
*/
inline auto do_fast_io() noexcept -> void
{
... | ALGO | 0.999381 | 6.080725 |
956a5ad7-f905-44f1-9710-3932624fced8 | atul799/CarND-Path-Planning-Project | src/Eigen-3.3/test/sparse_permutations.cpp | static long int nb_transposed_copies;
#define EIGEN_SPARSE_TRANSPOSED_COPY_PLUGIN {nb_transposed_copies++;}
#define VERIFY_TRANSPOSITION_COUNT(XPR,N) {\
nb_transposed_copies = 0; \
XPR; \
if(nb_transposed_copies!=N) std::cerr << "nb_transposed_copies == " << nb_transposed_copies << "\n"; \
VERIFY( (#XPR... | TEST | 0.926281 | 6.2616 |
0622a4d4-7c6f-458b-897a-228ad9c6f5af | emanali-dev/Leetcode | 0153-find-minimum-in-rotated-sorted-array/0153-find-minimum-in-rotated-sorted-array.cpp | class Solution {
public:
int findMin(vector<int>& nums)
{
int l = 0;
int r = nums.size();
int size = r - 1;
while(l < size)
{
int mid = l + (size-l)/2;
if(nums[mid] > nums[size])
{
l = mid+1;
}
... | ALGO | 0.999986 | 5.721524 |
afc4058e-deb3-4bdd-808f-076fac23d124 | ehnryx/acm | fb-hackercup/2020/round1/a3.cpp | //#pragma GCC optimize("O3")
//#pragma GCC target("sse4,avx2,abm,fma")
#include <bits/stdc++.h>
using namespace std;
#define _USE_MATH_DEFINES
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
using namespace __gnu_pbds;
template <typename T>
using ordered_set = tree<T, null_type, less<T>, ... | ALGO | 0.99992 | 3.962815 |
b4630ecd-9607-4c56-8180-1f6927188d30 | Sharafabdullah/CompetitiveProgramming | acmTraining/acmContest/G_qaruti_and_Bazar_Palindrome.cpp | #include <bits/stdc++.h>
using namespace std;
#define all(v) ((v).begin()), ((v).end())
#define rep(i, begin, end) for (__typeof(end) i = (begin) - ((begin) > (end)); i != (end) - ((begin) > (end)); i += 1 - 2 * ((begin) > (end)))
#define pb push_back
#define ppb pop_back
#define F ... | ALGO | 0.999445 | 3.860395 |
59a2a475-ee43-4bde-ade3-19695a89f3b7 | PremiumGraphicsCodes/CGLib | Physics/OrientedParticle.cpp | #include "OrientedParticle.h"
using namespace Crystal::Math;
using namespace Crystal::Core;
using namespace Crystal::Physics;
namespace {
float getWeight(const float dist, const float radius) {
if (dist < radius) {
return 1.0f - std::pow(dist / radius, 3);
}
return 0.0f;
}
}
Matrix3d<float> OrientedPartic... | ALGO | 0.99784 | 6.365911 |
e4972ace-95c7-48a6-8c7e-edbdbc6fa921 | FarihaUpoma/Programming-Codes | UVa/146-IDCodes.cpp | #include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include <math.h>
#include <algorithm>
#include <ctype.h>
#include <iostream>
#include <map>
#include <vector>
#include <queue>
#include <stack>
using namespace std;
#define eps 1e-10
#define PI acos(-1)
int main()
{
char a[60];
while(scanf("%s", a))... | ALGO | 0.999962 | 3.071499 |
0d85df23-ca3b-48ac-b017-7beb35462bf6 | snSon/algorithm_study | ํ๋ก๊ทธ๋๋จธ์ค/1/159994.โ
์นด๋โ
๋ญ์น/์นด๋โ
๋ญ์น.cpp | #include <string>
#include <vector>
#include <iostream>
using namespace std;
// string solution(vector<string> cards1, vector<string> cards2, vector<string> goal) {
// int idx_1 = 0, idx_2 = 0;
// for(int i = 0; i < goal.size(); i++){
// while(1){
// if(idx_1 >= cards1.size() && idx_2 >= c... | ALGO | 0.999943 | 5.693442 |
c914e9ae-3f77-4dfa-9f78-97f4fc8a56d4 | chenduckgo/huahuod | src/ripple/rpc/impl/TransactionSign.cpp | //------------------------------------------------------------------------------
//==============================================================================
#include <ripple/rpc/impl/TransactionSign.h>
#include <ripple/app/ledger/LedgerMaster.h>
#include <ripple/app/ledger/OpenLedger.h>
#include <ripple/app/main... | TOOL | 0.96112 | 7.038827 |
76a40cee-cace-46c4-8fa9-2ccf99d96f00 | walkccc/LeetCode | solutions/1238. Circular Permutation in Binary Representation/1238.cpp | class Solution {
public:
vector<int> circularPermutation(int n, int start) {
vector<int> ans;
for (int i = 0; i < 1 << n; ++i)
ans.push_back(start ^ i ^ i >> 1);
return ans;
}
};
| ALGO | 0.999835 | 5.975779 |
562313ea-c4d2-4baa-83a1-230f657ca79a | amirphl/learning | data-structures/geeks-for-geeks/queue/find-the-count-of-unvisited-indices-in-an-infinite-array.cpp | // https://www.geeksforgeeks.org/find-the-count-of-unvisited-indices-in-an-infinite-array/
// { Driver Code Starts
//Initial Template for C++
#include <bits/stdc++.h>
#include <unordered_set>
using namespace std;
// } Driver Code Ends
//User function Template for C++
class Solution {
public:
int candies(int m, ... | ALGO | 0.999852 | 6.220037 |
d731d28e-fb1a-4631-a551-298bdf4f86df | Zu-rin/AtCoder | DISCO_2016_Final/A.cpp | #include <iostream>
#include <vector>
#include <string>
#include <algorithm>
#include <cmath>
using namespace std;
typedef long long ll;
int main(void) {
int r, k, kk, R, ans = 0, a = 0, i;
cin >> r >> k;
r = r << 1;
kk = k << 1;
R = r * r;
for (i = kk; i < r; i += kk)
ans += sqrt(R - i * i) / kk;
/*for (i =... | ALGO | 0.997573 | 3.110278 |
a8bd9052-b827-4f2c-b770-cf78139ae384 | RahulMittal18/Leetcode_solutions | Change Bits - GFG/change-bits.cpp | // { Driver Code Starts
//Initial Template for C++
#include <bits/stdc++.h>
using namespace std;
// } Driver Code Ends
//User function Template for C++
class Solution {
public:
vector<int> changeBits(int N) {
int i=31;
int ans = 0;
while(((1<<i)&N)==0) i--;
while(i>=0)... | ALGO | 0.999679 | 5.830466 |
af1efe5e-f792-435f-ae71-eb8680feddc9 | keshav25201/data-structure-and-algo | recursion in arrays/display array in reverse.cpp | #include <iostream>
using namespace std;
void printarr(int arr[],int idx,int n){
if(idx==n){
return;}
printarr(arr,idx+1,n);
cout<<arr[idx]<<'\n';
}
int main() {
int n;
cin>>n;
int arr[n];
for (int i = 0; i < n; i++) {
cin>>arr[i];
}
printarr(arr,0,n);
return 0;
}
| ALGO | 0.999752 | 4.651159 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.