uuid string | repo_name string | relative_path string | content string | category string | algo_rel_score float64 | quality_score float64 |
|---|---|---|---|---|---|---|
a08c870e-163d-4baa-9d1f-4c7b8e28e7e8 | Iann1978/Explore-To-OpenCV | thirdparty/opencv-3.4.2-vc14_vc15/opencv/sources/3rdparty/carotene/src/min_max.cpp | #include <algorithm>
#include "common.hpp"
#include "vtransform.hpp"
namespace CAROTENE_NS {
#ifdef CAROTENE_NEON
namespace {
template <typename T>
struct Min
{
typedef T type;
void operator() (const typename internal::VecTraits<T>::vec128 & v_src0,
const typename internal::VecTraits<... | ALGO | 0.99277 | 6.647814 |
b52206e2-aea0-4a3b-8bb6-9944c83996a0 | HamzaMPSY/problem-solving | uva/uva11960.cpp | #include<bits/stdc++.h>
using namespace std;
#define ll long long int
const int MAXN =1e6 +5;
const int MAXLG = log2(MAXN) + 3;
const int MOD = 1e9 + 7;
int prime[MAXN],primeList[MAXN],nbDiv[MAXN],ans[MAXN],t,n;
void sieve(){
for (int i = 2; i < MAXN; ++i)
if(!prime[i]){
for(int j=i+i; j < MAXN; j+=i)
prim... | ALGO | 0.999954 | 4.65991 |
1fd08f67-0cda-4802-99ac-54f78923ab77 | vaishnavirajj/CodeWithDSA | Char_Arrays_and_Strings/Find_Length_of_character_array.cpp | #include<iostream>
using namespace std;
int getLength(char arr[],int size) {
int count=0;
int index=0;
// while loop
while(arr[index]!='\0') {
count++;
index++;
}
return count;
//for loop
// for (index=0;index<size;index++) {
// if(arr[index]=='\0') {
... | ALGO | 0.981633 | 3.068093 |
56e032a0-c1ee-4995-87d5-31ab4102aac9 | solomonwzs/leetcode | cpp/src/symmetric_tree.cpp | #include "leetcode.h"
using namespace std;
using namespace leetcode;
#define same_nonnull_node(_a, _b) ((_a) && (_b) && (_a)->val==(_b)->val)
#define check_nodes(_a, _b, _v, _nl) \
if (same_nonnull_node(_a, _b)){ \
_v.push_back(_a); \
_v.push_back(_b); \
_nl+=2; \
} else if ((_a)!=NULL || (... | ALGO | 0.999844 | 6.309434 |
8e6398fe-bba1-483c-91ad-b90e0d58233a | jakubowiczish/ASD | Sortings/Array Sortings/Bucket Sort/main.cpp | #include <iostream>
#include <ctime>
#include <cstdlib>
using namespace std;
void setTable(int tab[], int N);
void printTable(int tab[], int N);
int find_maximum_element(int tab[], int N);
int find_minimum_element(int tab[], int N);
void BucketSort(int arr[], int N);
int main()
{
int N = 30;
int arr[N];
s... | ALGO | 0.999555 | 4.41949 |
18f3af5c-d981-400c-bae7-0f274d836e52 | n17y17/kyou_pro_history | At_coder/abc/abc322/abc322_a.cpp | // AC
#include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for(int i = 0; i < (int)(n); ++i)
int main()
{
int n;
string s;
cin >> n >> s;
if (n < 3)
{
cout << -1 << endl;
return 0;
}
rep(i, n-2)
{
if (s.at(i) == 'A' && s.at(i+1) == 'B' && s.at(i+2) == '... | ALGO | 0.999948 | 3.985768 |
1118ef7a-a105-4782-9eec-49cf5c51da31 | ashib11/Sub_Zero_ | Sorting_1.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>
#define ll long long
#define pi acos(-1.0)
#define ull unsigned long long
#define endl "\n"
#define all(v) v.begin(), v.end()
#define allr(v) v.r... | ALGO | 0.999986 | 3.688126 |
0c97bcf8-69df-49cf-84da-6eb1cbe52abd | Wild-Donkey/Code | Luogu/P9000-P9799/P9233_ColorBalance.cpp | #include <algorithm>
#include <bitset>
#include <cmath>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <ctime>
#include <iostream>
#include <map>
#include <queue>
#include <set>
#include <string>
#include <unordered_map>
#include <vector>
#define Wild_Donkey 0
#define foreplay for
#define wild while
u... | ALGO | 0.999816 | 3.885651 |
3fb05edd-c53d-4f4e-b156-d94e211dadaa | prantiknoor/CP | bit_mask.cpp | #include <bits/stdc++.h>
using namespace std;
vector<vector<int>> subset(vector<int> nums) {
vector<vector<int>> subsets;
for(int i = 0; i < (1 << nums.size()); i++) {
subsets.push_back(vector<int>());
for(int j = 0; j < nums.size(); j++) {
if((i & (1 << j)) != 0) {
subsets.back().push_back(n... | ALGO | 0.996958 | 5.773192 |
6d3ad371-a4bb-48cf-81da-662d63c43808 | AcornPublishing/functional-programming-c | 3rd-party/ericniebler/range-v3/test/algorithm/for_each.cpp | #include <vector>
#include <range/v3/core.hpp>
#include <range/v3/algorithm/for_each.hpp>
#include "../simple_test.hpp"
struct S
{
void p() const { *p_ += i_; }
int *p_;
int i_;
};
int main()
{
int sum = 0;
auto fun = [&](int i){sum += i; };
std::vector<int> v1 { 0, 2, 4, 6 };
CHECK(ranges... | TEST | 0.914851 | 6.455429 |
070d0f1d-caa4-4199-85cc-18b3c9ac3dd0 | zwmain/Algorithm | LeetCode/0110.平衡二叉树/main.cpp | #include "main.h"
#include "Utils.hpp"
#include <iostream>
#include <string>
#if !defined(INPUT_PATH)
#define INPUT_PATH "./input.txt"
#endif // INPUT_PATH
int main()
{
string fp(INPUT_PATH);
auto input = zwn::inputTreeNode(fp);
Solution s;
for (auto* t : input) {
bool res = s.isBalanced(t);
... | ALGO | 0.990365 | 5.753518 |
22c7a060-d7b5-4415-8330-b6d575f32a2c | seonpilKim/Algorithm | Greedy/boj/11000/src.cpp | #include <iostream>
#include <string>
#include <vector>
#include <algorithm>
#include <math.h>
#include <bitset>
#include <stack>
#include <queue>
#include <deque>
#include <map>
#include <set>
#include <unordered_set>
#include <unordered_map>
#include <limits.h>
#include <numeric>
#include <functional>
#include <sstre... | ALGO | 0.999938 | 4.219747 |
e1e6dc23-6d92-4c06-89ca-06bca1d7c30c | zty950323/UsingSTLCases | TheModernCppChallenge/Chapter_2/ex2_1/main.cpp | #include <iostream>
#include <type_traits>
#include <variant>
using namespace std;
template <typename T>
unsigned long long sum_of_multiples(T limit)
{
if (std::is_same<T, unsigned int>::value ||
std::is_same<T, unsigned short>::value ||
std::is_same<T, unsigned long>::value ||
std::is_same<T, uns... | ALGO | 0.996592 | 4.434788 |
92a05682-8da9-4c44-82ef-d1c740e80589 | szymon8576/parallelProcessing | zadanie1-koszty-wspoldzielenia-danych/src/PI7.cpp | #include <stdio.h>
#include <omp.h>
#include <time.h>
long long num_steps = 100000000;
double step;
int main(int argc, char* argv[])
{
clock_t start, stop;
double pi, sum = 0.0,tab[80];
int i;
for (int j = 0; j < 30; j++)
{
step = 1. / (double)num_steps;
start = clock();
omp_set_num_threads(2);
#pragm... | ALGO | 0.999942 | 3.204152 |
20bcbc78-3967-4941-ad55-dd346c61006a | vanitas-23/Daily_progress | 2312-most-frequent-number-following-key-in-an-array/2312-most-frequent-number-following-key-in-an-array.cpp | class Solution {
public:
int mostFrequent(vector<int>& nums, int key) {
unordered_map<int,int>mp;
for(int i=0;i<nums.size()-1;i++)
{
if(nums[i]==key)
{
mp[nums[i+1]]++;
}
}
int maxi=-1;
int res=-1;
for(auto i... | ALGO | 0.999999 | 5.617794 |
91b12abf-a893-4144-9f72-aa56095dae51 | Ibrahim-898/Solved_problem | A_Coins.cpp | //Template
#include<bits/stdc++.h>
using namespace std;
#define endl '\n'
#define ll long long
#define ios() ios_base:: sync_with_stdio(0);cin.tie(0);
int main()
{
ios();
int t;
cin >> t;
while(t--)
{
ll n ,k;
cin >> n >> k;
if(n%2==0) cout << "YES" << endl;
else if(... | ALGO | 0.999676 | 4.304779 |
27c56f46-b7d5-4d46-b23d-cc0673eb1d91 | OptimalAlgorithm/algo-study | 2020-01-02 1주차/혜민/카탄의 개척자(통과).cpp | #include <iostream>
#include <vector>
#include <cstring>
using namespace std;
int tc;
int n;
int map[1001][1001] = { 0, }; //
vector <pair<int, int>> tile; //Ÿ ġ (* )
int dir[6][2]{ { -1,1 },{ -2,0 },{ -1,-1 },{ 1,-1 },{ 2,0 },{ 1,1 } }; //6 ̵.
// 2
//
... | ALGO | 0.999711 | 3.683079 |
9ec83167-392b-460b-9a76-5191533a7556 | hgreenlee/ppfx | src/AbsorptionDPIPReweighter.cpp |
#include "AbsorptionDPIPReweighter.h"
#include "CentralValuesAndUncertainties.h"
#include <cstdlib>
#include <iostream>
namespace NeutrinoFluxReweight{
AbsorptionDPIPReweighter::AbsorptionDPIPReweighter(int iuniv, const ParameterTable& cv_pars, const ParameterTable& univ_pars):cvPars(cv_pars),univPars(univ_pa... | TOOL | 0.981456 | 5.122295 |
5638b275-d09c-40cc-bfcc-4dda3d983dfe | sarvex/leetcode-modula | solution/0000-0099/0014.Longest Common Prefix/Solution.cpp | class Solution {
public:
string longestCommonPrefix(vector<string>& strs) {
int n = strs.size();
for (int i = 0; i < strs[0].size(); ++i) {
for (int j = 1; j < n; ++j) {
if (strs[j].size() <= i || strs[j][i] != strs[0][i]) {
return strs[0].substr(0, i)... | ALGO | 0.999887 | 6.03169 |
52b9c05a-5879-487c-9e63-7737a7662ad9 | themichaeltsang/AntiBullyingSocialRobot | src/cpp_classifiers/src/results/trial 1/main.cpp | #include "hCRF.h"
#include "ros/ros.h"
#include "perceptual_filter/FeaturesArr.h"
#include <iostream>
#include <string>
#include <vector>
#include <queue>
#include <fstream>
#include <boost/thread/mutex.hpp>
#ifdef WIN32
#include <conio.h>
#endif
#include <time.h>
#ifdef _OPENMP
#include <omp.h>
#endif
using names... | DATA | 0.929432 | 5.085575 |
e0b938c6-1638-430b-99ee-7915ea40e233 | CalvinNeo/ACM | SRC/nuaa_hhu2016.B.cpp | //#include <iostream>
//#include <cstdio>
//#include <map>
//#include <cstring>
//#include <algorithm>
//using namespace std;
//
//const int N=100010;
//int fr[N];
//char nm[N][20];
//
//int main()
//{
// int n,m;
// scanf("%d%d",&n,&m);
// for (int i=0;i<n;i++) {
// scanf("%d",&fr[i]);
// scanf("%s",nm[i]);
// }
// ... | ALGO | 0.999955 | 3.890511 |
c5a5b673-c3f5-4160-b31f-3e30f2630ae3 | hjiang13/LLMs-in-IR | POJ-104/26/153.cpp | #include <iostream>
using namespace std;
//???????
int main()
{
char input[101]; //?????????
char *p, *q; //?????????
int end; //?????
cin.getline(input, 102);
end = strlen(input); //???
p = input;
q = input;
while(p < input + end) //?????
{
while(*p != ' ' && *p != '\0') ... | ALGO | 0.999707 | 3.330522 |
c43c36e4-3fde-4f2c-a0f1-37814bac3577 | LiShaojun1994/CodingPractice | Chapter3/BFSSearch.cpp | #include <cstdio>
#include <cstring>
#include <iostream>
#include <algorithm>
using namespace std;
const int N = 100010;
int n,m;
int h[N],e[N],ne[N],idx;
int d[N],q[N];
void add(int a, int b){
e[idx] = b;
ne[idx] = h[a];
h[a] = idx++;
}
int bfs(){
int hh = 0;
int tt = 0;
q[0] = 1;
memse... | ALGO | 0.999856 | 4.3012 |
a7b7d09e-af70-423a-9258-abbdb8140066 | b06b01073/cses_dynamic_programming | removing_digits.cpp | #include<bits/stdc++.h>
using namespace std;
vector<long long> dp;
long long solve(int n) {
if(n >= 0 && n <= 9)
return 1;
if(n < 0)
return INT_MAX;
if(dp[n] != INT_MAX)
return dp[n];
int k = n;
while(k) {
int digit = k % 10;
if(digit != 0) {
... | ALGO | 0.999884 | 4.937224 |
50e90b31-640c-4443-b1a1-fa8c259eda3d | AAlkaid/CPP | 函数模板/02函数模板注意事项.cpp | //
// Created by VINNO on 2022/3/22.
//
#include <iostream>
using namespace std;
// 1、函数模板注意事项
// - 自动类型推导,必须要推导出一致的数据类型T才能使用
// - 必须要确定出T的数据类型才能使用
template<class T> // typename可以替换成class
void mySwap(T&a, T&b)
{
T temp = a;
a = b;
b = temp;
}
void test01()
{
int a = 10, b = 20;
char c = 'c';
// ... | TOOL | 0.897671 | 4.379883 |
0d817bd9-ca6f-4ae0-af55-df6ba0de09c3 | cheesege/practicing | Codeforces/Codeforces Round 898 (Div. 4)/A. Short Sort.cpp | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define fastio ios::sync_with_stdio(0);cin.tie(0);
int main(){
fastio
int t;
cin >> t;
for(int i=0;i<t;i++){
string a;
cin >> a;
if(a=="bca" || a=="cab"){
cout << "NO" << '\n';
}
else... | ALGO | 0.999686 | 4.809397 |
146bb17e-be55-414a-9f90-d8a09dd79ffc | sansriti14/Leetcode | 1116-print-zero-even-odd/1116-print-zero-even-odd.cpp | class ZeroEvenOdd {
mutex m;
condition_variable cv;
int curr_value;
bool zero_wait;
private:
int n;
public:
ZeroEvenOdd(int n) {
this->n = n;
curr_value = 1;
zero_wait = false;
}
// printNumber(x) outputs "x", where x is an integer.
void zero(function<v... | ALGO | 0.998857 | 5.457802 |
b67e4ce7-0f0e-4443-a289-cec4f34c8560 | ishandutta2007/codeforces | dvdg6566/normal/1244/G.cpp | #include<bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef vector<int> vi;
typedef pair<int,int> pi;
typedef vector<pi> vpi;
typedef long double ld;
#define pb emplace_back
#define mp make_pair
#define f first
#define s second
#define lb lower_bound
#define ub upper_bound
#define ALL(x) x.begin(), x.end... | ALGO | 0.999946 | 3.522388 |
9c35771b-8ca5-4464-b456-8768453c3f69 | IvanAndonovMicev/Cpp-Exercises | Cpp-OOP/04.RuleOf_3_5_0Exercise/01.MinBy/MinBy.cpp | #include <iostream>
#include <string>
#include <sstream>
#include <vector>
#include "MinBy.h"
std::vector<std::string> readWhitespaceSeparatedValuesLine() {
std::vector<std::string> values;
std::string line;
std::getline(std::cin, line);
std::istringstream lineIn(line);
std::string value;
while (lineIn >> va... | ALGO | 0.99888 | 5.03511 |
b41fd670-606f-4fd3-9091-59d6356ac29c | pawangoyal02/SdeSheetChallenge | BinarySearchTree2/FindPairWithGivenSumInBST.cpp | #include<bits/stdc++.h>
class BSTiterator
{
stack<BinaryTreeNode<int>*> myStack;
bool reverse= true;
void pushAll(BinaryTreeNode<int>* node) {
for(; node!=NULL;) {
myStack.push(node);
if(reverse == true) {
node= node->right;
}
else... | ALGO | 0.999999 | 4.907678 |
7af64030-e724-49d8-a2d5-ce70c8d11e00 | anishaLATHWAL/GeeksForGeeks_DSA-self-Paced | Problem- Arrays/MaximumOccuredInteger.cpp | // This commit includes only the maxOccured function.
// The rest of the implementation and context are present in the
// GeeksforGeeks (GFG) code editor.
int maxOccured(int n, int l[], int r[], int maxx) {
// Your code here
int freq[100000] = {0};
for(int i=0;i<n;i++){
freq[l[i]... | ALGO | 0.999675 | 5.738785 |
acc66288-4351-4a76-a978-e46e9f7d89f3 | roy7077/POTD-gfg | Validate an IP Address.cpp | /* The function returns 1 if
IP string is valid else return 0
You are required to complete this method */
class Solution {
public:
int isValid(string s) {
int cnt=0;
int num=0;
int zero=0;
int number=0;
for(auto it:s)
... | ALGO | 0.988458 | 4.433758 |
483530fe-d4fb-46a1-8417-3440be34596c | chirantan-basu01/LeetCode-I | merge-intervals/merge-intervals.cpp | class Solution {
public:
vector<vector<int>> merge(vector<vector<int>>& intervals) {
if(intervals.size()<=1)
return intervals;
sort(intervals.begin(),intervals.end());
vector<vector<int>> output;
output.push_back(intervals[0]);
for(int i=1;i<i... | ALGO | 0.999999 | 6.070611 |
bcb0e6ea-c856-4642-b5df-04c5c7881df6 | HanpyBin/CP-Note | leetcode/搜索/面试题 04.01. 节点间通路/bfs.cpp | class Solution
{
public:
vector<int> u, v;
bool findWhetherExistsPath(int n, vector<vector<int>>& graph, int start, int target)
{
int m = graph.size();
vector<vector<int>> routes(n);
for (int i = 0; i < m; i++)
{
int a = graph[i][0];
routes[a].push_bac... | ALGO | 0.999965 | 5.839227 |
ccfc7272-e08e-49d4-b13c-5bce7c4c4cca | MTDEV-CM7/frameworks | base/media/libstagefright/codecs/amrnb/enc/src/lag_wind.cpp | /*
------------------------------------------------------------------------------
Pathname: ./audio/gsm-amr/c/src/lag_wind.c
Date: 01/31/2002
------------------------------------------------------------------------------
REVISION HISTORY
Description:
1. Eliminated unused include files.
... | ALGO | 0.99866 | 6.688238 |
253a2ee2-086a-472e-b113-b3f766fa3b7d | doyoque/HR-Algorithm | MiniMaxSum/main.cpp | #include <bits/stdc++.h>
#include <algorithm>
using namespace std;
vector<string> split_string(string);
// Complete the miniMaxSum function below.
void miniMaxSum(vector<int> arr) {
int n = arr.size();
long long sum = 0;
int minVal = arr[0], maxVal = arr[0];
cout << minVal "\n" << maxVal << "\n";
... | ALGO | 0.999813 | 4.544809 |
b5071e30-3320-4176-ad09-bde327d52b58 | fxb0829/LanQiao | _树状数组与线段数/_1264_动态求连续区间和.cpp |
// 树状数组:
// #include <iostream>
// #include <cstdio>
// #include <cstring>
// #include <algorithm>
// using namespace std;
// const int N = 100010;
// int n,m;
// int a[N],tr[N];
// int lowbit(int x){
// return x & -x;
// }
// void add(int x,int v){
// for(int i = x; i <= N; i += lowbit(i)) tr[i] += v;
// ... | ALGO | 0.999994 | 4.633306 |
052d7377-db81-4c94-8b30-78814fd23609 | JJiang28/LeetCodeSolutions | AnnoyedCoworkers.cpp | #include <iostream>
#include <string>
#include <sstream>
#include <queue>
using namespace std;
struct CompareSum {
bool operator()(pair<long long, long long> p1, pair<long long, long long> p2) {
return (p1.first + p1.second) > (p2.first + p2.second);
}
};
int main(){
string limits = " ";
get... | ALGO | 0.999865 | 3.959067 |
7456e3fe-c788-452f-ad50-31d48f1a040f | GeorgeLukaanya/GeorgeCode | c++/practice/calculator.cpp | //
// Created by LTGW GEORGE on 12/2/2023.
//
/*This program calculates numbers*/
#include<iostream>
using namespace std;
int main(){
double num1, num2;
cout <<"Enter the first number: "<<endl;
cin >> num1, num2;
cout <<"Enter the second number: "<<endl;
cin >> num2;
cout<<"The sum is: "<< nu... | TOOL | 0.943033 | 3.818704 |
53aa12c4-3327-4306-912f-dc717f714d86 | guozhaosengzs/compression | uncompress.cpp | /**
Compression - uncompress
uncompress.cpp
November 22, 2019
@author Zhaosen Guo
@collaboration Darren Strash
*/
#include "TreeNode.h"
#include <fstream>
#include <iostream>
#include <string>
using namespace std;
/**
Rebuilds the Huffman tree based on input characters,
recurse till no... | ALGO | 0.990477 | 3.887282 |
660a41d0-ab88-4571-ab2c-b56a4e651677 | Herzeig/CodeCompetitions | ReplyChallenge/2020/Winners/3. *CODE - 25900994/submit-2/yosupo/assign_opt.cpp | //#pragma GCC optimize("Ofast")
//#pragma GCC target("avx")
//#undef LOCAL
#include "base.h"
#include "util/fast_io.h"
#include "util/random.h"
#include "util/stopwatch.h"
#include "bitop.h"
#include "datastructure/radixheap.h"
#define priority_queue RadixHeap
#include "graph/mincostflow.h"
Scanner sc = Scanner(stdi... | ALGO | 0.999602 | 4.428636 |
cb6f4c71-af66-41bc-9307-b6757e104b46 | SP0N9E/Study4Job | LeetCode/6.z-字形变换.cpp | /*
* @Author: SP0N9E
* @Description: Edit
* @Date: 2020-08-10 16:13:38
* @LastEditors: SP0N9E
* @LastEditTime: 2020-08-10 16:48:02
* @FilePath: \C++_Code\LeetCode\6.z-字形变换.cpp
*/
/*
* @lc app=leetcode.cn id=6 lang=cpp
*
* [6] Z 字形变换
*
* https://leetcode-cn.com/problems/zigzag-conversion/description/
*
* a... | ALGO | 0.999916 | 6.471929 |
5d9a0daf-e678-43c9-b2b6-c64940a4dfee | Nitika3277/cpp | 2.cpp | #include<iostream>
using namespace std;
int main(){
int n;
cin>>n;
if (n%4==0 && n%100!=0 || n%400==0){
cout << "LEAP YEAR";}
else
cout<< "NOT A LEAP YEAR";
}
| ALGO | 0.999924 | 3.698709 |
291114d9-d05a-4583-87ed-b44e01af887a | closekn/procon | AtCoder/company/M_SOLUTIONS/2019/B/B.cpp | #include <bits/stdc++.h>
using namespace std;
int main() {
string s;
cin >> s;
int k = s.length(), ch = 0;
for ( int i = 0; i < k; i++ ) {
if ( s[i] == 'o' ) { ch++; }
}
if ( (15-k)+ch >= 8 ) {
cout << "YES" << endl;
} else {
cout << "NO" << endl;
}
return 0;
} | ALGO | 0.999741 | 3.952144 |
033fde9c-c224-464c-867a-e12cbf3fce6e | moyac1012/compepetive-programing-problems | abc373/f.cpp | #include <iostream>
#include <vector>
#include <algorithm>
#include <queue>
using namespace std;
typedef long long ll;
struct Unit {
ll delta_happiness;
ll weight;
};
int main() {
int N;
ll W;
cin >> N >> W;
vector<Unit> units;
for (int i = 0; i < N; ++i) {
ll w, v;
cin ... | ALGO | 0.999953 | 4.673754 |
fdaecc62-b45d-4f18-af1c-57bcae6e09b9 | avantika0108/Cpp | OOP/Ass_9_b).cpp | //Avantika Nandre
#include <iostream>
using namespace std;
template <class T> void bubbleSort(Ta[], int n) {
for (int i = 0; i < n - 1; i++)
{for (int j = n - 1; i < j; j--)
{if (a[j] < a[j - 1])
{ swap(a[j], a[j - 1]);}}
} }
int main() {
int a[5] = {10, 50, 30, 40, 20};
int n = sizeof(a) / sizeof(a[0]);
// calls ... | ALGO | 0.999497 | 4.845918 |
3c17ec1f-fa8f-462d-b01a-769fefba16cb | anuj-das-10/CPP-STL | 02_vectors/practice-questions/solution-04.cpp | // 4. Write a function that returns the maximum and minimum elements
// of a vector without using in-built max_element() or min_element().
#include<bits/stdc++.h>
using namespace std;
void print(vector<int> list, string caption) {
cout << caption;
for(int x: list) {
cout << x << ", ";
}
co... | ALGO | 0.999896 | 5.021494 |
8d230fb6-b931-4628-a39c-b8f0821bbcee | TheStranger512/Competitive-Programming-Stuff | SPOJ/CDC12_G.cpp | /* Solved
* 12562. Glory War
* File: CDC12_G.cpp
* Author: Andy Y.F. Huang
* Created on December 8, 2012, 10:38 AM
*/
#include <cstdio>
#include <iostream>
#include <cmath>
#include <algorithm>
#include <stack>
#include <vector>
#include <queue>
#include <string>
#include <cstring>
#include <set>
#include <map>... | ALGO | 0.999887 | 3.834795 |
48ce7c03-1096-4474-a28c-0e8490ab3d19 | ananyachawla1/DSA | Binary search/1D Arrays/BinarySearch.cpp | #include<iostream>
#include<vector>
using namespace std;
class Solution {
public:
int search(vector<int>& nums, int target) {
int n=nums.size();
int low=0;
int ans=-1;
int high=n-1;
while(low<=high)
{
int mid=floor(high+low)/2;
if(target==nu... | ALGO | 0.99983 | 5.773625 |
8d5ece6c-ff7e-4b6a-8b13-b58a52e0be08 | manikanta2901/ubuntu | .history/practice/cpp/Hackerrank/Cpp/BoxIt_20210526224041.cpp | #include<bits/stdc++.h>
using namespace std;
//Implement the class Box
//l,b,h are integers representing the dimensions of the box
// The class should have the following functions :
// Constructors:
// Box();
// Box(int,int,int);
// Box(Box);
// int getLength(); // Return box's l
// int getBreadth (); // Return... | ALGO | 0.989985 | 3.537471 |
1d221d9f-d50a-4872-8c7c-9487f68bd427 | MaSteve/UVA-problems | UVA10235.cpp | #include <iostream>
#include <bitset>
#include <unordered_set>
using namespace std;
typedef long long ll;
typedef unordered_set<int> usi;
ll sieve_size;
bitset<10000000> bs;
usi primes;
void sieve(ll upperbound) {
sieve_size=upperbound+1; bs.set(); bs[0]=bs[1]=0;
for (ll i=2; i<=sieve_size; i++) if(bs[i]) {
for ... | ALGO | 0.999915 | 4.489377 |
7f66410f-0875-44b0-9445-2e9fff45cebb | radrbiz/radard | src/ripple/app/paths/cursor/ForwardLiquidity.cpp | //------------------------------------------------------------------------------
//==============================================================================
#include <BeastConfig.h>
#include <ripple/app/paths/cursor/PathCursor.h>
#include <ripple/basics/Log.h>
#include <tuple>
namespace ripple {
namespace path ... | ALGO | 0.963182 | 7.209158 |
68fe06c9-2ec6-4508-b8df-e317318b3ef8 | GokulVSD/ScratchPad | LeetCode/402 - Remove K Digits.cpp | // https://leetcode.com/problems/remove-k-digits/
// I enjoyed figuring this one out. The trick is to scan from the left as long as the digits keep getting bigger, and delete the digit when it doesn't. Repeat k times.
// Ain't very fast because string erase function is slow, but the complexity is O(k*num.length())
cl... | ALGO | 0.99997 | 6.911355 |
f5298a8d-c1fb-42fb-91cb-84d880fcfffb | GyuJin-Cho/Algorithm | 백준/부등호.cpp | #include<iostream>
#include<vector>
#include<map>
#include<algorithm>
#include<cmath>
#include<string>
#include<queue>
#include<stack>
#include<set>
#include<unordered_map>
#include<unordered_set>
#include<memory>
using namespace std;
int n;
char a[20];
vector<string> answer;
bool check[10];
bool ok(string num)
{
fo... | ALGO | 0.999979 | 3.627763 |
84e6931b-b7bf-4cbe-a354-fa428de9da85 | BinomialSheep/Competitive | AtcoderContest/AHC045/07.cpp | #include <bits/stdc++.h>
using namespace std;
using ll = long long;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define all(x) (x).begin(), (x).end()
// デバッグ用マクロ:https://naskya.net/post/0002/
#ifdef LOCAL
#include <debug_print.hpp>
#define debug(...) debug_print::multi_print(#__VA_ARGS__, __VA_ARGS__)
#else
#... | ALGO | 0.999897 | 4.24596 |
42d8707d-3110-4296-baab-c3db8db679ee | GlodonOpenSrc/Qt5.9.5_Glodon | qtbase/src/corelib/tools/qdatetimeparser.cpp | #include "qplatformdefs.h"
#include "private/qdatetimeparser_p.h"
#include "qdatastream.h"
#include "qset.h"
#include "qlocale.h"
#include "qdatetime.h"
#include "qregexp.h"
#include "qdebug.h"
//#define QDATETIMEPARSER_DEBUG
#if defined (QDATETIMEPARSER_DEBUG) && !defined(QT_NO_DEBUG_STREAM)
# define QDTPDEBUG qDeb... | TOOL | 0.856005 | 5.39936 |
aafb762f-b739-4e72-a23d-465e09cf425e | shilpa1-naik/Hacking | leetcode/225_stackUsingQueue.cpp | class Stack {
queue<int> myqueue;
public:
// Push element x onto stack.
void push(int x) {
myqueue.push(x);
}
// Removes the element on top of the stack.
void pop() {
if (myqueue.empty()) return;
queue<int> tmpqueue;
while (myqueue.size() > 1) {
int i... | ALGO | 0.999748 | 5.491386 |
50471afa-8416-49e1-bc31-c6b60f14c57e | pavel-ryzhov/global_vars | runs/006464.cpp | #include <iostream>
#include <fstream>
#include <map>
#include <vector>
#include <string>
using namespace std;
// Пара слово-его частота
typedef pair<string, unsigned int> element;
// Нужно переопределить операции сравнения, иначе с порядком следования слов в словаре будут проблемы:
bool operator > (element a, element... | ALGO | 0.999256 | 3.807969 |
81183e80-76ac-4372-b01f-cc6b1ce480be | raincross7/code-similarity | codes/train_code/problem092/problem092_269.cpp | #include <iostream>
using namespace std;
int main(int argc, char const *argv[]) {
int A, B, C;
cin >> A >> B >> C;
if (A == B) {
cout << C << "\n";
} else if (A == C) {
cout << B << "\n";
} else {
cout << A << "\n";
}
return 0;
}
| ALGO | 0.999946 | 4.603142 |
9b6786ce-356b-433f-b55d-05a73c7252de | euchangxian/LeetCode | C++/3201-FindTheMaximumLengthOfValidSubsequenceOne/Solution.cpp | #include <algorithm>
#include <array>
#include <vector>
class Solution {
public:
int maximumLength(std::vector<int>& nums) {
// A subsequence sub of length x is valid if:
// (sub[0]+sub[1])%2 == (sub[1]+sub[2])%2 == ... == (sub[x-2]+sub[x-1])%2
// Return the length of the longest valid subsequence.
... | ALGO | 0.999937 | 5.992691 |
d7d85a3a-a909-4764-80f5-5fea73e9fbf4 | ajespoo/-Tutorial | C++/19_cppBeginners.cpp | #include <iostream>
using namespace std;
int main()
{
int x = 1; // loop start point
int number; // store the number the user enters
int total = 0; // store the sum of the numbers
while (x <= 5){
cin >> number; // ask the user for a number and store it in the number variable
total = to... | ALGO | 0.994839 | 3.238393 |
eaf1db04-94ba-44cc-888a-8911568f95f5 | liltipo/InformeAlgoCo | sortingAlgorithms/codes/mergeSort.cpp | #include <bits/stdc++.h>
#include <chrono>
using namespace std;
// Función para fusionar dos subvectores
void merge(vector<int>& arr, int left, int mid, int right) {
int n1 = mid - left + 1;
int n2 = right - mid;
vector<int> L(n1), R(n2);
for (int i = 0; i < n1; i++) L[i] = arr[left + i];
for (in... | ALGO | 0.999869 | 6.215261 |
504269ee-9c42-4a41-8665-1761c91ced8a | sukesh-13/CSA5175-Cryptography | 24.RSA system, the public key of a given user is e = 31, n = 3599. What is the private key of this user.cpp | #include <stdio.h>
// Function to calculate the greatest common divisor (GCD) using Euclidean algorithm
int gcd(int a, int b) {
if (b == 0) {
return a;
}
return gcd(b, a % b);
}
// Function to find the modular multiplicative inverse using the Extended Euclidean Algorithm
int modInverse(int e, int ... | ALGO | 0.999982 | 5.245338 |
9fb52548-8c9e-499d-b1cd-fb9a051f32f1 | xuatcc/tree | 1008tree/queue.cpp | #include <stdio.h>
#include <malloc.h>
#include "queue.h"
#define MAXSIZE 20
void init_squeue(sq_queue *q)
{
q->front = 0;
q->rear = 0;
}
int lenth_squeue(sq_queue *q)
{
int len = ((q->rear) + MAXSIZE - (q->front)) % MAXSIZE;
return len;
}
bool in_squeue(sq_queue *q, tree *val)
{
//ʱ ж϶
if ((q->rear + 1) % MAXSIZ... | ALGO | 0.998916 | 3.645654 |
db7f93ec-90f2-4932-aff4-5177789ae1f3 | KTBO11Labs/lub5n2MaxGonVar4 | lub5n2MaxGon/lub5n2MaxGon/lub5n2MaxGon.cpp | #include <iostream>
#include <string>
#include <vector>
#include <algorithm>
#include <cctype>
using namespace std;
int count_of_words(string str) {
int count = 1;
for (int i = 0; i < str.size(); i++) {
if (str[i] == ' ') { count++; }
}
return count;
}
string del_abc(string str) {
string out = "";
for (int i = ... | ALGO | 0.99986 | 4.520715 |
1635c831-086e-4355-a2ba-94854b93c888 | sjm150/ps | baekjoon/25682/solution.cpp | #include <bits/stdc++.h>
using namespace std;
int main() {
cin.tie(0); ios_base::sync_with_stdio(0);
int n, m, k; cin >> n >> m >> k;
vector<string> grid(n);
for (int i = 0; i < n; i++) cin >> grid[i];
vector<vector<int>> cnt(n + 1, vector<int>(m + 1, 0));
int ans = n * m;
for (int l = 0; ... | ALGO | 0.999934 | 4.718784 |
517f37db-85b5-4fa1-b4ab-a3ee51cb8a7a | Drage/subsidence-simulation | HighRes/Main.cpp |
#include "../Common/CellGrid3D.h"
#include "../Common/SelectionSet.h"
#include "../Common/Timer.h"
#include "../Common/Heightmap.h"
#include "../Common/Xml.h"
#include "../Common/Obj.h"
#include <iostream>
const char EARTH = 'e';
const char AIR = 'a';
const char COAL = 'c';
const char DRILL = 'd';
const char VOID =... | ALGO | 0.9994 | 6.41071 |
496eec36-7e19-4662-8b49-c0c34c98140e | ishandutta2007/codeforces | oleh1421/normal/1157/F.cpp | #pragma GCC optimize ("Ofast")
#include <bits/stdc++.h>
typedef long long ll;
using namespace std;
int a[200001];
int cnt[200001];
int main()
{
ios_base::sync_with_stdio(false);
cin.tie(0);
cout.tie(0);
int n;cin>>n;
for (int i=1;i<=n;i++){
cin>>a[i];
cnt[a[i]]++;
}
vector<in... | ALGO | 0.999997 | 3.765687 |
d87f1b0d-7339-48d4-b2ec-6cb71ce3cca6 | abdullahkhfb/BUE-Object-Oriented-Programming-Labs | Code Solutions/Lab 1/Section A/problem 1b.cpp | #include <iostream>
#include <cmath>
using namespace std;
int main()
{
double numbers[5];
double sum = 0.0;
cout << "Enter five decimal numbers: ";
for (int i = 0; i < 5; i++)
{
cin >> numbers[i];
sum += numbers[i];
}
int roundedSum = round(sum);
cout << "Rounded sum: ... | ALGO | 0.999597 | 4.100165 |
09608359-74c5-46b6-8e57-967389d729ac | sarvex/leetcode-chai | solution/2400-2499/2464.Minimum Subarrays in a Valid Split/Solution.cpp | class Solution {
public:
const int inf = 0x3f3f3f3f;
int validSubarraySplit(vector<int>& nums) {
int n = nums.size();
vector<int> f(n);
function<int(int)> dfs = [&](int i) -> int {
if (i >= n) return 0;
if (f[i]) return f[i];
int ans = inf;
... | ALGO | 0.999984 | 5.48328 |
326ae0b6-d407-4892-86f8-6d033b6209ce | leothatidiot/algorithm-exercise | offer/11/c++/main.cpp | #include "Solution.cpp"
int main() {
vector<vector<int>> ts = {
{1,3,5},
{10,1,10,10,10},
{2,2,2,0,1},
{1,3,3},
{1,1},
{3,1,3},
};
Solution s1;
for (auto t : ts) {
cout << s1.minArray(t) << '\n';
}
return 0;
} | ALGO | 0.999787 | 5.43668 |
3dbe3bc8-1025-45a9-886b-b7f18445a27b | manish-tech-git/SdeSheetChallenge | Floor in BST.cpp | /************************************************************
Following is the TreeNode class structure
template <typename T>
class TreeNode {
public:
T val;
TreeNode<T> *left;
TreeNode<T> *right;
TreeNode(T val) {
this->val = val;
left = NUL... | ALGO | 0.999996 | 5.197568 |
9e34deb2-2178-4f95-83ee-caa325e6ca31 | lemon0910/leetcode | Reverse Nodes in k-Group/Reverse Nodes in k-Group.cpp | /**
* Definition for singly-linked list.
* struct ListNode {
* int val;
* ListNode *next;
* ListNode(int x) : val(x), next(NULL) {}
* };
*/
class Solution {
public:
ListNode *reverseKGroup(ListNode *head, int k) {
ListNode temp(0);
temp.next = head;
ListNode *p = &temp;
... | ALGO | 0.999999 | 5.481169 |
007994d1-0e6e-40dc-9df2-7c233126d6bf | hyang373/c-plus-plus-projects | intro-to-c-plus-plus/lab2.cpp | /*
* Lab 2
* Author: Helen Yang
* Course: CS 215-001
* Purpose: to direct a cashier how much change to give
*/
#include <iomanip>
#include <iostream>
using namespace std;
int main()
{
// Declare a variable to store the total cost of purchase
double amount_due = 0.0;
// Declare a variable to store the amount rece... | TOOL | 0.955483 | 4.886217 |
15455fd5-b671-4a7d-8e48-37ed94f5ca49 | anilpiparaiya/DSA-IN-C-plusplus | CSES Problem Set/dp/increasingsubseq.cpp | // #include<iostream>
// #include<bits/stdc++.h>
// using namespace std;
// #define int long long int
// #define mod 1000000007
// signed main(){
// int t;
// cin>>t;
// vector<int> v(t);
// for(int i=0;i<t;i++){
// cin>>v[i];
// }
// O(n2)soln
// int ans =0;
// vector<int> dp(t... | ALGO | 0.999964 | 4.885992 |
cda29b85-3c36-4207-b5d4-8f3e06472b97 | Haipm26/learningC | code c/test thuat toan/toan tu bit.cpp | #include <stdio.h>
#include <stdlib.h>
#include <math.h>
//int main(){
// int n;
// scanf("%d", &n);
// for (int i = 8; i >= 0; i--){
// if (n & (1 << i)) printf("1");
// else printf("0");
// }
//}
int main(){
int a[4] = {1, 2, 3};
for (int i = 0; i < (1 << 3); i++){
printf("{ ");
for (int j = 0; j < 3; j++){... | ALGO | 0.998005 | 3.37606 |
2289991b-a931-4bb5-929e-43240dd2566a | VarickQ/ACM | HaveDone/大二暑假练习/多校联合比赛第九场数据+标程+解题报告/多校联合比赛第九场数据+标程+解题报告/Farmer Greedy/standard.cpp | #include <iostream>
#include <cstdio>
#include <cstring>
#include <cmath>
#include <cstdlib>
#include <algorithm>
#include <vector>
#include <map>
#include <queue>
#include <set>
#include <cassert>
using namespace std;
#define SZ(v) ((int)(v).size())
#define REP(i, n) for (int i = 0; i < (n); ++i)
#define REPF(i, a, b)... | ALGO | 0.999875 | 3.992308 |
9b9b55fa-22e0-41ed-b0ea-49b9476e6851 | chintan-27/AOA_Project | Implementation/main.cpp | #include "tasks.h"
using namespace std;
void getMN(int *m, int *n)
{
int m1, n1;
cin >> m1;
cin >> n1;
*m = m1;
*n = n1;
}
void getK(int *k)
{
int k1;
cin >> k1;
*k = k1;
}
void getC(int *c)
{
int c1;
cin >> c1;
*c = c1;
}
void getA(vector<vector<int>> &A, int m, int n)
... | ALGO | 0.977047 | 3.161317 |
a7765e75-842b-490a-ada4-3667edfcc594 | Abheast12/programming-contests | SWERC/boy.cpp | #include<iostream>
using namespace std;
int main(){
int n, t;
cin >> t;
for(int i=0; i<t; i++){
int a;
cin >> n;
int tot =0;
int prev;
for(int j=0; j<n; j++){
cin >> a;
if(j==0){
tot+=(a/120);
}
else{
... | ALGO | 0.99982 | 3.366694 |
c1a755a7-afb4-400b-b8d7-1106835170dd | jitender1222/ineuronPPT-Assignment-DSA- | Assignment-23 Heaps/Q4.cpp | #include <iostream>
#include <map>
#include <queue>
struct Node
{
int data;
int hd; // horizontal distance
Node *left;
Node *right;
};
Node *newNode(int data)
{
Node *node = new Node();
node->data = data;
node->hd = 0;
node->left = nullptr;
node->right = nullptr;
return node;
}... | ALGO | 0.999975 | 6.393808 |
fb0911f3-8769-46b8-a388-bdd08a21f050 | sarvex/leetcode-nim | solution/1200-1299/1260.Shift 2D Grid/Solution.cpp | class Solution {
public:
vector<vector<int>> shiftGrid(vector<vector<int>>& grid, int k) {
int m = grid.size(), n = grid[0].size();
vector<vector<int>> ans(m, vector<int>(n));
for (int i = 0; i < m; ++i) {
for (int j = 0; j < n; ++j) {
int t = (i * n + j + k) % (m... | ALGO | 0.999988 | 6.577381 |
c3110120-d414-4aa7-9aec-f61157f8b085 | adammaksim/CarND-Path-Planning-Project | src/Eigen-3.3/doc/examples/Tutorial_ReductionsVisitorsBroadcasting_broadcast_simple_rowwise.cpp | #include <iostream>
#include <Eigen/Dense>
using namespace std;
int main()
{
Eigen::MatrixXf mat(2,4);
Eigen::VectorXf v(4);
mat << 1, 2, 6, 9,
3, 1, 7, 2;
v << 0,1,2,3;
//add v to each row of m
mat.rowwise() += v.transpose();
std::cout << "Broadcasting result: " << std::... | ALGO | 0.993095 | 4.296038 |
f3e1a347-179f-48a7-bbd3-67a76ebc86f3 | mihkhoi/baitap | Chuong 5 mang 1 chieu/Ky thuat dem/230.cpp | #include<bits/stdc++.h>
using namespace std;
void input(int a[], int n)
{
for(int i = 0;i < n;i++)
{
cin >> a[i];
}
}
void solve(int a[], int n)
{
int d = 0;
for(int i = 0;i <= 100;i++)
{
for(int j = 0;j < n;j++)
{
if(i == a[j])
{
... | ALGO | 0.999311 | 3.553982 |
5435e665-76e6-4449-b3ba-f43d7a2a0366 | ishandutta2007/codeforces | generic_placeholder_name/normal/1492/E.cpp | #pragma GCC optimize("Ofast")
#pragma GCC optimization("unroll-loops, no-stack-protector")
#pragma GCC target("avx,avx2,fma")
#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/trie_policy.hpp>
#include <ext/rope>
using namespace std;
using namespace __gnu_pbds;
using namespace __gn... | ALGO | 0.999998 | 3.78389 |
7b9b515e-fd74-49a6-8519-05c1a0294866 | MishkatIT/codeforces-atcoder-submissions | codeforces/977/977F Consecutive Subsequence.cpp | /*
Author : MishkatIT
Created : Saturday 08-06-2024 01:34:58
*/
#include <bits/stdc++.h>
using namespace std;
#ifdef LOCAL
#include "algo/debug.h"
#else
#define debug(...) 42
#endif
using ll = long long;
using ld = long double;
const ll mod = 1e9 + 7;
const ll N = 2e5 + 10;
const ll inf = 1e9;
const ll ... | ALGO | 0.999985 | 5.027765 |
de67983a-2083-4bc7-8947-7843f4179ae3 | tic40/atcoder | algo-method/457/main.cpp | #include <bits/stdc++.h>
using namespace std;
#define REP(i,n) for(int i=0;i<(int)(n);i++)
#define ALL(x) x.begin(), x.end()
using ll = long long;
const int INF = 1e9;
const ll LINF = 1e18;
const int MOD = 1e9+7;
vector<pair<ll, ll>> prime_factorize(ll n) {
vector<pair<ll,ll>> res;
for (ll a = 2; a * a <= n; a++) ... | ALGO | 0.999874 | 4.3499 |
9e5cbfd0-4c77-4a7a-bfe8-9f94bb04aa4d | ishandutta2007/codeforces | sonechko/normal/1006/F.cpp | #include<bits/stdc++.h>
using namespace std;
#define ll long long
#define ff first
#define ss second
#define pb push_back
#define mp make_pair
const int N = 100 + 11;
ll a[N][N];
int n,m;
ll k;
map<ll,ll> mt[N][N];
ll ans;
void rec1(int l, int r, int dist, ll mm)
{
if (l>n||r>m) return;
mm^=a[l][r];
dis... | ALGO | 0.999967 | 3.55053 |
bb676f74-c7b8-47d9-aa1b-0eae11f4e0a0 | antoniogarro/Hara | priors.cpp | #include "goban.h"
void Goban::init_priors(Prior priors[]) const
{
const double EQUIV = size;// /2;
priors[PASS].prior = 0.1*EQUIV, priors[PASS].equiv = EQUIV;
for(int i = 0; i < empty_points.length(); ++i){
int p = empty_points[i];
priors[p].prior = 0.5*EQUIV, priors[p].equiv = EQUIV;
}
... | ALGO | 0.997952 | 3.374531 |
f6a0b72e-caf2-4cf7-ba65-700e5c374d0f | Thalisson-Alves/Competitive-Programming | submissions/AtCoder/abc193/a.cpp | #include <bits/stdc++.h>
using namespace std;
#ifdef DEBUG
#include "Competitive-Programming/debug.cpp"
#else
#define dbg(...)
#endif
#define all(x) x.begin(), x.end()
using ll = long long;
const vector<pair<int, int>> dir4{{1, 0}, {-1, 0}, {0, 1}, {0, -1}};
const vector<pair<int, int>> dir8{{1, 0}, {-1, 0}, {0, 1}... | ALGO | 0.994606 | 3.741876 |
2747a3d1-7e1f-48ec-b917-13c2d18f7aa6 | Domain-Cmap/assignments-day-1-to-day-9-22bcs13469 | Day 6/Very Hard/2.cpp | #include <iostream>
#include <vector>
using namespace std;
class Solution {
public:
int maxDivisibleComponents(int n, vector<vector<int>>& edges, vector<int>& values, int k) {
vector<vector<int>> tree(n);
for (const auto& edge : edges) {
tree[edge[0]].push_back(edge[1]);
tr... | ALGO | 0.999987 | 6.663777 |
4217b8fa-aa4f-448e-bb8d-5ff552751cc7 | feifei14119/fft_test | optimize_twiddle/c2c_1d_dev.cpp | #include <cassert>
#include <complex>
#include <iostream>
#include <vector>
#include <map>
#include <time.h>
#include <math.h>
#include <sys/time.h>
#include <hip/hip_runtime_api.h>
#include "hip/hip_runtime.h"
#include "rocfft.h"
#define TEST_LENGTH (100)
const size_t batch = 100*100;
//////////////////////////////... | ALGO | 0.996815 | 5.275181 |
b44268f1-ca2b-4dfe-9e3c-419d53030e96 | asriniv2-git/interview_prep | remove_duplicates.cpp | /*
Given a sorted array nums, remove the duplicates in-place such that each element appear only once and return the new length.
Do not allocate extra space for another array, you must do this by modifying the input array in-place with O(1) extra memory.
Example 1:
Given nums = [1,1,2],
Your function should return l... | ALGO | 0.999964 | 6.653487 |
b2a24348-d435-43c3-93c3-6af980921500 | achint740/Data-Structures | LinkedList/DeleteNode.cpp | #include <bits/stdc++.h>
using namespace std;
class SinglyLinkedListNode {
public:
int data;
SinglyLinkedListNode *next;
SinglyLinkedListNode(int node_data) {
this->data = node_data;
this->next = nullptr;
}
};
class SinglyLinkedList {
public:
S... | ALGO | 0.999787 | 4.551305 |
f91bdc3f-72ac-4c3b-8615-919cd7f037b1 | BH4DKC/iMSTK | Source/DynamicalModels/ObjectModels/imstkRigidBodyModel2.cpp | #include "imstkRigidBodyModel2.h"
#include "imstkParallelFor.h"
#include "imstkProjectedGaussSeidelSolver.h"
#include "imstkRbdConstraint.h"
#include "imstkTaskGraph.h"
#include "imstkLogger.h"
namespace imstk
{
RigidBodyModel2::RigidBodyModel2() :
m_config(std::make_shared<RigidBodyModel2Config>()),
m_pgsSolv... | ALGO | 0.981144 | 7.664799 |
abcc9611-0708-4986-9450-9029f21fde7a | naitikrathore/Codeforces | A_Presents.cpp | #include<bits/stdc++.h>
using namespace std;
int main()
{
int n;
cin>>n;
int arr[1000];
int k;
for(int i=1; i<=n; i++){
cin>>k;
arr[k]=i;
}
for(int i=1; i<=n; i++){
cout<<arr[i]<<" ";
}
} | ALGO | 0.999928 | 3.587757 |
b0ce65b2-4c6f-473e-aefe-8275091314b4 | linux4life798/llvm-project-ci-test | clang-tools-extra/clangd/unittests/ClangdTests.cpp | #include "Annotations.h"
#include "ClangdServer.h"
#include "CodeComplete.h"
#include "CompileCommands.h"
#include "ConfigFragment.h"
#include "GlobalCompilationDatabase.h"
#include "Matchers.h"
#include "SyncAPI.h"
#include "TestFS.h"
#include "TestTU.h"
#include "TidyProvider.h"
#include "refactor/Tweak.h"
#include "... | TEST | 0.859457 | 5.591174 |
5ada8928-9bb3-4a9e-b023-fc7eb7e2f7c1 | rzmv/opencv_test | samples/cpp/tutorial_code/objectDetection/detect_board.cpp | #include <iostream>
#include <vector>
#include <opencv2/highgui.hpp>
#include <opencv2/objdetect/aruco_detector.hpp>
#include "aruco_samples_utility.hpp"
using namespace std;
using namespace cv;
namespace {
const char* about = "Pose estimation using a ArUco Planar Grid board";
//! [aruco_detect_board_keys]
const cha... | ALGO | 0.961293 | 6.267648 |
e3b48635-6ec4-42ac-8392-8630473e8db6 | LauZyHou/Algorithm-To-Practice | LeetCode/275.cpp | class Solution {
public:
int hIndex(vector<int>& v) {
int n = v.size();
for (int i = 0; i < n; i ++ ) {
if (v[i] >= n - i)
return n - i;
}
return 0;
}
}; | ALGO | 0.999764 | 5.898702 |
f6f03e6e-afcf-4bab-aedd-2bbeb8f76a4b | ishandutta2007/codeforces | 1.618/normal/1355/E.cpp | #include <iostream>
#include <cstdio>
#include <cstring>
#include <algorithm>
#include <cmath>
#include <utility>
#include <queue>
using namespace std;
typedef long long ll;
const int LEN = 100000;
struct fastio {
int it, len;
char s[LEN + 5];
fastio() {
it = len = 0;
}
char get() {
if(it < len) ret... | ALGO | 0.999696 | 3.032526 |
d64b92b7-0bf5-41ae-996a-620fb140d8d1 | Viq111/twilight | src/GameState.cpp | #include "GameState.h"
#include "standardFunctions.h"
#include <math.h>
#include <map>
#include <utility>
// Default board size
int GameState::n = 10;
int GameState::m = 10;
int GameState::opsFactor = 60;
int GameState::populationCountsWeight = 30;
int GameState::humanProximityWeight = 20;
int GameState::enemyProximit... | ALGO | 0.999209 | 3.01233 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.