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 |
|---|---|---|---|---|---|---|---|
5c9aa06e-3b9d-4df0-8df2-c675b10e167c | ariloc/CompetitiveProgrammingCodes | CodeForces/1468E.cpp | #include <bits/stdc++.h>
//#pragma GCC optimize("Ofast")
//#pragma GCC target("avx,avx2,fma")
#define forn(i,n) for(int i = 0; i < int(n); i++)
#define forsn(i,s,n) for(int i = int(s); i < int(n); i++)
#define dforn(i,n) for (int i = int(n)-1; i >= 0; i--)
#define dforsn(i,s,n) for(int i = int(n)-1; i >= int(s); i--)... | ALGO | 0.999813 | 4.153549 | {
"github_metadata": {
"branch": "master",
"commit_count": 183,
"repo_created_at": "2020-08-19T01:48:31.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "882284e0... |
6a3114f0-7cf9-42e1-90bc-54d54f44ddd8 | KhoaNguyenAn/Algorithm | AC3/XAYDUNG.cpp | ///...................................*****.................................................///
/// Author : Ankhoa ///
/// Department of Computer Science ///
/// & Algorithm... | ALGO | 0.999965 | 3.746119 | {
"github_metadata": {
"branch": "master",
"commit_count": 1,
"repo_created_at": "2021-09-12T02:44: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": "afc3eaf30b... |
d5e19f63-4a8d-4b06-a20e-399f2a8a4891 | Seungchan0325/baekjoon | solutions/24973_0.cpp | #include <bits/stdc++.h>
using namespace std;
const int MAXN = 303030;
bool U[MAXN], D[MAXN];
int n, p[MAXN], prv[MAXN];
char UD[MAXN];
int main()
{
cin >> n;
for(int i = 1; i <= n; i++) cin >> p[i];
for(int i = 0; i < n-1; i++) {
cin >> UD[i];
if(UD[i] == 'U') U[i] = true;
if(UD... | ALGO | 0.999898 | 3.99717 | {
"github_metadata": {
"branch": "main",
"commit_count": 795,
"repo_created_at": "2023-12-31T15:30: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": "328cfa006b... |
b2ca51b6-312a-4afe-b975-0cf51d7f7954 | PaddlePaddle/Paddle | paddle/phi/kernels/cpu/nce_kernel.cc | // Copyright (c) 2024 PaddlePaddle Authors. All Rights Reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required... | DATA | 0.978438 | 7.123025 | {
"github_metadata": {
"branch": "develop",
"commit_count": 54743,
"repo_created_at": "2016-08-15T06:59:08.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 23037,
"forks": 5770,
"issues": 1009,
"pull_requests": 823
},
"file_meta": {
"content_... |
9a63fc8d-368d-45ec-97a7-e658adcd8300 | diegomaranges/practico2 | Practico2/Practico2/OperacionesMatenaticas.cpp | #include "stdafx.h"
#include "OperacionesMatenaticas.h"
#include "MenuOpt.h"
#define PI 3.1415
#define ADD(a, b) a + b
#define SQu(a) a * a
#define MAX(a, b) a > b ? a : b
double cal_square(double num1)
{
return SQu(num1);
}
double cal_addition(double num1, double num2)
{
return ADD(num1, num2);
}
double circle_... | TOOL | 0.923082 | 3.497005 | {
"github_metadata": {
"branch": "tp_three",
"commit_count": 77,
"repo_created_at": "2018-03-09T15:22: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": "f82255e... |
b3a96ebf-da22-4fd9-aa86-4e0c8871f939 | gizemdal/remote-rendering | optix_sdk_7_2_0/SDK/lib/DemandLoading/include/DemandLoading/Tex2D.h | //
// Copyright (c) 2020, NVIDIA CORPORATION. All rights reserved.
//
// 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 co... | ALGO | 0.954186 | 6.719145 | {
"github_metadata": {
"branch": "main",
"commit_count": 165,
"repo_created_at": "2020-11-17T20:43:22.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 19,
"forks": 3,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "40e969438... |
6fbcd79b-6d5a-48a3-a522-c7451be69125 | sanjukh68/Parallel-Computing | Assignment 5/lcs.cpp | #include <omp.h>
#include <stdio.h>
#include <iostream>
#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>
#include <unistd.h>
#include <string.h>
#include <chrono>
#include<math.h>
#include<algorithm>
#include <cstdlib>
using namespace std;
#ifdef __cplusplus
extern "C" {
#endif
void generateReduceDat... | ALGO | 0.994791 | 4.119054 | {
"github_metadata": {
"branch": "master",
"commit_count": 1,
"repo_created_at": "2017-12-06T15:48: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": "afc58d2b1b... |
1779ea38-feb5-407a-a3c6-fea97fd245e3 | atsushi-m-ito/QUMASUN | source/poisson_fft.h | #pragma once
#include <cmath>
#include <cstdio>
#include <cstdlib>
#include <algorithm>
#include <cstdint>
#include "wrap_fft.h"
#include "fftw_executor.h"
/*
* necessary work size is (size_x * size_y * size_z * 4).
*/
inline
void SetPotentialByPoissonFFT(double* Vhart, const double* rho, int size_x, int size_y, int s... | ALGO | 0.998863 | 4.001924 | {
"github_metadata": {
"branch": "master",
"commit_count": 1,
"repo_created_at": "2024-05-21T07:52: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": "114bacf9d5... |
eb9e2975-1e4a-4a49-b505-c84bf9b83019 | DCherish/CodingPractice | cpp File/PG17683/p17683.cpp | #include <string>
#include <vector>
#include <sstream>
#include <algorithm>
using namespace std;
int maxcost = 0;
bool cmp(string a, string b)
{
for (int i = 0; i < b.length(); i++)
{
int j = 0;
while (i + j < b.length() && a[j] == b[i + j])
{
j++;
... | ALGO | 0.998735 | 4.905137 | {
"github_metadata": {
"branch": "master",
"commit_count": 322,
"repo_created_at": "2020-08-25T05:58: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": "38f5e058... |
c0b5a985-4e7c-488c-9809-0aaf4aaf8bcb | MeJerry215/learning_repo | leetcode/0410_split-array-largest-sum.cpp | #include "common.h"
/*
给定一个非负整数数组 nums 和一个整数 m ,你需要将这个数组分成 m 个非空的连续子数组。
设计一个算法使得这 m 个子数组各自和的最大值最小。
示例 1:
输入:nums = [7,2,5,10,8], m = 2
输出:18
解释:
一共有四种方法将 nums 分割为 2 个子数组。
其中最好的方式是将其分为 [7,2,5] 和 [10,8] 。
因为此时这两个子数组各自的和的最大值为18,在所有情况中最小。
示例 2:
输入:nums = [1,2,3,4,5], m = 2
输出:9
示例 3:
输入:nums = [1,4,4], m = 3
输出:4
... | ALGO | 0.999952 | 5.661252 | {
"github_metadata": {
"branch": "main",
"commit_count": 620,
"repo_created_at": "2022-04-22T14:27: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": "7976fd674f... |
078ad3d5-8e1d-4103-bdf5-159eb630bdb1 | erp11/BassConnections_SaeediZwickImplementation | segmentFelzenszwalb.cpp | #include <string.h>
#include <stdio.h>
#include <stdlib.h>
#include <mex.h>
#include ".\image.h"
#include ".\misc.h"
#include ".\pnmfile.h"
#include ".\image.h"
#include ".\segment-image.h"
#include ".\segment-image-labelOutput.h"
#ifndef MIN
#define MIN(x, y) (((x) < (y)) ? (x) : (y)) /* min and max value macros */... | ALGO | 0.989628 | 5.47305 | {
"github_metadata": {
"branch": "master",
"commit_count": 15,
"repo_created_at": "2017-04-21T21:43:55.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "762e26a97... |
8b79f2bb-e39c-469e-a12d-b49385cab57c | Nakkkkkul0130/Neo-Collab-DSA | unit 4/imagine u r a teacher.cpp | #include <iostream>
#include <vector>
#include <iomanip>
using namespace std;
int partition(vector<double>& gpas, int low, int high) {
double pivot = gpas[high];
int i = low - 1;
for (int j = low; j < high; j++) {
if (gpas[j] >= pivot) {
i++;
swap(gpas[i], gpas[j]);
... | ALGO | 0.999972 | 5.407725 | {
"github_metadata": {
"branch": "main",
"commit_count": 67,
"repo_created_at": "2023-09-05T20:19:14.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "f0a4b4d892b... |
0f8e5a43-e341-491a-8f9e-7bd56a461f3c | DungNguyenCoder/CPP_PTIT | CPP0131.cpp | #include <bits/stdc++.h>
#define faster() ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);
using namespace std;
#define ll long long
#define fi first
#define se second
#define vt vector
#define db double
#define endl "\n"
const int mx = 1e5;
const int mod = 1e9+7;
#define TEST 1
int nt[10005];
void sang()
{
... | ALGO | 0.999765 | 4.620739 | {
"github_metadata": {
"branch": "master",
"commit_count": 36,
"repo_created_at": "2024-08-17T17:00: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": "2c821808b... |
442562a1-1b6e-4e36-8f7a-b5131fe916bd | ishandutta2007/codeforces-t | tfg/normal/1163/D.cpp | #include <iostream>
#include <vector>
#include <chrono>
#include <random>
#include <queue>
#include <cstring>
#include <cassert>
#include <algorithm>
std::mt19937 rng((int) std::chrono::steady_clock::now().time_since_epoch().count());
const int ms = 55 * 2;
int trie[ms][26], c = 1;
int fail[ms], cost[ms];
int addSt... | ALGO | 0.999889 | 3.984528 | {
"github_metadata": {
"branch": "main",
"commit_count": 1,
"repo_created_at": "2024-10-30T16:27: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": "6117b9a7b331... |
283d1fb8-6205-499c-a8c9-890254ddab7b | dreyus95/AVSP_SourceQualityPrediction | CodeJamCrawler/dataset/10_4026_9.cpp | package codejam2010.round1;
import java.io.File;
import java.io.PrintWriter;
import java.util.Scanner;
public class A {
private static Scanner sc;
private static PrintWriter pw;
private static int test;
// change to your local folder
private static final String path = "files/codejam2010/round1/";
... | ALGO | 0.94628 | 3.125871 | {
"github_metadata": {
"branch": "master",
"commit_count": 70,
"repo_created_at": "2017-06-08T21:00: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": "4bcafd9ed... |
66f358c0-d2cc-482c-9c38-25f1cde91657 | UPG1308/Leetcode-Daily-Challenge | 2024 December Leetcoding Challenge/1346. Check If N and Its Double Exist.cpp | class Solution {
public:
bool checkIfExist(vector<int>& arr) {
// Step 1: Sort the array
sort(arr.begin(), arr.end());
for (int i = 0; i < arr.size(); i++) {
// Step 2: Calculate the target (double of current number)
int target = 2 * arr[i];
// Step 3: Cu... | ALGO | 0.999665 | 6.234217 | {
"github_metadata": {
"branch": "main",
"commit_count": 639,
"repo_created_at": "2023-11-01T08:08: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": "eb18be3e2d... |
e1aee26a-0fde-415b-a586-c56e1ab2e13b | vector94/Competitive-programming-library | Graph Algorithm/Dijkstra/Dijkstra’s Shortest Path Algorithm using priority_queue of STL_2.cpp | #include <bits/stdc++.h>
using namespace std;
typedef pair<int, int> pii;
int node;
vector<pii> graph[20009];
int level[20009];
void shortestPath(int source)
{
priority_queue<pii, vector<pii>, greater<pii> > PQ;
memset(level, -1, sizeof(level));
PQ.push(make_pair(0, source));
while (!PQ.empty()){
... | ALGO | 0.999978 | 3.97619 | {
"github_metadata": {
"branch": "master",
"commit_count": 367,
"repo_created_at": "2021-09-30T14:41: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": "16413556... |
eaaa7ec9-f733-496b-9e58-9a79bfe9c21a | loypt/leetcode | N2101-Detonate-the-Maximum-Bombs/solution1.cpp | class Solution {
public:
int maximumDetonation(vector<vector<int>>& bombs) {
int n = bombs.size();
auto isConnected = [&](int u, int v) -> bool {
long long dx = bombs[u][0] - bombs[v][0];
long long dy = bombs[u][1] - bombs[v][1];
return (long long)bombs[u][2] * bo... | ALGO | 0.999903 | 5.714504 | {
"github_metadata": {
"branch": "master",
"commit_count": 1063,
"repo_created_at": "2022-01-24T13:41:54.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 4,
"forks": 1,
"issues": 0,
"pull_requests": 1
},
"file_meta": {
"content_id": "38014459... |
f3b01bd1-f3c6-4533-a545-77e5865394e7 | yamate11/compprog | zOther/past202005/o/cans.cc | #include <bits/stdc++.h>
#include <cassert>
typedef long long int ll;
using namespace std;
// @@ !! LIM(debug)
// --> f:<< debug minCostFlow
// ---- inserted function << from util.cc
template <typename T1, typename T2>
ostream& operator<< (ostream& os, const pair<T1,T2>& p) {
os << "(" << p.first << ", " << p.second... | ALGO | 0.999977 | 4.351586 | {
"github_metadata": {
"branch": "main",
"commit_count": 219,
"repo_created_at": "2021-03-11T06:12:02.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "55bca85965... |
a45ce090-4398-4494-8b21-9e82935cafbd | kLiHz/data-structure | string/trie.hpp | #ifndef TRIE_HPP
#define TRIE_HPP
#include <iostream>
#include <string>
#include <map>
#include <stack>
namespace trie
{
template<typename CHAR_TYPE>
struct node {
CHAR_TYPE ch;
size_t cnt;
std::map<CHAR_TYPE, node *> children;
node() : ch(' '), cnt(0) {}
node(CHAR_TYPE... | ALGO | 0.992706 | 4.505143 | {
"github_metadata": {
"branch": "master",
"commit_count": 63,
"repo_created_at": "2020-09-20T13:18:34.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "f90b42949... |
579cf4e4-1b6c-426d-831a-5b18e0630333 | A12-CODE-cyber/c-program | IMS.cpp | #include <iostream>
#include <string>
#include <vector>
using namespace std;
struct Item {
string name;
int quantity;
double price;
};
int main() {
vector<Item> inventory;
int choice;
do {
cout << "\n ****INVENTORY MANAGEMENT SYSTEM BY <NAME>*** \n ***ASSIGNED BY <NAME>*** \n";
... | TOOL | 0.940178 | 5.854226 | {
"github_metadata": {
"branch": "main",
"commit_count": 2,
"repo_created_at": "2025-03-18T06:58:59.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "c88a20949573... |
c132f5f3-3cd7-49b4-bc09-dbb26633a655 | reneang17/ttbar | idsolver/IdSolver/Tools/determine_masters.cpp | /******************************************************************************
* *
* Copyright (C) 2006 <NAME> *
* *
******... | ALGO | 0.976471 | 5.70491 | {
"github_metadata": {
"branch": "master",
"commit_count": 1,
"repo_created_at": "2019-06-28T22:21: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": "36e418e70c... |
4c47463d-12dd-4acc-89d7-70337bb6a5ae | edionu97/Algorithms-DataStructures-ContestsSolutions | Algorithms/QuickSort.cpp | #include "stdafx.h"
#include <vector>
#include <functional>
#include <iostream>
using namespace std;
template <typename T> class QuickSorter {
private:
function < bool(const T&, const T&) > comp;
int sortedElement(int li, int ls,vector <T>& elements) {
bool increase = true;
while (li < ls) {
if (!comp(... | ALGO | 0.999955 | 5.63497 | {
"github_metadata": {
"branch": "master",
"commit_count": 5,
"repo_created_at": "2018-04-09T07:12:55.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "f4d7c15f8f... |
c5f4a878-e2a0-4872-84ca-bb5f3af47d3f | bemoregt/gpRadonTransform | src/ofApp.cpp | #include "ofApp.h"
#include<iostream>
#include<math.h>
using namespace cv;
using namespace std;
using namespace ofxCv;
//--------------------------------------------------------------
void ofApp::setup(){
before.load("/Users/kerbal/Desktop/pp.png");
Mat src = toCv(before);
Mat src2;
cvtColor(src,... | ALGO | 0.935352 | 4.451456 | {
"github_metadata": {
"branch": "master",
"commit_count": 16,
"repo_created_at": "2019-07-10T01:42:27.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 10,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "9094ab65... |
b1192650-7d1c-4a91-b982-58626563e47c | adrianp20/CSE-165-Labs | 2/q1.cpp | /*
If-else statements
Write a program that reads in an integer and outputs ”POSITIVE” if the integer is positive
and ”NEGATIVE” if it is negative, and ”ODD” if the integer is odd and ”EVEN” if the
integer is even.
*/
#include <iostream>
using namespace std;
int main() {
int n;
cout<<"Enter an integer: ";
... | ALGO | 0.996182 | 4.427022 | {
"github_metadata": {
"branch": "main",
"commit_count": 2,
"repo_created_at": "2022-05-05T23:40:41.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "f616a76c0e1e... |
f7910e4e-7c1e-4c03-8ba0-300cdec7af64 | priyesh-raj-singh/leetcodePratice | Segregate even and odd nodes in a Link List - GFG/segregate-even-and-odd-nodes-in-a-link-list.cpp | // { Driver Code Starts
//Initial template for C++
#include <bits/stdc++.h>
using namespace std;
struct Node
{
int data;
struct Node* next;
Node(int x){
data = x;
next = NULL;
}
};
void printList(Node* node)
{
while (node != NULL) {
cout << node->data <<" ";
... | ALGO | 0.999528 | 5.163585 | {
"github_metadata": {
"branch": "main",
"commit_count": 996,
"repo_created_at": "2021-09-27T12:25:40.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "a3bfe7fa33... |
391bda48-fa56-4465-865f-66a5eec0bdcb | haakools/AoC2024 | day4/main.cpp |
#include <fstream>
#include <iostream>
#include <string>
#include <vector>
// returns vector of strings, where the "string" is the entire line in the file
std::vector<std::vector<std::string>> readFileLines(const std::string& filename) {
std::vector<std::vector<std::string>> lines;
std::ifstream file(filenam... | ALGO | 0.999406 | 4.633442 | {
"github_metadata": {
"branch": "master",
"commit_count": 16,
"repo_created_at": "2024-12-03T18:02: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": "37411f4df... |
eb61d887-60d9-410a-ad0e-3ebbac9b3952 | Mukhtarhan/algorithms-and-data-structures | lab10/f.cpp | #include <bits/stdc++.h>
using namespace std;
#define fi(n) for(int i = 0; i < n; i++)
int n, m;
bool search(vector<int> g[], int i, int j){
int vis[n+1];
fi(n+1)vis[i] = 0;
vis[i] = 1;
queue<int> q;
q.push(i);
while(!q.empty()){
int cur = q.front();q.pop();
fi(g[cur].size()){
... | ALGO | 0.999979 | 4.072629 | {
"github_metadata": {
"branch": "main",
"commit_count": 2,
"repo_created_at": "2023-11-02T05:27: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": "e38083f29e2a... |
a42ec061-fcea-4004-8637-2481a3ffb7cf | tcll321/FaceSdk | FaceSdk/action/imi_common/Hist.h | #pragma once
#include <opencv2/opencv.hpp>
#include <iostream>
//#include "ShowUtils.hpp"
class HistMeter
{
public:
static cv::Mat calucate(cv::Mat m, cv::Mat mask = cv::Mat(), int bins = 64)
{
if (m.channels() == 3)
{
cv::Mat gray;
cv::cvtColor(m, gray, CV_BGR2GRAY);
m = gray;
}
cv::Mat hist;
cv... | TOOL | 0.979431 | 4.336381 | {
"github_metadata": {
"branch": "master",
"commit_count": 2,
"repo_created_at": "2018-12-16T16:10:00.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 2,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "48f8deb050... |
d4909d5d-da8d-43f2-8d8d-2444687fc04a | AndreasZi/Muehle | speicher.h | /*Aufgrund von der Umstellung in unserer Architektur, während des Projekts,
wird diese Datei nicht mehr verwendet.
Auch komisch dass in der headerdatei logik programmiert wurde... hmmmm....
*/
#include <iostream>
using namespace std;
char field[3][8]; // Zweidimensionales Array, welches die Werte 'O', 'W' und 'B' sp... | ALGO | 0.982516 | 4.006984 | {
"github_metadata": {
"branch": "main",
"commit_count": 92,
"repo_created_at": "2022-05-20T13:17: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": "9178c5662c8... |
2612b3e6-eadd-4829-9a7a-19421448e70d | peteryang1031/leetcode | 001两数之和.cpp | #include<iostream>
#include<algorithm>
#include<vector>
#include<string>
using namespace std;
/****
* 1. 两数之和
* 题目:给定一个target和数组nums,返回数组中相加之和为target的两个元素的位置(一个元素只能使用一次)
* 思路:一开始往排序后二分的方向想,处理不了临界的位置。
改变思路,排序后给出head指针和tail指针进行遍历,若head+tail>target,则tail--,否则head++,复杂度O(nlogn)
Tips:排序后数组元素位置发生改变,要copy一份原数组才能返回元素在... | ALGO | 0.999946 | 5.176976 | {
"github_metadata": {
"branch": "master",
"commit_count": 1,
"repo_created_at": "2020-04-24T03:35:19.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "e01af69e4d... |
272bdb40-82a7-4887-aa10-bea9c5dfd429 | fsjhhh/acm_title | cpp/luogu/luogu_P3369.cpp | #include <iostream>
#include <cstdio>
#include <cstring>
#include <algorithm>
#include <cmath>
#include <vector>
#include <map>
#include <unordered_map>
#include <set>
#include <unordered_set>
#include <queue>
#include <deque>
#include <iomanip> // std::fixed std::setprecision(x) 保留x位小数
#include <array>
#include <bitse... | ALGO | 0.999842 | 4.850222 | {
"github_metadata": {
"branch": "main",
"commit_count": 24,
"repo_created_at": "2023-10-30T10:57:45.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "1cf221bbcab... |
a8ab75ff-0dcb-407a-8030-05086bccf64c | kunal131005/GeetaUniversity | Linked_List/Searching/RecursiveMSearchingInALL.cpp | #include <iostream>
using namespace std;
class ListNode
{
public:
int val;
ListNode *next;
ListNode(int val)
{
this->val = val;
this->next = NULL;
}
};
void insertAtHead(ListNode *&head, int val)
{
ListNode *node = new ListNode(val);
node->next = head;
head = node;
}
voi... | ALGO | 0.99985 | 4.10468 | {
"github_metadata": {
"branch": "main",
"commit_count": 10,
"repo_created_at": "2025-03-18T08:40: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": "432f0865537... |
37018cad-a58b-4d2f-822b-8b94fa470f5d | honmameiko22/fairnessclique | Graph.cpp | #include "Utility.h"
#include "Graph.h"
#include "LinearHeap.h"
#include "Timer.h"
using namespace std;
Graph::Graph(const char* _dir){//init some values
dir = string(_dir);
n = 0;
m = 0;
threshold = 0;
attr_size=0;
max_color=0;
offset = nullptr;
edge_list = nullptr;
attribute = nul... | ALGO | 0.989334 | 3.688974 | {
"github_metadata": {
"branch": "main",
"commit_count": 3,
"repo_created_at": "2021-02-01T02:47:58.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 4,
"forks": 2,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "fdfd4c37e1bd... |
987ea622-8e83-4c7c-b234-41e9dca14842 | ex-surreal/contest-programming | codeforces/163E.cpp | #include <iostream>
#include <cstdio>
#include <bitset>
#include <vector>
#include <numeric>
#include <string>
#include <algorithm>
#include <map>
#include <cmath>
#include <set>
#include <queue>
#include <stack>
#include <cstring>
#include <ctime>
#include <cstdlib>
#include <cassert>
using namespace std;
#define me... | ALGO | 0.999753 | 3.871145 | {
"github_metadata": {
"branch": "master",
"commit_count": 239,
"repo_created_at": "2016-08-02T14:15: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": "e7da3782... |
792829e9-bf2e-4926-bd83-7b03e2dc69c4 | lozpeng/applesales | SRC/Geometry/source/noding/IntersectionFinderAdder.cpp | /**********************************************************************
* $Id: IntersectionFinderAdder.cpp 1820 2006-09-06 16:54:23Z mloskot $
*
* GEOS - Geometry Engine Open Source
* http://geos.refractions.net
*
* Copyright (C) 2006 Refractions Research Inc.
*
* This is free software; you can redistribute and... | ALGO | 0.997529 | 5.712299 | {
"github_metadata": {
"branch": "master",
"commit_count": 549,
"repo_created_at": "2015-11-12T06:16:05.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "2b2127e6... |
6af783a1-b5b4-4741-84bb-2a3e6c67931b | ayushshahnsk/final-dsa | 5.cpp | #include <iostream>
#include <cstring>
using namespace std;
struct node
{
char data;
node *left;
node *right;
};
class tree
{
public:
node *top;
void expression(char[]);
void display(node *);
void non_rec_postorder(node *);
void del(node *);
};
class stack1
{
node *data[30];
... | ALGO | 0.999913 | 4.731692 | {
"github_metadata": {
"branch": "main",
"commit_count": 4,
"repo_created_at": "2025-05-08T19:22: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": "f8066b305127... |
1805ddcd-c032-4858-b529-13e31ac281a2 | mono-1729/AtCoder_cpp | ABC/363/d.cpp | #include <bits/stdc++.h>
#include <unordered_map>
#include <stdlib.h>
#include <boost/multiprecision/cpp_int.hpp>
#include <atcoder/all>
using namespace atcoder;
using namespace boost::multiprecision;
using namespace std;
#define rep(i, a, n) for(ll i = a; i < n; i++)
#define rrep(i, a, n) for(ll i = a; i >= n; i--)
#d... | ALGO | 0.999779 | 4.467355 | {
"github_metadata": {
"branch": "main",
"commit_count": 296,
"repo_created_at": "2023-07-13T08:05: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": "bcddcbc2ae... |
384dae02-5fee-4816-be55-97abfe41a40b | MaicolGomez/ACM | pku/predi/2272/8768715_AC_579MS_752K.cc | #include<iostream>
#include<cstdio>
#include<vector>
#include<algorithm>
using namespace std;
int f( double x1 , double y2 ){
if( x1*x1 + y2*y2 <= 9.00 ) return 100;
if( x1*x1 + y2*y2 <= 36.00 ) return 80;
if( x1*x1 + y2*y2 <= 81.00 ) return 60;
if( x1*x1 + y2*y2 <= 144.00 ) return 40;
if( x1*x1 + ... | ALGO | 0.999336 | 3.320772 | {
"github_metadata": {
"branch": "master",
"commit_count": 4,
"repo_created_at": "2018-03-28T01:35:39.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "298159556c... |
f17c5b0e-3516-435e-9b6a-211a0b003f6e | leoshuai/soluOftest2015cplex | test2015cplex/LPB.h | #pragma once
struct ProbData
{
std::string Prob_Name;
double f_optimal;
};
struct OutData
{
int status;// Status of output
double Error;// For public version, I don't need this because I will not know the optimal value of all the problems.
double f_final;// The approximate optimal value returned by LPB
int No... | ALGO | 0.997995 | 5.151479 | {
"github_metadata": {
"branch": "master",
"commit_count": 2,
"repo_created_at": "2016-04-12T10:54: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": "0841fc4925... |
bc86520d-869f-48d8-bf2e-d24719a4aae8 | wangyongcong/fancystar | demo/platformer/platform2d.cpp | #include "platform2d.h"
#include <cassert>
#include <fstream>
#include <sstream>
#include <algorithm>
#include "wyc/util/util.h"
#include "wyc/util/strutil.h"
namespace wyc
{
inline bool compare_vec2d_by_xy (const xvec2f_t &left, const xvec2f_t &right)
{
if(left.x!=right.x)
return left.x<right.x;
return left.y<... | TOOL | 0.970603 | 4.277282 | {
"github_metadata": {
"branch": "master",
"commit_count": 2,
"repo_created_at": "2014-12-19T14:25:55.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "5aedcf83d0... |
fcd4cf25-be1c-4a6e-9594-ea381840a899 | AlaminPu1007/leet-code | Leet-Code/551. Coin Change/322_Coin_Change_memoization.cpp | /**
* Naive of brute force approach, it will give us TLE(Time limit exceed)
* Accepted
*/
#include <bits/stdc++.h>
using namespace std;
class Solution
{
public:
int coinChange(vector<int> &coins, int amount)
{
int n = coins.size();
vector<vector<int>> dp(n + 1, vector<int>(amount + 1, -1));
int r... | ALGO | 0.999979 | 4.38004 | {
"github_metadata": {
"branch": "master",
"commit_count": 1102,
"repo_created_at": "2022-06-13T15:42:37.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 6,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "7bc356f... |
3e42e56d-d1a9-45aa-bbcc-3608a79e246c | ThienStylemen/LearnAlgorithmnCPlusPlus | LearnAlgorithmnCPlusPlus/BINARY SEARCH TREE/Distinct Count.cpp | //
// Distinct Count.cpp
// LearnAlgorithmnCPlusPlus
//
// Created by NguyenTanThien on 2/5/20.
// Copyright © 2020 NguyenTanThien. All rights reserved.
//
/*
ViEng
Distinct Count
Given an array A of N integers, classify it as being Good, Bad or Average. It is called Good, if it contains exactly X distinct int... | ALGO | 0.999497 | 5.277393 | {
"github_metadata": {
"branch": "master",
"commit_count": 48,
"repo_created_at": "2020-01-28T00:46: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": "132b6487f... |
237f52e8-0488-48a7-9155-d8f5886e7017 | Ky0ya/DSA-practice | Striver Sheet/Linked List/addTwoNumbers.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) {}
};
int lengthList(ListNode* head){
int count=0;
if(head=... | ALGO | 0.99905 | 4.992084 | {
"github_metadata": {
"branch": "main",
"commit_count": 1,
"repo_created_at": "2023-07-10T20:41:28.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "670e5ead05a3... |
6e67ce93-7812-4aca-8e8b-546847044b69 | LuoKuanShu/CplusplusPractice | chapter5_statement/5.3_condition_statement/5.3.1_if_statement/prac/5.6_prac.cpp | #include <iostream>
#include <vector>
#include <string>
using namespace std;
int main(void){
//store int scores
unsigned int grade = 0;
vector<unsigned int> grades;
while (cin >> grade){
grades.push_back(grade);
}
vector<string> finalGrades(grades.size()); //initial to specific num of vector.
//store ... | ALGO | 0.99209 | 4.34183 | {
"github_metadata": {
"branch": "master",
"commit_count": 93,
"repo_created_at": "2018-11-30T06:40: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": "37b532f3c... |
3f657f8c-8d63-45e3-b617-6a90ca0d6ba6 | OpenStarbound/OpenStarbound | source/core/StarSmallVector.hpp | #pragma once
#include "StarAlgorithm.hpp"
namespace Star {
// A vector that is stack allocated up to a maximum size, becoming heap
// allocated when it grows beyond that size. Always takes up stack space of
// MaxStackSize * sizeof(Element).
template <typename Element, size_t MaxStackSize>
class SmallVector {
publi... | TOOL | 0.937941 | 7.26337 | {
"github_metadata": {
"branch": "main",
"commit_count": 1561,
"repo_created_at": "2023-06-20T04:18:02.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 847,
"forks": 106,
"issues": 80,
"pull_requests": 13
},
"file_meta": {
"content_id": "65b2... |
86389928-ec48-408a-a485-fd52ffb4dc90 | 2018eeb1139/cpp-codes-restart | graphs/detectCycle_directed.cpp | #include <iostream>
#include <vector>
using namespace std;
bool dfs(int node, vector<int> adj[], vector<bool> &vis, vector<int> &curr_path)
{
vis[node] = true;
curr_path[node] = 1;
for (int &child : adj[node])
{
if (!vis[child])
{
if (dfs(child, adj, vis, curr_path))
... | ALGO | 0.999937 | 5.349522 | {
"github_metadata": {
"branch": "main",
"commit_count": 56,
"repo_created_at": "2025-05-08T10:16: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": "9ef08ac863d... |
37e5551f-6809-4086-8665-de53aff52e6d | irff/cp-codes | Pelatda/babylon.cpp | #include <cstdio>
#include <algorithm>
using namespace std;
#define R(i,_a,_b) for(int i=int(_a);i<int(_b);i++)
typedef struct {
int a, b, c;
} cube;
cube x[1000111];
int lis[100111], n;
bool cp(cube f, cube s) {
if(f.a==s.a) {
return f.b < s.b;
}
return f.a < s.a;
}
int main() {
scanf("... | ALGO | 0.999684 | 3.485254 | {
"github_metadata": {
"branch": "master",
"commit_count": 1,
"repo_created_at": "2014-10-19T18:22:50.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "78dc92bf10... |
9a94dd43-2e36-437a-b56d-9375d7b9ef44 | Razeenadil/CPSC-457 | analyzeDir.cpp | /*
<NAME>
Assignment 2
CPSC 457
*/
#include "analyzeDir.h"
#include <dirent.h>
#include <sys/stat.h>
#include <sys/types.h>
#include <unistd.h>
#include <iostream>
#include <cstring>
#include <unordered_map>
#include <set>
#include <string>
#include <vector>
#include <cstdio>
#include <algorithm>
using names... | ALGO | 0.989568 | 5.078703 | {
"github_metadata": {
"branch": "main",
"commit_count": 2,
"repo_created_at": "2023-01-27T19:04: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": "a000400494f9... |
f3fe2830-732e-44ed-8da6-24271b04ffe1 | Yawn-Sean/Daily_CF_Problems | daily_problems/2025/02/0211/personal_submission/cf1184e1_hum.cpp | #include <bits/stdc++.h>
using namespace std;
int main() {
ios_base::sync_with_stdio(false);
cin.tie(nullptr);
int n, m;
cin >> n >> m;
vector<array<int, 3>> a(m);
for (int i = 0; i < m; i++) {
int u, v, w;
cin >> u >> v >> w;
a[i] = {w, u - 1, v - 1};
}
ranges::sort(a.begin() + 1, a.end... | ALGO | 0.99982 | 4.444372 | {
"github_metadata": {
"branch": "main",
"commit_count": 20410,
"repo_created_at": "2024-02-26T01:04:08.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 478,
"forks": 302,
"issues": 0,
"pull_requests": 7
},
"file_meta": {
"content_id": "7921... |
5afe5ac1-bc76-4f28-a2b0-0455bdfa3ecf | tommy-weng/my-cpp | Algrithom/quick-sort.cpp | #include <iostream>
using namespace std;
void print_array(int arr[], int size)
{
for (int i = 0; i < size; i++)
{
cout << arr[i] << " ";
}
cout << '\n';
}
void quick_sort(int a[], int low, int high)
{
if (low < high)
{
int key = a[low];
int i = low;
int j = hi... | ALGO | 0.999918 | 5.314223 | {
"github_metadata": {
"branch": "master",
"commit_count": 95,
"repo_created_at": "2018-12-18T05:22:58.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 1,
"issues": 1,
"pull_requests": 0
},
"file_meta": {
"content_id": "6c9d0c215... |
b7b0b528-b7f0-4e5b-8b69-052a71be79fa | NitkarshChourasia/pro-b_lang_master_private | downloaded_completely/C++/expert/[1524] Generate N-Size Combinations from an Array [Ex].cpp | /*
#### Generate N-Size Combinations from an Array ####
Create a function that returns all combinations of size n from an array. Sort the array in ascending lexicographical order.
[Examples]
___
combo([1, 2, 3, 4], 1) ➞ [[1], [2], [3], [4]]
combo([1, 2, 3, 4], 2) ➞ [[1, 2], [1, 3], [1, 4], [2, 3], [2, 4], [3, 4]... | ALGO | 0.999354 | 6.431173 | {
"github_metadata": {
"branch": "main",
"commit_count": 153,
"repo_created_at": "2022-12-11T14:53:27.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 2,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "49c8f93f5c... |
53bbce83-7123-4ef0-a277-7cc740ce5504 | simonjamain/testCSP | demos/kiwiChris.cpp | #include <kiwi/kiwi.h>
#include <stdio.h>
/*
* c++ version of <NAME> example here
* https://groups.google.com/d/msg/enaml/DVaSWDGfLkc/dutzhOB7ALsJ
* */
using namespace kiwi;
int main( int argc, const char* argv[] )
{
// 0|-------------| x1 ----- xm ----- x2 |-----------------------|100
/*
x1 = kiwi.Va... | ALGO | 0.992651 | 5.454358 | {
"github_metadata": {
"branch": "master",
"commit_count": 6,
"repo_created_at": "2015-09-15T07:36:25.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "9c63df652e... |
14ccb78e-d391-40e2-9530-6a7000935ed9 | Antonc3/Competitive-Programming | codeforces/practice/twochesspieces.cpp | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
int n,d;
vector<vector<int>> adj;
vector<int> a,b;
vector<int> depth;
ll totalCost = 0;
int adepth,bdepth;
void dfs(int cur, int par){
if(a[cur]){
totalCost += depth[cur]-adepth;
adepth = depth[cur];
if(adepth-bdepth > d){
... | ALGO | 0.999884 | 3.874164 | {
"github_metadata": {
"branch": "main",
"commit_count": 19,
"repo_created_at": "2021-06-04T01:54:41.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "1cf4e001149... |
2f5582f2-f4ca-450e-b91e-65d1b4164e65 | nicolaprezza/lex-factorization | lex.cpp | #include <iostream>
#include <sdsl/suffix_arrays.hpp>
#include "internal/e_csa.hpp"
using namespace std;
using namespace lex;
using namespace sdsl;
/*
* usage: lex input_file [opt]
*
* options:
*
* -t trailing character at the end of phrases (by default: no trailing char).
*
*/
int main(int argc, char** argv)... | ALGO | 0.992108 | 3.929545 | {
"github_metadata": {
"branch": "master",
"commit_count": 6,
"repo_created_at": "2018-03-15T16:17:19.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "95327e5734... |
e63e5c31-d89e-4c95-a55a-43fcebd60308 | make-ideas/leetcode | 242.有效的字母异位词.cpp | /*
* @lc app=leetcode.cn id=242 lang=cpp
*
* [242] 有效的字母异位词
*/
#include <unordered_map>
using namespace std;
// @lc code=start
class Solution {
public:
bool isAnagram(string s, string t) {
if(s.length() != t.length()) return false;
#if 0
map<char, int> mps;
map<char, int> mpt;
... | ALGO | 0.999844 | 6.332689 | {
"github_metadata": {
"branch": "master",
"commit_count": 8,
"repo_created_at": "2021-01-24T14:47: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": "7b36a3a07f... |
43869894-d1cd-456b-8308-5e7f8195e7ca | Thoufeek23/Handy_DSA | linearsearch.cpp | #include <iostream>
#include <vector>
using namespace std;
int linearsearch(vector<int> arr, int key)
{
for (int i = 0; i < arr.size(); i++)
{
if (arr[i] == key)
{
return i;
}
}
return -1;
}
int main()
{
cout << "Enter array size: ";
int n;
cin >> n;
... | ALGO | 0.999538 | 5.481621 | {
"github_metadata": {
"branch": "main",
"commit_count": 10,
"repo_created_at": "2025-01-18T02:49: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": "7ec423d6228... |
ed2d2d39-2024-46ca-a5ef-858aaf46559b | JaeHua/DataStruct_SourceCode | Graph/ShorttestPath/floyed.cpp | //
// Created by jjh on 2023/12/21.
//
#include <iostream>
#include <vector>
#define Max 503
#define INF 0xcffffff
using namespace std;
typedef struct AMGraph { //定义图
int vex, arc;
int arcs[Max][Max]; //邻接矩阵
};
int path[Max][Max]; //dis保存最短路径总权值、path通过保存路径的前驱结点来保存路径
void putin(AMGraph &G... | ALGO | 0.999993 | 5.036845 | {
"github_metadata": {
"branch": "master",
"commit_count": 18,
"repo_created_at": "2023-12-22T07:32:14.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "8ad93fa84... |
ad80cd35-e3cc-4a78-9da5-4f659d43aa16 | sunny-lan/cpp-contest | bit operations lesson.cpp | #include <cstring>
#include <iostream>
#define MAX(a,b)(a>b?a:b)
#define MIN(a,b)(a<b?a:b)
int r, c, s, b, k, m;
int temp[51][51];
int val[51][51];
int dp[55][55][55][55];
int f(int h, int pos, int t, int num) {
int &res = dp[h][pos][t][num];
if (res == -1) {
if (h > r || num == k) res = 0;
else {
for (int i =... | ALGO | 0.999804 | 3.367893 | {
"github_metadata": {
"branch": "master",
"commit_count": 1,
"repo_created_at": "2018-07-02T19:05:08.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 3,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "538eb24a09... |
b0723b03-6710-43c3-89e3-40bf55a980f1 | AvaLovelace1/competitive-programming | solutions/fhc/fhc15c1p2.cpp | /*
Solution to Autocomplete by <NAME>
Key concepts: trie
*/
#include <bits/stdc++.h>
using namespace std;
int T, N, cnt;
string S;
int trie[1000001][27];
void insert(string s) {
int n = 0;
for (char c : s) {
if (trie[n][c - 'a'] == 0) {
trie[n][c - 'a'] = cnt;
cnt++;
... | ALGO | 0.999948 | 4.690078 | {
"github_metadata": {
"branch": "master",
"commit_count": 782,
"repo_created_at": "2018-03-04T18:04:34.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 8,
"forks": 1,
"issues": 1,
"pull_requests": 0
},
"file_meta": {
"content_id": "1adeb3f2... |
1b12e5fe-0853-440a-9e16-e6f6e18515d4 | lidianxiang/leetcode_CPP | 动态规划/97-交错字符串.cpp | /*
给定三个字符串 s1、s2、s3,请你帮忙验证 s3 是否是由 s1 和 s2 交错 组成的。
两个字符串 s 和 t 交错 的定义与过程如下,其中每个字符串都会被分割成若干 非空 子字符串:
s = s1 + s2 + ... + sn
t = t1 + t2 + ... + tm
|n - m| <= 1
交错 是 s1 + t1 + s2 + t2 + s3 + t3 + ... 或者 t1 + s1 + t2 + s2 + t3 + s3 + ...
提示:a + b 意味着字符串 a 和 b 连接。
示例 1:
输入:s1 = "aabcc", s2 = "dbbca", s3 = "aadbbcbcac"
... | ALGO | 0.998536 | 5.661419 | {
"github_metadata": {
"branch": "master",
"commit_count": 551,
"repo_created_at": "2020-10-19T01:43:15.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 3,
"forks": 2,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "56bd7778... |
49b2c4de-d7fc-43c1-b038-c9b5c7cb306a | Noverish/Language-C | withcs.net/withcs 2759 01000001/withcs 2759 01000001/소스.cpp | #include <stdio.h>
#include <string.h>
#define LENGTH 100
/*실제 1과 0을 아스키코드의 1과 0으로 바꾼다*/
int change_number_to_ASCII(char real_number[]) {
int i;
for(i=LENGTH-1;i>=0;i--)
if(real_number[i]==1) break;
if(i==-1) { //0일때를 생각
real_number[0] += '0';
return 0;
}
for(;i>=0;i--)
real_number[i] += '0';
return... | ALGO | 0.999641 | 3.443045 | {
"github_metadata": {
"branch": "master",
"commit_count": 1,
"repo_created_at": "2016-07-23T15:56: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": "f099eacf64... |
398e4e61-535f-46c6-b880-278baf5177cf | Pichara/data_structures | C DS/hash_tables.cpp | #include <stdio.h>
#include <stdlib.h>
#include <string.h>
#define TABLE_SIZE 5
// Structure for each key-value entry
typedef struct Entry {
char *key;
char *value;
struct Entry *next;
} Entry;
// Global hash table
Entry *table[TABLE_SIZE];
// Simple hash function
unsigned int hash(const char *key) {
... | ALGO | 0.978374 | 5.783372 | {
"github_metadata": {
"branch": "main",
"commit_count": 12,
"repo_created_at": "2024-10-01T13:24: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": "e4673eeb43d... |
2b11f885-494c-4e96-8bbf-385fd16f31da | WatchDogStudios/WDFoundation_OSS | Code/Foundation/Application/Config/Implementation/PluginConfig.cpp | /*
* Copyright (c) 2023-present WD Studios L.L.C.
* All rights reserved.
* You are only allowed access to this code, if given WRITTEN permission by Watch Dogs LLC.
*/
#include <Foundation/FoundationPCH.h>
#include <Foundation/Application/Config/PluginConfig.h>
#include <Foundation/IO/FileSystem/DeferredFileW... | TOOL | 0.933822 | 6.76383 | {
"github_metadata": {
"branch": "main",
"commit_count": 3,
"repo_created_at": "2024-04-23T20:54:43.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 2,
"pull_requests": 0
},
"file_meta": {
"content_id": "2a5dd25ba1bc7... |
9448e449-d67a-4dd3-80be-9a8355fcae35 | AMReX-Codes/amrex-tutorials | ExampleCodes/Basic/HeatEquation_EX2_C/Source/mykernel.H | #ifndef MY_KERNEL_H_
#define MY_KERNEL_H_
#include <AMReX_FArrayBox.H>
AMREX_GPU_DEVICE AMREX_FORCE_INLINE
void init_phi (int i, int j, int k,
amrex::Array4<amrex::Real> const& phi,
GpuArray<amrex::Real,AMREX_SPACEDIM> const& dx,
GpuArray<amrex::Real,AMREX_SPACEDIM> const&... | ALGO | 0.999155 | 4.550613 | {
"github_metadata": {
"branch": "main",
"commit_count": 436,
"repo_created_at": "2021-03-02T00:07:11.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 63,
"forks": 85,
"issues": 2,
"pull_requests": 1
},
"file_meta": {
"content_id": "d6c7e9268... |
1d525b71-a8c3-479e-9108-83fa2b1d2ebe | ThatKirbyGuy/PracticalWorks | Практические работы/ZverevNikita_№20.cpp | #include <iostream>
#include <locale.h>
using namespace std;
int main()
{
setlocale(LC_ALL, "Russian");
srand(time(0));
int array[10][5];
cout << "Исходный массив, заполненный рандомными числами: " << endl;
for (int i = 0; i < 10; i++)
{
for (int j = 0; j < 5; j++)
{
... | ALGO | 0.988525 | 4.001625 | {
"github_metadata": {
"branch": "main",
"commit_count": 16,
"repo_created_at": "2022-10-31T20:53: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": "448ac7fdabf... |
857bb53e-a455-4681-a88b-0109e4c0bb9d | Anderwer/Algorithm | 刷题/Codeforces/Educational Codeforces Round 170/D_Attribute_Checks.cpp | #include <bits/stdc++.h>
using i64 = long long;
using namespace std;
const int N = 5050;
int f[N][N];
int cnt1[N][N], cnt2[N][N];
void solve()
{
int n, m, cnt = 0;
cin >> n >> m;
for(int i = 1; i <= n; i++)
{
int x; cin >> x;
if(x == 0)
{
cnt++;
continue... | ALGO | 0.999996 | 4.002985 | {
"github_metadata": {
"branch": "master",
"commit_count": 44,
"repo_created_at": "2025-04-02T01:50:29.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "4dc5d0c24... |
c9628735-dc33-4326-a8ff-197fd9a5cd9f | ElvisKwok/code | c++/alg/maxBlackWhitePair.cc | #include <iostream>
#include <algorithm>
using namespace std;
#define MAXSIZE 100
struct point {
float x;
float y;
bool visited;
};
bool compare(const point &p1, const point &p2) {
return p1.x < p2.x;
}
int count(point black[], point white[], int n, int m) {
int cnt = 0;
int maxY;
sort(black+1, black+n, comp... | ALGO | 0.999856 | 4.095907 | {
"github_metadata": {
"branch": "master",
"commit_count": 272,
"repo_created_at": "2014-09-10T16:50:11.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "3b2626a4... |
23af175d-c5a5-4534-a190-3c56c72589bb | ishandutta2007/codeforces-o | origenes/normal/1446/D1.cpp | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<int, int> pii;
#define FOR(i, a, b) for (int (i) = (a); (i) <= (b); (i)++)
#define ROF(i, a, b) for (int (i) = (a); (i) >= (b); (i)--)
#define REP(i, n) FOR(i, 0, (n)-1)
#define sqr(x) ((x) * (x))
#define all(x) (x).begin(), (x).end()
#de... | ALGO | 0.999939 | 3.670006 | {
"github_metadata": {
"branch": "main",
"commit_count": 1,
"repo_created_at": "2024-10-30T15:45:49.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "cb89515ac0c1... |
d96eec10-efa0-4647-8e46-c1bd05a5ddd8 | gburgett/fizzbuzz | blocks/gordonb/fizzbuzz/main.cpp | /* main.cpp
* main program to run fizzbuzz
*/
#include <stdio.h>
#include <stdlib.h>
#include <iostream>
#include <cstdlib>
#include <climits>
#include <cerrno>
#include <cstring>
#include "fizzbuzz.h"
using namespace std;
bool tryParseInt(char* str, int& result);
int main (int argc, // Number of strings i... | TOOL | 0.955188 | 4.647924 | {
"github_metadata": {
"branch": "master",
"commit_count": 11,
"repo_created_at": "2015-12-04T21:14:09.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 1
},
"file_meta": {
"content_id": "865eebfe2... |
71fa094e-1105-4b61-8109-d731cb661111 | semicircunferencia/Red-Hopfield | Hopfield4.cpp | /*
MODELO DE HOPFIELD
Tenemos una red de NxN neuronas, cada una activada (vale 1) o desactivada (vale 0). Cada neurona interactúa con
todas las de alrededor. La fórmula concreta está en el guion, pero lo importante es que el incremento de energía al
activar o desactivar una neurona, s_ij----->1-s_ij es:
Suma de k=1 h... | ALGO | 0.999958 | 4.075353 | {
"github_metadata": {
"branch": "master",
"commit_count": 18,
"repo_created_at": "2023-04-21T12:02: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": "d2103442f... |
099e998b-8d75-404d-b663-884291170402 | kirbisity/carNoiseFinder | src/car.cpp | #include <vector>
#include <string>
#include <iostream>
#include <sstream>
#include <math.h>
/* in current directory */
#include "car.h"
using namespace std;
#define MAXDIFF 2
#define DBCONVERSION false /* determine if the noise fitting will use real energy value instead of dB value */
Car::Car(void) {
target_noise... | ALGO | 0.938927 | 3.819963 | {
"github_metadata": {
"branch": "master",
"commit_count": 9,
"repo_created_at": "2019-06-27T02:56:13.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "0e40ad39f9... |
97a3381c-9c1b-4d7c-90fa-bc4e297350ea | Cptnjack/NetworkSecurityProject | Network Security Summer 1 2015/Source.cpp | #include <iostream>
#include <string>
#include <algorithm>
using namespace std;
void main()
{
char cipher[6][6];
string alphanumericbet = "ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789";
string key, keyc, plaintext, ciphertext, go;
int ind = 0, a = 0;
char first, second;
int f1, f2, s1, s2, len;
//get the key
cout... | ALGO | 0.99971 | 3.959191 | {
"github_metadata": {
"branch": "master",
"commit_count": 3,
"repo_created_at": "2015-06-10T14:15: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": "22e81aaf55... |
0b79d8e4-9aef-4db7-bf70-eafddcc952b9 | HeRaNO/OI-ICPC-Codes | Contest/NAIPC 2019/I.cpp | #include<bits/stdc++.h>
using namespace std;
#define fi first
#define se second
#define SZ(x) ((int)x.size())
#define lowbit(x) x&-x
#define pb push_back
#define ls (u<<1)
#define rs (u<<1|1)
#define ALL(x) (x).begin(),(x).end()
#define UNI(x) sort(ALL(x)),x.resize(unique(ALL(x))-x.begin())
#define GETPOS(c,x) (lower_b... | ALGO | 0.999976 | 3.333853 | {
"github_metadata": {
"branch": "master",
"commit_count": 246,
"repo_created_at": "2018-12-31T09:57:51.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 24,
"forks": 3,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "c66c433... |
cc71802b-89be-453b-9105-0441f598ccd0 | TJFord/sard | USER-OMP/angle_sdk_omp.cpp | /* ----------------------------------------------------------------------
LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator
http://lammps.sandia.gov, Sandia National Laboratories
<NAME>, <EMAIL>
Copyright (2003) Sandia Corporation. Under the terms of Contract
DE-AC04-94AL85000 with San... | ALGO | 0.999395 | 6.522023 | {
"github_metadata": {
"branch": "master",
"commit_count": 10,
"repo_created_at": "2013-05-25T01:38:30.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "cdf8b0ce5... |
e3d598b8-b78c-4b0f-8f9f-cb47d7aad3a8 | PowerCell46/Algorithms | Hash Map/Linear Probing Hash Map.cpp | #include <iostream>
#include <sstream>
class Hashmap {
int size;
int* keys;
int* values;
int* deleted;
static const int DEFAULT_HASHMAP_SIZE = 50;
static const int EMPTY_KEY_VALUE = INT_MIN;
public:
Hashmap() :
size(DEFAULT_HASHMAP_SIZE), keys(new int[DEFAULT_HASHMAP_SIZE]{}), val... | ALGO | 0.918971 | 5.495247 | {
"github_metadata": {
"branch": "main",
"commit_count": 21,
"repo_created_at": "2024-05-25T08:12: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": "74b8e4c53f5... |
14a7059f-b99a-4e8c-ba08-5aea6aea1530 | akshayrathore11/CPP | 12_if_else.cpp | #include <iostream>
using namespace std;
int main() {
int number;
cout << "Enter a number: ";
cin >> number;
// Simple if statement
if (number > 0) {
cout << "The number is positive." << endl;
}
// If-else statement
if (number % 2 == 0) {
cout << "The number is even.... | TOOL | 0.984751 | 3.583284 | {
"github_metadata": {
"branch": "Main",
"commit_count": 17,
"repo_created_at": "2025-01-26T06:33: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": "24461064523... |
3f0823fc-9f38-448f-b236-157943dbc534 | GRTLCollaboration/Chombo | releasedExamples/AMRINS/util/CoarseAverageEdge.cpp | #ifdef CH_LANG_CC
/*
* _______ __
* / ___/ / ___ __ _ / / ___
* / /__/ _ \/ _ \/ V \/ _ \/ _ \
* \___/_//_/\___/_/_/_/_.__/\___/
* Please refer to Copyright.txt, in Chombo's root directory.
*/
#endif
#include "CoarseAverageEdge.H"
#include "AverageEdgeF_F.H"
// --------------... | ALGO | 0.945217 | 5.975772 | {
"github_metadata": {
"branch": "main",
"commit_count": 89,
"repo_created_at": "2018-01-30T14:07:31.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 16,
"forks": 12,
"issues": 1,
"pull_requests": 0
},
"file_meta": {
"content_id": "a91a3a4d33... |
0de2d243-7c3a-43d2-85d1-d197a89cb296 | wdzeng/cp-solutions | codeforces/gym/100482/g.cpp | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<int, int> pii;
typedef pair<double, double> pdd;
typedef vector<int> vi;
#define iter(x) x.begin(), x.end()
#define ms(x) memset(x, 0, sizeof(x))
#define mn(x) memset(x, -1, sizeof(x))
const int M = 1e9 + 7;
int rev(const int i) {
sta... | ALGO | 0.999898 | 4.177777 | {
"github_metadata": {
"branch": "master",
"commit_count": 170,
"repo_created_at": "2019-03-26T03:15: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": "1ca2aae0... |
85d99012-5f7c-41eb-b01e-d43727fcc782 | polinasand/university | algo/string set/StringSet.cpp | #include "StringSet.h"
#include<cmath>
#include<ctime>
#include<chrono>
using namespace std;
#include <iostream>
StringSet::StringSet(): first(nullptr){
srand(time(nullptr));
p = rand();
while (p < pow(2,8)) {
p = p << 1;
}
if (p % 2 == 0)
p++;
}
link::link(unsigned long long key, ... | ALGO | 0.997673 | 4.208042 | {
"github_metadata": {
"branch": "master",
"commit_count": 114,
"repo_created_at": "2020-04-13T08:07: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": "fe4d9db2... |
a4596763-7733-406a-8109-bbef49e42ad2 | jswildcards/up-project | src/04/075.cpp | #pragma GCC optimize("Ofast")
#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,avx2,fma")
#pragma GCC optimize("unroll-loops")
#include <bits/stdc++.h>
#define int long long
#define LEN length()
#define V vector
#define PQ priority_queue
#define PQI PQ<int>
#define PQIR PQ<int, V<int>, greater<int>>
#def... | ALGO | 0.999985 | 4.134358 | {
"github_metadata": {
"branch": "ladder",
"commit_count": 7,
"repo_created_at": "2020-12-31T15:55:16.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "4ac1fcd87a... |
fea760a5-29c0-45d0-af50-34497d5c063b | wkdtjdwns/Cpp | beakjoon/Bronze/Bronze III/9610. 사분면/사분면.cpp | #include <iostream>
#include <algorithm>
#include <string>
#include <vector>
#include <cmath>
#define ll long long
#define fastIo ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);
using namespace std;
int main() {
fastIo;
int n, x, y; cin >> n;
int result[5] = {};
for (int i = 0; i < n; i++) {
cin >> x >> ... | ALGO | 0.998792 | 3.853738 | {
"github_metadata": {
"branch": "main",
"commit_count": 1095,
"repo_created_at": "2024-04-17T10:36: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": "9ac56982c... |
b7dc41ce-25c4-4fad-95e5-9503403bdcdb | ehandel18/Library-Management-System | CSIT 214 Lab 7 Final.cpp | #include <iostream> // For input/output operations
#include <string> // For using std::string
#include <vector> // For using std::vector
#include <ctime> // For handling dates and time
#include <limits> // For numeric_limits (used with cin.ignore)
using std::cout;
using std::cin;
using std... | TOOL | 0.943254 | 6.385619 | {
"github_metadata": {
"branch": "main",
"commit_count": 4,
"repo_created_at": "2025-04-11T04:02: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": "69004cd8afa1... |
dcd891dc-e976-4380-9217-99af548d196c | sseen2/algorithm | BOJstudy/bs/B2467.cpp | #include <bits/stdc++.h>
using namespace std;
#define all(x) x.begin(), x.end()
#define ll long long
#define X first
#define Y second
typedef pair<int, int> pi;
typedef pair<ll,ll> pl;
typedef vector<int> vi;
typedef vector<ll> vl;
const char nl = '\n';
const int N = 100'005;
int n, mn = INT_MAX;
int arr[N];
int res... | ALGO | 0.999996 | 3.86937 | {
"github_metadata": {
"branch": "main",
"commit_count": 173,
"repo_created_at": "2023-07-07T19:19: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": "4824024d90... |
882d3ff7-adc2-4f89-a3ef-5633a06543d2 | saqibnazmus/Face_project | main.cpp | #include <opencv2/opencv.hpp>
#include "face_detection.h"
#include "face_recognition.h"
#include <iostream>
int main() {
// Load models
FaceDetector face_detector("models/retinaface_model.onnx");
FaceRecognizer face_recognizer("models/facenet_model.onnx");
cv::VideoCapture cap(0); // Open webcam
i... | WEB | 0.952926 | 6.185707 | {
"github_metadata": {
"branch": "main",
"commit_count": 17,
"repo_created_at": "2022-11-29T12:15:14.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "487295559cd... |
647e5e8f-824c-4f15-ae65-592be660ef6b | yazuid4/algorithms | Graphs/BITMAP.cc | /*
Question from spoj: http://www.spoj.com/problems/BITMAP/
(Algorithm : BFS on white pixels)
*/
#include<iostream>
#include<vector>
#include<queue>
#include<utility>
#include<cstring>
using namespace std;
#define f first
#define s second
const int MAXN = 500000;
int n, m;
queue< pair<int,int> > Q;
int... | ALGO | 0.999895 | 3.490021 | {
"github_metadata": {
"branch": "main",
"commit_count": 1,
"repo_created_at": "2023-06-07T21:49:29.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "d5e9644ba3a0... |
5c516cf2-59a4-4cbd-b658-e8049b151488 | zhiwei1988/LeetCode | 719-find-k-th-smallest-pair-distance/solution.cpp | class Solution {
public:
int smallestDistancePair(vector<int>& nums, int k) {
int len = nums.size();
sort(nums.begin(), nums.end()); // 排序
int min = 0;
int max = nums[len-1] - nums[0];
// 第 k 个最小距离肯定在 [min, max] 间产生
while (min < max) { // 二分
int mid = (min... | ALGO | 0.999996 | 6.388194 | {
"github_metadata": {
"branch": "master",
"commit_count": 137,
"repo_created_at": "2020-02-08T11:57: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": "1967bf8c... |
b75a193d-9f7e-4236-a2e7-a71749a3a4dd | intervalrain/Cpp | blind75/graph/number_of_islands.cpp | #include <iostream>
#include <vector>
using namespace std;
class Solution {
public:
int numIslands(vector<vector<char>>& grid) {
int m = grid.size(), n = grid[0].size();
vector<vector<bool>> visited(m, vector<bool>(n, false));
int cnt = 0;
for (int i = 0; i < m; i++){
f... | ALGO | 0.999971 | 6.294442 | {
"github_metadata": {
"branch": "main",
"commit_count": 265,
"repo_created_at": "2022-04-25T18:46:57.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "ae820ea74f... |
49e24a99-e072-4923-bb26-7f63ed22c404 | daxbrat/largest_smallest | main.cpp | #include "std_lib_facilities.h"
int main()
{
double num{};
string unit{};
double total{};
double largest{};
double smallest{};
vector <double> nums {};
cout << "Enter a number and unit: \n";
while (cin >> num >> unit) {
if (unit != "cm" && unit != "m" && unit != "in" && unit != "ft") { // reject wrong unit
... | TOOL | 0.946543 | 4.830684 | {
"github_metadata": {
"branch": "main",
"commit_count": 2,
"repo_created_at": "2023-08-28T14:46:44.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "ef9056821932... |
6ef5dd99-9ddc-492f-b90e-79890a53f228 | khaledatia25/cp-problems-solutions | binary-search-session/leetcode34.cpp | #include <bits/stdc++.h>
using namespace std;
/*
Idea find first index and last index of target in the given vector
Solution -> find first index using lower bound
-> find last index using upper bound - 1
-> if lower bound = upper bound there is no elements in the vector
equal target
*/
voi... | ALGO | 0.99997 | 5.561642 | {
"github_metadata": {
"branch": "main",
"commit_count": 27,
"repo_created_at": "2023-09-10T08:46:08.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "7504b706b62... |
1c6a0b99-2a40-4891-a965-c5ff51286b57 | suzumiyayuhi/LeetCodeTrain | 面试经典150题/数组/翻转字符串里的单词.cpp | #include<iostream>
#include<vector>
#include<stack>
using namespace std;
class Solution {
public:
/*
string reverseWords(string s) {
int n = s.size();
vector<string> loot;
string tem;
for(int i = 0; i < n; i++){
if(s[i] == ' '){
if(!tem.empty())
... | ALGO | 0.999916 | 5.036974 | {
"github_metadata": {
"branch": "main",
"commit_count": 95,
"repo_created_at": "2024-04-22T13:54: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": "e9e38f083b7... |
1f11bc99-b643-465d-897d-6d17a5bbbb86 | elmachotroso/unreal_devtoolbox | Engine/Plugins/Experimental/Mutable/Source/MutableRuntime/Private/MuR/OpImageProject.cpp | // Copyright Epic Games, Inc. All Rights Reserved.
#include "MuR/OpImageProject.h"
#include "MuR/ConvertData.h"
#include "MuR/Image.h"
#include "MuR/ImagePrivate.h"
#include "MuR/Layout.h"
#include "MuR/MeshBufferSet.h"
#include "MuR/MeshPrivate.h"
#include "MuR/MutableMath.h"
#include "MuR/MutableTrace.h"
#include "... | ALGO | 0.963205 | 5.980092 | {
"github_metadata": {
"branch": "main",
"commit_count": 3,
"repo_created_at": "2023-03-23T14:37:59.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "4716d88f53f6... |
9ecbfc18-7de3-4482-bf55-101b43a787ab | gA4ss/mymat | src/vector/dot.hpp | /**
* @file dot.hpp
* @author <EMAIL>
* @version 1.0.0
* @date 06-MAY-2022
* @brief Vector dot operator
* @attention
*
*
* @htmlonly
* <span style="font-weight: bold">History</span>
* @endhtmlonly
* Version|Auther|Date|Describe
* -------|------|----|--------
* 1.0.0|yanwenbin|... | ALGO | 0.957981 | 5.917435 | {
"github_metadata": {
"branch": "master",
"commit_count": 8,
"repo_created_at": "2022-11-08T18:40: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": "47621d3411... |
9ecb9632-15eb-467d-8f43-bb8cc55e3f5a | duylonggg/DSA-CodePTIT | Tree/DSA11020.cpp | #include <bits/stdc++.h>
using namespace std;
#define tests() int test_cases; cin >> test_cases; while (test_cases--)
struct Node {
int data;
Node* left;
Node* right;
Node(int val) : data(val), left(nullptr), right(nullptr) {}
void insert(int val) {
if (val < data) {
if (... | ALGO | 0.99966 | 5.337916 | {
"github_metadata": {
"branch": "main",
"commit_count": 49,
"repo_created_at": "2025-03-06T16:29: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": "b6ae45d8d63... |
ec607c4c-c5f6-4d34-8dd3-c93daa47c815 | Hamza-28/CP_Templates | code/Geometry/Closest Pair of Points.cpp | ll min_dis(vector<array<int, 2>> &pts, int l, int r) {
if (l + 1 >= r) return LLONG_MAX;
int m = (l + r) / 2;
ll my = pts[m-1][1];
ll d = min(min_dis(pts, l, m), min_dis(pts, m, r));
inplace_merge(pts.begin()+l, pts.begin()+m, pts.begin()+r);
for (int i = l; i < r; ++i) {
if ((pts[i][1] - my) * (pts[i]... | ALGO | 0.999926 | 4.979325 | {
"github_metadata": {
"branch": "main",
"commit_count": 74,
"repo_created_at": "2025-01-27T14:32:07.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 2,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "658f74370eb... |
29e76eb0-fe0e-4f9a-9334-64377a16f1c8 | cbarnson/uva | src/cpp-stuff/next_bracket_sequence_lexicographical.cc | // Problem # : next_bracket_sequence_lexicographical
// Created on : 2018-11-01 21:53:58
#include <bits/stdc++.h>
#define FR(i, n) for (int i = 0; i < (int)(n); ++i)
#define PR(a, n) \
{ \
cout << #a << " = "; \
FR(i... | ALGO | 0.999995 | 4.864166 | {
"github_metadata": {
"branch": "master",
"commit_count": 259,
"repo_created_at": "2018-09-19T14:22:05.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 3,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "c61c53fe... |
26be6ca4-3f27-4835-a71d-5b811abbd437 | NaoyukiKita/Atcoder | 012-Red_Painting.cpp | #include <iostream>
#include <vector>
using namespace std;
class UnionFind {
private:
int H, W;
vector<bool> is_red;
vector<int> roots;
int dir[4][2] = {
{-1, 0},
{1, 0},
{0, -1},
{0, 1}
};
bool _isInRange(int r, int c) {
if (r < 1 || H < r) return false... | ALGO | 0.999938 | 4.708794 | {
"github_metadata": {
"branch": "main",
"commit_count": 54,
"repo_created_at": "2023-10-17T00:55:46.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "02ce5cf2918... |
fafd241e-986d-4111-8180-1ac704f3358f | satse13/JuecesEnLinea | ED/ej14/ej14/ej14.cpp | // Nombre del alumno ..... <NAME>
// Usuario del Juez ...... A70
#include <iostream>
#include <iomanip>
#include <fstream>
#include"double_linked_list_ed.h"
using namespace std;
template <typename T>
class double_linked_list_ed_plus : public double_linked_list_ed <T> {
using Nodo = typename double_linked_list_ed ... | ALGO | 0.999684 | 4.869859 | {
"github_metadata": {
"branch": "main",
"commit_count": 2,
"repo_created_at": "2023-11-11T16:18: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": "a16f77d091e0... |
52e378cf-710c-4c01-acef-f4a4e178cab5 | yashSingodia/problem-solving | SortingAndSearching/Towers.cpp | #include<bits/stdc++.h>
using namespace std;
long long bs(vector<long long> towerCubes, long long index, long long prevIndex, vector<vector<long long>>& dp) {
if(index==towerCubes.size()) {
return 0;
}
if(dp[index][prevIndex+1] != -1)return dp[index][prevIndex+1];
long long len = 0 + bs(to... | ALGO | 0.999953 | 4.42796 | {
"github_metadata": {
"branch": "main",
"commit_count": 19,
"repo_created_at": "2023-12-08T06:21: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": "bc3fffb3cde... |
216e81d0-1f19-47dd-aeee-8f46889bd3c9 | Kumarmilan02/2105208_OOP_PROGRAM | LAB-2-July-26-2022-class _object/208-q4-inch.cpp | //CREATE A CLASS DISTANCE (FEET ,INCH).INPUT 2 DISTANCE VALUES IN OBJECT,ADD THEM ,STORE THEM IN OBJECT AND DISPALY THE RESULANT DISTANCE.
//STORE THE RESULANT DISTANCE IN CALLING OBJECT.
// 1. c3.add(c1,c2)
// 2. c3=c2.add2(c1,c2)
// 3. return the resulant object c3=c1.add3(c2)
#include <iostream>
using namespace st... | TOOL | 0.972127 | 4.320801 | {
"github_metadata": {
"branch": "main",
"commit_count": 5,
"repo_created_at": "2022-12-22T05:25: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": "6a0018137f85... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.