uuid string | repo_name string | relative_path string | content string | category string | algo_rel_score float64 | quality_score float64 |
|---|---|---|---|---|---|---|
47cffc55-d29a-4a91-892c-33c14ed5202f | backengineering/llvm-msvc | llvm/lib/Analysis/PhiValues.cpp | #include "llvm/Analysis/PhiValues.h"
#include "llvm/ADT/SmallVector.h"
#include "llvm/IR/Instructions.h"
#include "llvm/InitializePasses.h"
using namespace llvm;
void PhiValues::PhiValuesCallbackVH::deleted() {
PV->invalidateValue(getValPtr());
}
void PhiValues::PhiValuesCallbackVH::allUsesReplacedWith(Value *) {
... | TOOL | 0.982216 | 7.821162 |
e02c873a-19ba-4883-bcb2-eab673ec08e3 | giuliamf/paa_t1 | mergesort.cpp | #include <iostream>
#include <vector>
using namespace std;
// Função merge que junta dois subarrays ordenados
void merge(vector<int>& arr, int left, int mid, int right) {
int n1 = mid - left + 1; // tamanho do primeiro subarray
int n2 = right - mid; // tamanho do segundo subarray
vector<int> L(n1), R(n... | ALGO | 0.999982 | 6.289632 |
0cdc64d0-9862-472b-8aed-dbc149064bf0 | sumayyaDev/cpp | Bootcamp_S13/Bootcamp_W5/w5_class2.cpp | #include<bits/stdc++.h>
using namespace std;
//prime factorization
//Find the prime factors of n
/*vector<int> prime_factors(int n)
{
vector<int> result;
for(int p=2; p<=n; p++){
while(n%p == 0){
n /= p;
result.push_back(p);
}
}
return result;
}*/
//prime factorization-->... | ALGO | 0.999933 | 3.546441 |
e9f2d4dd-a52f-4a55-8cc0-9f1e03917b00 | Furyton/cg-lab | simple_phone_model/smoothRotator.cpp | #include "header/smoothRotator.hpp"
bool SmoothRotator::calc() {
T += 0.0075f;
std::cout<<std::endl<<"t: "<<T<<std::endl;
if (fabs(T - 1.0f) < 1e-6 || T > 1.0f) return true;
q_t = (1-T) * q_0 + T * q_1;
q_t = q_t / glm::sqrt(q_t.w * q_t.w + q_t.x * q_t.x + q_t.y * q_t.y + q_t.z * q_t.z);
... | ALGO | 0.879808 | 4.92832 |
7393f982-dfaa-434f-9531-38ebb97a1e1c | tecshogo/contest | ABC/147/B/answer.cpp | #define rep(i, n) for (int i = 0; i < (n); i++)
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using P = pair<int, int>;
const int MOD = 1000000007;
// MAX int 2,147,483,647
// MAX O(n) 10^18
int main() {
string S;
cin >> S;
int numOfTry = S.size() / 2;
int ans = 0;
rep(i, num... | ALGO | 0.999954 | 4.113951 |
bce9a15b-c64c-47cd-b110-9df594fed381 | stevenbai0724/Codeforces-Solutions | johnnyAndHisHobbies.cpp | //https://codeforces.com/problemset/problem/1362/B
#include <bits/stdc++.h>
using namespace std;
#define int long long
signed main(){
cin.tie(nullptr)->sync_with_stdio(false);
int t; cin>>t;
while(t--){
int n; cin>>n;
vector<int>arr(n+1);
for(int i=1;i<=n;i++){
cin>... | ALGO | 0.999654 | 4.582675 |
46b3f813-be64-4d6e-839c-de8b64e1c491 | Rehan0705/CODING | Triangles.cpp | #include<iostream>
using namespace std;
int main()
{
for(int i=1;i<5;i++)
{
for(int j=4;j>i;j--)
{
cout<<" ";
}
for(int k=1;k<=(2*i-1);k++)
{
cout<<"*";
}
cout<<"\n";
}
return 0;
}
| ALGO | 0.999869 | 3.321068 |
102a11de-ea6d-40c1-b32a-ed675fc2fce3 | VVCodec/PPCM-PWRDO | PWRDO/PWRDO/How to Compile/dependencies/HDRTools/common/src/FrameFilterNLMeans.cpp | /*!
*************************************************************************************
* \file FrameFilterNLMeans.cpp
*
* \brief
* FrameFilterNLMeans Class (NL means filtering)
* Code is a C++ port of the code provided by Chad on the xyz-ee1 reflector (12/6/2015)
* The algorithm is based on work from... | ALGO | 0.996819 | 5.800076 |
cdd344b9-e32b-40f1-871a-eadfb9b0ef28 | GaurangRastogi/DAA-Assignments | Lab Fat/folderDaa/1.Sorting/4.quick_sort.cpp | #include<bits/stdc++.h>
using namespace std;
int partition(vector<int>&arr,int st,int end){
int random= st+ (rand() % end);
int pivot=st;
//instead of st as pivot, taking random as pivot,
// kind-of randomized quick sort
swap(arr[random],arr[pivot]);
while(st<end){
while(arr[st]<=a... | ALGO | 0.999895 | 5.646842 |
790c118b-0231-4a68-8cb9-111b4b3b66ff | sdgent/CS_161_2015 | rangeSum.cpp | // Author: Steven Gentry
// Created:1/23/15
// Last Modified:1/25/15
// Description:rangeSum.cpp
// User enters 2 integers. and all numbers (inclusive) are summed between those numbers
// and the total is output
#include <iostream>
using namespace std;
int main()
{
int sum=0,integer1,integer2; //user input varia... | ALGO | 0.980426 | 4.548221 |
1c90fb22-a148-408f-b673-06008419e036 | sarvex/leetcode-coffeescript | lcof2/剑指 Offer II 019. 最多删除一个字符得到回文/Solution.cpp | class Solution {
public:
bool validPalindrome(string s) {
for (int i = 0, j = s.size() - 1; i < j; ++i, --j)
if (s[i] != s[j])
return check(s, i + 1, j) || check(s, i, j - 1);
return 1;
}
bool check(string s, int i, int j) {
for (; i < j; ++i, --j)
... | ALGO | 0.999981 | 6.395447 |
c9c504ce-aa4c-4198-b416-6f9a07021b92 | CrutoSJ/GFG-Leetcode_CPP-Python | #GFG-Daily/LLGroupReverse.cpp | // #Question:-
// Link-> https://www.geeksforgeeks.org/problems/reverse-a-linked-list-in-groups-of-given-size/1
// Date-> 21/01/25
// #Solution:-
#include<bits/stdc++.h>
using namespace std;
struct Node
{
int data;
struct Node* next;
Node(int x){
data = x;
next ... | ALGO | 0.999995 | 5.58005 |
42ad8760-25ba-43ca-aee1-676e5ec47116 | adni03/DSA-Program-Files | Stack/stack_intopostfix.cpp | //INFIX TO POSTFIX
#include<iostream>
#include<ctype.h>
using namespace std;
struct stack
{
int size, top;
char elements[50];
};
//function defs
void push(stack &m, char x);
char pop(stack &m);
void convert(stack &m, char c[], int n);
void decide(stack &m, char c);
void pop_dat(stack &m, char c);
int main()
{
... | ALGO | 0.999867 | 3.96405 |
635bed4d-6da4-4d3c-b853-8b519c1dad4f | farleymatos/CalculadoraLingProg | parse.cpp | /*
TRABALHO DE LINGUAGENS DE PROGRAMAO
Calculadora em linha de comando
-Linguagem C++
-Modularizada
-Compartilhada pelo GitHub
Professor: Leonardo Nunes
Alunos: Bruno saraiva
Farley Matos
Laura Panzariello
Stephanie Cancado
Ti... | ALGO | 0.956584 | 3.891309 |
bb8554d9-9e3d-4518-8bab-7dc2d8b6f893 | Vijitverm1234/DSA-Revision-Journey- | Sorting/Selection_Bubble_Sort.cpp | #include<iostream>
#include<vector>
using namespace std;
class Sort{
public:
void SelectionSort(vector<int> arr,int n){
for(int i=0;i<n;i++){
for(int j=i+1;j<n;j++){
if(arr[i]>arr[j]){
swap(arr[i],arr[j]);
}
}
}
... | ALGO | 0.999816 | 4.630949 |
2e658457-3571-4137-87c5-656b66693ba8 | liudong206/Apollo_control_algorithm | Eigen-3.3/doc/special_examples/Tutorial_sparse_example_details.cpp | #include <Eigen/Sparse>
#include <vector>
#include <QImage>
typedef Eigen::SparseMatrix<double> SpMat; // declares a column-major sparse matrix type of double
typedef Eigen::Triplet<double> T;
void insertCoefficient(int id, int i, int j, double w, std::vector<T>& coeffs,
Eigen::VectorXd& b, con... | ALGO | 0.998177 | 5.388735 |
81f5f51d-5391-41c5-8387-e96600a068fa | Yash-op7/fullSpeedAhead | media.net/cfbitmaskingdp.cpp | #include <bits/stdc++.h>
using namespace std;
#define vi vector<int>
#define vvi vector<vi>
#define vvvi vector<vvi>
#define vb vector<bool>
#define vvb vector<vb>
#define vvvb vector<vvb>
#define pq priority_queue
#define ll long long
#define all(x) (x).begin(), (x).end()
#define vl vector<ll>
#define vvl vector<vl>
... | ALGO | 0.999864 | 3.266227 |
47996ac5-4dfe-4609-a4ce-74bcb2480d71 | jpostel/FreeBSD-sandbox | contrib/llvm/lib/Transforms/Utils/DemoteRegToStack.cpp | #include "llvm/Transforms/Utils/Local.h"
#include "llvm/Function.h"
#include "llvm/Instructions.h"
#include "llvm/Type.h"
#include <map>
using namespace llvm;
/// DemoteRegToStack - This function takes a virtual register computed by an
/// Instruction and replaces it with a slot in the stack frame, allocated via
/// a... | TOOL | 0.938983 | 7.297269 |
82e23918-f73e-48d8-842b-15a11ce1e001 | yash-gargji/codeforces-solution | C_You_Soared_Afar_With_Grace.cpp | #include<bits/stdc++.h>
using namespace std;
#define int long long
signed main(){
int t;
cin>>t;
while(t--){
int n;
cin>>n;
int a[n];
int b[n];
map<int,int>mb;
for(int i = 0;i<n;i++){
cin>>a[i];
}
int count = 0;
... | ALGO | 0.999834 | 3.352031 |
dea30cd6-6184-488f-a062-04e3da3e2475 | yuran653/CPP_Module02 | ex03/src/bsp.cpp | /* ************************************************************************** */
/* */
/* ::: :::::::: */
/* bsp.cpp :+: :+: :+: ... | ALGO | 0.998204 | 5.683533 |
6e29e26b-10bc-4845-a241-9e1bf840de1e | abhipsa14/Basics-DSA | DSA/graphs/dfs.cpp | #include <bits/stdc++.h>
using namespace std;
class Solution {
public:
void dfs(int node, vector<int> adj[], int vis[], vector<int> &ls) {
vis[node] = 1;
ls.push_back(node);
// traverse all its neighbours
for(auto it : adj[node]) {
// if the neighbour is not visited... | ALGO | 0.999974 | 5.298012 |
7a8b4adf-15cd-4774-886b-c9a35440f77f | TirilaPatricGabriel/Data-Structures-and-Problem-Solving | Problems/230. Kth Smallest Element in a BST/InorderSolution.cpp | #include <iostream>
#include <vector>
using namespace std;
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(... | ALGO | 0.999978 | 5.948994 |
4a6598d2-9937-4143-8737-364760135d96 | SSRockySS/learnGit | cpppC3/e461.cpp | /*++*/
#include<iostream>
using namespace std;
int main(void)
{
int iVal1;
int iVal2;
//cout<<++iVal1<<endl;
//cout<<iVal2++<<endl;
for(iVal1 = 0;iVal1<10;cout<<iVal1++)
cout<<" ";
cout<<iVal1<<endl;
for(iVal2 = 0;iVal2<10;cout<<++iVal2)
cout<<" ";
cout<<iVal2<<endl;
return 0;
}
| TOOL | 0.989628 | 3.325816 |
448464b0-f317-4d19-ad07-721fa218ec83 | ishandutta2007/codeforces | alex_wei/normal/463/B.cpp | #include<bits/stdc++.h>
using namespace std;
int n,h[100005],ans;
int main()
{
cin>>n;
for(int i=1;i<=n;i++)
cin>>h[i],ans=max(ans,h[i]);
cout<<ans;
return 0;
} | ALGO | 0.999655 | 3.732503 |
59ac6c89-2dec-4d1e-b1cd-6677d4b8bcb2 | 113bommy/deepmind_codecontests_refine | cpp_source_filter_file/cpp_train_8242_8.cpp | #include <bits/stdc++.h>
using namespace std;
const int M = 1e5 + 5;
int n, m;
vector<int> row[M], col[M];
int Left, Right, Top, Bottom;
struct STC {
int x, y, d;
};
STC next(STC o) {
if (o.d == 1) {
int max_y = Right;
for (auto i : row[o.x]) {
if (i > o.y) max_y = min(max_y, i - 1);
}
Right =... | ALGO | 0.999982 | 4.229727 |
ce3ec412-b9e5-48a1-a9d6-bb2363772b0d | sarah21392773/Mycode | zerojudge/Other/基礎題庫/d732. 二分搜尋法_2.cpp | #include <bits/stdc++.h>
#define int long long
using namespace std;
int n,k,x,nums[100005];
signed main(){
cin.tie(0);ios::sync_with_stdio(false);
cin >> n >> k;
for(int i=0;i<n;i++){
cin >> nums[i];
}
while(k--){
cin >> x;
if(binary_search(nums,nums+n,x)){
cout... | ALGO | 0.999949 | 4.529726 |
11887cdf-cbfb-42cd-80b4-43c6abbeacd9 | qwerty1994/lab3 | p10-14/minmax.cpp | #include "convert.h"
#include "sdt.h"
void minimax(const vector<Temperature> temp_res, Temperature &minimum, Temperature &maximum, Temperature &average)
{
using namespace std;
average.value=0;
maximum.value=0;
minimum=temp_res[0];
for (Temperature x:temp_res)
{
if (x < minimum)
... | ALGO | 0.999056 | 5.038523 |
cdecd11f-553e-41cc-838f-5742d8478cd2 | ishandutta2007/codeforces | tute7627/normal/1517/A.cpp | //#define _GLIBCXX_DEBUG
#include<bits/stdc++.h>
using namespace std;
#define endl '\n'
#define lfs cout<<fixed<<setprecision(10)
#define ALL(a) (a).begin(),(a).end()
#define ALLR(a) (a).rbegin(),(a).rend()
#define spa << " " <<
#define fi first
#define se second
#define MP make_pair
#define MT make_tuple
#define P... | ALGO | 0.99941 | 4.266954 |
3ef3e124-fc48-4f24-ae8a-7ad654741a11 | EcutDavid/oj-practices | leetcode/121.cpp | #include <algorithm>
#include <vector>
using namespace std;
class Solution {
public:
int maxProfit(vector<int>& p) {
int ret = 0;
int prevMax = 0;
for (auto it = p.rbegin(); it != p.rend(); it++) {
ret = max(ret, prevMax - *it);
prevMax = max(prevMax, *it);
}
return ret;
}
};
| ALGO | 0.999697 | 5.814613 |
c3f1dad3-9350-4210-9d6f-8efba476ccfc | Hongcheng-Xiang/ardupilot | libraries/AC_PID/AC_P.cpp | /// @file AC_P.cpp
/// @brief Generic P algorithm
#include <AP_Math/AP_Math.h>
#include "AC_P.h"
const AP_Param::GroupInfo AC_P::var_info[] = {
// @Param: P
// @DisplayName: PI Proportional Gain
// @Description: P Gain which produces an output value that is proportional to the current error value
AP_G... | TOOL | 0.98067 | 3.208479 |
77623f25-7692-49e9-a041-db195835a4e1 | donbasta/leetcode-submissions | Hard/968.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.999969 | 6.975437 |
fc7ba307-6507-49ed-8d55-38c335fe925b | MdReyadHossain/CodeforcesSolved | 50A - Domino piling.cpp | #include <iostream>
using namespace std;
main() {
int m, n, d = 2;
cin >> m >> n;
int result = (m * n)/d;
cout << result << endl;
} | ALGO | 0.999602 | 3.826846 |
ffdf814b-13e1-49b7-84d2-53398a9c5d60 | xiehuc/MPI_IO_Reply | src/lcs_merge_trace.cpp | #include "ts.h"
#include <time.h>
#include <iostream>
#include <vector>
#include <string>
#include <algorithm>
#include <iterator>
#include <fstream>
#include <sys/stat.h>
#include "preprocess.h"
using namespace std;
// preprocess time
struct timespec pp_time;
// merge time
struct timespec merge_time;
// post proces... | ALGO | 0.99266 | 4.226826 |
4d25d6f2-bd48-4748-9332-fb651f54943d | Hyarius/TAAG-3D-redesign | srcs/basics/basic_function.cpp | #include "template.h"
#include "base_value.h"
void error_exit(string msg, int error)
{
printf("Error %d : %s\n", error, msg.c_str());
getchar();
exit(error);
}
t_vect get_mouse_coord()
{
int x;
int y;
SDL_GetMouseState(&x, &y);
return(t_vect(x, y));
}
void get_leaks(string msg)
{
//system("clear"... | TOOL | 0.894132 | 3.607765 |
2533a4b4-b8fc-4988-bf94-168ec2939846 | raptoravis/forwardplusrendering | thirdparty/boost_1_70_0/libs/multiprecision/example/hypergeometric_luke_algorithms.cpp | #include <algorithm>
#include <cstdint>
#include <deque>
#include <functional>
#include <iostream>
#include <limits>
#include <numeric>
#include <vector>
#include <boost/math/constants/constants.hpp>
#include <boost/noncopyable.hpp>
//#define USE_CPP_BIN_FLOAT
#define USE_CPP_DEC_FLOAT
//#define USE_MPFR
#if !defined... | ALGO | 0.999241 | 4.336036 |
5b8921bd-8d13-4b6a-bc70-6f4bb157dca4 | 19-hanhan/LSG | c_api/IndexIVF_c.cpp | #include "Index_c.h"
#include "Clustering_c.h"
#include "IndexIVF_c.h"
#include "IndexIVF.h"
#include "macros_impl.h"
using faiss::IndexIVF;
using faiss::IndexIVFStats;
DEFINE_DESTRUCTOR(IndexIVF)
DEFINE_INDEX_DOWNCAST(IndexIVF)
/// number of possible key values
DEFINE_GETTER(IndexIVF, size_t, nlist)
/// number of p... | ALGO | 0.922091 | 5.818144 |
35a753c5-74bc-4dfc-a4ae-2da8066efc84 | Alberl-Lee/miniblink57-VS2022 | third_party/WebKit/Source/web/tests/TextFinderTest.cpp | #include "web/TextFinder.h"
using blink::testing::runPendingTasks;
namespace blink {
class TextFinderTest : public ::testing::Test {
protected:
TextFinderTest()
{
m_webViewHelper.initialize();
WebLocalFrameImpl& frameImpl = *m_webViewHelper.webView()->mainFrameImpl();
frameImpl.viewIm... | TEST | 0.889588 | 5.288566 |
efd3f243-a902-4b61-b6c8-6bfab821d2a0 | rlorigro/overlap_analysis | src/executable/dotplot.cpp | using overlap_analysis::FastqElement;
using overlap_analysis::FastqIterator;
#include "boost/program_options.hpp"
#include <boost/accumulators/accumulators.hpp>
#include <boost/accumulators/statistics.hpp>
using boost::program_options::options_description;
using boost::program_options::variables_map;
using boost::pro... | DATA | 0.964369 | 5.796924 |
7222074d-0777-429d-8311-69a129f73e34 | sarvex/leetcode-chai | solution/2400-2499/2487.Remove Nodes From Linked List/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* removeNodes... | ALGO | 0.999995 | 5.946305 |
bdc444c4-bec0-46f6-9c38-81319e9db5d3 | joyeeta26/C-Codes | DS/stacks.cpp | #include<iostream>
#include<stack>
using namespace std;
struct Node
{
int data;
Node* next;
};
struct Node* top=NULL;
//Stack Reversal
void Reverse()
{
if(top==NULL)
return;
stack<Node*> S;
Node* temp=top;
while(temp!=NULL)
{
S.push(temp);
temp=temp->next;
}
top=S.top();
temp=S.top();
S.pop();
while(!... | ALGO | 0.997798 | 3.842804 |
dda184b0-daad-45d3-aa01-06ae434409af | rezwan4029/UVA-CODES | 11960 - Divisor Game.cpp | /*
Rezwan_4029
AUST , CSE-25
*/
#include<stdio.h>
#include<iostream>
#include<cstring>
#include<string>
#include<cctype>
#include<vector>
#include<cmath>
#include<sstream>
#include<map>
#include<queue>
#include<climits>
#include<algorithm>
#include<stdlib.h>
#define pb push_back
#define eps 1e-8
#define CS pri... | ALGO | 0.999182 | 3.883894 |
1c48c7bf-c11a-4496-bea5-9f856a4874bd | ethancoyle7/CMPS3013-AdvancedAlgortihsm | Lectures/SimplePointers.cpp | // This program stores the address of a variable in a pointer.
#include <iostream>
using namespace std;
int main()
{
int x = 25; // int variable
//int *ptr; // Pointer variable, can point to an int
//ptr = &x; // Store the address of x in ptr
int *ptr = &x;
cout << "===================================... | TOOL | 0.973515 | 4.779691 |
31892441-3d87-4ca1-aa93-e5eedce2db9c | ayanamizuta/cpro | atcoder/abc/abc273/e.cpp | #include "bits/stdc++.h"
#include <atcoder/all>
using namespace std;
using mint = atcoder::modint998244353;
#define FOR(i, a, b) for (int i = (a); i < (b); ++i)
#define REP(i, n) FOR(i, 0, n)
#define ALL(a) (a).begin(), (a).end()
#define LL long long
using fps = vector<mint>;
fps operator*(const fps &a, const fps &b... | ALGO | 0.99979 | 4.661166 |
80daffac-8777-49a5-9a3c-ba803f4f777a | AnshD07/cpp-DSA | Lecture 19 c++ STL/set/set.cpp | #include<iostream>
#include<set>
using namespace std;
int main(){
set <int> s;
s.insert(5);
s.insert(5);
s.insert(5);
s.insert(3);
s.insert(3);
s.insert(7);
s.insert(7);
s.insert(7);
s.insert(1);
s.insert(10);
// set Automatilay sort the array
for (int i:s){
c... | ALGO | 0.997322 | 3.728977 |
8fcbdfca-8e0c-47a6-a679-67fad7c6ba5f | Le-xiaoyu/AlgorithmPractice | KY3615 单词个数统计/单词个数统计.cpp | //#include <iostream>
//#include <string>
//#include <map>
//#include <algorithm>
//using namespace std;
//
//int main() {
// int charCount = 0, wordCount = 1; // ո
// map<char,int> mostChar; // ¼ʺͳִ ṹ嶯̬ ڸcount
// string str = { 0 };
// //cin >> str; / scanf ֻȡһ
// // cԶȡһ: char arr[200]={0}; fgets(arr,200,stdin); ... | ALGO | 0.999348 | 3.960333 |
de5e5769-c2c4-47f9-bbf7-226d70d662d3 | qiaozishun4/CSP2024_BJ | BJ-Senior/answers/BJ-S00705/duel/duel.cpp | #include<bits/stdc++.h>
#define ll long long
#define N 500050
using namespace std;
ll n,a[N],b[N],c[N],ans;
bool cmp(ll x,ll y){
return x<y;
}
int main(){
freopen("duel.in","r",stdin);
freopen("duel.out","w",stdout);
cin>>n;
for(int i=1;i<=n;i++)
{
cin>>a[i];
}
sort(a+1,a+n+1... | ALGO | 0.999981 | 3.639939 |
21f55483-80c4-4935-af48-c0a4697741a4 | leety1228/swordOfferCoding | 23FindPath.cpp | #include <iostream>
#include <vector>
using namespace std;
struct TreeNode
{
int val;
struct TreeNode *left;
struct TreeNode *right;
TreeNode(int x = 0)
:val(x), left(NULL), right(NULL)
{
}
};
class Solution
{
public:
vector< vector<int> > m_res;
vector< vector<int> > FindPath(Tr... | ALGO | 0.999964 | 4.705777 |
85910417-cc34-4a02-aba1-e3692dabc6b3 | naucoin/VTKSlicerWidgets | Utilities/mrmpi/mpistubs/mpi.cpp | /* Single-processor "stub" versions of MPI routines */
#include "stdlib.h"
#include "string.h"
#include "stdio.h"
#include "vtksys/SystemTools.hxx"
#include "mpi.h"
/* lo-level function prototypes */
void mpi_copy_int(void *, void *, int);
void mpi_copy_float(void *, void *, int);
void mpi_copy_double(void *, void... | TOOL | 0.937468 | 4.204834 |
fe8112ab-b725-4668-82d9-516f45519a65 | CasualWeeb159/ROBOT-MANIPULATOR | buildroot/share/PlatformIO/variants/MARLIN_F446VE/variant.cpp | #include "pins_arduino.h"
#ifdef __cplusplus
extern "C" {
#endif
// Pin number
const PinName digitalPin[] = {
PA_0, //D0 //A7
PA_1, //D1 //A8
PA_2, //D2 //A9
PA_3, //D3 //A0
PA_4, //D4 //A1
PA_5, //D5 //A10
PA_6, //D6 //A11
PA_7, //D7 //A12
PA_8, //D8
PA_9, //D9
PA_10, ... | CONFIG | 0.902652 | 3.647584 |
706bd858-5d4c-4aa5-8eb1-e561650f56c5 | 1784175347/HPIM | booksim2/src/allocators/pim.cpp | // $Id$
#include "booksim.hpp"
#include <iostream>
#include "pim.hpp"
#include "random_utils.hpp"
//#define DEBUG_PIM
PIM::PIM( Module *parent, const string& name,
int inputs, int outputs, int iters ) :
DenseAllocator( parent, name, inputs, outputs ),
_PIM_iter(iters)
{
}
PIM::~PIM( )
{
}
void PIM::Allocat... | ALGO | 0.916648 | 3.968359 |
eb9a6900-ccae-4b00-83a0-686f036cfdb2 | mmp/pbrt-v2 | src/core/camera.cpp | // core/camera.cpp*
#include "stdafx.h"
#include "camera.h"
#include "film.h"
#include "montecarlo.h"
#include "sampler.h"
// Camera Method Definitions
Camera::~Camera() {
delete film;
}
Camera::Camera(const AnimatedTransform &cam2world,
float sopen, float sclose, Film *f)
: CameraToWorld(cam2w... | TOOL | 0.894217 | 6.671222 |
bc9d03e7-2048-41da-a58f-c00ae2aec4f0 | ShammiAnand/cp-problemset | CF-1360D.cpp | #include<bits/stdc++.h>
using namespace std;
#define ll long long
#define pb push_back
#define mp make_pair
#define setbits(x) __builtin_popcountll(x)
#define zrobits(x) __builtin_ctzll(x)
#define mod 1000000007
#define nl "\n"
#define ps(x,y) fix... | ALGO | 0.999984 | 4.209577 |
2f74ceea-bc81-4ca9-ad1c-f0bb2ab191ac | Ahona18/Leetcode-Practice | balance-a-binary-search-tree/balance-a-binary-search-tree.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.999992 | 6.07504 |
8533b915-e3e6-4442-afbd-0849f3f14457 | Haudkozaur/masterThesis | cmake-build-debug/eigen-3.4.0/doc/examples/tut_matrix_resize.cpp | #include <iostream>
#include <Eigen/Dense>
using namespace Eigen;
int main()
{
MatrixXd m(2,5);
m.resize(4,3);
std::cout << "The matrix m is of size "
<< m.rows() << "x" << m.cols() << std::endl;
std::cout << "It has " << m.size() << " coefficients" << std::endl;
VectorXd v(2);
v.resize(5);
... | ALGO | 0.971606 | 3.894544 |
c927107b-0fd8-4eb4-a809-633e5a7622f1 | Happylilly1231/algorithm-study-2025 | week5_그래프/BOJ_1260/DFS와_BFS_happylilly.cpp | /*
알고리즘: DFS와 BFS
시간 복잡도:
- DFS & BFS: O(N + M)
- 인접 리스트 오름차순 정렬 : O(MlogM)
참고 링크:
- 그래프 인접 리스트(벡터): https://velog.io/@christer10/C%EC%9E%90%EB%A3%8C%EA%B5%AC%EC%A1%B0-%EA%B7%B8%EB%9E%98%ED%94%84Graph
- DFS & BFS: https://better-tomorrow.tistory.com/entry/DFS-BFS-%EC%9D%B4%ED%95%B4%ED%95%98%EA%B8%B0
아이디... | ALGO | 0.999979 | 5.363849 |
cb5f5950-d31c-4330-b895-510e383644c1 | Pranay-Prasad2/DSA | Graph/DFS.cpp | #include<bits/stdc++.h>
using namespace std;
#define ll long long
#define For(i,a) for(int i = 0; i < a ;i++)
#define RFor(i,a,b) for(int i = a; i >= b ;i--)
#define vi vector<int>
#define mi map<int,int>
const int N = 1e5 + 2;
vi adj[N];
bool vis[N];
void dfs(int node)
{
//preorder
vis[node] = 1;
cout<<nod... | ALGO | 0.999982 | 4.478973 |
6a67c235-4cc4-4a26-b6dc-1a80054b1461 | RodriguezGoldstein/High-Performance-Computing | code/openmp/omp_list.cpp | #include <stdio.h>
#include <stdlib.h>
#include <math.h>
#include <string.h>
#include <ctype.h>
#include <my_timer.h>
#include <my_omp.h>
struct LinkedList_t
{
LinkedList_t *next;
int value;
LinkedList_t() : next(NULL), value(0) {}
};
LinkedList_t * buildList (const int n)
{
LinkedList_t *head = new L... | ALGO | 0.996633 | 3.611837 |
c33e0d27-a010-489c-a934-cf40ea853e5f | Abhishek0421/Leetcode-solution | 115-distinct-subsequences/115-distinct-subsequences.cpp | class Solution {
public:
int solve(int i,int j,string &s,string &t,vector<vector<int>> &dp){
if(i==s.length() && j<t.length()){
return 0;
}
if(j==t.length()){
return 1;
}
if(dp[i][j]!=-1){
return dp[i][j];
}
if(s[i]==t[j]){
... | ALGO | 0.999994 | 6.50827 |
215b8b2d-ff66-48f5-9a37-b8e8d6844cf7 | powershoping/codingEx | binaryTree/src/binaryTreeUtil.cpp | #include <queue>
#include <limits.h>
#include <iostream>
#include "binaryTree.h"
TreeNode *buildBTUsingLevelOrder(const std::vector<int> &&vecOrg)
{
return buildBTUsingLevelOrder(vecOrg);
}
TreeNode *buildBTUsingLevelOrder(const std::vector<int> &vecOrg)
{
if (vecOrg[0] == INT_MAX)
{
std::cout << "Emp... | ALGO | 0.999215 | 5.451046 |
242621e0-fe14-4168-a38c-db6803a2a0bd | Ark-Aak/code_repo | 2025-02-11/add.cpp | #ifdef ONLINE_JUDGE
#pragma GCC optimize("Ofast,no-stack-protector,unroll-loops,fast-math")
#pragma GCC target("sse,sse2,sse3,ssse3,sse4.1,sse4.2,avx,avx2,popcnt")
#include <immintrin.h>
#include <emmintrin.h>
#endif
#include <bits/stdc++.h>
#define int ll
#define rep(i, a, b) for(int i = (a), i##end = (b); i <= i##e... | ALGO | 0.999977 | 4.001271 |
e2a7b0c5-37af-41ec-af14-af028ac14cb2 | xieyian/Uni_Work | ADDS/assignment5/ReduceMinimum.cpp | using namespace std;
#include <iostream>
#include <string>
#include <vector>
#include "ReduceMinimum.h"
int ReduceMinimum::binaryOperator(int a, int b){
if(a>b){
return b;
}else{
return a;
}
}
int ReduceMinimum::reduce(vector<int> vec){
if(count<vec.size()-1){
vec[0]=binaryOper... | ALGO | 0.999524 | 4.733238 |
7010326d-f887-4f84-b79a-0ade7b2b3f27 | junjunjunk/competitive_programming | atcoder/159/b.cpp | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef vector<int> vi;
typedef vector<ll> vl;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;
#define REP(i, n) for (int i = 0; i < (int)(n); i++)
#define FOR(i, a, b) for (int i = (int)(a); i < (int)(b); i++)
#define FORR(i, a, b) for (int i ... | ALGO | 0.999983 | 3.759629 |
b6c9b46e-dcc9-4f81-a114-6b8764aaf9d4 | Nuktaverma/practice | topic2flowcontrol,function&loop/2elseif_eg_posinegative.cpp | #include<iostream>
using namespace std;
int main()
{
int n;
cout<<"Enter a number : ";
cin>>n;
if(n>0)
cout<<"Positive number";
else if(n<0)
cout<<"Negative number";
else
cout<<"Zero";
return 0;
} | ALGO | 0.994291 | 3.359387 |
220d972e-1b57-4a1f-a823-a0120415da4d | Tylder/soliton_engine | extern/Simd/src/Simd/SimdNeonSynetPooling.cpp | #include "Simd/SimdStore.h"
#include "Simd/SimdNeon.h"
#include "Simd/SimdBase.h"
namespace Simd
{
#if defined(SIMD_NEON_ENABLE) && defined(SIMD_SYNET_ENABLE)
namespace Neon
{
SIMD_INLINE void PoolingAverageNhwc1(const float* src, size_t srcS, size_t srcC, size_t kH, size_t kW, const float32x4_t& nor... | TOOL | 0.987713 | 5.699248 |
1a18b1b3-f415-4190-8e7c-e8b57b2afbd2 | Subrat29/Leetcode-Problemofday | 85. Maximal Rectangle/sol1.cpp | #include <iostream>
#include <vector>
#include <algorithm>
using namespace std;
// Remember: In first approach i work on the char matrix which is given in the question but
// my friend tell me that how you store integer above 9 because 10 is string not char
// then i convert the given matrix in <int> matrix now all s... | ALGO | 0.999896 | 5.409412 |
4760b724-2023-4cee-9098-10b67377c6c0 | HarshGupta02/Data-Structure-And-Algorithm | Bit Manipulation/Power of Three.cpp | // METHOD 1: TIME = O(19) -> MAX.
class Solution {
public:
bool isPowerOfThree(int n) {
if(n == 0 or n == 2) return false;
while(n % 3 == 0){
n/=3;
}
if(n != 1) return false;
return true;
}
};
// METHOD 2 : TIME = O(1)
class Solution {
public:
bool isPo... | ALGO | 0.999699 | 6.293215 |
a602225c-5556-451f-a1b5-c3974df5198a | Atharv-Sathe/DSARegistry | SlidingWindTwoPtr/TrippingRainWater.cpp | #include <iostream>
#include <stack>
#include <vector>
using namespace std;
/*
Given n non-negative integers representing an elevation map where
the width of each bar is 1, compute how much water it can trap after raining.
*/
int trap(vector<int>& height) {
// Two Pointer Solution O(1) space and O(n) time
in... | ALGO | 0.999993 | 7.621723 |
5e89ecd1-5969-4b61-aa25-2e22884e596b | Praveenkumar07007/DSA | stacks/prefixeval.cpp |
#include<iostream>
#include<stack>
using namespace std;
int solve(int val1, int val2,char ch){
if(ch=='+') return val1 + val2;
else if(ch=='-') return val1 - val2;
else if(ch=='*') return val1 * val2;
else return val1/val2;
}
int main()
{
string s="-/*+79483";
stack<int> val;
for(int i=s.l... | ALGO | 0.999969 | 4.050227 |
1aae2755-580c-49ce-b137-b190aaf4c2a0 | popgenmethods/SINGER | SINGER/SINGER/TSP_smc.cpp | //
// TSP_smc.cpp
// SINGER
//
// Created by Yun Deng on 4/5/23.
//
#include "TSP_smc.hpp"
int TSP_smc::counter = 0;
TSP_smc::TSP_smc() {
}
TSP_smc::~TSP_smc() {
for (auto &x : state_spaces) {
for (Interval *interval : x.second) {
delete interval;
}
}
vector<vector<double>... | ALGO | 0.999308 | 3.6757 |
9417aa13-2fc6-4344-af7f-1c5d1ebf9233 | madomigo/programacion-competitiva | Curso LoC/Week4/a4.cpp | #include <iostream>
#include <set>
using namespace std;
int main () {
int n;
cin >> n;
int num;
set<int> s;
for (int i = 0; i < n; i++) {
cin >> num;
s.insert(num);
}
cout << s.size() << "\n";
} | ALGO | 0.998808 | 4.086529 |
20e053d8-61d2-4562-8e43-82814a0cdf63 | tarunsamanta2k22/Data-Structure---Algorithm | CSES codes(COMPLETE)/Missing Number.cpp | #include<bits/stdc++.h>
typedef long long ll;
using namespace std;
int main()
{
ll n;
cin>>n;
vector<ll>vect;
ll num;
for(int i=0;i<n-1;i++)
{
cin>>num;
vect.push_back(num);
}
sort(vect.begin(),vect.end());
/*for(ll i=0;i<(ll)vect.size();i++)
{
cout<<vect[i]<<" ";
}
cout<<endl<<endl;
*/
fo... | ALGO | 0.999924 | 3.336596 |
d6350465-0d9f-48f5-9c63-c8b12ed815e0 | IcyLunar/leetcode-75-study | moonpoison/binary_tree-bfs/1161.cpp | #include<bits/stdc++.h>
using namespace std;
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), left(left), right(r... | ALGO | 0.999984 | 4.892568 |
ae0669aa-caaa-418a-894f-2b6f2e0d4e8e | peelchan/exercise_code | codeforces/663div2/c.cpp | #include <algorithm>
#include <cmath>
#include <cstdio>
#include <cstring>
#include <iostream>
#include <map>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <string>
#include <utility>
#include <vector>
using namespace std;
typedef long long ll;
typedef pair<int, int> P;
const int inf = 0x... | ALGO | 0.999967 | 4.044427 |
0480882a-3def-4b68-a744-e53920de5543 | ishan-marikar/firmware-mod-kit | src/lzma/C/7zip/Compress/LZMA/LZMAEncoder.cpp | // LZMA/Encoder.cpp
#include "StdAfx.h"
#include "../../../Common/Defs.h"
#include "../../Common/StreamUtils.h"
#include "LZMAEncoder.h"
// for minimal compressing code size define these:
// #define COMPRESS_MF_BT
// #define COMPRESS_MF_BT4
#if !defined(COMPRESS_MF_BT) && !defined(COMPRESS_MF_PAT) && !defined(COMP... | TOOL | 0.851778 | 7.363019 |
841141f3-d987-422a-93bc-bb7f05f161cd | chiseungii/baekjoon | 11/11724.cpp | #include <iostream>
#include <queue>
using namespace std;
char connect[1001][1001]; // input
char check[1001]; // 방문 체크용
int N, M;
void BFS(int n) {
queue<int> B;
B.push(n);
check[n] = 1;
while (!B.empty()) {
int tmp = B.front();
B.pop();
for (int i = 1; i <= N; i++) {
if (connect[tmp][i] && !check[... | ALGO | 0.999834 | 4.702845 |
145cc615-7a5c-4084-8e4c-30eb3254b4c9 | BoruiXu/ScalaGBM | src/thundergbm/quantile_sketch.cpp |
#include "thundergbm/quantile_sketch.h"
#include <math.h>
void summary::Reserve(int size){
if(size > entries.size()){
entry_reserve_size = size;
entries.resize(size);
//data...
}
}
void summary::Copy(summary& src){
entry_size = src.entry_size;
entry_reserve_size = src.entry_re... | ALGO | 0.99749 | 4.489978 |
60285ec5-d253-4791-9336-21fd834ef3c3 | ukmoldogazy/flutter-hw | hw6_hylophone/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.998999 | 6.785645 |
4b22c0a9-f1d3-49a1-bae3-f996dc140249 | hyeongseok21/algorithm-codesignal | Interview_Practice/Data_Structure/Graphs/currencyArbitrage.cpp | // floyd-warshall algorithm
// : 모든 i에서 j로 가는 경로에 대해, 중간점 k를 경유하는 경로가 더 작을 경우 업데이트
// 한 쌍의 최단 거리는 다익스트라 알고리즘으로 구하고, 모든 쌍의 최단 거리를 구할 땐 플로이드 알고리즘으로 구함
bool solution(vector<vector<double>> exchange) {
int n = exchange.size();
for (int k = 0; k < n; ++k) {
for(int i = 0; i < n; ++i) {
for(... | ALGO | 0.999666 | 5.123902 |
1f4a8d0d-69d6-465b-88ea-018f1a1c5040 | AbdulWasay25/OOP_Lab-Tasks | Lab_3/Task_6.cpp | #include<iostream>
using namespace std;
class Matrix {
private:
int nrows, ncols;
int **elements;
public:
Matrix(int r, int c) : nrows(r), ncols(c) {
elements = new int*[nrows];
for(int i=0 ; i<nrows ; i++){
elements[i] = new int[ncols] ;
}}
int getRows() { return nrows; }
int get... | ALGO | 0.991398 | 4.316894 |
1d28ad57-cad5-40b3-8f4e-35c75b28fa7a | Mksiyak/ProjectEuler | pro_elu_17.cpp | #include <algorithm>
#include <cmath>
#include <cstdio>
#include <iostream>
#include <vector>
using namespace std;
#define fo(i, n) for (int i = 0; i < n; i++)
#define ll long long
string s[91];
string spell(int number)
{
string ret;
if(number/100!=0){ret+=(s[number/100]+" Hundred ");}number%=100;
if(nu... | ALGO | 0.999062 | 4.760569 |
a4e7350e-1b00-4a05-a557-ba0e6a99ed32 | ishandutta2007/codeforces | huangzirui/normal/1523/H.cpp | // CF
#include<bits/stdc++.h>
using namespace std;
# define ll long long
# define read read1<ll>()
# define Type template<typename T>
Type T read1(){
T t=0;
char k;
bool vis=0;
do (k=getchar())=='-'&&(vis=1);while('0'>k||k>'9');
while('0'<=k&&k<='9')t=(t<<3)+(t<<1)+(k^'0'),k=getchar();
return vis?-t:t;
}
# define... | ALGO | 0.999893 | 3.473261 |
7ef0ce9f-23fe-48a7-b3a2-0679fa1dc245 | Mothi24/intern_assignment1 | 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 |
aaf29738-ff69-4312-b4e9-201ff0f781aa | impala1213/codetree-TILs | 240521/2가 3번째로 등장하는 위치/where-2-appears-3rd.cpp | #include <iostream>
using namespace std;
int main() {
int count;
cin >> count;
int numbers[count];
int two = 0;
for(int i =0; i < count; i++){
cin >> numbers[i];
}
for(int i = 0; i < count; i++) {
if(numbers[i] == 2){
two += 1;
}
if(two == 3){
... | ALGO | 0.999855 | 4.088651 |
302c2189-220d-48ce-b5b3-fdf1ea82dfa2 | IAMRICKYAN/Interview_Experience | Overload_new/Overload_new/stackmemory.cpp | #include <stdio.h>
void function(int level)
{
int localVariable = level;
if (level > 0)
{
function(level - 1);
}
printf("ջ㼶%dֵ%d\n", level, localVariable);
}
int main()
{
function(3);
} | ALGO | 0.99348 | 4.02523 |
df14126c-b78a-4a22-8762-37cb4b17e826 | thehashmap/6Companies30Days | Intuit/Koko Eating Bananas.cpp | class Solution {
public:
bool isFeasible(vector<int>& piles , int h , int k){
int hours = 0;
for(auto banana : piles) hours += (banana-1)/k+1;
return hours <= h;
}
int minEatingSpeed(vector<int>& piles, int h) {
long sum = 0 ;
for(auto banana : piles){
... | ALGO | 0.999875 | 5.859177 |
ed2494a7-1121-47c4-81b8-ed7cd8509362 | AdityaGattu/Leetcode | CodeChef/Racing Horses.cpp | #include<bits/stdc++.h>
#include <iostream>
using namespace std;
int main() {
// your code goes here
int t;
cin>>t;
while(t--)
{
int n;
cin>>n;
vector<int>v;
int x;
for(int i=0;i<n;i++)
{
cin>>x;
v.push_back(x);
}
sort(v.begin(),v.end());
... | ALGO | 0.999945 | 3.842259 |
eb45c694-6bb8-4d8c-9e2b-1831e1b4e0ef | sushant2019/bustub-private | third_party/murmur3/MurmurHash3.cpp | // This source file was originally from:
// https://github.com/PeterScott/murmur3
//
// We've changed it for use with VoltDB:
// - We changed the top-level functions defined below to return
// their hash by value, rather than accept a pointer to storage
// for the result
// Note - The x86 and x64 versions ... | ALGO | 0.984173 | 7.076665 |
bba86f9b-7645-4cb8-a510-199ea29e68c0 | Kyun2da/Algorithm | cpp/baekjoon/10870 Fibonacci/main.cpp | #include <iostream>
using namespace std;
int solution(int n) {
if (n == 0)
return 0;
else if (n == 1)
return 1;
else{
return solution(n-1)+solution(n-2);
}
}
int main() {
int N, answer;
cin >> N;
answer = solution(N);
cout << answer;
return 0;
}
| ALGO | 0.999993 | 4.931695 |
d8f75362-1944-49b5-8b1e-2f738f51c5f4 | akindyakov/neron | src/util/geometry/circle_shape.cpp | /**
** autor Alexander K
** email <EMAIL>
** date 08.07.2012.13.33
** BRIEF circle implementation
*/
//=============================================================================
#include <iostream>
#include <iterator>
#include <cmath>
//==================================================================... | ALGO | 0.991682 | 5.066722 |
d01643fc-14cf-4d11-9a58-2bf0688c0fcb | alexandraback/datacollection | solutions_5688567749672960_0/C++/Misanthrop/A.cpp | #include <iostream>
#include <string>
using namespace std;
int64_t reverse(int64_t x)
{
int64_t result = 0;
for(int64_t rest = x; rest; rest /= 10)
{
int64_t next = result*10 + (rest % 10);
if(result != next/10) return 0;
result = next;
}
return result;
}
int ndigit(int64_t x)
{
int count = 1;
while(x /=... | ALGO | 0.999487 | 5.317044 |
023079bd-9e7c-4e9f-bafa-14f80bc44c28 | TriumphantAkash/STL_CPP | sequence_containers/vector.cpp | /*
*This program demonstrate the use of a vector
*Vector is a dynamic array that can grow dynamically
*Obviously the momry is allocated from heap
|1|2|5|12|3|
^v.begin() ^v.end()
Hence,
cout<<*v.end(); //dangerous situtation
*Properties of vector:
->fast insert/remove at the end: O(1)
->slow insert/remo... | ALGO | 0.98565 | 3.876283 |
d01bbdbf-b519-44b5-8f99-1a223d2353dc | protik0939/codeforces_problemset | 1300 Ratings/F_Money_Trees.cpp | /*
________________________________________________________________
.......
....... ...
.. .......... .
. . .
. .. ,*.////.
. .... ..****
,*,** //,,.***
*,,,,..,,.,*
,....... | ALGO | 0.999699 | 3.644156 |
101edcb0-a28b-48f1-8a79-804b95d8fff8 | SlarkUndead/Source-Server-VerX | Client/OGRE/OgreMain/src/OgreNumerics.cpp | #include "OgreStableHeaders.h"
#include "OgreCommon.h"
#include "OgreNumerics.h"
namespace Ogre
{
bool NumericSolver::solveNxNLinearSysDestr(int n, PreciseReal **coeff, PreciseReal *col)
{
// we'll use standard row reduction; since we only care about systems with unique
// solutions, our job is slightly easier. ... | TOOL | 0.998644 | 4.677761 |
4b3391a4-a4db-4147-9756-3e9b8459deec | rahul-p-007/Practice_problem | Painter Partition/index.cpp | bool issolution(int arr[], int n, int k, long long mid)
{
long long workercnt = 1;
long long lengthsum = 0;
for (int i = 0; i < n; i++)
{
if ((lengthsum + arr[i]) <= mid)
lengthsum += arr[i];
else
{
workercnt++;
if (workercnt > k || arr[i] >... | ALGO | 0.999998 | 5.098932 |
a3a9167a-1d0e-43b7-afec-211fa0f54b87 | Kunal-19/DSA-Questions | Q444/BitManipulation.cpp | #include<stdc++.h>
using namespace std;
int main(){
int n;
cout << "Enter a number: ";
cin >> n;
if(n&(n-1)) cout << "NOT DIVISIBLE BY 2!!" << endl;
else cout << "DIVISIBLE BY 2!!" << endl;
return 0;
} | ALGO | 0.992797 | 4.538265 |
606abfd9-7b4a-4b7b-8b7b-f99f2139d936 | HypedUpbOii/CSES-Solutions | Introductory Problems/Increasing_Array.cpp | #include <iostream>
using namespace std;
int main(){
long long n, prev, curr, moves = 0;
cin >> n;
cin >> prev;
for(int i = 0; i < n - 1; i++){
cin >> curr;
if (curr < prev){
moves += prev - curr;
curr = prev;
}
prev = curr;
}
cout << move... | ALGO | 0.999827 | 3.512039 |
91199ad1-ab96-4d9c-ab63-e819c2ad7c57 | gedorinku/llvm-65816 | llvm/lib/Transforms/Scalar/LowerMatrixIntrinsics.cpp | #include "llvm/Transforms/Scalar/LowerMatrixIntrinsics.h"
#include "llvm/ADT/PostOrderIterator.h"
#include "llvm/ADT/SmallVector.h"
#include "llvm/Analysis/AliasAnalysis.h"
#include "llvm/Analysis/DomTreeUpdater.h"
#include "llvm/Analysis/LoopInfo.h"
#include "llvm/Analysis/OptimizationRemarkEmitter.h"
#include "llvm/A... | TOOL | 0.9825 | 7.930764 |
d2235309-8615-49e6-b652-5dc20cf6ac1f | Ibn-Omar-Romel/LeetCode_Solve | 3241-divide-array-into-arrays-with-max-difference/3241-divide-array-into-arrays-with-max-difference.cpp | #pragma GCC optimize("Ofast")
static auto _ = [](){ios::sync_with_stdio(false); cin.tie(nullptr); return nullptr;}();
class Solution {
public:
vector<vector<int>> divideArray(vector<int>& nums, int k) {
sort(nums.begin(), nums.end());
vector<vector<int>> vec;
int row = 0;
for (int i ... | ALGO | 0.999914 | 5.178602 |
e0a9768c-692f-43ba-a497-09ce7db760ab | anshsawant/ITSC_3146_A_4_2 | pthreads_p2.cpp | /*
@file: pthreads_skeleton.cpp
@author: student name1, <EMAIL>
@author: student name2, <EMAIL>
@author: student name3, <EMAIL>
@description: A program that demonstrates processes.
@course: ITSC 3146
@assignment: in-class activity [n]
*/
#include <pthread.h>
#include <iostream>
#include <unistd.h>
using... | ALGO | 0.993011 | 4.993017 |
9f10fa40-79bd-460a-80eb-fad95c5bb7f3 | Javi5454-DGIIM/FP | Practicas/FelizNavidad.cpp | /***************************************************************************/
// FUNDAMENTOS DE PROGRAMACIN
//
// (C) FRANCISCO JOS CORTIJO BON
// DEPARTAMENTO DE CIENCIAS DE LA COMPUTACIN E INTELIGENCIA ARTIFICIAL
// <EMAIL>
//
// FELIZ NAVIDAD 2020-2021
//
/************************************************************... | ALGO | 0.998711 | 3.247899 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.