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 |
|---|---|---|---|---|---|---|
6aea4abf-d147-41a1-a0b9-005c41c5fb39 | lttthedev/SPOJ-VNOI-VNOJ-Solution | BCACM11A-src.cpp | #include <iostream>
using namespace std;
long d1, d2, d3;
long m, n, k, t;
void dem()
{
for (long x = 100000; x <= 999999; x++)
{
long m = x, s = 0, sum = 0, c1 = 1;
while (m != 0)
{
long cs = m % 10;
sum += cs;
s = s * 10 + cs;
if (cs == 0) c1 = 0;
m = m / 10;
}
if (s == x)
{
d3++;
... | ALGO | 0.99962 | 3.759671 |
a3f749e5-b751-4849-95bd-7c716656eeb5 | VikasKanwar101/DSA | 53-maximum-subarray/maximum-subarray.cpp | class Solution {
public:
int maxSubArray(vector<int>& nums) {
int sum=0;
int max=INT_MIN;
int l=nums.size();
for(int i=0;i<l;i++)
{
sum=sum+nums[i];
if(sum>max)
max=sum;
if(sum<0)
sum=0;
}
return max;... | ALGO | 0.999967 | 6.207769 |
9b41d794-2119-44c4-866c-ddaae86df520 | einstein07/AUTOFAC-TELO2023 | robogen/src/config/ConfigurationReader.cpp | #include <boost/program_options.hpp>
#include <fstream>
#include <iostream>
#include <sstream>
#include <vector>
#include <boost/filesystem.hpp>
#include <boost/regex.hpp>
#include <boost/math/special_functions/round.hpp>
#include <boost/algorithm/string.hpp>
#include <osg/Vec3>
#include <boost/filesystem.hpp>
#includ... | CONFIG | 0.947721 | 5.578246 |
eeddb8e9-c4a5-4862-a414-47fb9fa71d62 | godolias15/CSEC_CPD | Games.cpp | #include <iostream>
#include <map>
using namespace std;
int main() {
int teams;
cin >> teams;
map<int, int> h, g;
int k = 0;
for (int i = 0; i < teams; ++i) {
int x, y;
cin >> x >> y;
if (x == y) {
k++;
}
h[x]++;
g[y]++;
}
int c... | ALGO | 0.9998 | 4.418394 |
38564009-11da-4d3a-afa9-90542c45b298 | bikashkumaryadav/GFG-ProblemSets | Difficulty: Medium/Implement Pow/implement-pow.cpp | //{ Driver Code Starts
// Initial Template for C++
#include <bits/stdc++.h>
using namespace std;
// } Driver Code Ends
// User function Template for C++
class Solution {
public:
double power(double b, int e) {
// code here
double ans=1;
int nflag=0;
if(e<0){
nflag=1;... | ALGO | 0.999328 | 5.647104 |
645fe8ee-b4b8-49b1-bb92-82e00b7925fe | mitegab/Task-Manager | windows/runner/utils.cpp | #include "utils.h"
#include <flutter_windows.h>
#include <io.h>
#include <stdio.h>
#include <windows.h>
#include <iostream>
void CreateAndAttachConsole() {
if (::AllocConsole()) {
FILE *unused;
if (freopen_s(&unused, "CONOUT$", "w", stdout)) {
_dup2(_fileno(stdout), 1);
}
if (freopen_s(&unuse... | TOOL | 0.998859 | 6.785645 |
ba0be7c5-707d-41f3-a166-9e5e583984a0 | ishandutta2007/codeforces | sokokaleb/normal/855/B.cpp | #include <bits/stdc++.h>
#define __INIT_CC__ ios::sync_with_stdio(false); \
cin.tie(0);
#ifdef __WIN32__
char getchar_unlocked() {return getchar();}
#endif
#define FOR(_i,_n,_m) for(int (_i)=(_n),_t=(_m);_i<(_t);++(_i))
#define FORN(_i,_n,_m) for(int (_i)=(_n),_t=(_m);_i<=(_t);++(_i))
#define FORD(_i,_n,_m) for(in... | ALGO | 0.999937 | 3.506825 |
6aaa3b7c-d6fb-4ae5-85ff-b417678f9f71 | congmei86/leetcode | 01-GeekBand算法原理与实践/cpp/insertSort.cpp | /**
* @file insertSort.cpp
* @brief
* @author DuYong
* @date 2021-03-11
*/
/*
(有序区,无序区)。把无序区的第一个元素插入到有序区的合适的位置。对数组:比较得少,换得多。
插入排序思路:
1. 从第一个元素开始,该元素可以认为已经被排序
2. 取出下一个元素,在已经排序的元素序列中从后向前扫描
3. 如果该元素(已排序)大于新元素,将该元素移到下一位置
4. 重复步骤3,直到找到已排序的元素小于或者等于新元素的位置
5. 将新元素插入到该位置后
6. 重复步骤2~5
*/
void insertSort(std::vecto... | ALGO | 0.999785 | 5.187289 |
8d2ad1e9-db1a-4724-8a3d-c4a6fbb82d4a | yan998/oclint-0.15 | llvm/lib/CodeGen/MachineScheduler.cpp | #include "llvm/CodeGen/MachineScheduler.h"
#include "llvm/ADT/ArrayRef.h"
#include "llvm/ADT/BitVector.h"
#include "llvm/ADT/DenseMap.h"
#include "llvm/ADT/PriorityQueue.h"
#include "llvm/ADT/STLExtras.h"
#include "llvm/ADT/SmallVector.h"
#include "llvm/ADT/iterator_range.h"
#include "llvm/Analysis/AliasAnalysis.h"
#in... | ALGO | 0.991185 | 7.861978 |
530ca3fe-e5f6-4118-99a6-6e010a6539d2 | Mohit-Raj1712/LeetCode-Solutions | 49. Group Anagrams.CPP | class Solution {
public:
vector<vector<string>> groupAnagrams(vector<string>& strings) {
unordered_map<string,vector<string>> map;
for(string &s : strings)
{
string t = s;
sort(t.begin(),t.end());
map[t].push_back(s);
}
... | ALGO | 0.999994 | 6.532138 |
036e05bd-fd64-4551-b7ad-89841bcedaa3 | namratabose32/Leetcode | 732-my-calendar-iii/732-my-calendar-iii.cpp | class MyCalendarThree {
public:
MyCalendarThree() {
}
map<int, int> count = {{-1, 0}};
int res = 0;
int book(int s, int e) {
auto start = count.emplace(s, (--count.upper_bound(s))->second);
auto end = count.emplace(e, (--count.upper_bound(e))->second);
for (auto... | ALGO | 0.999922 | 6.004428 |
bcb59113-01a3-4f94-ab8d-e5043d5cf52c | tahmidul-islam-star/Data_Structure_B210101002 | Queues/Create_Queue_using_Array.cpp | #include <iostream>
#include <cstdlib>
using namespace std;
struct Queue{
int front, rear, capacity;
int* queue;
};
struct Queue* createQueue(int capacity) {
struct Queue* q = (struct Queue*)malloc(sizeof(struct Queue));
q->capacity = capacity;
q->front = q->rear = 0;
q->queue = (int*)ma... | ALGO | 0.995584 | 4.627507 |
4549e64d-43a6-4868-8650-0bbff10284c1 | G33k1973/CodingGames | RangeAddition.cpp | class Solution {
public:
vector<int> getModifiedArray(int length, vector<vector<int>>& updates) {
vector<int> arr(length + 1, 0);
for (auto& x : updates) {
int i = x[0], j = x[1], k = x[2];
arr[i] += k;
arr[j + 1] -= k;
}
for (int i = 1; i < length; ++i) {
arr[i] += arr[i - 1];
}
arr.pop_back()... | ALGO | 0.999486 | 5.814885 |
26deb845-f8c0-4068-a21a-fa8a3395dab6 | jayjaisswal/Data-Structure | DSA Using cpp/Function/swaping_UsingXOR.cpp | #include<iostream>
using namespace std;
int main()
{
int a,b;
cout<<"Enter two Number "<<endl;
cin>>a>>b;
cout<<"A = "<<a<<" B = "<<b<<endl;
a = a ^ b;
b = a ^ b;
a = a ^ b;
cout<<"A = "<<a<<" B = "<<b<<endl;
return 0;
} | ALGO | 0.999684 | 3.528727 |
ee649553-ba80-4986-b4cd-0005fc157c67 | Ownfos/Waffle | libraries/boost_1_72_0/libs/compute/perf/perf_partial_sum.cpp | #include <algorithm>
#include <iostream>
#include <numeric>
#include <vector>
#include <boost/compute/system.hpp>
#include <boost/compute/algorithm/partial_sum.hpp>
#include <boost/compute/container/vector.hpp>
#include "perf.hpp"
int rand_int()
{
return static_cast<int>((rand() / double(RAND_MAX)) * 25.0);
}
i... | ALGO | 0.97899 | 5.905273 |
6cd0da03-3904-4b9f-b6e3-13df2bebff75 | Deep-0603/Cpp | polymorphism.cpp | #include <iostream>
using namespace std ;
class baseclass
{
public :
int var_base;
void display()
{
cout <<"displaying base class variable " <<var_base <<endl;
}
};
class derivedclass : public baseclass
{
public:
int var_derived;
void display()
{
cout <<"displayi... | ALGO | 0.922149 | 6.173759 |
90746e04-074a-4735-b97d-676e73d30dc0 | pclubiitk/Spring-Camp-25 | CP/Abubakar/Assignment7/CSES_Compay_Queries.cpp | #include <bits/stdc++.h>
using namespace std;
#define ll long long
#define vpll vector<pair<ll, ll>>
#define vdll vector<vector<ll>>
#define pll pair<ll,ll>
#define vll vector<ll>
#define pb push_back
#define ff first
#define loop(i, n) for(int i = 0; i < n; i++)
#define one(i, n) for(int i = 1; i <= n; i++)
#define ss... | ALGO | 0.99992 | 4.455929 |
47f1f5c1-4f32-4bcb-b4d0-8cc34b932851 | sohardforaname/ACM_ICPC_practice | multi-college/nc2020/2/J.cpp | #include <bits/stdc++.h>
using namespace std;
const int N = 1e5 + 5;
int a[N], b[N];
vector<int> v;
bool vis[N];
int main()
{
int n, m;
scanf("%d%d", &n, &m);
for (int i = 1; i <= n; ++i)
scanf("%d", &a[i]);
for (int i = 1; i <= n; ++i)
if (!vis[i])
{
v.clear();
... | ALGO | 0.999998 | 3.435118 |
00891fd9-c10d-4699-8abe-c030132fc1f8 | sasidharan10/Cpp | basic c++ problems/stringStream.cpp | #include <bits/stdc++.h>
using namespace std;
int main()
{
string sentence = "This is a sample sentence";
stringstream ss(sentence);
string word;
vector<string> words;
// Split the sentence into words
while (ss >> word)
{
words.push_back(word);
}
// Print the words
for ... | TOOL | 0.985769 | 4.927348 |
9ae94a1d-2848-47f7-9ccd-17a258a60d58 | Junhachoi-GameDav/data_structures_practice | Project7/stack_s.cpp | #include <stdio.h>
#include "stack_s.h"
int top = -1;
int is_stack_empty(void) {
if (top == -1) return 1;
else return 0;
}
int is_stack_full(void) {
if (top == STACK_SIZE - 1) return 1;
else return 0;
}
void push(element item) {
if (is_stack_full()) {
printf("\n\n stack is full!!\n");
return;
}
else stac... | ALGO | 0.966163 | 3.845948 |
a8475d43-5372-4e56-a21e-a5111a9e5d35 | enricava/leetcode | trapping-rain-water/Accepted/9-18-2022, 9_08_49 PM/Solution.cpp | // https://leetcode.com/problems/trapping-rain-water
class Solution {
public:
int trap(vector<int>& height)
{
int left = 0, right = height.size() - 1;
int ans = 0;
int left_max = 0, right_max = 0;
while (left < right) {
if (height[left] < height[right]) {
height[left] >= left_ma... | ALGO | 0.999993 | 6.92927 |
d29e0fff-00a4-4275-92c1-81fb5faf72b4 | yatharthg07/Leetcode_dsa | two-sum-iv-input-is-a-bst.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.999986 | 5.752636 |
f018f6ab-e443-41ab-8ccb-4a154438d2bc | BIBEK-913/Codeforces | ToMyCritics.cpp | #include <iostream>
using namespace std;
int main()
{
int t, a, b, c;
cin >> t;
while (t--)
{
cin >> a >> b >> c;
if (a + b >= 10 || b + c >= 10 || a + c >= 10)
cout << "YES" << endl;
else
cout << "NO" << endl;
}
return 0;
} | ALGO | 0.998898 | 4.268478 |
8d3e8ecf-7944-4df0-8459-d1a0df90975a | ashar-viraj/ChefForces | B_Making_Towers.cpp | #include <bits/stdc++.h>
using namespace std;
#define int long long int
#define rep(i, a, b) for (auto i = a; i < b; i++)
#define reprev(i, a, b) for (auto i = a; i >= b; i--)
#define endl '\n'
#define mp make_pair
#define f first
#define s second
#define MOD 1000000007
#define out(valid) cout << (valid ? "YES\n" : "N... | ALGO | 0.999811 | 4.436524 |
719c4a5a-5421-4503-bc6d-fcf7a03d88e5 | PaukIsUha/optimizing_formating_code | predictions/submissions-aizu-gpt35/Codenet/p00519/703659459/response_4.cpp | #include <iostream>
#include <vector>
#include <queue>
#include <cstring>
#include <algorithm>
using namespace std;
const int MAXN = 6000, INF = 999999999;
vector<int> pass[MAXN];
int n, k;
int c[MAXN], r[MAXN];
int d[MAXN];
bool used[MAXN];
void dfs(int v, int u, int f, int end, bool visited[MAXN]) {
if (visited[u])... | ALGO | 0.999771 | 3.986303 |
b5ebafb4-5faa-4801-a2d2-4ba83349232e | leonardoAnjos16/Competitive-Programming | Other/the_special_king.cpp | #include <bits/stdc++.h>
using namespace std;
#define llong long long int
int main() {
ios_base::sync_with_stdio(false);
cin.tie(NULL);
int T; cin >> T;
while (T--) {
int x1, y1, x2, y2;
cin >> x1 >> y1 >> x2 >> y2;
int ans = abs(x2 - x1) + abs(y2 - y1);
cout << ans ... | ALGO | 0.999377 | 4.352989 |
b8403188-9cd7-4f8f-b47b-f5c9b2fc5e28 | ishandutta2007/codeforces | faustaadp/normal/750/D.cpp | #include<bits/stdc++.h>
#define ll long long
#define pb push_back
#define mp make_pair
#define fi first
#define se second
using namespace std;
ll n,hs,i,a[1010],d[500][500],dx[10]={0,1,1,0,-1,-1,-1,0,1},dy[10]={0,0,1,1,1,0,-1,-1,-1};
bool b[500][500][10][40];
ll rct1(ll aa)
{
if(aa==8)
return 1;
else
return aa+1;... | ALGO | 0.999737 | 3.023345 |
41cbeb09-a43a-4a70-9c4e-e7e6007f1d41 | Yusaku-Nakanose/competitive_programming | AtCoder/ABC/371/a.cpp | #include <iostream>
#include <string>
using namespace std;
int main() {
char a, b, c;
cin >> a >> b >> c;
if(a=='>' && b=='>' && c=='>') cout << 'B' << endl;
else if(a=='>' && b=='>' && c=='<') cout << 'C' << endl;
else if(a=='>' && b=='<' && c=='<') cout << 'A' << endl;
else if(a=='<' && b=='... | ALGO | 0.999971 | 3.626774 |
067d0a4f-f331-47d0-8258-5da81292881d | dylan007/Coding | ACM18/b.cpp | /*=======================
Author : Shounak Dey
Filename : b.cpp
======================= */
#include<bits/stdc++.h>
using namespace std;
typedef long long int ll;
typedef unsigned long long int ull;
#define PB push_back
#define MK make_pair
#define SZ(a) (int)(sizeof(a))
#define F first
#define S second
#define... | ALGO | 0.999991 | 3.555831 |
bc3e05b9-f5d1-452d-b11d-e12507e2cdb6 | leonardoAnjos16/Competitive-Programming | Codeforces/removing_graph.cpp | #include <bits/stdc++.h>
using namespace std;
#define llong long long int
vector<vector<int>> g;
vector<bool> vis;
int cycle(int v) {
if (vis[v]) return 0;
int ans = 1;
vis[v] = true;
for (int u: g[v])
ans += cycle(u);
return ans;
}
int main() {
ios_base::sync_with_stdio(false);
... | ALGO | 0.99999 | 4.097749 |
42b1dae9-caaa-4072-a336-a1c98f7cb219 | waiwai444/oj | uva/10110 - Light, more light/10110.cpp | #include <cstdio>
#include <cmath>
int main()
{
unsigned int n;
unsigned int sr;
while(scanf("%d", &n)!=EOF)
{
if(n==0)
break;
sr = (unsigned int)sqrt((double)n);
if(sr*sr==n || (sr+1)*(sr+1)==n)
printf("yes\n");
else
printf("no\n");
}
return 0;
} | ALGO | 0.999888 | 4.127461 |
43d1a01d-1433-4400-b6b8-4142a7784bbd | WOONBE/C__Algorithm | Segment_Tree/SumOfSection.cpp | //
// Created by 김헌우 on 2023/07/22.
//참고용으로 코드만 긁어옴
#include "bits/stdc++.h"
using namespace std;
long long *tree;
long long arr[1000001];
long long init(int node, int start, int end){
if(start==end) return tree[node] = arr[start];
int mid = (start+end)/2;
return tree[node] = init(2*node,start,mid)+init(2... | ALGO | 0.999911 | 4.850515 |
352935bc-f978-4e96-8211-f76e772b37f3 | GabrielSantaRosa/ITP | ITP/QuestoesURI/1186.cpp | #include <iostream>
#include <iomanip>
using namespace std;
int main()
{
char Acao; cin >> Acao;
float s = 0.0;
float m = 0.0;
float Matriz[12][12];
for(int i = 0; 12 > i; i++)
{
for(int j = 0; 12 > j; j++)
{
cin >> Matriz[i][j];
}
}
for(int i = 1; ... | ALGO | 0.996742 | 3.132238 |
b049e0ec-78ef-4d21-8f08-e759999788e1 | ngobach/competive | c631/b.cpp | // MacOS Fix
#ifndef LOCAL
#include <bits/stdc++.h>
#else
#include "../stdcpp.h"
#endif
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
void solve();
int main() {
#ifdef LOCAL
freopen("../input.txt", "r", stdin);
#endif
ios_base::sync_with_stdio(false);
cin.tie(nullptr);
... | ALGO | 0.999826 | 3.725609 |
0b67bb73-656d-4f5e-a6ff-5721b52793bf | BooleanCube/cp | codeforces/longeststrike.cpp | // AC
#include <bits/stdc++.h>
using namespace std;
/* TYPES */
#define ll long long
#define ld long double
#define pii pair<int, int>
#define pll pair<long long, long long>
#define vi vector<int>
#define vll vector<long long>
#define mii map<int, int>
#define si set<int>
#define sc set<char>
/* CONSTANTS */
#defin... | ALGO | 0.999899 | 4.321902 |
163ca8fc-b083-4149-9e18-d2835757026f | javmonisu/UVA-Online-Programming | src/10130SuperSale.cpp | #include <iostream>
#include <vector>
#include <algorithm>
#include <map>
using namespace std;
struct objetos {
int pPrecio;
int wPeso;
};
bool comparacion(objetos const& a, objetos const& b) // comparison function
{
return a.wPeso < b.wPeso;
}
int main() {
int t,n,g,p,w,total,pesoPKT;
objetos objeto;
cin>>t;... | ALGO | 0.999242 | 3.453457 |
36fe5e94-7691-4df3-a44e-9337c9fcbcfd | danquaheric/Loop | ncr.cpp | #include<iostream>
using namespace std;
float CalcCombination(float n, float r)
{
int i, res;
if(r > 0)
return (n/r)*CalcCombination(n-1,r-1);
else
return 1;
}
int main()
{
float n, r;
int result;
cout<<"\n\n\tEnter the value of n: ";
cin>>n;
cout<<"\tEnter the value of r: ";
cin>>r;
result = CalcComb... | ALGO | 0.999662 | 5.027617 |
62645f4a-04c1-4a37-9991-11f0309dbf7f | 123pk/100DaysCodingChallenege | Day55/Latest Time by Replacing Hidden digits.cpp | /*
Platform :- Leetcode
Problem :- Latest Time by Replacing Hidden Digits
Hint :- brute force
*/
class Solution {
public:
string maximumTime(string time) {
if(time[time.size()-1]=='?'){
time[time.size()-1]='9';
}
if(time[time.size()-2]=='?'){
time[time.size()-2]='... | ALGO | 0.99995 | 6.681154 |
f6bf61c6-d52a-4d55-a7a6-6c8264ffcf9d | DaAlG/code_studying | jaeyeong/공통/[백준]1938_통나무 옮기기.cpp | using namespace std;
#include <iostream>
#include <queue>
#include <tuple>
#include <cstring>
int N;
char board[50][50];
int C_dx[] = { -1, -1, -1, 0, 0, 1, 1, 1 };
int C_dy[] = { -1, 0, 1, -1, 1, -1, 0, 1 };
bool Visit[50][50][2];
int B_Shape, E_Shape;
pair<int, int> Start[3], End[3], B_Center, E_Center;
bool Change... | ALGO | 0.999942 | 4.919284 |
62c27281-5c43-4f14-8e6a-96707f6ef097 | bluesea0/Leetcode | 752. 打开转盘锁/752. 打开转盘锁.cpp | #include <iostream>
#include<vector>
#include<queue>
#include<unordered_map>
using namespace std;
//202011123:01:14
//class Solution {
//public:
// int openLock(vector<string>& deadends, string target) {
// //˼·BFS0000ʼУ¼
// queue<string> q;
// unordered_set<string> set;
// for(auto d:dea... | ALGO | 0.999887 | 5.907674 |
7cdebd10-53d0-4fc0-829b-32501ce60e80 | RjRaghu/CPP | discountedbill.cpp | #include <iostream>
using namespace std;
int main()
{
int bill, discounted, discountedamt;
cout << "Enter the amout of bill:\n";
cin >> bill;
if (bill < 100)
{
cout << "Aur saaman khareedo discount ke liye!!....";
}
else if (bill >= 100 && bill < 500)
{
discounted = (bill... | TOOL | 0.903603 | 3.587439 |
6301fff5-df84-43c0-960a-ce2d4e038b69 | teja-surya-p/Competitive-coding-practice | practice/12.cpp | //semi completed
#include <iostream>
using namespace std;
int div(long x)
{
int count = 0;
int temp;
while(x > 0)
{
temp = x%10;
if(temp == 4 || temp == 7)
count++;
x = x/10;
}
if(count == 4 || count == 7)
return 1;
else
return -1;
}
int main()
... | ALGO | 0.999828 | 3.755738 |
46298e00-346a-481b-b04b-7349184135e9 | marcus-o/real_time_rfsoc_phase_correction | adjustable_pc_high_speed/vitis_hls/phase_c_dr/trigger_worker.cpp | #include "pc_dr.h"
adc_data_double_length abs_sq(adc_data_compl a){
#pragma HLS inline
return a.real()*a.real() + a.imag()*a.imag();
}
void trig_worker(
hls::stream<adc_data_compl_vec> &in_sig_h_q,
hls::stream<adc_data_compl_vec> &out_proc_q,
hls::stream<adc_data_compl_vec, 100> &out_ifg_q,
hls::stream<tim... | TOOL | 0.878472 | 4.484563 |
b0524fbe-f109-4a7b-8681-29dac7a93e7d | MikAghumyan/univ_1sem | lab_hw3/ex264.cpp | #include <iostream>
using namespace std;
int main(void)
{
const int n_def = 30;
int arr[n_def], *ptr;
int max, min, n;
do{
cout << "n[2,30]: "; cin >> n;
} while(n < 2 || n > 30);
ptr = arr;
for(int i = 0; i < n; ++i){
cout << "arr[" << i << "]: ";
cin >> *(ptr + i);
}
min = *ptr; max = *ptr;
for(i... | ALGO | 0.997274 | 3.584808 |
f15c6b3b-93c1-4a61-9210-004821e0cba2 | cssl-unist/trust-sec23 | rust/src/llvm-project/llvm/lib/CodeGen/MachineInstrBundle.cpp | #include "llvm/CodeGen/MachineInstrBundle.h"
#include "llvm/ADT/SmallSet.h"
#include "llvm/ADT/SmallVector.h"
#include "llvm/CodeGen/MachineFunctionPass.h"
#include "llvm/CodeGen/MachineInstrBuilder.h"
#include "llvm/CodeGen/Passes.h"
#include "llvm/CodeGen/TargetInstrInfo.h"
#include "llvm/CodeGen/TargetRegisterInfo.h... | TOOL | 0.850418 | 7.917451 |
96d2be31-e1aa-439c-81cd-08c845adc700 | catarinab/KrylovMittagLeffler | utils/scaling_and_squaring.cpp | #include <vector>
#include "headers/mtx_ops_mkl.hpp"
#include "headers/scaling_and_squaring.hpp"
using namespace std;
//find suitable m value for pade approximation
int findM(double norm, double theta , int * power) {
int m = 1; //2^0
*power = 0; //2^0
while(norm / m >= theta) {
m *= 2;
... | ALGO | 0.999901 | 4.396927 |
7109f3b0-f288-4b8d-bb30-598a5d811a00 | Modilover69/ADSL | Trees.cpp | #include <iostream>
using namespace std;
struct ETreesNode
{
char data;
struct ETreesNode *left, *right;
};
class Etree
{
struct ETreesNode *root;
struct ETreesNode *st[20];
int top;
public:
struct ETreesNode *temp, *lnode;
Etree()
{
root = NULL;
top = -1;
}
v... | ALGO | 0.999902 | 4.698979 |
e931eb2e-e24c-4a33-b659-3c6449a942a4 | dsaenzl/2021-I-Prog-DSaenz | rootf/Secant.cpp | #include<iostream>
#include<cmath>
using alg =double(double);
const double M=60;
const double G=9.81;
const double T=10.0;
const double VT=40;
double f(double x);
double secant(double xo,double xi,double eps,alg fun,int &p);
int main(int argc,char *argv[]){
std::cout.setf(std::ios::scientific);
std::cout.preci... | ALGO | 0.999905 | 3.607717 |
f42f57c4-51d3-4bb5-8086-d37fce455905 | MichaelMarchiano/R4.0-Engine | thirdparty/bullet/Bullet3Collision/BroadPhaseCollision/b3OverlappingPairCache.cpp | #include "b3OverlappingPairCache.h"
//#include "b3Dispatcher.h"
//#include "b3CollisionAlgorithm.h"
#include "Bullet3Geometry/b3AabbUtil.h"
#include <stdio.h>
int b3g_overlappingPairs = 0;
int b3g_removePairs = 0;
int b3g_addedPairs = 0;
int b3g_findPairs = 0;
b3HashedOverlappingPairCache::b3HashedOverlappingPairCa... | TOOL | 0.950879 | 4.765043 |
961543bf-04cf-4f3c-9c95-ede2d154e426 | LEE930923/2023aaib3 | week01/week01-5b.cpp | #include<iostream>
using namespace std;
int main(){
int n,N=0;
cin>>n;
int a[32]; //ans
while(n>0)
{
a[N++]=n%2;
n /= 2;
}
for(int i=N-1;i>=0;i--)
{
cout << a[i];
}
return 0;
}
| ALGO | 0.99999 | 3.983741 |
1f3dd027-a28a-4e02-8afc-e344f72c500f | Conglang/MyLeetCode | src/Path_Sum.cpp | //////////////////////////////////////////////////////
// Project: MyLeetCode
//
// Author: YanShicong
// Date: 2014/10/28
//////////////////////////////////////////////////////
/*--------------------------------------------------------------------------------------------------------------
* Given a binary tree... | ALGO | 0.999784 | 6.005264 |
34fe9af0-a441-4e89-ae90-b89a107d3bf5 | chakku000/algorithm | structure/SegTree/SegXor.cpp | // 1点更新
// 区間取得
template<typename T = long long>
struct SegTreeXor{
public:
int n;
vector<T> data;
// data[i] <- data[i*2+1], data[i*2+2]
SegTreeXor(){}
SegTreeXor(int n_){
init(n_);
}
void init(int n_){
n = 1;
while(n < n_) n *= 2;
data.assign(2*n-1, 0LL);
... | ALGO | 0.999904 | 4.127981 |
1ba1db55-30c4-4e93-ab84-f9465bd115fc | Ri-Nai/CompetitionCode | ACM/2023-2024-1/WinterTraining2024/codeforces/20240127/I.cpp | #include<bits/stdc++.h>
using namespace std;
typedef long long ll;
#define End(X) return cout<<X<<'\n',void()
bool Nai;
namespace T
{
int n,m;
const int N=1e6+5;
int ans[N];
int rd()
{
int t=0,c,f=0;while(!isdigit(c=getchar()))f|=c=='-';
while(isdigit(c))t=(t<<1)+(t<<3)+(c^48),c=getc... | ALGO | 0.999876 | 4.48507 |
6cc71353-b237-4c0d-9b39-2651415ce28a | 321thijs123/Advent-Of-Code-2024 | days/day2/day2.cpp | #include "day2.h"
Day2::Day2(){
reports = readFile("../inputs/day2/example.txt");
std::cout << " ---- Day 2 ---- " << std::endl;
benchmark([this]() {this->part1();});
benchmark([this]() {this->part2();});
}
Day2::report_list Day2::readFile(const std::string path){
std::fstream inputFile(path, std::ios_base:... | ALGO | 0.997601 | 5.772676 |
cba8de59-a91d-4e68-9a53-17533310dea5 | firiexp/library | graph/manhattanmst.cpp | template<typename T>
vector<pair<int, int>> manhattanMST(vector<T> xs, vector<T> ys) {
using P = pair<int, int>;
vector<P> es;
vector<int> ord(xs.size());
for (int s = 0; s < 4; s++) {
iota(ord.begin(), ord.end(), 0);
auto cmp = [&](int i, int j) -> bool {
if (xs[i]+ys[i] != ... | ALGO | 0.999889 | 4.71956 |
66f49a6f-6e36-4b69-8cb0-3058847bf18a | kishan779/DSA_CPP | 0038-count-and-say/0038-count-and-say.cpp | #include <iostream>
using namespace std;
class Solution {
public:
string countAndSay(int n) {
if(n==1) return "1";
if(n==2) return "11";
string s ="11";
for(int i =3; i<=n;i++){
string t="";
s= s+'&';
int c = 1;
for(int j =1; j<s.length(); j++){
if(s[j]!=s[j-1])... | ALGO | 0.999986 | 5.849098 |
8556d287-5ae7-4763-93f0-a327a3168e14 | julyfun/jfmfoi | 240724-图/t1-vector-边权.cpp | #include <iostream>
#include <vector>
using namespace std;
int n, m;
struct E {
int v; // 目的地
int w; // 道路的长度
};
vector<E> e[110];
// 每个 e[i] 都是一个 E 类型的动态数组,存储 i 点所有连出去的边的信息,
// 例如 e[2][0] = { 1, 15 }, e[2][1] = { 4, 23 }
int main() {
cin >> n >> m;
while (m--) {
int u, v, w;
cin >> u >... | ALGO | 0.999853 | 3.722782 |
e54ae107-7c01-4543-9808-6d16153eb7ae | qiaozishun4/CSP2024_BJ | BJ-Junior/answers/BJ-J00755/sticks/sticks.cpp | #include<bits/stdc++.h>
using namespace std;
string dp[100010]={"-1","-1","1","7","4","2","6","8","10","18","22","20","28","68","88","107","202","200","208"};
int main()
{
freopen("sticks.in","r",stdin);
freopen("sticks.out","w",stdout);
int T;
scanf("%d",&T);
while(T--)
{
int n;
... | ALGO | 0.999567 | 3.836577 |
e4500838-cf41-47a5-95b2-fc6c3bc2614e | prateeek1/CP | Problems/Bitmasks/1554C-Mikasa.cpp | #include<bits/stdc++.h>
#define pb push_back
#define fo(i,n) for(int i=0;i<n;i++)
#define foo(i,n) for(int i=1;i<=n;i++)
using namespace std;
#define mod 1000000007
long long inf = 100000000001;
#define all(v) (v).begin(),(v).end()
#define pb push_back
#include<bits/stdc++.h>
#define pb push_back
#define fo(i,n) for(in... | ALGO | 0.999922 | 4.80907 |
0e8a6ba6-258d-44ec-a086-f5a537e01058 | IDA-TUBS/CC_LinkMonitor | thirdparty/boost_1_73_0/libs/geometry/doc/src/examples/algorithms/line_interpolate.cpp | // Boost.Geometry
// QuickBook Example
//[line_interpolate
//` Shows how to interpolate points on a linestring
#include <iostream>
#include <boost/geometry.hpp>
#include <boost/geometry/geometries/point_xy.hpp>
using namespace boost::geometry;
int main()
{
typedef boost::geometry::model::d2::point_xy<double> p... | ALGO | 0.995866 | 4.824072 |
f8c94056-ac1c-47ea-8fa1-12e7e5e171c8 | AdityaKanikdaley/C_Programs | SECONDMA.CPP | #include<stdio.h>
#include<conio.h>
void main()
{
int a[10];
int i,n,c,m=0,k=0;
clrscr();
printf("enter a number\n");
scanf("%d",&n);
for(i=0;i<n;i++)
scanf("%d",&a[i]);
m=a[0];
for(i=1;i<n;i++)
{
if(a[i]>m)
{
k=m;
m=a[i];
}
else if(a[i]>k)
k=a[i];
}
printf("%d is second maximum",k);
getch();
} | ALGO | 0.999899 | 3.412451 |
d64595ba-1da1-4978-827a-5f261cb9f2c4 | nyankosoft/amorphous | framework/amorphous/BSPMapCompiler/PortalBuilder.cpp |
#include "MapCompiler.h"
#include "Stage/BinaryNode.hpp"
namespace amorphous
{
void CPortalBuilder::ConstructFrom( CBSPTreeBuilder* pBSPTBuilder,
CCellBuilder* pCellBuilder)
{
m_pBSPTree = pBSPTBuilder->GetBSPTree();
m_paCell = pCellBuilder->GetCell();
MakeBoundingPortals( pBSPTBuilder->GetAABB() );
... | TOOL | 0.909307 | 5.285193 |
f2952a21-3c10-4693-9835-3cbf2cc7dea8 | trdln/ADS-Autumn-2021 | Midterm/D.cpp | #include <iostream>
using namespace std;
bool is(int arr[], int n, int x){
int l = 0;
int r = n;
while (l <= r) {
int mid = l + (r - l) / 2;
if (x == arr[mid]){return true;}
else if (x < arr[mid]){l = mid - 1;}
else{r = mid + 1;}
}
return false;
}
int is_r(int arr[]... | ALGO | 0.999773 | 4.554593 |
be22e4d9-a969-428b-8beb-d34b35b68b09 | DrZhang818/my-first-project | Problems/School/2.26/E.cpp | #include<bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef double db;
typedef pair<int,int> PII;
//https://www.luogu.com.cn/problem/AT_abc139_e
void solve() {
int n;
cin >> n;
vector<vector<int>> idx(n + 1, vector<int>(n + 1));
int cnt = 0;
for(int i = 1; i <= n; i++) {
for... | ALGO | 0.999374 | 3.966246 |
0e04e6ca-0579-4694-a93a-a9eddd79c5ce | k28611-nits/Leetcode-Solutions | 153-find-minimum-in-rotated-sorted-array/153-find-minimum-in-rotated-sorted-array.cpp | class Solution {
public:
int findMin(vector<int>& nums) {
int l = 0,r=nums.size()-1,n=nums.size();
int mid,prev,next;
while(l<=r){
mid = l + (r-l)/2;
prev = (mid + n - 1)%n;
next = (mid+1)%n;
if(nums[mid]<=nums[... | ALGO | 0.999997 | 5.49709 |
b3898a79-8678-47cb-9f4d-cdf2e45242d0 | airen3339/server | src/modules/Bots/playerbot/strategy/values/AttackersValue.cpp | #include "botpch.h"
#include "../../playerbot.h"
#include "AttackersValue.h"
#include "GridNotifiers.h"
#include "GridNotifiersImpl.h"
#include "CellImpl.h"
using namespace ai;
using namespace MaNGOS;
list<ObjectGuid> AttackersValue::Calculate()
{
set<Unit*> targets;
AddAttackersOf(bot, targets);
Group... | ALGO | 0.85075 | 4.815685 |
a614f6c3-e434-4abd-9838-7152afade534 | yogurtisnumone/lab15 | lab15_3.cpp | #include <iostream>
#include <algorithm>
using namespace std;
int main(){
int a[] = {1,2,4,6,9};
double b[] = {5.5,2.1,13,-7,6.9,0,25,11.1,-4};
int * pa = max_element(&a[0], &a[5]);
cout << "Address of the highest value in array A is " << pa << "\n";
cout << "The highest value in array A is "<< * pa << "\n";... | ALGO | 0.998802 | 4.23746 |
71da00d6-1864-4d88-b994-4e236110da86 | ishandutta2007/codeforces | brovko/normal/609/A.cpp | #include <bits/stdc++.h>
#define int long long
#define ld long double
#define x first
#define y second
#define pb push_back
#define mp make_pair
using namespace std;
int n, m, a[105];
int32_t main()
{
ios_base::sync_with_stdio(0);
cin.tie(0);
cout.tie(0);
cin >> n >> m;
for(int i = 0; i < n; i+... | ALGO | 0.999988 | 4.931363 |
008cd4eb-8730-4866-8f74-168f505e575e | santi1475/asistenciaML | backend/entrenamientos opencv ruidos/opencv-master/samples/cpp/phase_corr.cpp | #include "opencv2/core.hpp"
#include "opencv2/videoio.hpp"
#include "opencv2/highgui.hpp"
#include "opencv2/imgproc.hpp"
using namespace cv;
int main(int, char* [])
{
VideoCapture video(0);
Mat frame, curr, prev, curr64f, prev64f, hann;
char key;
do
{
video >> frame;
cvtColor(fram... | ALGO | 0.950339 | 4.467867 |
ae9f21b5-0b24-4257-9213-32c14c38ff15 | sailfishos-mirror/llvm-project | libcxx/test/std/algorithms/alg.modifying.operations/alg.replace/ranges_replace_copy_if.pass.cpp | // UNSUPPORTED: c++03, c++11, c++14, c++17
// <algorithm>
// template<input_iterator I, sentinel_for<I> S, class T, output_iterator<const T&> O,
// class Proj = identity, indirect_unary_predicate<projected<I, Proj>> Pred>
// requires indirectly_copyable<I, O>
// constexpr replace_copy_if_result<I, O>
// ... | TEST | 0.946512 | 7.777751 |
2af9f573-0da8-4cfd-9205-47b9973eea0e | mjpvl-ai/LocaLLM | extern/llama.cpp/src/llama-kv-cache.cpp | #include "llama-kv-cache.h"
#include "llama-impl.h"
#include "llama-batch.h"
#include "llama-cparams.h"
#include "llama-model.h"
#include <algorithm>
#include <limits>
#include <map>
static const llama_kv_cache_slot_info llama_kv_cache_slot_info_failed{false};
uint32_t llama_kv_cache_get_padding(const struct llama_... | TOOL | 0.912585 | 3.416359 |
70ed5a44-aa27-4847-bc5b-7e79ee1d231d | SarahCristina00/C-plus-plus-I | manipuçacao_constante_com_ponteiros.cpp | /******************************************************************************
*******************************************************************************/
#include <iostream>
using namespace std;
int main()
{
int *pt;
cout<<"Endereço de pt: "<<&pt<<endl;
int x;
cout<<"Informe o valor... | ALGO | 0.981726 | 3.727918 |
6555b0f9-872e-456d-bbe6-f245511c7991 | ema0j/cs482-icg-pj | ICG-code/far/src/libs/scene/shape_sphere.cpp | #include "shape_sphere.h"
#include "intersectionMethods.h"
void SphereShape::CollectStats(StatsManager& stats) {
StatsCounterVariable* spheres = stats.GetVariable<StatsCounterVariable>("Shapes", "Spheres");
StatsCounterVariable* memory = stats.GetVariable<StatsCounterVariable>("Shapes", "Memory");
spheres... | ALGO | 0.930752 | 7.502764 |
7027e94d-8ac7-4941-ae75-a7948ac47b38 | Shapooo/leetcode | 1023.驼峰式匹配.cpp | #include <iostream>
#include <string>
#include <vector>
using namespace std;
/*
* @lc app=leetcode.cn id=1023 lang=cpp
*
* [1023] 驼峰式匹配
*/
// @lc code=start
class Solution {
bool isMatch(string& query, string& pattern)
{
size_t iq {}, ip {};
auto len1 { query.size() }, len2 { pattern.size()... | ALGO | 0.999138 | 6.099663 |
06bda697-38bf-4841-a660-767639902ab7 | cpuchain/cpuchain | src/wallet/wallet.cpp | #include <wallet/wallet.h>
#include <blockfilter.h>
#include <chain.h>
#include <consensus/amount.h>
#include <consensus/consensus.h>
#include <consensus/validation.h>
#include <external_signer.h>
#include <interfaces/chain.h>
#include <interfaces/wallet.h>
#include <key.h>
#include <key_io.h>
#include <outputtype.h>
... | TOOL | 0.949376 | 5.448444 |
e6504f84-8bab-4802-9b25-2e7dbbf93e93 | greenapple1017/codeTree | 241124/최고의 13위치/best-place-of-13.cpp | #include <iostream>
using namespace std;
int a[20][20];
int main() {
// 여기에 코드를 작성해주세요.
int n;
cin >> n; // 이걸 왜 맨날 빼먹냐..
for (int i = 0; i < n; i++) {
for (int j = 0; j < n; j++) {
cin >> a[i][j];
}
}
int max_t = 0;
for (int i = 0; i < n; i++) {
for (in... | ALGO | 0.999788 | 4.334786 |
ba6b723b-4f6e-4526-95d9-4a29ae4351cd | montoyaaa/financiapp | windows/runner/utils.cpp | #include "utils.h"
#include <flutter_windows.h>
#include <io.h>
#include <stdio.h>
#include <windows.h>
#include <iostream>
void CreateAndAttachConsole() {
if (::AllocConsole()) {
FILE *unused;
if (freopen_s(&unused, "CONOUT$", "w", stdout)) {
_dup2(_fileno(stdout), 1);
}
if (freopen_s(&unuse... | TOOL | 0.998859 | 6.785645 |
e65ad95d-8293-477c-8cad-2d17e9f91430 | Prabhjeet2005/DSA | Lec62-73_BinaryTree/BST/Lec73_LargestBstInBinaryTree/largestBSTInBinaryTree.cpp | #include <iostream>
#include <queue>
#include <vector>
using namespace std;
class Node
{
public:
int data;
Node *left;
Node *right;
Node(int d)
{
this->data = d;
this->left = NULL;
this->right = NULL;
}
};
Node *createTree(Node *root)
{
int d;
cout << "Enter Root: ";
cin >> d;
root = ... | ALGO | 0.999984 | 5.609519 |
bdb6f1d4-1fbf-4d07-9973-133a913c260d | ankushsde/problem-solving | 2024/NeetCode/Arrays and Hashing/1. contains-duplicates.cpp | // Three approaches:
// 1. Using nested loops, we can find out if there are any duplicates
// 2. Using sorting, sort the array and then check if the neighboring element is similar or not,
// you can also check for the prev or next:
// 3. using a hashset or hashtable , we'll store all the unique values in the set and ... | ALGO | 0.999904 | 5.575111 |
2889f9fb-4bd0-4f57-ac8a-dd3db153c009 | doun4576/codetree-TILs | 240827/겹쳐지지 않는 두 직사각형/non-overlapping-two-rectangles.cpp | #include <iostream>
#include <cstdio>
#include <limits>
using namespace std;
#define MAX 5
/*
algorithm
1) 첫 번째 직사각형을 선택한다.
2) 첫 번째 직사각형 영역 외에 두 번째 직사각형을 선택한다.
3) 직사각형의 좌표는 출발 좌표와 도착 좌표를 통해 그린다.
4) 출발 좌표와 도착 좌표 영역 내에 다른 직사각형이 있을 시 넘어간다.
*/
int arr[MAX][MAX];
int n, m;
bool inFirstBoxRange(int fx1, int fy1, int... | ALGO | 0.999875 | 3.684059 |
fb45e48c-1492-48eb-97c6-ed8f559535cc | rajarshiroydev/cses | Introductory Problems/MissingNumber.cpp | #include<iostream>
using namespace std;
int main() {
long long n, a;
cin >> n;
long long sum = 0;
int k = n - 1;
while(k--) {
cin >> a;
sum += a;
}
cout << (n * (n + 1)) / 2 - sum;
return 0;
} | ALGO | 0.999745 | 3.535748 |
72dab441-75f9-419c-8bf1-a4c62995081a | brankomilosevic/Data_Structures_and_Algorithms | Data_Structures_course/wk01/netwoek_packages_processing.cpp | #include <iostream>
#include <queue>
#include <vector>
/*
Problem Introduction
In this problem you will implement a program to simulate the processing of network packets.
Input Format.
The first line of the input contains the size S of the buffer and the number n of incoming network packets.
Each of the next n lines c... | ALGO | 0.999823 | 4.343838 |
bde8b5cc-0d8e-4fad-b674-e0d22d5565ab | LiussNK/CppPrimerEdition5 | ch003/3.25.cpp | #include <iostream>
#include <vector>
#include <string>
using std::cin;
using std::cout;
using std::endl;
using std::cerr;
using std::vector;
using std::string;
int main()
{
vector<unsigned> scores(11, 0);
unsigned grade;
auto it = scores.begin();
while (cin >> grade)
{
if (grade <= 100)
++(*(it + grade / 1... | ALGO | 0.987604 | 3.732603 |
85759042-e7f1-4d22-bd9d-0f27934cb3d4 | risacker/Leetcode_Solutions | 200-number-of-islands/200-number-of-islands.cpp | class Solution {
public:
void DFS(vector<vector<char>>& grid, int x, int y) {
if (x < 0 || x >= grid.size() || y < 0 || y >= grid[0].size() || grid[x][y] == '0')
return;
grid[x][y] = '0';
DFS(grid, x + 1, y);
DFS(grid, x - 1, y);
DFS(grid, x, y + 1);
DFS(g... | ALGO | 0.999989 | 6.844424 |
d2e01566-9f43-4b2a-b6af-15a8e7f5fb73 | PaukIsUha/optimizing_formating_code | predictions/submissions-aizu-coop-gpt4/Codenet/p02349/763358054/response_5.cpp | #include <iostream>
using namespace std;
typedef long long ll;
int main() {
const int maxn = 100005;
ll S[maxn] = {0};
int n, q;
cin >> n >> q;
for (int i = 0; i < q; i++) {
bool op;
cin >> op;
if (op) {
int k;
cin >> k;
ll ans = 0;
... | ALGO | 0.996036 | 4.080132 |
0eab768d-eaa2-457f-810f-536802071f72 | Social-Wallet-Inc/wire-core | src/crypto/hmac_sha512.cpp | #include "crypto/hmac_sha512.h"
#include <string.h>
CHMAC_SHA512::CHMAC_SHA512(const unsigned char* key, size_t keylen)
{
unsigned char rkey[128];
if (keylen <= 128) {
memcpy(rkey, key, keylen);
memset(rkey + keylen, 0, 128 - keylen);
} else {
CSHA512().Write(key, keylen).Finalize(... | ALGO | 0.936752 | 5.686802 |
5d23689a-1db1-4751-b022-8f137df55102 | ibrahimqureshi302/DSA_LAB | Assignment 2nd/Question 1.cpp | #include <iostream>
using namespace std; // Add this line to include the std namespace
class Node {
public:
int data;
Node* next;
Node(int value) : data(value), next(nullptr) {}
};
class LinkedList {
private:
Node* head;
public:
LinkedList() : head(nullptr) {}
void insert(int value) {
... | ALGO | 0.997843 | 5.546125 |
446ca1fb-218c-4642-8ff4-30278f71ca50 | Faizullah9181/LeetCode-Practice | 51-n-queens/51-n-queens.cpp | class Solution {
private:
bool canWeFillQueen(int row, int col, vector<string> board, int n){
int rowBackup = row, colBackup = col;
// diagonal on upper side
while(row >=0 && col >= 0){
if(board[row--][col--] == 'Q') return false;
}
// left si... | ALGO | 0.999928 | 6.164648 |
dc8ba75b-5682-4c60-a89b-6ef4f5e231f5 | fruxc/DataStructure | Sorting/Bubble_Sort_02.cpp | #include<iostream>
#define max 25
using namespace std;
class bubble
{
int n, A[max],temp,count;
public:
bubble()
{
n = 0;
count = 0;
temp = 0;
}
void getdata()
{
cout<<"Enter the size of the Array"<<endl;
cin>>n;
A[n];
cout<<"Enter the values of the Array"<<endl;
for(int i=0; i<n... | ALGO | 0.999834 | 3.637402 |
17cef1c8-9df5-4e94-959a-87eca44d3a79 | Sadman007/codelibrary | UVa/11466.cpp | #include <stdio.h>
long long LPD(long long n)
{ if(n<0) n=(-1)*n;
long long i,cnt,mx=0,hishab=0;
for(i=2; i*i<=n; i++)
{
if(n%i==0)
{
hishab++;
cnt=0;
while(n%i==0)
{
n=n/i;
cnt++;
}
}
... | ALGO | 0.999983 | 3.981893 |
a7813693-c943-433b-8adc-d6f0e45e31f6 | havency/testgitcode | testrecurr.cpp | #include <iostream>
using namespace std;
double factorial(double n)
{
if (n < 0)
return -1;
else if (n == 0)
return 1;
else
return n * factorial(n-1);
}
int num_zeros(int n) /* File: num-zeros.cpp */
{
if (n == 0) // Base case #1
return 1;
else if (n ... | ALGO | 0.999124 | 3.714763 |
2811e58e-9f84-4952-81d3-e98b9a5fa27e | yash-dhingra/DS_Codes | DS_Lab/Week_2_Lab_B/q8.cpp | #include <iostream>
#include <cstdlib>
using namespace std;
struct node
{
struct node *prev;
int data;
struct node *next;
};
class linkedlist
{
struct node *head;
public:
void push(int data)
{
node *new_ptr = new node;
if (head == NULL)
{
head = new node;
... | ALGO | 0.999756 | 4.398386 |
6bb93f20-3548-4d64-8821-6a6ad3ac3f99 | Andrenator/Workbench | Workbench/ProjectEuler/Problem17.cpp | #include <iostream>
using namespace std;
int processnum(int);
int main()
{
unsigned long long int num = 0;
for (int i = 1; i <= 1000; i++)
{
num += processnum(i);
cout << "total for " << i << " is " << processnum(i) << endl;
}
cout << "number is " << num << endl;
return 0;
}
int processnum(int x)
{
if ... | ALGO | 0.997937 | 4.226544 |
cc511d91-03ca-4c5c-8879-d3ee26f05073 | SCahmedmohamed/Competitive-Programming | codeforces/1644A. Doors and Keys.cpp | // By Ahmed Mohamed Ibrahim . Feb/22/2022 20:39
#include <bits/stdc++.h>
using namespace std;
#define ld long double
#define lli long long int
#define ll long long
#define el endl
#define ft float
#define Scorpion ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);
int main(){
Scorpion
int n;
cin >> n;
... | ALGO | 0.998185 | 4.252765 |
04b39f95-fc8d-4caa-b2f8-1ba33175a682 | riceroll/MylarFilmSimulator | lib/libigl/tutorial/407_BiharmonicCoordinates/main.cpp | #include <igl/opengl/gl.h>
#include <igl/arap.h>
#include <igl/biharmonic_coordinates.h>
#include <igl/cat.h>
#include <igl/cotmatrix.h>
#include <igl/massmatrix.h>
#include <igl/matrix_to_list.h>
#include <igl/parula.h>
#include <igl/point_mesh_squared_distance.h>
#include <igl/readDMAT.h>
#include <igl/readMESH.h>
#i... | ALGO | 0.988755 | 5.73782 |
db9817d7-059e-4f0e-81a7-d069a67b0d37 | pushkarNath007/DSA_GFG_1 | basic/pattern.cpp | /*
1
1 0 1
1 0 0 0 1
1 0 0 0 0 0 1
*/
#include<bits/stdc++.h>
using namespace std;
int main(){
int n;
cin>>n;
for(int i=1;i<=n;++i){
for(int j=1;j<=(n-i);++j){
cout<<" ";
}
for(int j=1;j<=(n*2)-1;++j){
if(j>=(n-i+1) && j<=(n+i-1)){
... | ALGO | 0.99993 | 3.477692 |
22c608ab-c900-41c4-9b68-ebfdc2363d35 | sarvex/leetcode-javascript | solution/0000-0099/0023.Merge k Sorted Lists/Solution.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* mergeKLists... | ALGO | 0.999833 | 6.232008 |
2dba49b5-67f0-42c4-80ac-b7e76f157907 | rajaditya-m/Interview-Prep | Leetcode/Medium/Search_Range.cpp | class Solution {
public:
int findLeft(std::vector<int> &nums, int target){
int n = nums.size();
int start = 0;
int end = n-1;
while(start<=end){
int mid = start + (end-start)/2;
if(nums[mid]==target){
if(mid-1>=0){
if(nums[mid-1]<target)
... | ALGO | 0.999964 | 6.244271 |
996f2e9f-931a-46cc-9ac4-027c070badbb | pri998/Pattern-Classifier-using-5N-CA | Non-Self replicating/checkNonselfreplicatingSet_RuleWise.cpp | #include <bits/stdc++.h>
using namespace std;
// Function to convert a decimal number to a binary string of length 32
string toBase2(long long decimal, int length = 32) {
string base2 = "";
while (decimal > 0) {
base2 = to_string(decimal % 2) + base2;
decimal /= 2;
}
base2.insert(base2.... | ALGO | 0.999347 | 6.940266 |
18b726c8-3701-4ae8-b927-7e70e8a86e62 | grantrostig/cpp_by_example | alternative_operator_tokens_eq/main.cpp | #include <cstdlib>
#include <iostream>
#include <functional>
using std::cout,std::endl;
constexpr bool eq(int a,int b) {return a == b;}
bool eq2(int a,int b) {return a == b;}
int main() {
// if ( 1 !not_equal_to 1) cout << "equal"<< endl; todo: why can't I do this?
// if ( 1 ! != 1) cout << "equal"<< endl; ... | TOOL | 0.858711 | 3.724211 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.