uuid string | repo_name string | relative_path string | content string | category string | algo_rel_score float64 | quality_score float64 |
|---|---|---|---|---|---|---|
b6ebbc27-5b3d-47bd-8a0f-1a826d136c8b | Jannchie/simple-diffusion | extensions/forge_legacy_preprocessors/annotator/oneformer/detectron2/layers/csrc/box_iou_rotated/box_iou_rotated_cpu.cpp | namespace detectron2 {
template <typename T>
void box_iou_rotated_cpu_kernel(
const at::Tensor& boxes1,
const at::Tensor& boxes2,
at::Tensor& ious) {
auto num_boxes1 = boxes1.size(0);
auto num_boxes2 = boxes2.size(0);
for (int i = 0; i < num_boxes1; i++) {
for (int j = 0; j < num_boxes2; j++) {
... | ALGO | 0.98476 | 7.186255 |
eb1ea5e9-e4d1-4de2-90dc-4bdb6ee234f4 | mzain7/DataStructure | AVL_Tree/Main.cpp | #include <iostream>
#include "AVL_Tree.h"
int main(int argc, char const *argv[])
{
int arr[] = {3,4,5,6};
int size = sizeof(arr) / sizeof(arr[0]);
// std::cout << size << std::endl;
AVL_Tree tree(arr, sizeof(arr) / sizeof(arr[0]));
tree.print(tree.root);
/*tree.insert(55);
tree.insert(33);
... | ALGO | 0.990486 | 4.128623 |
44defc52-763c-4c5e-8e0c-4c38fb480d56 | imitrichev/OOP_2018 | oop9_5.cpp | #include <algorithm>
#include <iostream>
#include <vector>
#include <iterator>
int main()
{
std::vector<int> from_vector;
for (int i = 0; i < 10; i++) {
from_vector.push_back(i);
}
std::vector<int> to_vector(10,1);
std::copy(from_vector.begin(), from_vector.end(), to_vector.begin());
... | TOOL | 0.997201 | 3.329351 |
ebd42a40-5dd1-4359-a2aa-8f1e11c77108 | potataahhh/365-Days-Leetcode-Challenge | 206. Reverse Linked List/sol.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* reverseList... | ALGO | 0.999838 | 5.732032 |
bd7446ec-fccf-44d2-902d-cd5b5f08c792 | erosnick/ModernOpenGL | Thirdparty/tgen/src/tgen.cpp | /**
* TGen - Simple Tangent Generator
*
* 2016 by Max Limper, Fraunhofer IGD
*
* This code is public domain.
*
*/
#include <tgen.h>
#include <cmath>
// local utility definitions
namespace
{
const tgen::RealT DenomEps = 1e-10;
//-------------------------------------------------------------------------... | ALGO | 0.998262 | 5.034005 |
a9fa7a8a-2388-4f38-9ccc-eca37c640365 | mkoleva/butterfly | gsc-1.2/packages/+sp/+gmm/vag_norm_fast.cpp | #include "mex.h"
#include <float.h>
#include <memory.h>
#include <math.h>
#include "matrix.h"
#include <iostream>
#include <vector>
void displayDims( const char *name, const int *dims, int ndims ) {
std::cout << name << " is [ " << dims[ 0 ];
for( int i = 1; i < ndims; ++i )
std::cout << " x " << dims[ i ];
... | ALGO | 0.999154 | 4.56077 |
595d938d-2ac3-4ed9-a5bc-c1ff67b6e92e | flopp/aoc2024 | 02/main.cpp | #include <iostream>
#include <sstream>
#include <string>
#include <vector>
using namespace std;
typedef string S;
typedef int T;
typedef vector<T> Report;
Report parseReport(const S& s) {
Report res;
istringstream iss(s);
T i;
while (iss >> i) {
res.push_back(i);
}
return res;
}
bool... | ALGO | 0.998812 | 4.921814 |
facc465a-a59f-4621-b56e-1b1cbdddf0a6 | wistaria/alps | applications/dmrg/mps/framework/dmrg/models/alps/symm_handler_impl/model_2u1.cpp | #include "dmrg/models/alps/symm_handler.hpp"
#include "dmrg/block_matrix/symmetry/2u1.h"
// Symmetry dependent implementation
// TwoU1 Symmetry
template <>
TwoU1::charge state_to_charge<TwoU1>(alps::site_state<short> const & state, alps::SiteBasisDescriptor<short> const& b,
std::m... | ALGO | 0.942837 | 5.792222 |
e29be7ad-c6fb-4308-9756-9888ac116aed | DJMAXJOAA/TASK_C2 | TASK_C2/230529 1~10문자출력.cpp | #include <stdlib.h>
#include <iostream>
#include <cstring>
#include <string>
using namespace std;
int main()
{
int n = 0;
cout << " ڸ Է : ";
cin >> n;
if (n>0 && n<10)
{
for (int i = 1; i <= n; i++) // n ݺ
{
for (int j = n; j >= 1; j--)
{
if (j <= i)
{
cout << j;
}
else
{
... | ALGO | 0.999325 | 3.464332 |
707243be-911c-488b-809b-314ec125a1ed | StefanosChaliasos/test_libhatshuffle | src/test_lib.cpp | #include <string>
#include <iostream>
#include <sstream>
#include <libhatshuffle/mixnet.h>
int main(int argc, char *argv[])
{
if (argc < 2) {
cerr << "Input parameter missing!" << '\n';
return 1;
}
istringstream ss(argv[1]);
int n; //number of ciphertexts
if (!(ss >> n)) {
... | TOOL | 0.901471 | 4.50612 |
ba31506b-7540-4177-8fe1-7a002e970b0f | alexgryzlov/algo | segment-tree.cpp | /* Дан массив из целых чисел a1, a2, ..., an (индексация с 1!).
* Для каждого запроса [left, right] найдите такой подотрезок al, al+1, ..., ar этого массива,
* что сумма чисел al + al+1 + ... + ar является максимально возможной. Требуемое время ответа на запрос - O(log n).
*/
#include <iostream>
#include <vector>
#in... | ALGO | 0.99991 | 5.401303 |
7f6ecd17-2027-49d0-80db-f76e9e67f1c5 | yzzupgo/MFTCG | Data/abc136_b/shibanyan515/ac/14272856.cpp | #include <bits/stdc++.h>
#include <algorithm>
#define rep(i,n) for (int i = 0; i < (n); ++i)
using namespace std;
int main() {
int n;
cin >> n;
if (n < 10) {
cout << n;
}
else if(10 <= n && n < 100) {
cout << 9;
}
else if(100 <= n && n < 1000) {
cout << 9 + n % 100 + 100 * (n / 100 - 1) + 1;
}
else if(1000 <= n && n < ... | ALGO | 0.999618 | 4.637109 |
f255dff5-d605-4a35-9de3-691d80812ced | PragatheeshSOS/CPP-Practice | Greatest Of Two Number.cpp | // Greatest Of Two Number......................................................................
// APPROACH 1.........................................................................
#include<iostream>
using namespace std;
int main(){
int num1,num2;
cout<<"Enter Number 1: ";
cin>>num1;
cout<<"Enter Number 2: ";... | ALGO | 0.99787 | 4.366247 |
29e0ce31-9536-4b57-8843-6257f1c3d962 | 1bpm/csound-transforms | src/haar.cpp | #include <cstdlib>
#include <iostream>
#include <iomanip>
#include <cmath>
#include <ctime>
#include <plugin.h>
using namespace std;
#include "haar.hpp"
//****************************************************************************80
void haar_1d (csnd::Csound* csound, csnd::Vector<MYFLT> x)
{
int n = x.len();
... | ALGO | 0.989394 | 4.180387 |
7793a89a-3c46-4b1e-b886-a928ce7756bd | Oriburger/problem_solving_1w3solve | BOJ/13148_학교탐방하기.cpp | #include <iostream>
#include <vector>
#include <cmath>
#include <algorithm>
using namespace std;
struct Edge { int cost, u, v; };
bool CompEdge(const Edge &u1, const Edge &u2)
{
return u1.cost < u2.cost;
}
bool CompEdgeGreater(const Edge &u1, const Edge &u2)
{
return u1.cost > u2.cost;
}
struct DisjointSet
{
v... | ALGO | 0.999851 | 3.980391 |
c83b8d93-5bd1-459b-beb7-d139d065e703 | BhuveshDhiman/CPP-programs | nQueen.cpp | #include <iostream>
using namespace std;
bool isSafe(int **arr, int x, int y, int n)
{
for (int row = 0; row < x; row++)
{
if (arr[row][y] == 1)
{
return false;
}
}
int row = x, col = y;
while (row >= 0 && col >= 0)
{
if (arr[row][col] == 1)
... | ALGO | 0.999897 | 5.798763 |
8bf9edde-ec8b-42ce-b523-b281b7c62efd | alaminmiah4274/Data_Structure | linked_list_recap_practice/print_max_value.cpp | #include <bits/stdc++.h>
using namespace std;
class Node
{
public:
int value;
Node *next;
Node(int value)
{
this->value = value;
this->next = NULL;
}
};
void insert_at_tail(Node *&head, Node *&tail, int val)
{
Node *newNode = new Node(val);
if (head == NULL)
{
... | ALGO | 0.999828 | 4.720614 |
388d8a8e-261b-4c93-a15a-790ae84fb248 | lordcj/Daily-Coding-Problem | Problem7.cpp | #include<bits/stdc++.h>
using namespace std;
typedef long long lo;
int main(){
string s;
cin>>s;
vector<lo> dp(s.length()+1, 0);
lo p = 0;
for(lo i=0;i<s.length();i++){
p = p*10 + (s[i]-'0');
if(p%10==0){
if(p==10 || p==20){
if(i-2>=0)dp[i]+=dp[i-2];
... | ALGO | 0.999331 | 3.642004 |
0161a160-21f3-4a76-9fcd-f5d63e401b35 | dragon-web/second_stage_review | day_11_28/test.cpp | /*#include<stdio.h>
int cnt = 0;
int fib(int n)
{
cnt++;
if(n == 0)
{
return 1;
}
if(n == 1)
{
return 2;
}
else{
return fib(n-1)+fib(n-2);
}
}
int main()
{
fib(8);
printf("%d \n",cnt);
return 0;
}*/
#include<iostream>
#include<stack>
#include<string>
#include<vector>
usi... | ALGO | 0.999921 | 3.958797 |
5f87c7bd-538d-46a8-ac32-912f19b4c4e7 | Krishx17/CodeForcesSolutions | GreedyMarathon/HonestCoach.cpp | /*▄███████▀▀▀▀▀▀███████▄
░▐████▀▒▒писатель▒▀██████▄
░███▀▒▒▒▒Кришнеш▒▒▒▒▀█████
░▐██▒▒▒▒Чаурасия▒▒▒▒▒████▌
░▐█▌▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒████▌
░░█▒▄▀▀▀▀▀▄▒▒▄▀▀▀▀▀▄▒▐███▌
░░░▐░░░▄▄░░▌▐░░░▄▄░░▌▐███▌
░▄▀▌░░░▀▀░░▌▐░░░▀▀░░▌▒▀▒█▌
░▌▒▀▄░░░░▄▀▒▒▀▄░░░▄▀▒▒▄▀▒▌
░▀▄▐▒▀▀▀▀▒▒▒▒▒▒▀▀▀▒▒▒▒▒▒█
░░░▀▌▒▄██▄▄▄▄████▄▒▒▒▒█▀
░░░░▄█████████████ █▒▒▐▌
░░... | ALGO | 0.999671 | 5.014473 |
b277185a-96c9-49e4-ba12-5a47eb25fe8d | lonelam/SolveSet | control.cpp | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef long double ld;
const int inf = 0x3f3f3f3f;
const int maxn = 100000;
struct edge
{
int u,v;
ll cap, flow;
edge() {}
edge(int u, int v, ll cap) : u(u), v(v), cap(cap), flow(0) {}
};
ll cost[maxn];
struct dinic
{
int n;
v... | ALGO | 0.999881 | 3.905729 |
2b2cf7f5-aa54-469a-a710-b104feb39498 | Higherorbit/Leetcode-and-gfg-solutions | 1277-count-square-submatrices-with-all-ones/1277-count-square-submatrices-with-all-ones.cpp | class Solution {
public:
int countSquares(vector<vector<int>>& v) {
int n=v.size();
int m=v[0].size();
int dp[n+1][m+1];
for(int i=0;i<=n;i++){
for(int j=0;j<=m;j++){
if(i==0 or j==0){
dp[i][j]=0;
}
}
... | ALGO | 0.999684 | 6.0776 |
8fcd09bf-22ea-4964-8485-3772895e8fd2 | ishandutta2007/codeforces | fishcathu/normal/1513/C.cpp | #include<bits/stdc++.h>
#define ls i<<1
#define rs i<<1|1
#define fi first
#define se second
using namespace std;
typedef long long ll;
typedef pair<int,int> pii;
const int N=2E5+10;
const int inf=1<<30;
ll read()
{
ll a=0;
char b=1,c;
do if((c=getchar())==45)b=-1;while(c<48||c>57);
do a=(a<<3)+(a<<1)+(... | ALGO | 0.999903 | 4.097044 |
993e165c-f8e9-4818-987c-f4fda69ddb10 | mohitbabani/CP-Probelm-Solutions | Contests/codechef cook off/A_PizzaForces.cpp | #include<bits/stdc++.h>
using namespace std;
#define ll long long
#define ld long double
#define pb push_back
#define ull unsigned long long
#define inf LLONG_MAX
#define all(vec) vec.begin(),vec.end()
#define f(i,a,b) for(ll i=a;i<b;i++)
#define fr(i,b,a) for(ll i=b;i>=0;i--)
#define IOS ios_base::sync_with_stdio(fals... | ALGO | 0.999669 | 4.568688 |
8d347f5a-9de5-49cc-925c-c0855c3351b2 | dltpal07/algorithm | programmers/연습문제_x만큼간격이있는n개의숫자.cpp | //https://programmers.co.kr/learn/courses/30/lessons/12954
#include <iostream>
#include <string>
#include <vector>
using namespace std;
vector<long long> solution(int x, int n)
{
vector<long long> answer;
long long tmp = x;
for (int i = 0; i < n; i++)
{
answer.push_back(tmp);
tmp += x;
}
return answer;
}
... | ALGO | 0.999903 | 4.029916 |
7b165f9f-a0da-4e89-92ed-fd0f92f90cb4 | FahadHasan8386/oNline_problem_solving | cf1972B.cpp | ///In the name of Allah
#include <bits/stdc++.h>
using namespace std ;
void solve()
{
int n;
cin >> n;
string s;
cin >> s;
int cnt = 0;
for(int i = 0 ; i < n ;i++)
{
if(s[i] == 'U')
{
cnt++;
}
}
if(cnt % 2 != 0)
{
cout << "YES" << end... | ALGO | 0.999919 | 5.178576 |
aa182f1f-571a-446e-9326-55fa38c5ca92 | Altu-Bitu-2/Altu_Bitu | 트리-5월17일/1967.cpp | #include <iostream> //입출력 사용
#include <vector> //vector 사용
using namespace std; //std namespace 사용중
typedef pair<int, int> ci; //int, int형 pair 선언
ci dfs(int node, int parent, vector<vector<ci>>& graph) { //pair로 return할거임
int pos = node, len = 0; //지름을 구성하는 노드 중 하나, 그 노드까지의 거리
for (int i = 0; i < graph[node]... | ALGO | 0.999952 | 4.05904 |
cf107420-89df-4c3b-9c8a-5a1b96a5317e | Delciuxs/Competitive-Programming-Problems | dark_roads.cpp | //LINK to the Problem:
//http://www.spoj.com/problems/ULM09/
//Problem type: MST Kruskal
#include<iostream>
#include<vector>
#include<algorithm>
#include<map>
using namespace std;
struct city
{
int common_city;
int rank;
};
typedef city city;
vector<city> cities;
int num_disjoint_sets;
int find_common_city(int ... | ALGO | 0.999545 | 4.310393 |
7357dfa2-be17-4024-a900-d75f2b89769b | kiran-yadav-13/DSA | Arrays/Move0and1.cpp | # include <iostream>
using namespace std;
// Question : all the elements in the given array is either 0 or 1 .
// Move all the 0's to left and all 1's to right side of array
// aproach 1: count no of 1's and 0's and assign that no of 0 first in an array then that no of 1's
// aproach 2: apply sortting
// aproach 3: t... | ALGO | 0.999958 | 4.490972 |
00238b15-39ef-4968-af4d-86dfa2de0d5d | mcfi/MCFI | compiler/llvm-3.5.0.src/lib/Analysis/CFG.cpp | #include "llvm/Analysis/CFG.h"
#include "llvm/ADT/SmallSet.h"
#include "llvm/Analysis/LoopInfo.h"
#include "llvm/IR/Dominators.h"
using namespace llvm;
/// FindFunctionBackedges - Analyze the specified function to find all of the
/// loop backedges in the function and return them. This is a relatively cheap
/// (com... | ALGO | 0.999664 | 7.54521 |
a8c2a742-1da7-4b29-9960-76e9dab67084 | alexandraback/datacollection | solutions_5695413893988352_0/C++/lipsum/b_main_pp.cpp | #include <iostream>
#include <fstream>
#include <string>
#include <sstream>
#include <iomanip>
#include <map>
#include <set>
#include <vector>
#include <list>
#include <queue>
#include <stack>
#include <bitset>
#include <numeric>
#include <utility>
#include <functional>
#include <algorithm>
#include <complex>
#inclu... | ALGO | 0.99989 | 4.133861 |
260baf3f-d177-4b87-8aa8-99a3115f5c50 | nandana0527/sample | patternsquare.cpp | #include<iostream>
using namespace std;
int main()
{
int n,i,j;
cout<<"enter the limit";
cin>>n;
for(i=0;i<n;i++)
{
for(j=0;j<n;j++)
{
if(j==0||j==n-1||i==0||i==n-1)
{
cout<<"*"<<"\t";
}
else{
cout<<" \t";
... | ALGO | 0.999371 | 3.347222 |
f5384ac8-c878-4cab-b050-fc0efcc6192e | kishanrajput23/Wipro-Unix-CPP-Systems | Extra Mettl Questions/Solutions/30.cpp | /*
Question : Calculate sum of prime index values in an array
Example 1 : if array elements are
input1[] = {10, 20, 30, 40, 50, 60, 70, 80, 90, 100};
input2 = 10;
Output : 210
Explanation : The values of prime indexes are 30, 40, 60, 80 and their sum is 210
Example 2 : if array elements are
input1[] = {-1, -2, -3,... | ALGO | 0.999899 | 4.627428 |
1f1f83e5-e9f4-4a9d-82dc-4d4a3edc4936 | ViktorIukhlin/Examples-of-my-homework | Tasks from the Internet/array resizing increase reduction.cpp | #include <iostream>
using namespace std;
void FillArray(int* const arr, const int size)
{
for (int i = 0; i < size; i++)
arr[i] = rand() % 10;
}
void ShowArray(const int* const arr, const int size)
{
for (int i = 0; i < size; i++)
cout << arr[i] << "\t";
cout << endl;
}
void push_back(int*& arr, int& size, c... | ALGO | 0.987242 | 4.608067 |
ecd24003-c1d2-4e3c-9f7b-20d54826a48e | marco-tomSuden/MineSlicer | src/libigl/igl/orth.cpp | // Broken Implementation
IGL_INLINE void igl::orth(const Eigen::MatrixXd &A, Eigen::MatrixXd &Q)
{
//perform svd on A = U*S*V' (V is not computed and only the thin U is computed)
Eigen::JacobiSVD<Eigen::MatrixXd> svd(A, Eigen::ComputeThinU );
Eigen::MatrixXd U = svd.matrixU();
const Eigen::VectorXd S = svd.sin... | ALGO | 0.998414 | 4.278628 |
f6fed60e-7f4c-45cd-9443-a0a39a0140a3 | WeiHe999/dmoj_cpp_level_2 | level-2/07-30-2021/fix_free.cpp | #include <iostream>
#include <string>
using namespace std;
int check_fix(string str1, string str2)
{
if (str2.length() < str1.length())
{
if (str1.substr(0, str2.length()) == str2 || str1.substr(str1.length() - str2.length()) == str2)
{
return 1;
}
}
if (str1.length()... | ALGO | 0.9999 | 4.279285 |
6185484d-6101-411e-a2d4-11f0972988a8 | kikato2022/-Cpp-Primer-Plus-Example-Code | ch9/9.9_static.cpp | // static.cpp -- using a static local variable
#include<iostream>
// constants
const int ArSize = 10;
// function prototype
void strcount(const char * str);
int main(){
using namespace std;
char input[ArSize];
char next;
cout << "Enter a line:\n";
cin.get(input, ArSize);
while(cin){
... | ALGO | 0.926602 | 5.504237 |
f77e6b62-b49d-4054-afe8-4ae26297e988 | DanBeckerich/Cpp-Homework | Chapter4Exercise4/Chapter4Exercise4/Main.cpp | //************************************************
//Created By Daniel Beckerich
//9:44 PM 2/5/2017
//This program is the Solution to Exercise 4 in chapter 4
//The user may enter the name of a shape, and some information and the program will return calculations based on what was entered
//******************************... | ALGO | 0.967996 | 3.687594 |
bfd06176-be35-4b74-b46b-2a7463683c28 | sslab-gatech/Sense | src/systemc/tests/systemc/misc/cae_test/general/control/loop/for_exit/for_exit.cpp | /*****************************************************************************
for_exit.cpp --
Original Author: Rocco Jonack, Synopsys, Inc., 1999-07-29
*****************************************************************************/
/*****************************************************************************... | ALGO | 0.931267 | 3.440312 |
e8a8b928-0081-421c-82e6-9371514cd3ac | saidul-07/ProblemSolving | Codeforces/Codeforces Round 975 (Div. 2)/C.cpp | #include<bits/stdc++.h>
using namespace std;
#define fast() ios_base::sync_with_stdio(0); cin.tie(0);cout.tie(0);
#define ll long long int
#define ull unsigned long long int
#define vi vector<int>
#define vll vector<ll>
#define vs ... | ALGO | 0.999121 | 3.528145 |
9fd6f075-f5d3-4b56-9363-fdb140664097 | arash-ha/Cpp | Smallest Sufficient Team.cpp | /*
Smallest Sufficient Team
In a project, you have a list of required skills req_skills, and a list of people. The ith person people[i] contains a list of skills that the person has.
Consider a sufficient team: a set of people such that for every required skill in req_skills, there is at least one person in the team w... | ALGO | 0.999971 | 6.491728 |
f2b561c8-70a6-42e9-80ba-36ebdbe2e544 | jnvshubham7/All_Programming | All_Folder/DSA/Graph/Graph_SCC.cpp | // Kosaraju's algorithm to find strongly connected components in C++
#include <iostream>
#include <list>
#include <stack>
using namespace std;
class Graph {
int V;
list<int> *adj;
void fillOrder(int s, bool visitedV[], stack<int> &Stack);
void DFS(int s, bool visitedV[]);
public:
Graph(int V);
void a... | ALGO | 0.999929 | 6.072029 |
36ca7ae5-a199-4007-8398-717a44e511a1 | ishandutta2007/codeforces | igori/normal/1492/A.cpp | #include <bits/stdc++.h>
using namespace std;
signed main()
{
ios_base::sync_with_stdio(false);
cin.tie(0);
int t;
cin >> t;
while (t--)
{
long long p, a, b, c, x, y, z;
cin >> p >> a >> b >> c;
x = (p + a - 1) / a * a;
y = (p + b - 1) / b * b;
z = (p +... | ALGO | 0.999699 | 3.708939 |
b2c383b1-ce62-4f04-99d5-c43e0fdbf32c | DoHoangAnh2007/codeforces_master | B-set/1136B. Nastya Is Playing Computer Games.cpp | /***from dust i have come, dust i will be***/
#include<bits/stdc++.h>
typedef long long int ll;
typedef unsigned long long int ull;
#define dbg printf("in\n")
#define nl printf("\n")
#define N 200100
#define inf 1e6
#define sf(n) scanf("%d", &n)
#define sff(n,m) scanf("%d%d",&n,&m)
#define sfl(n) scanf("%I64d", &n)... | ALGO | 0.999813 | 3.388861 |
cd6c8091-88ba-4703-83c1-15f7a993f755 | sazzadhossain143/Codeforces_Problem_Solve | p-72_B. Perfect Number.cpp | #include<bits/stdc++.h>
#define ll long long int
#define pb push_back
#define maximum INT_MIN
#define minimum INT_MAX
#define fri for(int i=0; i<n; i++)
#define frj for(int j=0; j<m; j++)
#define vp vector<pair<int,int>>
#define srt(v) sort(v.begin(),v.end())
#define srt(s) sort(s.begin(),s.end())
#define rev(v) revers... | ALGO | 0.999483 | 3.700415 |
7200f587-4f34-4381-8707-17658f575ba4 | greatzero728/SCLI | Math/Simplex.cpp | #define _ make_pair
struct simplex { //0-based
//max{cx} subject to {ax <= b, x >= 0}
static const int nr = 101, nc = 101;
DO a[nr][nc], b[nr], c[nc], s[nr][nc], x[nc];
int I[nr], t[nc], n, m;
void rot(int x, int y) {
int i = -1, j; swap(I[x], t[y]);
while(i++ < n) if(i ^ x && fabs(s[i][y]) > eps)
for(j =... | ALGO | 0.999831 | 4.117056 |
02ad39fb-e214-40e8-b690-7b29fc01339a | Christin-Ts8a/hpmpc-toolkit | fluid_sharmir_cli.cpp | #include <iostream>
#include <string>
#include <sys/time.h>
#include <emp-tool/emp-tool.h>
#include <jsoncpp/json/json.h>
#include "io/fluid_sharmir_client.h"
#define DATA_NUM 10000000
using namespace std;
using namespace emp;
using namespace Json;
int main(int argc, const char* argv[]) {
int id = atoi(argv[1]);... | WEB | 0.942816 | 4.068142 |
8ba50a9c-d6df-435d-abcf-2dc171bab969 | Greeeder/Program | Eigen_Libraries/doc/examples/tut_matrix_coefficient_accessors.cpp | #include <iostream>
#include <Eigen/Dense>
using namespace Eigen;
int main()
{
MatrixXd m(2,2);
m(0,0) = 3;
m(1,0) = 2.5;
m(0,1) = -1;
m(1,1) = m(1,0) + m(0,1);
std::cout << "Here is the matrix m:\n" << m << std::endl;
VectorXd v(2);
v(0) = 4;
v(1) = v(0) - 1;
std::cout << "Here is the vector v:\n... | ALGO | 0.998864 | 3.671318 |
3ed5f9c4-2f21-41d8-9c0e-fa3ade564472 | pratiksaha/practice | array/checkPairDiffX.cpp | //given A[] of N nos and another no S, determines whether or not there exist two elements in A whose diff is exactly S
//Using features of C++ Standard (2011) Compile using g++ -std=c++11
#include<iostream>
#include<algorithm>
#include<unordered_map>
using namespace std;
void checkPairDiffX(int A[], int N, int S) {
... | ALGO | 0.999415 | 4.788901 |
ee2cf4eb-97c8-4b41-a7b3-9079a5c03538 | michaelehab/LeetCode-Dynamic-Programming-I | Day8/309.Best-Time-to-Buy-and-Sell-Stock-with-Cooldown.cpp | class Solution {
public:
int maxProfit(vector<int>& prices) {
int N = prices.size();
if (N <= 1) return 0;
int noStock = 0;
int inHand = -prices[0];
int Sell = 0;
for (int i = 1; i < N; i++) {
int tmp = inHand;
inHand = max(inHand, noStock - pr... | ALGO | 0.99978 | 6.049125 |
0daf77b4-57d5-433d-a8e8-478c96eef101 | SwapnanilHalder/CodingFiles | Language_Based/C++/Cpp_practice/largeintadd.cpp | #include<bits/stdc++.h>
#define SPEED ios_base::sync_with_stdio(false)
#define SPEED1 ios_base::sync_with_stdio(false);cin.tie(0);cout.tie(0)
#define endl '\n'
#define vi vector<int>
#define vi2d vector<vector<int>>
#define pb push_back
#define For(i,a,b) for(int i=a;i<b;i++)
#define ford(i,a,b) for(int i=a;i>=b;i--)
... | ALGO | 0.999919 | 4.008884 |
2c000c73-ee3a-45e9-ae7e-4df6d64e484f | sdorff/DataStructures | Lab9/Lab9/Graph.cpp | #include <iostream>
using namespace std;
//node struct
struct node {
int value;
struct node* next;
};
class Graph {
public:
int n;
struct node** vals;
//constructor
Graph(int n) {
this->n = n;
vals = new struct node* [n];
for (int i = 0; i < n; i++)
vals[i] = NULL;
}
//adds edge to graph
void addEd... | ALGO | 0.98947 | 3.957357 |
3eb4d568-4a59-44da-a973-a932f88edf79 | not-dharmik/C-C-Practice | fxn.cpp | #include <iostream>
using namespace std;
int factorial (int n){
int tot =1;
for(int i=n; i>=1; i--){
tot *= i;
}
return tot;
}
int main (){
int d;
cin>>d;
cout<<factorial(d);
return 0;
} | ALGO | 0.999902 | 4.561054 |
a63655bf-03e6-4092-9e27-3104a41832bd | asmjahid/OOP_CPP | madam binary.cpp | #include<iostream>
#include<iomanip>
using namespace std;
int main()
{
int i,s[100];
const int n=10;
cout<<"Element"<<setw(13)<<"value"<<endl;
for(int i=1;i<n;i++)
{
s[i]=1+2*i;
}
for(int i=1;i<n;i++)
{
cout<<setw(3)<<i<<setw(15)<<s[i]<<endl;
}
}
| ALGO | 0.973197 | 3.026726 |
f03da9b9-ca64-46e8-83f7-6f83f17c7433 | mbikas/ACM | uva.onlinejudge.org/671.cpp | #include<stdio.h>
#include<string.h>
#include<stdlib.h>
#define sz 16
typedef struct{
char word[sz];
}DIC;
DIC dic[10002],dic_sort[10002];
long n=0;
int comp(void const *A, void const *B);
int comp_char(void const *A, void const *B);
long int binsearch(char search[]);
void check_replacement(char str[]);
void main()... | ALGO | 0.999512 | 3.300811 |
40f643b3-6379-4a04-af01-44721644fbbf | Kurisu90/determine-if-a-number-is-prime | 判断一个数是不是素数/判断一个数是不是素数/判断一个数是不是素数.cpp | #include<stdio.h>
#include<math.h>
int GET() {
int a;
printf("Please enter a number:");
scanf_s("%d", &a);
return a;
}//读取输入的一个数
int main() {
int x = GET();//输入的数
int i=2;
while (x%i!=0) {
i++;
}
if (i == x) {
printf("Yes.");
}
else {
printf("No.");
}
}
| ALGO | 0.999912 | 3.185515 |
8614445b-9cdf-463f-bad2-888a5724377e | hardik302001/leetcode | problems/flatten_binary_tree_to_linked_list/solution.cpp | // O(n) , i guess
/*
class Solution {
public:
void flatten(TreeNode* root) {
if (!root) return;
flatten(root->left);
flatten(root->right);
TreeNode *tmp = root->right; // head of right side
root->right = root->left; // put flattened left on right side
... | ALGO | 0.999993 | 6.336025 |
9870ad1a-219c-415f-a4b3-7a219b000337 | giselaortt/Graphs | Edge.cpp | #include <stdio.h>
#include <iostream>
#include "Vertex.h"
#include "Edge.h"
using namespace std;
Edge::Edge( double value, int f, int s ){
this->value = value;
this->first = f;
this->second = s;
}
/*
Edge::Edge( int f, int s ){
this->first = f;
this->second = s;
this->value = f->getDistance( s );
}
*/
Edge::~E... | ALGO | 0.954073 | 3.628229 |
f046beed-e96a-4da5-995a-cca5247c1c0f | ishandutta2007/codeforces | hualian/normal/1610/F.cpp | #include<bits/stdc++.h>
#define pb push_back
#define ed (e[w][x].size()-1)
#define For(i,a,b) for(int i=a,i##end=b;i<=i##end;i++)
#define Rof(i,a,b) for(int i=a,i##end=b;i>=i##end;i--)
#define rep(i, a) for(int i=1,i##end=a;i<=i##end;i++)
using namespace std;
const int N=5e6+9;
//char buf[(1<<21)+5],*p1,*p2;
//#define... | ALGO | 0.999974 | 3.902954 |
d4d37551-934e-4fae-a0e3-164413ab79c0 | Sandip-Kanzariya/Codeforces | Daily Dose/236_A_Kefa_and_First_Steps.cpp | #include <bits/stdc++.h>
#include <iostream>
#include <vector>
#include <cmath>
#include <string>
#include <algorithm>
#include <map>
#include <set>
#include <numeric>
#include <iomanip>
using namespace std;
const int N = 1e7;
using I = int;
using SI = short int;
using LI = long int;
using LLI = long long int;
using ... | ALGO | 0.999933 | 4.490452 |
70954886-f699-4190-8211-da9fd90e72f5 | KUMARANKIT3012/Leetcode | Search Insert Position.cpp | class Solution {
public:
int searchInsert(vector<int>& nums, int target) {
int st = 0;
int end = nums.size()-1;
int n = nums.size();
while(st<=end){
int mid = st + (end-st)/2;
if(nums[mid] == target) return mid;
else if(nums[mid] < target){
... | ALGO | 0.999942 | 6.362179 |
f04d5077-4346-4b8a-a471-29a6be42fe66 | Nainagarg19/Codes | Binary Search/Aggressive Cows .cpp | #include <bits/stdc++.h>
using namespace std;
bool ispossible(vector<int> &arr, int pos,int cow )
{
int cnt=1;
int p=arr[0];
for(int i=1;i<arr.size();i++)
{
if(arr[i]-p>=pos)
{
cnt++;
p=arr[i];
if(cnt==cow)
return true;
}
}
return false;
}
int main() {
int t;
cin>>t;
while(t--)
{
int n,c... | ALGO | 0.999996 | 3.949534 |
d4cd2478-ec18-43e3-af82-8333cdc281bf | A-AAAA-A/OOPLab_Tasks | LAB2/task4.cpp | #include<iostream>
#include<algorithm>
using namespace std;
void showStrings(string *array, int count) {
for(int i = 0; i < count; i++) {
cout << array[i] << endl;
}
}
int main() {
int numStrings;
cout << "Enter the number of strings you wish to input: ";
cin >> numStrings;
cin.ignore(... | ALGO | 0.998363 | 5.73679 |
445f424c-7eff-4bf3-a80f-ebf781e84ef1 | AgusNazer/c- | Cpp /clasesViernes/ejercicioClase_Dowhile.cpp | #include <iostream>
using namespace std;
/*
dado una lista de numero positivos
q finaliza con cero mostra:
1- cuantos de ellos son pares
------------------------
! WHILE
! Con while la variable que va en la condicion, siempre se debe inicializar
! antes del while y siempre se debe modificar dentro del while
! DO W... | ALGO | 0.999671 | 3.873832 |
cae9bec2-f5d3-448e-973c-eddd63c0e34c | travp624/frameworks_base | media/libstagefright/codecs/amrnb/common/src/lsp.cpp | /*
Pathname: ./audio/gsm-amr/c/src/lsp.c
Functions:
------------------------------------------------------------------------------
REVISION HISTORY
Description: Updated template used to PV coding template.
Changed to accept the pOverflow flag for EPOC compatibility.
Description: Per review comments, added pOve... | ALGO | 0.896674 | 3.848159 |
564d244f-79de-47c8-bfc4-d7a0f7a93d2a | ishandutta2007/codeforces | shayan.p/normal/1387/C.cpp | // hello darkness my old friend, I've come to talk with you again
#include<bits/stdc++.h>
#define F first
#define S second
#define PB push_back
#define sz(s) int((s).size())
#define bit(n,k) (((n)>>(k))&1)
using namespace std;
typedef unsigned long long ll;
typedef pair<int,int> pii;
const int maxn = 210, MAX = 55... | ALGO | 0.999981 | 3.584838 |
2a49df59-efbe-4691-a090-bd2d5fdf375e | Cherrytree56567/Zinc | AVEngine/include/cryptopp/gost.cpp | #include "pch.h"
#include "gost.h"
#include "misc.h"
NAMESPACE_BEGIN(CryptoPP)
// these are the S-boxes given in Applied Cryptography 2nd Ed., p. 333
const byte GOST::Base::sBox[8][16]={
{4, 10, 9, 2, 13, 8, 0, 14, 6, 11, 1, 12, 7, 15, 5, 3},
{14, 11, 4, 12, 6, 13, 15, 10, 2, 3, 8, 1, 0, 7, 5, 9},
{5, 8, 1, 13, 10... | ALGO | 0.999509 | 7.484592 |
4199eba4-e6f3-48dd-9ee7-5e7fb882ac36 | C5Hwang/Online-Judge-Solutions | JZOJ/JZOJ5702.cpp | #include <stdio.h>
#include <stdlib.h>
#define ll long long
#define DEBUG printf("Passing [%s] in Line %d\n" , __FUNCTION__ , __LINE__) ;
const int MAX_N = 1e5 + 10 , MAX_K = 10 + 5 , mod = (119 << 23) + 1 ;
struct Link {
int num ;
Link *next ;
}list[MAX_N << 1] ;
Link *head[MAX_N] ;
int n , m , k , cur , C[MAX_K... | ALGO | 0.999855 | 4.435603 |
d999cbe4-9be8-43ea-84e7-8f5b476589ad | chenlu11/ETH-Algorithms-Lab---AS16 | week2/boats2.cpp | // Result: correct
#include <iostream>
#include <queue>
using namespace std;
struct Boat
{
int length;
int ring_pos;
int min_end;
Boat(int length, int ring_pos): length(length), ring_pos(ring_pos), min_end(ring_pos) {}
};
class CompareBoat
{
public:
bool operator()(Boat& x, Boat& y)
{
if... | ALGO | 0.999971 | 4.429349 |
e5b4b22d-997a-437e-9ebd-4201db0ac885 | WWWSven/Notes | dataStructure/PPT/Src/DS_2_StackAndQueue/DS_2_7_LiQueue1.cpp | //链式队列(带头节点版本)
#include <stdio.h>
#include <stdlib.h>
/**定义模块**/
typedef struct LinkNode {
int data;
struct LinkNode *next;
} LinkNode;
typedef struct {
LinkNode *front, *rear;
} LinkQueue;
//函数声明
void InitQueue(LinkQueue &Q);//初始化
bool EnQueue(LinkQueue &Q, int x);//入队操作
bool DeQueue(LinkQueue &Q, int... | ALGO | 0.990637 | 4.5423 |
ef6e1afc-4bc4-470e-8237-7b46a16ccb08 | OpenNuvoton/NUC970_Linux_Applications | qt-everywhere-opensource-src-4.8.5/src/gui/painting/qcssutil.cpp | #include "qcssutil_p.h"
#include "private/qcssparser_p.h"
#include "qpainter.h"
#include <qmath.h>
#ifndef QT_NO_CSSPARSER
QT_BEGIN_NAMESPACE
using namespace QCss;
static QPen qPenFromStyle(const QBrush& b, qreal width, BorderStyle s)
{
Qt::PenStyle ps = Qt::NoPen;
switch (s) {
case BorderStyle_Dotted:... | TOOL | 0.964527 | 6.572534 |
57d1b84a-f46c-49bc-8722-9b0d1e9b5b4e | juvereturn05151/cs580-GameAI | Rabin-Engine-main_20250115/Source/Student/Project_3/P3_TerrainAnalysis.cpp | #include <pch.h>
#include "Terrain/TerrainAnalysis.h"
#include "Terrain/MapMath.h"
#include "Agent/AStarAgent.h"
#include "Terrain/MapLayer.h"
#include "Projects/ProjectThree.h"
#include <iostream>
bool ProjectThree::implemented_fog_of_war() const // extra credit
{
return false;
}
float distance_to_closest_wall(... | ALGO | 0.997748 | 3.224123 |
42bbb90e-81b5-4e7a-9fad-324d3d26c5dc | Mjp777/C- | Shortest Subarray With OR at Least K II.cpp | class Solution {
public:
// Same as 3095. Shortest Subarray With OR at Least K I
int minimumSubarrayLength(vector<int>& nums, int k) {
constexpr int kMax = 50;
const int n = nums.size();
int ans = n + 1;
int ors = 0;
vector<int> count(kMax + 1);
for (int l = 0, r = 0; r < n; r++) {
o... | ALGO | 0.99995 | 6.499549 |
054701f2-628a-4179-a784-b19c0a9203ed | spaceKSRW/C- | arrays/3sum.cpp | #include <bits/stdc++.h>
using namespace std;
void three_sum(vector<int> &arr, int element)
{
for (int i = 0; i < arr.size(); i++)
{
for (int j = i + 1; j < arr.size(); j++)
{
int third = element - (arr[i] + arr[j]);
for (int k = j + 1; k < arr.size(); k++)
{
... | ALGO | 0.999866 | 5.16841 |
10fb8a8c-1117-4b4d-b117-e52578ee426f | prashantdhaka1/LeetCode-Solutions | C++/combination-sum-iv.cpp | // Time: O(nlogn + n * t), t is the value of target.
// Space: O(t)
class Solution {
public:
int combinationSum4(vector<int>& nums, int target) {
vector<uint32_t> dp(target + 1, 0);
dp[0] = 1;
sort(nums.begin(), nums.end());
for (int i = 1; i <= target; ++i) {
for (int... | ALGO | 0.999974 | 6.79212 |
b06fdbc5-1fab-43a5-a7bf-621e766159de | Rampatil2104/DSA | Lect 6/1_DecimalToBinary.cpp | #include <iostream>
#include<math.h>
using namespace std;
//Decimal to binary
int main(){
int n;
cin>>n;
int ans = 0;
int i =0;
while(n!=0){
int bit = n&1;
ans = (pow(10,i)*bit)+ans;
n = n>>1;
i++;
}
cout<<ans<<endl;
} | ALGO | 0.999969 | 4.840688 |
9e84b51b-9314-47cb-9e2f-fad242cb9f59 | thegamer1907/Code_Analysis | CodesNew/1162.cpp | //In The Name Of God
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
typedef vector<string> vs;
typedef pair<int, int> ii;
typedef pair<int, ii> iii;
typedef pair<double, double> dd;
typedef pair<dd, double> ddd;
typedef vector<int> vi;
typedef vector<vi> vvi;
typede... | ALGO | 0.999982 | 3.724365 |
c92374e4-c506-46f8-9610-b12df412668d | lee850220/UVA_Problems | 11520/11520.cpp | #include <iostream>
#include <algorithm>
using namespace std;
char check_table(char** table, int i, int j, int lines) {
char res = 'A';
char list[4];
fill(list, list+4, 126);
//up
if(j-1 >= 0) {
if(table[i][j-1] != '.') list[0] = table[i][j-1];
}
//down
if(j+1 < lines) {
... | ALGO | 0.999322 | 4.352584 |
18671491-6753-49d2-8958-8368457636a6 | proRamLOGO/Competitive_Programming | APRIL20A/1.cpp | /*
/-----------------------------------------------------------/
| |
| |
| AUTHOR: Achint Narang |
| ... | ALGO | 0.999936 | 4.802575 |
d352ddc1-3488-41f9-a6b5-67ea53dd5853 | Hima0X2/lightOJ | Integer Divisibility.cpp | /// BISMILLAHIR RAHMANIR RAHIM
#include<bits/stdc++.h>
using namespace std;
#define endl '\n'
#define optimize() ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);
#define fraction() cout.unsetf(ios::floatfield); cout.precision(10); cout.setf(ios::fixed,ios::floatfield);
long long int lcm(long long int a,long long b)... | ALGO | 0.999581 | 3.005611 |
6890d23e-d9dd-413e-b674-ad6d484fc6d1 | alamincse97/code-library | Starters 198 (Rated till 5 star)/make_cat.cpp | #include<bits/stdc++.h>
using namespace std;
int main()
{
ios_base::sync_with_stdio(false);
cin.tie(NULL);
/* freopen(input.txt, 'r', stdin);
freopen(output.txt, 'w', stdout); */
string s;
cin >> s;
sort(s.begin(), s.end());
if(s == "act"){
cout << "Yes" << endl;
}
e... | ALGO | 0.999793 | 3.141144 |
156371b7-3a4d-48ee-99ad-de082780b11b | jamperezmondragon/Competitive-Programming | cf/776-3/D.cpp | #include <bits/stdc++.h>
using namespace std;
using ll = long long;
using vi = vector<int>;
using vl = vector<ll>;
using pi = pair<int, int>;
using vii = vector<vector<int>>;
using mii = map<int, int>;
#define in(a) for (auto &e : a) cin >> e
#define sz(x) int((x).size())
#define all(a) a.begin(), a.end()
#define ptp p... | ALGO | 0.999971 | 3.751489 |
5963b4b2-3d35-4d11-8aa3-86cc2149a418 | aniketbidgar3/Cpp | Decimal_to_Hexadecimal.cpp | #include <bits/stdc++.h>
using namespace std;
string toHexadecimal(int n)
{
int p16 = 1;
string ans = "";
while (p16 <= n)
{
p16 *= 16;
}
p16 /= 16;
while (n > 0)
{
int last = n / p16;
n -= last * p16;
p16 /= 16;
if (last <= 9)
{
... | ALGO | 0.998755 | 5.803678 |
6f8309fd-e980-4b8e-a697-1f7f481d6cbf | melalonso/CompetitiveProgramming | COJ/Graph Theory/COJ_2724 - Avoid the Lakes/main.cpp | #include <bits/stdc++.h>
using namespace std;
// ACC
int mat[102][102];
int mi[] = {-1, 0, 1, 0};
int mj[] = {0, 1, 0, -1};
int n, m, k;
bool isValid(int i, int j) {
return i >= 0 && i < n && j >= 0 && j < m && mat[i][j] == 1;
}
int floodfill(int x, int y) {
int res = 1;
mat[x][y] = 0;
for(int i = ... | ALGO | 0.99962 | 4.456577 |
68f3fa53-c1f4-40ea-8fcd-9c51273b8bc0 | Maximizer03/Data-Structures-And-Algorithms | 128-longest-consecutive-sequence/128-longest-consecutive-sequence.cpp | class Solution {
public:
int longestConsecutive(vector<int>& nums) {
unordered_map<int,int>m;
int mx=0;
for(int i=0;i<nums.size();i++){
m[nums[i]]++;
}
for(int i=0;i<nums.size();i++){
int x=nums[i];
if(m.find(x+1)==m.end()){
... | ALGO | 0.999979 | 5.77651 |
2c9d410e-7f67-4135-ae9d-97e8f75a3fe4 | Akshitguptaa/cp | cp/2056A.cpp | //// AKSHIT - template ////
#include <bits/stdc++.h>
// #include<chrono>
#include<unordered_set>
using namespace std;
typedef long long int int64;
typedef unsigned long long int uint64;
#define int long long
#define endl "\n"
#define INF LLONG_MAX
#define MOD 1000000007
#define PI 3.1415926535897932384626433832795
#... | ALGO | 0.999884 | 5.070194 |
4eadd9ee-68ac-4f79-ac85-64ed387b3fd0 | eaglesunshine/Database-Testing-and-Stock-Forecasting | ProfitComp.cpp | #include "ProfitComp.h"
#include <iostream>
#include <iomanip>
using namespace::std;
//ģ庯stringͱתΪõֵ
template <class Type>
Type stringToNum(const string& str)
{
istringstream iss(str);
Type num;
iss >> num;
return num;
}
//жϴļǷΪ
bool ProfitComp::isNum(string str)
{
stringstream sin(str);
float d;
char c;
if ... | TOOL | 0.873254 | 3.912854 |
55158998-401c-40aa-ba21-f8804d0df6dc | thepranaygupta/Data-Structures-and-Algorithms | 02. Algorithms/09. Dynamic Programming/003. Best time to Buy and Sell Stock/code.cpp | class Solution {
public:
int maxProfit(vector<int>& prices) {
int cost = INT_MAX, sell=0;
for(int i:prices)
{
cost = min(cost,i);
sell = max(sell,i-cost) ;
}
return sell ;
}
}; | ALGO | 0.999643 | 6.080704 |
24e62b7b-4158-4346-abbc-fea70bb156ea | Kyaki101/Competitive-Programming | CF/2104/a.cpp | #include <bits/stdc++.h>
using namespace std;
#define SET(m, i) ((m) | (1ULL << (i)))
#define TEST(m, i) ((m) & (1ULL << (i)))
#define CLEAR(m, i) ((m) &~ (1ULL << (i)))
#define DEBUG(n) cout<<#n<<" = "<<n<<endl
#define MSET(arr, x, n) (memset(arr, x, (n)*sizeof(arr[0])))
#define ALL(v) (v).begin(), (v).end()
#define ... | ALGO | 0.999923 | 4.449034 |
a69b51a7-1318-4f30-a929-a92efbc579ea | igor-pavkov/honours-2024 | Code Examples/DiverseVul Filtered/Secure/928429c5c96a701bcbcafacb2421a82602b36915-19.cpp | static int write_tree(
git_oid *oid,
git_repository *repo,
git_index *index,
const char *dirname,
size_t start)
{
git_treebuilder *bld = NULL;
size_t i, entries = git_index_entrycount(index);
int error;
size_t dirname_len = strlen(dirname);
const git_tree_cache *cache;
cache = git_tree_cache_get(index->tree... | TOOL | 0.935776 | 6.554197 |
c9f2646d-aaee-4b1f-bb16-858c21463127 | raincross7/code-similarity | codes/train_code/problem006/problem006_350.cpp | #include <iostream>
using namespace std;
int h, w, ans;
char field[25][25];
int dx[4] = {-1, 0, 1, 0};
int dy[4] = {0, -1, 0, 1};
void dfs(int x, int y) {
if(field[y][x] == '.' && 0 <= x && x < w && 0 <= y && y < h) {
field[y][x] = '#';
ans++;
for(int i = 0; i < 4; i++) {
int nx = x+dx[i], ny = y... | ALGO | 0.999695 | 4.043195 |
4c8df11e-8424-494a-8f06-6fade99fee3e | ishandutta2007/codeforces | satashun/normal/603/B.cpp | #include <bits/stdc++.h>
using namespace std;
typedef pair<int, int> pii;
typedef long long ll;
typedef vector<int> vi;
#define pb push_back
#define eb emplace_back
#define mp make_pair
#define fi first
#define se second
#define rep(i,n) rep2(i,0,n)
#define rep2(i,m,n) for(int i=m;i<(n);i++)
#define ALL(c) (c).begin... | ALGO | 0.999974 | 4.298638 |
5f2c276f-98a8-41ec-8212-fcbbf233c221 | Kabir-Shah-29/HackerRank | Tutorials/10 Days of Statistics/Day 4/Geometric_Distribution_I.cpp | /*
Geometric Distribution I
link : https://www.hackerrank.com/challenges/s10-geometric-distribution-1/problem?isFullScreen=true
*/
#include <bits/stdc++.h>
using namespace std;
double geometricDistribution(int n, double p)
{
return pow(1-p, n-1) * p;
}
int main(void)
{
int a, b, n;
cin >> a >> b;
ci... | ALGO | 0.999001 | 4.025088 |
6737d436-8fe5-4344-929a-5c5ffa3260aa | WYK15/swift-Ollvm10 | llvm/lib/CodeGen/LiveVariables.cpp | #include "llvm/CodeGen/LiveVariables.h"
#include "llvm/ADT/DenseSet.h"
#include "llvm/ADT/DepthFirstIterator.h"
#include "llvm/ADT/STLExtras.h"
#include "llvm/ADT/SmallPtrSet.h"
#include "llvm/ADT/SmallSet.h"
#include "llvm/CodeGen/MachineInstr.h"
#include "llvm/CodeGen/MachineRegisterInfo.h"
#include "llvm/CodeGen/Pas... | ALGO | 0.992271 | 7.93669 |
45ee85ae-2115-4ec2-8807-6f18f74a9733 | sVyu/Algorithm | BAEKJOON/all_problems/10K/10093.cpp | #include <iostream>
using namespace std;
typedef long long ll;
int main(void){
ios::sync_with_stdio(0);
cin.tie(0);
ll a, b;
cin >> a >> b;
if(a > b) swap(a, b);
cout << max(b-1-a, (ll)0) << '\n';
for(ll n = (a+1); n < b; n++){
cout << n << ' ';
}
return 0;
} | ALGO | 0.999869 | 3.59221 |
5b599d4b-55f9-4d49-b27d-a4d22bc473fb | CharlieHu99/zju-data-structure-mooc | 编程题/02-线性结构4 Pop Sequence/PopSequence.cpp | #include <cstdio>
bool isPopSeq(int seq[], int n, int m) {
int stack[m];
int top = -1, head = 0;
for (int i = 1; i <= n; i++) {
if (top + 1 < m) {
stack[++top] = i;
} else {
return false;
}
while (stack[top] == seq[head]) {
top--;
head++;
}
}
if (head != n) {
return false;
}
return true;... | ALGO | 0.999966 | 3.653164 |
614cdbd5-9357-4f38-85ec-0e2a0175d13f | lokeshkumar80/gfg | 62_Pallindromic_substr.cpp | // // POTD Problem : Understand it and learn Dynamic Programming and solve it again
// class Solution {
// public:
// // Code 1 : it is brute force technique...it shows TLE bcz O(n^3);
// // bool isPalindrome(const string &s) {
// // int left = 0, right = s.length() - 1;
// // while (l... | ALGO | 0.999872 | 6.293802 |
ac24cb33-3fbd-44d6-adc8-2fb8ffe472a1 | Vivek-Gokhale/-CrackYourInternship | DP/Ones_and_Zeros.cpp | #include <bits/stdc++.h>
using namespace std;
class Solution {
public:
// int dp[600][101][101];
// int Helper(vector<pair<int, int>> &vec, int idx, int m, int n)
// {
// if(idx < 0)return 0;
// if(dp[idx][m][n] != -1)return dp[idx][m][n];
// int take = 0;
// int non_take = 0... | ALGO | 0.999919 | 5.471111 |
9716a16b-0f39-4611-899a-09bee782c7ba | jinjoh/NOOR | blender/extern/bullet2/src/BulletCollision/CollisionDispatch/btBoxBoxDetector.cpp | ///ODE box-box collision detection is adapted to work with Bullet
#include "btBoxBoxDetector.h"
#include "BulletCollision/CollisionShapes/btBoxShape.h"
#include <float.h>
#include <string.h>
btBoxBoxDetector::btBoxBoxDetector(btBoxShape* box1,btBoxShape* box2)
: m_box1(box1),
m_box2(box2)
{
}
// given two boxes (p... | ALGO | 0.999783 | 6.313211 |
e49eaf36-62d4-42b7-ae87-e78fe68913db | rishabhjain208/Assignment27 | Assignmet27_questions/ques1complex-op.cpp | #include<iostream>
using namespace std;
class Complex
{
private :
int a,b;
public:
void set(int x, int y)
{
a=x;
b=y;
}
void display()
{
cout<<"real : "<<a<<" img : "<<b<<endl;
}
Complex operator+(Complex c)
{
cout<<"\nAddition of given Complex num... | ALGO | 0.953673 | 3.904936 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.