uuid string | repo_name string | relative_path string | content string | category string | algo_rel_score float64 | quality_score float64 |
|---|---|---|---|---|---|---|
a201238c-7b94-47f6-89e6-1ea3f9bb0548 | mie998/purokon | library/CPP/tree/binary_search_tree.cpp | struct node {
int val;
vode *lch, *rch;
};
node *insert(node *p, int x) {
if (p==NULL) {
node *q = new node;
q->val = x;
q->lch = q-> rch = NULL:
return q;
}
else {
if (x < p->val) p->lch = insert(p->lch,x);
else p-> rch = insert(p->rch, x);
return p;
}
}
bool find(node *p, int x) {
if (p == NULL... | ALGO | 0.99996 | 4.098825 |
42e56382-47b2-407c-bf73-e3b1c94c06e9 | emn2/Competitive-Programming-Algorithms | Problems/Codeforces/Codedigger Training Contest -Number Theory/E.cpp | #include "bits/stdc++.h"
using namespace std;
bool isPrime(int n){
for(int i = 2; i*i <= n; i++){
if(n % i == 0){
return false;
}
}
return true;
}
int main(){
ios::sync_with_stdio(0);
cin.tie(0);
int t;
cin >> t;
while(t--){
int x, a, b, c;
v... | ALGO | 0.999602 | 3.782088 |
a1b3ea63-170e-4fd2-9b77-51df63f36737 | sakarns/kct-c | lab exercise 2/07.cpp | #include<stdio.h>
int main()
{
int cp,sp,p,l;
printf("Enter the cost price: ");
scanf("%d",&cp);
printf("Enter the selling price: ");
scanf("%d",&sp);
if(sp>cp)
{
printf("This is profit of Rs%d",sp-cp);
}
else
{
printf("This is loss of Rs%d",cp-sp);
}
return 0;
} | ALGO | 0.99548 | 3.375862 |
a1050689-c9ef-4a87-8e16-c9bbdde8cf24 | strange-suraj/LeetCode-Susbmission | 890-find-and-replace-pattern/890-find-and-replace-pattern.cpp | class Solution {
public:
bool isSamePattern(string str1, string str2){
int n = str1.length();
unordered_map< char,char > um;
vector<bool> visited (26,false);
for(int i = 0; i < n; i++){
char c1 = str1[i],c2 = str2[i];
if( um[c1] && um[... | ALGO | 0.999963 | 6.267689 |
962c4856-2683-49be-a0af-8fe43ee14d4f | Yadhu-S/BulletPhysicsPlugin | Source/ThirdParty/BulletPhysicsEngineLibrary/bullet3/examples/ThirdPartyLibs/Wavefront/tiny_obj_loader.cpp | // Erwin Coumans: improved performance, especially in debug mode on Visual Studio (25sec -> 4sec)
//
// version 0.9.5: Parse multiple group name.
// Add support of specifying the base path to load material file.
// version 0.9.4: Initial suupport of group tag(g)
// version 0.9.3: Fix parsing triple 'x/y/... | TOOL | 0.921729 | 5.947458 |
8e131bc4-0a0a-4f1e-9772-0abe519a802a | wyolum/ultim8x8 | arduino/libraries/Adafruit_BluefruitLE_nRF51/examples/healththermometer/IEEE11073float.cpp | /**************************************************************************/
/*!
@file IEEE11073float.h
*/
/**************************************************************************/
#include <Arduino.h>
#include "IEEE11073float.h"
uint32_t float2IEEE11073(double data, uint8_t output[4])
{
uint32_t result ... | TOOL | 0.989727 | 5.217459 |
b1f6bd69-4597-40ca-b529-3a11a5aa0f6a | Jeon-JongChan/Programmers | sqrt.cpp | #include <string>
#include <vector>
#include <iostream>
#include <math.h>
using namespace std;
long long solution(long long n) {
long long answer = 0;
if(n > 0 && n <= 50000000000000)
{
float sqrt_f = sqrt(n);
int sqrt_i = (int)sqrt_f;
if(sqrt_f == sqrt_i)
{
s... | ALGO | 0.999905 | 4.622334 |
177420d0-dbde-4181-bb48-748013e9ca44 | meredwan/google_maps_-geolocator | 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.998733 | 6.76775 |
bd60d0d6-bfaa-4aba-88fc-90d9b147a978 | rishabh27goel/Daily-Coding-Practice | DSA_Sheet/Graph/Union_find_by_rank_and_path_compression.cpp | #include <iostream>
#include <vector>
using namespace std;
// Method : Union by Rank and Path Compression
vector<int> nodeParent;
vector<int> nodeRank;
int findParent(int node){
// Base Case
if(nodeParent[node] == node){
return node;
}
// Path Compression
nodeParent[node] = findParent(n... | ALGO | 0.999982 | 5.46348 |
555d4002-1af3-4a7a-b508-456a08750ad9 | ParthPatel2000/parallelized_large_scale_datastructures | parsing_genome/main.cpp | #include "genome_functions.h"
#include <iostream>
#include <string.h>
using namespace std;
int main(int argc, char const *argv[])
{
// checking for the valid count of arguments
if (argc == 4)
{
genomeProcessor *genomeObj = new genomeProcessor;
// calling the read function based on the flag... | DATA | 0.871312 | 4.827241 |
0cee7fe2-e45a-4f86-abe4-53341c01331c | arihantag06/Leetcode | 952-word-subsets/word-subsets.cpp | class Solution {
public:
vector<string> wordSubsets(vector<string>& words1, vector<string>& words2) {
vector<int>hash(26,0);
for (auto& s : words2) {
vector<int> temp(26, 0);
for (char c : s) {
temp[c - 'a']++;
}
for (int i = 0; i < 26... | ALGO | 0.999913 | 5.867134 |
2d1341c7-9b5c-4c2b-bbe2-7b1639003bff | alokg-812/Data-Structure-Algorithms | Leetcode/Practice_Qs/257BinaryTreePath.cpp | https://leetcode.com/problems/binary-tree-paths/submissions/1469037255/
class Solution {
public:
void helper(TreeNode* root, string s, vector<string>& ans){
if(root == NULL) return;
string a = to_string(root->val);
if(root->left == NULL and root->right == NULL){
s +=a;
... | ALGO | 0.999963 | 5.991043 |
6e3726b2-73cf-404d-a388-ffe74921d6c3 | kza59/Leet | 0021-merge-two-sorted-lists/0021-merge-two-sorted-lists.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* mergeTwoLis... | ALGO | 0.999792 | 5.629657 |
c9271679-5fb5-461f-87c4-9eed08708f2e | itlezy/eMule-mods-archive | eMule-0.50a-DreaMule_2.12_sources/MD4.cpp | //
// Free implementation of the MD4 hash algorithm
// MD4C.C - RSA Data Security, Inc., MD4 message-digest algorithm
//
#include "StdAfx.h"
#include "MD4.h"
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
///////////////////////////////////////////////////////////////... | ALGO | 0.979934 | 5.856209 |
3722036c-d398-45d0-9c7f-227af7dd6ab4 | ranjin/MyAlgorithm | MyAlgorithm/排序/快速排序.cpp | #include "快速排序.hpp"
class Sort{
public:
void Qsort(int arr[], int low, int high){
if (high <= low) {
return;
}
int i = low;
int j = high + 1;
int key = arr[low];
while (true) {
//从左往右找比key大的值
while (arr[++i] < key) {
... | ALGO | 0.999911 | 4.506038 |
12bb8abb-a523-444a-acc0-a8085f0e95fe | ishandutta2007/codeforces | swistakk/normal/455/D.cpp | #include <iostream>
#include <vector>
#include <set>
#include <map>
#include <algorithm>
#include <cmath>
#include <ctime>
#include <cstdlib>
#include <cstdio>
#include <utility>
#include <iomanip>
#include <assert.h>
#define MP make_pair
#define PB push_back
#define FOR(i, a, b) for(int i =(a); i <=(b); ++i)
#define R... | ALGO | 0.999623 | 3.657946 |
10c12d72-370a-4108-aff3-ab7d39581bc3 | Ali-Elbana/DSA-Exercises | DataStructures/Exercises/Lec16 (BinTree-1)/main.cpp | /*
============================================================
* Project: Binary Tree Implementation
* File: main.cpp
* Author: [Ali El-bana]
* Date: [2025-08-20]
* Version: v1.0
------------------------------------------------------------
* Description:
* Main application to demonstrate binary tree functionali... | ALGO | 0.999525 | 7.248977 |
322f7b84-85f7-4ec5-ae35-d7ae3f1c2c7e | RayLee234/Competitive-Programming-Stuff | Dynamic Programming/Fence Obstacle Course/main.cpp | #include <iostream>
#include <cstdio>
#include <cstring>
#include <cmath>
using namespace std;
int n, s, a[50010], b[50010], L[50010], R[50010], f[50010][2], ans = 1e9;
struct tree {
int l, r, val, mark;
}S[800010];
void build(int root, int l, int r) {
S[root].l = l, S[root].r = r, S[root].val = S[root].mark = ... | ALGO | 0.999819 | 3.287692 |
b76889ef-8c4a-4d8d-8425-bb7660117f60 | euchangxian/LeetCode | C++/0797-AllPathsFromSourceToTarget/Solution.cpp | #include <vector>
class Solution {
public:
std::vector<std::vector<int>> allPathsSourceTarget(
std::vector<std::vector<int>>& graph) {
// Find all possible paths from source to target, return in any order.
// DP on DAG.
// DFS works. BFS works.
// DFS should be simpler
const int n = graph.... | ALGO | 0.999856 | 6.784506 |
40c20d8e-b8ba-471e-9833-71b1839cb7a2 | msohcw/comp-algo-solns | codeforces/berkeley_test_contest/d.cpp | #include <stdio.h>
using namespace std;
int n;
int g[60][60];
int col = -1;
int main(){
scanf("%d", &n);
for(int i = 0; i < n; i++){
for(int j = 0; j < n; j++){
scanf("%d", &g[i][j]);
if(g[i][j] == n-1 && col == -1) col = j;
}
}
for(int i = 0; i < n; i++){
int p = g[i][col];
if(p == 0) p = n;
pr... | ALGO | 0.999735 | 3.194482 |
24b18cff-05c9-4ab9-90f7-eacd2c6be718 | speedwago/2dengineexperiment | speed_test/libs/box2d/include/Box2d/Collision/Shapes/b2ChainShape.cpp | #include <Box2D/Collision/Shapes/b2ChainShape.h>
#include <Box2D/Collision/Shapes/b2EdgeShape.h>
#include <new>
#include <memory.h>
b2ChainShape::~b2ChainShape()
{
b2Free(m_vertices);
m_vertices = NULL;
m_count = 0;
}
void b2ChainShape::CreateLoop(const b2Vec2* vertices, int32 count)
{
b2Assert(m_vertices == NULL... | ALGO | 0.985347 | 6.876169 |
0d41a0ed-88fe-440d-8dcd-ef3b047823a7 | victordamatta/NaiveBayes | llt-main.cpp | #include <iostream>
#include <fstream>
#include <string>
#include <regex>
#include <vector>
#include <map>
#include "trie.h"
#include "bayes.h"
using namespace std;
#define DEBUG 1
int training_size;
/* Transforma uma frase em um vetor de palavras */
vector<string> split (const string& s, char c = ' ') {
vector<... | ALGO | 0.992406 | 5.489067 |
1c53d748-8c08-46e5-9085-86f86ee02424 | Jackarain/tinyrpc | third_party/boost/libs/graph/example/astar_maze.cpp | // This program uses the A-star search algorithm in the Boost Graph Library to
// solve a maze. It is an example of how to apply Boost Graph Library
// algorithms to implicit graphs.
//
// This program generates a random maze and then tries to find the shortest
// path from the lower left-hand corner to the upper righ... | ALGO | 0.999887 | 7.090497 |
c4582b03-ac75-4d31-b126-d1d8093e51d1 | Priyasharma02821/Leetcode-Solutions | 2016-maximum-difference-between-increasing-elements/2016-maximum-difference-between-increasing-elements.cpp | class Solution {
public:
int maximumDifference(vector<int>& nums) {
int n = nums.size();
int ans = -1, premin = nums[0];
for (int i = 1; i < n; ++i) {
if (nums[i] > premin) {
ans = max(ans, nums[i] - premin);
} else {
premin = nums[i];
... | ALGO | 0.999974 | 5.789145 |
1e682920-a468-40ab-90fb-001fd778eb20 | ishandutta2007/codeforces | lyc_music/normal/1717/F.cpp | #include<bits/stdc++.h>
#define int long long
const int N=1000005;
using namespace std;
int sum[N];
struct edge{
int to,nx,w;
};
struct Flow{
edge e[N];
vector<int> hd;
int n,S;
void add(int fr,int to,int w){
e[++S]={to,hd[fr],w},hd[fr]=S;
e[++S]={fr,hd[to],0},hd[to]=S;
}
#define fore(k) for(int i=hd[k];... | ALGO | 0.999992 | 3.529031 |
75e2919d-12b2-4607-ac40-48f42275d97a | lulzbot3d/libUvulaLE | src/unwrap.cpp | // (c) 2025, UltiMaker -- see LICENCE for details
#include "unwrap.h"
#include <algorithm>
#include <map>
#include <numeric>
#include <set>
#include <range/v3/algorithm/partition.hpp>
#include <range/v3/view/enumerate.hpp>
#include <range/v3/view/map.hpp>
#include <spdlog/spdlog.h>
#include "Face.h"
#include "Matri... | ALGO | 0.999353 | 6.815252 |
ec3db3ca-e274-4aec-8c69-2a91a30cddde | mark9856/DataStructures_2014 | labs/lab4/Rectangle.cpp | #include <iostream>
#include "Rectangle.h"
Rectangle::Rectangle(const Point2D& lower_left, const Point2D& upper_right)
: m_lower_left(lower_left), m_upper_right(upper_right)
{ }
bool Rectangle::is_point_within(const Point2D& p) const {
return
// || should change to &&
(p.x() <= m_upper_right.x... | ALGO | 0.998873 | 5.131908 |
d7f05adc-4621-4815-a8c5-9f097eaf355a | Amanc77/DSA-Question-Practice | Recursion/SumOfNatural_byREcurcion.cpp | #include<iostream>
using namespace std;
int sum (int n)
{
if(n==0)
{
return 0;
}
else{
return sum(n-1)+n;
}
}
int main()
{
cout<< " enter the number "<<endl;
int n;
cin>>n;
int ans = sum(n);
cout<<"sum of n number is = "<<ans<<endl;
return 0;
} | ALGO | 0.999691 | 3.797719 |
4a8aa9c4-d25c-4254-a5b0-2ee40a4fdbe0 | suman0725/RGD_Analysis_New | PID/PID_Cuts/dt_pion_hypothesis_allpositivechargeparticles/main.cpp | #include <TFile.h>
#include <TH1F.h>
#include <TCanvas.h>
#include <TLegend.h>
#include <TSystem.h>
#include <ROOT/RDataFrame.hxx>
#include <ROOT/RVec.hxx>
#include <TF1.h>
#include <TLine.h>
#include <iostream>
#include <fstream>
#include <vector>
#include <chrono>
#include <iomanip>
#include <TStyle.h>
using namespa... | DATA | 0.94052 | 5.94945 |
0c34a426-a61d-4c4e-894b-cbf8ce7a2d8c | ard1498/Data-Structures | graph1.cpp | #include <iostream>
#include <vector>
#include <string>
using namespace std;
class node;
class edge
{
private:
int weight;
node* destination, *origin;
public:
edge(node* org, node* dest, int wt)
{
destination = dest;
origin = org;
weight = wt;
}
node* getorig() { return origin; }
node* getdest() { retur... | ALGO | 0.99225 | 4.237065 |
0049f8f9-b314-41a7-81fd-21602bc4721e | Taoyy-code/test | Population growth.cpp | #include<iostream>
#include<math.h>
using namespace std;
int main()
{
int x, n;
double s;
cout << "˿ڻ" << endl;
cin >> x;
cin >> n;
s = x;
s =pow((1 +0.001), n)*s;
cout << s;
} | ALGO | 0.999892 | 3.052514 |
ed021f97-7460-4930-8a6b-6ce9dd8127b5 | efeslab/lapidary | custom_gem5/src/systemc/tests/systemc/datatypes/int/arith/arith01/arith01.cpp | /*****************************************************************************
arith01.cpp --
Original Author: Martin Janssen, Synopsys, Inc., 2002-02-15
*****************************************************************************/
/****************************************************************************... | TEST | 0.954922 | 6.03225 |
655abe64-28d1-45a0-8c8e-d66cb5aa2e20 | shubham-1827/CPP | pw_cpp/searching/lower_and_higher_bound.cpp | #include <iostream>
#include <vector>
using namespace std;
int upper_bound(vector<int> &v, int target) {
if ( target >= v.back() ) {
return 0;
}
int left = 0;
int right = v.size() - 1;
int mid;
while ( left <= right ) {
mid = left + (right - left) / 2;
if ( v[mid] == target ) {
return v[... | ALGO | 0.999937 | 5.905053 |
c9de8793-b52f-4681-b460-e90223a062b4 | leonardoAnjos16/Competitive-Programming | Facebook/consistency_chapter_1.cpp | #include <bits/stdc++.h>
using namespace std;
#define long long long int
bool vowel(char c) {
switch (c) {
case 'A':
case 'E':
case 'I':
case 'O':
case 'U':
return true;
default:
return false;
}
}
int main() {
ios_base::sync_with_st... | ALGO | 0.999788 | 5.803822 |
efc46761-c89b-4fc1-b959-1d2ea1e9842e | FarmerJohnLYH/shareOI | JZOJ/2019.1.28/3836.cpp | #include <cmath>
#include <ctime>
#include <queue>
#include <cstdio>
#include <cstring>
#include <iostream>
#include <algorithm>
#define oo 2139062143
#define fo(i,x,y) for (int i=(x),asdfgh=(y);i<=asdfgh;++i)
#define fd(i,x,y) for (int i=(x),asdfgh=(y);i>=asdfgh;--i)
#define fi first
#define se second
using namespace ... | ALGO | 0.999927 | 3.645404 |
6ededf20-ca15-43f8-ab4a-38b3bbdd16cc | bootleg-q/external_skia | src/core/SkLatticeIter.cpp | #include "SkLatticeIter.h"
#include "SkRect.h"
/**
* Divs must be in increasing order with no duplicates.
*/
static bool valid_divs(const int* divs, int count, int start, int end) {
int prev = start - 1;
for (int i = 0; i < count; i++) {
if (prev >= divs[i] || divs[i] >= end) {
return fa... | TOOL | 0.966204 | 7.311618 |
00b960a6-aafc-4101-a0d1-be66990f78c4 | AdrianaVlad/sorting_networks_EAA | tema/Tools.cpp | #include "Tools.h"
#include <iostream>
#include <iomanip>
#include <sstream>
#include <cmath>
#include <map>
#include <algorithm>
namespace Tools {
std::bitset<32> toBitSet(int value) {
return std::bitset<32>(value);
}
int toInt(const std::bitset<32>& bits) {
return static_cast<int>(bits.... | TOOL | 0.986983 | 5.065146 |
8f43ffdb-8ad4-4bff-bd3e-140c456fb5c7 | VanshSah/complete-cpp-and-DSA-and-Practice-questions | codes in c++ (level-2)/decimal to hexa-decimal.cpp | #include<bits/stdc++.h>
#include<string>
using namespace std;
string decimalToHexaDecimal(int n)
{
int x=1;
string ans="";
while(x<=n)
x *= 16;
x /= 16;
while(x>0)
{
char c;
int lastDigit = n/x;
n -= lastDigit*x;
x /= 16;
if(lastDigit<=9)
ans = ans + to_string(lastDigit); // to_string converts i... | ALGO | 0.99964 | 5.558972 |
aa25a6db-a25a-4b85-a314-b5c008f72e51 | Vladimir-Mari-afk/Search_engine | SearchEngine/src/main.cpp | #include "SearchServer.h"
void threads(InvertedIndex& ii, std::vector<std::string>& docs)
{
int maxThreads = std::thread::hardware_concurrency();
std::vector<std::thread> threads;
int size = docs.size();
size_t count = 0;
while (size > 0)
{
int threadsToCreate = std::min(size, maxThreads);
size -= threads... | WEB | 0.982321 | 4.273153 |
9148a403-a62e-4de4-97ae-3a30f8f137cb | dejasonvu/Program_Design_II | hw1/hw1.cpp | #include <iostream>
#include <string>
using namespace std;
int main(int argc, char** argv){
int max = 0, test = 0;
int arg = stoi(argv[1]);
for(int i = 0; i <= arg; i++){
test = i * (arg - i);
if(test > max)
max = test;
cout << "(" << i << "," << arg - i << ")\n";
... | ALGO | 0.992483 | 4.418688 |
f8e49482-36ac-49e7-8688-273693c1b120 | gschiavodev/cop4520-assignment-03 | source/problem_01.cpp |
// System includes
#include <array>
#include <vector>
#include <thread>
#include <iostream>
#include <algorithm>
#include <random>
// Local includes
#include "problem_01.hpp"
#include "present.hpp"
#include "servant.hpp"
int problem_01::main()
{
// Create a list of presents
std::vector<problem_01::Present> unsort... | TOOL | 0.986877 | 5.942268 |
d7c48ae2-716e-4762-9b55-26b211d545b5 | zhenliatbrown/Multiscale_Coupling | src/GPU/pair_born_coul_wolf_gpu.cpp | /* ----------------------------------------------------------------------
Contributing authors: Trung Dac Nguyen (ORNL)
------------------------------------------------------------------------- */
#include <math.h>
#include <stdio.h>
#include <stdlib.h>
#include "pair_born_coul_wolf_gpu.h"
#include "atom.h"
#includ... | ALGO | 0.997173 | 6.242692 |
19333153-5184-4388-a9e2-f981a3a85253 | ReznikovRoman/mirea-hw | data_structures/lab-5/lab_5.cpp | #include <string>
#include <iostream>
#include <stack>
using namespace std;
// Задание 1
// Получаем приоритет операторов
int getOperatorsPrecedence(char c)
{
if (c == '^')
return 3;
else if (c == '*' || c == '/')
return 2;
else if (c == '+' || c == '-')
return 1;
else
r... | ALGO | 0.998992 | 4.548947 |
d480e8c5-d98d-426e-a38f-fa8e5ca5c2cb | Movazed/CodeForces_Problem_Set | 1100_1631B_Fun_with_even_subarrays.cpp | #include<bits/stdc++.h>
using namespace std;
#pragma GCC optimize("Ofast,unroll-loops")
//#pragma GCC target("avx,avx2,avx512,fma")
template<typename A, typename B> ostream& operator<<(ostream &os, const pair<A, B> &p) { return os << '(' << p.first << ", " << p.second << ')'; }
template<typename T_container, typen... | ALGO | 0.999876 | 5.130827 |
faf46d43-39fd-48f3-afba-e0d427196fad | fyrsta7/LLM_on_ASAC | result_api_backup/en_without_annotation_mzn/o1-mini/Statistics.cpp | #include<bits/stdc++.h>
using namespace std;
typedef long long ll;
ll count_twos(ll x){
ll count =0;
ll factor=1;
while(factor <=x){
ll lower = x % factor;
ll current = (x / factor) %10;
ll higher = x / (factor*10);
if(current <2){
count += higher * factor;
... | ALGO | 0.999678 | 4.007042 |
05fe9d51-f887-4254-a3c7-ab7c633828cf | thomasxm/Akira-obfuscator | llvm/lib/CodeGen/SwitchLoweringUtils.cpp | #include "llvm/CodeGen/SwitchLoweringUtils.h"
#include "llvm/CodeGen/FunctionLoweringInfo.h"
#include "llvm/CodeGen/MachineJumpTableInfo.h"
#include "llvm/CodeGen/TargetLowering.h"
#include "llvm/Target/TargetMachine.h"
using namespace llvm;
using namespace SwitchCG;
uint64_t SwitchCG::getJumpTableRange(const CaseClu... | ALGO | 0.995727 | 5.539927 |
71a982fb-51dd-4e09-aecc-deee7a2ce52f | bitecount/utils | arrange.cpp | #include <stdio.h>
#include <stdlib.h>
typedef struct frequency
{
int item;
int count;
} frequency_t;
void printarrangement(int *x, int i)
{
printf("[");
for(int j = 0; j < i; ++j)
printf("%3d ", x[j]);
printf("]\n");
}
/*
Backtracking function to either print permutations or combinations (with repetition) of... | ALGO | 0.99984 | 4.900054 |
01e3bc37-6b4f-479c-be28-d3997bb6a54f | unidesigner/pyconto | pyconto/algorithms/causality/cssr/CSSR-v0.1.1/Main.cpp | /////////////////////////////////////////////////////////////////////////////
//Title: Main.cpp (for program CSSR)
//Author: Kristina Klinkner
//Date: July 23, 2003
//Description: Creates separate causal states for each history of data
// with a singular probability distribution. History length
// increases increme... | ALGO | 0.997271 | 4.589738 |
757e9ab0-083b-472a-83db-7a796950f52a | pri1624/leetcode | 0520-detect-capital/0520-detect-capital.cpp | class Solution {
public:
bool detectCapitalUse(string word) {
int up=0, low=0;
for(int c = 0; c < word.size(); c++){
if(isupper(word[c]))
up++;
else
low++;
}
if(up==word.size()||low==word.size())
return true;
... | ALGO | 0.999909 | 6.165454 |
ba758f78-c600-4a99-afe9-75de529c3847 | ishandutta2007/codeforces | ivan100sic/normal/1199/A.cpp | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
typedef long double ld;
int n, x, y;
int a[100005];
int main() {
ios_base::sync_with_stdio(false);
cin.tie(nullptr);
cout.tie(nullptr);
cerr.tie(nullptr);
cin >> n >> x >> y;
for (int i=0; i<n; i++)
cin >> a[... | ALGO | 0.999976 | 4.033741 |
68573d80-0c25-49f4-a326-63592e4d4d22 | tavishivss/cpp-practice | binarysearch.cpp | #include<iostream>
using namespace std;
int binarySearch(int a[],int n,int key)
{
int s=0;
int e=n;
while(s<=e)
{
int mid=(s+e)/2;
if(a[mid]==key)
{
return mid;
}
else if(a[mid]>key)
{
e=mid-1;
}
else
{
s=mid+1;
}
}return -1;
}
int main()
{
int n;
... | ALGO | 0.999865 | 5.437096 |
3922f81f-d781-4e75-853c-fd2a166abf94 | LSH3333/PS | baekjoon/1043 (2).cpp | #include <iostream>
#include <vector>
#include <algorithm>
using namespace std;
int N, M, answer;
vector<int> knows;
vector<vector<int>> parties;
int parent[51];
int GetParent(int node) {
if(parent[node] == node) return node;
return parent[node] = GetParent(parent[node]);
}
void Union(int n1, int n2) {
n... | ALGO | 0.999717 | 4.560016 |
555a6844-b66a-446e-a756-51966bc903ee | skihyeon/22-2_OpenCV | 21. LBP_landmark/train_model.cpp | #include <vector>
#include <iostream>
#include "opencv2/opencv.hpp"
#include "opencv2/core/core.hpp"
#include "opencv2/highgui/highgui.hpp"
#include "opencv2/objdetect/objdetect.hpp"
#include "modelcfg.h"
#include "ldmarkmodel.h"
using namespace std;
using namespace cv;
int main()
{
std::vector<ImageLabel> mIma... | DATA | 0.967414 | 4.03644 |
f4205709-4777-417b-a362-ed7088fc31ea | Bliss-Elite/platform_system_core | libutils/JenkinsHash.cpp | /* Implementation of Jenkins one-at-a-time hash function. These choices are
* optimized for code size and portability, rather than raw speed. But speed
* should still be quite good.
**/
#include <utils/JenkinsHash.h>
namespace android {
hash_t JenkinsHashWhiten(uint32_t hash) {
hash += (hash << 3);
hash ^... | ALGO | 0.991958 | 7.014037 |
aa4dfa71-9dbe-4d92-ac9d-d9bd7f1fa59d | meowmeow321/cp-snippets | some good fuckin snippets/USACO-master/Contests/USACO Solutions/2019-20/Feb/Gold/help.cpp | #include "bits/stdc++.h"
using namespace std;
void setIO(string s) {
ios_base::sync_with_stdio(0); cin.tie(0);
freopen((s+".in").c_str(),"r",stdin);
freopen((s+".out").c_str(),"w",stdout);
}
#define f first
#define s second
const int MOD = 1e9+7;
int N;
int main() {
setIO("help");
cin >> N; vector<pai... | ALGO | 0.99998 | 4.120347 |
1b6c08e9-ba77-4d5c-a1e9-234d586e01f8 | bh-yogendra1/DAA-Lab-Assignments-main | week6/q2.cpp | #include <bits/stdc++.h>
using namespace std;
bool bfs(vector<int> adj[],int src, vector<int> &color,int n)
{
queue<int> q;
q.push(src);
color[src]=1;
while (!q.empty())
{
int node=q.front();
q.pop();
for (auto it:adj[node])
{
if (color[it]==-1)
... | ALGO | 0.999982 | 5.058282 |
c31da0a3-8138-4134-8edb-4fcbb090585d | EnLaLuna91/Grafics | Prac_2/practica2Test/BlinnPhong.cpp | #include "BlinnPhong.h"
BlinnPhong::BlinnPhong(){}
/**
* [BlinnPhong::obtainBlinnPhong description]
* Función que calcula el color en base Blinn-Phong, devuevle el color
* @param _info [description]
* @return [description]
*/
glm::vec3 BlinnPhong::obtainBlinnPhong(IntersectInfo &_info, glm::vec3 &light_co... | ALGO | 0.890591 | 3.760165 |
cd9f1b3d-8615-4170-b036-b0a3a8eb7628 | SolDev69/termuxpojav-mesa-zink | src/gallium/frontends/clover/llvm/codegen/common.cpp | ///
/// \file
/// Codegen back-end-independent part of the construction of an executable
/// clover::binary, including kernel argument metadata extraction and
/// formatting of the pre-generated binary code in a form that can be
/// understood by pipe drivers.
///
#include <llvm/IR/Type.h>
#include <llvm/Support/Alloc... | TOOL | 0.947056 | 7.557849 |
efee4c92-4541-4a14-80e2-79e5f7b077a0 | mohitmallick17/LeetCodeSolutions | 198-house-robber/198-house-robber.cpp | class Solution {
public:
int rob(vector<int>& nums) {
int n=nums.size();
if(n==1)return nums[0];
int p1,p2;
p2=nums[0];
p1=max(nums[0], nums[1]);
for(int i=2;i<n;i++){
int cur = max(p2 + nums[i], p1);
p2=p1;
p1=cur;
}
... | ALGO | 0.999896 | 5.814264 |
5d981c51-7bc3-4bb9-bbbc-120717d6bb9f | AyobAsroutVargas/VRPtest4 | main.cpp | #include "file-loader.h"
#include "greedy-vrp.h"
#include "grasp-vrp.h"
#include "solution.h"
#include "gvns.h"
int main(int argc, char* argv[]) {
std::string filename = "I40j_2m_S1_1.txt";
if (argc == 2) {
filename = argv[1];
}
int nClients = 0, nVehicles = 0;
std::vector<std::vector<int>> distanceMatri... | ALGO | 0.986571 | 3.462856 |
7153b7db-7afc-4d0a-8278-69e13247af45 | BowDer1118/ContestSolution | LeetCode/BSTPostorder.cpp | #include <bits/stdc++.h>
using namespace std;
//Definition for a binary tree node.
struct TreeNode {
int val;
TreeNode *left;
TreeNode *right;
TreeNode() : val(0), left(nullptr), right(nullptr) {}
TreeNode(int x) : val(x), left(nullptr), right(nullptr) {}
TreeNode(int x, TreeNode *left, TreeNode... | ALGO | 0.999877 | 5.755201 |
f5fead51-c394-41a3-9df7-478d26d2b237 | sunwaylive/sword-to-offer | Problem_21.cpp | #include <cstdio>
#include <stack>
#include <iostream>
using namespace std;
class MyStack{
private:
stack<int> value;
stack<int> minimum;
public:
MyStack() {}
void pop(){
if(this->value.empty()) return;
int t = this->value.top();
this->value.pop();
if(!this->minimum.e... | ALGO | 0.983943 | 3.777525 |
9be4ca86-93dc-4917-ba30-eb2bd62ab439 | Dhruvs220403/os-lab | diskScheduling.cpp | #include <iostream>
#include <fstream>
#include <vector>
#include <cmath>
#include <algorithm>
#include <iomanip>
using namespace std;
void readDiskParameters(const string &filename, int &numCylinders, int &numSectors, int &bytesPerSector,
int &rpm, double &avgSeekTime, int &initialHeadPosition, ... | ALGO | 0.995925 | 4.610043 |
2bbcf6ce-d5a2-4659-b1e7-9bc7dfcfe718 | mahmoudmahgoub/leetcode | algorithms/e9.goal-parser-interpretation/e9_cplusplus.cpp | class Solution {
public:
string interpret(string command) {
string res="";
for(int i=0;i<command.size();i++)
{
if(command[i]=='G')
res.push_back('G');
else if(command[i]==')')
{
res.push_back('o');
}
... | ALGO | 0.99777 | 4.266466 |
233c723c-a9fb-4f46-a052-fbd6b05dec5c | 155keshav223/100-DAYS-CODING | DSA/Questions love bubber/arrays/Array_max_min.cpp | #include<iostream>;
#include<cmath>;
using namespace std;
void max_min(int arr[],int n){
int temp=0;
for(int i=0;i<n;i++){
for(int j=i+1;j<n;j++){
if(arr[i]>arr[j]){
temp=arr[j];
arr[j]=arr[i];
arr[i]=temp;
}
}
}
... | ALGO | 0.99981 | 3.782808 |
df75acad-bd05-49f5-b1f5-f03014db9300 | appleopen/clang | src/lib/CodeGen/SelectionDAG/LegalizeVectorOps.cpp | #include "llvm/CodeGen/SelectionDAG.h"
#include "llvm/Target/TargetLowering.h"
using namespace llvm;
namespace {
class VectorLegalizer {
SelectionDAG& DAG;
const TargetLowering &TLI;
bool Changed; // Keep track of whether anything changed
/// For nodes that are of legal width, and that have more than one use,... | ALGO | 0.959915 | 7.423479 |
2be43be3-e910-492f-89cd-1499a6145c80 | michalber/ANC-Headphones-repository- | modules/juce_dsp/maths/juce_LookupTable.cpp | namespace juce
{
namespace dsp
{
template <typename FloatType>
LookupTable<FloatType>::LookupTable()
{
data.resize (1);
}
template <typename FloatType>
LookupTable<FloatType>::LookupTable (const std::function<FloatType (size_t)>& functionToApproximate,
size_t numPointsToUse)
{... | TOOL | 0.870729 | 6.787538 |
edd31f5e-6ea6-43fb-92b5-ad587b8d67f1 | ck961018/PBD | src/jet/implicit_surface_set2.cpp | #include <pch.h>
#include <jet/implicit_surface_set2.h>
#include <jet/surface_to_implicit2.h>
using namespace jet;
ImplicitSurfaceSet2::ImplicitSurfaceSet2() {}
ImplicitSurfaceSet2::ImplicitSurfaceSet2(
const std::vector<ImplicitSurface2Ptr>& surfaces,
const Transform2& transform, bool isNormalFlipped)
... | ALGO | 0.988163 | 7.804748 |
71b62978-c4a5-4653-81e2-4487b2bb528c | TM-DEV-PRO/DSA-CP | funtion-snippets/strivers/day22/distinct-elements-window.cpp | #include<bits/stdc++.h>
using namespace std;
const long long INF = 1e18L + 5;
const long double D_INF = 1e10;
long double ans = 0.0;
long long res = 0;
long long int md = 1000000007LL;
vector <int> countDistinct (int A[], int n, int k)
{
unordered_map<int,int> mp;
vector<int> res;
for(int i... | ALGO | 0.999824 | 3.989577 |
b76fd0d2-8a0a-49fb-a46c-4f9ec0ab4075 | Ubaid01/Algo_Visualizer | backtracking.cpp | #include "backtracking.h"
#include "types.h"
Backtracking::Backtracking(QWidget *parent,int N,int Width,int Height)
:QWidget(parent),n(N),width(Width),height(Height),NQ(nullptr),RM(nullptr){
int num_rows=4;
int separation=50,w=(width-50*5)/4,start_x=50,h=(height-200-50*5)/num_rows,start_y=50,separation_y=1... | ALGO | 0.901421 | 5.331174 |
7d2e2c76-f69f-49e9-acd5-bf5a3efcb672 | AbhiKangane/DSA_in_CPP | Matrix/Number_of_paths_in_matrix_with_k_coins.cpp | /*
GFG : https://www.geeksforgeeks.org/problems/number-of-paths-in-a-matrix-with-k-coins2728/1
Given a n x n matrix such that each of its cells contains some coins. Count the number of ways to collect exactly k coins
while moving from top left corner of the matrix to the bottom right. From a cell (i, j), you can only... | ALGO | 0.999984 | 5.215719 |
9f44dd6b-89d1-44f3-b070-341a34caa572 | Rajat-Raghuvanshi-0512/C-plus-plus | Data structures/Binary tree/deletion_BST.cpp | #include <iostream>
using namespace std;
struct node
{
int data;
node *left, *right;
};
struct node *root;
struct node *create(int data)
{
struct node *newnode;
newnode = new node;
newnode->data = data;
newnode->left = 0;
newnode->right = 0;
return newnode;
}
struct node *FindMin(node *r... | ALGO | 0.999968 | 5.573701 |
e9b5b200-cf1d-491e-a315-0ea6f6a6dbbb | Sumanth-NR/CompetitiveProgramming | Platforms/CodeForces/Infero/Infero2022_Rahul/E_Hexagon_of_Hexagons.cpp | #include <bits/stdc++.h>
using namespace std;
// Data Types
typedef long long int ll;
typedef long double ld;
// Constants
const int MOD = 1000000007;
const double PI = 3.1415926535;
const int INF = INT_MAX;
const ll LINF = LONG_MAX;
const char NL = '\n';
// Some misc Macros
#define pb push_back
#define prec fixed <... | ALGO | 0.999968 | 4.825652 |
8b83f70f-20aa-4f10-a657-8dfffe360444 | icoty/LeetCode | Algorithms/459.Repeated_Substring_Pattern.cpp | #include "AllInclude.h"
class Solution {
public:
bool repeatedSubstringPattern(string s) {
int len = s.size();
for(int i = len / 2; i >= 1; --i){
if(0 == len % i){
int cnt = len / i;
string tmp = "";
for(int... | ALGO | 0.995747 | 5.059037 |
210c1b01-5cc5-4091-9911-fe9a76c91327 | silvaalejesus/projetos-da-faculdade | jude/lista1/C-As-Novas-Missoes-Jedi.cpp | #include <iostream>
using namespace std;
int main() {
int N, XP;
cin >> N >> XP;
int XPi[3];
int total = 0;
for (int i = 0; i < 3; i++) {
cin >> XPi[i];
}
string nomes[3] = {"Yoda", "Luke", "Ahsoka"};
for (int i = 0; i < 3; i++) {
total = (N * XP) + XPi[i];
cout << nomes[i] << " " << ... | ALGO | 0.996847 | 3.998431 |
c8bcfe40-fcb5-4073-a036-50be572aea15 | soybean33/BAEKJOON | 14502 연구소.cpp | #include <iostream>
#include <vector>
#include <cstring>
#include <queue>
#include <algorithm>
struct Coordinate{
int y, x;
};
int N, M; // N: 세로 크기, M: 가로 크기 -> 직사각형임에 주의
int MAP[9][9]; // MAP[j][i]: j행 i열의 상태
int visited[9][9]; // visited[j][i]: j행 i열의 안전 구역 확인용
std::vector<Coordinate> v; // v: 초기 바이러스의 위치... | ALGO | 0.999718 | 5.039093 |
abc0ac47-9e27-4a3c-a833-9c56543748bf | eduardohmrodrigues/competitive-programming | URI/1_beginner/1963.cpp | #include <cstdio>
int main(){
double a, b;
scanf("%lf %lf", &a, &b);
printf("%.2lf%%\n", (b*100.0/a)-100);
return 0;
}
| ALGO | 0.997714 | 3.589703 |
123c3c88-608d-424c-bb69-61ea1eda576c | sami0055/DSA-with-CPP | Data Structure & Algorithm/LinkedList/LinkedList/HeadAndNode.cpp | #include<iostream>
#include<stdio.h>
#include<stdlib.h>
using namespace std;
struct Node{
int data;
struct Node* link;
};
struct Node* head;
void print(){
struct Node* temp;
temp=head;
while(temp!=NULL)
{
cout<<temp->data<<endl;
temp=temp->link;
}
}
int main()
{
head=... | ALGO | 0.996485 | 3.844366 |
ca55dada-506e-4ffb-954e-642244544cd3 | amoulis/CIFM | CMatrix.cpp | #include "CMatrix.hpp"
CMatrix::CMatrix(int w, int h)
{
int i, j;
if(h > 0 && w > 0)
{
this->height = h;
this->width = w;
}
else
{
cout << "Error Width or Height not conform" << endl;
return;
}
this->name = string();
for (i = 0; i < height; i++)
{
vector<double> row; // Create an empty row
f... | ALGO | 0.989111 | 3.778106 |
84c056f3-318c-4fca-986b-f39d88290680 | jedavis82/scene_labeling | HoFpy/src/hofpy.cpp | #include <iostream>
#include "hofpy.h"
#include "HoF_Raster.hpp"
py::array_t<double> FHist(py::array_t<unsigned char>& imageA, py::array_t<unsigned char>& imageB,
int numberDirections, bool useHybrid, double typeForce, double p0, double p1) {
py::buffer_info bufA = imageA.request();
... | DATA | 0.942125 | 6.407754 |
e3247a43-4770-4b8b-ad9b-cbc227d05a80 | Jam-Cai/DMOJ_Solutions | dmopc_2015_c6_p4.cpp | #include <algorithm>
#include <numeric>
#include <iterator>
#include <iostream>
#include <cstring>
#include <bitset>
#include <deque>
#include <vector>
#include <string>
#include <tuple>
#include <cmath>
#include <map>
#include <set>
#include <unordered_set>
#include <queue>
using namespace std;
typedef long long ll;
t... | ALGO | 0.999635 | 3.915956 |
3201fc25-b1da-4991-90be-d160ddaef701 | star-platinum127/uva | cf 1446 C.cpp | #include <bits/stdc++.h>
using namespace std;
typedef int64_t ll;
#pragma GCC optimize("Ofast")
#pragma GCC optimize ("unroll-loops")
#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native")
#define mikumywaifu ios_base::sync_with_stdio(0)
#define misakamywaifu cin.tie(0)
#define pb push_back
#defi... | ALGO | 0.999835 | 3.985357 |
a004cf18-7b96-451a-89f4-bd258306adc7 | Nizam6239/my_dsa_code | basiclinkedlist.cpp | #include <iostream>
using namespace std;
class Node{
public:
int data;
Node *next;
Node(int data){
this->data = data;
next = NULL;
}
};
int main(){
//Statically
// Node n1(1);
// Node *head = &n1;
// Node n2(2);
// n1.next = &n2;
// cout<<n1.data<<" "<<n2.da... | ALGO | 0.939595 | 3.689386 |
f2ef2368-1187-4709-9ce4-dfc70e70bc20 | jonaskaufman/LE-MCBRT | source/serial/serial-main.cpp | #include "../parameters.hpp"
#include "simulation.hpp"
#include <chrono>
#include <iostream>
//#include <stdlib.h>
int main(int argc, char** argv)
{
if (argc < 4)
{
std::cerr << "Invalid number of arguments [grid size] [number of primary rays] [density initialization method] "
"[a... | ALGO | 0.997058 | 5.998695 |
4180d495-8ac1-437c-9a95-730355aa2494 | mrpankajpandey/GFG-POTD24 | 01 - January/06-01-2024.cpp | /*
Author : mrpankajpandey
Date : 06/01/2024
Problem : Techfest and the Queue
Difficulty : Medium
Problem Link : https://www.geeksforgeeks.org/problems/techfest-and-the-queue1044/1
Video Solution : https://youtu.be/E5UbBRNQxPc
*/
//{ Driver Code Starts
#include<bits/stdc++.h>
using namespace std;
// } Driver Code ... | ALGO | 0.999888 | 5.836691 |
b431a97e-4f71-4e5c-ac91-8765d209d8ce | MortazaNabavi/Cources | Spring2025/Gharjistan_Uni/CPP_A/14040328/p06.cpp | #include <iostream>
using namespace std;
int main(){
double a,b,c;
cin>>a>>b>>c;
bool checkA=a<b+c;
bool checkB=b<a+c;
bool checkC=c<a+b;
if(checkA&&checkB&&checkC)
cout<<"Triangle";
else
cout<<"NOT Triangle";
return 0;
} | ALGO | 0.995933 | 4.546335 |
a36cc5fb-eb69-430c-989b-dfe6d43679c6 | fregu856/cpp | CtCI/18.3.cpp | #include <iostream>
#include <vector>
#include <cstdlib>
#include <ctime>
int getRandom(int max)
{
std::srand(std::time(nullptr));
return std::rand() % (max+1);
}
std::vector<int> pickM(std::vector<int> &vec, int m)
{
std::vector<int> subset(m);
for (int i = 0; i < m; ++i)
{
subset[i] = ve... | ALGO | 0.998548 | 4.803974 |
12171f09-26b4-4e86-9010-b29cc8683edb | antonyayansi/curso-cpp | clase1/suma_con_funcion.cpp | #include<iostream>
#include<conio.h>
using namespace std;
int suma(int a, int b){
return a + b;
}
int main(int argc, char** argv){
int a;
int b;
int suma;
cout<<"PROGRAMA SUMA SIN FUNCIONES"<<endl;
cout<<"============================"<<endl;
cout<<"Ingrese el primer valor: "<<endl;
cin>>a;
cout<<"Ingrese ... | TOOL | 0.970294 | 4.168664 |
9f01ca72-ffc9-4b77-b7c1-699c14b794b2 | StrikerSumit39/CodeForces | codeforces/1543/A.cpp | #include<bits/stdc++.h>
using namespace std;
//===================================tempelet=======================================
#define fastio ios_base::sync_with_stdio(false);cin.tie(NULL); cout.tie(0);
#define endl "\n"
#define int long long int
#define ll long long int
#define ull unsigned long long int
#define... | ALGO | 0.999925 | 4.659594 |
f95eb708-1e7b-4d5e-8256-7cccc8cea234 | ygm8810/mock_twelve | cocos2d/tools/simulator/frameworks/runtime-src/proj.win32/SimulatorWin.cpp |
#pragma comment(lib, "comctl32.lib")
#pragma comment(linker, "\"/manifestdependency:type='Win32' name='Microsoft.Windows.Common-Controls' version='<IP_ADDRESS>' processorArchitecture='X86' publicKeyToken='6595b64144ccf1df' language='*'\"")
#include "stdafx.h"
#include <io.h>
#include <stdlib.h>
#include <malloc.h>
#i... | TOOL | 0.863153 | 5.721512 |
b5f411c6-611c-4913-9160-eca655b4fc7c | aditya762/Leetcode-Coding-Practice | 0109-convert-sorted-list-to-binary-search-tree/0109-convert-sorted-list-to-binary-search-tree.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) {}
* };
*/
/**
* Definition for a binary tree node.
* stru... | ALGO | 0.999994 | 6.574999 |
6ebe9ab6-5f2c-46e1-8ed3-60d03a4c1bbc | ketrin1777/04-cpp-homework | 02/02/main.cpp | #include <iostream>
unsigned long long fibo(unsigned long long *arrFib, int size, int n) {
if (n == 0) {
return 0;
}
if (n == 1 || n == 2) {
arrFib[n] = 1;
return 1;
}
// Проверяем если в данном ряду есть число то не выпоняем рекурсию
if (arrFib[n] > 0) {
return arrFib[n];
}
// Запоми... | ALGO | 0.99984 | 5.287882 |
b62b74ea-2034-47ea-a56a-51480b8efaba | ShubhranshuArya/Poke | 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 |
3823eff7-7abf-404e-b79a-f4c7885d3ee3 | Sumitsonawane30/SumitAssignments | C++Stuff/Quicksort.cpp | #include<iostream>
using namespace std;
struct student
{
int roll;
string name;
float sgpa;
};
void show1(student*a[],int n)
{
for(int i=0;i<n;i++)
{
cout<<a[i]->roll<<" ";
cout<<a[i]->name<<" ";
cout<<a[i]->sgpa<<"\n";
}
}
void show2(student*a[],int n){
for(... | ALGO | 0.99928 | 3.592529 |
2890f411-e53f-4224-aeff-1592b6960a83 | habib09/problem-solution | uva/382-perfection.cpp | #include <iostream>
#include<stdio.h>
using namespace std;
int main()
{
long int k,sum,n;
printf("PERFECTION OUTPUT\n");
while(1)
{
scanf("%ld",&n);
if(n == 1){ printf("%5ld DEFICIENT\n",n);continue;}
if(n ==0)break;
sum=1;
for(k=2;k<n;k++)
{
... | ALGO | 0.996529 | 3.98817 |
87d7bba0-f98c-4c70-9df8-d9056f1e0955 | matter-labs/compiler-llvm | libcxx/test/std/containers/sequences/vector/vector.modifiers/push_back_exception_safety.pass.cpp | // <vector>
// void push_back(const value_type& x);
#include <vector>
#include <cassert>
#include "asan_testing.h"
#include "test_macros.h"
// Flag that makes the copy constructor for CMyClass throw an exception
static bool gCopyConstructorShouldThrow = false;
class CMyClass {
public: CMyClass(int tag);
pu... | TEST | 0.914094 | 6.432074 |
4f94d4cd-1de7-4fff-9163-139a7a336733 | Adi7523/codes | prime.cpp | #include <iostream>
using namespace std;
int main() {
int i, n;
bool is_prime = true;
cout << "Enter a positive integer: ";
cin >> n;
// 0 and 1 are not prime numbers
if (n == 0 || n == 1) {
is_prime = false;
}
// loop to check if n is prime
for (i = 2; i <= n/2; ++i) {
if (n % i == 0) {
... | ALGO | 0.999258 | 4.17351 |
c05cd1de-e067-45a6-aa12-43c3d83dcf5f | pkunjam/Data-Structures-and-Algorithms | Strings/Check if strings are rotations of each other or not.cpp | // { Driver Code Starts
#include <bits/stdc++.h>
using namespace std;
bool areRotations(string, string);
int main()
{
int t;
cin>>t;
while(t--)
{
string s1;
string s2;
cin>>s1>>s2;
cout<<areRotations(s1,s2)<<endl;
}
return 0;
}
// } Driver Code Ends
/* Functio... | ALGO | 0.999888 | 5.590288 |
0a1621e3-576e-40f2-87c0-8e3a2907b49d | Aliaaxx/DSA | Graphs/DFS/Additional Problems/I-DZY_Loves_Chemistry.cpp | ///*** https://codeforces.com/problemset/problem/445/B ***///
#include <bits/stdc++.h>
#define endl "\n"
#define ll long long
#define IO ios::sync_with_stdio(0); cin.tie(0); cout.tie(0)
using namespace std;
int DFS(vector<bool>& vis, vector<int> adj[], int cur, int& Num) {
vis[cur] = true;
Num += 1;
for (... | ALGO | 0.999646 | 3.995533 |
c183799e-797d-40dd-8f5d-e9ba3c203150 | mohityadaviitb/cp | A_Alyona_and_a_Square_Jigsaw_Puzzle.cpp | #include <bits/stdc++.h>
#define Code ios_base::sync_with_stdio(false);
#define By cin.tie(NULL);
#define Mohityadav cout.tie(NULL);
#define fu(i, a, b) for (ll i(a); i < b; i++)
#define ll long long int
#define pb push_back
using namespace std;
#define commented // Un-Comment this before submission
#ifndef commented
#... | ALGO | 0.99923 | 3.024927 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.