uuid string | repo_name string | relative_path string | content string | category string | algo_rel_score float64 | quality_score float64 |
|---|---|---|---|---|---|---|
c6b7f9fe-066a-4c06-9e85-1c004010eb49 | StarryFK/acmlearn | practice/ch/ch3401.cpp | #include <iostream>
#include <cstring>
#include <cstdio>
using namespace std;
#define LL long long
#define RLL(x) scanf("%lld", &x)
#define RS(x) scanf("%s", x)
LL n,m,t,act;
LL l=1;
char op[100];
char ops[15][10];
LL lenops[15];
LL st[100];
LL trans[65][100][100];
inline LL pos(LL i, LL j){
return (i-1)*m+j;
}
LL g... | ALGO | 0.999907 | 4.077316 |
643a8b3f-0238-4d3d-9f64-960b1b01b68b | chauhansatyam3112/DSA-problems | 0682-baseball-game/0682-baseball-game.cpp | class Solution {
public:
int calPoints(vector<string>& op) {
stack<string>st;
for(int i=0;i<op.size();i++)
{
if(op[i]!="C" && op[i]!="D" && op[i]!="+" )
{
st.push(op[i]);
}
else{
if(op[i]=="C")
... | ALGO | 0.999867 | 5.938927 |
ad1619d6-2e0e-456a-b3ac-dcf2169d65c2 | tbagz104/amfoss-tasks | task-02/Codeforces/Football.cpp | #include<bits/stdc++.h>
using namespace std;
int main(){
string str;
cin >> str;
int t=0;
int one = 0,zero = 0;
for(int i = 0; i < str.length(); i++)
{
if(str[i] == '1')
{
one++;
zero = 0;
}
else
{
zero++;
... | ALGO | 0.999501 | 3.651495 |
7010e0ed-0a96-460b-96ac-cee099068745 | juribeparada/MMDVM_CM | DMR2P25/Hamming.cpp | #include "Hamming.h"
#include <cstdio>
#include <cassert>
// Hamming (15,11,3) check a boolean data array
bool CHamming::decode15113_1(bool* d)
{
assert(d != NULL);
// Calculate the parity it should have
bool c0 = d[0] ^ d[1] ^ d[2] ^ d[3] ^ d[4] ^ d[5] ^ d[6];
bool c1 = d[0] ^ d[1] ^ d[2] ^ d[3] ^ d[7] ^ d[8] ... | ALGO | 0.997692 | 5.288651 |
3b450995-a924-4907-82cc-ff95f53d269c | Ted2016/TedLeetcodeAnswers | 203. Remove Linked List Elements(c++)/203. Remove Linked List Elements.cpp | /**
* Definition for singly-linked list.
* struct ListNode {
* int val;
* ListNode *next;
* ListNode(int x) : val(x), next(NULL) {}
* };
*/
class Solution {
public:
ListNode* removeElements(ListNode* head, int val) {
auto cur = head;
ListNode tmp = ListNode(0);
ListNode* p... | ALGO | 0.999975 | 5.941586 |
4bfbf524-eeaa-48c9-8552-26204bb7311e | KF8311/COMP2011 | L6/2d-array-fcn2.cpp | /* File: 2d-array-fcn2.cpp
* Each row of a 2D array, e.g., a[N][M], can be treated as a 1D array.
* The i-th row can be addressed as a[N],
* which represents a 1D array of M elements.
*/
float euclidean_distance(const float point_A[], const float point_B[])
{
float x_diff = point_A[0] - point_B[0];
float ... | ALGO | 0.998811 | 5.640415 |
1f805d1c-a6fb-4cfa-9aa1-8279b559099e | zszyellow/leetcode | Cpp/406_queue_reconstruction_by_height/solution.cpp | class Solution {
public:
static bool comp(pair<int, int> a, pair<int, int> b) {
return a.first > b.first || (a.first == b.first && a.second < b.second);
}
vector<pair<int, int>> reconstructQueue(vector<pair<int, int>>& people) {
std::sort(people.begin(), people.end(), comp);
vec... | ALGO | 0.999999 | 5.684041 |
220062d2-f3ce-429d-b64e-9525920f4b77 | hegde95/PPO_TORCS_IMAGE | vtorcs-RL-color/src/drivers/lliaw/spline.cpp | #include <math.h>
#include <stdlib.h>
#include "spline.h"
/* solving tridiagonal nxn matrix with Givens-Rotations in linear time O(n)
[ a1 b1 0 0 0 .......... ]
[ c1 a2 b2 0 0 ...........]
[ 0 c2 a3 b3 0 ...........]
[ ...........................]
[ ................... b(n-1) ]
[ ................ c(n-1... | ALGO | 0.999962 | 5.904467 |
cf8beebc-af47-41c6-a980-a8f7423a81dd | raincross7/code-similarity | codes/train_code/problem115/problem115_307.cpp | #include <bits/stdc++.h>
using namespace std;
using ll=long long;
using vi = vector<int>;
using vvi = vector<vector<int>>;
using vl = vector<ll>;
using vvl = vector<vector<ll>>;
#define all(x) x.begin(),x.end()
#define rep(i,j,n) for (long long i = j; i < (long long)(n); i++)
#define _GLIBCXX_DEBUG
#define MOD 10000000... | ALGO | 0.998974 | 4.066835 |
da4ffd9f-5aef-4bd3-84c6-2c960b489b22 | ccuchengwei/LongReadSelfCorrect | PacBio/LongReadOverlap.cpp | MultipleAlignment LongReadOverlap::buildMultipleAlignment(const std::string& query,
size_t srcKmerLength,
size_t tarKmerLength,
size_t min_overlap,
... | ALGO | 0.990076 | 4.500838 |
fb24f5c1-6689-4641-b0f2-bbdcba42ebed | sreeram0407/City-Graph-and-Shortest-Path-Finder | main.cpp | //********************************************************************
// Author: Sreeram Kondapalli
// Description: //---- is where you should add your own code
//********************************************************************
//include necessary header file here
//----
#include "Graph.h"
#include <string>
#incl... | ALGO | 0.984034 | 3.544302 |
d931b107-822c-4bf7-81d6-39875d6501f7 | RamGupta2000/LoveBabbarDSA_450 | 332_DetectCycleInAnDirectedGraph_BFS.cpp |
#include <bits/stdc++.h>
using namespace std;
class Solution
{
public:
bool isCyclic(int v, vector<int> adj[])
{
vector<int> topo;
vector<int> inDegree(v, 0);
for (int i = 0; i < v; i++)
for (auto it : adj[i])
inDegree[it]++;
queue<int> q;
... | ALGO | 0.999884 | 5.580679 |
f723b50b-7091-478a-a1de-e1359f0ebf98 | showmic96/Online-Judge-Solution | CodeForces/1016B/15238267_AC_280ms_140kB.cpp | // In the name of Allah the Lord of the Worlds.
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
int ar[1005];
int main(void)
{
ios::sync_with_stdio(0);
cin.tie(0);cout.tie(0);
int n , m , q;
cin >> n >> m >> q;
string s , t;
cin >> s >> t;
memset(ar , 0 , sizeof(ar)... | ALGO | 0.999965 | 4.119929 |
373b6f3e-6168-44b5-84ef-f60914f07525 | Request2609/algorithm | suanfa/offer47.cpp | #include <iostream>
using namespace std ;
class Solution {
public:
int Add(int num1, int num2)
{
int temp = 0 ;
while(num2 != 0){
//进行异或
temp = num1^num2 ;
num2 = (num1&num2)<<1 ;
num1 = temp ;
}
return num1 ;
}
};
int main()
{... | ALGO | 0.999891 | 4.599116 |
2b270565-7f54-4673-997a-b791f43b663f | KhushiBindal/CipherSchool | L-30/segment.cpp | const int N = 3e4 + 100, INF = 1e9;
int root, idx;
int n;
int a[N], p[N];
struct Node
{
int s[2], p, v;
int size, add;
void init(int _v, int _p)
{
v = _v, p = _p;
size = 1;
add = 0;
}
void clear() {
size = 0;
add = 0;
s[0] = s[1] = 0;
}
}t... | ALGO | 0.999944 | 4.643339 |
eadf0fe4-a616-4979-8250-79d9fbdd8175 | waowao/libMesh- | contrib/eigen/3.2.9/unsupported/doc/examples/FFT.cpp | // To use the simple FFT implementation
// g++ -o demofft -I.. -Wall -O3 FFT.cpp
// To use the FFTW implementation
// g++ -o demofft -I.. -DUSE_FFTW -Wall -O3 FFT.cpp -lfftw3 -lfftw3f -lfftw3l
#ifdef USE_FFTW
#include <fftw3.h>
#endif
#include <vector>
#include <complex>
#include <algorithm>
#include <iterator>
... | ALGO | 0.971425 | 6.252964 |
d12af063-3c93-44b8-b9b1-6c4c86c1120e | alexandraback/datacollection | solutions_5744014401732608_0/C++/rok04/B.cpp | #include<iostream>
#include<algorithm>
#include<vector>
#include<set>
#include<math.h>
#include<fstream>
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define pii std::pair<int,int>
#define vi std::vector<int>
#define mp(a,b) make_pair(a,b)
#de... | ALGO | 0.999235 | 3.928939 |
3bea7ff9-80d9-40ac-a032-139bf9a3da88 | myCloudStrife/SSPP2018 | sem5/task5/main.cpp | #include <mpi.h>
#include <stdint.h>
#include <cstdlib>
#include <iostream>
struct Matrix {
double *data;
uint64_t rows, columns;
Matrix() {
rows = 0;
columns = 0;
data = NULL;
}
Matrix(uint64_t rows, uint64_t columns) {
this->rows = rows;
this->columns = col... | ALGO | 0.999416 | 4.65505 |
0118aa67-500d-47e5-b60f-9e5d64fad7b9 | robot-Yang/Ewenwan_vision | PCL_APP/Basic/Filtering/Keypoints/narf_keypoint_extraction.cpp | /*
NARF
从深度图像(RangeImage)中提取NARF关键点
1. 边缘提取
对点云而言,场景的边缘代表前景物体和背景物体的分界线。
所以,点云的边缘又分为三种:
前景边缘,背景边缘,阴影边缘。
就是点a 和点b 如果在 rangImage 上是相邻的,然而在三维距离上却很远,那么多半这里就有边缘。
在提取关键点时,
边缘应该作为一个重要的参考依据。
但一定不是唯一的依据。
对于某个物体来说关键点应该是表达了某些特征的点,而不仅仅是边缘点。
所以在设计关键点提取算法时,需要考虑到以下一些因素:
边缘和曲面结构都要考虑进去;
关键点要能重复;
关键点最好落在比较稳定的区域,方便提取法线。
图像的Harris角点算子... | DATA | 0.982323 | 5.330662 |
51bea327-2605-4fc9-9ad4-d466cc7ac7fd | nccaiteam/histopathology_annotation_nia | libs/boost_1_67_0/libs/math/example/negative_binomial_example2.cpp | // negative_binomial_example2.cpp
// Simple example demonstrating use of the Negative Binomial Distribution.
#include <boost/math/distributions/negative_binomial.hpp>
using boost::math::negative_binomial_distribution;
using boost::math::negative_binomial; // typedef
// In a sequence of trials or events
// (Berno... | ALGO | 0.981876 | 6.204316 |
43a13789-964b-475b-933f-c20543f379c6 | dPddddfe/yewon | DS/DS109/Main.cpp | #include <iostream>
#include <stack>
#include <string>
using namespace std;
int main() {
string s;
while (true) {
cin >> s;
if (s == "q") {
cout << "Bye!" << endl;
break;
}
stack<char> left, right;
for (int i = 0; i<s.length(); i++) {
... | ALGO | 0.999915 | 4.578314 |
2c2a4d7b-ee2f-43f8-b7fb-570756864413 | ACM-Obsidian/Obsidian | 2014-05-27/C.cpp | #include <cstdio>
#include <algorithm>
#include <vector>
#define P 1051721729
#define Q 410021621
#define maxn 131072
int tmp[262144], *e = tmp + maxn, cnt[120001], cnt2[120001], x[120001], a[120001];
int **sum;
int pwr(int a, int n, int p) {
int s = 1, t = a;
for (; n; n >>= 1, t = 1LL * t * t % p)
if (n & 1) s = ... | ALGO | 0.999959 | 4.312713 |
26127f74-b7e0-4692-9e66-786088137418 | YongHoonJJo/BOJ | 8980.cpp | #include <cstdio>
#include <vector>
#include <algorithm>
using namespace std;
struct P { int f, t, box; };
bool cmp(P a, P b)
{
return a.t == b.t ? (a.f < b.f) : (a.t < b.t);
}
int main()
{
int n, c, m;
scanf("%d%d%d", &n, &c, &m);
vector<P> v;
while(m--) {
int a, b, box;
scanf("%d%d%d", &a, &b, &box);
v... | ALGO | 0.999892 | 4.298621 |
a7e94f1b-2a44-42df-a35e-a5df61c96d7b | denis-gubar/Leetcode | Sorting/1630. Arithmetic Subarrays.cpp | static int F1[500][9];
static int F2[500][9];
class Solution {
public:
vector<bool> checkArithmeticSubarrays(vector<int>& nums, vector<int>& l, vector<int>& r) {
int Q = l.size();
vector<bool> result(Q);
memset(F1, 0, sizeof(F1));
memset(F2, 0, sizeof(F2));
int N = nums.size(... | ALGO | 0.999972 | 5.317402 |
fa4eb529-1609-4fb4-aa49-20cc400a2758 | aakulchyk/tanks-sfml | lib/json/tests/thirdparty/Fuzzer/FuzzerSHA1.cpp | #include "FuzzerSHA1.h"
#include "FuzzerDefs.h"
/* This code is public-domain - it is based on libcrypt
* placed in the public domain by Wei Dai and other contributors.
*/
#include <iomanip>
#include <sstream>
#include <stdint.h>
#include <string.h>
namespace { // Added for LibFuzzer
#ifdef __BIG_ENDIAN__
# defi... | ALGO | 0.931255 | 7.45007 |
df13ef8f-1ebf-43cd-a94f-2445ca8d36db | Coder-pranto/CodeNCode | Miscellaneous/lambda.cpp |
#include <bits/stdc++.h>
using namespace std;
int main()
{
auto sum = [](int x, int y){ return x+y;};
cout<<sum(4,8)<<endl;
cout<<[](int x, int y){ return x*y;}(3,2)<<endl;
/* In this example, the auto keyword is used to allow the compiler to deduce the return type of the lambda function. Alternativ... | TOOL | 0.862539 | 4.691226 |
6b50b980-a413-4a18-8a3a-a7a204db9b91 | Smarth111/C-codes-on-Program-Dsa | test.cpp | #include <bits/stdc++.h>
using namespace std;
int main() {
// your code goes here
int a=5;
int* p=&a;
int** q=&p;
cout<<* p<<endl;//derefrancing the p at a and hence printing the value at a
cout<<**q<<endl;//double dereferencing at q and hence printing the value at a
cout<<p<<endl;//print the adress stored at p... | ALGO | 0.926742 | 3.172761 |
b2162bd5-4130-4589-bdbf-d9aafee4273b | steffanmouton/JRPGProject | aieBootstrap-master/dependencies/glm/test/core/core_func_integer_find_msb.cpp | // This has the programs for computing the number of leading zeros
// in a word.
// Max line length is 57, to fit in hacker.book.
// Compile with g++, not gcc.
#include <cstdio>
#include <cstdlib> // To define "exit", req'd by XLC.
#include <ctime>
#define LE 1 // 1 for little-endian, 0 for big-endian.
... | ALGO | 0.999418 | 3.211916 |
10e8ec94-161c-4d7e-be67-ec4ce69a6a0b | viftode4/PBINFOOOO | Info/ Skyscrapers (hard version)/main.cpp | #include <bits/stdc++.h>
#define st first
#define nd second
#define pb push_back
#define mp make_pair
#define ll long long
using namespace std;
ifstream fin( "xxx.in" );
ofstream fout( "xxx.in" );
void fast()
{
cin.tie( 0 );
ios_base::sync_with_stdio( 0 );
}
ll n;
ll a[500005];
ll s[500005], p, u;
ll pre[500005... | ALGO | 0.999998 | 3.278272 |
8b19b8be-67ef-4907-8711-0ee95163ad42 | manojz18/Data-Structure-Algoritms | 2D Array/2D Array Basics/problems.cpp/col-wise_sum.cpp | #include<iostream>
using namespace std;
void colWise_Sum(int arr[][3], int rows, int cols){
for(int colm = 0; colm < cols; colm++){
int sum = 0;
for(int row= 0; row < rows; row++){
sum = sum + arr[row][colm];
}
cout << "sum of column" << colm << " is: " << sum << endl... | ALGO | 0.99919 | 4.345942 |
a57fccbe-1e9a-46b6-9624-e4d1f9258642 | 1lann/aio-camp-2015 | usaco/bcount.cpp | #include <cstring>
#include <cstdio>
#include <queue>
#define HOLSTEINS 1
#define GUERNSEYS 2
#define JERSEYS 3
using namespace std;
typedef struct cows {
int holsteins;
int guernseys;
int jerseys;
bool hasValue;
} cow;
cows queries[17][100010];
int allCows[100010];
int numCows;
int maxLayer = 16;
// Inclusive... | ALGO | 0.997761 | 3.571054 |
719c7aa5-ec48-4632-8e92-393d44390948 | sainimohit23/CB-Codes | lec_15_generic_tree/codes/main.cpp | #include <iostream>
#include "levelOrderInput.h"
#include "levelOrderOutput.h"
#include "postOrder.h"
#include "Node.h"
#include "maxNode.h"
using namespace std;
// #include <utility>
// pair<Node<int> *, int> P;
// P.first;
// P.second;
int main(){
Node<int> * tree = levelOrderInput<int>();
// levelOrderOutput(tre... | ALGO | 0.999503 | 3.908043 |
d5126939-0182-4f68-aae9-19ce93e49dce | MohammadRakibulHassan/CSES | cses1667.cpp | #include<bits/stdc++.h>
using namespace std;
int main()
{
int n , m;
cin>>n>>m;
vector<int> dist(n+1 , INT_MAX) , par(n+1);
vector<vector<int>> adj(n+1);
for(int i = 0 ; i < m ;i++){
int a,b;
cin>>a>>b;
adj[a].push_back(b);
adj[b].push_back(a);
}
queue<int> q;... | ALGO | 0.999999 | 4.327459 |
3397caf2-0ef8-4a7f-8101-a36b62896d14 | saacg/algorithms | hw8/Problem4.cpp | // Isaac Goldman HW8 Problem 4
#include <iostream>
#include <string>
#include <cstdlib>
#include <list>
#include <map>
#include <fstream>
#include <utility>
using namespace std;
// function to print the elements in a list
void listPrint(list<string>* stringList){
for(list<string>::iterator it = stringList->begin(... | ALGO | 0.997925 | 4.378864 |
e8caf979-9a87-42e3-9a34-a43c008464c8 | ywyue/RoomFormer | detectron2/layers/csrc/box_iou_rotated/box_iou_rotated_cpu.cpp | namespace detectron2 {
template <typename T>
void box_iou_rotated_cpu_kernel(
const at::Tensor& boxes1,
const at::Tensor& boxes2,
at::Tensor& ious) {
auto num_boxes1 = boxes1.size(0);
auto num_boxes2 = boxes2.size(0);
for (int i = 0; i < num_boxes1; i++) {
for (int j = 0; j < num_boxes2; j++) {
... | ALGO | 0.990578 | 7.186255 |
e419cde4-c707-4b4f-85e4-20201f1d3c75 | wyjoutstanding/Algorithm | CCF-CSP/CSP-Code/第4题/201312-4.cpp | /*
* @Author: wuyangjun
* @Create time: 2019-09-26 17:15:43
* @Last Modified time: 2019-09-26 17:15:43
* @Gitub: https://github.com/wyjoutstanding
*/
#include<bits/stdc++.h>
using namespace std;
typedef long long LL;
LL mod = 1000000007, n, dp[1002][6] = {0}; // 6个状态:{2},{02},{23},{012},{023},{0123}
int main() ... | ALGO | 0.999983 | 4.101612 |
c1964afb-4e15-4431-87d2-3a2df31d1115 | YoungseokCh/problem-solving | baekjoon/30033.cpp | #include <bits/stdc++.h>
using namespace std;
// R번 - Rust Study
int A[1000];
int main(){
int N;
cin >> N;
for (int i=0; i<N; i++){
cin >> A[i];
}
int count = 0;
for (int i=0; i<N; i++){
int x;
cin >> x;
if (x >= A[i]) count++;
}
cout << count;
re... | ALGO | 0.999883 | 3.563994 |
b3b2933c-45ce-44fd-adaf-06aaf0953dad | chapel-lang/chapel-attic | third-party/llvm/llvm-src/lib/Support/SpecialCaseList.cpp | #include "llvm/Support/SpecialCaseList.h"
#include "llvm/ADT/SmallVector.h"
#include "llvm/ADT/StringExtras.h"
#include "llvm/Support/MemoryBuffer.h"
#include "llvm/Support/Regex.h"
#include <string>
#include <system_error>
#include <utility>
#include <stdio.h>
namespace llvm {
bool SpecialCaseList::Matcher::insert(s... | TOOL | 0.922128 | 7.382716 |
cdc8a73b-cc1c-4d14-8d2d-8bcc661034c3 | Pavitragandhi/GFG_solutions | Easy/Check if string is rotated by two places/check-if-string-is-rotated-by-two-places.cpp | //{ Driver Code Starts
#include <bits/stdc++.h>
using namespace std;
// } Driver Code Ends
class Solution
{
public:
//Function to check if a string can be obtained by rotating
//another string by exactly 2 places.
bool isRotated(string str1, string str2)
{
int n = str1.size();
... | ALGO | 0.999687 | 5.586344 |
9592fff2-2225-4063-be8f-b0f5ce6158ef | DavidTsat/CPPDraft | algorithimic problems/string/minimum-remove-to-make-valid-parentheses/Source.cpp | #include <stack>
#include <iostream>
#include <vector>
using namespace std;
class Solution {
//stack<pair<char, int>> sc;
stack<int> sc;
/*
string minRemoveToMakeValid_BAD_MEMOORY(string s) { // memory exceeded
string s2;
for (int i = 0; i < s.size(); ++i)
{
char c... | ALGO | 0.999518 | 5.458685 |
bbbc989f-c342-4978-8066-9e9dbd06fe1a | abner-math/PlaneDetection | eigen3/doc/examples/Tutorial_BlockOperations_print_block.cpp | #include <Eigen/Dense>
#include <iostream>
using namespace std;
int main()
{
Eigen::MatrixXf m(4,4);
m << 1, 2, 3, 4,
5, 6, 7, 8,
9,10,11,12,
13,14,15,16;
cout << "Block in the middle" << endl;
cout << m.block<2,2>(1,1) << endl << endl;
for (int i = 1; i <= 3; ++i)
{
cout << "B... | ALGO | 0.990258 | 3.6853 |
e1df6997-e539-466f-a575-5845ebcf34e5 | h50039135/llvm_again_somehow | libc/src/math/remquol.cpp | #include "src/__support/common.h"
#include "utils/FPUtil/DivisionAndRemainderOperations.h"
namespace __llvm_libc {
long double LLVM_LIBC_ENTRYPOINT(remquol)(long double x, long double y,
int *exp) {
return fputil::remquo(x, y, *exp);
}
} // namespace __llvm_libc
| TOOL | 0.962079 | 5.496768 |
498c7757-08d5-409d-87f2-88439f1e1828 | DEO-DECODE/Mastering_Recursion_and_Backtracking | Partition to K Equal Sum Subsets(LeetCode).cpp | #include<bits/stdc++.h>
using namespace std;
class Solution {
public:
bool canPartition(vector<int> &nums, vector<int> &vis, int k, int ind, int currSum, int sumOfEachSubsets)
{
if (k == 1)
return true;
if (currSum == sumOfEachSubsets)
{
return canPartition(nums, vis, k - 1, 0, 0, sumOf... | ALGO | 0.999953 | 5.25733 |
36dea2a0-0b24-4100-b026-339692cdc42f | guptanitin280/codechef-classes | bs-edu/a4.cpp | #include <bits/stdc++.h>
// 1. bs
#define int long long
#define cf(i, a, b) for(int i=a;i<=b;i++)
#define cb(i, a, b) for(int i=a;i<=b;i--)
#define gcd __gcd
#define endl "\n"
#define pb emplace_back
#define setbits(x) __builtin_popcountll(x)
#define zrobits(x) __bui... | ALGO | 0.999889 | 4.810006 |
40aa5ae9-5125-4212-947b-7c2c4c3e8db2 | dhwanisanmukhani/competitive-coding | codeforces/drinks.cpp | #include <iostream>
#include <algorithm>
#include <vector>
using namespace std;
vector<int>v ;
void binary_search(int val,int l,int r)
{
if(l==r)
{
return l;
}
int mid=(l+r)>>1;
if(val>=v[mid])
{
return binary_search(val,mid+1,r);
}
else
{
return binary_search(val,l,mid);
}
}
int main()
{
int n;
cin... | ALGO | 0.999979 | 3.998277 |
8aed5689-b238-400b-8660-206519161a40 | Pramodms/opencv_images | 3rdparty/carotene/src/sub.cpp | #include "common.hpp"
#include "vtransform.hpp"
namespace CAROTENE_NS {
#ifdef CAROTENE_NEON
namespace {
template <typename T, typename WT>
struct SubWrap
{
typedef T type;
void operator() (const typename internal::VecTraits<T>::vec128 & v_src0,
const typename internal::VecTraits<T>::v... | ALGO | 0.994988 | 6.165411 |
354647c9-a169-4da7-b773-d60827ccc049 | hrb11182/DataStructures-and-Algorithms | C++/Leetcode/226. Invert Binary Tree.cpp | /*
Given the root of a binary tree, invert the tree, and return its root.
Example 1:
Input: root = [4,2,7,1,3,6,9]
Output: [4,7,2,9,6,3,1]
Example 2:
Input: root = [2,1,3]
Output: [2,3,1]
Example 3:
Input: root = []
Output: []
Constraints:
The number of nodes in the tree is in the range [0, 100].
-100 <= Node.val... | ALGO | 0.999998 | 6.952144 |
f221240d-ce3f-4622-bb4a-e962e26b3451 | FariqJavier/UR5-Pick-and-Place-using-OVGNet | workspace/noetic_src/ompl-1.5.2/demos/Koules/KoulesSimulator.cpp | /* Author: Beck Chen, Mark Moll */
#include <ompl/control/SpaceInformation.h>
#include "KoulesStateSpace.h"
#include "KoulesControlSpace.h"
#include "KoulesSimulator.h"
namespace ob = ompl::base;
namespace oc = ompl::control;
namespace
{
inline double normalizeAngle(double theta)
{
if (theta < -boost... | ALGO | 0.997366 | 5.304133 |
44685958-733c-4a82-807a-2194be91ec46 | ishandutta2007/codeforces | baluteshih/normal/1672/D.cpp | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;
#define X first
#define Y second
#define SZ(a) ((int)a.size())
#define ALL(v) v.begin(), v.end()
#define pb push_back
int arr[200005], brr[200005];
int main() {
ios::sync_with_stdio(0), cin.ti... | ALGO | 0.999981 | 3.728413 |
9ae1dfa7-dce3-4ab6-8d57-d3ab5875f186 | hzfsls/leetcode-supercrawl | data/2316.count-unreachable-pairs-of-nodes-in-an-undirected-graph/code_snippets/sol.cpp | class Solution {
public:
long long countPairs(int n, vector<vector<int>>& edges) {
}
}; | ALGO | 0.999691 | 5.978765 |
80346f58-274d-4892-adf3-f43394d30cf3 | juruo-c/ACM | 22.08/22.8.29/22hdu1I.cpp | #include <iostream>
#include <algorithm>
#include <cstring>
#include <cstdio>
#include <set>
#include <vector>
#include <map>
#include <queue>
#include <cmath>
#define ZYCMH
using namespace std;
typedef long long LL;
typedef pair<int, int> PII;
const int N = 500005;
int n;
int x[N], y[N];
bool judge(int x1, int y1... | ALGO | 0.999946 | 3.767275 |
d06043a6-35d6-466e-bb68-262a0dd167ee | vikmeln/FractionCalculator | Project1/MultiplyOperation.cpp | #include "MultiplyOperation.h"
Fraction MultiplyOperation::execute(const Fraction& a, const Fraction& b) const
{
return (a * b).simplify();
}
| TOOL | 0.924581 | 5.348402 |
265f7984-ddf5-498f-9c78-ded6bdf5d5b4 | Tos927/CplusplusEnterprise | C++ Enterprise/GeneratorLevel.cpp |
#include "GeneratorLevel.h"
#include "ShipBehaviour.h"
#include <iostream>
#include <vector>
std::vector<Planet> NewLevel(int planetMax, int planetMin, float radiusMax, float radiusMin, float security) {
int planets = ((double)rand() / RAND_MAX) * (double(planetMax) - double(planetMin)) + planetMin;
std::vector<Pl... | ALGO | 0.984604 | 3.686534 |
0bff095b-2f09-4498-843b-d1cbc1b978b3 | adarshnarayan04/Codeforces | 1894A.cpp | #include <bits/stdc++.h>
using namespace std;
#define ll long long
#define ull unsigned long long
#define popcount(x) __builtin_popcountll(x)
#define w(t) ll testcase; cin>>testcase; for (ll tc = 1; tc <= testcase; ++tc)
#define vin(v,n) for(int i = 0; i < n; ++i){int x;cin>>x;v.pb(x);}
//vin(vector na... | ALGO | 0.999893 | 4.260351 |
92dd5e6a-bd8e-4b60-9e45-c74d42b47bb5 | DavidBShan/Competitive-Programming2022-2024 | OlympiadLevelThree/Feb 25/Love.cpp | #include <bits/stdc++.h>
using namespace std;
const int MM = 10005;
long long sumArr[4][MM];
int main(){
string str; cin >> str;
int len = str.length();
for(int i = 0; i < 4;i++) sumArr[i][0]=0;
for(int i = 1; i <= len;i++){
for(int j = 0; j < 4;j++) sumArr[j][i] = sumArr[j][i-1];
if(str... | ALGO | 0.999551 | 3.323844 |
66ede1d9-3492-49af-99de-629f5379617a | Jihaduttolibinn/125_LoopingFungsi | BEBAS 3/BEBAS 3.cpp |
#include <iostream>
using namespace std;
int main()
{
int x;
srand(time(0));
x = rand() & 10;
cout << "Nilai X Awal = " << x << endl;
while (x > 4)
{
cout << "perulangan Dengan while" << endl;
x = rand()% 10;;
}
cout << "Nilai X akhir = " << x << endl;
}
| ALGO | 0.993443 | 3.176257 |
466f0bba-0dc7-44ca-8805-05fe482d3f10 | evilmucedin/project-euler | euler263/263.cpp | #include <cassert>
#include "lib/primes.h"
#include "lib/console.h"
static constexpr int kLimit = 2000000000;
// static constexpr int kLimit = 1000000;
Erato erato(kLimit);
static bool isPractical(int n) {
if (n > 4) {
if ((n % 4) && (n % 6)) {
return false;
}
}
auto divs = di... | ALGO | 0.999229 | 4.706393 |
431d1b56-15c2-4841-a783-f0c8c9073535 | Guru2113/EatAndShare | 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.9988 | 6.76073 |
0142fdf6-7c41-48a6-aae1-7daf2514c616 | linapex/eos-chinese | contracts/eosio.system/producer_pay.cpp |
//<developer>
// <name>linapex 曹一峰</name>
// <email><EMAIL></email>
// <wx>superexc</wx>
// <qqgroup>128148617</qqgroup>
// <url>https://jsq.ink</url>
// <role>pku engineer</role>
// <date>2019-03-16 19:44:12</date>
//</624457030932893696>
#include "eosio.system.hpp"
#include <eosio.token/eosio.... | ALGO | 0.98679 | 5.162094 |
02a59440-5520-44b9-9d8a-929a80cb011a | RahulRevanna11/c--notes | c++/test.cpp | #include<iostream>
#define NODE 5
using namespace std;
int path[NODE];
int graph[NODE][NODE] = {
{0, 1, 0, 1, 0},
{1, 0, 1, 1, 1},
{0, 1, 0, 0, 1},
{1, 1, 0, 0, 1},
{0, 1, 1, 1, 0},
};
void displayCycle() {
cout<<"Cycle: ";
for (int i = 0; i < NODE; i++)
cout << path[i] << " ";
cout << pa... | ALGO | 0.999944 | 4.331603 |
2d51eb0c-f4a5-4224-b78f-8a47e7c10ed3 | realamanvats/cpp | Array/coparrayintoanothernewarray.cpp | //copy on array in to another array...
#include<iostream>
#include<limits.h>
using namespace std;
int main(){
int n;
cout<<"enter the number of elements in array: ";
cin>>n;
int arr[n]; // first array
cout<<"\n enter the elements :";
for(int i=0;i<n;i++){
cin>>arr[i];
}
i... | ALGO | 0.998667 | 3.041568 |
9d488274-e97b-4210-89c1-11302abc41ca | Prince-Singh-05/Leetcode-Solutions | 76-minimum-window-substring/minimum-window-substring.cpp | class Solution {
public:
string minWindow(string s, string t) {
int freqT[256] = {0};
int l = 0, r = 0, minLen = INT_MAX, start = -1, cnt = 0;
for(int i = 0; i<t.length(); i++) {
freqT[t[i]]++;
}
while(r < s.length()) {
if(freqT[s[r]] > 0) {
... | ALGO | 0.99999 | 6.624866 |
905de703-bf98-4308-80df-cbc815774569 | ernestyalumni/HrdwCCppCUDA | Voltron/Source/Algorithms/HackerRank/BubbleSort.cpp | #include "BubbleSort.h"
#include <algorithm> // std::swap
#include <vector>
using std::swap;
using std::vector;
namespace Algorithms
{
namespace HackerRank
{
namespace Sorting
{
namespace BubbleSort
{
int count_swaps(vector<int>& a)
{
int counter {0};
int n {static_cast<int>(a.size())};
for (int i {0}; i < n... | ALGO | 0.999863 | 5.254478 |
ad55b8be-3931-4b42-8fa4-ca8f1b3aa545 | JaeHua/DataStruct_SourceCode | Graph/lab/lab2.cpp | //
// Created by jjh on 2023/12/24.
//
#include <iostream>
#include <vector>
using namespace std;
#define maxn 10005
int n;
int a[maxn];
vector<int>b;
struct tree
{
int data;
tree*lchild;
tree*rchild;
tree()
{
lchild = rchild = nullptr;
}
tree(int d){
data = d;
lchild... | ALGO | 0.999997 | 4.718328 |
e9bae5e7-21fb-4209-b38c-4a213e7c04a8 | BARDAMRI/3D-Animation | ass2/igl/null.cpp | template <typename DerivedA, typename DerivedN>
IGL_INLINE void igl::null(
const Eigen::PlainObjectBase<DerivedA> & A,
Eigen::PlainObjectBase<DerivedN> & N)
{
using namespace Eigen;
typedef typename DerivedA::Scalar Scalar;
JacobiSVD<MatrixXd> svd(A, ComputeFullV);
svd.setThreshold(A.cols() * svd.singularVa... | ALGO | 0.991987 | 3.441766 |
fca17415-c733-4d8e-883f-fcdf36bd8a89 | raghavthakar/rrt | src/rrt.cpp | #include <iostream>
#include <fstream>
#include <list>
#include <time.h>
#include <cmath>
#include <unistd.h>
#include <random>
#include <chrono>
#define MAX_STEP_LENGTH 50
#define ILLEGAL_NODE -50
#define ROOT_COORDINATE 49
#define TARGET_COL 99
#define TARGET_ROW 99
#define ITERATIONS 1000
#define SLEEP_TIME 1000
#d... | ALGO | 0.999054 | 3.544986 |
1e637d42-e24c-4c7b-adc2-2997c582747a | MirenaAngelova/TD_01 | DSAP_70/67_FSGSA_01/Source.cpp | // Find subarray with the given sum in an array
// Input:
//
// A[] = { 3, 4, -7, 1, 3, 3, 1, -4 }
// Sum = 7
//
// Output :
//
// Subarrays with the given sum are
//
// { 3, 4 }
// { 3, 4, -7, 1, 3, 3 }
// { 1, 3, 3 }
// { 3, 3, 1 }
// Time complexity is O(n**3)
#include <stdio.h>
void printArray(int A[], int ... | ALGO | 0.99978 | 5.641862 |
cb1b0614-145f-40fa-b23a-4b27ca29ac73 | tanya2203/Atomic | Arrrays.cpp/strings/ValidPalindrome.cpp | #include <iostream>
using namespace std;
int toLowerCase(char ch)
{
if (ch >= 'A' && ch <= 'Z')
{
char lower = ch - 'A' + 'a';
return lower;
}
return ch;
}
bool isValid(char ch)
{
if (ch >= 'A' && ch <= 'Z' || ch >= 'a' && ch <= 'z' || ch >= '0' && ch <= 9)
{
return tru... | ALGO | 0.999881 | 4.759381 |
ed05472c-a1f0-413c-b17e-f9616d8b945c | ishandutta2007/codeforces | latte0119/normal/384/E.cpp | #include<bits/stdc++.h>
using namespace std;
#define int long long
typedef pair<int,int>pint;
typedef vector<int>vint;
typedef vector<pint>vpint;
#define pb push_back
#define mp make_pair
#define fi first
#define se second
#define all(v) (v).begin(),(v).end()
#define rep(i,n) for(int i=0;i<(n);i++)
#define reps(i,f,n... | ALGO | 0.999786 | 4.206158 |
f47de78e-8009-40e0-bd38-fb6ed47d26f7 | ishandutta2007/codeforces | hehezhou/normal/1207/D.cpp | #include <bits/stdc++.h>
using namespace std;
const int mod = 998244353;
map<int, int> a, b;
map<pair<int, int>, int> ab;
pair<int, int> d[300010];
int n;
int fac[300010];
int main() {
ios :: sync_with_stdio(0);
cin >> n;
fac[0] = 1;
for(int i = 1; i <= n; i++) {
cin >> d[i].first >> d[i].second... | ALGO | 0.999971 | 4.627642 |
758a4640-c94a-42d7-9c45-8d2c841d31c7 | Codarki/Pyrotech_2016 | democodebase/SDK/boost/libs/math/example/f_test.cpp | #ifdef _MSC_VER
# pragma warning(disable: 4512) // assignment operator could not be generated.
# pragma warning(disable: 4510) // default constructor could not be generated.
# pragma warning(disable: 4610) // can never be instantiated - user defined constructor required.
# pragma warning(disable: 4180) // qualifier... | ALGO | 0.925295 | 5.571537 |
f7dad033-6d10-4105-a5e3-149dd52ade64 | raincross7/code-similarity | codes/train_code/problem118/problem118_379.cpp | #pragma GCC optimize("Ofast")
#include<bits/stdc++.h>
using namespace std;
#define pb push_back
#define fi first
#define se second
#define sz(a) a.size()
#define all(a) a.begin(),a.end()
#define lb lower_bound
#define ub upper_bound
#define owo ios_base::sync_with_stdio(0);cin.tie(0);
#define MOD (ll)(998244353)
#defi... | ALGO | 0.99998 | 4.5258 |
bee2a105-b395-4042-94df-115c3e05264d | Z3-dan/Competitive-Programming | Kattis/Open/Fibonacci number/main.cpp | #include <bits/stdc++.h>
using namespace std;
int n;
long long mem[100000010];
long long fib(int n)
{
if(n == 0) return 1;
if(n == 1) return 1;
if(mem[n] != -1) return mem[n];
return mem[n] = fib(n-1) + fib(n-2);
}
int main()
{
memset(mem, -1, sizeof(mem));
while(cin >> n)
{
cout << fib(n) << endl... | ALGO | 0.999992 | 4.652842 |
e096d008-6cb6-4ff6-95ad-6f60ae66c571 | ishandutta2007/codeforces | riano_/normal/1367/B.cpp | #include <bits/stdc++.h>
using namespace std;
#define ll long long
#define rep(i,n) for(int (i)=0;(i)<(n);(i)++)
#define Pr pair<ll,ll>
#define Tp tuple<int,int,int>
using Graph = vector<vector<int>>;
const ll mod = 1000000007;
int main() {
std::ios::sync_with_stdio(false);
std::cin.tie(nullptr);
ll T; ci... | ALGO | 0.999849 | 4.536312 |
8c9544b3-270b-4d90-a93d-eb41020a89fa | 0utKast/PracticasPlantillasCPP | PRACTICAS236CURSOSTL/PRACTICA10/236_PRACTICA10/236_PRACTICA10/236_PRACTICA10.cpp | #include <iostream>
template <typename T>
class Stack {
public:
Stack() {};
void push(T element) {};
T pop() { return T(); };
bool empty() { return true; };
};
template<>
class Stack<char> {
private:
static const int max_size = 100;
char elements[max_size];
int top;
public:
Stack() : ... | ALGO | 0.976772 | 6.687322 |
25d23035-fd39-4f66-89c6-37523ec20a46 | dxt99/CP-archive | Contest-Practice Archive/Indo Contests/arkavqc/pertemuan.cpp | #include<bits/stdc++.h>
#define pb push_back
#define mp make_pair
#define fs first
#define sd second
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
typedef pair<ll,ll> pl;
typedef vector<ll> vl;
typedef vector<pair<ll,ll>> vll;
typedef vector<pair<ll,pl>> vlll;
typedef priority_queue <ll, v... | ALGO | 0.999979 | 3.843773 |
62ed344f-dc43-48d7-8537-7615d6488cd3 | tori-az/code | practice/Fast_power.cpp | // sample
#include<bits/stdc++.h>
#pragma GCC optimize("Ofast", "unroll-all-loops")
#define tori_az ios_base::sync_with_stdio(false);cin.tie(0);cout.tie(0);
#define int long long
#define endl '\n'
const int MAX = 2e5+5;
const int INF = 9e18;
const int MOD = 1e9+7;
const double EPS = 1e-9;
using namespace std;
int a, b... | ALGO | 0.9999 | 4.676727 |
06bb1453-bc77-408c-84d3-cbb55f3a5b59 | BillOutliers/leet | 274_H_index.cpp | /*
Given an array of citations (each citation is a non-negative integer) of a researcher, write a function to compute the researcher's h-index.
According to the definition of h-index on Wikipedia: "A scientist has index h if h of his/her N papers have at least h citations each, and the other N ? h papers have no more ... | ALGO | 0.999957 | 6.074159 |
726f2dce-f18b-429e-b78b-a36827502b1a | harshabangi/leetcode | cpp/number_of_zeroe_filled_subarrays.cpp | //
// Created by Harsha Vardhan on 25/07/22.
//
#include <iostream>
#include <vector>
#include <unordered_map>
#include <unordered_set>
#include <queue>
using namespace std;
long long zeroFilledSubarray(vector<int> &nums) {
int i = 0, j = 0;
long long ans = 0;
while (j < nums.size()) {
if (nums[j... | ALGO | 0.999773 | 5.887789 |
3446d78f-ce56-4c23-a442-ec8e6160a8e5 | irisktaker/movie_app | 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.998859 | 6.785645 |
82c1c5d8-bfa3-444e-8029-07027e894db0 | ParticulateFlow/LIGGGHTS-PFM | src/USER-CUDA/pair_lj_charmm_coul_charmm_implicit_cuda.cpp | #include <cmath>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include "pair_lj_charmm_coul_charmm_implicit_cuda.h"
#include "pair_lj_charmm_coul_charmm_implicit_cuda_cu.h"
#include "cuda_data.h"
#include "atom.h"
#include "comm.h"
#include "force.h"
#include "kspace.h"
#include "neighbor.h"
#include "neigh_... | ALGO | 0.986563 | 6.196234 |
a719d38f-f6a8-495f-a353-47397787c7d0 | ijmp320/Competitive-Programming | AtCoder/ARC/037.cpp | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
typedef pair<int,int> pii;
#define FOR(i,a,n) for(int i=a;i<(int)(n);i++)
#define REP(i,n) FOR(i,0,n)
#define ALL(a) (a).begin(),(a).end()
#define MP(a,b) make_pair(a,b)
#define PB(a) push_back(a)
#define F first
#define... | ALGO | 0.999978 | 3.080878 |
8aa00020-22f1-479e-bb18-8a0491bb0527 | ampl/coin | Bonmin/Bonmin/src/Interfaces/BonTNLPSolver.cpp | //Bonmin includes
#include "BonTNLPSolver.hpp"
//Ipopt includes
#include "IpBlas.hpp"
//Standard includes
#include <fstream>
#include "BonColReader.hpp"
namespace Bonmin{
using namespace Ipopt;
#if 0
string TNLPSolver::returnCodes[TNLPSolver::numReturnCodes] = {
"Hit iteration limit" /**iterationLimit*/,
... | ALGO | 0.972279 | 3.927197 |
ba51777a-6f42-453f-9247-7a667977161a | icf/Code | C++ code/GpBCS_S.C.CPMC/SC_afqmcConstraintPathBP_4.4_sideRotation_ExactDensityInput/include/eigen/bench/spbench/sp_solver.cpp | // Small bench routine for Eigen available in Eigen
// (C) Desire NUENTSA WAKAM, INRIA
#include <iostream>
#include <fstream>
#include <iomanip>
#include <Eigen/Jacobi>
#include <Eigen/Householder>
#include <Eigen/IterativeLinearSolvers>
#include <Eigen/LU>
#include <unsupported/Eigen/SparseExtra>
//#include <Eigen/Sp... | ALGO | 0.995411 | 4.29849 |
2fe4cf64-ec35-4c9f-9178-023ce396aeea | clockzhong/WrapLAMP | Boost/libs/graph/example/transpose-example.cpp | int
main()
{
using namespace boost;
typedef int weight_t;
typedef adjacency_list < vecS, vecS, bidirectionalS,
property < vertex_name_t, char > > graph_t;
enum { a, b, c, d, e, f, g, N };
graph_t G(N);
property_map < graph_t, vertex_name_t >::type
name_map = get(vertex_name, G);
char name = 'a';
... | ALGO | 0.981595 | 4.504684 |
d7b80bc8-931d-401d-91f4-19c7e3a01b87 | luckykumar19/DSA_algo | queue/dequeu.cpp | #include<iostream>
#include<queue>
using namespace std;
int main(){
deque<int> d;
d.push_front(12);
d.push_back(14);
// cout<< d.front()<<endl;
// cout<< d.back()<<endl;
// cout<< pop_front();
d.pop_front();
cout<<d.back()<<endl;
d.pop_back();
if (d.empty())
{
/... | ALGO | 0.956748 | 3.891086 |
7b6d026b-dc82-41dc-bdec-3dc2a23b4751 | Amritapandey22/Daily-codes | array manipulation.cpp | /* to sort even positions in descending and odd placed in ascending order*/
#include<bits/stdc++.h>
using namespace std;
void array_manipulation()
{
int n;cin>>n;
int a[n];
for(int i=0;i<n;i++)
cin>>a[i];
sort(a,a+n);
vector<int>v1;
int c=0,d=n-1;
for(int i=0;i<n;i++)
if(i%2==0)
v1.push_back(a[c++]);
else
v1.push_... | ALGO | 0.999935 | 4.232378 |
c173f0de-3ff5-4b9c-8554-73e72fc8876c | matiasgomez05/PracticaCpp | Practicas/007 - OperadoresLogicos.cpp | #include<iostream>
using namespace std;
/*
int main()
{
int dia, mes, ao;
cout << "Ingrese nro de da: ";
cin >> dia;
cout << "Ingrese nro de mes: ";
cin >> mes;
cout << "Ingrese nro de ao: ";
cin >> ao;
// 1) Mostrar por consola si la fecha corresponde al primer trimestre (|| OR).
... | TOOL | 0.982803 | 3.358682 |
e7f9a881-75a6-4f7f-8281-2271a3a8b1b0 | Adarsh-hash610/Cpp | leetcode/advance/duplicateelement.cpp | #include<iostream>
using namespace std;
void duplicate(int arr[],int n)
{
if(n==1){
cout << "[]";
}
for(int i=0;i<n;i++){
for(int j=i+1;j<n;j++){
if(arr[i]==arr[j])
{
cout << arr[j] << " ";
}
}
}
}
int main(){
int n... | ALGO | 0.998472 | 4.259241 |
17cda47f-3848-4726-ac46-047e28926ec4 | Williamarvin/innonautics_moos_dev | moos-ivp-pavlab-aro/src/uFldBloomStormSim/FldBloomStormSim.cpp | /************************************************************/
/* NAME: Tyler Paine */
/* ORGN: MIT, Cambridge MA */
/* FILE: FldBloomStormSim.cpp */
/* DATE: December 29th, 1963 ... | ALGO | 0.947833 | 5.426886 |
d2113729-e90b-479c-b045-b1c2f5e3bd53 | khsu95/CodingTest | Programmers/Lv1/완주하지 못한 선수_해시.cpp | //https://programmers.co.kr/learn/courses/30/lessons/42576
#include <string>
#include <vector>
#include <set>
using namespace std;
string solution(vector<string> participant, vector<string> completion) {
string answer = "";
multiset<string> ms;
for(int i=0;i<participant.size();i++)
ms.insert(parti... | ALGO | 0.999658 | 5.256855 |
edcb95e7-1376-4c65-9b90-8006e5f47a31 | Lesords/ACM | codeforces/刷题/Elephant.cpp | #include<stdio.h>
int n;
int main()
{
scanf("%d",&n);
if(!(n%5)) printf("%d\n",n/5);
else printf("%d\n",n/5+1);
return 0;
}
| ALGO | 0.99985 | 3.125359 |
c1e48897-8793-4bc8-8ac2-f95a4b831a4b | joseph-zhong/personal | cuda/samples/NVIDIA_CUDA-8.0_Samples/7_CUDALibraries/nvgraph_SSSP/nvgraph_SSSP.cpp | #include <stdio.h>
#include <stdlib.h>
#include <cuda_runtime.h>
#include "helper_cuda.h"
#include "nvgraph.h"
/* Single Source Shortest Path (SSSP)
* Calculate the shortest path distance from a single vertex in the graph
* to all other vertices.
*/
void check_status(nvgraphStatus_t status)
{
if ((int)status... | ALGO | 0.998989 | 3.786417 |
a283165b-9201-4f15-870c-9794cc838486 | sujalpahwa30/-CrackYourInternship | Greedy/TaskScheduler.cpp | class Solution {
public:
int leastInterval(vector<char>& tasks, int n) {
int counter[26] = {0};
int maximum = 0;
int maxCount = 0;
for (char task : tasks) {
counter[task - 'A']++;
if (maximum == counter[task - 'A']) {
maxCount++;
}
... | ALGO | 0.999984 | 6.859031 |
4edf96e8-64f7-4884-aa92-908d3873adfe | manuel1992j/Fort | src/base58.cpp | #include <base58.h>
#include <hash.h>
#include <uint256.h>
#include <util/strencodings.h>
#include <assert.h>
#include <string.h>
/** All alphanumeric characters except for "0", "I", "O", and "l" */
static const char* pszBase58 = "123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz";
static const int8_t mapBa... | TOOL | 0.917525 | 6.951943 |
a44dedf1-95a5-466b-a886-700b3420318e | wvu-navLab/Enabling-Robust-State-Estimation-through-Measurement-Error-Covariance-Adaptation | 3rdparty/Eigen/doc/examples/class_CwiseUnaryOp_ptrfun.cpp | #include <Eigen/Core>
#include <iostream>
using namespace Eigen;
using namespace std;
// define function to be applied coefficient-wise
double ramp(double x)
{
if (x > 0)
return x;
else
return 0;
}
int main(int, char**)
{
Matrix4d m1 = Matrix4d::Random();
cout << m1 << endl << "becomes: " << endl << ... | ALGO | 0.984897 | 4.120226 |
cfa60d5b-25a2-448e-83b7-f92d4bcd218f | EkaterinaSukhorukova/Zadachi | Rabota2/Zadacha1Virazhenie.cpp | #include <iostream>
#include <algorithm>
#include <stdio.h>
using namespace std;
int main()
{
int c;
cin >> c;
int *a = new int[c + 1];
a[0] =1000;
a[1] =1000;
a[3] =0;
for (int i = 4; i < c + 1; i++)
{
a[i] = 1000;
for (int j = 0; (j*j+j+3)<= i; j++)
{
if ((i - (j*j+j+3))>0... | ALGO | 0.999954 | 3.826612 |
c36c22c9-6766-442b-a73f-96124d2f467a | adivya-jain/DSA_study | GFG/8-May-POTD.cpp | class Solution {
public:
void solve(Node* root, vector<int>curr, vector<vector<int>>&ans){
if(root==NULL){
return;
}
curr.push_back(root->data);
if(root->left==NULL && root->right==NULL){
ans.push_back(curr);
return ;
}
... | ALGO | 0.999954 | 6.00004 |
237008ad-45b9-4553-b670-ccfb9a004643 | adarista012/faceRecognoitionPython | opencv-master/modules/features2d/perf/opencl/perf_brute_force_matcher.cpp | /*M///////////////////////////////////////////////////////////////////////////////////////
//
// IMPORTANT: READ BEFORE DOWNLOADING, COPYING, INSTALLING OR USING.
//
// By downloading, copying, installing or using the software you agree to this license.
// If you do not agree to this license, do not download, instal... | TEST | 0.85978 | 6.782664 |
db4c9f14-fce3-4ddd-a85d-da4326daf7b2 | sashi-cse/c-c- | C++/bstIntro.cpp | #include<iostream>
#include<queue>
using namespace std;
class Node{
public:
int data;
Node* left;
Node* right;
Node(int d){
this->data = d;
this->left = NULL;
this->right = NULL;
}
};
void inorder(Node* root) {
//base case
if(root == NULL) {
return ;
}... | ALGO | 0.999845 | 4.431232 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.