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 |
|---|---|---|---|---|---|---|---|
71f91a36-5e60-4f4a-b24d-e3ce9fa29103 | SazinSamin/Problem-Solving | LeetCode/19. Remove Nth Node From End of List/cpp1(9ms,36.61%).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:
int listLength(ListNo... | ALGO | 0.999986 | 5.615292 | {
"github_metadata": {
"branch": "main",
"commit_count": 393,
"repo_created_at": "2021-08-02T01:27:53.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "59f51e0588... |
82b22431-20b2-4fd6-8633-8f25a468ad56 | brianbbsu/program | code archive/CF/20B.cpp | //{
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef double lf;
typedef pair<ll,ll> ii;
#define REP(i,n) for(ll i=0;i<n;i++)
#define REP1(i,n) for(ll i=1;i<=n;i++)
#define FILL(i,n) memset(i,n,sizeof i)
#define X first
#define Y second
#define SZ(_a) (int)_a.size()
#define ALL(_a) _a.begin(),_... | ALGO | 0.99992 | 3.778991 | {
"github_metadata": {
"branch": "master",
"commit_count": 199,
"repo_created_at": "2017-02-06T06:47:00.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "6095059f... |
b6a29140-4f9d-476b-a730-73874320f8c8 | JusticeRoberts/Graphics | UtilityFunctions.cpp | #include "UtilityFunctions.h"
#include <iostream>
#include <sstream>
#include <string>
#include <fstream>
#include <vector>
std::pair<double, double> * RegularPolyPoints(int numPoints, double* center, double radius)
{
std::pair<double, double> * coordinates = new std::pair<double,double>[numPoints];
for(int i... | TOOL | 0.988335 | 5.275697 | {
"github_metadata": {
"branch": "master",
"commit_count": 1,
"repo_created_at": "2022-11-05T19:51: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": "218e2c6654... |
8a7629c5-6457-423c-81a9-ce8cb2cf5e2e | cswangjiawei/leetcode | C++/24.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* swapPairs(L... | ALGO | 0.999994 | 6.309682 | {
"github_metadata": {
"branch": "main",
"commit_count": 264,
"repo_created_at": "2021-01-17T13:02:06.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "b514ef703f... |
7f319bf4-5e3b-4d68-8145-f8ded962ac43 | ograycode/vivaldi-source | chromium/net/tools/quic/quic_in_memory_cache.cc | // Copyright (c) 2012 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include "net/tools/quic/quic_in_memory_cache.h"
#include "base/files/file_enumerator.h"
#include "base/files/file_util.h"
#include "base/stl_util.h"... | WEB | 0.947379 | 7.724646 | {
"github_metadata": {
"branch": "master",
"commit_count": 1,
"repo_created_at": "2016-04-29T20:25:34.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 23,
"forks": 7,
"issues": 1,
"pull_requests": 0
},
"file_meta": {
"content_id": "46fc4a222... |
e5f55dcd-3080-4bbf-9986-ecaf37c9d112 | AlexandruValeanu/Competitive-Programming | Game-Theory/Grundy's game.cpp | #include <bits/stdc++.h>
using namespace std;
/**
Name: Grundy's game
Description: Grundy's game is a two-player mathematical game of strategy.
The starting configuration is a single heap of objects,
and the two players take turn splitting a single heap into two heaps of dif... | ALGO | 0.999678 | 3.981161 | {
"github_metadata": {
"branch": "master",
"commit_count": 776,
"repo_created_at": "2014-06-20T10:59:00.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 87,
"forks": 67,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "9d5cbb... |
96da1518-907b-4a70-bc70-4c64cad6a086 | ncaklovic/playground-c9wfjmaq | a04.cpp | // { autofold
#include <iostream>
#include <vector>
#include <string>
#include <iomanip>
#include <iterator>
#include <fstream>
#include <algorithm>
// }
struct student {
std::string name, surname;
int grade;
};
std::istream& operator>>(std::istream& is, student& s) {
return is >> s.name >> s.surname >> s... | TOOL | 0.992842 | 5.444383 | {
"github_metadata": {
"branch": "master",
"commit_count": 3,
"repo_created_at": "2022-11-04T10:16: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": "0d2a026b7f... |
9483278a-3b13-4b63-a699-6ea17892a3ce | chamad14/Muchamad-Rizki-Fadillah_FOP2020 | LAB 11/Q3.cpp | #include <iostream>
using namespace std;
int main ()
{
int mylist[5] = {4,7,12,5,2};
if (mylist[0] % 2 == 1) {
cout << "element is an odd number" << endl;
}
else {
cout << "element is an even number" << endl;
}
if (mylist[1] % 2 == 1) {
cout << "element is an odd number" << endl;
}
e... | ALGO | 0.989807 | 3.879556 | {
"github_metadata": {
"branch": "master",
"commit_count": 18,
"repo_created_at": "2020-09-11T02:30: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": "e9955b250... |
2d1dddd2-639d-40b6-8372-7768e2968719 | Sagnik-Ghosh/File_compressor | source_code.cpp | #include <bits/stdc++.h>
using namespace std;
void compress(string text, string &compressedfileName, int &bitlength) {
map<string, int> dictionary;
map<string, pair<int, int>> metric_values;
set<pair<pair<int, int>, string>> metric;
int time = 0, n = text.length(), limit = (1 << bitlength) - 1;
fo... | ALGO | 0.998159 | 4.071236 | {
"github_metadata": {
"branch": "master",
"commit_count": 15,
"repo_created_at": "2020-07-14T15:37: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": "c2d183c2a... |
9616a95a-3879-4aa1-80c2-73f7089c5518 | proRamLOGO/Competitive_Programming | XTREME13/Monokeros2.cpp | #include <bits/stdc++.h>
#define lli long long int
using namespace std;
class node {
public:
lli data ;
node *left ;
node *right ;
node( lli data ) {
this->data = data ;
this->left = NULL ;
this->right = NULL ;
}
};
node* buildBST(vector< lli > arr, int* postIndex, i... | ALGO | 0.999968 | 5.114612 | {
"github_metadata": {
"branch": "master",
"commit_count": 48,
"repo_created_at": "2018-10-01T07:05:55.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 10,
"issues": 1,
"pull_requests": 4
},
"file_meta": {
"content_id": "af486326... |
9148f14c-940c-4078-a403-8bb402e6be77 | Andy87877/LeetCode | 592.cpp | // https://leetcode.com/problems/fraction-addition-and-subtraction/description/
class Solution {
public:
string fractionAddition(string expression) {
bool UP = true; // 是否是分子
vector<long long> up, down; //分子分母
vector<char> Add_or_Sub; // + or -
if (expression[0] == '-') {
... | ALGO | 0.999967 | 5.336708 | {
"github_metadata": {
"branch": "main",
"commit_count": 173,
"repo_created_at": "2021-11-25T17:01: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": "721610cb18... |
46d38f03-aa17-46dc-a05d-a7d81c2b5085 | Coach-Academy/Winter-2-2023 | Level 2/Class 3/Practice G1/Week 10/g.cpp | #include<bits/stdc++.h>
using namespace std;
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
using namespace __gnu_pbds;
#define ordered_set tree<int, null_type,less<int>, rb_tree_tag,tree_order_statistics_node_update>
#define FAST ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);
typed... | ALGO | 0.999963 | 3.554826 | {
"github_metadata": {
"branch": "main",
"commit_count": 527,
"repo_created_at": "2023-11-22T17:57:02.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 4,
"forks": 0,
"issues": 0,
"pull_requests": 1
},
"file_meta": {
"content_id": "6ea09d6f51d... |
1d92ac39-c1bb-43b4-9ed5-6fd192c7c864 | Al-mizan/Competitive-Programming | algorithm/RMQ/segment_tree.cpp | #include <bits/stdc++.h>
using namespace std;
using ll = long long;
using ull = unsigned long long;
#define endl '\n'
#define ff first
#define ss second
#define pi acos(-1)
#define mod 1000000007
#define newline cout << '\n'
#define no ... | ALGO | 0.99955 | 5.496447 | {
"github_metadata": {
"branch": "main",
"commit_count": 92,
"repo_created_at": "2024-08-30T04:57:42.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "f4f6526ef5a... |
e73b56f9-7ce6-4d68-825f-87f13b8a8d36 | tktj12/cpp-problem-solving | BOJ-9250/solution1.cpp | #include <iostream>
#include <vector>
#include <queue>
using namespace std;
// 알파벳 대문자를 저장하는 경우 각 노드는 26개의 자손을 가질 수 있다.
const int ALPHABETS = 26;
int ToNumber(char ch) { return ch - 'a'; }
class TrieNode {
public:
TrieNode* children[ALPHABETS] = { 0, };
// 이 노드가 종료 노드인지
bool terminal = false;
// 실패 연결, 이 노드에 대응되는... | ALGO | 0.999986 | 5.189287 | {
"github_metadata": {
"branch": "main",
"commit_count": 446,
"repo_created_at": "2023-06-15T09:54: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": "0f05977a76... |
5719386a-c1f9-4187-83f6-672ea84fd792 | souradip2k4/DSA_in_Cpp | leetcode/stacks-and-queues/stacks/online-stock-plan.cpp | // https://leetcode.com/problems/online-stock-span/
// 901. Online Stock Span
#include<bits/stdc++.h>
using namespace std;
class StockSpanner {
public:
stack<pair<int, int> > st;
StockSpanner() {
}
int next(int price) {
pair<int, int> elem = {price, 1};
if (st.empty()) {
st.push(elem);
} e... | ALGO | 0.999056 | 6.111463 | {
"github_metadata": {
"branch": "main",
"commit_count": 125,
"repo_created_at": "2024-08-17T12:43: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": "82752b6ad3... |
8b5b57ac-39c4-4286-8136-d9871f37ab39 | huangallen2008/cppcode | code/CSacademy/tree_game/tree_game.cpp | #include<bits/stdc++.h>
using namespace std;
// #pragma GCC optimize("O3,unroll-loops,fast-math")
// #pragma GCC target("avx2,sse4,bmi,popcnt")
#define int long long
#define REP(i,n) for(int i=0;i<(n);i++)
#define REP1(i,n) for(int i=1;i<=(n);i++)
#define RREP(i,n) for(int i=(n)-1;i>=0;i--)
#define RREP1(i,n) for(int i... | ALGO | 0.998525 | 3.913316 | {
"github_metadata": {
"branch": "main",
"commit_count": 21357,
"repo_created_at": "2024-06-07T09:21: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": "b8b24942... |
a54072e4-7acc-4ca5-bc46-c6c7839d7eea | bowman85/prata- | glava09/ex04/ex04sales.cpp | #include <iostream>
#include "stdio.h"
#include "ex04.h"
namespace SALES {
using std::cout ;
using std::cin ;
void setSales (Sales &s , const double ar[], int size){
s.min = ar[0];
s.max = ar[0];
s.average = 0;
// find max, max and average value
double counter = 0;
for (int i =0 ; i<... | ALGO | 0.995007 | 3.745836 | {
"github_metadata": {
"branch": "master",
"commit_count": 8,
"repo_created_at": "2017-12-29T14:54: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": "8aee43ffa7... |
2e1fa690-3d00-4859-88fd-5e848fe00751 | zhiyuxinxuan/QG-TaskCamp | 大组/Week3/作业2/Sources/排序(数据量10000).cpp | #include <stdio.h>
#include <stdlib.h>
#include <windows.h>
#include <time.h>
#define ll long long
void InsertSort(int a[],int n){//插入排序
int i,j,key;
for(int i=0;i<n-1;i++){
if(a[i+1]<a[i]){
key=a[i+1];
for(j=i;key<a[j];j--){
a[j+1]=a[j];
}
a[j+1]=key;
}
}
}
void Merge(int a[],int temp[],int sta... | ALGO | 0.999949 | 4.236753 | {
"github_metadata": {
"branch": "master",
"commit_count": 11,
"repo_created_at": "2024-03-17T12:27: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": "ce6e094ae... |
f0f5dcf8-d191-446e-a2c7-c381ff5a0f2d | yryuvraj/cp_problems | lemonadeChange.cpp | #include <bits/stdc++.h>
using namespace std;
#define int long long
#define endl '\n'
#define ip(a, n) for(int i = 0; i < n; ++i) cin >> a[i];
#define op(a, n) for(int i = 0; i < n; ++i) cout << a[i] << " "; cout << endl
#define all(x) x.begin(),x.end()
const int N = 1e5 + 7;
const int MOD = 1000000007;
// Lemonade ... | ALGO | 0.999925 | 4.99353 | {
"github_metadata": {
"branch": "main",
"commit_count": 4,
"repo_created_at": "2024-04-24T12:43: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": "d0e9cc7fdd7b... |
c94b6b45-c21f-4954-8c18-19ee067433a0 | AntonioPGR/Competitive-Programming | Beecrowd/grafos/1076.cpp | #include <iostream>
#include <vector>
#include <stack>
using namespace std;
int dfs(vector<vector<int>> adj, int start){
vector<bool> visited(adj.size(), false);
int count = 0;
stack<int> st;
st.push(start);
visited[start] = true;
while(!st.empty()){
int cur = st.top();
st.pop();
for(int no... | ALGO | 0.999461 | 3.835016 | {
"github_metadata": {
"branch": "main",
"commit_count": 7,
"repo_created_at": "2025-07-11T13:38: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": "4b2cf87cf011... |
7ebc8259-7278-446c-a373-b0ff8a345a8d | luqmanarifin/cp | vjudge/brute.cpp | #include <bits/stdc++.h>
using namespace std;
const int N = 1e5 + 5;
int bit[N], n;
void upd(int i, int val) {
for (; i < N; i |= i + 1) bit[i] += val;
}
int find(int i) {
int ret = 0;
for (; i >= 0; i = (i & (i + 1)) - 1) ret += bit[i];
return ret;
}
int main() {
for (int n = 4; n <= 6; n++) {
for ... | ALGO | 0.993763 | 3.563905 | {
"github_metadata": {
"branch": "master",
"commit_count": 772,
"repo_created_at": "2016-02-09T04:26:58.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 6,
"forks": 0,
"issues": 1,
"pull_requests": 0
},
"file_meta": {
"content_id": "e684e67b... |
685d02ba-5865-40c2-a977-60d2733a1abf | KausBoss/CP-SubGrouped | roughCodes/Longest Common Subsequence.cpp | /*
*/
#include <bits/stdc++.h>
using namespace std;
#define ll long long int
#define vi vector<int>
#define pb push_back
#define fi first
#define si second
#define pii pair<int,int>
#define vii vector<pair<int,int>>
#define F(a,n) for(int i=0;i... | ALGO | 0.999982 | 3.837509 | {
"github_metadata": {
"branch": "master",
"commit_count": 635,
"repo_created_at": "2020-06-13T13:18:43.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "9d149e34... |
68c85f15-1f1a-4734-843f-b15d3196e98a | sagi-z/hackerrank | 30days/day23.cpp | #include <iostream>
#include <cstddef>
#include <queue>
#include <string>
#include <cstdlib>
using namespace std;
class Node{
public:
int data;
Node *left,*right;
Node(int d){
data=d;
left=right=NULL;
}
};
class Solution{
public:
Node* insert(Node* r... | ALGO | 0.999975 | 4.834716 | {
"github_metadata": {
"branch": "master",
"commit_count": 12,
"repo_created_at": "2021-02-26T16:36:14.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "4d583f2b8... |
6e21f2c0-39ac-4baa-8ba2-77858d930912 | bcyeah2k25/DS | 24_InsAtBegLL.cpp | /* Write a C++ program to Insert an element
at the beginning of the linear linked list. */
#include <iostream>
using namespace std;
struct Node
{
int data;
Node *next;
};
class LinkedList
{
Node *start;
public:
LinkedList()
{
start = nullptr;
}
void DispLL()
{
Node... | ALGO | 0.991732 | 5.756665 | {
"github_metadata": {
"branch": "main",
"commit_count": 74,
"repo_created_at": "2023-08-25T15:10:39.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2,
"forks": 1,
"issues": 0,
"pull_requests": 1
},
"file_meta": {
"content_id": "6ddd273a5c4... |
0bccbc07-6bd1-47eb-800d-4cbd846627c4 | Aryaman1706/Learning_Cplusplus | operatorOverloading/rationalNumber.cpp | // program to add two rational numbers overload +, <<
// part of the student assignment
#include<iostream>
using namespace std;
class RationalNo {
private:
int num,den;
public:
RationalNo ( int p = 0, int q = 1 ) {
num = p;
den = q;
};
RationalNo o... | TOOL | 0.986286 | 5.155931 | {
"github_metadata": {
"branch": "master",
"commit_count": 20,
"repo_created_at": "2020-05-12T21:11:52.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "c8b5541ff... |
233bd845-ea66-4c42-9888-1877a735ff72 | maximum428/interview_quiz | 2D_Spiral_Array/spiral_array.cpp | #include <iostream>
#include <vector>
using namespace std;
bool isInvalid(vector<vector<int>>& res, int r, int c) {
if (r < 0 || c < 0 || r >= (int)res.size() || c >= (int)res.size() || res[r][c] != 0) {
return true;
}
return false;
}
vector<vector<int>> getSpiral(int n) {
if (n <= 0) return {{}};
ve... | ALGO | 0.999889 | 4.797658 | {
"github_metadata": {
"branch": "master",
"commit_count": 558,
"repo_created_at": "2018-01-16T20:38: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": "c2502d92... |
fb6c76d0-30a5-4266-8571-7b2e38f98dee | anagorko/zpk2015 | grupa2/gbachurewicz/p7/ksiazka_adresowa.cpp | #include <iostream>
#include <vector>
#include <fstream>
#include <algorithm>
using namespace std;
class Person {
string name;
string surname;
string email;
string phone;
int id;
public:
Person();
Person(int i, string na, string su, string em, string ph);
string getName() const;
... | TOOL | 0.905895 | 4.178509 | {
"github_metadata": {
"branch": "master",
"commit_count": 1745,
"repo_created_at": "2016-02-24T09:19:07.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 12,
"issues": 0,
"pull_requests": 1
},
"file_meta": {
"content_id": "2655b9... |
2d25c7a2-5a15-4964-949e-9434e4887d77 | algorithm007-class02/algorithm007-class02 | Week_04/G20200343040154/LeetCode_127_0154.cpp | //127. 单词接龙
//https://leetcode-cn.com/problems/word-ladder/
// 解法1:BFS
// 广度优先搜索求解,注意这里我们选用unordered_set<string> visited用来标记单词是否被访问过,如果已经被访问过,说明已经有对应路径存在,因此跳过访问
class Solution {
public:
int ladderLength(string beginWord, string endWord, vector<string>& wordList) {
unordered_set<string> dict(wordList.begin(), wordL... | ALGO | 0.999921 | 5.581578 | {
"github_metadata": {
"branch": "master",
"commit_count": 1636,
"repo_created_at": "2020-03-10T07:12:35.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 33,
"forks": 115,
"issues": 619,
"pull_requests": 4
},
"file_meta": {
"content_id": "fb4... |
860bb741-5e25-497f-8cf4-e3cf36c2477d | slo0ey/DictApp | dict.cpp | #include <stdlib.h>
#include <stdint.h>
#include <string.h>
#include "dict.h"
uint8_t max(uint8_t a, uint8_t b) {
return a > b ? a : b;
}
// AVL Tree features
uint8_t is_leaf(DictNode* root);
uint8_t get_height(DictNode* root);
int8_t get_balance_factor(DictNode* root);
DictNode* get_successor_node(DictNode* root)... | ALGO | 0.985862 | 5.181255 | {
"github_metadata": {
"branch": "master",
"commit_count": 9,
"repo_created_at": "2024-11-03T05:27:12.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "8e9f9afca8... |
2ebb6f58-fa50-4a45-8055-6fa7bbd98155 | liuq901/code | Ural/ur_1943.cpp | #include <cstdio>
#include <queue>
#include <algorithm>
using namespace std;
int a[10],b[10],c[510];
queue <int> P,Q;
bool win(int n,int *a,int *b)
{
while (!P.empty())
P.pop();
while (!Q.empty())
Q.pop();
for (int i=1;i<=n;i++)
{
P.push(a[i]);
Q.push(b[i]);
}
whi... | ALGO | 0.999997 | 3.47828 | {
"github_metadata": {
"branch": "master",
"commit_count": 108,
"repo_created_at": "2013-09-18T08:58:34.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 3,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "1f86efd2... |
93914425-66f8-40cf-a22f-95545095b2f8 | miyatis/atcoder | abc305/b.cpp | // #include <bits/stdc++.h>
#include <stdlib.h>
#include <stdio.h>
#include <iostream>
#include <cmath>
#include <atcoder/all>
#include <set>
#include <map>
#include <atcoder/all>
#include <unordered_map>
#include <unordered_set>
using namespace std;
using namespace atcoder;
using mint = modint998244353;
#define rep(i... | ALGO | 0.999954 | 4.147062 | {
"github_metadata": {
"branch": "main",
"commit_count": 6,
"repo_created_at": "2024-09-21T06:36: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": "21a35571d1a7... |
35a766cf-bc0b-4ca1-9dca-ea1010ff3ce6 | brokengdnb/emi | lib/qm-dsp/maths/KLDivergence.h | /* -*- c-basic-offset: 4 indent-tabs-mode: nil -*- vi:set ts=8 sts=4 sw=4: */
/*
QM DSP Library
Centre for Digital Music, Queen Mary, University of London.
This file copyright 2008 QMUL.
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Pub... | ALGO | 0.994502 | 6.375244 | {
"github_metadata": {
"branch": "master",
"commit_count": 10,
"repo_created_at": "2020-03-16T13:44:46.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 1
},
"file_meta": {
"content_id": "b8096b300... |
ecff78dd-010b-492b-8247-355bf9c2fec6 | muitajune/Teach--2--give | QUESTION 4.cpp | /*Write a program that accepts a string as input, capitalizes the first letter of each word in the
string, and then returns the result string.*/
#include <iostream>// includes the input output library
#include <string>//icludes strring library
using namespace std;
int main() {
string entry;
cout << "Enter St... | TOOL | 0.90811 | 4.721945 | {
"github_metadata": {
"branch": "main",
"commit_count": 1,
"repo_created_at": "2024-02-12T07:03: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": "ace9e4241bb9... |
c7172209-4a7d-4a99-8217-00b559daf792 | SamBlakeman/ReinforcementLearningAnIntroduction | WindyGridworld/WindyGridworld.cpp | #include "WindyGridworld.h"
WindyGridworld::WindyGridworld()
{
num_actions = 8;
grid_width = 10;
grid_height = 7;
wind_values = {0, 0, 0, 1, 1, 1, 2, 2, 1, 0};
start_loc = {3, 0};
goal_loc = {3, 7};
move_reward = -1;
epsilon = .1;
alpha = .1;
num_episodes = 1000;
state_action_values = vector<vector<vecto... | ALGO | 0.974562 | 5.061528 | {
"github_metadata": {
"branch": "master",
"commit_count": 12,
"repo_created_at": "2018-06-05T07:55: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": "c40c476f3... |
b35031b9-5743-4b54-8838-86ce667a7687 | yousef-mohsen/Competitive-Programming-Problems | CSES-problem-set/Tree Matching/Tree Matching/main.cpp | //
// main.cpp
// Tree Matching
//
// Created by Yousef on 24.03.20.
//
#include <iostream>
#include <vector>
using namespace std;
int counter = 0;
vector<bool> visited;
vector<bool> marked;
vector<vector<int>> adj;
void dfs(int node)
{
if (visited[node])
return;
visited[node] = true;
... | ALGO | 0.999762 | 4.44369 | {
"github_metadata": {
"branch": "main",
"commit_count": 3,
"repo_created_at": "2024-08-18T19:02: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": "12fc21a7d289... |
978fe587-d5f5-4876-9a87-6ba55916fa0f | sthsuyash/CSIT_Labs | 5th_Semester/Design_and_Analysis_of_Algorithm/binary_search_divide_and_conquer.cpp | /*
* Program: Binary Search with Divide and Conquer Program
*
* Binary search is a searching algorithm that searches for an element in a sorted array.
* In this approach, the element is always searched in the middle of a portion of an array.
*
* Time Complexity: O(logn)
* Space Complexity: O(1)
*
*/
#include ... | ALGO | 0.999988 | 6.123876 | {
"github_metadata": {
"branch": "main",
"commit_count": 705,
"repo_created_at": "2022-08-13T12:11:08.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 37,
"forks": 10,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "de60cb86... |
cfcbf996-cab3-4e9d-9fd5-fd432f1b50fa | delsiiin/leetcode | 数组/498.对角线遍历.cpp | /*
* @lc app=leetcode.cn id=498 lang=cpp
*
* [498] 对角线遍历
*/
// @lc code=start
#include <iostream>
#include <vector>
using namespace std;
class Solution
{
public:
vector<int> findDiagonalOrder(vector<vector<int>> &mat)
{
int count = 0;
int i = 0, j = 0;
int len_r = mat.size();
... | ALGO | 0.999962 | 6.517807 | {
"github_metadata": {
"branch": "master",
"commit_count": 21,
"repo_created_at": "2023-05-04T16:17:56.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "47c233291... |
a4b98399-87a3-4b14-92e8-c3971d262971 | JoseLucas1999/estrutura-de-dados-linguagem-C | Codes/06 - Arvores Binarias.cpp | #include <iostream>
using namespace std;
typedef struct arv {
char info;
struct arv *pai;
struct arv *dir;
struct arv *esq;
} Arv;
Arv* cria( char raiz ) {
// Aloca memoria para o no/arvore
Arv* aux = new Arv;
// Armazena a informacao
aux->info = raiz;
// Garante que os ponteiros estejam sem ... | ALGO | 0.999896 | 4.264194 | {
"github_metadata": {
"branch": "main",
"commit_count": 1,
"repo_created_at": "2025-05-16T23:54:02.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "c000815d30dc... |
93bced89-0c65-4d91-9ef4-6c5d0964c19e | MrPinksWorkshop/cpp-6-hours | Lessons 41-60/49. TicTacToeGame.cpp | #include <iostream>
#include <vector>
#include <cmath>
#include <ctime>
#include <iomanip>
// 49. TIC TAC TOE Game
// a pointer to an array named spaces
// 1d array to keep track of all the markers
// like what spots are occupied
void drawBoard(char *spaces);
void playerMove(char *spaces, char player);
void compute... | ALGO | 0.998695 | 4.203006 | {
"github_metadata": {
"branch": "main",
"commit_count": 142,
"repo_created_at": "2023-10-13T01:19: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": "57b67dda9b... |
4fe8a08e-24c2-430e-9b91-0dd5db4cdf05 | studouglas/GEANT4-GPU | geant4.10.02/source/geometry/magneticfield/include/G4NystromRK4.hh | //
// ********************************************************************
// * License and Disclaimer *
// * *
// * The Geant4 software is copyright of the Copyright Holders of *
// * the Geant4 Collaboration... | ALGO | 0.997801 | 5.265204 | {
"github_metadata": {
"branch": "master",
"commit_count": 518,
"repo_created_at": "2015-09-13T23:36:17.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 40,
"forks": 18,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "df9bcd... |
33464a4c-6a7a-4cb6-8d4f-b46043ebf5dc | Ritik609/Linked-List | add1.cpp | #include <bits/stdc++.h>
using namespace std;
struct node
{
int data;
struct node* next;
};
node *reverse(node *start){
node *prev=NULL;
node *next;
node *curr=start;
while(curr!=NULL ){
next=curr->next;
curr->next=prev;
prev=curr;
curr=next;
}... | ALGO | 0.999959 | 4.042487 | {
"github_metadata": {
"branch": "master",
"commit_count": 23,
"repo_created_at": "2020-06-10T15:01: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": "4e811040f... |
4273aecd-b5ce-47d4-ae36-fbd67fc4a1f4 | dmarce1/octopart | src/state/riemann.cpp | #include <octopart/math.hpp>
#include <octopart/options.hpp>
#include <octopart/state.hpp>
#include <cassert>
flux_state KT(const primitive_state &WL, const primitive_state &WR) {
flux_state F;
const auto UR = WR.to_con();
const auto UL = WL.to_con();
const auto vR = WR.v[0];
const auto vL = WL.v[0];
const auto ... | ALGO | 0.999912 | 5.253134 | {
"github_metadata": {
"branch": "master",
"commit_count": 152,
"repo_created_at": "2019-12-07T04:25: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": "06e54ccd... |
807243ea-d5ad-4db6-bfac-cb3794b93280 | rock-slam/slam-envire | tools/env_mls_trajectory.cpp | #include <Eigen/Geometry>
#include "envire/Core.hpp"
#include "envire/maps/TriMesh.hpp"
#include "envire/maps/MLSGrid.hpp"
#include "boost/scoped_ptr.hpp"
#include <iostream>
#include <sstream>
#include <fstream>
using namespace envire;
using namespace std;
int main( int argc, char* argv[] )
{
if( argc < 2... | DATA | 0.940986 | 5.096266 | {
"github_metadata": {
"branch": "master",
"commit_count": 1106,
"repo_created_at": "2015-03-13T08:51:16.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 2,
"forks": 10,
"issues": 0,
"pull_requests": 1
},
"file_meta": {
"content_id": "5b56eeb... |
3db7b5d5-a48e-4058-83a1-8b06d9caf14a | Taebee00/CodingTest | Inflearn_1/Baekjoon_9996.cpp | // #include <bits/stdc++.h>
// using namespace std;
// int main()
// {
// int num; string pattern, pattern_front, pattern_back; string file[100];
// cin >> num;
// cin >> pattern;
// for (int i = 0;i < pattern.length();i++) {
// if (pattern[i] == '*') {
// pattern_front = pattern.substr(0, i);
// pattern_... | ALGO | 0.999962 | 4.947012 | {
"github_metadata": {
"branch": "main",
"commit_count": 148,
"repo_created_at": "2023-02-27T15:59: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": "854f832053... |
feeae9af-9ffd-41d6-9d91-7eada0dfb5ff | asdadeeeee/OJ | leetcode/583/b.cpp | #include <algorithm>
#include <cmath>
#include <cstring>
#include <ios>
#include <iostream>
#include <numeric>
#include <string>
#include <vector>
using namespace std;
class Solution {
public:
int minDistance(string word1, string word2) {
int n = word1.length();
int m = word2.length();
vector<int> dp(m +... | ALGO | 0.999996 | 5.392856 | {
"github_metadata": {
"branch": "main",
"commit_count": 42,
"repo_created_at": "2024-10-29T14:23:40.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "149a25b91f7... |
85e10c6f-55ee-4253-8ce4-b2368acd5ab8 | vanthaita/Lap-Trinh | NMLT/solapphuong.cpp | #include <iostream>
using namespace std;
void inputArray(int a[], int n)
{
for(int i = 0; i <n ;i++)
cin>>a[i];
}
void outputArray(int a[], int n)
{
for(int i = 0; i <n ;i++)
cout<<a[i]<<" ";
}
bool solapphuong(int n)
{
for(int i = 0; i < n;i++)
{
if(i * i * i == n)
... | ALGO | 0.999879 | 3.569223 | {
"github_metadata": {
"branch": "main",
"commit_count": 1,
"repo_created_at": "2024-06-28T16:39:43.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "d176fbcc2700... |
abb29042-0bf0-4f09-a497-3007f722d1e8 | rozwo/Informatyka-z-liceum | inf bl/3Ag/szkola/Galerie/galeria.cpp | #include <bits/stdc++.h>
using namespace std;
ifstream fin;
ofstream fout;
void zad1()
{
fin.open("galerie.txt");
int n=50;
string t[n]={}, m;
int s, d, ile=1;
for(int i=0; i<n; i++)
{
fin>>t[i]>>m;
for(int j=0; j<70; j++)
{
fin>>s>>d;
}
}
so... | ALGO | 0.998032 | 3.340919 | {
"github_metadata": {
"branch": "master",
"commit_count": 1,
"repo_created_at": "2023-07-06T08:01: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": "301a38e41e... |
ece4a79f-3586-4f0f-82ae-8f451bb77a25 | MarcoPhanVu/Programming-With-School | Khoa/2Khoa.cpp | #include <iostream>
using namespace std;
struct SoLaMa
{
int n;
string s;
void operator = (SoLaMa sl)
{
n=sl.n;
}
};
int GetN(string s)
{
if(s=="I") return 1;
if(s=="II") return 2;
if(s=="III") return 3;
if(s=="IV") return 4;
if(s=="V") return 5;
if(s=="VI") return 6;
if(s=="... | ALGO | 0.986736 | 3.115549 | {
"github_metadata": {
"branch": "main",
"commit_count": 15,
"repo_created_at": "2022-03-14T14:14: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": "48e2d1f491c... |
fb94be2c-7922-4f6c-942a-9d83fd0bc1e6 | SpinDOS/Contests | Yandex2019AutumnQuals/C.PowerStations.cpp | #include <algorithm>
#include <queue>
#include <vector>
#include <iostream>
uint16_t N;
using DestinationPrice = std::pair<uint16_t, uint64_t>;
std::vector<DestinationPrice> buildPrices;
std::vector<std::vector<DestinationPrice>> pathPrices;
void ReadInput();
uint64_t Solve();
int main() {
ReadInput();
std... | ALGO | 0.999628 | 4.413 | {
"github_metadata": {
"branch": "master",
"commit_count": 12,
"repo_created_at": "2019-06-12T21: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": "88ca046ed... |
018fdfef-df5e-47be-9a57-4914b5544548 | CLDP/USACO-Contest | 2013-2014 Season/2014 January/Silver/ccski.cpp | #include <iostream>
#include <fstream>
#include <vector>
#include <queue>
#include <cstring>
#include <algorithm>
using namespace std;
const int MAXN = 501;
const int INF = 2000000000;
const int MX[4] = {0, 0, -1, 1};
const int MY[4] = {-1, 1, 0, 0};
int n, m;
int x[MAXN][MAXN];
vector<pair<int, int> > y;
bool z[MAXN... | ALGO | 0.999938 | 3.603604 | {
"github_metadata": {
"branch": "master",
"commit_count": 178,
"repo_created_at": "2013-05-12T16:29:24.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 4,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "78b632bd... |
77bcbe6c-971d-4aac-9f48-ccf39e452726 | feelus-disk/_programming | _lang_cpp/[Страуструп]принципы и практика с++ Source/Exercise Solutions/Ch3/e3-9.cpp | // <NAME> 7/20/2009
// Chapter 3 Exercise 9
#include "std_lib_facilities.h"
// note that different compilers/SDEs keep header files in different places
// so that you may have to use "../std_lib_facilities.h" or "../../std_lib_facilities.h"
// the ../ notation means "look one directly/folder up from the current direc... | ALGO | 0.91078 | 4.049967 | {
"github_metadata": {
"branch": "master",
"commit_count": 44,
"repo_created_at": "2015-07-07T10:13:41.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 16,
"forks": 9,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "30f93e92... |
f9c7cc7e-2552-4e83-b819-1a10ef29ec77 | a7med7amed7/Problem-Solving | CP/CF_781_B.cpp | #include <bits/stdc++.h>
using namespace std;
#define ll long long
#define ld long double
#define all(v) v.begin(), v.end()
#define rall(v) v.rbegin(), v.rend()
#define f(i, a, n) for (int i = (a); i <= (n); i++)
#define ff first
#define ss second
void solve()
{
int n, x, mx = 1;
cin >> n;
map<int, int> mp... | ALGO | 0.999881 | 4.499906 | {
"github_metadata": {
"branch": "master",
"commit_count": 1,
"repo_created_at": "2022-04-19T06:58: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": "6d58bfbdf3... |
8b05fedc-6c97-43d1-95e2-743688137094 | gyrodope69/Data-Structures-and-Algorithm | SkippedLinikedList.cpp | #include <bits/stdc++.h>
using namespace std;
class Node
{
public:
int data;
Node *next;
Node *skip;
Node(int val)
{
data = val;
next = NULL;
skip = NULL;
}
};
void insertAthead(Node *&head, int data)
{
Node *node = new Node(data);
node->next = head;
// Nod... | ALGO | 0.999959 | 5.012969 | {
"github_metadata": {
"branch": "master",
"commit_count": 19,
"repo_created_at": "2022-05-16T14:28:23.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 3,
"forks": 2,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "3fd8255dd... |
69dee8d5-a3be-4b2f-8dd0-6ba1f96c97b6 | NajafAli786110/100-Days-of-Code | Week 1/Day 1/Second_Largest_Element_in_Array.cpp | #include <iostream>
#include <string>
#include <limits.h>
#include <vector>
#include <queue>
using namespace std;
string kthLargestNumber(vector<string> &nums, int k)
{
string ans;
int secondLargest = INT_MIN;
int largest = INT_MIN;
if (k <= 0 || k > nums.size())
{
return "-1";
}
... | ALGO | 0.99955 | 5.027085 | {
"github_metadata": {
"branch": "main",
"commit_count": 5,
"repo_created_at": "2023-12-17T10:44: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": "d1dcb5c63524... |
f6ef4bae-010c-4da1-833e-3468ce3efe37 | WiktorKociuba/AOC_2023 | Day_9/miragec2.cpp | #include <bits/stdc++.h>
using namespace std;
int main(){
vector<vector<long long>> odczyty;
int wynik = 0;
long long pom = 0;
for(int z = 0; z < 200; z++){
odczyty.clear();
pom = 0;
odczyty.push_back(vector<long long>());
for (int j = 0; j < 21; j++){
cin >>... | ALGO | 0.999952 | 3.139693 | {
"github_metadata": {
"branch": "main",
"commit_count": 3,
"repo_created_at": "2023-12-10T12:08: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": "124a3af03a69... |
64c03369-b916-4112-aa65-91d4c16d2f8c | shafikul9806/CSE-306-LAb-summer19 | stack 3.cpp | #include<iostream>
using namespace std;
#define MAX 100
class Stack{
private: char Array[MAX];
int top;
public:
Stack(){
top = -1;
}
~Stack(){
}
void push(char element);
void pop();
bool isEm... | ALGO | 0.999654 | 4.118515 | {
"github_metadata": {
"branch": "master",
"commit_count": 6,
"repo_created_at": "2019-07-08T10:12: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": "16148cba90... |
1041bcb6-e1ef-4de5-a415-6d8ee7495415 | rbaygildin/learn-graphics | plane3d/affine/affine.cpp | //
// Created by <NAME> on 07.11.17.
//
#include "affine.h"
arma::mat Affine::inverse(arma::mat matrix) {
return arma::mat();
}
arma::mat Affine::scale(arma::mat matrix, double a, double b, double c) {
arma::mat sm(3, 3);
//first row x
sm(0, 0) = a;
sm(0, 1) = 0;
sm(0, 2) = 0;
//second ro... | ALGO | 0.981848 | 5.940532 | {
"github_metadata": {
"branch": "master",
"commit_count": 60,
"repo_created_at": "2017-11-02T21:03:19.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 3,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "33badc16c... |
10392824-756d-45e6-a070-a8d81a24e02a | funcdfs/Algorithm | 2022/474B蚯蚓在第几堆.cpp | // https://github.com/fengwei2002, 2023.02.22-19:52:25
// https://codeforces.com/contest/474/problem/B
// 474B. Worms, Codeforces - Codeforces Round #271 (Div. 2)
#include <bits/stdc++.h>
using namespace std;
#ifdef LOCAL
#include "algo/dbg.h"
#else
#define dbg(...) 42
#endif
auto main() -> int32_t {
cin.tie(null... | ALGO | 0.999935 | 4.736674 | {
"github_metadata": {
"branch": "main",
"commit_count": 398,
"repo_created_at": "2021-05-25T12:32:15.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 26,
"forks": 2,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "0946a3185... |
710d2df2-8b7c-443c-8f49-d0cece0315e1 | priyanshuuranjan/LeetCode | Difficulty: Basic/Leap Year/leap-year.cpp | //{ Driver Code Starts
#include <bits/stdc++.h>
using namespace std;
// } Driver Code Ends
class Solution {
public:
bool checkYear(int N) {
// code here
if(N % 400 ==0){ // checking is it sis divisible by 400
return 1;
}
else if(N % 4 ==0 && N %100 != 0 ){... | ALGO | 0.994127 | 5.370475 | {
"github_metadata": {
"branch": "main",
"commit_count": 165,
"repo_created_at": "2023-09-20T14:16:47.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 3,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "f1126cf75d... |
3ef76f3b-2946-44b3-983c-bb42634d05fd | contactvaibhavi/LeetcodeSolutions | solutions/problems/isomorphic_strings/solution.cpp | class Solution {
public:
bool isIsomorphic(string s, string t) {
if (s.length() != t.length())
return false;
int firstOccurence[256] = {0};
firstOccurence[s[0]] = 1;
int charMapS[60000] = {0};
for (int i = 1; i < s.length(); i++) {
if(!firstOccurence[s[... | ALGO | 0.999982 | 6.023657 | {
"github_metadata": {
"branch": "master",
"commit_count": 307,
"repo_created_at": "2020-05-02T16:17:18.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "7aeb5079... |
5d930f95-096d-47eb-bcb6-26cdfffee69a | codingguru2221/library-management-system | main.cpp | #include <iostream>
#include <vector>
#include <string>
#include <fstream>
#include <cstdlib> // For rand() and system()
#include <ctime> // For time()
#include <iomanip> // For std::quoted
#include <limits> // Include this header for std::numeric_limits
using namespace std; // Add this line to use the standard nam... | TOOL | 0.930052 | 5.442132 | {
"github_metadata": {
"branch": "main",
"commit_count": 3,
"repo_created_at": "2025-01-13T08:33: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": "7a67b68d054a... |
444e6b75-3d8a-4465-a46c-d0313f1c3edf | oganaa2472/Leetcode | 464-can-i-win/can-i-win.cpp | class Solution {
public:
unordered_map<int, bool> memo;
int maxChoose, target;
bool dfs(int state,int currentTotal){
if(memo.count(state)) return memo[state];
for (int i = 1; i <= maxChoose; i++) {
if (!(state & (1 << (i - 1)))) {
if (currentTotal + i >= target || !df... | ALGO | 0.999919 | 5.704121 | {
"github_metadata": {
"branch": "main",
"commit_count": 2267,
"repo_created_at": "2024-12-18T01:47: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": "cb3b03774... |
c7419d38-96fc-4fc2-8651-f95636e02583 | SoTaeHo/Algorithm-study | problem_14889_dfs.cpp | #include <iostream>
#include <vector>
#include <cstdlib>
using namespace std;
int n, result = 0x11111111;
vector<vector<int>> s;
bool elementOf(const vector<int>& arr, int num) {
for (int i : arr) {
if (i == num)
return true;
}
return false;
}
void dfs(int num, int r, vector<int>& arr... | ALGO | 0.999953 | 3.964273 | {
"github_metadata": {
"branch": "main",
"commit_count": 69,
"repo_created_at": "2023-03-19T08:07:32.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 1,
"pull_requests": 0
},
"file_meta": {
"content_id": "5b8aea8dd06... |
c5c38eec-1a52-4c0d-98a4-8ce2344a6f68 | 13igg/Coding-Challenges | misc/C_C++/Algorithms/Archive/02-20/Intermediate C++/Project/MyCode.cpp | //In Class February 20
#include <iostream>
#include <vector>
#include <algorithm>
#include <string>
using namespace std;
template <typename T>
void print(vector<T>& v, int n = 3); //Print n first and n last elements
//Public inheritance allows us to publically use the vector stuff, like .size().
class SortVector: pub... | ALGO | 0.986192 | 4.642231 | {
"github_metadata": {
"branch": "master",
"commit_count": 8,
"repo_created_at": "2018-07-12T18:28: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": "e1de18040c... |
378714a3-f1da-43cf-9bdb-8824ae88741a | ishandutta2007/codeforces-h | heart_blue/normal/63/E.cpp | #include <cstdlib>
#include <cctype>
#include <cstring>
#include <cstdio>
#include <cmath>
#include <algorithm>
#include <vector>
#include <string>
#include <iostream>
#include <sstream>
#include <map>
#include <set>
#include <queue>
#include <stack>
#include <fstream>
#include <numeric>
#include <iomanip>
#include <bi... | ALGO | 0.999037 | 3.567629 | {
"github_metadata": {
"branch": "main",
"commit_count": 1,
"repo_created_at": "2024-04-11T02:01: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": "62401a3f1a4b... |
d604e5cf-f5e5-4535-a0b0-1070df44f4d8 | xyzyzl/compprog | probs/cf/1547/f.cpp |
#include <bits/stdc++.h>
using namespace std;
const int MAXA = 1e6;
int vis[MAXA+1];
vector<int> ps;
void solve()
{
int n; cin >> n;
vector<int> a(n);
int g = __gcd(a[0], a[1]);
for(int i = 0; i < n; i++)
{
cin >> a[i];
g = __gcd(a[i], g);
}
vector<set<int> > factors(n);
for(int i = 0; i < n; i++)
{
... | ALGO | 0.99965 | 4.416493 | {
"github_metadata": {
"branch": "master",
"commit_count": 364,
"repo_created_at": "2019-06-11T03:19:10.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2,
"forks": 0,
"issues": 1,
"pull_requests": 0
},
"file_meta": {
"content_id": "3c323a32... |
ff82a41a-28cb-4da7-bb59-75a6b20fabbf | ItsSarthakJain/data-structures | Linklist/doubly_ll.cpp | //doubly linked list
#include<iostream>
using namespace std;
class dll
{
private:
struct node
{
int value;
struct node*previous;
struct node*next;
};
struct node*start;
struct node*tail;
struct node*new_node;
struct node*ptr;
public:
dll()
{
start=NULL;
... | ALGO | 0.999601 | 4.025136 | {
"github_metadata": {
"branch": "master",
"commit_count": 4,
"repo_created_at": "2018-11-13T14:50:49.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "52bdf58ab0... |
ca54d8fa-e349-439b-a9ae-44799e21fcb3 | whiitex/CP-competitions | codeforces/round_999/E.cpp | #pragma GCC optimize("Ofast,unroll-loops")
#include <bits/stdc++.h>
using namespace std;
#define int long long
typedef vector<int> vi;
#define pb push_back
const int INF = 1e18;
void solve() {
int n, m, k; cin >> n >> m >> k;
vi a(n); for (int &i: a) cin >> i;
vi b(m); for (int &i: b) cin >> i;
vi a... | ALGO | 0.999948 | 4.13531 | {
"github_metadata": {
"branch": "master",
"commit_count": 154,
"repo_created_at": "2023-11-29T10:30: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": "f90ccd85... |
55c7901f-e9d5-42d5-995e-8e2c06867ab8 | BCAPATHSHALA/DSA-SUPREME-2-0-NOTES | DSA SUPREME 2.0 CODES/35. CLASS CODE/QUEUE02.CPP | // 3. Implementation of Circular Queue using a Dynamic Array
#include<iostream>
using namespace std;
class CQueue
{
public:
int* arr;
int size;
int front;
int rear;
CQueue(int size){
arr = new int[size];
this->size = size;
front = -1;
... | ALGO | 0.999397 | 5.78313 | {
"github_metadata": {
"branch": "master",
"commit_count": 322,
"repo_created_at": "2023-08-28T06:24:20.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 235,
"forks": 86,
"issues": 1,
"pull_requests": 1
},
"file_meta": {
"content_id": "26c27... |
c2933bd3-f73a-4c31-a110-6e44f63ed7ad | Cr3ativeCod3r/CPP-data-structure | drzewo.cpp | #include <iostream>
//-std=c++0x
using namespace std;
struct node{
int key;
node* parent;
node* left;
node* right;
};
struct findNode{
node *n;
bool b;
};
node make_node(int value);
void add_node(int value, node *&root);
void preorder(node*root);
void postorder(node*root);
void inorder(n... | ALGO | 0.999462 | 3.494529 | {
"github_metadata": {
"branch": "main",
"commit_count": 7,
"repo_created_at": "2023-05-26T12:10:53.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "1ee91595fb29... |
021d87d8-7326-40dc-9c59-db663101af32 | TaoLeeCode/Leetcode- | leetcode_524.cpp | #include <bits/stdc++.h>
using namespace std;
string findLongestWord(string s, vector<string>& d) { /*从外部获取给定字符串s,字符串数组d*/
string longestwordnow = ""; /*初始定义迄今匹配最长字符串为空*/
for (string member : d) { ... | ALGO | 0.999839 | 3.525585 | {
"github_metadata": {
"branch": "master",
"commit_count": 2,
"repo_created_at": "2020-03-24T05:03: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": "0a6e1b21c3... |
e3e53269-e9e7-49d5-b61b-ee0cc1109048 | hoangnqh/Training-ACM-ICPC | The 2018 ICPC Asia Hanoi Regional Contest/hydrasheads.cpp | #include<bits/stdc++.h>
using namespace std;
#define int long long
#define fi first
#define se second
#define mp make_pair
#define pb push_back
typedef pair<int, int >ii;
typedef pair<int, ii> iii;
const int INF = 1e9;
const int MOD = 1000000007;
const int N = 2e5 + 5 ;
int a[N];
int b[N];
int delta(int x) {
i... | ALGO | 0.999948 | 4.054433 | {
"github_metadata": {
"branch": "master",
"commit_count": 19,
"repo_created_at": "2021-09-28T01:24:24.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "30f31e277... |
311eaa07-4def-449a-9895-47a2f0ae8392 | Sabbir943/Array_cpp | Even_odd_number.cpp | #include<iostream>
using namespace std;
int main() {
int arr[] = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10};
int n = sizeof(arr) / sizeof(arr[0]);
if (n < 2) {
cout << "Array needs at least two elements." << endl;
return 0;
}
int First_largest, Second_largest;
int First_smallest, Sec... | ALGO | 0.999972 | 4.708355 | {
"github_metadata": {
"branch": "master",
"commit_count": 1,
"repo_created_at": "2024-06-01T17:11: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": "236107528c... |
3ce5e942-badc-4581-ae27-89f3564de567 | Vinniellf/Competitive-Programming | CSES/Mathematics/josepuhs-queries.cpp | #include<bits/stdc++.h>
using namespace std;
typedef long long ll;
const ll MOD = 1e9 + 7;
const ll N = 1e6;
void solve(){
int k, n; cin>>n>>k;
if(n == 1) {cout<<1<<"\n"; return;}
int N = n;
bool par = true;
int factor = 1;
int frst = 1;
for(int i = 0; i <= 65; i++){
if(frst + (par... | ALGO | 0.999952 | 3.780461 | {
"github_metadata": {
"branch": "main",
"commit_count": 19,
"repo_created_at": "2024-09-14T01:27:12.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "4567186f0ea... |
840287c1-f523-40a7-94b2-c7c069635394 | alexanderlvarfolomeev/ITMO | Algorithms and Data Structures/Paths/minpath_k_edges.cpp | #include <iostream>
#include <fstream>
#include <vector>
#include <list>
#include <algorithm>
#include <set>
#include <unordered_set>
#include <map>
#include <cmath>
using namespace std;
vector<pair<pair<int, int>, int>> edges;
vector<vector<int>> a;
int main() {
int n, m, k, s;
cin >> n >> m >> k >> s;
... | ALGO | 0.999977 | 3.977032 | {
"github_metadata": {
"branch": "master",
"commit_count": 97,
"repo_created_at": "2019-04-15T20:02:43.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 5
},
"file_meta": {
"content_id": "9ffb812c1... |
5c7a477e-493e-47e5-b854-f7f043e6f178 | kifah-s/Fundamentals_Of_Programming | Gammal_Tech_Academy/Core_Courses/3_Data_Structures/Sec_3_Linked_Lists/Les_13_Linked_List_2/Examples/Example_1.cpp |
//* Example 1 ..
#include <iostream>
#include <array>
#include <vector>
#include <string>
#include <string.h>
#include <algorithm>
#include <set>
#include <utility>
#include <map>
#include <cctype>
#include <fstream>
#include <cstring>
using namespace std;
//* Struct ..
struct Node
{
char name[25];
int pa... | TOOL | 0.945066 | 4.340621 | {
"github_metadata": {
"branch": "main",
"commit_count": 2110,
"repo_created_at": "2023-04-07T14:22: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": "25b1af93f... |
f0118945-0584-4a8f-a323-94ca4d52c6e7 | AbdulM0izz/PfLabTasks | PFclass13Nov/nestedifelseQ5.cpp | #include <iostream>
using namespace std;
int main() {
int num;
cout << "Enter a number: ";
cin >> num;
if (num > 0) {
if (num % 2 == 0) {
cout << num << " is a positive even number." << endl;
} else {
cout << num << " is a positive odd number." << endl;
... | ALGO | 0.999577 | 4.83639 | {
"github_metadata": {
"branch": "main",
"commit_count": 27,
"repo_created_at": "2024-11-01T19:28: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": "f6acdc47cd7... |
9a76004f-5b5f-45c2-87e4-d954e43f7bd4 | TouchGod/CppBase | Day07-Dictionary/vector_dict.cc | #include <iostream>
#include <fstream>
#include <sstream>
#include <string>
#include <vector>
#include <algorithm>
using namespace std;
struct Record
{
string _word;
int _frequency;
};
class Dictionary
{
public:
void read(const std::string &filename)
{
ifstream ifs(filename);
if (!ifs)
{
cerr << "fail t... | TOOL | 0.96563 | 4.565448 | {
"github_metadata": {
"branch": "master",
"commit_count": 34,
"repo_created_at": "2020-01-08T02:25: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": "73fe4e03c... |
72c2c2b3-e13a-4ec4-a414-795a66bc70e6 | sv022/Random-Bits-Generator | Generator.cpp | #pragma once
#include<iostream>
#include"Generator.h"
#define ld long double
ld Generator::randfloat(){
return (rand() / static_cast<float>(RAND_MAX));
}
int Generator::toint(){
int s = 0;
for (int i = this->n - 1; i >= 0; i--){
s += (int)this->bits[i] * pow(2, (this->n - i) - 1);
}
retur... | ALGO | 0.994265 | 4.066714 | {
"github_metadata": {
"branch": "main",
"commit_count": 39,
"repo_created_at": "2023-12-20T14:50:10.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "dd3b6d8d031... |
e0244b19-9831-4b3b-bbef-5a26666b2957 | Yashgoswami41/DSAx | stack/arrayImplement.cpp | #include <iostream> // For input/output operations
using namespace std;
struct mystack
{
int *arr;
int cap;
int top;
mystack(int c)
{ cap = c;
arr = new int[cap];
top = -1;
}
void push(int x)
{
if (top == cap - 1)
{
... | ALGO | 0.999307 | 4.58434 | {
"github_metadata": {
"branch": "main",
"commit_count": 36,
"repo_created_at": "2025-02-12T13:16: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": "72a64c5bb2b... |
da7b20ce-2dde-40bf-a181-ac3bcc88bc9f | Vhostym/assignments | a2q3/a2q3.cc | #include <iostream>
#include <iomanip>
#include <sstream>
using namespace std;
int main() {
int spaces = 0;
string line;
string character;
bool semicolon = false;
while (cin) {
getline(cin, line);
istringstream iss(line);
while (iss >> character) {
if (character == "//") {
semicolon = false;
stri... | ALGO | 0.982912 | 3.503907 | {
"github_metadata": {
"branch": "master",
"commit_count": 26,
"repo_created_at": "2016-10-06T01:06: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": "936568c89... |
b1ead923-1262-477b-a6f1-bfa59dad7775 | Keyur1284/Competitive-Programming | Leetcode POTD/2024/463. Island Perimeter.cpp | // Problem Link :- https://leetcode.com/problems/island-perimeter/
// Solved by DFS
// Time Complexity :- O(row * col)
// Space Complexity :- O(row * col)
class Solution {
public:
int islandPerimeter(vector<vector<int>>& grid) {
int row = grid.size(), col = grid[0].size();
int dx[4] = {-1... | ALGO | 0.999883 | 6.028545 | {
"github_metadata": {
"branch": "master",
"commit_count": 1296,
"repo_created_at": "2022-11-03T10:45:02.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 7,
"forks": 2,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "573d60a... |
c95ea45d-cc0c-4ce1-8505-dcbaa6039b88 | Souravirus/codechef | july17/pshttr.cpp | #include<bits/stdc++.h>
#define vvp vector<vector<pair<int, int> > >
#define vp vector<pair< int, int> >
using namespace std;
pair<int, int> foo;
vvp :: iterator itvvp;
vvp :: iterator itvvp1;
vvp :: iterator itvvp2;
vp::iterator itvp1;
vp::iterator itvp2;
int cnt=0;
void dfs(vvp tree, int pos, int *arr, int *R, vector... | ALGO | 0.999976 | 4.672467 | {
"github_metadata": {
"branch": "master",
"commit_count": 3,
"repo_created_at": "2017-09-22T16:53:52.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "cdc036935b... |
79f4816f-119f-412b-b7fc-71eca31a78f2 | lksa4e/Coding-Study-private | cpp/BOJ/[S5] 1018.cpp | 문제
지민이는 자신의 저택에서 MN개의 단위 정사각형으로 나누어져 있는 M*N 크기의 보드를 찾았다. 어떤 정사각형은 검은색으로 칠해져 있고, 나머지는 흰색으로 칠해져 있다.
지민이는 이 보드를 잘라서 8*8 크기의 체스판으로 만들려고 한다.
체스판은 검은색과 흰색이 번갈아서 칠해져 있어야 한다. 구체적으로, 각 칸이 검은색과 흰색 중 하나로 색칠되어 있고,
변을 공유하는 두 개의 사각형은 다른 색으로 칠해져 있어야 한다. 따라서 이 정의를 따르면 체스판을 색칠하는 경우는 두 가지뿐이다.
하나는 맨 왼쪽 위 칸이 흰색인 경우, 하나는 검은색인 경우이다.
보드... | ALGO | 0.999954 | 4.163251 | {
"github_metadata": {
"branch": "master",
"commit_count": 379,
"repo_created_at": "2020-08-25T12:42: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": "78d0424a... |
900a59b8-e780-46ca-aee3-dbd57bf92b03 | Sherlock9256/LeetCode | 51.cpp | #include<vector>
#include<string>
#include<iostream>
using namespace std;
class Solution{
vector<vector<string>> ret;
public:
vector<vector<string>> solveNQueens(int n) {
vector<string> cur(n,string(n,'.'));
vector<bool> col(n,true);
vector<bool> diag(n*2-1,true);
vector<bool> ... | ALGO | 0.999808 | 5.043024 | {
"github_metadata": {
"branch": "master",
"commit_count": 3,
"repo_created_at": "2022-02-13T08:46: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": "45b27b50f5... |
bef1df5a-8f03-4b92-ace4-4c531989d7bd | akshitagit/CPP | Trie/trie.cpp | #include<bits/stdc++.h>
using namespace std;
struct trie{
struct trie* child[26];
bool is_end;
trie(){
memset(child,0,sizeof(child));
is_end=false;
}
};
struct trie* root;
//inserts a word to the trie
void insert(string s){
struct trie* temp=root;
//traverses over each character
//if the character already ... | ALGO | 0.998579 | 4.278779 | {
"github_metadata": {
"branch": "master",
"commit_count": 985,
"repo_created_at": "2020-09-14T13:09:20.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 493,
"forks": 436,
"issues": 143,
"pull_requests": 28
},
"file_meta": {
"content_id": "5b... |
f44f5bd4-929d-45b3-9815-12db46acd1b4 | srinjoyray/Codeforces-Solutions | codeforces/1537/E2.cpp | #include<bits/stdc++.h>
using namespace std;
#define fo(i,n) for(i=0;i<n;i++)
#define fo2(i,start,end) for(i=start;i<=end;i++)
#define rfo(i,n) for(i=n-1;i>=0;i--)
#define ll long long int
#define deb(x) cout<<#x<<"="<<x<<endl
#define deb2(x,y) cout<<#x<<"="<<x<<","<<#y<<"="<<y<<endl
#define pb push_back
#define mp mak... | ALGO | 0.999991 | 3.329419 | {
"github_metadata": {
"branch": "master",
"commit_count": 998,
"repo_created_at": "2021-05-22T14:38:02.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2,
"forks": 2,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "d1817519... |
d3eaa2a6-a0a8-45b1-8ea7-dbf6c44b1df0 | bempp/bempp-legacy | lib/fiber/quadrature/galerkinduffy.hpp | // Copyright (C) 2009-2010 <NAME>, <NAME>, Franz
// Rammerstorfer, <NAME>
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
// in the Software without restriction, including without limitation the rights
//... | ALGO | 0.980856 | 6.565644 | {
"github_metadata": {
"branch": "master",
"commit_count": 3179,
"repo_created_at": "2011-03-27T18:27:40.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 64,
"forks": 38,
"issues": 0,
"pull_requests": 3
},
"file_meta": {
"content_id": "eead22... |
ee39b832-8115-4604-81fc-48be22538972 | ntnhut/LeetSolve | backup/88. Merge Sorted Array/88_Merge_Sorted_Array.cpp | #include <iostream>
#include <vector>
using namespace std;
//! @brief merge them into a sorted nums1.
//! @param nums1, m, nums2, n two sorted vectors of integers and their length
//! @author <NAME>
void merge(vector<int>& nums1, int m, vector<int>& nums2, int n) {
int k = m + n - 1;
int i = m - 1;
int... | ALGO | 0.999827 | 5.553335 | {
"github_metadata": {
"branch": "main",
"commit_count": 375,
"repo_created_at": "2022-05-31T20:38:58.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 7,
"forks": 1,
"issues": 0,
"pull_requests": 1
},
"file_meta": {
"content_id": "71a0ab91db... |
1ef2ff74-eb9e-4381-8cd8-71de803f18f8 | ColderWANG/CpperDay | 笔试/1.cc | #include <bits/stdc++.h>
using namespace std;
// s 给定,inow-1 表示字符串中当前位置, path 路径,side 邻接表, cnt 表示计数
void dfs(const string& s, int inow, string &path, unordered_map<int,vector<int>> side, int cnt){
if(path.size() == 3){
if((path[0] != path[1]) && (path[1] == path[2]))cnt++;
return;
}
vector... | ALGO | 0.999966 | 3.819754 | {
"github_metadata": {
"branch": "main",
"commit_count": 68,
"repo_created_at": "2021-06-10T06:29:17.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "b8968228612... |
6013e4b5-2432-46a2-94c5-cdcb92265376 | RashikAnsar/everyday_coding | cpp/strings/implement_string_tokenizer.cpp | #include <cstring>
#include <iostream>
using namespace std;
char *mystrtok(char *s, char delim) {
static char *input = NULL;
if (s != NULL) {
input = s;
}
// base case: After the final token has retured
if (input == NULL) {
return NULL;
}
// extraction tokens and storing them in an array
cha... | TOOL | 0.920424 | 3.902471 | {
"github_metadata": {
"branch": "main",
"commit_count": 185,
"repo_created_at": "2020-11-08T13:30:13.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "9bd9a2b426... |
da471b79-9fe5-4069-a65c-3dacefbd004b | Git-Sarang/DSA | Backtracking/nQueens.cpp | #include <iostream>
#include <vector>
using namespace std;
bool isSafe(vector<vector<int>> &m, int r, int c, int n) {
// Finding in same col. (|)
for(int i=0; i<n; i++) {
if(m[i][c]==1) return false;
}
int row=r, col=c;
// negative diagonal (\)
while(row>=0 && col>=0) {
if(m[row... | ALGO | 0.999967 | 5.301604 | {
"github_metadata": {
"branch": "master",
"commit_count": 83,
"repo_created_at": "2021-10-18T21:43: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": "e4d215647... |
bc1adce2-e833-4007-9417-0e98ae00d998 | JaejunHan/Algorithm | c++/April/8/2018_kakao_newsClustering.cpp | #include <string>
#include <set>
#include <algorithm>
#include <iostream>
#include <cctype>
using namespace std;
const int mul = 65536;
string lowerCase(string x) {
string ans= "";
for (auto ele: x) {
ans += tolower(ele);
}
return ans;
}
int solution(string str1, string str2) {
multiset<... | ALGO | 0.999936 | 4.142567 | {
"github_metadata": {
"branch": "main",
"commit_count": 136,
"repo_created_at": "2023-03-19T07:40: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": "7e4f3d6587... |
16a9122a-3945-42d0-80d8-e904ab63472b | saraanbih/Problem-Solving | 1995-finding-pairs-with-a-certain-sum/1995-finding-pairs-with-a-certain-sum.cpp | class FindSumPairs {
public:
unordered_map<int,int> freq1,freq2;
vector<int> n2;
FindSumPairs(vector<int>& nums1, vector<int>& nums2) {
for(auto &num : nums1)freq1[num]++;
for(auto &num : nums2)freq2[num]++;
n2 = nums2;
}
void add(int index, int val) {
int od = n... | ALGO | 0.999956 | 6.201254 | {
"github_metadata": {
"branch": "main",
"commit_count": 1030,
"repo_created_at": "2025-04-11T17:51: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": "d9659120a... |
cce83bb4-8505-4769-b03d-a63675fa7bff | ZhenyingZhu/ClassicAlgorithms | src/CPP/src/epi/chapter12/FindMinMax.cpp | #include "FindMinMax.hpp"
#include <vector>
#include <algorithm>
#include <utility>
#include <cassert>
#include <iostream>
#include <stdexcept>
#include "../../MyUtils.h"
using std::vector;
using std::minmax;
using std::pair;
using std::min;
using std::max;
using std::invalid_argument;
using std::cout;
using std::end... | ALGO | 0.999632 | 6.170687 | {
"github_metadata": {
"branch": "master",
"commit_count": 484,
"repo_created_at": "2014-09-14T08:09:34.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 7,
"forks": 2,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "c0bbfbc5... |
e643ce7d-d9f1-47c9-905e-7fc7397665ee | apassi99/LeetCode | add_binary_str.cpp | class Solution {
public:
string addBinary(string a, string b) {
string result;
int i = 0, carry = 0;
while ( (i < a.size()) || (i < b.size()) ) {
int n1 = (i >= a.size()) ? 0 : a[a.size() - i - 1] - '0';
int n2 = (i >= b.size()) ? 0 : b... | ALGO | 0.999986 | 6.420561 | {
"github_metadata": {
"branch": "master",
"commit_count": 285,
"repo_created_at": "2015-10-22T21:10:37.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "778bcfed... |
0e12efc8-3e13-4af4-8c1c-f1d0f4da2e48 | SunghyunHH/Baekjoon_practice | 백준/Silver/10158. 개미/개미.cc | #include <iostream>
using namespace std;
int main() {
int w, h, p, q, t, x, y;
int dx = 1, dy = 1;
cin >> w >> h >> p >> q >> t;
// p + t (총 이동 거리 ) / w => 0~w까지 얼마나 왕복했는 지 체크 가능
x = (p + t) / w;
y = (q + t) / h;
// 짝/홀인 경우에 따라 움직이는 시작점이 다름
if (x % 2 == 0) {
p = (p + t) % w;
}
else {
p = w - ((p + t) % w... | ALGO | 0.999935 | 3.380777 | {
"github_metadata": {
"branch": "main",
"commit_count": 48,
"repo_created_at": "2023-01-16T07:40:15.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "597e2aa30b4... |
d038f252-7b72-4b26-80f1-0aab800fda4d | Vartika511/CCC_Phase3-4 | Pretty Jealous Fairies.cpp | #include <iostream>
#include <algorithm>
#include <vector>
using namespace std;
bool can_assign_fairies(vector<int>& castles, int c, int d) {
int last_castle = castles[0];
int assigned = 1;
for (int i = 1; i < castles.size(); i++) {
if (castles[i] - last_castle >= d) {
last_castle = ca... | ALGO | 0.999996 | 4.570922 | {
"github_metadata": {
"branch": "main",
"commit_count": 292,
"repo_created_at": "2023-03-01T06:06:54.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 13,
"forks": 71,
"issues": 0,
"pull_requests": 1
},
"file_meta": {
"content_id": "e9705502... |
8aee57b6-7c24-4d1c-a650-66992898247e | forkich/spbspu_labs_2020 | B2/task1.cpp | #include <iostream>
#include "queueWithPriority.hpp"
#include "commands.hpp"
#include "details.hpp"
void task_1()
{
QueueWithPriority<std::string> queue;
QueueWithPriority<std::string>::ElementPriority tmp_priority;
Commands tmp_command;
while(std::cin >> tmp_command)
{
std::string line;
if(tmp_com... | TOOL | 0.935496 | 5.593316 | {
"github_metadata": {
"branch": "master",
"commit_count": 1,
"repo_created_at": "2021-12-25T20:44: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": "992ac22768... |
6a6e8844-abb5-4088-bd97-b038e7af07ad | NangJohnBui3010/kattis-cpp | fourThought.cpp | #include <iostream>
#include <vector>
#include <string>
using namespace std;
char ops[] = {'*','-','+','/'};
bool validString(string s, int target){
//check for * and /
int res = 4;
vector<int> m;
int l = 0;
m.push_back(4);
for(int i = 2; i < 14; i+=4){
if(s[i] == '*')
m[l... | ALGO | 0.999883 | 4.121749 | {
"github_metadata": {
"branch": "main",
"commit_count": 10,
"repo_created_at": "2024-09-19T06:42: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": "6ca7b04c9e2... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.