uuid stringlengths 36 36 | repo_name stringlengths 5 123 | relative_path stringlengths 5 4k | content stringlengths 33 2.85M | category stringclasses 6
values | algo_rel_score float64 0.85 1 | quality_score float64 3 8.76 |
|---|---|---|---|---|---|---|
f3711a47-9b7c-4abf-959e-aba1df9c3415 | 113bommy/deepmind_codecontests_refine | cpp_gold_filter_file/cpp_train_9021_7.cpp | #include <bits/stdc++.h>
using namespace std;
inline char gc() {
static char buf[100000], *p1 = buf, *p2 = buf;
return p1 == p2 && (p2 = (p1 = buf) + fread(buf, 1, 100000, stdin), p1 == p2)
? EOF
: *p1++;
}
inline int read() {
int x = 0;
char ch = getchar();
bool positive = 1;
for ... | ALGO | 0.999937 | 4.408187 |
8bfb7b9f-b28c-42c8-ae8e-66f6c2e0be4c | ishandutta2007/codeforces | meaningiess/normal/1630/C.cpp | #include<bits/stdc++.h>
#define ll long long
using namespace std;
int a[200010],l[200010],r[200010];
int main()
{
int n,i,j,ans=0;cin>>n;
for (i=1;i<=n;i++) cin>>a[i];
for (i=1;i<=n;i++)
{
if (!l[a[i]]) l[a[i]]=r[a[i]]=i;
else r[a[i]]=i;
}
for (i=1;i<=n;i++) if (i==l[a[i]] && l[a[i]]!=r[a[i]])
{
int u=r[a[... | ALGO | 0.999967 | 3.640869 |
3bff6c5d-90f0-4623-9b35-a8dae80fac6c | josephabrams/follicle_updated | .history/custom_modules/twoP_20230616171446.cpp | #include "./twoP.h"
//two parameter and three parameter equations for cryobiology
//includes a number of conversions for solutions
std::vector <double> cell_exterior_densities;
std::vector <double> cell_interior_densities;
std::vector <std::vector <double> > virial_coefficients{{},{1,},{},{}};//same index as solutes ... | ALGO | 0.999895 | 6.689732 |
24962cd8-cdd2-4423-b399-32c2ca18d88f | fabricerenard12/2048-Solver | src/Game.cpp | // Game class for the 2048 game logic
// Author: Fabrice Renard
// Date : 23 / 06 / 2023
#include "Game.hpp"
void printBinary(uint64_t value) {
std::bitset<64> binary(value);
std::cout << binary << std::endl;
}
Game::Game()
: grid_(0), score_(0), rd_(std::random_device()), gen_(std::ranlux48(rd_())) {
... | ALGO | 0.994156 | 6.511424 |
502cd8c9-e84a-49ed-94a2-fa6f7904043c | sashank-kasinadhuni/ObjectRecognition | QTprojects/CorrespondenceGrouping/src/keypoints.cpp | #include "keypoints.h"
#include <pcl/visualization/pcl_visualizer.h>
typedef pcl::PointXYZRGBA PointT;
typedef pcl::PointCloud<PointT> PointCloudT;
typedef pcl::PointCloud<pcl::PointNormal> PointNormalCloudT;
double ISSKeypoints::computeCloudResolution (const pcl::PointCloud<pcl::PointXYZRGBA>::ConstPtr &cloud)
{
d... | ALGO | 0.990741 | 6.217536 |
e5681c8f-f267-4393-acd5-c51c9fdbf118 | aravindm711/TIL | A2OJ/CodeforcesDiv2_A/Expression.cpp | # include <string>
# include <vector>
# include <algorithm>
# include <numeric>
# include <set>
# include <map>
# include <queue>
# include <iostream>
# include <sstream>
# include <cstdio>
# include <cmath>
# include <ctime>
# include <cstring>
# include <cctype>
# include <cassert>
# include <limits>
# include <utili... | ALGO | 0.999929 | 4.162923 |
5ea73491-271a-40a6-becb-01743e3fa839 | cal-cs184-student/p4-clothsim-sp20-Hames1001 | ext/nanogui/ext/eigen/doc/examples/Tutorial_BlockOperations_vector.cpp | #include <Eigen/Dense>
#include <iostream>
using namespace std;
int main()
{
Eigen::ArrayXf v(6);
v << 1, 2, 3, 4, 5, 6;
cout << "v.head(3) =" << endl << v.head(3) << endl << endl;
cout << "v.tail<3>() = " << endl << v.tail<3>() << endl << endl;
v.segment(1,4) *= 2;
cout << "after 'v.segment(1,4) *= 2', v... | ALGO | 0.995609 | 3.093805 |
f8bbd6f2-8bb4-4f9b-b0b8-df9b4ce3bcee | MilenaBMaciel/Questoes-Maratona-Mineira-de-Programacao | 2017/2576invertendoSetas.cpp | #include <bits/stdc++.h>
using namespace std;
#define _ ios_base::sync_with_stdio(0);cin.tie(0);
#define F first
#define S second
#define PB push_back
#define LL long long
#define MP make_pair
#define PII pair<int,int>
#define dgb(x) cout << #x << " = " << x << endl
const int maxn = 5*1e5 + 10;
vector<PII> grafo[m... | ALGO | 0.999984 | 4.259738 |
3c0b7028-68d6-4115-9156-47c9edbce33b | juniorandrade1/Competitive-Programming | Codechef/FEV18/poinpoly.cpp | #include <bits/stdc++.h>
using namespace std;
#define eps 1e-8
typedef long long ll;
struct Point {
ll x, y;
Point(){};
Point(ll _x, ll _y) { x = _x; y = _y; }
void read(){ scanf("%lld %lld", &x, &y); }
bool operator < (Point other) const {
if(x != other.x) return x < other.x;
return y < other.y;
... | ALGO | 0.99988 | 4.097555 |
e8226280-9c3b-4101-9121-91caf134d37d | rafadastan/Estrutura-de-dados-cpp | Jessica-Avanzo/Exercicio6.cpp | #include <iostream>
using namespace std;
int main()
{
int num, contador = 1;
cout <<"FATEC Sao Caetano do Sul \n" << endl;
cout << "Disciplina: Estrutura de Dados\n" << endl;
cout << "Alunas: Rita Aparecida Santos Fonseca\n e Jessica Avanzo e Jully Ferreira\n";
cout << "universidade de brasilia\n" << ... | TOOL | 0.852728 | 3.608233 |
21c3bb74-889a-4602-ac9d-8fe886a20066 | knavoid/just-algorithm | sw-expert-academy/D3/태혁이의 사랑은 타이밍.cpp | #include <iostream>
using namespace std;
int main() {
int T;
cin >> T;
for (int t = 1; t <= T; t++) {
int D, H, M, answer = 0;
cin >> D >> H >> M;
answer += (D - 11) * 24 * 60;
answer += (H - 11) * 60;
answer += (M - 11);
cout << '#' << t << ' ';
... | ALGO | 0.998946 | 4.323586 |
4747bd2c-d686-4d87-aed9-17a38fd2d3dc | sarvex/leetcode-tsh | lcof/面试题38. 字符串的排列/Solution.cpp | class Solution {
public:
vector<string> permutation(string s) {
vector<string> ans;
function<void(int)> dfs = [&](int i) {
if (i == s.size() - 1) {
ans.push_back(s);
return;
}
unordered_set<char> vis;
for (int j = i; j <... | ALGO | 0.999955 | 6.233398 |
7f1e11b6-c492-49ad-8e30-82d7939b2366 | gitlicheng/camdroid | camdroid/frameworks/av/media/libvoicecall/codecs/libamrnb/dec/src/ex_ctrl.cpp | /*
------------------------------------------------------------------------------
Pathname: ./audio/gsm-amr/c/src/ex_ctrl.c
Funtions: ex_ctrl
Date: 02/08/2002
------------------------------------------------------------------------------
REVISION HISTORY
Description: Replaced "int" and/or "char" with OSCL... | ALGO | 0.988175 | 7.006685 |
c9aa0235-8388-4bf0-83c9-8714cdae0c3e | surajjaiswal-cmd/courses | dsa/BSTqus.cpp |
// is binary search tree or not
#include <iostream>
#include <climits>
using namespace std;
class node
{
public:
int data;
node *left;
node *right;
node(int value)
{
data = value;
left = right = nullptr;
}
};
node *insert(node *root, int key)
{
if (!root)
{
root ... | ALGO | 0.999986 | 5.111094 |
8a32651d-fac4-4719-8ff1-b7235f19036d | harleenkaur12/CPP | CPP_Classroom/Book questions/References/returnByReference.cpp | #include<iostream>
using namespace std;
inline int &abc(int &x, int &y){
if(x>y){
cout<<"x is greater";
}
else{
cout<<"y is greater";
}
}
int main(){
int a=5;
int b=6;
abc(a,b); //we cannot directly pass values inside the function. since arguments need to be equal to our par... | TOOL | 0.990779 | 3.50959 |
40626e0d-75db-4aa0-8834-605b36d87bf4 | ishandutta2007/codeforces | krk/normal/1588/B.cpp | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef long double ld;
int T;
int n;
ll Ask(int l, int r)
{
printf("? %d %d\n", l, r); fflush(stdout);
ll res; scanf("%I64d", &res);
return res;
}
int Solve(ll val)
{
ll got = 1ll + 8ll * val;
ll ans = sqrt(ld(got));
while ... | ALGO | 0.999835 | 3.433178 |
fcc46bd1-347e-4d40-ba63-0fb3d9f0f3ca | gitanirban/CodePractice | Tricky_C_questions/BitWiseRelated/calculate-xor-1-n_GFG.cpp | //https://www.geeksforgeeks.org/calculate-xor-1-n/
/*
Given a number n, the task is to find the XOR from 1 to n.
Examples :
Input : n = 6
Output : 7
// 1 ^ 2 ^ 3 ^ 4 ^ 5 ^ 6 = 7
Input : n = 7
Output : 0
// 1 ^ 2 ^ 3 ^ 4 ^ 5 ^ 6 ^ 7 = 0
*/
// C++ program to find XOR of numbers
// from 1 to n.
#include <bits/stdc... | ALGO | 0.999982 | 5.885571 |
8e3127c1-e6f8-4c71-b07b-f6df6608f6ff | xray700r/AOP | determ.cpp | #include <iostream>
#include <fstream>
#include <iomanip>
#include <cmath>
#include "deter.h"
using namespace std;
void welcome()
{
cout<<"##########Welcome to the CALCULUS program for the array functions!##########\n"
<<"#####Although it may seem obsolete in the graphical features,#####\n"
<<"#####the algor... | ALGO | 0.99857 | 3.015739 |
7d20ac90-40d5-491f-a9e0-8d3394c998f4 | gsusdev/YASLI | fw/light/sketches/string_utils.cpp | #include <cstdlib>
#include <cstdio>
#include <string>
#include "stringToNumber.h"
#include "string_utils.h"
bool StringUtils::equal(const std::string &v1, const std::string &v2, bool caseInsensitive)
{
const auto sz = v1.size();
if (sz != v2.size())
{
return false;
}
if (!caseI... | TOOL | 0.914573 | 5.289571 |
e668a345-8d9f-4506-9c23-11170dc43c6e | manikanta2901/ubuntu | .history/codingChallenges/cpp/Codechef/longChallenges/October/CovidRun_20201002213425.cpp | #include<bits/stdc++.h>
#include<vector>
#include<iostream>
#include<cmath>
#include<algorithm>
#include<iterator>
#include<string>
#include<map>
#define vv vector
#define F first
#define S second
#define MP make_pair
#define EXECUTE_FASTER ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL);
#define printM... | ALGO | 0.999953 | 3.091775 |
1bc45ab8-a90e-4782-9010-20d4eeb55723 | ishandutta2007/codeforces | mofk/normal/700/B.cpp | #include <bits/stdc++.h>
#define ff(i, a, b) for(int i = (a), _b = (b); i <= _b; i++)
#define fb(i, a, b) for(int i = (a), _b = (b); i >= _b; i--)
#define pb push_back
typedef long long ll;
using namespace std;
typedef vector <int> vi;
int N, K;
bool a[200005];
vi adj[200005];
int sz[200005];
int dad[200005];
int roo... | ALGO | 0.999844 | 4.266363 |
48ccb1e4-5755-4fd2-864f-32b81c7ea5a9 | dhanashreeg368/DSA-Practice-Questions | 113-path-sum-ii/113-path-sum-ii.cpp | /**
* Definition for a binary tree node.
* struct TreeNode {
* int val;
* TreeNode *left;
* TreeNode *right;
* TreeNode() : val(0), left(nullptr), right(nullptr) {}
* TreeNode(int x) : val(x), left(nullptr), right(nullptr) {}
* TreeNode(int x, TreeNode *left, TreeNode *right) : val(x), l... | ALGO | 0.999957 | 6.263045 |
7800bb85-1f7e-4d98-9da8-1f4954b43b73 | GuacheSuede/MSSubmission1234567890 | submission/macd/boost_1_69_0/libs/multiprecision/doc/numeric_limits_qbk.cpp | // Program to list all numeric_limits items for any type to a file in Quickbook format.
// C standard http://www.open-std.org/jtc1/sc22/wg11/docs/n507.pdf
// SC22/WG11 N507 DRAFT INTERNATIONAL ISO/IEC STANDARD WD 10967-1
// Information technology Language independent arithmetic Part 1: Integer and Floating point arith... | TOOL | 0.887012 | 6.162451 |
45c50ef9-3d43-4bd0-8467-5e135166445b | ukmaurya/cses | maths/commonDivisor.cpp | #include<bits/stdc++.h>
using namespace std;
int main(){
int n ;
cin>>n;
vector<int> arr(n);
const int maxNum = 1e6+1;
vector<int> freq(maxNum,0); // stores the freq of each element
for(int i=0;i<n;i++){
cin>>arr[i];
freq[arr[i]]++; // indexes are representing the element , we co... | ALGO | 0.999917 | 3.968258 |
b809c83d-a97e-4f28-8f09-35796b459d59 | adityaThakkar001/problem-solving | TLE/1000/1791D.cpp | #include<bits/stdc++.h>
using namespace std;
int main() {
int t;
cin >> t;
while(t--) {
int n;
cin >> n;
string s;
cin >> s;
vector<int> prefix(n+1, 0), suffix(n+1, 0);
set<char> seenPrefix, seenSuffix;
for (int i = 1; i <= n; i++) {
seenP... | ALGO | 0.999835 | 4.799587 |
2d7201cf-fa38-4152-97ea-357d6801784b | WiseCoder24/leetcode-questions | 23 Jan to 31 Jan 2023/QueueUsingStack.cpp | /*
232. Implement Queue using Stacks
Easy
Implement a first in first out (FIFO) queue using only two stacks. The implemented queue should support all the functions of a normal queue (push, peek, pop, and empty).
Implement the MyQueue class:
void push(int x) Pushes element x to the back of the queue.
int pop() Remove... | ALGO | 0.99908 | 6.474289 |
1318b5e1-11fb-424c-b56b-fc14335b442c | ToNoName/LeetCode | easy/88.merge.cpp | #include <iostream>
#include <algorithm>
#include <stack>
#include <vector>
#include <map>
using namespace std;
//effective : 1
//Solution 1 双指针
//class Solution {
//public:
// void merge(vector<int>& nums1, int m, vector<int>& nums2, int n) {
// int i = m-- + --n;
// while (n >= 0) {
// nums1[i--] = m >= 0 && nu... | ALGO | 0.99999 | 5.268304 |
adf546cd-5a00-48cb-b35a-31a00168c135 | developerjoao/Laboratorio-1 | LabQ2/src/jogo.cpp | // Alunos: João Victor Fernandes Cabral e Eric Andrade Siqueira
#include "jogo.h"
#include <iostream>
using namespace std;
Jogo::Jogo(){
}
Jogo::~Jogo(){
}
bool Jogo::getAcabou(){
return acabou;
}
//Define os jogadores e o valor limite.
void Jogo::adicionaJogador(){
int jogadores, valor;
string nomeJogador;... | ALGO | 0.977479 | 4.257779 |
e768e339-48d2-4da0-8bba-3cb328b8041d | ShivaanjayNarula/LeetCode | 2996) Smallest Missing Integer Greater Than Sequential Prefix Sum.cpp | class Solution {
public:
int missingInteger(vector<int>& nums) {
int n = nums.size();
int ans = nums[0];
for(int i = 1; i < n; i++)
{
if(nums[i-1] + 1 == nums[i])
{
ans += nums[i];
}
else
{
br... | ALGO | 0.999868 | 5.400958 |
50b0db39-087e-4ac4-babf-b066a78bccd5 | omarfarukof/CP_Contest | CodeForces/Round_993_Div_4/D_Harder_Problem.cpp | #include "bits/stdc++.h"
using namespace std;
void cout_arr(int* arr, int size){
for (int i = 0; i < size; i++) {
cout << arr[i] << " ";
}
}
void cin_arr(int* arr, int size){
for (int i = 0; i < size; i++) {
cin >> arr[i];
}
}
int main(){
int t;
cin >> t;
for (int test_no =... | ALGO | 0.999949 | 3.779728 |
d6520105-d937-4d1b-8e4b-186c535d84bd | JulioEmmmanuel/Data-Structures-and-Algorithms-Specialization | Data structures/1 Basic data structures/5 Max sliding window/max_sliding_window.cpp | #include <iostream>
#include <vector>
#include <deque>
using std::cin;
using std::cout;
using std::deque;
using std::max;
using std::vector;
struct num {
int value;
int idx;
};
deque<num> numdeq;
void addToDeque(int v, int i)
{
while (!numdeq.empty() && numdeq.back().value <= v)
{
numdeq.pop... | ALGO | 0.999979 | 4.000434 |
41e49350-ea7b-4407-b377-4d564513345c | knavoid/just-algorithm | programmers/C++/Level1/신고 결과 받기.cpp | #include <string>
#include <vector>
#include <unordered_map>
#include <set>
using namespace std;
vector<int> solution(vector<string> id_list, vector<string> report, int k) {
int N = id_list.size();
// 각 이용자의 id를 인덱스에 매핑
unordered_map<string, int> index;
for (int i = 0; i < N; i++)
index[id_li... | ALGO | 0.999619 | 5.665008 |
5b368d4e-31b3-476e-bc96-54b86bcc1338 | LuisAlbOR/Udemy | Python/recursos/opencv-4.x/3rdparty/carotene/src/sub.cpp | #include "common.hpp"
#include "vtransform.hpp"
namespace CAROTENE_NS {
#ifdef CAROTENE_NEON
namespace {
template <typename T, typename WT>
struct SubWrap
{
typedef T type;
void operator() (const typename internal::VecTraits<T>::vec128 & v_src0,
const typename internal::VecTraits<T>::v... | ALGO | 0.992674 | 6.165411 |
2986dea6-7b3a-435c-b4bc-166916183d1f | SiegfriedSchmidt/SPP | Вузак/Vuzak-C.cpp | //
// 14.02.2024
#include <bits/stdc++.h>
#include <iostream>
#include <map>
#include <vector>
#include <set>
using namespace std;
#define int long long
#define mp make_pair
const int MAXN = 2 * 1e5 + 1;
const int INF = 1e9 + 7;
signed main() {
cin.tie(nullptr);
ios_base::sync_with_stdio(false);
int ... | ALGO | 0.999715 | 3.788935 |
70a8cc5e-7f1e-4b34-8507-043f95dee082 | anlingbin/earthenterprise | earth_enterprise/src/common/khGetopt.cpp | #include "khGetopt.h"
#include <unistd.h>
#include <getopt.h>
#include <stdio.h>
#include <khstl.h>
#include "khSimpleException.h"
#include "khFileUtils.h"
// class - static
std::string khGetopt::ProgName = std::string();
std::string khGetopt::FullProgName = std::string();
// ****************************************... | TOOL | 0.900183 | 6.120046 |
634e14f4-b0f2-4cfa-a611-bf2f0d117f27 | gcp-vais-team1/lammps | src/npair_skip_size_off2on_oneside.cpp | // clang-format off
#include "npair_skip_size_off2on_oneside.h"
#include "atom.h"
#include "domain.h"
#include "error.h"
#include "my_page.h"
#include "neigh_list.h"
using namespace LAMMPS_NS;
/* ---------------------------------------------------------------------- */
template<int TRIM>
NPairSkipSizeOff2onOneside... | ALGO | 0.998822 | 6.226771 |
584ce8f9-3c1d-42d1-a980-c51fc6fd2d24 | kks227/BOJ | 11000/11047.cpp | #include <cstdio>
using namespace std;
int main(){
int N, K, cost[10], result = 0;
scanf("%d %d", &N, &K);
for(int i=0; i<N; i++)
scanf("%d", cost+i);
// 가장 큰 액수의 동전부터 최대한 사용
for(int i=N-1; i>=0; i--){
result += K/cost[i];
K %= cost[i];
}
printf("%d\n", result);
} | ALGO | 0.999658 | 3.392408 |
f410df96-9e59-4301-8bc9-332a279f8cd1 | hjiang13/LLMs-in-IR | POJ-104/43/1805.cpp | #include <iostream>
using namespace std;
int main()
{
int m,a,b,i,k;
cin >> "%d",&m);
for(a=3; a<=m/2; a=a+2)
{
b=m-a;
i=2;
k=2;
while(i<=a-1)
{
if(a%i==0)
break;
else
i=i+1;
}
while(k<=b-1)
{
if(b%k==0)
break;
else
{
if(k==b-1&&i==a)
cout << "%d %d\n",a,b); }
k=k+1;
}
}
} | ALGO | 0.999535 | 3.008136 |
742a013f-5369-4b16-8338-e718c072d822 | JonyFaker/Daily-Coding | offer_interview/src/004.cpp | /*
不修改数组找出重复的数字
在一个长度为n+1的数组里的所有数字都在1到n的范围内, 所以数组中至少有一个数字是重复的。
请找出数组中任意一个重复的数字, 但不能修改输入的数组
例如,如果输入长度为8的数组{2,3,5,4,3,2,6,7},那么对应的输出的数字是2或3。
*/
#include <iostream>
#include <stdlib.h>
#include <string>
class Solution {
public:
//时间O(n) 空间O(n)
int getDuplicate(const int* numbers, int length) {
if (numbers =... | ALGO | 0.995569 | 4.055503 |
e2876c06-8cca-4d8c-adb9-b0d59f7d134b | RobinSchmidt/RS-MET | Libraries/RobsJuceModules/rosic/legacy/MovedToRAPT/rosic_ModalSynthesizer.cpp | //#include <limits>
//#include "rosic_ModalSynthesizer.h"
//using namespace rosic;
//=================================================================================================
// class ModalFilter:
ModalFilter::ModalFilter()
{
g = 1.0;
b1 = a1 = a2 = 0.0;
reset();
}
void ModalFilter::setModalParameters... | ALGO | 0.985287 | 5.218855 |
11654c07-4cef-4c37-a39c-d7a6f523ccfe | mekyas/ProjectEuler | Largest_Plus_Sign.cpp | #include <vector>
#include <iostream>
using namespace std;
class Solution {
public:
int orderOfLargestPlusSign(int n, vector<vector<int> >& mines) {
int ans=0, l=0, r=0;
while(l<n){
for(r=l; r<n-ans; r++){
cout << l << " " << r << "\n";
int order = is_pl... | ALGO | 0.999789 | 4.949474 |
84f1c233-ae36-4c1a-a3bd-30d51b939c5b | srivastavaritik/DSA | 336-palindrome-pairs/336-palindrome-pairs.cpp | struct TrieNode {
TrieNode *next[26] = {};
int index = -1;
vector<int> palindromeIndexes;
};
class Solution {
TrieNode root; // Suffix trie
void add(string &s, int i) {
auto node = &root;
for (int j = s.size() - 1; j >= 0; --j) {
if (isPalindrome(s, 0, j)) node->palindro... | ALGO | 0.999966 | 6.437596 |
00d4bada-a03b-407c-ad67-d0e6e5968ce5 | hbcbh1999/FT.NO.FULL | example/example00.cpp | #include <vector>
#include <FronTier.h>
/* Function Declarations */
static void test_propagate(Front*);
static int rotation_vel(POINTER,Front*,POINT*,HYPER_SURF_ELEMENT*,
HYPER_SURF*,double*);
char *in_name,*restart_state_name,*restart_name,*out_name;
boolean RestartRun;
int RestartStep;
boo... | ALGO | 0.999837 | 6.190371 |
f2d4ed0a-b914-4f16-9ca4-0d4adc7f7e59 | saloxbro/FCPP-PROGRAMS | WEEK 6/dimofunc.cpp | #include <iostream>
using namespace std;
void increase(int row_size)
{
for (int row = 1; row<=row_size; row++)
{
for (int col=1;col<=row;col++)
{
cout<<"*";
}
cout<<endl;
}
}
void decrease(int row_size){
for(int row=row_size;row>=1;row--){
for(int col... | ALGO | 0.932874 | 3.564279 |
8a28b231-5832-4a6c-976b-147729d07276 | artap-framework/agrossuite | 3rdparty/pagmo2/src/utils/genetic_operators.cpp | // MINGW-specific warnings.
#if defined(__GNUC__) && defined(__MINGW32__)
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wsuggest-attribute=pure"
#endif
#include <random>
#include <string>
#include <utility>
#include <pagmo/exceptions.hpp>
#include <pagmo/problem.hpp>
#include <pagmo/rng.hpp>
#include <... | ALGO | 0.999958 | 6.681525 |
8897c637-6bbd-4b55-a5a8-b4ad369cf73d | HuaiYu-code/x2t-wasm | x2t-wasm/core/DesktopEditor/raster/JBig2/source/LeptonLib/dewarp.cpp | /*
* dewarp.c
*
* Create/destroy
* L_DEWARP *dewarpCreate()
* void dewarpDestroy()
*
* Build warp model
* l_int32 dewarpBuildModel()
* PTAA *pixGetTextlineCenters()
* PTA *pixGetMeanVerticals()
* PTAA ... | ALGO | 0.999877 | 3.455637 |
25e6fb7d-9d51-4f7f-9beb-d6e13c37bb48 | davidjacobo/Competencias | Codeforces/R304/C.cpp | #include <iostream>
#include <queue>
#define MAX_IT 1000000
using namespace std;
queue<int> qA;
queue<int> qB;
int main(){
int n;
int A, B, t;
cin>>n;
cin>>A;
for(int i=0;i<A;++i){
cin>>t;
qA.push(t);
}
cin>>B;
for(int i=0;i<B;++i){
cin>>t;
qB.push(t);
... | ALGO | 0.999826 | 3.477541 |
77c0f11d-724f-47bb-a0be-0eabd62c51b7 | Viswa-teja-pathala/Geeks_for_geeks_Problems | Difficulty: Hard/Chocolates Pickup/chocolates-pickup.cpp | //{ Driver Code Starts
#include <bits/stdc++.h>
using namespace std;
// } Driver Code Ends
class Solution {
public:
int allPaths(int i, int j1, int j2, int n, int m, vector<vector<int>> &grid, vector<vector<vector<int>>> &dp) {
if (j1 < 0 || j1 > m || j2 < 0 || j2 > m)
return -1e9;
... | ALGO | 0.999901 | 6.340891 |
8ae1a394-3560-4f7c-9ce1-9e309847a01d | ApoorvaSunkad/QueueQuestions | implementQueueusingLinkedList.cpp | #include<bits/stdc++.h>
using namespace std;
//Linked list - Node creation
class Node{
public:
int data;
Node* next;
Node(int val){
this->data = val;
this->next = nullptr;
}
};
//Creation of class Queue
class MyQueue{
public:
Node* front;
Node* rear;
MyQueue(){
... | ALGO | 0.999005 | 4.600705 |
9918d5e3-f2d6-4868-99ea-312bbe54d10f | mskoenz/cpp_template_examples | 09_proof/09_03_dynamic_polymorphism.cpp | // Author: Mario S. Könz <<EMAIL>>
// Date: 04.07.2013 21:01:59 EDT
// File: 09_03_dynamic_polymorphism.cpp
#include <iostream>
#include <vector>
#include <typeinfo>
#include <chrono>
class vector_concept {
public:
typedef int size_type;
virtual void * operator[](size_type const & pos) = 0;
virtual... | TOOL | 0.896732 | 6.224661 |
00ef0daa-7cc8-4886-a7c3-11c2d25e509f | Ayuphys789/competitive_programming | atcoder/abc/abc218/f.cpp | /**
* Author: Ayuphys
* Problem Number: abc218-f
* Title: Blocked Roads
* Link to the Problem: https://atcoder.jp/contests/abc218/tasks/abc218_f
* Link to the Submission: https://atcoder.jp/contests/abc218/submissions/65628154
* Difficulty: 1753
*/
#include "/home/ayuphys789/competitive_programming/template/tem... | ALGO | 0.999948 | 5.056231 |
46519a22-3a36-4d1d-acf2-f8fc25d8f2f7 | gjc13/LogicConverter | LogicConverter/LogicExpression.cpp | #include "LogicExpression.h"
using namespace std;
map<char,int> LogicExpression::variableToInt;
map<int,char> LogicExpression::intToVariable;
std::set<char> LogicExpression::variables;
int LogicExpression::numVariable=0;
void LogicExpression::SubmitVariable(char c)
{
if(variables.find(c)==variables.end())
{
numV... | ALGO | 0.944322 | 4.11957 |
64ba4b45-88c9-4b22-8ca5-cca17f8f7ace | Overstars/Practice | OJ/HDOJ题目/HDOJ2899Strange fuction(牛顿迭代法解方程).cpp | //#pragma comment(linker, "/STACK:102400000,102400000")
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<int,int>pii;
//#define int ll
#define ff first
#define ss second
#define debug(x) std:: cerr << #x << " = " << x << std::endl;
const int maxn=2e5+10,inf=0x3f3f3f3f,mod=1000000007;
cons... | ALGO | 0.999887 | 3.499147 |
493f21e0-f721-406f-b9b2-6d584f61b5b3 | christric1/OpenGL-Lab | Final_Project/Final_Project/include/glm-master/test/core/core_func_integer_find_lsb.cpp | #include <glm/glm.hpp>
#include <cstdio>
#include <cstdlib> //To define "exit", req'd by XLC.
#include <ctime>
int nlz(unsigned x)
{
int pop(unsigned x);
x = x | (x >> 1);
x = x | (x >> 2);
x = x | (x >> 4);
x = x | (x >> 8);
x = x | (x >>16);
return pop(~x);
}
int pop(unsigned x)
{
x = x - ((x >> 1) & 0... | ALGO | 0.996659 | 4.794778 |
8e6cdf32-551d-444b-ab9a-123c46c574c7 | jnava1612/Teambook-Sindicato-de-Transporte-2880 | DP/BrokenProfile.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 <class T>
using ordered_set = tree<T, null_type, less<T>, rb_tree_tag, tree_order_statistics_node_update>;
#define PI acos(-1)
#define pb push_back
#define i... | ALGO | 0.999844 | 4.466315 |
ef03da81-c84d-4bd3-ae44-0e65112cbf77 | vikasjackar/cpp_programs_-codechef- | CFMM.cpp | #include <iostream>
#include <bits/stdc++.h>
using namespace std;
void meal(){
int n;
cin>>n;
unordered_map<char,int>m;
for(int i=0;i<n;++i){
string s;
cin>>s;
for(char j:s){
m[j]++;
}
}
cout<<min({m['c']/2,m['o'],m['d'],m['e']... | ALGO | 0.9978 | 4.640103 |
3b1a5b41-fd40-45e7-b46f-5f847fc456bd | fermino/OneWireRotary | src/OneWireRotary.cpp | #include "OneWireRotary.h"
/*
* The below state table has, for each state (row), the new state
* to set based on the next encoder output. From left to right in,
* the table, the encoder outputs are 00, 01, 10, 11, and the value
* in that position is the new state to set.
*/
#ifdef ROTARY_HALF_STEP
const unsig... | ALGO | 0.984151 | 7.089911 |
8bab2df1-7957-4830-9528-44492fbc3251 | masc-ucsc/livehd | pass/submatch/pass_submatch.cpp | #include "pass_submatch.hpp"
#include <format>
#include <iostream>
#include <queue>
#include <string>
#include "lgedgeiter.hpp"
#include "lgraph.hpp"
#include "node.hpp"
#include "node_pin.hpp"
#include "waterhash.hpp"
#include "woothash.hpp"
static Pass_plugin sample("pass_submatch", pass_submatch::setup);
void pa... | ALGO | 0.97786 | 4.649871 |
8ffa3084-bdc6-49ee-8d92-63666cd22186 | 113bommy/deepmind_codecontests_refine | cpp_source_filter_file/cpp_train_2770_5.cpp | #include <bits/stdc++.h>
using namespace std;
int n = 0, k, m, a;
pair<int, int> g[104];
pair<int, int> g_copy[104];
int aux;
void Copi() {
for (int i = 0; i < n; i++) g_copy[i] = g[i];
}
bool pair_comp(const pair<int, int> &p1, const pair<int, int> &p2) {
if (p1.first == p2.first) return p1.second < p2.second;
r... | ALGO | 0.999969 | 3.156609 |
d71f7da1-9cdf-4726-b938-708ef907c50e | raincross7/code-similarity | codes/train_code/problem272/problem272_198.cpp | #include <vector>
#include <algorithm>
#include <map>
using namespace std;
typedef long long i64;
typedef pair<i64,i64> P;
int Lower(vector<i64>& a, vector<int>& index ,int l,int r,i64 key)
{
while(r - l > 1)
{
int m = (l + r) / 2;
if(a[index[m]] >= key)
{
r = m;
}
... | ALGO | 0.999984 | 5.136691 |
d94be3b4-23e9-4c2a-bbec-fa431a62237b | YongHoonJJo/BOJ | 2579.cpp | #include <stdio.h>
int n, a[301], d[301];
int Max(int x, int y)
{
return x > y ? x : y;
}
int go(int k)
{
int x, y;
if(d[k]) return d[k];
if(k < 1) return 0;
x = a[k-1] + go(k-3);
y = go(k-2);
return d[k] = Max(x, y) + a[k];
}
int main()
{
int i;
scanf("%d", &n);
for(i=1; i<=n; i++)
scanf("%d ", a+... | ALGO | 0.999977 | 3.532247 |
85190fea-6ac4-40f2-bced-14d824245dad | Kartik2301/Recurrence | algorithms/strivers_sheet/105_Height_of_a_Binary_Tree.cpp | /**
* Definition for a binary tree node.
* struct TreeNode {
* int val;
* TreeNode *left;
* TreeNode *right;
* TreeNode() : val(0), left(nullptr), right(nullptr) {}
* TreeNode(int x) : val(x), left(nullptr), right(nullptr) {}
* TreeNode(int x, TreeNode *left, TreeNode *right) : val(x), l... | ALGO | 0.9995 | 6.31746 |
7ac0dff5-ce9e-4bc2-ab56-5050d33def02 | anuragpratap05/DSA | RECURSION/Recursion_revision_2/class5/nQueenOptimized.cpp | #include <bits/stdc++.h>
using namespace std;
vector<int> row;
vector<int> col;
vector<int> diag;
vector<int> adiag;
bool isSafeToPlaceShadow(int r, int c, int m)
{
if (row[r] or col[c] or diag[m - 1 - (r - c)] or adiag[r + c])
{
return false;
}
return true;
}
int calls = 0;
int nQueenHelpe... | ALGO | 0.999609 | 5.311849 |
d475350c-a009-49d4-857b-0fda4a6969b3 | sarvex/leetcode-matlab | solution/2200-2299/2233.Maximum Product After K Increments/Solution.cpp | class Solution {
public:
int maximumProduct(vector<int>& nums, int k) {
int mod = 1e9 + 7;
make_heap(nums.begin(), nums.end(), greater<int>());
while (k--) {
pop_heap(nums.begin(), nums.end(), greater<int>());
++nums.back();
push_heap(nums.begin(), nums.en... | ALGO | 0.999994 | 5.892963 |
32e2b364-e257-4323-bf05-0cf3bfe7367e | hjiang13/LLMs-in-IR | POJ-104/6/3301.cpp | #include <iostream>
using namespace std;
int main()
{
int c[101][101];
int n,i,j,s,t;
cin>>n;
while(n--)
{
cin>>s>>t;
for(i=0; i<s; i++)
for(j=0; j<t; j++)
cin>>c[i][j];
int sum=0;
if(s==1)
for(i=0; i<t; i++)
sum=sum+c[0][t];
else if(t==1)
for(i=0; i<s; i++)
sum=sum+c[i][0];
else
{
for(i=0; i<t; i++)
sum=sum+c[0][i]+c[... | ALGO | 0.999821 | 3.135464 |
70a5c6c2-e6ca-494c-aae8-c9f0fa2260df | ahnayef/Code-Practice | Codes/Algo/Lab/BFS.cpp | #include<bits/stdc++.h>
using namespace std;
int adjMatrix[100][100];
void bfs(int no_vertices, int start){
int visited[no_vertices];
queue<int>q;
for(int i=0;i<no_vertices;i++){
visited[i] =0;
}
q.push(start);
visited[start] = 1;
while(!q.empty())
{
int s = q.front();
cout<<s<<" ";
q.pop();
... | ALGO | 0.999953 | 4.497134 |
70bb3453-51d2-4cf4-b765-60d29b7760b4 | mabiju/b2cpp | Y_Array/m_array_multidimensional_transpose_of_a_matrix.cpp | #include <iostream>
using namespace std;
int main()
{
int a[10][10], transpose[10][10], row, column;
cout << "Enter rows of matrix: ";
cin >> row;
cout << "Enter columns of matrix: ";
cin >> column;
cout << "\nEnter elements of matrix: " << endl;
// Storing matrix elements
for (int i... | ALGO | 0.99899 | 3.86863 |
f1c7b8ff-6e7c-4471-92a7-7b2124659f9a | pepepper/llvm-temple | libcxx/test/libcxx/fuzzing/unique.pass.cpp | // UNSUPPORTED: c++03, c++11
#include <algorithm>
#include <cstddef>
#include <cstdint>
#include <vector>
#include "fuzz.h"
extern "C" int LLVMFuzzerTestOneInput(const std::uint8_t *data, std::size_t size) {
std::vector<std::uint8_t> working(data, data + size);
std::sort(working.begin(), working.end());
... | TEST | 0.975756 | 6.065795 |
62326cad-c733-41c3-9432-0f5e427c65b7 | Macw07/Macw07 | Algorithm/Depth-First-Search/T185602-礼物.cpp | #include <iostream>
#include <algorithm>
using namespace std;
int n, m, ans;
int arr[105][105];
int dp[105][105];
int dx[] = {0, 1, -1, 0};
int dy[] = {1, 0, 0, -1};
void dfs(int x, int y, int sum){
if (x > n || y > n) return ;
if (x == n && y == m) {
ans = max(ans, sum);
return ;
}
d... | ALGO | 0.999923 | 3.801766 |
62b65881-c119-4ed8-97cf-72120f736af5 | ezhou2008/algorithm-basic | cpp1/JZ-215_254-Drop-Eggs.cpp | /*Drop Eggs
Description
There is a building of n floors. If an egg drops from the k th floor or above,
it will break. If it's dropped from any floor below, it will not break.
You're given two eggs, Find k while minimize the number of drops for the worst case.
Return the number of drops in the worst case.
Clarificat... | ALGO | 0.999513 | 6.210041 |
be886cd9-54ad-4100-bb84-1feaf5c8f143 | KAISER1997/REBELLION-1 | CountingInversionBIT.cpp | #include <bits/stdc++.h>
using namespace std;
int sum(int bin[9999],int n)
{
int q=0;
while(n!=0)
{
q=q+bin[n];
n=n-(n&-n);
}
return(q);
}
void update(int bin[9999],int x,int size)
{
while(x<=size)
{
bin[x]+=1;
x=x+(x&-x);
}
}
int countt( int maxx, int arr[9999],int n)
{
int bin[9999]={0};
int r=0;
for(int u=n... | ALGO | 0.999953 | 3.697707 |
557b96ad-30a9-4b68-bc5e-51c804eac895 | sadramanouch/leetcode | 2657-find-the-prefix-common-array-of-two-arrays/2657-find-the-prefix-common-array-of-two-arrays.cpp | class Solution {
public:
vector<int> findThePrefixCommonArray(vector<int>& A, vector<int>& B) {
vector<int> prefixCommonArray;
set<int> seen_in_A, seen_in_B;
for (size_t i = 0; i < A.size(); ++i) {
seen_in_A.insert(A[i]);
seen_in_B.insert(B[i]);
set<int> c... | ALGO | 0.999814 | 6.440084 |
0c7de0b5-7f0e-4e38-a3ff-7d8fdb3c79ab | YoussefHassanDEV/Problem-Solving | B_Funny_Permutation.cpp | #include <iostream>
#include <algorithm>
using namespace std;
#define ll long long int
int main()
{
int t;
cin >> t;
while (t--)
{
int n;
cin >> n;
if (n == 3)
cout << -1 << "\n";
else
{
for (int i = 3; i <= n; i++)
cout << ... | ALGO | 0.999848 | 4.084562 |
21ca1130-8ed6-4649-a50f-7473c79e8c42 | srbcheema1/Algo_Ds | Competitive Programming Challenges/C:C++/Patterns/pattern6.cpp | #include <iostream>
using namespace std;
int main(){
int n;
cin >> n;
for( int i = 1; i <= n; i++ ){
for( int j = 1; j <= i; j++ ){
cout << i;
}
cout << endl;
}
return 0;
}
/*
5
1
22
333
4444
55555
*/
| ALGO | 0.999966 | 3.998063 |
46db4ab5-2ca0-486f-b920-7e696c29f24c | trbhakta/BhaktaTejash_48102 | Hmwrk/Assignment1/Gaddis_8thEd_Chpt2_Prob8_RestaurantBill/main.cpp | /*
File: main
Author: Tejash Bhakta
Created on August 29, 2016, 5:00 PM
Purpose: Calculate the subtotal and total sum of items with tax.
*/
//System Libraries
#include <iostream> //Input/Output objects
#include <iomanip> //Format Librabry
using namespace std; //Name-space used in the System Lib... | ALGO | 0.982835 | 4.148597 |
88131f87-d734-44d7-8dc1-8b8cb5cba34a | MrVBian/acm | 19年整理/4专题四 最短路练习/1 dij+prio ed POJ 2387 Til the Cows Come Home.cpp | #include<iostream>
#include<cstring>
#include<cstdio>
#include<algorithm>
#include<queue>
using namespace std;
const int maxn = 1e4;
const int inf = 0x3f3f3f3f;
struct node{
int to;
int w;
int next;
}e[maxn];
int head[maxn], cnt, n;
int d[maxn], vst[maxn];
void add(int u,int to,int w){
e[cnt].to = t... | ALGO | 0.999521 | 4.085934 |
db8d96f1-ca04-42d6-961c-f9fb296cd96e | anninahelmy/CG | assignment_9/src/main_terrain.cpp | #ifdef _WIN32
# include <windows.h>
# include <stdlib.h>
# include <errhandlingapi.h>
#endif
#include "render/ShaderViewer.h"
#include <vector>
#include <string>
#include <cmath>
#include "render/Mesh.h"
#include "render/MeshViewer.h"
// Render your GLSL fBm into a 2D array of height values.
// \param size resolut... | TOOL | 0.886562 | 6.562979 |
edd60fc9-e278-413a-90bd-00186ec3b8f8 | ranjeetsingh99/cpp | sort algorithm/buuble_sort.cpp | #include<iostream>
using namespace std;
int main() {
int n;
cout << "Enter the size of Array : ";
cin >> n;
int arr[n];
for ( int i = 0;i < n;i++ )
cin >> arr[i];
int counter = 0;
while ( ++counter < n )
for ( int j = 0;j < n - counter;j++ )
if ( arr[j] > arr[j... | ALGO | 0.999959 | 3.890375 |
fc6659f1-47fa-4845-a816-58ab60ca884f | ishandutta2007/codeforces | sohsoh/normal/1534/B.cpp | // Sohsoh84 O_o //
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<ll, ll> pll;
#define all(x) (x).begin(),(x).end()
#define X first
#define Y second
#define sep ' '
#define endl ... | ALGO | 0.999912 | 5.243364 |
66e4dce5-6175-4a0e-968f-4e03b532a96b | aashitsoni/Algorithms | Array_and_Strings/implementStrStr.cpp | /*
28. Implement strStr()
Easy
Implement strStr().
Return the index of the first occurrence of needle in haystack, or -1 if needle is not part of haystack.
Clarification:
What should we return when needle is an empty string? This is a great question to ask during an interview.
For the purpose of this problem, we w... | ALGO | 0.999267 | 5.41763 |
92b3ceb0-bf86-4075-857f-21ece67dbf02 | facebookresearch/beanmachine | src/beanmachine/graph/stepper/single_site/nmc_dirichlet_beta_single_site_stepping_method.cpp | #define _USE_MATH_DEFINES
#include <cmath>
#include <algorithm>
#include <random>
#include <string>
#include <vector>
#include "beanmachine/graph/distribution/distribution.h"
#include "beanmachine/graph/graph.h"
#include "beanmachine/graph/mh.h"
#include "beanmachine/graph/operator/stochasticop.h"
#include "beanmachi... | ALGO | 0.993287 | 7.276625 |
e1fe2e8e-9055-49ec-b20e-59aa8b494d72 | vremyavnikuda/codewars | c++/cpp.code/char/char_5.cpp | #include <iostream>
//
// Created by vremyavnikuda on 9/23/24.
//
int main() {
char strings[5][100] = {
{"Пончики - это просто бублики с посыпкой"}, {"Клубничный монстр"}, {"Тарталетки с брусникой"},
{"КРЕВЕТКИ ЗАХВАТЯТ МИР!"}, {"Крабонатор"}
};
for (char (&str)[100]: strings) {
std... | TOOL | 0.908171 | 3.356983 |
7daca6db-850e-40dd-9833-f60bbefe2627 | Aapng-cmd/my_polyctf_task | ppc/guess/main.cpp | #include <iostream>
#include <vector>
#include <cstdlib>
#include <ctime>
std::string FLAG = "flag_plug";
std::pair<int, std::vector<int>> get_random(std::vector<int>& array) {
int i = rand() % array.size();
int value = array[i];
array.erase(array.begin() + i);
return {value, array};
}
int game(int p... | ALGO | 0.99238 | 3.273265 |
373eafb9-2980-4c47-a726-128fdb55a43d | atul008/codechef | july 14/july_count_substring.cpp | #include <map>
#include <set>
#include <vector>
#include <list>
#include <cmath>
#include <cstring>
#include <string>
#include <sstream>
#include <iostream>
#include <algorithm>
#define first x
#define second y
#define sz(a) int((a).size())
#define all(c) (c).begin(),(c).end()
#define tr(c,i) for(typeof... | ALGO | 0.999696 | 3.902784 |
710d0100-8372-4a40-ae13-2bdfe7924b27 | a2bhijeet/DataStructures | Sorting/selectionSort.cpp | #include<iostream>
void swap(int *p, int *q)
{
int temp;
temp = *p;
*p = *q;
*q = temp;
}
void selectionSort(int ar[], int length)
{
for(int i = 0; i < length; i++)
{
int minIndex = i;
for(int j = i; j < length; j++)
{
if (ar[j] < ar[minIndex])
... | ALGO | 0.999895 | 4.657849 |
4b2bd415-64c3-46c9-86aa-7f11d4917129 | iliyian/codeforces.com | 1919/B.cpp | #include <bits/stdc++.h>
using namespace std;
void solve() {
int n;
cin >> n;
string str;
cin >> str;
str = '0' + str;
vector<int> s(n + 1);
for (int i = 1; i <= n; i++) {
s[i] = s[i - 1] + (str[i] == '+' ? 1 : -1);
}
cout << abs(s[n]) << '\n';
}
int main() {
ios::sync_with_stdio(false); cin.t... | ALGO | 0.999972 | 4.220778 |
2c61c74a-8085-4435-901f-5d8ac3656960 | 113bommy/deepmind_codecontests_refine | cpp_gold_filter_file/cpp_train_9022_4.cpp | #include <bits/stdc++.h>
using namespace std;
const int max_n = 4044, max_k = 77, mod = 998244353;
int mul(int x, int y) { return (1LL * x * y) % mod; }
int n[2], k, ans[max_n], used[max_n], sz[max_n];
int c[max_k][max_k], dp[2][max_n][max_k];
vector<int> G[2][max_n], g[max_n], all;
void calc_sz(int v, int p) {
all.p... | ALGO | 0.999917 | 4.682015 |
3140b552-5eb1-4a84-b29c-063af45e5199 | ishandutta2007/codeforces | yz6205/normal/685/C.cpp | #include <stdbool.h>
#include <stdio.h>
#include <stdlib.h>
#define N 100005
long long xi[N], yi[N], zi[N];
int n;
long long max(long long a, long long b)
{
return a > b ? a : b;
}
long long calc(long long x, long long y, long long z)
{
long long res = 0;
for (int i = 1; i <= n; ++i)
res = max(res, ... | ALGO | 0.999724 | 4.795704 |
2bdadf55-d68f-4e39-ac36-6857052ce55b | Saurav2120/Recursion_Advanced | Combination_Sum.cpp | #include<iostream>
#include<vector>
using namespace std;
void findCombination(int idx, vector<int> &arr,int target, vector<vector<int>> &ans , vector<int> &ds){
if(idx==arr.size()){
if(target==0){
ans.push_back(ds);
}
return;
}
if(arr[idx]<=target){
ds.push_back... | ALGO | 0.999918 | 5.767081 |
48dc7782-72b1-470f-b13f-d0b3bd1a3d86 | ROCm/firdev-llvm-project | llvm/lib/CodeGen/VirtRegMap.cpp | #include "llvm/CodeGen/VirtRegMap.h"
#include "LiveDebugVariables.h"
#include "llvm/ADT/SmallVector.h"
#include "llvm/ADT/Statistic.h"
#include "llvm/CodeGen/LiveInterval.h"
#include "llvm/CodeGen/LiveIntervals.h"
#include "llvm/CodeGen/LiveStacks.h"
#include "llvm/CodeGen/MachineBasicBlock.h"
#include "llvm/CodeGen/Ma... | TOOL | 0.948748 | 3.477767 |
2ef31d48-830e-49e8-85d3-007860c7aab1 | jeremiequesnel/Projet3D | Projet3D/project/third-party/assimp/code/OptimizeMeshes.cpp | /** @file OptimizeMeshes.cpp
* @brief Implementation of the aiProcess_OptimizeMeshes step
*/
#ifndef ASSIMP_BUILD_NO_OPTIMIZEMESHES_PROCESS
#include "OptimizeMeshes.h"
#include "ProcessHelper.h"
#include "SceneCombiner.h"
#include "Exceptional.h"
using namespace Assimp;
static const unsigned int NotSet = 0xff... | ALGO | 0.859236 | 7.073448 |
715d072f-7b22-462a-96ed-c384d2bf3749 | kammoh/flopoco | src/BitHeap/BitHeap.cpp |
#include "BitHeap.hpp"
#include "BitHeap/FirstFittingCompressionStrategy.hpp"
#include "BitHeap/ParandehAfsharCompressionStrategy.hpp"
#include "BitHeap/MaxEfficiencyCompressionStrategy.hpp"
#include "BitHeap/OptimalCompressionStrategy.hpp"
#include <algorithm>
namespace flopoco {
BitHeap::BitHeap(Operator* op_, uns... | ALGO | 0.954176 | 5.226243 |
bc54b844-1433-4289-b7dc-d26430f0ac83 | SunguckLee/MariaDB-PageCompression | storage/ndb/src/kernel/blocks/suma/Suma.cpp | #include <my_config.h>
#include "Suma.hpp"
#include <ndb_version.h>
#include <NdbTCP.h>
#include <Bitmask.hpp>
#include <SimpleProperties.hpp>
#include <signaldata/NodeFailRep.hpp>
#include <signaldata/ReadNodesConf.hpp>
#include <signaldata/ListTables.hpp>
#include <signaldata/GetTabInfo.hpp>
#include <signaldata/... | TOOL | 0.855279 | 5.629525 |
be0d38a5-bc91-4348-bb07-0bbe2f5afc50 | seminsim/study | leetcode/divide-two-integers/main.cpp |
#include <iostream>
#include <cstdlib>
#include <climits>
using namespace std;
int divide (int dividend, int divisor)
{
if (dividend == 0) return 0;
if (dividend == divisor) return 1;
if (divisor == 1) return dividend;
if (dividend == INT_MIN && divisor == -1) return INT_MAX;
if (divisor == -1) return -div... | ALGO | 0.998745 | 4.757054 |
144b9b4a-7fa9-40b4-8bd7-1dd6b6b3fa78 | NumanWali/C-Practice | cost_price_and_selling_price.cpp | #include <iostream>
using namespace std;
int main(){
int cp;
cout<<"enter the cost price: ";
cin>>cp;
int sp;
cout<<"enter the sell price: ";
cin>>sp;
if(sp>cp){
cout<<"profit is: "<<sp-cp;
}
else if(sp<cp){
cout<<"loss is: ";
cout<<cp-sp;
}
else
cout<<"no loss and no profi... | ALGO | 0.983399 | 3.432209 |
e4f5e149-07a7-4a44-9fe5-bdfe86f4d734 | PriyanshK09/Leetcode-Discord-Bot | solutions/is-array-a-preorder-of-some-binary-tree.cpp | // Time: O(n)
// Space: O(n)
// stack
class Solution {
public:
bool isPreorder(vector<vector<int>>& nodes) {
vector<int> stk = {nodes[0][0]};
for (int i = 1; i < size(nodes); ++i) {
while (!empty(stk) && stk.back() != nodes[i][1]) {
stk.pop_back();
}
... | ALGO | 0.999974 | 6.084306 |
9756031f-235c-40ea-9703-e82b278b197c | arlechann/atcoder | AtCoder/ABC048-ARC064/C.cpp | #include <algorithm>
#include <boost/optional.hpp>
#include <climits>
#include <cmath>
#include <cstdio>
#include <cstring>
#include <functional>
#include <iomanip>
#include <iostream>
#include <limits>
#include <list>
#include <map>
#include <numeric>
#include <queue>
#include <set>
#include <sstream>
#include <string... | ALGO | 0.999974 | 4.377169 |
82ea14f0-84cf-4ba5-ae96-455f804d210b | dshnightmare/LeetCodeC | src/TheSkylineProblem.cpp | #include <vector>
using namespace std;
class Solution{
public:
vector<pair<int, int>> getSkyline(vector<vector<int>>& buildings){
vector<pair<int, int>> ret;
if(buildings.size() == 0)
return ret;
vector<vector<int>> result = help(buildings, 0, buildings.size() - 1);
ret.emplace_back(make_pair(result[0][0],... | ALGO | 0.999937 | 5.906273 |
9d24f416-add4-4da7-be05-f16c523f9634 | TejasMishr/Codeforces_sol | E_Decode.cpp | // +########################################################################################+
#include<bits/stdc++.h>
using namespace std;
// Code Shortners
#define ub upper_bound
#define lb lower_bound
#define endl "\n"
#define ll long long
#define lli long long int
#define vi vector<int>
#define vc vector<char>
#defi... | ALGO | 0.999797 | 4.104027 |
ecc09758-122b-4e9b-ada3-7e06a3fd163a | CosmicTraveler/rA-E | src/common/md5calc.cpp | /***********************************************************
* md5 calculation algorithm
*
* The source code referred to the following URL.
* http://www.geocities.co.jp/SiliconValley-Oakland/8878/lab17/lab17.html
*
***********************************************************/
#include "md5calc.hpp"
#include <cst... | ALGO | 0.999197 | 5.71172 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.