uuid string | repo_name string | relative_path string | content string | category string | algo_rel_score float64 | quality_score float64 |
|---|---|---|---|---|---|---|
988bb3f6-c51b-4e83-a26a-72a830eefba4 | Patil-Ojas/CPP-Practice | 07_middle_ll.cpp | // non optimal way-> get length then go to half of length
Node *findMiddle(Node *head) {
Node* fast = head;
Node* slow = head;
while (fast->next!=NULL)
{
if (fast->next->next!=NULL)
{
slow = slow->next;
fast = fast->next->next;
}
else
{
... | ALGO | 0.999826 | 3.862054 |
d0be55e1-6474-4a88-bb37-0abb6922d861 | harshul21/Interview-problem | Pattern problem/Triangle with stars.cpp | /*
*
* *
* * *
* * * *
* * * * *
*/
#include<iostream>
using namespace std;
int main()
{
int row,col;
cin>>row>>col;
for(int i=1;i<=row;i++)
{
for(int j=1;j<=(5-i);j++)
{
cout<<" ";
}
for(int j=5-i+1;j<=col;j++)
{
cout<<"*"<<" ";
... | ALGO | 0.999155 | 3.897568 |
a1785ed8-324c-4a9c-9ec4-cd27ba690090 | aydinsimsek/Problem-Solving-Practices | HackerRank/Algorithms/Implementation/The_Time_in_Words.cpp | #include <bits/stdc++.h>
using namespace std;
string timeInWords(int h, int m) {
vector<string> num = {
"zero",
"one",
"two",
"three",
"four",
"five",
"six",
"seven",
"eight",
"nine",
"ten",
"eleven",
"twelve"... | ALGO | 0.998726 | 6.211199 |
c497dde2-2998-454b-9ab7-87039c1912a9 | dhruvrajput1/cppcodes | Array 2D/XOXO_pattern.cpp | #include<iostream>
using namespace std;
void pattern(char arr[100][100], int row, int col){
int sr = 0, er = row-1, sc = 0, ec = col-1;
char ch = 'X';
while(sr <= er and sc <= ec){
for(int i = sc; i <= ec; i++){
arr[sr][i] = ch;
}
sr++;
for(int j... | ALGO | 0.999175 | 3.800359 |
983a6ca0-332d-445f-89fa-1307396a8369 | Nerez83/ProjectEuler | Euler12.cpp | #include <iostream>
// give it like 10 mins, i'm too lazy to optimize it
int main()
{
unsigned long long int currentNum = 0;
unsigned int numberOfDivisors = 0;
unsigned int highestNoOfDivisors = 0;
int i = 0;
while (numberOfDivisors <= 500)
{
numberOfDivisors = 0;
currentNum ... | ALGO | 0.999833 | 5.453878 |
cac7c405-8ea1-4cab-a5aa-918ec3283726 | gurtej007/CODING | concat.cpp | #include<iostream>
#include<string>
#include<vector>
#include<map>
using namespace std;
void createmap(vector<string> v,map<string,int> &mp){
for(int i=0;i<v.size();i++){
mp[v[i]]=1;
}
}
void solve(vector<string> &v,map<string,int> &mp,vector<bool> &ans){
for(int i=0;i<v.size();i++){
string... | ALGO | 0.999887 | 4.550198 |
50a5f5ca-b0ee-4385-a55b-60a410cd0c06 | Alexxq64/ScFCPP13-08-02-binary-tree | ScFCPP13 08 02 binary tree/BinaryTree.cpp | #include "BinaryTree.h"
#include <string>
#include <iostream>
using namespace std;
//
BinaryTree::Node::Node(int d, Node* p) :
data(d), parent(p) {
leftChild = nullptr;
rightChild = nullptr;
}
//
BinaryTree::Node::~Node() {
//
if (rightChild != nullptr)
delete rightChild;
if (leftChild != nullptr)
delete ... | ALGO | 0.998739 | 4.254981 |
14775cf7-3478-4ae8-8a75-a8e3d3e1b664 | Zhaisan/ads | basicsOF_c++(not algo course)/extrainf/informatics/extra1_BD.cpp | //Степень
#include <iostream>
#include <cmath>
using namespace std;
int main(){
int n, i=1,s;
cin>>n;
s=1;
for (i=1; i<=n; ++i)
{
s=pow(2,i);
}
cout<<s<<endl;
} | ALGO | 0.999926 | 4.468506 |
31404d20-2b02-4ded-bf8a-f839df7fcb44 | raaihank/problem-solving | hackerrank/cpp/strings/strings.cpp | #include <iostream>
#include <string>
using namespace std;
int main() {
string s1, s2;
cin >> s1 >> s2;
cout << s1.size() << ' ' << s2.size() << endl;
cout << s1+s2 << endl;
swap(s1[0], s2[0]);
cout << s1 << ' ' << s2 << endl;
return 0;
}
| ALGO | 0.99902 | 3.564574 |
e5fe87be-9c36-4d31-8d23-a7fe2822bd19 | KunalBansal12/KUNALBANSAL12 | 1187-print-foobar-alternately/print-foobar-alternately.cpp | class FooBar {
private:
int n;
mutex m;
condition_variable cv;
int j;
public:
FooBar(int n) {
this->n = n;
j=0;
}
void foo(function<void()> printFoo) {
for (int i = 0; i < n; i++) {
unique_lock<mutex>lock(m);
cv.wait(lock,[&]{return !... | ALGO | 0.965854 | 5.525568 |
1b21608c-9ac5-42e6-96e8-43714dc7e4c8 | roshanrk44/Leetcode_Solutions | 1845-seat-reservation-manager/1845-seat-reservation-manager.cpp | class SeatManager {
public:
priority_queue<int,vector<int>,greater<int>> seats;
SeatManager(int n) {
for(int i=1;i<=n;i++)
{
seats.push(i);
}
}
int reserve() {
int a=seats.top();
seats.pop();
return a;
}
void unreserve(int seatNumber) {
seat... | ALGO | 0.999148 | 6.278421 |
e86a4ba5-6e14-4130-9297-0152eb2d8905 | uwf-fang/cop3014-examples | ch08-adv-array/array-params.cpp |
#include <iostream>
using namespace std;
const int ROWS = 2;
const int COLS = 5;
// pass local array
// data in stack
// either int literal or int constant in the bracket
// first dimension can be omitted
void matrixEleMultiply1(double matrix[2][5], int rows, int cols, double factor);
void matrixEleMultiply2(double ... | ALGO | 0.993012 | 4.329957 |
9bcad8a5-79a2-4763-b86a-724ee31a0a1b | mdarikrayhan/Reference-Paper | stress-tests/graph/LinkCutTree.cpp | #include "../utilities/template.h"
#include "../../content/graph/LinkCutTree.h"
#include "../../content/data-structures/UnionFind.h"
int main() {
srand(2);
LinkCut lczero(0);
rep(it,0,10000) {
int N = rand() % 20 + 1;
LinkCut lc(N);
UF uf(N);
vector<pii> edges;
rep(it2,0,1000) {
int v = (rand() >> 4) ... | TEST | 0.979085 | 4.474247 |
0270c550-d2ce-44f7-bb45-ef0b65b6f80e | ishandutta2007/codeforces | wwwwodddd/normal/900/B.cpp | #include <bits/stdc++.h>
using namespace std;
int main() {
int a, b, c;
cin >> a >> b >> c;
for (int i = 1; i <= 200000; i++) {
a *= 10;
if (a / b == c) {
printf("%d\n", i);
return 0;
}
a %= b;
}
printf("-1\n");
return 0;
} | ALGO | 0.999936 | 3.485723 |
ec8590bc-493d-4f62-8f4a-ad2b345ec029 | ishandutta2007/codeforces | demoralizer/normal/312/B.cpp | #include <bits/stdc++.h>
using namespace std;
#define pb push_back
int main(){
ios_base::sync_with_stdio(false);
int a,b,c,d;
cin>>a>>b>>c>>d;
double k=1.0,q=1.0*(b-a)*(d-c)/b/d;
k=1.0*a/b*1/(1-q);
cout<<k;
} | ALGO | 0.996843 | 3.093984 |
e071720f-12eb-400b-8cb8-377264c4c96e | ZiyouZoeZhang/Cpp | 2024/class/2-trees/10_05/dishwashing.cpp | //https://usaco.org/index.php?page=viewproblem2&cpid=922
//stack模拟
#include<bits/stdc++.h>
using namespace std;
int n,placed,base[100001];
stack<int> item[100001];
void setIO(string name = "") {
ios_base::sync_with_stdio(0); cin.tie(0);
if((int)(name).size()){
freopen((name+".in").c_str(), "r", stdin);... | ALGO | 0.999979 | 3.856708 |
d78318a7-96f4-4671-a8b2-9ba0bc8e9d35 | ishandutta2007/codeforces | yzyyylx/normal/908/G.cpp | #include<bits/stdc++.h>
#define ll long long
#define N 710
#define MN 700
#define M 1000000007
using namespace std;
ll n,ans,num[N],ten[N],qz[N],dp[N][10][N];
char str[N];
inline void Add(ll &u,ll v){u=(u+v)%M;}
ll dfs(ll now,ll jz,ll ct,bool lim,bool qd)
{
if(ct<0) return 0;
if(now>n) return !ct;
if(!lim... | ALGO | 0.999977 | 4.138901 |
baec869b-ea53-49b3-9829-cf79b20d5b74 | Akanksha038/Striver_Sheet_Question | 0875-koko-eating-bananas/0875-koko-eating-bananas.cpp | class Solution {
public:
long long SumTotalHr(vector<int>& piles, int hourly)
{
long long totalHr=0;
for(int i=0;i<piles.size();i++)
{
totalHr += ceil((double)piles[i] / (double)hourly);
}
return totalHr;
}
int minEatingSpeed(vecto... | ALGO | 0.999909 | 5.945747 |
1af720bc-4dfb-487a-9720-37e1b1247216 | Chopinsky/algo-problems | challenges/1499/1277_CountSquareSubmatricesAllOnes.cpp | '''
1277. Count Square Submatrices with All Ones
'''
class Solution {
public:
// the idea is that we can expand 1 more square to (i, j), from the min-side
// from (i-1, j), (i, j-1), and (i-1, j-1)
int countSquares(vector<vector<int>>& matrix) {
int m = matrix.size();
int n = matrix[0].size();
int cn... | ALGO | 0.999939 | 6.1847 |
eda9d867-aaf7-45eb-8867-4de57e19ea04 | 113bommy/deepmind_codecontests_refine | cpp_gold_filter_file/cpp_train_4195_18.cpp | #include <bits/stdc++.h>
using namespace std;
int main() {
int q;
cin >> q;
for (int i = 0; i < q; i++) {
long long a, b, c, d;
cin >> a >> b >> c >> d;
if (b * c < a)
cout << -1 << endl;
else {
long long k = a / (d * b);
cout << max(a * (k + 1ll) - d * b * k * (k + 1ll) / 2ll, a... | ALGO | 0.999609 | 3.614565 |
fb4010db-d234-47a5-9a85-e40379915819 | PaukIsUha/optimizing_formating_code | predictions/supersonic_predicted_submissions/Codenet/p01320/892067106/6.cpp | #include <algorithm>
#include <assert.h>
#include <bitset>
#include <climits>
#include <cmath>
#include <complex>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <ctime>
#include <deque>
#include <iomanip>
#include <iostream>
#include <iterator>
#include <list>
#include <map>
#include <queue>
#include ... | ALGO | 0.999788 | 4.04234 |
6a93d4dc-9eba-4af4-80a2-cd70a57525ce | fdmxfarhan/CPP_Projects | test-65 marge sort/main.cpp | #include <iostream>
#include <conio.h>
using namespace std;
void Marge(int a[],int low, int high, int mid)
{
int j=low,t;
for(int i=mid+1;i<=high;i++)
{
while(a[j] < a[i]) j++;
t=a[i];
if(j==i) break;
for(int k=i;k>j;k--)
a[k]=a[k-1];
a[j]=t;
}
}
voi... | ALGO | 0.999526 | 3.619155 |
041931d1-1543-4a5d-9dcf-8a7280afdec8 | Donkeyzhenbang/base | demo/algorithm/349.两个数组的交集.cpp | /*
* @lc app=leetcode.cn id=349 lang=cpp
*
* [349] 两个数组的交集
*/
#include<bits/stdc++.h>
using namespace std;
// @lc code=start
class Solution {
public:
vector<int> intersection(vector<int>& nums1, vector<int>& nums2) {
unordered_set<int> res;
unordered_set<int> nums1_set(nums1.begin(), nums1.end(... | ALGO | 0.999876 | 5.678034 |
e05833b6-9213-4006-b7da-83550c11395e | Jacopo4796/CPlusPlusMatrix | eser1StudProve.cpp | #include <iostream>
using namespace std;
int main()
{
int numAlunni = 4; // Numero degli alunni;
int numProve = 3; // Numero delle prove
int votazione[numAlunni][numProve]; // Dichiarazione della matrice votazione
for(int i = 0; i < numAlunni; i++) // Riempio la matrice delle votazione
{
f... | ALGO | 0.922377 | 4.279364 |
fa6b894f-9238-41df-8560-2d08301a4cca | KausBoss/CP-SubGrouped | LeetCode/85.cpp | class Solution {
public:
int maximalRectangle(vector<vector<char>>& matrix) {
int n = matrix.size();
if(n == 0){return 0;}
int m = matrix[0].size();
stack<int> s;
int height, ans=0;
vector<int> h(m, 0);
for(int i=0; i<n; i++){
int j;
for(j=0;... | ALGO | 0.999925 | 6.214061 |
a2f14840-1189-4562-af45-5122aafb70b6 | vikrantRajan/C-plus-plus-projects | Basics/17_alternative_nested_loop.cpp | #include <iostream>
#include <string>
using namespace std;
int main()
{
for (int i = 1, j = 1; i <= 10; i++) // amount of rows & length of column
{
cout.width(4);
cout << i * j;
// increase j everytime i = 10
if (i == 10)
{
j++;
i = 0;
... | ALGO | 0.994986 | 3.822615 |
bbe02e93-2260-4f9f-9817-bf6ca11d0144 | raincross7/code-similarity | codes/train_code/problem486/problem486_101.cpp | #include<bits/stdc++.h>
using namespace std;
using ll = long long;
ll powll(ll base,ll exp) { ll res = 1; while(exp>0){ if(exp & 1)res = res * base; base = base * base; exp >>= 1; } return res;}
ll mod_pow(ll base,ll exp, ll mod) { ll res = 1; while(exp>0){ if(exp & 1)res = res * base % mod; base = base * base % mod;... | ALGO | 0.999888 | 3.991585 |
582338ed-7454-44eb-ab39-f14d7c95f218 | vitorhugcunnha/Ativ_Cpp_Loop | Ativ2.cpp | #include <stdio.h>
#include <stdlib.h>
int main() {
int n1, n2;
printf("Digite dois numeros extremos o primeiro que seja menor que o segundo numero.\n");
scanf("%d %d", &n1, &n2);
if(n1<n2){
for(int i = n1; i <= n2; i++){
if(i % 2 == 0){
printf("%i \n", i);
}
};
}else {
for(int i = n2; i ... | ALGO | 0.996183 | 3.054064 |
f3110a77-35c2-4676-aad4-9b96bf7b3771 | sjnaj/.leetcode | 39.组合总和.cpp | /*
* @lc app=leetcode.cn id=39 lang=cpp
*
* [39] 组合总和
*/
// @lc code=start
class Solution
{
public:
vector<vector<int>> res;
vector<int> path;
void backtracing(int start, vector<int> &candidates, int sum, int target)
{
if (sum == target)
{
res.push_back(path);
... | ALGO | 0.999981 | 6.617349 |
490383cc-eee0-454d-847f-dda226a3dd08 | makwanakinjal/IMPCodingQuestions | sumoftwoarray.cpp | #include<iostream>
using namespace std;
int sumoftwoarr(int arr[],int arr2[],int s1,int s2){
int n = s1-1;
int m = s2-1;
int carry=0;
int sum;
}
int main(){
int arr[]={1,2,3,4};
int s1 = sizeof(arr)/arr[0];
int arr2[]={9,9};
int s2 = sizeof(arr2)/arr2[0];
} | ALGO | 0.997352 | 3.298967 |
2efa8d4f-8b47-4f1f-89d6-d87ef4c5f86a | ishandutta2007/codeforces | popovicirobert/normal/1427/D.cpp | #include <bits/stdc++.h>
#define lsb(x) (x & (-x))
#define ll long long
#define ull unsigned long long
#define Test(tt) cout << "Case #" << tt << ": "
using namespace std;
int main() {
#ifdef HOME
ifstream cin("A.in");
ofstream cout("A.out");
#endif
int i, n;
ios::sync_with_stdio(false);
cin.tie(0... | ALGO | 0.999963 | 3.177542 |
94f3f42c-ceaa-42d2-aebe-7c647a411c2f | Whituru/BAEKJOON_OnlineJudge | 15489.cpp | #include <iostream>
#include <vector>
#include <algorithm>
#include <string>
#include <map>
#include <array>
using namespace std;
int main() {
ios_base::sync_with_stdio(false);
cin.tie(NULL);
cout.tie(NULL);
int R, C, W;
cin >> R >> C >> W;
int dp[31][31];
fill(&dp[0][0], &dp[R+W][R+W-1], 1);
for(... | ALGO | 0.99946 | 3.940953 |
85a3114d-0da5-4fa5-a9d1-a10e92011a78 | Midhun0312/Mini-Project | DP/Triangle.cpp | int minimumTotal(vector<vector<int>> &triangle)
{
int n = triangle.size();
vector<int> prev(n, INT_MAX), curr(n, INT_MAX);
prev[0] = triangle[0][0];
for (int i = 1; i < n; ++i)
{
for (int j = 0; j <= i; ++j)
{
if (j - 1 >= 0)
curr[j] = min(prev[j], prev[j... | ALGO | 0.999948 | 6.073832 |
b683ac8f-1837-4cbf-a6f0-ef302dd19c5d | facebookresearch/beanmachine | src/beanmachine/graph/distribution/beta.cpp | #define _USE_MATH_DEFINES
#include <cmath>
#include "beanmachine/graph/distribution/beta.h"
#include "beanmachine/graph/util.h"
namespace beanmachine {
namespace distribution {
Beta::Beta(
graph::ValueType sample_type,
const std::vector<graph::Node*>& in_nodes)
: Distribution(graph::DistributionType::BET... | ALGO | 0.854094 | 7.210238 |
805cec60-6265-40d5-8d12-d7104e7d0b12 | Harsh971/100DaysOfDSA | Day 88/Modify Linked List-1_GFG/Modify_Linked_List-1.cpp | class Solution{
public:
struct Node* modifyTheList(struct Node *head)
{
Node * slow = head;
Node * fast = head;
while(fast != nullptr and fast -> next != nullptr){
fast = fast -> next -> next;
slow = slow -> next;
}
if(fast !=... | ALGO | 0.999969 | 4.76226 |
0a49191c-afd8-45ce-b184-711d8359389e | Krish203018/cpp | tricky programmes/cube_without_multiply.cpp | #include<iostream>
using namespace std;
int main()
{
int n;
cin>>n;
int sum=0;
for (int i = 0; i < n*n; i++)
{
sum=sum+n;
}
cout<<sum;
return 0;
} | ALGO | 0.999052 | 3.276967 |
9fd97d49-ddc8-4d9b-bf03-6ca7a7196ca8 | Xtra-Computing/ThunderGP | automation/parser.cpp |
#include <string>
#include <cctype>
#include <algorithm>
#include <cstdlib>
#include <iostream>
#include <fstream>
#include <sstream>
#include <stdarg.h>
#include <vector>
#include "para_check.h"
#include "parser.h"
#include "parser_debug.h"
#include "mem_interface.h"
#include "kernel_interface.h"
#include "customi... | TOOL | 0.880503 | 3.704608 |
ed44f660-c2da-48de-bf79-4970e8e27205 | grav/beatthebox | BeatTheBox/MFCC.cpp | #include "MFCC.h"
#include <stdio.h>
template <class T>
T* MFCC<T>::_H;
template <class T>
size_t MFCC<T>::_N;
template <class T>
size_t MFCC<T>::_M;
template <class T>
size_t MFCC<T>::_f_min;
template <class T>
size_t MFCC<T>::_f_max;
template <class T>
T MFCC<T>::_deltaPhi;
template <class T>
T MFCC<T>::_fs;... | ALGO | 0.984815 | 5.098811 |
ec0d2634-2003-4fb2-9a5d-727b61976670 | d2school/bhcpp | 03-feelling-1/3.14.3-HelloSTL_ScoreManageVer1_01/main.cpp | #include <iostream>
#include <list>
#include <vector>
#include <string>
using namespace std;
//ѧ
struct Student
{
unsigned int number; //ѧ
string name;
};
//ɼ
struct Score
{
unsigned int number; //ѧ
float mark; //
};
//ѧɼ
struct StudentScoreManager
{
public:
void InputStudents();
void InputScores(... | TOOL | 0.857624 | 4.177856 |
6badf048-5b14-4975-88f9-a44c224a8da9 | ankishb/Algorithm-DS-Problems | design/design_circular_queue_2.cpp |
class MyCircularDeque {
public:
deque<int> dq;
int capacity;
/** Initialize your data structure here. Set the size of the deque to be k. */
MyCircularDeque(int k) {
capacity = k;
}
/** Adds an item at the front of Deque. Return true if the operation is successful. */
bool inser... | ALGO | 0.999048 | 6.138716 |
63802117-86ad-4c95-a725-12b62b575a19 | tridibsamanta/GeeksforGeeks_Solutions | Practice/Consecutive_1's_not_allowed.cpp | /**
* Title : Consecutive 1's not allowed
* Author : Tridib Samanta
* Link : https://practice.geeksforgeeks.org/problems/consecutive-1s-not-allowed/0
**/
#include<bits/stdc++.h>
using namespace std;
#define MOD 1000000007
int getCount(int n) {
int a[n], b[n];
// Base Case
a[0] = 1;
b[0] =... | ALGO | 0.999959 | 5.048323 |
985a8590-ad0e-4417-b44d-ef80051b4c6f | chomuscleguy/CodingTest | C++/프로그래머스/1/178871. 달리기 경주/달리기 경주.cpp | #include <string>
#include <vector>
#include <unordered_map>
using namespace std;
vector<string> solution(vector<string> players, vector<string> callings)
{
unordered_map<string, int> indexMap;
for (int i = 0; i < players.size(); ++i)
indexMap[players[i]] = i;
for (string& name : callings)
... | ALGO | 0.999981 | 5.782449 |
88891ad0-23c5-45e1-a595-00ebb50804d1 | Devansh707/DSA-In-CPP | Stacks n Queues/main stackll temple.cpp | #include<iostream>
#include "stackll temple.cpp"
using namespace std;
int main(){
stack <int> s;
s.push(22);
s.push(23);
s.push(36);
s.push(94);
s.push(75);
s.display();
cout<<"size = "<<s.size()<<endl;
cout<<"popped element = "<<s.pop()<<endl;
cout<<"size = "<<s.size()<<endl;
cout<<"popped element = "<<s.po... | ALGO | 0.980496 | 4.373446 |
ece149f6-30af-4877-9d62-b9ccb92ead53 | LegendGraphics/FastMassSpring | 3rdParty/eigen/doc/snippets/Tutorial_solve_triangular.cpp | Matrix3f A;
Vector3f b;
A << 1,2,3, 0,5,6, 0,0,10;
b << 3, 3, 4;
cout << "Here is the matrix A:" << endl << A << endl;
cout << "Here is the vector b:" << endl << b << endl;
Vector3f x = A.triangularView<Upper>().solve(b);
cout << "The solution is:" << endl << x << endl;
| ALGO | 0.999815 | 3.055453 |
fbbdafac-00f1-4af6-abe6-3900b8484260 | 21pawarpr/Program05 | Tree.cpp | /**********************************************
* Tree Public
* Written by Prabhleen Pawar
**********************************************/
#define TREE_MAX 1024
#define TREE_ERR -1
#include <string>
#include <algorithm>
#include <iostream>
#include <string>
using namespace std;
#include "tree.h"
#include "Node.h"
... | ALGO | 0.999518 | 4.950169 |
4e421297-0d53-4caf-9b12-eba233a7e84f | NgaKezzy/flutter_flavorizr | 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 |
dcc4edf2-1b56-4b65-8feb-aa80abc0b554 | yuzuwxy/JiShi | he-wei-sde-liang-ge-shu-zi-lcof.cpp | #include <iostream>
#include<iostream>
#include<algorithm>
#include<cstdio>
#include<cmath>
#include<string>
#include<cstdlib>
#include<vector>
#include<map>
#include<queue>
#define MAXN (int)1e5
#define ll long long
using namespace std;
class Solution {
public:
vector<int> twoSum(vector<int>& nums, int target) ... | ALGO | 0.999941 | 4.726628 |
7193f2b7-dc74-4b14-aef7-fd7772935008 | shivamk2745/CP | oddQueries.cpp | // Online C++ compiler to run C++ program online
#include<bits/stdc++.h>
#include <iostream>
using namespace std;
int main() {
int t;
cin>>t;
while(t--){
long long n,q;
cin>>n>>q;
vector<long long> nums(n+1);
vector<long long> pre(n+1);
long long curr=0;
for(int i=1;i<=n;i++){
cin>>... | ALGO | 0.999925 | 3.703871 |
83c7c32b-0640-46e1-a6ab-eeeee8d310cc | Inspirvtion/Algorithme-IA | Experimentation/SourceCode/Opt.cpp | class Opt {
/*------------------------------------------------- Attributs -------------------------------------------------------------------------------*/
private: Graf g, gx;
char zadanie[DLGNAZWY]; // Tache
Gospodarstwo *gosp; // Reference sur un noeud... | ALGO | 0.998185 | 3.307719 |
21bf0752-ad88-4dc5-8a11-470e4824bfa0 | samsung-sm8650/android_hardware_qcom_display | sde-drm/drm_utils.cpp | #include <drm/drm_fourcc.h>
#include <drm_utils.h>
#include <regex>
#include <sstream>
#include <sstream>
#include <string>
#include <string>
#include <utility>
#include <vector>
using std::string;
using std::stringstream;
using std::regex;
using std::pair;
using std::vector;
namespace sde_drm {
void ParseFormats(co... | TOOL | 0.879303 | 6.178336 |
5bb16ce3-08fc-4c13-b9d9-e5f3364f41aa | ramkrishnareddy24/DataStructures | C++ DS Problems and Algorithms/hoarePartition.cpp | #include <bits/stdc++.h>
using namespace std;
//Efficient Solution
int hoarePartition(int arr[],int l,int h)
{
int p=arr[l];
int i=l-1,j=h+1;
while(true)
{
do
{
i++;
}while(arr[i]<p);
do
{
j--;
}while(arr[j]>p);
if(i>=j) return j;
swap(arr[i],arr[j]);
}
}
int main()
{
int arr[]={5,3,8,4... | ALGO | 0.999957 | 4.542813 |
04000eae-e964-4c37-bc4f-4c444d88c01b | RooTinfinite/leetcode-solutions | solutions/3645-maximize-the-number-of-target-nodes-after-connecting-trees-ii/maximize-the-number-of-target-nodes-after-connecting-trees-ii.cpp | class Solution {
public:
int dfs(int node, int parent, int depth,
const vector<vector<int>>& children, vector<int>& color) {
int res = 1 - depth % 2;
color[node] = depth % 2;
for (int child : children[node]) {
if (child == parent) {
continue;
... | ALGO | 0.999963 | 5.884001 |
6466c36d-60c3-4693-ac8e-3e10c2b0d52d | Ray-Tracing-Systems/kernel_slicer | apps/tests/001_loop_start/test_class.cpp | #include "test_class.h"
#include <cstdint>
void Numbers::CalcArraySumm(const int* a_data, unsigned int a_dataSize)
{
kernel1D_ArraySumm(a_data, a_dataSize);
}
void Numbers::kernel1D_ArraySumm(const int* a_data, size_t a_dataSize)
{
m_summ = 0;
for(int i=a_dataSize/2; i<a_dataSize; i++)
{
int number = a_da... | ALGO | 0.931143 | 5.181763 |
93581000-7a10-4123-8e88-fd8956ebc5b6 | r-hub2/bolstered-quasidesolate-queenslandgrouper-leidenbase | src/core/centrality/prpack.cpp | /* -*- mode: C -*- */
#include "igraph_error.h"
#include "centrality/prpack_internal.h"
#include "centrality/prpack/prpack_igraph_graph.h"
#include "centrality/prpack/prpack_solver.h"
#include "core/exceptions.h"
using namespace prpack;
using namespace std;
/*
* PRPACK-based implementation of \c igraph_personaliz... | ALGO | 0.999911 | 5.438592 |
94d9ac17-e1fc-4f34-85bc-ea13133aaa76 | superegg-M/VINS-Lite | lib/graph_optimization/problem_slam.cpp | //
// Created by Cain on 2024/3/7.
//
#include "problem_slam.h"
#include <omp.h>
#include <iostream>
// #define USE_PCG_SOLVER
//#define DIRECT_MARGINALIZE
namespace graph_optimization {
using namespace std;
/*
* marginalize 所有和 frame 相连的 edge: imu factor, projection factor
* vertex排序必须满足: extra, po... | ALGO | 0.999759 | 3.264786 |
494f2a01-47ab-4528-8291-3e792ec78879 | AbrarurRahman07/Practice_Problem | BeeCrowd/2143.cpp | #include <iostream>
using namespace std;
int main()
{
int t,n;
while(1)
{
cin>>t;
if(t==0)
break;
for(int i=0; i<t; i++)
{
cin>>n;
if(n%2!=0)
cout<<(n-1)*2+1<<endl;
else
cout<<(n-2)*2+2<<endl;
... | ALGO | 0.999571 | 3.792547 |
db8589cf-8908-40bd-bad8-74cdc608bce4 | hjiang13/LLMs-in-IR | POJ-104/66/69.cpp | #include <iostream>
using namespace std;
int main ()
{
int days[13]={
0,31,28,31,30,31,30,31,31,30,31,30,31}
;
long year;
int mon,day;
scanf ("%ld%d%d",&year,&mon,&day);
year=year%2800;
long x=0;
int i;
if (year==1)x=0;
if (year>1)
{
for (i=1; i<year; i++)
{
if ((i%400==0)||((i%4==0)&&(i%100!=0)))x+=366;
else x+=365;
}... | ALGO | 0.99973 | 3.269695 |
98fffc04-b6bd-445c-9fed-e49f746ae113 | blockchaingate/fabcoin | src/encodings_crypto.cpp | /** All alphanumeric characters except for "0", "I", "O", and "l" */
static const char* pszBase58new = "123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz";
bool Encodings::Base58ToBytes(const std::string& inputBigEndian, std::vector<unsigned char>& outputBigEndian, std::stringstream* commentsOnFailure)
{
... | TOOL | 0.918644 | 6.439295 |
edd97b06-68c5-426d-83ee-34731a235d00 | AgreHarshal/Problem_Solving | Competitive Programming/codeforces/Contests/div_3/E_Anna_and_the_Valentine_s_Day_Gift.cpp | #include <bits/stdc++.h>
using namespace std;
#define int long long
const int mod = 1e9 + 7;
void precal()
{
}
int c(int num){
int res = 0;
while (num % 10 == 0) {
res++;
num /= 10;
}
return res;
}
int cntall(int num){
int res = 0;
while (num >0) {
res++;
num /= 1... | ALGO | 0.999981 | 5.175249 |
3975c196-af91-4429-b92b-6231d3b2b044 | maverickreal/leetcode-solutions | 894-all-possible-full-binary-trees/894-all-possible-full-binary-trees.cpp | class Solution {
typedef long long ll;
typedef pair<ll, ll> pi;
#define vi(x) vector<x>
#define pb push_back
const ll mod = 1e9 + 7;
const char nl = '\n';
public:
vi(TreeNode*) func(ll n) {
if (n == 1) {
return { new TreeNode(0) };
}
vi(TreeNode*)res;
for ... | ALGO | 0.99994 | 5.16495 |
622e5102-6c2b-41f0-bb20-7973a1251b73 | evgeniyfeder/itmo | algo/labs/range_quaries/fastadd.cpp | #include <iostream>
#include <vector>
std::string file_name = "fastadd";
typedef unsigned int uint;
std::vector<uint32_t> sum_prefix;
std::vector<uint32_t> deriv;
uint a, b;
uint cur = 0;
uint nextRand() {
cur = cur * a + b;
return cur >> 8;
}
void nextAddition(uint &add, uint &l, uint &r) {
add = nextRand();
l ... | ALGO | 0.999462 | 3.967139 |
15edb08f-07e8-4999-9c97-8721aaae4044 | dhesant/comp2012h | Lab 4/interleaving.cpp | #include <iostream>
#include <cstdlib>
bool isInterleaved(char *s1, char *s2, char *s3) {
if (!(*s1 || *s2 || *s3)) {
return true;
}
else if (*s3 == '\0') {
return false;
}
else {
return ((*s1 == *s3 && isInterleaved(s1+1, s2, s3+1)) || (*s2 == *s3 && isInterleaved(s1, s2+1, s3+1)));
}
}
void ... | ALGO | 0.992271 | 4.262198 |
0d7a110e-fff5-4030-9a7a-413ea085aba6 | tr1ten/DNA | codeforces/specialist/F_Array_Stabilization_GCD_version.cpp | #include <cstdio>
#include <bits/stdc++.h>
using namespace std;
#include "ext/pb_ds/assoc_container.hpp"
#include "ext/pb_ds/tree_policy.hpp"
using namespace __gnu_pbds;
template<class T>
using ordered_set = tree<T, null_type, less<T>, rb_tree_tag, tree_order_statistics_node_update> ;
template<typename T>
using order... | ALGO | 0.999168 | 3.918827 |
b073ecad-9dd7-4b32-8e61-6c66fb30c258 | trymeow/mstuca | Functions.cpp | #include "Functions.h"
#include "Programmer.h"
#include <algorithm>
#include <experimental/filesystem>
#include <fstream>
deque<Programmer> parse(string filename) {
ifstream fin;
fin.open(filename);
deque<Programmer> mydeque;
while (!fin.eof()) {
Programmer a;
string str;
fin >> str;
if (str.em... | TOOL | 0.971879 | 3.771797 |
68bdf07b-a642-4ab7-b14d-aa400e056c0d | MahinAshraful/CodeWatch_Data | sample-data/p00018/s614326128.cpp | #include <iostream>
#include <algorithm>
using namespace std;
int main()
{
int num[5];
for (int i = 0; i < 5; i++){
cin >> num[i];
}
for (int i = 0; i < 5; i++){
for (int j = 0; j < 5; j++){
if (num[i] >= num[j]){
swap(num[i], num[j]);
}
}
}
cout << num[0];
for (int i = 1; i < 5; i++){
... | ALGO | 0.999943 | 3.267399 |
76de203d-5fbf-4b9c-bfb3-8dfd93a0d915 | bellicose77/Problem-Solving | Codeforces/Array/G_Plaindrome_Array.cpp | #include<bits/stdc++.h>
using namespace std;
void plaindrome(vector<int>v)
{
int flag=0;
int n=v.size();
int x=v.size()/2;
for(int i=0;i<=x;i++)
{
if(v[i]!=v[n-i-1])
{
flag=1;
break;
}
}
if(flag==0)
{
cout<<"YES"<<endl;
}
el... | ALGO | 0.999965 | 4.145114 |
560cd19d-e286-47e8-b7eb-97a3977fcea6 | dyabol-tn/Semester-1 | Laboratory Work 4/лабораторная 4.cpp | /*4.13.Разработать программу, запрашивающую у пользователя размерность массива N, выполняющую Сортировки
его элементов по убыванию.Сортировки осуществлять с помощью сортировок «пузырька» и «бинарной».Ввод,
вывод, Сортировки выделить в отдельные функции.Тип массива longlong.*/
#include <iostream>
using namespace std;
... | ALGO | 0.999382 | 3.656732 |
665f5041-85d3-475c-a47c-3807af2e557a | shikhak101/leetcode | PrintImmutableLinkedListInReverse.cpp | /**
* // This is the ImmutableListNode's API interface.
* // You should not implement it, or speculate about its implementation.
* class ImmutableListNode {
* public:
* void printValue(); // print the value of the node.
* ImmutableListNode* getNext(); // return the next node.
* };
*/
class Solution {
pub... | ALGO | 0.999717 | 5.852136 |
a40ea9aa-a934-46d3-8811-390dcfa45a73 | BioinformaticsToolsmith/Look4LTRs | src/ltr/SGD.cpp | #include "SGD.h"
SGD::SGD(std::vector<double> weightVec) {
// Pre-conditions
assert(weightVec.size() > 0); // Number of features must be greater than 0!
this->weightVec = weightVec;
this->featureCount = weightVec.size() - 1;
}
std::vector<int> SGD::predict(Matrix &featureMatrix) {
int rowCount = featureMatri... | ALGO | 0.980481 | 5.370759 |
7d5d6328-f836-4a3f-a0d0-9b8060719fa1 | Allen-Swaidan/Solar-System-Model | GR SIM/include/glm/test/core/core_func_integer_bit_count.cpp | // This has the programs for computing the number of 1-bits
// in a word, or byte, etc.
// Max line length is 57, to fit in hacker.book.
#include <cstdio>
#include <cstdlib> //To define "exit", req'd by XLC.
#include <ctime>
unsigned rotatel(unsigned x, int n)
{
if (static_cast<unsigned>(n) > 63) { std::printf("r... | ALGO | 0.9987 | 4.846448 |
41fa86be-9aab-422c-a836-51368eab65f2 | kopildas/ACM | A_K-divisible_Sum.cpp | // “Ayo, these ain’t lookin like shooting stars”
//
// -Dinosaurs
#include <bits/stdc++.h>
using namespace std;
typedef long long lg;
//const lg N = 10000000; // BIG LOOOOOOOOOL 7
// lg ar[N];
int main()
{
bool flag=true;
lg brk, n,j, t, k,h,m,ah,am,a,b,c,x;
cin>>t;
... | ALGO | 0.999989 | 4.366845 |
165b97e0-d9be-4eba-87d2-f7dd74b72ff2 | Jaydenyounger/Programming-Repo | C++ Projects/C++ Project 6 Pyramid.cpp | #include <iostream>
#include <string>
using namespace std;
// Function prototypes for the different types of pyramids
void PrintPyramid(int rows, string Print, int Space); // Regular pyramid
void PrintInvertedPyramid(int rows, string Print, int Space); // Inverted pyramid
void PrintFloydsPyramid(int ro... | TOOL | 0.986467 | 5.554601 |
26249b26-7caa-4b67-86d0-37581f7e0436 | Anxi77/.Algorithms | BaaarkingDog/0x0D/solutions/15686.cpp | // Authored by : BaaaaaaaaaaarkingDog
// Co-authored by : -
// http://boj.kr/445279200beb4050ac92ffc9dc68d68b
#include <bits/stdc++.h>
using namespace std;
#define X first
#define Y second
int board[55][55];
int n, m;
vector<pair<int,int>> chicken;
vector<pair<int,int>> house;
int main(void) {
ios::sync_with_stdio... | ALGO | 0.999949 | 4.23818 |
407e9a0b-248d-410e-94c2-bf277f41e5de | ishandutta2007/codeforces | nigus/normal/779/B.cpp | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef long double ld;
ll big = 1000000007ll;
ll n,m,q,T,k;
string s;
ll f(ll i , ll k2){
if(k2 == 0)return 0;
if(i == -1)return big;
if(s[i] == '0'){
return f(i-1,k2-1);
}
return 1 + f(i-1,k2);
}
int main()
{
//freopen("input.txt","r",st... | ALGO | 0.999939 | 4.109681 |
6be3ed71-c95b-424c-a940-58b9d5982242 | kzahedi/entropy | src/entropy++/CMI.cpp | #include <entropy++/CMI.h>
#include <iostream>
#include <assert.h>
#include <math.h>
using namespace std;
using namespace entropy;
double __empericalCMI(ULContainer* X, ULContainer* Y, ULContainer* Z)
{
assert(X->isDiscretised());
assert(Y->isDiscretised());
assert(Z->isDiscretised());
int maxX = 0;
in... | ALGO | 0.984316 | 3.821437 |
37c961b1-2bb7-461d-bdc8-63f6dd5478a1 | Kawser-nerd/CLCDSA | Source Codes/AtCoder/agc026/B/3195154.cpp | #include <iostream>
using namespace std;
#define int long long
int gcd(int a, int b) {
if (b == 0)
return a;
return gcd(b, a%b);
}
signed main() {
int T;
cin >> T;
while (T--) {
int A, B, C, D;
cin >> A >> B >> C >> D;
if (A < B || D < B) {
cout << "No" << endl;
} else if (C < B - (gcd(B, D) - A % ... | ALGO | 0.999823 | 4.62504 |
d6b6c16a-700b-4ad3-9672-edebe93da63a | Gabuter-OS/frameworks_av | media/libaudioprocessing/AudioResamplerCubic.cpp | #define LOG_TAG "AudioResamplerCubic"
#include <stdint.h>
#include <string.h>
#include <sys/types.h>
#include <log/log.h>
#include "AudioResamplerCubic.h"
namespace android {
// ----------------------------------------------------------------------------
void AudioResamplerCubic::init() {
memset(&left, 0, size... | ALGO | 0.926321 | 6.907433 |
64a2568e-6791-42ad-8729-859230c1230a | ishandutta2007/codeforces | grt_2018/normal/1368/C.cpp | #include <bits/stdc++.h>
using namespace std;
multiset<pair<int,int> >cells;
int dx[6] = {0,0,-1,1,1,-1};
int dy[6] = {-1,1,0,0,1,-1};
int main() {
ios_base::sync_with_stdio(0);
cin.tie(0);
int n;
cin >> n;
for(int i = 1; i <= n; ++i) {
if(cells.find({i,i}) == cells.end())
cells.insert({i,i});
for(int j ... | ALGO | 0.999743 | 3.111495 |
55255f32-202c-41f9-95b3-f53a76df7b27 | Vish-001/LeetCode | 2116-check-if-a-parentheses-string-can-be-valid/2116-check-if-a-parentheses-string-can-be-valid.cpp | class Solution {
public:
bool canBeValid(string s, string locked)
{
if(s.size()%2!=0) return false;
int open=0;
int close=0;
for(int i=0;i<s.size();i++)
{
int j=s.size()-1-i;
if(s[i]=='(' || locked[i]=='0')
{
open++;
... | ALGO | 0.998591 | 5.487439 |
5e4b9803-a98e-4753-aa8e-60918e6f816e | sealkeen/leetcode-longest-substring | leetcode-longest-substring/Source.cpp | #include <iostream>
#include <string>
using std::string;
class Solution {
public:
int lengthOfLongestSubstring(string s) {
size_t slen = s.length();
if (slen < 1) return 0;
if (slen == 1) return 1;
std::string result = std::string(); // the resulting buffer substring
int ma... | ALGO | 0.999712 | 5.726594 |
01be36ed-3133-4b98-a7af-24aa127cde2c | hardstyle01/prog3 | puntero2.cpp | #include <iostream>
using namespace std;
int main(int argc, char *argv[]){
int var=10; //Declara una variable entera llamada var e inicializa su valor en 10.
int *puntero; //Declara un puntero a un entero llamado puntero.
puntero=&var; //Asigna la direccin de memoria de la variable var al puntero puntero. Ahora pu... | ALGO | 0.992224 | 3.527868 |
fff6081d-5327-4106-8f3e-8f22ca5f4fe4 | rodrigo-bruno/rolp | src/share/vm/opto/loopUnswitch.cpp | #include "precompiled.hpp"
#include "memory/allocation.inline.hpp"
#include "opto/connode.hpp"
#include "opto/loopnode.hpp"
#include "opto/rootnode.hpp"
//================= Loop Unswitching =====================
//
// orig: transformed:
// if (invariant-test) then
//... | ALGO | 0.89493 | 6.049525 |
3128b7e7-9588-4c36-8c17-7930fb1941a2 | rohithpadukani/task_app | 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 |
80351662-0b38-46e2-a5a0-95bcf424b1b1 | onvungocminh/The-Dahu-distance | apps/mumford_shah_on_tree/minimumbarier.cpp | #include <mln/core/image/image2d.hpp>
#include <mln/core/neighb2d.hpp>
#include <mln/morpho/component_tree/io.hpp>
#include <mln/morpho/tos/ctos.hpp>
#include <mln/morpho/component_tree/compute_depth.hpp>
#include <mln/morpho/component_tree/reconstruction.hpp>
#include <mln/morpho/component_tree/accumulate.hpp>
#inclu... | DATA | 0.976366 | 5.982243 |
e7be0ee4-cd56-46a1-987c-95f8c2cdc3e1 | ishandutta2007/codeforces | hitman623/normal/500/D.cpp | #include "bits/stdc++.h"
#ifdef PRINTERS
#include "printers.hpp"
using namespace printers;
#define tr(a) cerr<<#a<<" : "<<a<<endl
#else
#define tr(a)
#endif
#define int long long
#define ll long long
#define pb push_back
#define pii pair<int,int>
#define vi vector<int>
#define... | ALGO | 0.999953 | 3.943687 |
c29512b7-85e9-496d-bd0d-ca0e0880c318 | sarvex/leetcode-s | solution/1600-1699/1629.Slowest Key/Solution.cpp | class Solution {
public:
char slowestKey(vector<int>& releaseTimes, string keysPressed) {
char ans = keysPressed[0];
int mx = releaseTimes[0];
for (int i = 1, n = releaseTimes.size(); i < n; ++i) {
int d = releaseTimes[i] - releaseTimes[i - 1];
if (d > mx || (d == mx ... | ALGO | 0.999915 | 6.2644 |
caf1f0b5-3368-405d-8285-33f8d5ada678 | fgorman/random-math-stuff | 3n1.cpp | #include <iostream>
#include <set>
#include <vector>
#include <limits>
#include <thread>
#include <chrono>
#include <mutex>
#include <map>
#include <sstream>
#include "ConcurrentQueue.hpp"
#ifdef DEBUG_LOG
const bool DEBUG = true;
#else
const bool DEBUG = false;
#endif
#define PROGRESS_BAR_WIDTH 150
using namespace... | TOOL | 0.986158 | 4.48966 |
7557812f-5338-4dfb-a518-405aaeab64a4 | TraderCoin/tradercoin | src/scrypt.cpp | #include "scrypt.h"
#include "util.h"
#include <stdlib.h>
#include <stdint.h>
#include <string.h>
#include <openssl/sha.h>
#if defined(USE_SSE2) && !defined(USE_SSE2_ALWAYS)
#ifdef _MSC_VER
// MSVC 64bit is unable to use inline asm
#include <intrin.h>
#else
// GCC Linux or i686-w64-mingw32
#include <cpuid.h>
#endif
#e... | ALGO | 0.98621 | 5.092005 |
c61467d6-3b74-4fa2-8022-8bb15ae3bce3 | BOBrown/Deeparsing | src/caffe/solvers/adagrad_solver.cpp | #include <vector>
#include "caffe/sgd_solvers.hpp"
namespace caffe {
#ifndef CPU_ONLY
template <typename Dtype>
void adagrad_update_gpu(int N, Dtype* g, Dtype* h, Dtype delta,
Dtype local_rate);
#endif
template <typename Dtype>
void AdaGradSolver<Dtype>::ComputeUpdateValue(int param_id, Dtype rate) {
CHECK(Ca... | ALGO | 0.99876 | 7.601492 |
b4d57690-4ebf-4adb-b6cd-bdbd55a789e0 | MozaffarMotwakil/cpp-problem-solving | level-2/Ex13-CheckIdentityMatrix/Ex_13-CheckIdentityMatrix.cpp | #include <iostream>
#include <cstdlib>
using namespace std;
int RandomNumber(int From, int To) {
return rand() % (To - From + 1) + From;
}
void FillMatrixWithRandomNumber(int Matrix[3][3], int Rows, int Columns) {
for (short i = 0; i < Rows; i++)
{
for (short j = 0; j < Columns; j++)
{
Matrix[i][j] = Rando... | ALGO | 0.99561 | 3.899107 |
e1504eb2-7e57-4b3a-818c-391c4190e1fb | CuongNgyn2005/DSA | LT/buoi3/Add_After.cpp | /*###Begin banned keyword - each of the following line if appear in code will raise error. regex supported
define
include
###End banned keyword*/
#include <iostream>
using namespace std;
//###INSERT CODE HERE -
using namespace std;
struct Node{
int info;
Node *next;
};
struct List{
Node *Head, *Tail;
}; ... | ALGO | 0.999486 | 3.992797 |
9c02c2f6-9bb1-4dd5-ab63-02d29ace259a | DarkImpact1/Data-Structure-Algorithm | Array/reversePairs.cpp | #include<bits/stdc++.h>
using namespace std;
int brute_reversePairs(vector<int>& nums) {
int pair = 0;
int n = nums.size();
for(int i=0;i<n;i++){
for(int j = i+1;j<n;j++){
if(nums[i] > (2 * nums[j])){
pair++;
}
}
}
return pair;
}
int main() {... | ALGO | 0.999029 | 4.981578 |
40ee5174-f855-4445-832e-d458d10718e5 | jsupancic/AStar_Dual_Tree_HandPose | util/Segment.cpp | #include "Segment.hpp"
#include "Renderer.hpp"
#include "Capturer.hpp"
#include "Pipe.hpp"
#include <highgui.h>
#include <GL/glut.h>
namespace deformable_depth
{
/// SECTION: Segemntation
struct Message_segment_caputre_to_circle
{
Mat ZDT, RGBcap;
public:
Message_segment_caputre_to_circle(Mat ZDT,Mat... | ALGO | 0.97664 | 4.264165 |
0347c4fc-8e2a-4347-9879-4c7f27e5484e | rjw57/tiw-computer | emulator/3rdparty/bgfx/3rdparty/glslang/StandAlone/spirv-remap.cpp | #include <iostream>
#include <fstream>
#include <cstring>
#include <stdexcept>
#include "../SPIRV/SPVRemapper.h"
namespace {
typedef unsigned int SpvWord;
// Poor man's basename: given a complete path, return file portion.
// E.g:
// Linux: /foo/bar/test -> test
// Win: c:\foo\bar\... | TOOL | 0.882617 | 6.775279 |
89ca0b54-983b-4bfa-8f8b-d7189b693e13 | YashhhCodesHere/Cpp-DSA-Questions-Practice | 3. Conditional Statements/9_Armstrong_Number.cpp | #include <bits/stdc++.h>
using namespace std;
int numberOfDigit(int n){
int count = 0;
while(n != 0){
n /= 10;
count++;
}
return count;
}
bool isArmstrong(int n, int power){
int org = n;
int arm = 0;
int temp = 0;
while(n > 0){
temp = pow((n%10), power);
... | ALGO | 0.999831 | 5.443306 |
ee3bb97f-eb78-4212-99e9-079b2314585e | Priyanshsoniii/DSA | 767-prime-number-of-set-bits-in-binary-representation/prime-number-of-set-bits-in-binary-representation.cpp | class Solution {
public:
int countPrimeSetBits(int left, int right) {
int cnt=0;
int n = right;
bool prime[n + 1];
memset(prime, true, sizeof(prime));
for (int p = 2; p * p <= n; p++) {
if (prime[p] == true) {
for (int i = p * p; i <= n; i += p)
pr... | ALGO | 0.999813 | 4.504647 |
53b313d1-767e-4d59-bee8-21c84ec09654 | alaaMelook/Problem-solving-sheet1 | W. Mathematical Expression.cpp | #include <iostream>
#include <iomanip>
#include <cmath>
using namespace std ;
int main (){
int a, b ,c ,r ;
char s,e ;
// bool flag ;
cin >> a >> s >> b >> e >> c ;
if (s =='+' ){
r = a+b ;
}else if (s =='-'){
r = a-b ;
}else if (s == '*'){
r = a*b ;
}
if (r==c){... | ALGO | 0.999968 | 3.435938 |
42be0b31-b28d-49ab-8787-c5b708f2e638 | VivaLaPanda/CS315 | lab01/lab01_b.cpp | #include <iostream>
unsigned int invert(unsigned, int, int);
unsigned int rightRot(unsigned x, int n);
int main()
{
unsigned x = 3;
std::cout << rightRot(x, 2) << std::endl;
return 0;
}
unsigned int invert(unsigned x, int p, int n)
{
for(int i = 0; i < n; i++)
{
unsigned check = 1;
... | ALGO | 0.999817 | 5.86279 |
84dbb859-c478-4c60-9598-ea61f24f44c0 | eriser/axLib | libs/VST3 SDK/public.sdk/samples/vst/mda-vst3/source/mdaMultiBandProcessor.cpp | #include "mdaMultiBandProcessor.h"
#include "mdaMultiBandController.h"
#include <math.h>
namespace Steinberg {
namespace Vst {
namespace mda {
//-----------------------------------------------------------------------------
FUID MultiBandProcessor::uid (0x97C53059, 0x47FC442C, 0x8A858B04, 0x30C3AFE7);
//------------... | TOOL | 0.985417 | 5.788521 |
aeb649a3-78f7-4b8a-a1f5-2aa86e0208bb | Sayemahamed/cpp | A_SwapSort.cpp | #include <bits/stdc++.h>
using namespace std;
int main()
{
ios_base::sync_with_stdio(false);
cin.tie(NULL);
cout.tie(NULL);
long long siz, k = 0;
cin >> siz;
cout << siz << endl;
vector<long long> dat(siz);
for (auto& it : dat)
cin >> it;
for (long long i = 0; i < siz; i++)
... | ALGO | 0.999943 | 3.325354 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.