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 |
|---|---|---|---|---|---|---|---|
60444b06-a7d3-4069-96d3-e8dfeb6222e4 | luqmanarifin/cp | 0-unclassified/seqtree.cpp | // kadalbonek
#include <bits/stdc++.h>
using namespace std;
const int N = 2e5 + 5;
int a[N];
int main() {
int n;
scanf("%d", &n);
int m = 2 * (n - 1);
int sum = 0;
vector<pair<int, int>> vec;
for(int i = 1; i <= n; i++) {
scanf("%d", a + i);
vec.emplace_back(a[i], i);
sum += a[i];
if(... | ALGO | 0.999931 | 3.498679 | {
"github_metadata": {
"branch": "master",
"commit_count": 772,
"repo_created_at": "2016-02-09T04:26:58.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 6,
"forks": 0,
"issues": 1,
"pull_requests": 0
},
"file_meta": {
"content_id": "0ab1f632... |
ed45bc38-3b73-437b-b425-4b86a7389b9f | raincross7/code-similarity | codes/train_code/problem273/problem273_452.cpp | //#define _GLIBCXX_DEBUG//TLEの原因になるので注意!!!!!!!!!!!
#include<cmath>
#include <bits/stdc++.h>
typedef long long ll;
using namespace std;
vector<int> arr;
stack<int> st;
queue<int> qu;
queue<pair<int,int> > qu2;
#define rep(i,n) for(int i=0; i<(int)(n); i++)
#define rep2(i,n) for(int i=1; i<=(int)(n); i++)
#define mins(x... | ALGO | 0.999535 | 3.234224 | {
"github_metadata": {
"branch": "main",
"commit_count": 3,
"repo_created_at": "2024-03-06T05:07:19.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "a4b7f7068a7a... |
922ea00f-86e1-4537-8368-ad4b7508d7ab | raincross7/code-similarity | codes/train_code/problem377/problem377_221.cpp | #include <bits/stdc++.h>
using namespace std;
#define int long long
#define double long double
const int MAX_N = 1e5 + 5;
const int MAX_L = 20; // ~ Log N
const int MOD = 1e9 + 7;
const int INF = 1e9 + 7;
typedef vector<bool> vb;
typedef vector<vb> vvb;
typedef vector<int> vi;
typedef pair<int,int> ii;
typedef vec... | ALGO | 0.999955 | 4.333835 | {
"github_metadata": {
"branch": "main",
"commit_count": 3,
"repo_created_at": "2024-03-06T05:07:19.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "d90652170b2c... |
bfe71e61-777a-4eda-9ac7-ee0d8ca42be1 | NalinDalal/Leetcode | c++/147.UniqueBST.cpp | /*
https://leetcode.com/problems/unique-binary-search-trees/description/
96. Unique Binary Search Trees
Given an integer n, return the number of structurally unique BST's (binary
search trees) which has exactly n nodes of unique values from 1 to n.
Example 1:
Input: n = 3
Output: 5
Example 2:
Input: n = 1
Output: 1... | ALGO | 0.999993 | 6.990699 | {
"github_metadata": {
"branch": "main",
"commit_count": 395,
"repo_created_at": "2024-03-19T02:48:47.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 6,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "0b91e77a14... |
0abda41f-3dc5-4c72-8a95-3e28d22642a3 | sanjeev261/DSA3 | 0034-find-first-and-last-position-of-element-in-sorted-array/0034-find-first-and-last-position-of-element-in-sorted-array.cpp |
class Solution {
public:
vector<int> searchRange(vector<int>& nums, int target) {
vector<int> result(2, -1); // Initialize result with -1 for both positions
int n = nums.size();
// Find the first occurrence of target
int low = 0;
int high = n - 1;
while (low <= high... | ALGO | 0.999937 | 6.874716 | {
"github_metadata": {
"branch": "main",
"commit_count": 24,
"repo_created_at": "2024-06-12T13:26: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": "8c1c2fbc454... |
689a75c1-eb6b-49a7-9f83-1b9ca5e55630 | ishandutta2007/codeforces-r | rubikun/normal/1464/B.cpp | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
template<class T>bool chmax(T &a, const T &b) { if (a<b) { a=b; return true; } return false; }
template<class T>bool chmin(T &a, const T &b) { if (b<a) { a=b; return true; } return false; }
#define all(x) (x).begin(),(x).end()
#define fi first
#define ... | ALGO | 0.999918 | 3.611709 | {
"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": "21d2b6e4c896... |
1a501c9f-21b9-4c9b-b131-d651894790fb | paulnewman1979/edocteel | 085/858/main.cpp | #include <iostream>
#include <vector>
#include <algorithm>
#include <stdio.h>
using namespace std;
class Solution {
public:
int mirrorReflection(int p, int q) {
int a = p, b = q;
while ((a != 0) && (b != 0)) {
if (a > b) {
a = a % b;
} else {
... | ALGO | 0.999993 | 4.10737 | {
"github_metadata": {
"branch": "master",
"commit_count": 533,
"repo_created_at": "2015-08-30T22:52:58.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "d321d556... |
53a0768e-6d6b-4a59-8f80-bb4fc56314a3 | bobbiesimpson/bemquad | include/Adaptive1DClenshaw.h | #ifndef ADAPTIVE_1D_CLENSHAW_H
#define ADAPTIVE_1D_CLENSHAW_H
#include "IQuadrature.h"
#include <mutex>
namespace bemquad {
/// A struct which hold all the necessary information for a 'cell' that represents
/// a range of our integration domain.
struct Cell {
/// Constructor
... | ALGO | 0.999817 | 6.343713 | {
"github_metadata": {
"branch": "master",
"commit_count": 12,
"repo_created_at": "2023-07-12T22:08: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": "aa0dc193e... |
4d99a235-89d9-47c0-8c2e-c5054c1ceaf8 | a-y-u-s-h/competitive | codechef/HEAPEDU2.cpp | #include <bits/stdc++.h>
int main(int argc, char const *argv[]) {
int N;
std::cin >> N;
/*
======================================
Here's a step-by-step process for
deleting the minimum element (root)
from a min-heap:
Remove the Root:
1. Swap the root with the last leaf
... | ALGO | 0.999982 | 5.346143 | {
"github_metadata": {
"branch": "master",
"commit_count": 1,
"repo_created_at": "2024-06-26T23:29:49.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "0680898495... |
6f0b9d9f-8cf0-4d3e-9255-ef66726d6bbe | ishandutta2007/codeforces-k | krk/normal/1469/F.cpp | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
const int Maxn = 1000005;
const int Maxm = 4194304;
int n, k;
int a[Maxn];
ll st[Maxm];
ll fl[Maxm];
int res = Maxn + 1;
void downOn(int v, int sz, ll f)
{
st[v] += ll(sz) * f;
fl[v] += f;
}
void Down(int v, int l, int m, int r)
{
if (fl[v]) {
... | ALGO | 0.999965 | 3.537442 | {
"github_metadata": {
"branch": "main",
"commit_count": 1,
"repo_created_at": "2024-04-11T06:06: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": "1cecae08181b... |
fc1d80d5-818b-463e-8857-8b20d2ceb704 | imorlxs/PracticasALG | P3/src/Problema3.cpp | #include <iostream>
#include <vector>
#include <map>
#include <limits>
#include <queue>
using namespace std;
#define LIM 999
struct Arista{
int hacia;
int peso;
};
void addArista(map<int, vector<Arista>>& grafo, int desde, int hacia, int peso){
grafo[desde].push_back({hacia, peso});
grafo[hacia].push_back({des... | ALGO | 0.999964 | 5.587339 | {
"github_metadata": {
"branch": "master",
"commit_count": 216,
"repo_created_at": "2024-02-29T17:12: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": "e89916cf... |
b236a155-0832-4a87-94dd-0a6a2e0ddc4f | jungyeonPark/baekjoon-study | barkingDog/기초코드2/2445.cpp | // BOJ 2445번 별 찍기-8
#include <bits/stdc++.h>
using namespace std;
int main(void)
{
ios::sync_with_stdio(0);
cin.tie(0);
int n;
cin >> n;
for (int i = 1; i <= n; i++)
{
for (int j = 0; j < 2 * n; j++)
{
if (j < i || j > 2 * n - 1 - i)
cout << '*';
... | ALGO | 0.99999 | 4.028916 | {
"github_metadata": {
"branch": "master",
"commit_count": 17,
"repo_created_at": "2020-08-18T14:39: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": "ccd40846b... |
304c90f4-4391-4240-9492-ad008ef6757a | AmanSharma0710/cp | Codeforces Ladders/1800-1899/D_Pair_of_Numbers.cpp | #include<bits/stdc++.h>
using namespace std;
#define int long long int
signed main(){
ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL);
int n;
cin>>n;
vector<int> a(n);
for(int i=0; i<n; i++){
cin>>a[i];
if(a[i]==1){
cout<<1<<" "<<n-1<<endl;
c... | ALGO | 0.999849 | 3.24052 | {
"github_metadata": {
"branch": "main",
"commit_count": 6,
"repo_created_at": "2022-05-03T21:58: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": "fb9534628f91... |
56e5d10e-a11f-4dbd-99ba-00ba7171690e | OftenDeadKanji/Studies | Ja - projekt/Zrodla/MAIN/Generator/main.cpp | #include <iostream>
#include <fstream>
#include <cmath>
#include <time.h>
using namespace std;
void generuj(ofstream& plik, int liczba)
{
int* niewiadome = new int[liczba];
for (int i = 0; i < liczba; i++) {
niewiadome[i] = (rand() % 11) - 5;
while (niewiadome[i] == 0)
niewiadome[i] = (rand() % 11) - 5;
}... | TOOL | 0.96211 | 3.327677 | {
"github_metadata": {
"branch": "master",
"commit_count": 33,
"repo_created_at": "2021-06-22T19:34: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": "2ae51d6de... |
db8c4d99-ac72-4214-a190-b2222cd8a49c | p4lang/p4c | backends/tofino/bf-p4c/mau/table_placement.cpp | /**
* Copyright (C) 2024 Intel Corporation
*
* 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 ag... | ALGO | 0.918136 | 6.617087 | {
"github_metadata": {
"branch": "main",
"commit_count": 3803,
"repo_created_at": "2016-04-04T18:12:32.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 774,
"forks": 468,
"issues": 337,
"pull_requests": 99
},
"file_meta": {
"content_id": "8b1... |
021ebe0c-1416-477b-a1e2-e3cab626a85b | iontorrent/TS | external/vcflib/smithwaterman/Repeats.cpp | #include "Repeats.h"
map<string, int> repeatCounts(long int position, const string& sequence, int maxsize) {
map<string, int> counts;
for (int i = 1; i <= maxsize; ++i) {
// subseq here i bases
string seq = sequence.substr(position, i);
// go left.
int j = position - i;
... | ALGO | 0.993283 | 5.016744 | {
"github_metadata": {
"branch": "master",
"commit_count": 49,
"repo_created_at": "2012-01-13T15:25:43.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 44,
"forks": 14,
"issues": 30,
"pull_requests": 7
},
"file_meta": {
"content_id": "b180298... |
5dcb7aeb-ff20-44a8-afbf-e95bc54a3016 | GarageGames/Torque3D | Engine/source/math/util/frustum.h | //-----------------------------------------------------------------------------
// Copyright (c) 2012 GarageGames, LLC
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to
// deal in the Software without restrictio... | TOOL | 0.992756 | 7.141365 | {
"github_metadata": {
"branch": "development",
"commit_count": 3540,
"repo_created_at": "2012-09-18T20:33:56.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 3358,
"forks": 1193,
"issues": 309,
"pull_requests": 64
},
"file_meta": {
"content_... |
a4e23b27-88eb-40ee-a7da-14fa422666f5 | vlad2010/MSc_DataEngineering_Results | OpenAI_API_Issues64_Experiment/2024_10_22/New_Code_Selected_26_Files/Issue_53/New_generated_code_01.cpp | #include <dirent.h>
#include <fstream>
#include <iostream>
#include <vector>
#include <regex>
#include <stdexcept>
#include <limits> // Include to use for streamsize
#include "constants.h"
#include "queryFile.h"
#include "superSearch.h"
void queryFile(std::string filePath, const char* query, std::vector<Result>& resu... | TOOL | 0.938487 | 5.821285 | {
"github_metadata": {
"branch": "main",
"commit_count": 8,
"repo_created_at": "2024-10-22T18: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": "fd4d13182db9... |
42d999f6-36a2-4ea0-b18c-75c4e82378e9 | ezjinha/Algorithms | Simulation/SWEA_2382_MicrobeIsolation/microbe_isolation.cpp | #include <iostream>
#include <vector>
using namespace std;
const int UP = 1;
const int DOWN = 2;
const int LEFT = 3;
const int RIGHT = 4;
class Microbe
{
public:
int y;
int x;
int num;
int dir;
Microbe() {}
Microbe(int _y, int _x, int _num, int _dir) : y(_y), x(_x), num(_num), dir(_di... | ALGO | 0.999979 | 4.410787 | {
"github_metadata": {
"branch": "master",
"commit_count": 160,
"repo_created_at": "2022-11-03T05:54: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": "c0ca4343... |
0fc0f457-91e3-4526-9cb5-a2befa752112 | sowbh/Strivers-A2Z-DSA-Course-Sheet | Step 03 - Arrays/Easy/Find_the_union_of_2sorted_arrays.cpp | /*Problem statement
Given two sorted arrays, ‘a’ and ‘b’, of size ‘n’ and ‘m’, respectively, return the union of the arrays.
The union of two sorted arrays can be defined as
an array consisting of the common and the distinct elements of the two arrays.
The final array should be sorted in ascending order.
Note: 'a' ... | ALGO | 0.999932 | 5.520036 | {
"github_metadata": {
"branch": "master",
"commit_count": 1,
"repo_created_at": "2024-02-20T16:14: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": "47d0847cf3... |
00f76dd8-a595-49b2-bcce-e5323fbba519 | robotology-legacy/kdl_codyco | src/utils.cpp | /**
* Copyright (C) 2013 IIT - Istituto Italiano di Tecnologia
* Author: <NAME>
* website: http://www.codyco.eu
*/
#include <iostream>
#include <kdl/kinfam_io.hpp>
#include <kdl/frames_io.hpp>
#include <sstream>
#include <fstream>
#include <Eigen/LU>
#include "kdl_codyco/utils.hpp"
#include "kdl_codyco/treeseria... | ALGO | 0.917718 | 5.884945 | {
"github_metadata": {
"branch": "master",
"commit_count": 245,
"repo_created_at": "2013-05-14T13:28:53.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 4,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "3405261dd... |
9c9512ed-046a-4326-af0a-5b8cec65962f | OpenXRay/xray-15 | cs/sdk/3d_sdk/3dsmax/ver-6.0/samples/modifiers/bonesdef/BonesDef_UniformGrid.h | #ifndef __BONESDEFUNIFORMGRID__H
#define __BONESDEFUNIFORMGRID__H
//Fast closest vertex lookup using a uniform grid
//juat a table of all the points in a cell
class Grid
{
public:
Tab<int> index;
};
//Uniform Grid class to look up closest vertices faster than the typical
//nxn lookup
class UniformGrid
{
public:
U... | ALGO | 0.934301 | 5.326594 | {
"github_metadata": {
"branch": "xd_dev",
"commit_count": 610,
"repo_created_at": "2014-08-22T12:09:41.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 175,
"forks": 64,
"issues": 3,
"pull_requests": 0
},
"file_meta": {
"content_id": "644f87... |
8f523121-3194-4a10-bddc-2c77e8ca0f96 | lsmd23/Algorithm | HM3/src/main.cpp | #include <iostream>
#include <fstream>
#include <utility>
#include <vector>
#include <iomanip>
#include <chrono>
#include "Point.h"
using namespace std;
vector<Point> points; // 存储点的数组
pair<Point, Point> nearestPoints; // 最近点对
double minDistance; // 最小距离
int generateRandomPoints(int num_points); ... | ALGO | 0.998292 | 5.198904 | {
"github_metadata": {
"branch": "main",
"commit_count": 3,
"repo_created_at": "2025-07-04T12:17:59.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "3f7abe03273c... |
5c81b647-d44c-4101-8578-70843c1ef2a8 | Mids/LeetCode | 33. Search in Rotated Sorted Array.h | //
// Created by Jin on 5/2/2021.
//
#ifndef LEETCODE_33_SEARCH_IN_ROTATED_SORTED_ARRAY_H
#define LEETCODE_33_SEARCH_IN_ROTATED_SORTED_ARRAY_H
using namespace std;
// iterative
class Solution {
public:
int search(vector<int> &nums, int target) {
int start = 0, end = nums.size() - 1;
while (start <= end) {
a... | ALGO | 0.999983 | 6.581824 | {
"github_metadata": {
"branch": "master",
"commit_count": 142,
"repo_created_at": "2021-01-04T07:18:03.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "74f5f0b8... |
d9c2f2aa-2bd6-43d5-8972-dec290914ed6 | inglada/OTB | Utilities/ITK/Code/Common/itkMinimumDecisionRule.cxx | /*=========================================================================
Program: Insight Segmentation & Registration Toolkit
Module: $RCSfile: itkMinimumDecisionRule.cxx,v $
Language: C++
Date: $Date: 2009-02-06 20:53:05 $
Version: $Revision: 1.6 $
Copyright (c) Insight Software Consortiu... | ALGO | 0.998489 | 6.413184 | {
"github_metadata": {
"branch": "master",
"commit_count": 10982,
"repo_created_at": "2011-07-01T06:29:23.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 5,
"forks": 4,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "1753ae... |
afc945c3-9f7e-47d9-b1c7-6f66cf6646c4 | arrayfire/arrayfire | src/backend/cpu/kernel/lookup.hpp | /*******************************************************
* Copyright (c) 2015, ArrayFire
* All rights reserved.
*
* This file is distributed under 3-clause BSD license.
* The complete license agreement can be obtained at:
* http://arrayfire.com/licenses/BSD-3-Clause
**********************************************... | ALGO | 0.995924 | 6.322162 | {
"github_metadata": {
"branch": "master",
"commit_count": 6246,
"repo_created_at": "2014-10-28T20:58:33.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 4739,
"forks": 546,
"issues": 277,
"pull_requests": 18
},
"file_meta": {
"content_id": "... |
68f5ff0d-6476-42c7-85bd-6b906b089e24 | AlqanbarRami/DigitalDice-7segmentsDisplay_Embedded | main4.cpp | #include <avr/io.h>
#include <util/delay.h>
#include <stdlib.h>
void One(){
PORTB = PORTB &~ 1 << PB5;
PORTB = PORTB &~ 1 << PB4;
PORTB = PORTB &~ 1 << PB3;
PORTB = PORTB &~ 1 << PB2;
PORTD = PORTD &~ 1 << PD7;
PORTD = PORTD | 1 << PD6;
PORTD = PORTD | 1 << PD5;
PORTD = PORTD | 1 << PD4;
}
void Two(){
PORTB = PORT... | ALGO | 0.97388 | 3.943159 | {
"github_metadata": {
"branch": "master",
"commit_count": 1,
"repo_created_at": "2021-10-29T07:38: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": "ed88c41664... |
ffaeb323-6ad1-482d-bd09-8f578c89d17f | Parth-Gandhi96/CS-301-High-Performance-Computing | manualReduction.cpp | #include <bits/stdc++.h>
#include <omp.h>
#include <time.h>
using namespace std;
#define ll long long int
ll serialSum = 0;
ll parallelManualSum=0;
ll parallelSum=0;
void store(ll n,ll arr[]){
for(ll i=0;i<n;i++){
arr[i] = 1;
}
}
double serial(ll n,ll arr[]){
double t1 = omp_get_wtime();
for(ll i=0;i<n;i++){
... | ALGO | 0.9976 | 3.398123 | {
"github_metadata": {
"branch": "master",
"commit_count": 2,
"repo_created_at": "2016-09-23T07:22: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": "2cd1dc39f6... |
d90e9522-26a8-4bc3-b819-7827c82e3d6e | klund1/color_som | SelfOrganizingMap.hpp | #ifndef SELFORGANIZINGMAP_H
#define SELFORGANIZINGMAP_H 1
#include <vector>
#include <random>
#include <limits>
#include <algorithm>
#include <thread>
#include <mutex>
#include <atomic>
#include <boost/geometry.hpp>
#include <boost/geometry/index/rtree.hpp>
#include <Eigen/Dense>
#include <unordered_map>
#include ... | ALGO | 0.965948 | 4.719633 | {
"github_metadata": {
"branch": "master",
"commit_count": 2,
"repo_created_at": "2016-12-05T20:09: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": "bea8551195... |
0cb6b296-804a-4f44-bb6b-f95e696e9171 | vijaysaravanan1812/linked_list | linked_list_problem19.cpp | //19) merge two sorted list
#include<iostream>
using namespace std;
struct node
{
int data;
node *next;
};
node * merge(node *& head1, node *& head2)
{
int len1 = 0, len2 = 0;
node * temp1 = head1,* prev1 = NULL;
node * temp2 = head2,* prev2 = NULL;
for (node * temp = head1 ; temp != N... | ALGO | 0.999473 | 4.344213 | {
"github_metadata": {
"branch": "master",
"commit_count": 8,
"repo_created_at": "2020-08-07T15:48: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": "7f1a06ab57... |
d2e1676b-9608-4c40-a23b-f3707226e36f | kutta97/super-simple-shell | srcs/match.cpp | #include "../includes/simple_shell.h"
// -1 : answer is not calculated
// 1 : match true
// 0 : match false
int cache[101][101];
string filename;
string wildCard;
void initCache() {
for (int i = 0; i < 101; i++)
for (int j = 0; j < 101; j++)
cache[i][j] = -1;
}
bool match(int w, int f) {
... | TOOL | 0.974154 | 3.927781 | {
"github_metadata": {
"branch": "master",
"commit_count": 2,
"repo_created_at": "2022-06-13T13:17: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": "b59144c59a... |
c12f2e9c-8243-463e-b0c8-6de90cc4c986 | Sanjeev2487/accepted | ACODE.cpp | #include <algorithm>
#include <cctype>
#include <climits>
#include <cmath>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <iostream>
#include <list>
#include <map>
#include <queue>
#include <set>
#include <sstream>
#include <string>
#include <vector>
typedef long long int ll;
#define gc getchar_unlock... | ALGO | 0.999766 | 3.129294 | {
"github_metadata": {
"branch": "master",
"commit_count": 46,
"repo_created_at": "2016-10-21T20:23:00.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "29a0377a8... |
286d8b7d-0d5c-463a-8a60-cc4ab2991ce0 | AshwinkumarPillai/LeetCode | Problems/1091_Shortest_Path_in_Binary_Matrix.cpp | class Solution {
public:
bool isValid(int i, int j, int n){
return (i >=0 && j >= 0 && i < n && j < n);
}
int shortestPathBinaryMatrix(vector<vector<int>>& grid) {
queue<pair<int, int>>q;
q.push({0,0});
int ans = 0;
int n = grid.size();
... | ALGO | 0.999995 | 5.569197 | {
"github_metadata": {
"branch": "master",
"commit_count": 158,
"repo_created_at": "2020-10-02T09:25: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": "3800a90b... |
23a7c216-bda3-46ff-8c80-c841a1d7a730 | HiImDarwin/LeetCodePraticing | 1917-maximum-average-pass-ratio/1917-maximum-average-pass-ratio.cpp | class Solution {
struct smaller {
bool operator() (const pair<double,int> &a,const pair<double,int> &b) {
return a.first < b.first;
}
};
public:
double maxAverageRatio(vector<vector<int>>& classes, int extraStudents) {
priority_queue<pair<double,int>,vector<pair<double,int>>,smaller> pq;
... | ALGO | 0.999549 | 4.950382 | {
"github_metadata": {
"branch": "main",
"commit_count": 2145,
"repo_created_at": "2025-05-25T06:16: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": "b10020ad6... |
af7b4bec-c933-418b-a2bf-589eff9b813e | latuya23/rt2 | Parser.cpp | #define GLM_SWIZZLE
#include "Parser.h"
#include "Model.h"
#include <assert.h>
#include <fstream>
#include <string>
#include <iostream>
#include <glm/glm.hpp>
#include <glm/gtx/string_cast.hpp>
#include <glm/gtc/matrix_transform.hpp>
#include <glm/gtc/matrix_inverse.hpp>
#define MAX_CHARS 1000
const double PI = 3.1415... | TOOL | 0.991628 | 3.511311 | {
"github_metadata": {
"branch": "master",
"commit_count": 18,
"repo_created_at": "2016-01-17T20:15:05.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "f0d9bc8f1... |
b3e83af4-a01d-4596-bb53-59ac5b18a96e | cshsgy/ExoCubed | src/opacity/Giants/microwave/absorption_function_ph3.cpp | /**************************************************************************
===== JUNO codes =====
Copyright (C) 2019 California Institute of Technology (Caltech)
All rights reserved.
Written by <NAME> (<EMAIL>)
Adapted by <NAME> (<EMAIL>) to SNAP structure
************************... | ALGO | 0.997023 | 5.490104 | {
"github_metadata": {
"branch": "main",
"commit_count": 114,
"repo_created_at": "2023-07-11T13:19:03.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 4,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "1a85c5c7fb... |
9d4affb8-70ce-46bd-8964-63301be99498 | Shikhar21121999/ds-algo-busted | max_profit_on_two_stock_dp.cpp | // max_profit_on_two_stocks_dp
#include <bits/stdc++.h>
# define C continue
# define R return
# define D double
# define I insert
# define ll long long
# define ld long double
# define ull unsigned long long
# define ui unsigned int
# define pb push_back
# define pf push_front
# define vi vector < int >
# def... | ALGO | 0.999786 | 4.934342 | {
"github_metadata": {
"branch": "main",
"commit_count": 78,
"repo_created_at": "2020-11-15T04:00: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": "f0474a978ef... |
97fc87f1-814c-4fcc-ae8f-187e0c8f0092 | NavySunKOR/DataStructureAndAlgorithm | Project1/main.cpp | #include <iostream>
using namespace std;
int main(void)
{
int testCase;
cin >> testCase;
/*int* choX = new int[testCase];
int* choY = new int[testCase];
int* rangeFromCho = new int[testCase];
int* baekX = new int[testCase];
int* baekY = new int[testCase];
int* rangeFromBaek = new int[... | ALGO | 0.997786 | 3.847281 | {
"github_metadata": {
"branch": "master",
"commit_count": 10,
"repo_created_at": "2020-09-08T07:55: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": "90f772e80... |
c2236fd1-522f-435d-a7c5-55f67925541a | pavel0807/Algorithm-c- | Sort/Sort/Shell/SortShell.h | #ifndef SortShell_h
#define SortShell_h
#include <cmath>
//<NAME>
template<typename RandomIterator,typename Compare,typename offsetIterator>
void ShellSorting(RandomIterator first,RandomIterator last,Compare comp,offsetIterator beginOffset,offsetIterator endOffset )
{
for(auto offset = endOffset; offset >= beginO... | ALGO | 0.994807 | 4.730808 | {
"github_metadata": {
"branch": "main",
"commit_count": 2,
"repo_created_at": "2021-05-20T11:16: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": "2c5fa20be867... |
00c475b3-2a44-4646-92ea-ad185c9775c7 | knockcat/CodeForces | Codeforces Round #719 (Div. 3)/d.cpp | // KNOCKCAT
#include <bits/stdc++.h>
using namespace std;
#define fast \
std::ios::sync_with_stdio(false); \
cin.tie(nullptr);
#define int long long int
#define endl "\n"
typedef unsigned long long ull;
typedef long long ll;
typedef long double ld;
const ll mod = 1e9 + 7;
const ll e... | ALGO | 0.999941 | 4.56781 | {
"github_metadata": {
"branch": "main",
"commit_count": 571,
"repo_created_at": "2022-05-03T01:30:49.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 12,
"forks": 3,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "7d894526f... |
4eca5d52-b962-4c95-828d-9954e0212a42 | PatelManav/Codeforces_Backup | 1197B.cpp | /*May The Force Be With Me*/
#include <bits/stdc++.h>
#include <stdio.h>
#include <ctype.h>
#pragma GCC optimize ("Ofast")
#define ll long long
#define MOD 1000000007
#define endl "\n"
#define vll vector<long long>
#define pll pair<long long, long long>
#define all(c) c.begin(),c.end()
#define pb push_back
#define f fi... | ALGO | 0.999982 | 3.91984 | {
"github_metadata": {
"branch": "master",
"commit_count": 98,
"repo_created_at": "2020-10-01T14:54:31.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "c58f4d6f8... |
de44b62a-42c4-452a-9077-650ee44f376a | PKhing/ALGORITHM_DESIGN | grader/graph/a64_q3_wildfire.cpp | #include <bits/stdc++.h>
using namespace std;
vector<int> edge[5005];
int val[5005];
int query[5005];
int visited[5005];
int sum = 0;
void dfs(int u) {
if (visited[u]) return;
visited[u] = 1;
sum -= val[u];
for (auto v : edge[u]) dfs(v);
}
int main() {
int n, m, q;
cin >> n >> m >> q;
for (int i = 0; ... | ALGO | 0.999948 | 3.957497 | {
"github_metadata": {
"branch": "main",
"commit_count": 13,
"repo_created_at": "2022-02-01T14:23:27.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 3,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "4f5e60c96c3... |
3cd51509-2d03-4f90-b0cf-9992feb6999d | zarif98sjs/Competitive-Programming | Light OJ/LightOj 1183.cpp | /* Which of the favors of your Lord will you deny? */
#include<bits/stdc++.h>
using namespace std;
#define MAX 100050
#define LL long long
#define PII pair<int,int>
#define MP make_pair
#define F first
#define S second
int ara[100010];
struct Node
{
LL prop=-... | ALGO | 0.999515 | 3.735701 | {
"github_metadata": {
"branch": "master",
"commit_count": 83,
"repo_created_at": "2018-10-14T16:47:09.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "80b5cf8ca... |
b6026f51-4cca-43a6-8ad0-b0dfc8f1f694 | EnnSou/ooss-paddle2.3 | paddle/fluid/operators/graph_khop_sampler_imp.h | /* Copyright (c) 2022 PaddlePaddle Authors. All Rights Reserved.
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... | ALGO | 0.99308 | 6.737803 | {
"github_metadata": {
"branch": "air",
"commit_count": 35433,
"repo_created_at": "2022-07-29T08:29:39.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 4,
"forks": 3,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "cdab18260... |
5c8d44c7-e101-48e4-a325-eaa03e23f359 | dtegunov/tom | Oscar3/c++Picker/include/arpack++/aruscomp.h | /*
ARPACK++ v1.0 8/1/1997
c++ interface to ARPACK code.
MODULE ARUSComp.h.
Arpack++ class ARluCompStdEig definition
(umfpack version).
ARPACK Authors
<NAME>
<NAME>
<NAME>
Dept. of Computational & Applied Mathematics
Rice University
Houston, Texas
*/
#ifndef ARUSC... | ALGO | 0.998256 | 5.072102 | {
"github_metadata": {
"branch": "master",
"commit_count": 5,
"repo_created_at": "2016-01-27T23:22:55.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 16,
"forks": 5,
"issues": 1,
"pull_requests": 0
},
"file_meta": {
"content_id": "769c14ee9... |
1423a24c-239a-494b-8a25-33e9afcc40d7 | Udopia/gbdc | src/extract/gates/GateAnalyzer.h | /*************************************************************************************************
CNFTools -- Copyright (c) 2015, <NAME>, KIT - Karlsruhe Institute of Technology
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and
associated documentation files (the "Softw... | ALGO | 0.999644 | 6.494792 | {
"github_metadata": {
"branch": "master",
"commit_count": 248,
"repo_created_at": "2021-04-30T07:36:34.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 5,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "72dcdb87... |
990e3cf3-18aa-42e0-9f84-134a1295705b | BlindIris/NorthwestVista-C- | RecursionFactorial.cpp | #include <iostream>
using namespace std;
/* TODO: Write recursive DigitCount(int number) function here. */
int factorial(int n);
int fibonacci(int n);
int sumOfDigits(int n);
int main()
{
int n;
cin >> n;
int fact = factorial(n);
int fib = fibonacci(n);
int sum = sumOfDigits(n);
cout << "This is the factorial... | ALGO | 0.995853 | 4.50197 | {
"github_metadata": {
"branch": "main",
"commit_count": 7,
"repo_created_at": "2025-02-26T17:05: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": "b9d7b4f73487... |
18ba0e23-dc74-48ec-9530-c6ee60d97bbb | onvungocminh/The-Dahu-distance | apps/g2/reconstruct.hpp | #ifndef RECONSTRUCT_HPP
# define RECONSTRUCT_HPP
# include <mln/morpho/component_tree/filtering.hpp>
# include <boost/foreach.hpp>
# include "types.hpp"
namespace mln
{
template <class Graph, class AMap>
void
reconstruct_marginal(const tree_t& t1, const tree_t& t2, const tree_t& t3,
const AMap& val1, ... | ALGO | 0.97422 | 5.61345 | {
"github_metadata": {
"branch": "master",
"commit_count": 4,
"repo_created_at": "2018-09-21T11:12: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": "18d8246c01... |
a40ab9f7-443b-4267-b207-1c7bd016f43b | SubratKumarSingh2001/Data-Structures-and-Algo-DSA-Supreme | Lectures Codes/Queues/main (24).cpp | #include <iostream>
using namespace std;
class Queue {
public:
int *arr;
int size;
int front;
int rear;
Queue(int size) {
this->size = size;
arr = new int[size];
front = 0;
rear = 0;
}
voi... | ALGO | 0.903278 | 4.27684 | {
"github_metadata": {
"branch": "main",
"commit_count": 318,
"repo_created_at": "2023-02-07T05:40:16.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 79,
"forks": 9,
"issues": 1,
"pull_requests": 0
},
"file_meta": {
"content_id": "07e5a0a49... |
d079d669-255c-4949-b241-b3322ff3f04d | poynt2005/ReleaseNoter | utilities/DependenciesFinder(DEP)/vc++/DependenciesFinder/DependenciesFinder.cpp | #include <iostream>
#include <string>
#include <vector>
#include <filesystem>
#include <windows.h>
#include <string.h>
#include "DependenciesFinder.h"
bool FindAssemblyByCLR(const std::string& inputDllPath, std::vector<std::string>& ccAssemblies) {
auto getFullPath = [&inputDllPath](System::String^% outStr) -> bool {... | TOOL | 0.957953 | 5.180546 | {
"github_metadata": {
"branch": "master",
"commit_count": 2,
"repo_created_at": "2023-02-20T02:56: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": "74bf2ed888... |
7e3152ce-5113-4c99-8586-5ede9637fe67 | samiam713/CPPExamples | CandyStealingProblem_DynamicProgramming/CandyStealingProblem_DynamicProgramming/main.cpp | //
// main.cpp
// CandyStealingProblem_DynamicProgramming
//
// Created by <NAME> on 3/8/21.
//
#include <iostream>
#include <vector>
using namespace std;
int maxCandyStealable(std::vector<int> const & houses) {
const int n = int(houses.size());
if (n < 2) return (n == 1) ? houses[0] : 0;
in... | ALGO | 0.99998 | 5.604648 | {
"github_metadata": {
"branch": "main",
"commit_count": 7,
"repo_created_at": "2021-01-23T01:25: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": "414dc029c692... |
b753734b-6c31-4192-a6e9-5033b8cea79a | MrPicadilli/TinyMesh | AppTinyMesh/Source/MyFile/Bezier.cpp | #include "myFile/Bezier.h"
#include <random>
#include <iomanip>
Bezier::Bezier()
{
}
Bezier::Bezier(int n, int m, int x_max, int y_max) {
this->n = n;
this->m = m;
this->x_max = x_max;
this->y_max = y_max;
double pas_x = 0.0;
double pas_y = 0.0;
std::random_device rd;
std::default_random_engine eng(rd());
st... | ALGO | 0.938754 | 3.767946 | {
"github_metadata": {
"branch": "main",
"commit_count": 3,
"repo_created_at": "2024-07-28T16:43: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": "d6fd81e9545e... |
c3ba55c2-e7ac-46dd-a9da-f91e30280e86 | umariqb/3D_Pose_Estimation_CVPR2016 | tools_intern/efficiency/efficiency_linux64/C_intersect_presorted.cpp | #include "mex.h"
#include <memory.h>
#include <stdio.h>
/* printf("List %d: %d entries... ",i+1,cell_lengths[i]);
for (j=0; j<cell_lengths[i]; j++)
printf("%f ",((double*)vals)[j]);
printf("\n");*/
int C_intersect_presorted(double* list_out, double* pA, double* pB, int mA, int mB, double* pIA, double* pIB, int* ... | ALGO | 0.999944 | 4.671773 | {
"github_metadata": {
"branch": "master",
"commit_count": 31,
"repo_created_at": "2016-07-19T18:52:34.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 37,
"forks": 30,
"issues": 2,
"pull_requests": 0
},
"file_meta": {
"content_id": "1c15cc2... |
4e469060-4bd5-48b6-8a6d-507cf9b61d68 | pkeberly/Skytrak | Skytrac start.ino | /*
Skytrak PWM module replacement. <NAME> (<EMAIL>)
This code should replace the two custom Skytrak modules that create a PWM signal to controls
the 4 Apitech Pulsar boom solenoids in our old Skytrak. The datasheet says to modulate
the solenoids at 33Hz between 40% & 90%, we'll see how that goes.
I pic... | ALGO | 0.99533 | 5.21243 | {
"github_metadata": {
"branch": "main",
"commit_count": 1,
"repo_created_at": "2023-07-09T18:52: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": "257e77b701c8... |
5e97e61c-2ba1-4949-87f8-fe386a139c84 | RxNaruto/StriverDsaSheet | graphs/shortestPath/bellmanFord.cpp | #include<iostream>
#include<vector>
#include<climits>
using namespace std;
class Solution{
public:
vector<int>bellmanFord(int v,vector<vector<int> > &edges,int src){
vector<int>dist(v,INT_MAX);
dist[src]=0;
for(int i=0;i<=v-1;i++){
for(auto it: edges){
int u =... | ALGO | 0.999868 | 4.234417 | {
"github_metadata": {
"branch": "main",
"commit_count": 103,
"repo_created_at": "2024-01-18T17:14: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": "5dbe64f42f... |
94e6c0e1-9127-4b59-bcce-ea42257bbc47 | nalvarez508/cs302 | Proj7/proj7.cpp | //Project 7, <NAME>, CS302, Fall 2019.
#include <iostream>
#include <vector>
#include <bits/stdc++.h>
using namespace std;
const int NUMBER_CITIES = 5;
int BEST_ROUTE = 0;
int TSP(int array[][NUMBER_CITIES], int s);
void printCity(int k);
int main()
{
int cityArray[][NUMBER_CITIES] = {{0, 218, 518, 704, 439}, ... | ALGO | 0.999905 | 5.145508 | {
"github_metadata": {
"branch": "master",
"commit_count": 10,
"repo_created_at": "2020-11-25T23:07:38.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "ccc58e421... |
1e28ef07-014c-46c1-9601-b7e26ef06ef8 | HyungJunGoo/AlgorithmProblems | Programmers/previous_radio_song.cpp | #include <bits/stdc++.h>
using namespace std;
string sharp_conversion(string melody){
string conv_melody = "";
for(int i=0; i<melody.length(); i++){
if(melody[i] == '#'){
switch(melody[i-1]){
case 'C':
conv_melody += '1';
break;
case 'D':
conv_melody += '2';
... | ALGO | 0.99975 | 4.774803 | {
"github_metadata": {
"branch": "master",
"commit_count": 58,
"repo_created_at": "2021-03-07T15:16: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": "c38ee3034... |
6340e81e-25ae-4183-898a-45d9205a9058 | TangMingliang95/USACO-Training-Solutions | Chapter 1/Section 1.2/1_2_NameThatNumber.cpp | #include <fstream>
#include <string>
using namespace std;
const int c_maxDictEntryNum = 5000;
const string c_letters = "ABCDEFGHIJKLMNOPRSTUVWXY";
string g_nameDict[c_maxDictEntryNum];
int g_dictEntryNum = 0;
string GetNumStringFromName(const string &letters, const string &name);
int GetNumberFromLetter(const string... | ALGO | 0.998497 | 3.826986 | {
"github_metadata": {
"branch": "master",
"commit_count": 4,
"repo_created_at": "2017-09-21T16:49: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": "c1ff248f6a... |
dfb64f08-6a12-4745-92d5-b78955348c9a | booneng/competitive_programming | codeforces/1111B.cpp | #include <iostream>
#include <vector>
#include <map>
#include <algorithm>
#include <iomanip>
using namespace std;
int main() {
int n, k, m;
cin >> n >> k >> m;
vector<long long> a(n);
for (int i = 0; i < n; i++) {
cin >> a[i];
}
sort(a.begin(), a.end(), greater<int>());
for (int... | ALGO | 0.999943 | 3.362328 | {
"github_metadata": {
"branch": "master",
"commit_count": 133,
"repo_created_at": "2018-03-26T11:11:05.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "c5098bf3... |
c169e41b-34c4-4b69-a7a0-d30a496a4534 | xiaolittle/interview | lc/ConstructBinaryTreefromPreorderandInorderTraversal.cpp | /**
* Definition for binary tree
* struct TreeNode {
* int val;
* TreeNode *left;
* TreeNode *right;
* TreeNode(int x) : val(x), left(NULL), right(NULL) {}
* };
*/
class Solution {
public:
TreeNode *buildTree(vector<int> &inorder, int inStart,
vector<int> &postorder, int poStart, int len, ma... | ALGO | 0.999955 | 5.796187 | {
"github_metadata": {
"branch": "interview",
"commit_count": 30,
"repo_created_at": "2013-11-07T18:38: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": "d2d3b4... |
a050fe86-527b-456b-9ab2-25ba7b2e287c | bishal5917/COMPUTER_GRAPHICS_ALGORITHMS | rotation.cpp | #include<bits/stdc++.h>
#include<graphics.h>
using namespace std;
int main(){
int gd=DETECT,gm;
int x1,y1,x2,y2,x3,y3;
int xa,ya,xb,yb,xc,yc;
double sinValue,cosValue,ang;
initgraph(&gd,&gm,(char*)"");
x1=300; //line points
y1=350;
x2=300;
y2=300;
x3=250;
y3=25... | ALGO | 0.998567 | 4.276207 | {
"github_metadata": {
"branch": "master",
"commit_count": 1,
"repo_created_at": "2021-12-13T14:27: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": "44f30433cb... |
03a2ca5f-4b29-4ff7-884d-6b2d129bcf1a | ivanhu42/p | codeforces/cpp/581b.cpp | #include <iostream>
#include <cstdio>
#include <cstdlib>
#include <cmath>
#include <algorithm>
#include <vector>
#include <map>
#include <string>
#include <iomanip>
#include <utility>
using namespace std;
typedef long double db;
typedef long long ll;
int main()
{
ll n, a, i, m;
cin >> n;
vector<ll> v(n);
vect... | ALGO | 0.999949 | 3.43538 | {
"github_metadata": {
"branch": "master",
"commit_count": 54,
"repo_created_at": "2016-06-22T12:02: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": "a2114858a... |
a6e7e792-8ad8-4886-93e0-055754f77961 | juliacevedofuentes/UTN | BEECROWD/1551.cpp | #include <iostream>
#include <string>
#include <algorithm>
using namespace std;
bool fullsentence(string b);
bool almostfull(string b);
#define tl 27
int main(int argc, char *argv[]) {
int n;
cin >> n;
cin >> ws;
for(int i = 0; i<n; i++){
string frase = {};
getline(cin,frase);
if(fullsentence(frase)==... | ALGO | 0.976121 | 4.296266 | {
"github_metadata": {
"branch": "main",
"commit_count": 140,
"repo_created_at": "2024-06-01T14:30: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": "30bef4b0d5... |
7b1a3094-fa66-4957-8306-390f6b057697 | girishlande/CPlusPlus | leetcode/11PhoneNumber.cpp | // ConsoleApplication4.cpp : Defines the entry point for the console application.
//
#include "stdafx.h"
#include <iostream>
#include <vector>
#include <list>
#include <algorithm>
using namespace std;
class Solution {
public:
string getLetters(char num) {
switch (num) {
case '2': return "abc";
... | ALGO | 0.999345 | 5.682638 | {
"github_metadata": {
"branch": "master",
"commit_count": 70,
"repo_created_at": "2019-08-21T10:27: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": "519ee663b... |
00532089-f215-477b-8867-dd4e6c56fdd1 | joelb429078/PhysicsEngine | MathHelper/Vector.cpp | #include <iostream>
#include <cmath>
#include "Matrix.h"
#include "Vector.h"
using namespace std;
class Vector {
private:
double x_value;
double y_value;
public:
Vector() : x_value(0), y_value(0) {}
Vector(double x, double y) : x_value(x), y_value(y) {}
double get_x_value() const {
retu... | ALGO | 0.957223 | 3.798936 | {
"github_metadata": {
"branch": "main",
"commit_count": 18,
"repo_created_at": "2024-07-10T18:57:46.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "dc186041d9e... |
9fc0657d-fbfe-48e1-acb9-89fab3ddd4e8 | noeyiz/42Seoul | Circle_5/CPPModule08/ex01/Span.cpp | #include "Span.hpp"
Span::Span(unsigned int n) : n(n) {}
Span::Span(const Span& other) : n(other.n) {
for (size_t i = 0; i < other.vector.size(); i++)
vector.push_back(other.vector[i]);
}
Span& Span::operator=(const Span& other) {
if (this != &other) {
n = other.n;
vector.clear();
... | ALGO | 0.973967 | 5.082886 | {
"github_metadata": {
"branch": "main",
"commit_count": 211,
"repo_created_at": "2022-10-28T15:09: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": "634064e761... |
6a98b2a6-45ba-42e6-8b85-3c5158ad133d | rsln-s/aggregative-coarsening-for-multilevel-hypergraph-partitioning | packages/moertel/morkon/src/mrk_compute_normals.hpp | /*
#@HEADER
# ************************************************************************
#
# Moertel FE Package
# Copyright (2015) Sandia Corporation
#
# Under terms of Contract DE-AC04-94AL85000, there is a non-exclusive
# license for use of this work by or on behalf of the U.S. ... | ALGO | 0.998488 | 7.073793 | {
"github_metadata": {
"branch": "master",
"commit_count": 3,
"repo_created_at": "2018-04-04T20:05:42.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 7,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "a68e42f423... |
23200784-f598-4a9f-8e3a-7491e138949c | doun4576/codetree-TILs | 240501/격자 위의 편안한 상태/comfortable-state-on-the-grid.cpp | #include <iostream>
using namespace std;
#define MAX_LEN 100
#define DIR_LEN 4
int N;
int arr[MAX_LEN][MAX_LEN];
int dx[DIR_LEN] = {1,0,-1,0};
int dy[DIR_LEN] = {0,-1,0,1};
bool isRange(int x, int y) {
return x >= 0 && x < N && y >= 0 && y < N;
}
bool checkIsComfortable(int x, int y) {
int cnt = 0;
fo... | ALGO | 0.999974 | 4.301616 | {
"github_metadata": {
"branch": "main",
"commit_count": 406,
"repo_created_at": "2024-04-09T12:40: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": "7f4d7bcc1f... |
3306149d-fd14-4cad-96be-0d9b0c5770d4 | kshiozaw/AtCoder | ABC/abc163/progE.cpp | #include<bits/stdc++.h>
using namespace std;
#define rep(i,n) for(int i=0;i<int(n);i++)
#define rep1(i,j,n) for(int j=i+1;j<int(n);j++)
//中心からの距離を求める
double distance(int a,double center){
if(a>center){
return double(a)-center;
}else{
return center - double(a);
}
}
//絶対値
int plusA(int a){
if(a>=0){
... | ALGO | 0.999981 | 3.196999 | {
"github_metadata": {
"branch": "master",
"commit_count": 182,
"repo_created_at": "2021-06-18T13:14: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": "5d80bb56... |
4972999c-ad6c-4829-a52a-a8cb79cd8498 | jorgebravo04/TresEnRaya | tres_en_raya/tresenraya.cpp | #include <stdio.h>
#include <stdlib.h>
char tablero[3][3];
char jugadorActual = 'X';
//MOSTRAR TABLERO DE INICIO
void inicializar(){
for(int x=0; x<3; x++){
for(int y=0; y<3; y++){
tablero[x][y] = '_';
}
}
}
//HACER COMPROBACIONES PARA VER SI HAY UN GANADOR
bool ganador(){
//HORIZONTAL
cha... | ALGO | 0.999528 | 4.088915 | {
"github_metadata": {
"branch": "master",
"commit_count": 1,
"repo_created_at": "2015-05-30T11:06: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": "f1ecf6654e... |
67fc65c3-38ba-4c1d-85f6-659a7487f1a7 | QbitQuantum/Basics | Исходники/calculator01.cpp | double term(TokenStream& tokenStream)
{
double result = primary(tokenStream); // set result to value of primary
Token token = tokenStream.getToken(); // get next token from tokenStream
while (true)
{
if (token.kind == '*')
{
result *= primary(tokenStream); // evaluate pr... | ALGO | 0.989545 | 5.008862 | {
"github_metadata": {
"branch": "main",
"commit_count": 68,
"repo_created_at": "2024-03-06T07:05:07.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "76f4fe7a9e2... |
8e42d131-eb2e-4fe2-8895-4c04613bfa66 | bakir004/ETF | asp/lab7/pz7.cpp | #include <ctime>
#include <iostream>
#include <functional>
#include <cstdlib>
#include <vector>
const float FAKTOR_PROSIRENJA = 1.5;
const int POCETNA_VELICINA = 10;
using namespace std;
template <typename K, typename V>
class Mapa {
public:
virtual ~Mapa() {}
virtual void obrisi() = 0;
virtual void obris... | ALGO | 0.964492 | 4.583405 | {
"github_metadata": {
"branch": "master",
"commit_count": 236,
"repo_created_at": "2024-04-28T20:42: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": "371a7998... |
48efc10e-f079-4025-972a-c7ba7cf3c80d | jeongyeonkim/Algorithm__cpp | baekjoon/b_20055.cpp | #include <iostream>
#include <deque>
using namespace std;
int N, K, input, result;
deque<int> durabilityOfBelt;
deque<bool> existOfLobot;
int main(){
ios_base::sync_with_stdio(false); cin.tie(0); cout.tie(0);
cin >> N >> K;
for(int i=0; i<2*N; i++){
cin >> input;
durabilityOfBelt.push_back... | ALGO | 0.999965 | 3.86557 | {
"github_metadata": {
"branch": "master",
"commit_count": 245,
"repo_created_at": "2018-12-29T12:11:27.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 1
},
"file_meta": {
"content_id": "2a6c5386... |
9a769e2c-3650-43ec-8f69-71f30423df3b | ozden-kars/BLG252-Object-Oriented-Programming-Assignment-2 | src/simulation.cpp | #include <iostream>
#include <fstream>
#include <sstream>
#include <cstdlib> // std::srand
#include <vector>
#include <string>
#include "../include/simulation.hpp"
#include "../include/worker.hpp"
#include "../include/machine.hpp"
using namespace std;
Simulation::Simulation(Factory &factory, int total_days, std::str... | TOOL | 0.949682 | 3.928857 | {
"github_metadata": {
"branch": "main",
"commit_count": 6,
"repo_created_at": "2024-07-09T13:06: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": "6f2c6fe96da0... |
41d1afee-b5d0-41f3-a934-c44b463e8cc1 | vijairamg/Leetcode-submissions | 0019-remove-nth-node-from-end-of-list/0019-remove-nth-node-from-end-of-list.cpp | /**
* Definition for singly-linked list.
* struct ListNode {
* int val;
* ListNode *next;
* ListNode() : val(0), next(nullptr) {}
* ListNode(int x) : val(x), next(nullptr) {}
* ListNode(int x, ListNode *next) : val(x), next(next) {}
* };
*/
class Solution {
public:
int size(ListNod... | ALGO | 0.999977 | 5.951867 | {
"github_metadata": {
"branch": "main",
"commit_count": 440,
"repo_created_at": "2023-08-15T22:26: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": "869d2cca8b... |
f42ce3ef-c86d-42b1-a40b-f895ce2dfc10 | whxwhx/HNSD2015 | day1/contest/rabbit_bx2k.cpp | //用bx2k那个贪心+BIT的办法写的
//递增排序后,一段相等的元素的一个后缀-1可以转为它的一个前缀-1,这样就能不用平衡树仍然维护一个有序的数列了
#include <iostream>
#include <cstdio>
#include <cmath>
#include <set>
#include <map>
#include <queue>
#include <bitset>
#include <vector>
#include <string>
#include <cstdlib>
#include <cstring>
#include <algorithm>
#define Rep(i,a) for(int i ... | ALGO | 0.999961 | 3.272214 | {
"github_metadata": {
"branch": "master",
"commit_count": 30,
"repo_created_at": "2016-01-05T07:09: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": "f9bbada5d... |
6656ad0b-d7c5-4598-8626-f6a3a96f4a5c | hlr7999/Leetcode | src/148.cpp | #include <stdlib.h>
using namespace std;
struct ListNode {
int val;
ListNode *next;
ListNode(int x) : val(x), next(NULL) {}
};
class Solution {
public:
// merge sort
ListNode* sortList(ListNode* head) {
if (head == NULL || head->next == NULL)
return head;
ListNode *slo... | ALGO | 0.999972 | 5.656089 | {
"github_metadata": {
"branch": "master",
"commit_count": 201,
"repo_created_at": "2019-09-11T12:26: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": "47790c58... |
f14c0340-c39b-490b-ba2a-60e41fd339ef | dannguyenmessi1705/Cpp | SCTDL046_MuaLuongThuc.cpp | /*
Gia su ban là mot nguoi ngheo trong dia phuong cua ban. Dia phuong cua ban cu duy nhat mot cua hang ban luong thuc. Cua hàng cua ban mo cua tat ca coc ngày trong tuan ngoai tru chu nhat. Cho bo ba so N, S, M thoa mon ràng buoc sau:
N : so don vi luong thuc nhieu nhat ban cu the mua trong ngày.
S : so luong ngày ban ... | ALGO | 0.999948 | 4.511857 | {
"github_metadata": {
"branch": "master",
"commit_count": 167,
"repo_created_at": "2022-08-20T13:52:58.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "5e51bde3... |
eb9b431d-f60d-47a6-bd10-1ea9e3483021 | TanavShah/Competitive-Programming | SPOJ/cpp_codes/dcepc504.cpp | // <NAME>?
#include <iostream>
#include <bits/stdc++.h>
using namespace std;
int main()
{
int t;
scanf("%d" , &t);
long long n[t];
long long k[t];
for(int i = 0 ; i < t ; i++)
{
scanf("%lld %lld" , &n[i] , &k[i]);
}
long long maxval = n[0];
for(int i = 1 ; ... | ALGO | 0.999951 | 3.512509 | {
"github_metadata": {
"branch": "master",
"commit_count": 9,
"repo_created_at": "2020-08-10T19:37:13.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 4,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "b363312d20... |
79e6bbeb-9fc9-4b7d-b9a7-9f685e9099ae | abdelkarimhajji/web-server | newweb/Server.hpp | #pragma once
#include "./parse/DataConfig.hpp"
#include "./parse/ParseConfigFile.hpp"
#include <iostream>
#include <sys/socket.h>
#include <arpa/inet.h>
#include <unistd.h>
#include <fstream>
#include <iostream>
#include <sstream>
#include <fcntl.h>
#include <dirent.h>
#include <string>
#include <cstring>
#include ... | WEB | 0.938688 | 3.07214 | {
"github_metadata": {
"branch": "main",
"commit_count": 35,
"repo_created_at": "2024-02-12T14:05:03.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 6,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "7df57d44af5... |
b79d823d-3d8d-42b4-a88d-8925e1de8587 | Anantadhirya/LeetCode | 0021-merge-two-sorted-lists/0021-merge-two-sorted-lists.cpp | /**
* Definition for singly-linked list.
* struct ListNode {
* int val;
* ListNode *next;
* ListNode() : val(0), next(nullptr) {}
* ListNode(int x) : val(x), next(nullptr) {}
* ListNode(int x, ListNode *next) : val(x), next(next) {}
* };
*/
class Solution {
public:
ListNode* mergeTwoLis... | ALGO | 0.999969 | 5.788553 | {
"github_metadata": {
"branch": "main",
"commit_count": 2010,
"repo_created_at": "2024-05-04T02:39: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": "2071f297d... |
20e1565d-b6d0-4f63-a276-ad8f67fd0125 | nyankiti/algorithm_job | atCoderEnv/problems/tessoku-book/a15/a15.cpp | #include <bits/stdc++.h>
using namespace std;
#include <atcoder/all>
using namespace atcoder;
/* alias */
using ull = unsigned long long;
using ll = long long;
using vi = vector<int>;
using vvl = vector<vi>; // 二次元vector
using vs = vector<string>;
using pii = pair<int, int>;
/* macro */
#define rep(i, a, n) for (int i... | ALGO | 0.99997 | 4.207058 | {
"github_metadata": {
"branch": "master",
"commit_count": 260,
"repo_created_at": "2021-02-01T09:33: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": "8b8a08ec... |
52cccbe0-16fa-4979-a049-f07edadc99c3 | AndrewWayne/OI_Learning | 【模板】st表.cpp | // luogu-judger-enable-o2
#include <cstdio>
#include <iostream>
#include <algorithm>
#include <cmath>
using namespace std;
const int maxn = 1e6;
int n, m, a[maxn], st[maxn][30], l, r;
int Log2[maxn];
int query(int l, int r){
int res = 0;
int len = r - l + 1;
int x = Log2[len];
res = max(st[l][x], st[r -... | ALGO | 0.999951 | 4.296179 | {
"github_metadata": {
"branch": "master",
"commit_count": 99,
"repo_created_at": "2018-08-20T06:49: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": "99a865c34... |
97631592-f326-487b-a72a-ac2a34fc9f40 | Icaaar/Projects | 13752.cpp | #include <iostream>
/*Дан целочисленный массив из 30 элементов.
Элементы массива могут принимать целые значения от 0 до 10 000 включительно.
Опишите на одном из языков программирования алгоритм,
который находит количество элементов массива, больших 100 и при этом кратных 5,
а затем заменяет каждый такой элемент на числ... | ALGO | 0.999503 | 3.511442 | {
"github_metadata": {
"branch": "master",
"commit_count": 18,
"repo_created_at": "2018-01-09T11:18: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": "da6eff82e... |
0f60c333-f43b-4a48-99ef-42c99327d3e6 | AdityaTulasi-xx/coding | AlmostSorted.cpp | #include<stdio.h>
int main()
{
int n;
scanf("%d", &n);
int arr[n];
for (int i = 0; i < n; i++)
{
scanf("%d", &arr[i]);
}
// find the first inversion
int inv1 = -1, inv2 = -1, invElem1, invElem2;
int i;
for (i = 0; i < n - 1; i++)
{
if (arr[i + 1] < arr[i])
{
inv1 = i;
invElem1 = arr[i];
b... | ALGO | 0.999993 | 3.150002 | {
"github_metadata": {
"branch": "master",
"commit_count": 7,
"repo_created_at": "2017-01-07T18:12: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": "d815bb9332... |
4a926ed9-1543-43ef-bd68-58c97c9a5fa5 | ishandutta2007/codeforces-n | ngfam/normal/1301/B.cpp | #include <bits/stdc++.h>
using namespace std;
int a[100005];
int main() {
#ifdef LDT
freopen("input.txt", "r", stdin);
//freopen("output.txt", "w", stdout);
#endif
ios_base::sync_with_stdio(false);
cin.tie(NULL);
int t;
cin >> t;
while (t--) {
int n;
cin >> n;
int L ... | ALGO | 0.999881 | 3.7165 | {
"github_metadata": {
"branch": "main",
"commit_count": 1,
"repo_created_at": "2024-10-30T15:35: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": "7f353d7543b7... |
eb552f3e-68a8-4a9a-b56a-716ccacc9cd4 | kritirikhi/DataStructuresAndAlgorithms | laddersProbOptimised.cpp | // LADDERS PROBLEM
// there are n steps and a boy is on the ground floor. He has to reach at the top (nth step)
// calculate the no of ways to reach the nth step and the boy can take at max k steps from the ith step
// This approach works in O(n+k)
// in... | ALGO | 0.999935 | 4.040905 | {
"github_metadata": {
"branch": "master",
"commit_count": 3,
"repo_created_at": "2020-01-30T07:51:51.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "be28a3bf1e... |
47bf2367-5c74-4571-9a3d-07d0c6285c86 | ishandutta2007/codeforces-t | t90tank/normal/1456/D.cpp | #include <bits/stdc++.h>
#define pb push_back
#define lowbit(x) ((x)&(-(x)))
using namespace std;
using ll = long long;
const int maxn = 5006;
struct data {
ll t,x;
}a[maxn];
bool cmp(data a, data b) {
return a.t < b.t;
}
int Abs(ll x) {
return x>0?x:-x;
}
bool canget(data a, data b) {
return Abs(a.x-b.x)... | ALGO | 0.99996 | 3.575791 | {
"github_metadata": {
"branch": "main",
"commit_count": 1,
"repo_created_at": "2024-10-30T16:27: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": "44688da755f8... |
ceebdb67-b5de-40d3-820e-3003a29d405a | mines213/Algorithm | 백준/Platinum/10293. Ranks in groups/Ranks in groups.cc | #include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
#define ll long long
#define fastio ios::sync_with_stdio(0), cin.tie(0);
using namespace std;
using namespace __gnu_pbds;
#define ordered_set tree<int, null_type, greater<int>, rb_tree_tag,tree_order_statistics_node_u... | ALGO | 0.999979 | 4.519701 | {
"github_metadata": {
"branch": "main",
"commit_count": 30,
"repo_created_at": "2024-09-23T12:09: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": "aeaff385552... |
f364fbf2-2b09-4d8f-b9f2-aad58fe979ad | hoquenaureen/WiFi-preauth | exbit/lib/sync_short.cc | /*
* Copyright (C) 2013, 2016 <NAME> <<EMAIL>>
*
* 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 Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This progra... | ALGO | 0.947625 | 5.595567 | {
"github_metadata": {
"branch": "main",
"commit_count": 32,
"repo_created_at": "2023-04-17T15:20:17.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "a108e95907d... |
2d201c2a-1296-4eb7-ae61-721bfdb4f160 | RandyLambert/Summer | ACM/week5/poj1200.cpp | #include<iostream>
#include<cstring>
using namespace std;
const int MaxNum = 20000000;
char ch[MaxNum];
bool lage[MaxNum]; //用于标记是否为相同的子串
int hashArray[256]; //存储n个字母转换成整数之后再转换成nc进制的数
int main() {
int n, nc;
while (cin >> n >> nc >> ch) {
in... | ALGO | 0.999568 | 3.424302 | {
"github_metadata": {
"branch": "master",
"commit_count": 3,
"repo_created_at": "2019-09-23T09:14:09.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "09a373279f... |
d190e9ab-32b0-4470-87c8-7a07ada60f6a | bobjonesss/Programmirovanie_na_jazyke_CPP_v_srede_Qt_Creator | __ALL_PAGE_p-namber-page/p124.cpp | //
#include <iostream>
#include <stdio.h>
#include <math.h>
using namespace std ;
float Pow( float a, int k, int m ) //Первая функция
{
cout << "Функция 1 \t";
if (a == 0)
return 0;
else if (k == 0)
return 1;
else if (a > 0)
return exp((float) k / m * log(a));
else if (m % 2 != 0)
return -(exp... | ALGO | 0.999437 | 4.219269 | {
"github_metadata": {
"branch": "main",
"commit_count": 29,
"repo_created_at": "2024-01-23T10:22: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": "76cd77ac9b9... |
1b123e97-978c-45ba-829c-3af54e06eb34 | sdonegan/Staging | StagingFilters/ApproximatePointCloudHull.h | #ifndef _approximatepointcloudhull_h_
#define _approximatepointcloudhull_h_
#include "SIMPLib/Common/SIMPLibSetGetMacros.h"
#include "SIMPLib/FilterParameters/FloatVec3FilterParameter.h"
#include "SIMPLib/Filtering/AbstractFilter.h"
#include "SIMPLib/Geometry/ImageGeom.h"
#include "SIMPLib/SIMPLib.h"
/**
* @brief Th... | TOOL | 0.91974 | 6.928438 | {
"github_metadata": {
"branch": "master",
"commit_count": 1,
"repo_created_at": "2019-03-06T15:02: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": "adb318d8fe... |
5fdf398b-2e24-4837-b867-87ada4728114 | jayin92/NYCU-intro-to-algorithms | HW2/p3.cpp | // :80 <enter>
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;
typedef pair<int, ll> pil;
typedef pair<ll, int> pli;
typedef pair<double,double> pdd;
#define SQ(i) ((i)*(i))
#define MEM(a, b) memset(a, (b), sizeof(a))
#define SZ(i) int(i.size())
... | ALGO | 0.99997 | 4.632474 | {
"github_metadata": {
"branch": "main",
"commit_count": 15,
"repo_created_at": "2022-09-14T06:00: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": "b60b238ffc4... |
70515393-64fc-401f-b854-1659173130ee | tinguen/Algorithms | Problems/test_1-12.cpp | #define BOOST_TEST_MODULE Problems1_12
#include <boost/test/included/unit_test.hpp>
#include "1-12.h"
vector<int> test_numbers = {- 7, -5, 1, 2, 3, 4, 5, 6, 7, 8};
BOOST_AUTO_TEST_CASE(problem1_check) {
Tree_problems t;
t.manual_push(test_numbers);
vector<int> expected_s = {5, -5};
vector<int> expecte... | TEST | 0.947881 | 4.232778 | {
"github_metadata": {
"branch": "master",
"commit_count": 36,
"repo_created_at": "2018-02-08T14:32: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": "9b8feac56... |
6b9e4317-aebe-4924-95c0-6e9f458f5a6b | jordandong/myleetcodes | LC_00631_DesignExcelSumFormula.cpp | /*
Your task is to design the basic function of Excel and implement the function of sum formula.
Specifically, you need to implement the following functions:
1. Excel(int H, char W): This is the constructor.
The inputs represents the height and width of the Excel form.
H is a positive integer, range from 1 to 26... | ALGO | 0.997122 | 5.984478 | {
"github_metadata": {
"branch": "master",
"commit_count": 2338,
"repo_created_at": "2012-11-19T10:18:23.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "8e94915... |
d8c04684-1655-47ba-bdb9-4d92e29b68e5 | SquashedSkinner/Raytracer | Raytracer/Collisions.h | #ifndef COLLISIONS_H
#define COLLISIONS_H
#include "collisionComponent.h"
#include <memory>
#include <vector>
using std::shared_ptr;
using std::make_shared;
class Collisions : public collisionComponent
{
public:
Collisions(){}
virtual bool hit(const Ray& Ray, double tMinimum, double tMaximum, cont... | TOOL | 0.957992 | 5.889807 | {
"github_metadata": {
"branch": "master",
"commit_count": 3,
"repo_created_at": "2021-12-20T12:56: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": "54d0c79c80... |
8bece172-060b-4ae5-9891-1437d806e927 | Shrivastava-04/Tic-Tac-Toe | tictactoeme.cpp | #include<bits/stdc++.h>
using namespace std;
vector<vector<char>> input(3, vector<char>(3));
int winner=-1;
void display(){
system("cls");
for(int i=0;i<3;i++){
for(int j=0;j<3;j++){
if(!input[i][j]){
cout<<" ";
}
else{
cout<<input[i]... | ALGO | 0.999935 | 4.254936 | {
"github_metadata": {
"branch": "main",
"commit_count": 5,
"repo_created_at": "2024-02-15T14:16: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": "34356f17999c... |
e6208739-389d-4139-83f4-56308a605f90 | mguid65/uva | uva1003/uva1003_mguid2088_b.cpp | #include <cstdio>
#include <vector>
#include <iostream>
#include <cmath>
#include <algorithm>
#include <numeric>
//error value
const double EPSILON = 1E-9;
const double PI = 3.1415926535897932384626433832795;
//a tree
class tree {
public:
tree() { tree(0,0,0,0); }
tree(int x, int y, int d, int h) : x(x), y(y), d... | ALGO | 0.999554 | 4.205865 | {
"github_metadata": {
"branch": "master",
"commit_count": 43,
"repo_created_at": "2018-10-30T14:12: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": "19f219130... |
d559a336-8997-402b-9716-252ef41f1ef1 | ojcole/re-pairing-brackets | src/solve/solution_test.cc | // MIT License
// Copyright (c) 2020-2021 <NAME>
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
// in the Software without restriction, including without limitation the rights
// to use, copy, modify, mer... | TEST | 0.994971 | 7.284482 | {
"github_metadata": {
"branch": "master",
"commit_count": 8,
"repo_created_at": "2021-04-30T18:22: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": "3215c66b72... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.