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 |
|---|---|---|---|---|---|---|---|
07165f31-a952-4ba7-8c73-5028775dd4aa | KUMARSANDIPROY/leetcode | Merge two sorted linked lists - GFG/merge-two-sorted-linked-lists.cpp | // { Driver Code Starts
#include<iostream>
using namespace std;
/* Link list Node */
struct Node
{
int data;
struct Node *next;
Node(int x)
{
data = x;
next = NULL;
}
};
Node* sortedMerge(struct Node* a, struct Node* b);
/* Function to print Nodes in a given linked list */
vo... | ALGO | 0.999914 | 4.924325 | {
"github_metadata": {
"branch": "main",
"commit_count": 1366,
"repo_created_at": "2022-01-06T15:31: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": "b2fd07595... |
96897911-40db-4dc4-aa93-41f61dfb20ae | genxium/Leetcode | p410_Split_Array_Largest_Sum/submission_recursive_slow.cpp | #define larger(x, y) x > y ? x : y
#define smaller(x, y) x < y ? x : y
#define MAXN 1000
#define MAXM 50
#define INVALID -1
int cache[MAXM+1][MAXN+1]; // "cache[groupIndex][groupElementStartIndexInArray] == x" means that using array[groupElementStartIndexInArray...] to form the rest "m-groupIndex" groups results in "mi... | ALGO | 0.999986 | 5.087777 | {
"github_metadata": {
"branch": "master",
"commit_count": 510,
"repo_created_at": "2020-05-05T14:53:48.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 5,
"forks": 4,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "cfd0a437... |
e9e5dcfd-3c13-40dc-8468-aa03e468f30e | Ahmed-Arafat10/Data-Security-Course | Polyalphabetic_Cipher.cpp | #include <bits/stdc++.h>
typedef long long ll;
using namespace std;
string ToLowChar(string str, ll sz)
{
for(ll i = 0; i<sz; i++) str[i] = tolower(str[i]);
return str;
}
void Encryption(ll __P,ll __C)
{
ll __X = __P + __C;
char __R = 'a'+ (__X % 26);
cout<<__R;
}
string Decryption(ll __P,ll __C)
{
... | ALGO | 0.999919 | 4.024636 | {
"github_metadata": {
"branch": "main",
"commit_count": 48,
"repo_created_at": "2021-11-07T15: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": "8d38fadfdab... |
afe7a0b7-05c8-4840-b715-b085cab4f23d | openvinotoolkit/openvino | src/core/reference/include/openvino/reference/embedding_segments_sum.hpp | // Copyright (C) 2018-2025 Intel Corporation
// SPDX-License-Identifier: Apache-2.0
//
#pragma once
#include "openvino/core/shape.hpp"
namespace ov {
namespace reference {
template <typename T, typename U>
void embeddingSegmentsSum(const T* embTable,
const U* indices,
... | ALGO | 0.996401 | 6.451494 | {
"github_metadata": {
"branch": "master",
"commit_count": 19551,
"repo_created_at": "2018-10-15T10:54:40.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 8597,
"forks": 2656,
"issues": 303,
"pull_requests": 258
},
"file_meta": {
"content_id"... |
52e441f3-8645-4b08-ac85-c9449d021c8e | Freepacer/Cpp | [Medium] 1038. Binary Search Tree to Greater Sum Tree.cpp | /*
Given the root of a binary search tree with distinct values, modify it so that every node has a new value equal to the sum of the values of the original tree that are greater than or equal to node.val.
As a reminder, a binary search tree is a tree that satisfies these constraints:
The left subtree of a node contai... | ALGO | 0.999994 | 5.935197 | {
"github_metadata": {
"branch": "LeetCode",
"commit_count": 87,
"repo_created_at": "2019-04-01T19:31:52.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 1
},
"file_meta": {
"content_id": "6ea650e... |
2a85164b-fb3e-4040-b321-da5753ba2088 | Boladar/AISD | 2/Drzewa/main.cpp | //
// main.cpp
// Drzewa
//
// Created by <NAME> on 06/04/2019.
// Copyright © 2019 <NAME>. All rights reserved.
//
#include <iostream>
#include <cstdlib>
#include <ctime>
#include <vector>
#include <cstdlib>
#include <fstream>
using namespace std;
void GenerujTablice(int tab[],int n)
{
int wylosowana;
bo... | ALGO | 0.99921 | 4.123734 | {
"github_metadata": {
"branch": "master",
"commit_count": 51,
"repo_created_at": "2019-03-17T10:15: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": "02b23824c... |
80c3b21c-ec8f-4969-8c54-fc05783608a5 | alyHusseinn/CPP_projects | Single files/Iteratros_vectors_data_structure_examples_STL.cpp | // Fig. 15.11: fig15_15.cpp
// Testing Standard Library vector class template
// element-manipulation functions.
#include <iostream>
#include <vector> // vector class-template definition
#include <algorithm> // copy algorithm
#include <iterator> // ostream_iterator iterator
#include <stdexcept> // out_of_range exceptio... | TEST | 0.954228 | 5.647007 | {
"github_metadata": {
"branch": "main",
"commit_count": 2,
"repo_created_at": "2023-09-04T07:32: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": "edda8673cae8... |
0772719a-3d7a-42d1-89a8-3b2df6a10497 | ManhNDd/CTFwriteup | whitehat-grandprix-2017/Re/Bfgap/a.cpp | #include <iostream>
#include <vector>
#include <algorithm>
#include <array>
#include <set>
#include <map>
#include <queue>
#include <tuple>
#include <unordered_set>
#include <unordered_map>
#include <functional>
#include <cassert>
#define repeat(i, n) for (int i = 0; (i) < int(n); ++(i))
#define repeat_from(i, m, n) fo... | ALGO | 0.999164 | 4.466492 | {
"github_metadata": {
"branch": "master",
"commit_count": 51,
"repo_created_at": "2017-02-23T11:57: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": "843a782b2... |
642c4e76-3bb9-408b-bf4e-d46007757e26 | Nikolaus1997/Forschungsmodul | src/dg/num_flux.cpp | #include "num_flux.h"
// Set the numerical flux function type
void NumericalFlux::setNumFluxFunction(FunctionType type)
{
selectedFunction = type;
}
// Compute the numerical flux based on the selected function
double NumericalFlux::computeNumFlux(double u_l, double u_r,Flux flux_, double dt, double meshWidth)
{... | ALGO | 0.998725 | 6.192659 | {
"github_metadata": {
"branch": "LDGPorousMedium",
"commit_count": 88,
"repo_created_at": "2024-11-16T14:46:49.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "... |
cabe2ee9-b9fa-43cc-ba60-cbe48100827b | manu-ravi-official/manuravi | assignment/sum of two matrices.cpp | //program for finding sum of two matrices
#include<iostream>
using namespace std;
void sum(int, int);
int main(){
int row, col;
cout<<"Enter the number of rows :";
cin>>row;
cout<<"Enter the number of column :";
cin>>col;
sum(row, col);
return 0;
}
void sum(int r, int c){
int m1[r][c], m2[r][c... | ALGO | 0.999352 | 4.416863 | {
"github_metadata": {
"branch": "master",
"commit_count": 29,
"repo_created_at": "2019-06-19T03:59:17.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "717fe47ff... |
6820eb4d-c934-44bd-ad06-6d49ae181c03 | Yallaswamy/gfg_solved | Medium/Number of Unique Paths/number-of-unique-paths.cpp | //{ Driver Code Starts
//Initial template for C++
#include<bits/stdc++.h>
using namespace std;
// } Driver Code Ends
//User function template in C++
class Solution
{
public:
//Function to find total number of unique paths.
int dp[17][17];
int slove(int i,int j,int r,int c){
if(i<0 || j<0 || i>... | ALGO | 0.999895 | 5.787068 | {
"github_metadata": {
"branch": "main",
"commit_count": 605,
"repo_created_at": "2023-09-12T14:11:47.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "70c25cf5c0... |
3e2261f8-dfa1-4d2f-ae3e-e66e2fc2d925 | aosp-mirror/platform_system_core | property_service/libpropertyinfoparser/property_info_parser.cpp | //
// Copyright (C) 2017 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.986832 | 6.501613 | {
"github_metadata": {
"branch": "main",
"commit_count": 91767,
"repo_created_at": "2008-10-21T18:21:04.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 1219,
"forks": 2244,
"issues": 0,
"pull_requests": 1
},
"file_meta": {
"content_id": "c8a... |
abb4ea0f-e6de-435f-8709-1f1dfb4e662e | 8lacknwhite/Cpp | Untitled2.cpp | #include<iostream>
using namespace std;
int a,nef,i,j,k;
int in[100], p[50];
int h=0, pc=0;
void getData(){
cout<<"Enter the length of page refrence sequence: ";
cin>>a;
cout<<"Enter the page reference sequence:\n";
for(i=0;i<a;i++)
{
cin>>in[i];
}
cout<<endl;
cout<<"Enter... | ALGO | 0.999772 | 3.493363 | {
"github_metadata": {
"branch": "master",
"commit_count": 1,
"repo_created_at": "2023-02-24T03:55: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": "ea59f56190... |
8de60a2a-f53b-4ad0-897a-58c71da61aa7 | FinalTheory/ACM_Code | HDU/HDU_4750.cpp | /**
* @file HDU_4750.cpp
* @brief 并查集题目。
* @hint 比赛的时候已经想到了利用并查集最小生成树的性质,来获得点集从而算出答案;
* 也想到了将询问在线转离线,从而一次遍历得出结果。
* 主要是一些具体的细节没想好,首先是加边的顺序,要满足题目要求f>=t,就得从大到小,
* 但是这样就不满足“最长边中的最小值”这一正确性了。
* 另外就是如何合并集合中元素的顺序,这一点没有想好。
* 后来看了别人题解,对于第一个问题,可以反过来思考,即找出所有满足f<t的数量,用总数减掉就行;
* 第二个问题,将问题看作是处理不同... | ALGO | 0.999959 | 4.178724 | {
"github_metadata": {
"branch": "master",
"commit_count": 44,
"repo_created_at": "2013-04-16T10:51:54.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 4,
"forks": 2,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "24a5f6dbb... |
bd43fb39-40ee-46fd-9100-557211c01790 | Neccolini/atcoder-save | library/Algorithm/Geometry/Point.cpp | /* 幾何ライブラリ */
const double DINF = 1LL<<60; // to be set appropriately
const double EPS = 1e-10; // to be set appropriately
const double PI = acosl(-1.0);
double torad(int deg) {return (double)(deg) * PI / 180;}
double todeg(double ang) {return ang * 180 / PI;}
struct Point {
double x, y;
Point(doub... | ALGO | 0.997965 | 3.857309 | {
"github_metadata": {
"branch": "master",
"commit_count": 6,
"repo_created_at": "2020-11-06T14:06: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": "886adbde75... |
459a1adf-f852-4b99-bb19-d6617951c752 | UNC-Robotics/nigh | src/nigh/impl/near_set.hpp | // Software License Agreement (BSD-3-Clause)
//
// Copyright 2018 The University of North Carolina at Chapel Hill
//
// Redistribution and use in source and binary forms, with or without
// modification, are permitted provided that the following conditions
// are met:
//
// 1. Redistributions of source code must retain... | ALGO | 0.977934 | 7.294374 | {
"github_metadata": {
"branch": "master",
"commit_count": 20,
"repo_created_at": "2018-09-26T23:20:58.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 58,
"forks": 13,
"issues": 2,
"pull_requests": 1
},
"file_meta": {
"content_id": "7a15e32f... |
e306e4d5-25d5-418c-91e7-5a66ce5fd763 | nya3jp/icpc | uva/solved/7/700.cc | /*
* ユークリッドの互除法など
*/
#include <iostream>
#include <algorithm>
#include <utility>
#include <cassert>
using namespace std;
typedef long long int integer;
// 拡張ユークリッド互除法
// a*x + b*y = gcd(a, b)
// となるx, yを求める
void xgcd(integer a, integer b, integer& x, integer& y) {
if (b == 0) {
x = 1;
y = 0;... | ALGO | 0.99956 | 3.525993 | {
"github_metadata": {
"branch": "master",
"commit_count": 5,
"repo_created_at": "2012-05-15T15:59:51.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 4,
"forks": 2,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "99e881549d... |
f366034b-17bb-4a15-99a5-a5f70d4ba2d1 | nerdola-de-cartola/TAP2 | Listas/lista7/i.cpp | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define N 1000001
#define M 1000000007
struct PrimeFactors {
ll x;
ll k;
};
ll primes[N];
bitset<N> isPrime;
PrimeFactors FACTORS[N];
void sieveOfEratosthenes() {
int i, j;
isPrime.set();
for(i = 4; i < N; i += 2)
isPrime[... | ALGO | 0.999868 | 3.915957 | {
"github_metadata": {
"branch": "main",
"commit_count": 13,
"repo_created_at": "2022-11-09T12:51: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": "d61fc90a7ee... |
760bc875-9c1e-4ac0-a802-e9a9cb2f3fd1 | dtkien205/DSA-PTIT | Review/contest/HeThongDien.cpp | #include <bits/stdc++.h>
using namespace std;
#define ll long long
#define endl '\n'
vector<int> adj[10005];
int main()
{
cin.tie(0)->sync_with_stdio(0);
int n, m, h;
cin >> n >> m >> h;
vector<int> power(m);
for (int i = 0; i < m; i++)
cin >> power[i];
for (int i = 0; i < h; i++) {
... | ALGO | 0.99997 | 3.940003 | {
"github_metadata": {
"branch": "master",
"commit_count": 8,
"repo_created_at": "2025-03-05T14:17: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": "fa171512f3... |
9311299b-7d1e-4e2b-aa74-aa8cd4c1d62b | neeshat-sh/CSE-106---DSA-1-Sessional | Offline/Offline 3 Queue/code/Skeleton Code/2205056/QueueLinkedList.h | #include <iostream>
using namespace std;
class Node
{
public:
int data;
Node *next;
Node(int value)
{
data = value;
next = nullptr;
}
Node(int value, Node *nextNode)
{
data = value;
next = nextNode;
}
};
class Queue
{
private:
Node *peekNode; // Po... | ALGO | 0.997441 | 5.160658 | {
"github_metadata": {
"branch": "main",
"commit_count": 1,
"repo_created_at": "2025-03-09T17:18: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": "6fc3196ace1b... |
66162377-11ba-4fde-a2fb-b23488767ad2 | a8hi-patil/Data-Structures-and-Algorithms-with-CPP | 16 Backtracting and Divide and Conquer/13 Word Search.cpp | #include <iostream>
#include <cstdlib>
#include <string>
#include <vector>
using namespace std;
bool solve(vector<vector<char>> &board, string &word, int row, int col, int i)
{
if (i == word.length())
{
return true;
}
if (row < 0 || row >= board.size() || col < 0 || col <= board[0].size() || boa... | ALGO | 0.999874 | 4.75852 | {
"github_metadata": {
"branch": "main",
"commit_count": 43,
"repo_created_at": "2024-07-01T07:15: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": "1307ea3b74b... |
234d2b36-2a54-4f1f-9c1c-761d98f43644 | iluvgirlswithglasses/cpp | vnoj/old-sol/dttui1/knap-greedy.cpp |
/*
superior to my previous submissions
*/
#include <iostream>
#include <algorithm>
#include <vector>
using namespace std;
#define u32 unsigned int
struct item {
u32 w, v;
};
const int N = 40, H = 20;
u32 n, m;
vector<item> a(N), f(1<<H), g(1<<H);
void brute(int l, int r, vector<item> &t) {
int len = r - l, mk =... | ALGO | 0.999992 | 4.068886 | {
"github_metadata": {
"branch": "main",
"commit_count": 646,
"repo_created_at": "2021-09-17T15:27:47.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "957149a120... |
03c2b9fb-e2cc-4c60-badf-116da62ee6dd | sangvirgo/algorithm | Thuat toan thi dau/Basic Number Theory/Ham So Hoc/*SumofDivisors.cpp | #include <iostream>
using namespace std;
// https://www.geeksforgeeks.org/sum-divisors-1-n/
#define ll long long
#define mod 1000000007
// Hàm tính lũy thừa x^y với mô đun p
ll power(ll x, ll y, ll p)
{
ll res = 1;
x = x % p;
while (y > 0)
{
if (y & 1)
res = (res * x) % p;
y... | ALGO | 0.999955 | 4.987684 | {
"github_metadata": {
"branch": "master",
"commit_count": 130,
"repo_created_at": "2023-11-20T15:45:19.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 3,
"forks": 1,
"issues": 0,
"pull_requests": 1
},
"file_meta": {
"content_id": "721cc5a9... |
70f2084e-81cc-43e0-beab-7dbf63fafe76 | mengarena/Leetcode | com/leet_cpp/VerifyingAnAlienDictionary.cpp | /*
953. Verifying an Alien Dictionary
In an alien language, surprisingly they also use english lowercase letters, but possibly in a different order.
The order of the alphabet is some permutation of lowercase letters.
Given a sequence of words written in the alien language, and the order of the alphabet,
return tru... | ALGO | 0.999979 | 6.08867 | {
"github_metadata": {
"branch": "master",
"commit_count": 1022,
"repo_created_at": "2016-10-29T01:06: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": "1355f83... |
043a4ad4-78d5-4cf1-b81e-03cd3733fde5 | its-rittik/Algorithm | Greedy/knapsack.cpp | #include <iostream>
using namespace std;
int main() {
int weights[] = {20, 10, 15, 10, 5};
int values[] = {100, 60, 70, 40, 80};
int capacity = 50;
int n = sizeof(weights) / sizeof(weights[0]);
int valueperweight[n];
for (int i = 0; i < n; i++)
valueperweight[i] = values[i] / weights[... | ALGO | 0.999982 | 4.081247 | {
"github_metadata": {
"branch": "main",
"commit_count": 57,
"repo_created_at": "2024-02-29T01:18: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": "978b1f4eb0a... |
a134e112-d136-40c0-94ee-9dfb3ccf54ac | antipinaanna/setcover | main.cpp | #include <iostream>
#include <vector>
#include <set>
#include <algorithm>
#include <sstream>
#include <fstream>
#include <filesystem>
namespace fs = std::filesystem;
struct Set {
std::set<int> elements;
int index;
int cost;
};
struct Result {
int totalCost;
std::vector<bool> includedSets;
};
Res... | ALGO | 0.990154 | 4.968645 | {
"github_metadata": {
"branch": "main",
"commit_count": 2,
"repo_created_at": "2023-09-13T08:31: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": "d940ff7b62c8... |
327ffa0d-32e8-4814-8723-e04aade0e59b | DevFLeo/Estudos | Dio/Dio Curso em C-Cpp/Desafio-Dio 3/5-3.cpp | #include <iostream>
#include <string>
using namespace std;
enum Naipe {
Paus = 0, Ouros = 1, Copas = 2, Espadas = 3
};
enum Valor {
As = 1, Valete = 2, Dama = 3, Rei = 4
};
// Função para converter o valor de "Valor" para string
string valorParaString(Valor v) {
switch (v) {
case As: return "Ás";
case... | TOOL | 0.996091 | 4.515478 | {
"github_metadata": {
"branch": "main",
"commit_count": 40,
"repo_created_at": "2024-11-07T16:15: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": "d29171e4e6a... |
e739c9aa-80de-4a20-a0bf-18617118dbf0 | maryialejandra/CursoFCII_UdeA-2020-2 | Documentos/Parcial1/CC1036666894/punto_2/craps/craps.cpp | #include <iostream>
#include <iomanip>
#include <ctime>
#include <cmath>
#include <cstdlib>
using namespace std;
int tirarDados(){
int dado1 = 0;
int dado2 = 0;
int resultado = 0;
dado1 = 1 + rand()%6;
dado2 = 1 + rand()%6;
resultado = dado1 + dado2;
return resultado;
}
int main(){
srand(time... | ALGO | 0.961487 | 4.016402 | {
"github_metadata": {
"branch": "master",
"commit_count": 616,
"repo_created_at": "2020-08-20T13:35:51.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 22,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "11df9c9... |
72e09c9e-2620-4c5d-86d8-ea90c68be297 | mrkimkim/csi | kakao 2019/kim/candidate.cpp | #include <bits/stdc++.h>
using namespace std;
bool isKey(int cur, int R, int C, vector<vector<string>>& relation){
unordered_set<string> rows;
for(int i = 0 ; i < R ; ++i){
string s;
for(int j = 0 ; j < C; ++j){
if(cur & (1<<j)){
s += relation[i][j];
}
... | ALGO | 0.999776 | 5.288631 | {
"github_metadata": {
"branch": "master",
"commit_count": 23,
"repo_created_at": "2020-08-30T03:06: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": "fd9d00530... |
eb224862-7067-4d17-804b-d70c44362761 | bilal2vec/assignments | CS343/a2/q3.cc | #include <iostream>
using namespace std;
static volatile long int shared = 0; // volatile to prevent dead-code removal
static intmax_t iterations = 500000000;
_Task increment {
void main() {
for ( decltype(iterations) i = 0; i < iterations; i += 1 ) {
shared += 1; // multiple increments to increase p... | ALGO | 0.9983 | 5.507691 | {
"github_metadata": {
"branch": "main",
"commit_count": 76,
"repo_created_at": "2023-02-17T20:30:41.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 5,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "c50b41864ad... |
b1f8f1da-8c34-4ea6-907c-14df0a54611d | Pranshu321/Codes | Apna College Sheet/Searching_Sorting/Minimum_Swaps_for_same.cpp | #include <bits/stdc++.h>
using namespace std;
#define int long long
int minSwaps(int a[], int n)
{
pair<int, int> arr[n];
for (int i = 0; i < n; i++)
{
arr[i].first = a[i];
arr[i].second = i;
}
sort(arr, arr + n);
int ans = 0;
vector<bool> vis(n, 0);
for (int i = 0; i ... | ALGO | 0.99999 | 4.852597 | {
"github_metadata": {
"branch": "master",
"commit_count": 93,
"repo_created_at": "2021-10-07T07:59:18.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 3,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "458583c00... |
d53e16fb-134d-4440-8713-e45328982b5e | SBKarr/stappler | components/common/utils/search/SPSearchUrl.cc | /**
Copyright (c) 2020 <NAME> <<EMAIL>>
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribut... | TOOL | 0.957921 | 5.644016 | {
"github_metadata": {
"branch": "master",
"commit_count": 321,
"repo_created_at": "2015-09-12T11:16:09.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 7,
"forks": 3,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "82a2b469... |
5d34bcf4-873d-4ea7-ab6b-96d9bc7f8269 | NurMuhammadCSE/SWE-I-Interview-Problems | Binary Search/First-Last-Position.cpp | #include<bits/stdc++.h>
using namespace std;
class Solution {
public:
vector<int> searchRange(vector<int>& nums, int target) {
int first = -1, last = -1;
for (int i = 0; i < nums.size(); i++) {
if (nums[i] == target) {
if (first == -1) {
first = i;
... | ALGO | 0.999985 | 6.580859 | {
"github_metadata": {
"branch": "main",
"commit_count": 79,
"repo_created_at": "2025-03-01T17:18: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": "6a23023af2d... |
382922e2-865c-4876-8142-f376ee4e0150 | Azrul16/Codeforces | C_Premutation.cpp | //Aurthor:- <NAME>
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
//Definition Section
//--------------------------------------------------------------
#define fl(i,x,y) for(i=x; i<y; i++)
#define flc(i,x,y,z) for(i=x; i<y; i+=z)
#define nl cout<<endl;
#define YES cout<<"YES";
#define NO cout<<"NO... | ALGO | 0.99915 | 3.703932 | {
"github_metadata": {
"branch": "main",
"commit_count": 119,
"repo_created_at": "2022-12-04T05:34:03.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 1
},
"file_meta": {
"content_id": "669f819cc1... |
6bc86f95-8f88-477d-899d-0ebf604109f6 | kimthienlang/Algorithm | 21.MergeTwoSortedLists.cpp | #include <bits/stdc++.h>
using namespace std;
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) {}
};
ListNode* mergeTwoLists(ListNode* list1, ListNode* list2) {
List... | ALGO | 0.999975 | 5.894909 | {
"github_metadata": {
"branch": "main",
"commit_count": 120,
"repo_created_at": "2024-04-17T11:12: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": "3838805e86... |
26bcc86a-bbab-4f71-a971-6b1bfaee85a0 | MasterMind90/cppractice | codeforces/1426/D.cpp | #ifndef LOCAL
#pragma GCC optimize("Ofast")
#pragma GCC target("avx,avx2,fma")
#pragma GCC optimization ("unroll-loops")
#endif
#include "bits/stdc++.h"
#include <ext/pb_ds/assoc_container.hpp> // Common file
#include <ext/pb_ds/tree_policy.hpp> // Including tree_order_statistics_node_update
#include <ext/pb_ds/detail/... | ALGO | 0.99995 | 4.568805 | {
"github_metadata": {
"branch": "master",
"commit_count": 1713,
"repo_created_at": "2021-01-12T19:00:54.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "8420bce... |
d37e3609-3cf9-448e-94a3-b2b992361552 | GarageGames/Torque3D | Engine/lib/opcode/OPC_AABBCollider.h | ///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
/*
* OPCODE - Optimized Collision Detection
* Copyright (C) 2001 <NAME>
* Homepage: http://www.codercorner.com/Opcode... | ALGO | 0.996786 | 6.974671 | {
"github_metadata": {
"branch": "development",
"commit_count": 3540,
"repo_created_at": "2012-09-18T20:33:56.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 3358,
"forks": 1193,
"issues": 309,
"pull_requests": 64
},
"file_meta": {
"content_... |
8cb0d3eb-ac06-49b0-a25e-6f6a2974240c | ryan-fauder/Number-Theory | Modular/Arithmetic/modular-arithmetic.cpp | #include "modular-arithmetic.hpp"
#include "gcd-euclidian.hpp"
#include <iostream>
#include <vector>
namespace modularClass{
int number = 1;
void setNumber(int n){
number = n;
}
int getNumber(){
return number;
}
};
int sumModular(int a, int b){
return (a + b) % modularClass::number;
}
int multiply... | ALGO | 0.999655 | 5.242819 | {
"github_metadata": {
"branch": "master",
"commit_count": 22,
"repo_created_at": "2021-09-01T01:44: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": "1119a45fd... |
4ce6e65a-9ea4-4f8f-b80a-417e6d61fc47 | Kazuha-Li/LeetCode | Cpp/1486_XOR_Operation_in_an_Array.cpp | /*
https://leetcode.com/problems/xor-operation-in-an-array/
Given an integer n and an integer start.
Define an array nums where nums[i] = start + 2*i (0-indexed) and n == nums.length.
Return the bitwise XOR of all elements of nums.
Example 1:
Input: n = 5, start = 0
Output: 8
Explanation: Array nums is equal to ... | ALGO | 0.999905 | 5.861278 | {
"github_metadata": {
"branch": "master",
"commit_count": 173,
"repo_created_at": "2020-04-25T06:39: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": "dee781d3... |
c604d1a1-624a-4baa-ae79-7905caeb0bf3 | mabbamOG/alg-max_array_sum | main.cpp |
#include <iostream>
#include <stdlib.h>//i chose the standard c library 'cuz the c++ <cmath> used std::abs which was primarily made for floats which i dont use, plus it's slower
#include <bitset>
///PRINT ARRAY, FOR DEBUG -- programmer reference
/*
std::cout<<" ( ";
for (int w = 0; w <= n; w++) { std::cout<<s[w]<... | ALGO | 0.999959 | 3.956888 | {
"github_metadata": {
"branch": "master",
"commit_count": 9,
"repo_created_at": "2018-08-26T23: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": "c411ce3cc1... |
7b5672fc-8472-46a1-9c48-cd59836e0c13 | UjjwalSingh171/GEEKS_for_GEEKS_solutions | Difficulty: Easy/Swap and Maximize/swap-and-maximize.cpp | //{ Driver Code Starts
#include <bits/stdc++.h>
using namespace std;
// long long int maxSum(int arr[], int n);
// } Driver Code Ends
class Solution {
public:
long long maxSum(vector<int>& arr) {
// code here
int n = arr.size();
// Sort the array to prepare for alternating pattern
... | ALGO | 0.998495 | 6.188328 | {
"github_metadata": {
"branch": "main",
"commit_count": 107,
"repo_created_at": "2024-09-22T09:20: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": "d26a0c98f6... |
95089ba3-dc65-4661-87d6-f4c7e5874fd2 | Aayush2492/Codeforces-Problems | Live/07-09-2023/C.cpp | #include <bits/stdc++.h>
using namespace std;
using LLI = long long int;
template <typename T>
using VEC = vector<T>;
template <typename T>
using VV = VEC<VEC<T>>;
using PII = pair<int, int>;
int get_nearest_multiple_4(int n)
{
int rem = n % 4;
if (rem == 0)
{
return n;
}
else if (rem =... | ALGO | 0.999931 | 4.173953 | {
"github_metadata": {
"branch": "main",
"commit_count": 2,
"repo_created_at": "2024-05-23T14:45: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": "7ca8e1112b79... |
2a6ca62e-82ef-42e6-bd48-72aed6ba5717 | hqztrue/LeetCodeSolutions | 0701-0800/715. Range Module 112ms_RBtree.cpp | const int N=2005,inf=~0u>>1;
struct RBtree{
#define black 0
#define red 1
struct node{
node *l,*r,*p;
int key,key1,size; int col;
void update(){
size=l->size+r->size+1;
}
};
node a[N];
int len;node *root,*null;
void clear(){
len=0;root=null=newnode(0,0);
null->l=null->r=null->p=null;
null->size=... | ALGO | 0.999798 | 3.957798 | {
"github_metadata": {
"branch": "master",
"commit_count": 292,
"repo_created_at": "2019-05-13T09:30:01.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 390,
"forks": 46,
"issues": 1,
"pull_requests": 0
},
"file_meta": {
"content_id": "451d7... |
712caf6a-0cf6-42e0-b002-89d2f413f122 | AnjaliG1999/DSA | cpp/arrays/keyInSegment.cpp | #include <bits/stdc++.h>
using namespace std;
int isPresent(int arr[], int k, int x, int n){
int i = 0;
while(i < n/k){
int j = 0;
while(j < k){
if(arr[k*i+j] == x)
break;
j++;
}
if(j == k)
return false;
i++;
}
... | ALGO | 0.999888 | 5.088762 | {
"github_metadata": {
"branch": "master",
"commit_count": 71,
"repo_created_at": "2020-06-28T12:16: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": "93d2bd6ba... |
fa8d5e9c-dc5b-437f-952e-aa38e240162e | pranavbajaj/Lidar-Obstacle-Detection | src/quiz/cluster/kdtree.h | /* \author <NAME> */
// Quiz on implementing kd tree
#include "../../render/render.h"
#include<math.h>
// Structure to represent node of kd tree
struct Node
{
std::vector<float> point;
int id;
Node* left;
Node* right;
Node(std::vector<float> arr, int setId)
: point(arr), id(setId), left(NULL), right(NULL)
{}
... | ALGO | 0.999179 | 4.675052 | {
"github_metadata": {
"branch": "master",
"commit_count": 35,
"repo_created_at": "2020-05-05T10: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": "e1eeaf0ae... |
e23af06b-41ea-4417-adbc-1caf052cd69b | alexandraback/datacollection | solutions_1485488_0/C++/natsugiri/B_2.cpp | #include<cstdio>
#include<iostream>
#include<string>
#include<vector>
#include<algorithm>
#include<cstring>
#include<queue>
using namespace std;
struct EDGE_T{
int x, y;
int t;
EDGE_T(int x, int y, double t):x(x), y(y), t(t){};
};
bool operator<(EDGE_T a, EDGE_T b){
return a.t>b.t;
}
int dx[]={1, 0, -1, 0},... | ALGO | 0.99903 | 3.367245 | {
"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": "87b3fe128... |
7b8af650-9b38-497b-8db8-ab060cf90d6e | Atul0607/StriversSheetChallenge | Array/MergeSortedArray.cpp | class Solution {
public:
void merge(vector<int>& nums1, int m, vector<int>& nums2, int n) {
int a=0,b=0;
vector<int> temp;
for(int i=0;i<m;i++){
temp.push_back(nums1[i]);
}
for(int i=0;i<m+n;i++){
if(a!=m && b!=n){
if(temp[a] <= nums2[b... | ALGO | 0.999992 | 5.717731 | {
"github_metadata": {
"branch": "master",
"commit_count": 4,
"repo_created_at": "2023-06-04T06:05: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": "5a760d0783... |
f7e85441-afe0-43ac-b0bf-1bc976ea7c11 | xocaslou/UAS_BPD_LaporanPembelianTiket | BPD_UAS_06/BPD_UAS_06.cpp | // BPD_UAS_06.cpp : This file contains the 'main' function. Program execution begins and ends there.
//
/*
Nama : <NAME>
NIM : 202004560006
Tujuan : Membuat program peng-inputan data laporan pembelian tiket
*/
#include <iostream>
#include <string>
#include <string.h>
#include <stdio.h>
using namespace std;
struc... | DATA | 0.957436 | 4.206827 | {
"github_metadata": {
"branch": "main",
"commit_count": 1,
"repo_created_at": "2022-12-18T16:11: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": "94b8a8ec0ca5... |
12602b92-e512-4b6b-96ed-e74269e0c1c5 | Yawn-Sean/Daily_CF_Problems | daily_problems/2024/08/0830/personal_submission/cf1176f_yawn_sean.cpp | #include <bits/stdc++.h>
// #pragma GCC optimize("O3,Ofast,unroll-loops")
// #include <bits/extc++.h>
// using namespace __gnu_cxx;
// using namespace __gnu_pbds;
using namespace std;
signed main()
{
ios_base::sync_with_stdio(false);
cin.tie(0);
cout.tie(0);
int n;
cin >> n;
long long inf = 1... | ALGO | 0.998988 | 3.851577 | {
"github_metadata": {
"branch": "main",
"commit_count": 20410,
"repo_created_at": "2024-02-26T01:04:08.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 478,
"forks": 302,
"issues": 0,
"pull_requests": 7
},
"file_meta": {
"content_id": "ab93... |
f19d611b-dd71-4075-be22-2e9a6e57c424 | llynv/CP-files | 578708B.cpp | /*
Code by: linvg
Created: 05.01.2025 18:57:12
*/
#include <bits/stdc++.h>
using namespace std;
#define int long long
#define all(x) (x).begin(), (x).end()
#define sz(x) ((int)(x).size())
string to_upper(string a) { for (int i = 0;i < (int)a.size();++i) if (a[i] >= 'a' && a[i] <= 'z') a[i] -= 'a' - 'A'; return a;... | ALGO | 0.99997 | 4.761911 | {
"github_metadata": {
"branch": "main",
"commit_count": 16,
"repo_created_at": "2023-05-26T04:12:11.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "1bbbe10b84d... |
58a96b0a-724e-4b11-aa5d-284dc945316c | TooLate0800/fitter_study | generator/RobustGenerator.cxx | #include <fstream>
#include <iostream>
#include "TF1.h"
#include "TMath.h"
#include "TRandom.h"
const double Mp = 938.272046;
const double tofm = 25.68189504;
Double_t GetExpectedEnergy( float Eb, float t)
{
/*Given the beam energy in MeV, and scattering angle theta in deg, calculate the
expected scattering... | ALGO | 0.970122 | 3.945357 | {
"github_metadata": {
"branch": "main",
"commit_count": 8,
"repo_created_at": "2020-12-09T21:13:27.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "0ab88b5f6bb9... |
9f75863c-f949-4839-90ac-a78973b3cde1 | aj-talaei/Algorithmic-Playground | LeetCode/distinct_subsequences/distinct_subsequences.cpp | // Source: https://leetcode.com/problems/distinct-subsequences/
// Description: Given strings S and T, count how many distinct subsequences of S equal T.
#include <string>
#include <vector>
class Solution {
public:
int numDistinct(const std::string& S, const std::string& T) {
int n = S.size(), m = T.size(... | ALGO | 0.99998 | 7.117614 | {
"github_metadata": {
"branch": "main",
"commit_count": 103,
"repo_created_at": "2025-04-28T01:15: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": "242dcdfe9b... |
14d95b9a-6ed6-4b1e-bc52-c0b78c06053f | matplotlib/matplotlib | extern/agg24-svn/include/agg_trans_perspective.h | //----------------------------------------------------------------------------
// Anti-Grain Geometry - Version 2.4
// Copyright (C) 2002-2005 <NAME> (http://www.antigrain.com)
//
// Permission to copy, use, modify, sell and distribute this software
// is granted provided this copyright notice appears in all copies.
... | ALGO | 0.992872 | 6.386942 | {
"github_metadata": {
"branch": "main",
"commit_count": 52759,
"repo_created_at": "2011-02-19T03:17:12.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 21441,
"forks": 7928,
"issues": 1241,
"pull_requests": 419
},
"file_meta": {
"content_id"... |
423ad2a6-798a-436a-bf7e-f6279f66e298 | SVladimir20/Lesson-6 | 2.cpp | #include <iostream>
#include <cstdlib>
using namespace std;
void PointerA(const size_t D1, const size_t D2, int **pA);
void FilFunc(const size_t D1, const size_t D2, int **pA);
int main()
{
const size_t D1 = 4;
const size_t D2 = 4;
int **pA = new int *[D1];
PointerA(D1, D2, pA);
FilFunc(D1, D2, pA);
for (size_t i... | TOOL | 0.908851 | 3.813385 | {
"github_metadata": {
"branch": "master",
"commit_count": 3,
"repo_created_at": "2021-05-20T14:25: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": "b39e0e2fc7... |
556f13b5-8d35-4551-a6c9-3625750a94da | brandonpelfrey/Construct | construct/ConstructGrid.h | #ifndef ConstructGrid_h
#define ConstructGrid_h
#include "construct/ConstructField.h"
#include "construct/ConstructDomain.h"
#include <iostream>
namespace Construct {
template<typename T>
struct ConstructGrid : public ConstructFieldNode<T> {
//! Domain definition for this grid
Domain domain;
//! The field which sh... | ALGO | 0.949027 | 5.786023 | {
"github_metadata": {
"branch": "master",
"commit_count": 41,
"repo_created_at": "2012-07-11T04:51:42.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 74,
"forks": 7,
"issues": 0,
"pull_requests": 1
},
"file_meta": {
"content_id": "c15fe87c... |
0f730746-e8d3-4639-abe9-c85562163dec | kosnoa/Algorithm-Study | Others/13023.cc | /* Code By kosnoa
GitHub : kosnoa */
#pragma GCC optimize("Ofast")
#pragma GCC("unroll-loops")
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef unsigned long long llu;
int n, k;
vector<vector<int>> v(2005);
vector<bool> check(2005);
bool ans;
void dfs(int depth, int x)
{
check[x] = true... | ALGO | 0.999966 | 4.206089 | {
"github_metadata": {
"branch": "main",
"commit_count": 164,
"repo_created_at": "2022-06-10T09:38:11.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "e6dc77ac8a... |
f7f6d25f-dcbf-4653-812d-a62eea56feb4 | scale-snu/IDT | experiments/workloads/SPEC/app/631.deepsjeng_s/build/build_base_gcc-baseline-o2-m64.0000/utils.cpp | /*
Sjeng - a chess playing program
Copyright (C) 2000-2008 <NAME>
File: utils.c
Purpose: misc. functions used throughout the program
*/
#include "config.h"
#include "sjeng.h"
#include "extvars.h"
#include "bitboard.h"
#include "ttable.h"
#include "board.h"
#include "... | TOOL | 0.982512 | 4.765942 | {
"github_metadata": {
"branch": "master",
"commit_count": 6,
"repo_created_at": "2024-04-08T06:31:53.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 3,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "52dc372af13... |
91a29d53-3eb8-4215-98df-ba6f9b949947 | AshrafRahul/HackerRank | Phitron/Semester_2/Data_structure/8_remove_duplicate.cpp | #include<bits/stdc++.h>
using namespace std;
class Node {
public:
int val;
Node* next;
Node(int val) {
this->val = val;
this->next = NULL;
}
};
void insert_tail(Node* &head, Node* &tail, int val) {
Node* newNode = new Node(val);
if(head==NULL) {
head = newNo... | ALGO | 0.999779 | 4.425913 | {
"github_metadata": {
"branch": "main",
"commit_count": 29,
"repo_created_at": "2023-07-09T11:24:17.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "724cd6bb670... |
b77ef692-a188-4483-a214-3765c8aa9a08 | ImnIrdst/ICPC-Practice-2015-TiZii | UVa/Comptitive Programming/Ch-01 Ad Hoc/CP1/UVa 10528 - Major Scales - AC.cpp | #include <iostream>
#include <string>
#include <cstring>
#include <sstream>
using namespace std;
string notes[] = {"C", "C#", "D", "D#", "E", "F", "F#", "G", "G#", "A", "A#", "B" };
bool possible[12][12]={0}, played[12]={0};
void init(){
for (int i = 0; i < 12; ++i){
possible[i][i] =
possible[i][(... | ALGO | 0.996014 | 3.975391 | {
"github_metadata": {
"branch": "master",
"commit_count": 44,
"repo_created_at": "2016-04-08T04:18: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": "e15356367... |
73381398-32f1-4546-a33d-f151cbad123f | Konishi2911/lalib | include/lalib/solver/tri_diag.hpp | #pragma once
#ifndef LALIB_SOLVER_TRIDIAG_HPP
#define LALIB_SOLVER_TRIDIAG_HPP
#include "lalib/mat.hpp"
#include "lalib/vec.hpp"
#include "lalib/type_traits.hpp"
#include <concepts>
#include <vector>
#include <utility>
#if defined(LALIB_LAPACK_BACKEND)
#include "lapack/gtsv.hpp"
#else
#include "internal/tdma.hpp"
#e... | ALGO | 0.989635 | 6.411601 | {
"github_metadata": {
"branch": "main",
"commit_count": 160,
"repo_created_at": "2023-12-11T09:17: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": "4ca0a21069... |
e5c7e36a-661c-4160-8f4e-30b15c742c18 | daoxuandong/Code | kruskal.cpp | #include<iostream>
#define MAX 100
using namespace std;
typedef struct{
int dau, cuoi, c;
} edge;
class graph{
int n, A[MAX][MAX], chuaxet[MAX], ne, AT[MAX][MAX], neT, dH;
edge G[MAX], T[MAX];
public:
void readdata();
void bubblesort();
void init(){ for(int i=1; i<=n; ... | ALGO | 0.999984 | 3.154716 | {
"github_metadata": {
"branch": "main",
"commit_count": 54,
"repo_created_at": "2021-09-14T13:24: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": "53a81163b88... |
fd23f0c5-a307-4c7f-99fb-ed2ba84a93d6 | H-Shen/My_Code_Collection | Luogu/P6426.cpp | #include <bits/extc++.h>
using namespace std;
using namespace __gnu_pbds;
constexpr int MAXN = 3;
namespace IO {
template<typename T>
inline
void read(T &t) {
int n = 0;
int c = getchar_unlocked();
t = 0;
while (!isdigit(c)) n |= c == '-', c = getchar_unlocked();
w... | ALGO | 0.999858 | 4.143367 | {
"github_metadata": {
"branch": "master",
"commit_count": 1586,
"repo_created_at": "2019-04-11T06:48:09.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "1e7fdcc... |
299a479c-dc55-4104-83a9-4a1d98d20307 | tdivyanshu99/daily-leetcode-problems | day5/heaps.cpp | //@kakovic
#include <bits/stdc++.h>
using namespace std;
#define fastIO ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL);
#define endl '\n'
#define pb push_back
#define all(v) v.begin(),v.end()
#define forn(i, a, n) for (int i = a; i < int(n); ++i)
typedef long long ll;
typedef pair<ll,ll> pll;
typedef m... | ALGO | 0.999951 | 4.223802 | {
"github_metadata": {
"branch": "master",
"commit_count": 10,
"repo_created_at": "2022-03-25T21:39:27.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "dc172de2d... |
5768dc91-5a34-498a-bcc8-b8c5c37e4774 | aj4941/Algorithm | 백준/Silver/14940. 쉬운 최단거리/쉬운 최단거리.cc | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef vector<vector<ll>> vll;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;
typedef pair<double, double> pdd;
ll gcd(ll a, ll b) { for (; b; a %= b, swap(a, b)); return a; }
int dx[4] = { -1, 1, 0, 0 };
int dy[4] = { 0, 0, 1, -1 };
ll a[1002]... | ALGO | 0.999751 | 3.44934 | {
"github_metadata": {
"branch": "main",
"commit_count": 998,
"repo_created_at": "2023-02-24T03:10: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": "de12e92970... |
3993c61d-d756-46bb-83a8-b96f0c18bb5c | alecguilin/CSUSM | CS 433 - Operating Systems/A3/main.cpp | /*******************************
Name: <NAME>
Date: 11/2/19
CS 433 Assignment 3
*******************************/
#include <iostream>
#include <string>
#include "simulation.h"
using namespace std;
// function prototypes
void userInput(Simulation &DES, int argc, char * argv[]);
void prompt(Simulation &DES, int a... | TOOL | 0.921262 | 4.495976 | {
"github_metadata": {
"branch": "master",
"commit_count": 15,
"repo_created_at": "2020-06-08T06:27: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": "7620494be... |
630bec0f-e8ae-49a8-9d1b-8e8f353ea0b0 | 2108arunk/Compbio_project | src/hirschberg.cpp | /*
* The way to run this code is
* 1. g++ -o hirschberg hirschberg.cpp
* 2. ./hirschberg
* Reads a new file in.txt with two strings
* A new file output.txt is generated with allignment
*/
#include<iostream>
#include<fstream>
#include<time.h>
#include <cmath>
using namespace std;
uint64_t hirsch = 0;
... | ALGO | 0.999752 | 3.938911 | {
"github_metadata": {
"branch": "main",
"commit_count": 18,
"repo_created_at": "2022-04-22T05:46:47.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "9cc5fb7b0e4... |
f81e78cc-f4fc-4e5e-b903-da3fba03dbd8 | james-sungjae-lee/2018_CPP | algorithmTest/01_20/20최빈값/최빈값.cpp | #include <iostream>
#include <fstream>
#include <cstdlib>
using namespace std;
ifstream inStream;
int arr[100] = {0};
int arr2[100] = {0};
int arr3[100] = {0};
int countNumber();
int main(int argc, char const *argv[]) {
int numTestCases;
inStream.open("input.txt");
if (inStream.fail()) {
std::cerr << "... | ALGO | 0.999832 | 3.842254 | {
"github_metadata": {
"branch": "master",
"commit_count": 2,
"repo_created_at": "2018-06-03T09:21: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": "5ae99cf124... |
19932f10-88d3-46cb-bc22-f3b79085c9d9 | alex-87/HyperGraphLib | include/Hypergraph/algorithm/Connected.hh | /*
* MIT License
*
* Copyright (c) 2015 <NAME>
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify,... | ALGO | 0.997331 | 4.27461 | {
"github_metadata": {
"branch": "master",
"commit_count": 188,
"repo_created_at": "2015-09-22T17:56:17.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 21,
"forks": 3,
"issues": 4,
"pull_requests": 0
},
"file_meta": {
"content_id": "786680f... |
9316dfca-e233-4e1d-8bfc-22b52ab09074 | 0-jij-0/CompetitiveProgramming | Problems Archive/0000 - 0999/0976 - DeadLee.cpp | #include <iostream>
#include <vector>
#include <queue>
#include <algorithm>
using namespace std;
struct edge {
int u, v, id; edge() {}
edge(int _u, int _v, int _id) :
u(_u), v(_v), id(_id) {}
};
struct node { vector<edge> edges; };
vector<int> w;
struct graph {
vector<node> nodes; int n, m = 0;
graph(int _n) ... | ALGO | 0.999993 | 4.220494 | {
"github_metadata": {
"branch": "main",
"commit_count": 256,
"repo_created_at": "2021-02-01T07:57:01.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 14,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "d60b537a3... |
8030ca02-5b10-4ed8-8601-de286e6a9659 | TileDB-Inc/TileDB | tiledb/sm/query/readers/aggregators/safe_sum.h | /**
* @file safe_sum.h
*
* @section LICENSE
*
* The MIT License
*
* @copyright Copyright (c) 2023 TileDB, Inc.
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restricti... | TOOL | 0.940723 | 7.438826 | {
"github_metadata": {
"branch": "main",
"commit_count": 5153,
"repo_created_at": "2017-03-31T23:44:23.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 1970,
"forks": 196,
"issues": 89,
"pull_requests": 26
},
"file_meta": {
"content_id": "ea9... |
4b7648bc-d52a-4259-a126-0ab8ea335e03 | fuushigi/QuintosTracy_CSC_17A_48130 | Homework/Assignment417A/Gaddis7thEdChp13Prob9/main.cpp | //<NAME>
//11/18/14
//17A Homework Gaddis7thEdChp13Prob9
#include <iostream>
#include <cstdlib>
#include "Circle.h" //circle header
#include "ZeroException.h" //zero exception header
using namespace std;
Circle::Circle()
{
radius = 1.0;
}
Cir... | TOOL | 0.96065 | 5.453566 | {
"github_metadata": {
"branch": "master",
"commit_count": 22,
"repo_created_at": "2014-09-18T18:52: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": "e1476e31d... |
dbead7c7-9b5f-4f51-a848-1f11da90f181 | Parkhaeil/PNU_DataStructure | 04_twocops/main.cpp |
#include <iostream>
using namespace std;
int pandan(int ln_Sumarr[],int n,int geori){
for(int i=0;i<n;i++){
if(geori<ln_Sumarr[i]) return i-1;
else if(geori==ln_Sumarr[i]) return i;
}
}
int C1_change (int t, int S1, int S2){
if(t>=0 && t<= S1/2) return t;
else if(t>S1/2 && t<=S1) retu... | ALGO | 0.999996 | 3.662175 | {
"github_metadata": {
"branch": "main",
"commit_count": 5,
"repo_created_at": "2024-01-04T13:01:19.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "1dee41e898bf... |
51ee7e1b-f658-42f3-8e66-9eb354d1ca2f | icl-utk-edu/magma | src/zpotrs_batched.cpp |
/*
-- MAGMA (version 2.0) --
Univ. of Tennessee, Knoxville
Univ. of California, Berkeley
Univ. of Colorado, Denver
@date
@author <NAME>
@precisions normal z -> s d c
*/
#include "magma_internal.h"
#include "batched_kernel_param.h"
/**************************************... | ALGO | 0.997469 | 5.746941 | {
"github_metadata": {
"branch": "master",
"commit_count": 8870,
"repo_created_at": "2023-04-05T15:59:59.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 63,
"forks": 29,
"issues": 10,
"pull_requests": 1
},
"file_meta": {
"content_id": "53dfe... |
79edfb1c-2ba7-4aed-bb1c-f08d6a6e5311 | chilikk/adventofcode | 2023/17.cpp | #include "utils.hpp"
#include <queue>
#define debugon 0
#if debugon==1
#include <list>
#endif
#define debug debugon && std::clog
struct pathpoint {
utils::map<char>::iterator<utils::map<char>> it;
uint straight = 0;
uint total_heat = 0;
utils::map<uint> *min_estimate;
#if debugon==1
std::list<path... | ALGO | 0.999818 | 4.759106 | {
"github_metadata": {
"branch": "master",
"commit_count": 79,
"repo_created_at": "2016-12-09T22:10: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": "bcd271c7a... |
b73f67f4-697b-4bbe-ac7b-eb142aa7552a | edwinlo/FirstYearProgrammingAssignments | 4 - StudentIdSort/IdSort.cpp | /********************************
/Assignment 4 Task 1 : IdSort.cpp
/
/By : <NAME>
/
/Nov. 1st 2016
/
/This program allows the user to input 5 student IDs and uses the bubble sort
/algorithm to sort the 5 IDs in descending order.
/
********************************/
#include <iostream>
using namespace std;
int main(){... | ALGO | 0.997859 | 4.187581 | {
"github_metadata": {
"branch": "master",
"commit_count": 13,
"repo_created_at": "2017-01-25T21:35: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": "84600ff20... |
202776fb-bb14-4c3c-a312-6d579bf9837f | gmlrhkd12345/study | pill_three/BOJ_1153_네개의소수.cpp | #define _CRT_SECURE_NO_WARNINGS
#include <iostream>
#include <cstdio>
#include <vector>
#include <cstdlib>
#include <cmath>
#include <string>
#include <algorithm>
using ll = long long;
using namespace std;
vector<int> p;
int a[1000001];
int n;
vector<int> v;
int flag = 0;
void find(int num) {
if (num < 8) {
printf("... | ALGO | 0.999856 | 3.570801 | {
"github_metadata": {
"branch": "main",
"commit_count": 82,
"repo_created_at": "2021-02-06T05:56: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": "68c18cb0e81... |
8529964c-6975-4410-8c62-49e9a4c0478f | CabooseShep/CS-3010-S22-Assignment-4-Exercise-3 | main.cpp | /* <NAME>
Prof. <NAME>, CS 3010 - Spring 2022
Assignment 4, Exercise 3
main.cpp - Driver program responsible for asking the user to prompt the value to be used for evaluating the obtained polynomial.
*/
#include <iostream>
#include <vector>
#include <string>
#include "polyInput.hpp"
#include "newtonInterpol... | ALGO | 0.998115 | 4.364956 | {
"github_metadata": {
"branch": "main",
"commit_count": 2,
"repo_created_at": "2022-04-22T23:17: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": "51349595df4d... |
18536bcc-c13a-4d05-8204-d9416daba94d | sneha-08/Game-hub-using-backTracking-algorithm | sudoku.cpp | #include<iostream>
using namespace std;
#include "sudoku.h"
#include<stdlib.h>
int sudoku::is_exist_row(int grid[N][N], int row, int num)
{
for (int col = 0; col < 9; col++)
{
if (grid[row][col] == num)
{
return 1;
}
}
return 0;
}
int sudoku::is_exist_col(int grid[N][N], int col, int num)
... | ALGO | 0.999013 | 3.508739 | {
"github_metadata": {
"branch": "main",
"commit_count": 1,
"repo_created_at": "2021-05-03T08:26: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": "9e529c6cb69e... |
137f7e00-50ab-4c85-90f8-5c854220fb4d | jyothieswarreddy/CSA0478-OS-Regno-192211468 | os 7.cpp | #include <stdio.h>
#include <stdlib.h>
// Structure to represent a process
typedef struct {
int process_id;
int arrival_time;
int burst_time;
} Process;
// Function to find the process with the shortest burst time
int findShortestJob(Process processes[], int n) {
int shortest_time = 10000; // Initialize... | ALGO | 0.999998 | 4.760382 | {
"github_metadata": {
"branch": "main",
"commit_count": 8,
"repo_created_at": "2023-10-16T17:08: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": "2084c2564526... |
801d45d1-cc17-4639-bdc0-b324a80c3d76 | hungdhv97/Kattis | W5.cpp | #include<bits/stdc++.h>
using namespace std;
struct Time
{
int hour,minute,second;
};
int main()
{
//freopen("in.txt", "r", stdin);
//freopen("out.txt", "w", stdout);
struct Time time[2];
string s;
int t = 0, time_second[2], subtime;
while(cin >> s)
{
time[t].hour = (s[0] - ... | ALGO | 0.998796 | 3.762321 | {
"github_metadata": {
"branch": "master",
"commit_count": 1,
"repo_created_at": "2019-11-27T14:00: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": "5956db308e... |
c7c8737d-ae74-439a-adc8-1bfb1779891e | ishandutta2007/codeforces-c | couplefire/normal/1167/F.cpp | #include <bits/stdc++.h>
using namespace std;
#define MOD 1000000007
#define MAXN 500005
struct FenwickTree {
vector<long long> bit; // binary indexed tree
long long n;
FenwickTree(long long n) {
this->n = n;
bit.assign(n, 0);
}
FenwickTree(vector<long long> a) : FenwickTree(a.si... | ALGO | 0.999368 | 3.820871 | {
"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": "25c42537de27... |
b015f173-0315-4ae2-a712-df40f9ac9089 | karno/heavenly | Player.cpp | #include <vector>
#include <algorithm>
#include <utility>
#include "Player.h"
vector<pair<int, Player::Action> > Player::AvailableAction(vector<Tile*>& ins, Tile* tile, bool chowable)
{
vector<pair<int, Player::Action> > ret;
for (int i = 0; i < ins.size() - 1; i++)
{
// 同じ種類の牌であることが大前提
if(ins.at(i)->GetType(... | ALGO | 0.938579 | 5.15921 | {
"github_metadata": {
"branch": "master",
"commit_count": 1,
"repo_created_at": "2012-11-08T15:59:10.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "b035bc55ac... |
2a7cb07c-34e9-4ae6-9958-1ac8a65fd030 | ahmeterdem1/Vector_cpp | optimizations/executables/include/matrix.h | //
// Created by <NAME> on 19.01.2024.
//
#ifndef VECTOR_CPP_MATRIX_H
#define VECTOR_CPP_MATRIX_H
#include "vector.h"
template <typename T>
class Matrix {
template <typename U>
using ctype = typename std::common_type<T, U>::type;
public:
Vector<Vector<T>*> *data = nullptr;
unsigned int a = 0;
... | TOOL | 0.921704 | 5.134459 | {
"github_metadata": {
"branch": "main",
"commit_count": 41,
"repo_created_at": "2023-09-03T23:14:00.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "4ea0485ba58... |
9c63f70c-beba-4686-9b3b-c76565f9b02e | anurodh1452513/ProjectGame | snake.cpp | #include <SFML/Graphics.hpp> // Provides graphics rendering functionality using SFML
#include <ctime> // Used for time-related functions for random number generation
#include <iostream> // Used for console output using std::cout
#include <cstdlib> // Used for general-purpose functions, including random number generatio... | TOOL | 0.972385 | 6.48633 | {
"github_metadata": {
"branch": "main",
"commit_count": 1,
"repo_created_at": "2024-04-13T17: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": "64a94a68b8ea... |
57117042-b5b5-42fb-bb9c-3a41fec463e5 | pirishe/algos | hashtable/happyNumber.cpp | # Write an algorithm to determine if a number is "happy".
# A happy number is a number defined by the following process: Starting with any positive integer,
# replace the number by the sum of the squares of its digits, and repeat the process until the number
# equals 1 (where it will stay), or it loops endlessly in a c... | ALGO | 0.999829 | 4.669725 | {
"github_metadata": {
"branch": "master",
"commit_count": 16,
"repo_created_at": "2018-09-14T12:13:36.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "784f29bd2... |
ed215427-25f7-408f-9e68-f8a67557eff7 | Manzood/Advent-of-Code-Solutions | 2024/Day4/B/B.cpp | #include "bits/stdc++.h"
#ifdef local
#include "custom/debugger.h"
#else
#define debug(...) 42;
#endif
using namespace std;
#define int long long
vector<pair<int, int>> dirs = {{1, 0}, {-1, 0}, {0, 1}, {0, -1},
{1, 1}, {1, -1}, {-1, 1}, {-1, -1}};
bool ok(int x, int y, int n, int m) {... | ALGO | 0.999522 | 4.355131 | {
"github_metadata": {
"branch": "master",
"commit_count": 15,
"repo_created_at": "2021-01-07T10:49:32.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "c372ba7ab... |
ea912765-ff7a-4e9d-ba38-499551dc35b0 | vittorioromeo/SSVOpenHexagon | include/SSVOpenHexagon/Utils/Easing.hpp | // Copyright (c) 2013-2020 <NAME>
// License: Academic Free License ("AFL") v. 3.0
// AFL License page: https://opensource.org/licenses/AFL-3.0
#pragma once
namespace hg::Utils {
[[nodiscard, gnu::pure, gnu::always_inline]] inline float getSaturated(
const float mValue)
{
if(mValue < 0.f)
{
retur... | TOOL | 0.964261 | 7.205853 | {
"github_metadata": {
"branch": "master",
"commit_count": 3415,
"repo_created_at": "2012-11-01T21:49:55.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 631,
"forks": 75,
"issues": 30,
"pull_requests": 11
},
"file_meta": {
"content_id": "cf... |
e3bedc49-d5ea-463c-8ee9-da64ebc235ca | blender/blender | extern/Eigen3/Eigen/src/Core/products/GeneralMatrixVector.h | // This file is part of Eigen, a lightweight C++ template library
// for linear algebra.
//
// Copyright (C) 2008-2016 <NAME> <<EMAIL>>
//
// 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 this file, You can obtain one at http://mo... | ALGO | 0.995784 | 6.565783 | {
"github_metadata": {
"branch": "main",
"commit_count": 152123,
"repo_created_at": "2019-10-09T12:47:28.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 15670,
"forks": 2395,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "1... |
85a084cc-0554-4b7a-8497-17e9b7e174b6 | godotengine/godot | thirdparty/meshoptimizer/vfetchoptimizer.cpp | // This file is part of meshoptimizer library; see meshoptimizer.h for version/license details
#include "meshoptimizer.h"
#include <assert.h>
#include <string.h>
size_t meshopt_optimizeVertexFetchRemap(unsigned int* destination, const unsigned int* indices, size_t index_count, size_t vertex_count)
{
assert(index_cou... | ALGO | 0.990706 | 5.780643 | {
"github_metadata": {
"branch": "master",
"commit_count": 76043,
"repo_created_at": "2014-01-04T16:05:36.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 98972,
"forks": 22820,
"issues": 5000,
"pull_requests": 3866
},
"file_meta": {
"content... |
8f543c2e-a45f-4f9d-8561-e8021c571e92 | user2oo4/uga-icpc-training | nac-2024/A.cpp | #include <bits/stdc++.h>
using namespace std;
// #define int long long
const int maxN = 51;
const int maxA = 1e5 + 5;
const int inf = 1e9 + 7;
int dp[2][maxN * maxA];
int n;
int a[maxN];
int b[maxN];
signed main() {
ios_base::sync_with_stdio(0);
cin.tie(0); cout.tie(0);
freopen("input.txt", "r", stdin);
... | ALGO | 0.999972 | 3.661304 | {
"github_metadata": {
"branch": "main",
"commit_count": 18,
"repo_created_at": "2024-11-10T03:23: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": "59232d047c3... |
7aad604c-92d5-4492-bd26-96bb611eef00 | RangiLyu/nanodet | demo_mnn/nanodet_mnn.cpp | #include "nanodet_mnn.hpp"
using namespace std;
static void generate_grid_center_priors(const int input_height, const int input_width, std::vector<int>& strides, std::vector<CenterPrior>& center_priors)
{
for (int i = 0; i < (int)strides.size(); i++)
{
int stride = strides[i];
int feat_w = cei... | ALGO | 0.998435 | 5.251187 | {
"github_metadata": {
"branch": "main",
"commit_count": 361,
"repo_created_at": "2020-10-19T08:36:25.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 6009,
"forks": 1073,
"issues": 222,
"pull_requests": 23
},
"file_meta": {
"content_id": "3... |
a618e60a-c630-4ba9-b80e-326897e6c287 | LutzGross/esys-escript.github.io | trilinos_source16/packages/rol/adapters/thyra/src/function/TOpEleWiseBoundsHelpers.hpp | // @HEADER
// ***********************************************************************
//
// RTOp: Interfaces and Support Software for Vector Reduction Transformation
// Operations
// Copyright (2006) Sandia Corporation
//
// Under terms of Contract DE-AC04-94AL85000, there is a non-exclusive
// lic... | ALGO | 0.992888 | 6.508456 | {
"github_metadata": {
"branch": "master",
"commit_count": 5724,
"repo_created_at": "2020-08-10T02:31:18.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 34,
"forks": 15,
"issues": 63,
"pull_requests": 0
},
"file_meta": {
"content_id": "5b38... |
ecb97825-7042-47c8-857d-b2c5039a10d6 | Haris-Rehman/CS-250-Data-Structures-and-Algorithms | Assignments/Linked Lists/Linked_List.cpp | # include <iostream>
using namespace std;
struct node
{
node *head1;
node *tail1;
node *head0;
node *tail0;
node *previus;
int data;
node *next;
void oddcreator() // creates the list of odd numbers
{
node *tem = new node;
tem->data = 1;
tem->next = tem;
tem->previus = tem;
head1 = tem;
tail1 = t... | ALGO | 0.997307 | 4.406191 | {
"github_metadata": {
"branch": "master",
"commit_count": 5,
"repo_created_at": "2020-01-16T16:42: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": "4035236d6d... |
8ef794f6-726d-4109-a3ad-dd65ed6a396f | dhruv-yadav-nitj/striver-a2z-dsa-cpp | Step 05 ~ Strings/02.MEDIUM PROBLEMS/05-SUM-OF-BEAUTY-OF-ALL-SUBSTRING.CPP | #include <bits/stdc++.h>
using namespace std;
// brute force -> generate all the substrings and then calculate the beauty of each substring , etc. -> O(N3)
class Solution {
public:
int beautySum(string s) {
// Your code goes here
int ans=0 , n = s.length() ;
for(int i =0 ; i < n; i++) {
... | ALGO | 0.999934 | 4.895575 | {
"github_metadata": {
"branch": "main",
"commit_count": 173,
"repo_created_at": "2023-06-07T19:26:27.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 52,
"forks": 13,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "817b2a46... |
983234b5-ec8e-46f0-95e3-8cf36bd2bcf6 | Zelenoff4/Math-Logic | DeductionTheorem/Deduction.cpp | #include <bits/stdc++.h>
using namespace std;
struct Node{
Node* left = nullptr;
Node* right = nullptr;
string value = "";
};
vector<string> expressions, leftPrt, rightPrt;
string axioms[10] = {"A->(B->A)", "(A->B)->(A->(B->C))->(A->C)","A->B->(A&B)", "(A&B)->A", "(A&B)->B", "A->(A|B)", "B->(A|B)", "(A->... | ALGO | 0.999952 | 3.710598 | {
"github_metadata": {
"branch": "master",
"commit_count": 17,
"repo_created_at": "2018-10-28T16:00: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": "c8e38a94f... |
c2300698-b4a8-4a7c-839d-51cf8918cc9c | CountrySideEngineer/CorCppMySamples | DoxygenSamples/DoxygenSample_001/SubCode_003_01.cpp | /**
* @file SubCode_003_01.cpp
* @brief Sample file which implements sub functions.
* @author CountrySideEngineer
* @copyright Copyright 2024 CountrySideEngineer. All right reserved.
* This program is released under MIT license.
*/
#include <iostream>
#include <Windows.h>
#include <tchar.h>
/**
* @fn SubFu... | TOOL | 0.91008 | 4.232 | {
"github_metadata": {
"branch": "main",
"commit_count": 104,
"repo_created_at": "2020-12-31T22:15:52.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "5665dd593f... |
e1ade655-495a-486b-8447-b6ee3987ce5c | Krzmbrzl/contractor | src/processor/Factorizer.cpp | #include "processor/Factorizer.hpp"
#include "processor/Simplifier.hpp"
#include "utils/IndexSpaceResolver.hpp"
#include "utils/PairingGenerator.hpp"
#include <limits.h>
#include <string>
namespace ct = Contractor::Terms;
namespace cu = Contractor::Utils;
namespace Contractor::Processor {
using cost_t = ct::Contrac... | ALGO | 0.994903 | 6.183634 | {
"github_metadata": {
"branch": "master",
"commit_count": 307,
"repo_created_at": "2021-04-30T09:03: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": "4be20cdb... |
60dab295-75d7-4df8-9f26-aa8b5022fd63 | kamal-hossin/Phitron | XPSC/Weak 02/STL/A_Strong_Password.cpp | #include <iostream>
#include <string>
#include <algorithm>
using namespace std;
int calculateTime(const string &s) {
if (s.empty()) return 0;
int total = 2;
for (int i = 1; i < s.size(); ++i) {
if (s[i] == s[i-1]) {
total += 1;
} else {
total += 2;
}
}
... | ALGO | 0.99999 | 4.380068 | {
"github_metadata": {
"branch": "main",
"commit_count": 2,
"repo_created_at": "2025-06-24T04:55: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": "01a1315a5bf8... |
b99e3f4f-62b7-4fae-b7e7-53e0e6a33d3b | mganahl/MPSTools | blas/lapack_routines.hpp | #ifndef lapack_routines_h_
#define lapack_routines_h_
#include <boost/numeric/ublas/vector.hpp>
#include <boost/numeric/ublas/matrix.hpp>
#include <iostream>
#include <string>
#include "../boost_typedefs.hpp"
//#include "BoostToolsLapack/LapackSVD.h"
#include "boost/multi_array.hpp"
#include "helperfunctions.hpp"
usi... | ALGO | 0.904489 | 4.445601 | {
"github_metadata": {
"branch": "master",
"commit_count": 7,
"repo_created_at": "2016-10-18T17:01:21.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 1,
"pull_requests": 0
},
"file_meta": {
"content_id": "3b6a317f51... |
b941b8d1-6b77-4c9e-a6d0-d03d017fe5d2 | abhitry/LearnADS | assignment_6/q4.cpp | #include<iostream>
using namespace std;
class Node
{
public:
int vertex;
int wt;
Node*next;
Node()
{
vertex=0;
next=NULL;
}
Node(int v,int w)
{
vertex=v;
wt=w;
next=NULL;
}
};
class Graph
{
Node*head[10];
public:
int n;
bool... | ALGO | 0.999565 | 4.108385 | {
"github_metadata": {
"branch": "main",
"commit_count": 1,
"repo_created_at": "2024-02-25T09:46: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": "5c76ec4d97a9... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.