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 |
|---|---|---|---|---|---|---|
e7b7bcb1-9ece-42b3-8c88-9c65d9716e6e | kunalbhatia-868/Leetcode | Find length of Loop - GFG/find-length-of-loop.cpp | //{ Driver Code Starts
// driver code
#include <bits/stdc++.h>
using namespace std;
struct Node
{
int data;
Node* next;
Node(int val)
{
data = val;
next = NULL;
}
};
void loopHere(Node* head, Node* tail, int position)
{
if(position==0) return;
Node* walk = head;
... | ALGO | 0.999821 | 5.056298 |
dbdb0f31-8af4-47a3-b684-bb1120da83de | Addii155/DSA-with-Cpp | Bit_operations/flipallbits.cpp | #include<iostream>
using namespace std;
int main()
{
long long int n=23;
int temp=n;
// n=n| n>>1;
// n=n| n>>2;
// n=n| n>>4;
// n=n| n>>8;
// n=n| n>>16;
// n=temp^n;
int x;
while (temp>0)
{
x=temp;
temp=temp&(temp-1);
}
x=2*x-1;
int ans=x^n;
... | ALGO | 0.999925 | 4.106103 |
5b6a90f4-a8b0-4057-af76-badd90888500 | ishandutta2007/codeforces | winniechen/normal/1111/E.cpp | #include <cstdio>
#include <algorithm>
#include <cmath>
#include <cstring>
#include <cstdlib>
#include <queue>
#include <iostream>
#include <bitset>
using namespace std;
#define N 100005
#define ll long long
#define mod 1000000007
struct node{int to,next;}e[N<<1];
int head[N],cnt,fa[N],anc[N],dep[N],siz[N],son[N],idx[N... | ALGO | 0.999936 | 3.865619 |
ae451b50-8ba9-441a-8485-6aba0e47a4b4 | Shreyaspatil2310/LeetCode | 1130-minimum-cost-tree-from-leaf-values/1130-minimum-cost-tree-from-leaf-values.cpp | class Solution {
public:
int solve(vector<int>& arr, map<pair<int, int>, int>& maxi, int left, int right, vector<vector<int>>& dp) {
if (left == right) return 0;
if (dp[left][right] != -1) return dp[left][right];
int ans = INT_MAX;
for (int i = left; i < right; i++) {
... | ALGO | 0.999954 | 5.728712 |
938a760b-722d-4d2d-82f4-e8e6fd98ffc4 | vkc12uec/temp-prgs | lca.cpp |
node *LCA (node *r, node *p, node *q) {
if (!r)
return 0;
if (
r->left == p ||
r->left == q ||
r->right == p ||
r->right == q )
return r;
l1 = LCA (r->left, p, q)
l2 = LCA (r->right, p, q)
if (l1 || l2)
return r;
else {
node *n = (l1 == null)? l2 : l1;
return n;
... | ALGO | 0.999904 | 3.773016 |
6d0755e0-eaf5-4519-ab69-a029c81c4c70 | vi5hnuu/love-babbar-dssa-sheet-sol | graph/Possible paths between 2 vertices.cpp | /*
Given a Directed Graph having V nodes numbered from 0 to V-1, and E directed edges. Given two nodes, source and destination, count the number of ways or paths between these two vertices in the directed graph. These paths should not contain any cycle.
Note: Graph doesn't contain multiple edges, self-loop, and cycles.... | ALGO | 0.999987 | 6.326221 |
1e42b244-d034-477c-b042-6c1cd9b17060 | HN026/CAlgo | Graphs/FloydWarshallAlgo.cpp | #include <iostream>
#include <vector>
using namespace std;
void shortestDistance(vector<vector<int>> &matrix){
int n = matrix.size();
for(int i = 0; i<n; i++){
for(int j = 0; j<n; j++){
if(matrix[i][j]==-1){
matrix[i][j] = 1e9;
}
if(i==j) matrix[i][j... | ALGO | 0.999971 | 4.555263 |
fd99fab1-4121-4e94-b78c-bd9c6a79dc55 | TanvirMahfuz/Codeforces | Laura and Operations/prg.cpp | #include<bits/stdc++.h>
#define rep(n) for(int i=0;i<n;i++)
#define yes "yes\n"
#define no "no\n"
using namespace std;
void solve();
int sumOfN(int n){
n=abs(n);return ((n-1)*n)/2;
}
vector<int> createVector(int n) {
vector<int> myVector;rep(n)cin>>myVector[i];return myVector;
}
int maxSubarraySum(const std::ve... | ALGO | 0.999931 | 4.361387 |
3ed7b8d0-15ef-4c30-a9ab-64b0ba300c9b | geobeans/vxworks_osg | osgcpp/LineSegment.cpp | #include <osg/LineSegment>
using namespace osg;
LineSegment::~LineSegment()
{
}
bool LineSegment::intersectAndClip(vec_type& s,vec_type& e,const BoundingBox& bb)
{
// compate s and e against the xMin to xMax range of bb.
if (s.x()<=e.x())
{
// trivial reject of segment wholely outside.
i... | ALGO | 0.985985 | 5.432492 |
5f723280-8f25-4359-b083-8f914eb4bdb3 | StefanEvanghelides/AdventOfCode | 2018/11/cpp/main-a.cpp | #define NOMINMAX
#include <windows.h> // for nice formatted output
// https://docs.microsoft.com/en-us/windows/console/console-virtual-terminal-sequences?redirectedfrom=MSDN
#include <limits.h>
#include <iostream>
#include <fstream>
#include <numeric>
#include <algorithm>
#include <string_view>
#include <string>
#incl... | ALGO | 0.996049 | 5.965871 |
8b345b47-d741-48d2-9dce-cddd461a1078 | KunalNepali/fifth_sem | DAA/fibo.cpp | #include <iostream>
#include <chrono>
using namespace std;
using namespace chrono;
void fibonacci(int n) {
int first = 0, second = 1, next;
cout << "Fibonacci Series: " << first << " " << second;
for (int i = 2; i < n; i++) {
next = first + second;
cout << " " << next;
first = seco... | ALGO | 0.978873 | 7.365469 |
e43ad945-735f-4549-9bca-eba1f8ea4f1d | s3team/gdop | lib/CodeGen/IfConversion.cpp | #include "llvm/CodeGen/Passes.h"
#include "BranchFolding.h"
#include "llvm/ADT/STLExtras.h"
#include "llvm/ADT/SmallSet.h"
#include "llvm/ADT/Statistic.h"
#include "llvm/CodeGen/LivePhysRegs.h"
#include "llvm/CodeGen/MachineBlockFrequencyInfo.h"
#include "llvm/CodeGen/MachineBranchProbabilityInfo.h"
#include "llvm/Code... | ALGO | 0.952468 | 6.346034 |
597ed651-af1c-41f5-a8ec-5bb7e5c15e19 | ThiagoFBastos/programacao-competitiva | kattis/10 Kinds of People.cpp | #include "bits/stdc++.h"
using namespace std;
void solve() {
int r, c, q, id = 0;
cin >> r >> c;
vector<string> g(r);
vector<vector<int>> cc(r, vector<int>(c, -1));
for(int i = 0; i < r; ++i) cin >> g[i];
function<void(int, int, char)> dfs = [&](int x, int y, char ch) {
if(x < 0 || y < 0... | ALGO | 0.999938 | 5.174599 |
ad946f70-82da-432d-953f-ad47d9769da8 | voltour2001/Programming | C++/Uni C++/Small programs/Printf/One Decimal Space Format/main.cpp | #include <iostream>
using namespace std;
//! Show the index and value with one decimal place
// Prints like this
// 0.5 -> sequence[0] = 0.5
// 1 -> sequence[1] = 1.0
// 1.5 -> sequence[2] = 1.5
// 2 -> sequence[3] = 2.0
// 2.5 -> sequence[4] = 2.5
float * newArr(int size)... | ALGO | 0.985788 | 3.321203 |
5cb972fa-4c5d-4417-b945-2579e6a324ef | raincross7/code-similarity | codes/train_code/problem072/problem072_224.cpp | #include <iostream>
using namespace std;
int main(){
int N;cin>>N;
int sm = 0;
int dai;
for(int i = 1; N >= i; i++){
sm+=i;
if(sm > N){
dai=i;break;
}
}
for(int i = 1; dai >= i; i++){
if(sm - N != i)cout << i << endl;
}
} | ALGO | 0.999996 | 3.181052 |
8e192104-2b78-4e73-b652-8b6e94b0e555 | AthaaFW/Daspro-UPI | Pertemuan 5/Latihan/Latihan2.cpp | #include <iostream>
using namespace std;
int main(){
string abstrakMakalah;
cout << "Program Penghitung Jumlah Karakter Pada Abstrak Makalah" << endl;
cout << "=======================================================" << endl;
cout << "Masukan abstrak makalah : "; getline(cin, abstrakMakalah);
co... | TOOL | 0.911783 | 3.708121 |
2d2eec9b-9bc7-463f-b288-ced85b5ebbff | IgorPBorja/competitive-programming | problems/CSES/trees/tree_diameter.cpp | #include <bits/stdc++.h>
using namespace std;
#define vi vector<int>
#define vb vector<bool>
#define vc vector<char>
#define vvi vector<vector<int>>
#define vvb vector<vector<bool>>
#define vvc vector<vector<char>>
#define vpi vector<pair<int, int>>
#define vvpi vector<vector<pair<int, int>>>
#define pii pair<int, int>... | ALGO | 0.99738 | 4.392592 |
08c29819-9a67-49b5-a902-ab0ca6f66698 | 1DenLy/Cpp_Progects | 5number.cpp | #include <iostream>
#include <cstdlib>
using namespace std;
void deleteColumn(int** matrix, int rows, int cols, int K) {
for (int i = 0; i < rows; i++) {
for (int j = K - 1; j < cols - 1; j++) {
matrix[i][j] = matrix[i][j + 1];
}
}
}
int main() {
int rows, cols, K;
cout <... | ALGO | 0.983401 | 5.617946 |
b81bae47-018a-4361-a1b0-dd5695e5ecb2 | VA-run23/GeeksforGeeks-POTD | March/POTD_30_03_2025.cpp | /*
1. Initialize variables to track total gas, total cost, current gas in the tank, and the starting index of the station.
2. Iterate through each gas station in the given vector, summing total gas and total cost, and calculating current gas after visiting each station.
3. If `currentGas` drops below zero, ... | ALGO | 0.999936 | 6.339419 |
49afdc99-003a-442e-9ec4-a31b787ab378 | strengthen/LeetCode | C++/370.cpp | __________________________________________________________________________________________________
class Solution {
public:
vector<int> getModifiedArray(int length, vector<vector<int>>& updates) {
vector<int> res, nums(length + 1, 0);
for (int i = 0; i < updates.size(); ++i) {
nums[updat... | ALGO | 0.999954 | 6.073278 |
500d786c-06e1-49fb-a78d-c4d32edfea49 | sudh-12/DSA-Important | 56-Merge-Intervals.cpp | class Solution {
public:
vector<vector<int>> merge(vector<vector<int>>& inter) {
sort(inter.begin(), inter.end());
vector<vector<int>> ans;
int n = inter.size();
int i =0;
while(i<n){
int s = inter[i][0];
int e = inter[i][1];
int j = i+1;
... | ALGO | 0.999994 | 5.577298 |
26a4a9f7-0ade-468f-a0d9-7ca5952e0f4b | Coach-Academy/Winter-2-2023 | Level 1/Class 2/Lecture/Week 08/Array.cpp | #include <bits/stdc++.h>
using namespace std;
int main()
{
int n;
cin >> n;
vector<int> vec(n) , pos , neg , zero;
for(int i = 0 ; i < n ; i++){
cin >> vec[i];
if(vec[i]== 0)
zero.push_back(vec[i]);
else if(vec[i] > 0)
pos.push_back(vec[i]);
else
neg.push_back(vec[i]... | ALGO | 0.999671 | 3.522816 |
0eeaef5e-c5a9-4150-b114-5a15c981b371 | rishi058/CP-DSA | Binary Search/02.5_Upper_Bound.cpp | #include <bits/stdc++.h>
using namespace std;
#define int long long
#define F(a,b,i) for (int i = a; i < b; i++)
#define all(v) v.begin(), v.end()
typedef long double ld;
typedef vector<int> vi;
//------------------------------------------------------
// upper bound --> if a element is present(or not) return the el... | ALGO | 0.999674 | 5.068583 |
c6ec947b-5cd3-4097-bd3b-7b659c41bd23 | urmisen/OOP_Data_Structure_and_Algorithm | LeetCode/Graph/LeetCode_1971_Find_if_Path_Exists_in_Graph.cpp | #include<iostream>
#include<unordered_map>
#include<map>
#include<list>
#include<queue>
using namespace std;
map<int,list<int>> l;
bool validPath(int n, vector<vector<int>>& edges, int source, int destination) {
unordered_map<int,vector<int>>umap;
for(auto x:edges){
vector<int>temp = x;
... | ALGO | 0.999812 | 4.476818 |
9ac94254-e223-4489-b617-f8ea1994b490 | suveshpandey/DSA-Cpp | 22_recursion/7_sum2.cpp | #include<iostream>
using namespace std;
int sum2(int n){
if(n == 0) return 0;
return n+sum2(n-1);
}
int main(){
cout<<sum2(10);
} | ALGO | 0.999734 | 4.023322 |
508a2e17-07de-4ae4-bc2c-781aa5692ac2 | ShivGamer007/ShivCodeSxLeeTcode | 0383-ransom-note/0383-ransom-note.cpp | class Solution {
public:
bool canConstruct(string ransomNote, string magazine) {
int arr[26] = {0};
for(char ch: magazine){
arr[ch-'a']++;
}
for(char ch: ransomNote){
if (arr[ch - 'a']==0){
return false;
}
arr[ch-'a']--;... | ALGO | 0.999928 | 6.314149 |
40e9f3aa-e9a2-4cf1-b96c-98dc9e62e748 | keke2014/JianzhiOffer | C++/16题目1518:反转链表.cpp |
#include <stdio.h>
#include <stack>
using namespace std;
struct ListNode {
ListNode(): pNext(NULL) {}
int nValue;
ListNode* pNext;
};
void DestroyList(ListNode* head)
{
while (head)
{
ListNode* pNode = head;
head = head->pNext;
delete pNode;
}
}
int main()
{
int n;
while (scanf("%d", &n) != EOF)
{
... | ALGO | 0.999839 | 3.829721 |
df3accec-7453-4ef9-b4a4-b13b28b7606d | lixworth/cpp-playground | snippets/uit/2023/1207.cpp | //
// Created by Worth Lix on 2023/12/7 19:01.
//
#include <iostream>
#include <algorithm>
using namespace std;
int main() {
int a, b, c;
cin >> a >> b >> c;
cout << 2 * a * b + 2 * b * c + 2 * a * c << endl;
cout << a * b * c << endl;
return 0;
} | ALGO | 0.999437 | 5.182151 |
08691db5-f81a-4983-936c-7fe22c84aa7b | sarvex/leetcode-hack | solution/0300-0399/0387.First Unique Character in a String/Solution.cpp | class Solution {
public:
int firstUniqChar(string s) {
int cnt[26]{};
for (char& c : s) {
++cnt[c - 'a'];
}
int n = s.size();
for (int i = 0; i < n; ++i) {
if (cnt[s[i] - 'a'] == 1) {
return i;
}
}
return -1;... | ALGO | 0.99995 | 6.108007 |
1bd115ad-0e81-4fcd-b868-20ce9afe3c67 | curio-7/Dynamic_Programming | 0322-coin-change/0322-coin-change.cpp | class Solution {
public:
//memo wil not pass
// int f(vector<int>coins,int amount,int i,vector<vector<int>>&dp){
// //base case
// if(i==0){
// if(amount%coins[i]==0) return amount/coins[i];
// return 1e9;
// }
// //check
// if(dp[i][amount]!=-1) r... | ALGO | 0.999773 | 5.820734 |
8d7a3583-45c9-448e-b5cb-539801582087 | Vaibhav10sept/DSA | NEETCODE 175/dp-2d-longest-increasing-path.cpp | #include <bits/stdc++.h>
using namespace std;
int longestIncreasingPath(vector<vector<int>> arr) {
// WV recommended.
}
int main()
{
/***************************
* DP solution is also there
VIDEO LINK: https://www.youtube.com/watch?v=wCc_nd-GiEc
QUESTION LINK: https://leetcode.com/problems/longest-increasing-p... | ALGO | 0.999847 | 5.270212 |
0f4c4caf-a24a-4b8c-a7d6-960f36754747 | Jayesh260/Cpp | Codechef/Starter 122/Arya In Grid.cpp | #include <bits/stdc++.h>
using namespace std;
typedef long long int lli;
void solve(){
lli n,m,xo,yo,l;
cin>>n>>m>>xo>>yo>>l;
lli cells=1;
if(l==1){
cout<<(n*m)<<endl;
}
else{
lli up=(xo-1)/l,down=(n-xo)/l,left=(yo-1)/l,right=(m-yo)/l;
cells = 1LL + (up + down) + (left + right... | ALGO | 0.999838 | 4.322225 |
d0355caf-2048-4a0d-abec-c6c5dbf190cf | ValentynaKhomits/customSDRangel | sdrbase/audio/audiofilter.cpp | #include <cmath>
#include <algorithm>
#include <QDebug>
#include "audiofilter.h"
// f(-3dB) = 3.6 kHz @ 48000 Hz SR (w = 0.0375):
const float AudioFilter::m_lpa[3] = {1.0, 1.392667E+00, -5.474446E-01};
const float AudioFilter::m_lpb[3] = {3.869430E-02, 7.738860E-02, 3.869430E-02};
// f(-3dB) = 300 Hz @ 80... | ALGO | 0.979907 | 4.675132 |
eb5a4175-13c2-4989-b15c-865c5c6d5048 | ajaykumar191/DSA | Arrays/PositivesAnsNegatives.cpp | #include<bits/stdc++.h>
using namespace std;
//Assumption that we have equal number of positives and negatives.
int main(){
vector<int>arr={1,2,-4,-5};
int n=arr.size();
vector<int>pos;
vector<int>neg;
for(int i=0;i<n;i++){
if(arr[i]>0){
pos.push_back(arr[i]);
}else{
... | ALGO | 0.999945 | 4.511878 |
b3174c03-3617-4ce9-a409-2f565423de28 | enderdaniil/OOP_labs | lab_7/8.cpp | #define _CRT_SECURE_NO_WARNINGS
#include<iostream>
#include <string>
#include <stdlib.h>
#include <iomanip>
#include <cstdlib>
using namespace std;
class bMoney
{
private:
char Dollar = '$';
long double Value;
string Ustring;
string money;
string digits = "0123456789";
long double Max = 9999999999999990.00;
pu... | TOOL | 0.851082 | 3.783211 |
ffcb724a-7cf9-4435-9a0b-8249b95da2ab | gorkinovich/DefendersOfMankind | dependencies/boost-1.46.0/libs/proto/example/map_assign.cpp | #include <map>
#include <string>
#include <iostream>
#include <boost/proto/core.hpp>
#include <boost/proto/transform.hpp>
#include <boost/type_traits/add_reference.hpp>
namespace proto = boost::proto;
using proto::_;
struct map_list_of_tag
{};
// A simple callable function object that inserts a
// (key,value) pair in... | TOOL | 0.896304 | 6.890498 |
b7339649-3a7e-4a16-8bbf-c490587b58b1 | suhedacilek/C-CodeCollections | shortest.cpp | #include <bits/stdc++.h>
using namespace std;
#define M 10
#define N 10
bool isSafe(int mat[M][N], int visited[M][N], int x, int y)
{
if (mat[x][y] == 0 || visited[x][y])
return false;
return true;
}
bool isValid(int x, int y)
{
if (x < M && y < N && x >= 0 && y >= 0)
return true;
return false;
}
void ... | ALGO | 0.999937 | 5.266059 |
93a5d656-fd62-4fad-a368-1831316ea20c | fanshixiong/slam- | vio/learn_vins/VINS-Mono-code-annotation/pose_graph/src/pose_graph.cpp | #include "pose_graph.h"
PoseGraph::PoseGraph()
{
posegraph_visualization = new CameraPoseVisualization(1.0, 0.0, 1.0, 1.0);
posegraph_visualization->setScale(0.1);
posegraph_visualization->setLineWidth(0.01);
t_optimization = std::thread(&PoseGraph::optimize4DoF, this);
earliest_loop_index = -1;
t... | ALGO | 0.876591 | 3.895264 |
6f42072f-aa4f-470d-96d1-ace04ec0f2b5 | dangdan2807/learning-c | CauTrucDuLieuVaGiaiThuat/BT/tuan8/test.cpp | #include <iostream>
using namespace std;
struct node
{
int data;
node *left;
node *right;
};
node *insert(node *t, int x)
{
if (t == NULL)
{
node *temp = new node;
temp->data = x;
temp->left = NULL;
temp->right = NULL;
return temp;
}
else
{
... | ALGO | 0.999917 | 5.642897 |
176c4089-fddf-4d7b-8174-bfcc56dfe0d7 | ishandutta2007/codeforces | xay5421/normal/675/E.cpp | #include<cstdio>
typedef long long ll;const int N=100005,K=20;
int n,a[N],st[N][K],lg[N];ll ans,dp[N];
int query(int l,int r){
int x=lg[r-l+1];int y=st[l][x],z=st[r-(1<<x)+1][x];
return a[y]<a[z]?z:y;
}
int main(){
scanf("%d",&n);for(int i=1;i<n;++i)scanf("%d",a+i),st[i][0]=i;for(int i=2;i<=n;++i)lg[i]=lg[i>>1]+1;a[... | ALGO | 0.999777 | 3.315571 |
b6f1ba0e-1651-427b-8681-51e7a719a407 | Henrik-Yao/NEUQ-ACM-Solution | winter-day1/0.题目/司伟业/7-10.cpp | #include <bits/stdc++.h>
#define maxn 10005
using namespace std;
struct person{
string name;
int arrival,deal;
}p[maxn];
vector <string> v[105];
vector <person> friends[maxn];
map <string,int> id;
int n,m,late;
double ans;
bool check[maxn];
int lists[maxn];
bool cmp(person &x,person &y)
{
if (x.arrival != y.arrival)... | ALGO | 0.999869 | 3.628724 |
6714075f-9da0-4347-87f6-3126e61cbd07 | gpunit2417/CPP | reverseint.cpp | //leetcode
class Solution{
public:
int reverse(int n){
int ans = 0;
while(n!=0){
int digit = n%10;
if((ans > INT_MAX/10) || (ans < INT_MIN/10)){
return 0;
}
ans = ans * 10 + digit;
n = n/10;
}
return ans;... | ALGO | 0.999935 | 5.311974 |
4ceb7bc4-8771-4815-b947-e3a062a8cbda | meat124/BAEKJOON_My_Solution | Gold_2/백준_1368_물대기.cpp | #include<bits/stdc++.h>
using namespace std;
int V , E;
vector<int> p(305 , -1);
tuple<int , int , int> edge[100005];
int Find(int x)
{
if (p[x] < 0)
return x;
return p[x] = Find(p[x]);
}
bool Union(int u , int v)
{
u = Find(u);
v = Find(v);
if (u == v)
return false;
if (p[u] =... | ALGO | 0.999921 | 3.789125 |
600c364f-c875-440f-b7d7-bc8be652c0de | rohithakanta07/Leet_code | 1667-find-kth-bit-in-nth-binary-string/find-kth-bit-in-nth-binary-string.cpp | class Solution {
public:
char solve(int n, int k, bool invert, int mid){
//cout << n <<" " << mid << " " << k << endl;
if(n == 1){
if(invert == true) return '1';
else return '0';
}
if(k == mid){
if(invert == true) return '0';
else retur... | ALGO | 0.999997 | 5.850908 |
94109505-4832-440a-9663-ac377718e5fc | alexvelea/competitive | contests/codeforcesRound390/c.cpp | #include <algorithm>
#include <iostream>
#include <map>
#include <vector>
using namespace std;
map<string, int> person_id;
bool IsOk(char c) {
return ('0' <= c and c <= '9') or ('a' <= c and c <= 'z') or ('A' <= c and c <= 'Z');
}
bool IsPerson(const string& txt) {
return person_id.find(txt) != person_id.end... | ALGO | 0.999943 | 4.670893 |
85decac9-982c-45ac-8b85-9266c3dbaeb7 | martinandrovich/aibot | solver/src/SokobanSolver.cpp | #include <algorithm>
#include <cctype>
#include <iostream>
#include <cstddef>
#include <fstream>
#include <ostream>
#include <queue>
#include <string>
#include <unordered_map>
#include <vector>
#include "debug.h"
#include "Position.hpp"
#include "SokobanSolver.hpp"
SokobanSolver::SokobanSolver() {}
SokobanSolver::So... | ALGO | 0.999699 | 4.627861 |
a58a6547-6b82-4e53-8f00-247ca8393293 | renegz/competitive-programming | EntrenamientoICPC/grafos/12376.cpp | #include <bits/stdc++.h>
using namespace std;
#define vi vector<int>
vi kw;
int counter = 0;
int position = 0;
void solve(int s, vector<vi> AL);
int main (){
int T;
cin >> T;
int n, m;
for(int i = 1; i <= T; i++){
cin >> n >> m;
vector<vi> AL(n);
for (int i = 0; i < n; i++)
... | ALGO | 0.999886 | 4.195364 |
6adf7a91-03e5-4c51-a828-de57c45ccf39 | ishandutta2007/codeforces | teapotd/normal/1598/A.cpp | #define _USE_MATH_DEFINES
#include <bits/stdc++.h>
#ifdef LOC
#include "debuglib.h"
#else
#define deb(...)
#define DBP(...)
#endif
using namespace std;
using ll = long long;
using Vi = vector<int>;
using Pii = pair<int, int>;
#define pb push_back
#define mp make_pair
#de... | ALGO | 0.999941 | 4.310931 |
94c0a823-fd49-4b47-8af6-905afe4f0f03 | ishandutta2007/codeforces | jtnydv25/normal/1534/C.cpp | #include <bits/stdc++.h>
using namespace std;
#define ll long long
#define pii pair<int, int>
#define all(c) ((c).begin()), ((c).end())
#define sz(x) ((int)(x).size())
#ifdef LOCAL
#include <print.h>
#else
#define trace(...)
#define endl '\n'
#endif
const int mod = 1e9 + 7;
inline int add(int x, int y){ x += y; if(... | ALGO | 0.999994 | 3.82131 |
f197429a-21c5-4545-8838-3e92d328e130 | sudosys/school-works | COE202_c++_homeworks/hw2/main.cpp | #include <iostream>
#include <vector>
#include "Polynomial.h"
int main() {
std::vector<int>* coeff_1 = new std::vector<int>;
std::vector<int>* exp_1 = new std::vector<int>;
*coeff_1 = {1,2,9,13,3};
*exp_1 = {3,2,5,6,7};
Polynomial* poly1 = new Polynomial(coeff_1, exp_1);
std::vector<int... | ALGO | 0.936365 | 3.620493 |
d3d52b1a-0f79-4ff3-8946-22352ec96eea | Midway91/HactoberFest2023 | Hacktoberfest-2023/Leetcode Solutions/0027-remove-element.cpp | class Solution {
public:
int removeElement(vector<int>& nums, int val) {
int index = 0;
for(int i = 0; i< nums.size(); i++){
if(nums[i] != val){
nums[index] = nums[i];
index++;
}
}
return index;
}
}; | ALGO | 0.999504 | 6.059243 |
b6e2dc9f-516e-40f9-9858-e4284374860e | masayasviel/algorithmAndDataStructure | from51to100/ABC99/mainC.cpp | #include <iostream>
#include <algorithm>
#include <vector>
using namespace std;
#define INF 1000000
// xの累乗円のコインを生成
void make_multiplier(int x, int N, vector<int>& coins) {
int num = x;
while(num <= N) {
coins.push_back(num);
num *= x;
}
}
int main() {
int N;
cin >> N;
// DPテー... | ALGO | 0.99997 | 4.770346 |
f7b75a76-ed9b-494b-943a-8d8d4a5cac3f | beingRish/DSA | DSA/Phase-1/Algo/#3. BinarySearch.cpp | /* Binary Search
-> Element should be in montonic function.
3 5 9 13 27
*/
#include<iostream>
using namespace std;
int binarySearch(int arr[], int size, int key){
int start = 0;
int end = size-1;
int mid = (start + end)/2; // int mid = start + (end-st... | ALGO | 0.999946 | 5.711864 |
3ffcffe9-8208-4025-ac95-17413a9439a2 | ngthanhtrung23/CompetitiveProgramming | codeforces/461/B.cpp | #include <set>
#include <map>
#include <list>
#include <cmath>
#include <queue>
#include <stack>
#include <cstdio>
#include <string>
#include <vector>
#include <cstdlib>
#include <cstring>
#include <sstream>
#include <iomanip>
#include <complex>
#include <iostream>
#include <algorithm>
#include <ctime>
#include <deque... | ALGO | 0.999961 | 3.673497 |
b952689c-67df-49f4-bbeb-50b5e42c4597 | krodgers/aprilBP | src/uai14.cpp | // Wrapper for UAI competition code
//
#include <cstdio>
#include <iostream>
//#include <sstream>
#include <fstream>
#include "boost/program_options.hpp"
#include "factorgraph.h"
#include "mplp.h"
#include "mbe.h"
#include "gibbs.h"
#include "lbp.h"
#include "gbp.h"
using namespace std;
using mex::mxObject;
using ... | ALGO | 0.999124 | 5.689257 |
c2e18930-0c63-4bd8-bcb9-cd0589396877 | DucThang1108/CODE-CTDLGT-PTIT | DSA01021 - TỔ HỢP TIẾP THEO.cpp | // https://code.ptit.edu.vn/student/question/DSA01021
// TỔ HỢP TIẾP THEO
#include <bits/stdc++.h>
using namespace std;
void testCase() {
int n, k;
cin >> n >> k;
vector<int> a(k + 1);
map<int, int> mp;
for (int i = 1; i <= k; ++i) {
cin >> a[i];
mp[a[i]]++;
}
int i = ... | ALGO | 0.999944 | 4.028177 |
8a890ca1-1b83-40cf-a402-d2407d77d7a7 | SebastianAyala201/Ejercicios_Codeforces_Ladders | Ejercicio_20.cpp | #include<bits/stdc++.h>
using namespace std;
bool Esta_Ordenada(string &cadena);
void Funcion_recursiva(string cadena);
int main(){
ios_base::sync_with_stdio(false);
cin.tie(NULL);
string suma;
cin>>suma;
if(suma.length()==1){
cout<<suma;
}
else{
Funcion_recursiva(suma);
... | ALGO | 0.999979 | 4.828138 |
05500529-1397-4607-9231-d46d6447ebe4 | aniketraj1615/CPP_Codes | templet_class.cpp | #include<bits/stdc++.h>
using namespace std;
template<class t>
class product{
public:
t *arr;
int size;
product(int n){
size=n;
arr=new t [size];
}
t dot_product(product &p){
t d=0;
for(int i=0;i<size;i++){
d+=this->arr[i]*p.arr[i];
}
... | ALGO | 0.997892 | 3.196116 |
a5d4a322-6d5e-488b-86d8-5177edb1d3cd | mir183/NOT_NM | Interpolation/Newton Divided Difference/ndd.cpp | #include<bits/stdc++.h>
using namespace std;
int main() {
int n;
double x1, ans, x_value;
cout << "Enter the number of values for the argument x :";
cin >> n;
vector<double> x(n), f_x(n);
vector<vector<double>> table(n, vector<double>(n));
cout << "Write the values of the argument x :";
... | ALGO | 0.999824 | 3.685841 |
30b998ca-a7df-47a7-89e6-c4afa3cd34df | WULEI7/WULEI7 | ACM俱乐部/大二下学期训练/3.14 热身赛2/I Pegasus Circle Shortcut(圆上距离).cpp | #include <iostream>
#include <cstdio>
#include <cmath>
using namespace std;
int main()
{
ios::sync_with_stdio(0),cin.tie(0),cout.tie(0);
int n,t=1;
double x0,y0,x1,x2,y1,y2,r,jiao,dis1,dis2,po[15][15];
while(cin>>x0>>y0>>x1>>y1>>x2>>y2)
{
if(x0==0&&y0==0&&x1==0&&y1==0&&x2==0&&y2==0) break;
r=sqrt(pow(x1-x0,2)... | ALGO | 0.99947 | 3.687066 |
db1675d9-a7fa-4935-820e-5864f48c5d59 | MLSA-MUET-SZAB-Club-Khairpur-Mir-s/Learn-to-Code | C++/pyramid1.cpp | #include <iostream>
using namespace std;
int main()
{
int n;
cout << "Enter Number of rows you want to enter: " << endl;
cin >> n;
for (int i = 1; i <= n; i++)
{
for (int j = 1; j <= n - i; j++)
{
cout<<" ";
}
for (int j = 1; j <= 2 * i - 1; j++)
{... | ALGO | 0.99756 | 3.934822 |
47f098cf-6778-47be-9199-73b79a7228e8 | BabaSambar/Codeforces-Questions | 2014/2014B.cpp | #include<bits/stdc++.h>
using namespace std;
#define ll long long
#define pb push_back
#define pf push_front
#define mp make_pair
#define ff(s, f) for(ll i=s; i<=f; i++)
#define fr(s, f) for(ll i=s; i>=f; i--)
#define ffi(s,f) for(ll i=s; i<=f; i++)
#define ffj(s, f) for(ll j=s; j<=f; j++)
#define tc ll t;cin>>t;whi... | ALGO | 0.999804 | 3.744552 |
72bfa5e8-c649-465b-855a-11e96e879df5 | mansigarg-nith/DSA | Bit Manipulation/bit1.cpp | // get bit
#include <iostream>
using namespace std;
int main(){
int n,i;
cin>>n>>i;
if((n & 1<<i)!=0){
cout<<"1";
}
else{
cout<<"0";
}
return 0;
}
| ALGO | 0.999817 | 3.238872 |
69f24a1a-104a-40e0-a889-812aff0f5b16 | sayed-amin/practice | Code chef/number theory/LEVY.cpp | /*
NUMFACT.cpp
26 June 2022
Sun 05:31
prime factorization
*/
#include <bits/stdc++.h>
using namespace std;
#define int long long
#define endl "\n"
const int N = 1e4 + 10;
vector<bool> isprime(N, 0);
vector<int> prime;
vector<int> ct(N, 0);
void solve()
{
int n;
cin >> n;
cout << ct[n] << endl;
}
int32_t mai... | ALGO | 0.999282 | 4.778514 |
927bdb10-44e0-4943-b4f0-d83a43322183 | siraf72/tesseract-test | src/ccstruct/otsuthr.cpp | #include "otsuthr.h"
#include <cstring>
#include "allheaders.h"
#include <tesseract/helpers.h>
#if defined(USE_OPENCL)
#include "openclwrapper.h" // for OpenclDevice
#endif
namespace tesseract {
// Computes the Otsu threshold(s) for the given image rectangle, making one
// for each channel. Each channel is always on... | ALGO | 0.999049 | 7.409904 |
20f5a039-cb78-43f9-9af1-879b0e2e6417 | qwonfery/MoreTech5_SvoiLydiSochtemsya | Plugins/ALS-Community-4.22/Source/ALSV4_CPP/Private/Library/ALSMathLibrary.cpp | #include "Library/ALSMathLibrary.h"
#include "Library/ALSCharacterStructLibrary.h"
#include "Components/ALSDebugComponent.h"
#include "Components/CapsuleComponent.h"
FTransform UALSMathLibrary::MantleComponentLocalToWorld(const FALSComponentAndTransform& CompAndTransform)
{
const FTransform& InverseTransform = Comp... | TOOL | 0.873084 | 7.281446 |
d0467a3a-f3d5-4bbd-a83c-c812bc0e3f11 | meilleur777/Competitive_Programming | BOJ/cpp/6588.cpp | #include <bits/stdc++.h>
using namespace std;
#define fast_io ios_base::sync_with_stdio(false); cin.tie(NULL)
typedef long long ll;
typedef long double ld;
typedef pair<int, int> intp;
void init_code() {
fast_io;
#ifndef ONLINE_JUDGE
freopen("input.txt", "r", stdin);
freopen("output.txt", "w", stdout);
#endif
}... | ALGO | 0.999686 | 4.795506 |
2dea9874-7a0d-4a1d-b274-a73fb8c63e50 | paras-13/DSA | CPP/Graph/isBipartite.cpp | // Is Bipartite Graph
// In a bipartite graph no two adjacent nodes have same color
// A graph which will have an odd length cycle will always be a bipartite graph
// Using DFS
// TIme Complexity: O(V+E)
#include <iostream>
#include <vector>
using namespace std;
class Graph
{
private:
vector<vector<int>> adj;
... | ALGO | 0.999964 | 5.983905 |
dc63680c-f1e1-4431-ae15-697efca412f3 | EASINTUHA/Coding-Journey-reset | April 2025 past/A_Ilya_and_Bank_Account.cpp | #include<bits/stdc++.h>
using namespace std;
int main()
{
ios::sync_with_stdio(false);
cin.tie(NULL);
string s;
cin>>s;
if(s[0]!='-')
cout<<s<<endl;
else
{
for(int i=1;i<s.size();i++)
{
if(s[i]=='0')
{
s.erase(i,1);
... | ALGO | 0.999489 | 4.004532 |
ceede489-4c69-4fa0-b20e-3959bc761273 | saurabhchaudhary05/Data-Structure-and-Algorithms | Stack/stack_using_array.cpp | #include<iostream>
using namespace std;
int top=-1;
void push(int a[],int max){
int value;
if(top==max-1){
cout<<"stack is overflow so u can't insert"<<endl;
}
else{
cout<<"enter the value which u want to insert into stack"<<" ";
cin>>value;
top++;
a[top]=value;
}
}
void pop(int a[]){
if(top==-1){
... | ALGO | 0.998883 | 3.509192 |
5c092676-60d0-4ae7-935e-6054f79d9a0c | YashTanna/DSA | try.cpp | #include <iostream>
#include <string>
using namespace std;
int a[] = {6, 5, 8, 9, 3, 10, 15, 12, 16, 1000};
void swap(int &a, int &b)
{
int temp = a;
a = b;
b = temp;
}
int Partition(int l, int h)
{
int pivot = a[l];
int i = l;
int j = h;
do
{
i++;
} while (a[i] > pivot);... | ALGO | 0.999966 | 5.324497 |
0a3998c6-f528-4144-b125-d602b4dbeb3e | ishandutta2007/codeforces | enem/normal/1285/D.cpp | #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;
#define M1 1000000007
#define M2 998244353
#define ll long long
#define pll pair<ll,ll>
#define REP(i,a,b) for(ll i=a;i<b;i++)
#define REPI(i,a,b) for(ll i=b-1;i>=a;i--... | ALGO | 0.999927 | 4.203773 |
f5e3e7b2-18a0-4879-8f30-472942b13b1f | hustpython/algorithm_cpp | 动态规划/triangle_long.cpp | // 问题描述:
// 7
// 3 8
// 8 1 0
// 2 7 4 4
//在上面的数字三角形中寻找一条从顶部到底边的路径,
//使得路径上所经过的数字之和最大。路径上的每一步
//都只能往左下或右下走。只需要求出这个最大和即可,
//不必给出具体路径。
//三角形的行数大于1小于等于100,数字为0~99.
// 输入格式:
// 4 ///三角形的行数。下面是三角形
// 7
// 3 8
// 8 1 0
// 2 7 4 4
# include <iostream>
# ... | ALGO | 0.999991 | 3.770756 |
d465481b-17c4-434d-aa7d-2a2d46482e63 | codingksj/Baekjoon-Solution | 백준/02000~02999/02100~02199/02110.cpp | #include<iostream>
#include<set>
#include<unordered_map>
#include<map>
#include<vector>
#include<queue>
#include<deque>
#include<stack>
#include<algorithm>
#include<string>
#include<numeric>
#include<cmath>
#include<cctype>
#include<cstring>
#include<iomanip>
using namespace std;
typedef long long LL;
typedef pair<in... | ALGO | 0.999995 | 4.353537 |
0a8002d3-d042-487f-9743-6177d137ba66 | Jenish1154/c-Language | fillament day 22/task 2.cpp | #include<stdio.h>
#include<string.h>
int main(){
char a[20],i;
printf("enter value:");
scanf("%s",a);
for(i=0;i<=strlen(a);i++){
if(a[i]>='a' && a[i]<='z'){
a[i]-=32;
}
else if(a[i]>='A' && a[i]<='Z'){
a[i]+=32;
}
}
printf("%s",a);
return 0;
} | ALGO | 0.999166 | 4.089557 |
fa91b26a-9047-408f-9aee-b48512d97971 | aayush2761/Leetcode_prob | 0162-find-peak-element/0162-find-peak-element.cpp | #include <vector>
using namespace std;
class Solution {
public:
int findPeakElement(vector<int>& nums) {
int low = 0;
int high = nums.size() - 1;
while (low < high) {
int mid = low + (high - low) / 2;
if (nums[mid] < nums[mid+1]) {
low = mid ... | ALGO | 0.999946 | 5.912794 |
e60df9db-17a8-44ef-a4f8-d9376909a6bd | rohankale-18/CodeforcesCodes | contest_1912D.cpp | #include<bits/stdc++.h>
#define int long long
#define uint unsigned long long
#define pb push_back
#define mp make_pair
#define vi vector<int>
#define vvi vector<vi >
#define vb vector<bool>
#define vvb vector<vb >
#define pii pair<int,int>
#define vpii vector<pair<int,int>>
#define vvpii vector<vector<pair<int,int>>>
... | ALGO | 0.999957 | 3.812222 |
da8929bd-f480-4015-9b15-779ab4cf32f5 | dip4012/Striver_SDE_Sheet | Stack and Queue Part 2/maximum_of_minimum_of_every_window_size.cpp | #include <bits/stdc++.h>
using namespace std;
vector<int> nextSmaller(vector<int> a, int n)
{
stack<int> st;
vector<int> next(n);
for (int i = n - 1; i >= 0; i--)
{
while (!st.empty() && a[i] <= a[st.top()])
st.pop();
if (st.empty())
next[i] = n;
else
... | ALGO | 0.999996 | 4.412454 |
470c0f72-22e4-4d47-8412-56ed2f324fb4 | rdivi297/DSA | 0345-reverse-vowels-of-a-string/0345-reverse-vowels-of-a-string.cpp | class Solution {
public:
string reverseVowels(string s) {
int i=0;
int n=s.size()-1;
set<char> ch{'a','e','i','o','u','A','E','I','O','U'};
while(i<n){
if(ch.find(s[n])==ch.end()) n--;
else if(ch.find(s[i])==ch.end()) i++;
else {swap(s[i],s[n]);i++;n--... | ALGO | 0.999806 | 6.554426 |
c72aecc3-d8be-44ee-9bc2-9a6a9736decd | CelestialLemon/Programs | 100Doors/100Doors.cpp | #include<iostream>
using namespace std;
void CloseAllDoors(bool *doors)
{
for (int i = 1; i < 101; i++)
{
doors[i] = false;
}
}
void ProceduralMethod(bool *doors)
{
for (int i = 1; i < 101; i++)
{
for (int j = 1; j < 101; j++)
{
if(i % j == 0)
d... | ALGO | 0.99844 | 4.288317 |
dc82f1f8-e7f2-4c95-9ce5-2ee707246f41 | hansh0101/Algorithm_BaseCamp | c++_ps/baekjoon/2580.cpp | #include <iostream>
#include <set>
using namespace std;
int board[9][9];
int answer[9][9];
set<pair<int, int>> holes;
set<int> rowCheck[9];
set<int> colCheck[9];
set<int> boxCheck[9];
bool isFinish;
void init();
void input();
void solve();
void print();
int main() {
cin.tie(NULL);
ios::sync_with_stdio(fa... | ALGO | 0.999892 | 5.258275 |
85d19432-9b37-490c-ad4d-27a77acc8b8a | Meltout/Competitive-Programming | Strings/Z_Function.cpp | #include <iostream>
#include <cstdio>
#include <vector>
#include <algorithm>
#include <string>
#include <cstring>
#define pb push_back
#define mp make_pair
using namespace std;
vector <int> z_function(string &s)
{
int n = s.size();
vector <int> z(n);
z[0] = n;
for(int i = 1, l = 0, r = 0; i < n; i++)
... | ALGO | 0.999873 | 3.834217 |
0249ea22-d063-49c1-b97a-17579b5af23e | Raquelgr/ED-20232 | TP2/src/Grafo.cpp | #include <Grafo.hpp>
Grafo::Grafo(int qtdVertices) {
tamanho = qtdVertices;
vertices = new Vertice[qtdVertices];
for (int i = 0; i < qtdVertices; i++) {
vertices[i].rotulo = i;
}
}
Grafo::~Grafo() {
for (int i = 0; i < tamanho; i++) {
delete[] vertices[i].vizinhos;
}
d... | ALGO | 0.85434 | 4.265562 |
8ae6ad8b-8529-4a40-93d7-0d25de9ab5ae | makio93/competitive-othersites | Codeforces/Div2/R716/C/main0-2.cpp | // 本番AC
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
#define rep(i, n) for (int i=0; i<(int)(n); ++(i))
#define rep3(i, m, n) for (int i=(m); (i)<(int)(n); ++(i))
#define repr(i, n) for (int i=(int)(n)-1; (i)>=0; --(i))
#define rep3r(i, m, n) for (int i=(int)(n)-1; (i)>=(int)(m); --(i))
#defin... | ALGO | 0.999922 | 3.899089 |
58afb0f1-7ebb-4fd9-b94d-d54c9403fb6b | skygupta07/DSA | 86_subarrayQuestion/5_subarraySumEqualsK.cpp | // subarraySumEqualsK.cpp
/*
Given an array of integers nums and an integer k,
return the total number of subarrays whose sum equals to k.
A subarray is a contiguous non-empty sequence of elements within an array.
Example 1:
Input: nums = [1,1,1], k = 2
Output: 2
Example 2:
Input: nums = [1,2,3], k = 3
Output: ... | ALGO | 0.999907 | 6.442939 |
4d8c7394-2b95-4660-8b78-f6add7386f7b | ishandutta2007/codeforces | memset0c/normal/292/A.cpp | // =================================
// author: memset0
// date: 2018.12.28 13:06:25
// website: https://memset0.cn/
// =================================
#include <bits/stdc++.h>
#pragma GCC optimize(2)
#pragma GCC optimize(3)
#pragma GCC optimize("Ofast")
#define pb push_back
#define rep(i, l, r) for (register i... | ALGO | 0.999942 | 3.43667 |
7cbf8b3a-5654-4e23-b67a-7eb147eb866a | whomimohshukla/cpp-and-leetcode-questions-practise | c++/variables.cpp | #include <iostream>
using namespace std;
int main(){
int number;
cout << "Enter a number: ";
cin >> number;
if (number % 2 == 0) {
cout << "The number is even." << endl;
} else {
cout << "The number is odd." << endl;
}
return 0;
} | ALGO | 0.99211 | 3.532448 |
76974055-a940-4517-9abb-a75329570ea5 | OpenDigitalTwin-Dev/FENGSim | toolkit/Geometry/netgen/libsrc/meshing/localh.cpp | #include <mystdlib.h>
#include "meshing.hpp"
namespace netgen
{
GradingBox :: GradingBox (const double * ax1, const double * ax2)
{
h2 = 0.5 * (ax2[0] - ax1[0]);
for (int i = 0; i < 3; i++)
xmid[i] = 0.5 * (ax1[i] + ax2[i]);
flags.cutboundary = 0;
flags.isinner = 0;
flags.oldcell = 0;
... | ALGO | 0.988262 | 4.8581 |
baa24078-e273-4f69-b617-e581471e73a5 | rifathasanpriyo/All_code_in_c-oop- | oop khirsty maam/swaping different class.cpp | #include<iostream>
using namespace std;
class number1
{
int n1;
public:
void set(int n)
{
n1=n;
}
int get()
{
return n1;
}
void display()
{
cout<<"N1= "<<n1<<endl;
}
};
class number2
{
int n2;
public:
... | ALGO | 0.951028 | 4.258388 |
1424865c-5341-4e5b-9aea-468680665317 | sndrzt/opencv-3.4.7 | modules/cudastereo/src/disparity_bilateral_filter.cpp | #include "precomp.hpp"
using namespace cv;
using namespace cv::cuda;
#if !defined (HAVE_CUDA) || defined (CUDA_DISABLER)
Ptr<cuda::DisparityBilateralFilter> cv::cuda::createDisparityBilateralFilter(int, int, int) { throw_no_cuda(); return Ptr<cuda::DisparityBilateralFilter>(); }
#else /* !defined (HAVE_CUDA) */
#i... | TOOL | 0.985045 | 7.222837 |
99de1121-6a86-4d2e-96bc-4a74bc299b07 | realAYAYA/UnrealEngine-ToonLit | UnrealEngine/Engine/Source/ThirdParty/Intel/Embree/Embree2140/src/kernels/subdiv/catmullclark_coefficients.cpp | #include "catmullclark_coefficients.h"
namespace embree
{
CatmullClarkPrecomputedCoefficients CatmullClarkPrecomputedCoefficients::table;
CatmullClarkPrecomputedCoefficients::CatmullClarkPrecomputedCoefficients()
{
/* precompute cosf(2.0f*M_PI/n) */
for (size_t n=0; n<=MAX_RING_FACE_VALENCE; n++)
... | TOOL | 0.921745 | 5.781526 |
d7edf123-f313-484f-b4b9-60f796de5d8f | mitadic/webserv | src/Config.cpp |
#include "Config.hpp"
#include "ServerBlock.hpp"
#include "Location.hpp"
#include "Log.hpp"
/**
* @brief Loads (the config) file into a stringstream
*/
void Config::load_file(const std::string & filename, std::stringstream& content)
{
std::ifstream file(filename.c_str());
if (filename.substr(filename.find_last_o... | WEB | 0.981992 | 5.95408 |
309ea766-1954-4b94-a138-e4bbd74673fe | oxygen-hunter/Flashboom | data/big-vul-100/add_attention_code/Gemma/top0-100/find-shortest-path-with-k-hops-Solution.shortestPathWithHops/177913_Exec_Code_Overflow.cpp | tt_cmap8_validate( FT_Byte* table,
FT_Validator valid )
{
FT_Byte* p = table + 4;
FT_Byte* is32;
FT_UInt32 length;
FT_UInt32 num_groups;
if ( table + 16 + 8192 > valid->limit )
FT_INVALID_TOO_SHORT;
length = TT_NEXT_ULONG( p );
if ( table + len... | ALGO | 0.998621 | 3.840379 |
f8fa0229-0928-4020-911f-5266e28893c2 | janciesko/kokkos-stf | examples/fibonacci.cpp | /**
* @file
*
* @brief An example of Fibonacci sequence illustrating how we can use
* dynamically created logical data
*/
#include <cuda/experimental/stf.cuh>
using namespace cuda::experimental::stf;
int fibo_ref(int n)
{
if (n < 2)
{
return n;
}
else
{
return fibo_ref(n - 1) + fibo_ref... | ALGO | 0.903276 | 6.275493 |
dda4bff9-5df3-45cb-9e02-6ddedf8e5985 | Akash-raj-INT/DSA | Buy and Sell.cpp | #include <bits/stdc++.h>
using namespace std;
class Solution {
public:
int maxProfit(vector<int>& prices) {
int n = prices.size();
int profit = 0;
for (int i = 0; i < n; ++i) {
for (int j = i + 1; j < n; ++j) {
profit = max(profit, prices[j] - prices[i]);
... | ALGO | 0.999796 | 5.601524 |
9c75ea43-d665-435a-b705-73aca337fc44 | Tasnimul116/beecrowd | selectionsort.cpp | #include<bits/stdc++.h>
using namespace std;
int main(){
int n;
cin>>n;
int arr[n];
for(int i=0; i<n; i++){
cin>>arr[i];
}
for(int i=0; i<n-1; i++){
int minIndex=i;
for(int j= i+1; j<n;j++){
if(arr[j]>arr[minIndex]){
minIndex=j;
}
swap( arr[minIndex],arr[j]);
}
}
cout<<"Sorted: ";
... | ALGO | 0.999989 | 4.599895 |
e0463492-9bd8-4bbc-9753-cabdda8b69dd | sarvex/leetcode-dart | solution/0200-0299/0223.Rectangle Area/Solution.cpp | class Solution {
public:
int computeArea(int ax1, int ay1, int ax2, int ay2, int bx1, int by1, int bx2, int by2) {
int a = (ax2 - ax1) * (ay2 - ay1);
int b = (bx2 - bx1) * (by2 - by1);
int width = min(ax2, bx2) - max(ax1, bx1);
int height = min(ay2, by2) - max(ay1, by1);
retu... | ALGO | 0.999402 | 5.609729 |
315f3a50-23c4-48b7-a357-9ad4702d4846 | reunanen/boost-prebuilt-windows-binaries | libs/spirit/example/x3/calc/calc4c/grammar.cpp | ///////////////////////////////////////////////////////////////////////////////
//
// A Calculator example demonstrating generation of AST. The AST,
// once created, is traversed, 1) To print its contents and
// 2) To evaluate the result.
//
// [ JDG April 28, 2008 ] For BoostCon 2008
// [ JDG February 18, 20... | ALGO | 0.914151 | 7.761004 |
4f49e705-f23a-4572-b38d-488383d3a11d | armychawakorn/lab1_cisclass | 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 |
6e4208cc-5dc4-4c8b-9958-da9e0d6079c8 | ishandutta2007/codeforces | rfpermen/normal/977/E.cpp | #include<bits/stdc++.h>
using namespace std;
#pragma GCC optimize("O3")
#define ll long long
#define rep(i,n,N) for(ll i=(ll)n;i<=(ll)N;i++)
#define rap(i,n,N) for(int i=(int)n;i>=(int)N;i--)
#define pii pair<int,int>
#define pll pair<ll,ll>
#define mp make_pair
#define pb push_back
#define pob pop_back
#define pf pus... | ALGO | 0.999706 | 3.844708 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.