uuid string | repo_name string | relative_path string | content string | category string | algo_rel_score float64 | quality_score float64 |
|---|---|---|---|---|---|---|
cbd5035b-841f-438b-9731-d3032f680d58 | sanma-icfpc/icfpc2021 | libs/boost_1_76_0/libs/graph/example/dfs.cpp | #include <vector>
#include <algorithm>
#include <utility>
#include <boost/graph/adjacency_list.hpp>
#include <boost/graph/depth_first_search.hpp>
#include <boost/graph/visitors.hpp>
/*
This calculates the discover finishing time.
Sample Output
Tree edge: 0 --> 2
Tree edge: 2 --> 1
Back edge: 1 --> 1
Fin... | ALGO | 0.999682 | 5.209993 |
78217270-353c-45ce-8b2d-a195cc94b7a7 | kohsheen1234/interview_imp | 238. Product of Array Except Self.cpp | //Optimize the array R
//Runtime: 40 ms, faster than 75.01% of C++ online submissions for Product of Array Except Self.
//Memory Usage: 10.4 MB, less than 100.00% of C++ online submissions for Product of Array Except Self.
//time: O(N), space O(1)
class Solution {
public:
vector<int> productExceptSelf(vector<int>& ... | ALGO | 0.999994 | 6.518419 |
140391c0-c440-45e2-bc2a-0bca5a9a6f68 | maspypy/library | test/1_mytest/count_P3P4P5.test.cpp | #define PROBLEM "https://judge.yosupo.jp/problem/aplusb"
#include "my_template.hpp"
#include "random/random_graph.hpp"
#include "graph/count/count_P3_P4_P5.hpp"
void test() {
FOR(N, 20) {
FOR(50) {
Graph<int, 0> G(N);
for (auto& [a, b]: random_graph<false>(N, true)) G.add(a, b);
G.build();
... | ALGO | 0.999466 | 4.86913 |
62d5cbb2-182e-4647-be01-8384c49b1773 | hieu-ln/IT81-14 | CodeC5/ThienPhuc_C5_Bai5.cpp | // Chuong 5 - bai 5
#include <iostream>
#include <stdio.h>
#include <fstream>
#include <sstream>
using namespace std;
#define MAX 20
struct node
{
int info;
node *link;
};
node *first[MAX];
int n;
char vertex[MAX];
node *sp;
node *front, *rear;
//STACK
void initStack()
{
sp = NULL;
}
int isEmptyS()
{
if (sp ==... | ALGO | 0.999151 | 3.706112 |
9d02c796-2cda-4ed0-b4dd-263247b1922f | Binayakz/Competitive-Programming | Random Problem/GFG/FindNumber.cpp | #include <bits/stdc++.h>
using namespace std;
int calculation(vector<long long int> &arr, long long int n)
{
long long int q = n / 5;
long long int r = n % 5;
if (r == 0)
{
r = 5;
q = q - 1;
}
arr.push_back((r * 2 - 1));
if (q == 0)
{
return 0;
}
else ... | ALGO | 0.999943 | 5.122108 |
2f1f1e54-892d-4138-9d9e-53f4b3be8b60 | azrsh/atcoder | abc170/d/main.cpp | #include <stdio.h>
#include <stdlib.h>
#include <string>
#include <iostream>
#include <utility>
#include <vector>
#include <list>
#include <algorithm>
#include <unordered_map>
using namespace std;
using ll = long long;
const int mod = 1e9 + 7;
int main()
{
ll N;
scanf("%lld", &N);
string s;
cin >> s;
... | ALGO | 0.999745 | 3.13419 |
fbf61968-36d8-4e63-a60e-1e066e2db0cf | Qazwar/DnfTest | DnfTest/Common/SyntaxEdit/XTPSyntaxEditSectionManager.cpp | // XTPSyntaxEditSectionManager.cpp: implementation of the CXTPSyntaxEditSectionManager class.
//
// This file is a part of the XTREME TOOLKIT PRO MFC class library.
// (c)1998-2011 Codejock Software, All Rights Reserved.
//
// THIS SOURCE FILE IS THE PROPERTY OF CODEJOCK SOFTWARE AND IS NOT TO BE
// RE-DISTRIBUTED BY A... | TOOL | 0.911087 | 4.313778 |
583a1440-92ab-46a5-8b5d-f08246c5a8cd | ashokabairwaideology/Leet-code-problem | solution/0100-0199/0116.Populating Next Right Pointers in Each Node/Solution2.cpp | /*
// Definition for a Node.
class Node {
public:
int val;
Node* left;
Node* right;
Node* next;
Node() : val(0), left(NULL), right(NULL), next(NULL) {}
Node(int _val) : val(_val), left(NULL), right(NULL), next(NULL) {}
Node(int _val, Node* _left, Node* _right, Node* _next)
: val(_... | ALGO | 0.999965 | 6.07452 |
6901138c-7fd7-46ec-ab6d-5e8e5a5e14ee | hellopatrick/aoc.cpp | exe/2024-06/main.cpp | #include "lib.h"
#include <algorithm>
#include <chrono>
#include <complex>
#include <print>
#include <unordered_map>
#include <unordered_set>
template <typename T>
using coord_map = std::unordered_map<aoc::Coord, T, aoc::CoordHasher>;
std::pair<coord_map<char>, aoc::Coord> parse_stdin() {
coord_map<char> map;
... | ALGO | 0.999168 | 6.209501 |
219e36ed-404d-4fc1-b102-05f787f3f027 | avplayer/proxy | third_party/boost/libs/compute/perf/perf_stl_search.cpp | #include <algorithm>
#include <iostream>
#include <numeric>
#include <vector>
#include "perf.hpp"
int rand_int()
{
return static_cast<int>((rand() / double(RAND_MAX)) * 25.0);
}
int main(int argc, char *argv[])
{
perf_parse_args(argc, argv);
std::cout << "size: " << PERF_N << std::endl;
// create ve... | ALGO | 0.984534 | 5.696832 |
6e681d4f-ab46-4969-9f55-01408c1a55db | spin-spin-ryo/contest-practice | solved/ABC262/D.cpp | #include<iostream>
#include<vector>
using namespace std;
using ll = long long;
#define mod 998244353
int main(){
int N;cin >> N;
vector<int> a(N);
for (int i=0;i<N;i++) cin >> a[i];
ll ans = 0;
for (int n=1;n<N+1;n++){
vector<vector<vector<ll> > > dp(N+1,vector<vector<ll> >(n,vector<ll>(n... | ALGO | 0.99995 | 4.735053 |
b30f84e9-d9cb-4a15-bb6b-766515e1772b | raincross7/code-similarity | codes/train_code/problem027/problem027_454.cpp | #include <stdio.h>
int main(){
int m,f,r;
int i,j,k;
scanf("%d %d %d",&m,&f,&r);
while(m+1||f+1||r+1){
if(m<0||f<0||m+f<30){
printf("F\n");
}else if(m+f<50){
(r<50)? printf("D\n") : printf("C\n");
}else if(m+f<65){
printf("C\n");
}else... | ALGO | 0.999521 | 3.46162 |
1b9c70c5-69ea-4fbb-9919-107d6153d9c7 | G0T-cha/G0T-cha.github.io | thirdparty/linux/miracl/miracl_osmt/source/ebrick2.cpp | /*
* Test program to implement Comb method for fast
* computation of x.G, on the elliptic curve E(F_2^m) for fixed G and E,
* using precomputation.
* This idea can be used to substantially speed up certain phases
* of the Elliptic Curve Digital Signature Standard (DSS).
*
* See "Handbook of Applie... | ALGO | 0.999744 | 5.454657 |
7d6363f0-3ab2-4ec2-af4c-7b2bdcd539a8 | Innoox/DIPLearning | libs/opencv/sources/samples/cpp/stereo_calib.cpp | #include "opencv2/calib3d.hpp"
#include "opencv2/imgcodecs.hpp"
#include "opencv2/highgui.hpp"
#include "opencv2/imgproc.hpp"
#include <vector>
#include <string>
#include <algorithm>
#include <iostream>
#include <iterator>
#include <stdio.h>
#include <stdlib.h>
#include <ctype.h>
using namespace cv;
using namespace s... | TOOL | 0.974372 | 6.24072 |
e4d27aea-7d98-41f8-b673-7a2b2831a224 | wells-wei-wei/smplify-x_in_docker | opencv-4.2.0/modules/core/src/opencl/runtime/opencl_clamdfft.cpp | #include "../../precomp.hpp"
#ifdef HAVE_CLAMDFFT
#include "opencv2/core/opencl/runtime/opencl_core.hpp"
#include "opencv2/core/opencl/runtime/opencl_clamdfft.hpp"
#if defined(_WIN32)
#include <windows.h>
static void* WinGetProcAddress(const char* name)
{
static HMODULE opencl_module = NULL;
... | ALGO | 0.88766 | 6.39067 |
67f2fdbc-fbf5-41e5-946f-105eee19471f | Xxxjudge/Leetcode | algorithm/122.cpp | class Solution {
public:
int maxProfit(vector<int>& prices) {
int dp0=0,dp1=-prices[0];
for(int i=1;i<prices.size();i++) {
int newdp0=max(dp0,dp1+prices[i]);
int newdp1=max(dp0-prices[i],dp1);
dp0=newdp0;
dp1=newdp1;
}
return dp0;
}... | ALGO | 0.999963 | 5.854619 |
05a1ff50-64f6-48e3-ae7a-495c42ca011d | joephinecalapiz/Myday_Group5_semi | 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 |
678bd7c3-0c35-43d5-b4af-1a4e3006576d | fstudio/Phoenix | test/Experimental/libcxx/test/std/utilities/template.bitset/bitset.cons/string_ctor.pass.cpp | // test bitset(string, pos, n, zero, one);
#include <bitset>
#include <cassert>
#pragma clang diagnostic ignored "-Wtautological-compare"
template <std::size_t N>
void test_string_ctor()
{
{
try
{
std::string str("xxx1010101010xxxx");
std::bitset<N> v(str, str.size()+1, 10);
asser... | TEST | 0.897386 | 7.585084 |
7483253e-955a-4530-8284-4735bc7e19c2 | muahaio123/Artificial-Intelligence---ORR | orrAgentJackiev2.cpp | // YOUR NAME: Thanh Long Le
//
// CS 4318, spring 2021
// Agent Challenge 3: Off-road rally
//
// Rename this file and the function below. For example, if your agent name
// is Jones, rename this orrAgentSmith.cpp file to orrAgentJones.cpp and the
// orrAgentSmith function below to orrAgentJones. Complete your agent
... | ALGO | 0.999886 | 5.089144 |
6633eccc-dffd-429e-8b73-2a0c922f2b36 | Elvito-hub/DSA-competitive-programming- | 1.Number Theory/Practice/Hackerearth/nearestprime.cpp | #include<bits/stdc++.h>
using namespace std;
const int MX=1e6+1;
bool isPrime[MX];
void sieve()
{
memset(isPrime,true,sizeof(isPrime));
for(int p=2;p*p<MX;p++){
if(isPrime[p]==true){
for(int i=p*p;i<MX;i+=p){
isPrime[i]=false;
}
}
}
}
int main()
{
// ios_base::sync_with_stdio(false);
sieve();
int T,n... | ALGO | 0.999642 | 4.16184 |
4771349f-0b62-4ed6-8454-dd059167def5 | Eeman1113/Leetcode | Problems/2865.cpp | class Solution {
public:
bool canAliceWin(vector<string>& a, vector<string>& b) {
// words[0][i] := the biggest word starting with ('a' + i) for Alice
// words[1][i] := the biggest word starting with ('a' + i) for Bob
vector<vector<string>> words(2, vector<string>(26));
// For each letter, only the ... | ALGO | 0.999635 | 5.905125 |
997a148f-e0b6-47b5-ab99-cbcb9d377329 | wangluodan9908/leetcode-solutions | cpp/0055-jump-game.cpp | /*
Given int array, return true if can reach last index
Ex. nums = [2,3,1,1,4] -> true, index 0 to 1 to last
Greedy: At each point, determine furthest reachable index
Time: O(n)
Space: O(1)
*/
class Solution {
public:
bool canJump(vector<int>& nums) {
int n = nums.size();
int ... | ALGO | 0.99998 | 6.601078 |
fd625985-48ce-4748-a01f-bf57c4003e90 | adi2710/LeetCode | 0201-bitwise-and-of-numbers-range/0201-bitwise-and-of-numbers-range.cpp | class Solution {
public:
int rangeBitwiseAnd(int left, int right) {
int ans = 0;
for(int i = 0; i <= 30; i++)
{
long mask = 1ll << i;
if(left & mask)
{
int rem = left - (left % mask);
int set = rem / mask;
if... | ALGO | 0.999949 | 5.701859 |
d215b530-0b81-46a8-bb73-8cbd8be96d4d | ujjwalpandeycs22/computer-programming_semester1-assigment | 20. C program to check whether a number is palindrome or not..cpp | #include <stdio.h>
int main() {
int n, reversed = 0, remainder, original;
printf("Enter an integer: ");
scanf("%d", &n);
original = n;
while (n != 0) {
remainder = n % 10;
reversed = reversed * 10 + remainder;
n /= 10;
}
if (original == reversed)
printf("%d is a... | ALGO | 0.999478 | 4.098931 |
84bf2483-4652-494a-a98a-276f4fc20c97 | SJTUqizhenlin/SjtuOnlineJudge | sjtu-oj1049.cpp | #include <iostream>
#include <stdio.h>
#include <stack>
#include <queue>
using namespace std;
int main()
{
int T, N, M, tmpint;
cin >> T;
stack<int> stk;
queue<int> q;
for (int i = 0; i < T; i++)
{
scanf("%d%d", &N, &M);
for (int j = 0; j < N; j++)
{
scanf("%d", &tmpint);
q.push(tmpint);
}
for (... | ALGO | 0.999805 | 3.835453 |
044a300f-b105-4dfb-9051-45190d0c2521 | TrijalBurman/Experiment-20 | exp20a.cpp | //Trijal Burman
//23070123145
#include <iostream>
using namespace std;
void swap(int *a, int *b)
{
int temp = *a;
*a = *b;
*b = temp;
}
void display(int ar[], int len)
{
for (int i = 0; i < len; i++)
{
cout << ar[i] << " ";
}
cout << endl;
}
void selectsort(int ar[], int len)
{
for (int j = ... | ALGO | 0.999779 | 4.668297 |
fb02ac5f-927b-4dfa-a463-12affb3ffb23 | sungwoopark95/QualExamCoding | soungmunkim/C++/String/14_LongestCommonPrefix_SM.cpp | /*
[젤 첫번째 문자를 포함해서 다 겹치는 가장 긴 char 찾기] C와 구현 같음!
!!!첫번째 문자가 무조건 같아야 함!!!
Write a function to find the longest common prefix string amongst an array of strings.
If there is no common prefix, return an empty string "".
Example 1:
Input: strs = ["flower","flow","flight"]
Output: "fl"
Example 2:
Input: strs = ["dog","ra... | ALGO | 0.998662 | 5.965693 |
d6071e14-cf71-4a98-806e-165c4226084f | vinidlm/TP-maquinadebusca | indexador.cpp | #include "indexador.h"
#include <fstream>
#include <sstream>
#include <filesystem>
#include <algorithm>
namespace fs = std::filesystem;
std::string Indexador::normalizarPalavra(const std::string& palavra) {
std::string palavra_normalizada;
for (char c : palavra) {
if (isalpha(c)) {
palavra... | TOOL | 0.934591 | 5.209441 |
6bfa4054-927b-464e-9a2d-3fe22d8206ce | ShisuiMadara/csesProblemSet | Tree Matching.cpp | #include<bits/stdc++.h>
using namespace std;
typedef long long ll;
const int MOD = 998244353;
const int MAX_N = 1e6;
vector<int>arr[MAX_N];
vector<int>visited(MAX_N, 0);
ll cnt = 0;
void dfs(int previous, int current)
{
for(auto&c:arr[current])
{
if(c != previous)
{
dfs(curren... | ALGO | 0.999779 | 5.07101 |
724d9122-e10a-4ca1-8a49-ad91685dc160 | SangJae-Nam/cp-repo | atcoder_abc377_e_brute.cpp | #include <algorithm>
#include <iostream>
#include <utility>
#include <vector>
#include <string>
#include <tuple>
#include <sstream>
#include <numeric>
#include <cassert>
#include <bitset>
#include <queue>
#include <limits>
#include <cmath>
#include <map>
#include <set>
#include <unordered_map>
#include <unordered_set>
... | ALGO | 0.999981 | 3.925795 |
f6f848f1-973e-4d1d-a6ae-a2c17732037b | shubhamsaket49/Coding-Contest | Contests/Codeforces/20Sept21/1.cpp | #include<bits/stdc++.h>
using namespace std;
int main()
{
int t;
cin>>t;
while(t--)
{
int n;
cin>>n;
string str = "()";
for(int i=0;i<n;i++)
{
for(int j=0;j<i;j++)
cout<<str;
int m = n-i ;
for(int i=0;i<m;i++)
cout<<"(";
for(int i=0;i<m;i++)
... | ALGO | 0.999558 | 4.326352 |
356c2608-8a4c-45ce-95f7-c915340f226c | miq1101/Algorithms | Insertion_Sort/insertion.cpp | #include <iostream>
using namespace std;
void insertionSort(int arr[], int n){
int key, j;
for (int i = 1; i < n; i++){
key = arr[i];
j = i - 1;
while (j >= 0 && arr[j] > key){
arr[j + 1] = arr[j];
j = j - 1;
}
arr[j + 1] = k... | ALGO | 0.999979 | 4.743643 |
451130fa-285b-40b0-a676-8e71f4088df1 | bluespeck/aoc | aoc_2020/aoc_2020_04.cpp | import std.core;
import std.regex;
struct passport_t
{
std::vector<std::string> fields;
};
using input_t = std::vector<passport_t>;
input_t
read_input()
{
input_t input;
passport_t entry;
std::regex field_rule{ "(byr|iyr|eyr|hgt|hcl|ecl|pid):\\S+" };
while (std::cin)
{
std::string li... | ALGO | 0.9114 | 6.030651 |
743259d7-1743-40d4-85a6-96640e6e0ebd | NabilaEusha/CSE_282 | Experiment 08/prac-02.cpp | /* Find the shortest distance and path from an arbitrary source to an arbitrary
destination node. */
/*Graph a: nodes 8, edges 10
0 1
0 3
1 2
3 4
3 7
7 4
7 5
5 4
5 6
4 6
Graph b: nodes 9, edges 10
0 1
0 3
0 8
1 7
2 3
2 5
3 4
4 8
5 6
7 2
*/
#include <bits/stdc++.h>
using namespace std;
vector<int> adj[100];
vector<in... | ALGO | 0.999967 | 5.167941 |
81316b18-7894-4255-a5e3-69650e24c75f | ishandutta2007/codeforces | brovko/normal/339/D.cpp | #include <bits/stdc++.h>
#define li long long
using namespace std;
const int N = (1 << 17);
int t[4 * N];
void upd(int v, int l, int r, int pos, int val, bool f)
{
if(r - l == 1)
{
t[v] = val;
return;
}
int m = (l + r) / 2;
if(pos < m)
upd(2 * v + 1, l, m, pos, val, f ^ ... | ALGO | 0.999992 | 4.934017 |
6ee212a9-04f6-4153-90f8-621beae6974b | Richard-m-j/LeetCode | 289-GameOfLife/289-GameOfLife.cpp | // Last updated: 7/24/2025, 8:32:00 AM
class Solution {
private:
vector<pair<int,int>> dirs = {{-1,-1},{-1,0},{-1,1},{0,-1},{0,1},{1,-1},{1,0},{1,1}};
public:
void gameOfLife(vector<vector<int>>& board) {
int n=board.size();
int m = board[0].size();
for(int i=0;i<n;i++){
for... | ALGO | 0.999944 | 6.611882 |
f1ce4491-90f0-4d06-9feb-8e7752e23dea | muntahaaa/Deduplicate_the_file | Hash.cpp | #include <bits/stdc++.h>
using namespace std;
typedef unsigned long long int int64;
int64 Message[80];
// Stores the hexadecimal values for
// calculating hash values
const int64 Constants[80]
= { 0x428a2f98d728ae22, 0x7137449123ef65cd,
0xb5c0fbcfec4d3b2f, 0xe9b5dba58189dbbc,
0x3956c25bf348b538,... | ALGO | 0.999874 | 4.396282 |
0f5800e6-4e4e-4690-a589-28961b5deb9b | madhvendrasingh007/LeetCode-GFG | 0203-remove-linked-list-elements/0203-remove-linked-list-elements.cpp | /**
* Definition for singly-linked list.
* struct ListNode {
* int val;
* ListNode *next;
* ListNode() : val(0), next(nullptr) {}
* ListNode(int x) : val(x), next(nullptr) {}
* ListNode(int x, ListNode *next) : val(x), next(next) {}
* };
*/
class Solution {
public:
ListNode* removeEleme... | ALGO | 0.999852 | 5.733362 |
8914bba8-21c4-4e1d-a16f-c00b51065330 | KOWSHIQKATTAMURI/LeetCode-Solutions-By-Kowshiq-Kattamuri | 1657-determine-if-two-strings-are-close/1657-determine-if-two-strings-are-close.cpp | class Solution {
public:
bool closeStrings(string word1, string word2){
if(word1.length() != word2.length()){
return false;
}
vector<int> first(26, 0), second(26, 0);
bitset<26> b1, b2;
for(int i = 0; i < word1.length(); i++){
first[word1[i] - 'a']++;
... | ALGO | 0.999985 | 5.731797 |
1457237c-7bee-4d64-a8e1-8507fe9d0889 | Starfighter555/puzzles | ProfessionalC++/view_based_loop_2.cpp | #include <iostream>
#include <ranges>
int main() {
auto even = [](int n) { return n % 2 == 0; };
for (int i : std::views::iota(1, 11) | std::views::filter(even)) {
std::cout << i << ' ';
}
// Ausgabe: 2 4 6 8 10
return 0;
}
| TOOL | 0.96788 | 5.649595 |
41c815e7-b050-4a89-b5ed-09d2a557c72c | Ameyak17901/Cpp_programs | Lab 1-2/sum.cpp | #include<iostream>
using namespace std;
int main()
{
int a,b,sum;
char ch1, ch2;
// sum of integers
cout<<"Enter 2 numbers : "<<endl;
cin>>a>>b;
sum=a+b;
cout<<"sum of two numbers="<<sum << endl;
// sum of characters
cout<<"Enter 2 characters : "<<endl;
cin>>ch1>>ch2;
sum=ch1+ch2;
cout<<"sum of two characte... | TOOL | 0.951809 | 3.505355 |
3218c91c-6755-43df-9f51-9a03cdd6fa48 | elizabeth-suehr/LIGGGHTS_CFDRC | src/atom_vec_sph.cpp | #include <cmath>
#include <stdlib.h>
#include <string.h>
#include "atom_vec_sph.h"
#include "atom.h"
#include "domain.h"
#include "modify.h"
#include "force.h"
#include "fix.h"
#include "fix_adapt.h"
#include "memory.h"
#include "error.h"
using namespace LAMMPS_NS;
#define DELTA 10000
/* ----------------------------... | TOOL | 0.988827 | 5.61778 |
558339f5-211f-4378-a84d-0a0e0c21959d | Beisenbek/MSPP1_24 | week6/test_gen.cpp | #include <iostream>
#include <algorithm>
using namespace std;
int main(){
int n;
cin >> n;
for(int i = 0; i < n; ++i){
cout << i + 1 << " ";
}
return 0;
}
| ALGO | 0.995948 | 3.761741 |
e1eb687d-6a4e-46ae-a962-78bd0ecbb21a | bsnxsourav/IP-Notes | essential cpp/priority_queuex.cpp | #include<bits/stdc++.h>
using namespace std;
typedef pair<int, int> pi;
int main() {
priority_queue<pair<int, int>> pq;//ordered by first element;
pq.push(make_pair(10, 200));
pq.push(make_pair(20, 100));
pq.push(make_pair(15, 400));
pair<int, int> top = pq.top();
cout << top.first << " " << ... | ALGO | 0.999148 | 4.230682 |
f95aa3be-b231-4e58-a1d4-0784f28d2410 | nguyenhoang4875/CompetitiveProgramming | codeforces/div3_974/D.cpp | #include <bits/stdc++.h>
#define int long long
using namespace std;
#define pb push_back
#define all(x) (x).begin(), (x).end()
#define sz(a) (int)(a).size()
#define el '\n'
#define F first
#define S second
#define For(i, a, b) for (int i = (a); i <= (int)(b); i++)
#define Rof(i, a, b) for (int i = (a); i >= (int)(b);... | ALGO | 0.99995 | 4.330058 |
26cb0dad-37e4-4375-b3a6-04d99e8775b1 | H1Y1B8S1/Cpp | Cpp/01 Functions/01_InlineFunction.cpp | /*
Benefits of Inline Functions:
Reduced Function Call Overhead: No need to push/pop arguments onto the stack or jump to a function location.
Improved Performance: For small functions, inlining can make the program faster by eliminating the overhead of function calls.
Avoids Macro Pitfalls: Inline functions are safer ... | ALGO | 0.879814 | 7.53886 |
4fb00e97-240c-4906-ad8a-e612a4591ebd | Modding-Zaibatsu/ue5-polaris | Engine/Source/ThirdParty/Intel/TBB/IntelTBB-2019u8/python/rml/ipc_utils.cpp | #include "ipc_utils.h"
#include <stdlib.h>
#include <stdio.h>
#include <limits.h>
#include <string.h>
#include <unistd.h>
namespace tbb {
namespace internal {
namespace rml {
#define MAX_STR_LEN 255
#define STARTTIME_ITEM_ID 21
static char* get_stat_item(char* line, int item_id) {
int id = 0, i = 0;
while(... | TOOL | 0.873963 | 5.583733 |
a67ebc4f-dff0-428b-bd60-61c7d6652172 | ZrjaK/algorithm | OJ/luogu/100045/C.cpp | // #pragma GCC optimize("O3,unroll-loops")
// #pragma GCC target("avx2,bmi,bmi2,lzcnt,popcnt")
#include <bits/stdc++.h>
#include <ext/rope>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/hash_policy.hpp>
#include <ext/pb_ds/tree_policy.hpp>
#include <ext/pb_ds/trie_policy.hpp>
#include <ext/pb_ds/priority... | ALGO | 0.99996 | 4.223588 |
ca343932-bc2c-4a20-97e9-d9234f8e940e | ti8anACEx/EMS_Project_CPP | college_codes/2d_arr_element_addr.cpp | // 2D ARRAY ELEMENTS ADDRESS
#include<iostream>
using namespace std;
int main(){
int arr[3][3] = {
{3,4,5},
{7,8,9},
{5,6,7},
};
cout<<"Elements are : "<<endl;
for(int i = 0; i<3; i++){
for(int j=0; j<3; j++){
cout<<arr[i][j]<<"\t";
}
cout<<endl;
}
cout<<endl;
cout<<"Addresse... | ALGO | 0.963949 | 3.4824 |
2629a4a4-005b-4912-b55a-178268547bf9 | Carlos-Segura/Ejercicios-C- | 4. Estructuras Repetitivas/Ejercicio 6 de C++.cpp | /*Escriba un programa que calcule x^y, donde tanto x como y son enteros positivos, sin utilizar la funcion pow.*/
#include<iostream>
#include<conio.h>
using namespace std;
int main(){
int x, y, M;
cout<<"Ingrese el valor de 'x': "; cin>>x;
cout<<"Ingrese el valor de 'y': "; cin>>y;
M = x * y;
cout<<"\nEl ... | ALGO | 0.997772 | 4.01511 |
61d25114-e7d1-48da-b1e6-c75fdbd372cf | shikgom2/Codeup | 1100/1163.cpp | #include<stdio.h>
int main()
{
int y, m, d;
scanf("%d %d %d", &y, &m, &d);
if( (y+m+d) / 100 % 10 % 2 == 0)
printf("대박");
else
printf("그럭저럭");
return 0;
}
| ALGO | 0.99764 | 3.294617 |
1939d43a-2b62-4dcb-8928-ab54f54b7650 | Xharlie/DISN | isosurface/tbb/tbb-2018_U6/src/old/spin_rw_mutex_v2.cpp | #include "spin_rw_mutex_v2.h"
#include "tbb/tbb_machine.h"
#include "../tbb/itt_notify.h"
#include "tbb/atomic.h"
namespace tbb {
using namespace internal;
static inline bool CAS(volatile uintptr_t &addr, uintptr_t newv, uintptr_t oldv) {
return as_atomic(addr).compare_and_swap(newv, oldv) == oldv;
}
//! Signal... | TOOL | 0.950473 | 7.313472 |
8edb37bd-8a1f-4d07-92a5-e5735d833329 | msokhi99/c_cpp_programming | cppSolns/perfect_number.cpp | #include <iostream>
using namespace std;
int main ()
{
int user_num, factors = 0;
cout << "Enter the number: ";
cin >> user_num;
for (int i = 1; i < user_num + 1; i++)
{
if (user_num % i == 0)
{
cout << "Factors: " << i << endl;
factors++;
}
}
if (factors == 2)
{
cout << user_num << " is ... | ALGO | 0.998752 | 4.046929 |
9bc0f104-dc19-44f2-9417-fd748f40b8db | barrystyle/beacon | src/hash.cpp | #include "hash.h"
#include "crypto/hmac_sha512.h"
#include "crypto/scrypt.h"
inline uint32_t ROTL32(uint32_t x, int8_t r)
{
return (x << r) | (x >> (32 - r));
}
unsigned int MurmurHash3(unsigned int nHashSeed, const std::vector<unsigned char>& vDataToHash)
{
// The following is MurmurHash3 (x86_32), see http:... | ALGO | 0.986929 | 4.930666 |
ec3d43ac-3d1b-4600-95b6-7ef60f55240c | jashvakharia/device_xiaomi_violet-xdroid | gps/utils/LocHeap.cpp | #include <LocHeap.h>
namespace loc_util {
class LocHeapNode {
friend class LocHeap;
// size of of the subtree, excluding self, 1 if no subtree
int mSize;
LocHeapNode* mLeft;
LocHeapNode* mRight;
LocRankable* mData;
public:
inline LocHeapNode(LocRankable& data) :
mSize(1), mLeft(NU... | ALGO | 0.998238 | 6.593742 |
66bcd044-ee41-43b6-ad5f-f5d1924ea65f | yoni/RideShare | rideshare/trunk/engine/libcontroller/BruteForceOptimizer.cpp | #include "BruteForceOptimizer.hpp"
#include <iostream>
namespace optimizer
{
using std::vector;
void BruteForceOptimizer::optimize() {
iterate();
}
double BruteForceOptimizer::iterate() {
//static size_t count = 0;
//cout<<"count: "<<count++<<endl;
for(Solution::RidersMap::iterator cur_rider = mySolution.myRide... | ALGO | 0.99924 | 4.452806 |
6f36c28c-4d48-4503-a669-909e47a113cf | frostAdarsh/CrackYourInternship | Minimum Moves to Equal Array Elements II.cpp | class Solution {
public:
int minMoves2(std::vector<int>& nums) {
std::sort(nums.begin(), nums.end());
int len = nums.size();
int medianEl = nums[len / 2];
int count = 0;
for (int el : nums) {
count += std::abs(el - medianEl);
}
return count... | ALGO | 0.999767 | 6.044182 |
d3269d0d-a1a9-442a-bce0-bb30fb85cacb | jhui/driving | path_planning/src/Eigen-3.3/bench/benchmark.cpp | // g++ -O3 -DNDEBUG -DMATSIZE=<x> benchmark.cpp -o benchmark && time ./benchmark
#include <iostream>
#include <Eigen/Core>
#ifndef MATSIZE
#define MATSIZE 3
#endif
using namespace std;
using namespace Eigen;
#ifndef REPEAT
#define REPEAT 40000000
#endif
#ifndef SCALAR
#define SCALAR double
#endif
int main(int ar... | ALGO | 0.983263 | 3.675187 |
26b9ecac-61fc-431c-ac28-8b15e8af7cbb | jamesfang87/USACO.cpp | 2016 - 2017/Open Contest/1. lostcow/lostcow.cpp | #include <bits/stdc++.h>
using namespace std;
int main() {
ifstream fin("lostcow.in");
ofstream fout("lostcow.out");
int x, y; fin >> x >> y;
int dir = 1;
int i = 1;
int distance = 0;
while (true) {
if ((dir == 1 && x <= y && y <= x + i) || (dir == -1 && x - i <= y && y <= x)) {
... | ALGO | 0.999971 | 3.771564 |
852fd53b-5596-4252-8dae-0e7016714114 | Misterxgames/Basisprogrammeren | Week1/Opdracht7/opdracht7.cpp | #include <stdio.h>
#include <math.h>
int main() {
double pi = acos(-1.0);
//Variabele om de leeftijd op te slaan
float diameter;
float oppervlakte;
float omtrek;
//Vragen om de leeftijd
printf("Geef de diameter van de cirkel: ");
scanf_s("%f", &diameter);
oppervlakte = pi * pow((diameter / 2), 2);
omtrek ... | ALGO | 0.987296 | 3.30791 |
13417333-825d-43fd-bf1b-7386cfc2b7bb | AliMuhammadAsad/PackageDelivery_HUMania | PackageDelivery/main.cpp | #include <iostream>
#include <stdio.h>
#include <stdlib.h>
#include "node.hpp"
#include <fstream>
#include <string>
using namespace std;
BSTNode *root = NULL; // this is the root of BST
// You have to define the functions below
void loadTrucks();
void makeJourney();
void unloadTrucks();
void loadTrucks()
{
// r... | TOOL | 0.863607 | 3.886283 |
e5d12100-3beb-41c0-9044-d41c186f9a2a | Tastypotato245/boj | 1/17103/main.cpp | // https://www.acmicpc.net/problem/17103
// github/Tastypotato245/boj
#include <iostream>
#include <algorithm>
#include <vector>
using namespace std;
int T, N;
bool era[1000001];
vector<int> v;
void Solve()
{
//에라토스
era[0] = true;
era[1] = true;
for (int i = 2 ; i * i <= 1000000 ; ++i)
for (int j = i * i ; j... | ALGO | 0.999571 | 5.291615 |
cc01821e-b6be-4ca7-8280-e48eefc9827b | angel-utn/laboratorio1-20232c | Clase 04/Viernes Virtual/cantidad de pares.cpp | #include <iostream>
using namespace std;
/**
hacer un programa que pida 10 numeros enteros
y muestre la cantidad de numeros pares ingresados
*/
int main() {
int numero, cantidadPares;
/// inicializamos contadores y acumuladores
cantidadPares = 0;
for(int i=1; i<=10; i++){ /// lo utilizamos para ... | ALGO | 0.978014 | 3.938633 |
d42d53f6-c3fb-4c31-9a2e-297b84892e61 | AustenHsiao/CS199 | Su_2019_Term_1/CS199_Cpp/Exam/1_exam_practice.cpp | #include <iostream>
#include <cctype>
#include <cstring>
using namespace std;
const int SIZE = 100;
void capitalize_first(char a[])
{
int n = strlen(a);
for(int i = 0 ; i < n; ++i)
{
if(isalpha(a[i]) != 0)
{
a[i] = tolower(a[i]);
}
}
for(int i = 0 ; i < n; ++i)
{
if(a[i] == ' ')
{
a[i+1] = toup... | TOOL | 0.977574 | 4.92996 |
890a091a-e71b-4ee8-8662-0c250fa4b142 | ikorotkin/gromacs_fhmd | src/gromacs/linearalgebra/gmx_lapack/slaswp.cpp | #include "../gmx_lapack.h"
/* LAPACK */
void
F77_FUNC(slaswp,SLASWP)(int *n,
float *a,
int *lda,
int *k1,
int *k2,
int *ipiv,
int *incx)
{
int ix0,i1,i2,inc,n32;
int ix,i,j,ip,k;
float temp;
if(*incx>0) {
ix0 = *k1 - 1;
i1 = *k1 - 1;
i2 = *k2;
inc = 1;
} else if(*incx<0) {
ix0 = *i... | ALGO | 0.999355 | 3.027687 |
3772257e-5996-438c-b2de-d7c28264b6df | Phatteronyyz/FRA142 | LAB1_basic/inLab_1_1.cpp | #include <bits/stdc++.h>
using namespace std;
int main(){
int i;
float a,ans=0;
cin >> a;
ans += a;
for(i=2;i<=30;i++){
if(i==15){
continue;
}
else{
switch (i%2){
case 0:
a = a*1.2;
ans += a;
... | ALGO | 0.999782 | 3.534956 |
76f6f68f-5ef7-45c7-8ee8-e0b00f2b6bfc | fire-archive/godot-fire | thirdparty/bullet/BulletSoftBody/btSoftRigidCollisionAlgorithm.cpp | #include "btSoftRigidCollisionAlgorithm.h"
#include "BulletCollision/CollisionDispatch/btCollisionDispatcher.h"
#include "BulletCollision/CollisionShapes/btSphereShape.h"
#include "BulletCollision/CollisionShapes/btBoxShape.h"
#include "BulletCollision/CollisionDispatch/btCollisionObject.h"
#include "btSoftBody.h"
#inc... | ALGO | 0.99592 | 4.315296 |
f9524d4a-5c33-43fe-af99-957c47817cf3 | dsvilarkovic/dynamic_plane_convolutional_onet | src/utils/pypoisson/src/PoissonRecon_v6_13/src/Factor.cpp | //////////////////////
// Polynomial Roots //
//////////////////////
#include <math.h>
#include "Factor.h"
int Factor(double a1,double a0,double roots[1][2],double EPS){
if(fabs(a1)<=EPS){return 0;}
roots[0][0]=-a0/a1;
roots[0][1]=0;
return 1;
}
int Factor(double a2,double a1,double a0,double roots[2][2],double EPS... | ALGO | 0.999829 | 3.301164 |
de3ac456-4b72-4507-aa88-a56349f40d96 | varunragu23/codeforces | contest/231/d/61299477.cpp | #include <iostream>
using namespace std;
int main() {
// freopen("a.in","r",stdin); freopen("a.out","w",stdout);
int x, y, z;
cin >> x >> y >> z;
int dx, dy, dz;
cin >> dx >> dy >> dz;
int a1, a2, a3, a4, a5, a6;
cin >> a1 >> a2 >> a3 >> a4 >> a5 >> a6;
int res = 0;
if (y < 0) {
... | ALGO | 0.990554 | 3.439908 |
f22edea5-c1d5-47f1-a55a-e09a1fc53c44 | shreyansh-1711/placements | dsa/16_recursion/Partition to K Equal Sum Subsets.cpp | // class Solution {
// public:
// bool solve(vector<int> nums,vector<bool>& visited,int currsum,int idx,int subsetsum,int k){
// if(k==0)return true;
// if(currsum>subsetsum)return false;
// if(currsum==subsetsum){
// return solve(nums,visited,0,0,subsetsum,k-1);
// }
// ... | ALGO | 0.999909 | 5.638648 |
fc375748-cb5e-4c89-a5cb-2a91c0a9a64c | Stozux/coding-chalenges | maratona cin/homework - sem 2/L.cpp | #include <bits/stdc++.h>
using namespace std;
#define fIo ios::sync_with_stdio(false); cin.tie(NULL);
int main()
{
fIo;
int n,x,a;
cin >> n >> x;
vector<int> arr(n);
map<int,int> tab;
for(int i = 0; i < n; i++)
{
cin >> a;
arr[i] = a;
}
bool pos = false;
for... | ALGO | 0.999965 | 4.264524 |
712bf3b8-428c-41fb-a946-7524b6fe484d | prats3992/practice-questions | C++/link_list_template.cpp | #include <iostream>
using namespace std;
template <typename T>class ChainNode
{
template <typename U>friend class Chain;
public:
ChainNode(T element, ChainNode<T> *next) // constructor
{
data = element;
link = next;
}
private:
T data;
ChainNode<T> *link;
};
template <typenam... | ALGO | 0.99871 | 4.388471 |
59a442f7-3724-4a75-82ea-74db4d94741c | Shaman786/-100DaysOfCode | Day2/elseif.cpp | // Home Work
#include <iostream>
using namespace std;
int main()
{
char ch;
ch = cin.get();
int n = ch; // converted char value to int so it returns the ASCII value
if (ch >= 'a' && ch <= 'z')
cout << "This is lower case";
else if (ch >= 'A' && ch <= 'Z')
cout << "This is upper case... | ALGO | 0.966485 | 3.547139 |
f9bd4f31-0ae3-4e59-9d78-081b210291d2 | alexandraback/datacollection | solutions_5658068650033152_0/C++/sulix/C.cpp |
#include <cstdlib>
#include <iostream>
#include <stdint.h>
#include <cmath>
#include <vector>
#include <set>
#include <algorithm>
#include <map>
#include <utility>
#include <functional>
#include <popcntintrin.h>
#include <x86intrin.h>
using namespace std;
#define forl(i,a,b) for(int i = a; i < b; ++i)
int popcnt64(... | ALGO | 0.999587 | 3.883882 |
a0dfba78-cd5e-4052-8557-3de3e165bdcf | xiaowenfan/twostepoptimize | telecalibrate.cpp | // telecalibrate.cpp : 此文件包含 "main" 函数。程序执行将在此处开始并结束。
//
#define _CRT_SECURE_NO_WARNINGS
#include <ceres/ceres.h>
#include "common.h"
#include "SnavelyReprojectionError.h"
#include "SnavelyReprojectionError2.h"
#include "glog/logging.h"
#include <iostream>
#include <opencv2/opencv.hpp>
#include <opencv2/core/eigen.hp... | ALGO | 0.996734 | 3.003706 |
f9561572-c149-44a0-8d7a-7fdc1c68bb07 | hjiang13/LLMs-in-IR | POJ-104/64/2187.cpp | #include <iostream>
using namespace std;
int main()
{
float point[10][3],distant[45],t;
int n,i,j,k=0,p,d[45][2];
cin>>n;
for(i=0; i<n; i++)
for(j=0; j<3; j++)
cin>>point[i][j]; //i???????j?????????
for(i=0; i<n; i++)
for(j=i+1; j<n; j++,k++){
//distant????????????d??????????????
distant[k]=sqrt(pow((point[i][0]-po... | ALGO | 0.999925 | 3.921482 |
afdc8163-5894-4d19-a8a4-46c210d67488 | hey-saniraj/Practiced-Programs | starPattern.cpp | #include<iostream>
using namespace std;
int main()
{
int i,j,n;
cout<<"Enter no of rows:";
cin>>n;
for(i=1;i<=n;i++)
{
for( j=n;j>=i;j--)
{
cout<<"*"<<" ";
}
cout<<endl;
}
} | ALGO | 0.999567 | 3.615535 |
e5b34b1d-a8da-4c76-9fb3-c92d33a61b06 | divyank554/MissionRnD-C-Arrays-Worksheet | src/removeArrayDuplicates.cpp | /*
OVERVIEW: given an array that has duplicate values remove all duplicate values.
E.g.: input: [1, 1, 2, 2, 3, 3], output [1, 2, 3]
INPUTS: Integer array and length of the array.
OUTPUT: Update input array by removing duplicate values.
ERROR CASES: Return NULL for invalid inputs.
NOTES: Don't create new array, tr... | ALGO | 0.987969 | 4.022315 |
b726c4a0-c9c0-4c77-8b53-d8076bdf5ffc | githjk/cornell-robocup | plays/playTransition/2002playTransitions/jamAndShootTransition.cpp | #include "JamAndShootTransition.h"
#include "common/util/math/dist.h"
#include "info/ball/ball.h"
#include "plays/2002plays/upfieldDefense.h"
#include "Skillz/JamAndShootSkill.h"
#include "GUI/GUI.h"
void JamAndShootTransition::executePlayTransition(VisionData& field, RobocupStrategyData* rsd,
... | TOOL | 0.887135 | 4.627687 |
012088f6-61e7-4349-811d-807302209df3 | Micro-Shubham/Data-structure | 07Vector/vector03.cpp | #include<iostream>
#include<vector>
using namespace std;
int main ()
{
//initialization
vector<int>v;
//inseration
v.push_back(35);
v.push_back(39);
v.push_back(31);
v.push_back(30);
v.push_back(32);
v.push_back(34);
//loop
for(auto it = v.begin(); it != v.end(); it++)
... | TOOL | 0.981128 | 3.249002 |
0fce2814-23d3-4507-8a03-53ce752d7766 | ashn-dot-dev/scratch | leetcode/problem-0001-two-sum.cpp | #include <cassert>
#include <cstdio>
#include <unordered_map>
#include <vector>
std::vector<int>
two_sum(std::vector<int>& nums, int target)
{
std::unordered_map<int, size_t> map{};
for (size_t i = 0; i < nums.size(); ++i) {
auto found = map.find(target - nums[i]);
if (found != map.end()) {
... | ALGO | 0.998753 | 6.302873 |
67abdcf3-d9c4-4197-8cdd-be5fcaf713e6 | vinodkr09/Cpp-Code | 06_Recursion/09_Reverse_String.cpp | #include<iostream>
using namespace std;
void reverse(string &str, int i, int j){ // mpercent ka dhyan dena yahan par i.e pointer
//base case
if(i > j){
return;
}
swap(str[i], str[j]);
i++;
j--;
//Recursive call
reverse(str, i, j);
}
int main(){
string name = "saket";
... | ALGO | 0.999792 | 4.269346 |
42d6df80-3dde-4b1d-85cb-59499916d09f | puja2196/LLVM-tutorial | libc/src/math/amdgpu/frexpf.cpp | #include "src/math/frexpf.h"
#include "src/__support/common.h"
#include "declarations.h"
#include "src/__support/macros/config.h"
namespace LIBC_NAMESPACE_DECL {
LLVM_LIBC_FUNCTION(float, frexpf, (float x, int *p)) {
return __builtin_frexpf(x, p);
}
} // namespace LIBC_NAMESPACE_DECL
| ALGO | 0.912096 | 5.125079 |
07f1a9fe-fd3d-4bf8-bab3-9f6caea6f23d | VerzatileDev/University.SubSystemEngine | SubSystemEngine/include/Box2D/Dynamics/Contacts/b2EdgeAndPolygonContact.cpp | #include <Box2D/Dynamics/Contacts/b2EdgeAndPolygonContact.h>
#include <Box2D/Common/b2BlockAllocator.h>
#include <Box2D/Dynamics/b2Fixture.h>
#include <new>
b2Contact* b2EdgeAndPolygonContact::Create(b2Fixture* fixtureA, int32, b2Fixture* fixtureB, int32, b2BlockAllocator* allocator)
{
void* mem = allocator->Allocat... | ALGO | 0.969476 | 6.936368 |
00911057-8f4d-4193-b100-27471776d619 | imkhushboo/QOTD | 02-08-2024.cpp | class Solution {
public:
int minSwaps(vector<int>& nums) {
int cnt=0;
int n=nums.size();
for(int i=0;i<n;i++)
{
if(nums[i]) cnt++;
}
int i=0,j=0,zero=0;
int ans=2*n;
while(j<2*n)
{
if(nums[j%n]==0)
{
... | ALGO | 0.999993 | 5.889198 |
f9bf2982-e7c4-4049-a8ca-bba604c81adf | leelabsg/SKAT | src/Binary_Permu_SKAT.cpp | #include <math.h>
#include <stdlib.h>
#include <string.h>
#include "Binary_global.h"
#include "Binary_Permu_SKAT.h"
#ifndef _STAND_ALONE_
#include <R.h>
#include <Rmath.h>
#endif
/*********************************************************************
**********************************************************... | ALGO | 0.999542 | 3.748131 |
29d53500-23a1-4886-9ac5-e579157d25b4 | rystills/RaiderEngine | RaiderEngine/libs/PhysX-4.1/physx/source/geomutils/src/hf/GuSweepsHF.cpp | #include "GuSweepTests.h"
#include "GuHeightFieldUtil.h"
#include "GuEntityReport.h"
#include "GuVecCapsule.h"
#include "GuSweepMTD.h"
#include "GuSweepTriangleUtils.h"
#include "GuVecBox.h"
#include "CmScaling.h"
#include "GuSweepCapsuleTriangle.h"
#include "GuInternal.h"
#include "GuGJKRaycast.h"
using namespace phy... | ALGO | 0.992103 | 7.598485 |
44bba7d2-a397-4023-b046-0589bdb4443d | NanayaHaruki/leetcode | 序号/136.只出现一次的数字.cpp | class Solution {
public:
int singleNumber(vector<int>& nums) {
int i = 0;
for(int j:nums){
i^=j;
}
return i;
}
}; | ALGO | 0.999967 | 5.554007 |
294b3d3f-56bf-44d9-8549-fefdda9a5a77 | GalGR/PMM | libigl/include/igl/grad.cpp | #include "PI.h"
#include "per_face_normals.h"
#include "volume.h"
#include "doublearea.h"
namespace igl {
namespace {
template <typename DerivedV, typename DerivedF>
IGL_INLINE void grad_tet(
const Eigen::MatrixBase<DerivedV>&V,
const Eigen::MatrixBase<DerivedF>&T,
Eigen::SparseMatrix<typename DerivedV::Scalar... | ALGO | 0.997553 | 6.294159 |
8bf49526-7acf-47df-89af-10f8e9821ee7 | avinashw50w/ds_algo | interview-questions-master/sorting_searching/anagrams_together/solution.cpp | /* Write a method to sort an array of strings so that all the anagrams are next to
* each other.
*
* Source: Cracking the Coding Interview, page 121, question 11.2
*/
#include <iostream>
#include <algorithm>
#include <map>
#include <vector>
using namespace std;
void sort_by_anagrams(vector<string> &strings) {
map... | ALGO | 0.999987 | 6.423296 |
759a6263-e383-4e43-9d8c-c1f1eecbc2e8 | roeas/GAMES101-Premake | Frame/Source/ThirdParty/opencv/samples/cpp/tutorial_code/features2D/Homography/pose_from_homography.cpp | #include <iostream>
#include <opencv2/core.hpp>
#include <opencv2/imgproc.hpp>
#include <opencv2/calib3d.hpp>
#include <opencv2/highgui.hpp>
using namespace std;
using namespace cv;
namespace
{
enum Pattern { CHESSBOARD, CIRCLES_GRID, ASYMMETRIC_CIRCLES_GRID };
void calcChessboardCorners(Size boardSize, float square... | ALGO | 0.999149 | 6.05288 |
7e3ee067-3541-4237-bc0f-e6f004d77ad7 | CrisGold22/Algorithm | Arboles/Teoria/iterationPrint.cpp | #include <iostream>
#include <stack>
#include <algorithm>
using namespace std;
struct Nodo
{
int dato;
Nodo *left;
Nodo *right;
};
struct Arbol
{
Nodo *root;
};
void construirArbol(Arbol &arbol){
arbol.root = nullptr;
}
Nodo *createNodo(int elemento, Nodo *left, Nodo *right){
Nodo *newNodo =... | ALGO | 0.999926 | 4.910612 |
d4f50e05-5dae-47d1-a763-926aab1587d3 | akktrsst/DSA | Time&SpaceComplexityAnalysis/RotateArray.cpp | // You have been given a random integer array/list(ARR) of size N. Write a function that rotates the given array/list by D elements(towards the left).
// Note:
// Change in the input array/list itself. You don't need to return or print the elements.
// Input format :
// The first line contains an Integer 't' which den... | ALGO | 0.999638 | 6.278097 |
dfbcd485-a945-4cdb-8a42-dc94eac09403 | AayushAnand39/CSES-CODES | Concert_Tickets.cpp | #include<bits/stdc++.h>
using namespace std;
int main(){
int n,m;
cin>>n>>m;
vector<int> a(n), b(m);
for (int i=0;i<n;i++) cin>>a[i];
for (int i=0;i<m;i++) cin>>b[i];
multiset<int> s;
for (int i=0;i<n;i++) s.insert(a[i]);
for (int i=0;i<m;i++){
int temp = b[i];
auto it =... | ALGO | 0.999985 | 3.39491 |
07ed3c33-4d99-43f8-b065-6b366b5adbc3 | black-shadows/LeetCode-Topicwise-Solutions | C++/h-index.cpp | // Time: O(n)
// Space: O(n)
// Counting sort.
class Solution {
public:
int hIndex(vector<int>& citations) {
const auto n = citations.size();
vector<int> count(n + 1, 0);
for (const auto& x : citations) {
// Put all x >= n in the same bucket.
if (x >= n) {
... | ALGO | 0.999938 | 6.54279 |
cfe1d21e-7ec4-4eb7-ae68-722bc6f1a35b | ishandutta2007/codeforces | kirill22/normal/1443/A.cpp | #include<bits/stdc++.h>
using namespace std;
template <typename A, typename B>
string to_string(pair<A, B> p);
template <typename A, typename B, typename C>
string to_string(tuple<A, B, C> p);
template <typename A, typename B, typename C, typename D>
string to_string(tuple<A, B, C, D> p);
string to_string(const st... | ALGO | 0.999418 | 4.023524 |
181b1bd2-fa65-47d6-8024-fda216a5478d | highya/ztb-leetcode | Week4/Linked-List-Cycle-II/yangke.cpp | /**
* Definition for singly-linked list.
* struct ListNode {
* int val;
* ListNode *next;
* ListNode(int x) : val(x), next(NULL) {}
* };
*/
class Solution {
public:
ListNode *detectCycle(ListNode *head) {
ListNode *p;
ListNode *q;
p=q=head;
bool has_circle=false;
... | ALGO | 0.999978 | 5.435057 |
55da7ddd-b19a-47fc-be15-3dc8d5083177 | masterchef2209/coding-solutions | codes/atc/abc144E.cpp | /*Read the problem carefully before starting to work on it*/
#include <bits/stdc++.h>
//#include <boost/multiprecision/cpp_int.hpp>
//using namespace boost::multiprecision;
//#include <ext/pb_ds/assoc_container.hpp>
//#include <ext/pb_ds/tree_policy.hpp>
using namespace std;
//using namespace __gnu_pbds;
typedef lon... | ALGO | 0.99999 | 3.539502 |
671bc6b8-cbec-403a-a90a-dc2776682ba2 | yisliu/mysort.cpp | .ccls-cache/@home@runner@mysortcpp/main.cpp | #include <iostream>
using namespace std;
//insertion sort
/*
example input:
5
4 9 2 4 1
example output:
1 2 4 4 9
*/
/*
how insertion sort works:
it basically keeps a value and than compares it with the ones next to it until its sorted.
example: 6 7 5
it would take the 5 all the way down
example sorted: 5 6 7
*/
/*... | ALGO | 0.999914 | 4.146935 |
55f5f3c9-6b3c-47a4-85f9-4aa31b1f697b | arsami12/TugasLatihan | Latihan1.cpp | #include <iostream>
using namespace std;
int main () {
int X, Y, Z;
cout << "Masukkan Nilai X : "; cin >> X ;
cout << "Masukkan Nilai Y : "; cin >> Y ;
if (X>Y){
Z = X-Y;
cout << "Selisih X dan Y yaitu "<< Z ;
}
else if (Y>X){
Z = Y-X;
cout << "Selisih Y dan X yaitu "<< Z ;
}
}
| ALGO | 0.999188 | 3.311787 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.