uuid stringlengths 36 36 | repo_name stringlengths 5 133 | relative_path stringlengths 3 3.76k | content stringlengths 282 4.03M | category stringclasses 6
values | algo_rel_score float32 0.9 1 | quality_score float32 3 8.13 | source_meta dict |
|---|---|---|---|---|---|---|---|
ddff298f-6fd6-4333-9e99-7fa3db2e253b | pawan-nirpal-031/Algorithms-And-ProblemSolving | Active/CodeForces/A_Shortest_Path_with_Obstacle.cpp | // Problem Link : https://codeforces.com/contest/1547/problem/A
#include <bits/stdc++.h>
using namespace std;
typedef unsigned long long int ull;
typedef long long int ll;
typedef long double ld;
#define Mod 1000000007
#define Infinity (ll)1e18
#define Append(a) push_back(a)
#define Pair(a,b) make_pair(a,b)
#define Cle... | ALGO | 0.999939 | 5.382592 | {
"github_metadata": {
"branch": "master",
"commit_count": 121,
"repo_created_at": "2021-03-16T14:30:10.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "b9f93b72... |
58871e7f-9abd-4dac-be9b-746bad07fa31 | akssingh0102/Workspace | DSA and Competitive Programming/CP_CipherSchools/2021 Feb/Assignment 2 - Recursion and Backtracking/2_OldPhoneKeypadCombination.cpp | #include<iostream>
#include<bits/stdc++.h>
#include<unordered_set>
#include<unordered_map>
using namespace std;
#define ll long long int
#define llmin -1e18
#define ff first
#define ss second
#define pb push_back
#define vi ... | ALGO | 0.999781 | 4.85002 | {
"github_metadata": {
"branch": "main",
"commit_count": 125,
"repo_created_at": "2022-04-23T17:39:04.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "4c1bd6600b... |
6966bfb8-e293-4735-8c10-53ef3f2dc8bb | cseshamim47/station | CPP/2020-2023/IMPORTATNT TOPICS/Data Structure/Ternary Search.cpp | #include <bits/stdc++.h>
using namespace std;
int f(int* arr, int key)
{
int l = 0;
int r = 9;
while(l <= r)
{
int m1 = l+(r-l)/3;
int m2 = r-(r-l)/3;
if(arr[m1] == key)
{
return arr[m1];
}else if(arr[m2] == key)
{
return arr[m2];... | ALGO | 0.999911 | 4.397389 | {
"github_metadata": {
"branch": "master",
"commit_count": 122,
"repo_created_at": "2021-02-12T19:05:34.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "8fef61fa... |
97fbf7d6-9940-44d6-b425-950b26cce1f2 | falcaoanderson/CompetitiveProgramming | OBI/obi-2023-premio.cpp | // 03/08/23 //
#include <iostream>
#include <algorithm>
#include <vector>
#include <queue>
#include <set>
#include <unordered_set>
#include <map>
#include <unordered_map>
#include <tuple>
#include <cstring>
#include <stack>
using namespace std;
#define ll long long
#define endl "\n"
#define fast_io ios_base::sync_wit... | ALGO | 0.998923 | 4.852956 | {
"github_metadata": {
"branch": "main",
"commit_count": 337,
"repo_created_at": "2023-03-08T11:51:46.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "8b969ca36a... |
f2375489-e184-42db-9034-86fdf77efd9c | bjut-hz/basics | leetcode_c++/394.decode-string.cpp | /*
* @lc app=leetcode id=394 lang=cpp
*
* [394] Decode String
*
* https://leetcode.com/problems/decode-string/description/
*
* algorithms
* Medium (47.25%)
* Likes: 2143
* Dislikes: 115
* Total Accepted: 148.2K
* Total Submissions: 313.7K
* Testcase Example: '"3[a]2[bc]"'
*
* Given an encoded stri... | ALGO | 0.998313 | 6.572178 | {
"github_metadata": {
"branch": "master",
"commit_count": 476,
"repo_created_at": "2018-08-13T12:30:11.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "434ae9ce... |
3843164c-c24b-4224-892b-044fb83e5544 | Xilinx/Vitis_Libraries | codec/L2/demos/jxlEnc/third_partys/lib/jxl/linalg.cc | // Copyright (c) the JPEG XL Project Authors. All rights reserved.
//
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
#include "lib/jxl/linalg.h"
#include <stdlib.h>
#include <cmath>
#include <deque>
#include <utility>
#include <vector>
#include "lib/jxl/base/... | ALGO | 0.999163 | 6.998256 | {
"github_metadata": {
"branch": "main",
"commit_count": 471,
"repo_created_at": "2019-09-23T19:13:46.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 988,
"forks": 381,
"issues": 0,
"pull_requests": 12
},
"file_meta": {
"content_id": "5130c0... |
68bbf186-48e6-4a25-beb5-d5f37d85c3b4 | Sunil2120/Coding_questions | Fenwick_tree/Distinct_elements.cpp | #include<bits/stdc++.h>
using namespace std;
struct node
{
int first;
int second;
int index;
};
bool compare(node a,node b)
{
return a.second < b.second;// increasing order
}
void update(int* BIT,int index,int value,int n)
{
for(int i=index;i<=n;i+=(i&(-i)))
{
BIT[i]+=value;
}
}
int query(int* BIT,int... | ALGO | 0.999965 | 4.086255 | {
"github_metadata": {
"branch": "master",
"commit_count": 9,
"repo_created_at": "2021-07-23T01:59:32.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "c1000a1683... |
6b4d6eae-7acb-41e4-a3ea-e41369825411 | opengl-tutorials/ogl | external/bullet-2.81-rev2613/src/BulletMultiThreaded/SpuNarrowPhaseCollisionTask/SpuCollisionShapes.cpp | /*
Bullet Continuous Collision Detection and Physics Library
Copyright (c) 2003-2006 <NAME> http://continuousphysics.com/Bullet/
This software is provided 'as-is', without any express or implied warranty.
In no event will the authors be held liable for any damages arising from the use of this software.
Permission is ... | ALGO | 0.980831 | 5.220236 | {
"github_metadata": {
"branch": "master",
"commit_count": 210,
"repo_created_at": "2015-05-31T00:33:09.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 2799,
"forks": 938,
"issues": 29,
"pull_requests": 19
},
"file_meta": {
"content_id": "c5... |
a06a524e-cf99-4833-a1b8-a17ed56153e5 | oss5824/practice | DFS와BFS/2636.cpp | #include<iostream>
#include<algorithm>
#include<cstring>
#include<queue>
#include<cmath>
#include<vector>
#include<string>
#define INF 987654321
typedef unsigned long long ull;
using namespace std;
int N, M, Map[100][100];
int dx[4] = { -1,0,1,0 }, dy[4] = { 0,1,0,-1 };
bool visit[100][100];
vector<pair<int, int>>v;
bo... | ALGO | 0.999913 | 3.328213 | {
"github_metadata": {
"branch": "master",
"commit_count": 800,
"repo_created_at": "2020-12-16T12:26:55.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "ea7dd2ce... |
e8685580-6b68-41fd-b417-dd4029d99b57 | Avrahamadana/BinaryTree-a | sources/BinaryTree.hpp | using namespace std;
namespace ariel
{
template <typename T>
class BinaryTree
{
struct Node
{
friend class BinaryTree;
T data;
Node *left;
Node *right;
Node *parent;
Node(T d) : data(d), left(nullptr), right(nullptr), p... | ALGO | 0.999514 | 5.818207 | {
"github_metadata": {
"branch": "main",
"commit_count": 1,
"repo_created_at": "2021-05-26T16:14:18.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "57fd282e478c... |
a1f8f1de-cb87-46d0-a378-f2cffbd2fb56 | ritz2405/c-and-cpp-codes | bob_and_apples.cpp | #include<bits/stdc++.h>
using namespace std;
vector<vector<vector<int> > > dp;
int knapsack(int v[], int p[], int m, int n, int flag)
{
if(dp[n][m][flag] != -1)
{
return dp[n][m][flag];
}
if(n == 0 || m == 0)
{
return 0;
}
if(flag == 1)
{
if(p[n-1] <= m)
{
return dp[n][m][flag] = max(v[n-1] + knapsac... | ALGO | 0.999967 | 3.66827 | {
"github_metadata": {
"branch": "main",
"commit_count": 1,
"repo_created_at": "2024-07-16T21:09:28.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "184b04cf49b0... |
c0d831dc-8cad-414b-9a12-8bb323a992bd | Pseudomanifold/Aleph | include/aleph/topology/QuotientSpaces.hh | #ifndef ALEPH_TOPOLOGY_QUOTIENT_SPACES_HH__
#define ALEPH_TOPOLOGY_QUOTIENT_SPACES_HH__
#include <iterator>
#include <set>
#include <vector>
namespace aleph
{
namespace topology
{
/**
Calculates the cone over a simplicial complex. The function creates
a new cone vertex that is guaranteed not to occur in the sim... | ALGO | 0.97437 | 7.052755 | {
"github_metadata": {
"branch": "master",
"commit_count": 2213,
"repo_created_at": "2016-11-30T08:42:10.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 101,
"forks": 16,
"issues": 4,
"pull_requests": 1
},
"file_meta": {
"content_id": "c3fd... |
272bb7e6-290f-46b9-836c-864ad040118e | RoboKez/AppRL | robot/CPP/Envs/NN.cpp | //
// NN.cpp
// robot
//
// Created by <NAME> on 20/06/2022.
//
#include "NN.hpp"
NeuralNetwork::NeuralNetwork(std::uint16_t in_size,
std::uint16_t out_size,
std::uint16_t h1_size,
std::uint16_t h2_size,
... | ALGO | 0.993393 | 5.170068 | {
"github_metadata": {
"branch": "main",
"commit_count": 2,
"repo_created_at": "2023-01-23T21:54:03.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "d9d6b4288e28... |
42ceabb1-39f9-491b-a24e-a29d44f1db65 | 2019331099-Rabbi/Online-Judges-Problems-Solution | LeetCode/Random/13.RomantoInteger.cpp | #include <bits/stdc++.h>
#define endl '\n'
#define PI acos(-1)
#define sz 10
#define inf 1000000000009
#define mod 100000000
#define RUN_FAST ios::sync_with_stdio(false);
using namespace std;
int arr[26];
void init()
{
arr['I' - 'A'] = 1;
arr['V' - 'A'] = 5;
arr['X' - 'A'] = 10;
arr['L' - 'A'] = 50;
... | ALGO | 0.99986 | 4.646214 | {
"github_metadata": {
"branch": "main",
"commit_count": 25,
"repo_created_at": "2022-06-29T17:28:54.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "5831ec08ca4... |
36752ebf-d84a-4183-abae-cafbffb0bae3 | hpgl/hpgl | src/GsTL-1.3/GsTL/grid/data_relocator.cc | /* GsTL: the Geostatistics Template Library
*
* Author: <NAME>
* Copyright (c) 2000 The Board of Trustees of the Leland Stanford Junior University
*
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without modification,
* are permitted provided that the following conditi... | ALGO | 0.99586 | 5.520531 | {
"github_metadata": {
"branch": "master",
"commit_count": 23,
"repo_created_at": "2011-07-04T12:42:09.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 115,
"forks": 24,
"issues": 2,
"pull_requests": 0
},
"file_meta": {
"content_id": "e3a7bb... |
9418783b-2e5a-48fd-98eb-9753dc5a2638 | busebd12/InterviewPreparation | LeetCode/C++/General/Easy/SameTree/main.cpp | #include "../TreeNode.h"
#include <iostream>
using namespace std;
/*
* Approach:
* Recursively iterate through both trees.
* Base cases: if both nodes are null, return true. if one node is not null and the other one is, return false. If both node values are not equal, return false.
* Return both node values are eq... | ALGO | 0.999963 | 6.447131 | {
"github_metadata": {
"branch": "master",
"commit_count": 218,
"repo_created_at": "2015-12-15T14:19:50.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "d6d89fe7... |
d564d8d5-1970-4ae9-8ff5-b35e33e11431 | ernstnolte/routersim | main.cpp | //43769780 <NAME>
#include <iostream>
#include <fstream> //file handling
#include <iomanip> //setw
#include <memory> //smart pointers
#include <ctime> //random number generation
using namespace std;
//declares router address constant
const string ROUTER_ADDRESS = "192.168.0.1";
//defines the str... | TOOL | 0.907922 | 3.823683 | {
"github_metadata": {
"branch": "master",
"commit_count": 39,
"repo_created_at": "2024-09-21T15:41:04.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "82d153249... |
ac293025-07df-4d5a-8c42-4154c0b80c41 | Masum95/UvaSolution | UVA _10651 - Pebble Solitaire.cpp | #include<bits/stdc++.h>
#define bug cout<<"bug";
#define pb(n) push_back(n)
#define lli long long int
#define fr(i,s,l) for(i=s;i<l;i++)
#define sf(n) scanf("%d",&n);
#define nl printf("\n")
#define mst(n) memset(n,0,sizeof(n))
// a pretty straightforward backtracking problem
//all we need to do is to check all possib... | ALGO | 0.999677 | 3.506913 | {
"github_metadata": {
"branch": "master",
"commit_count": 6,
"repo_created_at": "2017-09-07T10:14:43.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "cba866b113... |
90ac90ea-c8f9-45ca-aad5-6a90edce8fb8 | mit-racecar/racecar_simulator | include/racecar_simulator/scan_simulator_2d.hpp | #pragma once
#include <random>
#include "racecar_simulator/pose_2d.hpp"
namespace racecar_simulator {
class ScanSimulator2D {
private:
// Laser settings
int num_beams;
double field_of_view;
double scan_std_dev;
double angle_increment;
// Ray tracing settings
double ray_tracing_epsil... | ALGO | 0.925121 | 6.107008 | {
"github_metadata": {
"branch": "master",
"commit_count": 27,
"repo_created_at": "2019-01-31T19:43:27.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 140,
"forks": 82,
"issues": 1,
"pull_requests": 1
},
"file_meta": {
"content_id": "f646867... |
7083c73f-cdc2-4c86-b4fb-a1e3d42517cc | sxs-collaboration/spectre | src/PointwiseFunctions/GeneralRelativity/InverseSpacetimeMetric.hpp | // Distributed under the MIT License.
// See LICENSE.txt for details.
#pragma once
#include <cstddef>
#include "DataStructures/DataBox/Tag.hpp"
#include "DataStructures/Tensor/TypeAliases.hpp"
#include "PointwiseFunctions/GeneralRelativity/Tags.hpp"
#include "Utilities/Gsl.hpp"
#include "Utilities/TMPL.hpp"
/// \in... | ALGO | 0.976211 | 7.078893 | {
"github_metadata": {
"branch": "develop",
"commit_count": 17103,
"repo_created_at": "2017-04-07T17:28:20.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 168,
"forks": 202,
"issues": 530,
"pull_requests": 57
},
"file_meta": {
"content_id": ... |
8b4a1138-c4b7-4e8e-acfd-147a4c8368af | kecho/Noice | Source/Noice/SimdSearcher.h | #pragma once
#include <vector>
#include <random>
#include <Noice/SimdSearcher.ispc.h>
namespace ispc
{
struct Image;
typedef int PixelState;
inline int MakePixelState(int offset, int valid)
{
return (offset << 1) | (valid & 0x1);
}
inline int IsValid(PixelState ps)
{
retur... | ALGO | 0.998749 | 5.738337 | {
"github_metadata": {
"branch": "main",
"commit_count": 101,
"repo_created_at": "2021-03-27T23:29:10.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 95,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "1aa6dc381... |
e6a308b9-63e4-45f4-97be-40aa3158f7d3 | MAHFUZ003/xpsc__ | week 6/day 3/Anti_Palindrome.cpp | #include <bits/stdc++.h>
using namespace std;
#define read(type) readInt<type>() // Fast read
#define ll long long
#define nl "\n"
void solve()
{
int n;
cin >> n;
string s;
cin >> s;
int v[26];
memset(v, 0, sizeof(v));
for (int i = 0; i < n; i++)
{
v[int(s[i] - 'a')]++;
}
... | ALGO | 0.999985 | 4.280022 | {
"github_metadata": {
"branch": "main",
"commit_count": 51,
"repo_created_at": "2023-08-06T10:23:41.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "bd9ea77bb9a... |
57f449bf-e14b-4447-8598-e613364a1e0c | Tarunagg1/Ds_Alog_notes | Bitonic_Point/Bitonic_Point.cpp | /*
BITONIC POINT
Given an array. The task is to find the bitonic point of the array.
The bitonic point in an array is the index before which all the numbers
are in increasing order and after which, all are in decreasing order.
*/
#include<bits/stdc++.h>
using namespace std;
int bitonic(int a[], int n) {
int l = ... | ALGO | 0.9998 | 4.783125 | {
"github_metadata": {
"branch": "master",
"commit_count": 1,
"repo_created_at": "2021-01-19T04:18:10.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "60401cc983... |
ec7df653-4f63-4f51-be72-e00799b3e19d | xamarin/XobotOS | external/skia/src/gpu/FlingState.cpp |
/*
* Copyright 2010 Google Inc.
*
* Use of this source code is governed by a BSD-style license that can be
* found in the LICENSE file.
*/
#include "FlingState.h"
#include "SkMatrix.h"
#include "SkTime.h"
#define DISCRETIZE_TRANSLATE_TO_AVOID_FLICKER true
static const float MAX_FLING_SPEED = 1500;
static ... | TOOL | 0.904336 | 6.660915 | {
"github_metadata": {
"branch": "master",
"commit_count": 2,
"repo_created_at": "2012-04-30T21:53:19.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 1246,
"forks": 247,
"issues": 6,
"pull_requests": 0
},
"file_meta": {
"content_id": "ee4db3... |
5960714b-afba-4e7b-b6a3-5e9cedfbde03 | zurich-eye/ze_oss | ze_splines/include/ze/splines/operators.hpp | // Copyright (c) 2015-2016, ETH Zurich, <NAME>, Zurich Eye
// All rights reserved.
//
// Redistribution and use in source and binary forms, with or without
// modification, are permitted provided that the following conditions are met:
// * Redistributions of source code must retain the above copyright
// noti... | TOOL | 0.986538 | 5.991698 | {
"github_metadata": {
"branch": "master",
"commit_count": 1603,
"repo_created_at": "2016-08-31T12:39:01.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 34,
"forks": 12,
"issues": 1,
"pull_requests": 0
},
"file_meta": {
"content_id": "41a00d... |
2d603ac6-30a2-41df-87f1-e266eb727121 | Amanhacker/Aman-Barnwal-Leetcode-Solutions | 742-closest-leaf-in-a-binary-tree/742-closest-leaf-in-a-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.999992 | 5.669499 | {
"github_metadata": {
"branch": "master",
"commit_count": 2521,
"repo_created_at": "2021-12-24T16:13:06.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 441,
"forks": 140,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "436... |
7f6453a3-5c5b-4595-af61-525ae8e3b638 | flyfj/Saliency | SalientObjectDetector_Clean_new/library/EHSW/HistBinaryCenterReconstructionFunction.h | #pragma once
#include <HistBinaryFunction.h>
template<class RealType>
class BinReconstructionFunction : public BinFunctionBase<RealType>
{
private:
valarray<int> global_histogram; // of the entire image
public:
BinReconstructionFunction(const valarray<int>& global_hist)
: global_histogram(global_hist) {}
bin... | ALGO | 0.999086 | 6.232047 | {
"github_metadata": {
"branch": "master",
"commit_count": 286,
"repo_created_at": "2012-11-08T21:41:32.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 7,
"forks": 8,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "2a0dc636... |
a7652f3f-9f98-45e6-bac5-bee65c08f4a2 | RyannLLM/LeetCode | src/DataStructure/590-N-aryTreePostorderTraversal/main2.cpp | #include <iostream>
#include <vector>
#include <stack>
#include <unordered_map>
using namespace std;
// Definition for a Node.
class Node
{
public:
int val;
vector<Node *> children;
Node() {}
Node(int _val)
{
val = _val;
}
Node(int _val, vector<Node *> _children)
{
val = _val;
children ... | ALGO | 0.999811 | 6.006049 | {
"github_metadata": {
"branch": "main",
"commit_count": 433,
"repo_created_at": "2021-05-08T07:07:09.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "bf096dc1c0... |
920c6a09-cdb7-408a-aa7a-0eb24147ea97 | rizkadian/Praktikum-Struktur-Data | Pertemuan 10/Postest 10.cpp | #include <iostream>
using namespace std;
class treeavl{
public:
void viewPostOrder(struct DataPohonAVL *root);
void viewInOrder(struct DataPohonAVL *root);
void viewPreOrder(struct DataPohonAVL *root);
private:
int data, height;
};
struct DataPohonAVL{
int data;
int height;
DataPohonAVL *kiri;
D... | ALGO | 0.999106 | 4.755185 | {
"github_metadata": {
"branch": "master",
"commit_count": 10,
"repo_created_at": "2022-10-02T18:47:32.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "b93dcc00a... |
bf2ea172-1388-441d-8309-b5739e425037 | chelseafandev/CodilityProblems | lesson4_countingelements/MaxCounters.cpp | /*
MaxCounters
: Calculate the values of counters after applying all alternating operations: increase counter by 1;
set value of all counters to current maximum.
You are given N counters, initially set to 0, and you have two possible operations on them:
increase(X) − counter X is increased by 1,
max counter − all co... | ALGO | 0.999824 | 5.893034 | {
"github_metadata": {
"branch": "main",
"commit_count": 20,
"repo_created_at": "2021-04-05T18:46:24.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "cabcceda40b... |
097f31a4-943c-4a7f-b5b2-04714ec620dc | antgwy/Competitive-Programming | AtCoder/abc396/F.cpp | #include <bits/stdc++.h>
using namespace std;
using ll = long long;
#define debug(x) cerr << #x << " is " << x << endl
typedef pair<int, int> pii;
const int INF = 0x3f3f3f3f;
template<typename T>
struct fenwick {
int n;
vector<T> a;
fenwick(int n_ = 0) { init(n_); }
void init(int n_) {
n = n_;... | ALGO | 0.99993 | 3.443698 | {
"github_metadata": {
"branch": "main",
"commit_count": 30,
"repo_created_at": "2023-10-17T15:58:52.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "f223950ba78... |
ae1e943f-718c-4d1e-b71f-147cdfe94ef0 | MAGISTER-PD2OR/AlienSwarmReactiveDrop | src/game/client/swarm/gameui/swarm/vfoundpublicgames.cpp | //========= Copyright © 1996-2008, Valve Corporation, All rights reserved. ============//
//
// Purpose:
//
//=====================================================================================//
#include "cbase.h"
#ifdef IS_WINDOWS_PC
#undef INVALID_HANDLE_VALUE
#include "windows.h"
#endif
#include "tier1/fmtstr.h"... | TOOL | 0.902398 | 4.46506 | {
"github_metadata": {
"branch": "master",
"commit_count": 3,
"repo_created_at": "2020-05-07T09:48:39.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2,
"forks": 3,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "e233f91022... |
129a4c84-7aa7-40f1-b518-5bd54d4b8649 | Charbel-11/Competitive-Programming | Contests/IEEEXtreme/IEEEXtreme 15.0/Training Plan.cpp | #include <iostream>
#include <string>
#include <map>
#include <set>
#include <vector>
#include <cmath>
#include <algorithm>
#include <climits>
using namespace std;
typedef long long ll;
int main() {
ios::sync_with_stdio(0);
cin.tie(0), cout.tie(0);
int t; cin >> t;
while (t--) {
int m, x, y, K; cin >> m >> x >>... | ALGO | 0.999781 | 4.058503 | {
"github_metadata": {
"branch": "master",
"commit_count": 79,
"repo_created_at": "2021-02-23T22:39:08.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "39c7d68a9... |
39dd4946-0908-4e40-b7d3-1449b4130103 | kushgupta-official/Data-Structures-and-Algorithms-Specialization- | Algorithmic Toolbox/week 6/knapsack.cpp | #include <iostream>
#include <vector>
#include <algorithm>
using namespace std;
using std::vector;
int optimal_weight(int W, const vector<int> &w) {
//write your code here
int current_weight = 0;
for (size_t i = 0; i < w.size(); ++i) {
if (current_weight + w[i] <= W) {
current_weight += w[i];
}
}... | ALGO | 0.999993 | 4.680185 | {
"github_metadata": {
"branch": "master",
"commit_count": 31,
"repo_created_at": "2020-05-09T19:50:07.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "3ab7081f5... |
4a3ea99b-e1d8-480a-8044-67432c3ebb53 | s1nisteR/CPSolutions | LeetCode/NumberOfIslands.cpp | #include <vector>
#include <iostream>
using namespace std;
class Solution
{
public:
int numIslands(vector<vector<char>>& grid)
{
m_grid = grid;
m = grid.size();
n = grid[0].size();
visited = vector<vector<bool> >(m);
for(auto& x : visited)
{
x = ... | ALGO | 0.999958 | 5.948025 | {
"github_metadata": {
"branch": "main",
"commit_count": 74,
"repo_created_at": "2021-06-23T10:17:33.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "240de8a5428... |
69fb7d42-8d59-48b6-93c2-6a447e184617 | valderyaya/Competitive-Programming | Luogu/P1308.cpp | #include<bits/stdc++.h>
using namespace std;
string a,b;
int f[1000001], cnt=0, frt = -1, n;
int main(){
getline(cin,a);
getline(cin,b);
//cin >> a >> b;
for(int i=0;i<a.size();++i) a[i]=tolower(a[i]);
for(int i=0;i<b.size();++i) b[i]=tolower(b[i]);
a = ' '+a+' ';
b = ' '+b+' ';
n = a.s... | ALGO | 0.999967 | 3.923194 | {
"github_metadata": {
"branch": "main",
"commit_count": 1839,
"repo_created_at": "2021-04-06T07:42:04.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "6da3d5b10... |
db25f492-7fda-4044-b041-3e638a8c108e | KeiShimon/AtCoder-C- | ABC043/D.cpp | #include <algorithm>
#include <cmath>
#include <deque>
#include <iostream>
#include <numeric>
#include <queue>
#include <sstream>
#include <string>
#include <string.h>
#include <tuple>
#include <vector>
#define REP(i,x) for(int i{ 0 }; i < (int)(x); i++)
#define REPC(i,x) for(int i{ 0 }; i <= (int)(x); i++)
#define RR... | ALGO | 0.999962 | 3.162692 | {
"github_metadata": {
"branch": "master",
"commit_count": 259,
"repo_created_at": "2019-03-06T05:55:57.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "8849061d... |
8de296f7-40a8-4aa4-a24a-42b361490adb | suyash045/DSA-codes | Tree/Binary Tree/4.cpp | //Write code for traversals by using iteration.
#include<iostream>
#include<queue>
using namespace std;
class Node{
public:
int data;
Node* left;
Node* right;
Node(int data){
this->data=data;
this->left=NULL;
this->right=NULL;
}
};
Node* buildBinaryTree(Node* root){
... | ALGO | 0.999953 | 4.880309 | {
"github_metadata": {
"branch": "main",
"commit_count": 1,
"repo_created_at": "2023-10-29T20:16:04.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "eb90300887e1... |
14b309bc-f76e-473a-b989-64f479ddfdeb | ishandutta2007/codeforces-m | maximumshot/normal/752/B.cpp | #include <bits/stdc++.h>
using namespace std;
#define vec vector
#define ALL(x) (x).begin(), (x).end()
typedef long long ll;
typedef pair< int, int > pii;
typedef pair< ll, ll > pll;
typedef long double ld;
int const inf = 1000 * 1000 * 1000;
ll const inf64 = 1ll * inf * inf;
int main() {
string s, t;
ci... | ALGO | 0.999973 | 3.612012 | {
"github_metadata": {
"branch": "main",
"commit_count": 1,
"repo_created_at": "2024-06-06T01:03:30.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "8f7f9e4b18b1... |
d9978c5d-6113-4fe9-a9ee-c1dd08b3ec13 | juanpa1220/AlgoritmosDeBusqueda | busquedas/main.cpp | #include <iostream>
#include "BusquedaSecuencial.cpp"
#include "BusquedaBinaria.cpp"
#include "BusquedaDeInterpolacion.cpp"
using namespace std;
int main() {
int arr[10];
int num;
// recibe 10 numeros que forman el array
cout << "Ingrese 10 numeros enteros en orden ascendente\n";
for (int i = 0;... | ALGO | 0.999423 | 4.67425 | {
"github_metadata": {
"branch": "master",
"commit_count": 2,
"repo_created_at": "2018-08-29T02:08:50.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "284df2103f... |
cab9a2c7-9872-40e4-a814-68a8815dd4a1 | Danus00/Dz-programmirovanie | дз на 09.01.2021/Задача1.cpp | #include <iostream>
#include <ctime>
#include <algorithm>
int main() {
int *arr = new int[10];
int maxEven, minNEven, index1, index2, biggestNum, amount;//не совсем корректно работает
srand(time(0));
printf("%s", "Enter the amount of numbers you want to see in your array: ");
scanf_s("%d", &amount);
printf("%s", "Ent... | ALGO | 0.988721 | 3.50854 | {
"github_metadata": {
"branch": "master",
"commit_count": 37,
"repo_created_at": "2020-09-30T17:59:33.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "a1746aa2a... |
225a9be2-738d-4f05-91b7-fe0d53672bd6 | haran2001/DSA | Llist/prob7a.cpp | //template for Llist
#include<iostream>
#include<stdio.h>
#include<stdlib.h>
#include<map>
#include<iterator>
#include<string.h>
#include<unordered_set>
#include<unordered_map>
#include<algorithm>
#include<vector>
#include<cmath>
#include<set>
using namespace std;
int min3(int a, int b, int c){
return min(a, mi... | ALGO | 0.999842 | 4.335016 | {
"github_metadata": {
"branch": "master",
"commit_count": 27,
"repo_created_at": "2021-05-14T07:26:08.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "88988fbd1... |
2b24aa62-e21f-42ef-91b0-971364f6db1b | mihainsto/FMI | Year 1 Sem 1/Doubly Linked List/DLL.cpp | #include <iostream>
struct listnode
{
int val;
listnode *next;
listnode *prev;
};
void list_front_add(listnode *&first, listnode *&last, int x)
{
listnode *aux;
aux = new listnode;
aux->next = NULL; aux->prev = NULL;
aux->val = x;
if (first == NULL) first = last = aux;
else {
aux->next = first;
first->pre... | ALGO | 0.99802 | 4.478527 | {
"github_metadata": {
"branch": "master",
"commit_count": 83,
"repo_created_at": "2018-10-26T10:14:36.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 11,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "14f09025... |
dedbf592-f24d-4b48-b130-bb67f4d07c96 | chellmuth/gpu-motunui | include/moana/cuda/fresnel.hpp | #pragma once
#include "moana/cuda/snell.hpp"
namespace moana { namespace Fresnel {
__device__ static float divide(const float a, const float b)
{
// assert(b != 0.f);
return a / b;
}
__device__ inline float dielectricReflectance(
float cosThetaIncident,
float etaIncident,
float etaTransmitted
)... | ALGO | 0.968794 | 6.201343 | {
"github_metadata": {
"branch": "master",
"commit_count": 194,
"repo_created_at": "2020-09-04T14:57:23.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 148,
"forks": 9,
"issues": 1,
"pull_requests": 0
},
"file_meta": {
"content_id": "3cdcf3... |
5b096909-e2a1-460d-a6ad-372e61bc28ee | alexandraback/datacollection | solutions_2463486_1/C++/shivamrana/fairsq.cpp | /* shivamrana */
#include <cassert>
#include <cctype>
#include <cmath>
#include <cstring>
#include <cstdio>
#include <cstdlib>
#include <ctime>
#include <set>
#include <map>
#include <vector>
#include <queue>
#include <list>
#include <deque>
#include <stack>
#include <iterator>
#include <string>
#include <sstream>
#inc... | ALGO | 0.999814 | 3.978485 | {
"github_metadata": {
"branch": "master",
"commit_count": 58,
"repo_created_at": "2017-03-08T11:33:58.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 4,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "599903e0e... |
18abf5f4-d2bf-44f0-95e5-f9e21ed504eb | WishQi/CodeHome | cpp/152. Maximum Product Subarray.cpp | //
// main.cpp
// 152. Maximum Product Subarray
//
// Created by <NAME> on 2019/7/15.
// Copyright © 2019 <NAME>. All rights reserved.
//
#include <iostream>
#include <vector>
#include <stack>
using namespace std;
class Solution {
public:
int maxProduct(vector<int>& nums) {
if (nums.empty()) return ... | ALGO | 0.999713 | 6.010962 | {
"github_metadata": {
"branch": "master",
"commit_count": 95,
"repo_created_at": "2017-08-22T10:27:09.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "d8b0b4e95... |
26b05ed3-3979-45b2-837c-e903a75fc609 | Noodle3D/ZCookie | algorithm/POJ/POJ2967 Triangles.cpp | #include <cstdio>
#include <cstring>
#include <algorithm>
using namespace std;
const int MAXN = 1000005;
int n, a[MAXN];
int readInteger()
{
int res = 0;
char ch = getchar();
while(ch >= '0' && ch <= '9')
{
res = res * 10 + ch - '0';
ch = getchar();
}
return res;
}
bool judge(... | ALGO | 0.999949 | 4.660337 | {
"github_metadata": {
"branch": "master",
"commit_count": 17,
"repo_created_at": "2013-05-17T09:57:17.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 17,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "dd69929f... |
7b05ef90-738c-4b3a-b2b8-94f728bb7525 | vikashkumarjha/missionpeace | lc/lc/2021_target/top100/lc_42_trapping_rain_water.cpp | #include "../header.hpp"
class Solution {
public:
int trap(vector<int>& h) {
if (h.size() < 2) return 0;
int water= 0;
int n = h.size();
vector<int> leftMax(n,0);
vector<int> rightMax(n,0);
leftMax[0] = h[0];
for ( int i = 1; i < n; i++) {
leftMa... | ALGO | 0.999988 | 6.291949 | {
"github_metadata": {
"branch": "master",
"commit_count": 99,
"repo_created_at": "2020-02-19T22:59:36.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "eccd6f1b8... |
7b84d3e5-08d5-41a6-b151-0cd8c059c1eb | chandan-ojha/xpsc-problem-solving | week-02/day-07/C_Traffic_Light.cpp | // Problem link: https://codeforces.com/problemset/problem/1744/C
#include <bits/stdc++.h>
#define ll long long int
using namespace std;
int main()
{
ios::sync_with_stdio(false);
cin.tie(nullptr);
int t;
cin >> t;
while (t--)
{
ll n;
cin >> n;
char ch;
string str... | ALGO | 0.999594 | 3.809994 | {
"github_metadata": {
"branch": "main",
"commit_count": 93,
"repo_created_at": "2024-10-26T15:14:33.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "35661a71f67... |
411d699b-b098-49fc-87a3-f218e210cc6a | LexLoki/stone-maze-challenge | stone-automata - c2.cpp | #include <iostream>
#include <cmath>
#include <vector>
#include <stack>
#include <fstream>
#include <chrono>
#include <bitset>
using namespace std;
using namespace std::chrono;
#define ROW_SIZE 2000 // Number of rows in grid
#define COL_SIZE 2000 // Number of columns in grid
#define TOT_SIZE 4000000 // ... | ALGO | 0.999852 | 4.246863 | {
"github_metadata": {
"branch": "main",
"commit_count": 3,
"repo_created_at": "2023-04-11T22:34:57.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 8,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "2b744a0e8e27... |
f5d63626-b06b-4cff-a373-581134c37dd0 | Aakarsh102/leetcode | leetcode/countgoodnodesinbintree.cpp | // Definition of 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), left(left), right(right) {... | ALGO | 0.99971 | 6.292436 | {
"github_metadata": {
"branch": "main",
"commit_count": 153,
"repo_created_at": "2024-12-18T07:10:54.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "90c24f2b1a... |
de677b65-0ffd-4757-aac8-40f40a2c9777 | PlenkinAv/LeetCode | 623. Add One Row to Tree.cpp | //https://leetcode.com/problems/add-one-row-to-tree/
/**
* 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* addOneRow(TreeNode* root, int v... | ALGO | 0.999955 | 6.560351 | {
"github_metadata": {
"branch": "master",
"commit_count": 32,
"repo_created_at": "2019-09-02T16:47:54.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "07cfc1849... |
93617f13-8784-4456-a8b6-54fa54e41834 | babayaga-13/Competitive-Programming | CODEFORCES/div.2/C_Differential_Sorting.cpp | #include <bits/stdc++.h>
#define ll long long
#define endl "\n"
#define yes cout << "YES" << endl
#define no cout << "NO" << endl
#define ln cout << endl
#define all(v) v.begin(), v.end()
#define rall(v) v.rbegin(), v.rend()
#define count_one(x) __builtin_popcount(x)
#define trailing_zero(x) __builtin_ctz(x)
#define le... | ALGO | 0.999492 | 3.925527 | {
"github_metadata": {
"branch": "main",
"commit_count": 207,
"repo_created_at": "2024-09-13T09:17:53.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "911c211d2e... |
8360e14a-8166-4983-9647-3b1753f5af69 | Anand-Maurya542/Data_Structures | binarySearch.cpp | // C++ program to implement recursive Binary Search
#include <bits/stdc++.h>
using namespace std;
// A recursive binary search function. It returns
// location of x in given array arr[l..r] is present,
// otherwise -1
int binarySearch(int arr[], int l, int r, int x)
{
if (r >= l) {
int mid = l + (r - l) / 2;
// ... | ALGO | 0.999991 | 5.812564 | {
"github_metadata": {
"branch": "main",
"commit_count": 8,
"repo_created_at": "2022-09-09T05:01:35.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "b9ac0259055b... |
3f0c9c46-2e33-4330-bc26-ec369683e71d | gerecorrea/CAL_Complexidade-de-Algoritmos | ativ10_PQ_with_crivo.cpp | #include <iostream>
#include <cmath>
#include <algorithm>
#include <list>
using namespace std;
long long int limite = 500000;
list <int> crivo;
bool v[500000]={false};
void fazCrivo();
void addList();
int achaPQ(int n);
//MAIN
int main() {
int n = 412224749; //resultado de 19073 * 21613, ambos primos.
fazCriv... | ALGO | 0.999742 | 3.970489 | {
"github_metadata": {
"branch": "main",
"commit_count": 2,
"repo_created_at": "2020-11-19T19:47:15.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "85a32c4c6edd... |
5b0efa7d-e353-454e-a8a6-cfca9a2723c2 | surya-prakash-susarla/My-Solutions | 2024/regular_expression_matching.cpp | #include <algorithm>
#include <cmath>
#include <cstdio>
#include <iostream>
#include <limits>
#include <list>
#include <map>
#include <numeric>
#include <queue>
#include <set>
#include <stack>
#include <string>
#include <unordered_map>
#include <utility>
#include <vector>
typedef long long int llint;
typedef long long... | ALGO | 0.999958 | 4.455878 | {
"github_metadata": {
"branch": "main",
"commit_count": 1096,
"repo_created_at": "2018-11-28T13:59:20.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "5556b561c... |
be428fa7-f239-4780-9057-28840d94cdd8 | face4/yukicoder | Level2_5/0663.cpp | #include<iostream>
#include<vector>
#include<cstring>
using namespace std;
int automaton(int i, int j, int k){
if(j+k == 0 || i+j+k == 3) return 0;
return 1;
}
const int mod = 1000000007;
int dp[2000][2][2];
typedef long long ll;
int main(){
int n;
cin >> n;
vector<int> v(n);
for(int i = 0; ... | ALGO | 0.999996 | 3.906156 | {
"github_metadata": {
"branch": "master",
"commit_count": 102,
"repo_created_at": "2018-04-19T11:55:12.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "10760b86... |
39c80780-a219-44e5-baeb-47f0625105ef | dstbstr/AdventOfCode | AdventOfCode/src/2018/d12_Plants.cpp | #include "Common.h"
SOLUTION(2018, 12) {
using Rules = Constexpr::SmallMap<std::string, char>;
static const std::string Prefix = "......"s;
static const size_t PrefixSize = Prefix.size();
constexpr Rules ParseRules(const std::vector<std::string>&lines) {
Rules rules;
for (const auto& l... | ALGO | 0.99978 | 5.914511 | {
"github_metadata": {
"branch": "main",
"commit_count": 51,
"repo_created_at": "2024-10-10T23:08:44.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "7bdaa5a3607... |
1441377b-632b-4b00-a2bc-69b6be84e137 | arangodb/arangodb | 3rdParty/boost/1.78.0/boost/ptr_container/ptr_set_adapter.hpp | //
// Boost.Pointer Container
//
// Copyright <NAME> 2003-2005. Use, modification and
// distribution is subject to the Boost Software License, Version
// 1.0. (See accompanying file LICENSE_1_0.txt or copy at
// http://www.boost.org/LICENSE_1_0.txt)
//
// For more information, see http://www.boost.org/libs/ptr_con... | TOOL | 0.90162 | 7.418471 | {
"github_metadata": {
"branch": "devel",
"commit_count": 51986,
"repo_created_at": "2011-10-26T06:42:00.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 13878,
"forks": 857,
"issues": 743,
"pull_requests": 38
},
"file_meta": {
"content_id": ... |
ffabb552-1f17-4e55-8c5a-bb51f4d398b7 | KimYeongRok/SummerVacation | CPP03/main.cpp | #include <iostream>
int change_val(int* p) {
*p = 3;
return 0;
}
int change_val(int& p) {
p = 3;
return 0;
}
int& func(int& a) {
a = 5;
return a;
}
int func() {
int a = 5;
return a;
}
int main() {
{
/*int number = 5;
std::cout << number << std::endl;
change_val(&number);
std::cout << number << s... | ALGO | 0.954203 | 3.25994 | {
"github_metadata": {
"branch": "main",
"commit_count": 10,
"repo_created_at": "2024-06-26T09:09:46.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "5597f92557c... |
5d6f62c5-eda8-4be8-8c28-ac0e565e50f5 | pvy-it-tdh/LeThachPhucVy_Cpp | Chapter7/challenge2.cpp | #include<iostream>
using namespace std;
int main()
{
const int SIZE=12;
double mua[SIZE];
for (int i =0 ;i<12;i++)
{
cout << "Nhap luong mua cua thang "<< i+1 ;
cin >> mua[i];
cout << endl;
while (mua[i]<0)
{
cin >> mua[i];
}
}
double ... | ALGO | 0.999327 | 3.277489 | {
"github_metadata": {
"branch": "master",
"commit_count": 16,
"repo_created_at": "2023-10-02T13:51:11.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "aba0f17f5... |
86466354-1567-40e1-8405-782f98e29613 | pratybos/structured-programming-project-soufiane | Assignment_6/Pointer-based Linked List Operations.cpp | #include <iostream>
using namespace std;
struct Node {
int data;
Node* next;
};
// Function to insert a new node at the end of the linked list
void insertNode(Node*& head, int value) {
Node* newNode = new Node();
newNode->data = value;
newNode->next = nullptr;
if (head == nullptr) {
h... | ALGO | 0.999933 | 6.135038 | {
"github_metadata": {
"branch": "main",
"commit_count": 43,
"repo_created_at": "2024-10-28T18:09:15.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 1
},
"file_meta": {
"content_id": "f44d6f9f22c5... |
34b08d2c-d89e-48e3-a406-67d6f6c551e3 | furkan-kadioglu/Multithreading-Flight-Reservation-Simulation | main.cpp | #include <iostream>
#include "Process.h"
#include "ReadyQueue.h"
#include <fstream>
#include <vector>
using namespace std;
// prints ready queue at given time
void print(ofstream &out,vector<Process> readyQ,int _time)
{
out <<_time<<":";
out<<"HEAD-";
if(readyQ.size()!=0)
{
... | ALGO | 0.998333 | 4.271374 | {
"github_metadata": {
"branch": "master",
"commit_count": 4,
"repo_created_at": "2019-11-06T17:19:17.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "91d914a6d4... |
c2d4c5d0-26c9-4fd0-975f-4c5d9606779e | hrjacobs/FYS3150 | Project2/Code/eigenvalues.cpp |
#include "eigenvalues.hpp"
#include <iostream>
#include <fstream>
#include "time.h"
#define TRUE 1
#define FALSE 0
void eigenvalues::solve(double tolerance, int maxiter){
offdiag();
Jacobi_rotate();
int iterations = 1;
while (m_max > tolerance && iterations <= maxiter){
offdiag();
Jacobi_rotate();
iterations++;... | ALGO | 0.999938 | 4.441382 | {
"github_metadata": {
"branch": "master",
"commit_count": 3,
"repo_created_at": "2020-08-23T08:27:07.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "78fc3c4d72... |
bff184c2-f5ea-4d8a-9e71-7fae76e643b8 | NathanWine/2048-AI-Solvers | src/MonteCarlo.cpp | #include "MonteCarlo.hpp"
/**
* From a given game state, chooses random moves until the game is completed.
* @return (int FIRST_MOVE, int FINAL_SCORE)
*/
std::pair<int, int> simulateOneRun(Game game) {
Game game_cpy = game;
int first_move = -1;
while(game_cpy.canContinue()) {
board before_state ... | ALGO | 0.999732 | 5.40567 | {
"github_metadata": {
"branch": "master",
"commit_count": 36,
"repo_created_at": "2021-05-22T19:54:03.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 4,
"forks": 2,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "7cea370b4... |
027d2eb5-56b3-44b4-9735-459c80d9801a | usdot-fhwa-stol/carma-platform | arbitrator/src/cost_system_cost_function.cpp | /*
* Copyright (C) 2022 LEIDOS.
*
* Licensed under the Apache License, Version 2.0 (the "License"); you may not
* use this file except in compliance with the License. You may obtain a copy of
* the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in w... | ALGO | 0.937021 | 6.846554 | {
"github_metadata": {
"branch": "develop",
"commit_count": 7903,
"repo_created_at": "2018-10-22T21:27:52.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 416,
"forks": 125,
"issues": 262,
"pull_requests": 8
},
"file_meta": {
"content_id": "f... |
27e4c09f-26c1-4ab7-ba8b-2d28f1d6d134 | BritoAlv/cs | competitive_programming/R900/FillMatrix.cpp | // Problem: C. Fill in the Matrix
// Contest: Codeforces - Codeforces Round 896 (Div. 2)
// URL: https://codeforces.com/contest/1869/problem/C
// Memory Limit: 256 MB
// Time Limit: 2000 ms
// Math Proof: notice that in almost all cases answer is
// min(m ,n+1), to do so print the permutation ith shift to
// the right,... | ALGO | 0.999987 | 4.598722 | {
"github_metadata": {
"branch": "main",
"commit_count": 202,
"repo_created_at": "2022-06-16T15:43:00.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "1b65403037... |
26658b2e-b9e0-46f0-80ad-5b1c71de67ae | nabilahputria/NabilahPutriAyli-AP_2 | PERTEMUAN 3/latihan.cpp | #include <iostream>
using namespace std; //Namespace std digunakan untuk menghindari penulisan std:: sebelum setiap fungsi dari library standar
int main() {
int angka;
cout << "Masukkan sebuah bilangan bulat: "; //Berfungsi untuk meminta input dari pengguna
cin >> angka;
if (angka % 10 == 0) { //Ji... | ALGO | 0.994829 | 4.457362 | {
"github_metadata": {
"branch": "main",
"commit_count": 8,
"repo_created_at": "2025-05-25T14:44:48.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "43109d790040... |
0dd143ac-b286-43d2-9bf1-96c091ae3315 | leotms/IA-I | global/stateCount.cpp | #include <vector>
// Uses Iterative Deepening Depth First search
// To count the number of states in a given problem.
// Also computes the branching factor if needed.
// Calculates the total of possible states
unsigned long long int findTotalPossibleStates(int longitud){
return (longitud == 1 || longitud == 0) ? 1 ... | ALGO | 0.99971 | 4.820595 | {
"github_metadata": {
"branch": "master",
"commit_count": 61,
"repo_created_at": "2016-10-12T21:41:17.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "51ae9b71f... |
1673d57e-f0d0-4101-a982-fbd0ee0bc059 | anavhinojosa/OS | main.cpp | #include <iostream>
#include "ProcessManager.h"
#include "CPUInstructions.h"
#include "Translation.h"
#include "Booting.h"
#include "MMU.h"
#include "SystemMemory.h"
#include "SystemStorage.h"
using namespace std;
// Define global variables
list<Process> listProcesses; // List of processes for scheduling
qu... | TOOL | 0.986716 | 4.325398 | {
"github_metadata": {
"branch": "main",
"commit_count": 49,
"repo_created_at": "2024-09-16T15:57:34.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "924d6fac8c8... |
a94160ee-3c28-45b4-99ad-fb6ce5504ea1 | omar-besbes/competitive-programming | solutions/Codeforces/Hello 2022/A.cpp | #include <bits/stdc++.h>
using namespace std;
int main() {
// ios::sync_with_stdio(false);
// cin.tie(nullptr);
// cout.tie(nullptr);
// freopen("name.in", "r", stdin);
// freopen("input.txt", "r", stdin);
// freopen("output.txt", "w+", stdout);
int t;
cin >> t;
while (t-... | ALGO | 0.999576 | 3.5464 | {
"github_metadata": {
"branch": "main",
"commit_count": 109,
"repo_created_at": "2022-04-17T20:52:40.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 5,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "72ba98bc88... |
11026ccb-8a34-48f5-8a96-3e056d60746f | apache/tvm | src/support/parallel_for.cc | /*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you ... | ALGO | 0.998502 | 7.133505 | {
"github_metadata": {
"branch": "main",
"commit_count": 13125,
"repo_created_at": "2016-10-12T22:20:28.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 12452,
"forks": 3621,
"issues": 89,
"pull_requests": 49
},
"file_meta": {
"content_id": "... |
0e8846a6-bb67-483a-90fd-384c6f8d31ad | hvdieu/mycode | Cpp/find-maximum-index-product.cpp | #include <bits/stdc++.h>
using namespace std;
typedef pair<int, int> ii;
typedef pair<long long, int> lli;
typedef long long ll;
typedef unsigned long long ull;
#define For(i,a,b) for(int i=a;i<=b;i++)
#define Rep(i,a,b) for(int i=a;i>=b;i--)
#define fi first
#define se second
#define pb push_back
#define sz(s) int(s... | ALGO | 0.99991 | 3.734602 | {
"github_metadata": {
"branch": "master",
"commit_count": 4,
"repo_created_at": "2017-04-23T16:30:40.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "3bf8074986... |
4870a921-7ed8-4667-932f-c40277ba20f0 | jk983294/hpc | example/openmp/sections_omp.cpp | #include <omp.h>
#include <algorithm>
#include <iostream>
#include <numeric>
#include <vector>
using namespace std;
double x{1.1}, y{2.2}, z{3.3};
void calc_x() { x *= 2; }
void calc_y() { y *= 2; }
void calc_z() { z *= 2; }
int main() {
omp_set_num_threads(4);
cout << x << ' ' << y << ' ' << z << ' ' << en... | ALGO | 0.999671 | 3.983339 | {
"github_metadata": {
"branch": "master",
"commit_count": 16,
"repo_created_at": "2018-06-22T13:12:32.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "76e75a702... |
d18e3f76-2fd5-4784-90f5-2e66689cb100 | Jinsab/start | sort.cpp | #include <iostream>
using namespace std;
void quicksort(int low, int high, int s[]);
void partition(int low, int high, int& pivotpoint, int s[]);
int main()
{
int s[1000]={0};
int low, high;
int i, n; cout << ""
< endl; cin >> n; while(n<0 || n>1000)
{ // 적당한 값이 나올때 까지 반복
cout << "재입력"<<endl; cin >> n;
}
for... | ALGO | 0.999909 | 4.615808 | {
"github_metadata": {
"branch": "master",
"commit_count": 6,
"repo_created_at": "2018-06-07T10:11:56.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "ed5c897e95... |
dee97c8c-871b-4494-a7df-01b0b0a224d8 | E-Tsubo/RGBDObjectRecognition | kerneldesc.cpp | #include "kerneldesc.h"
using namespace MatIO;
KernelDescManager::KernelDescManager()
{
}
KernelDescManager::~KernelDescManager()
{
}
//bool KernelDescManager::Process(PBM* pbm, IplImage* rgb, IplImage* dep, MatrixXf& top_left)
//{
//}
void KernelDescManager::GKDESDense(MatrixXf& feaArr, MatrixXf& feaMag, Matrix... | ALGO | 0.991628 | 3.979861 | {
"github_metadata": {
"branch": "master",
"commit_count": 29,
"repo_created_at": "2017-07-30T05:28:34.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "c7403ce83... |
f9b20435-26e1-46db-8c87-1e2e97b4a456 | ankur-357/GFG-solution | Easy/Find minimum adjustment cost of an array/find-minimum-adjustment-cost-of-an-array.cpp | //{ Driver Code Starts
#include <bits/stdc++.h>
using namespace std;
// } Driver Code Ends
class Solution{
public:
int minAdjustmentCost(int A[], int n, int target)
{
// Your code goes here
int M= 100;
int dp[n][M + 1];
// handle first element of array separately
for (int j = 0; j <= M; ... | ALGO | 0.999916 | 5.49697 | {
"github_metadata": {
"branch": "main",
"commit_count": 579,
"repo_created_at": "2023-07-17T04:13:37.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "39e0208fe3... |
15331c20-497c-4809-acaa-25d050b0888a | sansriti14/Leetcode | 2304-minimum-path-cost-in-a-grid/2304-minimum-path-cost-in-a-grid.cpp | class Solution {
private:
int findMinCost(int curr_row, int curr_col, vector<vector<int>>& grid, vector<vector<int>>& moveCost, vector<vector<int>>& dp) {
int m = grid.size();
int n = grid[0].size();
if(curr_row == m - 1) {
return grid[curr_row][curr_col];
}
... | ALGO | 0.9999 | 5.968457 | {
"github_metadata": {
"branch": "main",
"commit_count": 2249,
"repo_created_at": "2023-10-31T20:16:21.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "f8005987f... |
c10f8304-1ca0-4e93-91f9-0e3533a0dfde | amsraman/Competitive_Programming | USACO/Contests/Gold/2019-2020/Contest 1/gold19dec2.cpp | #include <bits/stdc++.h>
#define f first
#define s second
using namespace std;
int n, m, t[100000], x, y, a[100000], b[100000], c[100000], depth[100000], ct;
pair<int,int> range[100000];
vector<int> g[100000], st, lst[100000], tst[100000];
bool ans[100000];
bool anc(int u, int v)
{
return ((range[u].f<=range[v].... | ALGO | 0.999972 | 4.181217 | {
"github_metadata": {
"branch": "master",
"commit_count": 413,
"repo_created_at": "2019-03-04T14:45:05.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 7,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "a8312fac... |
5e387e2a-f997-4322-9938-dab69ed7e76a | DonghoonPark12/problem_solving | Problem_Solving/SWEA/sw_1798.cpp | #include <iostream>
#include <vector>
#include <stack>
using namespace std;
int n, m
//void get_input() {
// cin >> n >> m;
// for (int i = 1; i <= n; i++) {
// for (int j = 1+i; j <= n; j++) {
// if (i != j) {
// int tmp; cin >> tmp;
// time[i][j] = tmp;
// time[j][i] = tmp;
// }
// }
// }
// char loc;... | ALGO | 0.999743 | 3.686835 | {
"github_metadata": {
"branch": "master",
"commit_count": 141,
"repo_created_at": "2019-05-13T04:00:59.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "b72ecae5... |
2920e124-98b1-407f-89c6-3c70701db703 | Ligvest/Coursera._Art_of_modern_cpp_programming | 3_RedBelt/Week 5/Multithread/sum.cpp | #include <future>
#include <list>
#include <vector>
#include "test_runner.h"
using namespace std;
template <typename Iterator>
class IteratorRange {
public:
IteratorRange(Iterator begin, Iterator end)
: begin_(begin), end_(end), size_(std::distance(begin_, end_)) {}
Iterator begin() { return begin_... | ALGO | 0.998043 | 5.896114 | {
"github_metadata": {
"branch": "master",
"commit_count": 12,
"repo_created_at": "2018-11-06T07:15:40.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "dd757f7c8... |
1b044fe0-78e6-430f-90f1-914042c709e2 | LeStefanPetrov/C-University | Dynamic Structures Task 5.cpp | #include<iostream>
using namespace std;
void add_b(int n);
int del_b(int &n);
void list();
void repeat();
struct elem{
int key;
elem *next;
}*start = NULL;
void main(){
int ch, num;
do{
cout << "\n MENU\n";
cout << "1 - Add the element\n";
cout << "2 - Del the element\n";
cout << "3 - Show the list\n";
... | ALGO | 0.99953 | 3.360456 | {
"github_metadata": {
"branch": "master",
"commit_count": 1,
"repo_created_at": "2021-01-17T15:21:53.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "37e98f183c... |
c614608c-11da-4bf5-8064-be0233abe80d | lukaszWroc/MIA-on-UWR | MIA/2018-2019/TheGameOfParity.cpp | #include<iostream>
using namespace std;
int main()
{
int n,k,a,even=0,odd=0,lastmove=-1;
cin >> n >> k;
for(int i=0;i<n;i++)
{
cin >> a;
if(a%2 == 0)
even++;
else
odd++;
}
if(n == k)
{
if(odd%2 == 0)
cout << "Daenerys";
... | ALGO | 0.999991 | 3.492281 | {
"github_metadata": {
"branch": "master",
"commit_count": 4,
"repo_created_at": "2019-01-25T22:27:03.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "1b1f56c017... |
8d8d4333-c7e1-4620-ba1b-c470b0d28164 | efeslab/ada-portathon | CortexSuite/vision/common/toolbox/lagrcv/calcOptFlowLKPyrWInitSobelMex.cc |
/* compile with
rm liblagrcv.a
gcc -c lagrcv.cpp
ar rc liblagrcv.a lagrcv.o
ranlib liblagrcv.a
mex7 calcTextureMex.cc -L/home/ikkjin/LagrMatlab/opencv/matlab -llagrcv -I/home/ikkjin/LagrMatlab/opencv/matlab/
*/
#include "mex.h"
#include "lagrcv.h"
#include <stdio.h>
#include <math.h>
#ifndef MAX_LEVEL
# define MAX_... | ALGO | 0.990406 | 4.915046 | {
"github_metadata": {
"branch": "master",
"commit_count": 31,
"repo_created_at": "2018-03-01T20:36:43.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 4,
"forks": 3,
"issues": 0,
"pull_requests": 2
},
"file_meta": {
"content_id": "12ff28be3f... |
507a34ef-9d3f-411a-a4a2-2b88990bc44b | zaidtech786/c-Placement-Series | Arrays/Easy/FindUnique.cpp | #include <iostream>
#include <unordered_set>
#include <map>
#include <set>
using namespace std;
int findUniqueNo(int arr[], int n){
// If there is only one unique element
int ans = 0;
for (int i = 0; i < n; i++)
{
ans = ans ^ arr[i];
}
return ans;
// If unique element more than 1
map<... | ALGO | 0.998468 | 4.278985 | {
"github_metadata": {
"branch": "master",
"commit_count": 4,
"repo_created_at": "2023-09-20T14:24:04.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "886ffd7415... |
276b60c7-0e27-4efe-bc0a-eb282c61c169 | OmerRosler/fractal_plotter | dfs_bandt_algorithm.ixx | export module frc.algorithms:bandt_base;
import std;
export import :base;
namespace frc
{
export template<typename Derived, typename T, std::size_t N>
class dfs_bandt_algorithm_functor
{
protected:
std::pmr::memory_resource* memory;
public:
using dfs_iterator = recursive_tree_dfs_iterator<T, N>;
using value... | ALGO | 0.999939 | 6.470918 | {
"github_metadata": {
"branch": "main",
"commit_count": 47,
"repo_created_at": "2022-05-01T13:43:18.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 8,
"pull_requests": 0
},
"file_meta": {
"content_id": "b4f20d2be75... |
2764cb0f-6dc5-4383-bf4f-93086754ba71 | DangerousCactus/Kattis | bobby.cpp | #include <bits/stdc++.h>
using namespace std;
#define rep(i, a, b) for (int i = a; i < (b); ++i)
#define all(x) begin(x), end(x)
#define sz(x) (int)(x).size()
typedef long long ll;
typedef pair<int, int> pii;
typedef vector<int> vi;
int main() {
cin.tie(0)->sync_with_stdio(0);
auto fact = [](int x) {
int ... | ALGO | 0.999456 | 4.244137 | {
"github_metadata": {
"branch": "master",
"commit_count": 82,
"repo_created_at": "2021-02-15T09:13:39.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "64000fbac... |
e68fece3-3512-4e02-af46-0d924799221c | Leodicap99/Graphs- | BFS/Some interesting shortest path questions.cpp | Note: Time Complixity of BFS = O(V+E)
Question 1: Given a directed weighted graph. You are also given the shortest path from a source vertex ‘s’ to a destination vertex ‘t’. If weight of every edge is increased by 10 units, does the shortest path remain same in the modified graph?
Ans) The shortest path may change. T... | TEST | 0.994082 | 4.858097 | {
"github_metadata": {
"branch": "master",
"commit_count": 32,
"repo_created_at": "2020-05-18T10:40:55.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "c5a51d5e8... |
a161ff9d-f4a6-4265-98b2-e0c406a10767 | Yawn-Sean/Daily_CF_Problems | daily_problems/2024/07/0716/personal_submission/cf442b_WanderOvO.cpp | /*
由于要求恰好有一个人做出来,所以人选多了未必会更优
通过打表,假如存在 >= 0.5 的,就是单独选最大的,都 < 0.5,似乎是选最大的几个,至于具体选几个需要枚举一下
*/
int T;
double a[N];
int n;
void solve1() {
cin >> n;
for (int i = 1; i <= n; i++) {
cin >> a[i];;
}
sort(a + 1, a + n + 1);
reverse(a + 1, a + n + 1);
double res = 0;
for (int cnt = 1; cnt <... | ALGO | 0.999927 | 3.995299 | {
"github_metadata": {
"branch": "main",
"commit_count": 20410,
"repo_created_at": "2024-02-26T01:04:08.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 478,
"forks": 302,
"issues": 0,
"pull_requests": 7
},
"file_meta": {
"content_id": "f689... |
8e8d5034-a79a-4981-ae90-402c89cab13c | abrahimladha/tex-summer-writeup | basic.cpp | #include <string>
#include <gmpxx.h>
#include <gmp.h>
#include <math.h>
#include <iostream>
#include <vector>
using namespace std;
/*
* returns a vector of all bitstrings up to a
* certain length
*/
vector<string> bitstring_generator(unsigned long n){
vector<string> bitstrings(pow(2,n));
bitstrings.push_back(... | ALGO | 0.999867 | 4.17264 | {
"github_metadata": {
"branch": "master",
"commit_count": 11,
"repo_created_at": "2016-08-24T03:10:45.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "cbe5df776... |
5207880b-ba38-4120-8cca-0c94442b4be1 | jakubdrobny/USACO | 2015_2016/jan/bronze/moving_the_field.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;
template<typename T> using ordered_set = tree<T, null_type, less<T>, rb_tree_tag, tree_order_statistics_node_update>;
template<typename T> void ckmin(T &a, T b) { if... | ALGO | 0.999933 | 4.020825 | {
"github_metadata": {
"branch": "master",
"commit_count": 7,
"repo_created_at": "2021-08-10T10:50:50.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "960523bea5... |
95467ce8-65e6-470d-86bd-37dcbff24ffe | danyanyam/cpp_basics | lessons/tuples_and_pairs/tuple2.cpp | #include <iostream>
#include <string>
#include <tuple>
#include <vector>
using namespace std;
tuple<string, int> check_existence(const vector<string>& v, string city) {
if (count_if(v.begin(), v.end(), [city](auto i) {return i == city;})) {
return make_tuple(city, 1);
} else {
return make_tupl... | ALGO | 0.981286 | 4.158017 | {
"github_metadata": {
"branch": "main",
"commit_count": 10,
"repo_created_at": "2021-08-19T06:38:27.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "4321fdfc7b4... |
6dcb1a3a-7ae6-43fc-b362-6823aea11a3f | Traverso/QuadrupedRobot | Felix/leg.ino | /**
* legSetup
* Initialize legs and servos
*/
void legSetup()
{
pwm.begin();
pwm.setPWMFreq(60);
for(int i = 0; i < LEGS_COUNT; i++)
{
leg lg;
lg.idx = i;
LEGS[i] = lg;
}
}
/**
* homePosition
* Move legs to default "ready" position
*/
void homePosition()
{
for(int i = 0; i < LEGS_CO... | TOOL | 0.994486 | 4.015365 | {
"github_metadata": {
"branch": "master",
"commit_count": 6,
"repo_created_at": "2016-11-03T09:29:04.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 9,
"forks": 3,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "895ad7bfc1... |
a0d3ee0d-e516-4fb0-b9b7-59aa0123f7d4 | GuillermoSego/MCC_1Sem | PA/Tarea02pp/Segura_Guillermo_Tarea2pp/P8_Dij.cpp |
# include <iostream>
# include <vector>
# include <limits>
# include <set>
const int INF = std::numeric_limits<int>::max();
int encontrarMinimoDistancia(const std::vector<int>& dist, const std::set<int>& visitados) {
int minimo = INF, indiceMinimo;
for (int v = 0; v < dist.size(); v++) {
if (... | ALGO | 0.999672 | 5.462279 | {
"github_metadata": {
"branch": "main",
"commit_count": 7,
"repo_created_at": "2023-11-25T18:18:59.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "5833e583c736... |
8bdfec4b-64d7-42f1-8e22-ca9ec73420de | gityug/code-samples | samples/c++/interleaving-string.cc | // https://leetcode.com/problems/interleaving-string/
// Given s1, s2, s3, find whether s3 is formed by the interleaving of s1 and s2.
//
// For example,
// Given:
// s1 = "aabcc",
// s2 = "dbbca",
//
// When s3 = "aadbbcbcac", return true.
// When s3 = "aadbbbaccc", return false.
class Solution {
public:
// Back... | ALGO | 0.985283 | 6.579548 | {
"github_metadata": {
"branch": "master",
"commit_count": 61,
"repo_created_at": "2016-04-19T02:02:54.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "0c3534fdc... |
938108f0-8638-406c-a8b5-34cf97686952 | rkonow/topk-final | src/test_wt.cpp | #include <algorithm>
#include <iostream>
#include <WaveletTreeRMQ.h>
#include <Sequence.h>
#include <Mapper.h>
#include <BitSequenceRG.h>
#include <BitString.h>
#include "rmq.cpp"
using namespace cds_utils;
using namespace cds_static;
//using namespace std;
class mycomparison
{
bool reverse;
public:
mycomparison(... | ALGO | 0.999268 | 3.645073 | {
"github_metadata": {
"branch": "master",
"commit_count": 39,
"repo_created_at": "2012-10-03T18:52:26.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "0026aca76... |
068a4c56-cbe4-4041-922a-a6844165a7a1 | Mu-L/TracerInteractiveUE4Plugins | Engine/Plugins/Experimental/GeometryProcessing/Source/DynamicMesh/Private/Sampling/MeshOcclusionMapBaker.cpp | // Copyright Epic Games, Inc. All Rights Reserved.
#include "Sampling/MeshOcclusionMapBaker.h"
#include "Sampling/SphericalFibonacci.h"
#include "Sampling/Gaussians.h"
#include "Math/RandomStream.h"
void FMeshOcclusionMapBaker::Bake()
{
const FMeshImageBakingCache* BakeCache = GetCache();
check(BakeCache);
const... | ALGO | 0.985668 | 6.776913 | {
"github_metadata": {
"branch": "master",
"commit_count": 41,
"repo_created_at": "2020-03-24T02:30:04.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 16,
"forks": 11,
"issues": 1,
"pull_requests": 1
},
"file_meta": {
"content_id": "0476529... |
57b2b0c7-b41f-4c25-a46b-61aa0eb8ad09 | codesniper99/LeetCode | Kmeans/main.cpp | #include<bits/stdc++.h>
#define ll long long int
using namespace std;
ll euclid(pair<ll,ll>a,pair<ll,ll>b)
{
return sqrt(pow(a.first-b.first,2)+pow(a.second-b.second,2));
}
int main()
{
ll n;
cin>>n;
vector<pair<ll,ll> >a(n);
a.clear();
for(ll i=0;i<n;i++)... | ALGO | 0.999984 | 3.964182 | {
"github_metadata": {
"branch": "master",
"commit_count": 5,
"repo_created_at": "2020-01-28T18:37:14.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "21c4d37567... |
2f6b0ab8-743e-4ca0-8c70-f6f29ec00d12 | hasipon/DiamondPrincess2015 | sim.cpp | #include <iostream>
#include <fstream>
#include <vector>
#include <string>
#include <complex>
#include <set>
#include <map>
#include <queue>
#include "picojson.h"
#include "common.hpp"
using namespace std;
#include "sim.hpp"
struct Solver : public BaseSolver {
Solver(const GameConfig& config, int seed) : BaseSolver... | ALGO | 0.998151 | 4.648442 | {
"github_metadata": {
"branch": "master",
"commit_count": 3,
"repo_created_at": "2015-08-10T12:01:27.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "2395374c40... |
d671eb2f-e4b8-4cdb-a5d2-b5d072a1b158 | sixis2010/Practice | hdu1003.hpp | #include <stdio.h>
#include <stdlib.h>
#include <limits.h>
#define MAXN 100001
int s[MAXN];
int a[MAXN];
int nCase;
int nNum;
//O(N)
void calc(const int &idx,const int &len)
{
int max_sum = INT_MIN;
int s_idx = 0;
int e_idx = 0;
int jump_idx = 0;
for (int i = 0; i < len; ++i)... | ALGO | 0.996935 | 3.550595 | {
"github_metadata": {
"branch": "master",
"commit_count": 29,
"repo_created_at": "2015-04-06T12:17:45.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "68a950aff... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.