uuid string | repo_name string | relative_path string | content string | category string | algo_rel_score float64 | quality_score float64 |
|---|---|---|---|---|---|---|
23092f07-1b16-4861-b0ef-a6bf3eb58cdc | jzakka/LeetCode | 0072-edit-distance/0072-edit-distance.cpp | class Solution {
public:
int minDistance(string word1, string word2) {
int matrix[501][501];
for (int i = 0; i < 501; i++) {
matrix[i][0] = i;
matrix[0][i] = i;
}
for (int i = 1; i <= word1.length(); i++) {
for (int j = 1; j <= word2.length(); j++... | ALGO | 0.999997 | 6.044627 |
2d975214-d018-42d3-9592-c281a45ac658 | sudban3089/PRNU-De-identification- | Filter/mirdwt_r.cpp | #include <math.h>
#include <stdio.h>
#include "mirdwt_r.h"
#define max(a, b) ((a) > (b) ? (a) : (b))
#define mat(a, i, j) (*(a + (m*(j)+i))) /* macro for matrix indices */
void MIRDWT(double *x, int m, int n, double *h, int lh, int L, double *yl, double *yh) {
double *g0, *g1, *ydummyll, *ydummylh, *ydummyhl;
dou... | ALGO | 0.999988 | 4.436943 |
4a8d4a34-1399-4138-b903-f4bb615a54c5 | manish-kumar1/LeetCode-Problems | Array/Merge_Sorted_Array.cpp | /*
Q. Merge Sorted Array
You are given two integer arrays nums1 and nums2, sorted in non-decreasing order, and two integers m and n, representing the number of elements in nums1 and nums2 respectively.
Merge nums1 and nums2 into a single array sorted in non-decreasing order.
The final sorted array should not be retu... | ALGO | 0.999984 | 5.205962 |
64ec38e3-cebc-4575-838b-496ef0765a67 | dihuibao/PKUACM | Simple calculations/main.cpp | #include <iostream>
#include <stdio.h>
using namespace std;
int main()
{
int n,i;
float a,b,c[3005],sum;
while(scanf("%d",&n)!=EOF){
sum=0;
scanf("%f%f",&a,&b);
for(i=0;i<n;i++){
scanf("%f",&c[i]);
sum+=(n-i)*c[i];
}
sum=(n*a+b-2*sum)/(n+1);
printf("%.2f\n",sum);
}
return 0;
} | ALGO | 0.990479 | 3.322041 |
c20bbc4a-f0e3-4dcc-a241-2e0b3a366885 | DaHye9/BaekJoon-Cpp-study | 5719.cpp | #include <iostream>
#include <cstdio>
#include <vector>
#include <queue>
#include <string.h>
using namespace std;
typedef pair<int, int> pii;
int visit[501];
int dist[501];
int rem[501][501];
int n, m, s, d;
void dijkstra(vector<pii> (&adj)[501]) {
priority_queue <pii, vector<pii>, greater<pii>> pq;
dist[s] = 0;... | ALGO | 0.999786 | 4.143097 |
4ca6db55-49c4-45c0-9481-de9cf92f5f52 | YahiaAbusaif/leetcode | 24-swap-nodes-in-pairs/24-swap-nodes-in-pairs.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* swapPairs(L... | ALGO | 0.999992 | 5.619575 |
6a037127-c3aa-477d-950c-70c9a6a34be6 | st1v4n/Data_Structures_Algorithms | Week3/CountOfSmallerAfterSelf.cpp | /*
Given an integer array nums, return an integer array counts where counts[i] is the number of smaller elements to the right of nums[i].
*/
#include <string>
#include <algorithm>
#include <vector>
#include <utility>
#include <iostream>
using namespace std;
class Solution {
public:
vector<int> countSmaller(vector<i... | ALGO | 0.999996 | 6.684967 |
f52d9567-7278-481b-8a0c-3392b5cad748 | Arslanarsal/CSES-Solutions | Graph Algorithms/_31_Hamiltonian_Flights.cpp | #include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
using namespace std;
using namespace __gnu_pbds;
#define fastio \
ios_base::sync_with_stdio(false); \
cin.tie(NULL); \
cout.tie(NULL);
typedef tree<int, null_typ... | ALGO | 0.999928 | 4.70644 |
eef33557-dbe2-4656-b08d-10b9670b7ce5 | wuxinrantj/Coding | LeetCode/969.煎饼排序/969.煎饼排序.cpp | /*
* @lc app=leetcode.cn id=969 lang=cpp
*
* [969] 煎饼排序
*
* https://leetcode-cn.com/problems/pancake-sorting/description/
*
* algorithms
* Medium (63.20%)
* Likes: 39
* Dislikes: 0
* Total Accepted: 5K
* Total Submissions: 7.9K
* Testcase Example: '[3,2,4,1]'
*
* 给定数组 A,我们可以对其进行煎饼翻转:我们选择一些正整数 k <=... | ALGO | 0.999981 | 6.058083 |
1f92db18-7465-4443-985b-11022b3de274 | bayisagit/DSA | stackarraystrial.cpp | #include <iostream>
using namespace std;
int top = -1;
void pushs(int nums[],int sizus,int numb){
if(top>=sizus-1){
cout<<"stack is overflow"<<endl;
}
else{
++top;
nums[top]=numb;
cout<<"item inserted succesfully"<<endl;
}
}
void display(int nums[]){
for(int i=0;i<=to... | ALGO | 0.996015 | 4.096087 |
756f634e-6786-422d-b6d1-a121b667a6a8 | ameyjain99/InterviewBit | Strings/IntegerToRoman.cpp | string Solution::intToRoman(int num) {
int a[7] = {1000, 500, 100, 50, 10, 5, 1};
char b[7] = {'M', 'D', 'C', 'L', 'X', 'V', 'I'};
char res[25];
int k = 0;
for (int i = 0; i < 7; i += 2) {
int c = num / a[i];
if (c == 4) {
res[k++] = b[i];
res[k++] = b[i - 1];
} else if (c == 9 && i != 0) {
res[k++]... | ALGO | 0.999798 | 5.545438 |
defe5fc5-d0de-4cab-9f0a-fb76abf0eb35 | kinston18/leetcode_DSA | Easy/1446. Consecutive Characters.cpp | class Solution {
public:
int maxPower(string s) {
int maxi=1;
int cnt=1;
for(int i=0;i<s.length();i++){
if(s[i]==s[i+1]){
cnt++;
}
else
cnt=1;
maxi=max(cnt,maxi);
}
return ma... | ALGO | 0.999832 | 5.725451 |
c28451af-617d-405a-aa41-212ef4805457 | HOANGDINHTUNG/ss8 | ss8bt10.cpp | #include <stdio.h>
int main() {
int n;
printf("Moi ban nhap so luong phan tu: ");
scanf("%d", &n);
int a[n];
for (int i = 0; i < n; i++) {
printf("array[%d] = ", i);
scanf("%d", &a[i]);
}
int maxCount = 0;
int result[n]; //bien dung de luu nhieu ket qua
int count = 0; //... | ALGO | 0.99998 | 3.679594 |
7ad93e6d-12f9-4a2a-ac6f-f799fbfec3be | hawkhai/7zipfile | p7zip_16.02/CPP/myWindows/mySplitCommandLine.cpp | #include "StdAfx.h"
#include "../Common/StringConvert.h"
#include "myPrivate.h"
#include "Windows/System.h"
#include "7zip/MyVersion.h"
#include "Common/StdOutStream.h"
#include "Common/IntToString.h"
#include "../C/CpuArch.h"
#ifdef ENV_HAVE_LOCALE
#include <locale.h>
#endif
#include <string.h> // memset
extern v... | TOOL | 0.864392 | 3.353795 |
98551099-9726-4043-85ed-8929a890e53d | jsk3342/basic-algo-lecture | 0x04/solutions/1406.cpp | // Authored by : BaaaaaaaaaaarkingDog
// Co-authored by : -
// http://boj.kr/84654f16875542e6a84d3da7e4cf0dac
#include <bits/stdc++.h>
using namespace std;
int main(void) {
ios::sync_with_stdio(0);
cin.tie(0);
string init;
cin >> init;
list<char> L;
for (auto c : init) L.push_back(c);
auto cursor = L.end... | ALGO | 0.999669 | 4.678375 |
bafd8b63-5159-4c55-952f-d83ccc2c76ca | timmyjose-experiments/competitive-programming | lc/coreprep/implementation/patterns_reference_implementation/merge_intervals/interval_intersection.cpp | #include <algorithm>
#include <iostream>
#include <vector>
using namespace std;
struct Interval {
int start;
int end;
Interval(int start, int end) : start(start), end(end) {}
};
vector<Interval> intersect(const vector<Interval> &a,
const vector<Interval> &b) {
vector<Interval> res... | ALGO | 0.999993 | 4.605914 |
f5b169e7-da96-4b54-8b21-931db7400584 | ishandutta2007/codeforces | rama_pang/normal/1262/E.cpp | #include <bits/stdc++.h>
using namespace std;
using lint = long long;
void solve() {
int N, M; cin >> N >> M;
vector<vector<lint>> grid(N, vector<lint>(M, 0));
vector<vector<lint>> pref2(N, vector<lint>(M, 0));
vector<vector<lint>> tmp(N, vector<lint>(M, 0));
vector<vector<lint>> pref(N, vector<li... | ALGO | 0.999961 | 5.105983 |
c300f4b6-feb9-449c-b137-b6f630db6fda | aquamagic9/Algorithm | algorithm/BOJ/13869.cpp | #include <iostream>
#include <vector>
#include <algorithm>
#include <cmath>
using namespace std;
int main()
{
int N;
cin >> N;
vector<int> v(N);
for (int i = 0; i < N; i++){
cin >> v[i];
}
sort(v.begin(), v.end());
int sum = v[0] * v[1] + v[N - 1] * v[N - 2];
//8642013579
... | ALGO | 0.999523 | 3.617983 |
cf9f6d96-4dab-4c08-bd56-8b163980359d | khanumar03/cp | A/A_Linear_Keyboard.cpp | #include <iostream>
#include <string>
#include <unordered_map>
#include <unordered_set>
#include <set>
#include <vector>
#include <algorithm>
#include <queue>
using namespace std;
typedef long long ll;
template <typename T>
using vec = vector<T>;
void tc()
{
string kb;
cin >> kb;
unordered_map<char, int... | ALGO | 0.99991 | 4.982543 |
9078957a-4001-442f-b7db-bd4f42b15d2a | RUSHDCAT/Contest-Solutions | ARC108/C.cpp | #include <bits/stdc++.h>
using namespace std;
typedef long long LL;
const int N = 200000 + 10;
int n, m;
vector< pair<int,int> > g[N]; bool vis[N];
int a[N];
void dfs(int u, int p) {
if (vis[u]) return;
vis[u] = 1;
for (auto e: g[u]) {
if (vis[e.first] == 0) {
if (a[u] != e.second)
a[e.first] = e.second;
... | ALGO | 0.999988 | 4.15064 |
8d6705cb-bdd8-44e2-8529-6baffe962904 | MadushaniDGS/Flutter-mini_project | 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 |
0a4904c3-5010-4ae0-87b2-253abdd3f95b | ehdms42/Jungol | 20240615.cpp | /*#include <stdio.h>
int main()
{
int a;
scanf("%d", &a);
for(int i=1; i<=a; i++){
for(int j=a; j>i; j--){
printf(" ");
}
for(int k=1; k<=i; k++){
printf("*");
}
printf("\n");
}
return 0;
} */
#include<stdio.h>
int main()
{
int n, x;
int ... | ALGO | 0.999941 | 3.20186 |
a20ea646-ec78-44ae-8d01-adfde0dce3fa | FilippoFantinato/unipd-master | MEMOCO/old/completed-models/iron-rods/ironrods_map_varzero.cpp | /**
* @file ironrods.cpp
* @brief
*/
#include <cstdio>
#include <iostream>
#include <vector>
#include "cpxmacro.h"
using namespace std;
// error status and messagge buffer
int status;
char errmsg[BUF_SIZE];
// data
const int I = 3;
const int J = 3;
const char nameI[I] = { 'A', 'B', 'C' }; // origins
const char ... | ALGO | 0.998668 | 5.510902 |
8dbf671f-8b3c-4ec7-8117-e2ec58f07709 | jvmcpheron/CS2_HW6 | main.cpp | //Jane McPheron
//Teammates: Somayeh Najafi, Yassine Berrada, Tianyi Liang
/*
jvmcpheron@dyn-10-140-246-187 CS2_HW6 % ./main
Expression: *
2
9
;
* 2 9 ;
jvmcpheron@dyn-10-140-246-187 CS2_HW6 % ./main
Expression: *
+
2
3
4
;
* + 2 3 4 ;
Result is 20
*/
#include <iostream>
#include <string>
#include <list>
#incl... | ALGO | 0.982625 | 5.05014 |
86ba7f99-0b74-4df7-ae64-8abde913c421 | asl/llvm-openrisc | lib/VMCore/InlineAsm.cpp | #include "llvm/InlineAsm.h"
#include "ConstantsContext.h"
#include "LLVMContextImpl.h"
#include "llvm/DerivedTypes.h"
#include <algorithm>
#include <cctype>
using namespace llvm;
// Implement the first virtual method in this class in this file so the
// InlineAsm vtable is emitted here.
InlineAsm::~InlineAsm() {
}
In... | TOOL | 0.880855 | 4.93883 |
7bf88683-23b9-4570-b5f3-ed37523c73ba | xiaorangood/cpp_primer | ch09/ex9_27.cpp | #include <forward_list>
#include <iostream>
using std::forward_list;
int main()
{
forward_list<int> fl{ 0, 1, 2, 3, 4, 5, 6, 7, 8, 9 };
auto prev = fl.before_begin();
auto curr = fl.begin();
while (curr != fl.end())
{
if (*curr & 0x1)
{
prev = curr;
++curr;
... | ALGO | 0.999537 | 4.541617 |
12be2448-2b50-4b7c-94c6-0088a208003c | sulthan-95/Practice_codes | _cpp_/spoj4.cpp | #include<iostream>
#include<string.h>
#define sz 200
using namespace std;
int main() {
// your code goes here
int n,k=0,j;
char s[sz];
cin>>n;
while(n--)
{
cin>>s;
k=strlen(s)/2;
for(j=0;j<k;j=j+2)
cout<<s[j]<<"\n";
}
return 0;
}
| ALGO | 0.999041 | 3.318805 |
42660bb4-a408-4b3d-a3fc-22e3702e092f | Ebeed-cs/ICPC-Assiut-Sheets-Problem-Solving-in-Cpp | Sheet 2(Loops)/Primes from 1 to n.cpp | #include <iostream>
#include <math.h>
using namespace std;
int main()
{
int N;
string primeNums = "";
bool isPrime = true;
cin >> N;
for( int i = 2 ; i <= N; i++)
{
for ( int j = 2 ; j <= sqrt(i); j++)
{
if( i % j == 0)
{
isPrime = false;... | ALGO | 0.999097 | 4.685786 |
3dea3c74-49ac-4251-bcff-8a347d79166b | Parranoh/ldrawing | src/rectangular_dual.cpp | #include <list>
#include <algorithm>
#include "include/rectangular_dual.hpp"
#include "include/debug_print.hpp"
struct path_t {
std::vector<vertex_t> contents{};
std::vector<vertex_t> predecessors{};
};
typedef std::vector<path_t> ordering31_t;
template<typename T>
T pred(T it)
{
return --it;
}
template<... | ALGO | 0.999875 | 6.597736 |
7ad5ee46-98e9-41d6-b66b-38e7c192e801 | Aj0SK/kika-projekt | samples/sample1.cpp | #include "Vector.h"
#include "bmpWrite.h"
#include "objLoad.h"
#include <cmath>
#include <fstream>
#include <iostream>
#include <vector>
using std::byte;
using std::pair;
std::vector<std::byte> data;
void Color_pixel(int X, int Y, int w, byte R, byte G, byte B)
{
data[3 * Y * w + 3 * X] = B;
data[3 * Y * w + 3 ... | ALGO | 0.9074 | 4.227676 |
ed46bcab-42a5-4727-b45d-35075c819d51 | JairoDiazS/MSc---Computing-Science | Semester 1/Programing and Algorithms/tarea3cpp/ej7.cpp | /**************************************/
/**************************************/
/**********Jairo Saul Diaz Soto********/
/*************Tarea 3 - EJ7************/
/*******Programacion y Algoritmos******/
/**************28/11/2023**************/
/**************************************/
/********************************... | TOOL | 0.9133 | 6.77368 |
7d27e751-fdb9-4641-9693-4244f146afc8 | joseneto0/Code-Forces | Contests/2023-Regional-ICPC/F.cpp | #include <bits/stdc++.h>
using namespace std;
int main(){
ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL);
int d, c, r, cont=0;
cin >> d >> c >> r;
vector<int> cansativa(c);
vector<int> revigorante(r);
for (int i = 0; i < c; i++){
cin >> cansativa[i];
}
... | ALGO | 0.999899 | 3.629388 |
63f68e90-8906-4f13-b398-22517d891fdd | InteractiveGraphicsLab/Fabricatable-90-Pop-up | Fabricatable90Popup/Fabricatable90Popup/3rdParty/opencv/sources/modules/video/src/tracking/detail/tracker_sampler.cpp | #include "../../precomp.hpp"
#include "opencv2/video/detail/tracking.detail.hpp"
namespace cv {
namespace detail {
inline namespace tracking {
TrackerSampler::TrackerSampler()
{
blockAddTrackerSampler = false;
}
TrackerSampler::~TrackerSampler()
{
// nothing
}
void TrackerSampler::sampling(const Mat& image... | TOOL | 0.899783 | 6.088943 |
ed27ac84-a570-43ce-8e64-0561ba10c0e7 | developertanvir2019/DSA_with_C- | week_6_BST_heap/BST/search_in_bst.cpp | #include <bits/stdc++.h>
using namespace std;
class Node
{
public:
int val;
Node *left;
Node *right;
Node(int val)
{
this->val = val;
this->left = NULL;
this->right = NULL;
}
};
Node *input_tree()
{
int val;
cin >> val;
Node *root;
if (val == -1)
r... | ALGO | 0.999918 | 4.235125 |
f00b6f4d-3db9-418c-87cb-8d4f568856ec | blackbeardONE/CheggHero | coursehero_auto_reg/account_registered_on_20180325/txtsource/200B-Drinks.cpp | #include <iostream>
using namespace std;
int main() {
int n;
cin>>n;
long double res=0;
for(int i=0;i<n;i++){
long double p;
cin>>p;
res+=p/100;
}
cout<<res*100/n;
return 0;
} | ALGO | 0.996941 | 3.549735 |
b9fc9546-db1a-4f4f-b590-9965ab97c456 | cyber-hoax/Scaler_DSA | Stack/PassingGame.cpp | //
// PassingGame.cpp
// Stack
//
// Created by CYBERHOAX on 10/04/22.
//
/*
There is a football event going on in your city. In this event, you are given A passes and players having ids between 1 and 106.
Initially, some player with a given id had the ball in his possession. You have to make a program to display... | ALGO | 0.999961 | 4.925792 |
4d8f2464-42bf-4d99-b60f-955c20253287 | Apoorv-1009/RL-Meets-VIO | svo-lib/opengv/src/sac_problems/point_cloud/PointCloudSacProblem.cpp | #include <opengv/sac_problems/point_cloud/PointCloudSacProblem.hpp>
#include <opengv/point_cloud/methods.hpp>
bool
opengv::sac_problems::
point_cloud::PointCloudSacProblem::computeModelCoefficients(
const std::vector<int> &indices,
model_t & outModel) const
{
outModel = opengv::point_cloud::threept_arun(... | ALGO | 0.992183 | 6.060114 |
1fbdd3d4-5206-44b5-a0ec-d5ea33e93e1d | coderSomya/Competetive-Programming | Codechef/12_July/b.cpp | #include <iostream>
using namespace std;
#include <bits/stdc++.h>
int main() {
// your code goes here
int t; cin>>t;
while(t--)
{
int n; cin>>n;
set<int> st;
int a[n], b[n];
int ans=1;
for(int i=0; i<n; i++){
cin>>a[i];
}
for(int i=0; i<n; i++) cin>>... | ALGO | 0.999932 | 3.833729 |
6c75c893-37cb-4859-a6dc-a4b1066dd2f9 | ishandutta2007/codeforces | abc864197532/normal/1407/D.cpp | /*
* ## ##### #### #### # # ####
* # # # # # # # # # # # #
* # # ##### # # # # # # #
* ###### # # # # # # ## # # #
* # # # # # # # # ## ## # #
* # # ##### #### #### # # ####
*/
#include <bits/stdc++.h>
us... | ALGO | 0.99997 | 4.032545 |
5373275f-4def-4f07-97c2-0b490034bee3 | ngoctlu30/data-structure-TLU | Matrix/Main.cpp | #include <iostream>
using namespace std;
#include "matran.h"
int main()
{
matran<int> a;
cout<<"Nhap ma tran 1 : \n";
a.Nhap();
a.Print();
matran<int> b;
cout<<"Nhap ma tran 2 : \n";
b.Nhap();
b.Print();
matran<int> c;
c = a + b;
c.Print();
return 0;
}
| ALGO | 0.956189 | 3.481722 |
71d3968a-8361-4944-aa61-8bc8704ded1d | zahid-dev/OpenCV_DLIB_Android_Facial-Landmarks-JNI | FaceLandmarksJNI/app/src/main/cpp/dlib/entropy_decoder/entropy_decoder_kernel_1.cpp | #include "../assert.h"
namespace dlib
{
// ----------------------------------------------------------------------------------------
entropy_decoder_kernel_1::
entropy_decoder_kernel_1(
) :
initial_low(0x00000001),
initial_high(0xffffffff),
in(0),
low(initial_low),
... | TOOL | 0.915265 | 6.981758 |
19109fc2-4857-41c5-a24f-eb09874b16b9 | blacksungrass/cpphomework | exp15_2/main.cpp | #include <iostream>
using namespace std;
class Point{
friend class Rectangle;
private:
double x,y;
public:
Point(double a,double b):x(a),y(b){};
};
class Rectangle{
private:
Point left,right;
public:
Rectangle(double a,double b,double c,double d):left(a,b),right(c,d){};
double GetArea() const
{
retu... | ALGO | 0.999538 | 3.347335 |
3baf755c-e33d-4810-a59e-8aab15b7d72c | deng-xi/NuV2C | cbmc/src/solvers/flattening/boolbv_cond.cpp | /*******************************************************************\
Module:
Author: Daniel Kroening, <EMAIL>
\*******************************************************************/
#include <iostream>
#include "boolbv.h"
/*******************************************************************\
Function: boolbvt::con... | ALGO | 0.965215 | 6.236054 |
39d63203-f6c4-4baf-966e-d195685d29a6 | SamueleVid/competitive_programming | olinfo/maxdifference/code.cpp | #include <bits/stdc++.h>
using namespace std;
#define ll long long
constexpr ll PW = 262144;
struct segment {
vector<ll> seg;
vector<ll> lazy;
segment() {
seg.assign(2 * PW, 0);
lazy.assign(2 * PW, 0);
}
void push_lazy(int idx, int l, int r) {
seg[idx] += lazy[idx];
... | ALGO | 0.999692 | 5.796325 |
75e0fbcf-7ec8-4f0c-8391-4819027e416e | ousttrue/swigbullet | bullet-2.79/BulletCollision/BroadphaseCollision/btMultiSapBroadphase.cpp | #include "btMultiSapBroadphase.h"
#include "btSimpleBroadphase.h"
#include "LinearMath/btAabbUtil2.h"
#include "btQuantizedBvh.h"
/// btSapBroadphaseArray m_sapBroadphases;
/// btOverlappingPairCache* m_overlappingPairs;
extern int gOverlappingPairs;
/*
class btMultiSapSortedOverlappingPairCache : public btSortedOv... | ALGO | 0.968572 | 4.5585 |
13360725-a77b-487e-8c51-a27676e016ff | GrapixLeGrand/Lustrine | thirdparty/Bullet3/bullet3/Extras/ConvexDecomposition/meshvolume.cpp | #include "float_math.h"
#include "meshvolume.h"
// http://codesuppository.blogspot.com
//
// mailto: <EMAIL>
//
// http://www.amillionpixels.us
//
inline float det(const float *p1, const float *p2, const float *p3)
{
return p1[0] * p2[1] * p3[2] + p2[0] * p3[1] * p1[2] + p3[0] * p1[1] * p2[2] - p1[0] * p3[1] * p2[2]... | TOOL | 0.993225 | 6.080237 |
273ee004-5023-4c0c-8359-c949d90d56a1 | pranavsindura/CompetitiveProgramming | codeforces/contest/1364/b.cpp | #include<bits/stdc++.h>
#define ll long long int
#define ld long double
#define pi pair<int,int>
#define eps 0.000000001
#define all(x) x.begin(), x.end()
#define allr(x) x.rbegin(), x.rend()
#define sz(x) ((int)x.size())
#define ln(x) ((int)x.length())
#define mp make_pair
#define pb push_back
#define ff first
#define... | ALGO | 0.999952 | 4.170031 |
f3030e24-f030-4b20-81ee-c04b49aab537 | mfkiwl/Grains3DGPU | Grains/Base/src/GrainsCPU.cpp | #include "GrainsCPU.hh"
#include "Grains.hh"
#include "GrainsParameters.hh"
#include "VectorMath.hh"
#include "ConvexBuilderFactory.hh"
// -----------------------------------------------------------------------------
// Default constructor
template <typename T>
GrainsCPU<T>::GrainsCPU()
{}
// -----------------------... | ALGO | 0.973794 | 6.214815 |
8e8f9cf7-5d58-4a91-8ecf-e1a3bcdef60f | Esther-Qinyx/suanfa | suanfa6.cpp |
//背包问题的贪心算法。
#include <stdio.h>
#define M 4
struct node{
float value;
float weight;
int flag;
}Node[M],temp;
float Value,curvalue=0;
float Weight,curweight=0;
//按性价比排序
void sort(){
int i,j;
for(i=0;i<M-1;i++){
for(j=i+1;j<M;j++){
if((Node[i].value/(float)Node[i].weight)<Node[j].value/(float)Node[j].we... | ALGO | 0.999987 | 3.10539 |
a834202b-9e25-45fa-b6dc-651412c5f464 | dmikushin/mitransform | src/find_controls.cpp | #include <miopen/find_controls.hpp>
#include <miopen/miopen.h>
#include <miopen/miopen_internal.h>
#include <miopen/logger.hpp>
#include <miopen/env.hpp>
#include <miopen/solver_id.hpp>
#include <miopen/stringutils.hpp>
#include <boost/optional.hpp>
#include <ostream>
#include <cstdlib>
#include <cstring>
MIOPEN_DE... | TOOL | 0.955954 | 7.019894 |
0400fc5d-ef3f-43c9-b68c-b9c6239f71ff | gargpriyam21/CPP-Codes | Day17/2.cpp | //
// 2.cpp
//
//
// Created by Neera on 04/07/16.
//
//
#include <iostream>
#include <cstring>
using namespace std;
class Distance
{
private:
int feet,inches;
public:
void Get( )
{
cin>>feet>>inches;
}
Distance operator ++( )
{
feet = this->feet + 1 + (this->inches +... | ALGO | 0.945644 | 3.980159 |
46927777-a860-464d-a0e8-180ed4b500d6 | fciapsa/Competitive-Programming | AceptaElReto/421Hamburguesquin.cpp | #include <iostream>
#include <vector>
#include <algorithm>
struct tRango {
long long int ini, fin;
};
struct tOrd {
bool operator()(tRango const& r1, tRango const& r2) {
return r1.ini < r2.ini || (r1.ini == r2.ini && r1.fin > r2.fin);
}
};
bool resuelve() {
long long int L,N;
std::cin >> L >> N;
if (!std::c... | ALGO | 0.999956 | 3.912757 |
4deddb56-1c84-4d36-a896-f79177957a2a | sourabh1-1/daily_quest | 0930-binary-subarrays-with-sum/0930-binary-subarrays-with-sum.cpp | class Solution {
public:
int numberOfSubarray(vector<int>& nums, int goal){
if(goal<0)
return 0;
int count=0;
int n=nums.size();
int sum=0;
int start=0;
int end=0;
while(end<n){
sum+=nums[end];
while(sum>goal && start<=end){... | ALGO | 0.999995 | 6.136884 |
92ea4438-8425-4b7e-9357-ef3ff5e73066 | Mrinal321/Competitive-Programming-Problem | C_Uninteresting_Number.cpp | #include<bits/stdc++.h>
using namespace std;
#define ll long long int
#define lld long double
//Ordered set(tree)
#include<ext/pb_ds/assoc_container.hpp>
#include<ext/pb_ds/tree_policy.hpp>
using namespace __gnu_pbds;
#define ordered_set tree<ll, null_type, less<ll... | ALGO | 0.999898 | 4.580112 |
fe6d8c1a-3f3c-436a-9e16-a973bb9fdd12 | kusano/TopCoderSRM | SubstringReversal.cpp | /*
TopCoder Open Algorithm 2014 Round 2C Easy SubstringReversal
答えのxは自分より右に自分より辞書順で小さい文字が存在する最左の位置である。ある
位置がこの条件を満たしたときに、より右が答えのxにならないことは自明。ある位置xが
この条件を満たし、xより左の位置がこの条件を満たさないのは、例えば、
S = aabaaaaa, x = 2
この場合、bをより右に送るために、x<2は答えにならない。
yについては全て試せば良い。
*/
#include <string>
#include <algorithm>
#include <vector>
using name... | ALGO | 0.999961 | 5.338849 |
299bffb9-a58c-4b49-b7d3-8f4990326f5d | Shubham-Choudhury/GeeksforGeeks-Problems | 2025/04 April/12 Flood fill Algorithm/main.cpp | // Link: https://www.geeksforgeeks.org/problems/flood-fill-algorithm1856/1
#include <iostream>
#include <vector>
#include <queue>
using namespace std;
class Solution
{
public:
vector<vector<int>> floodFill(vector<vector<int>> &image, int sr, int sc, int newColor)
{
if (image[sr][sc] == newColor)
... | ALGO | 0.996699 | 6.180842 |
359b31fb-55c7-4bc7-8158-35d6e0ead649 | TitoElTico/curso-cenfotec | fundamentos/tareas/evaluadas/conteo-texto/conteo-texto.cpp | /*
Exercises #6
In these exercise, apply as many modern C++ as possible.
Keep any function, struct or enumeration definition on a separate .h file, and any
implementation on a separate .cpp file.
- Exercise: Count Lines, Paragraphs, and Words in a Text File
- Objective: Write a C++ program that reads a text fil... | TOOL | 0.941657 | 6.349557 |
2ad77b71-2d08-45d5-bb31-16e36225e7fe | alvinzhaowei/VD-STAR | boost_1_66_0/libs/multiprecision/example/hashing_examples.cpp | #include <boost/multiprecision/cpp_int.hpp>
#include <boost/random.hpp>
#include <boost/functional/hash.hpp>
#include <unordered_set>
#include <city.h>
//[hash1
/*`
All of the types in this library support hashing via boost::hash or std::hash.
That means we can use multiprecision types directly in hashed containers s... | TOOL | 0.955075 | 6.836455 |
2f346808-081d-468a-b40e-aad8e32edcbc | PeregrineFalcon95/Online-Judge-Ex.-Uva-Solutions | 10000 - 10999/10505.cpp | #include<bits/stdc++.h>
using namespace std;
int visited [ 300 ];
vector < int > graph [ 300 ];
int t , n , m , a , b , c , d , e , lol , j , i , ans , sz;
char color [ 300 ];
map < char , int > mp;
map < char , int >::iterator it;
int bfs ( int source );
int main()
{
scanf("%d",&t);
while ( t-- )
{
... | ALGO | 0.999907 | 4.052751 |
f997de7f-e6d6-43a8-9748-24faf15c12cb | krishnavasavi06/CSA0429-OS | C-Scan DS algorithm.cpp | #include <stdio.h>
#include <stdlib.h>
void sort(int arr[], int n) {
int i, j, temp;
for (i = 0; i < n - 1; i++) {
for (j = 0; j < n - i - 1; j++) {
if (arr[j] > arr[j + 1]) {
// Swap the elements if they are in the wrong order
temp = arr[j];
... | ALGO | 0.99999 | 4.834433 |
b01ea650-8ea1-4e79-a5fd-35cd5c6f3168 | tmdprogramming/WinAPI | ConsoleApplication1/ConsoleApplication1/ConsoleApplication1.cpp | #include <stdio.h>
#include <iostream>
#include <Windows.h>
#include <tlhelp32.h>
#include <locale>
#include <codecvt>
#include <fstream>
#include <io.h>
#include <fcntl.h>
#include <string>
#define THREADCOUNT 5
#define MAX_SIZE 2048
#define SIZE 2048
using namespace std;
class Queue {
private:
int items[SIZE], f... | TOOL | 0.910907 | 4.111581 |
25cde13d-6022-4804-a205-93f10155941e | redbird-arch/isca2025-chimera-artifact | src/communication/backend/booksim2/src/routefunc.cpp | // $Id$
/*routefunc.cpp
*
*This is where most of the routing functions reside. Some of the topologies
*has their own "register routing functions" which must be called to access
*those routing functions.
*
*After writing a routing function, don't forget to register it. The reg
*format is rfname_topologyname.
*
... | ALGO | 0.994722 | 4.493553 |
96bfd18b-e29e-4bdd-b6c0-02c828150b2b | anubhavitis/Competitive-Programming | 1-Codeforces/Codeforces Round 684 Div 2/A.cpp | //Mark XXXII
#include<bits/stdc++.h>
#define ll long long
#define mp make_pair
#define pb push_back
#define lb lower_bound
#define ub upper_bound
#define all(x) x.begin(), x.end()
#define big(x) greater<x>()
#define sp fixe... | ALGO | 0.998789 | 3.217464 |
4b89aa24-0c7c-4af4-a824-86e4e795a7ef | alex-boni/ED | PLANTILLAS ED/PLANTILLAS PROFE/cpp/12_pair_y_tuple/main3.cpp | /*
* ---------------------------------------------------
* ESTRUCTURAS DE DATOS
* ---------------------------------------------------
* Manuel Montenegro Montes
* Facultad de Informática
* Universidad Complutense de Madrid
* ---------------------------------------... | ALGO | 0.998151 | 5.242364 |
f6122b4b-72f3-435b-8d7a-dde3c3b17fe2 | rafpacut/algorithms | spoj/Szyfr_Gronsfelda.cpp | #include <iostream>
#include <cstdio>
using namespace std;
string kod, zadanie;
const int d = int('Z')-int('A')+1;
void read()
{
cin >> zadanie;
cin >> kod;
}
int main()
{
read();
char s;
while( ( s = getchar() ) != '\n' );
s = 1;
if( zadanie == "SZYFRUJ" )
{
for( int p = 0 ; (s = getchar()... | ALGO | 0.999431 | 3.059787 |
298082ff-3c5e-4c50-8997-1494ed6a7aa7 | PandoraLS/C-Programming | Ch04/ch4_ex18.cpp | /*
* @Author: seenli
* @Date: 2020-12-02 14:21:07
* @Last Modified by: seenli
* @Last Modified time: 2020-12-02 16:26:39
*/
/*
Section 4 exercise 18.
Write a program to solve quadratic equations.
ax^2 + bx + c = 0
ax^2 + bx = -c
x^2 + bx/a = -c/a
x^2 + bx/a + (b/2a)^2 = -c/a + (b/2a)^2 complete... | ALGO | 0.998878 | 4.317127 |
d8fec5b8-885b-48e7-936c-36934d7155a6 | namecheker/SE-module-3 | module 3 assignment/qution no 9.cpp | /* 9.find the circumference of triangle formula : triangle = a+b+c */
#include<stdio.h>
int main(){
int a,b,c,triangle;
printf("\n enter the value of a");
scanf("%d",&a);
printf("\n enter the value of b");
scanf("%d",&b);
printf("\n enter the value of c");
scanf("%d",&c);
// circumference of triangle... | ALGO | 0.993452 | 3.01951 |
b185fe51-252f-4e76-b584-6ada8d81bcb2 | mhasan502/Hackerrank | 30 Days of Code/Day 8: Dictionaries and Maps.cpp | #include <bits/stdc++.h>
using namespace std;
int main() {
int n;
cin >> n;
map <string, int> phoneBook;
string name;
for (int i=0; i<n; i++){
cin >> name;
cin >> phoneBook[name];
}
while(cin >> name){
if(phoneBook.find(name) != phoneBook.end())
cout << n... | ALGO | 0.997371 | 4.047208 |
336a151d-69f7-4f37-a806-a65e359ecfe9 | gs252525/boj | swerc2023/L.cpp | #pragma GCC target("sse,sse2,sse3,ssse3,sse4,avx,avx2")
#include <bits/stdc++.h>
#define pb push_back
#define all(v) (v).begin(), (v).end()
#define rep(i, n) for (int i = 0; i < n; ++i)
#define rrep(i, n) for (int i = 1; i <= n; ++i)
#define ff first
#define ss second
using namespace std;
typedef long long ll;
void __... | ALGO | 0.999887 | 4.015945 |
739e7536-0666-4992-951d-94affb48983b | mostafamohsen99/Code_Forces_Problems | 2ndproblem(stringtask)/2ndproblem(stringtask)/2ndproblem(stringtask).cpp | // 2ndproblem(stringtask).cpp : This file contains the 'main' function. Program execution begins and ends there.
//
#include<iostream>
#include<string>
using namespace std;
int main()
{
string str;
cin >> str;
for (int i = 0; i < str.length(); i++)
{
if (str[i] >= 'A'&&str[i] <= 'Z')
{
str[i] += 32;
}
}
... | ALGO | 0.999179 | 4.514226 |
6599d889-c6e2-42f5-a56f-cbcc27a37cd1 | rachelmyl/ECE244-Programming-Fundamental | lab_3_valgrind_tutorial/parser.cpp | #include <iostream>
#include <sstream>
#include <string>
using namespace std;
#include "globals.h"
#include "Shape.h"
/*
* Take a sequence of command as input
* The commands create, delete modify and display shapes to be drawn on the screen.
* Each command consists of an operation keyword followed by arguments.
... | TOOL | 0.906733 | 5.340408 |
e8f4329c-4bcc-476d-a1be-01e3c42c6260 | gamecoder08/Data_structures_algorithms | Data Structures/Trees/Binary Trees/Binary Tree Traversal/Pre_In_Post_Order/binary_tree_traversal.cpp | #include <iostream>
class Node
{
public:
int data;
Node *left;
Node *right;
Node(int value)
{
data = value;
left = NULL;
right = NULL;
}
};
void preorder(Node *root)
{
if (root == NULL)
{
return;
}
std::cout << root->data << " ";
preorder(ro... | ALGO | 0.999857 | 5.820015 |
1c29fe6e-e14c-4bb5-aff5-da0d794f82a7 | Abhi52811/Cpp-Java | C++/DSA/Week 3 - Arrays/Class 2/PQ1.cpp | #include <bits/stdc++.h>
using namespace std;
int findUnique(vector<int> arr)
{
int ans = 0;
for (int i = 0; i < arr.size(); i++)
{
ans = ans ^ arr[i];
}
return ans;
}
int main()
{
// UNique Element
int n;
cout << "Enter the size of array : " << endl;
cin >> n;
vect... | ALGO | 0.999546 | 5.161448 |
4dfe4ff4-10a0-405a-b07a-be71fc6c88ef | MahajanYashasvi156/LeetCoding | Strongly Connected Components (Kosaraju's Algo) - GFG/strongly-connected-components-kosarajus-algo.cpp | // { Driver Code Starts
#include<bits/stdc++.h>
using namespace std;
// } Driver Code Ends
class Solution
{
void dfs(int src,stack<int>&s,vector<int> &visited,vector<int>adj[])
{
if(visited[src])
return;
visited[src]= 1;
for(int n: adj[src])
{
... | ALGO | 0.999367 | 6.293876 |
22c5dafd-afd3-4f2f-acaa-df34accee56b | fmosmanfaruq/Codeforces-problem | Problem-617A.cpp | #include<iostream>
using namespace std;
int main()
{
int n,r=0;
cin>>n;
r= n/5;
if(n%5!=0)
{
r++;
}
cout<<r<<endl;
} | ALGO | 0.999619 | 3.885081 |
b376a26c-db6b-4925-b157-fdd59b6e475e | sarthakgit21/leetcode | 1572-matrix-diagonal-sum/1572-matrix-diagonal-sum.cpp | class Solution {
public:
int diagonalSum(vector<vector<int>>& mat) {
int ans=0 ;
int j=mat[0].size()-1;
for(int i =0;i<mat.size();i++){
ans=ans+mat[i][i];
if(i!=j) ans=ans+mat[i][j];
j--;
}
return ans;
}
}; | ALGO | 0.999951 | 5.874558 |
54178cf8-db0d-4de4-865b-f681c95721f4 | cheongpark/Online_Judge_code | codeup/C_CPP/1095 codeup.cpp | #include <iostream>
#include <algorithm>
using namespace std;
int main()
{
int a = 0, in[10000] = {};
cin >> a;
for (int i = 0; i < a; i++)
cin >> in[i];
sort(in, in + a);
cout << in[0];
}
| ALGO | 0.99975 | 3.29582 |
360cb56e-9ecb-48f7-bb57-029b5a771ba1 | YashSuthar983/CodeForces | 4.C_RegistrationSystem.cpp | #include<bits/stdc++.h>
#include<chrono>
#define ll long long
using namespace std;
using namespace std::chrono;
int main()
{
ios_base::sync_with_stdio(false);
cin.tie(NULL);
ll test;
cin>>test;
unordered_map<string,int> feq;
while ((test--))
{
string s;
cin>>s;
string... | ALGO | 0.999835 | 4.719092 |
e301d94d-0996-4ad6-aad3-12e6ad2a9a32 | sophieJ07/CCC-Senior-cpp | 2007/S4_2007.cpp | #include <iostream>
#include <vector>
#include <algorithm>
using namespace std;
//Waterpark
//dynamic programming + graph theory
//start from bottom, update the number of path down from one particular point
int numPaths[10000];
int main(){
int n;
cin >> n;
vector<vector<int>> paths(10000);
int a, b;
ci... | ALGO | 0.999468 | 4.204857 |
c815d5ea-c1da-4945-a2ac-3ec3a5384a70 | jadonsooraj/Data-Structures-Practice-Programs | Accenture_Questions/Replace_characters.cpp | #include<iostream>
#include<string>
using namespace std;
string replace_occurance(string str){
string ans;
for(char c: str){
if(c=='a')ans+='b';
else if(c=='b') ans+='a';
else ans+=c;
}
return ans;
}
main(){
cout<<"Enter String:"<<endl;
string str;
getline(cin,str)... | ALGO | 0.998757 | 3.571617 |
11855d8e-ca91-43d4-8149-82ffa83e9fb3 | karouzakisp/llvm-bit-manip | libcxx/test/std/algorithms/alg.nonmodifying/alg.adjacent.find/adjacent_find.pass.cpp | // <algorithm>
// template<ForwardIterator Iter>
// requires EqualityComparable<Iter::value_type>
// constexpr Iter // constexpr after C++17
// adjacent_find(Iter first, Iter last);
#include <algorithm>
#include <cassert>
#include "test_macros.h"
#include "test_iterators.h"
#if TEST_STD_VER > 17
TEST_CONSTEX... | TEST | 0.978664 | 5.936117 |
547595be-4495-4be0-aa74-9d57a3759f64 | itsjay07/GFG | Pascal Triangle.cpp | class Solution{
public:
vector<long long> nthRowOfPascalTriangle(int n) {
vector<long long> prev;
prev.push_back(1LL);
for (int i = 1; i < n; i++)
{
vector<long long> next;
next.push_back(1LL);
for (int j = 1; j < prev.size(); j++)
... | ALGO | 0.99992 | 5.715759 |
4ebf136b-b5ee-4a4b-a860-fff340f1f6d8 | 113bommy/deepmind_codecontests_refine | cpp_gold_filter_file/cpp_train_12191_12.cpp | #include <bits/stdc++.h>
using namespace std;
struct block {
vector<int> first;
int second;
};
block different_blocks[1000];
int no_of_different_blocks = 0;
int no_of_different_divisors = 0;
bool v[1000009];
long long primes[1000009];
int n_primes;
int tmp[1000];
void pre_process();
int sieve();
int fn(int current,... | ALGO | 0.999526 | 4.58485 |
d618a853-ff85-48c3-8cc1-ee5ddfe37e7c | Rasie1/CS316 | Task3/Classes/GameOfLife/World.cpp | #include "World.h"
#include <cmath>
#include <iostream>
#include <chrono>
#include <thread>
using namespace std;
World::World(int w, int h, double population) :
width(w),
height(h),
population(population),
curr(height, std::vector<bool>(width)),
next(height, std::vector<bool>(width))
{
for (in... | ALGO | 0.998776 | 4.942587 |
e18c297f-c5d8-4c89-b720-78394510e91a | ahmedalam782/Data-Structures-and-Algorithms-Specialization | Advanced Algorithms and Complexity/Week 3/cleaning_apartment.cpp | #include <bits/stdc++.h>
using namespace std;
struct Edge {
int from;
int to;
};
struct ConvertHampathToSat {
int numVertices;
vector<Edge> edges;
ConvertHampathToSat(int n, int m) :
numVertices(n),
edges(m)
{}
int calc_index(int i, int j)
{
return i + j*numVertices + 1;
}
void printEquisatisfiabl... | ALGO | 0.999864 | 4.184697 |
e3a65dbc-1b0f-4686-8d01-6f61e4eea1ab | rohit141914/LeetCode | 2681-put-marbles-in-bags/2681-put-marbles-in-bags.cpp | class Solution {
public:
long long putMarbles(vector<int>& weights, int k) {
// We collect and sort the value of all n - 1 pairs.
int n = weights.size();
vector<int> pairWeights(n - 1, 0);
for (int i = 0; i < n - 1; ++i) {
pairWeights[i] += weights[i] + weights[i + 1];
... | ALGO | 0.999908 | 5.736846 |
bf072df6-57f1-4205-807f-eb8362c21634 | rorororom/HashTable | hash/hash_table.cpp | #include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <assert.h>
#include "hash_table.h"
List* LST_Create() {
List* list = (List*)malloc(sizeof(List));
if (list == NULL) {
return NULL;
}
list->fixedElement = NULL;
list->length = 0;
list->capacity = START_CAPACITY;
r... | ALGO | 0.98331 | 4.733366 |
08266e9d-f9b1-47e9-87e8-00584730afe9 | Vidit-Ostwal-zz/DSA-Codes | Algorithms/Quick_Sort.cpp | /*
A pivot is chosen, and after the first pass, all the elements lesser than pivot go to the left side of pivot and all the elements bigger than pivot are on the right side of pivot, In easier manner, the pivot element comes at it’s right position.
In merge sort, even if the half side is sorted it will go to the very e... | ALGO | 0.999998 | 5.554179 |
163abb4f-610a-4740-b91a-be1a7f2d3b3e | Suchi14052001/DataStructuresAndAlgorithms | 06_Sorting_Searching/17_reading_books.cpp | /*
Given number of pages in n different books and m students
Books are arranged in any order of number of pages
* Every student is assigned to read some consecutive segment of books
* Task is to assign books in such a way that max num of pages assigned to a student is minimum
*/
#include <iostream>
#include <vector>... | ALGO | 0.999973 | 5.824122 |
bb084077-f665-459b-b0ea-f331e9922953 | SanSanchezzz/technopark_algorithms-data_structures | module_2/it_1/source/best_vers.cpp | #include <iostream>
#include <vector>
#include <string>
#include <assert.h>
#define OK "OK"
#define FAIL "FAIL"
size_t str_hash_1(const std::string &data, size_t size) {
size_t hash = 0;
size_t arg = 13;
for (size_t i = 0; data[i] != 0; i++) {
hash += (hash * arg + data[i]) % size;
}
ret... | ALGO | 0.99919 | 5.076108 |
5e1639f2-04d3-4f74-9e18-fadd3525f6f2 | Tongyuang/EdgeTile | EdgeTileClient/deps/opencv/samples/cpp/kalman.cpp | #include "opencv2/video/tracking.hpp"
#include "opencv2/highgui.hpp"
#include <stdio.h>
using namespace cv;
static inline Point calcPoint(Point2f center, double R, double angle)
{
return center + Point2f((float)cos(angle), (float)-sin(angle))*(float)R;
}
static void help()
{
printf( "\nExample of c calls to... | ALGO | 0.988817 | 5.922791 |
c9b4efb5-0701-48be-a8e8-13469c48a9da | Sanketpatil27/DSA | Trees/Binary Trees/Max_Width_Of_Tree.cpp | #include<iostream>
#include<queue>
#include<climits>
using namespace std;
struct Node
{
int data;
Node *left;
Node *right;
Node(int val)
{
data = val;
left = NULL;
right = NULL;
}
};
int getMaxWidth(Node* root) {
// time: O(N) space: O(Width)
// we simply use... | ALGO | 0.999989 | 5.904704 |
89ad2703-4ecc-4dcc-b573-169403840297 | Kamlesh-Bhatt-52625/cpp | Basic/3_sum.cpp | // SUM OF FIRST N NATURAL NUMBERS
#include<iostream>
using namespace std;
int main(){
int n, sum;
cout<<"Enter the value of n:\n";
cin>>n;
sum = n* (n+1)/2;
cout<< "The sum of first "<<n<<" natural numbers is:"<<sum<<endl;
return 0;
} | ALGO | 0.936772 | 3.608681 |
e8520430-5d88-4ea6-8a2b-9d7fe2fabe2e | jinclef/algorithm | sds/practices/10610.cpp | #include <iostream>
#include <string>
#include <algorithm>
using namespace std;
typedef long long ll;
const int MAX = 100000;
char letters[MAX+1];
bool compare(char a, char b) {return a>b;}
int main(){
string N;
cin >> N;
for (int i=0;i<N.length();i++){
letters[i] = N[i];
}
// 0 개수 세기
... | ALGO | 0.999826 | 4.760584 |
ed46d2dc-f394-40db-b246-9a52e9dd19c3 | souravjena/stanford-cs106b | Assignment1-qt/4-NumericConversion/lib/StanfordCPPLib/io/filelib.cpp | /*
* File: filelib.cpp
* -----------------
* This file implements the filelib.h interface. All platform dependencies
* are managed through the platform interface.
*
* @version 2016/11/20
* - small bug fix in readEntireStream method (failed for non-text files)
* @version 2016/11/12
* - added fileSize, readEnt... | TOOL | 0.956152 | 6.459037 |
01a750de-4ca3-4ad1-bf29-8f5ac34cada1 | cocobisc/PS | 백준/9527- 1의 개수 세기.cpp | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
ll ans;
int main() {
ll A, B;
cin >> A >> B;
for (ll i = 2; i / 2 <= B; i <<= 1) {
ans += (B + 1) / i * (i / 2);
ll res = (B + 1) % i - i / 2;
if (res > 0) ans += res;
}
for (ll i = 2; i / 2 <= A; i <<= 1) {
ans -= (A / i) * (i ... | ALGO | 0.999926 | 3.655101 |
578e75a0-6685-4f7c-919c-ea55160e2c63 | Apress/learn-cocos2d-game-dev-w-ios-5 | CH14_code/Tilemap13/libs/Box2d/Dynamics/Contacts/b2ContactSolver.cpp | #include <Box2D/Dynamics/Contacts/b2ContactSolver.h>
#include <Box2D/Dynamics/Contacts/b2Contact.h>
#include <Box2D/Dynamics/b2Body.h>
#include <Box2D/Dynamics/b2Fixture.h>
#include <Box2D/Dynamics/b2World.h>
#include <Box2D/Common/b2StackAllocator.h>
#define B2_DEBUG_SOLVER 0
b2ContactSolver::b2ContactSolver(b2Conta... | ALGO | 0.99949 | 6.633346 |
b4054725-c00e-45af-8529-0cfca79f43d8 | Beatriz-Diniz/Laboratorio-de-Algoritmos-Avancados-I | Ex25/string1.cpp | #include <iostream>
#include <string>
#include <vector>
// Function to calculate the prefix array
std::vector<int> calculatePrefix(const std::string& pattern){
int patternLength = pattern.length();
std::vector<int> prefix(patternLength);
int k = 0;
for(int i = 1; i < patternLength; i++){
while(k > 0 && pattern[... | ALGO | 0.999872 | 6.527546 |
ac6578dd-a633-4342-813f-2237be1f98ce | LuniumLuk/Games202 | homework2/prt/ext/eigen/bench/sparse_product.cpp |
//g++ -O3 -g0 -DNDEBUG sparse_product.cpp -I.. -I/home/gael/Coding/LinearAlgebra/mtl4/ -DDENSITY=0.005 -DSIZE=10000 && ./a.out
//g++ -O3 -g0 -DNDEBUG sparse_product.cpp -I.. -I/home/gael/Coding/LinearAlgebra/mtl4/ -DDENSITY=0.05 -DSIZE=2000 && ./a.out
// -DNOGMM -DNOMTL -DCSPARSE
// -I /home/gael/Coding/LinearAlgebr... | ALGO | 0.994306 | 4.164869 |
517e0254-b767-4c60-b75d-9ace16e79c3e | KevinKingZhan/cross_compile_project | ffmpeg_2.8.5_android/external_libs/fdk-aac/libAACenc/src/band_nrg.cpp |
/* -----------------------------------------------------------------------------------------------------------
Software License for The Fraunhofer FDK AAC Codec Library for Android
Copyright 1995 - 2013 Fraunhofer-Gesellschaft zur Frderung der angewandten Forschung e.V.
All rights reserved.
1. INTRODUCTION
T... | ALGO | 0.998201 | 6.379401 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.