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 |
|---|---|---|---|---|---|---|---|
62b1ddae-0f2d-4413-a68c-f1a35bd753ae | Superzhaoooo/RLEs | omnetpp-5.6.2-src-windows/omnetpp-5.6.2/src/scave/stddev.h | //=========================================================================
// STDDEV.H - part of
// OMNeT++/OMNEST
// Discrete System Simulation in C++
//
// Author: <NAME>
//
//=========================================================================
/*-----------------------------------... | ALGO | 0.935765 | 6.870187 | {
"github_metadata": {
"branch": "master",
"commit_count": 2,
"repo_created_at": "2021-03-24T07:56:13.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 9,
"forks": 3,
"issues": 0,
"pull_requests": 1
},
"file_meta": {
"content_id": "715547e7bb... |
f0897d65-8031-45e1-9935-bebdc3f87f49 | DyhaCreator/console_password_generator | main.cpp | #include <iostream>
#include <string>
#include <random>
int random(int min, int max){
std::random_device dev;
std::mt19937 rng(dev());
std::uniform_int_distribution<std::mt19937::result_type> dist6(min, max);
return dist6(rng);
}
bool in(char a, std::string b){
for(int i = 0; i < b.size(); i++){
... | TOOL | 0.97166 | 3.654244 | {
"github_metadata": {
"branch": "main",
"commit_count": 3,
"repo_created_at": "2023-06-29T18:00:33.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "d51e3e79b53f... |
b4a14fcd-6573-45fb-93e1-3d3afade86af | ZephyrZhng/code_win | data structure/5 数组和广义表/十字链表.cpp | #include <iostream>
#include <fstream>
#include <cstdio>
#include <vector>
#include <string>
#include <stack>
#include <numeric>
#include <iterator>
#include <algorithm>
using namespace std;
typedef struct OLNode
{
int i, j;
int e;
struct OLNode *right, *down;
}OLNode, *OLink;
template<class T>
void ShellSort (vec... | ALGO | 0.999672 | 3.138687 | {
"github_metadata": {
"branch": "master",
"commit_count": 1,
"repo_created_at": "2016-01-27T10:40: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": "7414dbad21... |
396479ed-6283-4071-9361-1d7078727e1f | unonao/algorithms | template/template_bfs_grid.cpp | #include <bits/stdc++.h>
using namespace std;
using P = pair<int, int>;
int H, W;
vector<vector<char>> maze; // 迷路の内容を保存する配列
vector<vector<int>> dist; // 距離を記録しておく配列
P s, g;
// 幅優先探索
void bfs(P s) {
const int INF = 1e8;
dist.assign(H, vector<int>(W, INF)); // 初期化
queue<pair<int, int>> que;
que.em... | ALGO | 0.99992 | 4.53316 | {
"github_metadata": {
"branch": "master",
"commit_count": 124,
"repo_created_at": "2020-01-21T04:23:18.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "cbdb13c5... |
e8e488bf-659a-42da-865b-b46bc4a1ae3e | klb3713/aoapc-book | BeginningAlgorithmContests/exercises/ch9/UVa10192.cpp | // UVa10192 Vacation
// <NAME>
// 题意:输入两个字符串,求最长公共子序列长度
// 算法:LCS
#include<cstdio>
#include<cstring>
#include<algorithm>
using namespace std;
const int maxn = 100 + 5;
char A[maxn], B[maxn];
int d[maxn][maxn];
int LCS(const char* A, int n, const char* B, int m) {
memset(d, 0, sizeof(d));
for(int i = 1; i <= n; i... | ALGO | 0.999913 | 3.555858 | {
"github_metadata": {
"branch": "master",
"commit_count": 198,
"repo_created_at": "2013-09-22T01:26:51.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 181,
"forks": 56,
"issues": 1,
"pull_requests": 0
},
"file_meta": {
"content_id": "79d6a... |
db05e247-f91b-434d-9091-09879ca75fe7 | joonyle99/Algorithm | Solved.ac/Solved.ac/2751.cpp | // #include "Timer.h"
// #include "Random.h"
#include <bits/stdc++.h>
using namespace std;
vector<int> cards(1000005);
vector<int> tmp(1000005);
void BubbleSort(vector<int>& arr, int n)
{
// 버블 정렬 O(N^2)
// 거의 정렬된 상태라면 선택 정렬 보다 빠르다
for (int i = 0; i < n; ++i) {
for (int j = 0; j < n - i - 1; ++j) {
// 정렬 상태... | ALGO | 0.999993 | 5.787349 | {
"github_metadata": {
"branch": "main",
"commit_count": 147,
"repo_created_at": "2023-09-18T12:58: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": "98efe58707... |
817cef06-83af-4a20-80d0-0ce28359736b | define16/Class | 2-2/C++/HW/C2pdd/C2pdd/project_2.cpp | #include <iostream>
#include <vector>
using namespace std;
class ExVector{
protected :
vector<double> vec;
int max;
int min;
int gdc;
int lcm;
double delta;
public :
void Input(int num[]){
for(int i=0;i<10;i++)
vec.push_back(num[i]);
}
void Print()
{
cout << "1) 가장 큰 수와 가장 작은 수를 출력하세요." << endl;
... | ALGO | 0.996971 | 3.272049 | {
"github_metadata": {
"branch": "master",
"commit_count": 60,
"repo_created_at": "2018-09-16T07:57: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": "e5abf79db... |
ae8a70e2-88bd-4099-9f3d-a15fc48b0cd3 | gkarthikreddi/DataStructures | c++/stack.cpp | #include <iostream>
using namespace std;
#define MAX 7
struct stack {
int items[MAX];
int top = -1; // You shouldn't do this
};
typedef struct stack stack;
bool empty(stack &s) {
return s.top == -1;
}
bool is_full(stack &s) {
return s.top == MAX - 1;
}
void push(stack &s, int num) {
if (!is_ful... | ALGO | 0.991754 | 4.196667 | {
"github_metadata": {
"branch": "main",
"commit_count": 8,
"repo_created_at": "2024-04-24T13:55: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": "0c786f0624f1... |
6b58733d-3f54-4d3d-b202-a3bac5ce9a22 | harrisiva/AI-Path-Planner | Util/util.cpp | #include "util.hpp"
vector<string> getlines(string filename){
vector<string> lines;
fstream file;
file.open(filename,ios::in);
if (file.is_open()){
string line;
while (getline(file,line)){
lines.push_back(line);}
}
return lines;
}
vector<int> getdimensions(vector<st... | ALGO | 0.998995 | 4.60959 | {
"github_metadata": {
"branch": "main",
"commit_count": 61,
"repo_created_at": "2022-11-16T22:04: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": "2d50c1c1bf8... |
cdf3fcaf-4ce5-4f31-aeb5-2576eb5484a6 | OttoBismark/BellmanFord | src/bellmanFord.cpp | #include <iostream>
#include <list>
#include <climits>
#include <map>
#include "../include/grafo.h"
#include "../include/vertice.h"
#include "../include/bellmanFord.h"
#include "../include/arco.h"
using namespace std;
/*Costruttore della classe BellmanFord*/
BellmanFord::BellmanFord()
{}
/*Distruttore della classe B... | ALGO | 0.99976 | 4.500232 | {
"github_metadata": {
"branch": "master",
"commit_count": 15,
"repo_created_at": "2018-07-02T09:45: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": "66182d584... |
0c60ee95-193f-4bdc-ad00-ac6768d57df6 | xlpiao/code | problem_solving/codility/lesson/3_1.cc | /**
* File : 3_1.cc
* Author : <NAME> <<EMAIL>>
* Date : 2019.04.29
* Last Modified Date: 2019.04.29
* Last Modified By : <NAME> <<EMAIL>>
*/
/* Count minimal number of jumps from position X to Y.
* https://app.codility.com/programmers/lessons/3-time_complexity/frog_jmp/
*... | ALGO | 0.999642 | 4.769481 | {
"github_metadata": {
"branch": "master",
"commit_count": 288,
"repo_created_at": "2015-07-13T05:30:34.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 3,
"forks": 0,
"issues": 1,
"pull_requests": 0
},
"file_meta": {
"content_id": "d739b4ca... |
0645d39d-e0f1-4224-892b-20894f3c8771 | fuwutu/CodeForces | 336C - Vasily the Bear and Sequence.cpp | //4331596 Aug 24, 2013 12:22:08 PM fuwutu 336C - Vasily the Bear and Sequence GNU C++0x Accepted 124 ms 400 KB
#include <cstdio>
int main()
{
int n, a[100000], count[32] = {0};
bool b[32][32] = {false};
scanf("%d", &n);
for (int i = 0; i < n; ++i)
{
scanf("%d", &a[i]);
int x = ... | ALGO | 0.999981 | 3.51117 | {
"github_metadata": {
"branch": "master",
"commit_count": 258,
"repo_created_at": "2013-07-02T16:13:29.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 408,
"forks": 217,
"issues": 1,
"pull_requests": 26
},
"file_meta": {
"content_id": "9d6... |
193067dc-5fde-4dc9-9d3a-54e4c5e7a9bb | vincentorz/Maze | main.cpp | #include <SFML/Graphics.hpp>
#include <iostream>
#include <vector>
#include<stdlib.h>
#include<time.h>
#include<stack>
#include <utility>
#include <windows.h>
#include "functions.h"
#include <string>
using namespace sf;
using namespace std;
int colorx,colory;
pair<int,int> drawing;
bool done_dfs = 0;
bool done_prim = 0... | ALGO | 0.998879 | 3.448884 | {
"github_metadata": {
"branch": "main",
"commit_count": 3,
"repo_created_at": "2024-04-10T12:20: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": "542da4019c97... |
8bf434e7-ec74-4435-b0c6-63b91eab7df4 | DyungWang/leetcode | 179.cc | // @author wangyangyang<<EMAIL>>
// @created 2020/04/29
// @link https://leetcode.com/problems/largest-number/
#include <iostream>
#include <string>
#include <vector>
#include <algorithm>
using namespace std;
class Solution {
public:
string largestNumber(vector<int>& nums) {
vector<string> strs; strs.reserve... | ALGO | 0.999806 | 6.245478 | {
"github_metadata": {
"branch": "master",
"commit_count": 143,
"repo_created_at": "2020-03-22T14:14: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": "751ce906... |
7110c6e4-a22b-4c53-ab1c-547d1ca960bb | alikhan-test/Half-plane-intersection | task_solution.cpp | #include <bits/stdc++.h>
#define all(x) x.begin(), x.end()
#define sz(x) int(x.size())
#define pb push_back
#define rep(i, a, b) for(int i = a; i < b; i++)
using namespace std;
using ld = long double;//change to double if Time Limit
template<class T> int sgn(T x) { return (x > 0) - (x < 0); }
template<class T> struct ... | ALGO | 0.999933 | 4.111071 | {
"github_metadata": {
"branch": "main",
"commit_count": 2,
"repo_created_at": "2024-11-15T01:26: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": "9d7bc9af0a37... |
1347c233-1ec0-43c2-abc8-de2a045905ac | pranavanurag/cf | problemset/1398C.cpp | // https://codeforces.com/problemset/problem/1398/C
#include <iostream>
#include <algorithm>
#include <vector>
#include <map>
#include <cstring>
using namespace std;
long long n, x[123456], pre[123456];
map<long long, long long> cnt;
string s;
long long solve() {
cnt.clear();
pre[0] = s[0] - '0';
for (lo... | ALGO | 0.999808 | 4.831635 | {
"github_metadata": {
"branch": "main",
"commit_count": 8,
"repo_created_at": "2025-06-29T17:51: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": "c774a860626f... |
a41df7e1-35bb-423e-92b4-6e40d38d8b85 | morris821028/UVa | volume110/11056 - Formula 1.cpp | #include <stdio.h>
#include <string.h>
#include <algorithm>
using namespace std;
char name[105][150];
int time[105], IDX[105];
bool cmp(int a, int b) {
if(time[a] != time[b])
return time[a] < time[b];
return strcasecmp(name[a], name[b]) < 0;
}
int main() {
int n, i, j;
int mm, ss, mss;
while... | ALGO | 0.999239 | 3.028156 | {
"github_metadata": {
"branch": "master",
"commit_count": 1197,
"repo_created_at": "2013-06-14T12:34:32.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 571,
"forks": 269,
"issues": 1,
"pull_requests": 1
},
"file_meta": {
"content_id": "256... |
83966dee-2f3c-4e41-92bd-b34aae847f16 | exopyl/cg | src/cgmath/TMatrix4.h | #ifndef __TMATRIX4_H__
#define __TMATRIX4_H__
#include "TVector4.h"
#include <iostream>
using namespace std;
// TMatrix4[n][m] addresses the following element :
// n = row
// m = column
// ie
// m_Mat[0][0] m_Mat[0][1] m_Mat[0][2] m_Mat[0][3]
// m_Mat[1][0] m_Mat[1][1] m_Mat[1][2] m_Mat[1][3]
// m_Mat[2][0] m_Mat[2]... | TOOL | 0.966451 | 4.789356 | {
"github_metadata": {
"branch": "main",
"commit_count": 82,
"repo_created_at": "2022-05-30T13:29: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": "17403c4cae8... |
b7c1c79c-bb0f-4647-b809-7770945baaeb | simon-glitch/simon-glitch.github.io | cool.cpp | #include <bits/stdc++.h>
using namespace std;
string ltrim(const string &);
string rtrim(const string &);
/*
* Complete the 'knightlOnAChessboard' function below.
*
* The function is expected to return a 2D_INTEGER_ARRAY.
* The function accepts INTEGER n as parameter.
*/
int k_dist(int ki, int kj, int n){
... | ALGO | 0.999988 | 4.151746 | {
"github_metadata": {
"branch": "master",
"commit_count": 1603,
"repo_created_at": "2020-04-28T22:52:41.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "a0aa8cd... |
33d9ed61-0ca0-443c-9c6c-211798fde3e4 | anacmolina/CompII-20202 | Parcial III/Clase/Class_Method.h | //================================================
// Construccion de la clase. Diferencia finitas |
// Prototipo |
// | ... | ALGO | 0.993456 | 3.714362 | {
"github_metadata": {
"branch": "main",
"commit_count": 16,
"repo_created_at": "2020-10-26T23:35:51.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "a6acedfda97... |
b797643b-c9e9-4b80-8cf3-69d50de104f4 | KwongKaLok/CPP | BST/bst.h | template <typename T>
class BST
{
private:
struct BSTnode
{
T value;
BST left;
BST right;
BSTnode(const T &x) : value(x) {}
BSTnode(const BSTnode &) = default;
~BSTnode() { cout << "delete " << value << endl; }
};
BSTnode *root = nullptr;
public:
... | ALGO | 0.99803 | 4.82216 | {
"github_metadata": {
"branch": "master",
"commit_count": 73,
"repo_created_at": "2021-07-04T15:54:08.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "a7b00bfd8... |
bf3dde73-5f93-4bba-8c25-20b81ebd9de2 | wasifali2004/DSA-Practice | P8.cpp | #include <bits/stdc++.h>
using namespace std;
int main() {
int n;
cout<<"Enter size: ";
cin >> n;
int a = 0; // space complexity is O(1) (constant) b/c space does not increase on increasing or changing size.
int b = 1; // whereas in a array if you change size, arra... | ALGO | 0.999908 | 3.721675 | {
"github_metadata": {
"branch": "main",
"commit_count": 15,
"repo_created_at": "2024-09-12T08:40: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": "54eeff277f4... |
e9185867-95ea-4474-b7d8-9795e1c6f712 | fevilla/implementation-of-the-data-structure | ICPC/UVA-LNSD/vertices.cpp | #include <bits/stdc++.h>
#include <string>
using namespace std;
template <class V, class E>
class Edge; // prototipo declarado aqui para evitar error al usarlo en Vertex
template <class V, class E>
class Vertex // Clase vertice
{
public:
V m_Dato; // Nombre del vertice
list<Edge<V, E>> m_Ar... | ALGO | 0.980132 | 4.672783 | {
"github_metadata": {
"branch": "main",
"commit_count": 10,
"repo_created_at": "2021-06-02T18:36: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": "25b6c1169f1... |
37db6b94-593a-4259-acf2-897f4bfb7b36 | Strand2013/siguoya | AC_history/[202]快乐数.cpp | //编写一个算法来判断一个数 n 是不是快乐数。
//
// 「快乐数」定义为:对于一个正整数,每一次将该数替换为它每个位置上的数字的平方和,然后重复这个过程直到这个数变为 1,也可能是 无限循环 但始终变不到 1。
//如果 可以变为 1,那么这个数就是快乐数。
//
// 如果 n 是快乐数就返回 True ;不是,则返回 False 。
//
//
//
// 示例:
//
// 输入:19
//输出:true
//解释:
//12 + 92 = 82
//82 + 22 = 68
//62 + 82 = 100
//12 + 02 + 02 = 1
//
// Related Topics 哈希表 数学
// ... | ALGO | 0.999923 | 5.302526 | {
"github_metadata": {
"branch": "main",
"commit_count": 4,
"repo_created_at": "2021-09-11T03:17:20.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "7ef2d1d8e5ad... |
e2b42e25-cf8a-4a8a-897d-8814ee6c00dc | DoctorMax/ShanghaiTech | CS240/project/C++/problem2.cpp | // 时间:2021年6月13日21:18:18
// 贡献者:刘
// 前置文件:problem_2
// 文件内容:第一道题的C代码
// 文件描述:循环实现
// 实现内容:
// TBD:
// 通过个数:all
#include <iostream>
#include <vector>
#include <string>
#include <stdio.h>
using namespace std;
#define bignum (long long) (1e9+1)
#define smallnum (long long) (-1e9-1)
#define max_N (long long) 200002
... | ALGO | 0.999901 | 4.224763 | {
"github_metadata": {
"branch": "main",
"commit_count": 23,
"repo_created_at": "2021-01-11T07:31:40.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 3,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "5fcd8604f5a... |
9bc12be1-d8f8-4ab4-894e-c4770d9fd9b4 | Oneflow-Inc/oneflow | oneflow/core/common/math_util.h | /*
Copyright 2020 The OneFlow 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 agre... | TOOL | 0.943589 | 7.088377 | {
"github_metadata": {
"branch": "master",
"commit_count": 9549,
"repo_created_at": "2017-02-11T06:09:53.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 9355,
"forks": 1008,
"issues": 444,
"pull_requests": 186
},
"file_meta": {
"content_id":... |
4faf0191-7c2c-4cba-98b4-589f9bcf23f4 | Shengxiang-Lin/Lightweight-Deep-Learning-Framework-for-Accurate-Particle-Flow | Dealing With Jets/fastjet/fastjet-3.4.3/include/fastjet/internal/MinHeap.hh | //FJSTARTHEADER
// $Id$
//
// Copyright (c) 2005-2024, <NAME>, <NAME> and <NAME>
//
//----------------------------------------------------------------------
// This file is part of FastJet.
//
// FastJet is free software; you can redistribute it and/or modify
// it under the terms of the GNU General Public License as... | ALGO | 0.983428 | 6.106122 | {
"github_metadata": {
"branch": "main",
"commit_count": 27,
"repo_created_at": "2024-09-16T05:43:47.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 13,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "30246e009e... |
4823a4b5-b13d-4433-b79d-f9f7bd2ea959 | Alexis-2006/progra-bas | semana04/ejer02.cpp | /*Palíndromos: Desarrolla un programa que verifique si una palabra ingresada por el usuario
es un palíndromo (se lee igual de izquierda a derecha que de derecha a izquierda).
Usa un bucle while o for para comparar los caracteres.*/
#include <iostream>
#include <string>
using namespace std;
int main() {
string p... | ALGO | 0.992176 | 4.953001 | {
"github_metadata": {
"branch": "master",
"commit_count": 7,
"repo_created_at": "2024-11-24T00:20: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": "27bdcde18b... |
e441dc12-cd57-4834-bcfb-e19a299d9f3b | bencabrera/bayesian_nets_program | src/gbn/general/path_closing.cpp | #include "path_closing.h"
#include <boost/graph/topological_sort.hpp>
#include <boost/range/adaptor/reversed.hpp>
#include <queue>
#include <iostream>
namespace {
template<typename T>
inline bool is_in(const T& val, const std::set<T>& set)
{
return set.count(val) != 0;
}
}
// using Queue = std::queue<std::... | ALGO | 0.999774 | 4.472519 | {
"github_metadata": {
"branch": "master",
"commit_count": 90,
"repo_created_at": "2018-04-17T11:02:36.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 3,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "797fa95fa... |
ad2c9326-1772-460f-9122-89b711e16c2c | divyank-kashyap/BCA-STATS | Program4.cc | // Write a program to calculate the Geometric Mean for Discrete Series
#include <iostream>
#include <cmath>
using namespace std;
int main() {
int n;
cout << "Enter the number of data points : ";
cin >> n;
double product = 1.0;
double totalFrequency = 0.0;
cout << "Enter data points and thei... | ALGO | 0.999929 | 4.464478 | {
"github_metadata": {
"branch": "main",
"commit_count": 7,
"repo_created_at": "2023-08-28T12:26:25.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "a579d751026e... |
7c223c96-7840-41ec-b7c0-56e213e111b4 | Minh2k3/AI_TLU | AStar_2.cpp | // AI : A*
// Y tuong : Hoan toan theo Pseudocode nhu slide
#include <bits/stdc++.h>
using namespace std;
#define pb push_back
#define is insert
#define each(x,a) for (auto x : a)
const int maxn = 101;
int n, be, en, ans[maxn] = {0};
ifstream inp("AI_Search_6.INP");
pair<int, map<int, int> > node[maxn];
vecto... | ALGO | 0.999875 | 3.70984 | {
"github_metadata": {
"branch": "main",
"commit_count": 6,
"repo_created_at": "2022-12-23T16:23: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": "4cbf72fc5e46... |
de8f4229-97e7-4b40-b18e-2bb814a2c0cd | atatomir/work | _Codeforces/Round 310/D/main.cpp | #include <iostream>
#include <cstdio>
#include <cstring>
#include <vector>
#include <algorithm>
#include <cmath>
using namespace std;
#define mp make_pair
#define pb push_back
#define ll long long
#define maxN 200011
int n, m, i, pos;
pair<ll, int> ord[maxN];
ll x[maxN], len;
int wh[maxN];
int next_right(int pos, ... | ALGO | 0.999997 | 3.879612 | {
"github_metadata": {
"branch": "master",
"commit_count": 302,
"repo_created_at": "2015-03-29T18:54:24.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "8b67b6c4... |
511825f2-9271-43f0-a953-391374632692 | naguraghu99/prep | c++/sortdoc.cpp | #include <iostream>
#include <string>
#include <string.h>
#include <set>
#include <map>
#include <vector>
#include <algorithm>
#include <stdlib.h>
#include <sstream>
#include <fstream>
using namespace std;
long GetTimeStampOfTheFile(string fileName){
int location;
location = fileName.find_last_of( "." );
string tmp ... | ALGO | 0.997126 | 3.41443 | {
"github_metadata": {
"branch": "master",
"commit_count": 17,
"repo_created_at": "2015-05-18T14:41:29.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "d6bfe5878... |
40e80e92-3584-40ab-86e5-54d68718aa02 | PREPONDERANCE/Data-Structure | Binary Tree/Basic BST/6. IsBST.cpp | // To check if a binary tree is a BST, keep in mind of this concept that we should always look at a BST with the awareness of group or recursion
// To be more specific, the basic logic for this problem will be we recursively check if all the data in left subtree are less than the root while those in right subtree are g... | ALGO | 0.999993 | 4.90398 | {
"github_metadata": {
"branch": "main",
"commit_count": 6,
"repo_created_at": "2023-10-15T11:30: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": "d5e190d0f2e3... |
89dfedc8-84dc-43aa-bcd4-de2e3d27fd72 | archrave/DSA-Topics-and-Problems | Searching/binary_search.cpp | #include <iostream>
using namespace std;
int binarySearch(int a[], int n, int key)
{
int start = 0, end = n - 1, mid;
while (start <= end)
{
// mid = (start + end) / 2;
mid = start + (end - start) / 2; // This is a better apprach since '(start + end)' might result in interger overflow.
... | ALGO | 0.999902 | 4.785601 | {
"github_metadata": {
"branch": "main",
"commit_count": 26,
"repo_created_at": "2022-02-13T19:41: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": "b4c668c24a7... |
98897699-68a3-4565-b712-999f2b80cded | leechan02/Algorithm_study | baekjoon/gold/2042/add.cpp | #include <iostream>
#include <vector>
#include <cmath>
std::vector<long long> tree;
void setTree(int i) {
while (i != 1) {
tree[i / 2] += tree[i];
--i;
}
}
void changeValue(int index, long long value) {
long long diff = value - tree[index];
while (index > 0) {
tree[index] = tree[index] + diff;
... | ALGO | 0.999972 | 5.184039 | {
"github_metadata": {
"branch": "main",
"commit_count": 356,
"repo_created_at": "2023-10-13T04:58:20.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "331de962c2... |
33e7d123-d37d-4191-8bce-4724411eb52a | fanfank/leetcode | longest-substring-without-repeating-characters.cpp | class Solution {
public:
int pos[256];
int lengthOfLongestSubstring(string s) {
// IMPORTANT: Please reset any member data you declared, as
// the same Solution instance will be reused for each test case.
for(int i = 0; i < 256; ++i)
pos[i] = -1;
int stp = -1, sz = s.... | ALGO | 0.999968 | 5.236783 | {
"github_metadata": {
"branch": "master",
"commit_count": 75,
"repo_created_at": "2013-11-02T16:32:41.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 171,
"forks": 95,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "60bd3c... |
e63efa02-06ff-4cbc-901f-d1904d376cc5 | centesiman/Grafos | 402/402.cpp | #include <iostream>
#include <string.h>
#include <list>
using namespace std;
#define MAX_NODOS 26
int n_nodos;
int n_aristas;
int matriz_nodos[MAX_NODOS][MAX_NODOS];
int matriz_visitados[MAX_NODOS];
list<int> cola_nodos;
void leerGrafo(){
//leo el numero de nodos y aristas de mi array del grafo
cin >> n_nodos >> n... | ALGO | 0.999831 | 4.217649 | {
"github_metadata": {
"branch": "main",
"commit_count": 3,
"repo_created_at": "2021-11-09T22:13: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": "a7d5e1afe641... |
a416e92e-a39f-4a90-9cf5-e894a0fcc797 | wiizii/Algorithm_solution | 1806.cpp | #include <bits/stdc++.h>
using namespace std;
const int MAX = 100001;
const int INF = 0x3f3f3f3f;
int arr[MAX];
int main() {
ios_base::sync_with_stdio(0);
cin.tie(0);
int n, s;
cin >> n >> s;
for (int i = 0; i < n; i++) {
cin >> arr[i];
}
int l = 0, r = 0;
int acc = arr[r];
... | ALGO | 0.999869 | 3.771385 | {
"github_metadata": {
"branch": "master",
"commit_count": 555,
"repo_created_at": "2020-05-11T06:56:18.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "4f6b9537... |
631e4994-0a72-46ab-9a75-556c97b38b21 | neonsn0w/school-exercises | C++/ticoprof/if_for_while/es5.cpp | #include <iostream>
#include <cstdlib>
using namespace std;
int main()
{
int a, b, t, d=2;
bool looper = true;
cout << "Inserisci a: ";
cin >> a;
cout << "Inserisci b: ";
cin >> b;
if (b>a) {
t = a;
while (t<b){
t++;
cout << t << endl;
}
... | ALGO | 0.998734 | 4.083257 | {
"github_metadata": {
"branch": "main",
"commit_count": 84,
"repo_created_at": "2022-12-21T07:30: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": "6efff323ccc... |
4cab6e34-fa2d-470f-8deb-ecc99ad2e682 | saurabh060792/comp-prog | Codeforces/377A MAZE.cpp | #include <iostream>
#include <vector>
#include <set>
#include <algorithm>
#include <climits>
#include <queue>
using namespace std;
#define MAX 4000006
#define MAX_SIDE 502
typedef long long int lli;
typedef pair<int, int> pii;
struct vertex {
int parent, degree;
bool visited;
};
struct edge {
lli w;
... | ALGO | 0.999928 | 3.804653 | {
"github_metadata": {
"branch": "main",
"commit_count": 412,
"repo_created_at": "2025-03-12T21:45: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": "086c0103a3... |
88c2e55a-6cea-4dc7-bfb2-54a76d2680d7 | anhncs/Probabilistic-Graphical-Models | 3.Markov Networks for OCR/inference/inference-src/libdai/utils/fginfo.cpp | /* This file is part of libDAI - http://www.libdai.org/
*
* Copyright (c) 2006-2011, The libDAI authors. All rights reserved.
*
* Use of this source code is governed by a BSD-style license that can be found in the LICENSE file.
*/
#include <iostream>
#include <cstdlib>
#include <dai/factorgraph.h>
#include <d... | ALGO | 0.974505 | 5.411551 | {
"github_metadata": {
"branch": "master",
"commit_count": 9,
"repo_created_at": "2013-04-21T12:30:24.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 104,
"forks": 70,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "c7a8bae... |
f9a6514f-ba60-4e94-a5fd-4d6dfcf6e4ef | bkhanale/Competitive-Programming | Codeforces/CF_1099/D.cpp | #include <bits/stdc++.h>
using namespace std;
// Approach - 1
// Wrong approach, missed it :(
// int main() {
// int n; cin >> n;
// int a[n], b[n]; a[0] = 0;
// for(int i = 1; i < n; i++) {
// int x; cin >> x;
// a[i] = x - 1;
// }
// for(int i = 0; i < n; i++) {
// cin >> b[i];
// }
// int... | ALGO | 0.999932 | 3.741263 | {
"github_metadata": {
"branch": "master",
"commit_count": 47,
"repo_created_at": "2017-07-18T13:43:47.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2,
"forks": 0,
"issues": 1,
"pull_requests": 0
},
"file_meta": {
"content_id": "3834d51f5... |
679da443-adf2-430c-9fe4-c5e07b8917ec | evan11401/MyJudgeCode | usaco/hamming.cpp | /*
ID: evan11401
TASK: hamming
LANG: C++
*/
#include <iostream>
#include <cstdio>
#include <string>
#include <map>
#include <fstream>
#include <vector>
#include <algorithm>
using namespace std;
int check(int a,int b)
{
int k=0;
while (a || b)
{
if (a%2!=b%2) k++; ... | ALGO | 0.999933 | 3.026434 | {
"github_metadata": {
"branch": "master",
"commit_count": 11,
"repo_created_at": "2018-05-28T07:54: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": "c6bffa497... |
93985f51-9341-4c3c-a79d-ff0474334200 | HaochenLiu/My-LeetCode-CPP | 056.cpp | /*
056. Merge Intervals
Given a collection of intervals, merge all overlapping intervals.
For example,
Given [1,3],[2,6],[8,10],[15,18],
return [1,6],[8,10],[15,18].
*/
/*
Time: O(n)
Space: O(n)
Extra space: O(1)
*/
/**
* Definition for an interval.
* struct Interval {
* int start;
* int end;
* Int... | ALGO | 0.999981 | 6.31514 | {
"github_metadata": {
"branch": "master",
"commit_count": 971,
"repo_created_at": "2015-09-22T23:28:22.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 3,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "b00dab01... |
59f6623a-b657-41c1-9abf-57d28d51812d | TEN-framework/ten-framework | third_party/clingo-sys/clingo/clasp/src/constraint.cpp | //
// Copyright (c) 2006-2017 <NAME>
//
// This file is part of Clasp. See http://www.cs.uni-potsdam.de/clasp/
//
// 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, inclu... | ALGO | 0.997186 | 5.746482 | {
"github_metadata": {
"branch": "main",
"commit_count": 1266,
"repo_created_at": "2024-06-19T14:26:15.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 6756,
"forks": 787,
"issues": 135,
"pull_requests": 21
},
"file_meta": {
"content_id": "5c... |
1ab4a528-2969-4708-a545-4db2b32362bf | OrionGregory/ChessEngineComparator | OldFlaskCode_depreciated/backend/stockfish/src/timeman.cpp | /*
Stockfish, a UCI chess playing engine derived from Glaurung 2.1
Copyright (C) 2004-2024 The Stockfish developers (see AUTHORS file)
Stockfish 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 ve... | ALGO | 0.987556 | 7.302744 | {
"github_metadata": {
"branch": "main",
"commit_count": 101,
"repo_created_at": "2025-01-23T19:54:23.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2,
"forks": 0,
"issues": 7,
"pull_requests": 0
},
"file_meta": {
"content_id": "0c511ab107... |
bc06965d-43d1-44b3-bbd8-ae73d0943fb3 | mdarikrayhan/Competitive-Programming | codeforces/846/A.cpp | #include <bits/stdc++.h>
#define endl '\n'
#define all(a) (a).begin(), (a).end()
#define vi vector<int>
#define int long long int
using namespace std;
int32_t main(){
ios::sync_with_stdio(0);
cin.tie(0);
cout.tie(0);
int n;
cin>>n;
vi nose(n);
vi one(n + 1);
vi zero(n + 1);
... | ALGO | 0.999996 | 3.751012 | {
"github_metadata": {
"branch": "master",
"commit_count": 8052,
"repo_created_at": "2022-05-15T11:22:39.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 18,
"forks": 8,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "793633... |
543f7d31-0f9c-4122-ba9d-88755b928aca | Aahantrikha/Data-Structures-and-Algorithms | c++/insertionarray.cpp | #include <iostream>
using namespace std;
struct Array
{
int A[20];
int size;
int length;
};
void Display(struct Array Arr)
{
int i;
cout<<"Elements are: "<<endl;
for ( i = 0; i < Arr.length; i++)
{
cout<<Arr.A[i];
}
}
void Append(struct Array *Arr, int x)
{
if(Arr->length<Arr... | ALGO | 0.997688 | 3.995654 | {
"github_metadata": {
"branch": "main",
"commit_count": 2,
"repo_created_at": "2024-08-28T10:17: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": "8a7812f737a3... |
935c5372-4fca-43ff-b103-b90c301fc329 | gogdizzy/ACM | code.snippets/kmp.h | //
// Created by 关鑫 on 2018-11-29.
//
#pragma once
void kmp( const char* s, int len, int* n ) {
// s[0] is a sentinel
// s[1..n[i]] is suffix of s[1..i]
n[1] = 0;
for( int i = 2; i <= len; ++i ) {
int j = n[i - 1];
while( j && s[j + 1] != s[i] ) j = n[j];
if( s[j + 1] == s[i] )... | ALGO | 0.993511 | 5.018083 | {
"github_metadata": {
"branch": "master",
"commit_count": 94,
"repo_created_at": "2012-11-12T09:41:08.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 4,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "3bddc2601... |
41370c6e-7724-4eaa-92bb-7a5a116cf234 | mhaoli/ACM-Source-Code | Problems/HDU/HDU3711.cpp | /*
* Author: Plumrain
* Created Time: 2014/8/28 12:38:51
* File Name: C.cpp
*/
#include <iostream>
#include <cstdio>
#include <cstring>
#include <string>
#include <cmath>
#include <algorithm>
#include <vector>
#include <cstdlib>
#include <sstream>
#include <fstream>
#include <list>
#include <deque>
#include <queu... | ALGO | 0.999959 | 3.860545 | {
"github_metadata": {
"branch": "master",
"commit_count": 109,
"repo_created_at": "2015-04-15T04:55:14.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "8385a40a... |
d095f841-d649-4439-8e0a-1798a22b93ff | marvalarva2929/Competitive_Programming | Codeforces/Problems/1567D.cpp | #include <bits/stdc++.h>
#define int long long
#define nl " \n"
#define pi pair<int, int>
#define ff first
#define ss second
using namespace std;
int power(int a, int b) {
int ans = 1;
while (b) {
if (b & 1) ans *= a;
b >>= 1;
a *= a;
}
return ans;
}
bool isten(int x) {
in... | ALGO | 0.999616 | 4.757997 | {
"github_metadata": {
"branch": "master",
"commit_count": 55,
"repo_created_at": "2023-04-26T04:57:28.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "7d500b219... |
f27818ab-9349-4a55-ac3f-1c7c587329c4 | riuri/adventofcode | 2021/12/1.cpp | #include <cctype>
#include <iostream>
#include <map>
#include <set>
#include <string>
using namespace std;
int dfs(const map<string, set<string>> &graph, const string &node,
set<string> &visited) {
int count = 0;
for (const string &next : graph.at(node)) {
if (next == "end") {
count++;
} els... | ALGO | 0.999745 | 4.225497 | {
"github_metadata": {
"branch": "main",
"commit_count": 77,
"repo_created_at": "2021-12-05T14:54: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": "1d677e9e63d... |
39d484fe-8d67-48ce-a85e-cdf3c77f1823 | tylercbest/Class-Work-Projects | Rectangle.cpp | /*
Notes:
C++ was designed by <NAME>.
Data type: Basic/Simple, Structured, Pointers
Basic data types:
int (8), char('A'), string("JSU"),
float(9.9999999, single precision),
double(2.191919191919191, double precision),
bool(true / false)
Variable: int age = 9; float/double age = 9.5;
Constant: const double PI = 3.14... | ALGO | 0.995073 | 4.963436 | {
"github_metadata": {
"branch": "main",
"commit_count": 4,
"repo_created_at": "2024-11-13T16:07: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": "e95fe85dbde0... |
95784e74-ad63-4159-a595-e2a4487d9c50 | rare0b/training-atcoder | Contest/ABC303/A.cpp | #include <bits/stdc++.h>
#include <atcoder/all>
using namespace std;
using namespace atcoder;
using ll = long long;
//
int main() {
int n;
string s, t;
cin >> n >> s >> t;
bool flag = true;
for (int i = 0; i < n; i++) {
if (s[i] == t[i]) {
continue;
} else if (s[i] =... | ALGO | 0.999929 | 5.332166 | {
"github_metadata": {
"branch": "main",
"commit_count": 203,
"repo_created_at": "2023-02-22T14:44: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": "d93f07512b... |
15c36f78-04a8-492b-a117-366cb2160322 | Jay7221/competitve-programming | atcoder/GrandContests/GC064/A.cpp | #include <bits/stdc++.h>
using namespace std;
//#pragma GCC optimize("Ofast,unroll-loops")
//#pragma GCC target("avx,avx2,avx512,fma")
template<typename A, typename B> ostream& operator<<(ostream &os, const pair<A, B> &p) { return os << '(' << p.first << ", " << p.second << ')'; }
template<typename T_container,... | ALGO | 0.999939 | 3.806631 | {
"github_metadata": {
"branch": "main",
"commit_count": 2,
"repo_created_at": "2024-12-20T15:54:08.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "337dbdd29861... |
24128ff6-e442-44b1-9904-b030d74e46f3 | Hayden-Allen/hats | src/vec_util.h | #pragma once
#include "pch.h"
namespace hats::vec_util
{
// m is a tmat, dst and v are vecs
static inline void transform(f32* const dst, const f32* const m, const f32* const v)
{
dst[0] = m[0] * v[0] + m[4] * v[1] + m[8] * v[2] + m[12] * v[3];
dst[1] = m[1] * v[0] + m[5] * v[1] + m[9] * v[2] + m[13] * v[3];
d... | ALGO | 0.980346 | 6.667114 | {
"github_metadata": {
"branch": "main",
"commit_count": 51,
"repo_created_at": "2023-06-24T02:32:27.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "b85eede3bf4... |
8418ebc7-9a9e-470f-ab1d-fe43274d88ab | neppiness/TIL | problem-solving/boj/random-defense/2621-06-10-2023.cpp | #include <bits/stdc++.h>
using namespace std;
char col[5];
int no[5];
int ccnt[4];
int ncnt[10];
int ColToNum(char c) {
if (c == 'R') return 0;
if (c == 'B') return 1;
if (c == 'Y') return 2;
return 3;
}
int main() {
ios::sync_with_stdio(0);
cin.tie(0);
for (int i = 0; i < 5; i++) {
cin >> col[i]... | ALGO | 0.999564 | 3.214828 | {
"github_metadata": {
"branch": "main",
"commit_count": 623,
"repo_created_at": "2022-05-13T05:47: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": "567bd898fd... |
9e698a81-87b2-4eec-8df5-f364c567dffc | uvaaland/ExMD | src/main.cpp | /** @file main.cpp
* @brief Main driving program for ExMD simlation
*
* @author <NAME> (<EMAIL>)
* @date 2016-12-28
* @bug Does not support when velocities are too large for a given time step
* @bug Does not support only 1 particle
*/
/* -- Includes -- */
/* libc includes */
#include <iostream>... | ALGO | 0.997602 | 4.856627 | {
"github_metadata": {
"branch": "master",
"commit_count": 390,
"repo_created_at": "2016-11-28T18:56:01.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 3,
"pull_requests": 0
},
"file_meta": {
"content_id": "9e550737... |
01142165-4d3c-4378-8f53-43086873ead6 | BobKranky/GenerateFirstNNumbersInSetNonDecreasingOrder | GenerateNNumbersFromSetNonDecreasingOrder.cpp | // <NAME>
// This Algorithm takes an N >= 1 from user and returns the first N digits from the set {2^n3^m | m and n are non-negative integers}
#include <iostream>
#include <vector>
#include <queue>
#include <set>
void generateSequence(int N) {
std::priority_queue<int, std::vector<int>, std::greater<int>> pq; // Pr... | ALGO | 0.999927 | 5.797968 | {
"github_metadata": {
"branch": "main",
"commit_count": 8,
"repo_created_at": "2024-11-30T01:26:43.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 1,
"issues": 0,
"pull_requests": 1
},
"file_meta": {
"content_id": "4938cbf8ada8... |
1782fb0f-dd63-489e-a238-29139d555a48 | gitRasheed/cpp-JumpList-Assignment | JumpList.cpp | #include "JumpList.h"
#include <stdexcept>
Node::Node(const string& s, Node* next, Node* jump, int gap) {
data_ = s;
next_ = next;
jump_ = jump;
gap_ = gap;
}
Node::~Node() {
next_ = nullptr;
jump_ = nullptr;
}
JumpList::JumpList() {
head_ = nullptr;
}
// DO NOT CHANGE
// You do not need to understand the co... | ALGO | 0.995137 | 4.900373 | {
"github_metadata": {
"branch": "master",
"commit_count": 17,
"repo_created_at": "2024-11-10T22:08: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": "acc4146e0... |
e6240a81-1b30-4aa0-89d5-27a769bcd288 | ggamsang/AlgorithmPractice | programmers/120840.cpp | #include <string>
#include <vector>
#include <iostream>
using namespace std;
int solution(int balls, int share) {
long long unsigned int answer = 1;
vector<int> N, NM;
for(int n = balls; n > share; --n)
N.push_back(n);
for(int nm = (balls-share); nm > 1; --nm)
NM.push_back(nm... | ALGO | 0.999907 | 4.811625 | {
"github_metadata": {
"branch": "master",
"commit_count": 100,
"repo_created_at": "2017-05-23T11:36: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": "198d2de9... |
42e43b06-b411-4640-b742-de6d908141b8 | Tointech/Leetcode-solutions | Tree/112.Path-Sum.cpp | #include <bits/stdc++.h>
using namespace std;
struct TreeNode {
int val;
TreeNode *left;
TreeNode *right;
TreeNode() : val(0), left(nullptr), right(nullptr) {}
TreeNode(int x) : val(x), left(nullptr), right(nullptr) {}
TreeNode(int x, TreeNode *left, TreeNode *right) : val(x), left(left), righ... | ALGO | 0.999901 | 5.41681 | {
"github_metadata": {
"branch": "master",
"commit_count": 105,
"repo_created_at": "2022-05-02T06:52: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": "61a00781... |
9029d7a1-a2e4-4741-a231-0da5638e6b85 | lee-jeong-geun/ps | swexpert/2477.cpp | #include <cstdio>
#include <iostream>
using namespace std;
typedef struct _data
{
int Time, afterTime, humanidx;
}Data;
typedef struct _data2
{
int humanidx, receptnum;
}Data2;
Data reception[15], repair[15];
int N, M, K, A, B, Human[1005], Time = 0, result;
/*
주어진 조건에 맞게 시뮬레이션 돌리면 된다.
접수창에 도착 하면 큐에 넣어주고 접수창이 ... | ALGO | 0.999859 | 3.373961 | {
"github_metadata": {
"branch": "master",
"commit_count": 693,
"repo_created_at": "2017-10-14T13:45:05.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "9178863d... |
cc6646fc-bc9f-4573-bd00-cd61f1df5cae | Piyush-io/Cpp | maximumofminimumofeverywindow.cpp | //{ Driver Code Starts
#include <bits/stdc++.h>
using namespace std;
// } Driver Code Ends
class Solution
{
public:
// Function to find maximum of minimums of every window size.
vector<int> leftnextsmaller(int arr[], int n)
{
stack<int> s;
vector<int> ans(n, 0);
for (int i = 0; i <... | ALGO | 0.999955 | 6.011165 | {
"github_metadata": {
"branch": "main",
"commit_count": 896,
"repo_created_at": "2023-04-24T13:31: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": "bbd9dc2c89... |
37a07abf-31f5-4020-9c46-8e0761a5947a | gKevinK/LeetCode | 0501-1000/0894_All_Possible_Full_Binary_Trees.cpp | /**
* Definition for a binary tree node.
* struct TreeNode {
* int val;
* TreeNode *left;
* TreeNode *right;
* TreeNode(int x) : val(x), left(NULL), right(NULL) {}
* };
*/
class Solution {
TreeNode* copy(TreeNode* n) {
// if (n == NULL) return NULL;
// TreeNode* nn = new Tree... | ALGO | 0.999936 | 5.653575 | {
"github_metadata": {
"branch": "master",
"commit_count": 901,
"repo_created_at": "2017-12-25T05:10: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": "dfee2978... |
aa241e40-cf5d-4903-a192-863cc5c047a1 | ml1150258/CSC_CIS_17a | Hmwk/Assignment1 - ExampleNamingConventions/Gaddis_9thEd_Chap2_Prob20_PaintCoverage/main.cpp | /*
* File: main.cpp
* Author: Dr. <NAME>
* Created on January 9, 2020, 12:35 PM
* Purpose: Painters Profit
*/
//System Libraries
#include <iostream>
using namespace std;
//User Libraries
//Global Constants - No Global Variables
//Only Universal Constants, Math, Physics, Conversions, Higher Dimensions
//Fun... | ALGO | 0.991503 | 4.966249 | {
"github_metadata": {
"branch": "master",
"commit_count": 11,
"repo_created_at": "2022-09-07T15:57:14.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 6,
"forks": 11,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "233fa116... |
cc5aa651-d2cc-4ce7-b73d-8667abb0560a | vsg-dev/VulkanSceneGraph | src/vsg/utils/PolytopeIntersector.cpp | /* <editor-fold desc="MIT License">
Copyright(c) 2024 <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... | ALGO | 0.997416 | 7.012488 | {
"github_metadata": {
"branch": "master",
"commit_count": 6371,
"repo_created_at": "2018-09-13T08:43:58.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1547,
"forks": 240,
"issues": 28,
"pull_requests": 8
},
"file_meta": {
"content_id": "c... |
20347f2c-121c-4842-b1c9-85d6bc5ac16c | jeonaneum/hh | Data Structure/Sort/[STL] sort()_vector.cpp | #include <iostream>
#include <vector>
#include <string>
#include <algorithm>
using namespace std;
bool compare(pair<string, pair<int, int>> a,
pair<string, pair<int, int>> b) {
if (a.second.first == b.second.first)
return a.second.second > b.second.second;
else
return a.second.first > b.second.first;
}
int m... | ALGO | 0.999269 | 3.170314 | {
"github_metadata": {
"branch": "master",
"commit_count": 16,
"repo_created_at": "2019-02-14T08:35:24.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "fbcdb8c19... |
1d1ee15e-cde2-4763-813f-9edecc4b1da5 | snl-dakota/dakota-packages | acro/tpl/momhlib/MOMHLib/MO/tmotools.h | /*
Multiple Objective MetaHeuristics Library in C++ MOMHLib++
Copyright (C) 2001 <NAME>, <NAME> (<EMAIL>)
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation (www.gnu.org);
either version 2.1 of t... | ALGO | 0.999932 | 5.880224 | {
"github_metadata": {
"branch": "devel",
"commit_count": 279,
"repo_created_at": "2021-08-17T16:15:05.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 1,
"forks": 6,
"issues": 5,
"pull_requests": 1
},
"file_meta": {
"content_id": "bf45f01fcd... |
1029758a-3635-4d30-aac7-e02dd17485fb | wy-time/Store_code-ICPC | contest/牛客练习赛/27/C.cpp | #include <iostream>
#include <cstdio>
#include <algorithm>
using namespace std;
typedef long long ll;
#define wfor(i,j,k) for(i=j;i<k;++i)
#define mfor(i,j,k) for(i=j;i>=k;--i)
// void read(ll &x) {
// char ch = getchar(); x = 0;
// for (; ch < '0' || ch > '9'; ch = getchar());
// for (; ch >= '0' && ch <= '9'; ch =... | ALGO | 0.99993 | 3.784866 | {
"github_metadata": {
"branch": "master",
"commit_count": 412,
"repo_created_at": "2019-04-12T08:36: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": "5d3c9117... |
9acc9772-857e-4916-a7d8-d64fc7722aad | RighteousGong/LeetCode | LinkedLists/DoubleList/a01.cpp | /*
设计链表
你可以选择使用单链表或者双链表,设计并实现自己的链表。
单链表中的节点应该具备两个属性:val 和 next 。val 是当前节点的值,next 是指向下一个节点的指针/引用。
如果是双向链表,则还需要属性 prev 以指示链表中的上一个节点。假设链表中的所有节点下标从 0 开始。
实现 MyLinkedList 类:
MyLinkedList() 初始化 MyLinkedList 对象。
int get(int index) 获取链表中下标为 index 的节点的值。如果下标无效,则返回 -1 。
void addAtHead(int val) 将一个值为 val 的节点插入到链表中第一个元素之前。在插入完... | ALGO | 0.999491 | 5.539243 | {
"github_metadata": {
"branch": "main",
"commit_count": 41,
"repo_created_at": "2024-03-31T13:40: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": "79c78c56e46... |
8b105cd8-b89f-45f1-aad1-362237c1fad3 | Branden-Frieden/MSD | CS6013/OpenMP_HW/main.cpp | #include <iostream>
#include <vector>
#include <thread>
#include <omp.h>
template <typename T>
auto parallel_sum_std(T a[], size_t N, size_t num_threads){
auto startTime = std::chrono::high_resolution_clock::now();
std::atomic<T> sum = 0.0;
size_t blockLength = N/num_threads;
std::vector<std::threa... | ALGO | 0.999175 | 4.828853 | {
"github_metadata": {
"branch": "main",
"commit_count": 170,
"repo_created_at": "2022-08-22T17:16: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": "fed3820701... |
6ad5b311-0bf1-4f07-8db0-c50bc10632e7 | IntNull93/51_55 | C++_Primer/3_chapter/vector_calc_iter.cpp | /*
* =============================================================================
*
* Filename: vector_calc_iter.cpp
*
* Description: calc vector by using iterator
*
* Created on: 2015Äê10ÔÂ20ÈÕ
*
* Created by: Int_Null
*
* ==============================================================... | ALGO | 0.997944 | 5.440856 | {
"github_metadata": {
"branch": "master",
"commit_count": 32,
"repo_created_at": "2015-11-05T07:15: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": "3391af951... |
3eafc58f-e3e5-49d2-bfe4-0b8562e170d2 | pranjay-poddar/Dev-Geeks | cpp-projects/Rock-Paper-Scissors/rock-ppr-scissors.cpp | #include <iostream>
#include <cstdlib>
#include <ctime>
enum class Choice { ROCK, PAPER, SCISSORS };
Choice getPlayerChoice() {
int choice;
std::cout << "Enter your choice (0 for Rock, 1 for Paper, 2 for Scissors): ";
std::cin >> choice;
return static_cast<Choice>(choice);
}
Choice getComputerChoice(... | TOOL | 0.975531 | 5.608788 | {
"github_metadata": {
"branch": "main",
"commit_count": 3815,
"repo_created_at": "2021-08-31T18:49:02.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 618,
"forks": 808,
"issues": 218,
"pull_requests": 73
},
"file_meta": {
"content_id": "53... |
c2895b85-d1e7-42d1-9998-25aca172c360 | Chiki1601/Leetcode-Solution-in-Cpp | 2401-2500/2421.cpp | struct DSU {
vector<int> size;
vector<int> par;
DSU (int n) {
size.resize(n, 1);
par.resize(n);
for (int j = 0; j < n; j ++) par[j] = j;
}
int Leader (int x) {
if (x == par[x]) return x;
return (par[x] = Leader(par[x]));
}
void merge (in... | ALGO | 0.999946 | 5.497646 | {
"github_metadata": {
"branch": "main",
"commit_count": 1476,
"repo_created_at": "2022-07-22T05:42:37.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "67636d15f... |
f9239158-be72-4093-b4a8-cb331f6d1a3e | rehan-ahmed07/muj_sem2_cpp_practical_ia | asques3.cpp | #include <iostream>
using namespace std;
// Function to perform bubble sort on an array
void bubbleSort(int array[], int size) {
for (int i = 0; i < size - 1; i++) {
for (int j = 0; j < size - i - 1; j++) {
if (array[j] > array[j + 1]) {
// Swap the elements
int ... | ALGO | 0.998926 | 5.461228 | {
"github_metadata": {
"branch": "main",
"commit_count": 1,
"repo_created_at": "2024-07-16T13:39: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": "b7a658b3dedb... |
28947a6b-bf6b-44c8-baa8-cdb08be464a9 | ForrestFire0/RobotCode | Richaron/MS5/Subtask6/Motors.ino | /*
There are two concepts that I am using here to possibly help
*/
#define BOOST_SPEED 200
#define RIGHT_DEADBAND 36
#define LEFT_DEADBAND 50
//left from -256 to 256
void setMotors(int left, int right) {
//First, we need to calculate the actual motor precentage based on what we are passed.
//We cannot do ... | TOOL | 0.901943 | 5.854391 | {
"github_metadata": {
"branch": "main",
"commit_count": 20,
"repo_created_at": "2022-03-09T19:57:15.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 2
},
"file_meta": {
"content_id": "5eef54eb2bf... |
7b1c0955-8303-4660-983d-131f3b2b5c69 | juanmsuarez/el-mastro-icpc | contests/Regionales/Regional 2017/k.cpp | #include <bits/stdc++.h>
using namespace std;
#define forn(i,n) for(int i=0;i<int(n);i++)
#define forsn(i,s,n) for(int i=(int)(s);i<(int)(n);i++)
#define dforsn(i,s,n) for(int i=(int)(n-1);i>=int(s);i--)
#define si(a) int((a).size())
#define pb push_back
#define mp make_pair
#define all(a) a.begin(),a.end()
#define fa... | ALGO | 0.999923 | 3.711498 | {
"github_metadata": {
"branch": "master",
"commit_count": 279,
"repo_created_at": "2019-01-16T20:12:04.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 3,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "2917a387... |
4488ae24-d8bd-4258-9a7d-31bcbc04c9ed | ninghang/bayesianPlay | cpplapack-2005_03_25/include/_zrovector-/_zrovector-zrovector.hpp | //=============================================================================
/*! _zrovector+zrovector operator */
inline _zrovector operator+(const _zrovector& vecA, const zrovector& vecB)
{
#ifdef CPPL_VERBOSE
std::cerr << "# [MARK] operator+(const _zrovector&, const zrovector&)"
<< std::endl;
#endif... | ALGO | 0.912001 | 5.128795 | {
"github_metadata": {
"branch": "master",
"commit_count": 15,
"repo_created_at": "2012-08-17T20:48: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": "40ce46954... |
e2cf53c2-8162-4e03-b80b-2af7e68db42d | P37RIFIED/DSLAb | LAb/Lab 1/q4.cpp | #include <iostream>
#include <string>
using namespace std;
int main()
{
string name[5];
int age[5];
double membership[5];
// Input name and age for five people
for (int i = 0; i < 5; i++)
{
cout << "Enter name and age of person " << i + 1 << ": ";
cin >> name[i] >> age[i];
... | ALGO | 0.996768 | 4.740715 | {
"github_metadata": {
"branch": "main",
"commit_count": 4,
"repo_created_at": "2023-04-30T03:39: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": "8620b65d76cf... |
0694ddbe-f930-4248-b3b1-495452ad69cb | SuperVan-Young/hls | src/allocate/ilp.cpp | #include "ilp.h"
namespace hls {
const float theta_pipeline = 2.0;
// Use ILP to allocate resource types.
// Assume all resource types are instantiated once, under the given area limit,
// find the set with maximum size that could cover all operation types.
int ILPAllocator::allocate_resource_type() {
int *colno... | ALGO | 0.9661 | 5.984004 | {
"github_metadata": {
"branch": "main",
"commit_count": 54,
"repo_created_at": "2022-05-04T01:11: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": "4ab345b8cbb... |
118b73a8-b37a-4f25-b658-c237a204f197 | ushadow/pdbntk | lib/include/inference/infenginehmm.h | /*
* infenginehmm.h
*
* Copyright (C) 2009, <NAME>, The Bioinformatics Centre, University of Copenhagen.
*
* This file is part of Mocapy++.
*
* Mocapy++ is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software... | ALGO | 0.958786 | 6.223254 | {
"github_metadata": {
"branch": "master",
"commit_count": 23,
"repo_created_at": "2013-06-24T15:59:47.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 4,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "c1f156a85... |
eeb14fee-b941-4bf8-9a3f-b302cad7f632 | timi-liuliang/echo | thirdparty/mlpack/thirdparty/armadillo/include/armadillo_bits/op_sqrtmat_meat.hpp | // Copyright 2008-2016 <NAME> (http://conradsanderson.id.au)
// Copyright 2008-2016 National ICT Australia (NICTA)
//
// 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.or... | ALGO | 0.999793 | 6.536653 | {
"github_metadata": {
"branch": "master",
"commit_count": 3016,
"repo_created_at": "2018-03-10T04:07:35.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 971,
"forks": 116,
"issues": 254,
"pull_requests": 0
},
"file_meta": {
"content_id": "f... |
1e514212-d86b-49c8-b721-f3234a8114b2 | mindspore-ai/mindspore | mindspore/ccsrc/plugin/device/cpu/kernel/in_top_k_cpu_kernel.cc | /**
* Copyright 2022 Huawei Technologies Co., Ltd
*
* 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... | ALGO | 0.995265 | 7.534879 | {
"github_metadata": {
"branch": "master",
"commit_count": 83896,
"repo_created_at": "2020-02-11T08:43:48.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 4559,
"forks": 740,
"issues": 181,
"pull_requests": 20
},
"file_meta": {
"content_id": ... |
7451c88c-5f96-4fb1-9e67-0e4edbecff32 | tylerdefoor/Parallel-Computation | PA4/Critiques/PA04/src/para.cpp | // Header Files
#include <iostream>
#include "mpi.h"
#include <stdio.h>
#include <stdlib.h>
#include <cstring>
#include <cmath>
using namespace std;
// Global Constants
bool PRINT = true;
bool UNIQUE_MATRIX = true;
int TESTS = 1;
// Function Prototypes
void getData( int argc, char* argv[], int &rows, int &columns );... | ALGO | 0.994573 | 4.280663 | {
"github_metadata": {
"branch": "master",
"commit_count": 102,
"repo_created_at": "2017-02-16T17:38: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": "7492cf60... |
34b6a4e9-bddc-4c3b-9a46-130152eacbb1 | lemire/Code-used-on-Daniel-Lemire-s-blog | 2021/07/14/union2by2.cpp |
#include <algorithm>
#include <chrono>
#include <cmath>
#include <filesystem>
#include <fstream>
#include <iostream>
#include <memory>
#include <random>
#include <vector>
uint64_t nano() {
return std::chrono::duration_cast<::std::chrono::nanoseconds>(
std::chrono::steady_clock::now().time_since_epoch()... | TEST | 0.996094 | 6.740138 | {
"github_metadata": {
"branch": "master",
"commit_count": 2385,
"repo_created_at": "2012-04-06T00:13:02.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 885,
"forks": 184,
"issues": 2,
"pull_requests": 5
},
"file_meta": {
"content_id": "069... |
58f59158-d02b-4c25-a080-19d2135e7a3d | threeal/leetspace | old-problems/1992/solution.cpp | #include <vector>
class Solution {
public:
std::vector<std::vector<int>> findFarmland(std::vector<std::vector<int>>& land) {
std::vector<std::vector<int>> coordinates{};
for (int y1{0}; y1 < static_cast<int>(land.size()); ++y1) {
for (int x1{0}; x1 < static_cast<int>(land[y1].size()); ++x1) {
... | ALGO | 0.999829 | 7.389076 | {
"github_metadata": {
"branch": "main",
"commit_count": 2163,
"repo_created_at": "2023-09-13T10:41:38.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 1,
"issues": 235,
"pull_requests": 174
},
"file_meta": {
"content_id": "33b50... |
5c09c462-bb85-413e-8c1f-c3c3d54b46b0 | Matvii-Jarosh/math_utils | rpn/utils.cpp | /*
* Copyright (C)2025 <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, merge, publish, dist... | TOOL | 0.95917 | 6.686241 | {
"github_metadata": {
"branch": "main",
"commit_count": 6,
"repo_created_at": "2025-04-14T12:42: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": "208a28a39ddb... |
627b6a49-828e-4757-a4b5-be61bafc92e7 | Wanzaz/ParallelJacobiMethod | src/main.cpp | #include <QCoreApplication>
#include <QDebug>
#include <QtConcurrent>
#include "MatrixHandler.h"
#include "JacobiSolver.h"
#include "ArgumentParser.h"
/**
* @brief The main function that initializes the application, parses arguments,
* loads the matrix and vector, and solves the system using the Jacobi method... | ALGO | 0.999172 | 6.473105 | {
"github_metadata": {
"branch": "main",
"commit_count": 13,
"repo_created_at": "2025-01-09T13:31: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": "cf9b5ae44a7... |
a5dda0ac-fa4b-4d94-8212-deb0ed2aafcd | kewook55/PS-BOJ | Minimum_Spanning_Tree/13418-학교탐방하기(MST).cpp | /*
오르막길을 내려갈 순 없다. 따라서 그냥 오르막을 cost = 1로 생각해주고 kruskal 알고리즘을 사용하면 된다.
*/
#include<iostream>
#include<algorithm>
#include<vector>
#include<cstring>
using namespace std;
struct Edge {
int node1, node2, cost;
bool operator < (const Edge &ipt)const {
return cost < ipt.cost;
}
};
int N, M, parent[1001];
vector<Edge... | ALGO | 0.999752 | 3.773536 | {
"github_metadata": {
"branch": "master",
"commit_count": 125,
"repo_created_at": "2020-05-28T06:31: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": "58c57f03... |
bb6d4213-0be8-4b2b-97dc-2ec641875c3f | nvkuy/CompetitiveProgramming | VNOJ/hbtlca/main.cpp | #include <bits/stdc++.h>
using namespace std;
#pragma GCC optimize("O3,unroll-loops")
#pragma GCC target("avx2,bmi,bmi2,lzcnt,popcnt")
const int max_h = 20;
vector<vector<int>> c;
vector<vector<int>> up;
vector<int> depth;
int root;
void buildBL(int u, int par) {
up[u][0] = par;
for (int i = 1; i < max_h; i... | ALGO | 0.999959 | 4.611433 | {
"github_metadata": {
"branch": "master",
"commit_count": 121,
"repo_created_at": "2022-01-21T04:40: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": "61115fc4... |
74c8221e-340d-49b0-b527-a0c381efffa2 | sharmaUday0903/Codes | B_Stand-up_Comedian.cpp | // author : <NAME>
// 2023-01-24 20:29:12
#include <bits/stdc++.h>
#define fast \
ios_base::sync_with_stdio(false); \
cin.tie(NULL);
using namespace std;
#define f first
#define s second
#define mp make_pair
#define pb push_back
#define REP(i, k, n) for (int i = k; i < n; i++)
#define ... | ALGO | 0.99995 | 4.72403 | {
"github_metadata": {
"branch": "main",
"commit_count": 43,
"repo_created_at": "2022-09-16T05:44: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": "63b463e9774... |
9226ca04-be57-4935-9c10-1efd5b8d8010 | nlphacker/bavieca | src/common/estimation/FMLLREstimator.h | /*---------------------------------------------------------------------------------------------*
* Copyright (C) 2012 <NAME> - www.bltek.com - Boulder Language Technologies *
* *
* www.bavieca.org is the website of ... | ALGO | 0.967351 | 6.462278 | {
"github_metadata": {
"branch": "master",
"commit_count": 18,
"repo_created_at": "2014-08-04T12:38:34.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 3,
"forks": 2,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "0a0f80a41... |
afb2b694-5d8d-4e9c-a011-56a34bfa7e81 | josephvoss/me348-robot | RoboMaze.cpp | #include "simpletools.h" // Include simple tools
#include "servo.h"
#include "ping.h"
#include "abdrive.h"
#include "wifi.h"
//#include "ff_functions.h"
//int position[2];
//int ff_arr[6][6];
//int wall_arr[6][6];
//int goal[2];
//int direction = 0;
//int move = 0;
//int wall_arr[6][6] = {{11,8,1... | TOOL | 0.997157 | 3.693568 | {
"github_metadata": {
"branch": "master",
"commit_count": 131,
"repo_created_at": "2017-04-27T19:44:51.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 2,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "2913ede2... |
0594c607-39ad-41f2-8462-3126a44570c5 | heahgo/Algorithms | cpp/sort/insertion_sort.cpp | #include <cstdio>
void Swap(int* a, int* b) {
if (a == b) return;
*a ^= *b;
*b ^= *a;
*a ^= *b;
}
void PrintArr(int* arr, int size) {
printf("[");
for (int i = 0; i < size; i++) {
if (i == size-1) printf("%d]\n", arr[i]);
else printf("%d, ", arr[i]);
}
}
void InsertionSort... | ALGO | 0.999908 | 5.293817 | {
"github_metadata": {
"branch": "main",
"commit_count": 54,
"repo_created_at": "2023-05-08T13:32: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": "13523a836b8... |
61c41b2e-f927-452d-9267-fd9623877e8c | martinpiper/C64Public | Compression/DecompressU.cpp | #include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include "DecompressU.h"
#include "CompressUInternals.h"
static inline int DecompressionU_readBit(const unsigned char** ppInBlock, const unsigned char* pDataEnd, int* currentBitMask, unsigned char* bits)
{
int nBit;
const unsigned char* pInBlock = *ppInBlock... | ALGO | 0.967111 | 4.871987 | {
"github_metadata": {
"branch": "master",
"commit_count": 140,
"repo_created_at": "2013-04-05T03:58:30.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 139,
"forks": 24,
"issues": 5,
"pull_requests": 2
},
"file_meta": {
"content_id": "e233e... |
c1f44363-405b-4fdb-9234-cc75a8aa1083 | ishandutta2007/codeforces-s | saketh/normal/1034/B.cpp | #include <bits/stdc++.h>
using namespace std;
#define TRACE(x) x
#define WATCH(x) TRACE(cout << #x" = " << x << endl)
#define WATCHR(a, b) TRACE(for (auto it=a; it!=b;) cout << *(it++) << " "; cout << endl)
#define WATCHC(V) TRACE({cout << #V" = "; WATCHR(V.begin(), V.end());})
#define all(x) (x).begin(), (x).end()
... | ALGO | 0.999974 | 3.901117 | {
"github_metadata": {
"branch": "main",
"commit_count": 1,
"repo_created_at": "2024-10-30T16:07: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": "e78836c1b7dc... |
4913b8b1-31aa-4a2c-a4e0-d453d7c853de | rsato64/SimpleBounce | simplebounce.cc | #include<iostream>
#include<cmath>
#include"simplebounce.h"
namespace simplebounce{
// integral by trapezoidal rule
double integral(const double *integrand, const double dr, const int n){
double result = 0.;
for(int i=0; i<n-1; i++){
result += (integrand[i] + integrand[i+1])*dr*0.5;
}
return result;
}
///////... | ALGO | 0.999359 | 4.075582 | {
"github_metadata": {
"branch": "master",
"commit_count": 41,
"repo_created_at": "2019-07-30T07:22:04.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 4,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "d3fc31990... |
9665b9b2-7c37-4fb5-b76b-c31cd74acb0d | NVIDIAGameWorks/PhysX-3.4 | PhysX_3.4/Source/LowLevelDynamics/src/DyArticulationContactPrepPF.cpp | //
// Redistribution and use in source and binary forms, with or without
// modification, are permitted provided that the following conditions
// are met:
// * Redistributions of source code must retain the above copyright
// notice, this list of conditions and the following disclaimer.
// * Redistributions in bin... | ALGO | 0.949303 | 5.352944 | {
"github_metadata": {
"branch": "master",
"commit_count": 30,
"repo_created_at": "2016-10-12T16:34:31.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 2383,
"forks": 282,
"issues": 49,
"pull_requests": 9
},
"file_meta": {
"content_id": "2b31... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.