uuid stringlengths 36 36 | repo_name stringlengths 5 123 | relative_path stringlengths 5 4k | content stringlengths 33 2.85M | category stringclasses 6
values | algo_rel_score float64 0.85 1 | quality_score float64 3 8.76 |
|---|---|---|---|---|---|---|
01307142-5534-4f76-b35c-ab9dba31e13c | mint6421/kyopro | atcoder/abc/145/abc_145_d.cpp |
#include<bits/stdc++.h>
using namespace std;
#define inf INT_MAX
#define INF LLONG_MAX
#define ll long long
#define ull unsigned long long
#define M (int)(1e9+7)
#define P pair<int,int>
#define FOR(i,m,n) for(int i=(int)m;i<(int)n;i++)
#define RFOR(i,m,n) for(int i=(int)m;i>=(int)n;i--)
#define rep(i,n) FOR(i,0,n)
#d... | ALGO | 0.999988 | 4.697849 |
48494b79-0aef-40f5-8eac-0dc67b2f76de | milesmiles902/C | Pattern Recognition and Machine Learning/common/log1pexp.cpp | /*
* @file log1pexp.cpp
* @Description Accurately comput y=log(1+exp(x));
* @Eqns #
*/
#include "nr3.h"
#include <cmath>
#include <iostream>
/*
*Input:
* x[d]: Input Data
*Output:
* y[d]: Output Data
*/
void log1mexp(VecDoub x, VecDoub &y){
int i,j;
VecDoub index(x.size());
y=x;
for(i=0;i<x.size();i+... | ALGO | 0.974239 | 3.825189 |
02727258-9e6b-40e1-82e0-91ccee975d96 | nrysk/atcoder | ABC/abc302/d.cpp | // clang-format off
#include <atcoder/all>
#include <bits/stdc++.h>
using namespace std;
using namespace atcoder;
typedef long long ll;
template <class T> using V = std::vector<T>;
template <class T, class E> using P = std::pair<T, E>;
#define rep(i, n, m) for (int i = n; i < (int)(m); ++i)
#define rrep(i, n, m) for (i... | ALGO | 0.999976 | 4.993834 |
81bc0077-0e0f-4109-8534-29e857bd7daf | rise-zeus/comp | dfs_on_grid_and_CC.cpp | #pragma GCC optimize ("-O3")
#include<bits/stdc++.h>
typedef long long ll;
using namespace std;
#define f(i,x,n) for(ll i=x;i<n;i++)
#define pb push_back
#define mp make_pair
#define debug(x) cout<<x<<"\n";
#define lb lower_bound
#define ub upper_bound
#define bs binary_search
#define MOD 1000000007
int arr[100][100];
... | ALGO | 0.999588 | 3.928843 |
01f38857-7535-4425-b172-5059cde2a940 | gemy26/CP-Solutions | CodeForces/GNU C++17/727A | Transformation: from A to B/167712065.cpp | #include <iostream>
#include<bits/stdc++.h>
#define ll long long
#define el '\n'
//------is prime---------//
bool isprime(int x)
{
for (int i = 2; i <= x / i; i++)
if (x % i == 0)
return false;
return true;
}
using namespace std;
void ssbs(string s[],int n) {
for(int i=0;i < n;i++) {
... | ALGO | 0.999986 | 4.053345 |
5f7f2662-bac4-4f5e-8084-0317f7173e49 | hantae96/DataStructure | VSCode/Ex1002_MergeSort/Ex1002_MergeSort.cpp | #include <iostream>
#include <iomanip>
using namespace std;
bool CheckSorted(int* arr, int size)
{
for (int i = 0; i < size - 1; i++)
{
if (arr[i] > arr[i + 1])
return false;
}
return true;
}
void Print(int* arr, int left, int right)
{
for (int i = left; i <= right; i++)
cout << setw(3) << arr[i] << " "... | ALGO | 0.999952 | 5.304828 |
98d9fb8c-c589-4efe-b063-56eeadcf4a73 | toacoin/TOA | src/zerocoin/Commitment.cpp | /**
* @file Commitment.cpp
*
* @brief Commitment and CommitmentProof classes for the Zerocoin library.
*
* @author Ian Miers, Christina Garman and Matthew Green
* @date June 2013
*
* @copyright Copyright 2013 Ian Miers, Christina Garman and Matthew Green
* @license This project is rele... | ALGO | 0.996277 | 7.0719 |
dd3acf2c-09a3-43e5-bd3e-b366e922b011 | nefrttPrabhu/leetstore | 2610-closest-prime-numbers-in-range/closest-prime-numbers-in-range.cpp | class Solution {
public:
vector<int> closestPrimes(int left, int right) {
const int MAXN = 1e6 + 1;
vector<bool> isPrime(MAXN, true);
vector<int> primes;
isPrime[0] = isPrime[1] = false;
for (int i = 2; i < MAXN; i++) {
if (isPrime[i]) {
for (int ... | ALGO | 0.999984 | 5.511886 |
297b4791-c7e9-4cee-9775-8655af0f5bae | yan998/oclint-0.15 | llvm/lib/CodeGen/SafeStack.cpp | #include "SafeStackColoring.h"
#include "SafeStackLayout.h"
#include "llvm/ADT/APInt.h"
#include "llvm/ADT/ArrayRef.h"
#include "llvm/ADT/SmallPtrSet.h"
#include "llvm/ADT/SmallVector.h"
#include "llvm/ADT/Statistic.h"
#include "llvm/Analysis/AssumptionCache.h"
#include "llvm/Analysis/BranchProbabilityInfo.h"
#include ... | TOOL | 0.928131 | 4.316676 |
9c87d1ee-eab6-4ef0-ba3b-9a9382c43c75 | JamesWP/Santa---Advent-of-Code | day02/day2.cpp | #include <iostream>
#include <fstream>
int
min(int a,int b)
{
return (a<b)? a:b;
}
int
main(int argc,char *argv[])
{
std::fstream f;
f.open(argv[1], std::fstream::in);
int l,w,h;
int sa,sl;
int bow,ribbon;
int totalPaper = 0, totalRibbon = 0;
do{
f >> l;
f.ignore(1,'x');
f >> w;
f.ign... | ALGO | 0.991421 | 3.582682 |
69509e24-9acf-42e1-b5ff-9e861b2e50b4 | arcana-lab/gino | tests/regression/ReductionIterations1/test.cpp | #include <stdio.h>
#include <stdlib.h>
#include <math.h>
long long int computeSum (long long int *a, long long int iters){
long long int s =0;
for (auto i=0; i < iters; ++i){
s += a[i];
s += 5;
}
return s;
}
int main (int argc, char *argv[]){
/*
* Check the inputs.
*/
if (argc < 2){
f... | ALGO | 0.999272 | 3.817653 |
b14b897b-f7b9-480c-9d80-1307d7afe629 | ishandutta2007/codeforces | mhq/normal/109/D.cpp | #include <bits/stdc++.h>
using namespace std;
const int maxN = (int)1e5 + 10;
int a[maxN];
int b[maxN];
int n;
set < pair < int, int > > s;
bool lucky(int x) {
while (x > 0) {
if (x % 10 == 4 || x % 10 == 7) {
x /= 10;
}
else return false;
}
return true;
}
vector < pair ... | ALGO | 0.999891 | 3.284194 |
b5e51d60-ff2b-48d3-8837-1296bf37ac52 | okuraofvegetable/Library-for-PCK | Graph/dijkstra.cpp | #include <cstdio>
#include <cstring>
#include <cstdlib>
#include <cmath>
#include <complex>
#include <string>
#include <sstream>
#include <algorithm>
#include <vector>
#include <queue>
#include <stack>
#include <functional>
#include <iostream>
#include <map>
#include <set>
using namespace std;
typedef pair<int,int> P;
... | ALGO | 0.999952 | 3.865807 |
97904898-4ccc-4bca-aa92-1662159eec93 | sabirbugti9/BlogClub-Flutter | 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 |
4537361a-e3ab-45c4-b945-eaedba7435f3 | niteshcse14/hackerearth | Swap_It.cpp | #include <bits/stdc++.h>
using namespace std;
typedef long long int ll;
const ll maxn = 1e3 + 5;
ll t, n, m, k, a, b;
ll arr[maxn];
int main () {
scanf ("%d", &t);
while (t--) {
scanf ("%d%d", &n, &k);
for(int i = 0; i < n; ++i) {
scanf ("%d", &arr[i]);
}
bool flag = true;
for (int j = 0; j < k; ++j) {
... | ALGO | 0.999902 | 3.134357 |
45db19fa-9906-4c23-b993-d28c1ad64f71 | Mikean16l/Udacity_Self-Driving_Car_Projects | CarND-MPC-Project-LQT/src/Eigen-3.3/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.987006 | 4.164869 |
84bc8b88-7a41-4bed-99b1-ce8e238850a4 | sahilThite01/C-programming | Find what character it is.cpp | #include <stdio.h>
int main(){
int ch;
printf("Input a character: ");
scanf("%c",&ch);
if (ch>=97 && ch<=122)
{printf("Upper Case");
}
else if (ch>=65 && ch<=90)
{printf("Lower Case");
}
else if (ch>='0' && ch <='9')
{ printf("Numeric");
}
else
{printf("Symbolic");
}
return 0;
}
| ALGO | 0.987592 | 3.473306 |
d3b5583c-fc5c-4489-abcd-7919ab89adf3 | JahidulHasanSuhel/Competitive-programming | AtCoder/336B.cpp | #include<bits/stdc++.h>
using namespace std;
#define ll long long
#define sp " "
#define endl "\n"
#define Suhel() ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);
int main(){
Suhel()
int n; cin >> n;
int cnt = 0;
while( n % 2 == 0){
cnt++;
n /= 2;
}
cout<< cnt << endl;
... | ALGO | 0.999938 | 4.710094 |
8ec93f08-0a16-4dbf-9f48-ca3f8281b624 | vkg001/DSA-important-question-solutions | 2 non-repeating numbers in array (bit manipulation).cpp | #include<iostream>
using namespace std;
int chkBit(int* brr, int pos, int n)
{
int i,b=(1<<pos),xyz=0;
for(i=0;i<n;i++)
{
if((b & brr[i])==1)
xyz=xyz^brr[i];
}
cout<<xyz<<endl;
return xyz;
}
int uniquenumber(int* brr, int size)
{
int i,lol=0;
for(i=0;i<size;i++)
... | ALGO | 0.999975 | 4.792727 |
5877391f-b757-4b51-b899-229fba3b15f6 | monman53/online_judge | CodeForces/0050/a.cpp | // header {{{
// #define NDEBUG
#include <bits/stdc++.h>
using namespace std;
// {U}{INT,LONG,LLONG}_{MAX,MIN}
#define ALPHABET (26)
#define INF INT_MAX
#define MOD (1000000007LL)
#define EPS (1e-10)
#define EQ(a, b) (abs((a)-(b)) < EPS)
#define CILING(a, b) (((a)+(b)-1LL)/(b))
te... | ALGO | 0.999741 | 3.824982 |
1b0ff9bc-3fa9-4314-81dc-ebd59bb0803a | rottaca/ComputerGraphics-Project | extern/assimp/code/SplitLargeMeshes.cpp | /** @file Implementation of the SplitLargeMeshes postprocessing step
*/
// internal headers of the post-processing framework
#include "SplitLargeMeshes.h"
#include "ProcessHelper.h"
using namespace Assimp;
// ------------------------------------------------------------------------------------------------
SplitLargeM... | TOOL | 0.859727 | 6.82604 |
f39c6718-9c38-4671-b354-098451e4edc7 | usenameI/dart_dev | project/mobile_dev/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.998505 | 6.776823 |
515be6f1-fa41-4ffd-b2b7-32bd0a82399e | CN-hao/leetcode | 3144.minimum-substring-partition-of-equal-character-frequency.cpp | /*
* @lc app=leetcode.cn id=3144 lang=cpp
* @lcpr version=30204
*
* [3144] ๅๅฒๅญ็ฌฆ้ข็็ธ็ญ็ๆๅฐๅญๅญ็ฌฆไธฒ
*/
// @lcpr-template-start
using namespace std;
#include <algorithm>
#include <array>
#include <bitset>
#include <climits>
#include <deque>
#include <functional>
#include <iostream>
#include <list>
#include <queue>
#include... | ALGO | 0.999983 | 6.208451 |
890c6f3c-c13a-4ab4-ae62-547e1f7a864c | JarvisFri/LeetcodeJourney | 0132-palindrome-partitioning-ii/0132-palindrome-partitioning-ii.cpp | class Solution {
public:
int minCut(string s) {
int n = s.size();
vector<vector<bool>> isPal(n, vector<bool>(n, false));
vector<int> dp(n, 0);
// Precompute palindromes
for (int i = n - 1; i >= 0; --i) {
for (int j = i; j < n; ++j) {
if (s[i] == s... | ALGO | 0.999979 | 6.541689 |
6e89d499-56d2-41b6-a72b-c53dcf4df39c | EzgiDurmazpinar/CS-240 | Homework08/Simulation.cpp | #include "CallCenter.cpp"
#include <iostream>
#include <vector>
#include <time.h>
using namespace std;
void display(int Time,int x,int y);
// a function to display current results within every 5 minutes
//Input: the time ,the current number of calls in the waiting list, completed calls untill now
//Output: none
void... | ALGO | 0.995217 | 4.200988 |
7b6f385b-17e4-4ea6-ba68-7efd2df47a1d | raincross7/code-similarity | codes/train_code/problem271/problem271_347.cpp | #include<iostream>
using namespace std;
int main(){
double p[4][2],m[2][2],inv[2][2],det,x[2];
while(cin >>p[0][0]>>p[0][1]>>p[1][0]>>p[1][1]>>p[2][0]>>p[2][1]>>p[3][0]>>p[3][1]){
for(int i=1; i<4; i++) for(int j=0; j<2; j++) p[i][j]-=p[0][j];
for(int i=0; i<2; i++) for(int j=0; j<2; j++) m[i][j] = p[1+j][i... | ALGO | 0.999819 | 3.37471 |
4f5f6163-5474-4ecc-bb3b-acb6f1d10520 | kevinchangjk/code-comps | codeforces/cpp/1774A.cpp | /**
* Template C++ file for Codeforces problems.
* Written by @kevinchangjk
*/
// #include <bits/stdc++.h>
#include <cmath>
#include <iostream>
#include <string>
#define ll long long
#define f first
#define s second
#define pii pair<int,int>
#define pll pair<ll,ll>
#define pb push_back
#define epb emplace_back
#def... | ALGO | 0.999156 | 4.279184 |
37645fba-c657-4f6d-8d77-79fd94b5bc16 | cdfq277462/ur5_JetsonNano | include/adjustthreshold/adjustthreshold.cpp | #include "adjustthreshold.h"
Adjustthreshold::Adjustthreshold()
{
}
bool Adjustthreshold::readImg(std::string imgName)
{
origImg = cv::imread(imgName);
if(origImg.empty())
return false;
cv::cvtColor(origImg, grayImg, cv::COLOR_BGR2GRAY);
return true;
}
double Adjustthreshold::getAdjustThresh... | TOOL | 0.905335 | 4.539787 |
68846df4-885b-4687-aba6-616fae8871bc | WasmCFuzz/WasmCFuzz | custom_mutators/libfuzzer/FuzzerCrossOver.cpp | #include "FuzzerDefs.h"
#include "FuzzerMutate.h"
#include "FuzzerRandom.h"
#include <cstring>
namespace fuzzer {
// Cross Data1 and Data2, store the result (up to MaxOutSize bytes) in Out.
size_t MutationDispatcher::CrossOver(const uint8_t *Data1, size_t Size1,
const uint8_t *Dat... | ALGO | 0.983656 | 6.036198 |
8eabedb3-450e-4664-abb2-e0d068baab9c | remichartier/022_selfDrivingCarND_HighwayDrivingPathPlanner | src/Eigen-3.3/bench/sparse_setter.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.935109 | 4.152793 |
5d035259-b6a6-4e27-8e62-dde15e3f830a | Sophriel/DirectX_ODEengine_TableTennis | OPCODE/Ice/IceRay.cpp | ///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
/**
* Contains code for rays.
* \file IceRay.cpp
* \author Pierre Terdiman
* \date April, 4, 2000
*/
///////////... | ALGO | 0.994639 | 5.89369 |
256aedd4-104b-44b6-8684-4fb83cc2f864 | AnanyaSinha2717/CPP-Projects | INDIE/Cube_Calc.cpp | #include <iostream>
#include <cmath>
using namespace std;
double cube(double num)
{
return num * num * num;
}
int main()
{
double num;
cout << "Enter a number: ";
cin >> num;
double answer = cube(num);
cout << answer << endl;
return 0;
} | TOOL | 0.988971 | 4.671185 |
65c51484-fb68-4860-872e-68fabedc9c9e | Mulab11/cntt2016-hw1 | TC-SRM-584-div1-900/grq.cpp | #include<bits/stdc++.h>
#define sqr(x) (x)*(x)
#define ll long long
#define ull unsigned long long
#define ui unsigned int
#define vi vector<int>
#define pb push_back
#define ld long double
#define mp make_pair
#define pii pair<int,int>
#define debuge puts("isok")
#define debug(x) cout<<#x<<"="<<x<<endl
#define SS seco... | ALGO | 0.999577 | 3.342294 |
cbac40bd-4f03-4935-86ae-41c7cf5e4572 | EthanKim8683/High-School-Competitive-Programming | USACO/Guide/Gold/Modular Arithmetic/santa.cpp | #include <iostream>
#include <cstdio>
using namespace std;
using I = int;
using Lli = long long int;
const Lli MOD = 998244353;
const I K = 1e6;
const I A = 1e6;
I a_arr[K];
Lli prbs[A];
Lli pow(Lli bse, Lli exp) {
Lli res = 1;
while (exp) {
if (exp & 1)
res = res * bse % MOD;
bse = bse * bse % M... | ALGO | 0.999358 | 3.823809 |
6f30fa83-0e5e-4d54-88a4-d0081d9aae55 | OdikemeEbi/ict_yep_mobile_app | 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 |
ade924ca-5c91-4571-98a5-0c6650372274 | hachanhvu2205/Google_research_football | third_party/gfootball_engine/src/onthepitch/referee.cpp | // written by bastiaan konings schuiling 2008 - 2015
// this work is public domain. the code is undocumented, scruffy, untested, and should generally not be used for anything important.
// i do not offer support, so don't ask. to be used for inspiration :)
#include "referee.hpp"
#include <cmath>
#include "../scene/ob... | ALGO | 0.940643 | 5.553465 |
19376c73-4542-4336-add5-90ce01a08e4f | JaninduTharuka/210306G_Data-Structures-and-Algorithms | Lab 9/hashtable_basics.cpp | #include <cstring>
#include <string>
#include <iostream>
using namespace std;
struct HashTable{
int MAX_LENGTH = 4;
string * password = new string[MAX_LENGTH];
void intialize_hashtable(){
for (int i = 0; i < 4; i++){
password[i].clear();
}
}
bool isFull(){
bool ... | TOOL | 0.974337 | 4.481853 |
76e7dcc2-0463-4297-a985-94dcb250feb0 | RavinaShende/MKPITS_Ravina_Shende_March2022 | formula-4.cpp | #include<stdio.h>
#include<conio.h>
main()
{
int a, v, u,t=5;
printf("final velocity");
scanf("%d",&v);
printf("initial velocity");
scanf("%d",&u);
a=(v-u)/t;
printf("Accelration a= %d",a);
} | ALGO | 0.997717 | 3.117238 |
4220d0ea-234e-461d-8e5a-dc3049ce3120 | manikanta2901/ubuntu | .history/imp/cpp/DataStructures/singlyLinklist/creatingAnode_20200622140940.cpp | #include <bits/stdc++.h>
using namespace std;
class Node {
public:
int data;
Node* next;
};
void printList(Node* n)
{
while (n != NULL) {
cout << n->data << " ";
n = n->next;
}
cout << endl;
}
int main()
{
Node* head = new Node();
Node* second = new Node();
Node* third = new Node();
... | ALGO | 0.99947 | 4.279722 |
98d6dac4-cec8-447c-b7f8-1c26ab2fcb9d | ishandutta2007/codeforces | komendart/normal/707/A.cpp | #include <bits/stdc++.h>
using namespace std;
signed main() {
ios_base::sync_with_stdio(false); cin.tie(0);
int n, m;
cin >> n >> m;
for (int i = 0; i < n * m; i++) {
string s; cin >> s;
if (s == "C" || s == "M" || s == "Y") {
cout << "#Color\n";
return 0;
... | ALGO | 0.999413 | 4.421745 |
e0ac8197-d9e5-439d-9f8b-a6b9d0babaa3 | surajkumar2207/DSA | Arrays/duplicatesinsorted.cpp | #include<iostream>
#include<vector>
using namespace std;
vector<int> removeDuplicates(vector<int> &v){
int i = 0;
int j = 1;
while(j < v.size()){
if(v[i] !=v[j]){
int temp = v[i+1];
v[i+1] = v[j];
v[j] = temp;
j++; i++;
}else if(v[i] == v... | ALGO | 0.998838 | 4.436307 |
f47d9cb3-4b62-44d2-b151-7a88e7ba0c67 | Snigdha7906/QuestionsRandom | 1May_prefixSuffixSearch.cpp | /*Design a special dictionary which has some words and allows you to search the words in it by a prefix and a suffix.
Implement
WordFilter(string[] words) Initializes the words in the dictionary
f(string prefix, string suffix) Returns the index of the word in the dictionary which has the prefix prefix and the suffix... | ALGO | 0.999561 | 5.551999 |
f4c00a12-a198-43c6-83f5-00393cd287cb | juneeda-maker/Algorithm | algowithc/์๊ณ ๋ฆฌ์ฆ/sort_func2.cpp | #include <iostream>
#include <vector>
#include <algorithm>
using namespace std;
bool compare(pair<string, pair<int, int> > a,
pair<string, pair<int, int> > b ){
if(a.second.first == b.second.first){
return a.second.second > b.second.second;
} else{
return a.second.first > b.second.... | ALGO | 0.988819 | 3.838293 |
d0861a2a-b4ee-4125-beff-5324180b6d76 | tusharhow/flutter-tv | 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.998687 | 6.797341 |
7331c4ca-3b4b-4977-bdbc-d94a3f397009 | jombaek/Leetcode | C++/784._Letter_Case_Permutation.cpp | class Solution {
public:
vector<string> ans;
void backtrack(string& s, vector<string>& ans, int i)
{
if (i == s.size())
{
ans.push_back(s);
return;
}
if (isalpha(s[i]))
{
s[i] = toupper(s[i]);
backtrack(s, ans, i + 1);... | ALGO | 0.999513 | 6.630412 |
912219d7-365b-422f-81a8-0146ddf9efd5 | sx-aurora-devold/llvm | lib/Transforms/InstCombine/InstCombineSimplifyDemanded.cpp | #include "InstCombineInternal.h"
#include "llvm/Analysis/ValueTracking.h"
#include "llvm/IR/IntrinsicInst.h"
#include "llvm/IR/PatternMatch.h"
#include "llvm/Support/KnownBits.h"
using namespace llvm;
using namespace llvm::PatternMatch;
#define DEBUG_TYPE "instcombine"
namespace {
struct AMDGPUImageDMaskIntrinsic {... | TOOL | 0.982544 | 5.542084 |
1ed957e2-d327-4675-9805-4b961507f0f3 | thiagotps/linear-algebra | eigen-3.4-rc1/doc/examples/TutorialLinAlgExSolveLDLT.cpp | #include <iostream>
#include <Eigen/Dense>
using namespace std;
using namespace Eigen;
int main()
{
Matrix2f A, b;
A << 2, -1, -1, 3;
b << 1, 2, 3, 1;
cout << "Here is the matrix A:\n" << A << endl;
cout << "Here is the right hand side b:\n" << b << endl;
Matrix2f x = A.ldlt().solve(b);
cout << "... | ALGO | 0.999919 | 3.807622 |
3ec404e6-1598-4f01-96d0-7d1c9a9947a7 | MilkClouds/Competitive-Programming | BOJ/milkclouds/02820/2820.cpp17.cpp | #include <bits/stdc++.h>
#define rep(a,b,c) for(ll a = b; a < c; a++)
#define rep2(a,b,c) for(ll a = c - 1; a >=b; a--)
#define all(x) (x).begin(), (x).end()
#define pb push_back
#define x first
#define y second
using namespace std;
using ll = long long;
using tll = tuple<ll, ll, ll>;
using pl = pair<ll, ll>;... | ALGO | 0.999916 | 3.525887 |
38015b42-a7e9-4d5b-916b-fb770371bc59 | ishandutta2007/codeforces | noimi/normal/1454/C.cpp | #pragma region Macros
#pragma GCC optimize("O3")
#pragma GCC target("avx2,avx")
#pragma GCC optimize("unroll-loops")
#pragma GCC target "sse4.2"
#include <bits/stdc++.h>
#define ll long long
#define ld long double
#define rep2(i, a, b) for(ll i = a; i <= b; ++i)
#define rep(i, n) for(ll i = 0; i < n; ++i)
#define rep3(... | ALGO | 0.999476 | 4.126895 |
66c401d0-5b50-4c51-baf4-66f643514ef0 | yuyunjae/acmicpc.net | baekjoon/2042/main.cpp | #include <iostream> // sol 676ms
using namespace std;
long long int seq[4000000];
long long int number[1000000];
long long int make_heap(int start, int end, int index)
{
if (start == end)
{
seq[index] = number[start];
return (number[start]);
}
int mid = (start + end) / 2;
seq[inde... | ALGO | 0.999969 | 3.734266 |
e09a803f-02c4-4548-8e37-aa289bc581f5 | sunstick/code-street | leetcode/word_search.cpp | /*
Given a 2D board and a word, find if the word exists in the grid.
The word can be constructed from letters of sequentially adjacent cell, where "adjacent" cells are those horizontally or vertically neighboring. The same letter cell may not be used more than once.
For example,
Given board =
[
["ABCE"],
["SFCS"... | ALGO | 0.999898 | 6.341926 |
5945ed62-dadb-4a0c-8fca-cf0046ff1a2a | laxmishinde29/Logic_Building | program453.cpp | // Generic LinkedList
#include<iostream>
using namespace std;
template <class T>
struct node
{
T data;
struct node *next;
};
template <class T>
class SinglyLL
{
private:
struct node<T> * First;
int iCount;
public:
SinglyLL();
void Display();
int Count();
... | ALGO | 0.996588 | 4.313521 |
a1dc166a-9557-49b9-9a9a-9d6efe808443 | allwellll/cf_code_jiangly | 1491/1491B-B-MinimalCost.cpp | // url:https://codeforces.com/contest/1491/problem/B
// time:2021-02-28 16:44:40
// name:B-MinimalCost
#include <bits/stdc++.h>
using i64 = long long;
using u64 = unsigned long long;
using u32 = unsigned;
int main() {
std::ios::sync_with_stdio(false);
std::cin.tie(nullptr);
int t;
std::cin >> t;
wh... | ALGO | 0.99987 | 5.226318 |
413832f4-4fb4-44a1-875f-f853a0e49f50 | abdallamaher/competitive_programming | Math/Number_Theory/Divisors_Primes_PrimeDivisors/Divisibility/B_Pleasant_Pairs.cpp | #include <bits/stdc++.h>
using namespace std;
#define ll long long
inline void solve() {
int n; cin >> n;
map<int, int> mp;
int ans = 0;
for (int i = 1; i <= n; i++) {
int a; cin >> a;
int b = 1;
while (a * b <= 2 * n) {
if (mp[b] && b * a == mp[b] + i)ans++;
... | ALGO | 0.999788 | 4.216353 |
42cfed18-05e7-41ca-a248-da17ba86b10f | tanishq252/myLeetcodeSolutions | 86-partition-list/86-partition-list.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* partition(L... | ALGO | 0.999992 | 5.268111 |
50dc0660-d10c-425d-bea5-df1a46cbe8b4 | andrenovax/udacity-estimation | src/QuadControl.cpp | #include "Common.h"
#include "QuadControl.h"
#include "Utility/SimpleConfig.h"
#include "Utility/StringUtils.h"
#include "Trajectory.h"
#include "BaseController.h"
#include "Math/Mat3x3F.h"
#ifdef __PX4_NUTTX
#include <systemlib/param/param.h>
#endif
void QuadControl::Init()
{
BaseController::Init();
// variab... | ALGO | 0.956912 | 5.673411 |
3e3c00a7-d28f-422d-97c5-ed8aceae7e98 | KrishanKantAgnihotri/CP-Solutions | Atcoder/C++ (GCC 9.2.1)/abc168_a/14697722.cpp | #include<bits/stdc++.h>
//#include<boost/multiprecision/cpp_int.hpp>
#include<ext/pb_ds/assoc_container.hpp>
#include<ext/pb_ds/tree_policy.hpp>
#define ull unsigned long long int
#define ll long long
#define vi vector<int>
#define mii map<int,int>
#define all(x) x.begin(),x.end()
#define fast_io ios_base::sync_with_s... | ALGO | 0.999928 | 3.593634 |
7422d074-f959-4ab2-bbdc-c5fa0d853ff9 | nikhil-robinson/opencv-esp32 | opencv_contrib/modules/dpm/samples/cascade_detect_sequence.cpp | #include <opencv2/dpm.hpp>
#include <opencv2/core.hpp>
#include <opencv2/imgproc.hpp>
#include <opencv2/highgui.hpp>
#include <stdio.h>
#include <iostream>
#include <fstream>
using namespace cv;
using namespace cv::dpm;
using namespace std;
int save_results(const string id, const vector<DPMDetector::ObjectDetection>... | DATA | 0.937214 | 5.91636 |
8d2479d3-79e6-4845-8a35-fcaef7e7fb26 | Mihas8r/OOP_Lab_Homework | T6.1/T6.1/T6.1.cpp | #include <iostream>
#include <cmath>
using namespace std;
class ComplexNumber
{
public:
double real, imag;
ComplexNumber(double real = 0, double imag = 0) {
this->real = real;
this->imag = imag;
}
};
class Operations :ComplexNumber {
public:
double a;
Operations() {
this->a = a;
}
v... | TOOL | 0.963834 | 4.365303 |
146f1c6c-0854-4213-9c48-43d5ad425c76 | ahampriyanshu/algo-ds-101 | Data-Structures/Queue/Priority-Queue/Priority-Queue.cpp | #include<bits/stdc++.h>
using namespace std;
// Node Declaration
struct node
{
int priority;
int info; // info stands for the value or the item to be added
struct node *link;
};
// Class Priority Queue
class Priority_Queue
{
private:
node *front; //front node of queue
public:
Priority_Queue(... | ALGO | 0.9977 | 4.599283 |
e554c9f5-9bfb-4cd0-b6bc-884283476144 | aman12207/Leetcode-Solutions | 1207-unique-number-of-occurrences/1207-unique-number-of-occurrences.cpp | class Solution {
public:
bool uniqueOccurrences(vector<int>& arr) {
unordered_map<int,int> m,freq;
for(auto i : arr){ // storing {number,count}
m[i]++;
}
for(auto i : m){ // storing {count,freq}
freq[i.second]++;
}
for(auto ... | ALGO | 0.999969 | 6.114121 |
d04869d9-aaff-41f8-8914-510fa7f6e8a7 | AIZ2201/VisualCampus | demo3/opencv/sources/samples/cpp/segment_objects.cpp | #include "opencv2/imgproc.hpp"
#include "opencv2/videoio.hpp"
#include "opencv2/highgui.hpp"
#include "opencv2/video/background_segm.hpp"
#include <stdio.h>
#include <string>
using namespace std;
using namespace cv;
static void help(char** argv)
{
printf("\n"
"This program demonstrated a simple method... | ALGO | 0.912195 | 5.580627 |
7f202351-314c-41e2-bbc0-1bf1e86f1665 | algoguy1/DSA-problems | linked list/insert at begin in singly linked list.cpp | #include<iostream>
using namespace std;
struct node {
int data;
node* next;
node(int x) {
data = x;
next = nullptr;
}
};
node* insertbegin(node* head, int x) {
node* newNode = new node(x); // Create a new node with the value x
newNode->next = head; // Set the next poi... | ALGO | 0.999666 | 5.104614 |
f8268cbf-9f9c-4891-826b-8aa4c76c1bb3 | kventinel/BSU | 4_sem/MNA/Lab8/main.cpp | #include <cmath>
#include <iostream>
double function(double x) {
return pow(2.0, x) / (1 - pow(4.0, x));
}
double left_rectangle(double a, double b, double eps) {
double old_int = function(a) * (b - a);
int n = 2;
while (true) {
double new_int = 0;
double h = (b - a) / n;
for (... | ALGO | 0.99995 | 4.960546 |
9e6f90ab-fd2e-47ad-bf5f-cce5674e458e | MahinAshraful/CodeWatch_Data | sample-data/p00001/s901285609.cpp | #include<iostream>
using namespace std;
int main(){
const int n = 3;
const int num = 10;
int t;
int a[num] = {0};
int b[n] = {0};
for(int i = 0; i < num; i++)
{
cin >> a[i];
}
b[0] = a[0];
for(int i = 1; i < num; i++)
{
t = a[i];
for(int j = 0;j < n; j++)
{
if(t > b[j])
{
for(int k = n-1; k >= j+1; k--)
... | ALGO | 0.999949 | 3.357359 |
8f484269-4006-4498-9021-cf2e590a92e6 | anindyaspaul/competitive-programming | codechef/CHEFELEC.cpp | #include <bits/stdc++.h>
using namespace std;
typedef long long LL;
typedef unsigned long long ULL;
#define MX 100010
#define INF 1000000010
int ara[MX];
char str[MX];
vector <int> pos;
int main()
{
int t;
scanf("%d", &t);
while(t--) {
int n;
scanf("%d", &n);
scanf("%s", str);
... | ALGO | 0.999871 | 3.585602 |
146de38d-d74b-418f-b144-b29ede99e3d7 | LongPham7/hybrid_aara_artifact | volesti/R-proj/src/polytopes_modules.cpp | // VolEsti (volume computation and sampling library)
#include <Rcpp.h>
class Hpolytope {
public:
Hpolytope() {}
Hpolytope(Rcpp::NumericMatrix _A, Rcpp::NumericVector _b) : A(_A), b(_b), Aeq(Rcpp::NumericMatrix(0,0)),
beq(Rcpp::NumericVector(0)), vol(std::numeric_limits<double>::signaling_NaN()... | ALGO | 0.992499 | 5.956096 |
d8ea4654-be16-4e27-883e-d9c356477534 | gurgentus/CCST-Sim | Cst/Pfd.cpp | #include "Pfd.hpp"
#include <sstream>
#include <cmath>
#include <iostream>
Pfd::Pfd()
{
}
void Pfd::reset()
{
decomp.clear();
}
void Pfd::addToPfd(double r_1, double r_2, double c, double d, int multiplicity)
{
pfdFraction mPfdFraction;
mPfdFraction.r1 = r_1;
mPfdFraction.r2 = r_2;
mPfdFraction.... | ALGO | 0.98729 | 4.076081 |
78b2c113-65cd-4842-a2eb-34d4bce4c9ec | KleskBY/IrrLicht-Shooter-Example | irrBullet/3rdparty/bullet3-2.83.7/src/BulletCollision/CollisionDispatch/btUnionFind.cpp | #include "btUnionFind.h"
btUnionFind::~btUnionFind()
{
Free();
}
btUnionFind::btUnionFind()
{
}
void btUnionFind::allocate(int N)
{
m_elements.resize(N);
}
void btUnionFind::Free()
{
m_elements.clear();
}
void btUnionFind::reset(int N)
{
allocate(N);
for (int i = 0; i < N; i++)
{
m_elements[i].m_id = ... | ALGO | 0.989184 | 4.788029 |
e244a4c0-8579-456f-ba17-37d97289f23a | tolgagolbasi/HomeworkCENG | Montgomery reduction/opencl/cl/app/TemplateC/Source.cpp | #include <string.h>
#include <cstdlib>
#include <iostream>
#include <string>
#include <fstream>
#include <time.h>
int main()
{
clock_t begin, end;
double time_spent;
unsigned long input1[2560000];
unsigned long input2[2560000];
unsigned long output[2560000];
bool passed = true;
begin = clock();
for(unsign... | ALGO | 0.995126 | 3.050493 |
2378c850-dd13-45de-89b7-8d139a74c9e2 | Aidyn-A/NektarWithScalar | library/LibUtilities/Foundations/NodalTetElec.cpp | #include <LibUtilities/BasicUtils/ErrorUtil.hpp>
#include <LibUtilities/Foundations/NodalTetElec.h>
#include <LibUtilities/Foundations/NodalTetElecData.h>
#include <LibUtilities/Foundations/NodalUtil.h>
#include <LibUtilities/LinearAlgebra/NekVector.hpp>
#include <LibUtilities/LinearAlgebra/NekMatrix.hpp>
namespace Ne... | ALGO | 0.995418 | 4.488114 |
261b89b2-358e-42d0-87eb-10dcfc80381d | MegaBeing/C-Practices | DataStructures/CircularLinkedList/delAtVal.cpp | #include<bits/stdc++.h>
using namespace std;
class node{
public:
int data;
node *next;
node(int i){
data=i;
next=NULL;
}
};
void delEle(node *&head,node *&tail){
node *hd=head;
cout<<"\nelement:\t";
int pos;
cin>>pos;
while(head->next->data!=pos){
head=hea... | ALGO | 0.999879 | 4.35239 |
fc756117-028f-4f00-be3d-0faf4b558b52 | kyeah/Cloth-Fluids-Solver | fluids/eigen_3.2.2/doc/examples/TutorialLinAlgSVDSolve.cpp | #include <iostream>
#include <Eigen/Dense>
using namespace std;
using namespace Eigen;
int main()
{
MatrixXf A = MatrixXf::Random(3, 2);
cout << "Here is the matrix A:\n" << A << endl;
VectorXf b = VectorXf::Random(3);
cout << "Here is the right hand side b:\n" << b << endl;
cout << "The least-squares ... | ALGO | 0.999851 | 3.908823 |
a1b8562e-1dd4-4038-a027-ea8d160a6d47 | jskinn/phd-place-recognition-experiment | SaliencyMaskCalculator/SimilarityCriteria.cpp | #include "stdafx.h"
#include "SimilarityCriteria.h"
SimilarityCriteria::SimilarityCriteria(double radius) : radiusSquared(radius * radius)
{
}
SimilarityCriteria::~SimilarityCriteria()
{
}
bool SimilarityCriteria::isImageSimilar(const DatasetImage& baseImage, const DatasetImage& comparisonImage) const
{
// Check di... | TOOL | 0.941183 | 5.590524 |
327bcd95-51e6-4358-bf24-50891b2301db | dwhaynes/leetcode-solutions | 160-intersection-of-two-linked-lists/2022-03-06 19.57.21 - Accepted - runtime 91ms - memory 14.5MB.cpp | /**
* Definition for singly-linked list.
* struct ListNode {
* int val;
* ListNode *next;
* ListNode(int x) : val(x), next(NULL) {}
* };
*/
class Solution {
int len(ListNode* curr){
if(!curr) return 0;
int sz = 1;
while(curr->next){
curr = curr->next;
... | ALGO | 0.999821 | 5.296245 |
7e20263d-17aa-4455-817c-52c1e2dc3933 | ashallue/tabulate_car | primetest.cpp | // Code written by Jonathan Sorenson
#include "primetest.h"
// 32 and 64-bit strong pseudoprime test for the given base
// we have n-1=m*2^e with m odd
bool strong(int32 base, int32 n, int32 m, int16 e)
{
int64 x=powmod(base, m, n);
if(x==1 || x==n-1) return true;
for(int i=0; i<e; i++)
{
x=(x*x)%n;
i... | ALGO | 0.978336 | 5.724761 |
39677c53-7ef6-4f66-b5d5-a0de3bec539a | manvii3110/Data_Structure | stack/prefix_to_postfix.cpp | #include<iostream>
#include<stack>
using namespace std;
bool isOperand(char c){
if((c>='a'&& c<='z') || (c>='A' && c<='Z'))
return true;
else
return false;
}
string PrefixToPostfix(string prefix){
stack<string> s;
for(int i=prefix.length()-1;i>=0;i--)
{
if(isOperand(prefix[i])){
string op(1,pref... | ALGO | 0.999641 | 4.727999 |
c6c518a4-5829-4080-ac3b-ffe775ecbc56 | colinrford/linearalgebra | vectorspace/tests/testt.cpp |
#include <chrono>
#include <list>
#include <numeric>
#include <ratio>
#include <sstream>
#include <string>
#include <thread>
//#include <tbb/tbb.h>
#include "vector.cpp"
template <typename T>
using std_vector = std::vector<T>;
using la_vector = linalg::vector;
//std::tuple<std_vector<la_vector>,
// std::ch... | TOOL | 0.98943 | 6.514278 |
83beb5b1-489c-4745-afdb-c53fde6d04f5 | Sciencethebird/CS_OOP | 4.Lab4/ๆธฌ่ณ/lab4_1/main_1_3.cpp | #include <iostream>
#include <stdio.h>
using namespace std;
#include "ArrayStack.h"
int main(){
ArrayStack<int> test;
test.push(5);
test.push(7);
test.push(6);
printf("%d\n", test.getSize());
printf("%d\n", test.isEmpty());
printf("%d\n", test.Top());
test.pop();
printf("%d\n", test... | ALGO | 0.877341 | 3.760907 |
5faec2f2-34b4-452c-8266-e3a5587e191f | neelesh1112/LeetCode-GFG | Easy/Check if string is rotated by two places/check-if-string-is-rotated-by-two-places.cpp | //{ Driver Code Starts
#include <bits/stdc++.h>
using namespace std;
// } Driver Code Ends
class Solution
{
public:
//Function to check if a string can be obtained by rotating
//another string by exactly 2 places.
bool isRotated(string str1, string str2)
{
// Your code here
int n1= ... | ALGO | 0.999709 | 5.7093 |
e4aeae80-c9dd-4af4-b8c2-8dee63d2178a | alexvelea/competitive | infoarena/petsoft/petsoft.cpp | #include <cstdio>
#include <algorithm>
#include <vector>
using namespace std;
#define max_n 1005
#define FORIT( it,v ) for(typeof((v).begin()) it=(v).begin(); it!=(v).end(); ++it )
#define pb push_back
int Best[max_n][max_n][2];
int Rez [max_n][2];
vector<int> Vertex[max_n];
int n,i,Father;
void get_max( int &a, in... | ALGO | 0.999838 | 3.872284 |
63c64fbb-f399-4ab3-a536-95ed65268d83 | Shekhu04/Code-Studio | reverseStackUsingRecursion.cpp | void insertAtBottom(stack<int> &s , int x) //making a function
{
//base case
if(s.empty()) //checking till stack is empty
{
s.push(x); //inserting x when stack is empty
return;
}
int num = s.top(); //storing top element in num
s.pop(); //removing top element
//recursive c... | ALGO | 0.999987 | 5.801318 |
4839ea0e-8d0e-49c0-95a1-55c1677b6a40 | ebzkurt1/CppLearning | coding_challange/challange_day_20_05_23.cpp | // The main idea of this challange is to build uniq cli tool.
// 20.05.23
#include <iostream>
#include <fstream>
#include <string>
#include <map>
#include <vector>
std::map<std::string, int> process_input_file(std::string filename)
// read input file line by line and save it to an ordered map
{
std::map<std::... | TOOL | 0.997045 | 5.729049 |
9277e9d6-1c19-49f2-85ac-28cfea3f5978 | a092devs/DSA-Practice | lecture 030 - macros, global variables, keywords/defaultArgs.cpp | #include<iostream>
using namespace std;
void print(int arr[], int n, int start = 0){
for(int i = start; i < n; i++) {
cout << arr[i] << " ";
}
cout << endl;
}
int main(){
int arr[5] = {5, 6, 7, 8, 9};
int n = 5;
print(arr, n);
print(arr, n, 2);
return 0;
} | ALGO | 0.994232 | 5.052643 |
5169d248-e8fa-4b64-913b-1129827eaab5 | thegamer1907/Code_Analysis | Graphs/2808.cpp | #if 1
#include <bits/stdc++.h>
#else
#include "includes.h"
#endif
using namespace std;
#if 1
#define pv(x) cout<<#x<<" = "<<(x)<<"; ";cout.flush()
#define pn cout<<endl
#else
#define pv(x)
#define pn
#endif
#if 1
#define in cin
#define out cout
#else
ifstream in("date.in");
ofstream out("date.out");
... | ALGO | 0.999996 | 4.48943 |
1a5a81f6-9302-4c75-9eef-e4700f8ac423 | Kushagra-Madhukar/dsa_practice | Minimum Cost Path - GFG/minimum-cost-path.cpp | // { Driver Code Starts
#include<bits/stdc++.h>
using namespace std;
// } Driver Code Ends
class Solution
{
public:
// void DFS(int cost, int i, int j, int &minCost, vector<int> &vis, int n, int m, vector<vector<int>>& grid) {
// if(i == n-1 && j == m-1) {
// minCost = min(minCost, cost +... | ALGO | 0.999933 | 6.4031 |
1f601668-1945-460d-8c99-dc11bddb9f4c | IDEA-CUHK/FlatDD | extern/taskflow/examples/dependent_async_algorithm.cpp | /**
This program demonstrates how to use dependent async tasks to create
dependent algorithm tasks.
*/
#include <taskflow/taskflow.hpp>
#include <taskflow/algorithm/for_each.hpp>
#include <taskflow/algorithm/transform.hpp>
#include <taskflow/algorithm/reduce.hpp>
int main(){
const size_t N = 65536;
tf::Exec... | ALGO | 0.999519 | 6.347857 |
7d04930e-4fe4-4155-b6a1-2f9bffd3396e | adhimaswisnuyudo/unisba_sisfo_afternoon | 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.998762 | 6.786404 |
1f83a877-1f8c-4c89-879f-d30e133c00b2 | anashssn/Data-Structure-codes | Adjacency Matrix.cpp | #include <iostream>
#include <iomanip>
using namespace std;
void PrintMatrix(int MAT[][10], int n)
{
int i, j;
cout << "\n\n" << setw(4) << " ";
for (i=0 ; i<n ; i++)
cout << setw(3) << "(" << i+1 << ")";
cout << "\n\n";
for (i=0 ; i<n ; i++)
{
cout << setw(3) << "(" << i+1 << ... | ALGO | 0.989298 | 3.897099 |
ae5046c6-b207-483c-bd31-b23b908192be | asrjy/dsa | 0ld/geeksforgeeks/arrayInsertAtEnd.cpp | #include <iostream>
void insertAtEnd(int arr[], int sizeOfArray, int element)
{
arr[sizeOfArray - 1] = element;
}
int main()
{
int sizeOfArray(0), iter(0), element(0);
std::cin >> sizeOfArray;
int arr[sizeOfArray];
for (iter = 0; iter < sizeOfArray - 1; iter++)
{
std::cin >> arr[iter];
... | ALGO | 0.999885 | 4.238993 |
bb2e8d86-0c84-4998-847b-df98ac317608 | sheikh-arman/SegmentTree | toph_Non-zero_ANDs_Accepted_Solution_Segment_Tree_in_C++.cpp |
/*
Sk arman Hossain
University of Barisal
Problem name : toph Non-zero ANDs
Algorithm/Data Structure : Segment Tree
*/
#include<bits/stdc++.h>
#define T(n) printf("test %d\n",n)
typedef long long int ll;
using namespace std;
vector<ll>V,V2,V3;
ll ar[100010];
ll result[40];
ll seg_tree[400010][40];
ll... | ALGO | 0.999981 | 4.022426 |
5718ef6f-3e5b-4dcf-b674-ad97590fb7e1 | nhingthao1203/CSLT | Chuong3/BTH03/BT08.cpp | #include <iostream>
using namespace std;
int main()
{
int mth, yr;
cout << "Nhap thang: ";
do
{
cin >> mth;
if(mth < 1 || mth > 12) cout << "Thang khong hop le. Moi nhap lai: ";
} while (mth < 1 || mth > 12);
cout << "Nhap nam: ";
do
{
cin >> yr;
if(y... | ALGO | 0.982155 | 3.687938 |
cb71b7f2-d041-4147-9629-5511f08aca6d | whippingdot/AdventOfCode-Stuffs | 2024/aoc/C++/day-1/01-2.cpp | #include "C:\Users\sanja\OneDrive\Documents\Coding\GitHubProjects\AdventOfCode-Stuffs\2024\aoc\aoc.h"
void Day1Part2()
{
std::vector<std::string> input = read_file("C:\\Users\\sanja\\OneDrive\\Documents\\Coding\\GitHubProjects\\AdventOfCode-Stuffs\\2024\\aoc\\C++\\day-1\\input.txt");
int answer = 0;
std::vector<i... | ALGO | 0.998931 | 5.000287 |
77b5fd72-7cb2-4c9b-9af4-6f74f219b654 | reoden/tpl_ref | library/USI-ctl/datastruct/cartesian-tree.cpp | /**
* Author: Yuhao Yao
* Date: 22-10-23
* Description: Cartesian Tree of array $as$ (of distinct values) of length $N$. Node with smaller depth has smaller value. Set $gr = 1$ to have top with the greatest value. Returns the root of Cartesian Tree, left sons of nodes and right sons of nodes. ($-1$ means no left son... | ALGO | 0.999925 | 4.754556 |
d3850bfe-2c0c-423a-8f42-b0bc9f8df634 | iamrajee/fast_planner_ws | src/.Fast-Planner-for-ubuntu20.04/uav_simulator/so3_quadrotor_simulator/include/ode/libs/numeric/odeint/examples/elliptic_functions.cpp | #include <iostream>
#include <fstream>
#include <cmath>
#include <boost/array.hpp>
#include <boost/numeric/odeint/config.hpp>
#include <boost/numeric/odeint.hpp>
#include <boost/numeric/odeint/stepper/bulirsch_stoer.hpp>
#include <boost/numeric/odeint/stepper/bulirsch_stoer_dense_out.hpp>
using namespace std;
using... | ALGO | 0.999989 | 5.294099 |
75a788ef-93ee-486c-a6a5-2e7521330636 | zlxljj/carAndroid | tess-two/jni/com_googlecode_tesseract_android/src/cube/search_column.cpp | #include "search_column.h"
#include <stdlib.h>
namespace tesseract {
SearchColumn::SearchColumn(int col_idx, int max_node) {
col_idx_ = col_idx;
node_cnt_ = 0;
node_array_ = NULL;
max_node_cnt_ = max_node;
node_hash_table_ = NULL;
init_ = false;
min_cost_ = INT_MAX;
max_cost_ = 0;
}
// Cleanup data
v... | ALGO | 0.99956 | 6.491274 |
0079d495-6682-414d-9d42-6322829a0e5b | EliGwz/leetcode | top-interview-questions-easy-collection/design/384.ๆไนฑๆฐ็ป.cpp | /*
* @lc app=leetcode.cn id=384 lang=cpp
*
* [384] ๆไนฑๆฐ็ป
*/
// @lc code=start
#include <vector>
#include <cstdlib>
#include <ctime>
using namespace std;
class Solution {
vector<int> origin;
vector<int> now;
public:
Solution(vector<int>& nums) {
this->origin = vector<int>(nums);
this->n... | ALGO | 0.997755 | 6.053915 |
78f50ec9-2cf7-496c-9bf7-427140f5259f | CarbezonKARDE/Leet | 3356. Zero Array Transformation II.cpp | class Solution {
public:
int minZeroArray(vector<int>& nums, vector<vector<int>>& queries) {
int n = nums.size(), sum = 0, k = 0;
vector<int> cnt(n + 1, 0);
for (int i = 0; i < n; i++) {
while (sum + cnt[i] < nums[i]) {
if (k == queries.size()) return -1;
... | ALGO | 0.999883 | 5.838449 |
e7c9a31c-507c-4218-9e85-5b1b7725192f | auschill/FGPA-SoC-HLS-with-AMD-AUP-ZU3 | Labs/FIR/Vitis_HLS/srcs/fir.cpp | #include "fir.h"
// Not optimzied code in Figure 2.1
void fir(d_out_stream& y, d_in_stream& x){
#pragma HLS INTERFACE mode=ap_ctrl_none port=return
#pragma HLS INTERFACE mode=axis register_mode=both port=y
#pragma HLS INTERFACE mode=axis register_mode=both port=x
#pragma HLS PIPELINE style=frp
coef_t c[N] = {
... | ALGO | 0.9993 | 4.90708 |
14c40f88-5fc0-4421-8700-e07d96162ec4 | AyushOJOD/DSA-codes | interviewQ/lis_xor.cpp | #include <bits/stdc++.h>
using namespace std;
bool isValid(vector<int> &a, int prev, int curr)
{
int andVal = a[prev] & a[curr];
int orVal = a[prev] | a[curr];
return andVal * 2 < orVal;
}
int helper(vector<int> &a, int curr, int prev)
{
if (curr == a.size())
{
return 0;
}
int no... | ALGO | 0.99999 | 4.996335 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.