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 |
|---|---|---|---|---|---|---|---|
a3c7b3ba-0347-4d55-8436-b4f5050fa3da | 2316663736/homework-tj-cs | 大二上/数据结构(101019)/hw4/hw5.cpp | #include<iostream>
using namespace std;
struct tree {
int high = 0;//表示此节点所处的深度
tree* first_child = NULL;//第一个孩子节点
tree* first_brother = NULL;//右边第一个兄弟节点
tree* father = NULL;//第一个父节点
//这些节点没有则为空
};
tree* cin_tree(tree* start_tree, int num)
{
for (int i_cycle = 1; i_cycle < num; i_cycle++)
{
int fa, child... | ALGO | 0.999982 | 4.178314 | {
"github_metadata": {
"branch": "master",
"commit_count": 6,
"repo_created_at": "2025-05-07T05:06: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": "eaada877f0... |
637150e9-ec9a-45d1-abc1-376535c7db3a | layan050/lab-algorithm-design-and-analysis | task 10/assigment1.cpp | #include <iostream>
#include <vector>
#include <queue>
#include <limits>
using namespace std;
const int INF = numeric_limits<int>::max();
class Graph {
private:
struct Edge {
int to;
int weight;
};
vector<vector <Edge> > adjacency_list;
int num_vertices;
public:
Graph(int n) : n... | ALGO | 0.999667 | 5.811325 | {
"github_metadata": {
"branch": "main",
"commit_count": 24,
"repo_created_at": "2024-03-14T13:56: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": "69b3ccc2cbe... |
7711abe6-982b-418c-8016-955ea7f96abc | DrSwad/CP | Submissions/Codeforces/1556/D_Take_a_Guess.cpp | #include <bits/stdc++.h>
using namespace std;
const int BITS = 30;
const int N = 1e4 + 4;
int n, k;
int res[N][2];
int query(string type, int i, int j) {
assert(type == "or" or type == "and");
cout << type << " " << i << " " << j << endl;
int res;
cin >> res;
assert(res != -1);
return res;
}
void answer... | ALGO | 0.999885 | 3.713123 | {
"github_metadata": {
"branch": "master",
"commit_count": 65,
"repo_created_at": "2019-10-12T13:53:06.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 21,
"forks": 5,
"issues": 0,
"pull_requests": 1
},
"file_meta": {
"content_id": "b98b8dfb... |
d1b57659-3965-4b32-bc97-dd35a5450dd9 | Swapnil-P-002/Dsa | 6MA.CPP | #include <iostream>
#include <cstdlib>
using namespace std;
int cost[10][10], i, j, k, n, qu[10], front = 0, rear = 0, v;
int visit[10] = {0}, visited[10] = {0}; // BFS tracking
int stk[10], top = 0, visit1[10] = {0}, visited1[10] = {0}; // DFS tracking
int main()
{
int m;
cout << "Enter number of vertices : ... | ALGO | 0.999987 | 5.849979 | {
"github_metadata": {
"branch": "main",
"commit_count": 2,
"repo_created_at": "2025-05-04T05:04:54.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "0e4ad85449cb... |
9f02d0a0-d2bd-4d9d-b98d-f1d79b27579d | turehans/nim | nim.cpp | #include <cstdio>
#include <iostream>
#include <limits>
#include <random>
#include <vector>
#include <unistd.h>
using namespace std;
// declare functions
void printIntro();
int checkStartingPlayer();
void addValuesToList(int numberOfPiles);
void printBoard();
void updatePiles(int isPlayer);
int findSticks(int pi... | TOOL | 0.975105 | 3.668741 | {
"github_metadata": {
"branch": "master",
"commit_count": 22,
"repo_created_at": "2023-05-24T01:34: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": "df5cf8370... |
b4dcfe18-b973-4983-8f82-ad2dbd3e4e14 | TanmayAJadhav/Leetcode_Solutions | 1281_Sub_the_Product_and_Sum.cpp | // Given an integer number n, return the difference between the product of its digits and the sum of its digits.
// Example 1:
// Input: n = 234
// Output: 15
// Explanation:
// Product of digits = 2 * 3 * 4 = 24
// Sum of digits = 2 + 3 + 4 = 9
// Result = 24 - 9 = 15
class Solution {
public:
int subtractPro... | ALGO | 0.999747 | 5.965737 | {
"github_metadata": {
"branch": "main",
"commit_count": 260,
"repo_created_at": "2022-03-08T14:01: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": "4e89c1545a... |
c98fce4c-066a-49e2-a08f-9e2022e68497 | tensorflow/tensorflow | third_party/xla/xla/tsl/framework/convolution/eigen_spatial_convolutions-inl.h | /* Copyright 2019 The TensorFlow 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 a... | ALGO | 0.905153 | 6.472497 | {
"github_metadata": {
"branch": "master",
"commit_count": 182413,
"repo_created_at": "2015-11-07T01:19:20.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 190773,
"forks": 74758,
"issues": 873,
"pull_requests": 553
},
"file_meta": {
"content... |
01d520b5-ce53-4b50-b22c-145ad5ccf139 | z-learner/LeetCode | 二分查找/LeetCode_33_搜索旋转排序数组.cpp | #include <iostream>
#include <vector>
using namespace std;
class Solution {
public:
int search(vector<int>& nums, int target) {
int left = 0;
int right = nums.size() - 1;
while (left <= right)
{
int mid = (right - left) / 2 + left;
if (nums[mid] == target) ... | ALGO | 0.999989 | 5.324818 | {
"github_metadata": {
"branch": "master",
"commit_count": 2,
"repo_created_at": "2021-12-10T12:09:13.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "6eda32c01f... |
2389123d-96db-440a-a664-2cc0ef9563b9 | ishandutta2007/codeforces-z | zhylj/normal/1148/F.cpp | #include <bits/stdc++.h>
#define gc() getchar()
template <typename T> inline void rd(T& x) {
int si = 1; char c = gc(); x = 0;
while(!isdigit(c)) si = c == '-' ? -1 : si, c = gc();
while(isdigit(c)) x = x * 10 + c - 48, c = gc();
x *= si;
}
template <typename T, typename... Args>
inline void rd(T& x, Args&... args... | ALGO | 0.999903 | 3.68709 | {
"github_metadata": {
"branch": "main",
"commit_count": 1,
"repo_created_at": "2024-10-30T16:43: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": "0a1956448d85... |
dab94a55-175d-4dcc-ac17-6cfccbf63ab6 | byhj/Algorithm | Algorithm/DivideConquer/03.Median of two sorted arrays.cpp | /*
Question: There are 2 sorted arrays A and B of size n each. Write an algorithm to find the median of the array obtained after merging the above 2 arrays(i.e. array of length 2n). The complexity should be O(log(n))
Median: In probability theory and statistics, a median is described as the number separating the highe... | ALGO | 0.999996 | 5.53066 | {
"github_metadata": {
"branch": "master",
"commit_count": 13,
"repo_created_at": "2017-04-11T13:05: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": "294ff4d75... |
7af4c271-ed59-4b88-bd0a-783e15166af4 | corganhejijun/printer | ReadFile/stpReader/src/DrawDim/DrawDim_PlanarDistance.cxx | // Created on: 1996-01-10
// Created by: <NAME>
// Copyright (c) 1996-1999 Mat<NAME>
// Copyright (c) 1999-2014 OPEN CASCADE SAS
//
// This file is part of Open CASCADE Technology software library.
//
// This library is free software; you can redistribute it and/or modify it under
// the terms of the GNU Lesser General... | ALGO | 0.98906 | 6.767249 | {
"github_metadata": {
"branch": "master",
"commit_count": 131,
"repo_created_at": "2019-09-21T08:20:57.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 2,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "8f683ab0... |
92efebfa-d11f-469d-bf6e-71ef428e40e2 | facebookarchive/BOLT | pstl/include/pstl/internal/memory_impl.h | // -*- C++ -*-
//===----------------------------------------------------------------------===//
//
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
// See https://llvm.org/LICENSE.txt for license information.
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
//
//===------------... | TOOL | 0.923083 | 7.58552 | {
"github_metadata": {
"branch": "main",
"commit_count": 410387,
"repo_created_at": "2018-04-24T23:40:08.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 2530,
"forks": 183,
"issues": 66,
"pull_requests": 2
},
"file_meta": {
"content_id": "6e... |
cf5bb9f9-df7c-4b7b-9332-ca6fa85fc5f7 | NguyenHuynhVietQuang/NguyenHuynhVIetQuang_bt04_ctdl | Chương_6_C++/6_9.cpp | #include <iostream>
#include <vector>
#include <queue>
#include <climits>
#include <cstring>
using namespace std;
// Hướng dẫn di chuyển trong cùng hàng và cột
const int dx[] = {0, 0, -1, 1};
const int dy[] = {-1, 1, 0, 0};
struct Point {
int x, y, steps;
};
bool isValid(int x, int y, int N, vector<vector<char>... | ALGO | 0.99994 | 6.033849 | {
"github_metadata": {
"branch": "main",
"commit_count": 1,
"repo_created_at": "2025-02-17T16:32: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": "81e7f0602893... |
8805c66d-9611-44c8-a9a2-a11a15eed491 | koosaga/olympiad | ICPC/WF/wf2024_a.cpp | #include <bits/stdc++.h>
using namespace std;
#define rng(i,a,b) for(int i=int(a);i<=int(b);i++)
#define rep(i,b) rng(i,0,b-1)
#define gnr(i,b,a) for(int i=int(b);i>=int(a);i--)
#define per(i,b) gnr(i,b-1,0)
#define pb push_back
#define eb emplace_back
#define fi first
#define se second
#define bg begin()
#define ed e... | ALGO | 0.999973 | 3.211241 | {
"github_metadata": {
"branch": "master",
"commit_count": 361,
"repo_created_at": "2015-11-06T16:01:57.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 285,
"forks": 31,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "0e9e8... |
05099fb4-855c-476d-93a3-640e01900c56 | JSandusky/SprueTex | SprueKit/Content/Effects/NoTanNormals.inc |
//Returns a normal from a grid of heights
float3 ComputeHeightNormals(float hA, float hB, float hC, float hD, float hN, float heightScale)
{
//To make it easier we offset the points such that n is "0" height
float3 va = { 0, 1, (hA - hN)*heightScale };
float3 vb = { 1, 0, (hB - hN)*heightScale };
float... | ALGO | 0.999721 | 5.730302 | {
"github_metadata": {
"branch": "main",
"commit_count": 2,
"repo_created_at": "2024-10-31T01:36:43.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "228cbf6fb914... |
64b001c5-c25b-456e-af13-030abc50ade9 | yuba-lab/miscellanea | ntuj/0124.cpp | #include<cstdio>
const char dx[]={1,0,-1,0},dy[]={0,1,0,-1};
char map[99][99];
int n,m,d[99][99];
double load[99][99];
struct pt{int x,y;}q[9999];
char valid(int x,int y)
{
return(x>=0 && x<n && y>=0 && y<m && map[x][y]=='.');
}
int go(int x,int y,char ed,double w)
{
if(d[x][y]==0)return 1;
int sum=0;
f... | ALGO | 0.999137 | 3.3504 | {
"github_metadata": {
"branch": "master",
"commit_count": 89,
"repo_created_at": "2016-05-22T13:54:47.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "b135c84a8d... |
7f9b9b68-c1ea-44d6-bc13-1e81e92e82c9 | jimlo7760/Data-Structure | Lab12/priority_queue.h | #ifndef priority_queue_h_
#define priority_queue_h_
#include <iostream>
#include <vector>
#include <cassert>
template <class T>
class priority_queue {
private:
std::vector<T> m_heap;
public:
priority_queue() {}
priority_queue( std::vector<T> const& values )
{
for (unsigned int i = 0; i < values.size(... | ALGO | 0.992567 | 4.667898 | {
"github_metadata": {
"branch": "main",
"commit_count": 4,
"repo_created_at": "2023-10-02T21:20:45.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "0e534f7745b9... |
45b9c7ec-b87a-47fd-9e0f-3eba8bedb55b | thefreebird777/Mergesort | shellsort.cpp | #include "Shellsort.h"
#include <iostream>
#include <string>
#include <cstdlib>
#include <sstream>
#include <vector>
using namespace std;
Shellsort::Shellsort()
{
delimits.push_back(524287);
delimits.push_back(262143);
delimits.push_back(131071);
delimits.push_back(65535);
delimits.push_back(32767... | ALGO | 0.99987 | 4.269682 | {
"github_metadata": {
"branch": "master",
"commit_count": 10,
"repo_created_at": "2016-10-17T16:09:43.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "f396163ce... |
cb8d2377-80b9-4b22-84d3-ccaca8f1429b | ishandutta2007/codeforces-g | gnoud__/normal/300/E.cpp | #include<bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
#define int long long
int hmt() {int x=0;int c=getchar(),n=0;for(;!isdigit(c);c=getchar()) n=(c=='-');for(;isdigit(c);c=getchar()) x=x*10+c-'0';if(n) x=-x;return x;}
#define in hmt()
#define ins ({string x;char c=getchar(... | ALGO | 0.999943 | 3.482459 | {
"github_metadata": {
"branch": "main",
"commit_count": 1,
"repo_created_at": "2024-04-11T01:55: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": "adcc42b29e09... |
1d49aae3-8762-4f34-b5fc-5e503ee5742f | philippeb8/fcalc | libqd/inline.h | /**
Copyright 2019 Fornux Inc.
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, merge, publish, distribute... | ALGO | 0.952061 | 5.565856 | {
"github_metadata": {
"branch": "master",
"commit_count": 4,
"repo_created_at": "2019-10-21T19:35:44.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 3,
"forks": 2,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "7928f4c176... |
e2deb6ad-8773-49b9-bdfd-a57c1dcb8f4b | ocslegna/codeforces | 341A.cpp | /* P341A by <NAME> - 31/01/16 */
#include <bits/stdc++.h>
using namespace std;
int main(){
int n;
cin >> n;
long long numeros[n];
for(int i=0; i < n; i++){
cin >> numeros[i];
}
int cOdds = 0;
long long lowestOdd = 0;
long long sum = 0;
for(int i = 0; i < n; i++){
sum = sum + nume... | ALGO | 0.999978 | 3.885908 | {
"github_metadata": {
"branch": "master",
"commit_count": 2,
"repo_created_at": "2016-02-06T22:01: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": "a687349c63... |
2b087b42-6f21-4eaa-9b19-95bc21cc14cf | IliyaKarkamov/GraphTheoryProject | src/graph_theory_project/src/main.cpp | #include <graph/graph.h>
#include <iostream>
#include <chrono>
#include <cmath>
#include <future>
using namespace graph;
AdjacencyList<std::string, float> processData(const std::string& inputFile, const std::string& outputFile)
{
AdjacencyList<std::string, float> graph;
std::ifstream ifs(inputFile);
ifs ... | ALGO | 0.989919 | 6.134748 | {
"github_metadata": {
"branch": "master",
"commit_count": 25,
"repo_created_at": "2020-01-05T16:41:55.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "e13e942d5... |
d80337f8-fcd0-438d-a5c3-4e4f4571ffb3 | RyderBlack/MyAntAcademy | bfs_algo/main.cpp | #include <iostream>
#include "ants.h"
int main() {
Anthill ant_0 (4,2);
ant_0.set_room_capacity(0,2);
ant_0.set_room_capacity(1,1);
ant_0.set_room_capacity(2,1);
ant_0.set_room_capacity(3,2);
ant_0.add_tunnels(0,1);
ant_0.add_tunnels(0,2);
ant_0.add_tunnels(1,3);
ant_0.add_tunnels... | ALGO | 0.993668 | 3.50423 | {
"github_metadata": {
"branch": "main",
"commit_count": 18,
"repo_created_at": "2025-05-20T08:31: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": "55f4ec15afc... |
23dfbe6c-b568-49cc-a266-b12af707d701 | EshUno/cpp-transport-catalogue | transport_router.h | #pragma once
#include <variant>
#include <memory>
#include "router.h"
#include "transport_catalogue.h"
namespace routing {
struct Settings{
double bus_wait_time_ = 0;
double bus_velocity_ = 0; // m/min
};
struct WaitEdge{
std::string stop_name;
double time;
};
struct BusEdge{
std::string bus_na... | TOOL | 0.953075 | 6.025387 | {
"github_metadata": {
"branch": "main",
"commit_count": 19,
"repo_created_at": "2023-07-30T09:48: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": "63daa01ad2e... |
d42942bf-4615-4d1b-a16a-beaa03484b86 | Brightorange90/GP | GP.cpp | #include "GP.h"
#include "util.h"
#include "def.h"
#include "MVMO.h"
#include <nlopt.hpp>
#include <Eigen/Dense>
#include <iostream>
#include <fstream>
#include <vector>
#include <utility>
#include <iomanip>
#include <map>
#include <chrono>
using namespace std;
using namespace Eigen;
using namespace std::chrono;
// tr... | ALGO | 0.971385 | 6.052235 | {
"github_metadata": {
"branch": "master",
"commit_count": 43,
"repo_created_at": "2019-06-10T12:53:30.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "d978c5902... |
25c2d83b-4161-4f82-99ed-fb40a309a7ac | Himanjitt/LC_soln | 3271-count-the-number-of-houses-at-a-certain-distance-i/count-the-number-of-houses-at-a-certain-distance-i.cpp | class Solution {
public:
vector<int> countOfPairs(int n, int x, int y) {
vector<vector<int>> adjMat(n + 1, vector<int>(n + 1, 1e9));
for (int i = 1; i < n; i++) {
adjMat[i][i + 1] = 1;
adjMat[i + 1][i] = 1;
}
adjMat[x][y] = 1;
adjMat[y][x] = 1;
... | ALGO | 0.999965 | 5.462203 | {
"github_metadata": {
"branch": "main",
"commit_count": 1073,
"repo_created_at": "2024-10-26T05:48: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": "ec4c7004a... |
c2efdc85-e2ad-497f-ae3a-73d6d770a01f | compiler-research/llvm-project | clang/include/clang/Analysis/FlowSensitive/SourceLocationsLattice.h | //===-- SourceLocationsLattice.h --------------------------------*- C++ -*-===//
//
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
// See https://llvm.org/LICENSE.txt for license information.
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
//
//===---------------------------... | TOOL | 0.958744 | 7.824706 | {
"github_metadata": {
"branch": "main",
"commit_count": 417562,
"repo_created_at": "2021-01-13T19:29:09.000Z",
"is_fork": true,
"is_org_owned": true,
"forked_from": "llvm/llvm-project",
"stars": 3,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_... |
9cf937ca-9bbe-4835-870a-160cb5365184 | delekta/agh-wdi | kolosy-poprawkowe/2015_2016_2.cpp | //
// Created by <NAME> on 08.01.2020.
//
//Dany jest N elementowy zbior liczb naturalnych w postaci tablicy int t[N]. Prosze napisać
//funkcje, ktora zwraca informacje czy jest mozliwy podzial zbioru na trzy zbiory tak, aby w kazdym z
//trzech zbiorow łączna liczba jedynek w liczbach zapisanych w systemie bunarnym był... | ALGO | 0.995408 | 4.841506 | {
"github_metadata": {
"branch": "master",
"commit_count": 8,
"repo_created_at": "2020-11-09T18:02: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": "b7cbd7d2d4... |
e7524b16-f7fe-43cf-b0aa-b01a566332f5 | fastbuild/fastbuild | Code/Core/Strings/LevenshteinDistance.cpp | // LevenshteinDistance.cpp
//------------------------------------------------------------------------------
// Includes
//------------------------------------------------------------------------------
#include "LevenshteinDistance.h"
#include "AString.h"
#include "Core/Env/Assert.h"
#include "Core/Env/Types.h"
// Ch... | ALGO | 0.998687 | 6.594531 | {
"github_metadata": {
"branch": "main",
"commit_count": 2041,
"repo_created_at": "2015-03-21T19:53:07.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 1282,
"forks": 390,
"issues": 151,
"pull_requests": 44
},
"file_meta": {
"content_id": "5b... |
99277298-762d-422f-8843-71ee405eabe4 | sazan007/codes | MonkeyTradition(LOJ) (CRT).cpp | #include<bits/stdc++.h>
using namespace std;
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
using namespace __gnu_pbds;
#define ordered_set tree<int, null_type,less<int>, rb_tree_tag,tree_order_statistics_node_update>
#define ll long long
#define si(n) scanf("%d",&n);
#define PI acos(-1.0... | ALGO | 0.998996 | 3.526991 | {
"github_metadata": {
"branch": "master",
"commit_count": 35,
"repo_created_at": "2020-05-09T11:32: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": "927d50fb7... |
1bd0cc23-968c-44df-9c32-c708fc5aed67 | jimbok8/Animesh | src/libGeom/include/Geom/Geom.h | #pragma once
#include <Eigen/Core>
#include <map>
#include <memory>
#include <vector>
namespace animesh {
class PointNormal {
public:
PointNormal( const Eigen::Vector3f& point, const Eigen::Vector3f& normal);
using Ptr=std::shared_ptr<PointNormal>;
/**
* @return The point.
*/
inline const Eigen::Vector3f& ... | ALGO | 0.994573 | 6.608167 | {
"github_metadata": {
"branch": "master",
"commit_count": 567,
"repo_created_at": "2020-12-17T14:25: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": "749cef81... |
464049d0-0c13-48dd-a03c-3b630a11b12e | Graynder/C-G | Defi Solo/Facile/Le pouvoir de Thor.cpp | #include <iostream>
#include <string>
#include <vector>
#include <algorithm>
using namespace std;
/**
* Auto-generated code below aims at helping you parse
* the standard input according to the problem statement.
**/
int main()
{
int LX; // the X position of the light of power
int LY; // the Y position of ... | ALGO | 0.999965 | 4.94011 | {
"github_metadata": {
"branch": "master",
"commit_count": 1,
"repo_created_at": "2015-10-10T12:00: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": "a67849a720... |
cdfc10c1-0f18-4707-ad35-7243ea9cb526 | kelaicai/homework | jinch.cpp | #include<stdio.h>
struct fcfs//定义进程的结构体
{
char name[10];//进程名
float arrivetime;//到达时间
float servicetime;//服务时间
float starttime;//开始时间
float finishtime;//完成时间
float zztime;//周转时间
float dqzztime;//带权周转时间
float pjzztime;//平均周转时间
float pjdqtime;//平均带全周转时间
};
struct sjf//定义进程的结构体
{
ch... | ALGO | 0.999846 | 3.06345 | {
"github_metadata": {
"branch": "master",
"commit_count": 3,
"repo_created_at": "2018-06-10T08:54: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": "e2535d0c7c... |
b45e75b4-cb68-4e23-994e-b894a1e40531 | GauravDaharia20/Competitive-PRogramming | BinaryTree/replacesum.cpp | #include<bits/stdc++.h>
using namespace std;
class Node
{
public:
int data;
Node *l;
Node *r;
Node(int d)
{
data = d;
l = NULL;
r = NULL;
}
};
Node *levelbuild()
{
int d;
cin >> d;
queue<Node*>q;
Node *root = new Node(d);
q.push(root);
while(!q.... | ALGO | 0.999978 | 4.088167 | {
"github_metadata": {
"branch": "master",
"commit_count": 10,
"repo_created_at": "2021-12-07T09:27: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": "a6abf186f... |
0371a540-244d-46de-bbf3-31849ac61fd7 | timmyjose-experiments/competitive-programming | lc/coreprep/implementation/practice_iterations/patterns_iterations_3/pair_with_target_sum.cpp | #include <algorithm>
#include <cmath>
#include <iostream>
#include <limits>
#include <list>
#include <queue>
#include <random>
#include <string>
#include <unordered_map>
#include <unordered_set>
#include <vector>
using namespace std;
int next_random(int low, int high) {
random_device rd;
mt19937 engine(rd());
u... | ALGO | 0.9998 | 4.589159 | {
"github_metadata": {
"branch": "master",
"commit_count": 181,
"repo_created_at": "2022-06-14T11:32:15.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "04fa16c92... |
8eaaa173-296f-4370-a1ac-d91c52b87d6b | eliogovea/solutions_cp | Timus/1523-6220758.cpp | // Problem: pace=1&num=1523
// Verdict: Accepted
#include <bits/stdc++.h>
using namespace std;
const int mod = 1e9;
int n, k;
int a[20005];
int bit[15][20005];
void update(int id, int p, int v) {
while (p <= n) {
bit[id][p] += v;
bit[id][p] %= mod;
p += p & -p;
}
}
int query(int id, int p) {
int res = 0;... | ALGO | 0.999998 | 4.198787 | {
"github_metadata": {
"branch": "master",
"commit_count": 9,
"repo_created_at": "2019-11-16T04:08: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": "b5f2dc1c7a... |
e91e8811-faeb-4daa-b9bd-aae87f47512e | GonzalesP/cpp-practice-programs | leetcode/670-maximum-swap.cpp | #include <iostream>
#include <vector>
#include <math.h>
class Solution {
public:
std::vector<int> listOfDigits(int num) {
if (num == 0) {
return std::vector<int> {0};
}
std::vector<int> digits;
while(num > 0) {
digits.insert(digits.begin(), num % 10);
... | ALGO | 0.999488 | 5.664392 | {
"github_metadata": {
"branch": "main",
"commit_count": 91,
"repo_created_at": "2024-09-17T00:17:53.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "7987392c733... |
f1a223e9-c4d3-4d8b-83e0-b91d2390b1de | weekend0101/cpp | bst.cpp |
#include <iostream>
using namespace std;
struct Node {
int data;
Node* left;
Node* right;
};
Node* createNode(int value) {
Node* newNode = new Node();
newNode->data = value;
newNode->left = nullptr;
newNode->right = nullptr;
return newNode;
}
Node* insert(Node* root, int value) {
... | ALGO | 0.999954 | 5.572635 | {
"github_metadata": {
"branch": "main",
"commit_count": 1,
"repo_created_at": "2024-11-29T02:18: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": "3b87e57e9261... |
01b79ec6-0761-4059-a37f-aed8d0c4e1c8 | florinrm/PA-Labs-2018 | Lab3/skel-lab03/cpp/task-2/main.cpp | #include <fstream>
#include <iostream>
#include <vector>
#include <algorithm>
using namespace std;
struct Result {
int len;
vector<int> subsequence;
};
class Task {
public:
void solve() {
read_input();
print_output(get_result());
}
private:
int n, m;
vector<int> v;
vector<int> w;
int max (int a, int b... | ALGO | 0.999996 | 3.563482 | {
"github_metadata": {
"branch": "master",
"commit_count": 27,
"repo_created_at": "2018-03-06T11:54: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": "f90d57ad2... |
c140ce68-74fa-4f19-8435-472e1972a308 | Sean-Lan/leetcode | algorithms/criticalConnectionsInANetwork/criticalConnectionsInANetwork.cpp | /**
*
* Sean
* 2020-05-29
*
* https://leetcode.com/problems/critical-connections-in-a-network/
* There are n servers numbered from 0 to n-1 connected by undirected server-to-server connections
* forming a network where connections[i] = [a, b] represents a connection between servers a and b.
* Any server can rea... | ALGO | 0.999909 | 6.264782 | {
"github_metadata": {
"branch": "master",
"commit_count": 754,
"repo_created_at": "2015-04-08T02:27:14.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 3,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "ef73475b... |
c6951955-ac41-416d-b947-d10130edfee6 | LLNL/polytope | src/VoroPP_3d.cc | //----------------------------------------------------------------------------//
// VoroPP_3d
//----------------------------------------------------------------------------//
#include <stdint.h>
#include <cstdlib>
#include <iostream>
#include <iterator>
#include <algorithm>
#include <map>
#include <set>
#include "poly... | ALGO | 0.973187 | 6.601911 | {
"github_metadata": {
"branch": "master",
"commit_count": 754,
"repo_created_at": "2019-02-25T03:32:33.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 9,
"forks": 2,
"issues": 8,
"pull_requests": 3
},
"file_meta": {
"content_id": "24053bb34... |
b3b68704-644a-489a-8fe8-fbf58bc02095 | d-coder111/DSAmplify | C++/988_Smallest_String_Starting_From_Leaf.cpp | /*
988. Smallest String Starting From Leaf
You are given the root of a binary tree where each node has a value in the range [0, 25] representing the letters 'a' to 'z'.
Return the lexicographically smallest string that starts at a leaf of this tree and ends at the root.
As a reminder, any shorter prefix of a string is ... | ALGO | 0.999974 | 6.313835 | {
"github_metadata": {
"branch": "main",
"commit_count": 303,
"repo_created_at": "2023-10-06T22:45:44.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 28,
"forks": 60,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "5b39a20c... |
3db7ff59-ff56-45b0-988f-04a48561c4c4 | LARG/utaustinvilla3d | kalman/BallKF.cpp | #include "BallKF.h"
#include <iostream>
//#include <memory/TextLogger.h>
#include <cstdlib> // abs didn't compile
/*
X[0][0] = posex
X[1][0] = posey
X[2][0] = posetheta
X[3][0] = ballx
X[4][0] = bally
X[5][0] = ballxvel
X[6][0] = ballyvel
*/
BallKF::BallKF(WorldModel* worldModel_) {
worldModel = w... | ALGO | 0.925829 | 4.963426 | {
"github_metadata": {
"branch": "master",
"commit_count": 57,
"repo_created_at": "2016-01-29T18:32:34.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 115,
"forks": 50,
"issues": 1,
"pull_requests": 0
},
"file_meta": {
"content_id": "4a8bc90... |
56222a6e-e25b-45a6-9f48-28e299a56b96 | kisuk010203/PS | CodeForces/Round941/941C.cpp | #include <bits/stdc++.h>
using namespace std;
int main() {
cin.tie(0);
cout.tie(0);
ios_base::sync_with_stdio(false);
int T;
cin >> T;
while (T--) {
int n;
unordered_map<int, int> count;
int distinct = 0;
int adj_cnt = 0;
cin >> n;
for (int i = 0; ... | ALGO | 0.999997 | 4.053381 | {
"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": "a85bfc23... |
8e15b8c6-ff90-499e-ab53-bf99389b6642 | Matrim88RLTW/CPP | old_movement.h | #include <iostream>
#include <vector>
using namespace std;
const int MAP_WIDTH = 10;
const int MAP_HEIGHT = 10;
class Map {
public:
Map() {
// Initialize the map with empty spaces
for (int y = 0; y < MAP_HEIGHT; y++) {
vector<char> row;
for (int x = 0; x < MAP_WIDTH; x++) ... | TOOL | 0.923143 | 5.074504 | {
"github_metadata": {
"branch": "main",
"commit_count": 79,
"repo_created_at": "2022-12-29T02:53:57.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "eb0b12295e4... |
7d23d5fc-aaeb-4079-ac8f-a3501b9e2c4b | 1GuoHaiTong1/Workspace | DataStruct/source/Heap.cpp | #include "../include/Heap.h"
template <typename U>
Heap<U>::Heap()
{
mHeap.resize(0);
mFlag = false;
}
template <typename U>
Heap<U>::Heap(std::vector<U> heap,int flag)
{
mHeap = heap;
mFlag = flag;
}
template <typename U>
Heap<U>::~Heap()
{
mHeap.clear();
}
template <typename U>
void Heap<U>::Heap... | ALGO | 0.996482 | 4.131835 | {
"github_metadata": {
"branch": "master",
"commit_count": 9,
"repo_created_at": "2024-02-20T14:17: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": "334730c822... |
65079254-af46-499c-b37f-747e21e6e1ae | kwoncycle/poro-baek | 5000/5923/solve.c++ | #include <bits/stdc++.h>
using namespace std;
#define ll long long
#define pii pair<int,int>
#define pll pair<ll,ll>
#define X first
#define Y second
#define CNT_LOWER(v,n) (int)(lower_bound((v).begin(),(v).end(),(n))-(v).begin())
#define CNT_UPPER(v,n) (int)(upper_bound((v).begin(),(v).end(),(n))-(v).begin())
// C... | ALGO | 0.999714 | 4.214353 | {
"github_metadata": {
"branch": "main",
"commit_count": 12,
"repo_created_at": "2025-01-30T14:41:25.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 3,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "268333ed200... |
e9de04c9-25fa-47e3-a289-9e8cc5319a3a | shcalbers/code-optimization-project | tanks_hasher.h | #pragma once
namespace Tmpl8
{
using TanksHasher = SpatialHasher<Tank*>;
template <>
class SpatialHasher<Tank*>
{
public:
struct Entry
{
vec2 position;
Tank* object;
};
SpatialHasher(BoundingBox boundary, float cellSize) noexcept;
bool tryInsertAt(vec2 position, Tank* tank) no... | ALGO | 0.972622 | 6.130376 | {
"github_metadata": {
"branch": "master",
"commit_count": 21,
"repo_created_at": "2020-02-07T09:21:54.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "53ff6a57a... |
d18ff7d5-9f55-4f03-b3a8-22012e685e27 | 27augain/Code | BTLESHIP/BTLESHIP.cpp | #include<bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
using namespace std;
using namespace __gnu_pbds;
#pragma GCC optimize("Ofast,O3,unroll-loops")
#pragma GCC target("avx2,bmi,bmi2,lzcnt,popcnt")
#define FOR(i, a, b) for (int i = (a); i <= (int) (b); ++i)
#define FORD(i... | ALGO | 0.999965 | 3.706262 | {
"github_metadata": {
"branch": "main",
"commit_count": 13,
"repo_created_at": "2022-11-03T13: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": "409ed23eb08... |
7ff664fc-9fa4-4239-b67d-ea1c43012c63 | suhanemathur/DSA | bitmanipulation.cpp | #include <iostream>
#include<vector>
using namespace std;
void OddorEven(int num){ //1 is 0000000001, s
if(!(num & 1)){ // preserving the rightmost bit and making everthing else 0
cout<<"Even";
}
else{
cout<<"Odd";
}
}
void powerofTwo(int num){
if((num & (num-1))==0){
cou... | ALGO | 0.991702 | 4.467241 | {
"github_metadata": {
"branch": "main",
"commit_count": 3,
"repo_created_at": "2024-10-17T07:13:11.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "58483fac4fa8... |
c702e150-588d-48c6-b3a6-565dcece95f2 | llynv/CP-files | codeforce/558334F.cpp |
/*
Code by: linvg
Created: 15.10.2024 15:58:39
*/
#include <bits/stdc++.h>
using namespace std;
#define int long long
#define all(x) (x).begin(), (x).end()
#define sz(x) ((int)(x).size())
string to_upper(string a) { for (int i = 0;i < (int)a.size();++i) if (a[i] >= 'a' && a[i] <= 'z') a[i] -= 'a' - 'A'; return a... | ALGO | 0.999881 | 4.895045 | {
"github_metadata": {
"branch": "main",
"commit_count": 16,
"repo_created_at": "2023-05-26T04:12: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": "1543180cf95... |
53c97e92-87b6-42d1-b87f-51f7111625f7 | pufe/programa | 2020-11-20/miranha.cpp | #include <cstdio>
#include <cmath>
struct point_t {
double x, y;
point_t operator-(point_t a) {
return point_t{x-a.x, y-a.y};
}
double length() {
return sqrt(x*x + y*y);
}
double distance(point_t b) {
return (*this-b).length();
}
};
struct node_t {
point_t coord;
bool visited;
double d... | ALGO | 0.999574 | 4.605091 | {
"github_metadata": {
"branch": "master",
"commit_count": 7,
"repo_created_at": "2020-12-08T00:04:40.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "0e6cd7ec46... |
8044dd90-3c8c-480d-b450-5b727a3817c4 | truongcongthanh2000/SPOJ-thanh123456 | thanh123456_AcceptedCodeSPOJ/DIVSEQ.cpp | #include <bits/stdc++.h>
#define pb push_back
#define Rep(i,a,b) for (int i=a; i<=b; i++)
using namespace std;
const int module = 1e9+9;
int n,k;
void nhap()
{
scanf("%d%d",&n,&k);
}
const int N = 1e3+7;
vector <int> a(N);
void pt(int x)
{
int i;
a.clear();
int y=(int)sqrt(x);
if (y == sqrt(x)) {a.p... | ALGO | 0.99998 | 4.121685 | {
"github_metadata": {
"branch": "master",
"commit_count": 7,
"repo_created_at": "2020-01-12T16:43: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": "b106b726a1... |
843215cd-cd28-4e2a-9865-1778cae970a4 | allenwhc/Leetcode | c++/RecoverBinaryTree/RecoverBinaryTree/main.cpp | /*
* Recover Binary Tree
* Last Modified: 7/24/2015
Hint:
1. Traverse the left subtree
2. Check the value of current node:
1) If no violation happens, then mark this node as previous, and move to next node
2) If violation happens:
i) If *first == NULL, it means this is the first violation
Set *fi... | ALGO | 0.999992 | 5.696235 | {
"github_metadata": {
"branch": "master",
"commit_count": 60,
"repo_created_at": "2015-08-24T18:40: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": "344b93397... |
b8d770c7-bd24-40e6-b719-d481220041c5 | WildSmilodon/codingame-puzzle-solutions | easy/the-descent.cpp | // https://www.codingame.com/training/easy/the-descent
#include <iostream>
#include <string>
#include <vector>
#include <algorithm>
using namespace std;
/**
* The while loop represents the game.
* Each iteration represents a turn of the game
* where you are given inputs (the heights of the mountains)
* and where... | ALGO | 0.999719 | 3.777719 | {
"github_metadata": {
"branch": "master",
"commit_count": 18,
"repo_created_at": "2021-11-19T18:42:59.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 9,
"forks": 4,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "94f2d89d3... |
218434a5-63ea-4632-8649-fe470fa57fd6 | bault18/Dijkstra-s_Algorithm | Home_EJ.cpp | #include <iostream>
#include <queue>
#include <list>
#include <vector>
#include <set>
using std::cin;
using std::cout;
using std::endl;
int initial_state = 0;
int goal_state = 13;
struct node {
node() {};
node(int s, double c, std::list<int> p)
{
state = s;
cost = c;
path = p;
}
int state;
double cost;... | ALGO | 0.999962 | 4.297923 | {
"github_metadata": {
"branch": "master",
"commit_count": 3,
"repo_created_at": "2017-02-23T19:52: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": "d3e133c80b... |
3084607f-1a78-450d-becc-a0792f840a15 | YuanWa1/Graph-algorithm | a4/Kruskal.cpp | #include <iostream>
#include <fstream>
#include <algorithm>
using namespace std;
struct Node {
int rank;
int parent;
};
struct Edge {
int src;
int dst;
int weight;
};
bool sortByWeight (const Edge& a, const Edge& b){
return(a.weight<b.weight);
}
// Create a single-node tree with i as the root
vo... | ALGO | 0.999963 | 5.01174 | {
"github_metadata": {
"branch": "master",
"commit_count": 3,
"repo_created_at": "2024-04-01T02: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": "a0676a031e... |
3a0ee151-2707-4c29-bdbf-138c034a0502 | ishandutta2007/codeforces-r | rubikun/normal/947/A.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.99988 | 4.196057 | {
"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": "a1f72850f8c3... |
e783060b-dfc7-479f-bc52-ffa5dbf37cfe | chili-epfl/CelluloV2 | Firmware/src/qml-plugin/src/util/math/PolyBezier.h | /*
* Copyright (C) 2018 EPFL
*
* 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 program is distributed i... | TOOL | 0.950304 | 7.69033 | {
"github_metadata": {
"branch": "main",
"commit_count": 17,
"repo_created_at": "2022-09-14T14:26:13.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 2,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "8bef315e1ee0... |
0b076865-c522-49d4-a722-d05250c959fe | ThomasYeoLab/CBIG | external_packages/matlab/default_packages/matlab_bgl_mac64/libmbgl/layouts.cc | /** @file layouts.cc
* @author <NAME>
* @date 2008-09-25
* @copyright Stanford University, 2008
* Graph layout wrappers
*/
/** History
* 2008-09-25: Initial coding
* 2008-09-27: Fixed progressive calls
*/
#include "include/matlab_bgl.h"
#include <yasmic/undir_simple_csr_matrix_as_graph.hpp>
#include <yasmi... | ALGO | 0.998953 | 6.124664 | {
"github_metadata": {
"branch": "master",
"commit_count": 130,
"repo_created_at": "2016-07-13T11:33:56.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 653,
"forks": 400,
"issues": 14,
"pull_requests": 0
},
"file_meta": {
"content_id": "b29c... |
8564f570-1479-4e4f-b96b-95b8903aa3b0 | CodeChefMUST/Algorithms | Traversal Algorithms/Tree Traversals/Level Order Traversal - Binary Tree/C++/LeftViewBinaryTree.cpp.cpp | /*
Input Tree -
36
/ \
5 23
/ \ / \
9 12 45 56
/
20
Output -
36 5 9 20
Time Complexity - O(n) -- Traversal of at-most n elements of the tree
Space C... | ALGO | 0.999987 | 5.173046 | {
"github_metadata": {
"branch": "main",
"commit_count": 107,
"repo_created_at": "2021-10-01T08:43:39.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 21,
"forks": 45,
"issues": 23,
"pull_requests": 5
},
"file_meta": {
"content_id": "d391e76... |
d414a9f7-a8cb-42dc-a525-db401e6d16bf | CycleRank/cyclerank-dev | src/pageloop_back.cpp | #include <cassert>
#include <fstream>
#include <iostream>
#include <vector>
#include <utility>
#include <algorithm>
#include <queue>
#include <stack>
#include <list>
#include <climits>
using namespace std;
ifstream in("input.txt");
ofstream out("output.txt");
int N, M, S, K;
struct nodo{
bool active;
bool instac... | ALGO | 0.999829 | 3.934734 | {
"github_metadata": {
"branch": "master",
"commit_count": 336,
"repo_created_at": "2019-09-06T09:16:05.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "56fc65fe4... |
06f2936b-169f-4938-a7cc-b31c951255bf | kpilkk/Interviewbit | Dynamic Programming/longest-valid-parentheses.cpp | // https://www.interviewbit.com/problems/longest-valid-parentheses/
// DP solution
int Solution::longestValidParentheses(string A) {
int n = A.length();
vector<int> dp(n , 0);
int ans = 0;
for(int i = 1; i < n; ++i){
if(A[i] == ')'){
if(A[i - 1] == '(')
dp[i] = ... | ALGO | 0.999051 | 5.040586 | {
"github_metadata": {
"branch": "master",
"commit_count": 295,
"repo_created_at": "2020-01-22T17:21:17.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "000214aa... |
848e256b-55e7-48b1-b222-07876b604206 | darrylys/spoj | akvod05.cpp | /*
AC 0.27s 4.0M SPOJ
algo: ad-hoc, data structure
try to do this on paper and a pattern should be evident
the output will go to a pattern of length K+1
assume that the first K numbers are
0 1 2 3 4 5 6 .. K. The next number will be K+1 and K+2nd number is 0
more generally, assume a set of k+1 numbers, a0, a1, a2, ..... | ALGO | 0.99993 | 4.221995 | {
"github_metadata": {
"branch": "master",
"commit_count": 1,
"repo_created_at": "2019-10-31T14:44: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": "2f55835ee4... |
900efb8b-ff26-474c-99a7-21be7a145fc7 | RishiBaijal/AI_project | GameOfLife.cpp | #include "GameOfLife.hpp"
#define ROW_NUMBER 102
#define COL_NUMBER 102
using namespace std;
void copy(int source[ROW_NUMBER][COL_NUMBER], int dest[ROW_NUMBER][COL_NUMBER])
{
int i, j;
for (i = 0; i < ROW_NUMBER; i++)
{
for (j = 0; j < COL_NUMBER; j++)
{
dest[i][j] = source[i]... | ALGO | 0.999627 | 4.188598 | {
"github_metadata": {
"branch": "master",
"commit_count": 12,
"repo_created_at": "2015-08-19T17:49:36.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "3de2d6c33... |
82a7c6fd-fc13-47dd-a14a-d2ff4c3772c7 | ShikakuNara/Competitive_Programming | misc/hackerearth/1.cpp | #include <bits/stdc++.h>
#ifdef LOCAL_TEST
#pragma comment(linker, "/stack:16777216")
#endif
using namespace std;
typedef long long int ll;
typedef vector <ll> vll;
typedef pair<ll, ll> pp;
typedef vector<pp > vpp;
typedef stack < pair<int, int> > sii;
typedef queue < ll > qll;
#define sz(a) (ll) ((a).size())
#def... | ALGO | 0.999994 | 3.638236 | {
"github_metadata": {
"branch": "master",
"commit_count": 4,
"repo_created_at": "2018-06-28T06:53: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": "7c6aaeae9d... |
389612f7-8439-4791-acfe-7c1006fb2a8c | dmitmedv/sportprog | lksh2017/Day7/A.cpp | #include <iostream>
#include <map>
#include <vector>
#include <deque>
#include <cstdio>
#include <algorithm>
#include <stack>
#include <fstream>
using namespace std;
const int Ox[8] = {2, 2, 1, -1, 1, -1, -2, -2};
const int Oy[8] = {1, -1, 2, 2, -2, -2, 1, -1};
const int n = 8;
int main() {
//ifstream cin("check... | ALGO | 0.99996 | 3.056968 | {
"github_metadata": {
"branch": "master",
"commit_count": 1,
"repo_created_at": "2023-10-12T05:18: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": "43f6ccce0a... |
f204f4be-2f64-4476-9c67-5eed241fe5e2 | AlejandroChiValdes/wallbreakers | week2/wordPattern.cpp | class Solution {
public:
// 8ms runtime 9.1mb storage
bool wordPattern(string pattern, string str) {
// split string into an array of words
// begin to map letters to words. Before you insert a pair, check to see if the current letter already corresponds to a word. If it does, and that word is diff... | ALGO | 0.998224 | 6.055945 | {
"github_metadata": {
"branch": "master",
"commit_count": 6,
"repo_created_at": "2019-05-05T04:34: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": "0d9729a96f... |
53a0a73b-05a0-4026-9d6d-07f2220f6bd9 | mateis-rgb/learning | code/cpp/algo-p2/tp/tp_2_6.cpp | #include <iostream>
#include <array>
const int nMax = 999;
using Jeu = std::array<char, nMax>;
void Init (Jeu &plateau, int nbMoutons, int &taillePlateau)
{
taillePlateau = 2*nbMoutons + 1;
// On insere M moutons blanc
for (int k = 0; k < nbMoutons; k++)
{
plateau[k] = 'B';
}
//... | ALGO | 0.99929 | 3.828519 | {
"github_metadata": {
"branch": "main",
"commit_count": 274,
"repo_created_at": "2023-07-13T22:23:35.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "aa5f8dbc7a... |
24e1150e-95b3-460a-94ac-5c1c93badab9 | Gh05ts/DS-Algo | Problems/Array/MergeWOSpace.cpp | #include <iostream>
#include <vector>
#include <algorithm>
using namespace std;
// vector<int> merge(vector<int>& left, vector<int>& right) {
// vector<int> res(left.size() + right.size());
// int l = 0, r = 0;
// for(int i = 0; i < res.size(); i++) {
// if(r >= right.size() || (l < left.size() &&... | ALGO | 0.999879 | 5.643298 | {
"github_metadata": {
"branch": "master",
"commit_count": 5,
"repo_created_at": "2020-03-02T06:53: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": "f9600b89ea... |
d73a25ca-af36-4312-b64a-ca96007670b4 | t-mochizuki/cpp-study | AtCoder/typical90/082 - Counting Numbers/main.cpp | // g++ -std=c++17 -D DEV=1 main.cpp
#include <stdio.h>
#include <cassert>
#include <iostream>
#include <fstream>
#include <vector>
#include <tuple>
using std::cin;
using std::cout;
using std::endl;
using std::terminate;
using std::vector;
using std::tie;
using std::make_tuple;
using std::tuple;
template<long MOD>
cla... | ALGO | 0.999341 | 4.657627 | {
"github_metadata": {
"branch": "main",
"commit_count": 731,
"repo_created_at": "2017-05-27T08:16:06.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "ac65a110c6... |
1f551e8d-337f-4d51-a00d-0447559900d0 | Sandija-V/Codeforce_exercises | 115a/115a.cpp | #include <bits/stdc++.h>
using namespace std;
int n;
vector<int> manager;
vector<int> superior[2001];
/* A recursive function DFS (Depth-First Search) for each manager node in the manager vector. The DFS function takes an employee node m and returns the maximum size of the group that the employee belongs to. The fun... | ALGO | 0.999955 | 3.83533 | {
"github_metadata": {
"branch": "main",
"commit_count": 37,
"repo_created_at": "2023-03-21T17:17: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": "7a0a2008ccd... |
88cbbb03-f729-4e73-b897-f6b3955da544 | AaradhyaSaxena/Competitive_programming | graph/Biconnected-component.cpp | //////https://www.hackerearth.com/practice/algorithms/graphs/biconnected-components/tutorial/
/// https://practice.geeksforgeeks.org/problems/biconnected-graph/0
/// Biconnected Component
#include<bits/stdc++.h>
using namespace std;
int timer;
bool dfs(int s,int par,int n,vector<vector<int>> &adj,vector<bool> &visit... | ALGO | 0.999907 | 5.138521 | {
"github_metadata": {
"branch": "master",
"commit_count": 233,
"repo_created_at": "2018-12-30T14:48:32.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 4,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "6429f07a... |
8e03f4cf-96d5-4f58-89e5-9d75750a3e99 | spiricom/LEAF | TestPlugin/Source/Yin.cpp | /*
==============================================================================
Yin.c
Created: 17 Jan 2017 1:20:23pm
Author: <NAME>
==============================================================================
*/
#include "Yin.h"
#include <stdint.h> /* For standard interger types (int16_t) */
#i... | ALGO | 0.998927 | 5.620496 | {
"github_metadata": {
"branch": "master",
"commit_count": 459,
"repo_created_at": "2018-11-18T23:20:42.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 209,
"forks": 28,
"issues": 6,
"pull_requests": 1
},
"file_meta": {
"content_id": "b25c4... |
72fe1d15-7735-49e0-bc86-8d4ad6aac070 | TaichiNikaido/TaichiNikaido | 吉田学園情報ビジネス専門学校_二階堂汰一/03_2年3Dアクションゲーム(制作途中)/3DGame/Source/System/ranking.cpp | ////=============================================================================
////
//// ランキング [ranking.cpp]
//// Author : 二階堂汰一
////
////=============================================================================
//
////*****************************************************************************
//// ヘッダファイルのインク... | WEB | 0.971957 | 3.40204 | {
"github_metadata": {
"branch": "master",
"commit_count": 52,
"repo_created_at": "2020-10-28T04:48: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": "e90b1a2c6... |
9696f2cc-3758-48eb-8d91-98d4698195f4 | aajjbb/contest-files | Codeforces/BraveKing.cpp | #include <bits/stdc++.h>
template<typename T> T gcd(T a, T b) {
if(!b) return a;
return gcd(b, a % b);
}
template<typename T> T lcm(T a, T b) {
return a * b / gcd(a, b);
}
template<typename T> void chmin(T& a, T b) { a = (a > b) ? b : a; }
template<typename T> void chmax(T& a, T b) { a = (a < b) ? b : a; ... | ALGO | 0.999719 | 4.048332 | {
"github_metadata": {
"branch": "master",
"commit_count": 892,
"repo_created_at": "2016-03-02T13:05:25.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2,
"forks": 2,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "0b47aaf8... |
6763f8a9-b64d-4fe2-8813-197c38981600 | ImranParthib/Enjoy_Programming_Cplusplus | CompilerDesign/Valid_IdentifierOrNot_01.cpp | #include <iostream>
#include <string>
#include <cctype> // For isalnum
using namespace std;
bool isValidIdentifier(const string &str)
{
if (str.empty() || str.length() > 31)
{
return false;
}
char firstChar = str[0];
if (!(isalpha(firstChar) || firstChar == '_'))
{
return fal... | ALGO | 0.996657 | 5.145704 | {
"github_metadata": {
"branch": "main",
"commit_count": 102,
"repo_created_at": "2022-11-13T18:59:29.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "46bd8faf8d... |
1832a2d4-b280-402b-800b-69bcd3efe090 | PolinaKebets/LR5 | Task_2/Task_2/Task_2/main.cpp | #include <limits>
#include <Windows.h>
#include <iostream>
#include <cmath>
#include "..\DynamicLib\Header.h"
#undef max
int main() {
HINSTANCE load;
load = LoadLibrary(L"C:\\Users\\USER\\OneDrive\\Документы\\OAIP\\LR5\\Task_2\\Task_2\\x64\\Debug\\DynamicLib.dll");
typedef int(__stdcall* cntEl)();
... | TOOL | 0.981202 | 3.831802 | {
"github_metadata": {
"branch": "main",
"commit_count": 3,
"repo_created_at": "2024-12-23T09:38: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": "0bdbdbead2e5... |
031a2e52-cdf4-4fed-99f7-468e017a61cb | Meku-nint/DSA | Stack/StackLinkedlist/palindrom.cpp | #include <iostream>
#include <cctype>
#include <string>
using namespace std;
struct Node {
char data;
Node* next;
};
void push(Node*& top, char value) {
Node* newNode = new Node;
newNode->data = value;
newNode->next = top;
top = newNode;
}
char pop(Node*& top) {
if (top != nullptr) {
... | ALGO | 0.99872 | 6.147956 | {
"github_metadata": {
"branch": "master",
"commit_count": 1,
"repo_created_at": "2025-01-01T13:34:27.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "e0945b6fe4... |
598b62b6-bb0f-4748-88fa-8f8b7234d16f | UncleBobbyB/BUPTOJ | 2350.cpp | #include<bitset>
#include<cassert>
#include<string>
#include<sstream>
#include<stack>
#include<queue>
#include<cctype>
#include<algorithm>
#include<map>
#include<iostream>
#include<iomanip>
#include<cstdio>
#include<cstring>
#include<vector>
#include<deque>
#include<algorithm>
#include<set>
// #include<bits/stdc++.... | ALGO | 0.999773 | 3.152215 | {
"github_metadata": {
"branch": "master",
"commit_count": 6,
"repo_created_at": "2019-04-07T11:43: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": "0426c3048b... |
4a7ffa99-d6c3-4183-abf1-7d86ce72df8b | ishandutta2007/codeforces-m | mohamedabookail/normal/1155/C.cpp | /**
* author: <NAME>
* created: 25/O6/2O2O
**/
#include <bits/stdc++.h>
#include <unordered_map>
#include <unordered_set>
using namespace std;
#define endl "\n"
#define ll long long
#define sz(x) int(x.size())
ll _gcd(ll x, ll y) {
return (!y ? x : _gcd(y, x % y));
}
ll _lcm(ll x, ll y) {
return x / _gcd(x... | ALGO | 0.999979 | 3.498045 | {
"github_metadata": {
"branch": "main",
"commit_count": 1,
"repo_created_at": "2024-06-06T01:03:30.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "be96c4c5bd5a... |
38b95fa0-ba45-435e-9fa8-c14c968d89cf | oparry/particle_sim_example | dynamics.hpp | // Defines various functions to compute spatial and dynamical properties of particle vectors
#ifndef dynamics_hpp
#define dynamics_hpp
#include <array>
#include <cmath>
#include <vector>
#include "globals.hpp"
#include "simulation.hpp"
// Returns the centre of mass of a vector of particles
template <typename Particl... | ALGO | 0.988002 | 6.446086 | {
"github_metadata": {
"branch": "master",
"commit_count": 2,
"repo_created_at": "2016-06-13T08:11: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": "3a11937941... |
290b06af-4782-456b-a54f-076cce339743 | ZYLZhuPP/OI | Luogu/P2444.cpp | #include<bits/stdc++.h>
using namespace std;
#define pb push_back
#define For(i, l, r) for (int i = (l); i <= (r); ++i)
const int N = 3e4 + 5;
struct IO {
char c; int f;
#define gc() getchar()
template<class C>
inline IO& operator >> (C &x) {
x = 0; f = 1;
while (!isdigit(c = gc()) && ~c) ... | ALGO | 0.999964 | 4.429155 | {
"github_metadata": {
"branch": "ZYLZPP",
"commit_count": 115,
"repo_created_at": "2024-09-18T03:26:22.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "fdd3605f... |
94e108b1-4b61-4e71-8838-c9a133eb49a8 | tromp/cuckoo | src/cuckoo/cuckoo.h | // Cuckoo Cycle, a memory-hard proof-of-work
// Copyright (c) 2013-2020 <NAME>
#include <stdint.h> // for types uint32_t,uint64_t
#include <string.h> // for functions strlen, memset
#include <stdarg.h>
#include <stdio.h>
#include <chrono>
#include <ctime>
#include "../crypto/blake2.h"
#include "../crypto/siphash.hpp"
... | ALGO | 0.999257 | 3.737686 | {
"github_metadata": {
"branch": "master",
"commit_count": 1017,
"repo_created_at": "2014-01-05T18:20:37.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 836,
"forks": 175,
"issues": 4,
"pull_requests": 0
},
"file_meta": {
"content_id": "ba5... |
2d632125-f9ef-4fa1-8a99-3c911d63136a | NBlood/NBlood | source/build/include/vfs.h |
#pragma once
#ifndef vfs_h_
#define vfs_h_
#include "compat.h"
#ifdef USE_PHYSFS
#include "physfs.h"
using buildvfs_FILE = PHYSFS_File *;
#define buildvfs_EOF (-1)
#define buildvfs_fread(p, s, n, fp) PHYSFS_readBytes((fp), (p), (s)*(n))
#define buildvfs_fwrite(p, s, n, fp) PHYSFS_writeBytes((fp), (p), (s)*(n))
#d... | TOOL | 0.906412 | 5.507591 | {
"github_metadata": {
"branch": "master",
"commit_count": 14247,
"repo_created_at": "2019-02-12T13:57:15.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 671,
"forks": 81,
"issues": 89,
"pull_requests": 4
},
"file_meta": {
"content_id": "19c... |
4c102542-a29b-4b74-b9fc-1cf25de8747c | kimminki10/algorithms | acmicpc/1939/1939.cc | #include <stdio.h>
#include <queue>
#include <vector>
using namespace std;
vector<pair<int, int> > g[10004];
bool isPossible(long long m, int f1, int f2) {
bool check[10004] = {false, };
queue<int> q;
q.push(f1);
check[f1] = true;
while(!q.empty()) {
int v = q.front(); q.pop();
... | ALGO | 0.999956 | 3.702068 | {
"github_metadata": {
"branch": "master",
"commit_count": 163,
"repo_created_at": "2018-07-15T05:20: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": "13833402... |
6b73071a-5d38-4647-bec6-9da046751379 | habibsain/Algorithms_Cpp | a8_matrix.cpp | //fmatrix multiplication
#include <iostream>
#include <vector>
#include <stdexcept>
#include <iomanip>
using namespace std;
vector<vector<double>> matrixMultiplication(const vector<vector<double>>& a, const vector<vector<float>>& b) {
double m = a.size();
double n = a[0].size();
double p = b[0].size();
... | ALGO | 0.999657 | 5.013958 | {
"github_metadata": {
"branch": "main",
"commit_count": 8,
"repo_created_at": "2024-11-08T21:44: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": "4822fbd283cc... |
9710c73e-9596-4bd4-9a73-be170301e733 | Ashishkumar448/GFG-Problem-of-the-day | 2024-12-December-GFG-POTD/December 15 - Peak element/Solution.cpp | #include <iostream>
#include <vector>
#include <sstream>
using namespace std;
class Solution {
public:
int peakElement(vector<int>& arr) {
int n = arr.size();
// Handle edge cases
if (n == 1) return 0;
// Check for peak elements at the beginning and end
if (arr[0] > arr[1])... | ALGO | 0.999479 | 5.10694 | {
"github_metadata": {
"branch": "main",
"commit_count": 1113,
"repo_created_at": "2024-07-18T04:41:29.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "3ab333f4e... |
f3797645-0b3d-488a-8452-5f04d05cdd05 | sami0055/Numerial-Method | RK_4t_For_2nd_Order.cpp | #include<bits/stdc++.h>
using namespace std;
float f(float t, float y, float z) {
// Given differential equation: y'' + 4y' + 5y = 35e^(-4t)
float result = 35 * exp(-4 * t) - 4 * z - 5 * y;
return result;
// Another Given diffenential equation is y'' + 4y' + 4y = (3+t)*e^-2t
// float result = (3+t) *... | ALGO | 0.999997 | 4.158474 | {
"github_metadata": {
"branch": "main",
"commit_count": 3,
"repo_created_at": "2023-11-03T05:38:11.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "dffe02e03727... |
eeb8c7d9-1069-4e5f-bb98-f52087148acb | ipaljak/hio-izborne-2022 | hio/mensza/mensza_paljak.cpp | #include <bits/stdc++.h>
using namespace std;
int l, q;
void alojzije() {
int a;
scanf("%d", &a);
vector<int> ret;
int curr = 0;
for (int i = 30; i >= 0; --i) {
if (a & (1 << i)) {
curr |= 1 << i;
ret.emplace_back(curr);
}
}
printf("%d", (int)ret.size());
for (int x : ret) print... | ALGO | 0.999142 | 3.600743 | {
"github_metadata": {
"branch": "main",
"commit_count": 170,
"repo_created_at": "2022-05-08T21:15: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": "8628c28ce2... |
adaa6ca5-9294-401c-82de-2df2a16764d3 | OSUsatoru/ParallelProgramming | FunctionalDecomposition/main.cpp | #include <stdio.h>
#define _USE_MATH_DEFINES
#include <math.h>
#include <stdlib.h>
#include <omp.h>
#ifndef NUMT
#define NUMT 4
#endif
void Deer();
void Grain();
void Watcher();
void MyAgent();
unsigned int seed = 0;
int NowYear; // 2021 - 2026
int NowMonth; // 0 - 11
float NowPrecip; // inches of r... | ALGO | 0.999858 | 4.925145 | {
"github_metadata": {
"branch": "master",
"commit_count": 7,
"repo_created_at": "2021-04-01T19:56: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": "96ccc6d8a2... |
857ec9b3-7a52-4db8-8406-c0861003e2de | doyubkim/fluid-engine-dev | include/jet/grid_backward_euler_diffusion_solver3.h | // Copyright (c) 2018 <NAME>
//
// I am making my contributions/submissions to this project solely in my
// personal capacity and am not conveying any rights to any intellectual
// property of any third parties.
#ifndef INCLUDE_JET_GRID_BACKWARD_EULER_DIFFUSION_SOLVER3_H_
#define INCLUDE_JET_GRID_BACKWARD_EULER_DIFFUS... | ALGO | 0.999464 | 7.616055 | {
"github_metadata": {
"branch": "main",
"commit_count": 279,
"repo_created_at": "2016-05-08T06:05:38.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2018,
"forks": 277,
"issues": 60,
"pull_requests": 0
},
"file_meta": {
"content_id": "0bf6... |
55d37f33-abc2-4172-a884-94d673bfe1fd | Royal-Phoenix/Data-Structures | C++/Queue ADT.cpp | #include <iostream>
#include <string.h>
using namespace std;
#define SIZE 50
class Queue {
private:
int queue[SIZE], front, rear, size;
public:
Queue() {
front = -1;
rear = -1;
size = 0;
}
bool isFull() {
return front == 0 && rear == SIZE - 1;
}
bool isEmpty() {
r... | ALGO | 0.993059 | 4.293303 | {
"github_metadata": {
"branch": "main",
"commit_count": 52,
"repo_created_at": "2023-07-21T09:13:54.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "12fc42459e2... |
456396b5-bb79-4110-8f15-b4d2717bb291 | raincross7/code-similarity | codes/train_code/problem356/problem356_473.cpp | #include <bits/stdc++.h>
#define pb emplace_back
#define ll long long
#define fi first
#define se second
#define mp make_pair
using namespace std;
typedef pair<int, int> pii;
const int N = int(3e5) + 2;
const int mod = 998244353;
unordered_map<int, int> dem;
int n, x, s[N... | ALGO | 0.999975 | 4.159173 | {
"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": "cd701e055539... |
6113df56-efa1-433e-910e-df1a0b16c8fd | VarunCypherV/LeetCode | TwoPointer/TrappingRainWater.cpp | //best two pointer
class Solution {
public:
int trap(vector<int>& height) {
int n = height.size();
if (n <= 2) {
return 0;
}
int left = 0, right = n - 1;
int leftMax = 0, rightMax = 0;
int area = 0;
while (left < right) {
if (height[le... | ALGO | 0.999991 | 6.617905 | {
"github_metadata": {
"branch": "main",
"commit_count": 144,
"repo_created_at": "2023-04-02T13:00: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": "0d04c7232b... |
67864d2c-a7d8-4ffd-a6c0-8f0ced562ab6 | duxins/leetcode | 258-add-digits.cpp | // 258. Add Digits
//
// Given a non-negative integer num, repeatedly add all its digits until the result has only one digit.
//
// For example:
// Given num = 38, the process is like: 3 + 8 = 11, 1 + 1 = 2. Since 2 has only one digit, return it.
//
// Follow up:
// Could you do it without any loop/recu... | ALGO | 0.997883 | 6.503489 | {
"github_metadata": {
"branch": "master",
"commit_count": 198,
"repo_created_at": "2016-03-06T06:11:30.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 3,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "79f724bf... |
3cf52332-e260-49d6-93e2-4bbc42682e2e | openLB/openLB | src/dynamics/firstOrderLbHelpers3D.h | /* This file is part of the OpenLB library
*
* Copyright (C) 2006, 2007 <NAME>
* E-mail contact: <EMAIL>
* The most recent release of OpenLB can be downloaded at
* <http://www.openlb.net/>
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Pub... | ALGO | 0.999246 | 5.427418 | {
"github_metadata": {
"branch": "master",
"commit_count": 3,
"repo_created_at": "2019-11-03T07:46:11.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 40,
"forks": 15,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "4093174e... |
afd7d69f-835d-4afd-a4b2-c591165696d0 | Matheusdamaceno/codigos | EST.DAD/arvores/arvore.cpp | #include <iostream>
struct Arv
{
int info;
Arv *dir;
Arv *esq;
};
Arv *criaFolha(int valor)
{
Arv *folha = (Arv *)malloc(sizeof(Arv));
folha->info = valor;
folha->dir = NULL;
folha->esq = NULL;
return folha;
}
Arv *criaNoInterno(int valor, Arv *esq, Arv *dir)
{
Arv *interno = (Arv *)malloc(sizeof(A... | ALGO | 0.999916 | 4.285065 | {
"github_metadata": {
"branch": "master",
"commit_count": 84,
"repo_created_at": "2023-03-24T00:01: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": "c952e7deb... |
887c6dec-7f7f-4a2f-a987-c47e7957a84d | EasyMoney-Kun/Cpp | c++提高编程/5. STL-常用算法/5.2 常用查找算法/76 count_if/76.cpp | #include <iostream>
using namespace std;
#include <vector>
#include <algorithm>
class Person
{
public:
Person(string name, int age)
{
this->m_Name = name;
this->m_Age = age;
}
bool operator==(const Person &p)
{
return this->m_Age == p.m_Age;
}
string m_Name;
int m... | ALGO | 0.992064 | 4.696705 | {
"github_metadata": {
"branch": "main",
"commit_count": 24,
"repo_created_at": "2022-03-29T14:42: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": "fbda7fd0842... |
6ac8c9fa-bd3e-4059-887d-1e078f395d19 | yumaokao/leetcpp | answers/73/ans.cpp | #include <string>
#include <climits>
#include <iostream>
#include <vector>
#include <unordered_map>
#include <set>
#include <algorithm>
using namespace std;
class Solution {
public:
void setZeroes(vector<vector<int>>& matrix) {
if (matrix.empty())
return;
int rows = matrix.size();
... | ALGO | 0.998371 | 5.820495 | {
"github_metadata": {
"branch": "master",
"commit_count": 87,
"repo_created_at": "2017-10-01T07:21: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": "b55aa9dfa... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.