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 |
|---|---|---|---|---|---|---|---|
67f2c8f8-f918-4bfd-8081-1498c727b348 | amolsatsangi/Leetcode | Easy/Merge Strings Alternately/Merge_Strings_Alternately.cpp | /******************************************************
You are given two strings word1 and word2. Merge the strings by adding letters in alternating order, starting with word1. If a string is longer than the other, append the additional letters onto the end of the merged string.
Return the merged string.
Example ... | ALGO | 0.99974 | 5.452734 | {
"github_metadata": {
"branch": "main",
"commit_count": 688,
"repo_created_at": "2024-08-31T16:35:15.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "2a5430bdf7... |
d3e99388-3ff0-4203-ba33-07b8467e2d6b | Abhinandan-2/LeetCode-And-GFG | Express as sum of power of natural numbers - GFG/express-as-sum-of-power-of-natural-numbers.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 numOfWays(int n, int x)
{
vector<int> a;
int k=1;
int res = pow(k,x);
while(res<=n)
... | ALGO | 0.999919 | 5.768401 | {
"github_metadata": {
"branch": "main",
"commit_count": 2776,
"repo_created_at": "2022-05-20T09:30:29.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "2e5a0c008... |
f9a66a7d-712d-4249-9983-2a6d3c7d4689 | iskang5532/PS | BOJ/20310 타노스.cpp | // 2022-05-11
// 20310 타노스
// https://www.acmicpc.net/problem/20310
/*
그리디 (2,024KB, 0ms)
시간 복잡도: ?
풀이)
- 가장 빠른 문자열을 만들기 위해서는 '0'이 앞서 있어야 한다.
그러므로, 값을 제거할 때 앞에 있는 '1'을 우선적으로 제거하며, '0'을 제거할 때는 뒤에서부터 제거한다.
*/
#include <iostream>
using namespace std;
#define FAST_IO ios::sync_with_stdio(false), cin.... | ALGO | 0.999987 | 4.275499 | {
"github_metadata": {
"branch": "master",
"commit_count": 330,
"repo_created_at": "2021-07-29T10:17:39.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "78eca7ed... |
fb2a7af0-4c25-41f2-884e-4b1d4ae92d79 | ggace/baekjoon | 2606.cpp | #define fio cin.tie(0);cout.tie(0);ios_base::sync_with_stdio(false);
typedef long long ll;
typedef unsigned long long ull;
#include <bits/stdc++.h>
using namespace std;
bool reverse_compare(int i1, int i2) {
return i1 > i2;
}
#define graph_size 1000
vector<vector<int>> graph(graph_size+1);
bool dfs_visited[grap... | ALGO | 0.999295 | 3.826353 | {
"github_metadata": {
"branch": "master",
"commit_count": 14,
"repo_created_at": "2024-04-25T06:24: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": "3bec28a06... |
3a824264-2b5a-4624-9698-ef560a77335c | jimgoo/hfrisk | src/myskewt.hpp | /*
Author: <NAME>
Created: 2012-09-01
*/
#ifndef __MYSKEWT_HPP__
#define __MYSKEWT_HPP__
// STD
#include <iostream>
#include <math.h>
#include <time.h>
#include <sstream>
#include <iomanip>
// GSL
#include <gsl/gsl_vector.h>
#include <gsl/gsl_matrix.h>
#include <gsl/gsl_deriv.h> // finite differencing
#include <... | ALGO | 0.99752 | 5.023361 | {
"github_metadata": {
"branch": "master",
"commit_count": 119,
"repo_created_at": "2013-01-10T02:06:25.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 7,
"forks": 4,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "4c289ccb... |
8678e7b1-fb17-4326-a765-18182637a1e8 | pskliff/Archiver | EncoderDecoder.h | #include <locale>
#include <codecvt>
#include "huffman.h"
#include "fano.h"
#include "lz77.h"
namespace EncDec
{
/**
* writes nodes(triples) to the file as bytes (5 bytes for 1 triple)
* \param v lz77 nodes
* \param destination_path
*/
// allsize.div.mod.ch.div.mod.ch.......allsize times
... | TOOL | 0.97877 | 4.445778 | {
"github_metadata": {
"branch": "master",
"commit_count": 14,
"repo_created_at": "2018-03-15T10:04: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": "d3c622cd8... |
a153f0cd-0db1-402b-a46a-9104a8f090d2 | racsosabe/CompetitiveProgramming | RuCode/2021-AB-E.cpp | #include<bits/stdc++.h>
using namespace::std;
int gcd(int a, int b){
while(b){
a %= b;
swap(a, b);
}
return a;
}
int mcm(int a, int b){
return a * b / gcd(a, b);
}
int a, b, c;
long long L, R;
long long g(long long x){
return (x + a - 1) / a + (x + b - 1) / b + (x + c - 1) / c;
}
long long f(long long x... | ALGO | 0.99995 | 3.865309 | {
"github_metadata": {
"branch": "master",
"commit_count": 107,
"repo_created_at": "2018-07-22T03:34:59.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 4,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "11cb1a93... |
f9b54bf9-56f3-4eca-a7d3-525aba52fa31 | jungwngkim/cp | src/atcoder/abc256_e.cpp | #include <iostream>
#include <vector>
#include <algorithm>
using namespace std;
int n, next_[200001], prev_[200001], cost[200001], state[200001];
long long ans;
void dfs(int u, int p) {
prev_[p] = u;
if(state[u] == 1) {
int x = prev_[u];
int min_cost = cost[u];
while(x != u) {
... | ALGO | 0.999887 | 3.382878 | {
"github_metadata": {
"branch": "main",
"commit_count": 69,
"repo_created_at": "2021-05-05T22:48: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": "470580ab5a4... |
b20ccb6e-9a32-47a1-aa6a-bf60663fa7fe | Chander-Shekhar/ConcurrentGraphs | HT-HT/graph.h | #include <atomic>
#include <iostream>
#include "HNode.h"
// #include "utils.h"
#include <bits/stdc++.h>
using namespace std;
class ConcGraph {
private:
HashTable<int, HashTable<int, int**>*> *adjlist;
public:
ConcGraph() {
adjlist = new HashTable<int, HashTable<int, int**>*>();
}
bool add... | ALGO | 0.998881 | 4.726835 | {
"github_metadata": {
"branch": "main",
"commit_count": 21,
"repo_created_at": "2021-01-27T11:06: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": "addb439fecf... |
debd23ab-077c-44f6-93a0-dc0ea94944cc | AroSwift/CS1020 | Teacher Msze/maze.cpp | //
// maze.cpp
// Written by: <NAME>
// 03/01/2016
//
// A stack-based maze solver. Solves mazes by pushing all choices
// at a given position, then popping a move. At dead-ends, no
// choices are pushed, so a previous position choice will be
// popped (thus returning to a previous position). If a dead-end
// is reache... | ALGO | 0.999731 | 5.442654 | {
"github_metadata": {
"branch": "master",
"commit_count": 321,
"repo_created_at": "2016-01-30T21:26:34.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "83ffb6b6... |
b226aef1-4f84-4794-8fb4-1f724aaa84ba | Connicpu/cnnr-engine | Source/Common/CxHash.h | #pragma once
#include <stdint.h>
#include <utility>
namespace cx
{
namespace details
{
template <typename T, T offset, T prime>
constexpr T fnv1a_helper(const char *str, ptrdiff_t pos)
{
return pos == 0
? offset
: (fnv1a_helper<T, offset, pri... | TOOL | 0.921899 | 6.603834 | {
"github_metadata": {
"branch": "master",
"commit_count": 84,
"repo_created_at": "2016-05-31T07:02: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": "8ba13950e... |
a72d0474-bcd3-43d9-8ede-f91dd56e0a42 | dharmu8948/GitLearningRapo | Data Structures and Algorithms/reverseString2.cpp | // C++ program to reverse a string preserving
// spaces.
#include <iostream>
using namespace std;
// Function to reverse the string
// and preserve the space position
string reverses(string str)
{
int i = str.length() - 1;
int start, end = i + 1;
string result = "";
while(i >= 0)
{
... | ALGO | 0.999654 | 5.050573 | {
"github_metadata": {
"branch": "master",
"commit_count": 69,
"repo_created_at": "2020-07-29T10:39:39.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "a4451fd6d... |
6d84a74d-b654-4334-a5da-cc63f3e3ba4b | ScienisTmiaoT/Speech-Recognition | Lextree/LextreeProcess.cpp | #include "LextreeProcess.h"
bool readTestFile(string filePath, string inFileName, string outFileName, vector<string>& vec)
{
convertFile(filePath, inFileName, outFileName);
readFile(filePath, outFileName, vec);
return true;
}
bool createTrie(string filePath, string inFileName, Trie& trie)
{
string str;
ifstream... | ALGO | 0.995721 | 3.92451 | {
"github_metadata": {
"branch": "master",
"commit_count": 77,
"repo_created_at": "2016-09-23T07:03: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": "e57c44a7f... |
4984acab-1767-47a0-9b20-384a483645f9 | hummingg/LeetCode | 937.重新排列日志文件.cpp | /*
* @lc app=leetcode.cn id=937 lang=cpp
*
* [937] 重新排列日志文件
*
* https://leetcode-cn.com/problems/reorder-data-in-log-files/description/
*
* algorithms
* Easy (59.01%)
* Likes: 107
* Dislikes: 0
* Total Accepted: 15.3K
* Total Submissions: 25.9K
* Testcase Example: '["dig1 8 1 5 1","let1 art can","di... | ALGO | 0.999016 | 5.462807 | {
"github_metadata": {
"branch": "main",
"commit_count": 19,
"repo_created_at": "2022-02-27T10:50:15.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "50bca9a6d8c... |
0af13f48-252b-4198-9ac7-feb43bc73bfe | metehkaya/Algo-Archive | Problems/AtCoder/Contests/Beginner_Contests/Contest_178/C.Ubiquity.cpp | #include <bits/stdc++.h>
#define maxn 1000003
#define mod 1000000007
using namespace std;
typedef long long LL;
int n;
LL ans;
LL pw8[maxn];
LL pw9[maxn];
LL fact[maxn];
LL calc(LL x , int y) {
if(!y)
return 1;
LL res = calc(x,y/2);
res = res*res % mod;
if(y&1)
res = res*x % mod;
return res;
}
int main() {
... | ALGO | 0.99993 | 3.840116 | {
"github_metadata": {
"branch": "main",
"commit_count": 78,
"repo_created_at": "2023-04-04T19:44: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": "cdea179957e... |
63503e9f-351b-4d41-9d7d-2e17806cf203 | mndxpnsn/longest-increasing-subsequence | longest-increasing-subsequence/main.cpp | //
// main.cpp
// longest-increasing-subsequence
//
// Created by <NAME> on 21/08/2022.
//
#include <iostream>
#include <map>
#include <vector>
using namespace std;
const int MAX = 2502;
int dp[MAX][MAX];
int len_max;
void init_dp() {
for(int i = 0; i < MAX; ++i) {
for(int j = 0; j < MAX; ++j) {
... | ALGO | 0.999953 | 5.829996 | {
"github_metadata": {
"branch": "master",
"commit_count": 2,
"repo_created_at": "2022-08-21T16:19: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": "bb5fe8e177... |
fca13d53-338d-4902-9b64-213a407d9348 | blueclocker/wpollo | lanelet/path_boost/include/path_boost/reference_path_smoother/tension_smoother_2.hpp | /*
* @Author: blueclocker <EMAIL>
* @Date: 2022-09-03 19:21:20
* @LastEditors: blueclocker <EMAIL>
* @LastEditTime: 2022-09-03 20:01:09
* @FilePath: /wpollo/src/lanelet/path_boost/include/path_boost/reference_path_smoother/tension_smoother_2.hpp
* @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: h... | ALGO | 0.996829 | 5.672858 | {
"github_metadata": {
"branch": "master",
"commit_count": 41,
"repo_created_at": "2021-09-30T02:10:02.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 4,
"forks": 2,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "dac955053... |
40b91037-5a7a-4eca-95c5-977e97684e1a | nimendoza/noi-2023 | training/week-7/intense/train.cpp | #include <bits/stdc++.h>
using vint = std::vector<int>;
auto solve(const int& m, const int& n, const std::string& s, const std::string& t) {
std::vector<std::vector<vint>> dp(m + 1, std::vector<vint>(n + 1, vint(2, INT_MIN)));
for (int i{m}; i >= 0; --i) {
for (int j{n}; j >= 0; --j) {
dp[i... | ALGO | 0.999962 | 4.75072 | {
"github_metadata": {
"branch": "main",
"commit_count": 16,
"repo_created_at": "2023-02-17T04:26: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": "cc69d08fd4d... |
b6972dbe-b972-403a-b0cf-5bc4c8da8b69 | nubot-nudt/single_nubot_gazebo | src/nubot_simulation/nubot_gazebo/plugins/parabolic_transition_planning.hh | /*
* Copyright (C) 2014-2015 NUDT
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed t... | ALGO | 0.99593 | 6.010936 | {
"github_metadata": {
"branch": "master",
"commit_count": 46,
"repo_created_at": "2015-08-18T08:39:43.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 21,
"forks": 11,
"issues": 1,
"pull_requests": 0
},
"file_meta": {
"content_id": "f8c61245... |
bc3d4514-c2be-469e-929c-1afeb1abd5ad | ImperishableMe/Lightoj | Lightoj1267.cpp | #include <bits/stdc++.h>
using namespace std;
typedef pair < int , int > PII ;
#define F first
#define S second
const int MX = 3e5 + 100;
struct dat
{
int x, y, type;
int id;
dat(){}
dat(int a,int b, int c, int d):x(a),y(b),type(c),id(d){
}
};
int BIT[MX] ;
void update(int id , int val)
{
... | ALGO | 0.99974 | 4.221095 | {
"github_metadata": {
"branch": "master",
"commit_count": 45,
"repo_created_at": "2017-12-20T13: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": "3ef0b9e8a... |
90b2b70a-2470-4185-8b73-6fe03eaa964d | yanshengjia/cpp-playground | cpp-htp/standard/ch02solutions/ex02_20.cpp | // Exercise 2.20 Solution: ex02_20.cpp
#include <iostream> // allows program to perform input and output
using namespace std; // program uses names from the std namespace
int main()
{
int radius; // variable to store a circle's radius
cout << "Enter the circle radius: "; // prompt user for radius
cin >> radi... | ALGO | 0.978212 | 4.917269 | {
"github_metadata": {
"branch": "master",
"commit_count": 24,
"repo_created_at": "2016-01-24T03:06:25.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 187,
"forks": 90,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "586d92... |
6443a5ce-8995-4d5b-a44f-67d2a220cc11 | BorisSchaeling/Boost.Thread-examples | 35_shared_lock_guard.cpp | // uses two threads writing to a global variable and two threads reading from it
// to introduce shared locking with boost::shared_mutex and boost::shared_lock_guard;
// program must be terminated with CTRL+C as it uses infinite loops in reader threads
#define BOOST_THREAD_VERSION 4
#include <boost/thread.hpp>
#include... | TOOL | 0.991142 | 4.919118 | {
"github_metadata": {
"branch": "master",
"commit_count": 2,
"repo_created_at": "2015-12-02T10:49:57.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 6,
"forks": 2,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "e4df7b5c64... |
f59914b4-f36e-4a9a-8254-8bcf9bd4e425 | destinyson7/All-Codes | Codeforces/edu/Binary Search/2g.cpp | #include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
using namespace __gnu_pbds;
using namespace std;
typedef long long int ll;
typedef unsigned long long int ull;
typedef long double ld;
typedef pair <ll, ll> pll;
typedef pair <int, int> pii;
typedef tree <ll, null_... | ALGO | 0.999984 | 4.394486 | {
"github_metadata": {
"branch": "master",
"commit_count": 213,
"repo_created_at": "2019-12-02T11:53: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": "23fca92f... |
d75af114-8371-4b0e-b21d-07d9cd6445a3 | tonglin0/Algorithm-Problems | BZOJ/bzoj1935.cpp | #include<cstdio>
#include<cstdlib>
#include<cstring>
#include<algorithm>
#define MN 10000009
using namespace std;
int c[MN];
struct point{int x,y;bool flag;int aid,po;};
int ans[500009];
point a[5*500009];
bool cmp(point a,point b){if (a.x!=b.x) return a.x<b.x;if (a.y!=b.y) return a.y<b.y;return a.flag;}
int low(int ... | ALGO | 0.999917 | 3.236278 | {
"github_metadata": {
"branch": "master",
"commit_count": 3,
"repo_created_at": "2018-11-29T11:13: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": "d37f0ae8e9... |
e04a5664-1702-4894-a460-30cd8c253897 | guohaoxiang/ComplexGen | GeometricRefine/GeometricRefine/src/Mathematics/DistRay3AlignedBox3.h | // <NAME>, Geometric Tools, Redmond WA 98052
// Copyright (c) 1998-2021
// Distributed under the Boost Software License, Version 1.0.
// https://www.boost.org/LICENSE_1_0.txt
// https://www.geometrictools.com/License/Boost/LICENSE_1_0.txt
// Version: 4.0.2019.08.13
#pragma once
#include <Mathematics/DistLine3AlignedB... | ALGO | 0.955425 | 6.287048 | {
"github_metadata": {
"branch": "main",
"commit_count": 94,
"repo_created_at": "2022-03-29T03:38:16.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 109,
"forks": 13,
"issues": 4,
"pull_requests": 0
},
"file_meta": {
"content_id": "46965b81... |
8f93c901-a03b-4122-9b37-fe25df381706 | AmanSharma0710/cp | Codeforces Round #875/E_Hyperregular_Bracket_Strings.cpp | #include<bits/stdc++.h>
using namespace std;
#define int long long int
#define vi vector<int>
#define pii pair<int,int>
#define vii vector<pii>
#define rep(i,a,b) for(int i=a; i<b; i++)
bool sortbysec(const pair<int,int> &a, const pair<int,int> &b){ //to sort vii by second element use sort(v.begin(), v.e... | ALGO | 0.999979 | 5.497616 | {
"github_metadata": {
"branch": "main",
"commit_count": 6,
"repo_created_at": "2022-05-03T21:58:26.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "aedf4a843317... |
fc517c26-f36e-44af-b2f6-144d9afbd5cd | cmse822/project-1-team-8 | Empirical_Roofline_Tool-1.1.0/Drivers/driver1.cxx | #include "kernel1.h"
#include "driver.h"
double getTime()
{
double time;
#ifdef ERT_OPENMP
time = omp_get_wtime();
#elif ERT_MPI
time = MPI_Wtime();
#else
struct timeval tm;
gettimeofday(&tm, NULL);
time = tm.tv_sec + (tm.tv_usec / 1000000.0);
#endif
return time;
}
#ifdef ERT_OCL
inline std::string loa... | TOOL | 0.960187 | 4.069524 | {
"github_metadata": {
"branch": "main",
"commit_count": 106,
"repo_created_at": "2024-01-11T15:28:47.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 2,
"forks": 0,
"issues": 0,
"pull_requests": 1
},
"file_meta": {
"content_id": "b10893334a7... |
fcac97ff-e671-48d8-994b-16a991853ff4 | ShaoxunJin/work_test_code | sizeof/sizeof/algorithm/MODEL_SEARCH.cpp | #include "stdafx.h"
#include "model_search.h"
int e[2][2] = {{1,0},{0,1}};
double MODEL_SEARCH_calculate_Y(xx_vect x_init, double sigma, int cycle)
{
function_in(__FUNCTION__);
xx_vect y_value[2] = {{},{}};
xx_vect y_value_plus = {};
xx_vect y_value_minus = {};
y_value[0].x1 = x_init.x1 + sigma * e[0][0];
y_... | ALGO | 0.999973 | 4.034954 | {
"github_metadata": {
"branch": "master",
"commit_count": 1,
"repo_created_at": "2018-05-17T13:46: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": "7155e45fe0... |
59d0e2cf-cb28-41b5-b577-f962d5eca7bb | yemika/algorithm_and_datastruct | sorting.cpp |
#include <iostream>
using namespace std;
void insertSort(int arr[], int n);
void selectSort(int arr[], int n);
void bubbleSort(int arr[], int n);
void shellSort(int arr[], int n);
void mergeSortRecursion(int arr[], int left, int right);
void mergeSortIterative(int arr[], int n);
int my_partion(int arr[], int left, in... | ALGO | 0.999804 | 5.248661 | {
"github_metadata": {
"branch": "master",
"commit_count": 3,
"repo_created_at": "2018-03-04T12:20: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": "aa480681d9... |
0dd5d95e-f181-47d6-a0b7-55d2edc9571b | hohaidang/CPP_Basic2Advance | LeetCode/Two Sum III - Data structure design/source.cpp | class TwoSum {
public:
/** Initialize your data structure here. */
// Tu lam
multiset<int> hashSet;
TwoSum() {
}
/** Add the number to an internal data structure.. */
void add(int number) {
hashSet.insert(number);
}
/** Find if there exists any pair of numbers which... | ALGO | 0.999885 | 6.137272 | {
"github_metadata": {
"branch": "master",
"commit_count": 113,
"repo_created_at": "2020-04-03T06:49:10.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 4,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "a7fc5360... |
17d5215b-6a70-4a76-8438-f6c2611360c4 | shyam640/Data-Structure-and-Algorithm | ChessBoardProblems/Problem1.cpp | /*
Given an N×N Matrix Mat[][] of N rows and N columns. There is exactly one Queen on the
chessboard and the cell that is under the attack of the Queen is represented by ‘Q’ and
the cell which is not under attack of the Queen is represented by ‘.’. The task is to
find the position of the Queen.
*/
#include<bits/st... | ALGO | 0.99994 | 4.058097 | {
"github_metadata": {
"branch": "main",
"commit_count": 64,
"repo_created_at": "2021-07-02T07:29: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": "eafea5e3fc3... |
437944e9-2c84-4368-8de5-45f017e0fb1c | pulkit1joshi/handbook_codes | Chapter 18: Tree Queries/treequeries_lca_method1.1.cpp | /*
Chapter 17: Tree Queries
Topic: Lowest Common Ancestor
Method 1:
Step 1: We will find the height and parent of each node.
Step 2: For two nodes x and y, we will first traverse up the one that is much lower such that both nodes are in same height
Step 3: Now we will traverse both up till we get a common node.
*/
#i... | ALGO | 0.999996 | 4.928791 | {
"github_metadata": {
"branch": "main",
"commit_count": 25,
"repo_created_at": "2020-10-17T15:42:51.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 29,
"forks": 6,
"issues": 1,
"pull_requests": 0
},
"file_meta": {
"content_id": "0bacf9062f... |
166defc3-cea6-4c0b-b0c9-ddbad0bdf63b | vindhya-14/6Companies30days | company5/problem5.cpp | #include <iostream>
#include <stack>
#include <string>
using namespace std;
string printMinNumberForPattern(string S) {
int n = S.length();
stack<int> st;
string result = "";
int num = 1;
// Traverse through the string
for (int i = 0; i <= n; i++) {
// Push the current number to th... | ALGO | 0.999974 | 6.594989 | {
"github_metadata": {
"branch": "main",
"commit_count": 98,
"repo_created_at": "2025-01-03T11:58: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": "60db226acc6... |
95cdb5e5-54d5-4a88-9f2e-8bf07d651e26 | fstqwq/Nemesis | SCL_others/Other/SJTU_ACM_Platelet/Template/Source/Geometry/circle_union.cpp | double ans[2001];
struct Point {
double x, y;
Point(){}
Point(const double & x, const double & y) : x(x), y(y) {}
void scan() {scanf("%lf%lf", &x, &y);}
double sqrlen() {return sqr(x) + sqr(y);}
double len() {return sqrt(sqrlen());}
Point rev() {return Point(y, -x);}
void print() {printf("%f %f\n", x, y);}
Poi... | ALGO | 0.999877 | 3.664525 | {
"github_metadata": {
"branch": "master",
"commit_count": 248,
"repo_created_at": "2019-09-08T16:45:23.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 43,
"forks": 4,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "8ec7eea... |
b6510d38-274d-4ffc-abf6-0ab0e8a9e0bb | hefcah/Object-Oriented-Programming | CountingInversionsIn2DArray.cpp | #include<iostream>
using namespace std;
int main()
{
int count=0;
int rows, cols;
cout << "Enter number of rows: ";
cin >> rows;
cout << "Enter number of columns: ";
cin >> cols;
// Create a 2D dynamic array
int** Arr = new int*[rows];
for (int i = 0; i < rows; i++)
{
Arr[i... | ALGO | 0.999873 | 4.044677 | {
"github_metadata": {
"branch": "main",
"commit_count": 3,
"repo_created_at": "2024-06-28T13:10: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": "eae1cdb68931... |
47b9ad29-2c2d-4d07-bffa-986316d0b71d | sunny2329/Data-Structure-And-Algorithms | Recurssion/recursion-9.cpp | #include <bits/stdc++.h>
using namespace std;
void solves(vector<int>nums, vector<vector<int>>& ans, int index){
if(index>=nums.size()){
ans.push_back(nums);
return;
}
for(int i = index;i<nums.size();i++){
swap(nums[index],nums[i]);
solves(nums,ans, index+1);
swap(nums[ind... | ALGO | 0.999968 | 4.944232 | {
"github_metadata": {
"branch": "main",
"commit_count": 25,
"repo_created_at": "2023-07-10T13:13: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": "90fe4fbdc6e... |
78060d66-3763-4507-bd3a-a5983c6d96de | ahmadhanif95/Data-Structures-and-Algorithm | DSA POSTLAB 11/MaxHeap.h | #ifndef MAX_HEAP_H
#define MAX_HEAP_H
using namespace std;
template<class DT>
class MaxHeap
{
public:
//part1: constructor initializes array of size maxsize
MaxHeap()
{
size = 0;
}
//part2: Inserts data into its appropriate position
//within the Heap
bool insert(const DT data)
{
size++;
arr[size] = data;
... | ALGO | 0.998494 | 4.041683 | {
"github_metadata": {
"branch": "main",
"commit_count": 1,
"repo_created_at": "2024-01-23T18:50:11.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "6c3832a00760... |
7413986c-3db0-48ff-8991-174763bba176 | luluwu516/leetcodeCplus2 | 345-ReverseVowelsOfString/345-s1.cpp | #include <iostream>
#include <string>
using namespace std;
class Solution {
public:
string reverseVowels(string s) {
int left = 0, right = s.size() - 1;
while (left < right) {
char l = tolower(s[left]);
if (l == 'a' || l == 'e' || l == 'i' || l == 'o' || l == 'u') {
char r = tolower(s[r... | ALGO | 0.997309 | 5.823218 | {
"github_metadata": {
"branch": "main",
"commit_count": 94,
"repo_created_at": "2024-02-14T19:10: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": "cfddf90238e... |
b96d2edc-8bcb-4c54-bbae-79e7c9bd125a | nvnamsss/leetcode | Redundant Connection/cpp/main.cpp | /*
In this problem, a tree is an undirected graph that is connected and has no cycles.
You are given a graph that started as a tree with n nodes labeled from 1 to n, with one additional edge added. The added edge has two different vertices chosen from 1 to n, and was not an edge that already existed. The graph is repr... | ALGO | 0.99993 | 5.968127 | {
"github_metadata": {
"branch": "master",
"commit_count": 31,
"repo_created_at": "2020-04-21T13:05:50.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 5,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "436c46787... |
170d9760-8305-455b-be48-fabf41502352 | kovalyov-z3/Academic_Stuff | Sortirovo4ka.cpp | // Этот код позволяет подсчитать количество чётных элементов в массиве и вывести его в отсортированном по чётности порядке
#include<stdio.h>
main()
{
int n; int a[100]; int counter = 0;
scanf("%d", &n); int buf;
for (int i=0; i<n; i++)
{
scanf("%d", &a[i]);
}
for (int i=0; i<n; i++)
{
printf("%3d", ... | ALGO | 0.999528 | 3.871293 | {
"github_metadata": {
"branch": "main",
"commit_count": 14,
"repo_created_at": "2020-10-28T07:26: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": "ba9dc57085a... |
0ffde187-61e7-4fcd-aebd-794c6aa36185 | peng-yq/the-way-to-find-a-job | leetcode/c++/2023_mihoyo_subsequence.cpp | // https://codefun2000.com/p/P1095
#include <bits/stdc++.h>
using namespace std;
bool change(string s, string t){
int charS[3] = {0}, charT[3] = {0};
string newS, newT;
for (int i = 0; i < int(s.length()); i++) {
if(s[i] == 'm')
charS[0]++;
else if (s[i] == 'h')
cha... | ALGO | 0.999985 | 4.46175 | {
"github_metadata": {
"branch": "main",
"commit_count": 561,
"repo_created_at": "2023-10-03T08:36:05.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 62,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "12017ea90... |
b7a70a64-8880-4fcd-b9d5-a74277dbdb6d | Sekai55/C | 1/змейка.cpp | #include <iostream>
#include <stdlib.h>
#include <conio.h>
#include <windows.h>
using namespace std;
const int weight=20;
const int height=20;
bool gameOver,print,gameWin=false;
int i,j,x,y,k,fx,fy,score;
int TailX[100],TailY[100],nTail;
enum direct{STOP=0, RIGHT, LEFT, UP, DOWN};
direct dir;
void setup(){
gameOver=... | ALGO | 0.984232 | 3.294372 | {
"github_metadata": {
"branch": "main",
"commit_count": 2,
"repo_created_at": "2024-04-21T02:16: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": "cd54a57a9945... |
06a52091-907b-428d-a922-399ee86f9aa8 | google/android-cuttlefish | base/cvd/cuttlefish/common/libs/utils/subprocess.h | /*
* Copyright (C) 2018 The Android Open Source Project
*
* 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 app... | TOOL | 0.980817 | 6.005158 | {
"github_metadata": {
"branch": "main",
"commit_count": 11534,
"repo_created_at": "2017-12-13T19:42:51.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 509,
"forks": 160,
"issues": 0,
"pull_requests": 8
},
"file_meta": {
"content_id": "86877... |
d2f8bc98-9823-4bde-9d98-380ad635a8f9 | KakeruKitahara/kyopuro | atcoder/abc232/c.cpp | #include <bits/stdc++.h>
#include <atcoder/all>
using namespace std;
using namespace atcoder;
#define REP(i, n) for (int i = 0; i < n; i++)
#define REP2(i, a, n) for (int i = a; i < n; i++)
#define REPR(i, n) for (int i = n - 1; 0 <= i; i--)
#define REPR2(i, n, a) for (int i = n; a <= i; i--)
using V = vector<int>;
usi... | ALGO | 0.999999 | 4.81867 | {
"github_metadata": {
"branch": "master",
"commit_count": 212,
"repo_created_at": "2022-02-02T07:17: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": "859913e0... |
48941158-986c-47c1-b55d-c27d94655905 | prateeksharma21/Competitive-Programming | Contest/Codeforces/Codeforces Round #640/f.cpp | #include <bits/stdc++.h>
using namespace std;
#define F first
#define S second
#define pb push_back
#define int ll
#define f(i,x,n) for(int i=x;i<n;i++)
#define all(c) c.begin(),c.end()
using ll = long long;
using pii = pair<int,int>;
const int MOD = 1e9+7, N = 1e5 + 10;
void test(){
int n0,n1,n2;
cin >> n0 >> ... | ALGO | 0.999885 | 3.729017 | {
"github_metadata": {
"branch": "main",
"commit_count": 102,
"repo_created_at": "2019-09-30T19:06:53.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 13,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "be9301174... |
d463cac1-25e7-4231-a737-9ee1d6550cd1 | froggagul/ps_baekjoon | baekjoon/brute force/recursion/16198.cpp | #include<iostream>
#include<vector>
#include<algorithm>
using namespace std;
int ans = 0;
void go(vector<int>& a, vector<bool>& check, int curr, int size, int n) {
if (size == 2) {
if (ans < curr) ans = curr;
return;
}
for (int i = 1; i < n - 1; i++) {
if (check[i]) continue;
int prevNum = 0, nextNum = 0;
... | ALGO | 0.999927 | 3.633721 | {
"github_metadata": {
"branch": "master",
"commit_count": 39,
"repo_created_at": "2020-04-23T14:30:12.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "71968f20e... |
14b7ff70-f7b2-4f74-9895-e44dda7645b1 | alexandraback/datacollection | solutions_5652388522229760_0/C++/supasaya/main.cpp | #include <iostream>
#include <vector>
#include <algorithm>
using namespace std;
int TC = 1, T, N;
int sum = 0;
int a[10];
void check(long long num) {
int digit;
while (num) {
digit = num % 10;
num = num / 10;
if (a[digit] == 0) {
sum++;
a[digit] = 1;
}
... | ALGO | 0.999694 | 4.213671 | {
"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": "cf7309913... |
873ea733-ba6f-4985-88af-3b0deb6a2798 | PSegaert/mrfDepth | src/Outlyingness.cpp | #include <algorithm>
#include <cstdlib>
#include <ctime>
#include <functional>
#include <fstream>
#include <iostream>
#include <math.h>
#include <time.h>
#include <stdio.h>
#include <stdlib.h>
#include <sstream>
#include <vector>
#include <limits>
#include <Eigen/Dense>
#include <Eigen/QR>
using namespace std;
using ... | ALGO | 0.996443 | 3.326736 | {
"github_metadata": {
"branch": "master",
"commit_count": 50,
"repo_created_at": "2017-04-03T08:15:20.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 3,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "6ba4e6c7f... |
cfe66f19-44e1-48d7-998d-62cb20d65bfc | PritamSarbajna/Coding-platforms-Solution | GeeksForGeeks/Remove loop in Linked List/remove_loop_in_linked_list.cpp | /*
structure of linked list node:
struct Node
{
int data;
Node* next;
Node(int val)
{
data = val;
next = NULL;
}
};
*/
class Solution
{
public:
Node *detectLoop(Node *head){
Node *slow = head, *fast = head;
while(fast != NULL && fast->nex... | ALGO | 0.999958 | 5.510215 | {
"github_metadata": {
"branch": "main",
"commit_count": 652,
"repo_created_at": "2021-12-30T19:32:34.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 3,
"forks": 3,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "497d7ddbaf... |
582e2347-33e4-48d7-a5ac-5c7ea3892da8 | PTQ-22/Solved-Algorithm-Problems | 2022/09/test_na_inteligencje.cpp | // https://szkopul.edu.pl/problemset/problem/Ak4wWPkNtHpF-OiulN1gixfW/site/
#include <bits/stdc++.h>
using namespace std;
bool check(int x, vector<int> &ind, int act)
{
if (ind[x] > act)
return true;
return false;
}
int main()
{
ios_base::sync_with_stdio(false);
cin.tie(nullptr);
const i... | ALGO | 0.999903 | 4.849779 | {
"github_metadata": {
"branch": "master",
"commit_count": 70,
"repo_created_at": "2022-09-24T21:27: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": "1910f25d3... |
f0afbea3-1905-4f64-a7fa-0e67c38e60a4 | Edith-3000/Algorithmic-Implementations | Advanced DS/Range Query DS/Segment Tree/Descent in Segment Tree.cpp | // Ref: https://unacademy.com/class/descent-in-segment-tree-problems/T2M5NK9L
// Raw code of below algorithm: https://pastebin.com/gUu5ugbL
// Prob. based on this concept: https://codeforces.com/edu/course/2/lesson/4/2/practice/contest/273278/problem/D
/****************************************************************... | ALGO | 0.999996 | 5.251458 | {
"github_metadata": {
"branch": "master",
"commit_count": 490,
"repo_created_at": "2020-07-24T04:49:45.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 9,
"forks": 4,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "09922a35... |
1eb0b15a-06e9-435f-9277-02c153a64934 | bhatnagar345/DSA | tree/pre n in order using ittrative.cpp | #include<bits/stdc++.h>
using namespace std;
class Node
{
public:
int data;
Node *lchild;
Node * rchild;
};
class Queue
{
private:
int first;
int rear;
Node **q;
int Size;
public:
Queue()
{
Size = 10;
first = rear =-1;
q = new Node*[Size];
}
Queue(i... | ALGO | 0.999975 | 3.509984 | {
"github_metadata": {
"branch": "main",
"commit_count": 5,
"repo_created_at": "2024-05-05T22:42: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": "8b5fd43d185e... |
467afc24-0920-4a9d-9f91-b5a0ac0f7868 | EdCharlesDiesel/Learning-C-P-P | Learn to Program with C++ 17/Learn to Program with C++ 17.cpp | #include <iostream>
#include <iomanip>
void SolveLinearEquations(double matrix[3][4], int n) {
// Gaussian Elimination
for (int i = 0; i < n; i++) {
// Make the diagonal element 1
double diagElement = matrix[i][i];
for (int j = 0; j <= n; j++) {
matrix[i][j] /= diagElement;
... | ALGO | 0.999986 | 5.208938 | {
"github_metadata": {
"branch": "master",
"commit_count": 6,
"repo_created_at": "2024-12-26T12:23: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": "45e1ab1fba... |
2f49f764-f638-468a-8359-f6045e173c3d | ebchen/CPSI | Contest 3/cab/cab/cab.cpp | #include <iostream>
#include <vector>
#include <fstream>
#include <string>
#include <cmath>
#include <math.h>
#include <algorithm>
#include <queue>
#include <utility>
#include <climits>
#include <queue>
#include <deque>
using namespace std;
class Solution
{
public:
char last;
int n;
int lastInd;
vector <string> wo... | ALGO | 0.999981 | 3.353126 | {
"github_metadata": {
"branch": "master",
"commit_count": 2,
"repo_created_at": "2019-03-20T02:55: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": "b3e73eb028... |
41ee0b86-4237-45c6-b3ff-2602473c253c | PhilippMatthes/cg1 | exercise4/src/AABBTree.cpp | // This source code is property of the Computer Graphics and Visualization
// chair of the TU Dresden. Do not distribute!
// Copyright (C) <NAME> - All Rights Reserved
#include "AABBTree.h"
#include <iostream>
void BuildAABBTreeFromTriangles(const HEMesh& m, AABBTree<Triangle >& tree)
{
std::cout << "Building AABB... | ALGO | 0.995429 | 5.988551 | {
"github_metadata": {
"branch": "master",
"commit_count": 125,
"repo_created_at": "2018-10-21T09:38:43.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "3059418d... |
d9d5dd06-ee62-46d0-b0f4-42867e5c1043 | AKC23/Learning_c_plus_plus | Data Structure and Algorithm/Sorting Algorithm/Merge sort/Merge_Sort.cpp | /*
C++ program for Merge Sort
*/
#include <iostream>
#include <vector>
#include <algorithm>
using namespace std;
void Print(vector<int> &vec, int size)
{
for (int i = 0; i < size;i++)
cout << vec[i] <<" ";
cout << "\n";
}
void Merge(vector<int> &x, int l, int mid, int r)
{
int i, j, k;
... | ALGO | 0.999995 | 5.776547 | {
"github_metadata": {
"branch": "main",
"commit_count": 108,
"repo_created_at": "2020-12-01T14:46: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": "31d120e3da... |
714ca5a7-3ce8-4d93-87a9-0b298d9ddbfe | jbernard-McMaster/PMIT | PMIT/PMIProblemV2A_PoL_v1.cpp | #include "stdafx.h"
#include "PMIProblemV2A_PoL_v1.h"
PMIProblemV2A_PoL_v1::PMIProblemV2A_PoL_v1(PlantModel^ Model, float ErrorRate, String^ FileName) : PMIProblemV2A_Rule(Model, ErrorRate, FileName)
{
}
PMIProblemV2A_PoL_v1::~PMIProblemV2A_PoL_v1()
{
}
//float PMIProblemV2A_PoL::Assess(array<Int32>^ Solution)
//{... | ALGO | 0.99991 | 4.409401 | {
"github_metadata": {
"branch": "main",
"commit_count": 2,
"repo_created_at": "2021-09-13T16:06:52.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "ce11cf00114a... |
f0562303-5fad-45a7-b428-9696bcecc02c | vishalbelsare/dinrhiw2 | src/reinforcement/RIFL_abstract.cpp |
#include "RIFL_abstract.h"
#include "NNGradDescent.h"
#include <assert.h>
#include <list>
#include <functional>
namespace whiteice
{
template <typename T>
RIFL_abstract<T>::RIFL_abstract(const unsigned int numActions,
const unsigned int numStates,
const unsigned int dimActionFeatures)
{
// ini... | ALGO | 0.975124 | 3.392281 | {
"github_metadata": {
"branch": "RBM_test",
"commit_count": 397,
"repo_created_at": "2018-08-05T19:47: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": "7ef804... |
3ef6c00e-83dc-45fb-b0e8-31f6ee76b938 | ZoranPandovski/al-go-rithms | data_structures/Stack/C++/Postfix_calcution.cpp | #include <iostream>
using namespace std;
#define Operand 1
#define Operator 2
#define Parenthesis 3
class Intstack{
public:
int stk[100000];
int top=1;
void Make_empty(){
top=1;
}
bool Is_empty(){
return top==1;
}
void push(int val){
... | ALGO | 0.99974 | 3.922519 | {
"github_metadata": {
"branch": "master",
"commit_count": 7457,
"repo_created_at": "2017-06-05T19:20:20.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1359,
"forks": 1929,
"issues": 20,
"pull_requests": 44
},
"file_meta": {
"content_id": ... |
09ae38f7-e47b-49ce-8e9b-aef072651f5b | Coolchirutha/CP | Step2/14.longest-common-prefix.cpp | /*
* @lc app=leetcode id=14 lang=cpp
*
* [14] Longest Common Prefix
*/
#include <bits/stdc++.h>
using namespace std;
// @lc code=start
class Solution {
public:
string longestCommonPrefix(vector<string> &strs) {
string result = "";
if (strs.size() == 0)
return result;
for (int i = 0; i < strs[0... | ALGO | 0.999806 | 6.391549 | {
"github_metadata": {
"branch": "master",
"commit_count": 259,
"repo_created_at": "2021-05-13T09:43: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": "cf584d41... |
6cfbc8db-0651-45d2-884b-a9b8a9e9538b | KangDHGit/Study | algorithm/Note/STL_set.cpp | #include<iostream>
#include<set>
#include<list>
#include<algorithm>
using std::cout;
using std::endl;
using std::cin;
template<typename T>
void PrintContainer(T container) {
for (auto it = container.begin(); it != container.end(); it++)
cout << *it << " ";
cout << endl;
}
template<typename T>
void PrintConPair(T ... | TOOL | 0.971381 | 4.419489 | {
"github_metadata": {
"branch": "main",
"commit_count": 119,
"repo_created_at": "2022-12-17T13:22: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": "9454b736c1... |
633f70db-5f5b-4810-9340-5db5ec76bb2d | tinku06071999/gfg-solutions | Medium/Subset Sum Problem/subset-sum-problem.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:
bool solve(int idx, vector<int>&arr, int sum, vector<vector<int>>&dp){
if(sum==0)return true;
if(idx == 0)return arr[0... | ALGO | 0.999568 | 5.644899 | {
"github_metadata": {
"branch": "main",
"commit_count": 492,
"repo_created_at": "2023-01-09T05:21: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": "8a9a2745b3... |
cd547f1a-ae06-4f42-be2c-e7b3f25052c9 | jtj8412/problem-solving | Programmers/Level3/1836.cpp | //----------------------------------------------------------------------------------
// [ 리틀 프렌즈 사천성 ] https://programmers.co.kr/learn/courses/30/lessons/1836
//
// 1. 알파벳의 오름차순으로 타일 위치 및 알파벳 저장 (vec)
// 2. a1타일 -> a2타일 연결 가능 루트는 수평이동->수직이동 또는 수직이동->수평이동이며
// 연결가능시, 두 타일을 저장소에서(board, vec) 제거 및 answer에 타일 알파벳 추가
// ... | ALGO | 0.999983 | 4.756672 | {
"github_metadata": {
"branch": "main",
"commit_count": 304,
"repo_created_at": "2021-07-03T14:08: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": "e034972e72... |
48b62f27-884a-4af8-9d72-d3b7e69d11ba | Elliotshui/leetcode_solution | acwing/111.cpp | #include <iostream>
#include <cstring>
#include <priority_queue>
using namespace std;
class cow {
public:
int a, b, idx, fidx;
bool operator < (const cow& c) const {
return a < cow.a || (a == cow.a && b < cow.b);
}
}
class fence {
public:
int idx, ft;
fence(int i, int f) : idx(i), ft(f) {}
bool operator < (co... | ALGO | 0.999993 | 3.776993 | {
"github_metadata": {
"branch": "master",
"commit_count": 9,
"repo_created_at": "2020-06-22T08:21: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": "1fc66db8e8... |
d6e23ac1-f2f8-4eca-a15b-7e9a9b0f7fc4 | carnivorous-hotdog/cp | csacademy/practice/anomalies.cpp | #include <bits/stdc++.h>
using namespace std;
#define vi vector<int>
#define vii vector<int, int>
#define ll long long
#define pb push_back
#define mp make_pair
#define endl '\n'
#define idk ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);
#ifdef LOCAL
#define trace(...) __f(#__VA_ARGS__, __VA_ARGS__)
template <type... | ALGO | 0.999976 | 4.721489 | {
"github_metadata": {
"branch": "master",
"commit_count": 95,
"repo_created_at": "2020-02-19T22:59: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": "0a4bd8098... |
3de9241f-3c36-46f9-9415-af23449c2a84 | codetorex/imagine3d | engine/m_light.cpp | #include "cmodify.h"
/*
void IModel::CalculateLightMaps(long size)
{
// First Sub Divide Mesh
long v1,v2,v3;
vector3f t0,t1,t2;
float area;
float e1,e2,e3;
long state;
vector3f* st1;
vector3f* st2;
vector3f* st3;
st1 = new vector3f [size];
st2 = new vector3f [size];
st3 = new vector3f [size];
float stp;
vector3f t... | ALGO | 0.969321 | 3.741978 | {
"github_metadata": {
"branch": "master",
"commit_count": 2,
"repo_created_at": "2020-01-27T10:14:18.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "eac468bbec... |
a86f08bc-a3d9-469d-a7fc-59945e9ef798 | apaarkamal/LPU-Bootcamp | insetion_sort.cpp | #include<bits/stdc++.h>
using namespace std;
int main()
{
freopen("input.txt", "r", stdin);
freopen("output.txt", "w", stdout);
int n;
cin >> n;
int a[n];
for (int i = 0; i < n; i++) {
cin >> a[i];
}
for (int index = 1; index < n; index++) {
int val = a[index];
int left = index - 1;
while (left >= ... | ALGO | 0.999995 | 4.263241 | {
"github_metadata": {
"branch": "main",
"commit_count": 12,
"repo_created_at": "2023-06-08T10:26:03.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "db93bdabbce... |
eacf327c-b223-4292-a5bb-005409065349 | ishandutta2007/codeforces-m | maripium/normal/300/E.cpp | #include <bits/stdc++.h>
using namespace std;
using ll = long long;
const int MX = 10000100;
int np[MX];
int pref[MX];
void precalc() {
for (int i = 2; i < MX; ++i) if (!np[i]) {
for (int j = 2 * i; j < MX; j += i) {
np[j] = true;
}
}
}
int main() {
ios_base::sync_with_stdio(false);
... | ALGO | 0.999881 | 3.948952 | {
"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": "160d0e5e653c... |
6c55ba5c-18f2-4aa4-94e6-74ebdcd71324 | yahoojapan/yskip | src/vec_util.h | /*******************************************
* Copyright (C) 2017 Yahoo! JAPAN Research
*******************************************/
#pragma once
#include <iostream>
#include <sstream>
#include <cstring> // strlen
#include <math.h> // fabs, pow, floor, ceil
#include <vector>
#include <string>
#include <random>
#inclu... | ALGO | 0.955262 | 4.940804 | {
"github_metadata": {
"branch": "master",
"commit_count": 5,
"repo_created_at": "2019-03-20T05:28:37.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 69,
"forks": 8,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "3e2938c4fe... |
7af874e7-7b09-4a51-b1d7-91a5097e564e | rajneeshkumar146/Questions | Question_LeetcodeAndGeeks/slidingWindow/Medium/Q009Leetcode1248_count-number-of-nice-subarrays/Q009Leetcode1248.cpp | // #include <bits/stdc++.h>
#include <iostream>
#include <vector>
#include <string>
#include <list>
#include <dequeue>
#include <multiset>
#include <queue>
#define vi vector<int>
#define vii vector<vi>
using namespace std;
auto speedUp = []() {
std::ios::sync_with_stdio(false);
std::cin.tie(nullptr);
std... | ALGO | 0.999957 | 5.372823 | {
"github_metadata": {
"branch": "master",
"commit_count": 29,
"repo_created_at": "2020-02-05T05:11:36.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "3ef477c83... |
f68229ec-9197-4c50-b376-219e36878e96 | Jikky1618/AtCoder | ABC/ABC100-149/ABC105/d.cpp | #include <bits/stdc++.h>
using namespace std;
using ll = long long;
#ifdef LOCAL
#include <debug_print.hpp>
#define debug(...) debug_print::multi_print(#__VA_ARGS__, __VA_ARGS__)
#else
#define debug(...) (static_cast<void>(0))
#endif
int main(){
cin.tie(nullptr);
ios::sync_with_stdio(false);
cout << fixed... | ALGO | 0.999959 | 4.353754 | {
"github_metadata": {
"branch": "main",
"commit_count": 1910,
"repo_created_at": "2022-08-14T03:49:13.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "5e1cc3f96... |
1a7ec223-8338-4015-ad22-c1b19c88bb02 | xiaomo9/studyCgg | Leecode/easy/存在重复元素II.cpp | #include<iostream>
using namespace std;
#include<vector>
#include<unordered_map>
#include<algorithm>
/*
给你一个整数数组 nums 和一个整数 k ,判断数组中是否存在两个 不同的索引 i 和 j ,
满足 nums[i] == nums[j] 且 abs(i - j) <= k 。如果存在,返回 true ;否则,返回 false 。
*/
class Solution
{
public:
bool containsNearbyDuplicate(vector<int>& nums, int k)
{
... | ALGO | 0.999661 | 5.348408 | {
"github_metadata": {
"branch": "main",
"commit_count": 66,
"repo_created_at": "2024-09-04T06:11:22.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "5f2acdfbb3b... |
67ba19d1-5829-4315-adbf-05ed03fcbce4 | ArupDas15/Linked_List | 1566-check-if-a-word-occurs-as-a-prefix-of-any-word-in-a-sentence/1566-check-if-a-word-occurs-as-a-prefix-of-any-word-in-a-sentence.cpp | class Solution {
public:
int isPrefixOfWord(string sentence, string searchWord) {
// Initialize the word position counter
int currentWordPosition = 1;
// Initialize the current index in the sentence
int currentIndex = 0;
// Get the length of the sentence
int sentenceL... | ALGO | 0.999709 | 6.091213 | {
"github_metadata": {
"branch": "master",
"commit_count": 1713,
"repo_created_at": "2020-07-23T04:10: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": "abef823... |
b0eb21d9-98b5-49f6-9efe-7b8b8e920bed | uvbs/klib | master/core/third/algorithms/heap/heap/heap.h | /*******************************************************************************
*
* FileName : heap.h
* Comment : heap base class
* Version : 1.0
* Author : <EMAIL>
* Date : 2007-9-25 1:07
*
*******************************************************************************/
#ifndef _HEAP_H_INCLUDED
#define _HEAP... | ALGO | 0.91904 | 4.493283 | {
"github_metadata": {
"branch": "master",
"commit_count": 458,
"repo_created_at": "2014-11-26T06:42:56.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 6,
"forks": 5,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "99634ea5... |
f2a72696-647b-4883-9ee5-090d979f46ef | theSamJain/TOF-Summer-Internship-2022 | TOF.cpp | // Time of Flight
# include <iostream>
# include <cmath>
# include <fstream>
# include <iomanip>
long double velz(long double KE, double m)
{
long double tof, v;
v = sqrt(2*(KE*1.60217*pow(10, -19))/(m*1.66054*pow(10, -27)));
return(v);
}
// KE in eV
// q in C
// m in u
// theta in degrees
long double TOF... | ALGO | 0.980724 | 3.505279 | {
"github_metadata": {
"branch": "main",
"commit_count": 2,
"repo_created_at": "2022-09-04T00:40: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": "bc121002e68b... |
a558ef15-d53d-4c8f-a2aa-38e06ac8617d | its-me-bauddha/LEETCODE | 23-merge-k-sorted-lists/merge-k-sorted-lists.cpp | /**
* Definition for singly-linked list.
* struct ListNode {
* int val;
* ListNode *next;
* ListNode() : val(0), next(nullptr) {}
* ListNode(int x) : val(x), next(nullptr) {}
* ListNode(int x, ListNode *next) : val(x), next(next) {}
* };
*/
class campare{
public:
bool operator()(... | ALGO | 0.999918 | 6.14052 | {
"github_metadata": {
"branch": "main",
"commit_count": 333,
"repo_created_at": "2023-09-14T16:20:39.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "c9d8263e62... |
414d4c82-309a-44bb-ac42-23b5369cd13c | Matas28731449/hash-generator | read/100000/testHex.cpp | //----------LIBRARY----------
#include <iostream>
#include <fstream>
#include <sstream>
#include <numeric>
#include <vector>
#include <bitset>
using std::stringstream;
using std::max_element;
using std::min_element;
using std::accumulate;
using std::ifstream;
using std::getline;
using std::vector;
using std::string;
u... | ALGO | 0.996663 | 4.36805 | {
"github_metadata": {
"branch": "main",
"commit_count": 9,
"repo_created_at": "2023-09-07T11:03: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": "b82091d0880e... |
8df003d3-54cc-440e-aac1-5139606c0195 | paulocezar/problem-solving | TopCoder/SRMs/#515/RotatedClock1.cpp | // Paste me into the FileEdit configuration dialog
#include <map>
#include <set>
#include <list>
#include <stack>
#include <cmath>
#include <queue>
#include <ctime>
#include <cfloat>
#include <vector>
#include <string>
#include <cstdio>
#include <climits>
#include <cstdlib>
#include <cstring>
#include <casser... | ALGO | 0.998442 | 4.320521 | {
"github_metadata": {
"branch": "master",
"commit_count": 108,
"repo_created_at": "2015-04-23T17:19:28.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 3,
"forks": 3,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "09ff2824... |
0cacae98-f49a-4d28-8b8c-ff6c878693ed | nikhil-iyer-97/Hash-tree-implementation | DM.cpp | #include <bits/stdc++.h>
#define ll long long
#define ld long double
#define rep(i,a,b) for(ll i=a;i<b;i++)
#define IOS ios::sync_with_stdio(false)
#define vi vector < ll >
#define sort(a) sort(a.begin(),a.end())
#define reverse(a) reverse(a.begin(),a.end())
#define pb push_back
#define mp make_pair
using namespace ... | ALGO | 0.998061 | 3.636598 | {
"github_metadata": {
"branch": "master",
"commit_count": 7,
"repo_created_at": "2017-10-04T18: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": "3f13c0492c... |
4f13b411-9d12-4a88-bce7-96f848e1da5c | PedroDariva36/Desktop | Contests/847/d/a.cpp | #include <bits/stdc++.h>
#define ll long long
#define ull unsigned long long
#define endl '\n'
#define all(x) (x).begin(), (x).end()
#define rall(x) (x).rbegin(), (x).rend()
#define pb push_back
using namespace std;
int main (int argc, char *argv[]){
cin.tie(0)->sync_with_stdio(0);
int tt;
cin >> tt;
... | ALGO | 0.999689 | 4.038483 | {
"github_metadata": {
"branch": "main",
"commit_count": 15,
"repo_created_at": "2024-03-30T23:55:50.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "38ac8254bc1... |
ba579a82-f3ef-4b86-90df-c072b37522ae | lezkizofrenik/DA | p3/DefenseStrategy.mioexample.cpp | // ###### Config options ################
// #######################################
#define BUILDING_DEF_STRATEGY_LIB 1
#include "../simulador/Asedio.h"
#include "../simulador/Defense.h"
#include "cronometro.h"
using namespace Asedio;
/*
struct compare {
bool operator()(Defense * d1, Defense * d2) {retur... | ALGO | 0.999466 | 4.000349 | {
"github_metadata": {
"branch": "master",
"commit_count": 2,
"repo_created_at": "2020-03-27T01:27: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": "0cb92f135b... |
6f876d52-5872-42a1-8692-dafd8d1bf577 | singhsanket143/CppCompetitiveRepository | UnacademyCourse/AdditionalConceptsCPPJuly2021/Lecture4/operator_overloading.cpp | // Problem Link -
/* By <NAME> */
#include<bits/stdc++.h>
void file_i_o()
{
std::ios_base::sync_with_stdio(0);
std::cin.tie(0);
std::cout.tie(0);
}
class Complex {
public:
int real;
int img;
Complex() {}
Complex(int r, int i) : real(r), img(i) {}
void display() const {
std... | ALGO | 0.941627 | 4.873544 | {
"github_metadata": {
"branch": "master",
"commit_count": 304,
"repo_created_at": "2018-06-26T07:06:16.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 348,
"forks": 160,
"issues": 1,
"pull_requests": 4
},
"file_meta": {
"content_id": "1301... |
13d4f153-6430-4f21-a2dc-c4629f6dd97f | twoload/myAlgo | Combination/CB_p1_16881_matrixGame.cpp | #if 0
//# Ive attended the code.plus class (https://code.plus/)
# And I've referred it's codes
# And core parts can be come fully from the class.
#endif
// each element -> grundy number
// if all numbers are 0 in a row, grundy number is 0
// if there is one number which is not 0, == rock stach is 0
// grundy number... | ALGO | 0.999996 | 3.391416 | {
"github_metadata": {
"branch": "master",
"commit_count": 37,
"repo_created_at": "2022-08-15T00:08: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": "a457f62df... |
fb309c21-a014-45bb-aad7-0d4654d31721 | shawon-majid/CP-Track | CSES/counting_coprime_pairs.cpp | //<NAME>
#include <bits/stdc++.h>
using namespace std;
#define debug(x) cout << '>' << #x << " : " << x << endl;
#define all(c) c.begin(), c.end()
#define F first
#define S second
#define fastIO ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL);
typedef unsigned long long ull;
typedef long long ll;
int ma... | ALGO | 0.999977 | 3.821452 | {
"github_metadata": {
"branch": "main",
"commit_count": 20,
"repo_created_at": "2022-08-08T16:52:16.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "f3e1c683941... |
07b4826c-2de2-4c82-8042-da2f4ea356da | Kagari22/MyCode | BinaryIndexTree/Fenwick.cpp | #include <bits/stdc++.h>
// from: cpp.json
#define INF 1e18
#define int long long
using namespace std;
template <typename T>
struct Fenwick {
int n;
std::vector<T> a;
Fenwick(int n_ = 0) {
init(n_);
}
void init(int n_) {
n = n_;
a.assign(n, T{});
}
vo... | ALGO | 0.999794 | 4.642979 | {
"github_metadata": {
"branch": "main",
"commit_count": 21,
"repo_created_at": "2024-05-08T02:47:36.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "8dc2c944f74... |
4809a38a-5e33-4d46-8979-a8403938f6e6 | jiangsit/LeetCode | 15. 3Sum.cpp | #include<iostream>
#include<vector>
#include<set>
#include<algorithm>
using namespace std;
vector<vector<int> > threeSum(vector<int>& nums) {
vector< vector<int> > result;
sort(nums.begin(),nums.end());
int n = nums.size();
for(int i=0;i<n-2;i++){
if(i>0 && nums[i-1]==nums[i])
continue;
int a = nums[i... | ALGO | 0.999663 | 4.762612 | {
"github_metadata": {
"branch": "master",
"commit_count": 37,
"repo_created_at": "2017-08-19T07:41: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": "cc5a1dbbb... |
615041be-a016-4e99-b7e0-860253e41d6b | szujoz/DiagTool_RXII | RobotDiagTool/DiagTool_Libs/common/CRC/crc8.cpp | /*
* crc8.c
*
* Created on: 25 mar 2017
* Author: osannolik
*/
#include "crc8.h"
/* For information and crc-tables, see
* - http://reveng.sourceforge.net/crc-catalogue/all.htm
* - https://github.com/madler/crcany
*/
#if (CRC8_USED_POLY == CRC8_8)
/* width=8 poly=0x07
* init=0x00
* refin=false
* refo... | ALGO | 0.961714 | 5.361456 | {
"github_metadata": {
"branch": "main",
"commit_count": 91,
"repo_created_at": "2020-10-10T19:45:05.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "a1f002fabf3... |
ab1c993f-2358-40f9-a626-a354f16f243e | UglySwedishFish/Ludum-Dare-42 | Core/Core.cpp | #include "Core.h"
#include <iostream>
template<typename T>
T LDEngine::Core::Interpolate(T A, T B, T X)
{
T FT = x * static_cast<T>(3.1415);
}
template<typename T>
T LDEngine::Core::Lerp(T A, T B, T F)
{
return A + F * (B - A);
}
Matrix4f LDEngine::Core::ViewMatrix(Vector3f Position, Vector3f Rotation)
{
M... | TOOL | 0.905416 | 5.296529 | {
"github_metadata": {
"branch": "master",
"commit_count": 6,
"repo_created_at": "2018-08-14T01:44:04.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 7,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "a4609f8720... |
fcb5554b-30bf-422a-a9be-9c70ed44b262 | apppchi/middle | middle/function_1.cpp | #include "middle.h"
void itc_num_print(int number){
cout << number;
}
int itc_len_num(long long number){
int c = 0;
if (number < 0)
number = number * -1;
while (number > 0){
c++;
number = number / 10;
}
return c;
}
int itc_sum_num(long long number){
if (number < 0)... | ALGO | 0.990965 | 3.222422 | {
"github_metadata": {
"branch": "main",
"commit_count": 5,
"repo_created_at": "2022-09-19T12:17:32.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "7d7fbf00e929... |
410487b7-830c-410e-a7b3-ca9e39170209 | masonhorne/Kattis-Solutions | src/cetvrta.cpp | #include <iostream>
using namespace std;
//////////////////////////////////////////////////////
// Problem: https://open.kattis.com/problems/cetvrta /
//////////////////////////////////////////////////////
int main() {
// Read in all x and y values from input
int x1, y1, x2, y2, x3, y3; cin >> x1; cin >> y1; ... | ALGO | 0.999819 | 5.387823 | {
"github_metadata": {
"branch": "master",
"commit_count": 4,
"repo_created_at": "2022-08-10T22:21: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": "2fca574c25... |
1a2e7d34-8463-4cd6-9c91-374a13d59eeb | sooking87/CPP_Algorithm | Chap 01/example09.cpp | #include <iostream> // std::cout
#include <vector> // std::vector
#include <algorithm> // std::find
void print(std::vector<int> v)
{
for (auto ele : v)
{
std::cout << ele << " ";
}
std::cout << std::endl;
}
int main()
{
std::vector<int> vec1 = {1, 2, 3, 4, 5};
std::cout << "vec1 초기... | ALGO | 0.992391 | 5.401223 | {
"github_metadata": {
"branch": "master",
"commit_count": 16,
"repo_created_at": "2022-09-15T02:43: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": "0bbf3fccb... |
b1dc465d-a8b6-45a7-b899-96baa020fd4c | MeTeoR541/Equation-Drawing | functions.cpp | #include "functions.h"
using namespace std;
char Function::OPEN_PAR = '(';
char Function::CLOSE_PAR = ')';
char Function::PLUS = '+';
char Function::MINUS = '-';
char Function::MULT = '*';
char Function::DIV = '/';
char Function::FACT = '!';
char Function::EXPO = '^';
string Function::SINE = "sin";
string Function::C... | ALGO | 0.996728 | 4.031585 | {
"github_metadata": {
"branch": "main",
"commit_count": 22,
"repo_created_at": "2022-06-01T03:31:00.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "e41bd696254... |
7bf86be3-e1ae-4029-8e07-be8c86d4ac51 | stephonlawrence/cisc-3110-lab-2-ticTacMath | main.cpp | /*
Author: <NAME>
Name: main.cpp
Description: Creates a tic tac math game where 2 players,
can play to win by using the number 1-9 to create a row, column
or diagonal that adds up to 15. The project details are posted here:
https://bc-cisc3110-f16.github.io/Project1.pdf
*/
#include <iostream>
#i... | ALGO | 0.976838 | 5.088534 | {
"github_metadata": {
"branch": "master",
"commit_count": 7,
"repo_created_at": "2016-09-21T05:57:31.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "fc2472f805... |
54ae210c-ac19-419d-9c46-70ed053faa79 | sravya273/DataStructures | BinaryTree/nodeHasKdecendents.cpp | #include <iostream>
using namespace std;
struct node
{
int data;
struct node *left, *right;
};
int haskchild(struct node* t)
{
if (t== NULL)
return 0;
return 1+haskchild(t->left)+haskchild(t->right);
}
void callchild(struct node* head, int k)
{
if(head== NULL)
return;
if(head!=NULL)
... | ALGO | 0.999769 | 3.708517 | {
"github_metadata": {
"branch": "master",
"commit_count": 65,
"repo_created_at": "2020-06-09T18:32:23.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "63e54bebb... |
2f7614df-d813-4534-8ad5-df5bea846814 | alpha-saliou-barry/GISUD_primal_algorithm | src/IncompatibilityDegree.h | #include <vector>
#include <unordered_map>
#include <algorithm>
#include "ISUD_Base.h"
#include "IB_Column.h"
#include <map>
#include <set>
class IncompatibilityDegree {
protected:
// Task name to task order
std::map<std::string, int> tasksOrderInv;
// Pointer on the problem
ISUD_Base* psolutionMethod_;
// RHS o... | ALGO | 0.994361 | 5.886439 | {
"github_metadata": {
"branch": "main",
"commit_count": 7,
"repo_created_at": "2024-05-22T13:43:29.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "2c9fa9ed7559... |
44878002-cc94-4db7-b01b-160eeb5733a6 | ishandutta2007/codeforces-b | belonogov/normal/888/D.cpp | #include <iostream>
#include <cmath>
#include <vector>
#include <map>
#include <set>
#include <string>
#include <cstring>
#include <queue>
#include <ctime>
#include <cassert>
#include <cstdio>
#include <algorithm>
#include <unordered_set>
#include <unordered_map>
#include <bitset>
#include <random>
#include <functional... | ALGO | 0.99995 | 4.106069 | {
"github_metadata": {
"branch": "main",
"commit_count": 2,
"repo_created_at": "2024-04-11T01:05:31.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "bd245fbb9892... |
c2ed3bd9-746f-4534-9062-3254a6444764 | AltairCA/qt-file-locker-AES-256 | Encrypt/botan/botan.cpp | /*
* Botan 1.10.2 Amalgamation
* (C) 1999-2011 <NAME> and others
*
* Distributed under the terms of the Botan license
*/
#include "botan.h"
#include <deque>
#ifdef Q_OS_WIN
#ifndef NOMINMAX
#define NOMINMAX
#endif
#endif
namespace Botan {
/**
* Represents a DLL or shared object
*/
class Dynamically_Loaded_Library
... | TOOL | 0.927162 | 6.681337 | {
"github_metadata": {
"branch": "master",
"commit_count": 3,
"repo_created_at": "2015-07-26T11:16:01.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "ee78eae906... |
00446f50-01da-4213-b404-70f99b3d1188 | coolyuyuyu/leetcode | algorithm_1000-1999/1681-Minimum Incompatibility/main.cpp | class Solution {
public:
int byDFS(vector<int>& nums, int k) {
int n = nums.size();
std::sort(nums.begin(), nums.end());
int ret = INT_MAX;
vector<bool> visited(n, false);
std::function<void(int, int, int, int, int)> dfs = [&](int prev, int cnt, int sum, int mn, int mx) {
... | ALGO | 0.999959 | 5.431869 | {
"github_metadata": {
"branch": "master",
"commit_count": 4422,
"repo_created_at": "2017-03-26T16:52: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": "dc1609b... |
a804e419-4052-4c01-b0aa-53cc8dac2717 | willthbill/cp-library | src/data-structures/temmie-segtree/main.cpp | // https://codeforces.com/contest/1567/submission/127969832
// thanks to temmie
template <typename node> class Segtree {
public:
int size, n_size;
std::vector <node> v;
Segtree(int _size) :
n_size(_size)
{
assert(_size > 0);
size = 1;
while (size < _size) {
size <<= 1;
}
v.resize(size << 1, nod... | ALGO | 0.999922 | 5.342305 | {
"github_metadata": {
"branch": "main",
"commit_count": 198,
"repo_created_at": "2020-10-14T10:47:40.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "8c8a98c0df... |
16b60d00-8ecb-4eb4-a1fa-408a6519c0a7 | omkar-kashid/Problems | Capacity To Ship Packages Within D Days - GFG/capacity-to-ship-packages-within-d-days.cpp | //{ Driver Code Starts
#include <bits/stdc++.h>
using namespace std;
// } Driver Code Ends
//User function Template for C++
class Solution {
public:
bool capacity(int arr[], int day, int cap, int n){
int TotalDaysRequired = 1;
int currentWeight = 0;
for(int i=0; i<n; i++){
... | ALGO | 0.999968 | 5.52997 | {
"github_metadata": {
"branch": "main",
"commit_count": 396,
"repo_created_at": "2023-03-26T11:18: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": "ecd6e42122... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.