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
1c172951-99e2-4899-b964-2c7a93fe8629
SirShreder/CPP-Learning-Hub
bits/PracticalApps/general.h
#ifndef BITWORKS_H_V2 #define BITWORKS_H_V2 #include <type_traits> #include <cstdint> #include <bitset> #include <limits> namespace basics{ /** * @brief Checks if a number is odd or even using bitwise operation. * * @tparam T The numeric type of the input. * @param num The number to check. ...
ALGO
0.998463
7.530463
{ "github_metadata": { "branch": "main", "commit_count": 390, "repo_created_at": "2024-11-28T10:07: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": "f1d69c1b34...
3123f47d-5480-44ee-ab03-b5d0924f9495
ajkashik/Data_Structure_and_Algorithm_C-
Hash-Table/test.cpp
#include <iostream> #include <map> using namespace std; // Data Structure to store a binary tree node struct Node { int data; Node *left, *right; Node(int data) { this->data = data; this->left = this->right = NULL; } }; // Recursive function to do a pre-order traversal of the tree and fill map // Here node ...
ALGO
0.999969
5.95351
{ "github_metadata": { "branch": "main", "commit_count": 2, "repo_created_at": "2022-03-13T20:12:13.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 1, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "918bbde27c27...
d956a088-8e2f-4eb8-acf8-ccfb3c50376d
wisehead/cpp_lib
parallel101/02/04/main.cpp
#include <cstdlib> #include <iostream> struct Vector { size_t m_size; int *m_data; Vector(size_t n) { // 构造函数 - 对象初始化时调用 m_size = n; m_data = (int *)malloc(n * sizeof(int)); } ~Vector() { // 解构函数 - 对象销毁时调用 free(m_data); } size_t size() { retur...
TOOL
0.934259
3.92379
{ "github_metadata": { "branch": "master", "commit_count": 270, "repo_created_at": "2018-12-17T06:35:05.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 1, "forks": 0, "issues": 0, "pull_requests": 1 }, "file_meta": { "content_id": "f3363331...
a04973d8-c095-4869-9791-956b848f7361
mustafaazad03/C-Question-Sets
Q1(a).cpp
#include <bits/stdc++.h> using namespace std; int **polynomialadd(int **ar1, int **ar2, int l1, int l2) { int **ar; ar = new int *[2]; for (int i = 0; i < 2; i++) ar[i] = new int[l1 + l2]; int i, j, k = 0; for(int i = 0;i<2;i++) for(int j = 0;j<l1+l2;j++) ar[i...
ALGO
0.999729
4.067377
{ "github_metadata": { "branch": "master", "commit_count": 8, "repo_created_at": "2022-10-09T17:50: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": "f19eb41a53...
f7d243ad-a455-48c9-b1fa-42cf01bc6dff
cran/miraculix
src/thuy.cc
/* Authors <NAME>, <EMAIL> library for simulation of random fields Copyright (C) 2012 -- 2019 <NAME>, 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 ...
ALGO
0.994772
3.758615
{ "github_metadata": { "branch": "master", "commit_count": 3, "repo_created_at": "2019-09-12T09:44:37.000Z", "is_fork": false, "is_org_owned": true, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "faacae6a4b1...
4b43079a-3bd7-4be9-8e9a-0be56bf6d9e5
yunipoke/compro_library
Math/CRT.cpp
#include<iostream> #include<cassert> using namespace std; const int p[9] = {4,9,5,7,11,13,17,19,23}; int head[9],b[110],rest[9], out[110]; const int m = 108; long extgcd(long a,long b,long &x,long &y){ if(b == 0){ x = 1;y = 0; return a; } long q = a/b; long g = extgcd(b,a-q*b,x,y); ...
ALGO
0.999984
3.448934
{ "github_metadata": { "branch": "main", "commit_count": 30, "repo_created_at": "2023-11-16T07:19: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": "72ad01bcd5c...
46569ba2-d63e-43b6-9b2e-d906e51ff066
Mishajain1110/CS-254-Design-and-Analysis-of-Algorithms-Lab-
Assignment 2/ques 3/ques3.cpp
#include <iostream> #include <vector> using namespace std; void merge_inplace(vector<int>& vec, int start, int mid, int end){ int second_start = mid + 1; if(vec[mid] <= vec[second_start]){ return; } while(start <= mid && second_start <= end){ if(vec[start] <= vec[second_start]){ ...
ALGO
0.999879
5.53921
{ "github_metadata": { "branch": "main", "commit_count": 15, "repo_created_at": "2024-01-14T13:43: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": "336a10cc9d5...
ffd86979-b935-4b9b-af08-73170f6751f1
apache/incubator-pagespeed-mod
pagespeed/opt/http/property_cache.h
/* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you ...
TOOL
0.967871
7.466002
{ "github_metadata": { "branch": "master", "commit_count": 5033, "repo_created_at": "2015-04-06T15:31:46.000Z", "is_fork": false, "is_org_owned": true, "forked_from": null, "stars": 696, "forks": 157, "issues": 524, "pull_requests": 0 }, "file_meta": { "content_id": "4b...
32a63546-fca3-4d05-9ef8-10a804eec76b
kamyu104/LeetCode-Solutions
C++/paint-fence.cpp
// Time: O(n) // Space: O(1) // DP with rolling window. class Solution { public: int numWays(int n, int k) { if (n == 0) { return 0; } else if (n == 1) { return k; } vector<int> ways(3, 0); ways[0] = k; ways[1] = (k - 1) * ways[0] + k; ...
ALGO
0.99999
5.842314
{ "github_metadata": { "branch": "master", "commit_count": 19395, "repo_created_at": "2018-10-11T17:38:35.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 4939, "forks": 1616, "issues": 1, "pull_requests": 55 }, "file_meta": { "content_id": ...
c2af199f-0ce4-4cfb-a31e-6550d4c09fe0
ombhujel/connected-components
function.cpp
#include "functions.h" void zero2D(int **Ary) { for(int i = 0; i < numRows + 2; i++) { for(int j = 0; j < numCols + 2; j++) { Ary[i][j] = 0; } } } void loadImage(ifstream &infile, int **Ary) { string string_array[numRows + 1]; int *translationarray = new int[numRows * numCo...
DATA
0.988742
3.392026
{ "github_metadata": { "branch": "main", "commit_count": 2, "repo_created_at": "2024-04-03T14:42:09.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "92ad37cf5870...
356e835a-9050-4ff9-96cb-abf6b757cf56
Kent2256/Leetcode_pactice
C++/2197/Main.cpp
You are given an array of integers nums. Perform the following steps: Find any two adjacent numbers in nums that are non-coprime. If no such numbers are found, stop the process. Otherwise, delete the two numbers and replace them with their LCM (Least Common Multiple). Repeat this process as long as you keep finding tw...
ALGO
0.999995
5.711805
{ "github_metadata": { "branch": "main", "commit_count": 44, "repo_created_at": "2023-09-04T13:11: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": "f7ade073686...
d365d606-5b05-4e71-ad58-0829b18049b3
ZeraVision/zera-network-validator
z_validator/z_validator/util/validator_config.cpp
#include "validators.h" #include "wallets.h" #include "../logging/logging.h" #include <thread> std::string ValidatorConfig::host_; std::string ValidatorConfig::client_port_; std::string ValidatorConfig::validator_port_; std::string ValidatorConfig::api_port_; std::string ValidatorConfig::fee_address_string_; std::vect...
CONFIG
0.958854
5.507754
{ "github_metadata": { "branch": "main", "commit_count": 19, "repo_created_at": "2025-03-16T03:12:54.000Z", "is_fork": false, "is_org_owned": true, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 2 }, "file_meta": { "content_id": "6ae57e3135c7...
392f9eb0-dba3-41ea-8650-6ea7ffeae755
ishandutta2007/codeforces-s
sevlll777/normal/1610/E.cpp
#include <iostream> #include <iomanip> #include <cstdio> #include <cstdlib> #include <algorithm> #include <cmath> #include <vector> #include <set> #include <map> #include <unordered_set> #include <unordered_map> #include <queue> #include <ctime> #include <cassert> #include <string> #include <cstring> #include <chrono> ...
ALGO
0.999169
3.980503
{ "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": "c2f90bd8ae56...
e299cd0b-2f52-48e4-a428-092ee7e300af
ydb-platform/ydb
contrib/tools/ragel5/aapl/insertsort.h
/* * Copyright 2002 <NAME> <<EMAIL>> */ /* This file is part of Aapl. * * Aapl 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; either version 2.1 of the License, or (at your option) * any ...
ALGO
0.999926
6.264926
{ "github_metadata": { "branch": "main", "commit_count": 35208, "repo_created_at": "2022-02-07T14:52:36.000Z", "is_fork": false, "is_org_owned": true, "forked_from": null, "stars": 4512, "forks": 701, "issues": 2263, "pull_requests": 682 }, "file_meta": { "content_id": ...
c6f8db04-b0f1-45c8-a9ed-bbd9e5e56bc9
rituraj0506/solved-problem
Check if Linked List is Palindrome - GFG/check-if-linked-list-is-palindrome.cpp
//{ Driver Code Starts #include <stdio.h> #include <stdlib.h> #include <iostream> #include <stack> using namespace std; /* Link list Node */ struct Node { int data; struct Node *next; Node(int x) { data = x; next = NULL; } }; // } Driver Code Ends /* struct Node { int data; struct Node *next; ...
ALGO
0.999609
5.242587
{ "github_metadata": { "branch": "main", "commit_count": 1209, "repo_created_at": "2023-05-05T06:02: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": "75f8d34e1...
5d29ba83-e19e-43f0-9808-a3256ab93d35
OFShare/Algorithm-challenger
洛谷/提高-/P1886.cc
/* * Author : OFShare * E-mail : <EMAIL> * Created Time : 2020-05-06 13:57:50 PM * File Name : P1886.cc */ #include <bits/stdc++.h> #define ll long long void debug() { #ifdef Acui freopen("data.in", "r", stdin); freopen("data.out", "w", stdout); #endif } const int N = 1e6 + 5; ll ...
ALGO
0.999986
3.977759
{ "github_metadata": { "branch": "master", "commit_count": 148, "repo_created_at": "2019-07-14T05:37:19.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 61, "forks": 11, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "759104...
03de5a8b-bdf0-428d-8e3f-f02a4a54028b
VariantAbdulaziz/Competitive-Programming
Codeforces/A_Showstopper.cpp
#include <bits/stdc++.h> #define int int64_t #define all(a) a.begin(), a.end() #define range(a, f, t) a.begin() + f, a.begin() + t using namespace std; void solve(){ int n; cin >> n; vector<int> a(n), b(n); for(auto &aj: a) cin >> aj; for(auto &bj: b) cin >> bj; bool toa = a[n-1] <= b[n-1]; ...
ALGO
0.999989
4.550691
{ "github_metadata": { "branch": "master", "commit_count": 703, "repo_created_at": "2022-05-16T11:15:40.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 1, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "dd5b774f...
f1770f2e-0a26-4f3d-85de-6e7f65a4f624
adityamuley29/c-plus-plus-exercise-projects
c++ practice projects/array_adt.cpp
#include<iostream> using namespace std; int main() { int a[100]; int n,i; cout<<"Enter a length of array"<<endl; cin>>n; cout<<"Enter Element of Array"<<endl; for(i=0 ;i<n ;i++) { cin>>a[i]; } cout<<"The Element in the Array are :-"<<endl; for(i=0;i<n;i++) { ...
ALGO
0.997988
3.727703
{ "github_metadata": { "branch": "master", "commit_count": 4, "repo_created_at": "2020-09-06T07:05: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": "eb43cd362d...
d8875c1b-f925-47e5-9d29-05ae0fc4e485
ry0u/yukicoder
193.cpp
#include <iostream> #include <vector> #include <string> #include <cstring> #include <algorithm> #include <sstream> #include <map> #include <set> #include <stack> #define REP(i,k,n) for(int i=k;i<n;i++) #define rep(i,n) for(int i=0;i<n;i++) #define INF 1<<30 #define pb push_back #define mp make_pair using namespace st...
ALGO
0.999997
3.974182
{ "github_metadata": { "branch": "master", "commit_count": 9, "repo_created_at": "2015-04-02T16:49: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": "1e029b6477...
ba5588ba-357f-441b-b387-ee0fe40042b7
alibaba/x-deeplearning
blaze/blaze/operator/sparse_op/cross/combine_func_op.cc
/* * \file combine_func_op.cc * \brief The combine func operator for combine result processing. */ #include "blaze/operator/sparse_op/cross/combine_func_op.h" namespace { const float kSmallConst = 0.00000001; } // namespace namespace blaze { // ID combine function template <typename K_DType, typename V_DType, ty...
TOOL
0.938432
7.549394
{ "github_metadata": { "branch": "master", "commit_count": 81, "repo_created_at": "2018-12-12T08:18:26.000Z", "is_fork": false, "is_org_owned": true, "forked_from": null, "stars": 4292, "forks": 1029, "issues": 112, "pull_requests": 15 }, "file_meta": { "content_id": "6...
f0f9ae06-111f-4a69-ab52-c1dd48eab6b2
sunjilkh/code-c
main.cpp
#include<bits/stdc++.h> using namespace std; int main() { #ifndef ONLINE_JUDGE freopen("input.txt", "r", stdin); freopen("output.txt", "w", stdout); #endif pair<int, double> p; p = make_pair(80, 4); //cout<<p.first<< " " <<p.second << endl; pair<int, double> p2 = p; //cout<<p2.first<< " " <<p2.second << ...
ALGO
0.999519
3.018413
{ "github_metadata": { "branch": "main", "commit_count": 6, "repo_created_at": "2022-11-08T17:36: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": "127717c8c9ee...
56306660-6b93-4383-baf4-f3e1de186c08
ishandutta2007/codeforces-c
coderanshu/normal/1512/A.cpp
// <NAME> #include<bits/stdc++.h> using namespace std ; #define ll long long #define pb push_back #define all(v) v.begin(),v.end() #define sz(a) (ll)a.size() #define F first #define S second #define INF 2000000000000000000 #define po...
ALGO
0.999858
4.480261
{ "github_metadata": { "branch": "main", "commit_count": 1, "repo_created_at": "2024-04-11T01:17:48.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "372b68ad8d79...
dd892ca2-3c60-4b86-a37f-039c7431ea87
KristinaTsulaya/particle_dynamics
particle_state.cpp
#include "particle_state.h" void particle_state::update_position(double dt) { for (int i = 0; i < position.size(); ++i) position[i] += dt * velocity[i]; } void particle_state::update_velocity(double dt) { double a = dt * coefficient; for (int i = 0; i < velocity.size(); ++i) velocity[i] +...
ALGO
0.974162
5.171714
{ "github_metadata": { "branch": "master", "commit_count": 1, "repo_created_at": "2024-06-26T10:33: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": "a0638f9bf9...
102aed5d-37a4-4b45-967d-248f59173eb0
Dhliv/Competitiva
RPC/2020/Actividad 05/marswindow.cpp
#include <bits/stdc++.h> #define INF INT_MAX #define MINF INT_MIN #define ll long long #define PB push_back #define PF push_front #define P_F pop_front #define P_B pop_back #define F front #define B back #define f first #define s second #define MP make_pair #define For(i, a, b) for(int i = a; i < b; i++) #define forit...
ALGO
0.999806
3.06815
{ "github_metadata": { "branch": "master", "commit_count": 124, "repo_created_at": "2020-10-15T03:14:14.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 4, "forks": 2, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "30c7e5d7...
f58dbc4a-4ad4-4fee-8e27-6598003e8df0
JimenaD-creator/Algorithms_DataStructures
doubleLinkedList.cpp
#include <SFML/Graphics.hpp> #include <iostream> #include <string> using namespace std; struct Node { int data; Node* next; Node* prev; // Añadido para soporte de doble enlace }; class LinkedList { private: Node* head; Node* tail; // Puntero al último nodo public: LinkedList() : head(nullptr...
TOOL
0.997093
5.679455
{ "github_metadata": { "branch": "main", "commit_count": 5, "repo_created_at": "2025-02-18T19:12: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": "69dfed66bb44...
dc54ebf2-1e30-4e23-b4ae-d7a50c535075
efatsi/chess-firmware
final/src/lib/Position.h
class Position { // status #define CONFIRMED 0 #define UNSTABLE_UP 1 #define STABLE_UP 2 #define UNSTABLE_DOWN 3 #define STABLE_DOWN 4 #define CONFIRM_TIME 1000 public: String position; int reading; bool value; int status; int occupiedBy; bool changed; long las...
ALGO
0.97619
6.385117
{ "github_metadata": { "branch": "main", "commit_count": 104, "repo_created_at": "2022-02-05T13:17: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": "685bbfc554...
fe2d0ebc-3615-42a1-b2eb-b94416c728c0
tony9402/baekjoon
solution/divide_and_conquer/2447/main.cpp
// Authored by : tony9402 // Co-authored by : - // Link : http://boj.kr/619d768333f74fce8dd3e0cdd129a675 #include<bits/stdc++.h> using namespace std; bool arr[6666][6666]; void solve(int y, int x, int size) { if(size == 3) { for(int i=0;i<3;i++) { for(int j=0;j<3;j++) { if(i =...
ALGO
0.999981
3.775277
{ "github_metadata": { "branch": "main", "commit_count": 4450, "repo_created_at": "2019-08-04T12:48:59.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 6208, "forks": 1199, "issues": 5, "pull_requests": 1 }, "file_meta": { "content_id": "7d2...
451aba39-a038-4419-9939-bcb2fd90316b
Mongerr/Algorithm_cpp
톱니바퀴.cpp
#include <time.h> #include <cstdio> #include <iostream> #include <cmath> using namespace std; #define MAX_QUEUE_SIZE 8 typedef struct{ char data[MAX_QUEUE_SIZE]; //톱니 8개의 극(N극 or S극) int front, rear; //front는 큐의 첫 번째 요소 하나 앞, rear는 마지막 요소 }DequeType; //덱: 큐의 전단과 후단에서 모두 삽입과 삭제가 가능한 큐 void init_deque(DequeTy...
ALGO
0.999793
4.023122
{ "github_metadata": { "branch": "main", "commit_count": 50, "repo_created_at": "2021-12-14T06:47: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": "12351572709...
8c9497a6-da04-4856-b1e2-37dcd9519820
pytorch/pytorch
torch/csrc/jit/frontend/source_range.h
#pragma once #include <c10/util/Exception.h> #include <optional> #include <algorithm> #include <iterator> #include <memory> #include <ostream> #include <sstream> #include <unordered_map> namespace torch::jit { class SourceRangeUnpickler; struct SourceRange; // A stringlike class backed by a vector of string_view //...
TOOL
0.941192
7.095941
{ "github_metadata": { "branch": "main", "commit_count": 90499, "repo_created_at": "2016-08-13T05:26:41.000Z", "is_fork": false, "is_org_owned": true, "forked_from": null, "stars": 91573, "forks": 24684, "issues": 5000, "pull_requests": 1303 }, "file_meta": { "content_i...
e172c9a0-d529-41d0-ba2f-ce58363c165c
kkb-10/Code-Library
cf-D - Buying Shovels.cpp
#include<bits/stdc++.h> using namespace std; #define fastIO ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL); #define ll long long int #define fi first #define se second #define pb push_back #define all(v) (v).begin(), (v).end() #define rep(i, l, r) for(int i=(int)(l);i<(int)(r);i++) #define repd(i, l, r) ...
ALGO
0.999971
3.84812
{ "github_metadata": { "branch": "master", "commit_count": 11, "repo_created_at": "2021-04-17T06:42:43.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 2, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "bae18e7d0...
0ad4370c-0324-4792-96e3-4cc7bf05ae95
OOP-2023/group6-task-collection
2MI0800218/oopw1z1Avtomatche.cpp
using namespace std; #include <iostream> struct transition { int stateN; char c; }; struct state { transition transitions[4]; int tranzitionsFromZero; }; struct stateInfo { state data[50]; }; bool hasTransition(const stateInfo& si, size_t from, char c) { if (from > 49) { return 0; ...
ALGO
0.996789
3.722623
{ "github_metadata": { "branch": "main", "commit_count": 370, "repo_created_at": "2023-02-28T09:32:22.000Z", "is_fork": false, "is_org_owned": true, "forked_from": null, "stars": 3, "forks": 17, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "5eb8a64256...
d541ce18-4ebc-462c-8d7b-e77949fdc38e
ROCm/amd-llvm-project
clang-tools-extra/amdllvm/amdllvm.cpp
#include <cstdlib> #include <cstring> #include <filesystem> #include <iostream> #include <linux/limits.h> #include <string> #include <sys/types.h> #include <sys/wait.h> #include <unistd.h> #include <vector> static bool AMDCLANG_DEBUG = false; static std::string get_path_to_self() { std::string p; std::vector<...
TOOL
0.908251
6.00155
{ "github_metadata": { "branch": "amd-stg-open", "commit_count": 410989, "repo_created_at": "2020-03-23T20:12:36.000Z", "is_fork": false, "is_org_owned": true, "forked_from": null, "stars": 13, "forks": 6, "issues": 0, "pull_requests": 6 }, "file_meta": { "content_id": ...
7685f031-cc1e-4be5-8deb-33419fc711ac
BryanBoni/TheorieLangage
BRANDON_THIEL/src/ndetPartie2.cpp
/* */ /* // ----------------------------------------------------------------------------- // Fonctions à compléter pour la seconde partie du projet // ----------------------------------------------------------------------------- sAutoNDE Append(const sAutoNDE& x, const sAutoNDE& y){ // fonction outil : on garde x,...
ALGO
0.951949
3.759397
{ "github_metadata": { "branch": "master", "commit_count": 24, "repo_created_at": "2016-10-10T06:25: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": "acde832ec...
a2619c08-05e2-4469-856f-bec547b468ad
carmenazorinm/DGIIM
Quinto/Metahueristicas/Practica 2/software/src/common/mh.h
#pragma once #include <problem.h> #include <utility> struct ResultMH { tSolution solution; tFitness fitness; unsigned int evaluations; ResultMH(tSolution &sol, tFitness fit, unsigned evals) : solution(sol), fitness(fit), evaluations(evals) {} }; /** * Metaheuristic algorithm interface. * * @author ...
ALGO
0.975959
5.782664
{ "github_metadata": { "branch": "main", "commit_count": 116, "repo_created_at": "2023-02-25T20:05: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": "244fd64686...
a6ba68ee-58ac-422f-98e5-e87530032af0
Harikesh-14/LB-450
Array/median_sorted_ii.cpp
#include<iostream> #include<vector> using namespace std; vector<int> merge_array (vector<int> &vec1, vector<int> &vec2){ vector<int> res; int n1 = vec1.size(); int n2 = vec2.size(); int i=0, j=0; while(i < n1 && j < n2){ if(vec1[i] < vec2[j]){ res.push_back(vec1[i++]); } else { res.push...
ALGO
0.999967
5.549713
{ "github_metadata": { "branch": "main", "commit_count": 52, "repo_created_at": "2024-05-04T14:43: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": "dd44f5ebc67...
f9f0e0ee-0971-4ad4-987f-c4709821abe6
JackMerma/Adagrupob
practicas/clase_04/max_number.cpp
/** * @author : <NAME> (<EMAIL>) * @created : 18/10/2021 * @filename : max_number * @description : Encuentra el maximo de una lista de numeros (entradad de datos) * Linea 1: lee n. Las siguientes n lineas leen 'n' numeros */ #include <bits/stdc++.h> using namespace std; //metodo para encontrar al ...
ALGO
0.999464
4.55979
{ "github_metadata": { "branch": "main", "commit_count": 120, "repo_created_at": "2021-09-21T01:30: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": "b1831e5248...
e9e55307-7706-427c-a907-15896ee52274
dluschan/lessons
containers/cplusplus/map.h
#ifndef MAP_H #define MAP_H #include <utility> namespace containers { class Node { friend class map_iterator; friend class map; private: Node(Node* parent, int key, int data = 0) : m_key(key) , m_data(data) , m_parent(parent) , m_left(nullptr) , m_right(nullptr) {} int& operator[](int ke...
ALGO
0.915363
5.259777
{ "github_metadata": { "branch": "master", "commit_count": 111, "repo_created_at": "2017-01-18T19:54:30.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 2, "forks": 1, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "87515ed5...
208b61f5-7c83-4fb5-9cca-71fcc71bb3e9
MindGuerrillas/isometric_game
CBinaryHeap.h
/* * File: CBinaryHeap.h * Author: alan * * Created on March 8, 2013, 1:50 PM */ #ifndef CBINARYHEAP_H #define CBINARYHEAP_H bool BinaryHeapMinPush(int a, int b); // Default Sort Order bool BinaryHeapMaxPush(int a, int b); bool BinaryHeapMinPop(int node, int arraysize, int val, int targetvalue); // Default So...
ALGO
0.998532
4.802372
{ "github_metadata": { "branch": "main", "commit_count": 3, "repo_created_at": "2020-10-05T09:50: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": "30f5b4951980...
f99ae12d-e29a-43cf-be98-4e57fd3e40b8
ishandutta2007/codeforces-t
tourist/normal/1630/B.cpp
/** * author: tourist * created: 27.01.2022 17:43:09 **/ #include <bits/stdc++.h> using namespace std; #ifdef LOCAL #include "algo/debug.h" #else #define debug(...) 42 #endif int main() { ios::sync_with_stdio(false); cin.tie(0); int tt; cin >> tt; while (tt--) { int n, k; cin >> n >...
ALGO
0.999971
3.998239
{ "github_metadata": { "branch": "main", "commit_count": 1, "repo_created_at": "2024-10-30T16:27:17.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "47298b684393...
ec995084-8beb-4ea2-a519-33de4fbafea2
Emilinya/FYS4150
project4/problem4/ising_computer.hpp
#include <assert.h> #include <fstream> #include <vector> #include <random> #include <chrono> #include <tuple> #include <map> #include <iostream> struct IsingState { std::vector<int8_t> spins; int32_t E = 0; int32_t M = 0; }; typedef std::map<int8_t, double> ExpMap; enum class InitialState { ORDERED,...
ALGO
0.998192
6.082353
{ "github_metadata": { "branch": "main", "commit_count": 55, "repo_created_at": "2022-08-26T08:10: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": "1268c03691d...
57f48f2f-8661-458e-a8d5-3de2fd11e72b
maddotexe/Competitive-contest-programs
code chef/forgetpw.cpp
#include<bits/stdc++.h> using namespace std; #define TRACE #ifdef TRACE #define trace1(x) cerr << #x << ": " << x << endl; #define trace2(x, y) cerr << #x << ": " << x << " | " << #y << ": " << y << endl; #define trace3(x, y, z) cerr << #x << ": " << x << " | " << #y <...
ALGO
0.995167
3.253577
{ "github_metadata": { "branch": "master", "commit_count": 3, "repo_created_at": "2015-02-22T20:03:41.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 1, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "8d4e443246...
b8888312-b019-41dc-b841-b05c065cbbcc
GyuJin-Cho/Algorithm
백준/새로운 게임 2.cpp
#include<iostream> #include<vector> #include<map> #include<algorithm> #include<cmath> #include<string> #include<queue> #include<stack> #include<set> #include<unordered_map> #include<unordered_set> #include<memory> #include<cstring> using namespace std; int dx[] = { 0,0,-1,1 }; int dy[] = { 1,-1,0,0 }; int opposite(int...
ALGO
0.999972
3.932388
{ "github_metadata": { "branch": "main", "commit_count": 1329, "repo_created_at": "2021-07-07T11:10: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": "db521a15a...
17d3a938-d729-48ea-a610-62241cb8689b
kungcn/Operating_System_Concept
Experiment3/Fib.cpp
#include <stdio.h> #include <pthread.h> #include <stdlib.h> void* fib(void* p) { int* x = (int*) p; int i, e; int v[2] = {0, 1}; int t; e = *x; for (i = 0; i < e; ++i) { x[i] = v[0]; t = v[0] + v[1]; v[0] = v[1]; v[1] = t; } return 0; } int main() { int* x; int cnt; pthread_t pT...
ALGO
0.999926
3.591371
{ "github_metadata": { "branch": "master", "commit_count": 7, "repo_created_at": "2016-05-18T12:34: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": "85c6a7265c...
e46ae472-f985-4e58-a9dc-58d36d68eb2f
nhingthao1203/KTLT
BTHC01/BTHC1/BT04.cpp
#include <iostream> #include <ctime> #include <iomanip> int const MR = 5, MC = 6; using namespace std; int main() { int arr[MR][MC]; int r, c, sum = 0, sumS; int x, count = 0, posArr[MR * MC][2]; char sumP; cout << "a. "; do { cout << "Nhap so dong va so cot: "; cin >> ...
ALGO
0.974136
3.461944
{ "github_metadata": { "branch": "main", "commit_count": 9, "repo_created_at": "2024-03-04T14:42: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": "b21ba9107494...
117495d6-4e6a-44f9-8a07-5eac703cc527
leetcode-practice/leetcode
cat/20160616/0224. Basic Calculator/solution.hpp
#include <vector> class Solution { public: int calculate(string str) { if (str.empty()) { return 0; } curr = 0; len = str.size(); s = str; int val = expression(); return val; } private: string s; int curr; int len; int expression() { int res = term(); while (cu...
ALGO
0.999901
5.452271
{ "github_metadata": { "branch": "master", "commit_count": 18, "repo_created_at": "2016-06-14T06:03:35.000Z", "is_fork": false, "is_org_owned": true, "forked_from": null, "stars": 0, "forks": 1, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "74ffe2ae5b...
3180fe85-aa85-4e2c-ab4c-85482b7e73d8
praveenkumarcs/MissionRnD-CMrndTest3
spec/Problem2Spec.cpp
#include "stdafx.h"; #include <stdlib.h>; #include "./../src/Problem2.cpp"; using namespace System; using namespace System::Text; using namespace System::Collections::Generic; using namespace Microsoft::VisualStudio::TestTools::UnitTesting; namespace spec { [TestClass] public ref class Problem2Spec { private: ...
TEST
0.97309
3.847655
{ "github_metadata": { "branch": "master", "commit_count": 4, "repo_created_at": "2016-04-24T04:28: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": "7cf0d40a0c...
164e48bd-6477-46dd-a366-dd26d99ffab0
sasikiranE/CSO-221-Algorithms
lab10/LCS.cpp
#include <bits/stdc++.h> using namespace std; class Solution { vector<vector<int>> dp; public: int lcs(string a, string b) { int m = a.size(); int n = b.size(); dp.assign(m + 1, vector<int>(n + 1, -1)); return lcs(a, b, m, n); } string getLCS(string a, string b) { string ans; int m = a.size(); int ...
ALGO
0.999988
5.061042
{ "github_metadata": { "branch": "main", "commit_count": 28, "repo_created_at": "2022-01-07T16:34:17.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "fdf47f062be...
6f6c71f9-0695-4eec-81c0-2e0bc7abeb35
richard-evans/vampire
src/create/cone.cpp
//----------------------------------------------------------------------------- // // This source file is part of the VAMPIRE open source package under the // GNU GPL (version 2) licence (see licence file for details). // // (c) <NAME> and <NAME> 2016. All rights reserved. // //-----------------------------------------...
TOOL
0.968512
5.679399
{ "github_metadata": { "branch": "main", "commit_count": 2030, "repo_created_at": "2012-10-04T22:38:06.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 138, "forks": 104, "issues": 27, "pull_requests": 14 }, "file_meta": { "content_id": "7b3...
522bcf03-27ea-4991-bc55-cfe62f0e1017
zizhong/POJSolutions
123234345/3740/6177451_AC_391MS_728K.cc
#include <iostream> #include <cstring> #include <cstdio> #include <queue> using namespace std; const int MAXN = 17; const int MAXM = 301; int matrix[MAXN][MAXM]; int link[MAXN][MAXN]; int rowCnt[MAXN]; int m, n; struct node_T { int row[MAXN]; int rCnt; int cnt; bool operator < (const node_T &nod) co...
ALGO
0.999963
3.791329
{ "github_metadata": { "branch": "master", "commit_count": 2, "repo_created_at": "2013-10-01T07:26: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": "3c72f81556...
2b2c15e1-2d8f-4e46-9197-8dfec2d6bfbc
pavnkb/ProgrammingPrep
Google/CSES/Graphs/Labyrinth.cpp
#include <bits/stdc++.h> using namespace std; int rows, cols; vector<vector<char>> grid, dir; vector<int> lx = {-1, 1, 0, 0}; vector<int> ly = {0, 0, -1, 1}; vector<char> lz = {'D', 'U', 'R', 'L'}; vector<char> la = {'U', 'D', 'L', 'R'}; vector<char> path; pair<int, int> start; queue<pair<int, int>> q; bool isValid(i...
ALGO
0.999976
4.287289
{ "github_metadata": { "branch": "main", "commit_count": 3, "repo_created_at": "2021-10-12T09:03: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": "604516e8d06f...
576d1409-b8a7-4a3a-89aa-4cc6ef2d6092
MananKGarg/Placements
CSES Problem Set/Minimizing Coins.cpp
/* Basic DP. DP array initialisation is important. Initialise all the values to INT_MAX except for dp[0]. Initialise dp[0] = 0. */ #include <bits/stdc++.h> using namespace std; typedef long long ll; void solve(){ ll n,x; cin >> n >> x; vector <ll> coins; for(ll i = 0; i < n; i++){ ll e; ...
ALGO
0.999925
4.218473
{ "github_metadata": { "branch": "main", "commit_count": 213, "repo_created_at": "2021-05-16T10:46:28.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "4270d25836...
7b20bba9-17fb-46d7-9a45-8bc200e79030
E3SM-Project/E3SM
components/eamxx/src/physics/shoc/disp/shoc_energy_integrals_disp.cpp
#include "shoc_functions.hpp" #include "ekat/kokkos/ekat_subview_utils.hpp" namespace scream { namespace shoc { template<> void Functions<Real,DefaultDevice> ::shoc_energy_integrals_disp( const Int& shcol, const Int& nlev, const view_2d<const Spack>& host_dse, const view_2...
ALGO
0.91759
5.903746
{ "github_metadata": { "branch": "master", "commit_count": 64504, "repo_created_at": "2014-07-03T19:04:08.000Z", "is_fork": false, "is_org_owned": true, "forked_from": null, "stars": 381, "forks": 425, "issues": 535, "pull_requests": 54 }, "file_meta": { "content_id": "...
c2128b1b-3dcf-4018-ab9e-6f97a9a51653
viveksraan/competitive-programming
2_B_Ropes.cpp
#include<bits/stdc++.h> #include<vector> #include<set> using namespace std; # define ll long long # define ull unsigned long long # define descending greater<ll> () # define Sort(c) sort(c.begin(), c.end()) # define RevSort(v) sort(v.begin(), v.end(), greater<ll>()) #define vll vector<ll> #define vull vector<ull> # d...
ALGO
0.999975
4.050773
{ "github_metadata": { "branch": "binary_search", "commit_count": 1, "repo_created_at": "2025-01-22T09:58: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": "b7d...
d02b1ae3-502e-4c6e-9ad5-3a61048e68f9
kvit-dev/WonderMaze-CourseWork
src/game/maze_generation/generator.cpp
#include <iostream> #include <cmath> #include <ctime> #include <vector> #include <stack> #include <cstdlib> #include <random> #include <fstream> #include <algorithm> #include <cstring> using namespace std; struct Cell { int x, y; char type; Cell(int x, int y, char type) : x(x), y(y), type(type) {} }; en...
TOOL
0.91286
4.555862
{ "github_metadata": { "branch": "master", "commit_count": 2, "repo_created_at": "2025-01-10T13:15:21.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "112068b6f8...
0708e0b2-0d81-41f6-a455-8055b7890034
TALLER7/test
tensorflow/compiler/xla/service/dfs_hlo_visitor.h
/* Copyright 2017 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...
TOOL
0.954766
7.317019
{ "github_metadata": { "branch": "master", "commit_count": 23898, "repo_created_at": "2017-11-02T00:38: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": "bc7774...
b1d1cf34-1868-42ae-b5ee-6927efed8518
devnowk/Algorithm-Study
it 취업을 위한 알고리즘 문제풀이 (with CC++)/DP11@@. 최대점수 구하기(냅색 알고리즘).cpp
#include <iostream> #include <vector> #include <algorithm> int dp[101][1001]; //std::vector<std::vector<int> > dp(n+1, std::vector<int>(m+1)); // dp[i][j]의미 : i문제까지 j시간 안에 풀 수 있는 최대점수 std::vector<std::pair<int, int> > Question; // 문제 점수와 걸리는 시간 정보 int DFS(int i, int j) { //std::cout << "DFS(" << i << ", " << j <<...
ALGO
0.999802
3.787544
{ "github_metadata": { "branch": "main", "commit_count": 219, "repo_created_at": "2022-01-09T16:40:09.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "04b9537406...
96b50263-0ffd-4fc2-ac61-d524f583dd47
Soumyadip54321/CPP_Codes
LEETCODE/design_hashset.cpp
#include <iostream> #include <stdlib.h> #include <string.h> #include <algorithm> #include <vector> using namespace std; const int n=1e6+10; class MyHashSet { int *hshset; public: MyHashSet() { hshset=(int*)malloc(sizeof(int)*n); if(hshset==nullptr) exit(-1); for(int...
ALGO
0.998996
3.984888
{ "github_metadata": { "branch": "main", "commit_count": 1, "repo_created_at": "2023-09-13T13:03: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": "369e2694a543...
fdfeb43e-2f5b-4318-b6de-6553f0a0913c
buliuzi/ruanka
alg/test/a1075.cpp
#include <cstdio> #include <cstring> #include <algorithm> using namespace std; struct STUDENT { int usrid; int totalscore = {0}; int score[6] = {-2, -2, -2, -2, -2, -2}; int flag = {0}; int rank; int good = {0}; //注意这道题目需要确定有全0分输出的情况,需要和全0分区分 } stu[10010]; bool cmp(STUDENT a, STUDENT b) { ...
ALGO
0.999454
3.159431
{ "github_metadata": { "branch": "master", "commit_count": 5, "repo_created_at": "2019-02-13T15:00: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": "5bb00327c7...
4efd8f70-fd45-42f4-85c8-1f9f3ef83225
Like1Shot/CSCI-1300-Fall-2023
Code/codeWeek3_Functions.cpp
#include <iostream> #include <cmath> // Remember this from two weeks ago? #include <iomanip> // input/output manipulation #include <cassert> // Won't use it yet! Say hi and get familiar with the name! using namespace std; // The main is also a function! "main" is the name of the function // So in the analogy of y = f...
ALGO
0.989966
5.445175
{ "github_metadata": { "branch": "main", "commit_count": 59, "repo_created_at": "2023-08-29T00:35:48.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 2, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "764ec476102...
0b275d72-3acc-46b3-831a-fdea8ab623e3
AdityaSolanki189/Cpp-Projects
Learning_STL/1.BeginSTL.cpp
#include <iostream> #include <vector> #include <algorithm> using namespace std; bool f(int x,int y){ return x>y; } int main(){ //C++ Standard Template Library vector<int> A = {11,2,3,14}; cout<< A[1]<<endl; //2 sort(A.begin() , A.end()); // O(NlogN) - Ascending Order Sort //2,3,11,14...
ALGO
0.999517
4.750486
{ "github_metadata": { "branch": "master", "commit_count": 384, "repo_created_at": "2020-04-09T15:09:34.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 3, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "f82737bb...
fa800918-d7af-4fe2-8eb2-2692ae14a30c
hbsun2113/LeetCodeCrawler
0264.ugly-number-ii/ugly-number-ii.cpp
class Solution { public: // 二刷 int nthUglyNumber(int n) { priority_queue<long long, vector<long long>, greater<long long>> p; p.emplace(1); long long pre=0; while(1){ long long t=p.top(); p.pop(); // cout<<"t="<<t<<" | "; if(t<...
ALGO
0.999998
5.010678
{ "github_metadata": { "branch": "master", "commit_count": 10, "repo_created_at": "2019-05-16T03:53:58.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 5, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "c4d4ab43b...
05bec52e-4adc-43e5-b838-ac5977814d4c
ishandutta2007/codeforces-t
tlewpdus/normal/1280/E.cpp
#include <bits/stdc++.h> #define x first #define y second using namespace std; typedef long long ll; typedef pair<int,int> pii; typedef pair<ll,ll> pll; typedef pair<ll,pll> plll; const ll MOD = 1e9+7; const int INF = 0x3f3f3f3f; const ll LINF = 0x3f3f3f3f3f3f3f3f; ll r; int n; char str[1000100]; int ans[80100]; st...
ALGO
0.999756
3.308202
{ "github_metadata": { "branch": "main", "commit_count": 1, "repo_created_at": "2024-10-30T16:27:17.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "42a9bdbb4461...
8826da1b-5383-480e-b073-819285f6ab81
xhy0410/m
02/【模板】排序.cpp
#include <stdio.h> #include<algorithm> int i,j,temp; void sort(int a[],int n) { for (i = 0; i < n - 1; i++) { for (j = 0; j < n - i - 1; j++) { if (a[j] > a[j + 1]) { temp = a[j]; a[j] = a[j + 1]; a[j + 1] = temp; } }...
ALGO
0.999886
4.293528
{ "github_metadata": { "branch": "main", "commit_count": 10, "repo_created_at": "2024-09-20T12:57: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": "f63e5a0c197...
ff8692ac-87a4-49e3-a263-def280f0790d
Boussejra/test-suite
scripts/C7_PMSSM.cpp
#include <marty.h> #include "marty/pmssm_lem.h" using namespace std; using namespace csl; using namespace mty; #define RESET "\033[0m" #define MESSAGEFONT "\033[1m\033[1;34m" // #define PRINT_PROG int main() { #ifndef PRINT_PROG std::cerr.setstate(std::ios_base::failbit); std::cout.setstate(std::ios...
ALGO
0.96286
3.66966
{ "github_metadata": { "branch": "master", "commit_count": 6, "repo_created_at": "2022-05-13T15:56: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": "f1759c6951...
16eba942-edd4-4f6c-9e7d-a84ccd088721
udonyang/acmps
hdu/2013 ACMICPC Asia Regional Online —— Warmup2/1012/main.cc
#include <cstdio> #include <algorithm> #include <cstdlib> #include <cstring> #include <iostream> using namespace std; const int N = 1e5+10; int n; char p[N], s[N]; void plus1() { int l = strlen(p); reverse(p, p+l); for (int i = 0; i < l; i++) p[i] -= '0'; p[0]++; for (int i = 0; i < l; i++) { p[i+1] += ...
ALGO
0.999257
3.409615
{ "github_metadata": { "branch": "master", "commit_count": 269, "repo_created_at": "2013-04-01T00:39: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": "d8fab336...
c6283071-2dd6-479b-ba95-bb783086f700
SohamGhugare/data-structures-and-algorithms
algorithms/selection_sort.cpp
/* <<------ SELECTION SORT ------>> Selection sort basically sorts the array by selecting the smallest element and putting it at its correct place. Approach: The approach here is to place the smallest element to the start of the array and repeat the same till the array is sorted. Time Complexity: Best Case: O(n^...
ALGO
0.999998
6.357997
{ "github_metadata": { "branch": "main", "commit_count": 29, "repo_created_at": "2023-01-25T14:15: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": "20e3a67def4...
dc34c233-912f-455f-bb7e-b4c0f4e1aede
alessandro-bugatti/appunti_terza
archivio/2021_2022/programmazione/funzioni/es22/main.cpp
#include <iostream> using namespace std; /** * FUnzione che determina se un numero è primo o no * @param n Il numero da verificare * @return true se il numero è primo, false altrimenti */ bool primo(int n){ for (int i = 2; i <= n/2; ++i) { if (n % i == 0) return false; } return tru...
ALGO
0.999491
4.665854
{ "github_metadata": { "branch": "master", "commit_count": 337, "repo_created_at": "2020-09-13T17:18:47.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 2, "forks": 1, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "6fd970a1...
85264083-cb9a-40fb-a17a-32268e8fc6a9
Tushar1805/coding_roadmap
GFG/Basic/decimalToBinary.cpp
//! Decimal to binary // Given a decimal number N, compute its binary equivalent. // Example 1: // Input: N = 7 // Output: 111 // Example 2: // Input: N = 33 // Output: 100001 // Your Task: // You don't need to read input or print anything. // Complete the function toBinary() which takes the decimal number N as th...
ALGO
0.995629
5.503823
{ "github_metadata": { "branch": "main", "commit_count": 328, "repo_created_at": "2023-03-07T12:55:51.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 1, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "80c850df1e...
3d8b53b7-4d7c-4007-8087-625283ac844e
SnoopyCodes/code
cses/dp/cc.cpp
#include <bits/stdc++.h> using namespace std; const int MOD = 1e9 + 7; vector<int> skills; int main() { cin.tie(0) -> sync_with_stdio(0); //coidng company int N, X; cin >> N >> X; skills.resize(N); for (int i = 0; i < N; i++) { cin >> skills[i]; } sort(skills.begin(), skills.end())...
ALGO
0.999945
4.719326
{ "github_metadata": { "branch": "main", "commit_count": 264, "repo_created_at": "2024-04-06T21:09:48.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 1, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "6d28581ee7...
dad83a66-46dd-4083-b549-c131f8be1270
YazhenHan/C--
Leetcode/Leetcode3/433.cpp
#include <vector> #include <string> #include <unordered_set> #include <queue> using namespace std; class Solution { private: bool isMinus(string str1, string str2) { int j = 0; for (int i = 0; i < str1.size(); i++) { if (str1[i] == str2[i]) continue; else j++; } ...
ALGO
0.999944
5.133693
{ "github_metadata": { "branch": "main", "commit_count": 993, "repo_created_at": "2020-11-10T09:40: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": "07501f70a2...
c1370aa2-ab98-487a-acb9-b6e1fb484441
dimitrijepanic/leetcode_tasks_may24
word_break_2/solution.cpp
#include <string> #include <set> #include <vector> using namespace std; class Solution { public: vector<string> wordBreak(string s, vector<string>& wordDict) { set<string> dict; vector<vector<string>> dp(s.size() + 1, vector<string>(1,"-")); for(auto s: wordDict) dict.insert(s); r...
ALGO
0.999698
5.37343
{ "github_metadata": { "branch": "main", "commit_count": 35, "repo_created_at": "2024-04-29T11:45:01.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "8199ef62c9e...
8396cc80-d414-4194-b449-ba69b5540584
oereo/Algorithm_for_CodingTest
Sehoon/Programmers/그래프/가장 먼 노드.cpp
#include <string> #include <vector> #include <algorithm> using namespace std; int cnt = 0; vector<vector<int>> map; vector<vector<int>> visit; vector<int> res; void dfs( int i ,vector<vector<int>> &edge, vector<vector<int>> &map, vector<vector<int>> &visit, int n, int cnt_1){ cnt_1++; //cnt_1 = max(cnt,...
ALGO
0.999909
4.527739
{ "github_metadata": { "branch": "master", "commit_count": 292, "repo_created_at": "2020-01-23T17:30:07.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 1, "forks": 7, "issues": 0, "pull_requests": 1 }, "file_meta": { "content_id": "c27dc07a...
456dc5ed-ea64-4426-b27c-0bb489125aa4
pooja25sep/Curve-fitting-using-Singular-Value-Decomposition
prob 1/main.cpp
#include <iostream> #include <armadillo> using namespace std; using namespace arma; int main(void) { arma_rng::set_seed_random(); mat matrix = mat(4, 4, fill::randn); matrix.print("martix A saved is: "); mat U, V; vec s; svd(U, s, V, matrix); // rank 1 approximation mat app_mat = s[0]...
ALGO
0.999791
4.030808
{ "github_metadata": { "branch": "main", "commit_count": 3, "repo_created_at": "2024-08-15T18:47: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": "4faab1116d99...
25dedbc7-0bd2-430c-81b2-2329806f87ed
Autoratch/Thailand-Olympiad-in-Informatics
toi06_gem.cpp
#include <bits/stdc++.h> using namespace std; const int N = 4e5 + 1; int n,m; vector<int> adj[N],rev[N]; stack<int> st; set<int> now; bool visited[N]; void dfs(int u) { if(visited[u]) return; visited[u] = true; for(int v : adj[u]) dfs(v); st.push(u); } void dfs2(int u) { if(visited[u]) return; ...
ALGO
0.999948
4.129252
{ "github_metadata": { "branch": "master", "commit_count": 164, "repo_created_at": "2018-03-04T08:45:09.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 20, "forks": 7, "issues": 1, "pull_requests": 0 }, "file_meta": { "content_id": "32a322a...
6afa5e8c-667b-4d4d-ab93-5766c398a051
nhathuyle2002/HIGH-SCHOOL-CODE
SPOJ/nkpolice.cpp
#include <iostream> #include <stdio.h> #include <vector> #include <stack> #include <algorithm> #define for(i,a,b) for (int (i)=(a); (i)<=(b); (i)++) #define pii pair<int,int> #define fi first #define se second using namespace std; const int maxn=1e5+100; int n, m, q; vector<int> e[maxn]; int cou, cou2, coutp; i...
ALGO
0.999931
4.315686
{ "github_metadata": { "branch": "master", "commit_count": 3, "repo_created_at": "2021-10-24T10:32:01.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "809b1be0bb...
8778e77a-6586-46dc-abbe-e181a03beba2
inglada/OTB
Utilities/ITK/Code/Common/itkGaussianSpatialFunction.txx
/*========================================================================= Program: Insight Segmentation & Registration Toolkit Module: $RCSfile: itkGaussianSpatialFunction.txx,v $ Language: C++ Date: $Date: 2009-05-11 16:54:23 $ Version: $Revision: 1.13 $ Copyright (c) Insight Software Cons...
TOOL
0.937927
7.118207
{ "github_metadata": { "branch": "master", "commit_count": 10982, "repo_created_at": "2011-07-01T06:29:23.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 5, "forks": 4, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "3e4fc8...
93709504-aa5e-4281-b173-be7585e6d373
OscarHernandezG/Factory_Engin3D
Factory Engin3D/Octree.cpp
#include "Octree.h" #include "GameObject.h" OctreeNode::OctreeNode(const AABB & quad) : limits(quad) {} OctreeNode::~OctreeNode() { if (HasChilds()) { for (size_t i = 0; i < 8; i++) { if (childs[i] != nullptr) { delete childs[i]; childs[i] = nullptr; } } } } void OctreeNode::Insert(GameObje...
ALGO
0.964952
4.572863
{ "github_metadata": { "branch": "master", "commit_count": 887, "repo_created_at": "2018-09-18T13:45:15.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 1, "forks": 2, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "d53c093e...
c6207a0d-1771-487a-bc47-ffc30111e66f
ishandutta2007/codeforces-m
matix2267/normal/618/D.cpp
#include <bits/stdc++.h> using namespace std; #define fru(j,n) for(int j=0; j<(n); ++j) #define tr(it,v) for(auto it=(v).begin(); it!=(v).end(); ++it) //#define tr(it,v) for(typeof((v).begin()) it=(v).begin(); it!=(v).end(); ++it) #define x first #define y second #define pb push_back #define ALL(G) (G).begin(),(G).end...
ALGO
0.999819
3.589496
{ "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": "b8532dfc61cc...
b53b9297-fa16-4fcf-9906-5ffbb511f60a
vsinghal-69/DSA-2-SDE
heap/nearly_sorted_or_sort_k_sorted_array.cpp
/* Given an array of n elements, where each element is at most k away from its target position, you need to sort the array optimally. The element present at a particular index i in the sorted array is present in the range [i-k, i+k] in the input array. n = 7, k = 3 arr[] = {6,5,3,2,8,10,9} Output: 2 3 5 6 8 9...
ALGO
0.999981
6.513221
{ "github_metadata": { "branch": "master", "commit_count": 106, "repo_created_at": "2021-07-28T03:26: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": "446d1d00...
e598a507-39a6-40bb-a88d-ac6ce104f41f
Vincent-28/VGit
Lab 5/numbers.cpp
//Name: <NAME> //Email: <EMAIL> //Date: March 4th, 2025 #include <iostream> #include <string> using namespace std; //Task A bool isDivisibleBy(int n, int d) { if (d == 0) { return false; } else if (n % d == 0) { return true; } else { return false; } } //Task B bool is...
ALGO
0.999702
4.66327
{ "github_metadata": { "branch": "main", "commit_count": 1, "repo_created_at": "2025-04-27T23:48: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": "533561ecba18...
13e0ed02-aaac-46d9-a9a1-edf12234ac29
Shaxzy/NIXWARE-CSGO
Nixware-CSGO/helpers/math.hpp
#pragma once #include "../valve_sdk/sdk.hpp" #include <DirectXMath.h> #define RAD2DEG(x) DirectX::XMConvertToDegrees(x) #define DEG2RAD(x) DirectX::XMConvertToRadians(x) #define M_PI 3.14159265358979323846 #define PI_F ((float)(M_PI)) namespace Math { inline float FASTSQRT(float x) { unsigned int i = *(unsigne...
TOOL
0.92383
5.664676
{ "github_metadata": { "branch": "master", "commit_count": 21, "repo_created_at": "2019-01-22T14:20:01.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 89, "forks": 28, "issues": 4, "pull_requests": 0 }, "file_meta": { "content_id": "5d2db16...
8f3a3856-dcba-45b2-847f-b307d5647fae
tobischroeder/CppND-Route-Planning-Project
src/route_planner.cpp
#include "route_planner.h" #include <algorithm> RoutePlanner::RoutePlanner(RouteModel &model, float start_x, float start_y, float end_x, float end_y): m_Model(model) { // Convert inputs to percentage: start_x *= 0.01; start_y *= 0.01; end_x *= 0.01; end_y *= 0.01; // TODO 2: Use the m_Model.Fi...
ALGO
0.923559
5.393618
{ "github_metadata": { "branch": "master", "commit_count": 1, "repo_created_at": "2020-04-08T09:24: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": "32ce8971ce...
f6572231-874b-4fe5-9351-be60211b3651
hisfog/minipascal_compiler
src/AST.cpp
#include "AST.h" map<string,AST> globalMap; map<string,AST> globalMapForQ; map<string,int> value;//真值 map<string,string> jmpTable1; map<string,string> jmpTable0; map<string,string> father; AST::AST() { data=""; expressionData=""; } AST::AST(string strx) { data=strx; expressionData=""; } AST::~AST() { ...
ALGO
0.99821
3.950438
{ "github_metadata": { "branch": "master", "commit_count": 2, "repo_created_at": "2022-05-12T03:43:44.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 2, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "0411504bff...
59c3bedb-95e9-48ea-adaf-d94182289199
AmrARaouf/algorithm-detection
graph-source-code/208-C/3072368.cpp
//Language: GNU C++ //#pragma warning (disable: 4786) #include <sstream> #include <queue> #include <set> #include <map> #include <cstdio> #include <cstdlib> #include <cctype> #include <cmath> #include <iostream> #include <string> #include <vector> #include <algorithm> #include <bitset> #include <list> #include <stri...
ALGO
0.999711
3.357858
{ "github_metadata": { "branch": "master", "commit_count": 9, "repo_created_at": "2015-11-10T10:51:28.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "1fea0f3aad...
9d1c48ec-ea40-4434-a730-76270a5d8a79
dull104/EatSnake_Qt
EatSnake/EatSnake.cpp
#include "EatSnake.h" snake::snake() { //初始化蛇的位置,以1300*800的窗口为标准,把蛇放置在页面中间 head = vector<int>{ 650,350 }; body.push_back(vector<int>{600, 350}); tail = vector<int>{ 550,350 }; } EatSnake::EatSnake(QWidget *parent) : QMainWindow(parent) { initMenu(); initButton(); initOther(); } EatSn...
TOOL
0.932127
5.321451
{ "github_metadata": { "branch": "develop", "commit_count": 2, "repo_created_at": "2025-07-13T05:57:37.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 2, "forks": 1, "issues": 1, "pull_requests": 0 }, "file_meta": { "content_id": "753dd5e6e...
eecb8629-98bb-4695-92ae-bb88d6bde284
iexpurgator/Major-Exercises
CPP/Matrix/CPPMAT15.cpp
#include <bits/stdc++.h> #define ull unsigned long long int #define ll long long int #define MOD 1000000007 #define MAX 100000 //#define oo 30 using namespace std; const int oo = 505; int A[oo][oo], B[oo][oo] = {0}, n, m; vector < pair < int, int > > v; void haveRoad(int row, int col, queue < pair < int, int > > & q...
ALGO
0.999775
4.636846
{ "github_metadata": { "branch": "master", "commit_count": 76, "repo_created_at": "2020-12-10T14:44: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": "ea5661597...
30f71f7c-84d9-4598-bbf4-72d42b407339
hshose/Adaptive-AMPC-Cartpole
pendulum_embedded/embedded_pendulum/modm/src/modm/math/utils/bit_operation.cpp
/* * Copyright (c) 2009, <NAME> * Copyright (c) 2009, <NAME> * Copyright (c) 2009-2010, <NAME> * Copyright (c) 2012-2014, <NAME> * * This file is part of the modm project. * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with th...
ALGO
0.98187
7.295348
{ "github_metadata": { "branch": "main", "commit_count": 3, "repo_created_at": "2024-05-18T13:26:41.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 9, "forks": 2, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "bb9e44605847...
acf6034e-b57b-4338-aee5-7198bb5797dd
pavel-zeman/CodeChef
CodeChef/src/y2017/m07/challenge/IPCTrainers.cpp
// Greedy algorithm, which prefers teachers with the highest sadness // https://www.codechef.com/JULY17/problems/IPCTRAIN #include <bits/stdc++.h> using namespace std; #define FOR(c, m) for(int c=0;c<(int)(m);c++) #define FORE(c, f, t) for(int c=(f);c<(t);c++) #define LLI long long int #define MOD 1000000007 char cc...
ALGO
0.999876
4.347366
{ "github_metadata": { "branch": "master", "commit_count": 101, "repo_created_at": "2013-04-21T19:40: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": "36386291...
3e8fd214-e2d2-4c89-b88e-4158160171ee
EshpulatovOtabek/funny-LEETCODE-tasks
3sum.cpp
// DATE: 7/6/2022 7:13 pm // LOCATION: Uzbekistan, Tashkent // DEVELOPER: <NAME> // TASK NUMBER: 15 // TASK: Given an integer array nums, return all the triplets [nums[i], nums[j], nums[k]] such that i != j, i != k, and j != k, and nums[i] + nums[j] + nums[k] == 0. // Notice that the solution set must not contain dup...
ALGO
0.999727
5.506548
{ "github_metadata": { "branch": "main", "commit_count": 14, "repo_created_at": "2022-07-01T15:44: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": "be757086c11...
ffbd6ad2-8226-478f-bd52-4115bbbea54b
PunitTak2005/CPP-GFG
241.cpp
//{ Driver Code Starts // Initial template for C++ #include <bits/stdc++.h> using namespace std; // } Driver Code Ends // User function Template for C++ class Solution { public: int solve(int i,int j,string &s,vector<vector<int>>&dp){ if(i>j){ return 0; } if(i=...
ALGO
0.999822
6.088597
{ "github_metadata": { "branch": "main", "commit_count": 397, "repo_created_at": "2024-10-16T13:12: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": "acebe9f0d6...
8e13401e-254a-4612-aadc-21bcae204337
anwar-arif/acm-code
uva live/Interval Product.cpp
#include <cassert> #include <cctype> #include <cmath> #include <cstdio> #include <cstdlib> #include <cstring> #include <iostream> #include <sstream> #include <iomanip> #include <string> #include <vector> #include <deque> #include <list> #include <set> #include <map> #include <bitset> #include <stack> #include <queue> #...
ALGO
0.999805
3.659175
{ "github_metadata": { "branch": "master", "commit_count": 76, "repo_created_at": "2018-03-31T14:35:44.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "39af03117...
98325b5f-0ee0-41d8-aa7b-e50b5ad52380
sethc23/aporo
ENV/archive/OpenResty_Nginx/openresty_mods/drizzle7-2011.07.21/drizzled/unique.cc
/* Copyright (C) 2001 MySQL AB 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; version 2 of the License. This program is distributed in the hope that it will be useful, but WITHOUT AN...
ALGO
0.997029
6.046203
{ "github_metadata": { "branch": "master", "commit_count": 127, "repo_created_at": "2014-06-30T17:17:32.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 1, "pull_requests": 1 }, "file_meta": { "content_id": "dc8b6390...
c3061a33-f29d-4d40-aefa-eedf4e365caa
LLNL/spheral
src/NodeGenerators/chooseRandomNonoverlappingCenter.cc
#include <random> #include "chooseRandomNonoverlappingCenter.hh" #include "Utilities/DBC.hh" namespace Spheral { //------------------------------------------------------------------------------ // Look for a position for the given shape inside a boundary and avoiding the // given set of shapes. //-------------------...
ALGO
0.99881
6.59092
{ "github_metadata": { "branch": "develop", "commit_count": 11401, "repo_created_at": "2018-07-24T20:43:19.000Z", "is_fork": false, "is_org_owned": true, "forked_from": null, "stars": 68, "forks": 19, "issues": 32, "pull_requests": 11 }, "file_meta": { "content_id": "93...
13ac255d-10af-4298-bf85-29b4ffdd72ae
Choroning/BOJ-Practice
C++17/백준/Bronze/2798. 블랙잭/블랙잭.cc
#include <iostream> using namespace std; int main() { ios::sync_with_stdio(false); cin.tie(nullptr); int n, m, currentTest, currentMax = 0; cin >> n >> m; int* p = new int [n]; for (int i = 0; i < n; i++) { cin >> p[i]; } for (int i = 0; i < n; i++) { for ...
ALGO
0.999995
4.253342
{ "github_metadata": { "branch": "main", "commit_count": 95, "repo_created_at": "2024-09-17T09:38: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": "97ef0e3b0a1...
65841716-da32-4b5d-aede-94c179c62222
thanhnc2803/Thanh-Github
phep-so-sanh.cpp
#include <iostream> using namespace std; // Phép so sánh: > >= < <= == != // 0: Fasle // 1: True int main() { int a = 10; int b = 5; cout << "a > b: " << (a > b) << endl; cout << "a >= b: " << (a >= b) << endl; cout << "a < b: " << (a < b) << endl; cout << "a <= b: " << (a <= b) << endl; co...
ALGO
0.981953
3.108259
{ "github_metadata": { "branch": "master", "commit_count": 6, "repo_created_at": "2020-06-14T02:37: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": "ebc053ab30...
10b098cc-9881-4121-8f34-3b83078b4d08
StoicGang/Problem_Solving
4/Stars/Solid_diamond.cpp
#include <iostream> using namespace std; int main() { int n; cout << "Enter N :"; cin >> n; // first half for (int row = 0; row < n; row++) { // Spaces print kr bhai for (int col = 0; col < (n - row - 1); col++) { cout << " "; } // stars print...
ALGO
0.999846
4.342514
{ "github_metadata": { "branch": "main", "commit_count": 51, "repo_created_at": "2025-01-01T05:59:51.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "3235a2ffdae...
80f258a4-8091-4777-9765-a59ec10e14b7
alexandraback/datacollection
solutions_2645486_0/C++/zhymaoiing/b.cpp
#include <cstdio> #include <cstring> #include <algorithm> #include <functional> #include <iostream> #include <queue> #include <set> using namespace std; typedef long long LL; typedef pair<int, int> PII; const int Max = 10010; int E, R, N, A[Max]; int U[Max]; LL D[Max]; void update(LL &r, LL d) { if (r < d) r = d;...
ALGO
0.999876
3.604091
{ "github_metadata": { "branch": "master", "commit_count": 58, "repo_created_at": "2017-03-08T11:33:58.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 1, "forks": 4, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "e4a65771c...
c916c95e-8181-4151-b80d-b1c0c22c7e6c
SaifulJnU/Hacktoberfest2022
LeetCode_special/Unique-Len3-Pallindromic-Seq.cpp
class Solution { public: int countPalindromicSubsequence(string s) { int n=s.length(); int ans=0; vector<int>f(26,0); for(int i=0 ; i<n; i++){// here we are calculating the frequency of each ower case letter f[s[i]-'a']++; } // GYAAN ...
ALGO
0.999991
5.866497
{ "github_metadata": { "branch": "main", "commit_count": 129, "repo_created_at": "2022-10-17T16:13:18.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 3, "forks": 37, "issues": 5, "pull_requests": 3 }, "file_meta": { "content_id": "5645c8462...
db39357b-dd8a-499b-845e-d7371fd0067b
shahriar480/Introduction-to-programming
Balanced BST.cpp
#include <iostream> using namespace std; struct TreeNode { int value; TreeNode* left; TreeNode* right; TreeNode(int val):value(val),left(nullptr),right(nullptr) {} }; TreeNode* buildBalancedTree(int arr[],int start,int end) { if (start>end) { return nullptr; } int mid=(start+end...
ALGO
0.999985
5.768176
{ "github_metadata": { "branch": "main", "commit_count": 11, "repo_created_at": "2023-10-14T11:02: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": "1174c141bb1...
594d9f8b-6dc2-4b7b-b1d7-e5eccc125c88
gauthamthampi/cpp_Training
Classworks/Day 19/Day 19/src/malloc1.cpp
#include <iostream> using namespace std; int main() { int* ptr = nullptr; int* temp = nullptr; int noofElem = 5; //allocate mem first and then use it ptr = (int*)malloc(sizeof(int) * noofElem); // copy BA to a temp pointer temp = ptr; for (int i = 0;i < noofElem;i++) { cout << "Enter the " << i + 1 << "val...
ALGO
0.983951
3.78728
{ "github_metadata": { "branch": "main", "commit_count": 142, "repo_created_at": "2025-04-23T06:24: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": "6865642062...