uuid string | repo_name string | relative_path string | content string | category string | algo_rel_score float64 | quality_score float64 |
|---|---|---|---|---|---|---|
8393eb12-f113-4def-b8d5-f6e3ac08a2b7 | andrewstevens59/HadoopSearchEngine | DyableSpider/SpiderList/RankURLs/RankURLs1/RankURLs.cpp | #include "../../../../MapReduce.h"
// This class takes the set of url text strings that
// have been hashed on the domain name and finds the
// occurrence of each domain name from the base node
// set. URLs are then ranked on their domain name
// occurrence and then by their pulse score. In
// particular URLs with ... | ALGO | 0.999129 | 5.279913 |
6c23f786-668f-4d22-b9ac-8632e26c96fa | pdhyeong/Junglepdh | 프로그래머스/4/43236. 징검다리/징검다리.cpp | #include <string>
#include <vector>
#include <algorithm>
#include <iostream>
using namespace std;
int solution(int distance, vector<int> rocks, int n) {
int answer = 0;
sort(rocks.begin(),rocks.end());
rocks.push_back(distance);
int start = 1;
int end = distance;
while(start <= end){
in... | ALGO | 0.999923 | 5.126621 |
5914b249-a6fa-4435-8d59-fd7f47746f58 | ayushshukla92/algorithms | programming/search.cpp | #include <iostream>
#include <queue>
#include <algorithm>
#include <climits>
#include <string>
#include <cstdlib>
#include <sstream>
#include <cmath>
#include <cctype>
#include <iomanip>
#include <cstdio>
#include <list>
#include <stack>
#include <vector>
#include <map>
#include <unordered_map>
#include <set>
#include ... | ALGO | 0.999749 | 3.466303 |
45c71fab-3e84-422a-962f-c419604884ce | snehaagrawal14/GFG_Solutions | Medium/Optimal Strategy For A Game/optimal-strategy-for-a-game.cpp | //{ Driver Code Starts
#include <bits/stdc++.h>
using namespace std;
// } Driver Code Ends
//Function to find the maximum possible amount of money we can win.
class Solution{
int solve(int i, int j, bool myChance, int arr[], vector<vector<int>> &dp){
if(i>j)
return 0;
if(... | ALGO | 0.999851 | 6.030734 |
761d76ab-9c34-4559-90f0-6ccf00a67c45 | nobinov/image_resizer_server | include/boost_1_75_0/libs/flyweight/example/custom_factory.cpp | /* We include the default components of Boost.Flyweight except the factory,
* which will be provided by ourselves.
*/
#include <boost/flyweight/flyweight.hpp>
#include <boost/flyweight/factory_tag.hpp>
#include <boost/flyweight/static_holder.hpp>
#include <boost/flyweight/simple_locking.hpp>
#include <boost/flyweight... | TOOL | 0.870425 | 7.778376 |
98104428-2671-41af-9330-8ef117c798d9 | ahangshizz/Learningrecord | 每日一题0712/每日一题0712/test.cpp | #if 0
#include <iostream>
#include <vector>
using namespace std;
int getLCA(int a, int b) {
// write code here
if (a == b) {
return a;
}
vector<int> v1;
vector<int> v2;
while (a > 1) {
v1.push_back(a / 2);
a /= 2;
}
while (b > 1) {
v2.push_back(b / 2);
b /= 2;
}
auto it_1 = v1.begin();
auto it_2 =... | ALGO | 0.999993 | 4.176551 |
b41cb5e0-0ebc-4d75-8a3f-a7fa50d924cd | KiiMYoo/Algorithm | 프로그래머스/1/12969. 직사각형 별찍기/직사각형 별찍기.cpp | #include <iostream>
using namespace std;
int main(void) {
int a;
int b;
cin >> a >> b;
for(int i = 0; i < b; i ++)
{
for(int j = 0; j < a; j++)
{
cout << "*";
}
cout << endl;
}
return 0;
} | ALGO | 0.999611 | 3.750772 |
4a5868e0-59eb-43dc-845e-d5c6d475d0dd | ArafatCMT/Algorithm | Problem Solvers Club Contest Batch - 4/test.cpp | #include<bits/stdc++.h>
using namespace std;
void merge(int arr[], int l, int m, int r)
{
int leftSize = m - l + 1;
int rightSize = r - m;
int L[leftSize], R[rightSize];
int k = 0;
for(int i=l; i<=m; i++)
{
L[i] = arr[k];
k++;
}
k = 0;
for(int i=m+1; i<=r; i++)
... | ALGO | 0.99999 | 4.845488 |
98256a93-5b38-47ee-a279-c1a0d2040595 | ZahidLive/cppPractice | zcpp_00002.cpp | /** program to swap the values of three variables without using fourth variable.
**/
#include<iostream>
using namespace std;
int main()
{
int x, y,z;
cout<<"Enter 3 numbers:"<<endl;
cin>>x>>y>>z;
cout<<"Values entered: "<<endl;
cout<<" x = " <<x<<" y = "<<y<<" z = "<<z<<endl;
x= x+y+z;
y= ... | ALGO | 0.999809 | 4.251318 |
f9abfce7-b77d-4d51-a94e-bed804ef3d3c | BaciFlorin/ImageProcessing_Project | image_2D_to_3D.cpp | #include"image_2D_to_3D.h"
Mat changeDirection(Mat image, Mat image_seg)
{
Mat result = image.clone();
uint w = image.cols, h = image.rows;
bool first = true;
int first_element = 0;
int last_element = 0;
Vec3b fillValue;
int NrPixels = get_nr_of_pixels(image_seg);
for (uint y = 0; y < h; y++)
{
first = true... | ALGO | 0.998004 | 4.601906 |
3003c4e9-cb7d-4839-b842-cffcf6cc085e | ApurboShib/Programming | number_theory/ugly_numbers.cpp | #include <bits/stdc++.h>
using namespace std;
#define endl '\n'
#define ll long long
const int MOD = 1e9 + 7;
const int N = 1e5 + 9;
signed main(){
ios::sync_with_stdio(false);
cin.tie(nullptr);
int n = 1500;
vector<int> v(n);
v[0] = 1;
int x2 = 0, x3 = 0, x5 = 0;
int mul2 = 2, mul3 = 3,... | ALGO | 0.999987 | 4.62642 |
6399c816-de51-4c5a-82cc-fc37d82647eb | ETHZ-RobotX/open3d_slam_advanced_rss_2024_public | libpointmatcher/pointmatcher/TransformationsImpl.cpp | // kate: replace-tabs off; indent-width 4; indent-mode normal
// vim: ts=4:sw=4:noexpandtab
#include "TransformationsImpl.h"
#include "Functions.h"
#include <iostream>
using namespace PointMatcherSupport;
//! Construct a transformation exception
TransformationError::TransformationError(const std::string& reason):
... | TOOL | 0.910766 | 5.908753 |
78337632-f81c-4eac-aa7e-e2e3418cf620 | Mu-Ahmad/Cses_solutions | 1634 - Minimizing Coins.cpp | #include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
using namespace std;
using namespace __gnu_pbds;
#define fi first
#define se second
#define ll long long
#define pb push_back
#define mp make_pai... | ALGO | 0.999968 | 4.422565 |
89e529d0-bb53-4294-a690-ed0738d2bb6d | LaurentChevalier/Geeetech-A20M-SKR-V1.3 | Marlin/src/gcode/calibrate/G34_M422.cpp | #include "../../inc/MarlinConfig.h"
#if ENABLED(Z_STEPPER_AUTO_ALIGN)
#include "../gcode.h"
#include "../../module/planner.h"
#include "../../module/stepper.h"
#include "../../module/motion.h"
#include "../../module/probe.h"
#if HOTENDS > 1
#include "../../module/tool_change.h"
#endif
#if HAS_LEVELING
#include ... | TOOL | 0.854549 | 6.83365 |
b7f3c62d-4bf1-447f-b0c3-2bd9d1d1c32f | zwwwwwwww/luogu | 递推和递归/P1706 全排列问题.cpp | #include<iostream>
using namespace std;
int data[10];
int Isuesd[10];
void fun(int n,int k,int count){
if(count==n){
for(int i=0;i<n;i++)
printf("%5d",data[i]);
cout<<endl;
}else{
for(int i=1;i<=n;i++){
if(Isuesd[i]==0){
data[count]=i;
Isuesd[i]=1;
fun( n,i+1,count+1);
Isuesd[i]=0;
... | ALGO | 0.999897 | 3.313267 |
067477ee-45b5-4b2b-acb6-ca438c64ac94 | jbush001/NyuziToolchain | tools/clang/test/SemaTemplate/ackermann.cpp | // RUN: %clang_cc1 -fsyntax-only -verify %s
// expected-no-diagnostics
// template<unsigned M, unsigned N>
// struct Ackermann {
// enum {
// value = M ? (N ? Ackermann<M-1, Ackermann<M, N-1> >::value
// : Ackermann<M-1, 1>::value)
// : N + 1
// };
// };
template<unsigned M, u... | ALGO | 0.90518 | 5.812396 |
9c2032ca-ab7d-4505-816a-071b98bc72b8 | troore/unico | benchmark/stream/lte/src/ResMapping/ResMapper.cpp |
#include <stdlib.h>
#include "ResMapper.h"
//#include "refs/dmrs.h"
#include "lte_phy.h"
//#include <iostream>
void SubCarrierMapping(LTE_PHY_PARAMS *lte_phy_params, float *pInpData, float *pOutData)
{
int NumLayer = lte_phy_params->N_tx_ant;
int NumULSymbSF = LTE_PHY_N_SYMB_PER_SUBFR;
int SCLoc = lte_phy_param... | ALGO | 0.980891 | 3.636268 |
6c08a4dc-d931-4908-a213-7d3bb93632e6 | realharryhero/newllvmproject | mlir/lib/Transforms/Utils/LoopInvariantCodeMotionUtils.cpp | #include "mlir/Transforms/LoopInvariantCodeMotionUtils.h"
#include "mlir/IR/Operation.h"
#include "mlir/IR/PatternMatch.h"
#include "mlir/Interfaces/LoopLikeInterface.h"
#include "mlir/Interfaces/SideEffectInterfaces.h"
#include "mlir/Interfaces/SubsetOpInterface.h"
#include "llvm/Support/Debug.h"
#include <queue>
#d... | ALGO | 0.997915 | 5.60058 |
384beed0-2df2-4ff2-97d6-c35535f3a516 | 113bommy/deepmind_codecontests_refine | cpp_source_filter_file/cpp_train_13274_12.cpp | #include <bits/stdc++.h>
using namespace std;
vector<string> v;
vector<string> tmp;
string neg(string s) {
int i;
for (i = 0; i < s.size(); ++i) s[i] = (s[i] == '+' ? '-' : '+');
return s;
}
int main() {
int n, i, j;
cin >> n;
v.push_back("+");
for (i = 1; i <= n; ++i) {
tmp = v;
v.clear();
fo... | ALGO | 0.999947 | 3.600526 |
2696998b-1db3-40ab-9111-fcc100f78039 | TBTGOMS/opencv | modules/core/src/softfloat.cpp | #include "precomp.hpp"
#include "opencv2/core/softfloat.hpp"
namespace cv
{
/*----------------------------------------------------------------------------
| Software floating-point underflow tininess-detection mode.
*----------------------------------------------------------------------------*/
enum {
tininess_b... | TOOL | 0.890463 | 6.65649 |
33369126-8090-4b58-b4f5-c24d02b48bd2 | AnimezKishan/Data-Structures-and-Algorithm-Preparation | LeetCode/Arrays/[C++] 2657. Find the Prefix Common Array of Two Arrays.cpp | class Solution {
public:
vector<int> findThePrefixCommonArray(vector<int>& A, vector<int>& B) {
int n = A.size();
vector<int> noCount(51, 0);
vector<int> prefixCommonArray;
int currCount = 0;
for(int i=0; i<n; i++){
noCount[A[i]]++;
noCount[B[i]]++;
... | ALGO | 0.999963 | 5.978309 |
8ed04e6d-d06b-4863-9777-192390880cd9 | Saif-000001/xpsc_latest | CodeChef/30Aug23/Maximum_Deliciousness.cpp | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef long double ld;
#ifdef LOKAL
#include "DEBUG_TEMPLATE.h"
#else
#define HERE
#define debug(args...)
#endif
const int MOD = 1000000007;
const int N = 2e5 + 5;
typedef pair<int, int> pii;
void TEST_CASES()
{
int n, k, l;
cin >> n >> k >> ... | ALGO | 0.999948 | 3.883142 |
e79970f2-55c5-40e7-ad86-e5007a76a1c7 | ASchneidman/HackCMU2018 | HackCMU2018/crawler/cpp_files/hackerearthshilandround.cpp | #include<bits/stdc++.h>
using namespace std;
long long bit[200005];
long long n;
void update(long long idx,long long val)
{
while(idx<=n)
{
bit[idx]+=val;
idx+=(idx&-idx);
}
}
long long query(long long idx)
{
long long sum=0;
while(idx>0)
{
sum+=bit[idx];
idx-=(i... | ALGO | 0.999923 | 4.25173 |
5dacdc45-3dd9-4c85-bc8b-cc1e8a5cd423 | knwoo/e2map | src/navigation/localization/thirdparty/fast_gicp/thirdparty/Eigen/doc/examples/TutorialLinAlgExComputeSolveError.cpp | #include <iostream>
#include <Eigen/Dense>
using namespace std;
using namespace Eigen;
int main()
{
MatrixXd A = MatrixXd::Random(100,100);
MatrixXd b = MatrixXd::Random(100,50);
MatrixXd x = A.fullPivLu().solve(b);
double relative_error = (A*x - b).norm() / b.norm(); // norm() is L2 norm
cout << "The ... | ALGO | 0.9997 | 3.645256 |
ecf2fb76-36e5-44bd-bc2b-dc76a07ef5f7 | PaukIsUha/optimizing_formating_code | predictions/submissions-aizu-cot-gpt4/Codenet/p02361/362928205/response_0.cpp | #include <algorithm>
#include <cstdio>
#include <queue>
#include <vector>
using namespace std;
const int INF = 1000000000;
struct edge {
int to, cost;
};
vector<edge> G[100000];
int v, e, r;
typedef pair<int, int> P;
priority_queue<P, vector<P>, greater<P>> q;
int main() {
scanf("%d %d %d", &v, &e, &r);
for (int ... | ALGO | 0.999946 | 3.984823 |
fd2d6f29-6324-4ad3-8794-154c7857d92a | Scarlett0815/Algorithm | oj/review-final/Graph/BFS.cpp | #include <iostream>
#include <list>
#include <map>
using namespace std;
struct Arc{
int adjnode;
int weight;
struct Arc* next;
};
struct Node{
int key;
struct Arc* first;
};
int n;
int node_index;
struct Node node[100];
int visited[100];
void CreateGraph(){
map<int, int> nodemap = {};
f... | ALGO | 0.999992 | 4.057761 |
498225d4-f861-4b20-813c-2237535724f7 | antaku66/programing_contest | src/LazySegmentTree.cpp | #include <bits/stdc++.h>
using namespace std;
using ll = long long;
constexpr ll INF = 1LL << 60;
namespace {
class LazySegmentTree {
public:
LazySegmentTree(int n, bool getMax) : getMax_(getMax) {
while (size_ < n) size_ *= 2;
node_.resize(2 * size_ - 1, (getMax_ ? -INF : INF));
lazy_.resize(2 * size_... | ALGO | 0.999349 | 5.497508 |
bbdd6f02-b0a4-47ce-b45e-74de696b3891 | CarlaCosenza/TrabalhoPAA | minimo.cpp | //https://br.spoj.com/problems/MINIMO/
#include <bits/stdc++.h>
using namespace std;
int n, m, c;
int mini(int a, int b){
if(a == -1 and b == -1) return -1;
if(a == -1) return b;
if(b == -1) return a;
return min(a, b);
}
int add(int a, int b){
if(a == -1 or b == -1) return -1;
return a+b;
}
void floydWarshall... | ALGO | 0.999976 | 4.341985 |
872f121d-c717-4005-bea4-fd6bb56e5386 | snichols/boost_1_61_0 | libs/program_options/src/variables_map.cpp | #define BOOST_PROGRAM_OPTIONS_SOURCE
#include <boost/program_options/config.hpp>
#include <boost/program_options/parsers.hpp>
#include <boost/program_options/options_description.hpp>
#include <boost/program_options/value_semantic.hpp>
#include <boost/program_options/variables_map.hpp>
#include <cassert>
namespace boo... | TOOL | 0.908496 | 7.838285 |
5bf2d5db-f4f5-4d1c-9a3a-260cbc701bd2 | ryuNagai/AtCoder | ABC114/C.cpp | #include <iostream>
#include <algorithm>
#include <vector>
#include <cmath>
#include <string>
using namespace std;
vector< string > S;
int num, l, i, N, ans=0;
void f(string S){
num = 0;
l = S.size();
if (l>=3){
for (i=0; i<l; i++){
num += (int)(S[i]-'0') * pow(10, l-1-i);
}
... | ALGO | 0.999374 | 3.829355 |
2046db7a-8393-4809-8dab-a9c3141f28ce | Richard-yw/RS-Image-Processing | work_5/func_5.cpp | #include "func_5.h"
void imageFusion(const char* pan_path, const char* mul_path, const char* result_path)
{
GDALAllRegister();
// Ӱ
GDALDataset* mul_dataset = (GDALDataset*)(GDALOpen(mul_path, GA_ReadOnly));
GDALDataset* pan_dataset = (GDALDataset*)(GDALOpen(pan_path, GA_ReadOnly));
int mul_x = mul_dataset->GetR... | DATA | 0.872581 | 3.747061 |
ae9fe9e6-74e3-4d6e-92be-bd62b0e135e1 | anushka931/Cpp_programming | find-root.cpp | #include<iostream>
using namespace std;
int root(int n){
int s=0;
int e=n;
int ans=-1;
long long int mid= s+(e-s)/2;
while(s<=e){
long long int sq= mid*mid;
if(sq == n){
return mid;
}
if(sq< n){
ans = mid;
s=mid+1;
}
else{
e=mid-1;
}
mid= s+(e-s)/2;
}
return ans;
}
dou... | ALGO | 0.999974 | 4.204414 |
6b8c2307-b9f0-42d4-a4b4-0872e6391607 | LIVE-EMPIRE/LITZLERTOTO | Engine/Source/ThirdParty/CryptoPP/5.6.5/include/des.cpp | // des.cpp - modified by Wei Dai from Phil Karn's des.c
// The original code and all modifications are in the public domain.
/*
* This is a major rewrite of my old public domain DES code written
* circa 1987, which in turn borrowed heavily from Jim Gillogly's 1977
* public domain code. I pretty much kept my key sch... | ALGO | 0.999574 | 6.701866 |
3571428c-ba9d-49cb-92a7-d6ebfe50b789 | linkeLi0421/no-remove-no-reorder | llvm/utils/TableGen/DAGISelEmitter.cpp | #include "CodeGenDAGPatterns.h"
#include "DAGISelMatcher.h"
#include "llvm/Support/Debug.h"
#include "llvm/TableGen/Record.h"
#include "llvm/TableGen/TableGenBackend.h"
using namespace llvm;
#define DEBUG_TYPE "dag-isel-emitter"
namespace {
/// DAGISelEmitter - The top-level class which coordinates construction
/// a... | TOOL | 0.9742 | 7.90951 |
cfdd3d4c-43a7-45b6-8de3-999540f3f72d | nikgit01/cpp_in_depth | Program/Rough work/tempCodeRunnerFile.cpp | #include<iostream>
using namespace std;
float calculateTriangleArea(float base, float height) {
// Formula for the area of a triangle: (1/2) * base * height
float area = 0.5 * base * height;
return area;
}
int main() {
float base, height;
cout << "Enter the base of the triangle: ";
cin >> bas... | ALGO | 0.998986 | 7.528441 |
09a549bc-6959-495c-9b50-adbb6f6a1d2b | raincross7/code-similarity | codes/train_code/problem271/problem271_6.cpp | #include<cstdio>
#include<cmath>
double getd(double x, double y){
double r = atan2(y, x) * 180 / M_PI;
return r;
}
int main(){
double x1,y1,x2,y2,x3,y3,xp,yp,d1,d2,d3;
double h;
while(scanf("%lf %lf %lf %lf %lf %lf %lf %lf", &x1,&y1,&x2,&y2,&x3,&y3,&xp,&yp) + 1){
x1 -= xp;
x2 -= xp;
x3 -= xp;
y1 -= yp;
... | ALGO | 0.999926 | 3.345834 |
9b6a9b9d-e552-413e-a0a1-baf1cda6012e | achtiii/task6 | task6.cpp |
#include <iostream>
#include <iomanip>
int ElemetsValid();
int** CreateMatr(int sizeRow_, int sizeCol_);
void InputMatr(int** matr, int sizeRow_, int sizeCol_);
void PrintMatr(int** matr, int sizeRow_, int sizeCol_);
void DeleteMatr(int** matr, int sizeRow_);
int SummMatr(int** matr, int sizeRow_, int sizeCol_);
i... | ALGO | 0.993588 | 4.147823 |
8ee7a3c0-1d87-476e-b808-05d5f9d6760c | AlessandroCilardo/NaplesPU-toolchain | compiler/lib/Transforms/Utils/LoopUnrollRuntime.cpp | #include "llvm/ADT/SmallPtrSet.h"
#include "llvm/ADT/Statistic.h"
#include "llvm/Analysis/AliasAnalysis.h"
#include "llvm/Analysis/LoopIterator.h"
#include "llvm/Analysis/ScalarEvolution.h"
#include "llvm/Analysis/ScalarEvolutionExpander.h"
#include "llvm/IR/BasicBlock.h"
#include "llvm/IR/Dominators.h"
#include "llvm/... | ALGO | 0.982786 | 7.840756 |
fc6d7ee4-54df-4103-88ff-b38ca5c29aa1 | Ri-Shard/Proyecto-Papeleria | 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.998693 | 6.797273 |
8d9439b5-b363-4784-8fc8-91a0a1b5cdc5 | Canbomm/Disciplina-PC | CodeForces/Atividades em Sala/Mashup 2/c-comprando votos.cpp | #include <bits/stdc++.h>
using namespace std;
typedef pair<int,int> pii;
int main (){
map<int, int> votos; // num_votos, candidatos com esse num_votos
set<int, greater<int>> maiores;
int n,candidato;
scanf("%d",&n);
int sananduva;
scanf("%d",&sananduva);
votos[sananduva] = 1;
maiores.insert(sanandu... | ALGO | 0.999985 | 3.813819 |
551b1087-1364-41d1-8eaa-625c45bf543e | anubhawbhalotia/Competitive-Programming | LeetCode/317. Shortest Distance from All Buildings.cpp | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef vector<int> vi;
typedef vector<long long> vl;
typedef vector<vector<int>> vvi;
typedef vector<vector<long long>> vvl;
typedef pair<int,int> pii;
typedef pair<long long ,long long> pll;
typedef set<int> si;
typedef set<long long> sl;
typedef uno... | ALGO | 0.9999 | 5.083172 |
bc6c0020-2673-498e-9ebd-3240924d8729 | Shwet310/LeetCode__Practice | 2415-reverse-odd-levels-of-binary-tree/2415-reverse-odd-levels-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.999981 | 6.071667 |
d3f32c90-732e-458c-809c-8075baf7af49 | basant-999/cppMain | 2darray/transposeMatric.cpp | #include<iostream>
using namespace std;
int main (){
int arr[2][3];
cout<<"enter 6 value \n";
for(int r=0; r<2;r++){
for(int c=0; c<3;c++){
cin>>arr[r][c];
}
}
for(int r=0;r<2;r++){
for(int c=0;c<3;c++){
cout<<arr[r][c]<<"\t";
}
cout<<"... | ALGO | 0.997981 | 3.299793 |
845a324a-0230-4827-a253-e6166f576902 | csJd/oj-codes | codeforces/567c.cpp | #include <bits/stdc++.h>
using namespace std;
const int N = 2e5 + 5;
int p[N];
int main()
{
int n, m, k, a, t;
scanf("%d%d%d%d",&n, &k, &a, &m);
int ans = -1;
for(int i = 1; i <=m; ++i)
{
scanf("%d", &t);
if(ans > 0 && (t / (a+1) + (n-t) /(a+1) < k))
ans = i;
}
printf("%d\n",ans);
return 0;
}
//Last ... | ALGO | 0.999924 | 3.256007 |
7f7b6650-b03c-485f-9552-a1d40cd4a4ff | MuVen/LeetCode | 73. Set Matrix Zeroes.cpp | class Solution {
public:
void setZeroes(vector<vector<int>>& matrix) {
int row = matrix.size();
if(row == 0)
return;
int col = matrix[0].size();
vector<int> r,c;
r.resize(row, 0);
c.resize(col, 0);
for(int i = 0; i < row; i++){
... | ALGO | 0.998684 | 6.208461 |
cc2ba625-c132-4655-bea3-133327d9c919 | milliyang/noise | src/base/util/umath.cpp | #include "noise/def.h"
#include "noise/strategy.h"
#include "noise/broker.h"
#include "noise/util.h"
#include "math.h"
#include <cmath>
namespace noise {
int umath::sum(const VecI &values)
{
int sum = 0;
if (values.size() <= 0) { return 0; }
for (auto it = values.begin(); it != values.end(); ++it) {
... | ALGO | 0.969118 | 6.073049 |
a5cf5cc6-0859-4d93-8aa7-dbf12adfa7c7 | greenrok/baekjoon | cpp/basic/농구_경기.cpp | #include <iostream>
#include <vector>
using namespace std;
int main()
{
int numOfplayer;
cin >> numOfplayer;
vector<int> count(26, 0);
for (int i = 0; i < numOfplayer; i++)
{
string player;
cin >> player;
count[player[0] - 'a']++;
}
bool flag = true;
for (int i = 0; i < co... | ALGO | 0.999819 | 4.441719 |
16f9b47a-b3dc-4764-b9ca-e59f2442fdee | ishandutta2007/codeforces | sergeifedorov/normal/164/C.cpp | #include <cstdio>
#include <iostream>
#include <vector>
#include <cmath>
#include <algorithm>
#include <string>
#include <set>
#include <map>
#include <ctime>
#include <cstring>
#include <cassert>
#include <bitset>
#include <sstream>
using namespace std;
#define forn(i, n) for(int i = 0; i < (int)(n); i++)
#define fo... | ALGO | 0.999977 | 3.016865 |
91ae199b-0479-4ade-b185-260ee678c223 | zhz0817/ds_demo | 排序/堆排序/优先队列api/cpp/main.cpp | #include "bits/stdc++.h"
using namespace std;
int main(){
std::vector<int> nums{10,9,8,7,6,5,4,3,2,1};
priority_queue<int,vector<int>,greater<int>> pq;
for(int& n:nums){
pq.push(n);
}
while (!pq.empty()){
cout<<pq.top()<<endl;
pq.pop();
}
return 0;
} | ALGO | 0.999507 | 4.26559 |
05536ebe-cff7-4619-b19a-915465ca73ea | ecoffey07/DCF_802.11_SIM | src/manager.cpp |
// #define TESTING
#define TOP1A
#define TOP1B
#define TOP2A
#define TOP2B
#include "manager.hpp"
#include "matplotlibcpp.h"
#include <chrono>
#include <thread>
#include <math.h>
#include <cmath>
#include <random>
#include <queue>
/**
Quick Maths:
Slot duration = 10us
Data frame size = 1500 bytes
BW = 10 Mbps... | ALGO | 0.978927 | 3.971467 |
56825d0f-0006-4e67-ac8b-e56905f76acb | acforvs/LeetCode-solutions | medium/Check If a String Contains All Binary Codes of Size K.cpp | class Solution {
public:
bool hasAllCodes(string s, int k) {
int n = s.length();
int total = 1 << k;
int ones = total - 1;
int hash = 0;
vector<bool> got(total, false);
for (int i = 0; i < n; i++) {
hash = ((hash << 1) & ones) | (s[i] - '0');
... | ALGO | 0.99983 | 6.119143 |
371cc41c-4e89-4777-be65-7961c7fbec0a | Awaken-Staging/android_frameworks_base | tools/stats_log_api_gen/utils.cpp | #include "utils.h"
#include "android-base/strings.h"
namespace android {
namespace stats_log_api_gen {
static void build_non_chained_decl_map(const Atoms& atoms,
std::map<int, AtomDeclSet::const_iterator>* decl_map) {
for (AtomDeclSet::const_iterator atomIt = atoms.non_chai... | TOOL | 0.902385 | 3.620443 |
828fbd3c-981e-45a9-8d9a-3932641c3330 | lclpsoz/competitive-programming | ARCHIVE/2018-10-02-1300/2069.cpp | #include <bits/stdc++.h>
using namespace std;
////////////// Prewritten code follows. Look down for solution. ////////////////
#define x first
#define y second
#define len(x) ((int)(x).size())
using pii = pair<int, int>;
using ll = long long;
using llu = long long unsigned;
using ld = long double;
const ld EPS = 1e-9... | ALGO | 0.999928 | 4.957917 |
8b362d4e-76c5-4a9e-bd02-bb57a97f2340 | iamrajee/ws_moveit2 | src/moveit/moveit_planners/chomp/chomp_motion_planner/src/chomp_trajectory.cpp | /* Author: Mrinal Kalakrishnan */
#include <ros/ros.h>
#include <chomp_motion_planner/chomp_trajectory.h>
#include <iostream>
namespace chomp
{
ChompTrajectory::ChompTrajectory(const moveit::core::RobotModelConstPtr& robot_model, double duration,
double discretization, const std::stri... | ALGO | 0.993576 | 6.378396 |
31fdcbaf-4d6c-4987-9bd0-4bc0574a6a4a | ishandutta2007/codeforces | kmjp/normal/901/D.cpp | #include <bits/stdc++.h>
using namespace std;
typedef signed long long ll;
#undef _P
#define _P(...) (void)printf(__VA_ARGS__)
#define FOR(x,to) for(x=0;x<(to);x++)
#define FORR(x,arr) for(auto& x:arr)
#define ITR(x,c) for(__typeof(c.begin()) x=c.begin();x!=c.end();x++)
#define ALL(a) (a.begin()),(a.end())
#define ZER... | ALGO | 0.999993 | 3.677152 |
0961a0f9-6b1a-4692-8f42-b18c025dd6a2 | mpfeifer1/Kattis | artichoke.cpp | // Michael Pfeifer
// Version 04, 2018/02/17
#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
using namespace std;
using namespace __gnu_pbds;
typedef long long ll;
typedef long double ld;
typedef unsigned int uint;
typedef unsigned long long ull;
const ld pi ... | ALGO | 0.999736 | 3.796363 |
7c06ea97-0e4f-4834-ab3f-12bd60506456 | AbhinaySinha21/DSA_C- | Activity_selection.cpp | #include <bits/stdc++.h>
using namespace std;
bool static compare(pair<int, int> a, pair<int, int> b)
{
return a.second < b.second;
}
int main()
{
int n;
cin >> n;
vector<pair<int, int>> v;
for (int i = 0; i < n; i++)
{
int x, y;
cin >> x >> y;
v.push_back({x, y});
}
... | ALGO | 0.99998 | 4.557375 |
e6ca6a7f-222b-49d6-b2ad-3ab515109e2c | oxygen-hunter/Flashboom | data/leetcode_cpp/iterator-for-combination.cpp | // Time: O(k), per operation
// Space: O(k)
class CombinationIterator {
public:
CombinationIterator(string characters, int combinationLength)
: characters_(characters)
, combinationLength_(combinationLength)
, last_(prev(characters.cend(), combinationLength), characters.cend())
, stk_{bind(&Combin... | ALGO | 0.999614 | 6.450728 |
2e799928-2bb6-4d50-8551-d5753a235f2e | jk-jeon/idiv | subproject/test/source/idiv.cpp | #include <idiv/continued_fraction/engine/caching.h>
#include <idiv/idiv.h>
#include <boost/ut.hpp>
#include <format>
#include <iostream>
namespace jkj {
namespace bigint {
static std::ostream& operator<<(std::ostream& out, jkj::bigint::uint_var const& n) {
auto digits = n.to_decimal();
... | TEST | 0.992462 | 6.704044 |
2f464562-6ac5-42c0-aaaf-8ebbc58ed66d | trinhminhtriet/leetcode | solutions/0900-0999/0929.unique-email-addresses/Solution.cpp | class Solution {
public:
int numUniqueEmails(vector<string>& emails) {
unordered_set<string> s;
for (const string& email : emails) {
size_t atPos = email.find('@');
string local = email.substr(0, atPos);
string domain = email.substr(atPos + 1);
string ... | ALGO | 0.999702 | 6.151651 |
e884775d-6be0-4b12-b0aa-59c36869785a | ishandutta2007/codeforces | lycmd/normal/1547/G.cpp | #include<bits/stdc++.h>
using namespace std;
int const N=400010;
int t,n,m,cur,tot,ans[N],ord[N],dfn[N],low[N],vis[N],slp[N],con[N];
vector<int>e[N],g[N];
stack<int>s;
void tarjan(int x){
dfn[x]=low[x]=++cur,vis[x]=1,s.push(x);
for(int y:e[x])
if(!dfn[y])
tarjan(y),low[x]=min(low[x],low[y]);
else if(vis[y])
... | ALGO | 0.999983 | 4.735476 |
f01c6093-f50e-45ff-a8ed-27fda50c835b | raincross7/code-similarity | codes/train_code/problem318/problem318_395.cpp | #include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
int main(){
int p,q,r;
cin >> p >> q >> r;
if(p <= q){
cout << p + min(q,r) << endl;
return 0;
}
if(q <= r){
cout << q + min(r,p) << endl;
return 0;
}
if(r <= p){
cout << r + min(p,q) << endl;
return... | ALGO | 0.99987 | 3.501822 |
8384c60d-76db-492c-af91-7d8c42bf524c | BBBBBbruce/PhysicsSimPro | external_lib/MFEM/mfem-4.3/examples/ex19p.cpp | // MFEM Example 19 - Parallel Version
//
// Compile with: make ex19p
//
// Sample runs:
// mpirun -np 2 ex19p -m ../data/beam-quad.mesh
// mpirun -np 2 ex19p -m ../data/beam-tri.mesh
// mpirun -np 2 ex19p -m ../data/beam-hex.mesh
// mpirun -np 2 ex19p -m ../data/beam-tet.mesh
// mpi... | ALGO | 0.999293 | 5.12966 |
e2f40c22-b98e-4072-b1fd-d6b926df998d | Jaimedev12/CodeForces_Problems | Ladders/Ladder4/A_Oh_Those_Palindromes.cpp | #include <bits/stdc++.h>
using namespace std;
#define _ ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);
int main() { _
int n; cin >> n;
string s; cin >> s;
sort(s.begin(), s.end());
cout << s << endl;
return 0;
} | ALGO | 0.999781 | 4.06797 |
402d9e43-9ef3-469f-9e92-a5596b2a1682 | evialbert/LeetCode | 0235-lowest-common-ancestor-of-a-binary-search-tree/0235-lowest-common-ancestor-of-a-binary-search-tree.cpp | /**
* Definition for a binary tree node.
* struct TreeNode {
* int val;
* TreeNode *left;
* TreeNode *right;
* TreeNode(int x) : val(x), left(NULL), right(NULL) {}
* };
*/
class Solution {
public:
TreeNode* lowestCommonAncestor(TreeNode* root, TreeNode* p, TreeNode* q) {
//base case... | ALGO | 0.999994 | 6.216547 |
fea9cc9b-f6da-4319-b79a-92862b2e5955 | shrikantkhatavkar/LB_Class_Applications | LB_Class/19-11-2021/program210.cpp | #include<iostream>
using namespace std;
typedef struct node
{
int data;
struct node* Lchild;
struct node* Rchild;
}NODE, *PNODE, **PPNODE;
void Insert(PPNODE Head, int no)
{
PNODE newn = new NODE;
newn->data = no;
newn->Lchild = NULL;
newn->Rchild = NULL;
if(*Head == NULL)
{
*Head = newn;
}
else
{
... | ALGO | 0.999282 | 3.529476 |
db56ebaf-6eb6-4484-8de2-3dcb65f71951 | afzalsiddique/problem-solving | CodeChef/REL101.cpp | #include <bits/stdc++.h>
#include <algorithm>
#include <map>
#define FOR(i,n) for(int i=0;i<n;i++)
using namespace std;
int main()
{
int t;
cin >> t;
while(t--)
{
map<int,int> mp;
int n;
cin >> n;
FOR(i,n)
{
int temp;
cin >> temp;
... | ALGO | 0.99988 | 3.39374 |
4439f63d-3e17-42a2-b8b3-d8a7173d4cc4 | wwwllm/C-- | 大一下/13届重庆市赛/H.cpp | #include <bits/stdc++.h>
using namespace std;
void solve()
{
int n;
cin >> n;
vector<int> a(n), b(n);
for (auto &x : a)
cin >> x;
for (auto &x : b)
cin >> x;
vector<int> aa;
for (auto it : a)
{
int op;
cin >> op;
if (op)
aa.push_back(i... | ALGO | 0.999945 | 4.370464 |
49ecd0e5-3846-4ac6-9489-0349550ac54c | shreyas-mante/Codeforces | 708A.cpp | // im__back - Shreyas Mante
#include<bits/stdc++.h>
using namespace std;
/*/-----------------------------TC && FASTIO--------------------------------/*/
#define nuke ll t; cin>>t; while(t--)
#define nuke_google ll t; cin>>t; for(ll i_1=1;i_1<=t;i_1++)
#define case_google cout<<"Case #";
#define imback ios::sync_with_s... | ALGO | 0.999991 | 3.864583 |
f6ef386f-085b-43d0-982c-024bc7d51f64 | Anupkp19/codeforces | competitiveprogrammer.cpp | #include<iostream>
#include <bits/stdc++.h>
using namespace std;
#define max(a, b) (a < b ? b : a)
#define min(a, b) ((a > b) ? b : a)
#define mod 1e9 + 7
#define FOR(a, c) for (int(a) = 0; (a) < (c); (a)++)
#define FORL(a, b, c) for (int(a) = (b); (a) <= (c); (a)++)
#define FORR(a, b, c) for (int(a) = (b); (a) >= (c);... | ALGO | 0.995248 | 4.129067 |
59f87650-7773-4cb1-8894-f3e8247bcf40 | ADIL0025/LeetCode | 661-image-smoother/image-smoother.cpp | class Solution {
public:
vector<vector<int>> imageSmoother(vector<vector<int>>& M) {
const int m = M.size();
const int n = M[0].size();
vector<vector<int>> ans(m, vector<int>(n));
for (int i = 0; i < m; ++i)
for (int j = 0; j < n; ++j) {
int ones = 0;
int count = 0;
for... | ALGO | 0.999297 | 6.965355 |
85fc3935-41e7-4bb4-a529-ccc024f3d652 | pos4n/1test | hashtable.cpp | /**************************
* Name: Posan Gc
* Assignment 7: Hash Tables
* Purpose of the file: This file implements a hash table using separate chaining with linked lists.
* It defines the HashTable class and its interface, including methods for adding, deleting, retrieving, and printing entries.
* The main fil... | ALGO | 0.861067 | 6.28312 |
847bf6af-94a5-4788-bb52-c53a72fa5805 | ZHIHAO93/TAIS | Src/03.cpp | #include <iostream>
#include <fstream>
#include <sstream>
#include <string>
#include <vector>
#include "TreeMap_AVL.h"
using namespace std;
void resuelve(TreeMap<string, vector<int>> treemap){
for (auto a : treemap){
cout << a.clave;
for (auto i = 0; i < a.valor.size(); i++)
{
cout << " " << a.valor[i];
}
... | ALGO | 0.967932 | 4.005893 |
5ea9e075-5b0b-4699-bf1a-69549225b955 | kenzhegaliyevn/Competitive-programming | acmp/0643/main.cpp | #include <iostream>
#include <cstdio>
#include <cmath>
#include <string>
#include <vector>
#include <deque>
#include <queue>
#include <stack>
#include <set>
#include <map>
#include <algorithm>
#include <sstream>
#include <bitset>
#include <cstdlib>
#define sqr(x) (x) * (x)
#define F first
#define S second ... | ALGO | 0.999914 | 3.977758 |
24052c99-8889-4cf4-b9aa-e501ce0fbf06 | Sarthak000001/SPPU_BE_COMP_Lab_SEM7 | DAA/a2.cpp | #include <iostream>
#include <queue>
#include <unordered_map>
#include <vector>
using namespace std;
class Node {
public:
char ch;
int freq;
Node* left;
Node* right;
Node(char character, int frequency) {
ch = character;
freq = frequency;
left = right = nullptr;
}
... | ALGO | 0.999987 | 6.094477 |
cc0acfbf-efa9-4dd3-a777-8c88ced6fe4c | rishabhkukreja30/DSA-questions | Stacks/Balanced_Paranthesis.cpp | #include<bits/stdc++.h>
using namespace std;
bool checkExpression(string str) {
stack <char> s;
for(int i= 0;i<str.size(); i++) {
if(str[i] == '(') {
s.push(str[i]);
}
else if(str[i] == ')') {
if(s.empty() || s.top() != '(') {
return false;
}
s.pop();
}
}
return s.empty();
}
int main() {
... | ALGO | 0.998646 | 4.570905 |
cdac3b46-9c88-4361-895a-457e1cda0c0a | openFudan/fudan-coursera | 3.专业教育/计算机科学与技术/专业必修/数据结构(C++)/上机/实验八/q2.cpp | #include"q2.h"
#include<iostream>
void BiThrTree::construct(int *p, int n)
{
int i = 0, a = 0;
LinkedQueue<int> q;
q.enqueue(p[i]);
BiThrNode *b;
while (1)
{
if (q.dequeue(&a) == 1) break;
if (a != -1) {
if (root == NULL)
root = new BiThrNode(a);
b = findi(a, root);
if (i < n - 1) {
i++;
... | ALGO | 0.999989 | 3.670622 |
de4f963f-1bf6-4475-99f8-74514b846d49 | bheem2510/Cracking_The_Coding_Interview | Ch 4. Trees and Graphs/C++14/4.10r-CheckSubtree.cpp | // Check Subtree: Tl and T2 are two very large binary trees, with Tl much bigger than T2. Create an
// algorithm to determine if T2 is a subtree of Tl.
// A tree T2 is a subtree of Tl if there exists a node n in Tl such that the subtree of n is identical to T2.
// That is, if you cut off the tree at node n, the two tre... | ALGO | 0.99908 | 6.929444 |
00e96a63-f2c9-4bea-ab61-e9c67afdf173 | Harshkamboj11/Cpp-basic-questions | pattern_a7.cpp | // ODD NUMBER PYRAMID
#include<iostream>
using namespace std;
int main(){
int n;
cout<<"Enter the number of rows u need: ";
cin>>n;
for (int i=1;i<=n;i++){
int num=1;
for (int j=1;j<=n-i;j++){
cout<<" ";
}
for (int k=1;k<=i;k++){
cout<<num<<" ";... | ALGO | 0.99928 | 4.217886 |
a91add45-16a3-4318-80c9-402b330a4f3e | txxxxc/competitive-programming | ABC_239/d/first/index.cpp | #include <bits/stdc++.h>
using namespace std;
#define debug(arg) std::cerr << #arg << ": " << (arg) << '\n'
#define INF ((1LL << 62) - (1LL << 31))
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define all(x) (x).begin(), (x).end()
using ll = long long;
using P = pair<int, int>;
using Graph = vector<vector<int>>... | ALGO | 0.999818 | 5.170459 |
20dee13b-7951-4342-a9cb-c0c0d0f349ca | Amix2/Systemy-Cyfrowe-Cpp | RealtimeCamera/RealtimeCamera/Angle.cpp | #include "stdafx.h"
#include "Angle.h"
double angleDifference(double angle1, double angle2) {
const double angleDif = std::abs(angle1 - angle2);
if (angleDif < PI) return angleDif;
else return 2 * PI - angleDif;
}
int angleCompare(double angle1, double angle2) { // angle1 > angle2
if (std::abs(angle1 - angle2) <=... | TOOL | 0.977888 | 4.496457 |
e4a3054d-3988-48eb-a85a-c6ced066a91e | 113bommy/deepmind_codecontests_refine | cpp_source_filter_file/cpp_train_12858_8.cpp | #include <bits/stdc++.h>
using namespace std;
long long N, M, ans, temp, lo, hi, done, a, b, rem;
inline long long go(long long n) {
n %= 1000000007;
return (n * (n + 1) / 2) % 1000000007;
}
int main() {
scanf("%lld %lld", &N, &M);
ans = ((N % 1000000007) * (M % 1000000007)) % 1000000007;
done = M + 1;
for ... | ALGO | 0.999985 | 4.969645 |
9b550c27-2c60-46c1-875d-47da58e5e205 | protectors/ACM | UVA/UVA374-Big_Mod.cpp | #include <cstdio>
#include <cstring>
#include <string>
#include <algorithm>
#include <iostream>
using namespace std;
int powermod(int a,int b,int c){
int ans=1;
while(b>0){
a%=c;
if(b%2==1) ans=(ans*a)%c;
b/=2;
a=(a*a)%c;
}
return ans;
}
int main(){
int a,b,c;
w... | ALGO | 0.999955 | 4.230978 |
28d5ee33-cb55-4708-af64-397050f1f301 | ultroneous/online-grocery-shopping | 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 |
16c06e8b-662a-4b9c-a85f-4332b57e6ac7 | RobertoTicona/A.D.A-2024-II-UNA | Inserción/Método de shell.cpp | //Mtodo de shell
#include <iostream>
#include <stdlib.h>
using namespace std;
void shellSort(int arr[], int n) {
for (int gap = n / 2; gap > 0; gap /= 2) { // Disminuye el gap en cada iteracin
for (int i = gap; i < n; i++) { // Empieza desde el ndice "gap" hasta el final
int temp = arr[i]; // Almacena el va... | ALGO | 0.999938 | 4.619756 |
a6334c66-f46f-4185-a82c-9fcb107494e4 | shahjalal-mahmud/CodeForces | Group/Assiut University Training - Newcomers/Data-Type-Condition/Contest-01/I_Lucky_Numbers.cpp | #include <iostream>
using namespace std;
int main()
{
int a;
cin >> a;
int temp1 = a % 10;
a = a / 10;
int temp2 = a % 10;
if (temp1 % temp2 == 0 || temp2 % temp1 == 0)
{
cout << "YES";
}
else
{
cout << "NO";
}
return 0;
} | ALGO | 0.999881 | 4.625292 |
2bfbc5c0-a085-4bde-89cb-41736cbd0a75 | mhdr-hami/DynamicPhiFunction | apps/witness/Driver.cpp | /*
* $Id: sample.cpp
* hog2
*
* Created by Nathan Sturtevant on 5/31/05.
* Modified by Nathan Sturtevant on 02/29/20.
*
* This file is part of HOG2. See https://github.com/nathansttt/hog2 for licensing information.
*
*/
#include <cstring>
#include "Common.h"
#include "Driver.h"
#include "Timer.h"
#include... | ALGO | 0.98994 | 4.441173 |
def8b8c2-3a00-4815-8e26-c2e60755dc8a | nhatlonggunz/Algorithm-And-Data-Structure | Graph/Edmond Karp.cpp | #include <vector>
#include <queue>
#include <iostream>
using namespace std;
#define maxN long(1e3) + 3
int n, s, t, mf, c[maxN][maxN], f[maxN][maxN];
vector<int> g[maxN], p;
bool findPath()
{
int u, v;
queue<int> q; q.push(s);
p.assign(n + 1, 0); p[s] = -1;
while(!q.empty())
{
... | ALGO | 0.999959 | 4.806025 |
0afcbd5a-7410-4534-9747-9455c489bce2 | wuhao5/boost | libs/algorithm/example/clamp_example.cpp | #include <string>
#include <iostream> // for cout, etc
#include <boost/algorithm/clamp.hpp>
namespace ba = boost::algorithm;
bool compare_string_lengths ( const std::string &one, const std::string &two )
{
return one.length () < two.length ();
}
int main ( int /*argc*/, char * /*argv*/ [] ) {
// Clamp take... | TEST | 0.98131 | 6.000297 |
05c3f890-d342-4178-a8bf-aa9397178905 | Zeta0080-cell/c-- | 实例39—数组元素插入.cpp | #include <stdio.h>
#define MAX_SIZE 10 // С
// ڽԪز뵽
void insertIntoSortedArray(int arr[], int size, int newElement)
{
int i;
// ҵ
for (i = size - 1; (i >= 0) && (newElement < arr[i]); i--)
{
arr[i + 1] = arr[i]; // Ԫƶ
}
// Ԫ
arr[i + 1] = newElement;
}
int main()
{
int arr[MAX_... | ALGO | 0.999813 | 5.162424 |
298bf609-26a5-451d-983b-f6162417163b | LILKOTYO/SimulationFramework | SimuFramework/libigl/include/igl/adjacency_list.cpp | #include "verbose.h"
#include <algorithm>
template <typename Index, typename IndexVector>
IGL_INLINE void igl::adjacency_list(
const Eigen::MatrixBase<Index> & F,
std::vector<std::vector<IndexVector> >& A,
bool sorted)
{
A.clear();
A.resize(F.maxCoeff()+1);
// Loop over faces
for(int i = 0;i<F... | ALGO | 0.972235 | 5.37298 |
6561a4a6-4d61-489d-8525-ec2c332479d4 | aanchalasnani/PS-Pseudo-Codes | specialNodes.cpp | #include<bits/stdc++.h>
using namespace std;
#define fastio ios_base::sync_with_stdio(false);cin.tie(0);cout.tie(0);
typedef long long ll;
typedef long double ld;
typedef double db;
typedef string str;
typedef pair<int, int> pi;
typedef pair<ll, ll> pl;
typedef pair<db, db> pd;
typedef vector<int> vi;
typedef vecto... | ALGO | 0.999827 | 4.203277 |
3516da7d-55c6-4809-b8df-ecc1396412b1 | PERFECT047/Journal_For_CP | USACO/Friday.cpp | /* Use the slash-star style comments or the system won't see your
identification information */
/*
ID: siddhar108
TASK: friday
LANG: C++
*/
/* LANG can be C++11 or C++14 for those more recent releases */
#include<bits/stdc++.h>
using namespace std;
#pragma GCC optimize("Ofast")
#pragma GCC targe... | ALGO | 0.99997 | 3.488759 |
59039b32-def5-4776-a0fb-7d0e045354d2 | king-yyf/cpcode | acwing/acw108/c.cpp | #pragma clang diagnostic push
#pragma ide diagnostic ignored "cppcoreguidelines-narrowing-conversions"
#pragma ide diagnostic ignored "hicpp-signed-bitwise"
#pragma GCC optimize ("Ofast,unroll-loops")
#pragma GCC optimize("no-stack-protector,fast-math")
#include <bits/stdc++.h>
using namespace std;
using ll = long lo... | ALGO | 0.999959 | 4.305237 |
7d8e0dae-0d7f-4e33-8709-a6ca73224691 | ilanolkies/PageRank | MatrixOperations.cpp | #include "MatrixOperations.h"
Matrix diagonal(Matrix &m) {
Matrix d(m.rows(), m.columns());
double acum[m.columns()];
for (uint i = 0; i < m.columns(); ++i)
acum[i] = 0;
for (unsigned int i = 0; i < m.rows(); ++i)
for (auto it = m[i].begin(); it != m[i].end(); ++it)
acum[i... | ALGO | 0.98805 | 3.92906 |
ed601163-48d7-44be-956c-a99bc0a85fb3 | Gokulkrishnanrg2004/Super_dream_batch_training | 2478-longest-nice-subarray/longest-nice-subarray.cpp | class Solution {
public:
int longestNiceSubarray(vector<int>& nums)
{
int n = nums.size();
int left = 0;
int currOR = 0;
int maxlen = 0;
for(int right = 0;right < n;right++)
{
while((currOR & nums[right]) != 0)
{
c... | ALGO | 0.999988 | 6.214928 |
8e02da98-8c07-431d-a17c-2a2919da7c45 | marcio1998/estrutura_dados_1 | org.struct.cpp | /*Algoritmo criado para organizar uma estrutura de dados chamado, fila duplamente encadeada em ordem crescente atravs do
do algoritmo bubble Sort.*/
#include <stdio.h>
#include <stdlib.h>
#include<time.h>
struct valores {
int valor;
struct valores *prox, *ant;// ponteiros que conectam as estruturas.
}; // struct cr... | ALGO | 0.999878 | 4.545028 |
3a0b3077-4ea6-4fee-bdc0-46497a375677 | CoderDongHuang/JavaserverCode | C++code1/2.6-2.12.cpp | #include<iostream>
#include<string>
#include<iomanip>
#include<fstream>
using namespace std;
#define OK 1
#define ERROR 0
#define OVERFLOW -2
typedef int Status; //Status ǺֵֵͣǺ״̬롣
typedef int ElemType; //ElemType ΪɶͣΪint
struct Book {
string id;//ISBN
string name;//
double price;//
};
typedef struct LNode {
Book ... | TOOL | 0.973442 | 3.372027 |
b5b35fcb-4839-4f7e-b65c-8d0569f1e06a | shubasgm/csa0613DAA | pascal triangle.cpp | #include <stdio.h>
int fact(int n)
{
int a;
for (a = 1; n > 1; n--)
a *= n;
return a;
}
int combination(int n, int r)
{
return fact(n) / (fact(n - r) * fact(r)); }
int main()
{
int rows;
int i, j;
printf("Enter Number of Rows: ");
scanf("%d", &rows);
for (i = 0; i <= rows; i++)
{
for... | ALGO | 0.99901 | 4.99163 |
67c9077e-a843-4629-b506-c287478f81df | arm/arm-toolchain | libcxx/test/std/algorithms/alg.sorting/alg.min.max/minmax_element.pass.cpp | // <algorithm>
// template<ForwardIterator Iter>
// requires LessThanComparable<Iter::value_type>
// pair<Iter, Iter>
// minmax_element(Iter first, Iter last);
#include <algorithm>
#include <random>
#include <cassert>
#include "test_macros.h"
#include "test_iterators.h"
std::mt19937 randomness;
template <cla... | TEST | 0.922443 | 6.297091 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.