uuid string | repo_name string | relative_path string | content string | category string | algo_rel_score float64 | quality_score float64 |
|---|---|---|---|---|---|---|
6c2a3ea5-8bcb-49e7-b2e3-2bd32194c006 | jeffjohnson9046/learncpp | main.cpp | #include "io.h"
int main() {
int firstNumber = readNumber();
int secondNumber = readNumber();
writeAnswer(firstNumber + secondNumber);
return 0;
}
| TOOL | 0.922355 | 4.342188 |
6be92a28-9fc0-4732-9e8f-476a2513a341 | BeamDC/Competitive_Programming | CCC/2023/J3.cpp | #include <bits/stdc++.h>
using namespace std;
int main() {
vector<int> a = {0,0,0,0,0};
int n, maximum,days;
string p;
cin >> n;
for (int i = 0; i < n; ++i) {
cin >> p;
for (int j = 0; j < 5; ++j) {
if(p[j]=='Y'){
++a[j];
}
}
}
... | ALGO | 0.99997 | 3.616527 |
475b22f9-4b26-497a-be2f-1504d82662f9 | ishandutta2007/codeforces | vladprog/normal/1096/D.cpp | #pragma GCC optimize("O3")
#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/rope>
#ifndef ONLINE_JUDGE
//#define DEBUG
#endif
#ifdef DEBUG
#define IFD(...) __VA_ARGS__
#define IFN(...)
#define L cout<<__LINE__<<"\n";
#define PRINT(...) __VA_ARGS__ cout<<__LINE__<<" :... | ALGO | 0.999532 | 3.641551 |
a77a5dd0-045e-4f44-90eb-a93faf8213ee | vmk8826/LeetCodeQuestions | 1299-k-concatenation-maximum-sum/k-concatenation-maximum-sum.cpp | class Solution {
public:
int mod=1e9+7;
int kConcatenationMaxSum(vector<int>& arr, int k) {
long long sum=accumulate(arr.begin(),arr.end(),0);
long long rig=0,mrig=0,lef=0,mlef=0;
for(int i=0;i<arr.size();i++){
rig+=arr[i];
mrig=max(mrig,rig);
}
... | ALGO | 0.999963 | 5.423228 |
50ec0e05-d69a-4404-8fd6-32444477f974 | Siddhant-gupta16/Gfg | Medium/Smallest Positive missing number/smallest-positive-missing-number.cpp | //{ Driver Code Starts
#include<bits/stdc++.h>
using namespace std;
// } Driver Code Ends
class Solution
{
public:
//Function to find the smallest positive number missing from the array.
int missingNumber(int arr[], int n)
{
sort(arr, arr+n);
unique(arr, arr+n);
int... | ALGO | 0.999838 | 5.581963 |
384f0a32-5542-4ad9-97a0-c6e737f45364 | nmpogg/CodePTIT | c/sochicobauocso.cpp | #include <stdio.h>
#include <math.h>
int main(){
unsigned long t, l, r, n, i, dem1, dem2;
scanf("%lu", &t);
while(t--){
dem1 = 0;
scanf("%lu %lu", &l, &r);
for(i = l; i <= r; i++){
dem2 = 0;
long long sqrt_i = (long long)sqrt(i);
for(n = 1; n <= sqrt_i; n++){
if(i % n == 0){
dem2 += 2;
... | ALGO | 0.999888 | 3.810114 |
a844e6cb-5a27-4d78-929f-608d2e76be74 | agusclap/MetodosNumericos | masaFalse.cpp | #include <iostream>
#include <math.h>
using namespace std;
double f(double x);
int main(int argc, char *argv[]) {
double a, b, c, tolerancia, error=1;
int contador=0;
cout<<"Ingrese a:"<<endl;
cin>>a;
cout<<"Ingrese b:"<<endl;
cin>>b;
cout<<"Ingrese tolerancia:"<<endl;
cin>>tolerancia;
if(f(a)*f(b)>0){
cout<... | ALGO | 0.999925 | 3.540573 |
6a2d4d44-3b4f-438d-94b6-3e40241fc792 | antops/FFTDIDLL | FFT.cpp | #include "FFT.h"
FFT::FFT()
{
}
FFT::~FFT()
{
}
void FFT::FFT_2D(double **InputR, double **InputI, double **OutputR, double **OutputI, int N, int M)
{
fftw_complex *in, *out;
fftw_plan p;
in = (fftw_complex*)fftw_malloc(sizeof(fftw_complex) * N * M);
out = (fftw_complex*)fftw_malloc(sizeof(fftw_complex) * N * M)... | ALGO | 0.99913 | 4.547998 |
475e433b-9344-4bae-9ceb-d41ee201c252 | anuragtiwari3100/DSA | Love-Babbar-450-master codes/04_searching_and_sorting/25_book_allocation_problem.cpp | /*
link: https://practice.geeksforgeeks.org/problems/allocate-minimum-number-of-pages0937/1
video [approach]: https://youtu.be/2JSQIhPcHQg
ref: 30_painters_partition...
*/
// ----------------------------------------------------------------------------------------------------------------------- //
bool is... | ALGO | 0.999992 | 5.478669 |
55f35e2e-11d4-4e6b-9751-92ee6c9bd520 | gaurisharma1/Data-Structure-and-Algorithms-Implementations | rotatearray.cpp |
#include <iostream>
using namespace std;
int* rotate1(int a[], int n, int k) {
for(int i = 0; i < k; i++) {
int temp = a[n-1];
for(int i = n-1; i >= 1; i--) {
a[i] = a[i-1];
}
a[0] = temp;
}
return a;
}
int* rotate2(int a[], int n, int k) {
int temp[n], in... | ALGO | 0.99973 | 3.948309 |
417821ce-976a-4fc2-a923-0219fd5ad4e9 | digant73/Artillery-Sidewinder-X1_releases_main_board | artillery_swx1_marlin_fw_2.0.8.2/bltouch_diga/source/Marlin-2.0.x/Marlin/src/libs/heatshrink/heatshrink_decoder.cpp | #include "../../inc/MarlinConfigPre.h"
#if ENABLED(BINARY_FILE_TRANSFER)
/**
* libs/heatshrink/heatshrink_decoder.cpp
*/
#include "heatshrink_decoder.h"
#include <stdlib.h>
#include <string.h>
#pragma GCC optimize ("O3")
/* States for the polling state machine. */
typedef enum {
HSDS_TAG_BIT, /* ... | ALGO | 0.940186 | 4.838655 |
3b13f4cc-a098-48ae-8bc5-4e3e6a5c6391 | reaktoro/reaktoro | Reaktoro/Models/ActivityModels/ActivityModelSpycherPruessEnnis.cpp | #include "ActivityModelSpycherPruessEnnis.hpp"
// Reaktoro includes
#include <Reaktoro/Common/ConvertUtils.hpp>
#include <Reaktoro/Math/Roots.hpp>
namespace Reaktoro {
using std::log;
using std::max;
using std::min;
using std::sqrt;
namespace {
// The universal gas constant in units of (bar*cm3)/(mol*K)
const auto... | ALGO | 0.958242 | 6.725703 |
31e2d3f3-1d07-4ac1-ae39-c96c2272e0bc | ishandutta2007/codeforces | radal/normal/1473/E.cpp | #include <bits/stdc++.h>
#pragma GCC optimize("O3")
#pragma GCC target("avx2,fma")
#define rep(i,l,r) for (int i = l; i < r; i++)
#define repr(i,r,l) for (int i = r; i >= l; i--)
#define X first
#define Y second
#define pb push_back
#define endl '\n'
#define debug(x) cerr << #x << " : " << x << endl;
using namespace st... | ALGO | 0.999994 | 4.006614 |
67f83182-d7a6-4b47-94b4-6d7e8a576edf | yadavarchana123/LeetCode-Problems | 2706-buy-two-chocolates/2706-buy-two-chocolates.cpp | class Solution {
public:
int buyChoco(vector<int>& prices, int money) {
int smallest = INT_MAX, second_smallest = 0;
for(int i=0; i<prices.size(); i++){
if(smallest > prices[i]){
second_smallest = smallest;
smallest = prices[i];
}
e... | ALGO | 0.999703 | 5.372422 |
c2f2d732-2a00-40fa-b5ee-74058dde95e0 | rafaelcanoguitton/AED | avl joaquin/avl joaquin.cpp | // avl joaquin.cpp : This file contains the 'main' function. Program execution begins and ends there.
//
#include "pch.h"
#include <iostream>
#include <vector>
#include <string>
#include <sstream>
#include <algorithm>
#include <random>
#include <iomanip>
#include <stdlib.h>
using std::vector;
using std::string;
using s... | ALGO | 0.993637 | 4.317139 |
8c6347d3-7c76-4445-911e-0dd3d40414e9 | blueshogun96/KunaiEngine | 3rdparty/recastnavigation/Detour/Source/DetourCommon.cpp | #include "DetourCommon.h"
#include "DetourMath.h"
//////////////////////////////////////////////////////////////////////////////////////////
void dtClosestPtPointTriangle(float* closest, const float* p,
const float* a, const float* b, const float* c)
{
// Check if P in vertex region outside A
float ab[3], ... | ALGO | 0.999778 | 7.405529 |
03d0d954-375e-4525-9fb2-c47e647b03c7 | lixworth/cpp-playground | snippets/C.cpp | /*
* Created by LixWorth
* Github: https://github.com/lixworth/
* Website: https://blog.lix.moe/
* Contact: <EMAIL>
**/
#include <bits/stdc++.h>
#define endl "\n"
using namespace std;
using ll = long long;
void solve() {
ll n;
cin >> n;
int arr[n];
for (int i = 0; i < n; ++i) cin >> arr[i];
... | ALGO | 0.999505 | 4.620939 |
4343736c-d186-4027-a716-633812386070 | priyanshukoshta5/MOB100-Leetcode-GFG | 1642-water-bottles/1642-water-bottles.cpp | class Solution {
public:
int numWaterBottles(int numBottles, int numExchange) {
int totalFull = numBottles;
int totalEmpty = 0;
int ans = 0;
while((totalFull + totalEmpty) >= numExchange)
{
ans += totalFull;
totalEmpty += totalFull;
totalFu... | ALGO | 0.999815 | 5.496265 |
0b8965fa-1409-4b61-9b48-497857f3bb09 | divy-03/CP | 1945A.cpp | /*
excl - grey
*/
#include <bits/stdc++.h>
using namespace std;
typedef int long long ll;
#define fastio ios_base::sync_with_stdio(false);cin.tie(0);cout.tie(0)
#define print(a) cout << a << "\n"
#define printab(a,b) cout << a << " " << b << "\n"
#define readV(vec) for (auto &e: vec) cin >> e;
#define debug(vec) f... | ALGO | 0.999793 | 4.657643 |
ffbe6152-c863-42a4-a2ef-8b34a339be8e | AbhijitDoesCoding/Coding | atfprep3.cpp | #include<bits/stdc++.h>
using namespace std;
typedef long long ll;
#define nline cout<<"\n";
#define yes cout<<"Yes\n";
#define no cout<<"No\n";
#define all(x) x.begin(),x.end()
#define rall(x) x.rbegin(),x.rend()
#define pb push_back
#define mp make_pair
#define ff first
#define ss second
#define mod 1000000007
#defi... | ALGO | 0.999611 | 5.009647 |
8d3ab85d-048c-4fca-9689-d8dd752d7dd1 | Lanninger08/LeetCode | LeetCode101/树/104.cpp | #include <math.h>
#include <TreeNode.h>
using namespace std;
int maxDepth(TreeNode* root) {
if(root==nullptr) return 0;
return max(maxDepth(root->left), maxDepth(root->right)) + 1;
} | ALGO | 0.98255 | 3.716248 |
7cc13ba6-a04b-4381-b7dc-016a12020604 | Anguskk/PATCode | src/C++/FavoriteColorStripe.cpp | #include <iostream>
#include <vector>
#include <algorithm>
using namespace std;
int FavoriteCOlorStripe(int argc, char* argv[])
{
int stripe[10001],dp[10001],pattern[201];
int n,M,L;cin>>n;
cin>>M;
for (int i = 1; i <=M ; ++i)
{
int color;
scanf("%d",&color);
pattern[color] = i;
}
cin>>L;
int cnt=0;
... | ALGO | 0.999642 | 3.833041 |
c21676fe-a3ee-47e6-9b0f-e928abb0dde8 | slaff/Arduino_TensorFlowLite | src/tensorflow/lite/micro/kernels/sub.cpp | #include "tensorflow/lite/kernels/internal/reference/sub.h"
#include "tensorflow/lite/c/builtin_op_data.h"
#include "tensorflow/lite/c/common.h"
#include "tensorflow/lite/kernels/internal/common.h"
#include "tensorflow/lite/kernels/internal/quantization_util.h"
#include "tensorflow/lite/kernels/internal/reference/proc... | ALGO | 0.996962 | 7.718053 |
51f29ff9-5e53-4ff5-bfc8-996b0fe70b11 | Pitosko/C- | C++/ex6/exercicio6.cpp | #include <iostream>
using namespace std;
int main () {
int day = 1;
switch (day) {
case 1:
cout<< "Monday";
break;
case 2:
cout<< "Tuesday";
break;
case 3:
cout<< "Wednesday";
break;
case 4:
cout<< "Thursday";
//break;
case 5:
cout<< "Friday";
break;
case 6:
cout<< "Saturd... | TOOL | 0.954043 | 3.427656 |
614c2153-b30f-4f33-b279-7509077179a0 | Astrophilic/Daily-Cpp-Problems | 23_05_2018/wachovia.cpp | #include <bits/stdc++.h>
#define ff first
#define ss second
#define pb push_back
#define mp make_pair
#define ll long long
#define ull unsigned long long
#define all(a) a.begin(),a.end()
#define BitCnt(a) __builtin_popcountll(a)
#define MEM(a,val) memset(a,val,sizeof(a))
#define pul pair<ull,ull>
#define pl pair<ll,ll>... | ALGO | 0.99992 | 3.461815 |
4bc76c62-fb15-45d0-94d5-115ad99d5914 | elitak/box2d | Box2D/Box2D/Collision/Shapes/b2PolygonShape.cpp | #include <Box2D/Collision/Shapes/b2PolygonShape.h>
#include <new>
b2Shape* b2PolygonShape::Clone(b2BlockAllocator* allocator) const
{
void* mem = allocator->Allocate(sizeof(b2PolygonShape));
b2PolygonShape* clone = new (mem) b2PolygonShape;
*clone = *this;
return clone;
}
void b2PolygonShape::SetAsBox(float32 hx,... | ALGO | 0.98875 | 7.92073 |
33e5f233-7862-43f3-9fb8-0815f2bb0442 | andyluo03/problems | problems/CF-1861B.cpp | //wecu's template -- works with c++17
#include <algorithm>
#include <bitset>
#include <climits>
#include <iostream>
#include <map>
#include <queue>
#include <set>
#include <string>
#include <unordered_map>
#include <unordered_set>
#include <vector>
#define forn(n) for(int i = 0; i < n; i++)
#define endl '\n'
using n... | ALGO | 0.999966 | 5.607083 |
0f737b9e-53bd-4477-824e-ba7e33d31e14 | ManojKumarPatnaik/Sr.SoftwareEngineerInterviewPrep | Data Structures/Tree/C++/BST Binary Tree.cpp | #include <bits/stdc++.h>
using namespace std;
/*structure of the binary tree*/
struct Node
{
int info; //data part
struct Node *left, *right; //left and right node which will contain address of left and right subtree
};
/*function to create tree*/
struct Node* create()
{
int data;
... | ALGO | 0.999828 | 4.759703 |
f820ea95-40d6-4324-a287-9b2b8116320d | act-reds/so3-gem5 | gem5/src/systemc/tests/systemc/misc/user_guide/chpt3.1/fsmr.cpp | /*****************************************************************************
fsmr.cpp --
Original Author: Martin Janssen, Synopsys, Inc., 2002-02-15
*****************************************************************************/
/*****************************************************************************
... | ALGO | 0.997745 | 4.889946 |
56fafd7e-321c-405b-9987-14e70e178b5a | AadithyaVenkat/LeetCode-Interview-Prep | Sametree.cpp | bool isSameTree(TreeNode* p, TreeNode* q) {
if (p==NULL && q==NULL) return true; // Check for empty tree
if ((p == NULL && q!=NULL) ||(q == NULL && p!=NULL)) return false; // check for null and non null trees
return (p->val == q->val) && isSameTree(p->left, q->left) && isSameTree(p-... | ALGO | 0.999976 | 5.560165 |
d05a3e57-4eaf-4255-82d5-964dcc9f063c | skyunix/mkvtoolnix | src/common/strings/parsing.cpp | #include "common/common_pch.h"
#include <QRegularExpression>
#include "common/list_utils.h"
#include "common/qt.h"
#include "common/strings/formatting.h"
#include "common/strings/parsing.h"
namespace mtx::string {
std::string timestamp_parser_error;
inline bool
set_tcp_error(const std::string &error) {
timestamp... | TOOL | 0.941077 | 7.149492 |
ac92dcea-0985-4036-bd2e-6886ee547fde | pkufzc/CuckooGraph | Competitors/third_party/junction/samples/MapScalabilityTests/MapScalabilityTests.cpp | #include <junction/Core.h>
#include <turf/CPUTimer.h>
#include <turf/Util.h>
#include <turf/extra/UniqueSequence.h>
#include <turf/extra/JobDispatcher.h>
#include <turf/extra/Options.h>
#include <junction/extra/MapAdapter.h>
#include <algorithm>
#include <vector>
#include <stdio.h>
using namespace turf::intTypes;
type... | ALGO | 0.957223 | 4.5511 |
9dc868e7-d0c9-4c36-ba98-f29b07a3a8af | danieltrt/SBFL | results/WRITE_A_C_PROGRAM_TO_CALCULATE_POWXN.py.cpp | int power ( int x , int y ) {
if ( ( y == 0 ) || ( y % 2 == 0 ) ) return 1 ;
else if ( ( int ) ( y % 2 ) == 0 ) return ( power ( x , ( int ) ( y / 2 ) ) * power ( x , ( int ) ( y / 2 ) ) ) ;
else return ( x * power ( x , ( int ) ( y / 2 ) ) * power ( x , ( int ) ( y / 2 ) ) ) ;
}
| ALGO | 0.999514 | 4.93056 |
386137eb-98f7-4580-8121-03a63417637d | ishandutta2007/codeforces | leaf1415/normal/1067/A.cpp | #include <iostream>
#define llint long long
#define mod 998244353
using namespace std;
llint n;
llint a[200005];
llint dp[2][205][2];
llint sum[205][2];
int main(void)
{
cin >> n;
for(int i = 1; i <= n; i++) cin >> a[i];
if(a[1] != -1){
dp[1][a[1]][1] = 1;
}
else{
for(int j = 1; j <= 200; j++) dp[1][j][1]... | ALGO | 0.999917 | 4.117754 |
54e135f3-3f4a-47dd-aecc-81f26df43bf7 | shankarreddy1438/DSA0193-C | multiply two matrices.cpp | #include <iostream>
using namespace std;
int main() {
int rows1, cols1, rows2, cols2;
cout << "Enter the number of rows and columns for the first matrix: ";
cin >> rows1 >> cols1;
cout << "Enter the number of rows and columns for the second matrix: ";
cin >> rows2 >> cols2;
if (cols1 != rows2... | ALGO | 0.999918 | 4.747364 |
9aa5af65-da3d-462c-9505-49a47c4c4db1 | Connnnn9/AI_Project | AI/Src/SeekBehavior.cpp | #include "Precomplied.h"
#include "SeekBehavior.h"
#include "Agent.h"
using namespace AI;
X::Math::Vector2 SeekBehavior::Calculate(Agent& agent)
{
const auto agentToDest = agent.destination - agent.position;
const float distToDest = X::Math::Magnitude(agentToDest);
if (distToDest<=0.1f)
{
return X::Math::Vector2... | ALGO | 0.996635 | 5.833483 |
b1282fe6-77c3-48e6-aff3-51523a9bf8a4 | thirtiseven/CPPex | 5-3.cpp | #include <iostream>
using namespace std;
int factorial(int a){
int x = 1;
for(int i = 1;i <= a;i++){
x *= i;
}
return x;
}
int main(int argc, char *argv[]) {
double e = 1.0;
int a = 1;
while(1.0/(double)factorial(a) > 10e-8){
e += 1.0/(double)factorial(a++);
}
cout << e;
return 0;
} | ALGO | 0.999661 | 3.586406 |
6c8be4ca-5395-4111-a874-8e198b5e04a7 | NUS-HcRL/cloth_opt | deps/eigen/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.999777 | 4.20012 |
80369964-0c45-41c6-8d7e-c12839fd98ce | satyam04sharma/My-code-journey | DELISH.cpp | #include<bits/stdc++.h>
using namespace std;
#define ll long long
vector<ll> max_left(ll a[],ll n)
{
vector<ll> res(n+1);
ll curr_sum=a[0];
res[0]=a[0];
for(ll i=0;i<n;i++)
{
res[i]=0;
}
for(ll i=1;i<n;i++)
{
curr_sum=max(a[i],curr_sum+a[i]);
res[i]=max(res[i-1],curr_sum);
//res[i]=max_sum;
}
return... | ALGO | 0.999841 | 4.587936 |
6758fe90-8763-48b3-b07f-9cf92c5e19f4 | yokolet/my-system-monitoring | src/linux_parser.cpp | #include <dirent.h>
#include <iomanip>
#include <unistd.h>
#include <sstream>
#include <string>
#include <vector>
#include "linux_parser.h"
using std::stof;
using std::string;
using std::to_string;
using std::vector;
// DONE: An example of how to read data from the filesystem
string LinuxParser::OperatingSystem() {
... | TOOL | 0.938279 | 4.299546 |
2237517d-db2c-47ed-b7fc-f2cc2d4575a9 | Remonhasan/codeforces | Online Judge Solves (Others)/Codeforces (combined)/kth.cpp | #include <bits/stdc++.h>
using namespace std;
int main() {
int t;
cin >> t;
while (t--) {
int n, k;
cin >> n >> k;
int need = (k - 1) / (n - 1);
cout << k + need << endl;
}
}
| ALGO | 0.99967 | 3.701653 |
b642554a-8849-4e11-a201-632099a4abae | KennethYangle/CMPCC | Eigen/bench/perf_monitoring/trmv_lo.cpp | #include "gemv_common.h"
EIGEN_DONT_INLINE void trmv(const Mat &A, const Vec &B, Vec &C) { C.noalias() += A.triangularView<Lower>() * B; }
int main(int argc, char **argv) { return main_gemv(argc, argv, trmv); }
| ALGO | 0.982968 | 4.727641 |
a93754ed-ee48-48f1-af0f-4830e3d94049 | WANIC-VGP2-2022-2024/BetaFramework-Linux | LowLevelAPI_C/src/Matrix2D.cpp | //------------------------------------------------------------------------------
// Include Files:
//------------------------------------------------------------------------------
#include <cstring>
#include "stdafx.h"
#include "Matrix2D.h"
//---------------------------------------------------------------------------... | ALGO | 0.954508 | 7.674724 |
9d865202-59cc-4a67-99d7-55bb9ce796df | gabrielbianchin/mestrado | 2019s1/MO412/trabalho 2/johnson/johnson_matrizAdj_vetor_normal.cpp | #include<bits/stdc++.h>
using namespace std;
#define inf 0x3f3f3f3f
int * c;
typedef struct{
float * d;
int * pai;
}NO;
struct NOD{
float valor;
int parent;
int usado;
int key;
};
typedef struct{
NOD * nos;
}FILA;
void inicializacaoD(FILA * f, int vertices, int s){
NOD aux;
f->n... | ALGO | 0.999848 | 3.252059 |
4034a71b-405d-4efa-bfd7-da7ccaef5adf | ishandutta2007/codeforces | fkguyx042/normal/282/A.cpp | #include<cstdio>
#include<algorithm>
#include<cstring>
using namespace std;
int i,j,m,n,p,k;
char c[4];
int main()
{scanf("%d",&n);
for (;n--;)
{ scanf("%s",&c);
if (c[1]=='+') p++; else p--;
}
printf("%d\n",p);
} | ALGO | 0.999685 | 3.852711 |
a95c7ee2-4bd4-4eec-b0ea-22e361d5e7d4 | jobelobes/Ultragon.Games.Singularity | include/3rdparty/bulletphysics/BulletCollision/NarrowPhaseCollision/btVoronoiSimplexSolver.cpp | #include "btVoronoiSimplexSolver.h"
#define VERTA 0
#define VERTB 1
#define VERTC 2
#define VERTD 3
#define CATCH_DEGENERATE_TETRAHEDRON 1
void btVoronoiSimplexSolver::removeVertex(int index)
{
btAssert(m_numVertices>0);
m_numVertices--;
m_simplexVectorW[index] = m_simplexVectorW[m_numVertices];
m_simplexPo... | ALGO | 0.999714 | 5.489566 |
b1c3cb42-bb1a-4645-9174-a7f5e14a8b56 | Junyingw/Inverse-Kinematics | starter/eigen/failtest/fullpivqr_int.cpp | #include "../Eigen/QR"
#ifdef EIGEN_SHOULD_FAIL_TO_BUILD
#define SCALAR int
#else
#define SCALAR float
#endif
using namespace Eigen;
int main()
{
FullPivHouseholderQR<Matrix<SCALAR,Dynamic,Dynamic> > qr(Matrix<SCALAR,Dynamic,Dynamic>::Random(10,10));
}
| TEST | 0.943968 | 3.150836 |
9ea0458e-05f3-4ead-8a6a-ba96664e3361 | mhmdshaker/Competitve-Programming | G_Replace_With_Product.cpp | // #pragma GCC optimize("Ofast, unroll-loops, no-stack-protector, fast-math, O3, omit-frame-pointer, inline, avx, avx2, fma")
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wc++11-extensions"
#include <bits/stdc++.h>
using namespace std;
#define SZ(x) ((int)(x).size()) // size of a container
#define F... | ALGO | 0.999816 | 4.406228 |
9c9e33b4-f65c-469f-b9b9-d1be17bb272d | WaleedOMEGA/CS | CS Course/4-10/main.cpp | #include <iostream>
using namespace std;
int main()
{
int A[3][3];
int row, col, sum = 0;
/* Input elements in matrix from user */
printf("Enter elements in matrix of 3: \n");
for(row=0; row<3; row++)
{
for(col=0; col<3; col++)
{
scanf("%d", &A[row][col]);
... | ALGO | 0.99891 | 4.033256 |
a0fe1e67-7e15-4d1e-a55b-221706a80f10 | Akash-raj-INT/LeetCode-Solution | 3227-find-missing-and-repeated-values/3227-find-missing-and-repeated-values.cpp | class Solution {
public:
vector<int> findMissingAndRepeatedValues(vector<vector<int>>& grid) {
long long n = grid.size();
long long n2 = n * n;
long long S = (n2 * (n2 + 1)) / 2;
long long P = (n2 * (n2 + 1) * (2 * n2 + 1)) / 6;
long long S_actual = 0, P_... | ALGO | 0.999843 | 5.890835 |
3d2b8b6b-f37d-4d9a-aec5-2a1563c46a1f | zhouweiti/Data-Structre-And-Algorithm | CodeTemplate/DS/KDTree.cpp | /**
* K-D Tree的实现,V1不支持插入和重构,V2支持插入和重构
* https://www.luogu.com.cn/problem/P6247
*
*
*
*/
#include <iostream>
#include <cstdio>
#include <algorithm>
#include <cmath>
using namespace std;
constexpr int N = 1e5 + 10;
constexpr double INF = 4e18;
struct Node {
double x, y;
}tr[N];
double _min = INF, _max =... | ALGO | 0.999937 | 4.407745 |
7063e6a3-5587-4002-b09e-c5398f431ca3 | 113bommy/deepmind_codecontests_refine | cpp_source_filter_file/cpp_train_4142_66.cpp | #include<bit/stdc++.h>
using namespace std;
int main()
{
int a,b; cin>>a>>b;
cout<<a*b<<endl;
} | ALGO | 0.984486 | 3.516686 |
7cb4ebae-1845-484c-acee-75ceafd074d1 | Esri/lerc | src/LercLib/RLE.cpp | #include "Defines.h"
#include "RLE.h"
#include <cstring>
USING_NAMESPACE_LERC
// -------------------------------------------------------------------------- ;
size_t RLE::computeNumBytesRLE(const Byte* arr, size_t numBytes) const
{
if (arr == nullptr || numBytes == 0)
return 0;
const Byte* ptr = arr;
size_... | ALGO | 0.999402 | 6.525348 |
881a3663-07ff-4681-91de-369b2298967c | devkhedr/leetcode-solutions | 1777-determine-if-two-strings-are-close/1777-determine-if-two-strings-are-close.cpp | class Solution {
public:
bool closeStrings(string word1, string word2) {
if(word1.length() != word2.length())
return 0;
vector<int>fr1(26), fr2(26);
for(char ch: word1) {
fr1[ch-'a']++;
}
for(char ch: word2) {
fr2[ch-'a']++;
}
... | ALGO | 0.999979 | 5.71842 |
4fdf1c1d-a066-4ac0-b808-4dcbd66f6b34 | ManojKumarPatnaik/Sr.SoftwareEngineerInterviewPrep | Codechef/C++/Ceiling Sum (CEILSUM).cpp | // Problem link: https://www.codechef.com/START7C/problems/CEILSUM
// If A==B then the only value of X possible wiil be A(or B) therefore the value of Ceil((B-B)/2)+Ceil((A-A)/2) = 0
// Further there are 4 more conditions
// ceil(B-X) ceil(X-A) Max
// Even Even B-A/2 (since both are even t... | ALGO | 0.99997 | 5.155798 |
f028f060-1eb5-4777-9293-1351d805de77 | 113bommy/deepmind_codecontests_refine | cpp_source_filter_file/cpp_train_463_14.cpp | #include <bits/stdc++.h>
using namespace std;
int main() {
ios_base::sync_with_stdio(false);
cin.tie(NULL);
int r, x, y, x2, y2;
cin >> r >> x >> y >> x2 >> y2;
if (x == x2 && y == y2) {
cout << 0;
return 0;
}
double d = sqrt(pow(y2 - y, 2) + pow(x2 - x, 2));
cout << (int)ceil(d / r) - 1;
}
| ALGO | 0.999696 | 3.374716 |
08d015b4-0399-495c-abe2-c2adc38cdb94 | tusharsharma2020/cpp | function/sum_of_n_numbers_8_5_21.cpp | #include <iostream>
#include <math.h>
using namespace std;
int sum(int num1)
{
int sum=0;
for (int i=num1;i>=1;i--)
{
sum=sum+i;
}
return sum ;
}
int main()
{
int a;
cout<<"enter the number a ";
cin>>a;
cout<<sum(a);
return 0;
}
| ALGO | 0.997884 | 3.751634 |
3fc34b86-1341-450f-846c-a196096f860b | cjdb/cpp-conferences | sydney-2017-03-29/motivation1a.cpp | #include <algorithm>
#include <iterator>
#include <iostream>
#include <vector>
template <typename InputIterator>
std::vector<double> make_vector(InputIterator first, InputIterator last)
{
auto v = std::vector<double>{};
while (first != last)
v.push_back(*first++);
return v;
}
std::vector<double> make_v... | ALGO | 0.994886 | 5.050388 |
1afb0ece-bb93-44b6-987d-0ab349b24ca5 | FabiOquendo/Competitive-Programming | Solved/Codeforces/C. Vasilije in Cacak.cpp | #include <bits/stdc++.h>
using namespace std;
int main() {
ifstream inputFile("input.txt");
ofstream outputFile("output.txt");
int t;
inputFile >> t;
while (t > 0) {
long long n, k, x;
inputFile >> n >> k >> x;
long long min = k * (k+1) / 2;
long long max = k * n - k * (k-1) / 2;... | ALGO | 0.999207 | 4.174324 |
dc3a0fa2-d019-480c-8917-3a15a7fc2d13 | matteogilioli/llvm-17.0.6 | src/libcxx/test/std/algorithms/alg.modifying.operations/alg.replace/replace_if.pass.cpp | // <algorithm>
// template<ForwardIterator Iter, Predicate<auto, Iter::value_type> Pred, class T>
// requires OutputIterator<Iter, Iter::reference>
// && OutputIterator<Iter, const T&>
// && CopyConstructible<Pred>
// constexpr void // constexpr after C++17
// replace_if(Iter first, Iter las... | TEST | 0.962595 | 6.960372 |
f96a1ff8-b033-4550-b92d-a14e7f63bb51 | vivithecanine/comm-central | mailnews/search/src/nsMsgImapSearch.cpp | /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
#include "msgCore.h"
#include "nsMsgSearchAdapter.h"
#include "nsMsgSearchScopeTerm.h"
#include "nsMsgResultElement.h"
#include "nsMsgSearchTerm.h"
#include "nsIMsgHdr.h"
#include "nsMsgSearchImap.h"
#include "prmem.h"
#include "nsIMsgImap... | TOOL | 0.860682 | 4.273827 |
13252c8a-c410-4319-9848-9655e7d8af58 | flamepeak/poj | NOI_1.12_08/main.cpp | /*
08:Vigenère密码
查看 提交 统计 提问
总时间限制: 1000ms 内存限制: 65536kB
描述
16世纪法国外交家Blaise de Vigenère设计了一种多表密码加密算法——Vigenère密码。Vigenère密码的加密解密算法简单易用,且破译难度比较高,曾在美国南北战争中为南军所广泛使用。
在密码学中,我们称需要加密的信息为明文,用M表示;称加密后的信息为密文,用C表示;而密钥是一种参数,是将明文转换为密文或将密文转换为明文的算法中输入的数据,记为k。 在Vigenère密码中,密钥k是一个字母串,k=k1k2…kn。当明文M=m1m2…mn时,得到的密文C=c1c2…cn,其中ci=mi®ki... | ALGO | 0.999987 | 4.746427 |
630970b9-9be9-43e7-a542-48028cad5844 | kailashsah/cplus_workspace | LANGUAGE/11/Misc11/src/27_cast_const_one.cpp |
#include <iostream>
using namespace std;
/*
1. const_cast<>
2.
*/
int fun_const_change(int* ptr)
{
*ptr = *ptr + 10;
return (*ptr);
}
/*
int fun(int* ptr)
{
return (*ptr + 10);
}
*/
//1.
int const_modify(void)
{
/*
-- const_cast can be used to pass const data to a function that doesnt receive const. For ... | TOOL | 0.901485 | 3.344909 |
e2408fdf-18bd-4207-b610-96998c6175cb | mmxsrup/procon | atcoder/abc/008/a.cpp | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef vector<int> vint;
typedef pair<int,int> pint;
typedef vector<pint> vpint;
#define rep(i,n) for(int i=0;i<(n);i++)
#define reps(i,f,n) for(int i=(f);i<(n);i++)
#define each(it,v) for(__typeof((v).begin()) it=(v).begin();it!=(v).end();it++)
#defi... | ALGO | 0.997232 | 3.206432 |
c33db67c-1fab-4668-8fa6-ae2214cae48c | pkbhowmick/UVA | 13088 - Lexicographically Smallest FPIS.cpp | #include <bits/stdc++.h>
#define pb push_back
#define sc1(n) scanf("%lld",&n)
#define sc2(a,b) scanf("%lld%lld",&a,&b)
#define sc3(a,b,c) scanf("%lld%lld%lld",&a,&b,&c)
#define MX 100000
using namespace std;
typedef long long int ll;
typedef unsigned long long ul;
int main()
{
ll arr[30];
ll cnt[30];
ll t... | ALGO | 0.999696 | 3.890224 |
56d4b817-312b-4511-88a6-e4c542d39564 | yyppsk/LeetCode | From October22/724FindPivotIndex.cpp | #include <iostream>
#include <vector>
#include <algorithm>
#include <string>
using namespace std;
int findMiddleIndex(vector<int> &nums)
{
int totalsum = 0;
for (auto i : nums)
{
totalsum += i;
}
int leftsum = 0;
// 1, 7, 3, 6, 5, 6
for (int i = 0; i < nums.size(); i++)
{
... | ALGO | 0.99982 | 5.111793 |
714b845e-0ce1-40e5-bdce-94ad14213b9f | dhratibaj/leetcode_solutions | 543-diameter-of-binary-tree/543-diameter-of-binary-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.999912 | 6.845524 |
134aa5e8-bf38-414f-8449-8594ee2bfe6d | tvdv/metastorey | lib/boost_1_53_0/libs/graph/example/graph.cpp | #include <boost/graph/adjacency_list.hpp>
using namespace boost;
using namespace std;
typedef property<vertex_color_t, default_color_type,
property<vertex_distance_t,int,
property<vertex_degree_t,int,
property<vertex_in_degree_t, int,
property<vertex_out_degree_t,int> > > > > VertexPropert... | ALGO | 0.974956 | 5.314047 |
44a8ab2a-5c1c-41b7-8641-724e121f107f | 113bommy/deepmind_codecontests_refine | cpp_source_filter_file/cpp_train_6001_6.cpp | #include <bits/stdc++.h>
using namespace std;
bool vocala(char c) {
if (c == 'a' || c == 'A' || c == 'e' || c == 'E' || c == 'i' || c == 'I' ||
c == 'o' || c == 'O' || c == 'u' || c == 'U')
return true;
return false;
}
int isprime(long long n) {
if (n == 1) return 0;
if (n == 2) return 1;
if (n % 2 ... | ALGO | 0.999956 | 3.923294 |
b5e694bb-379e-42a5-9553-b39ce1a459bb | thinhvip1/28Tech | bai_tap_c++/array2D/minximum_path_sum.cpp | #include <bits/stdc++.h>
using namespace std;
// cho mảng 2 chiều tìm đường đi từ a[0][0] -> a[n-1][m-1] sao cho sum nhỏ nhất
// có thể đi sang phải hoặc xuống dưới
int min(int a, int b){
return a < b ? a : b;
}
int main(){
int n, m; cin >> n >> m;
int a[n][m];
for(int i = 0; i < n; i++){
for(in... | ALGO | 0.999986 | 4.603735 |
9f70e771-f6dd-4b08-bb75-1ff37dbdb32b | ardenmendonca/DSA | Element_Appearing_Once.cpp | #include <iostream>
#include <vector>
#include <unordered_map>
using namespace std;
// Approach 1: Map
int getSingleElementMap(const vector<int> &arr) {
unordered_map<int,int> freq;
for(int x : arr) freq[x]++;
for(auto &p : freq){
if(p.second == 1) return p.first;
}
return -1;
}
// Approac... | ALGO | 0.999949 | 5.33521 |
0476aefd-af4f-47f3-8d2b-1e8f5082adfa | ishandutta2007/codeforces | holidin/normal/1284/E.cpp | #include <bits/stdc++.h>
#define int long long
#define fi first
#define se second
using namespace std;
const int N = 3e5 + 1;
const int mod = 1e9 + 7;
const long double PI = acos(-1);
const long double PI1 = 3.141592653589793238462643383279;
int x[N], y[N];
int plpl(int x, int y) {
if ((y == 0 && x > 0) || (y > 0)... | ALGO | 0.999947 | 4.455201 |
68d69b69-029a-476d-8264-9631361c0930 | quirrelHK/DSA | a2z/patterns_1.2/21.cpp | /*
*****
* *
* *
* *
*****
*/
#include<bits/stdc++.h>
using namespace std;
int main(){
int n=5;
for(int i=0;i<n;++i){
if(i==0 || i==n-1)
for(int j=0;j<n;++j) cout <<"*";
else{
cout<<"*";
for(int j=2;j<n;++j) cout <<" ";
cout <<"*";
}... | ALGO | 0.999673 | 3.628013 |
d4cadce0-5ac5-4ee6-9cef-fe8eb6fbfbd0 | VenusCh001/bloodSweatTears | assign92darrays5/prefixSumMatrix.cpp | //Q2 - Given a matrix arr[][] of integers, print the prefix sum matrix for it.
#include<iostream>
#include<vector>
using namespace std;
vector<vector<int>> prefixSum(int m,int n,vector<vector<int>> arr){
//row prefix sum
for(int i=0;i<arr.size();i++){
for(int j=1;j<arr[0].size();j++){
arr[... | ALGO | 0.999787 | 4.913904 |
ff81e8fc-26ee-4370-ba38-f6314ed1d6c1 | gromit-95/DataStructure_Algorithm | Algorithm/05_Stack/05_Stack.cpp | #include<iostream>
#include<stack>
#include<list>
#include<vector>
using namespace std;
// Stack (LIFO : Last In First Out) -> Լ
// --> 1. 迭 , 2.ḮƮ ִ.
// ǵ(ctrl + z)
template<typename T, typename Container = vector<T>>// ⺻¿ ͷ , ḮƮ ٲٱ
class Stack
{
public:
void push(const T& value)
{
_container.push_back(v... | ALGO | 0.997805 | 4.396211 |
3730fac8-afba-43b3-8825-326e0895174e | ishandutta2007/codeforces | flowerletter/normal/1620/C.cpp | #include <bits/stdc++.h>
#define rep(i, a, b) for(int i = (a); i <= int(b); i ++)
#define per(i, a, b) for(int i = (a); i >= int(b); i --)
#define fi first
#define se second
#define all(s) s.begin(), s.end()
#define trv(i, u, v) for(int i = head[u], v = e[i].to; i; v = e[i = e[i].nxt].to)
#define sz(s) (int)(s.size())
... | ALGO | 0.999828 | 3.222728 |
860d9a35-f9a1-4cf4-8e10-bd3a8d73a024 | Loroark/Studia-Lab-4 | Zad 5/main.cpp | #include <iostream>
using namespace std;
int main(){
string napis;
string napis2;
getline(cin, napis);
napis2 = napis;
int dlugosc = napis2.length();
cout << napis << endl;
for(int i = 0; i < dlugosc; i++){
if(napis2.at(i) == 32){
napis2.erase(i, 1);
napis2.... | ALGO | 0.997095 | 3.003255 |
9386b409-d854-4950-9c2f-ee3eab0653ac | 1119-2916/competitive-programming | atcoder/agc/022/a.cpp | #include <bits/stdc++.h>
using namespace std;
#define INF 1001000100010001000
#define MOD 1000000007
#define EPS 1e-10
#define int long long
#define rep(i, N) for (int i = 0; i < N; i++)
#define Rep(i, N) for (int i = 1; i < N; i++)
#define For(i, a, b) for (int i = (a); i < (b); i++)
#define pb push_back
#define eb ... | ALGO | 0.999754 | 3.401242 |
cd17ac43-3fa4-4238-ac9f-7aa22c817431 | NaderEG/competitive-programming | leetcode/cpp/rottingFruit.cpp | class Solution {
public:
bool valid_step(vector<vector<int>>& grid, int i, int j) {
return i >= 0 && i < grid.size() && j >= 0 && j < grid[0].size() && grid[i][j] == 1;
}
int orangesRotting(vector<vector<int>>& grid) {
queue<int> q;
int total_fruit = 0;
for(int i = 0; i < g... | ALGO | 0.999974 | 6.338983 |
cf012b33-adfa-486f-baef-0c9b2cd25bcd | dlvguo/NoobOJCollection | LeetCode/Normal/1700-1799/1707.cpp | #include <bits/stdc++.h>
using namespace std;
class Trie
{
public:
const int L = 30;
Trie *children[2] = {};
void insert(int val)
{
Trie *node = this;
for (int i = L - 1; i >= 0; --i)
{
int bit = (val >> i) & 1;
if (node->children[bit] == nullptr)
... | ALGO | 0.999908 | 5.454206 |
120634a4-4f41-43c3-b108-e9f7c2557fd2 | refactoring256/encrypt_decrypt | encryption.cpp | #include "encryption.h"
#include <iostream>
#include <cmath>
#include <vector>
using namespace std;
string encrypt_vigenere(const string& text, string key) {
string encrypted;
for (int i = 0; i < text.size(); ++i) {
char encrypting_letter = key[i % key.size()];
if ((encrypting_letter >= 65) && ... | ALGO | 0.999005 | 4.949151 |
ba4eee9e-565c-451f-8722-289cab943f7a | lidormoryosef/KNN | server/CanberraDistance.cpp | //
// Created by omer on 12/4/22.
//
#include "CanberraDistance.h"
/**
* This function calculate the distance between two vector by canberra.
* @param v1 the first vector.
* @param v2 the second vector.
* @return the distance.
*/
double CanberraDistance::distance(vector<double> v1, const vector<double>& v2) {
... | ALGO | 0.978979 | 5.536138 |
c88fa452-5276-41eb-ad5d-f273981a7316 | project-march/ProjectMarch | ros2/src/libraries/ginac/ginac/integration_kernel.cpp | /** @file integration_kernel.cpp
*
* Implementation of GiNaC's integration kernels for iterated integrals. */
#include "integration_kernel.h"
#include "add.h"
#include "mul.h"
#include "operators.h"
#include "power.h"
#include "relational.h"
#include "symbol.h"
#include "constant.h"
#include "numeric.h"
#include "f... | ALGO | 0.996719 | 7.562885 |
b34326f3-3ae9-4407-8d13-67ba19f9f51c | ajpc17/Arnaldo-Perdomo-funciones | ejercicio 2 de funciones.cpp | #include<stdio.h>
#include<iostream>
#include<conio.h>
#include<string.h>
void media(float,float,float);
int main(int argc,const char * argv[]){
float n1, n2, n3;
printf("Introduzca un numero: \n");
scanf("%f",&n1);
printf("Introduzca un numero: \n");
scanf("%f",&n2);
printf("Introduzca un numero: \n");
scanf("... | ALGO | 0.921423 | 3.593717 |
d7638134-642d-4c8d-bbfc-6bce327b70aa | nayeem003/CP | mex_set.cpp | #include <bits/stdc++.h>
using namespace std;
int main(){
int t;
cin >> t;
while (t--)
{
int n;
cin >> n;
int arr[n+1];
int cnt[101];
for(int i = 0 ; 1<101; i++) cnt[i] = 0;
for(int i=0; i<=n; i++)
{
cin >> arr[i];
cnt[a... | ALGO | 0.999766 | 3.557164 |
14b0f0cd-134d-49a6-a187-2284647d10a8 | nkc2002/DSA_Document | code_dsa/QuyHoachDong/Bai30_CatHinhChuNhat.cpp | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
const int MOD = 1e9 + 7;
ll dp[501][501];
int main()
{
int n , m ; cin >> n >> m;
for(int i = 1 ; i <= n ;i++)
{
for(int j = 1 ; j <= m ;j++)
{
dp[i][j] = MOD;
}
}
for(int i = 1 ; i <= 500 ; i++)... | ALGO | 0.999941 | 3.81817 |
7e448a9f-9890-43ce-8941-fcc1a385d764 | Stanleys75/DataStruct | Lab sesi 4.cpp | #include<stdio.h>
#include<stdlib.h>
#include<string.h>
int getHash(char name[]){
char temp = name[0];
return temp % 3;
}
struct data{
char name[20];
int age;
struct data* next;
struct data* prev;
} *head[3], *tail[3];
struct data* createData(char name[], int age){
struct data* curr = (data*)malloc(siz... | ALGO | 0.995417 | 3.767704 |
2eacc6cc-21a8-45e5-bf4d-ce42ad0d216d | moonjinhwan/Algorithm-Code-Up | back_Joon/다이나믹프로그래밍/9095 1,2,3 더하기.cpp | #include<iostream>
#include<cstring>
using namespace std;
int main() {
int TEST;
cin >> TEST;
while (TEST--) {
int N;
cin >> N;
int dp[11] = { 0 };
dp[1] = 1, dp[2] = 2, dp[3] = 4;
for (int i = 4; i <= N; i++) {
if (i - 1 > 0)
dp[i] += dp[i - 1];
if (i - 2 > 0)
dp[i] += dp[i - 2];
if (i - ... | ALGO | 0.999949 | 3.906522 |
fc658cf5-e36a-41bb-958e-b1fd3c8ef874 | AntonSkachko/Fundamentals_of_Algorithmization_and_Programming | firstSemester/variant7/laba_4/third_level.cpp | #include <iostream>
using namespace std;
int *createArray(int n) {
int* array = new int[n];
for (int i = 0; i < n; i++) {
cin >> array[i];
}
return array;
}
void printArray(int* array, int n) {
for (int i = 0; i < n; i++) {
cout << array[i] << endl;
}
}
void deleteArray(int* array) {
delete[] array;
}
vo... | ALGO | 0.99963 | 4.208113 |
d20562d6-ab72-494b-8880-29c95e43cbc6 | ShunMeizz/flutter-trial | 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 |
1f95ebaf-689a-494b-b9d7-628ae7d89e10 | ccccqyc/Books | Algorithm_SFBJ/4th/mergeSort.cpp | #define min(a, b) (a) < (b) ? (a) : (b)
const int maxn = 100;
void merge(int A[], int L1, int R1, int L2, int R2) {
int i = L1, j = L2;
int temp[maxn], index = 0;
while (i <= R1 && j <= R2) {
if (A[i] <= A[j]) {
temp[index++] = A[i++];
} else {
temp[index++] = A[j++... | ALGO | 0.999987 | 4.335866 |
15588eab-5ef3-43b9-8f41-68cfb38aee43 | pseudo-aloha/NTUEE-SoC-Verification | b07901075_hw4/p3/seatAss.cpp | #include <iostream>
#include <cstdlib>
#include <fstream>
#include <string.h>
#include <vector>
#include "sat.h"
#include "Solver.h"
using namespace std;
class Gate
{
public:
Gate(unsigned i = 0): _gid(i) {}
~Gate() {}
Var getVar() const { return _var; }
void setVar(const Var& v) { _var = v; }
private:
... | ALGO | 0.997625 | 3.743711 |
c64b342e-76b9-43c8-b1b1-46aade409644 | jycoast/algorithm-wiki | source-code/cpp/912.sort-an-array.cpp | #include <vector>
using namespace std;
/*
* @lc app=leetcode.cn id=912 lang=cpp
*
* [912] Sort an Array
*/
// @lc code=start
class Solution {
public:
vector<int> sortArray(vector<int>& nums) {
// quickSort(nums, 0, nums.size() - 1);
heapSort(nums);
return nums;
}
void heapSort... | ALGO | 0.999974 | 6.1817 |
57944588-d4c3-4232-b321-24959c25bf1d | trungdangtapcode/Competitive-Programming-Notebook | archived/firstyear_laptop/1886E.cpp | #include<bits/stdc++.h>
using namespace std;
typedef pair<int,int> pii;
const int maxN = 2e5+5, maxM = 25, maxLM = (1<<20)+5;
int n, m, b[maxM], f[maxLM];
pii nxt[maxN][maxM], trace[maxLM], a[maxN];
vector<int> res[maxM];
int main(){
ios::sync_with_stdio(0);
cin.tie(0); cout.tie(0);
cin >> n >> m;
for (int i = 1; ... | ALGO | 0.999998 | 3.442336 |
61794753-4039-431e-9c8e-e7f071f2962c | shinvipo/CTDL | Contest/Contest8/b07.cpp | /* So BDN1 */
#include <iostream>
using namespace std;
int t, a[20], x;
unsigned long long n, dem;
void Res()
{
unsigned long long s=0;
for(int i=0;i<x;i++)
s=s*10+a[i];
if(s!=0 && s<=n) dem++;
}
void Try(int i)
{
for(int j=0;j<=1;j++)
{
a[i]=j;
if(i==x-1) Res();
... | ALGO | 0.998785 | 4.112824 |
b3903786-829f-42d9-85d0-8bc3005aee71 | MeMrBerlin/Placement_help | Coding Platforms(codechef,codeforces,etc)/CodeChef/Practice/Chef and fruits.cpp | #include <iostream>
using namespace std;
int main(){
int t;
cin>>t;
while(t--)
{
int x,y,k;
cin>>x>>y>>k;
while(k--)
{
if(x>y)
{
y++;
}
else if(x<y)
{
x++;
}
else
{
break;
}
}
cout<<abs(x-y)<<endl;
}}
| ALGO | 0.999977 | 3.823641 |
eca0c98a-c6c3-41f1-b790-037f52d72540 | ishandutta2007/codeforces | ynycoding/normal/1603/B.cpp | #include <cstdio>
#include <algorithm>
int T, x, y;
int main()
{
scanf("%d", &T);
while(T--)
{
scanf("%d%d", &x, &y);
if(x>y) printf("%d\n", x+y);
else
{
int n=(y%x)/2;
printf("%d\n", y-n);
}
}
return 0;
} | ALGO | 0.999879 | 3.824864 |
cbb12487-b32d-4c1a-ab47-10523777cd14 | BTHPOS/BTH | src/crypto/sha256.cpp | #include "crypto/sha256.h"
#include "crypto/common.h"
#include <assert.h>
#include <string.h>
#include <atomic>
#if defined(__x86_64__) || defined(__amd64__)
#if defined(EXPERIMENTAL_ASM)
#include <cpuid.h>
namespace sha256_sse4
{
void Transform(uint32_t* s, const unsigned char* chunk, size_t blocks);
}
#endif
#endif... | ALGO | 0.997098 | 7.247845 |
8fadf15a-f67a-4e4f-9f53-567bcf05102b | gyana88sahu/bootstrapping | src/CryptoTree.cpp | #ifndef CRYPTO_TREE_CPP
#define CRYPTO_TREE_CPP
#include "CryptoTree.h"
#include "gsw-impl.cpp"
namespace lbcrypto{
template <class Element>
std::shared_ptr<RGSWSecretKey<Element>> CryptoTree<Element>::m_sk = nullptr;
template <class Element>
void CryptoTree<Element>::Multiply(){//Multiplication by post order trave... | ALGO | 0.990261 | 3.659878 |
18c2919d-956d-432a-90a1-6ef7fc5cae79 | tykim96/BJ | 백준/2798.cpp | #include <bits/stdc++.h>
using namespace std;
#define LIMIT 3
int N, M, result = 0;
vector<int>idx;
vector<bool>vis;
void BackT(int idx = 0, int sum = 0, int cnt = 0) {
if (idx >= N || sum > M || cnt > LIMIT) return;
if (cnt == LIMIT && sum <= M) {
result = max(result, sum);
if (result == M) { cout << result; ... | ALGO | 0.999993 | 4.016133 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.