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 |
|---|---|---|---|---|---|---|---|
f6b30bb5-a5a6-4837-b776-8bec170b896f | rifatikbal/Light-oj- | 1021.cpp | #include <stdio.h>
#include <iostream>
#include <climits>
#include <map>
#include <cmath>
#include <algorithm>
#include <set>
#include <stack>
#include <deque>
#include <vector>
#include <stdlib.h>
#include <string>
#include <string.h>
#include <utility>
#include <queue>
using namespace std;
#define ll long long
#d... | ALGO | 0.995915 | 3.567272 | {
"github_metadata": {
"branch": "master",
"commit_count": 102,
"repo_created_at": "2019-11-29T12:28: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": "0cb2a9cf... |
54b7c7b1-78dd-4033-8177-618fb69fe517 | erov/DM-labs | 1-semester/03-lab-coding/bwt.cpp | #include <iostream>
#include <cmath>
#include <vector>
#include <algorithm>
#include <string>
#include <set>
#include <map>
#include <random>
#include <deque>
#include <queue>
#include <cassert>
#include <unordered_map>
#include <unordered_set>
#include <iomanip>
#include <bitset>
#include <stack>
#include <climits>
u... | ALGO | 0.999962 | 3.380758 | {
"github_metadata": {
"branch": "main",
"commit_count": 19,
"repo_created_at": "2022-01-29T23:45: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": "57d8396ed02... |
03117f1f-b135-433e-b05f-57885410f70b | xingkungao/LeetCode_solutions | validate_binary_search_tree.cpp | /*************************************************************************
> File Name: validate_binary_search_tree.cpp
> Author: lax
> Mail: <EMAIL>
> Created Time: Thu 11 Dec 2014 01:09:41 PM CST
************************************************************************/
#include <iostream>
#include <cstdio>
... | ALGO | 0.999977 | 5.708326 | {
"github_metadata": {
"branch": "master",
"commit_count": 30,
"repo_created_at": "2014-12-04T06:20: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": "ac74c88bf... |
09bb3263-c5cc-478f-acec-2d0380d1e08b | vineethm1627/CPP | Standard Template Library/10 Maps and Multimaps/vertical_order_print.cpp | // vertical order print of a binary tree.
#include <iostream>
#include <algorithm>
#include <map>
#include <vector>
using namespace std;
class node {
public:
int data;
node *left;
node *right;
node(int data) {
this->data = data;
left = right = NULL;
... | ALGO | 0.999988 | 5.797521 | {
"github_metadata": {
"branch": "master",
"commit_count": 630,
"repo_created_at": "2020-09-22T19:11:16.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 11,
"forks": 2,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "06843ba... |
8136800a-bbbe-42d3-a231-89cdeab21219 | noodlescodes/HamiltonianCycle | eraseBad.cpp | #include <iostream>
#include <fstream>
#include <cstdlib>
#include <vector>
#include <string>
using namespace std;
vector<string> permutations;
vector<string> paths;
vector<string> goodPermutations;
void generatePaths()
{
paths.push_back("12");
paths.push_back("13");
paths.push_back("15");
paths.push_back("16");
... | ALGO | 0.994588 | 3.322787 | {
"github_metadata": {
"branch": "master",
"commit_count": 2,
"repo_created_at": "2012-12-27T01:49:04.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "ccd508a9f8... |
0d282a42-8c4c-4d7b-ab66-167c8b23607f | Tocktock/HanGwa1994 | Algorithm/사다리/ladder.cpp |
#include <iostream>
#include <fstream>
#include<string.h>
#include <algorithm>
using namespace std;
void Input();
void MainAlgoritm();
void Output();
ofstream fOut;
ifstream fIn;
struct LADDER
{
int endLadder;
int endHeight;
};
int g_ladderNum;
int g_inputNum;
LADDER g_ladderInfo[101][10001];
LADDER g_reverseInfo... | ALGO | 0.999972 | 3.744727 | {
"github_metadata": {
"branch": "master",
"commit_count": 79,
"repo_created_at": "2018-05-22T11:49: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": "3442cee39... |
db0ae305-03f9-418e-92d9-6f707783c1b6 | bhartik021/LeetHub | Check if it is possible to convert one string into another with given constraints - GFG/check-if-it-is-possible-to-convert-one-string-into-another-with-given-constraints.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 isItPossible(string S, string T, int M, int N) {
// code here
if(M!=N) return 0;
string S1="",S2="";
... | ALGO | 0.999742 | 5.699475 | {
"github_metadata": {
"branch": "main",
"commit_count": 1735,
"repo_created_at": "2022-02-14T05:27:14.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 5,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "b9b7d0a58... |
51965ee9-4dfb-40f7-840a-f2e750919db5 | MobinYengejehi/gpdivert | Shared/Utils.cpp | #include "Utils.h"
#include <ctime>
#include <filesystem>
#include <locale>
#include <codecvt>
#include <shellapi.h>
std::string Utils::File::Read(std::string path)
{
path = Path::GetWindowsPathFormat(path);
if (path.empty())
{
return "";
}
FILE* file = NULL;
fopen_s(&file, path.c_... | TOOL | 0.908976 | 5.795678 | {
"github_metadata": {
"branch": "main",
"commit_count": 4,
"repo_created_at": "2025-03-02T08:41: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": "f1dc9363c876... |
67418cde-1726-46eb-ad05-672eaa108bc9 | ishivpoojan22/geekforgeek-daily-problem | Difficulty: Easy/Rotate by 90 degree/rotate-by-90-degree.cpp | //{ Driver Code Starts
#include <bits/stdc++.h>
using namespace std;
// } Driver Code Ends
class Solution {
public:
// Function to rotate matrix anticlockwise by 90 degrees.
void rotateby90(vector<vector<int>>& mat) {
// code here
int n=mat.size();
vector<vector<int>> helper=mat;
... | ALGO | 0.999584 | 6.577847 | {
"github_metadata": {
"branch": "main",
"commit_count": 125,
"repo_created_at": "2024-11-20T13:44: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": "3872e55365... |
1ffee1ab-0d43-4c9a-b256-c1ee3b211a41 | JeongY00n/algorithms | 프로그래머스/3/258707. n + 1 카드게임/n + 1 카드게임.cpp | #include <string>
#include <vector>
#include<iostream>
using namespace std;
/*
최대 라운드 수
버리지 않고 누적해두다가 합이 n+1인 두장의 카드를 내야할 때 코인에서 -1을 해주고
만약 더이상 낼 코인이 없다면 게임 종료
*/
vector<pair<int,int>> having;
int solution(int coin, vector<int> cards) {
int answer = 1;
int n = cards.size();
for(int i=0;i... | ALGO | 0.999849 | 4.119694 | {
"github_metadata": {
"branch": "main",
"commit_count": 261,
"repo_created_at": "2022-09-17T01:35: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": "f3c08c6737... |
45d95abd-3138-44b1-b79c-5833d814b234 | MarkTiukov/mipt-term2-algos | Contest4/Task1.cpp | #include <iostream>
#include <vector>
const int MY_INT_MAX = 2147483647;
struct SparseTable {
std::vector<std::vector<int>> table;
SparseTable(int n, const std::vector<int> &numbers, const std::vector<int> &logarithms) {
this->table = std::vector<std::vector<int>>(n);
for (int i = 0; i < n; ++i) {
this->ta... | ALGO | 0.999998 | 5.16418 | {
"github_metadata": {
"branch": "master",
"commit_count": 170,
"repo_created_at": "2020-02-10T15:09:57.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "916eff4a... |
2b803bba-241c-42fc-bdcc-5b1daa6f1b92 | kolessios/sourcebots | bots/components/bot_component_memory.cpp | //========= Copyright © 1996-2005, Valve Corporation, All rights reserved. ============//
// Authors:
// <NAME> (linkedin.com/in/ivanbravobravo), 2017
//
// Purpose: It is in charge of managing the memory of the entities
// and the memory of the information besides considering who will be the best enemy of the bot.
/... | TOOL | 0.967206 | 5.629761 | {
"github_metadata": {
"branch": "master",
"commit_count": 15,
"repo_created_at": "2017-08-20T05:18:31.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 22,
"forks": 6,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "db20e213... |
fa32bde5-2d97-4afe-ab9c-87adb66634dd | han0305/Problem-Solving | rearrangeSpaces.cpp | /* You are given a string text of words that are placed among some number of spaces. Each word consists of one or more lowercase English letters and are separated by at least one space. It's guaranteed that text contains at least one word.
Rearrange the spaces so that there is an equal number of spaces between every p... | ALGO | 0.999988 | 5.832541 | {
"github_metadata": {
"branch": "master",
"commit_count": 336,
"repo_created_at": "2020-08-19T13:46: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": "d74de61b... |
54e159c1-9e40-4282-8766-a7a064d6db01 | shohagmist/SomeBestUvaOJ | 944-happy_num.cpp | #include<iostream>
#include<algorithm>
#include<cstdio>
#include<vector>
using namespace std;
#define happy 1
#define unhappy 2
int hap[15000];
int iteration[101000];
int status[101000];
int save[2000];
int j = 1;
inline int square(int a) { return a*a; }
void made_easy(int k)
{
int y;
for(y = k*10; y < 100000; y... | ALGO | 0.999808 | 3.539934 | {
"github_metadata": {
"branch": "master",
"commit_count": 1,
"repo_created_at": "2018-08-12T20:59: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": "40023ed919... |
399d5932-f9d9-4ede-9ea5-9b03c0e4aef3 | pauloamed/ICPC | strings/manacher.cpp | #include <bits/stdc++.h>
#define debug
using namespace std;
struct {
// creates d1 and d2
// D1[i] says that every string (with odd size) of indices from i-D1[i] to i+D1[i] (inclusive) is a palindrome
// D2[i] says that every string (with even size) of indices from i-D2[i]+1 to i+D2[i] (inclusive) is a palindrome
... | ALGO | 0.99979 | 4.50488 | {
"github_metadata": {
"branch": "master",
"commit_count": 554,
"repo_created_at": "2018-03-21T12:47:55.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 12,
"forks": 3,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "5eccf84... |
6f2dac32-8faa-470c-a6ef-5ba0f2b8950d | ArshhAnsari/cpp-dsa-practice | 08_Recursion/01Basic/01Basic_of_R.cpp | #include <iostream>
using namespace std;
// Function to print numbers in descending order before the recursive call
void fun1(int n)
{
if (n > 0)
{
cout << n << " "; // Print the current number before the recursive call
fun1(n - 1); // Recursive call with decremented value
}
}
// F... | ALGO | 0.999902 | 5.859643 | {
"github_metadata": {
"branch": "main",
"commit_count": 3,
"repo_created_at": "2025-07-15T11:27: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": "aa6355434575... |
b476de25-d458-41bb-917a-1389b0c86baa | Nilesh219/Leetcode_DSA_100days | Merge_in_between_Linked_list_1669.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 Solution {
public:
ListNode* mergeInBetw... | ALGO | 0.999952 | 5.176453 | {
"github_metadata": {
"branch": "master",
"commit_count": 75,
"repo_created_at": "2024-02-05T15:58: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": "5963eed19... |
93a6fd16-4ed7-4345-aca5-28a4ae0bdcc0 | KouroshKSH/University-Assignments | CS 300/homework 02/homework2.cpp | /*
Info: This is the main file for the main program.
Steps:
1) Get the number of files.
2) Read each file.
3) Make all the words of the given file lowercase.
4) Separate the words and store in them the AVL tree.
5) Get the queries from user.
6) Based on the query, display a proper message.
*/
#include... | TOOL | 0.996648 | 4.98772 | {
"github_metadata": {
"branch": "master",
"commit_count": 98,
"repo_created_at": "2023-03-11T12:38: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": "cacad6c53... |
ea8af06b-9cd1-49b6-920b-c68433f994ee | co-NP/BT | main.cpp | ////////////////////////////////////////////////////////////////////////////////
//
// Binary Table creator for simple funcsion (Boolean and others)
// main.cpp
// Feb 15, 2013 (8:08pm) [<NAME>]
//
///////////////////////////////////////////////////////////////////////////////
#include <algorithm>
#include <iostream>... | TOOL | 0.93831 | 6.026283 | {
"github_metadata": {
"branch": "main",
"commit_count": 3,
"repo_created_at": "2021-07-26T10:56: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": "0b0a04ff809b... |
6cc9dc27-8287-40a0-bf0b-88e2ab63f0c7 | Kytothetop/Competitive-Programming | OCOM/TOI2024/Practice at home/TOI10Map/main.cpp | #include <bits/stdc++.h>
using namespace std;
/*
Use Graph
Maybe present as trees but with sharable leaves?
properties and how to solve:
1. i nodes have i as parents -> until said by declare and 2 max parents (but only check if have parents)
2. possible for multiple nodes with no parents -> node with most descendants... | ALGO | 0.9999 | 4.162398 | {
"github_metadata": {
"branch": "main",
"commit_count": 13,
"repo_created_at": "2024-03-19T02:51:46.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "a10a40084cc... |
d365811a-2dd7-454b-83a3-1553a6df9d20 | MeenakshiSekhar/Lets-have-some-fun | G4G/Basic/Maximum number of zeroes.cpp | Given an array of n values. Print a number which had maximum number of zeroes. If their are no zeroes then print -1.
Note: If there are multiple numbers with same (max) number of zeroes then print the Maximum number among them.
Input:
The first line of input contains an integer T denoting the number of test cases. The ... | ALGO | 0.999814 | 4.21468 | {
"github_metadata": {
"branch": "master",
"commit_count": 154,
"repo_created_at": "2018-06-20T16:17:32.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 2,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "3cc636dd... |
6154a85a-83d2-413c-92ce-a17f4f77b6f9 | WeichiChen1210/ACM-codes | CF1141A.cpp | #include <bits/stdc++.h>
using namespace std;
int main(){
ios::sync_with_stdio(false);
cin.tie(nullptr);
long long a, b, c, d;
int cnt = 0;
cin >> a >> b;
if(a == b){
cout << 0 << endl;
return 0;
}
c = b / a;
d = b % a;
if(d != 0){
cout << -1 << endl;
... | ALGO | 0.999992 | 3.609949 | {
"github_metadata": {
"branch": "master",
"commit_count": 18,
"repo_created_at": "2019-03-05T14:51: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": "61de1dc54... |
f89a4d88-fd2b-430a-aeb1-69f195baa1a0 | Rishi-11-2/CP | B_Perfecto.cpp | #include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
using namespace std;
using namespace __gnu_pbds;
using namespace chrono;
mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());
#define debug(x...) { cout << "(" << #x << ")" << " = ( "; PRINT(x); }
tem... | ALGO | 0.999877 | 4.166784 | {
"github_metadata": {
"branch": "main",
"commit_count": 82,
"repo_created_at": "2023-10-19T06:20:09.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "cc1cadc7f70... |
a57437cf-1d1b-41af-a3da-df3fa2aa9165 | MarcosBNarita/OpenGL | pexe.cpp | #include <stdlib.h>
#include <GL/glut.h>
#include <stdio.h>
#include <math.h>
#define pi 3.1415926535898
#define janela_altura 400
#define janela_largura 600
float tx = 0.0, ty = 0.0, xStep = 4, yStep = 4;
float pexer = 1.0, pexeg = 0.3, pexeb = 0.2;
float flagpexe = 0.0;
float corpexe = 0.0;
void display(void);
void... | ALGO | 0.994824 | 4.333452 | {
"github_metadata": {
"branch": "master",
"commit_count": 1,
"repo_created_at": "2019-07-04T11: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": "88203e238f... |
bd1c55ca-6803-4911-93d9-04c527edea7f | smaru1111/pro-en-3 | 07(モンスターの追加)/main.cpp | #include <iostream>
using namespace std;
class Map {
public:
static const int ROCK = 0;
static const int EMPTY = 1;
static const int GOAL = 2;
static const int XSIZE = 13;
static const int YSIZE = 11;
int data[XSIZE][YSIZE];
void init();
void print();
void cellPrint(int x, ... | ALGO | 0.99487 | 3.15736 | {
"github_metadata": {
"branch": "main",
"commit_count": 4,
"repo_created_at": "2024-05-29T11:55:27.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "187148aa0730... |
af26f9e4-ddd7-4a7e-8076-f743d05c92f1 | Trietptm-on-Coding-Algorithms/Project-Euler-C-- | p18.cpp | #include <stdio.h>
#include <string.h>
#include <algorithm>
#define MAXN 100
using namespace std;
void printarr(int n, long a[][MAXN]) {
int i, j;
for (i = 0; i < n; i++) {
for (j = 0; j <= i; j++)
printf("%ld ", a[i][j]);
printf("\n");
}
}
long solve (int n, int a[][MAXN]) {
... | ALGO | 0.999988 | 3.753505 | {
"github_metadata": {
"branch": "master",
"commit_count": 3,
"repo_created_at": "2016-07-04T07:44:37.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "1bc98ceff7d... |
9046ad07-74bf-47b9-b582-ab00308c89f0 | chunzhang/practice | leetcode/0992_subarrays_with_K_different_integers/sol.cpp | /*
Given an integer array nums and an integer k, return the number of good subarrays of nums.
A good array is an array where the number of different integers in that array is exactly k.
For example, [1,2,3,1,2] has 3 different integers: 1, 2, and 3.
A subarray is a contiguous part of an array.
Example 1... | ALGO | 0.999948 | 6.820795 | {
"github_metadata": {
"branch": "master",
"commit_count": 179,
"repo_created_at": "2017-09-16T23:04: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": "60d6dd09... |
838724fd-fe27-4400-9158-410c593db7e3 | AndersonKao/CP_Problems | codeforce/607A.cpp | // AC Sep/07/2020 20:03UTC+8
#include <cstring>
#include <iostream>
#include <algorithm>
// #define LOCAL
using namespace std;
int ans[1000005];
int b[1000005];
bool beacon[1000005] = {false};
int main()
{
#ifdef LOCAL
freopen("input.txt", "r", stdin);
#endif
int n;
cin >> n;
int maxpos = 0;
int p... | ALGO | 0.999782 | 3.017026 | {
"github_metadata": {
"branch": "master",
"commit_count": 244,
"repo_created_at": "2022-01-23T04:16: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": "9de6aee6... |
85bb713d-2b19-4240-943d-570be2d8c02f | buiquoccuongk8lk/2024 | 28.08.2024/delquery.cpp | // 29 . 03 . 2008
#include <bits/stdc++.h>
using namespace std ;
#define int long long
typedef long long ll ;
typedef vector<int> vi ;
typedef vector<pair<int,int>> vii ;
typedef pair<int,int> ii ;
#define FOR(i,a,b) for(int i(a) ; i <= (int)b ; i++)
#define FORD(i,a,b) for(int i(a) ; i >= (int)b ; i--)
#define all(a)... | ALGO | 0.999719 | 4.078959 | {
"github_metadata": {
"branch": "main",
"commit_count": 90,
"repo_created_at": "2024-08-05T03:06:55.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "1a27e14815f... |
c368ea8b-c900-4816-bcab-67b0c852c331 | trilinos/Trilinos | packages/compadre/src/constraints/Compadre_CreateConstraints.hpp | // @HEADER
// *****************************************************************************
// Compadre: COMpatible PArticle Discretization and REmap Toolkit
//
// Copyright 2018 NTESS and the Compadre contributors.
// SPDX-License-Identifier: BSD-2-Clause
// ********************************************************... | ALGO | 0.997927 | 5.690637 | {
"github_metadata": {
"branch": "master",
"commit_count": 104031,
"repo_created_at": "2015-11-16T19:39:16.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 1299,
"forks": 593,
"issues": 263,
"pull_requests": 61
},
"file_meta": {
"content_id":... |
02b770ec-ef50-422f-bda3-a36bed53b349 | modsim/redicon-dune-immo | src/bridge-robinBC.hh | #ifndef CHANNELING_IMMO_BOUNDARY_HH
# define CHANNELING_IMMO_BOUNDARY_HH
#include"dune/grid/common/gridinfo.hh"
#include"dune/common/fvector.hh" // Field Vector
#include"dune/common/dynmatrix.hh" // Field Vector
//#define DEBUG
#include "setRobin.hh"
#ifdef DEBUG
# undef DEBUG
#endif
/*
* Robin BC: d f|n + eta f... | ALGO | 0.983911 | 4.66551 | {
"github_metadata": {
"branch": "master",
"commit_count": 7,
"repo_created_at": "2015-12-14T15:12:36.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "7e7a3cad3f7... |
55058897-e321-4e8b-a31c-bb230e564298 | JesseZhuang/CSAPP | leetcode/src/tree/BTVerticalOrder.hpp | #ifndef BTVERTICALORDER_HPP
#define BTVERTICALORDER_HPP
#include <deque>
#include <vector>
#include <unordered_map>
#include "struct/TreeNode.hpp"
#include <ranges>
using namespace std;
// LintCode 651, LeetCode 314, 20 ms, 2.82 mb
class Solution {
public:
/**
* @param root: the root of tree
* @return:... | ALGO | 0.999758 | 6.125768 | {
"github_metadata": {
"branch": "master",
"commit_count": 179,
"repo_created_at": "2019-11-05T03:29: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": "e27824dd... |
bc7995e1-cc22-426f-b779-279de1dcacc8 | noimin0610/competitive_programming | AtCoder/Tenka1_2017/Tenka1_2017C.cpp | #include<cstdio>
#include<cstdlib>
#include<cmath>
#include<iostream>
#include<string>
#include<stack>
#include<queue>
#include<vector>
#include<map>
#include<set>
#include<algorithm>
#include<numeric>
#define all(c) c.begin(), c.end()
#define rall(c) c.rbegin(), c.rend()
#define pb(x) push_back(x)
#define eb(x,y) emp... | ALGO | 0.999934 | 3.177506 | {
"github_metadata": {
"branch": "master",
"commit_count": 17,
"repo_created_at": "2017-02-10T11:37: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": "6fde494cd... |
86226d49-dc27-41fd-9269-829e9311d471 | brett-b112/EECS348_ECLab3 | main.cpp | #include <iostream>
#include <iomanip>
#include <string>
class Account {
protected:
std::string accountNumber;
std::string accountHolder;
public:
double balance;
Account(const std::string& number, const std::string& holder, double initialBalance)
: accountNumber(number), accountHolder(holder),... | TOOL | 0.90703 | 6.248987 | {
"github_metadata": {
"branch": "main",
"commit_count": 1,
"repo_created_at": "2023-11-21T13:44: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": "8fb021ffab2d... |
1caf973e-d438-4934-8c90-7fdfc385baeb | Ansh1693/contests | codeforces/Three_Person_Tree_Game.cpp | #include <iostream>
#include <vector>
#include <unordered_set>
using namespace std;
vector<vector<int>> tree;
vector<int> a, b, c;
// Function to perform DFS and check for a winner
string dfs(int node, int parent)
{
unordered_set<int> positions;
// Store the current positions of A, B, and C
positions.in... | ALGO | 0.999992 | 5.571915 | {
"github_metadata": {
"branch": "main",
"commit_count": 2,
"repo_created_at": "2024-07-24T05:37: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": "a2987fb954e6... |
4bd7e6d5-d545-4ee3-b650-4f535418456a | Langtienh/DSA | Xử lý xâu 2/STRBEAUTI.cpp | #include <iostream>
#include <algorithm>
using namespace std;
int n, k;
char S[200006], res[200006];
int main() {
scanf("%d%d", &n, &k);
scanf("%s", S+1); res[0] = '0';
for(int i=1; i<=k; ++i)
res[i] = S[i];
int j = 0, l=1;
for(int i=k+1; i<=n; ++i) {
++j;
if (j > k) j = 1... | ALGO | 0.999996 | 3.64138 | {
"github_metadata": {
"branch": "main",
"commit_count": 1,
"repo_created_at": "2024-04-17T06:20:42.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "431a585adf23... |
79747f3d-ca43-4650-844d-5122102ed488 | jvrlag/riemann | filam/geom.h | // Geometry file header
// 040525-071130-140428
#ifndef GEOMETRY_HEADER
#define GEOMETRY_HEADER
#include"common.h"
#include"matrix.h"
////////////////////////////////////////////////////////////////
// Point struct and referred functions
////////////////////////////////////////////////////////////////
typedef struct p... | ALGO | 0.968783 | 5.137825 | {
"github_metadata": {
"branch": "master",
"commit_count": 6,
"repo_created_at": "2014-11-16T18:19:07.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 3,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "53a42ffa2d... |
38e4f7d3-8fbc-43cd-8570-321b4f6de872 | alu0101543529/AYED-ULL | Practica2_VectorMatrix/src/rational_t.cpp | /*
* AUTOR: <NAME>
* FECHA: 27/02/2023
* EMAIL: <EMAIL>
* VERSION: 1.0
* ASIGNATURA: Algoritmos y Estructuras de Datos
* PRÁCTICA Nº: 2
*/
// Para los comentarios utilice la sintaxis // ó /* */, siempre que sea consistente.
#include "header_files/rational_t.hpp"
/**
* @brief Comprobación que el denominador es disti... | TOOL | 0.942547 | 5.485795 | {
"github_metadata": {
"branch": "main",
"commit_count": 11,
"repo_created_at": "2023-04-17T08:04: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": "ef93241a0f9... |
1294f8bf-a903-4791-87f1-39a653db49ff | OliverWayne007/CPP_Codes | olliePS-384.cpp | #include<bits/stdc++.h>
using namespace std;
typedef long long ll;
#define ull unsigned long long
#define flash() ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL);
const long long int MOD = 1e9 + 7;
const long long int INF = 1e18;
const long long int MAX = 1e9;
void Solution(ll T)
{
ll n;
cin >> ... | ALGO | 0.99978 | 4.061287 | {
"github_metadata": {
"branch": "main",
"commit_count": 2,
"repo_created_at": "2023-10-01T02:30: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": "729378f0a374... |
85b9dba2-dd75-4aa4-95af-1cdd8acd1c4f | TheCherno/Sparky | Dependencies/FreeImage/Source/LibRawLite/internal/aahd_demosaic.cpp | /* -*- C++ -*-
* File: aahd_demosaic.cpp
* Copyright 2013 <NAME>
* Created: Wed May 15, 2013
*
* This code is licensed under one of three licenses as you choose:
*
* 1. GNU LESSER GENERAL PUBLIC LICENSE version 2.1
* (See file LICENSE.LGPL provided in LibRaw distribution archive for details).
*
* 2. COMMO... | ALGO | 0.986302 | 4.348223 | {
"github_metadata": {
"branch": "master",
"commit_count": 122,
"repo_created_at": "2015-03-14T06:37:37.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1168,
"forks": 225,
"issues": 38,
"pull_requests": 12
},
"file_meta": {
"content_id": "c... |
2367129a-d60b-47c6-9066-75a79e647431 | lanessavee/CS32 | Homework 2/mazestack/mazequeue/mazequeue.cpp | //
// mazequeue.cpp
// Homework 2
//
// Created by <NAME> on 2/3/18.
// Copyright © 2018 <NAME>. All rights reserved.
//
#include <iostream>
#include <string>
#include <queue>
using namespace std;
class Coord
{
public:
Coord(int rr, int cc) : m_r(rr), m_c(cc) {}
int r() const { return m_r; }
int c() c... | ALGO | 0.999752 | 5.237075 | {
"github_metadata": {
"branch": "master",
"commit_count": 3,
"repo_created_at": "2018-10-08T02:22:29.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "45b8992bc9... |
f825aa0f-babf-40a0-990d-235f35ee45ae | shu8Cream/atcoder-archive | atcoder.jp/typical90/typical90_cf/Main.cpp | /**
* author: shu8Cream
* created: 02.01.2022 01:38:04
**/
#include <bits/stdc++.h>
using namespace std;
#define rep(i,n) for (int i=0; i<(n); i++)
#define rrep(i,n) for (int i=(n-1); i>=0; i--)
#define all(x) (x).begin(), (x).end()
#define rall(x) (x).rbegin(), (x).rend()
#define sz(x) int((x).size())
using ll... | ALGO | 0.99983 | 4.169073 | {
"github_metadata": {
"branch": "master",
"commit_count": 1468,
"repo_created_at": "2020-09-24T07:19: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": "4bc2fb7... |
9ea8e624-f9ff-43ab-ae21-5a99306a5c5b | muranyuliia/lab45 | lab45/lab45.cpp |
#include <iostream>
#include <iomanip>
#include <cstdlib>
#include <ctime>
using namespace std;
int main()
{
double x, y, R;
cout << "x = "; cin >> x;
cout << "y = "; cin >> y;
cout << "R = "; cin >> R;
for (int i = 0; i < 10; i++)
{
cout << "x = "; cin >> x;
cout << "y = "; cin >> y;
if ((y >= 0 && y ... | ALGO | 0.958316 | 3.802239 | {
"github_metadata": {
"branch": "master",
"commit_count": 1,
"repo_created_at": "2023-10-09T17:35:38.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "4f00ec593b... |
73f1e07b-fc3d-466e-8f44-da059761aa3c | redcapital/algo | timus/1119.cpp | // Uses: dynamic programming
#include <iostream>
#include <set>
#include <vector>
#include <queue>
#include <utility>
#include <cmath>
using namespace std;
const double INF = 1e12;
const double STEP = 100;
const double FSTEP = sqrt(STEP * STEP + STEP * STEP);
int main(int argc, char const *argv[])
{
int n, m, k;
... | ALGO | 0.999955 | 3.578911 | {
"github_metadata": {
"branch": "master",
"commit_count": 140,
"repo_created_at": "2012-05-08T10:55:46.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "c75d5870... |
4bfc6256-058c-473a-8623-b5afecd8b6d9 | neofytr/Codeforces | old/topics/binarySearch/monotoneSearch/task.cpp | #include <bits/stdc++.h>
using namespace std;
bool canCopy(const long long time, const long long n, const long long x, const long long y) {
long long first_copy_time = min(x, y);
if (time < first_copy_time) return false;
long long remaining_time = time - first_copy_time;
long long copies = 1 + (remaini... | ALGO | 0.999964 | 4.134157 | {
"github_metadata": {
"branch": "main",
"commit_count": 904,
"repo_created_at": "2024-12-27T05:04: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": "894e48701d... |
50a15c3f-8d39-40aa-94b4-8b75769cf110 | gerar2d/pthread | prodConPT.cc | #include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <pthread.h>
#include <ctime>
#include <unistd.h>
#define MAX_T 2
pthread_mutex_t mutexBuffer;
void *producer(void *args);
void *consumer(void *args);
int count = 0;
int countLimit = 0;
int bufferSize;
int *buffer;
int in = 0;
int out = 0;
int mai... | ALGO | 0.935023 | 4.71919 | {
"github_metadata": {
"branch": "main",
"commit_count": 4,
"repo_created_at": "2023-06-19T04:08: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": "7fd59284b2a6... |
e789a1ae-b501-48d3-b788-7f3ac3a45584 | terminaldweller/luactest | libtool/generic.cpp |
/*first line intentionally left blank.*/
/***************************************************Project Mutator****************************************************/
//-*-c++-*-
// a simple clang tool.
/*Copyright (C) 2019 <NAME>
This program is free software; you can redistribute it and/or modify it under the terms of t... | TOOL | 0.924947 | 6.49261 | {
"github_metadata": {
"branch": "master",
"commit_count": 46,
"repo_created_at": "2019-05-19T13:12:44.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 2,
"issues": 1,
"pull_requests": 0
},
"file_meta": {
"content_id": "e2e822a43... |
8ce68d52-588e-44a0-bc01-8c207f6c600b | ratstam/school | Sheet14/swtich2.cpp | #include <iostream>
using namespace std;
int main()
{
double x, y;
char operazione;
while (true)
{
cout << "\n\n DIGITA N1 OP N2 : ";
cin >> x >> operazione >> y;
cout << "\n " << x << " " << operazione << " " << y << " = ";
switch (operazione)
{ case '+': cout << x... | ALGO | 0.917163 | 3.204688 | {
"github_metadata": {
"branch": "main",
"commit_count": 47,
"repo_created_at": "2021-03-03T14:32:21.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "9ffe7bfbe2d7... |
c92ee5f6-a3fe-4922-bd0a-898ca84184fc | secure-foundations/CVC4-fork | src/theory/strings/infer_info.h | /********************* */
/*! \file infer_info.h
** \verbatim
** Top contributors (to current version):
** <NAME>
** This file is part of the CVC4 project.
** Copyright (c) 2009-2019 by the authors listed in the file AUTHORS
** in the top-level source direc... | TOOL | 0.964807 | 7.509441 | {
"github_metadata": {
"branch": "swiss-fork",
"commit_count": 7175,
"repo_created_at": "2021-04-19T22:35:02.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "d676... |
f1b2ef91-b905-4071-871e-972e24e2935a | gefeng/cp | codeforces/r952div4/F.cpp | #include <iostream>
#include <utility>
#include <cassert>
#include <algorithm>
#include <cmath>
#include <array>
#include <string>
#include <vector>
#include <queue>
void run_case() {
int H, N;
std::cin >> H >> N;
std::vector<int> A(N);
std::vector<int> B(N);
for(int i = 0; i < N; i++) {
... | ALGO | 0.999909 | 3.956974 | {
"github_metadata": {
"branch": "main",
"commit_count": 980,
"repo_created_at": "2022-07-19T19:38: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": "b7f07caeb9... |
60a3157b-638d-4e16-8d71-d4798b74710a | Harsh-91221/NEETCODE | 4. Stack/MinStack.cpp | /*
Design stack that supports push, pop, top, & retriving min element
2 stacks, 1 normal & 1 monotonic decr, only push if lower than top
Time: O(1)
Space: O(n)
*/
class MinStack
{
public:
vector<pair<int, int>> st;
MinStack()
{
}
void push(int val)
{
if (st.empty())
... | ALGO | 0.999909 | 6.485971 | {
"github_metadata": {
"branch": "main",
"commit_count": 438,
"repo_created_at": "2023-09-01T09:33:36.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 1
},
"file_meta": {
"content_id": "75781149aa... |
c5d21b8e-3db8-4f52-9eba-aebcd9ff0190 | Drske/IMO | test.cpp | #include <iostream>
#include <map>
#include <vector>
using namespace std;
class NearestNeighbourQueue
{
public:
void add(int v, int n, int d)
{
bool isin = false;
for (int i = 0; i < this->neighbours[v].size(); i++)
{
if (this->neighbours[v][i].first == n)
{
... | ALGO | 0.99973 | 4.434515 | {
"github_metadata": {
"branch": "main",
"commit_count": 165,
"repo_created_at": "2023-03-06T11:32: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": "8b36c76ce2... |
887fdfc8-c01f-4d75-ae9a-5c3fbd29da6e | Edu175/Competitive_Programming | oii/2020/C3.cpp | #include <bits/stdc++.h>
#define pb push_back
#define fst first
#define snd second
#define fore(i,a,b) for(ll i=a,ggdem=b;i<ggdem;++i)
#define SZ(x) ((int)x.size())
#define ALL(x) x.begin(),x.end()
#define mset(a,v) memset((a),(v),sizeof(a))
#define FIN ios::sync_with_stdio(0);cin.tie(0);cout.tie(0)
#define imp(v) {for... | ALGO | 0.999898 | 4.660243 | {
"github_metadata": {
"branch": "master",
"commit_count": 66,
"repo_created_at": "2022-09-14T03:09:27.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "4316fc8ba... |
530a2679-32c3-4240-b5f1-72df589e4436 | LevinJ/Pedestrian-Detection-Project | libs/CImg/examples/mcf_levelsets3d.cpp | /*
#
# File : mcf_levelsets3d.cpp
# ( C++ source file )
#
# Description : Implementation of the Mean Curvature Flow on Surfaces
# using the framework of Level Sets 3D.
# This file is a part of the CImg Library project.
# ( http://cimg.sourcefo... | ALGO | 0.998851 | 6.785142 | {
"github_metadata": {
"branch": "master",
"commit_count": 47,
"repo_created_at": "2015-01-10T23:27:53.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 23,
"forks": 21,
"issues": 3,
"pull_requests": 0
},
"file_meta": {
"content_id": "c2d2a52... |
cf744728-cc94-45ae-a1d8-ff266040ed69 | TI-1050/code | opentrains/1519/c.cpp | #include <bits/stdc++.h>
using namespace std;
using db = double;
const dp eps = 1e-8;
const int N = 8e2 + 10;
int sgn(db x) {
if (fabs(x) < eps) return 0;
else return x > 0 ? 1 : -1;
}
db a[N][N], x[N][N];
int gao() {
int i, j, k, col, max_r;
for (k = 0, col = 0; k < equ && col < var; ++k, ++col) {
max_r = ... | ALGO | 0.999952 | 3.511121 | {
"github_metadata": {
"branch": "master",
"commit_count": 6,
"repo_created_at": "2020-09-28T00:59:04.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 2,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "07d587e0b15... |
5ed770b9-2352-417f-b59f-79e962b844a2 | Rakib-Mahmud/Algorithms | Segment_Tree(lazy).cpp | #include<bits/stdc++.h>
#define mx 100005
using namespace std;
struct lazy{
int sum,prop;
}tree[mx*3];
int input[mx];
void make_tree(int node,int i,int j)
{
if(i==j){
tree[node].sum=input[i];
tree[node].prop=0;
return;
}
int left=2*node;
int right=2*node+1;
int mid=(i+... | ALGO | 0.999783 | 5.04203 | {
"github_metadata": {
"branch": "master",
"commit_count": 12,
"repo_created_at": "2017-09-29T20:18: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": "6ad504811... |
9144efca-489b-4f03-940e-b1e39235b110 | thilio/Competitive-programming-team | Trainings/2020-2021 Winter Petrozavodsk Camp, Day 5: Almost Retired Dandelion Contest (XXI Opencup, Grand Prix of Nizhny Novgorod)/g.cpp | #include<bits/stdc++.h>
using namespace std;
#define fr(i, n) for(ll i = 0; i < n; i++)
#define frr(i, n) for(ll i = 1; i <= n; i++)
#define frm(i, n) for(ll i = n-1; i >= 0; i--)
#define pb push_back
#define f first
#define s second
typedef long long ll;
typedef pair<int,int> pii;
typedef vector<vector<ll>> matrix... | ALGO | 0.999996 | 3.975871 | {
"github_metadata": {
"branch": "main",
"commit_count": 391,
"repo_created_at": "2021-01-09T16:55:59.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 8,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "6314ec160f... |
d13033bc-d114-4b34-8cc5-ffcce41ae52a | joaomarcosth9/competitive-programming | codeforces/codeton-round6-div2/E.cpp | #include "bits/stdc++.h"
using namespace std;
#ifdef LOCAL_DEBUG
#include "debug.h"
#else
#define debug(...)
#define cerr \
if (false) cerr
#endif
#define endl '\n'
#define eb emplace_back
#define all(x) begin... | ALGO | 0.999908 | 4.077851 | {
"github_metadata": {
"branch": "main",
"commit_count": 34,
"repo_created_at": "2022-07-20T11:23: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": "fa09e1a3ac5... |
0da28874-eacd-41b6-b3bb-1db9c6dbd2e9 | ishandutta2007/codeforces-o | ormlis/normal/1675/F.cpp | #include <bits/stdc++.h>
#define rep(i, n) for (int i = 0; i < (n); ++i)
#define rep1(i, n) for (int i = 1; i < (n); ++i)
#define rep1n(i, n) for (int i = 1; i <= (n); ++i)
#define repr(i, n) for (int i = (n) - 1; i >= 0; --i)
#define pb push_back
#define eb emplace_back
#define all(a) (a).begin(), (a).end()
#define ... | ALGO | 0.999718 | 4.262036 | {
"github_metadata": {
"branch": "main",
"commit_count": 1,
"repo_created_at": "2024-10-30T15:45: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": "b1bd26162543... |
db967ab0-bb1a-45fc-b8b5-2a1e9f5a4e65 | trolando/Divine2 | tools/memband.cpp | #include <wibble/sys/thread.h>
#include <stdlib.h>
#include <cassert>
#include <iostream>
struct Thrasher : wibble::sys::Thread
{
long long padding1;
long long terminate, total;
unsigned seedp, seedp_pad;
long long iter;
long long padding2;
void *main()
{
int bound = 1024*1024*(2500... | TEST | 0.904494 | 4.517806 | {
"github_metadata": {
"branch": "master",
"commit_count": 49,
"repo_created_at": "2014-09-15T11:03:11.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "6fe349bb7... |
dc6643df-4dd6-485a-8787-39250b020d72 | codophobia/Spoj-Solutions | LINES.cpp | #include <bits/stdc++.h>
using namespace std;
struct points
{
int x;
int y;
};
points a[1000];
int main()
{
int n;
int i;
int j;
int g;
int u;
int d;
while(1) {
scanf("%d",&n);
map<pair<int,int>,int> m;
if(n == 0) {
break;
}
for(i = 0; i < n; i++) {
... | ALGO | 0.999683 | 3.863562 | {
"github_metadata": {
"branch": "master",
"commit_count": 2,
"repo_created_at": "2016-10-09T17:31:47.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 3,
"forks": 5,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "8d2f4f72ed... |
de59c504-d8ac-40a7-b3b1-8bf6aa6991b4 | ehsankf/ZO-Data-Mining | research/ZerothOrder/varianceReduction/codes/code/logisticReg/Code_FSVRG/SVM/svm_dense.h | #include <iostream>
#include <algorithm>
#include <vector>
#include "mex.h"
using namespace std;
double vector_dot_product(double *x, double *y, long d) {
long i;
double ret = 0;
for (i = 0; i < d; i++) {
ret += x[i] * y[i];
}
return ret;
}
double* compute_full_gradient(double *w, double *Xt, double *y, lo... | ALGO | 0.999788 | 4.568885 | {
"github_metadata": {
"branch": "main",
"commit_count": 6,
"repo_created_at": "2021-06-11T23:39: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": "71e34d498d4b... |
357a85c3-7346-4833-8463-50a4e682ceed | lballabio/QuantLib | ql/processes/eulerdiscretization.cpp | /* -*- mode: c++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*
Copyright (C) 2004, 2005 StatPro Italia srl
This file is part of QuantLib, a free-software/open-source library
for financial quantitative analysts and developers - http://quantlib.org/
QuantLib is free software: you can redistribu... | ALGO | 0.993351 | 7.667099 | {
"github_metadata": {
"branch": "master",
"commit_count": 17543,
"repo_created_at": "2015-12-17T16:29:33.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 6151,
"forks": 1964,
"issues": 51,
"pull_requests": 11
},
"file_meta": {
"content_id":... |
ad247378-7974-45e2-9f67-c9e083cd3e7f | sxz1113/algorithms | DataStructure/1590.MakeSumDivisiblebyP.cpp | #include "../Common.h"
class Solution {
public:
int minSubarray(vector<int>& nums, int p) {
// 求最短的subarray,满足除以p的余数 == 整个数组的和除以p的余数。
int n = nums.size();
// 其实是prefix sum % p,因为会越界嗷嗷嗷
unordered_map<int,int> prefix_sum;
// k - prefix sum % p, v - idx
prefix_sum[0] =... | ALGO | 0.999669 | 5.108972 | {
"github_metadata": {
"branch": "main",
"commit_count": 21,
"repo_created_at": "2021-08-03T02:42: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": "4feaa816ddf... |
9f5da2f8-9782-4454-a1eb-7ff357b78a4e | wayne-wu/wiggly | src/Wiggly.h | #pragma once
#include <vector>
#include <utility>
#include <unordered_map>
#include <UT/UT_Vector3.h>
#include <UT/UT_Array.h>
#include <UT/UT_ThreadedAlgorithm.h>
#include <GU/GU_Detail.h>
#include "Eigen/Dense"
// NOTE: Not sure if we should include Houdini dependencies here.
// On one hand, it would save memory ... | ALGO | 0.997891 | 4.848051 | {
"github_metadata": {
"branch": "main",
"commit_count": 41,
"repo_created_at": "2022-03-01T00:43:41.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 7,
"forks": 2,
"issues": 2,
"pull_requests": 0
},
"file_meta": {
"content_id": "d0bcca5b1e7... |
6ae19020-6692-47a0-9b71-66cbd4f42a32 | CCR01/Tracer-Open-Master | OptimizeSystem/DampedLeastSquares.h | #pragma once
#include "importantOptimizeStructs.h"
#include "..\Image\ImageSimulation.h"
// image processing
#include "..\ImageProcessing\ImageProcessing.h"
struct defaultParaDLS
{
public:
defaultParaDLS();
~defaultParaDLS();
// damping factor
real getDampingFactor();
void setDampingFactor(real dampingFacto... | CONFIG | 0.997841 | 3.508346 | {
"github_metadata": {
"branch": "master",
"commit_count": 88,
"repo_created_at": "2020-02-03T13:08:18.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 6,
"forks": 5,
"issues": 1,
"pull_requests": 0
},
"file_meta": {
"content_id": "804e81c62... |
33e26366-2058-46cb-a08a-6b406d75fc8c | pseong/ProgramSolving | Baekjoon Online Judge/21939.cpp | #include <bits/stdc++.h>
#define all(c) (c).begin(),(c).end()
#define srt(c) sort(all(c))
#define srtrev(c) sort(all(c)); reverse(all(c))
using namespace std;
using ll=long long;
using i128 = __int128_t;
using pi=pair<int, int>;
using pll=pair<ll, ll>;
using ti=tuple<int, int, int>;
using tll=tuple<ll, ll, ll>;
templat... | ALGO | 0.999729 | 5.12294 | {
"github_metadata": {
"branch": "main",
"commit_count": 2105,
"repo_created_at": "2021-01-25T02:47: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": "35e507d0c... |
e56eeddc-1eb8-48fb-8501-0cc06395b2ea | KarinaSzewczyk/zadania_podrecznik | 3.1/main.cpp | #include <iostream>
#include <cstdlib>
#include <ctime>
using namespace std;
int main()
{
int array[2000];
srand(time(0));
int suma = 0, suma1 = 0, suma2 = 0;
int l_dod = 0;
int l = 0;
for(int i = 0; i < 2000; i++)
{
array[i] = rand() % 6001 - 3000 ;
suma +=... | ALGO | 0.997882 | 3.371319 | {
"github_metadata": {
"branch": "master",
"commit_count": 37,
"repo_created_at": "2012-01-09T18:14:14.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "b03f1b8c6... |
1cf4478d-2ed0-4d76-b206-7257cd1837dd | hhy4761/baekjoon | 백준/Gold/15684. 사다리 조작/사다리 조작.cc | #include <iostream>
#include <queue>
#include <tuple>
#include <algorithm>
using namespace std;
int n,m,h;
bool board[31][11];
int comb[500];
bool test(){
for(int i=1; i<=n; i++){
int cur = i;
for(int j=1; j<=h; j++){
if(board[j][cur]){
cur++;
}
... | ALGO | 0.999974 | 3.684384 | {
"github_metadata": {
"branch": "main",
"commit_count": 253,
"repo_created_at": "2022-06-11T16:22: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": "70d9389b0d... |
101c002e-4309-4f9f-bfe9-03f1e3cda10f | haowanwuyifan/c_code | C++program/C++program/reractangle.cpp | #include<iostream>
using namespace std;
int k = 1;
class Ractangle
{
public:
Ractangle(double x, double y, double length, double width)
:_x(x), _y(y), _length(length), _width(width) {}
double area();
bool operator==(Ractangle &b);
bool operator!=(Ractangle &b);
bool operator<(Ractangle &b);
bool operator>(Rac... | ALGO | 0.997794 | 3.387043 | {
"github_metadata": {
"branch": "master",
"commit_count": 50,
"repo_created_at": "2017-12-08T13:27: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": "a81093521... |
f94186e1-cd04-483b-819f-3a85ce8dca75 | smc2315/algorithm | 백준/Gold/7490. 0 만들기/0 만들기.cc |
#include <iostream>
#include <vector>
#include <string>
#include<algorithm>
using namespace std;
int N;
int cal(string s) {
int ans = 0;
int cur = 0;
char op = '+';
for (int i = 0; i <= s.size(); i++) {
if (s[i] == '-' || s[i] == '+' || s[i] == '\0') {
if (op == '-') {
ans -= cur;
cur = 0;
}
... | ALGO | 0.999799 | 4.462693 | {
"github_metadata": {
"branch": "main",
"commit_count": 574,
"repo_created_at": "2022-12-23T11:50:05.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "caf37358fd... |
27cf93d4-29f1-4d00-ac49-fb61b33af123 | kysu5095/algorithm | algorithmHomework/Traveling-Salesperson-Problem/Traveling_Salespersopn.cpp | #include "Traveling_Salesperson.h"
vector<int> optTour;
/* create different graphs using user input */
void createRandomMap() {
/* prepare random */
random_device rd;
mt19937 gen(rd());
uniform_int_distribution<int> dis(1, 100);
bool alreadCreate[101] = { false, };
/* create graph and fill random cost */
map =... | ALGO | 0.99995 | 3.579808 | {
"github_metadata": {
"branch": "master",
"commit_count": 749,
"repo_created_at": "2020-12-22T10:30:31.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "68b265c9... |
ddb35981-4e1d-4a2f-9812-ab6bd04d2bd2 | Derick317/MyOpenJudge | 重建二叉树.cpp | //OpenJudge 2255:重建二叉树
//给定一棵二叉树的前序遍历和中序遍历的结果,求其后序遍历。
//每组输入包含两个字符串,分别为树的前序遍历和中序遍历。每个字符串中只包含大写字母且互不重复。
#include<iostream>
using namespace std;
struct BinaryTree
{
BinaryTree* left;
BinaryTree* right;
BinaryTree* parent;
char info;
};
BinaryTree* Create_by_pre_in(char* ptLR, char* qLtR,int num);
int main()
{
cha... | ALGO | 0.999981 | 4.208034 | {
"github_metadata": {
"branch": "main",
"commit_count": 12,
"repo_created_at": "2022-02-10T14: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": "6a698745f6e... |
cd11c505-e1eb-4da2-a013-434efdaa0ba0 | sane-aalam/DSAOne | Lecture39 - Detect & Remove Cycle in a Linked List/2095. Delete the Middle Node of a Linked List(Leetcode).cpp |
#include <bits/stdc++.h>
using namespace std;
// 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) {}
};
// Thinking to solve this pr... | ALGO | 0.999947 | 6.144727 | {
"github_metadata": {
"branch": "main",
"commit_count": 19,
"repo_created_at": "2024-12-08T13:20:58.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "461d4bb10a8... |
252bd41d-078d-4d3d-bfb7-809f94db9487 | squaresLab/BatFix | results/transcoder/translations/java/NOBLE_INTEGERS_IN_AN_ARRAY_COUNT_OF_GREATER_ELEMENTS_IS_EQUAL_TO_VALUE_1.cpp | int nobleInteger ( int arr [ ] ) {
sort ( arr , arr + sizeof ( arr ) / sizeof ( int ) ) ;
int n = sizeof ( arr ) / sizeof ( int ) ;
for ( int i = 0 ;
i < n - 1 ;
i ++ ) {
if ( arr [ i ] == arr [ i + 1 ] ) continue ;
if ( arr [ i ] == n - i - 1 ) return arr [ i ] ;
}
if ( arr [ n - 1 ] == 0 ) retur... | ALGO | 0.999809 | 3.110802 | {
"github_metadata": {
"branch": "main",
"commit_count": 26,
"repo_created_at": "2023-05-21T15:21:59.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 5,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "a2f7f63a37fe... |
4df1bd14-d3e5-458e-970d-4f395f96dee6 | arthurvtrr/AA-Problems-Solved | To Define/SA-LCP.cpp | #include <cstdio>
#include <cstring>
#include <algorithm>
using namespace std;
#define N 1001
char str[N];
int len, gap, pos[N];
bool comp(int i, int j) {
if(pos[i] != pos[j]) return pos[i] < pos[j];
i += gap, j += gap;
return (i < len && j < len) ? pos[i] < pos[j] : i > j;
}
void run() {
scanf("%s", str);
le... | ALGO | 0.99999 | 3.988766 | {
"github_metadata": {
"branch": "master",
"commit_count": 22,
"repo_created_at": "2015-09-18T11:53: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": "fac9f891e... |
05b7b22c-1c94-41ea-8f80-711c91136699 | Kamaljeet-01/DSA | 2D_Linked_List.cpp | #include <iostream>
#include<vector>
#include<stack>
using namespace std;
struct Node{
int data;
Node* next;
Node* prev;
Node(int data){
this->data=data;
this->next=nullptr;
this->prev=prev;
}
Node(int data,Node* prev, Node* next){
this->data=data;
this->p... | ALGO | 0.999766 | 5.218343 | {
"github_metadata": {
"branch": "main",
"commit_count": 6,
"repo_created_at": "2024-08-19T06:46: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": "5eb0c6bb8c16... |
aa918268-113a-4f6b-a509-b02ef83a282f | Dxy1307/HUST_IT3040 | C++/ky_phap_hau_to.cpp | #include<bits/stdc++.h>
using namespace std;
bool isOperator(char op) {
return op == '+' || op == '-' ||
op == '*' || op == '%' ||
op == '/' || op == '^';
}
int compute(int left, int right, char op) {
int value;
switch(op) {
case '+': value = left + right; break;
case... | ALGO | 0.999892 | 3.949446 | {
"github_metadata": {
"branch": "main",
"commit_count": 4,
"repo_created_at": "2024-01-27T16:23: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": "c729dd022ff4... |
8cf6f868-9607-4b4d-929e-e1ad7a7edf6b | alpha-asb/codes | Linked-Lists/Reverse_Nodes_in_K-Groups.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 Solution {
public:
ListNode* reverseKGro... | ALGO | 0.999993 | 6.071614 | {
"github_metadata": {
"branch": "main",
"commit_count": 223,
"repo_created_at": "2024-02-12T14:58:06.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "793f27e245... |
0c9d6f15-2e07-4b1b-94fd-c5f6249cb18c | Vector-013/CP-Vector013 | Codeforces/climb/Contests/1002/C.cpp | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
using i64 = long long;
typedef unsigned long long ull;
typedef long double ld;
const int inf = 2e9;
const ll linf = 9e18;
const int mod = 1e9 + 7;
void solve()
{
ll n;
cin >> n;
vector<vector<ll>> a(n, vector<ll>(n));
for (int i = 0; i... | ALGO | 0.999909 | 4.707505 | {
"github_metadata": {
"branch": "master",
"commit_count": 47,
"repo_created_at": "2023-10-02T08:27:08.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "693a680de... |
0894f578-ccdf-4c9e-98be-ff6587d4aec1 | Manyizi101/OJ | POJ/1477.cpp | #include <cstdio>
#include <iostream>
#include <cstdlib>
using namespace std;
int main(int argc, char const *argv[])
{
int n, i, sum, ave, j, ans, t = 1;
int e[51];
while (scanf("%d", &n) == 1 && n)
{
ave = sum = 0;
for (i = 1; i <= n; i++)
{
scanf("%d", &e[i]);
... | ALGO | 0.999704 | 3.183593 | {
"github_metadata": {
"branch": "master",
"commit_count": 648,
"repo_created_at": "2017-07-28T06:53:40.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "4a9174a7... |
d3ac7213-d443-457e-96a9-ed8d5e6952b5 | saurabhh-svg/Contests | CodeChef/Non_Comprime_Neighbours.cpp | #include <bits/stdc++.h>
#include <unordered_map>
#define _ ios_base::sync_with_stdio(0);
#define fs cin.tie(0);
#define ll long long int
#define pb push_back
#define fl(i, n) for (int i = 0; i < n; i++)
#define sortall(v) sort(v.begin(), v.end())
#define sortrev(v) sort(v.end(), v.begin())
using namespace std;
void s... | ALGO | 0.999658 | 3.230997 | {
"github_metadata": {
"branch": "main",
"commit_count": 200,
"repo_created_at": "2022-01-12T17:39:47.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 8,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "503db6bd42... |
eacd8d7f-e0c2-43d1-ae42-f6c3c5ca8c37 | ahornung/humanoid_navigation | footstep_planner/include/footstep_planner/Heuristic.h | /*
* A footstep planner for humanoid robots
*
* Copyright 2010-2011 <NAME>, <NAME>, University of Freiburg
* http://www.ros.org/wiki/footstep_planner
*
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Soft... | ALGO | 0.993445 | 7.250649 | {
"github_metadata": {
"branch": "indigo-devel",
"commit_count": 297,
"repo_created_at": "2013-09-03T10:10:36.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 41,
"forks": 83,
"issues": 3,
"pull_requests": 2
},
"file_meta": {
"content_id": "... |
2c71ae2b-af40-4569-88a7-12832af67c9b | ishandutta2007/codeforces-e | emorgan5289/normal/1307/C.cpp | #include <bits/stdc++.h>
using namespace std;
#define inf 1000000000
#define inf_ll 1000000000000000000ll
#define inf_ull 1000000000000000000ull
#define ll long long
#define ull unsigned long long
#define all(x) (x).begin(), (x).end()
#define pb push_back
#ifdef ONLINE_JUDGE
#pragma GCC optimize ("O3")
#define debug(... | ALGO | 0.99996 | 3.819669 | {
"github_metadata": {
"branch": "main",
"commit_count": 1,
"repo_created_at": "2024-04-11T01:34: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": "7b07b1061998... |
c0797ffb-c16d-41e7-9294-42683f207434 | wang5339/secondc | 作业2/作业5.cpp | #include<stdio.h>
int min(int a,int b){
return a>b?b:a;
}
int max(int a,int b){
return a>b?a:b;}
int main(){
int x,y,z;
scanf("%d %d %d",&x,&y,&z);
printf(" %d %d %d\n", min(min(x,y),z), (x>min(min(x,y),z) && x<max(max(x,y),z)) ? x : y>min(min(x,y),z) && y<max(max(x,y),z) ? y : z, max(max(x,y),z));}
//2,#inc... | ALGO | 0.999906 | 3.613979 | {
"github_metadata": {
"branch": "master",
"commit_count": 5,
"repo_created_at": "2020-01-21T15:35:11.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "a78228df3f... |
930cd0e4-c33c-445d-b00d-e99dd9eec656 | GyanaramDhaka/assignment | assignment 57/question8.cpp | #include <iostream>
using namespace std;
class Node
{
public:
int data;
Node *next;
Node *pri;
Node()
{
data = 0;
next = NULL;
pri = NULL;
}
};
Node *head = NULL;
Node *t = NULL;
Node *rear = NULL;
Node *y = NULL;
class Doublylinklist
{
public:
void insertion(int valu... | ALGO | 0.999944 | 4.503586 | {
"github_metadata": {
"branch": "master",
"commit_count": 1,
"repo_created_at": "2023-05-22T12:27: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": "4c7359df02... |
13efc508-4727-4535-b130-b2e6f99a86d5 | xcatf/OJ-solve-the-problems | hnucm/河畔军训.cpp | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
static const int maxn=1e3+5;
struct node{
int x,y;
node(){}
node(int _x,int _y){x=_x;y=_y;}
};
char mp[maxn][maxn];
int n,m;
queue<node>q[3];
bool vis[3][maxn][maxn];
int d1[8][2]={{1,0},{-1,0},{0,1},{0,-1},{-1,-1},{-1,1},{1,-1},{1,1}};
int... | ALGO | 0.99996 | 3.352662 | {
"github_metadata": {
"branch": "master",
"commit_count": 32,
"repo_created_at": "2020-03-03T02:36:25.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "47461451a... |
9601a06a-c2ba-4c43-a1ef-a1a3b0aa62c7 | qzcwx/CEC2010SS-LSGO-Benchmarks-CPP | F3.cpp | #include "F3.h"
/**
* Shifted Ackley's Function
*
* as defined in "Benchmark Functions for the CEC'2010 Special Session
* and Competition on Large-Scale Global Optimization" by <NAME>,
* <NAME>, <NAME>, <NAME>, and <NAME>
* published as technical report on January 8, 2010 at Nature Inspired
* Computation and Ap... | ALGO | 0.973067 | 3.834825 | {
"github_metadata": {
"branch": "master",
"commit_count": 8,
"repo_created_at": "2011-03-16T11:22:22.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 7,
"forks": 2,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "d84994cf8d... |
b91a17d0-1b96-445d-9269-b9bae7605381 | FreeCAD/FreeCAD | src/Mod/Mesh/App/WildMagic4/Wm4ApprGaussPointsFit3.cpp | // Geometric Tools, LLC
// Copyright (c) 1998-2010
// Distributed under the Boost Software License, Version 1.0.
// http://www.boost.org/LICENSE_1_0.txt
// http://www.geometrictools.com/License/Boost/LICENSE_1_0.txt
//
// File Version: 4.10.0 (2009/11/18)
#include "Wm4FoundationPCH.h"
#include "Wm4ApprGaussPointsFit3.... | ALGO | 0.999153 | 6.879344 | {
"github_metadata": {
"branch": "main",
"commit_count": 42594,
"repo_created_at": "2012-09-09T08:25:02.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 25389,
"forks": 4671,
"issues": 2906,
"pull_requests": 250
},
"file_meta": {
"content_id"... |
ba7b58b9-8292-44e5-9501-69ad518c6e15 | MShinigami/DSA | 08.cpp | #include <iostream>
using namespace std;
struct Patient
{
string name;
int priority;
};
class PriorityQueue
{
private:
Patient arr[100];
int rear;
public:
PriorityQueue()
{
rear = -1;
}
bool isEmpty()
{
return (rear == -1);
}
bool isFull()
{
r... | ALGO | 0.999288 | 4.994903 | {
"github_metadata": {
"branch": "main",
"commit_count": 7,
"repo_created_at": "2024-04-22T14:47:38.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "0734b283eb06... |
9202ada7-5920-4b67-9734-201b23f63b71 | s1Sharp/MPI | task6.cpp | #include <cstdlib>
#include <math.h>
#include <math.h>
#include <stdio.h>
#include <stdlib.h>
#include <iostream>
#include <mpi.h>
#define GENERAL_PROCCESS 0
#define LINES 4
#define COLUMNS 4
#define RANDOM_SPREAD_COEFFICIENT 2
template<typename T>
void rand_vec(T* vec, size_t size)
{
int radius = ((int)size * RA... | ALGO | 0.999832 | 4.170085 | {
"github_metadata": {
"branch": "master",
"commit_count": 29,
"repo_created_at": "2022-03-04T02:58:07.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "a9b96de82... |
376355eb-ce08-4df1-84f5-9175af66f1b3 | AutoStephen/FYP2019 | _20190204SteeringWheelSignalManipulationAngleSwappingWorkingIsh/_20190204SteeringWheelSignalManipulationAngleSwappingWorkingIsh.ino | //stores % steering wheel has turned left or right.
//stores what the steering angle is based on that value.
//Turning radii are not different by the correct % (16 to 14 to 16%)
float AnalogInput;
float AnalogPercent;
float ThrottleInput;
float ThrottlePercent;
float TurningPercent;
float RightTurningPercent;
float Le... | ALGO | 0.991376 | 4.853797 | {
"github_metadata": {
"branch": "master",
"commit_count": 27,
"repo_created_at": "2018-09-17T19:39:50.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "41c176b76... |
90f9d43c-d3e1-4461-8d17-c6398e10db9b | Yash4119/CPP-Codes-CodeBlocks- | Recurssion/main.cpp | #include <iostream>
using namespace std;
int sum_of_n(int n){
if(n<=0){
return 0;
}
return n+sum_of_n(n-1);
}
int raised_to(int n,int p){
if(p<=0){
return 1;
}
int prevpower = raised_to(n,p-1);
return n*prevpower;
}
int fact(int n){
if(n==0){
return 1;
}
... | ALGO | 0.999162 | 3.891773 | {
"github_metadata": {
"branch": "main",
"commit_count": 7,
"repo_created_at": "2022-07-24T07:32: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": "50c37d08d3e2... |
022d895f-52de-4289-87a8-b584e12a58ca | jkrall/ocropus | ocropus/commands/OLD/ocr-ldetect-nnbr.cc | // -*- C++ -*-
// Copyright 2006-2007 Deutsches Forschungszentrum fuer Kuenstliche Intelligenz
// or its licensors, as applicable.
//
// You may not use this file except under the terms of the accompanying license.
//
// Licensed under the Apache License, Version 2.0 (the "License"); you
// may not use this file ex... | ALGO | 0.995788 | 6.303736 | {
"github_metadata": {
"branch": "master",
"commit_count": 16,
"repo_created_at": "2010-03-27T00:42:28.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 17,
"forks": 11,
"issues": 2,
"pull_requests": 1
},
"file_meta": {
"content_id": "e617e0c... |
7499ee4c-b00a-4b31-a787-6c2393d6ad29 | salim002/Cpp-Codes | 52_Codeforces/17_Codeforces 3/54_.cpp | #include<bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef long double ld;
typedef unsigned long long ull;
typedef vector<int> vi;
typedef vector<ll> vl;
typedef vector<ld> vd;
#define fi first
#define se second
#define mp make_pair
#define pb push_back
const int mod = 1000000007;
// const int mod = ... | ALGO | 0.999995 | 4.864334 | {
"github_metadata": {
"branch": "master",
"commit_count": 2,
"repo_created_at": "2023-12-11T13:47:46.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "c112e6c91b... |
b47d8698-1d2f-49be-bfae-a8693c7675ab | k0sk/aoj | 1249.cpp | #include <iostream>
#include <cstdio>
#include <algorithm>
#include <cmath>
#include <cstring>
#include <string>
#include <vector>
#include <map>
#include <stack>
#include <queue>
#include <map>
#include <climits>
#include <sstream>
using namespace std;
typedef long long ll;
const int MAX_N = 7 + 2;
const int NONE = 0... | ALGO | 0.999926 | 4.115888 | {
"github_metadata": {
"branch": "master",
"commit_count": 4,
"repo_created_at": "2014-01-25T05: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": "bce90c2005... |
9f24bf99-4f09-4099-83fd-cae8c5a0506f | hensg/algorithms | divide-conquer/int_multiplication/recursive_mult.cpp | #include "recursive_mult.hpp"
#include <string>
#include <iostream>
#include <cmath>
unsigned long recursive_mult(std::string x, std::string y, unsigned long n) {
if (n == 1)
return ((int)x[0]-48) * ((int)y[0]-48);
unsigned long half_n = n / 2;
std::cout << "n: " << n << ", half_n: " << half_n << ... | ALGO | 0.999821 | 5.563339 | {
"github_metadata": {
"branch": "master",
"commit_count": 12,
"repo_created_at": "2020-06-14T13:36: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": "3474f5443... |
6f92d9de-0c2d-4652-a823-7c48a8b1aac3 | Roonil03/LeetCodeR03 | ProblemStatements/0437. PathSumIII/pathSum3.cpp | /**
* Definition for a binary tree node.
* struct TreeNode {
* int val;
* TreeNode *left;
* TreeNode *right;
* TreeNode() : val(0), left(nullptr), right(nullptr) {}
* TreeNode(int x) : val(x), left(nullptr), right(nullptr) {}
* TreeNode(int x, TreeNode *left, TreeNode *right) : val(x), l... | ALGO | 0.999984 | 5.558866 | {
"github_metadata": {
"branch": "main",
"commit_count": 869,
"repo_created_at": "2024-09-11T18:57: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": "0ba7de74a8... |
df4e0173-f190-4559-ac15-46d9f2d589ed | liuyubobobo/Play-Leetcode | 0001-0500/0401-Binary-Watch/cpp-0401/main.cpp | /// Source : https://leetcode.com/problems/binary-watch/
/// Author : liuyubobobo
/// Time : 2020-02-15
#include <iostream>
#include <vector>
#include <sstream>
#include <iomanip>
using namespace std;
/// Brute Force
/// Time Complexity: O(2^10)
/// Space Complexity: O(1)
class Solution {
public:
vector<stri... | ALGO | 0.995819 | 6.04373 | {
"github_metadata": {
"branch": "master",
"commit_count": 2592,
"repo_created_at": "2016-12-01T17:08:20.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2732,
"forks": 718,
"issues": 1,
"pull_requests": 0
},
"file_meta": {
"content_id": "37... |
17ed3900-d67b-441d-8737-2afaab3928f1 | WanDejun/vscode_cpp | Codeforces/Round 903/F.cpp | #include <bits/stdc++.h>
#define PII array<i64, 2>
#define MII multimap<i64, i64>
#define MSI multimap<string, i64>
#define SI multiset<i64>
#define VI vector<i64>
#define i64 long long
using namespace std;
const i64 N = 2e5 + 5;
const i64 MOD = 998244353;
struct Treenode {
i64 fa;
vector<i64> child;
} Tree[... | ALGO | 0.999777 | 4.271478 | {
"github_metadata": {
"branch": "master",
"commit_count": 34,
"repo_created_at": "2023-10-10T15:01:30.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "8af9a1fe1... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.