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 |
|---|---|---|---|---|---|---|---|
b727005a-11e8-48ea-ada5-d98825d7521a | viks4222/Concepts | cpp/FindArrayIntersection.cpp | #include <iostream>
#include <string>
using namespace std;
string FindIntersection(string strArr[], int arrLength) {
int a, b = 0;
string res = "";
for( int i= 0; i< strArr[0].length(); i++)
{
if(strArr[0].find(',', i) != string::npos)
{
a = stoi(strArr[0].substr(i, strArr[0].find(i, ',') - i));
... | ALGO | 0.983485 | 4.280315 | {
"github_metadata": {
"branch": "master",
"commit_count": 8,
"repo_created_at": "2018-06-15T05:28: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": "177bf541af... |
bcd8e083-f760-4603-bd0f-1c136fc55bc4 | UpCoder/-Offer | 32.cpp | //
// Created by 梁栋 on 2019-03-28.
//
#include <iostream>
#include <vector>
#include <string>
#include <queue>
#include "BinaryTree.cpp"
using namespace std;
class Solution {
public:
vector<int> PrintFromTopToBottom(BinaryTreeNode* root) {
vector<int> res;
queue<BinaryTreeNode* > queue1;
que... | ALGO | 0.999992 | 5.808717 | {
"github_metadata": {
"branch": "master",
"commit_count": 8,
"repo_created_at": "2019-02-24T14:45: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": "a8b293b853... |
744f5d5a-b070-4bde-aa2f-6e57885c9c1f | archont00/cinepaint-oyranos | plug-ins/bracketing_to_hdr/br_core/WeightFunc_U16.cpp | /*
* WeightFunc_U16.cpp -- Part of the CinePaint plug-in "Bracketing_to_HDR"
*
* Copyright (c) 2005-2006 <NAME> <<EMAIL>>
*
* LICENSE:
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundati... | TOOL | 0.932131 | 6.245301 | {
"github_metadata": {
"branch": "master",
"commit_count": 49,
"repo_created_at": "2014-10-12T09:16:16.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 3,
"forks": 2,
"issues": 1,
"pull_requests": 0
},
"file_meta": {
"content_id": "5bba4361c... |
6f316c32-151e-4de4-b821-9f66b1a6235b | Naveed-Naqi/Data-Structures-and-Algorithms | Sorting/BubbleSort.cpp | #include <iostream>
void bubbleSort(int* arr, std::size_t size);
void swap(int* arr, int some_index, int other_index);
bool bubbleUpMax(int* arr, std::size_t size);
void printArray(int* arr, std::size_t size);
void bubbleSort(int* arr, std::size_t size)
{
bool is_sorted = false;
while(!is_sorted)
{
... | ALGO | 0.994916 | 5.437773 | {
"github_metadata": {
"branch": "master",
"commit_count": 26,
"repo_created_at": "2019-05-29T19:40: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": "7ec8c9297... |
03c7e905-fd21-4e3e-8da6-57d8617b8fd9 | showmic96/Online-Judge-Solution | UVA/11504/9117469_AC_80ms_0kB.cpp | // In the name of <NAME> Most Merciful.
#include<bits/stdc++.h>
using namespace std;
const int MAX = 123456;
vector<int>edges[MAX+9] , node;
bool isVisited[MAX+9];
void setUp()
{
node.clear();
for(int i=0;i<MAX;i++){
edges[i].clear();
isVisited[i] = false;
}
}
void dfs1(int u)
{
i... | ALGO | 0.999763 | 4.163667 | {
"github_metadata": {
"branch": "master",
"commit_count": 35,
"repo_created_at": "2019-12-26T03:05: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": "bdf263172... |
164e47a4-36d4-454b-be22-68d48624f265 | Red-company/RedLibrary | examples/DiffieHellmanEx.cpp | #include <stdio.h>
#include <math.h>
#include <random>
#include <chrono>
#include "DiffieHellman/DiffieHellman.h"
#include "DiffieHellman/RedTypes.h"
int main() {
Red::uint65536_t P, G, a, b;
srand(time(0));
// Both the persons will be agreed upon the
// public keys G and P
P = -1; // A prime num... | ALGO | 0.976381 | 4.725548 | {
"github_metadata": {
"branch": "main",
"commit_count": 178,
"repo_created_at": "2021-01-26T15:49:03.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 3,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "acfe279cc72... |
4b49682a-6f00-438f-bd8e-bcf2c20ab7ca | ishandutta2007/codeforces-f | fallleaves07/normal/1739/C.cpp | #include<bits/stdc++.h>
using namespace std;
using LL = long long;
const int M = 998244353;
void solve() {
int n;
cin >> n;
static int c[66][66];
c[0][0] = 1;
for (int i = 1; i <= n; i++) {
c[i][0] = 1;
for (int j = 1; j <= n; j++) {
c[i][j] = (c[i - 1][j - 1] + c[i - 1][j]) % M;
}
}
auto C = [&](int n... | ALGO | 0.999904 | 4.601446 | {
"github_metadata": {
"branch": "main",
"commit_count": 1,
"repo_created_at": "2024-04-11T01:43: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": "8f85dab0cd1a... |
7c7758e2-b8a7-4973-b3e6-db5c86fd0e06 | mkp0/CP | GeekForGeek/Find whether path exist GFG.cpp | class Solution
{
public:
//Function to find whether a path exists from the source to destination.
bool dfs(int i, int j, vector<vector<int>> &grid)
{
if (i < 0 || j < 0 || i >= grid.size() || j >= grid[0].size() || !grid[i][j])
{
return false;
}
if (grid[i][j] =... | ALGO | 0.999506 | 5.425739 | {
"github_metadata": {
"branch": "master",
"commit_count": 198,
"repo_created_at": "2020-06-19T19:32:06.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "de0576e0... |
82fb3355-dea4-41c1-9428-aa0baea9fd56 | MOIN46/XPSC | D_Equal_Candies.cpp | /**
* author: MOIN46
* --MD:<NAME>
* --CSE,BRUR
* --Email:<EMAIL>
**/
#include <bits/stdc++.h>
#define F first
#define S second
#define PB push_back
#define MP make_pair
#define vec vector<int>
#define sp " "
#define el "\n"
#define SQ(a) a *a
#define EPS 1E-9
#define PI acos(-1)
#d... | ALGO | 0.99993 | 3.942751 | {
"github_metadata": {
"branch": "main",
"commit_count": 85,
"repo_created_at": "2023-09-30T17:44:08.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 1
},
"file_meta": {
"content_id": "9e39b21d2e2... |
49b7633c-7d6f-444b-8310-72e357d6557c | mingkaic/DataStructures | Algorithm/Structure/hashheap.cpp | //
// hashheap.cpp
// hybrid
//
// Created by <NAME> on 2016-01-30.
// Copyright (c) 2016 <NAME>. All rights reserved.
//
#ifdef __HASH_HEAP__H
#include <stdexcept>
#include <string>
#include "pair.hpp"
#include "priorityContainer.hpp"
static const size_t ASCII_SIZE = 256;
template <class T>
static bool content... | ALGO | 0.936832 | 4.704208 | {
"github_metadata": {
"branch": "master",
"commit_count": 9,
"repo_created_at": "2016-01-20T08:54: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": "d9a50b5848... |
b1af7e4e-879c-4519-9e1e-6906f4654f23 | Aman-droid/CP_Essentials | CODES/C_Good_String.cpp | #include<bits/stdc++.h>
#define ll long long
#define endl '\n'
#define rep(i,a,b) for(int i=a;i<=b;i++)
#define pll pair<ll,ll>
#define pii pair<int,int>
#define vpll vector<pll>
#define SZ(x) ((int)x.size())
#define FIO ios_base::sync_with_stdio(0);cin.tie(NULL);cout.tie(NULL)
#define watch(x)cout<<(#x)<<" is "<<(x... | ALGO | 0.999849 | 4.439137 | {
"github_metadata": {
"branch": "master",
"commit_count": 5,
"repo_created_at": "2021-06-28T19:31:56.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "0a9b65707b... |
9f2adc61-ea04-4347-a81b-4fc118262a81 | Conglang/MyLeetCode | src/Binary_Search_Tree_Iterator.cpp | //////////////////////////////////////////////////////
// Project: MyLeetCode
//
// Author: YanShicong
// Date: 2016/09/16
//////////////////////////////////////////////////////
/*--------------------------------------------------------------------------------------------------------------
* Implement an iterat... | ALGO | 0.999925 | 5.567926 | {
"github_metadata": {
"branch": "master",
"commit_count": 154,
"repo_created_at": "2014-10-25T07:44:58.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 3,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "6d843803... |
e5987d50-f75e-4b72-897b-2426a16dad06 | Sandipon-Biswas/c-problem-solving | ccc.cpp | #include <iostream>
#include <string>
using namespace std;
int main() {
int t;
cin >> t;
while (t--) {
string s;
cin >> s;
// Extract hour and minute
int hour = stoi(s.substr(0, 2));
int minute = stoi(s.substr(3, 2));
string period;
if (h... | ALGO | 0.997558 | 4.534237 | {
"github_metadata": {
"branch": "main",
"commit_count": 93,
"repo_created_at": "2023-07-22T07:13:54.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "2f9bc7e7774... |
cfc019e5-2eca-46fd-8e63-a6023564471e | rdfhdt/hdt-cpp | libhdt/tests/popcnt.cpp | #include <stdint.h>
#include <iostream>
// Compile with -msse4.2
//#include <smmintrin.h>
#include "../src/util/StopWatch.hpp"
using namespace std;
static const unsigned char __poptable[256] =
{
# define B2(n) n, n+1, n+1, n+2
# define B4(n) B2(n), B2(n+1), B2(n+1), B2(n+2)
# define B6(n) B4(n), B4... | ALGO | 0.996734 | 4.099404 | {
"github_metadata": {
"branch": "develop",
"commit_count": 854,
"repo_created_at": "2014-04-24T18:04:06.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 122,
"forks": 67,
"issues": 59,
"pull_requests": 6
},
"file_meta": {
"content_id": "5319... |
4bc561ff-f931-441a-ad04-0716ee32ecdb | kunalbhatia-868/Leetcode | Rotten Oranges - GFG/rotten-oranges.cpp | //{ Driver Code Starts
#include<bits/stdc++.h>
using namespace std;
// } Driver Code Ends
class Solution
{
public:
//Function to find minimum time required to rot all oranges.
int orangesRotting(vector<vector<int>>& grid) {
// Code here
int n=grid.size();
int m=grid[0].size();
... | ALGO | 0.999844 | 5.866926 | {
"github_metadata": {
"branch": "main",
"commit_count": 907,
"repo_created_at": "2022-02-14T16:02:20.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "aad829369f... |
8a7db42b-1d6c-42f1-8fc5-d40e49365942 | czjczj/Leetcode_Cplus | acwing/多重背包二进制.cpp | /*
* Author:czj
* Time :2019/12/13 19:44
* Email :<EMAIL>
*/
#include<algorithm>
#include<iostream>
using namespace std;
/**
* 解题思路: 对于遍历到的 第 i 个物品, 其 重量 w, 价值 v, 可选个数 s, 假设背包最大可以填充重量为 W
* 1. 当 W/w <= s, 即这个物品提供的可选择的个数是 大于背包重量忍受范围的, 可以认为 这个物品 是可以选任意件的 这个时候为一个完全背包。
* 这个时候从 小 到 大 遍历背包的可以忍受重量
* for(int ... | ALGO | 0.999942 | 4.70575 | {
"github_metadata": {
"branch": "master",
"commit_count": 18,
"repo_created_at": "2019-08-14T11:57:10.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "b5697c6b5... |
d55abafe-1bfe-430b-a0df-94a379072815 | ihsnayvid/Leetcode-Practice | Construct a Full Binary Tree - GFG/construct-a-full-binary-tree.cpp | //{ Driver Code Starts
//Initial Template for C++
#include<bits/stdc++.h>
using namespace std;
struct Node
{
int data;
struct Node *left;
struct Node *right;
Node(int x){
data = x;
left = NULL;
right = NULL;
}
};
// } Driver Code Ends
/* Structre of the Node of the Binary Tree is as follows
str... | ALGO | 0.99995 | 6.106393 | {
"github_metadata": {
"branch": "main",
"commit_count": 2393,
"repo_created_at": "2022-04-22T05:57:31.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "0df2cbe03... |
89cba028-1323-4973-af28-1a45472f7b9f | ishandutta2007/codeforces-a | aryanc403/normal/797/D.cpp | /*
Warn - Don't change next line else you will get WA verdict. Online Judge is configured to give WA if next line is not present.
"An ideal problem has no test data."
Author - <NAME> (@aryanc403)
*/
#pragma warning(disable:4996)
#pragma comment(linker, "/stack:200000000")
#pragma GCC optimize ("Ofast")
#pragma G... | ALGO | 0.999385 | 4.000466 | {
"github_metadata": {
"branch": "main",
"commit_count": 4,
"repo_created_at": "2024-04-11T00:51: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": "c82c9d973d50... |
98df230c-dc80-4048-a11e-357ee7220e41 | AnupeshVerma/LeetCode_DSA | 2375-minimum-obstacle-removal-to-reach-corner/2375-minimum-obstacle-removal-to-reach-corner.cpp | class Solution {
private:
int drow[4] = {-1, 0, 1, 0};
int dcol[4] = {0, 1, 0, -1};
public:
int minimumObstacles(vector<vector<int>>& grid) {
int n = grid.size(), m = grid[0].size();
vector<vector<int>> distance(n, vector<int>(m, INT_MAX));
priority_queue<pair<int, pair<int, int>>, v... | ALGO | 0.99996 | 5.818699 | {
"github_metadata": {
"branch": "main",
"commit_count": 1682,
"repo_created_at": "2023-01-18T17:16: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": "8e35934b8... |
b31db401-46d8-4cdf-b4b1-76c82e219d3c | Vidit-Ostwal/DSA-Practise | C++/Leetcode 2477.cpp | #include <cmath>
#include <stdio.h>
#include <bits/stdc++.h>
using namespace std;
class Solution {
vector<int> Parent;
vector<int> Distance;
vector<bool> Visited;
vector<int> Person;
unordered_map<int,vector<int>> umap;
public:
long long minimumFuelCost(vector<vector<int>>& roads, int seats)... | ALGO | 0.999835 | 4.779634 | {
"github_metadata": {
"branch": "main",
"commit_count": 34,
"repo_created_at": "2023-01-21T11:37: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": "81596862982... |
3c7f8750-fe89-4b3b-83b4-45630fd89c64 | XieDianhua/leetcode | array/src/minSubArrayLen.cpp | #include<vector>
#include<stdint.h>
using namespace std;
//int minSubArrayLen(int target, vector<int>& nums) {
// int result = INT32_MAX;
// int sum = 0;
// int subLength = 0;/* 子序列长度 */
// for (int i = 0;i < nums.size();i++) { /* 设置子序列起点为i */
// sum = 0;
// for (int j = i;j < nums.size()... | ALGO | 0.999886 | 4.923779 | {
"github_metadata": {
"branch": "master",
"commit_count": 9,
"repo_created_at": "2024-06-28T12:21: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": "f195da190b... |
8223f186-ee8f-45a2-9f40-f3642679ea42 | Qengineering/ARMnn_Quantize_RPi_32-bits | model_output_labels_loader.hpp | //
// Copyright © 2017 Arm Ltd. All rights reserved.
// SPDX-License-Identifier: MIT
//
#include <algorithm>
#include <boost/assert.hpp>
#include <boost/filesystem.hpp>
#include <iostream>
#include <string>
#include <vector>
using CategoryNames = std::vector<std::string>;
/** Split a string into tokens by a delimite... | DATA | 0.924683 | 7.334341 | {
"github_metadata": {
"branch": "master",
"commit_count": 10,
"repo_created_at": "2020-05-03T16:49:25.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "2e6ae4fb6... |
7e4a5c42-ef66-40c1-af44-724533c0304e | JishTheFish20/DataStructures | lecture-18/exercise-1/support.h | #ifndef SUPPORT_H
#define SUPPORT_H
#include <iostream>
#include "BSTNode.h"
// Your 3 functions here here...
// Insert, Traverse, and Search...
BSTNode* insert(BSTNode* root, int value){
if(root == nullptr){ // if tree dne then have root equal value
root = new BSTNode(value);
}else if(value >= root... | ALGO | 0.993073 | 3.634029 | {
"github_metadata": {
"branch": "main",
"commit_count": 1,
"repo_created_at": "2023-01-06T00:48: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": "8b1c38a5874e... |
346786b2-5b27-4981-81f5-dc2a9729520e | jrr/tom7misc | golfhorse/nn/arith.cc |
#include <string>
#include <vector>
#include <shared_mutex>
#include <cstdint>
#include <deque>
#include "../../cc-lib/threadutil.h"
#include "../../cc-lib/randutil.h"
#include "../../cc-lib/arcfour.h"
#include "../../cc-lib/base/logging.h"
#include "../../cc-lib/base/stringprintf.h"
#include "../../cc-lib/util.h"
#... | ALGO | 0.993481 | 5.216212 | {
"github_metadata": {
"branch": "master",
"commit_count": 4297,
"repo_created_at": "2021-05-03T04:40:53.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 1
},
"file_meta": {
"content_id": "0f5aa25... |
ed004db7-eb51-400a-8e83-9a214b26c7e9 | hrshshukla/DSA | Apna College/02_Binary Number System/new_Base_Conveter.cpp | #include <iostream>
#include <cmath>
using namespace std;
// This Calculator can take any number of any (base) and perform operation and able to return ouput in any (base)
// Project [Github Link] in description
int base_calculator(int arr_num[], int arr_base[], char oprtr, int size, int outputBase)
{
int conver... | ALGO | 0.994877 | 4.573873 | {
"github_metadata": {
"branch": "main",
"commit_count": 4,
"repo_created_at": "2024-11-25T17:11: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": "544afa9fbad1... |
be3a64f0-b151-4730-bb53-0ec1688430e2 | ishandutta2007/codeforces-r | radewoosh/normal/1545/F.cpp | //~ while (clock()<=69*CLOCKS_PER_SEC)
//~ #pragma comment(linker, "/stack:200000000")
#pragma GCC optimize("O3")
//~ #pragma GCC target ("avx2")
//~ #pragma GCC optimize("Ofast")
//~ #pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native")
//~ #pragma GCC optimize("unroll-loops")
#include <bits/st... | ALGO | 0.999825 | 4.159437 | {
"github_metadata": {
"branch": "main",
"commit_count": 1,
"repo_created_at": "2024-10-30T15:58: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": "6e0fc2ad6198... |
d1c3f775-2e4d-40ef-9647-974460868068 | bOrax10/cses-problemset-solutions | Range Queries/static-range-minimum-queries.cpp | #include <bits/stdc++.h>
using namespace std;
#define rep(i,a,b) for(int i=a;i<b;i++)
#define repb(i,a,b) for(int i=a;i>=b;i--)
#define endl '\n'
#define print(x) cout<<x<<endl
#define printInline(x) cout<<x<<" "
#define ll long long
#define lli long long int
#define vi vector<int>
#define vll vector<long long>
#... | ALGO | 0.999983 | 4.857832 | {
"github_metadata": {
"branch": "main",
"commit_count": 35,
"repo_created_at": "2023-04-01T14:00: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": "8ccf3899d40... |
bd9f93e0-f3fc-44cd-906d-aeee7f71e7c2 | sherwyndd/cses-solutions | Tree Algorithms/Fixed-Length Paths I.cpp | /*
Harder not smarter
*/
#include <bits/stdc++.h>
using namespace std;
#define IOS ios::sync_with_stdio(0);cin.tie(NULL);cout.tie(NULL);
#define nl "\n"
typedef pair<int,int> p;
const int N = (2e5) + 7;
const int N2 = (1e3) + 7;
const int INF = (1e9);
const int base = 311;
const int MOD = (1e9) + 7;
const int MULTI... | ALGO | 0.999946 | 4.4822 | {
"github_metadata": {
"branch": "main",
"commit_count": 114,
"repo_created_at": "2024-06-24T13:56:22.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "ec6d31c394... |
260424c2-42c6-4edf-a668-2502e2b6f2d3 | Kaifislam48/I-am-Neo-DSA | UNIT-3.cpp/LEC-4_Q2.cpp | /* You are given a task by your teacher. The task is to develop a student registration system for a university. The system needs to maintain a priority queue of student registration requests based on their admission urgency.
Each student registration request is represented by a unique identifier (ID) and has an asso... | ALGO | 0.999918 | 5.554631 | {
"github_metadata": {
"branch": "main",
"commit_count": 1,
"repo_created_at": "2023-10-24T14:15:11.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "e4206a68ec2a... |
d6b2e059-b89c-4658-abdc-fd88b6f94001 | ishandutta2007/codeforces-h | h8_8q/normal/1750/E.cpp | #include<iostream>
#include<algorithm>
#include<cstring>
#include<cstdio>
#include<bitset>
#include<random>
#include<cmath>
#include<ctime>
#include<queue>
#include<map>
#include<set>
#define int long long
#define fi first
#define se second
#define max Max
#define min Min
#define abs Abs
#define lc (x<<1)
#define rc (... | ALGO | 0.999758 | 3.496239 | {
"github_metadata": {
"branch": "main",
"commit_count": 1,
"repo_created_at": "2024-04-11T02:01:06.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "69c0dfd78561... |
9d1def8f-907b-4330-9f3b-6481cd6b2da6 | minSsan/algorithm | baekjoon/practice/algorithm_lecture/bfs/12851_solved.cpp | #include <iostream>
#include <queue>
#include <algorithm>
using namespace std;
int n, k;
int cnt[100001];
bool visited[100001];
bool isFound;
int min_result; // 최소 경로 수
int min_cnt; // 경우의 수 카운트
const int MAX = 100000;
struct node
{
int position; // 노드의 번호
int cnt; // 노드를 방문하는 데까지 이동한 경로
};
queue<node> q;
i... | ALGO | 0.999929 | 4.308073 | {
"github_metadata": {
"branch": "main",
"commit_count": 338,
"repo_created_at": "2022-01-17T03:33:51.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "653c6340e2... |
79b57856-a07e-4182-8e99-ba9db4860925 | Abhishek2533/DSA | GeeksForGeeks/GfG_160-160_Days_of_Problem_Solving/Sorting/Find_H-Index.cpp | //{ Driver Code Starts
#include <bits/stdc++.h>
using namespace std;
// } Driver Code Ends
// User function Template for C++
class Solution {
public:
// Function to find hIndex
int hIndex(vector<int>& citations) {
// code here
int n=citations.size();
vector<int> freq(n+1);
fo... | ALGO | 0.999223 | 5.563687 | {
"github_metadata": {
"branch": "master",
"commit_count": 442,
"repo_created_at": "2023-05-28T01:08: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": "0968fa1b... |
f22db537-2695-424c-b211-ded2db7a5883 | Sharif-11/Competetive-Programming | round113B.cpp | //<NAME>
//<NAME>(1804011)
//Chittagong University of Engineering & Technology
#include<bits/stdc++.h>
#define pb push_back
#define fin(i,arr,n) for(i=0;i<n;i++)cin>>arr[i]
#define fout(i,arr,n) for(i=0;i<n;i++)cout<<arr[i]<<" "
#define inf 9223372036854775807
#define vi vector<ll>
#define init ll n,m,a,i,b,j,k,t,x,y,z... | ALGO | 0.999623 | 3.526777 | {
"github_metadata": {
"branch": "main",
"commit_count": 5,
"repo_created_at": "2022-02-02T08:35: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": "f45e4b5f31e1... |
c2164058-baaa-4db9-bdbf-58aab913e6e0 | shenli/ClickHouse | dbms/src/Common/tests/parallel_aggregation.cpp | #include <iostream>
#include <iomanip>
#include <mutex>
#include <atomic>
//#define DBMS_HASH_MAP_DEBUG_RESIZES
#include <DB/Interpreters/AggregationCommon.h>
#include <DB/Common/HashTable/HashMap.h>
#include <DB/Common/HashTable/TwoLevelHashMap.h>
//#include <DB/Common/HashTable/HashTableWithSmallLocks.h>
//#includ... | ALGO | 0.987303 | 4.835026 | {
"github_metadata": {
"branch": "master",
"commit_count": 8007,
"repo_created_at": "2016-06-16T08:30:55.000Z",
"is_fork": true,
"is_org_owned": false,
"forked_from": "ClickHouse/ClickHouse",
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"con... |
54c655e2-e0a6-4c84-b66b-7beb176ba0ac | T2hhbmEK/cp | P1434.cpp | #include <bits/stdc++.h>
using namespace std;
#define endl '\n'
#define int long long
#define rep(i, a, b) for (int i = (a); i <= (b); i++)
#define per(i, a, b) for (int i = (a); i >= (b); i--)
using ll = long long;
using vi = vector<int>;
using vii = vector<vi>;
using viii = vector<vii>;
using pii = pair<int, int>;
co... | ALGO | 0.999974 | 3.458636 | {
"github_metadata": {
"branch": "main",
"commit_count": 100,
"repo_created_at": "2024-11-15T14:58: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": "2be66d721e... |
d96e5bc3-709a-4d5d-9ef2-2e625afc2b3e | yogeshrdr/LeetcodeProblems | binary-tree-vertical-order-traversal/binary-tree-vertical-order-traversal.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.999997 | 5.930984 | {
"github_metadata": {
"branch": "main",
"commit_count": 1047,
"repo_created_at": "2021-10-10T14:21:12.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "31f6b0f42... |
17fe5271-8aeb-440d-a8b9-def34d0be17f | 2445928989/SCUTOJ | 2023/章节作业/第三章作业/G.cpp | /*已知用梯形法求积分的公式为
其中 h = ( b-a ) / n,n为积分区间的等分数,编程求如下积分的值。要求把求积分公式编写成一个函数,并使用函数指针作为形式参数。调用该函数时,给定不同的被积函数作为实际参数求不同的积分。
(注意这里的n为10000,程序需要求出下面的三个积分的值)
(图又没了!抱歉!)
输入
无
输出
三个积分的值(显示在一行,以一个空格间隔)
*/
#include<iostream>
#include<math.h>
#define n 10000
using namespace std;
double T1(double a, double b, double fa, double fb) {
... | ALGO | 0.999718 | 4.000831 | {
"github_metadata": {
"branch": "main",
"commit_count": 167,
"repo_created_at": "2023-10-14T12:33:37.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 4,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "4d30a31ff6... |
a1240ae8-0d01-4c55-9cf8-d1b4daf04eed | katyaadamenko/mipt-algorithms | Флойд/2598.cpp | #include <iostream>
#include <vector>
#include <limits>
#include <algorithm>
#include <iterator>
typedef int weight_t;
typedef int vertex_t;
typedef int number_of_flight_t;
const int INF = std::numeric_limits<int>::max();
void findPath(vertex_t first, vertex_t last, std::vector<std::vector<vertex_t>> & intermediateV... | ALGO | 0.999994 | 3.782295 | {
"github_metadata": {
"branch": "master",
"commit_count": 1,
"repo_created_at": "2017-05-31T22:43:01.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "b4363a8998... |
6d82cadc-503c-4782-89f0-2827b9f9dfdd | choijaewon323/PS | 알고리즘_스터디/ACM 호텔.cpp | #include <iostream>
using namespace std;
void numberOfRoom( int h, int w, int room );
int main() {
int testCase, h, w, room;
cin >> testCase;
for ( int i = 0; i < testCase; i++ )
{
cin >> h >> w >> room;
numberOfRoom( h, w, room );
}
return 0;
}
void numberOfRoom( int h, int w, int room ) {
int num = ... | ALGO | 0.999643 | 3.490309 | {
"github_metadata": {
"branch": "master",
"commit_count": 829,
"repo_created_at": "2021-09-04T02:57: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": "1c792f7a... |
46432c59-cd60-4f7f-ad73-4c4f7306b236 | SaiDaiwikV/LEETCODE_SOLUTIONS | water_bottel.cpp | /*There are numBottles water bottles that are initially full of water. You can exchange numExchange empty water bottles from the market with one full water bottle.
The operation of drinking a full water bottle turns it into an empty bottle.
Given the two integers numBottles and numExchange, return the maximum number ... | ALGO | 0.999947 | 5.884719 | {
"github_metadata": {
"branch": "main",
"commit_count": 148,
"repo_created_at": "2024-08-11T04:09: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": "b7bd559037... |
1b84941f-2727-4f03-9a0e-0a92833d0ca3 | Dev-RubinJo/AlgorithmCpp | AlgorithmC++/Algorithm/ProblemSolving/BaekJoon/Sort/BaekJoon1059.cpp | //
// BaekJoon1059.cpp
// Algorithm
//
// Created by <NAME> on 2020/07/24.
// Copyright © 2020 <NAME>. All rights reserved.
//
#include <stdio.h>
#include <iostream>
using namespace std;
void quickSort(int lSet[], int start, int end) {
if(start >= end) return;
int key = start;
int i = start + 1;
... | ALGO | 0.999997 | 5.184256 | {
"github_metadata": {
"branch": "master",
"commit_count": 85,
"repo_created_at": "2020-07-15T11:24: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": "d03be9993... |
f953bd65-f789-4d9a-a545-0306ab2205a9 | cran/TDA | src/tdautils/kernelUtils.h | #include <cmath>
#include <numeric>
#include <map>
// read element of matrix
double ReadMat(double*XX, int *pNN, int *pDD, int i, int d){
double out=0.0;
out=XX[(d-1)*(pNN[0])+i-1];
return out;
}
// write element of matrix
void WriteMat(double*XX, int *pNN, int *pDD, int i, int d, double input){
XX[(d-1)*(pNN[0]... | ALGO | 0.999507 | 5.236055 | {
"github_metadata": {
"branch": "master",
"commit_count": 23,
"repo_created_at": "2014-08-19T18:45:14.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 9,
"forks": 4,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "cd89fdae3f... |
f0746e00-3435-4b05-9c56-70e9d20d2d65 | shaneguru/SIT315 | Module3/Task1/mpi_mmulti_openmp.cpp | #include <mpi.h>
#include <stdio.h>
#include <stdlib.h>
#include <iostream>
#include <omp.h>
#define DIM 1000 //defining matrix size
#define MAX_RAND 10 //max value random generator
/* holding the matrices */
int matrix1[DIM][DIM];
int matrix2[DIM][DIM];
int res[DIM][DIM];
/* declaring function used */
void head(int... | ALGO | 0.999091 | 5.000926 | {
"github_metadata": {
"branch": "master",
"commit_count": 36,
"repo_created_at": "2020-07-20T06:55:35.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "400d45748... |
fb0cf3e5-b99f-41d7-84b5-1c8f22afd425 | Atharva-Kulkarni606/CODING | Graph_Theory/adjlist.cpp | #include<bits/stdc++.h>
using namespace std;
//Taking input in a graph
int main(){
//n - No of nodes, m - edges
int n,m,wt;
cin >> n >> m >> wt;
//Make a adj matrix
vector<pair<int,int>>adj[n];
//Take input for edges
for(int i = 0 ; i < m ; i++){
int u,v;
cin >> u >> v;
... | ALGO | 0.999929 | 4.34351 | {
"github_metadata": {
"branch": "main",
"commit_count": 11,
"repo_created_at": "2021-08-21T06:23:34.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "217ff796975... |
64dc3b67-03de-4d53-8b6a-23dd2bb5d83f | Foxyy420/foxyy_private | CSGOSimple/helpers/math.cpp | #include "math.hpp"
namespace Math
{
void NormalizeAngles(QAngle& angles)
{
for(auto i = 0; i < 3; i++) {
while(angles[i] < -180.0f) angles[i] += 360.0f;
while(angles[i] > 180.0f) angles[i] -= 360.0f;
}
}
//-------------------------------------------------------... | TOOL | 0.969238 | 6.410081 | {
"github_metadata": {
"branch": "master",
"commit_count": 1,
"repo_created_at": "2018-08-15T21:11:12.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 12,
"forks": 8,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "ba79e404a... |
5b83f9f4-1fbe-42c6-9901-57d73040e026 | Acytoo/leetcode | c++/2028findMissingObservations.cc | #include <iostream>
#include <sstream>
#include <vector>
#include <string>
#include <queue>
#include <climits>
#include <stack>
#include <algorithm>
#include <cmath>
#include <set>
#include <unordered_map>
#include <list>
#include <unordered_set>
#include <map>
#include <functional>
#include <bitset>
#include <numeric>... | ALGO | 0.999069 | 3.846425 | {
"github_metadata": {
"branch": "master",
"commit_count": 417,
"repo_created_at": "2018-11-01T11:52:26.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "9a54c6d0... |
f0ffdf1b-674f-48aa-9cbf-39677ae8bb7d | spicy-tomato/algorithms-and-application | red_black_tree/red_black_tree.cpp | #include <iostream>
#include "red_black_tree_node.cpp"
#include "red_black_tree_iterator.cpp"
#ifndef RED_BLACK_TREE
#define RED_BLACK_TREE
template<class Key>
class invalid_key : public std::runtime_error {
public:
explicit invalid_key(Key key);
};
template<class Key>
invalid_key<Key>::invalid_key(Key k... | ALGO | 0.976286 | 6.460552 | {
"github_metadata": {
"branch": "master",
"commit_count": 40,
"repo_created_at": "2021-09-08T15:32:53.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 6,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "00e9428b3... |
8da5e716-bb1c-49bf-8116-af47906c91e6 | Lukkario/pp2_zadania | 4_5.cpp | #include "lib.h"
#include <fstream>
using namespace std;
float wylicz1(int x)
{
return 2*sin(x);
}
float wylicz2(int x)
{
float a = (float)(x*x + 3*x)/((x+1)*(x+2));
//cout << a << endl;
return a;
}
float wylicz3(int x)
{
return sqrt(x*x +5);
}
void pisz(int *a, int *b, string path)
{
ofstr... | TOOL | 0.904957 | 3.788974 | {
"github_metadata": {
"branch": "master",
"commit_count": 21,
"repo_created_at": "2017-03-04T16:28: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": "415933696... |
cedb6b9e-a166-4dd7-8106-5b0c6e5aa7c3 | Sourav61/DSA-Practice | LeetCode/Medium/MaximumLevelSumOfBinaryTree.cpp | // https://leetcode.com/problems/maximum-level-sum-of-a-binary-tree/
#include<bits/stdc++.h>
using namespace std;
struct TreeNode {
int val;
TreeNode *left;
TreeNode *right;
TreeNode() : val(0), left(nullptr), right(nullptr) {}
TreeNode(int x) : val(x), left(nullptr), right(nullptr) {}
TreeNod... | ALGO | 0.999979 | 5.791123 | {
"github_metadata": {
"branch": "main",
"commit_count": 408,
"repo_created_at": "2021-09-01T08:29: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": "aeb21fdf74... |
469f15cf-e024-41b7-989b-45287574b5b9 | denismolete/Denis | denis.cpp | #include <iostream>
#include <vector>
#include <set>
#include <string>
#include <sstream>
#include <chrono>
using namespace std;
set<string> parseClause(const string& clauseStr) {
set<string> clause;
stringstream ss(clauseStr);
string literal;
while (ss >> literal) {
clause.insert(literal);
... | ALGO | 0.999876 | 5.691667 | {
"github_metadata": {
"branch": "main",
"commit_count": 2,
"repo_created_at": "2025-05-10T17:38:02.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "93ffd3d9d652... |
f1792eea-204e-4549-bc98-30026fc6dbbe | Maria16339/Pr_13.1 | Pr_13.1.cpp | #include <iostream>
#include <math.h>
#include <iomanip>
#include "dod.h"
#include "sum.h"
#include "var.h"
using namespace std;
using namespace nsDod;
using namespace nsSum;
using namespace nsVar;
int main()
{
cout << "x_p = "; cin >> x_p;
cout << "x_k = "; cin >> x_k;
cout << "dx = "; cin >> dx;
cout << "e = "; c... | ALGO | 0.995282 | 3.326396 | {
"github_metadata": {
"branch": "master",
"commit_count": 1,
"repo_created_at": "2020-12-30T18:46: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": "bb46bd4c17... |
b6ef2f1e-b218-4d09-812b-f3f15b3dad56 | litleleprikon/labs | SAOD_lab_4_3/SAOD_lab_4_3/SAOD_lab_4_3.cpp | // SAOD_lab_4_3.cpp: определяет точку входа для консольного приложения.
//
#include "stdafx.h"
#include <stdio.h>
#include <conio.h>
#include <iostream>
#define null NULL
struct node
{
int val;
node* left;
node* right;
}
* root, *tp;
void clearNode(node* n)
{
if(n->left!=null)
{
clearNode(n->left);
delete n... | ALGO | 0.997966 | 3.034914 | {
"github_metadata": {
"branch": "master",
"commit_count": 1,
"repo_created_at": "2013-07-29T17:57: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": "02d31cc632... |
727e7598-35c3-43fa-bb92-fc599f41bf85 | Thekla/thekla_atlas | src/nvmath/ProximityGrid.h | #pragma once
#ifndef NV_MATH_PROXIMITYGRID_H
#define NV_MATH_PROXIMITYGRID_H
#include "Vector.h"
#include "ftoi.h"
#include "nvcore/Array.inl"
// A simple, dynamic proximity grid based on Jon's code.
// Instead of storing pointers here I store indices.
namespace nv {
class Box;
struct Cell {
Arra... | ALGO | 0.985355 | 6.548342 | {
"github_metadata": {
"branch": "master",
"commit_count": 42,
"repo_created_at": "2013-07-27T07:16:50.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 476,
"forks": 64,
"issues": 9,
"pull_requests": 2
},
"file_meta": {
"content_id": "58dcb5e... |
60bf1877-66ac-4d5d-bdab-89d039fb030a | Kuldeep3330/2025_DSA | June challenge/18June.cpp | // 54. Spiral Matrix
/**
* @param {number[][]} matrix
* @return {number[]}
*/
var spiralOrder = function(matrix)
{
let r = matrix.length;
let c = matrix[0].length;
let arr = [];
let top = 0, bottom = r - 1, left = 0, right = c - 1;
while (top <= bottom && left <= right)
{
for (let i ... | ALGO | 0.999498 | 6.301532 | {
"github_metadata": {
"branch": "main",
"commit_count": 209,
"repo_created_at": "2025-04-07T16:22: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": "9b0b0768ce... |
5772eed8-ca83-4911-8cd2-6b32f8b92816 | dmehrab06/Time_wasters | codechef/sept long/CHEFCUT.cpp | #include <bits/stdc++.h>
#define MIN(X,Y) X<Y?X:Y
#define MAX(X,Y) X>Y?X:Y
#define ISNUM(a) ('0'<=(a) && (a)<='9')
#define ISCAP(a) ('A'<=(a) && (a)<='Z')
#define ISSML(a) ('a'<=(a) && (a)<='z')
#define ISALP(a) (ISCAP(a) || ISSML(a))
#define MXX 100000000000000000
#define MNN -MXX
#define VALID(X,Y,N,M) ((X)>=1 && (X)... | ALGO | 0.999985 | 3.560441 | {
"github_metadata": {
"branch": "master",
"commit_count": 8,
"repo_created_at": "2017-09-26T07:24: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": "910655ce3e... |
3b22dd4b-8c9a-4cb7-874a-b42fefe58cc3 | mreigad1/byteDiff | byteDiff.cpp | #include <iostream>
#include <sys/mman.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>
#include <unistd.h>
using namespace std;
int main() {
int height;
int width;
string image1;
string image2;
cin >> height;
cin >> width;
const int imageSize = height * width;
if (imageSize <= 0) {
cout... | ALGO | 0.912495 | 3.815273 | {
"github_metadata": {
"branch": "master",
"commit_count": 2,
"repo_created_at": "2017-12-08T21:16:23.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "72d05540df... |
059f06e1-9b33-48e4-af43-7b52b11d1b98 | alexpizarroj/competitive-programming | src/google/2016-code-jam/distributed-round-1-material/src/sandwich/main.cpp | #include <iostream>
#include <algorithm>
#include <vector>
#include <stack>
#include <queue>
#include <set>
#include <map>
#include <string>
#include "sandwich.h"
#include "message.h"
using namespace std;
using ll = long long;
using vi = vector<int>;
using vll = vector<ll>;
int main() {
if (MyNodeId() == 0) {
i... | ALGO | 0.99973 | 3.997012 | {
"github_metadata": {
"branch": "master",
"commit_count": 107,
"repo_created_at": "2014-09-11T05:20:41.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 6,
"forks": 5,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "22ff2922... |
0346f12a-27a7-46cd-9bb3-e2e54c9dfc5b | ngaotu/cplusplus | Ontap/binarysearchtree.cpp | #include <bits/stdc++.h>
using namespace std;
struct node{
int data;
node*left;
node*right;
};
node*makeNode(int e){
node* tmp = new node;
tmp->data=e;
tmp->left=NULL;
tmp->right=NULL;
return tmp;
}
// tinh chieu cao cua cay
int highestTree(node*root){
if(root==NULL){
return... | ALGO | 0.999992 | 4.132511 | {
"github_metadata": {
"branch": "master",
"commit_count": 6,
"repo_created_at": "2022-09-30T04:20: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": "c392e0470e... |
7ced33df-56a6-4ac7-bf3d-7faf169ee3b7 | igamenovoer/igcclib | include/igcclib/geometry/igcclib_geometry.hpp | #pragma once
#include <list>
#include <set>
#include <igcclib/core/igcclib_eigen_def.hpp>
namespace _NS_UTILITY
{
// ================= delarations ============================
/// <summary>
/// transform points by a matrix, by pts.dot(transmat)
/// </summary>
/// <param name="pts">N-d points</param>
/// <param... | ALGO | 0.998363 | 4.280117 | {
"github_metadata": {
"branch": "master",
"commit_count": 36,
"repo_created_at": "2024-08-01T16:00:22.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "255d4cf4e... |
040f12ed-893c-4faf-9a7e-6c39bc94c497 | GulzhamalK0/3labb | 3labka/3lab8.cpp | #include <iostream>
using namespace std;
int main (){
const int size = 4;
int matrix[size][size];
cout << "Element 4x4 matrix element: \n";
for (int i = 0; i < size ;i++){
for (int j = 0 ;j < size ; j++){
cin >> matrix[i][j];
}
}
int maxsum = 0;
int maxrow = 0;... | ALGO | 0.999906 | 4.746834 | {
"github_metadata": {
"branch": "main",
"commit_count": 2,
"repo_created_at": "2025-06-19T06:13: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": "77e20d6e50cc... |
a14b3027-de17-4e34-a215-c35ff4cbf15e | Adhamet/Problem-Solving | codeforces/Problems/2123F Minimize Fixed Points/2123F.cpp | #include <bits/stdc++.h>
using namespace std;
#define i64 int64_t
#define el '\n'
int32_t main() {
ios_base::sync_with_stdio(0), cin.tie(0), cout.tie(0);
constexpr int MAXN = 1e5 + 10;
vector<int> prime; prime.push_back(2);
bitset<MAXN/2> isPrime; isPrime.set();
for (int i = 3; i * i < MAXN; i += 2) if (isPrime... | ALGO | 0.999851 | 4.36614 | {
"github_metadata": {
"branch": "main",
"commit_count": 798,
"repo_created_at": "2022-01-29T00:47:07.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "520e0b1b2a... |
b5d8c72f-e586-4967-bc47-36c1cd9812af | Rhoban/model | TrajectoryDefinition/TrajLegLift.cpp | #include "TrajectoryDefinition/TrajLegLift.hpp"
#include "TrajectoryGeneration/TrajectoryUtils.h"
#include "TrajectoryDefinition/CommonTrajs.h"
#include "Model/JointModel.hpp"
#include "Model/NamesModel.h"
namespace Leph
{
void TrajLegLift::initializeParameters(TrajectoryParameters& trajParams)
{
// Total time lengt... | TOOL | 0.973698 | 6.056221 | {
"github_metadata": {
"branch": "master",
"commit_count": 831,
"repo_created_at": "2018-02-06T13:30:25.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 4,
"forks": 2,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "9730e64c6... |
0003c278-c4c3-45ae-8c95-25a934a8381a | matthewsamuel95/ACM-ICPC-Algorithms | DP/PartitionProblem/partition.cpp | /*
Given a set of positive integers, find if it can be divided into two subsets with equal sum.
Partition problem is special case of Subset Sum Problem which itself is a special case of the Knapsack Problem.
The idea is to calculate sum of all elements in the set.
*/
#include <iostream>
#include <string>
using namesp... | ALGO | 0.999932 | 5.795393 | {
"github_metadata": {
"branch": "master",
"commit_count": 1421,
"repo_created_at": "2017-10-21T21:46:48.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2203,
"forks": 1277,
"issues": 4,
"pull_requests": 48
},
"file_meta": {
"content_id": "... |
128c3a34-1caf-439e-90b0-98007e64506b | TheRealMolen/adventofcode2020 | aoc20/day19.cpp | #include "pch.h"
#include "harness.h"
using RuleSet = map<int, string>;
string compile_rule(int ruleix, const RuleSet& rules, bool part2);
string compile_expr(const string& expr, const RuleSet& rules, bool part2)
{
string compiled = "";
for (const auto& sub : split(expr, " "))
{
int subix = atoi(... | ALGO | 0.993312 | 4.931731 | {
"github_metadata": {
"branch": "main",
"commit_count": 35,
"repo_created_at": "2020-12-01T23:01:49.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "fcb7210731d... |
768bda09-0107-41bc-9c74-8b781212c92d | seth1919/MazeSolver | cApp.cpp | #include "cApp.h"
#include <vector>
wxIMPLEMENT_APP(cApp);
using namespace std;
cApp::cApp()
{
}
cApp::~cApp()
{
}
struct pixelTypeType {
int type;
unsigned int number;
bool taken = false;
};
struct node {
int y;
int x;
node* previous = nullptr;
unsigned int distance;
node* left = nullptr;
node* top = n... | ALGO | 0.974162 | 3.566686 | {
"github_metadata": {
"branch": "master",
"commit_count": 7,
"repo_created_at": "2022-02-22T02:31: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": "868a654706... |
8990b4d8-dbda-4a4a-a5f4-4f300b0c3b31 | hamm-bit/VJ | 4128/P7/A.cpp | // #include <bits/stdc++.h>
#include <iostream>
#include <vector>
#include <cmath>
#include <array>
#include <algorithm>
using namespace std;
#define ll long long
const ll nMOD = (ll) 1e9 + 7;
const int MAX = 1e5 + 5;
const int nMAX = 19;
void arr_print(array<array<int, nMAX>, MAX> z, int m) {
cout << "\n======... | ALGO | 0.999917 | 4.627395 | {
"github_metadata": {
"branch": "main",
"commit_count": 33,
"repo_created_at": "2024-09-10T14:44:00.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "2bf69e7c7a7... |
611c08cb-6101-4cb0-b6e9-755a303c0d9c | shambhavis20/DSA-arrays | Q8a.cpp | #include <iostream>
using namespace std;
//Largest contiguous suubarray sum i.e, Kadane's algorithm
int maxSumContiguousSubarray(int arr[], int size)
{ //max_ending_here stores the sum of the subarray currently
int max_ending_here = 0;
//max_so_far contains the max sum obtained so far, this will be returned ult... | ALGO | 0.999902 | 4.282918 | {
"github_metadata": {
"branch": "main",
"commit_count": 10,
"repo_created_at": "2021-07-16T03:30:47.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "8c58c311e81... |
3863dd8e-3885-4f79-b299-15026d71804d | kantam5/Algorithm | Algorithm/Baekjoon/너비 우선 탐색/16928 뱀과 사다리 게임.cpp | #include <iostream>
#include <vector>
#include <algorithm>
#include <string>
#include <stack>
#include <queue>
#include <map>
#include <set>
#include <memory.h>
#include <unordered_map>
using namespace std;
int board[102];
bool visited[106];
typedef struct
{
int n;
int distance;
} types;
queue<types> bfs;
in... | ALGO | 0.999873 | 3.389494 | {
"github_metadata": {
"branch": "master",
"commit_count": 314,
"repo_created_at": "2022-06-30T14:02: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": "7dc20d9c... |
febbfc00-c8e4-4a56-ba17-73bd7b2f1b1c | Sahithya13/claude | C++/problem_414.cpp | class Solution {
public:
int thirdMax(vector<int>& nums) {
// Initialize three variables to store the top three distinct maximum numbers
// Set them to the smallest possible value to handle edge cases
long long first = LLONG_MIN, second = LLONG_MIN, third = LLONG_MIN;
// Ite... | ALGO | 0.999989 | 6.414198 | {
"github_metadata": {
"branch": "main",
"commit_count": 42,
"repo_created_at": "2024-12-03T02:36:16.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "81ec58689a6... |
d19d82ee-effa-44f3-9c4a-4b8be2c13caf | Ultron011/DSA | DYNAMIC PROGRAMMING/FIBONACCI/memoization.cpp | #include<bits/stdc++.h>
#define MOD 1000000007
using namespace std;
/*
T.C - O(n)
S.C - O(n)
*/
long long fib(int n, vector<long long> &memo) {
if (n == 0 || n == 1) return n;
if (memo[n] != -1) return memo[n];
memo[n] = (fib(n-1, memo) + fib(n-2, memo)) % MOD;
return memo[n];
}
/*
T.C ... | ALGO | 0.999996 | 4.429265 | {
"github_metadata": {
"branch": "main",
"commit_count": 206,
"repo_created_at": "2024-10-19T16:32:02.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "5bee248e5b... |
5de4b999-3e0e-402c-8542-92f81b5e26a9 | AdamFull/ray_tracing | ray_tracer/render/integrator.cpp | #include "integrator.h"
#include "resources/resource_manager.h"
#include "ecs/components/camera_component.h"
#include "ecs/components/directional_light_component.h"
#include "ecs/components/point_light_component.h"
#include "ecs/components/spot_light_component.h"
#include "ecs/components/transform_component.h"
#inclu... | ALGO | 0.967504 | 5.545054 | {
"github_metadata": {
"branch": "main",
"commit_count": 18,
"repo_created_at": "2023-08-02T20:14:48.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "6357612705e... |
2d8325e6-fa7c-4bc1-8067-acca0a8c4917 | kisuk010203/PS | C++/Geometry/LineIntersection/17386(CCW).cpp | #include <iostream>
using namespace std;
typedef long long ll;
ll x[4];
ll y[4];
int ccw(int i, int j, int k) {
ll a = x[i] * y[j] + x[j] * y[k] + x[k] * y[i] -
(x[j] * y[i] + x[k] * y[j] + x[i] * y[k]);
return (a > 0) ? 1 : -1;
}
int main() {
for (int i = 0; i < 4; i++)
cin >> x[i] >> y[... | ALGO | 0.999948 | 3.548315 | {
"github_metadata": {
"branch": "master",
"commit_count": 124,
"repo_created_at": "2023-08-16T13:07: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": "bff672db... |
c46976bb-e778-4791-bdf9-b69cf3012d9c | wcleithinking/PI-STR-for-Quadrotor | Experiment Code/Quadrotor_Mode_II_Arduino_Due/Controller_STR.ino | /****************************************************************************/
/*
STR Variables
*/
/****************************************************************************/
#ifdef STR_v1
bool STR_flag = 0;
// tf coefficients
float a1 = 1;
float a2 = 1;
float b0 = 1;
float b1 = 1;
// outer loop
float Kp_STR_out... | ALGO | 0.990389 | 4.221079 | {
"github_metadata": {
"branch": "master",
"commit_count": 12,
"repo_created_at": "2018-01-22T08:30:06.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "c95d2b6dc... |
57cb74cd-cc42-4221-81bc-69ce8e5cd37e | Vegaaa99/2022-II-ProgCPP | 2022-09-12-numDeriv-FunctionPointers/derivatives-fptr_base.cpp | #include <iostream>
#include <cstdio>
#include <cmath>
using fptr = double(double); // a function that returns a double and receives a double
double f(double x);
double forward_deriv(double x, double h, fptr fun);
double central_deriv(double x, double h);
double richardson_deriv(double x, double h, int order);
int m... | ALGO | 0.99955 | 4.786207 | {
"github_metadata": {
"branch": "master",
"commit_count": 32,
"repo_created_at": "2022-10-10T15:19:22.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "d1357dcd4... |
6497a7ba-1182-4faf-ad96-2da54045111e | hugepeak/cabinair | src/evolve.cpp | #include "evolve.h"
int evolve_car(
Car * mycar,
Network * mynet
) {
add_car_into_network( mycar, mynet );
time_t t_start = mycar->getTimeStart();
time_t t_cursor = t_start;
time_t t_end = mycar->getTimeEnd();
double x_start = mycar->getXStart();
double y_start = mycar->getYStart();
double vx = my... | ALGO | 0.993563 | 4.727668 | {
"github_metadata": {
"branch": "master",
"commit_count": 32,
"repo_created_at": "2018-07-26T02:06:47.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "962821ddc... |
884a28f7-944f-4f66-b8f6-c033cee57a11 | deathblade1104/DSA_Practice | 2615-sum-of-distances/2615-sum-of-distances.cpp | class Solution {
public:
vector<long long> distance(vector<int>& nums) {
unordered_map<long long,vector<vector<long long>>>mp;
int n = nums.size();
for(int j=0;j<n;j++){
long long i = nums[j];
if(mp.count(i) == 0){
vector<vector<l... | ALGO | 0.999987 | 5.12758 | {
"github_metadata": {
"branch": "main",
"commit_count": 8577,
"repo_created_at": "2022-01-19T08:03: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": "6c216003b... |
71f2cc91-5815-418a-ad69-91dad27c895b | Halfdisposal/REINFORCEMENT-LEARNING | NEAT_Algorithm.cpp | #include <armadillo>
#include <SFML/Graphics.hpp>
#include <iostream>
#include "MoonLander.cpp"
#include <vector>
#include <random>
#include <algorithm>
class NEATNet{
public:
int input_size, hidden_size, output_size;
arma::mat w1, b1, w2, b2;
NEATNet(int input_size, int hidden_size, int output_siz... | ALGO | 0.99991 | 5.448432 | {
"github_metadata": {
"branch": "main",
"commit_count": 14,
"repo_created_at": "2025-03-03T09:09:49.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "efbea0438f3... |
af2c115a-b0eb-46da-a028-922f716eed21 | IEIAuto/AutoDRRT | src/autodrrt.application/perception/autoware.perception/traffic_light_ssd_fine_detector/lib/src/plugins/gather_topk.cpp | // Copyright 2023 TIER IV, Inc.
//
// 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 i... | TOOL | 0.909001 | 6.986749 | {
"github_metadata": {
"branch": "main",
"commit_count": 26,
"repo_created_at": "2023-08-11T02:20:18.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 23,
"forks": 14,
"issues": 1,
"pull_requests": 1
},
"file_meta": {
"content_id": "b0a3a7ae1... |
0fd5264e-2b15-4fe9-9e82-a5b3891aa677 | Thaleszh/Net-Topo | codigo/include/net_topo_charm_proxy.h |
#include <unordered_set>
#include "net_topo.h"
#include <middle-conv.h>
#include <topology.h>
class net_topo_charm_proxy {
private:
net_topo * net;
public:
net_topo_charm_proxy(net_topo * nettopo) : net(nettopo) {}
net_topo_charm_proxy(){}
~net_topo_charm_proxy() {
}
void init(LBTopology* topo) {
// ve... | ALGO | 0.90874 | 3.799207 | {
"github_metadata": {
"branch": "master",
"commit_count": 78,
"repo_created_at": "2018-05-11T14:55:41.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "b9845a633... |
f6f1214b-880b-47ac-ac97-c3ee9f383e42 | ishandutta2007/codeforces-x | xiaowuc1/normal/682/A.cpp | #include <algorithm>
#include <cassert>
#include <cmath>
#include <complex>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <ctime>
#include <deque>
#include <iostream>
#include <map>
#include <memory>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <string>
#include <unord... | ALGO | 0.999493 | 3.718799 | {
"github_metadata": {
"branch": "main",
"commit_count": 1,
"repo_created_at": "2024-10-30T16:38: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": "a17dda2f3c2e... |
ce257a06-ed4d-4007-9060-b627a944e18b | inhoekim/algorithm | baekjoon/dp/1126.cpp | #include <iostream>
#include <vector>
#include <algorithm>
#define INF 987654321
using namespace std;
int N;
vector<int> blocks;
vector<vector<int>> dp;
/* dp[curr_block_idx][height_diff] = 현재 curr_block_idx를 선택할 차례에 두 탑의 높이 차이가 height_diff일 때, N번_idx까지 진행했을 때 만들 수 있는 같은 높이의 탑의 최대 높이를 메모이제이션 */
// dp[curr_block_idx][... | ALGO | 0.999941 | 3.898958 | {
"github_metadata": {
"branch": "main",
"commit_count": 252,
"repo_created_at": "2021-09-16T02:15: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": "d367ea97da... |
a0791449-90f2-4055-84c7-ab0222d39e6f | areviRPC/AvanazaTechC | EstructurasCpp/CasaHash.cpp |
#include <iostream>
#include <stdio.h>
#include <string.h>
using namespace std;
// 14.5.1 declaracion de la clase tabla dispersa
// declaro la estructura tipo casa
struct TipoCasa{
char codigo[5];
char poblacion[31];
char direccion[51];
int habitaciones;
double precio... | TOOL | 0.995429 | 4.021676 | {
"github_metadata": {
"branch": "main",
"commit_count": 13,
"repo_created_at": "2025-03-18T14:02:13.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "fbaac645e8c... |
7286bf88-1c54-45de-b234-8f6bf4a5b1ff | mfem/mfem | examples/ex31.cpp | // MFEM Example 31
//
// Compile with: make ex31
//
// Sample runs: ex31 -m ../data/inline-segment.mesh -o 2
// ex31 -m ../data/hexagon.mesh -o 2
// ex31 -m ../data/star.mesh -o 2
// ex31 -m ../data/fichera.mesh -o 3 -r 1
// ex31 -m... | ALGO | 0.99026 | 4.609106 | {
"github_metadata": {
"branch": "master",
"commit_count": 24273,
"repo_created_at": "2015-06-11T21:42:21.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 1934,
"forks": 544,
"issues": 96,
"pull_requests": 189
},
"file_meta": {
"content_id": ... |
87025bf0-d45f-491b-a63a-f082ad1be017 | MohammadAh2002/Problems-Solving | Problems/Problem 34.cpp | /*
Write a program to ask the user to enter:
• TotalSales
The commission is calculated as one percentage * the total sales amount,
all you need is to decide which percentage
to use of the following:
• > 1000,000 -> Percentage is 1%
• > 500K to 1M -> Percentage is 2%
• > 100K – 500K -> Percentage is 3%
• >... | ALGO | 0.916483 | 4.391581 | {
"github_metadata": {
"branch": "main",
"commit_count": 32,
"repo_created_at": "2024-09-10T16:23: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": "c18b20832d3... |
0e71fe00-1bac-4fcc-9e91-aa4edcd82e7b | donivanev/State-Exam | Problems/3. Data Structures and Algorithms/Exams/sdp_2018_2.cpp | #include <iostream>
#include <fstream>
#include <sstream>
#include <vector>
#include <cmath>
using namespace std;
/*
Нека разгледаме следната структура от данни за бързо търсене, съхраняваща сортирана редица от цели числа:
Имаме списък с n елемента и нека с k означим горната цяла част на числото √𝑛. Всеки възел на сп... | ALGO | 0.999812 | 5.505961 | {
"github_metadata": {
"branch": "main",
"commit_count": 1,
"repo_created_at": "2025-07-15T16:56:42.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "a4c36a8e194d... |
2b3d14fb-902b-494c-ae57-335343f0c06d | kash1sh/practice_ques_cp | jpmc.cpp |
#include <bits/stdc++.h>
#define ll long long
#define pb push_back
#define vll vector<ll>
#define vpll vector<pair<ll, ll>>
#define fo(i, k, n) for (ll i = k; i < n; i++)
#define fo1(i, k, n) for (ll i = k; i <= n; i++)
#define rr return
#define ff first
#define ss second
#define Auto auto
#define llmin LONG_MIN
#defi... | ALGO | 0.999942 | 3.721893 | {
"github_metadata": {
"branch": "master",
"commit_count": 12,
"repo_created_at": "2021-11-24T16:54: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": "3db1c7dfe... |
9d988a7e-a0a1-464e-8cd0-3a3500cd9a79 | jomael/NaroCAD | Lib/AlternateWrapper/NaroOccCore/NaroOccCore-build-desktop/OCWrappersExt/out/Extrema/Extrema_SeqPOnCOfCCFOfELCCOfLocateExtCC.cpp | // File generated by CPPExt (CPP file)
//
#include "Extrema_SeqPOnCOfCCFOfELCCOfLocateExtCC.h"
#include "../Converter.h"
#include "Extrema_POnCurv.h"
#include "Extrema_SequenceNodeOfSeqPOnCOfCCFOfELCCOfLocateExtCC.h"
using namespace OCNaroWrappers;
OCExtrema_SeqPOnCOfCCFOfELCCOfLocateExtCC::OCExtrema_SeqPOnCOfCCFOf... | ALGO | 0.911683 | 3.334592 | {
"github_metadata": {
"branch": "master",
"commit_count": 1,
"repo_created_at": "2018-05-07T04:31:51.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 20,
"forks": 5,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "73eb49387... |
6142a800-45c5-4234-b3f1-6a5ddd746d1a | rish-singhal/CompetitiveProgramming | codechef/feb20long/12.cpp | #include <bits/stdc++.h>
using namespace std;
#define LL long long
#define vi vector<int>
#define srt(a) sort(a.begin(), a.end());
#define se second
#define fi first
#define pb push_back
#define all(x) (x).begin(), (x).end()
#define forn(i, n) for (int i = 0; i < (int)(n); ++i)
#define for1(i, n) for (int i = 1; i <= (... | ALGO | 0.99984 | 3.524641 | {
"github_metadata": {
"branch": "master",
"commit_count": 83,
"repo_created_at": "2020-03-17T16:59:44.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "c841968a1... |
effaac57-2b03-4216-9e12-ea9cf8a2f18d | ishandutta2007/codeforces-i | inventure/normal/833/B.cpp | #include <bits/stdc++.h>
using namespace std;
inline int read(){int x=0,f=1;char ch=getchar();while(ch<'0'||ch>'9'){if(ch=='-')f=-1;ch=getchar();}while(ch>='0'&&ch<='9'){x=x*10+ch-'0';ch=getchar();}return x*f;}
const int maxn = 35000 + 50;
namespace SegmentTree{
struct Node{
int l , r , mx , lzy;
void Upd( int... | ALGO | 0.999985 | 3.928572 | {
"github_metadata": {
"branch": "main",
"commit_count": 1,
"repo_created_at": "2024-04-11T05:39: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": "1d0b20d6560d... |
a2f4babf-dc8c-44bc-8365-4afee9ca3d92 | jeremih/ProjectEulerPlus | ProjectEulerPlus/Problem11.cpp | #include <map>
#include <set>
#include <list>
#include <cmath>
#include <ctime>
#include <deque>
#include <queue>
#include <stack>
#include <string>
#include <bitset>
#include <cstdio>
#include <limits>
#include <vector>
#include <climits>
#include <cstring>
#include <cstdlib>
#include <fstream>
#include <numeric>
#inc... | ALGO | 0.999649 | 4.451211 | {
"github_metadata": {
"branch": "master",
"commit_count": 2,
"repo_created_at": "2019-03-19T23:41:38.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "b80d2af67c... |
32aa99dc-a1b9-402f-ab3b-d55c7f7ba188 | micklevast/Dsa_practice | Anuj-Bhaiya/Heap/revsion_of_vector.cpp | #include<iostream>
#include<vector>
#include<algorithm>
using namespace std;
void print_arr(vector<int> arr)
{
for(int &x:arr)
{
cout<<x<<" ";
}
cout<<endl;
}
// In C++, we have a STL Algorithm find(start, end, item), it accepts three arguments,
// start -> Iterator pointing to the start of a r... | ALGO | 0.998532 | 4.40619 | {
"github_metadata": {
"branch": "main",
"commit_count": 3,
"repo_created_at": "2022-02-03T14:06: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": "91180db263b6... |
8df5c491-6ca2-4f30-879c-f02898ed09e2 | jaagrit10/Competitive-Programming-DS | CODEFORCES/beautifulArray_CODEFORCES.cpp | // TEMPLATE_JAAGRIT_ARORA
#include <bits/stdc++.h>
using namespace std;
#define ll long long int
#define flash ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL);
#define forloop_n for(ll i=0; i<n; i++)
#define And &&
#define Or ||
void solve(ll n)
{
ll lo = 0;
ll hi = 10000;
ll mid = 0;
... | ALGO | 0.999959 | 4.656322 | {
"github_metadata": {
"branch": "main",
"commit_count": 72,
"repo_created_at": "2021-04-19T15:06: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": "a347fba5ce3... |
bcbcc24e-f981-4743-a2eb-62ede8613c0c | tayu0110/atcoder | abc/abc70c.cpp | #include<iostream>
#include<iomanip>
#include<string>
#include<vector>
#include<algorithm>
#include<utility>
#include<tuple>
#include<map>
#include<queue>
#include<deque>
#include<set>
#include<stack>
#include<numeric>
#include<cstdio>
#include<cstdlib>
#include<cstring>
#include<cmath>
using namespace std;
using ll ... | ALGO | 0.999976 | 4.112635 | {
"github_metadata": {
"branch": "master",
"commit_count": 21,
"repo_created_at": "2021-05-02T14:14: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": "3ab2f5b04... |
4a6f183d-9def-4870-9404-3ca324120cb1 | andrewqt/Competitive-Programming | CodeForces/_1139_D_StepsToOne/_1139_D_StepsToOne.cpp |
// Problem : D. Steps to One
// Contest : Codeforces - Codeforces Round #548 (Div. 2)
// URL : https://codeforces.com/contest/1139/problem/D
// Memory Limit : 256 MB
// Time Limit : 2000 ms
// Powered by CP Editor (https://github.com/cpeditor/cpeditor)
#include <bits/stdc++.h>
using namespace std;
int N;
long long ... | ALGO | 0.999909 | 4.808753 | {
"github_metadata": {
"branch": "master",
"commit_count": 12,
"repo_created_at": "2018-09-08T12:27:15.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "1f023e9a6... |
958965d7-860e-448c-a59e-1ee240bee75f | xmlb88/algorithm | leetcode/array/15.threeSum.array_11.cpp | #include <iostream>
#include <vector>
using namespace std;
vector<vector<int>> threeSum(vector<int>& nums) {
vector<vector<int>> result;
for (int i = 0; i < nums.size() - 2; i++) {
for (int j = i + 1; j < nums.size() - 1; j++) {
for (int k = j + 1; k < nums.size(); k++) {
if... | ALGO | 0.999902 | 5.854262 | {
"github_metadata": {
"branch": "master",
"commit_count": 250,
"repo_created_at": "2020-09-09T02:44:20.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 4,
"pull_requests": 0
},
"file_meta": {
"content_id": "1e6b4b82... |
4716b0a0-bcf6-4504-bb89-e081a30219c7 | zimpha/acm-icpc | archived/LTIME01/COUPON.cc | #include <vector>
#include <cstdio>
#include <cstring>
#include <cstdlib>
#include <algorithm>
using namespace std;
typedef long long LL;
typedef vector <LL> VI;
vector <VI> Price, Discount, dp;
int main() {
int T, N, M; scanf("%d", &T);
while (T --) {
Price.clear(); Discount.clear(); dp.clear();
scanf("%d%d",... | ALGO | 0.999908 | 3.317667 | {
"github_metadata": {
"branch": "master",
"commit_count": 94,
"repo_created_at": "2013-06-01T11:50:19.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 24,
"forks": 10,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "0016866... |
1405d507-968a-4171-856d-f84f7292f453 | demionee/jpo | jpo2/zad4.cpp | #include <iostream>
#include <string>
std::string lower (std::string str) {
for (size_t i = 0; i < str.size(); i++) {
str[i] = std::tolower(str[i]);
}
return str;
}
int main() {
int counter = 0;
std::string str;
char letter;
std::cout << "Insert a phrase: " << std::endl;
std::get... | ALGO | 0.998596 | 4.379979 | {
"github_metadata": {
"branch": "main",
"commit_count": 1,
"repo_created_at": "2025-02-24T13:21: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": "dc901c226016... |
612de194-9d0c-49c3-8468-1e7848eef383 | joseuribe1996/CSC_5_SUMMER | Hmwk/Assignment_3/Savitch_9th_Ch3_Problem7_ValOfE/savitch_9th_Problem7_val_of_e_Factorial/main.cpp | /*
* File: main.cpp
* Author: <NAME>
* Created on July 06, 2016
* Purpose: Factorial problem
*/
//System Libraries
#include <cstdlib>
#include <iostream>
using namespace std; //namespace of the system libraries
//User libraries. We don't have these yet
//Global constant libraries/conversions
//Function P... | ALGO | 0.999576 | 3.920232 | {
"github_metadata": {
"branch": "master",
"commit_count": 24,
"repo_created_at": "2016-06-23T02:59: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": "750df8b64... |
31b3e93b-305b-4dc7-b916-93ba1c673e15 | tranvandat05032002/C-C-DoThi | huongdoituongCC++/OOPkethua/thuattoan/tohoplap.cpp | #include <bits/stdc++.h>
using namespace std;
#define ll long long
int mod = 1e9 + 7, N = 1e6 ;
ll t, n, k ;
ll powmod( ll a, ll b, ll m ){
ll res = 1;
a %= m;
while( b ){
if( b & 1 ){
res *= a;
res %= m;
}
a *= a;
a %= m;
b /= 2;
}
return res;
}
ll euclid( ll a, ll m ){
cout << powmod(a, m... | ALGO | 0.999969 | 4.928932 | {
"github_metadata": {
"branch": "main",
"commit_count": 3,
"repo_created_at": "2023-03-12T20:44:02.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "cfa994b9e552... |
0fb19903-23e4-4357-ac0b-f932ef154b0b | mikey96g/ALC | CA3/CA3/Main.cpp | //<NAME>
#include "HuffManTree.h"
#include<string>
#include<cstdlib>
#include <fstream>
#include <iostream>
#include <map>
#include <bitset>
#include <sstream>
using namespace std;
// to store the frequency of character of the input data
map<char, int >charList;
// to map each character its huffman value
map<char, stri... | ALGO | 0.996028 | 3.468383 | {
"github_metadata": {
"branch": "master",
"commit_count": 43,
"repo_created_at": "2018-02-08T15:12: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": "6434f4671... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.