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 |
|---|---|---|---|---|---|---|---|
ef856e79-3291-4e72-b0da-79c1c5ef7ede | koi151/Numer-theory | (6) So Thuan Nguyen To.cpp | // Một số được coi là thuần nguyên tố nếu nó là số nguyên tố, tất cả các chữ số là nguyên tố và tổng chữ số của nó cũng là một số nguyên tố. Bài toán đặt ra là đếm xem trong một đoạn giữa hai số nguyên cho trước có bao nhiêu số thuần nguyên tố.
// Input Format
// Một dòng hai số nguyên dương tương ứng, cách nhau một ... | ALGO | 0.999729 | 5.341253 | {
"github_metadata": {
"branch": "main",
"commit_count": 33,
"repo_created_at": "2022-09-24T13:12:58.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 4,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "123701e7cb4... |
a2119fc8-5e17-41e1-a684-a04c0d54ffa3 | sania51/1-2-Project---Snake-Modify | snake.cpp | #include <dos.h>
#include <conio.h>
#include <windows.h>
#include <graphics.h>
#include <cstdio>
#include <cstring>
#include <iostream>
#include <vector>
using namespace std;
void help();
void game();
void check();
void dead();
void level();
void high();
void over();
int snake_x[500],snake_y[500],snake_size = 5,score,... | TOOL | 0.975236 | 3.449183 | {
"github_metadata": {
"branch": "master",
"commit_count": 1,
"repo_created_at": "2018-10-01T15:24:37.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "09c94fa44e... |
519959b5-714c-41e0-8e90-1992f12de613 | Edith-3000/Algorithmic-Implementations | Linked List/Pattern - In-place Reversal of a LinkedList/Reverse Every K-Element Sub-List - II.cpp | // Prob: Given a singly linked list, reverse the nodes of the linked list k at a time and return the head
// of the modified list. k is a positive integer and is less than or equal to the length of the
// linked list. If, in the end, you are left with a sub-list with less than ‘k’ elements, DON'T
// ... | ALGO | 0.999986 | 5.660379 | {
"github_metadata": {
"branch": "master",
"commit_count": 490,
"repo_created_at": "2020-07-24T04:49:45.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 9,
"forks": 4,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "655422c8... |
15b0954d-e3ec-49bd-804d-b16050b838e2 | NVIDIA-Omniverse/PhysX | blast/source/sdk/common/NvBlastMath.h | // Redistribution and use in source and binary forms, with or without
// modification, are permitted provided that the following conditions
// are met:
// * Redistributions of source code must retain the above copyright
// notice, this list of conditions and the following disclaimer.
// * Redistributions in binary... | TOOL | 0.929803 | 6.40376 | {
"github_metadata": {
"branch": "main",
"commit_count": 33,
"repo_created_at": "2022-10-04T09:07:32.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 4056,
"forks": 524,
"issues": 38,
"pull_requests": 8
},
"file_meta": {
"content_id": "bc114b... |
cf371aa1-fef6-4f1b-9e0d-bb7a25972246 | kawamurakazushi/AlogirthmAndDatastructures | 8Tree/treeWalk.cpp | #include <iostream>
#include <stdio.h>
#include <stdlib.h>
#include <cstring>
using namespace std;
const int MAX = 26;
struct Node {
int id, parent, left, right;
Node() {
this->id = -1;
this->parent = -1;
this->left = -1;
this->right = -1;
}
};
//根節点、左部分木、右部分木
void preord... | ALGO | 0.999992 | 4.309953 | {
"github_metadata": {
"branch": "master",
"commit_count": 20,
"repo_created_at": "2015-07-16T11:30: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": "6f386f5b9... |
1f8c752d-75a5-4d90-8bd9-b8c4f1bc0781 | Tudor67/Competitive-Programming | LeetCode/Problems/Algorithms/#337_HouseRobberIII_sol1_dp_36ms_22.1MB.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.99994 | 5.848915 | {
"github_metadata": {
"branch": "master",
"commit_count": 615,
"repo_created_at": "2020-02-27T19:56:49.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 5,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "692bad87... |
7eddee22-a784-442c-a274-3c1c5ebdb329 | alexandraback/datacollection | solutions_5753053697277952_1/C++/satwant/A.cpp | #include <bits/stdc++.h>
#define pb push_back
#define mp make_pair
#define F first
#define S second
using namespace std;
const int maxn = 30;
int main(){
ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);
int tests; cin >> tests;
for (int test=1;test<=tests;test++){
int n, tot = 0; cin >> n;
priority_queue< ... | ALGO | 0.999896 | 3.400032 | {
"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": "490d1e20c... |
c1f3e1b7-85e4-48ff-8431-8854779ce999 | Atharv157/leetcode-problems | 160.intersection-of-two-linked-lists.cpp | /*
* @lc app=leetcode id=160 lang=cpp
*
* [160] Intersection of Two Linked Lists
*/
// @lc code=start
/**
* Definition for singly-linked list.
* struct ListNode {
* int val;
* ListNode *next;
* ListNode(int x) : val(x), next(NULL) {}
* };
*/
class Solution {
public:
ListNode *getIntersection... | ALGO | 0.999933 | 5.804968 | {
"github_metadata": {
"branch": "main",
"commit_count": 52,
"repo_created_at": "2021-12-13T06:07:26.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "5ae34588ef3... |
cfa422fd-57f6-41ea-a6aa-a3b8797bfa7b | iamvickynguyen/Kattis-Solutions | builddeps.cpp | #include <bits/stdc++.h>
using namespace std;
typedef pair<int, int> pii;
typedef long long ll;
typedef vector<int> vi;
typedef vector<ll> vll;
typedef vector<vector<int>> vvi;
typedef priority_queue<int, vector<int>, greater<int>> minpq;
typedef unordered_set<int> usi;
typedef unordered_map<int, vi> ivi;
typedef unord... | ALGO | 0.999725 | 4.470096 | {
"github_metadata": {
"branch": "master",
"commit_count": 432,
"repo_created_at": "2019-11-12T01:25:10.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 8,
"forks": 2,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "31608fe3... |
29c357b7-621a-4d40-bbbb-8b85fc2ef20b | gudengxia/DataStructure | src/EQueen.cpp | #include "EQueen.h"
#include <cstring>
#include <stack>
#include <iostream>
using namespace std;
int EQueen::solve()
{
int num_of_solution = 0;
stack<Loc> s;
Loc cur, nextpos;
cur.i = cur.j = 0;
board[cur.i][cur.j] = true;
s.push(cur);
cout<<"Push:("<<cur.i<<","<<cur.j<<")"<<endl;
whil... | ALGO | 0.999497 | 3.854348 | {
"github_metadata": {
"branch": "main",
"commit_count": 27,
"repo_created_at": "2023-09-28T07:54:41.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "cf8d079e2d8... |
b84c3daa-7116-415a-ac7b-4f26a509e33b | grotekneus/ALDA_Taak_3 | secondgraph.cpp | #include "secondgraph.h"
#include <queue>
using namespace std;
secondGraph::secondGraph()
{
}
void secondGraph::addEdge(char source, char destination)
{
if(this->adjacencyList.find(source) != this->adjacencyList.end()){
this->adjacencyList[source].push_back(destination);
}
else{
std::vec... | ALGO | 0.999895 | 4.254175 | {
"github_metadata": {
"branch": "main",
"commit_count": 8,
"repo_created_at": "2023-12-08T16:42: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": "40a762aceb1e... |
517708b8-b1c4-4b75-bb2a-53307e622e2b | bi-an/algo-exercises | leecode/leetcode-cn/653.两数之和IV-输入BST.cpp | /*
* @Author: your name
* @Date: 2022-03-26 17:21:48
* @LastEditTime: 2022-03-26 17:21:48
* @LastEditors: Please set LastEditors
* @Description: 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
* @FilePath: \practice\leecode\leetcode-cn\653.两数之和IV-输入BST.cc
*/
/**
* ... | ALGO | 0.999997 | 6.315209 | {
"github_metadata": {
"branch": "master",
"commit_count": 792,
"repo_created_at": "2024-11-30T06:22: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": "a6e637a0... |
8f736a4c-28fc-4907-91b8-4a53577982ab | EduardFlorescu/AdventOfCode-2021 | Day 5/Day5.cpp | #define _CRT_SECURE_NO_WARNINGS
#include <iostream>
#include <string>
#include <vector>
#include <map>
using namespace std;
vector<int> split(string line, string delimiters = ",./;")
{
vector<int> words;
int index = line.find_first_of(delimiters);
words.push_back(stoi(line.substr(0, index)));
while (index != -1... | ALGO | 0.999846 | 4.432434 | {
"github_metadata": {
"branch": "main",
"commit_count": 20,
"repo_created_at": "2021-12-01T05:44:52.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "d35c5debac5... |
7ce7c24d-5562-434a-b1f5-b1fbf9a1f3f5 | chenlu11/ETH-Algorithms-Lab---AS16 | week6/a_new_hope3.cpp | // correct
// bitmask dp: dp[root-i][bitmask]
#include <array>
#include <iostream>
#include <map>
#include <vector>
struct center {
center(int n) {
sup = std::vector<uint16_t>(n, 0);
}
std::vector<uint16_t> sup;
std::map<uint16_t, std::map<int, int> > extsup;
std::map<int, int> be... | ALGO | 0.999854 | 4.372158 | {
"github_metadata": {
"branch": "master",
"commit_count": 1,
"repo_created_at": "2017-11-21T10:29: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": "e876da9d91... |
bad2ea9b-bd05-449e-86f7-95eb91dde75e | ltdt-apex/codeforces | question/neetcode/advanced_graphs/foreign-dictionary.cpp | #include <bits/stdc++.h>
using namespace std;
/*
abc
abd
add
100*100
a [b,d] -> b [c,d] -> c
-> d
-> d [d] -> d
*/
struct TrieNode{
vector<char> order;
TrieNode* child[26] = {nullptr};
TrieNode() {}
};
struct Trie{
TrieNode* root;
Trie(){
root = new TrieNod... | ALGO | 0.999965 | 4.657404 | {
"github_metadata": {
"branch": "master",
"commit_count": 274,
"repo_created_at": "2023-12-27T03:24: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": "3feb157e... |
2404a3d4-069f-40c7-a775-0a98c4cd2655 | kisho1131/Data-Structure-and-Algorithm | Stack/min-stack-constant-space.cpp | #include <bits/stdc++.h>
using namespace std;
stack<int> s;
int minEle = -1;
/*===========Your Code Here=============*/
void popMin() {
if (s.size() == 0)
return;
else if (s.top() < minEle) {
minEle = 2 * minEle - s.top(); // Moving Back to the Previous Element
s.pop();
} else
s.pop();
}
void push... | ALGO | 0.999955 | 4.180629 | {
"github_metadata": {
"branch": "main",
"commit_count": 7,
"repo_created_at": "2021-06-01T18:11: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": "1fee19b66ed3... |
db637cdf-a4dd-48da-a231-78d2d03024ba | ImnIrdst/ICPC-Practice-2015-TiZii | UVa/Comptitive Programming/Ch-05 Math/03 Combinatorics/Other/UVa 11538 - Chess Queen - AC.cpp | #include <iostream>
#include <algorithm>
using namespace std;
typedef unsigned long long int64;
int main(){
int64 n, m;
while(cin >> n >> m && (n||m)){
// 1. Just in Diags
int64 mn=min(m,n), mx=max(m,n), ans=0;
//this loop cause TLE We Can Compute it Straight forward
//for(int64 i = 1; i!=mn ; i++){
... | ALGO | 0.999869 | 3.931703 | {
"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": "062ae4323... |
6d1a3734-28de-4da7-a018-07d8e8305b71 | jmainpri/libmove3d-hri | src/Agent_State_Analysis.cpp | //
// C++ Implementation: Agent's States Analyses
//
// Description:
//
//
// Author: <NAME> <<EMAIL>>, (C) 2011
//
// Copyright: See COPYING file that comes with this distribution
//
#include <list>
#include <string>
#include <iostream>
#include <math.h>
#include <sys/time.h>
#include <map>
#include <Util-pkg.h>
#i... | ALGO | 0.95345 | 5.067741 | {
"github_metadata": {
"branch": "master",
"commit_count": 365,
"repo_created_at": "2014-05-27T22:36:12.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "0136d81e... |
0e63d9dd-a38c-4ad7-9d71-84e820e55d50 | liymouse/POJ | 21/3040/3040.cpp | #include <stdio.h>
#include <vector>
#include <algorithm>
using namespace std;
pair<int, int> a[30]; //first = d, sceond=num
int use[30] = { 0 };
int n, c;
int choose()
{
int t = 0;
memset(use, 0, sizeof(use));
for (int i = n - 1; i >= 0; i--)
if (a[i].second > 0)
{
while (a[i]... | ALGO | 0.99998 | 3.324186 | {
"github_metadata": {
"branch": "master",
"commit_count": 126,
"repo_created_at": "2021-11-16T02:41: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": "e49b4f55... |
cd404c98-0c97-4061-9a2a-7b14e4ae5b11 | FatimaZahra569/atelier_3 | programe3.cpp | #include <iostream>
using namespace std;
class complex{
protected :
double R ;
double I ;
public :
complex(double reel , double imagin){
R = reel;
I = imagin;
}
void display( complex a,char op, complex b){
complex c(0,0);
switch (op)
{
case '+':{
c.R = a.R + b.R;
c.I = a.I + b.I;
... | ALGO | 0.947044 | 3.715185 | {
"github_metadata": {
"branch": "main",
"commit_count": 2,
"repo_created_at": "2022-11-22T20:16:07.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "c5e2f7fdbaab... |
2365cab5-3c23-4353-8d87-13977650dee8 | Debashish-hub/Problems-Of-The-Day | GeeksFoGeeks/Add2NumbersRepresentedByLinkedlist.cpp | // Add two numbers represented by linked lists
// Given two numbers represented by two linked lists of size N and M. The task is to return a sum list.
// The sum list is a linked list representation of the addition of two input numbers from the last.
// { Driver Code Starts
// driver
#include <iostream>
#include <... | ALGO | 0.999578 | 5.630014 | {
"github_metadata": {
"branch": "main",
"commit_count": 60,
"repo_created_at": "2021-06-12T11:19:03.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "bb679257940... |
5354e339-7e27-43ea-975a-feba3c408aa0 | catboost/catboost | library/cpp/yt/compact_containers/compact_heap.h | #pragma once
#include "compact_vector.h"
namespace NYT {
////////////////////////////////////////////////////////////////////////////////
//! A heap structure optimized for storing elements inline
//! and with little memory overhead. See TCompactVector.
/*!
* When inline, uses linear search for selecting minimum
... | ALGO | 0.960279 | 7.101484 | {
"github_metadata": {
"branch": "master",
"commit_count": 49562,
"repo_created_at": "2017-07-18T05:29:04.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 8472,
"forks": 1231,
"issues": 604,
"pull_requests": 23
},
"file_meta": {
"content_id":... |
141c3371-1cae-43f0-8d75-159661809a90 | flizhou/data_structure_and_algorithm | worddice_network_flow/readoring.cpp | #include <iostream>
#include <vector>
#include <map>
#include <set>
#include <cstdio>
#include <fstream>
using namespace std;
class Graph{
public:
Graph(vector<string>&);
void Clean();
void ProcessWord(string&);
void Print();
private:
vector<string> diceNodes;
string word;
multimap<int, int> *edges;... | ALGO | 0.995189 | 4.222393 | {
"github_metadata": {
"branch": "master",
"commit_count": 1,
"repo_created_at": "2019-05-20T15:39: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": "5932d60c56... |
6db0c97a-c933-485d-ab28-fc873ef0c99c | Kawser-nerd/CLCDSA | Source Codes/CodeJamData/09/65/10.cc | // another fine solution by misof
// #includes {{{
#include <algorithm>
#include <numeric>
#include <iostream>
#include <sstream>
#include <string>
#include <vector>
#include <queue>
#include <set>
#include <map>
#include <stack>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <cctype>
#include <cass... | ALGO | 0.999728 | 3.872608 | {
"github_metadata": {
"branch": "master",
"commit_count": 20,
"repo_created_at": "2019-09-30T05:38:13.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 22,
"forks": 8,
"issues": 1,
"pull_requests": 0
},
"file_meta": {
"content_id": "53adcc9f... |
9a5047b1-d020-46ab-9e66-f5fc8b763ef2 | BenkangPeng/CS106L | code/lecture7_template/main.cpp | #include<iostream>
#include<list>
#include<vector>
#include<deque>
/* bad code , as not every container is indexable(like std::list) and has .size() method(like stack)
template <typename Collection , typename DataType>
int countOccurences(const Collection& c, DataType value) {
int count = 0;
for (size_t i = 0;... | TOOL | 0.961674 | 5.103282 | {
"github_metadata": {
"branch": "main",
"commit_count": 2,
"repo_created_at": "2025-02-16T13:48: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": "a615dcf638ec... |
94fc12fd-9ad6-492c-b55a-4be2e4bdc7db | jpmoreiradev/data-structure-cpp | revision/script01.cpp | #include <iostream>
using namespace std;
float height_ideal(float weight, char sexo) {
if(sexo != 'F' && sexo != 'M' && sexo != 'f' && sexo != 'm') {
cout << "sexo invalid ";
return 0;
}
if(sexo == 'F' || sexo == 'f') {
return 62.1 * weight - 44.7;
}
return 72.7 * weight - ... | ALGO | 0.989143 | 3.804948 | {
"github_metadata": {
"branch": "development",
"commit_count": 25,
"repo_created_at": "2022-08-04T17:32:10.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "a2d5... |
3d746d2a-7f78-4d1c-bad9-6408d2a2ceff | Anttwo/SuGaR | gaussian_splatting/SIBR_viewers/src/core/video/VideoUtils.cpp | /*
* Copyright (C) 2020, Inria
* GRAPHDECO research group, https://team.inria.fr/graphdeco
* All rights reserved.
*
* This software is free for non-commercial, research and evaluation use
* under the terms of the LICENSE.md file.
*
* For inquiries contact <EMAIL> and/or <EMAIL>
*/
#include "VideoUtils.hpp"
... | TOOL | 0.980236 | 5.062152 | {
"github_metadata": {
"branch": "main",
"commit_count": 31,
"repo_created_at": "2023-11-27T02:49:09.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2795,
"forks": 227,
"issues": 177,
"pull_requests": 3
},
"file_meta": {
"content_id": "6691... |
36ccb9c2-de2b-41c6-99ce-676c69bc058c | ishandutta2007/codeforces-m | maximumshot/normal/603/A.cpp | #include <iostream>
#include <cmath>
#include <math.h>
#include <vector>
#include <algorithm>
#include <stdio.h>
#include <cstring>
#include <string>
#include <set>
#include <map>
#include <stack>
#include <queue>
#include <tuple>
using namespace std;
#define vec vector
#define ALL(x) (x).begin(), (x).end()
#define m... | ALGO | 0.999952 | 3.827066 | {
"github_metadata": {
"branch": "main",
"commit_count": 1,
"repo_created_at": "2024-06-06T01:03:30.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "838026d21cd6... |
1ba65ca2-a28d-40f5-87d3-8d0632e8b4b4 | bgin/Radar-ElectroOptical-Simulation | dsp/GMS_32f_exp_32f.h |
#ifndef __GMS_32F_EXP_32F_H__
#define __GMS_32F_EXP_32F_H__
/*
Based on VOLK project.
Modified by <NAME> on:
Date: 09-10-2021 13:34AM +00200
contact: <EMAIL>
Few modification were added to original
implementation (ICC pragmas, alignment directives and code layout rescheduled,
unrolling c... | ALGO | 0.947418 | 4.496304 | {
"github_metadata": {
"branch": "master",
"commit_count": 5635,
"repo_created_at": "2019-09-27T18:45:54.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 62,
"forks": 21,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "2e77f... |
5c004531-3642-47b2-bd0c-806b329d4959 | evanjiang943/ash-parallel-tuning | code/m5_SH.cpp | #include <vector>
#include <string>
#include <iostream>
#include <queue>
#include <cstdlib>
#include <random>
#include <cmath>
#include <tuple>
#include <chrono>
#include <cmath>
#include "m5_neural_network.h"
// 1 variable hyperparameter (non-architecture related to ensure fixed NN architecture)
class Candidate {
p... | ALGO | 0.999524 | 5.369657 | {
"github_metadata": {
"branch": "master",
"commit_count": 8,
"repo_created_at": "2023-06-08T05:12: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": "56d7cb99d6... |
2b1c82be-52d8-48be-943e-23fea8b52818 | samarjeet/apocharmm | include/ConstantPressurePostDrift.h | // BEGINLICENSE
//
// This file is part of chcuda, which is distributed under the BSD 3-clause
// license, as described in the LICENSE file in the top level directory of this
// project.
//
// Author: <NAME>, <NAME>
//
// ENDLICENSE
/** \file
* \author <NAME> (<EMAIL>)
* \date
* \brief Recombine com coordinates and ... | ALGO | 0.991595 | 5.648234 | {
"github_metadata": {
"branch": "main",
"commit_count": 66,
"repo_created_at": "2024-03-17T04:48:33.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 9,
"forks": 4,
"issues": 2,
"pull_requests": 1
},
"file_meta": {
"content_id": "1541b34cd21... |
b666aa50-67ec-4f3f-897a-78fb65fafb42 | mostafa-saad/MyCompetitiveProgramming | Olympiad/POI/official/2008/code/per/prog/perb0.cpp | /*************************************************************************
* *
* XV Olimpiada Informatyczna *
* *
* Zadanie: Permu... | ALGO | 0.999984 | 3.822885 | {
"github_metadata": {
"branch": "master",
"commit_count": 439,
"repo_created_at": "2017-02-05T22:26:39.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 415,
"forks": 85,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "33bfa... |
98cf302b-cc76-4d10-a5b6-1e51d978c69a | harshraj22/problem_solving | solution/leetcode/51.cpp | // https://leetcode.com/problems/n-queens/
class Solution {
vector<vector<string>> ans;
bool isValid(vector<vector<string>> &matrix, int row, int col) {
// checks if matrix is valid, given that queen is placed at (row, col)
int n = matrix.size();
// to check if a point is inside the m... | ALGO | 0.999938 | 6.393713 | {
"github_metadata": {
"branch": "master",
"commit_count": 905,
"repo_created_at": "2019-06-22T06:58:09.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 20,
"forks": 5,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "3a379c4... |
eb68ffea-a39d-4c44-9e31-8d287d52ed7d | kevinbchen/cspsp | jge/Projects/cspsp/src/Collision.h | #ifndef _COLLISION_H_
#define _COLLISION_H_
#include "JGE.h"
#include "Person.h"
#include <vector>
#ifdef WIN32
#include <math.h>
#else
#include <fastmath.h>
#endif
#define max2(a,b) (((a) > (b)) ? (a) : (b))
#define min2(a,b) (((a) < (b)) ? (a) : (b))
#define EPSILON 0.000001f
struct Line... | ALGO | 0.974769 | 4.3398 | {
"github_metadata": {
"branch": "master",
"commit_count": 11,
"repo_created_at": "2012-11-25T02:20:28.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 42,
"forks": 11,
"issues": 3,
"pull_requests": 0
},
"file_meta": {
"content_id": "c18f7f3... |
67002771-a546-4e94-8893-1580e2056d79 | WhereIsHeroFrom/Algorithm | 树状数组/HDU 4046 PanDa.cpp | /*
题意:给定一个长度为 n(n <= 50000) 的数组 A,只由 b 和 w 组成,两种操作:
1) 0 L R: 找出区间 [L, R] 中有多少个 wbw;
2) 1 k ch:将第 k 个字符变成 ch;
题解:树状数组 / 单点更新
1)首先一遍预处理:
n = len - 2
如果连续3个字符是 bwb 则在对应的树状数组中插入1,否则就是 0
012 -> 1
123 -> 2
234 -> 3
k(k+1)(k+2... | ALGO | 0.999933 | 4.005413 | {
"github_metadata": {
"branch": "master",
"commit_count": 210,
"repo_created_at": "2020-10-24T04:32:58.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 25,
"forks": 5,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "6215c40... |
e7d9dab2-ee5f-4d14-b689-4ac9aaadab2c | saimon7g/CSE-208 | Practice/1.cpp | #include<bits/stdc++.h>
#define pb push_back
using namespace std;
vector<int> flag;
vector<vector<int> > graph;
vector<vector<int> > weight;
void bfs(int u)
{
queue<int> q;
q.push(u);
flag[u] = 1;
while (!q.empty())
{
int f = q.front();
q.pop();
for (auto i = graph[f].begi... | ALGO | 0.99962 | 4.370146 | {
"github_metadata": {
"branch": "main",
"commit_count": 2,
"repo_created_at": "2024-11-16T19:40: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": "11bcad43bed6... |
3abaa5db-8d4f-4074-a420-d68e7fc38da9 | wesleykepke/Programming_Questions | sorting_and_searching/11_1.cpp | /*
Name: <NAME>
11.1: You are given two sorted arrays, A and B, where A has large enough buffer
at the end to hold B. Write a method to merge B into A in sorted order.
*/
#include <iostream>
#include <stdlib.h>
#include <time.h>
using namespace std;
#define ASIZE 10
#define BSIZE 4
void merge(int* a, int* b, int aSiz... | ALGO | 0.999714 | 4.218395 | {
"github_metadata": {
"branch": "master",
"commit_count": 16,
"repo_created_at": "2015-01-20T02:26: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": "a1c33898d... |
8bd50c1e-f371-450c-8591-bdf857664385 | AyanPahari/General-Practice | 94-binary-tree-inorder-traversal/94-binary-tree-inorder-traversal.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.999996 | 6.330207 | {
"github_metadata": {
"branch": "main",
"commit_count": 218,
"repo_created_at": "2022-07-24T07:14:18.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "f6e04a1fde... |
ec4ef7e0-5e42-48ed-a55f-7b4009d7e93c | buihuytu/Ki2_Nam2 | OOP/ThucHanh1/Hcn.cpp | #include<bits/stdc++.h>
using namespace std;
class Rect{
private:
int nWidth, nHeight;
public:
void Input(){
cin >> nWidth >> nHeight;
}
void Init(int w, int h){
this->nWidth = w;
this->nHeight = h;
}
int Area(){
return this->nWidth * this->nHeight;
}
int IsSquare(){
if(this->nWidth == this->nHeight)... | ALGO | 0.994814 | 3.681702 | {
"github_metadata": {
"branch": "main",
"commit_count": 1,
"repo_created_at": "2025-01-13T07:57: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": "ec06fdb8e661... |
5ef3aed2-5ccb-41ce-b795-3ab9f3bcb95b | Return-name/100_Days_of_GFG_Problems | Solutions/D41_30_10_Kth_Element_in_Matrix.cpp | // { Driver Code Starts
// kth largest element in a 2d array sorted row-wise and column-wise
#include<bits/stdc++.h>
using namespace std;
#define MAX 1000
int mat[MAX][MAX];
int kthSmallest(int mat[MAX][MAX], int n, int k);
// driver program to test above function
int main()
{
int t;
cin>>t;
while(t--)
... | ALGO | 0.999873 | 5.924359 | {
"github_metadata": {
"branch": "main",
"commit_count": 138,
"repo_created_at": "2021-09-20T02:24: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": "11fb805c2c... |
b46c91de-f5b8-4aa6-9167-a192f9d03d0e | cyyself/OILife | Codeforces/1327F - AND Segments.cpp | #include <bits/stdc++.h>
using namespace std;
const long long mo = 998244353;
const int maxn = 5e5+5;
int l[maxn],r[maxn],x[maxn];
int rr[maxn],d[maxn],f[maxn];
int main() {
int n,k,m;
scanf("%d%d%d",&n,&k,&m);
for (int i=0;i<m;i++) scanf("%d%d%d",&l[i],&r[i],&x[i]);
long long ans = 1;
for (int b=0;b<k;b++) {
fo... | ALGO | 0.999966 | 4.642375 | {
"github_metadata": {
"branch": "master",
"commit_count": 1211,
"repo_created_at": "2017-08-23T07:03:57.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 8,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "7886f65... |
9f0c5666-d5bc-4b81-b8c0-1e2260343165 | VaishnavShelke/DS-Algo | BST/Check whether BST contains Dead End or not.cpp | #include<bits/stdc++.h>
using namespace std;
// Check whether BST contains Dead End or not
struct Node
{
int data;
struct Node *left, *right;
};
Node *newNode(int data)
{
Node *temp = new Node;
temp->data = data;
temp->left = temp->right = NULL;
return temp;
}
struct Node* insert(struct No... | ALGO | 0.999997 | 3.482083 | {
"github_metadata": {
"branch": "main",
"commit_count": 453,
"repo_created_at": "2020-12-06T05:14: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": "a6b407804b... |
437b636c-bb15-40f2-bc5a-6b589934cfd7 | vmware/concord-bft | bftengine/src/bcstatetransfer/SourceSelector.cpp | // Concord
//
// Copyright (c) 2019 VMware, Inc. All Rights Reserved.
//
// This product is licensed to you under the Apache 2.0 license (the "License").
// You may not use this product except in compliance with the Apache 2.0
// License.
//
// This product may include a number of subcomponents with separate copyright
... | ALGO | 0.937277 | 7.242056 | {
"github_metadata": {
"branch": "master",
"commit_count": 4650,
"repo_created_at": "2018-08-01T09:36:28.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 382,
"forks": 146,
"issues": 0,
"pull_requests": 55
},
"file_meta": {
"content_id": "949... |
e6016cb3-0e17-45cd-91cc-c16c5ea2da5e | sloppydomain/CP31 | 1400/24.cpp | #include <bits/stdc++.h>
using namespace std;
signed main() {
ios_base::sync_with_stdio(false);
cin.tie(nullptr);
cout.tie(nullptr);
int tt = 1;
// cin >> tt;
while (tt--) {
int n;
cin >> n;
vector<int> a(n);
for (int i = 0; i < n; i++) {
cin >> a[i];... | ALGO | 0.999912 | 4.008452 | {
"github_metadata": {
"branch": "master",
"commit_count": 7,
"repo_created_at": "2024-10-12T16:19: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": "1b3915d2a8... |
86b2c490-a9f2-415d-831c-3672322ffd5d | SimonFM/Label-Detection | LabelDetection.cpp | /*
* <NAME>
*
* Label Detection using OpenCV
*
* For my implementation I examined the images through the HLS channels
* and saw that the "best" way to detect a label was through the Luminance
* channel or the Saturation Channels and then caculated the Sd of those
* images in those channels. If they had a high ... | ALGO | 0.958749 | 5.230946 | {
"github_metadata": {
"branch": "master",
"commit_count": 3,
"repo_created_at": "2015-11-12T18:24: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": "4288e34d0f... |
d84db07d-e95d-4497-b046-c4ffb079d23b | faisal47/competitive-programming | HUST/ASC 6-7/under control.cpp | #include <bits/stdc++.h>
#define ms(a,b) memset(a,b,sizeof(a))
#define inf 1<<30
#define mp make_pair
#define pi acos(-1)
#define pii pair<int,int>
#define pll pair<ll,ll>
#define pli pair<ll,int>
#define pil pair<int,ll>
#define fs first
#define sc second
#define cffi ios_base::sync_with_stdio(0);cin.tie(0);cout.tie... | ALGO | 0.999829 | 3.681973 | {
"github_metadata": {
"branch": "master",
"commit_count": 1,
"repo_created_at": "2017-12-02T03:39:12.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "216b0f93be... |
73c19350-76eb-4076-9cbc-a34fbd63a1f0 | changxvv/icpc-lib | content/data-structures/FenwickTree.h | /**
* Author: <NAME>
* Date: 2009-10-30
* License: CC0
* Source: folklore/TopCoder
* Description: Computes partial sums a[0] + a[1] + ... + a[pos - 1], and updates single elements a[i],
* taking the difference between the old and new value.
* Time: Both operations are $O(\log N)$.
* Status: tested on Luogu
*/
... | ALGO | 0.999844 | 5.442334 | {
"github_metadata": {
"branch": "master",
"commit_count": 2,
"repo_created_at": "2022-11-29T02:02: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": "5fdfaf456c... |
d296ce2f-4faa-4fa2-aa74-7efd98c1abbc | GyuhoLee/PS | BOJ/16000/16637_괄호추가하기.cpp | #include <iostream>
#include <algorithm>
#include <string.h>
#include <vector>
#include <limits.h>
using namespace std;
int N;
int first;
int num[10];
char oper[10];
int answer = INT_MIN;
void input()
{
cin >> N >> first;
for (int i = 0; i < N / 2; i++)
{
cin >> oper[i] >> num[i];
}
}
int solve(int a, int b, ... | ALGO | 0.999956 | 3.701037 | {
"github_metadata": {
"branch": "master",
"commit_count": 700,
"repo_created_at": "2019-05-26T15:16:35.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "fff2cf5c... |
b5f2b0b3-9339-44ab-a4db-a816fc4b9d74 | wooseokyourself/Algorithm-Assignment | Assn1/1-3.CORRECT.cpp | #include <cstdio>
#include <cstdlib>
#define NO 0
#define YES 1
int main (int argc, char* argv[]) {
int t;
scanf ("%d", &t);
int* results = (int*) calloc (t, sizeof(int));
for (int CASE=0; CASE<t; CASE++) {
int N, C;
scanf ("%d %d", &N, &C);
int* lap = (int*) calloc (C, sizeof(... | ALGO | 0.999307 | 3.303416 | {
"github_metadata": {
"branch": "master",
"commit_count": 5,
"repo_created_at": "2020-04-12T15:40: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": "eabdf75685... |
fc186dc5-01c3-4144-ab8c-c538aab1e732 | LadaOndris/active-contours | src/snake.cpp | //
// Created by lada on 3/12/22.
//
#include <opencv2/core.hpp>
#include <opencv2/imgproc.hpp>
#include <utility>
#include <snake.h>
#include <contour.h>
Snake::Snake(Contour initialContour) : contour(std::move(initialContour)) {
}
double Snake::step(int windowSize, double weightElasticity, double weightSmoothness... | ALGO | 0.999853 | 5.94648 | {
"github_metadata": {
"branch": "main",
"commit_count": 26,
"repo_created_at": "2022-03-08T10:16:13.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 3,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "da7f3a79ae1... |
976736e0-7a4c-4212-b6c7-5a08f7c83323 | richard-ma/fhlnoip | ProblemSet/primarySchool/second/2010/4地震/quake_tju.cpp | #include <cstdio>
#include <string>
const int MAXN = 64;
const int INF = 1000000000;
int mp[MAXN][MAXN], vis[MAXN], q[MAXN];
int n;
int check(int ans) {
int qh, qt;
memset(vis, 0, sizeof(vis));
vis[0] = 1;
q[0] = 0;
for (qh = 0, qt = 1 ; qh < qt ; ++qh) {
if (q[qh] == n - 1) return 1;
for (int i = 0 ; i < n ... | ALGO | 0.999976 | 3.778064 | {
"github_metadata": {
"branch": "master",
"commit_count": 30,
"repo_created_at": "2015-01-05T08:06: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": "14c37768d... |
fe5c0101-4058-4cd7-a59a-64a7b2c38d0d | stopresent/BOJ | CodingTestStudy/Quest/1018. 체스판 다시 칠하기/체스판 다시 칠하기.cpp | #include <iostream>
#include <vector>
#include <list>
#include <stack>
#include <queue>
#include <map>
using namespace std;
char board[51][51];
int M, N;
int minCount = 80;
// 수가 작다
// 완전 탐색이 어울릴듯하다
// 이상적인 보드와 비교 -> 이상적인 보드가 되기위한 변경 개수 확인
void CheckMincount(int firstY, int firstX)
{
int changeCountInFirstBlack = ... | ALGO | 0.999917 | 3.979689 | {
"github_metadata": {
"branch": "master",
"commit_count": 817,
"repo_created_at": "2022-10-07T06:44:39.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "ed8d7062... |
2646a8ed-645a-4787-978d-f14d43d6efbf | David-Kuts/Cpp_Primer_Plus_Exurcises | Chapter16_Exercise_009/Exercise_009.cpp | // Exercise_009.cpp
#include <iostream>
#include <vector>
#include <list>
#include <ctime>
#include <algorithm>
#include <cstdlib>
int main() {
constexpr int SIZE = 1000000;
srand(time(0));
std::vector<int> vi0;
for (int i = 0; i < SIZE; i++) {
vi0.push_back(rand());
}
std::vector<int> vi(vi0.begin(), vi0.... | ALGO | 0.997793 | 5.782714 | {
"github_metadata": {
"branch": "master",
"commit_count": 121,
"repo_created_at": "2024-01-21T18:21: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": "ed456cbc... |
887048d7-df20-4c7e-8258-80e36ea1f83d | mlpack/mlpack | src/mlpack/core/tree/space_split/midpoint_space_split.hpp | /**
* @file core/tree/space_split/midpoint_space_split.hpp
* @author <NAME>
*
* Definition of MidpointSpaceSplit, to create a splitting hyperplane
* considering the midpoint of the values in a certain projection.
*
* mlpack is free software; you may redistribute it and/or modify it under the
* terms of the 3-cl... | ALGO | 0.998506 | 7.365342 | {
"github_metadata": {
"branch": "master",
"commit_count": 30653,
"repo_created_at": "2014-12-17T18:16:59.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 5396,
"forks": 1663,
"issues": 16,
"pull_requests": 9
},
"file_meta": {
"content_id": "... |
84eed6dd-730b-4768-9195-5d9a302dc400 | kaamyk/CPP | CPP02/ex03/sources/bsp.cpp | /* ************************************************************************** */
/* */
/* ::: :::::::: */
/* bsp.cpp :+: :+: :+: ... | ALGO | 0.998344 | 5.373509 | {
"github_metadata": {
"branch": "main",
"commit_count": 171,
"repo_created_at": "2023-07-28T12:27: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": "9d56de38a0... |
d8a7cc22-2459-4047-a972-18783b901da6 | shresthkapila/WalkSAT-and-Resolution-Proving | a5/main.cpp | #include <iostream>
#include <stdlib.h>
#include <string>
#include <fstream>
#include <sstream>
#include <vector>
#include <set>
#include <cstdlib>
#include <assert.h>
using namespace std;
#include "propositionalTP.h"
#include "walksat.h"
// splitting a string using delementer : https://www.techiedelight.com/split-st... | ALGO | 0.999054 | 4.245957 | {
"github_metadata": {
"branch": "master",
"commit_count": 2,
"repo_created_at": "2020-08-26T20:53: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": "8da9c042d5... |
44d04d22-fba0-46f9-a3ca-630dabd7037c | YeonWon123/2019_summer_algorithm | Week 3/1. 분할 정복/2132 나무 위의 벌레 (명원 준비)/윤원_나무_위의_벌레.cpp | #include <iostream>
#include <vector>
#include <queue>
using namespace std;
typedef struct M {
int loc, p; // loc = 위치, p : 가중치
} M;
typedef struct item {
int from, to;
} item;
vector <int> con[10001];
M dp[3][10001]; // dp[2][x] = 윗 방향으로 갔을 때..
queue<item> Q;
int arr[10001];
char visit[10001];
// 동적계획법을 사용한 dfs
... | ALGO | 0.99998 | 4.217063 | {
"github_metadata": {
"branch": "master",
"commit_count": 144,
"repo_created_at": "2019-06-05T17:20: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": "21eb39f0... |
e2256759-145b-4337-89f9-f16046615c0b | hanstarj/algo | Leetcode/843_GuessTheWord.cpp | #include <string>
#include <vector>
#include <array>
#include <algorithm>
#include <iostream>
using namespace std;
// This is the Master's API interface.
// You should not implement it, or speculate about its implementation
// class Master
// {
// public:
// int guess(string word);
// };
class Solution
{
public:
... | ALGO | 0.990703 | 4.586565 | {
"github_metadata": {
"branch": "master",
"commit_count": 52,
"repo_created_at": "2019-08-29T22:18: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": "5a29cfb4d... |
8ee1fe46-2510-42e6-b3ab-83c6612501b6 | nandlalKumar-Code/LeetCodeNGfg | Construct a Full Binary Tree - GFG/construct-a-full-binary-tree.cpp | //{ Driver Code Starts
//Initial Template for C++
#include<bits/stdc++.h>
using namespace std;
struct Node
{
int data;
struct Node *left;
struct Node *right;
Node(int x){
data = x;
left = NULL;
right = NULL;
}
};
// } Driver Code Ends
/* Structre of the Node of the Binary Tree is as follows
str... | ALGO | 0.999967 | 6.082564 | {
"github_metadata": {
"branch": "main",
"commit_count": 231,
"repo_created_at": "2022-10-23T05:15: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": "68139ff68d... |
5a030287-082e-44f9-b433-7885cadc66e6 | ishant9805/DSA-LearnAndPractice | leetCode/6. Linked List/1. Easy/reverseList.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) {}
};
// Iterative Method
// ListNode* reverseList(ListNode *head)
// {
// ... | ALGO | 0.999853 | 5.335356 | {
"github_metadata": {
"branch": "main",
"commit_count": 363,
"repo_created_at": "2023-09-06T04:11:58.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 3,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "f53daa6b67... |
2b5e2687-1a2f-49db-97bb-dc269f0e6fc6 | kai-wei-kfuse/vscode | 2023/202302/0205/M2.cpp | #include <bits/stdc++.h>
using namespace std;
#define IOS ios::sync_with_stdio(0), cin.tie(0), cout.tie(0)
int next_[101];
string s[101];
int kmp(string a, string b) {
int tlen = a.size();
int slen = b.size();
// cout << a << endl << b << endl;
a = "?" + a;
b = "?" + b;
for (int i = 2, j = 0; ... | ALGO | 0.999989 | 3.603146 | {
"github_metadata": {
"branch": "c++",
"commit_count": 42,
"repo_created_at": "2023-03-25T03:45:33.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "73ffe2fe2106... |
b29d37db-6402-45b2-afd7-77a64f92be14 | avgorshk/cuda-2025 | 3822B1FI1/5_block_gemm_omp/drozhdinov_dmitriy/block_gemm_omp.cpp | #include "block_gemm_omp.h"
std::vector<float> BlockGemmOMP(const std::vector<float>& a,
const std::vector<float>& b,
int n) {
std::vector<float> c(n * n);
constexpr int block_size = 16;
int block_count = n / block_size;
#pragma omp parallel for ... | ALGO | 0.993985 | 5.910749 | {
"github_metadata": {
"branch": "main",
"commit_count": 512,
"repo_created_at": "2025-02-22T07:45: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": "aeace33e09... |
ad25e1eb-6876-45d3-9b86-343d0a8cf110 | RohiniKanherkar/DAA | Kruskal Algorithm.cpp | #include <bits/stdc++.h>
#include<cstring>
#include<iostream>
using namespace std;
class Edge
{
public:
int src, dest, weight;
};
class Graph
{
public:
int V , E;
Edge* edge;
};
Graph* createGraph(int V, int E)
{
Graph* graph = new Graph;
graph->V = V;
graph->E = E;
graph->edge = new ... | ALGO | 0.999988 | 5.002058 | {
"github_metadata": {
"branch": "main",
"commit_count": 17,
"repo_created_at": "2023-08-04T03:23: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": "5d47e56bcfa... |
fd3b30c1-32e8-4af3-bada-d550e78a30b8 | ishita-gambhir/Cplusplus | Searching and Sorting/AggresiveCows.cpp | /* <NAME> has built a new long barn, with N (2 <= N <= 100,000) stalls.
The stalls are located along a straight line at positions x1,…,xN (0 <= xi <=
1,000,000,000).
His C (2 <= C <= N) cows don't like this barn layout and become aggressive
towards each other once put into a stall. To prevent the cows from hurting
eac... | ALGO | 0.999975 | 4.145187 | {
"github_metadata": {
"branch": "master",
"commit_count": 180,
"repo_created_at": "2018-12-24T11:09:29.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 9,
"forks": 1,
"issues": 5,
"pull_requests": 0
},
"file_meta": {
"content_id": "30ff8693... |
685f7ff5-d21e-4509-b446-6fe44d67abe6 | ishandutta2007/codeforces-e | ei133333/normal/777/C.cpp | #include<bits/stdc++.h>
using namespace std;
const int INF = 1 << 30;
int main()
{
int n, m, q;
cin >> n >> m;
vector< vector< int > > a(n, vector< int >(m));
vector< int > range(n, -INF);
vector< int > bigs(n, -INF);
for(int i = 0; i < n; i++) {
for(int j = 0; j < m; j++) {
cin >> a[i][j];
... | ALGO | 0.999982 | 4.005893 | {
"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": "52d97ff1ad65... |
b212575c-7d65-4b1a-9aa2-27930271743e | urszula-salter/HuffmanCodeGenerator | HuffamannCodeGenerator.cpp | #include <iostream> // Include input/output stream library
#include <string> // Include string library
using namespace std; // not a good practice but a little less tying
const int basicASCIIrange = 128; // Maximum number of characters (ASCII range)
// Node class representing a node in a tree
class Node {
private:
... | ALGO | 0.999997 | 5.323696 | {
"github_metadata": {
"branch": "main",
"commit_count": 3,
"repo_created_at": "2023-08-27T14:53: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": "e6a6c6c8fa7b... |
5dc72fba-e8a3-4011-87ab-1d94c370edab | JJJoonngg/Algorithm | 백준/2473_저울.cpp | /*
https://www.acmicpc.net/problem/2437
문제
하나의 양팔 저울을 이용하여 물건의 무게를 측정하려고 한다. 이 저울의 양 팔의 끝에는 물건이나 추를 올려놓는 접시가 달려 있고, 양팔의 길이는 같다.
또한, 저울의 한쪽에는 저울추들만 놓을 수 있고, 다른 쪽에는 무게를 측정하려는 물건만 올려놓을 수 있다.
무게가 양의 정수인 N개의 저울추가 주어질 때, 이 추들을 사용하여 측정할 수 없는 양의 정수 무게 중 최솟값을 구하는 프로그램을 작성하시오.
예를 들어, 무게가 각각 3, 1, 6, 2, 7, 30, 1인 7개의 저울추가 주어졌을 ... | ALGO | 0.999968 | 3.960421 | {
"github_metadata": {
"branch": "master",
"commit_count": 92,
"repo_created_at": "2019-07-09T15:05:33.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "1c40ad574... |
508b3fa1-6327-4680-b3fd-51f462a5a609 | armst297/csc317_assignment3 | src/Plane.cpp | #include "Plane.h"
#include "Ray.h"
#include <cmath>
#include <Eigen/Geometry>
//
bool Plane::intersect(
const Ray & ray, const double min_t, double & t, Eigen::Vector3d & n) const
{
////////////////////////////////////////////////////////////////////////////
// Replace with your code here:
// My code here
... | ALGO | 0.984903 | 5.879208 | {
"github_metadata": {
"branch": "master",
"commit_count": 48,
"repo_created_at": "2022-09-13T02:29: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": "80eb7df7e... |
5311d313-1757-4d3d-9fb2-faf5b2fbf88d | erikjloo/Advent-of-code-2022 | day 13/distress_signal.cpp | #include <fstream>
#include <iostream>
// #include <list>
#include <regex>
#include <iterator>
#include <algorithm>
class List
{
private:
class Node
{
public:
int *int_ptr;
List *list_ptr;
Node *prev;
Node *next;
public:
Node() : list_ptr(nullptr), int_ptr(nullp... | ALGO | 0.96602 | 4.781618 | {
"github_metadata": {
"branch": "main",
"commit_count": 35,
"repo_created_at": "2022-12-04T02:34: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": "7b306efc7b5... |
c6ad0b77-5ed8-41a7-9d26-faf4a383e6ec | falconlee236/Algorithm_Practice | BaekJoon/9252.cpp | /*9252*/
/*Cheating*/
#include <iostream>
#include <algorithm>
#include <string>
#include <stack>
using namespace std;
int lcs[1001][1001];
int main(){
string a, b; cin >> a >> b;
for(int i = 1; i <= a.size(); i++){
for(int j = 1; j <= b.size(); j++){
char x = a[i - 1], y = b[j - 1];
... | ALGO | 0.999998 | 3.563027 | {
"github_metadata": {
"branch": "main",
"commit_count": 828,
"repo_created_at": "2021-07-30T10:24:37.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "df610fb031... |
b7ef02fd-0a95-4992-a548-8d3ccb995980 | wizleysw/backjoon | 2178/solve.cpp | // https://www.acmicpc.net/problem/2178
// 미로 탐색
// Written in C++ langs
// 2020. 02. 24.
// Wizley
#include <iostream>
#include <algorithm>
#include <string>
#include <vector>
#include <cmath>
#include <cstring>
#include <queue>
using namespace std;
int ARR[101][101]={0,};
int VISITED[101][101]={0,};
int N, M;
int ... | ALGO | 0.999992 | 3.875855 | {
"github_metadata": {
"branch": "master",
"commit_count": 506,
"repo_created_at": "2019-12-28T07:51: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": "9d30cfc1... |
465ca94e-5aa5-4799-97f6-3df6d34ea2ac | fengzhenHIT/learnOpenCV4 | 代码/chapter3/myMeanAndmearStdDev.cpp | #include <opencv2\opencv.hpp>
#include <iostream>
#include <vector>
using namespace std;
using namespace cv;
int main()
{
system("color F0"); //更改输出界面颜色
float a[12] = { 1, 2, 3, 4, 5, 10, 6, 7, 8, 9, 10, 0 };
Mat img = Mat(3, 4, CV_32FC1, a); //单通道矩阵
Mat imgs = Mat(2, 3, CV_32FC2, a); //多通道矩阵
cout << "/* 用me... | TOOL | 0.988375 | 4.018402 | {
"github_metadata": {
"branch": "master",
"commit_count": 5,
"repo_created_at": "2020-04-05T14:51:10.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 289,
"forks": 131,
"issues": 5,
"pull_requests": 0
},
"file_meta": {
"content_id": "cdc34a... |
5e5f5401-ab65-4307-beed-32ab47a020be | beingbing/pathshala-problems | 19GraphAlgorithms/20Assignment02/2_he_connected-comps.cpp | #include <iostream>
#include <vector>
using namespace std;
class Solution {
void dfs(int node, vector<int>& visited, vector<vector<int>>& adj) {
if (visited[node]) return;
visited[node] = 1;
for (int i{0}; i < adj[node].size(); i++)
dfs(adj[node][i], visited, adj);
}
publi... | ALGO | 0.999942 | 5.164883 | {
"github_metadata": {
"branch": "main",
"commit_count": 1324,
"repo_created_at": "2021-08-10T11:54: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": "3647fa3ae... |
474c2d26-606b-463e-8b25-e5ebf0c659c2 | cym2018/TheCProgrammingLanguage | Chapter 1/Exercise 1-14.cpp | #include<stdio.h>
#define WORD 0
#define BLANK 1
#define MAXSIZE 256
int main();
void input(int[]);
void output(int[]);
int maxNumber(int[]);
int main() {
// Exercise 1-14
// 写一个函数输出不同字符的输入频率
// Write a program to print a histogram of the frequencies of different characters in its input.
int data[MAXSIZE];
input(d... | ALGO | 0.99974 | 3.046407 | {
"github_metadata": {
"branch": "master",
"commit_count": 9,
"repo_created_at": "2020-02-27T10:51: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": "d01a0f4564... |
75048e8a-3410-4634-b314-49aeb992cd0c | yuancf1024/algorithm-go | 笔试/Bilibili0901/T1.cpp | #include <bits/stdc++.h>
/**
* @brief
* 输入n,1-n的范围内,有多少个num,
* num要满足num = a^2 + b^3 + c^4,abc均为质数。
* 输出这样的num的个数
*
* 神奇数字num = a^2+b^3+c^4且a、b、c都是质数
* 想知道1-n中有多少个神奇数字
* 1<=t<=10^5, 1<=n<=10^6
*
*/
/*
pass 20%
大佬AC代码 参考Refer1.cpp
感觉思路也差不多,为什么我的代码只能过20%
我用的是暴力模拟,即使出错,也只会报超时;
但是Pass 0% 是为什么?
C++ int的范围已经... | ALGO | 0.99971 | 4.066942 | {
"github_metadata": {
"branch": "master",
"commit_count": 700,
"repo_created_at": "2021-12-18T07:50:38.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 3,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "259c2be7... |
94e165bf-5375-4d3c-8196-f4737083fd5b | TM-Tareq/Phitron-Problem-Solving | Batch 6/c++/Final Exam/sortItAgain.cpp | #include<bits/stdc++.h>
using namespace std;
// Structure to store student data
struct Student {
string name;
int cls;
char section;
int id;
int math_marks;
int eng_marks;
};
// Comparator function for sorting
bool compare(Student a, Student b) {
if (a.eng_marks != b.eng_marks) // Compare ... | ALGO | 0.99916 | 5.416316 | {
"github_metadata": {
"branch": "main",
"commit_count": 27,
"repo_created_at": "2025-07-14T05:11:16.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "ab307a55461... |
e3eaccef-852f-47b3-ae22-a3e93d6d51af | sakshamrathi21/Competitive_Programming | problems_solved/line_segment_intersection.cpp | #include<bits/stdc++.h>
using namespace std;
#define ll long long
long double epsilon = 1e-9;
bool intersect(long double x1, long double y1, long double x2, long double y2, long double x3, long double y3, long double x4, long double y4) {
long double check_same = (y2-y1)*(x3-x1) - (x2-x1)*(y3-y1), check_same4 = (... | ALGO | 0.994211 | 4.806077 | {
"github_metadata": {
"branch": "main",
"commit_count": 144,
"repo_created_at": "2023-10-09T11:34:28.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "50f507d630... |
e9fb0a8d-053c-451b-a663-025dbc14e688 | Stiffstream/sobjectizer | doxygen/dox/so_5/so_5_5__in_depth_priority_of_agents.dox | /*!
\page so_5_5__in_depth_priority_of_agents so-5.5 In Depth - Priorities of Agents
\section so_5_5__in_depth_priority_of_agents__intro Intro
A new feature was introduced in v.5.5.8 -- agentís priorities. Every agent now
has a priority. Priority is just an optional mark for dispatchers. Some
dispatcher can use this... | ALGO | 0.943523 | 5.436523 | {
"github_metadata": {
"branch": "master",
"commit_count": 1144,
"repo_created_at": "2019-05-16T08:45:51.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 542,
"forks": 49,
"issues": 11,
"pull_requests": 0
},
"file_meta": {
"content_id": "482d... |
16f8e842-0f08-4b31-9128-7d6873c53354 | danielx285/Bard-X-ChatGPT-Competitive-Programming-Analysis | CodeForces/CodeForces Round 906(div 2)/A/gpt/gpt-1.cpp | #include <iostream>
#include <vector>
#include <algorithm>
bool isGoodArray(const std::vector<int>& a) {
int n = a.size();
if (n < 2) {
return true; // Trivially good
}
// Sort the array to make it easier to check
std::vector<int> sorted_a = a;
std::sort(sorted_a.begin(), sorted_a.end(... | ALGO | 0.999933 | 6.689679 | {
"github_metadata": {
"branch": "main",
"commit_count": 30,
"repo_created_at": "2023-07-11T05:14:44.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "ce7e1d65b80... |
61e88f17-fcee-4513-b00c-4fe9ae24098c | ishandutta2007/codeforces-a | a_g/normal/1666/J.cpp | #include <bits/stdc++.h>
using namespace std;
const int N = 203;
const long long INF = 1e18;
int c[N][N];
long long csum[N][N];
pair<long long, int> dp[N][N];
int par[N];
int main () {
ios_base::sync_with_stdio(0); cin.tie(0);
int n;
cin >> n;
for (int i = 0; i < n; i++) {
for (int j = 0; j < n; j++) {
... | ALGO | 0.999966 | 3.815522 | {
"github_metadata": {
"branch": "main",
"commit_count": 4,
"repo_created_at": "2024-04-11T00:51: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": "845fa0f6b562... |
47a216c1-3be7-430b-b841-47acfb7f002f | kimnamlhn/NMLT-HCMUS | 18120468_week02/baitap7/baitap7.cpp | #include <stdio.h>
#include <conio.h>
int main(void)
{
float l, tien;
printf("Nhap so km di taxi: ");
scanf_s("%f", &l);
if ((l > 0) && (l <= 1))
{
tien = l * 15000;
}
else if ((l > 1) && (l <= 5))
{
tien = (l - 1) * 13500 + 15000 * 1;
}
else if (l > 5)
{
tien = 15000 * 1 + 4 * 13500 + (l - 5) * 11000;... | ALGO | 0.992006 | 3.046932 | {
"github_metadata": {
"branch": "main",
"commit_count": 5,
"repo_created_at": "2020-10-26T14:05: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": "f6502cacaaf3... |
466e92f2-e65b-47b7-9791-dbda03a88408 | Nrydo/BQP-Analize | methods/grasp.h | #pragma once
#include "../matrix_utils.h"
#include <random>
#include <algorithm>
#include <vector>
#include <utility>
namespace GRASP {
inline std::vector<int> ConstructGreedyRandomizedSolution(const Matrix& Q, double alpha, std::mt19937& gen) {
int n = Q.size();
std::vector<int> solution(n, 0);
... | ALGO | 0.999982 | 6.317723 | {
"github_metadata": {
"branch": "main",
"commit_count": 7,
"repo_created_at": "2025-05-21T21:13:35.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "82e188592afa... |
99d3e9f2-b842-45f4-9572-abbbecc930ff | TranTrongHung123/CodePtit-Cpp | BienDoiMaTran.cpp | #include <bits/stdc++.h>
#define endl "\n"
using namespace std;
typedef long long ll;
const int mod = 1e9 + 7;
int main(){
ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);
int TC;
cin >> TC;
while(TC--){
int n;
cin >> n;
int a[n][n];
int sum_matrix = 0; // Luu tong cac phan tu cua ma tran
for(int i... | ALGO | 0.999974 | 5.17501 | {
"github_metadata": {
"branch": "master",
"commit_count": 6,
"repo_created_at": "2024-12-24T15:22: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": "7c53261c6f... |
6338befa-759d-44be-b6d9-13fc7dd8b23a | Brightlpf/MY-LEARN | cpp/C++PrimerPlus/chapter11/randwalk.cpp | #include "vector.h"
#include <cstdlib>
#include <ctime>
#include <iostream>
#include <fstream>
//#include <unistd.h> //for debug
//const int DEST = 50;
const int UNIT = 2;
const double PI = 3.1415926;
int main()
{
using namespace VECTOR;
using namespace std;
ofstream fout;
fout.open("walkerstep.log");
//if(!... | ALGO | 0.997961 | 3.928745 | {
"github_metadata": {
"branch": "master",
"commit_count": 4,
"repo_created_at": "2016-10-09T12:29:03.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "31365e564f... |
01a4ed06-2c1c-4e6c-bacb-ccc73003d2d8 | SunaShen/my_leetcode | leetcode/221_maximalSquare.cpp | // @File : 221_maximalSquare.cpp
// @Source : https://leetcode-cn.com/problems/maximal-square/
// @Title : 221. 最大正方形
// @Auther : sun_ds
// @Date : 2020/3/19
/** 题目描述:
在一个由 0 和 1 组成的二维矩阵内,找到只包含 1 的最大正方形,并返回其面积。
示例:
输入:
1 0 1 0 0
1 0 1 1 1
1 1 1 1 1
1 0 0 1 0
输出: 4
*/
/**
*... | ALGO | 0.999946 | 5.957578 | {
"github_metadata": {
"branch": "master",
"commit_count": 100,
"repo_created_at": "2019-12-03T15:30:40.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2,
"forks": 2,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "f2490be0... |
45caa572-988e-40d2-8c7f-d1d4fb25f48a | ahsanromeo/Works-with-UVA-Online-Judge | UVA Online Judge ( ahsan_romeo )/147.cpp | /// /* <NAME> *\\
/// <NAME>
/// Khulna University
/// CSE Discipline
#include <bits/stdc++.h>
using namespace std;
typedef long long lng;
typedef unsigned long long ulng;
const int iinf = 1 << 30;
const long long linf = 1LL << 62;
const double eps = 1e-6, PI = acos(-1.0), ee = 2.71828182845904523536, dinf = (double)... | ALGO | 0.998678 | 3.019126 | {
"github_metadata": {
"branch": "master",
"commit_count": 4,
"repo_created_at": "2016-04-22T04:53: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": "4d5fb6a59f... |
9c297cb1-1130-403d-8ba4-441aabfe7f66 | Jo-Minseok/algorithm-problem | 백준/Bronze/17293. 맥주 99병/맥주 99병.cc | #include <iostream>
#include <string>
using namespace std;
int main()
{
ios_base::sync_with_stdio(false);
cin.tie(NULL);
cout.tie(NULL);
int num;
cin >> num;
for (int i = num; i >= 0; i--)
{
if (i == 0) {
cout << "No more";
}
else {
cout << i... | ALGO | 0.999147 | 4.264887 | {
"github_metadata": {
"branch": "study",
"commit_count": 828,
"repo_created_at": "2022-03-04T19:35: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": "12987a54b... |
e91da390-6e86-40fd-b873-77b5c5ac8689 | CamiloSilva98/Info2 | info2/Lab2/Problema2_7/main.cpp | #include <iostream>
using namespace std;
// Función para eliminar caracteres repetidos de una cadena
void eliminarRepetidos(const char* original, char* sinRepetidos) {
bool visto[256] = { false };
int j = 0;
for (int i = 0; original[i] != '\0'; ++i)
{
char c = original[i];
if (!visto[(un... | ALGO | 0.998668 | 4.908432 | {
"github_metadata": {
"branch": "main",
"commit_count": 38,
"repo_created_at": "2023-09-02T18:38:32.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "e6f2d0c0c3f... |
68de302e-1a7b-4ff3-9039-61f7ff4ad3ac | polymake/polymake | apps/polytope/src/cocircuit_equations.cc | /* Copyright (c) 1997-2024
<NAME>, <NAME>, and the polymake team
Technische Universität Berlin, Germany
https://polymake.org
This program is free software; you can redistribute it and/or modify it
under the terms of the GNU General Public License as published by the
Free Software Foundation; either v... | ALGO | 0.995726 | 5.410394 | {
"github_metadata": {
"branch": "Releases",
"commit_count": 36,
"repo_created_at": "2014-03-29T14:19:53.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 80,
"forks": 13,
"issues": 1,
"pull_requests": 0
},
"file_meta": {
"content_id": "d7b08a... |
0c41550a-5cf6-44b6-a0f1-8d3b5751294c | dldydrhkd/Data_Structure | Tree1/P3.cpp | #include <iostream>
#include <vector>
using namespace std;
template <typename T>
class GeneralTree;
template <typename T>
class Node{
private:
T data;
int depth;
Node *par;
vector<Node*> chi;
public:
Node(){
this->data = NULL;
this->par = NULL;
this->depth = 0;
}
Node(T data){
... | ALGO | 0.999983 | 4.007597 | {
"github_metadata": {
"branch": "master",
"commit_count": 11,
"repo_created_at": "2020-09-11T09:06: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": "3d78a2d72... |
fdebf3da-532d-49a7-9b25-636b44063d13 | ipomanyeah/oj | lqdoj/kntt10t135lt3.cpp | #include <bits/stdc++.h>
typedef long long ll;
typedef long double ld;
typedef unsigned long long ull;
#define all(a) (a).begin(), (a).end()
template <typename T> using v = std::vector<T>;
template <typename T> using umset = std::unordered_multiset<T>;
template <typename T> using mset = std::multiset<T>;
template <type... | ALGO | 0.999297 | 4.121486 | {
"github_metadata": {
"branch": "main",
"commit_count": 13,
"repo_created_at": "2025-04-05T15:16:52.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "f59d94dfe2a... |
91bb2741-d7c4-4b70-aeb5-a1456b25de30 | ydb-platform/ydb | ydb/library/yaml_config/yaml_config_parser.h | #pragma once
#include <ydb/core/protos/config.pb.h>
#include <ydb/library/yaml_config/protos/config.pb.h>
#include <ydb/library/yaml_config/protos/blobstorage_config.pb.h>
#include <library/cpp/json/writer/json_value.h>
#include <library/cpp/protobuf/json/json2proto.h>
#include <library/cpp/yaml/as/tstring.h>
#inclu... | CONFIG | 0.946402 | 7.374911 | {
"github_metadata": {
"branch": "main",
"commit_count": 35208,
"repo_created_at": "2022-02-07T14:52:36.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 4512,
"forks": 701,
"issues": 2263,
"pull_requests": 682
},
"file_meta": {
"content_id": ... |
31805d18-2372-4914-a4d0-b05a5f9f6793 | unwxnted/sortingSimulator | creator.cpp | #include<bits/stdc++.h>
#include "vars.h"
using namespace std;
vector <int> v;
vector <vector <char> > m = vector<vector<char> >(2, vector<char>(2));
void createVector()
{
v.resize(longitudDelArray);
for(int i = 0; i < longitudDelArray; ++i)
{
v[i] = i+1;
}
// (1.2 + (rand()% 2))
for... | ALGO | 0.996055 | 3.018863 | {
"github_metadata": {
"branch": "main",
"commit_count": 12,
"repo_created_at": "2022-10-21T10:21:24.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "b752b95060b... |
898bfad2-1fb4-42ea-a8ea-4072410b4631 | K1ethoang/DataStruct-Algorithm-for-Beginner | Datastruct/5. Tree/Binary Tree/ly_thuyet/Khaibao_khoitao_duyet/1. Truoc(NLR-NRL)/1_khaibao_khoitao_duyet_NLR.cpp | #include <iostream>
using namespace std;
// ! Đề: nhập vào cây nhị phân các số nguyên. Xuất ra màn hình các phần tử của cây nhị phân
struct Node
{
int data;
Node *pLeft;
Node *pRight;
};
void createTree(Node *&root)
{
root = NULL;
}
// hàm thêm
void add(Node *&root, const int &value)
{
// node r... | ALGO | 0.999875 | 3.927722 | {
"github_metadata": {
"branch": "main",
"commit_count": 95,
"repo_created_at": "2021-11-22T15:13:44.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 4,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "6ddf059e8ab... |
c5408627-f37a-45cc-8223-0b7186798520 | JRazek/DSA | data_structures/SparseTable.h | #ifndef SPARSE_TABLE_DSJR
#define SPARSE_TABLE_DSJR
#include <cmath>
#include <vector>
namespace stjr{
//O(1) query time
//O(nlogn) space
//O(nlogn) preprocess
template<
typename T = int64_t,
typename Y = void*,
typename AssocFunc = std::greater<T>,
typename = typename... | ALGO | 0.998237 | 6.34767 | {
"github_metadata": {
"branch": "master",
"commit_count": 65,
"repo_created_at": "2020-11-01T21:48:44.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "708a70a0d... |
593c2e7e-c658-442e-9775-bc83ce65385f | Juseong-Bang/algorithms | 12761.cpp | /*
문제
동규와 주미는 일직선 상의 돌 다리 위에있다. 돌의 번호는 0 부터 100,000 까지 존재하고 동규는 N번 돌 위에, 주미는 M번 돌 위에 위치하고 있다. 동규는 주미가 너무 보고싶기 때문에 최대한 빨리 주미에게 가기 위해 A,B 만큼의 힘을 가진 스카이 콩콩을 가져왔다. 동규가 정한 다리를 건너는 규칙은 턴 방식인데, 한 턴에 이동할 수 있는 거리는 이러하다. 현 위치에서 +1칸, -1칸을 이동할 수 있고, 스카이 콩콩을 이용해 현 위치에서 A나 B만큼 좌우로 점프할 수 있으며, 순간적으로 힘을 모아 현 위치의 A배나 B배 만큼 이동을 할 수 있다. 예... | ALGO | 0.999963 | 3.465686 | {
"github_metadata": {
"branch": "master",
"commit_count": 52,
"repo_created_at": "2018-04-04T12:21: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": "053442769... |
23230df9-01b8-4448-83e4-66ba61b4f2ae | micmacIGN/micmac | src/uti_phgrm/Apero/OLD-cChoixImagesMicMac.cpp | /*Header-MicMac-eLiSe-25/06/2007
MicMac : Multi Image Correspondances par Methodes Automatiques de Correlation
eLiSe : ELements of an Image Software Environnement
www.micmac.ign.fr
Copyright : Institut Geographique National
Author : <NAME>
Contributors : <NAME>, <NAME>.
[1] <NAME>, <NAM... | ALGO | 0.981754 | 4.548104 | {
"github_metadata": {
"branch": "master",
"commit_count": 10879,
"repo_created_at": "2016-11-24T22:09:54.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 785,
"forks": 163,
"issues": 83,
"pull_requests": 30
},
"file_meta": {
"content_id": "b... |
5fdce2b6-6d2a-479b-8814-cd4157534755 | hardik21mishra/dsa | kadane_algo.cpp | // KADANE'S ALGORITHM --> FIND MAXIMUM SUM POSSIBLE FROM ALL THE SUBARRAYS
#include<bits/stdc++.h>
#include<iostream>
#include<vector>
#define INT_MIN (-INT_MAX-1)
using namespace std;
int maxSubarraySum(vector<int> &arr, int n){
int maxi = INT_MIN; // Maximum sum, initialized to the smallest possible integer
... | ALGO | 0.999874 | 5.10165 | {
"github_metadata": {
"branch": "main",
"commit_count": 20,
"repo_created_at": "2024-10-01T13:33:12.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "77da71d142e... |
5bf808b0-9e4b-41ae-a3cf-2877fedc8851 | Henrik-Yao/NEUQ-ACM-Solution | winter-day3/罗潇阳/7-5.cpp | #include <bits/stdc++.h>
using namespace std;
typedef long long var;
typedef long double let;
#define rep(i, a, b) for (int (i) = (a); (i) <= (b); ++(i))
#define per(i, a, b) for (int (i) = (a); (i) >= (b); --(i))
#define repl(i, t) for (int i = fi[t]; i; i = ne[i])
var read() {
var a = 0, s = 0, c = getchar();
whi... | ALGO | 0.999887 | 3.806662 | {
"github_metadata": {
"branch": "main",
"commit_count": 3351,
"repo_created_at": "2021-10-15T10:01:02.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 23,
"forks": 62,
"issues": 0,
"pull_requests": 42
},
"file_meta": {
"content_id": "947dc2... |
6318dcbf-06b3-417d-a9b5-8a3969dacd33 | sharveshram120/Catalog_assesment | main.cpp | #include <iostream>
#include <vector>
#include <string>
#include <cmath>
struct Point {
int x;
long long y;
};
long long decode_y(const std::string& base_str, const std::string& value_str) {
int base = std::stoi(base_str);
long long value = 0;
for (char c : value_str) {
value = value * bas... | ALGO | 0.999704 | 4.927181 | {
"github_metadata": {
"branch": "main",
"commit_count": 5,
"repo_created_at": "2024-09-25T05:55:20.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "789f80f35bba... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.