uuid string | repo_name string | relative_path string | content string | category string | algo_rel_score float64 | quality_score float64 |
|---|---|---|---|---|---|---|
0d299b32-5714-426a-8de1-a579572f921b | yugalgaur174/Leetcode-Problems | 0151-reverse-words-in-a-string/0151-reverse-words-in-a-string.cpp | class Solution {
public:
string reverseWords(string s) {
string ans="";
stringstream ss(s);
s="";
string word;
while(ss>> word){
s=word+" "+s;
}
// stringstream ss(s);
s.erase(s.size()-1,1);
return s;
// int back=-1;
... | ALGO | 0.999888 | 5.597752 |
5f37b25b-06fb-4afc-8f47-44ef21f449aa | theAlpha06/DSA | Leetcode/validPalindrome.cpp | #include <bits/stdc++.h>
using namespace std;
string removeNotRequired(string s){
string temporary = "";
for(int i = 0; i < s.length(); i++){
if( (s[i]>='A' and s[i]<='Z') or (s[i]>='a' and s[i]<='z') or (s[i]>='0' and s[i]<='9') ) {
temporary.push_back(s[i]);
}
}
r... | ALGO | 0.999705 | 5.416337 |
bd98fc37-9ac4-4ac4-90b2-c467a7e794c7 | XunZhiyang/STLite | data/priority_queue/data/four/code.cpp | // provided by ๅพๆคๅคฉ
#include<cstdio>
#include<algorithm>
#include<queue>
#include<vector>
#include<ctime>
#include<cstdlib>
#include<cstring>
#include<iostream>
#include<cctype>
#include<utility>
#include "priority_queue.hpp"
void TestConstructorAndPush(){
std::cout << "Testing constructors, destructor and push..." <... | TEST | 0.964894 | 3.872852 |
51c2cac9-d4e0-4f84-8566-ce18f9b23306 | Ayesh-Sandeepa/IA32_Decoder | Neg.cpp | #include <stdio.h>
#include <bitset>
#include <iostream>
#include <string>
#include <cmath>
#include <sstream>
#include <iomanip>
#include <queue>
#include <map>
#include <list>
#include "Neg.h"
using namespace std;
Neg::Neg(Common com, queue<short> &instruction, map<string, int> ®isters, map<string, int> &memori... | TOOL | 0.98834 | 3.129069 |
36e6bca0-cad3-49c4-b2ca-254d0ce7fdd6 | SasidharKanigolla/Codes | Case-specific Sorting of Strings - GFG/casespecific-sorting-of-strings.cpp | //{ Driver Code Starts
//Initial Template for C++
#include<bits/stdc++.h>
using namespace std;
// } Driver Code Ends
//User function Template for C++
class Solution
{
public:
//Function to perform case-specific sorting of strings.
string caseSort(string str, int n)
{
// your code here
... | ALGO | 0.999957 | 5.958994 |
d98360e5-5109-4fb5-95a0-08611476f45a | adembix/Programming-With-CPP | Algorithms-Problem-Solving-With-CPP/ProgrammingAdvices/Algorithms & Problem-Solving Level 2/problem 4.cpp | #include<iostream>
using namespace std;
int ReadPositiveNumber(string message)
{
int Number = 0;
do
{
cout << message << endl;
cin >> Number;
} while (Number < 1);
return Number;
}
int isPerfectNumber(int Number)
{
int Sum = 0;
for (int x = 1; x < Number ; x++)
{
if (Number % x == 0)
Sum += x;
}
... | ALGO | 0.993811 | 4.220876 |
1d9f86b6-e8f4-4705-b2f8-7ec43b5a86eb | tung2389/Cpp-Projects | Number to text converter/NumberToText.cpp | /*
Author: Tung Luu
Date: March 9, 2021
Purpose: Answer for TEST FOR SOFTWARE ENGINEER, DESKTOP BROWSER. This program will work for number with the maximum of 12 digits, but not greater than INT_MAX
*/
#include<iostream>
#include<string>
#include<cmath>
#include<algorithm>
#include"NumberToText.h"
#include"English.h"
... | TOOL | 0.998392 | 4.746504 |
dab05d07-d719-44b5-8432-1eba3bab444f | MelloBirkan/TAD-Lista-circular-duplamente-ligadaencadeada | .ccls-cache/@home@runner@TAD-Lista-circular-duplamente-ligadaencadeada/LDL.cpp | //AMANDA GOIS SMANIOTO TIA:42127351
//DANIELA BRAZOLIN FLAUTO TIA:42130581
#include <iostream>
#include "No.h"
#include "ListCirc.h"
// Construtor vazio
// inicia o cabeรงa da lista como null
LDL::LDL(){
this->cabeca = nullptr;
this->qtde = 0;
}
// Verifica se lDL estรก vazia
bool LDL::isEmpty() {
if (thi... | ALGO | 0.999387 | 4.765719 |
1914a42d-4252-4b22-87aa-3b6969592e5a | Talendar/programming_challenges | brute_force_and_backtracking/uva_624/main.cpp | /**
* Brute-force solution for the problem: https://onlinejudge.org/index.php?option=onlinejudge&page=show_problem&problem=565
* @author Gabriel Nogueira (Talendar)
*/
#include <iostream>
#include <vector>
using namespace std;
int best_sum, res;
vector<int> solution;
void solve(int i, vector<int>& tracks, int sum... | ALGO | 0.999683 | 4.06037 |
ea0473f3-6498-4e51-a2d2-9b4d162f6649 | Mayuri13/My_Leetcode_Solution | Binary Tree to BST - GFG/binary-tree-to-bst.cpp | //{ Driver Code Starts
//Initial template for C++
#include <bits/stdc++.h>
using namespace std;
struct Node
{
int data;
struct Node *left;
struct Node *right;
Node(int val) {
data = val;
left = right = NULL;
}
};
void printInorder (struct Node* node)
{
if (node == NULL)
... | ALGO | 0.99989 | 7.189932 |
daaea04f-451e-43d0-9f14-5c86157ea092 | joydip007x/CompetitiveCodeArchive | UVA/12425/23947309_TLE_0ms_0kB.cpp | #include<bits/stdc++.h>
using namespace std;
typedef long long ll;
#define pb push_back
#define nl '\n'
#define deb(x) cerr<<#x" = "<<x<<nl
ll in() { ll a ; scanf("%lld",&a); return a; }
const int N = 5e5 + 9;
const int mod = 1e9 + 7;
ll n,x,q;
ll phi(ll n)
{
ll result = n;
for (int p = 2; p * p <= n; ... | ALGO | 0.999802 | 3.805781 |
c4b89e4e-11a4-43fa-8c56-dd39b0971ffb | ishandutta2007/codeforces | jiangly/normal/1528/B.cpp | #include <bits/stdc++.h>
using i64 = long long;
using u64 = unsigned long long;
using u32 = unsigned;
constexpr int P = 998244353;
int main() {
std::ios::sync_with_stdio(false);
std::cin.tie(nullptr);
int n;
std::cin >> n;
std::vector<int> dp(n + 1);
dp[0] = 1;
int s = 1;
for (int i = 1;... | ALGO | 0.999962 | 5.174208 |
5db5021e-e3ab-4c59-abed-fbfc20e7fa77 | davidfox87/neuroPyOpt | rk4.cpp | #include "rk4.h"
#include <iostream>
RK4::RK4(int dim) {
N= dim;
// initialize upper triangle of butcher table to 0.0 and then fill in appropriate entries
for (int i= 0; i < 4; i++) {
Y[i]= new double[N];
F[i]= new double[N];
for (int j=i; j < 4; j++) {
a[i][j]= 0.0;
}
}
... | ALGO | 0.999864 | 4.382205 |
afd34fac-f5c5-44ee-875d-2af3ff16aa47 | divyanshrastogi51/21_Days_Of_Code | gog/Implement strstr.cpp | // { Driver Code Starts
#include<bits/stdc++.h>
using namespace std;
int strstr(string ,string);
int main()
{
int t;
cin>>t;
while(t--)
{
string a;
string b;
cin>>a;
cin>>b;
cout<<strstr(a,b)<<endl;
}
}
// } Driver Code Ends
/* The function should return ... | ALGO | 0.999773 | 5.715256 |
e2cbcb59-4e3a-4399-be4a-8e7302242db1 | porjesuraj/Learning-Data-Structure | Workspace/Day5_23Dec/Day5.2/AVL.cpp | #include<iostream>
#include<string>
#include<queue>
using namespace std;
namespace collection
{
class Exception
{
private:
string message;
public:
Exception( string messgae ) throw( ) : message( messgae )
{ }
string getMessage( void )const throw( )
{
return this->message;
}
};
class BSTree; //Forwa... | ALGO | 0.999462 | 4.442413 |
c78daa4c-df16-4bd1-8c85-5d3e41da0882 | liviu-liviu/pseudocode | GeekForGeeks/Binary Tree to DLL/Modified InOrder.cpp | /* Driver function for modified inorder tree conversion */
void convert(Node* root, Node **prev_ref)
{
// Empty tree, Nothing to convert
if(!root) return;
// Recursively flatten the left subtree
// Record the inorder predeccessor of root
convert(root->left, prev_ref);
// Connect the last seen ... | ALGO | 0.999894 | 5.089359 |
dceffede-267b-490c-be10-c006831faf00 | kkalucha/USACO-solutions | dirtraverse.cpp | /*
ID: seankeller2010
LANG: C++11
TASK: dirtraverse
*/
//#include "stdafx.h"
#include <iostream>
#include <fstream>
#include <vector>
#include <algorithm>
#include <unordered_set>
#include <unordered_map>
#include <queue>
#include <stack>
#include <cmath>
#include <math.h>
#include <string>
using namespace std;
#def... | ALGO | 0.99913 | 3.890398 |
964a8e36-ff77-4b77-b0ea-b7809d7b5d55 | RRIZVE/STL2 | 1 Stack/3 print.cpp | #include<bits/stdc++.h>
using namespace std;
int main()
{
stack<int>st;
st.push(1);
st.push(2);
st.push(3);
st.push(4);
st.push(5);
while(!st.empty())
{
cout<<st.top()<<endl;
st.pop();
}
/*5
4
3
2
1*/
}
| ALGO | 0.999933 | 3.887488 |
a2117768-0fa9-4992-8993-148f5161576b | Sujeet2801/DSA | Lecture 44 Linked List/practice.cpp | #include<iostream>
using namespace std;
class Node{
public:
int data;
Node* next;
//constructor
Node(int d){
this -> data = d;
this -> next = NULL;
}
// Destructor
~Node(){
int value = this -> data;
if(this-> next != NULL){
delete next;
... | ALGO | 0.999742 | 4.638489 |
044e4431-234a-4b49-b418-4e5105a7d2ab | yii-su/ppc | shortcut_memopt.cpp | //
// Created by suyi on 24-5-13.
//
/**
* https://ppc.cs.aalto.fi/ch2/
* The shortcut problem
* ไปๅ
ๅญ่ฎฟ้ฎๅฑ้ข่ฟ่กไผๅ
*/
#include <omp.h>
#include <algorithm>
#include <cstring>
#include <random>
#include <iostream>
#include <iomanip>
#include <chrono>
void create(float *d, size_t n);
void trans(float *, const float *, cons... | ALGO | 0.999933 | 3.793634 |
e3389e40-209f-473b-a01d-89b428ea8980 | root-jeong/BOJ | 10000~/15483_์ต์ ํธ์ง.cpp | #include <iostream>
#include <string>
#include <algorithm>
#include <vector>
using namespace std;
int arr[1001][1001];
bool arr2[1001];
int main() {
string origin, result;
int lcs;
int ans = 0;
bool flag = false;
cin >> origin >> result;
for (int i = 0; i <= origin.size(); i++) {
arr[0][i] = i;
}
for (int ... | ALGO | 0.999906 | 4.342766 |
abe37e8c-8fc4-4d08-a496-a6e776aa5b1e | sewook66/OpenCV_CCTV | opencv/sources/3rdparty/openexr/IlmImf/ImfLut.cpp | //-----------------------------------------------------------------------------
//
// Lookup tables for efficient application
// of half --> half functions to pixel data,
// and some commonly applied functions.
//
//-----------------------------------------------------------------------------
#include <ImfLut.h>
#incl... | TOOL | 0.984012 | 6.544207 |
fa59963e-078c-4ea8-b511-b49b2119bf54 | alexandraback/datacollection | solutions_5688567749672960_0/C++/jasmes/main.cpp | #include <cstdio>
#include <iostream>
#include <utility>
#include <cstdlib>
#include <algorithm>
#include <string>
#include <vector>
#include <queue>
#include <cstring>
using namespace std;
using ii = pair < int, int >;
#define X first
#define Y second
#define upto(i,n) for(int i = 0; i<n; ++i)
#define DEBUG(x) cout ... | ALGO | 0.9991 | 4.381532 |
239bfa4a-5fba-42ed-bf84-c01cfb2e53b3 | PLSysSec/hfi_firefox | dom/media/webaudio/blink/DynamicsCompressor.cpp | #include "DynamicsCompressor.h"
#include "AlignmentUtils.h"
#include "AudioBlock.h"
#include <cmath>
#include "AudioNodeEngine.h"
#include "nsDebug.h"
using mozilla::AudioBlockCopyChannelWithScale;
using mozilla::WEBAUDIO_BLOCK_SIZE;
namespace WebCore {
DynamicsCompressor::DynamicsCompressor(float sampleRate,
... | ALGO | 0.877621 | 7.63721 |
5af61539-36d5-44cc-9e8b-516e70932274 | cat2998/algorithm_cpp | P0037.cpp | #include <iostream>
using namespace std;
int main()
{
int N, K;
int sum = 0;
cin >> N >> K;
for (int i = 1; i <= K; i++)
sum += i;
N -= sum;
if (N < 0)
cout << -1;
else
{
if (N % K == 0)
cout << K - 1;
else if (N % K != 0)
c... | ALGO | 0.999951 | 3.854599 |
602f471b-58ef-4613-818e-df30f5d7707c | suraj101998/LeetCodeSolutions | 2400-2499/2434.Using a Robot to Print the Lexicographically Smallest String/Solution2.cpp | class Solution {
public:
string robotWithString(string s) {
int n = s.size();
vector<int> right(n, n - 1);
for (int i = n - 2; i >= 0; --i) {
right[i] = s[i] < s[right[i + 1]] ? i : right[i + 1];
}
string ans;
string stk;
for (int i = 0; i < n; ++i... | ALGO | 0.999984 | 6.309453 |
fa032326-8efd-4287-85b4-5cc62a33099a | kcalbCube/PVC-16 | include/boost_1_78_0/libs/histogram/examples/getting_started_listing_04.cpp | // clang-format off
//[ getting_started_listing_04
#include <algorithm> // std::max_element
#include <boost/format.hpp> // only needed for printing
#include <boost/histogram.hpp> // make_histogram, integer, indexed
#include <iostream> // std::cout, std::endl
#include <sstream> // s... | ALGO | 0.978853 | 6.421513 |
e2260868-98ce-4c96-bf85-cd981c8f6a7b | TangZichen0102/cpp_study | luogu/P1790.cpp | #include <bits/stdc++.h>
#define ll long long
#define E 1007
using namespace std;
char r[E][E] = {
{""},
{"-abcdefghijklmnopqrstuvwxyz"},
{"-zabcdefghijklmnopqrstuvwxy"},
{"-yzabcdefghijklmnopqrstuvwx"},
{"-xyzabcdefghijklmnopqrstuvw"},
{"-wxyzabcdefghijklmnopqrstuv"},
{"-vwxyzabcdefghijklmn... | ALGO | 0.999996 | 4.090558 |
86cd3bde-0213-44c4-9e4c-00dad58abf13 | Artcs1/UVA | 125 - Numbering Paths/125 - Numbering Paths.cpp |
//AUTOR:MURRUGARRA JEFFRI ERWIN
//UNIVERSIDAD: UNIVERSIDAD NACIONAL DE TRUJILLO
#include <bits/stdc++.h>
#define REP(i, a) for( int i = 0; i < a; i++ )
#define RFOR(i,x,y) for(int i = x; i>= y; i--)
#define FOR(i,x,y) for (int i = x; i < y; i++)
#define ITFOR(it,A) for(typeof A.begin() it = A.begin(); it!=A.end(); it... | ALGO | 0.999904 | 3.696793 |
c5b0669f-4382-4417-b0c8-84cd56bd3c7a | sarvex/leetcode-zsh | solution/1800-1899/1830.Minimum Number of Operations to Make String Sorted/Solution.cpp | const int N = 3010;
const int MOD = 1e9 + 7;
long f[N];
long g[N];
long qmi(long a, int k) {
long res = 1;
while (k != 0) {
if ((k & 1) == 1) {
res = res * a % MOD;
}
k >>= 1;
a = a * a % MOD;
}
return res;
}
int init = []() {
f[0] = g[0] = 1;
for (i... | ALGO | 0.999997 | 5.57286 |
3ec56aec-4e77-4c27-b158-5c3d8e8fd603 | piyushk77/leetcode_100_days_of_code | prob-986-interval-list-intersections.cpp | #include <vector>
using namespace std;
class Solution
{
public:
vector<vector<int>> intervalIntersection(vector<vector<int>> &firstList,
vector<vector<int>> &secondList)
{
vector<vector<int>> intersect;
for (int i{}; i < firstList.size(); ++i)
... | ALGO | 0.999923 | 5.947782 |
be20d672-f0d8-4705-b624-c9a3ce583294 | marysaka/mina32-llvm | llvm/utils/benchmark/cmake/std_regex.cpp | #include <regex>
#include <string>
int main() {
const std::string str = "test0159";
std::regex re;
re = std::regex("^[a-z]+[0-9]+$",
std::regex_constants::extended | std::regex_constants::nosubs);
return std::regex_search(str, re) ? 0 : -1;
}
| ALGO | 0.907517 | 5.855292 |
44603805-32cf-462f-ab66-3b79a690645c | Jtop13/2D-SLAM-Computer-Science-Capstone- | Testing Playground/test/janky_dbscan.cpp | #include <iostream>
#include <vector>
#include <cmath>
#include <ctime>
#include <cstdlib>
using namespace std;
struct Point {
double x, y;
};
double euclideanDistance(Point p1, Point p2) {
double dx = p1.x - p2.x;
double dy = p1.y - p2.y;
return sqrt(dx*dx + dy*dy);
}
vector<int> range(int n) {
... | ALGO | 0.999819 | 6.345278 |
af69c6b3-7145-4612-8403-48e2aa259448 | gagaron257/prog_in_cpp_by_eric_robert_solution | chapter4/ex3.cpp | /*
* File : ex3.cpp
* -------------------------------------------
* Write a program that prints out the longest line in a file entered by the user. If
* several lines are all equally long, your program should print out the first such
* line.
*/
#include <iostream>
#include <fstream>
#include <cstdlib>
using names... | ALGO | 0.923838 | 3.980972 |
105a010f-2f86-4701-b1a0-222569a8ab32 | ashutosh017/cp_journey | 129_jojo_conseq_ones_cf.cpp | #include <bits/stdc++.h>
using namespace std;
#define ll long long
int conseq_ones(string s)
{
int count = 0, prev_count = 0;
for (int i = 0; i < s.size(); i++)
{
if (s[i] == '1')
{
count++;
if (count > prev_count)
{
prev_count = count;
}
... | ALGO | 0.999986 | 4.83732 |
87616de3-a910-490d-a001-0a26db8e31b4 | truongbnguyen88/CSE_503 | Week3/tree_original.cpp | #include <iostream>
#include <cstddef>
using std::cout;
using std::endl;
class Node {
int value;
public:
Node* left; // left child
Node* right; // right child
Node* p; // parent
Node(int data) {
value = data;
left = NULL;
right = NULL;
p = NULL;... | ALGO | 0.999881 | 4.675293 |
3cbb72c8-279b-4a19-9414-9f5402f97fc7 | GlodonOpenSrc/Qt5.9.5_Glodon | qtwebengine/src/3rdparty/chromium/third_party/skia/src/core/SkScan_Path.cpp | #include "SkScanPriv.h"
#include "SkBlitter.h"
#include "SkEdge.h"
#include "SkEdgeBuilder.h"
#include "SkGeometry.h"
#include "SkPath.h"
#include "SkQuadClipper.h"
#include "SkRasterClip.h"
#include "SkRegion.h"
#include "SkTemplates.h"
#include "SkTSort.h"
#define kEDGE_HEAD_Y SK_MinS32
#define kEDGE_TAIL_Y SK... | ALGO | 0.999415 | 5.995474 |
3cb0e972-4251-497b-be97-0eb9b8ca6375 | bionanoimaging/matlab_tools | old/Copy of MultiGaussSigmaMSE.cpp | /* Compares a number of simulated Gaussian Spots with experimental data
* Examle : a=exp(-((xx(20,20)-2).^2+(yy(20,20)-1.2).^2)/20)
[fitted,params]=FitDataNDFast([0 1 0; 1 0 0],a)
*/
#include "mex.h"
#include <stdio.h>
#include <string.h>
#include <math.h>
// The function below calculates the N-dimensio... | ALGO | 0.992365 | 5.458652 |
7594bc24-472c-4058-a163-75269b0f7c25 | nitintayal008/new-leetcode-question | 0567-permutation-in-string/0567-permutation-in-string.cpp | class Solution {
public:
bool checkInclusion(string s1, string s2) {
vector<int>hash1(26,0);
vector<int>hash2(26,0);
int n=s1.size();
int m=s2.size();
if(n>m)return false;
int left=0;
int i=0;
for(int i=0;i<n;i++){
hash1[s1[i]-'a']... | ALGO | 0.999971 | 6.198268 |
c96b225c-fc76-420d-83a2-bde7c706e011 | g0ncalocunha/IC | proj1/opencv-4.x/samples/cpp/flann_search_dataset.cpp | // flann_search_dataset.cpp
// Naive program to search a query picture in a dataset illustrating usage of FLANN
#include <iostream>
#include <vector>
#include "opencv2/core.hpp"
#include "opencv2/core/utils/filesystem.hpp"
#include "opencv2/highgui.hpp"
#include "opencv2/features2d.hpp"
#include "opencv2/flann.hpp"
u... | ALGO | 0.987915 | 5.985428 |
aaefa638-7e9e-445f-ba91-72c68ad8663c | hjiang13/LLMs-in-IR | POJ-104/69/1384.cpp | #include <iostream>
using namespace std;
int main()
{
char a[300],b[300];
int c[300],aa[300],bb[300],i,la,lb,l;
cin>>a;
cin>>b;
la=strlen(a);
lb=strlen(b);
memset(aa,0,sizeof(aa));
memset(bb,0,sizeof(bb));
for (i=0; i<la; i++)
aa[i]=a[la-i-1]-'0';
for (i=0; i<lb; i++)
bb[i]=b[lb-i-1]-'0';
l=la; if(lb>l) l=lb;
memset(c,... | ALGO | 0.999975 | 3.153165 |
b87ba3aa-0e92-487f-bd39-c31acbd7a54f | oxygen-hunter/Flashboom | data/big-vul-100/add_attention_code/MixtralExpert/top0-100/searchMatrix2-Solution.searchMatrix/177875_Exec_Code_Overflow.cpp | s_aes_process(stream_state * ss, stream_cursor_read * pr,
stream_cursor_write * pw, bool last)
{
stream_aes_state *const state = (stream_aes_state *) ss;
const unsigned char *limit;
const long in_size = pr->limit - pr->ptr;
const long out_size = pw->limit - pw->ptr;
unsigned char t... | ALGO | 0.992057 | 6.404164 |
23a020d5-114a-4b9e-bb45-1581b5400697 | Dimitris75/neoCAM | src/Mod/Mesh/App/Core/Curvature.cpp | #include "PreCompiled.h"
#ifndef _PreComp_
#include <algorithm>
#include <functional>
#endif
#include <QFuture>
#include <QFutureWatcher>
#include <QtConcurrentMap>
#include <Base/Sequencer.h>
#include <Base/Tools.h>
// #define OPTIMIZE_CURVATURE
#ifdef OPTIMIZE_CURVATURE
#include <Eigen/Eigenvalues>
#else
#include ... | ALGO | 0.989162 | 6.425863 |
ed4e8e84-e1ec-4096-8127-1a9e1deb1656 | wenqiangwangsustech/FP16-LSRK | MenyuanModel/src/src_willimson/run.cpp | #include "header.h"
void modelChecking( PARAMS params )
{
int thisRank;
MPI_Barrier( MPI_COMM_WORLD );
MPI_Comm_rank( MPI_COMM_WORLD, &thisRank );
if ( params.useMultiSource && params.useSingleSource )
{
params.useMultiSource = 0;
if ( 0 == thisRank )
printf( "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!... | ALGO | 0.99961 | 5.025093 |
44467d74-db94-4d7d-a324-a32ecd0d365a | Anshul407/LeetCode | 1531-number-of-ways-to-wear-different-hats-to-each-other/1531-number-of-ways-to-wear-different-hats-to-each-other.cpp | class Solution {
public:
vector<vector<int>>dp;
const int mod=1e9+7;
int solve(int hat,unordered_map<int,vector<int>>&mp,int n,int state){
if(state==(1<<n)-1)return 1;
if(hat<0)return 0;
if(dp[state][hat]!=-1)return dp[state][hat];
int ans=0;
for(auto v:mp[hat]){
... | ALGO | 0.999996 | 5.731033 |
14777b26-96e3-49f4-b635-1b5dfe83a94b | Vivitha22/MODERN_CPP_220241 | WEEK_5/16_July_Traning_Session/future_inputs.cpp | /*
async has 2 use case
1) You can use std::async to fetch data from a thread if the function returns a value
2) providing inputs to executing threads asynchronously, out of order in "future"
future and promise model---> you will make a promise to the compiler that you will give the inputs in the futu... | TOOL | 0.995532 | 5.452865 |
c0124aea-b62c-43c0-b1c9-473b71ac6074 | kaisercoin/kaiser-wallet | bytecoin/src/ConnectivityTool/ConnectivityTool.cpp | #include <boost/optional.hpp>
#include <boost/program_options.hpp>
#include <System/ContextGroup.h>
#include <System/ContextGroupTimeout.h>
#include <System/Dispatcher.h>
#include <System/Event.h>
#include <System/InterruptedException.h>
#include <System/Ipv4Address.h>
#include <System/Ipv4Resolver.h>
#include <System... | WEB | 0.922758 | 7.308271 |
57eb2133-0a6e-4b41-b0e5-29f2f0c31a3d | Ankitar20/Whole-CPP-Prcatice | TUT69.CPP | #include<iostream>
using namespace std;
template <class T1 , class T2>
float funcAverage(T1 a , T2 b){
float avg =(a+b)/2.0;
return avg;
}
/*int main(){
float a;
a= funcAverage(5,2);
printf("The average of these numbers is %f" , a);
return 0;
}
*/
int main(){
float a;
a= funcAverage(5,2.8)... | ALGO | 0.956938 | 4.481625 |
d35f943f-55cb-46e2-9730-1cc7764c6aa9 | Suraj-Dhankad2025/DSA-Problems-Leetcode | 2201-valid-arrangement-of-pairs/valid-arrangement-of-pairs.cpp | class Solution {
public:
vector<vector<int>> validArrangement(vector<vector<int>>& pairs) {
int n = pairs.size();
map<int, vector<int>>adj;
map<int, int>outdeg;
for(int i=0; i<pairs.size(); i++){
int u = pairs[i][0];
int v = pairs[i][1];
adj[u].pus... | ALGO | 0.999997 | 5.819049 |
01c5932f-7987-4910-b56e-a39ed1fc119d | hunordbcz/test_fundamental_algorithms | 01 - Direct Sorting Methods Comparison/main.cpp | /**
* Author: Hunor Debreczeni
* Group: 30423
*
* Assignment Specification: Implement and Compare 3 Direct Sorting Methods in the Best, Worst and Average cases
* Discussion, interpretations, efficiency, compare, stability
*
* Conclusions:
* *Bubble Sort*
* Slowest... | ALGO | 0.999421 | 6.368966 |
9e4760f3-d068-479a-a632-86f95715a642 | sharc-lab/LightningSim | llvm-project/libc/src/math/generic/sincosf_data.cpp | #include "math_utils.h"
#include "sincosf_utils.h"
#include <stdint.h>
namespace __llvm_libc {
// The constants and polynomials for sine and cosine. The 2nd entry
// computes -cos (x) rather than cos (x) to get negation for free.
constexpr sincos_t SINCOSF_TABLE[2] = {
{{1.0, -1.0, -1.0, 1.0},
0x1.45f306dc... | ALGO | 0.993308 | 7.277528 |
27fba93c-db1c-486f-8a06-5f4af7863f1a | ishmeetkohli/SketchBasedImplicitBlending | lib/libigl/include/igl/mvc.cpp | // Broken Implementation
IGL_INLINE void igl::mvc(const Eigen::MatrixXd &V, const Eigen::MatrixXd &C, Eigen::MatrixXd &W)
{
// at least three control points
assert(C.rows()>2);
// dimension of points
assert(C.cols() == 3 || C.cols() == 2);
assert(V.cols() == 3 || V.cols() == 2);
// number of polygo... | ALGO | 0.998978 | 5.053101 |
d9c2ba5b-83cd-4e65-ab44-055518a36b0b | abhishekchauhan15/Data-Structures-and-Algorithms | Arrays/LargestElement.cpp | #include<iostream>
using namespace std;
int getLargest (int arr[], int n){
int getLargest=INT_MIN; //Time:O(n)
for(int i=0; i<n-1; i++){
if(arr[i]<arr[i+1]);
getLargest=arr[i+1];
}
return getLargest;
}
int main(){
int arr[]={3,4,5,2,5,6,7};
int n=sizeof(... | ALGO | 0.999517 | 3.744617 |
2d7a3c8e-0998-4fd1-8c5d-7ea3fa7b954d | Mason-programming/Data-Structers-and-Algorithm | Matrix Multiplication with Dynamic Arrays/pointers.cpp | #include <iostream>
#include "2DArray.h"
using namespace std;
void start_program();
int main(){
start_program();
return 0;
}
void start_program(){
//intializes the varibles
int a ,b ,c, d = 0;
//allows user to enter the size of the array
cout << "Enter the rows and coloumn of th... | TOOL | 0.946893 | 3.844416 |
7535cfb2-b717-4bba-b1f2-4b9430beaa6b | yousirong/Cpp-How-To-Program-9E-master | Chapter05/examples/5.14/fig05_14.cpp | /*
* =============================================================================
*
* Filename: fig05_14.cpp
*
* Description: Fig. 5.14 - Continue statement terminating an iteration of
* a for statement.
*
* Version: 1.0
* Created: 09/02/18 04:27:58
* Revisio... | ALGO | 0.999475 | 5.660927 |
acb15c95-9ebf-4339-b549-5a4847f2917b | salad14/2024-TongjiUniversity-Programming-Paradigm | cocos2d/cocos/math/CCVertex.cpp | #include "math/CCVertex.h"
#include "base/ccMacros.h"
NS_CC_BEGIN
void ccVertexLineToPolygon(Vec2 *points, float stroke, Vec2 *vertices, unsigned int offset, unsigned int nuPoints)
{
nuPoints += offset;
if(nuPoints<=1) return;
stroke *= 0.5f;
unsigned int idx;
unsigned int nuPointsMinus = nuPoin... | ALGO | 0.992923 | 5.81487 |
f14461e2-729e-4ce2-b4bc-4071cf487ee1 | hemanth1999k/Competitive-Programming | LeetCode/CourseScheduleI.cpp | class Solution {
public:
bool cyclePresent(int n,vector<bool> &recur,vector<vector<int>>&graph,vector<bool> &visited){
visited[n] = true;
recur[n] = true;
for(auto i:graph[n]){
if(!visited[i] && cyclePresent(i,recur,graph,visited))
return true;
if(recur[... | ALGO | 0.999937 | 6.206203 |
d46dfa01-6ff7-46a5-a11d-dd87c175dd08 | Preeti-KS/learn-ds | insertion-sort.cpp | #include<iostream>
using namespace std;
void insertion_sort(int*, int);
void swap(int&, int&);
void print_array(int*, int);
int swaps = 0;
int main(){
int input_array[] = {1, 2, 3, 4, 5, 6, 10, 12};
// int input_array[] = {12, 10, 6, 5, 4, 3, 2, 1};
int size = sizeof(input_array) / sizeof(int);
inser... | ALGO | 0.999958 | 5.184318 |
32525ef8-2782-41f1-9bd7-e952e1f1f352 | ishandutta2007/codeforces | sdya/normal/204/B.cpp | #include <iostream>
#include <cstdio>
#include <vector>
#include <algorithm>
#include <cstring>
#include <string>
#include <queue>
#include <set>
#include <map>
#include <bitset>
#include <cmath>
#include <ctime>
#pragma comment (linker, "/STACK:256000000")
using namespace std;
const int maxN = 110000;
int n, a[maxN]... | ALGO | 0.999931 | 3.527052 |
d915fb4e-3cb3-4bba-9887-c4cc57fc9d2d | ishaankalsi/Cplusplus_codes | letterphone.cpp | //Deepak Aggarwal, Coding Blocks
//<EMAIL>
#include <iostream>
using namespace std;
void letterphone(char number[], int be, char codeSoFar[], int i){
if (number[be] == '\0'){
//no more numbers to process
codeSoFar[i] = '\0';
cout << codeSoFar << endl;
return;
}
//123 to be handled
int correspondingNumber... | ALGO | 0.997995 | 3.728299 |
8e67cb2e-d956-4ede-8274-1024a4fca633 | oss5824/practice | ๊ตฌํ/12739.cpp | #include <iostream>
#include <string>
using namespace std;
int N, K, blue, red, green;
string s;
void getColor(int idx){
if (s[idx] == 'B')blue++; else if (s[idx] == 'G')green++; else red++;
}
int main()
{
cin.tie(NULL); ios::sync_with_stdio(false);
cin >> N >> K >> s;
while (K--) {
string tmp =... | ALGO | 0.999579 | 4.331264 |
5d6c600b-90f2-4c84-942f-048862e0b045 | WFZ7789/OI_Repo | P1207.cpp | #include <iostream>
#include <vector>
class Min_unsigned_integer {
std::vector<unsigned char> number;
public:
friend bool ispail(const Min_unsigned_integer&);
Min_unsigned_integer(int num_unit, unsigned long num)
{
do
{
number.push_back(num % num_unit);
} while(num /=... | ALGO | 0.998989 | 3.311834 |
51180e4d-9d0f-4fe1-b21d-09737bc9cc08 | ruchiii-codes/DSA_codes | Linear_search.cpp | #include<iostream>
using namespace std;
bool search(int arr[], int size, int key)
{
for(int i=0; i<size; i++)
{
if( arr[i] == key )
{
return 1;
}
}
return 0;
}
int main()
{
int arr[10] = { 6, 2, -9, 10, 3, 8, -12, 17, 0, -1};
cout << "Enter the element to se... | ALGO | 0.999733 | 4.332352 |
11f92ad7-61fb-465a-9c59-a4c80f84f511 | Aman-Jot-Kaur/Leetcode-solved | 392-is-subsequence/392-is-subsequence.cpp | class Solution {
public:
bool isSubsequence(string s, string t) {
string check="";
int j=0;
for(int i=0;i<t.size();i++){
if(t[i]==s[j]){
check+=t[i];
j++;
}
if(j==s.size()){
break;
}
}
if(check==s){
return true;
... | ALGO | 0.999947 | 6.241858 |
e1f09821-caee-4a4f-baac-3104d2a4c70a | Nithish-9/Competitive-programming | DivA/SoftDrinking.cpp | /******************************************************************************
Online C++ Compiler.
Code, Compile, Run and Debug C++ program online.
Write your code in this editor and press "Run" button to compile and execute it.
******************************************... | ALGO | 0.99841 | 4.09828 |
2c85ff0f-4861-42dd-91b7-83a4ad374ac7 | Zhenghao-Liu/LeetCode_problem-and-solution | 0174.ๅฐไธๅๆธธๆ/solution_dp.cpp | class Solution {
public:
int calculateMinimumHP(vector<vector<int>>& dungeon)
{
int row=dungeon.size(),column=dungeon.at(0).size();
//ๅฝๅๆ ผๅญๅฐ่พพๅ
ฌไธป้่ฆ็ๆๅฐ็ๅฝๅผ
vector<vector<int>> dp (row,vector<int>(column));
dp.at(row-1).at(column-1)=dungeon.at(row-1).at(column-1)<0?1-dungeon.at(row-1).at(column-1):1;
for (int i=row-... | ALGO | 0.999822 | 5.579328 |
a54c40df-5196-4a94-978c-67805f7d393d | umar-07/Competitive-Programming-questions-with-solutions | ONP/main.cpp | #include <bits/stdc++.h>
using namespace std;
bool isOperator(char a)
{
if(a=='+')
return true;
else if(a=='*')
return true;
else if(a=='-')
return true;
else if(a=='/')
return true;
else if(a=='^')
return true;
return false;
}
int main()
{
int t;
... | ALGO | 0.999865 | 4.611457 |
3302d43b-b47a-4350-9da2-e87060bec6b5 | AriadnaVillacorta/Programacion | R.E.P.O/For/Ejercicio9.cpp | #include <iostream>
using namespace std;
int main(){
cout<<"------------------------------------------"<<endl;
cout<<"NUMEROS DIVISIBLES POR 3 DEL 1 AL 100 "<< endl;
for (int i = 1; i <= 100; i++){
if (i % 3 == 0){
cout<<i<<" ";
}
}
cout<<endl;
cout<<"--------------------------------------------"<<endl;
cout<<"NUME... | ALGO | 0.994416 | 3.133517 |
c6d2e890-4eb4-4916-9e41-dbeef03ad6dd | RomanKosobrodov/mcha | JuceLibraryCode/modules/juce_gui_basics/positioning/juce_RelativeParallelogram.cpp | RelativeParallelogram::RelativeParallelogram()
{
}
RelativeParallelogram::RelativeParallelogram (const Rectangle<float>& r)
: topLeft (r.getTopLeft()), topRight (r.getTopRight()), bottomLeft (r.getBottomLeft())
{
}
RelativeParallelogram::RelativeParallelogram (const RelativePoint& topLeft_, const RelativePoint& t... | TOOL | 0.921902 | 5.806474 |
96fa3a54-1553-460a-b4dd-581eef7d5ef0 | verb55nta/atcoder | contests/AGC/agc018/library/unionFind.cpp | #include<iostream>
#include<string>
#include<algorithm>
#include<cstdlib>
#include<cmath>
#include<vector>
#include<list>
#include<cstdint>
#include<bits/stdc++.h>
#include<queue>
#include<set>
#define rep(i, n) for(int i = 0; i < (int)(n); i++)
#define rep_r(i, n) for(int i = n-1; i >= 0; i--)
#define rep1(i, n) for(... | ALGO | 0.999693 | 3.227436 |
33789466-adf5-418b-b272-4bc654eb3294 | mvancompernolle/ai_project | data/distributed_dfs_test.cpp | #ifdef BOOST_NO_EXCEPTIONS
void
boost::throw_exception(std::exception const& ex)
{
std::cout << ex.what() << std::endl;
abort();
}
#endif
using namespace boost;
using boost::graph::distributed::mpi_process_group;
// Set up the vertex names
enum vertex_id_t { u, v, w, x, y, z, N };
char vertex_names[] = { 'u',... | ALGO | 0.982734 | 6.794466 |
c9886c51-cdb9-41ae-a305-8dd0e256f0be | ishandutta2007/codeforces | pavelkunyavskiy/normal/37/C.cpp | #include <iostream>
#include <fstream>
#include <vector>
#include <set>
#include <map>
#include <string>
#include <cmath>
#include <cassert>
#include <ctime>
#include <algorithm>
#include <queue>
#include <memory.h>
#include <stack>
#define mp make_pair
#define pb push_back
#define setval(a,v) mems... | ALGO | 0.999988 | 3.446469 |
86fd21d9-fecb-4063-bec6-d34e292ba9a4 | xjw/cpp | hash/hash_table.cpp | #include <iostream>
#include <string.h>
#include <assert.h>
using namespace std;
typedef string HASH_KEY;
typedef long int HASH_VAL;
const unsigned int HASHTABLE_SIZE=13;
/**
* using separate chaining
*/
class LinkedHashEntry {
public:
HASH_KEY key;
HASH_VAL val;
LinkedHashEntry *next;
LinkedHas... | ALGO | 0.997654 | 5.24895 |
5365c587-5374-4d9e-be80-48349ddd2a13 | itsmeumaima/DSA | Lab 3/Question:03.cpp | #include <iostream>
#include <string>
using namespace std;
class Umaima_Lab03 {
int capacity;
int top;
char* arr;
public:
Umaima_Lab03(int s) {
capacity = s;
top = -1;
arr = new char[capacity];
}
~Umaima_Lab03() {
delete[] arr;
}
void push(char element) {
... | ALGO | 0.99899 | 6.077433 |
a8bca7d3-9467-4933-b16a-c0fbf5949789 | SarthakM7/algo-ds-stl | delete.cpp | #include<bits/stdc++.h>
#include <unordered_map>
using namespace std;
int main()
{
int n;
cin>>n;
int a[n];
for(int i=0;i<n;i++)
{
int x,y,v;
cin>>x>>y>>v;
float d=sqrt(x*x+y*y);
float t=d/v;
a[i]=t;
}
int count=0;
unordered_map<int,int>m;
for(int i=0;i<n;i++)
m[a[i]... | ALGO | 0.999685 | 3.733607 |
aff20a1c-2d3b-4a84-a956-13bb899cd06c | MateyApostolov/Olimpiici_D | drobi.cpp | #include <bits/stdc++.h>
using namespace std;
int a, b, c, d, nok1, nod1, d1, d2;
char s, z;
int nod(int a, int b) {
if(a < b) {
swap(a, b);
}
if(b == 0) {
return a;
}
int host;
while(a % b != 0) {
host = a % b;
a = b;
b = host;
}
return b;
}
in... | ALGO | 0.999741 | 4.346663 |
506acabf-64be-47e4-b19f-6b98dd412378 | thesilentline/DSA-code_on_every_line | dynamicprogramming/unboundedknapsack.cpp | //~ author : DSB
#include<bits/stdc++.h>
#include<iostream>
using namespace std;
#define ll long long
#define pint pair<int,int>
#define plong pair<long long,long long>
#define vlong vector <long long>
#define vint vect... | ALGO | 0.999999 | 4.000163 |
4379b828-72a3-438a-9669-a3a401987148 | yongwhan/codeforces | 479A.cpp | #include<bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<int,int> ii;
int main() {
cin.tie(0); cout.tie(0); ios_base::sync_with_stdio(0);
int a,b,c; cin>>a>>b>>c;
cout << max({a*b+c,a*(b+c), a+b*c, (a+b)*c, a*b*c, a+b+c}) << endl;
return 0;
}
| ALGO | 0.99983 | 4.111339 |
1f339bcc-3568-43e5-9d52-a974343a37d8 | Bonnahjohn/french | windows/runner/utils.cpp | #include "utils.h"
#include <flutter_windows.h>
#include <io.h>
#include <stdio.h>
#include <windows.h>
#include <iostream>
void CreateAndAttachConsole() {
if (::AllocConsole()) {
FILE *unused;
if (freopen_s(&unused, "CONOUT$", "w", stdout)) {
_dup2(_fileno(stdout), 1);
}
if (freopen_s(&unuse... | TOOL | 0.998859 | 6.785645 |
3de4cb3b-a77a-4cfb-a251-3f9af6781888 | raju535482/Open3D_Exp | examples/cpp/Octree.cpp | #include <chrono>
#include <functional>
#include <memory>
#include "open3d/Open3D.h"
using namespace open3d;
bool f_traverse(const std::shared_ptr<geometry::OctreeNode>& node,
const std::shared_ptr<geometry::OctreeNodeInfo>& node_info) {
if (auto internal_node =
std::dynamic_point... | TOOL | 0.907949 | 7.342862 |
ba9b3388-f0dc-4752-8d77-c3f0b80b4ed4 | itxAdie/flutter-practice | Attendance system/attendance_system_user/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.99802 | 6.76775 |
5c658e87-768e-459d-985d-75c19d870414 | mr-jestin-roy/LeetCode-TaskList | Codeforces-Daily-Virtual Contests/Round 724/Omkar bad Story.cpp | // Created by Jestin Roy
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
#define mod 1000000007
#define int long long int
#define fast ios_base::sync_with_stdio(false), cin.tie(NULL)
#define PI 3.14159265358979323846
#define endl "\n"
void solve()
{
int n;
cin >> n;
vector<int> a;
... | ALGO | 0.999349 | 4.619217 |
21cb87fb-d3b7-48c0-b32c-74aabb22fd2e | pmc1gh/pmc1gh | Selected Coursework/Computer Graphics Laboratory (CS 171)/hw5/scene_read.cpp | // Philip Carr
// CS 171 Assignment 5
// November 27, 2018
// scene_read.cpp
#include "scene_read.h"
using namespace std;
using namespace Eigen;
/**
* Return true if a given string is found in a vector of strings. Otherwise
* return false.
*/
bool string_in_vector(const vector<string> &v, const string a) {
fo... | ALGO | 0.988241 | 5.811991 |
616fa89b-12c3-460e-9c15-0c8ba2b2123d | KarthiKeyanPadmanaban/E_Commerce_Demo | 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.9988 | 6.76073 |
925be9b2-eae6-498c-a616-a236c702abf4 | isomorphist/ISS-MAPF-LNS | src/.ipynb_checkpoints/driver-checkpoint.cpp | #include <boost/program_options.hpp>
#include <boost/tokenizer.hpp>
#include "LNS.h"
#include "AnytimeBCBS.h"
#include "AnytimeEECBS.h"
#include "PIBT/pibt.h"
/* Main function */
int main(int argc, char** argv)
{
namespace po = boost::program_options;
// Declare the supported options.
po::options_description desc("... | TOOL | 0.949146 | 4.666687 |
effd16bf-4815-49e1-94b7-62dad18ed80d | POC-2025/leetcode | solution/1700-1799/1732.Find the Highest Altitude/Solution.cpp | class Solution {
public:
int largestAltitude(vector<int>& gain) {
int ans = 0, h = 0;
for (int v : gain) h += v, ans = max(ans, h);
return ans;
}
}; | ALGO | 0.999928 | 6.082428 |
f0f7c609-4726-49a1-b2fa-512b7f3e933a | AbhijeetFasate13/Leetcode-Solutions | 542-01-matrix/01-matrix.cpp | class Solution {
public:
vector<vector<int>> updateMatrix(vector<vector<int>>& mat) {
int m = (int)mat.size(), n = (int)mat[0].size();
vector<vector<int>> ans(m, vector<int>(n, -1));
queue<pair<pair<int, int>, int>> q;
for (int i = 0; i < m; i++) {
for (int j = 0; j < n; ... | ALGO | 0.999986 | 6.368022 |
2302a62f-cea0-40ef-b7e5-2eb8c9fe4ba2 | ishandutta2007/codeforces | w0nsh/normal/1077/A.cpp | #include <bits/stdc++.h>
#define FOR(i, n) for(int i = 0; i < (n); ++i)
#define REP(i, a, b) for(int i = (a); i < (b); ++i)
#define TRAV(i, a) for(auto &i : a)
#define SZ(i) ((int)(i).size())
#define X first
#define Y second
#define PR std::pair
#define PII std::pair<int, int>
#define MP std::make_pair
#define ll long ... | ALGO | 0.999872 | 3.654499 |
7e003509-73e9-4352-8e06-1badc3ed4cc0 | mohammadhasanloo/OS-CA2-Pipe | meanCalculator.cpp | #include "meanCalculator.h"
MeanCalculator::MeanCalculator(char* _dir)
{
dir = convert_to_string(_dir);
courses = {PHYSICS, ENGLISH, MATH, LITERATURE, CHEMISTRY};
}
string MeanCalculator::convert_to_string(char* a)
{
string s(a);
return s;
}
vector<string> MeanCalculator::get_folders_name()
{
DIR... | TOOL | 0.89796 | 3.139224 |
620f59a3-b5df-491f-a065-4cf2b477bd4b | ishandutta2007/codeforces | sys/normal/772/C.cpp | #include <bits/stdc++.h>
using namespace std;
const int Maxn = 200005;
int n, m, maxi, ct, cnt, pos, val[Maxn], head[Maxn], from[Maxn], fac[Maxn], deg[Maxn], f[Maxn];
bool vis[Maxn];
vector <int> Ve[Maxn];
struct edg
{
int nxt, to;
} edge[20 * Maxn];
void add(int x, int y)
{
deg[y]++;
edge[++cnt] = (edg){head[x], y... | ALGO | 0.999995 | 3.518346 |
68a29a7a-c9a8-4226-b1c2-f548de338b50 | lock3/meta | llvm/lib/CodeGen/DetectDeadLanes.cpp | #include <deque>
#include <vector>
#include "llvm/ADT/BitVector.h"
#include "llvm/ADT/SetVector.h"
#include "llvm/CodeGen/MachineFunctionPass.h"
#include "llvm/CodeGen/MachineRegisterInfo.h"
#include "llvm/CodeGen/Passes.h"
#include "llvm/CodeGen/TargetRegisterInfo.h"
#include "llvm/CodeGen/TargetSubtargetInfo.h"
#inc... | ALGO | 0.990785 | 4.984663 |
9924485d-3e32-4512-a03e-4150d56f714a | anwar-arif/acm-code | uva/1174 - IP-TV.cpp | #include <bits/stdc++.h>
using namespace std;
#define pf printf
#define sc scanf
#define ll long long int
#define pb push_back
#define sc1i(a) sc("%d",&a)
#define sc2i(a,b) sc("%d%d",&a,&b)
#define sc3i(a,b,c) sc("%d%d%d",&a,&b,&c)
#define sc4i(a,b,c,d) sc("%d%d%d%d",&a,&b,&c,&d)
#define sc1ll(a) sc("%I64d",&a)
#define... | ALGO | 0.999946 | 3.736105 |
755931bf-020c-464d-bda2-660a6f29c989 | lodhaakash07/FinalCourseworkCpp | Portfolio.cpp | #include "Headers/Portfolio.h"
#include<iostream>
#include<numeric>
Portfolio::Portfolio(const Matrix& assetReturns)
: Assets(assetReturns) {
}
void Portfolio::populateStatistics() {
calculatePortfolioMean();
calculatePortfolioCovariance();
}
void Portfolio::populateWeights(double targetReturn) {
gen... | ALGO | 0.853651 | 5.521292 |
37ffd23e-ba15-45f6-bba8-eb2a669f6956 | bhrnjica/magma | sparse/testing/testing_zusemagma_example.cpp | /*
-- MAGMA (version 2.4.0) --
Univ. of Tennessee, Knoxville
Univ. of California, Berkeley
Univ. of Colorado, Denver
@date June 2018
@precisions normal d -> s
@author Hartwig Anzt
*/
// includes, system
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
#include <... | ALGO | 0.995724 | 5.94417 |
484b94c5-3831-4141-867e-3b711a4067e2 | SylarAnh/docker-colrio | 3rd_party/gtsam-4.2a8/gtsam/3rdparty/Eigen/bench/quat_slerp.cpp | #include <iostream>
#include <Eigen/Geometry>
#include <bench/BenchTimer.h>
using namespace Eigen;
using namespace std;
template<typename Q>
EIGEN_DONT_INLINE Q nlerp(const Q& a, const Q& b, typename Q::Scalar t)
{
return Q((a.coeffs() * (1.0-t) + b.coeffs() * t).normalized());
}
template<typename Q>
EIGEN_DONT_INL... | ALGO | 0.998245 | 6.251058 |
a80cd66a-4637-42ec-8c31-a711e2a99c2e | Meta3DCompany/MetaSlicer | src/libigl/igl/polar_dec.cpp | // From Olga's CGAL mentee's ARAP code
template <
typename DerivedA,
typename DerivedR,
typename DerivedT,
typename DerivedU,
typename DerivedS,
typename DerivedV>
IGL_INLINE void igl::polar_dec(
const Eigen::PlainObjectBase<DerivedA> & A,
Eigen::PlainObjectBase<DerivedR> & R,
Eigen::PlainObjectBase<D... | ALGO | 0.999534 | 6.383218 |
e45e5e53-6f1d-4f53-a070-3b81dd8a758f | Kartik-153/Solutions | LeetCode/FindMinmumInRotatedArray.cpp | #include<bits/stdc++.h>
using namespace std;
class Solution {
public:
int findMin(vector<int>& nums) {
int low = 0;
int high = nums.size() - 1;
int ans = INT_MAX;
while(low<=high) {
int mid = (low+high)/2;
if(nums[low] <= nums[mid]) {
ans = mi... | ALGO | 0.999963 | 5.215069 |
85566710-56bb-4525-bf8b-6fa4f12e585b | tonal-glyph/faustus | compiler/generator/occurences.cpp | #include <stdlib.h>
#include <iostream>
#include "exception.hh"
#include "global.hh"
#include "occurences.hh"
#include "recursivness.hh"
#include "sigtype.hh"
#include "sigtyperules.hh"
using namespace std;
/**
* Extended Variability with recursiveness indication
*/
static int xVariability(int v, int r)
{
// c... | TOOL | 0.970731 | 5.937629 |
2163d85a-a375-4070-89c6-cb2df7626737 | dream2globe/FollowAndLearnCpp | 12_05_DynamicBindingAndStaticBinding.cpp | /* Keywords
์ ์ ๋ฐ์ธ๋ฉ : ์ปดํ์ผ ์์ ์ ๋ฏธ๋ฆฌ ๋ชจ๋ ํจ์๋ ๋ณ์๊ฐ ์ ํด์ ธ ์๋ ์ํฉ (์๋ ์ ๋ฆฌ)
๋์ ๋ฐ์ธ๋ฉ : ์ปดํ์ผ์ด ์๋ ์คํ ์์ ์ ์ ํด์ง๋ ์ํฉ (ํ๋ก๊ทธ๋๋ฐ์ด ์ ์ฐํด ์ง)
*/
#include <iostream>
using namespace std;
int add(int x, int y)
{
return x + y;
}
int subtract(int x, int y)
{
return x - y;
}
int multiply(int x, int y)
{
return x * y;
}
int main()
{
int x,... | ALGO | 0.971951 | 4.386309 |
c2cda26b-1889-43bd-b650-5df14b55c77d | fredwhite/Backup | 11503.cpp | #include<stdio.h>
#include<stdlib.h>
#include<map>
#include<string>
using namespace std;
map<string,int> table;
int lik[100010];
int c[100010];
int dis(int a){
if(lik[a]==a){
return a;
}
return lik[a]=dis(lik[a]);
}
int main(){
int i,j;
int t;
int n;
map<string,int>::iterator ita,itb;... | ALGO | 0.999597 | 3.52485 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.