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 |
|---|---|---|---|---|---|---|---|
883f9a72-c027-4ba1-952b-a9d24c6e3e1c | hsetlik/Phasermatic | plugin/source/Common.cpp | #include "Phasermatic/Common.h"
juce::StringArray getEffectTypeNames() {
juce::StringArray arr;
arr.add("Random Offsets");
arr.add("Phase Flipper");
arr.add("Modulate Odd");
return arr;
}
std::complex<float> c_flerp(std::complex<float> a,
std::complex<float> b,
... | ALGO | 0.969352 | 3.455541 | {
"github_metadata": {
"branch": "main",
"commit_count": 18,
"repo_created_at": "2025-02-24T18:04: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": "15ec2ea3152... |
4fb29032-36e3-4c34-86aa-c45f3695988c | gupta-ashwani/CPP | object_as_argument.cpp | // Passing object as argument in function
#include <iostream>
using namespace std;
class Time
{
int hour, minute, second;
public:
void getTime()
{
cout << "\nEnter hours: ";
cin >> hour;
cout << "Enter minutes: ";
cin >> minute;
cout << "Enter seconds: ";
c... | TOOL | 0.922897 | 5.63163 | {
"github_metadata": {
"branch": "main",
"commit_count": 32,
"repo_created_at": "2024-03-12T06:41: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": "f10e09882b8... |
b5b1162e-22d2-4695-adda-86fb4b00ce68 | soomrack/MR2023 | Sudneko Vladislav/OLD/6th semester/+ OmegaBot.ino | /*
* CONFIGURATION
* Before flashing the microcontroller firmware, make sure that the pins match
*/
#define PIN_SPEED_RIGHT 5
#define PIN_SPEED_LEFT 6
#define PIN_RIGHT_DIRECTION 4
#define PIN_LEFT_DIRECTION 7
#define PIN_LIGHT_RIGHT 1
#define PIN_LIGHT_... | TOOL | 0.941069 | 4.2041 | {
"github_metadata": {
"branch": "main",
"commit_count": 1819,
"repo_created_at": "2023-08-30T20:10:57.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 3,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "fc7f49402... |
ca7b2b99-67f7-4930-8c02-810f366969b4 | devloos/CS1B | Labs/DoublyLinkedList/src/handlers/nodePlacement.cc | /*******************************************************************************
* nodePlacement
-------------------------------------------------------------------------------
* FUNCTION: handles where to place the node by
* going through the linked list from head every time
* its called and using the string co... | ALGO | 0.998175 | 4.190141 | {
"github_metadata": {
"branch": "master",
"commit_count": 149,
"repo_created_at": "2022-01-01T02:03: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": "f3ee2330... |
591a3cdd-19d9-4e47-9614-1b50237b4015 | labmec/neopz | Material/needrefactor/REAL/eulerdif.h | /**
* \file
* @brief Contains the TEulerDiffusivity class which implements a numerical diffusivity coefficient for SUPG.
*/
#ifndef EULERDIFFUSIONHH
#define EULERDIFFUSIONHH
#include "pzvec.h"
#include "pzfmatrix.h"
/**
* @brief Implements a numerical diffusivity coeficient for the SUPG method. \ref analysis ... | ALGO | 0.999346 | 5.856536 | {
"github_metadata": {
"branch": "main",
"commit_count": 10847,
"repo_created_at": "2015-04-03T02:18:47.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 35,
"forks": 11,
"issues": 17,
"pull_requests": 3
},
"file_meta": {
"content_id": "c0cbe8... |
5d62c9aa-c3f3-4c72-9d84-8c23f0d21c9f | niyaznigmatullin/nncontests | 2013/02/CodeChef February Challenge/TRIQUERY.cpp | #include <cstdio>
#include <cstdlib>
#include <cassert>
#include <algorithm>
int ni() {
int c = getchar();
while (c != '-' && (c < '0' || c > '9')) {
c = getchar();
}
int sg = 0;
if (c == '-') {
sg = 1;
c = getchar();
}
int ret = 0;
while (c >= '0' && c <= '9') {... | ALGO | 0.999968 | 3.97142 | {
"github_metadata": {
"branch": "master",
"commit_count": 149,
"repo_created_at": "2015-06-05T12:48:58.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 7,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "f300525e... |
3256d000-e36b-48c5-b614-a991e8719b5a | kabicm/grid2grid | examples/scalapack_submatrix.cpp | #include <grid2grid/cantor_mapping.hpp>
#include <grid2grid/transform.hpp>
#include <mpi.h>
#include <algorithm>
#include <iostream>
#include <string>
#include <vector>
int main(int argc, char **argv) {
using namespace grid2grid;
using namespace grid2grid::scalapack;
MPI_Init(&argc, &argv);
int P, ... | ALGO | 0.92915 | 5.557975 | {
"github_metadata": {
"branch": "master",
"commit_count": 136,
"repo_created_at": "2019-04-15T20:51: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": "c6b2277e... |
5d895f8d-bc91-49b0-9642-401804c211ed | simran-ctrl/100daysofcode | Single Number - GFG/single-number.cpp | //{ Driver Code Starts
#include <bits/stdc++.h>
using namespace std;
// } Driver Code Ends
//User function template for C++
class Solution{
public:
int getSingle(int arr[], int n) {
int result = 0; // Initialize the result to 0
for (int i = 0; i < n; i++) {
result ^= arr[i]; // XOR each element wi... | ALGO | 0.999968 | 5.950778 | {
"github_metadata": {
"branch": "main",
"commit_count": 415,
"repo_created_at": "2023-06-29T17:18: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": "99de58ddea... |
1fc38be8-ac2d-4d22-96b9-1e5c68825490 | Qipu1220/BaiTapKieuCauTruc | 23520493_23521082_23521462_23521604_23521672_BT05/Bai230/Bai230.cpp | #include <iostream>
#include<cmath>
using namespace std;
struct PhanSo
{
float Tu;
float Mau;
};
typedef struct PhanSo PHANSO;
void Nhap(PHANSO&);
void Xuat(PHANSO);
void Nhap(PHANSO[][100], int&, int&);
void Xuat(PHANSO[][100], int, int);
int SoSanh(PHANSO, PHANSO);
PHANSO NhoNhat(PHANSO[][100], int, int);
int Dem... | ALGO | 0.998553 | 3.578419 | {
"github_metadata": {
"branch": "main",
"commit_count": 25,
"repo_created_at": "2023-11-02T15:58:04.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "9297b54c9f6... |
3c4eab7e-2039-42f1-83db-bd8b6980204c | jlprieur/jlplib | jlp_numeric/recent_fft.cpp | /****************************************************************
* Set of routines
* To recentre FFT
*
* Contains:
* RECENT_FFT(in,out,nx,ny,idim)
* RECENT_FFT_DOUBLE(in,out,nx,ny,idim)
* RECENT_FFT_1D_X(in,out,nx,ny,idim)
* RECENT_FFT_1D_Y(in,out,nx,ny,idim)
* RECENT_FFT_1D_X_float(in,out,nx,ny,idim)
* RECENT... | ALGO | 0.99588 | 6.176198 | {
"github_metadata": {
"branch": "master",
"commit_count": 15,
"repo_created_at": "2020-03-27T20:38:17.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "31c270e86... |
94df6603-77be-4a9c-8768-d53852f8ab88 | picnic800/picnic | dtweight/dtweight.cpp | #include <bits/stdc++.h>
#include <fstream>
using namespace std;
int main() {
fstream inputFile("input.csv", ios::in);
if (!inputFile.is_open()) {
cout << "Error: Unable to open the file.";
return 0;
}
string lineContent, feature, group, countString;
int value;
map<string, map<... | DATA | 0.997534 | 5.38216 | {
"github_metadata": {
"branch": "master",
"commit_count": 1,
"repo_created_at": "2024-11-11T14:47:48.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "c0bbf2e509... |
c8679948-f040-492a-a00b-0ce8c4225a9d | arefin-nabil/Phitron | Phitron/Basic Data Structures/M_6-LinkedList Operations/Insert_at_head.cpp | #include <bits/stdc++.h>
using namespace std;
class Node
{
public:
int val;
Node *next;
Node(int val)
{
this->val = val;
this->next = NULL;
}
};
void insert_at_head(Node *&head, Node *&tail, int val)
{
Node *newnode = new Node(val);
if (head == NULL)
{
head = ne... | ALGO | 0.999831 | 4.295518 | {
"github_metadata": {
"branch": "master",
"commit_count": 46,
"repo_created_at": "2025-04-05T10:21: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": "da4b26893... |
32a8da0f-4965-4e25-8312-c3400cbfe7d4 | tiberiu/delaunay-triangulation | bowyer-watson/delaunay_bowyerwatson.cpp | #include "triangulation.hpp"
#include "common.hpp"
#include <iostream>
#include <algorithm>
using namespace std;
// Store the info for an edge of the polygon-hole that needs to be retriangulated
struct PolygonEdge {
// the neighbouring triangle for this edge from outside the polygon
int nodeId;
// Edge
... | ALGO | 0.999929 | 5.395037 | {
"github_metadata": {
"branch": "master",
"commit_count": 11,
"repo_created_at": "2017-07-12T10:56:23.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "8e6e2511f... |
69da858d-dc10-4cf8-9c65-0f28834dca6c | kashmalvi/DSA---SS.ERIES | STL - containers/SET.cpp | //****************************************************************************
//***************************** SET *************************************
//****************************************************************************
#include<iostream>
#include<conio.h>
#include<set> //set library
using nam... | ALGO | 0.992569 | 3.992507 | {
"github_metadata": {
"branch": "main",
"commit_count": 40,
"repo_created_at": "2022-09-14T12:43: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": "549f8465c90... |
c339cd7d-f11e-41b7-b59e-f1917db07238 | tzinas/NTUA_programming | progtech/assignment_4/lexicon.cpp | #include <stdio.h>
#include <iostream>
#include<string.h>
using namespace std;
class lexicon {
private:
struct node{
string word;
int num;
node *left, *right;
};
node *root;
public:
lexicon () {
root = nullptr;
}
~lexicon () {
delete root;
}
void insert (const string &s) {
if ... | ALGO | 0.992381 | 3.571719 | {
"github_metadata": {
"branch": "master",
"commit_count": 6,
"repo_created_at": "2020-03-27T16:05: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": "d696c9e494... |
f79abc9f-2dc4-4177-9bea-26e9fe712793 | ccoliu/NTUST_OOP | C++Practice/CS1010301W03/TS0204/Source.cpp | //Name:¼B®a¦¨
//Date: 2022/3/9
//Last Update: 2022/3/9
//Problem statement:Print Standard Format.
#include <iostream>
#include <vector>
#include <math.h>
#include <algorithm>
using namespace std;
int main()
{
int T;
while (cin >> T)
{
vector<string> names;
vector<string> salary;
vector<string> award;
strin... | ALGO | 0.995377 | 4.527275 | {
"github_metadata": {
"branch": "main",
"commit_count": 30,
"repo_created_at": "2023-06-14T05:56: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": "9bb8ea39227... |
c7bf4b2e-6e8e-451c-9c06-de8121464ef8 | sslab-gatech/qsym | third_party/pin-2.14-71313-gcc.4.4.7-linux/source/tools/MemTrace/membuffer_simple_tid.cpp | /*BEGIN_LEGAL
Intel Open Source License
Copyright (c) 2002-2015 Intel 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 noti... | TOOL | 0.951937 | 6.729301 | {
"github_metadata": {
"branch": "master",
"commit_count": 66,
"repo_created_at": "2018-08-16T18:30:29.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 646,
"forks": 137,
"issues": 8,
"pull_requests": 0
},
"file_meta": {
"content_id": "05394f... |
bc5eb9b2-be54-43e2-8510-1a969291d658 | GersonCavalheiro/OpenMPSnapshot | May2023/RepCPP/240264505/sqrt.hpp |
#ifndef LBT_CEM_SQRT
#define LBT_CEM_SQRT
#pragma once
#include <cstdint>
#include <limits>
#include <type_traits>
#include "definitions.hpp"
#include "is_inf.hpp"
#include "is_nan.hpp"
#include "is_almost_equal_eps_rel.hpp"
namespace lbt {
namespace cem {
namespace detail {
template <typename T, std::int64_t R... | ALGO | 0.999343 | 6.657446 | {
"github_metadata": {
"branch": "master",
"commit_count": 3,
"repo_created_at": "2024-08-19T17:35:40.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 4,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "832ca00a90... |
30cd0256-afaa-4489-9059-42e17e4f61c5 | sagarsingla14/Codechef | ketan3.cpp | #include <bits/stdc++.h>
using namespace std;
#define ll long long int
ll calc(string str) {
ll w = 0;
for(auto i : str) {
w += (i - 'a' + 1);
}
return w;
}
static bool comp(pair <string , ll> &a , pair <string , ll> b) {
return a.second < b.second;
}
int main() {
ll t;
cin >> t;
... | ALGO | 0.999993 | 3.736253 | {
"github_metadata": {
"branch": "master",
"commit_count": 3,
"repo_created_at": "2019-09-16T18:20: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": "dacc40fc43... |
ac7ff5f6-0d33-42bb-bb1e-214696172dee | amberbhardwaj/CppNotam | Junk.cpp | /*
The MIT License (MIT)
Copyright (c) <2021> <<NAME>>
Permission is hereby granted, free of charge, to any person obtaining a copy of
this software and associated documentation files (the "Software"), to deal in
the Software without restriction, including without limitation the rights to
use, copy, modify, merge, publ... | ALGO | 0.999717 | 4.722032 | {
"github_metadata": {
"branch": "main",
"commit_count": 3,
"repo_created_at": "2021-03-05T18:24:08.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "2f317a2eb72b... |
fdba6002-baea-4ebc-9842-e0d20cefb587 | cryptotitan22/CG_artwork | Kite Drawing Using GL-LINES/main.cpp | #include <windows.h>
#include <GL/glut.h>
#include <stdio.h>
#include <GL/gl.h>
void init(void)
{
glClearColor(0.0,0.0,0.0,0.0); //GLfloat red,green,blue,alpha initial value 0 alpha values used by glclear to clear the color buffers
glMatrixMode(GL_PROJECTION); // To specify which matrix is the current matrix ... | ALGO | 0.912862 | 3.934115 | {
"github_metadata": {
"branch": "main",
"commit_count": 9,
"repo_created_at": "2025-01-28T05:25: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": "eefb361d7574... |
a5629fe2-055c-4d89-9b06-da7cacd057ee | ManavSahay/DSA-CPP | LinkedList/SingleLinkedList.cpp | #include <iostream>
#include <stdlib.h>
using namespace std;
typedef struct node {
int data;
node *next;
}node;
node *head, *insertionNode, *temp1, *temp2, *temp3, *newNode;
int sizeGlobal;
void createList();
void printList();
void insertFirst();
void insertLast();
void insertMiddle(int position);
void dele... | ALGO | 0.999427 | 4.738245 | {
"github_metadata": {
"branch": "main",
"commit_count": 1,
"repo_created_at": "2024-02-06T13:54:44.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "b134dba1fcce... |
ddf1c19d-9ed1-4e14-9893-947728ef983a | lpsztemp/parallel_mod | parallel_mod/randomize.cpp | #include "randomize.h"
#include <random>
#include <chrono>
#include <vector>
#include <chrono>
#include <thread>
#include <climits>
#ifdef _MSC_VER
#pragma warning (disable: 4146)
#endif //_MSC_VER
void randomize(void* pData, std::size_t cbData)
{
std::size_t T = std::thread::hardware_concurrency();
std::uintptr_t ... | TOOL | 0.950664 | 4.275509 | {
"github_metadata": {
"branch": "main",
"commit_count": 4,
"repo_created_at": "2020-11-24T08:10: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": "824ccc3e31a4... |
33402d2f-c18f-49c2-bf22-84ae54f584ca | muskankapoor/daily_coding | string/small_string.cpp | #include <iostream>
#include <string>
using std::cout;
using std::endif;
using std::sting;
vector<int> solution(string&, string&);
char smallestCharacter(string, int);
int frequencyOfCharacter(string, char);
vector<int> solution(string &A, string &B){
vector<int> result;
vector<string> aWords, bWords;
/... | ALGO | 0.999882 | 4.220987 | {
"github_metadata": {
"branch": "master",
"commit_count": 128,
"repo_created_at": "2019-06-13T19:58: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": "5a9b0e6a... |
de6b5d42-16b1-47f7-a58b-74697df79c84 | bear-zd/sj-Structure-origin-code- | 作业/第六章四-7/TestSqBinaryTree.cpp | #include "SqBinaryTree.h" // 顺序存储二叉树类
int main(void)
{
int p;
char c='a', e;
char pre[]={'A','B','D','H','I','E','J','K','C','F','L','M','G','N','O'}; // 先序序列
char in[]={'H','D','I','B','J','E','K','A','L','F','M','C','N','G','O'}; // 中序序列
int n = 15, size=15; // 结点个数
SqBinaryTree<char> bt;
bt... | ALGO | 0.99927 | 3.487703 | {
"github_metadata": {
"branch": "master",
"commit_count": 17,
"repo_created_at": "2020-12-03T23:55:11.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "de4119987... |
d62ef3e5-cef8-426f-b1fe-b7cf10644d5c | mqys/leetcode | houseRobber.cc | class Solution {
public:
int rob(vector<int>& nums) {
vector<int> maxSum(nums.size(),0);
// bool flag = false;
if (nums.empty()) return 0;
if (nums.size() < 2) return nums[0];
// -- need a flag ???
// maxSum[0] = nums[0];
// if (nums[0] > ... | ALGO | 0.999979 | 5.132059 | {
"github_metadata": {
"branch": "master",
"commit_count": 49,
"repo_created_at": "2015-09-23T02:01: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": "4e6f4aaf5... |
ed303525-e1d6-4c2e-848a-8c4b949e9f95 | RowonChung/SSAFY21_Algorithm | 김경빈/0317/19237.cpp | #include <iostream>
#include <algorithm>
#include <cstring>
#include <string>
#include <vector>
#include <queue>
#include <map>
#include <cmath>
#include <climits>
#include <unordered_map>
using namespace std;
struct SHARKS {
int y, x, direc;
};
int N, M, k, arr[21][21][2], direc[401][5][4], cnt;
int dy[] = { 0, -... | ALGO | 0.999964 | 4.067561 | {
"github_metadata": {
"branch": "main",
"commit_count": 505,
"repo_created_at": "2024-01-22T02:28:02.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 4,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "e9be95e19d... |
8f1aa876-cba2-4f72-bd31-f022de07e2c5 | GLlenner/OSTEP | hw/chapter30_cond-val/product-consumer_rbuf.cpp | //实现环形缓存区,注意缓冲区为空和满时的条件
#include<pthread.h>
#include<assert.h>
#include<iostream>
#include<unistd.h>
using namespace std;
#define BUFSIZE 3
int buf[BUFSIZE];
int head = 0,tail = 0;
pthread_mutex_t mutex = PTHREAD_MUTEX_INITIALIZER;
pthread_cond_t cons_cond = PTHREAD_COND_INITIALIZER;
pthread_cond_t prod_cond = PTHRE... | ALGO | 0.98804 | 4.948689 | {
"github_metadata": {
"branch": "main",
"commit_count": 7,
"repo_created_at": "2025-04-19T15:40:04.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "bcff8ba72ead... |
4b9e8bb9-265a-422a-845d-fc1272fc58c4 | ishandutta2007/codeforces-k | kostya_by/normal/134/A.cpp | //
// main.cpp
// average
//
// Created by <NAME> MacBook on 12.05.11.
// Copyright (c) 2012 __MyCompanyName__. All rights reserved.
//
#include <iostream>
#include <cstdio>
#include <cmath>
#include <vector>
#include <map>
#include <set>
#include <string>
#include <cstring>
#include <algorithm>
#include <iomanip>... | ALGO | 0.999835 | 3.299568 | {
"github_metadata": {
"branch": "main",
"commit_count": 1,
"repo_created_at": "2024-04-11T06:06: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": "39dafdd041be... |
7d0c93fe-fd38-47e9-846d-6725a475e57b | yongukpark/BOJ | Greedy/1202.cpp | //일단 결과값이 long long으로 나와야 한다는 것을 인지해야함
//vector에서의 삭제는 O(n)을 따르고 map set 에서의 삭제는 O(n)을 따름
//따라서 이문제는 vector를 이용하여 삭제할경우 시간초과가 나는 문제임
//용도에 따라 컨테이너를 적절히 활용해야함을 크게 깨달음
#include <iostream>
#include <algorithm>
#include <string>
#include <utility>
#include <vector>
#include <map>
using namespace std;
bool compare(pair<in... | ALGO | 0.999935 | 3.512944 | {
"github_metadata": {
"branch": "main",
"commit_count": 351,
"repo_created_at": "2021-11-18T11:45:47.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "dd0a417451... |
c8f02afb-d49e-42cf-8f7d-cf6ee4e974ab | JGU-HPC/parallelprogrammingbook | chapter6/advanced_reductions/avx_reduction.cpp | #include <iostream> // std::cout
#include <cstdint> // uint64_t
#include <cmath> // INFINITY
#include <random> // random
#include <immintrin.h> // AVX intrinsics
struct avxop {
__m256 neutral;
avxop() : neutral(_mm256_set1_ps(-INFINITY)) {}
inline __m256 operator()(
const ... | ALGO | 0.99927 | 4.266931 | {
"github_metadata": {
"branch": "master",
"commit_count": 46,
"repo_created_at": "2017-11-22T09:12:43.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 72,
"forks": 25,
"issues": 0,
"pull_requests": 1
},
"file_meta": {
"content_id": "1aa39b17... |
8959716c-6fe4-4d26-bfbc-45aea8ab7ac4 | lionell/labs | nlp/processed/column/TE5657.cc | #include<bits/stdc++.h>
using namespace std;
#define ll long long
#define st string
#define endl '\n'
#define fi first
#define se second
void file(){
ios_base::sync_with_stdio(0);
cin.tie(0);
cout.tie(0);
//freopen("wheel.in", "r", stdin); freopen("wheel.out", "w", stdout);
}
const int N = 100005;
ll... | ALGO | 0.99999 | 3.39958 | {
"github_metadata": {
"branch": "master",
"commit_count": 216,
"repo_created_at": "2015-07-12T08:15:06.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2,
"forks": 2,
"issues": 1,
"pull_requests": 0
},
"file_meta": {
"content_id": "cb0e8a86... |
35ab64b5-8aa9-46de-bb56-fadc8c01ee39 | lballabio/QuantLib | ql/experimental/math/fireflyalgorithm.hpp | /* -*- mode: c++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*
Copyright (C) 2015 <NAME>
This file is part of QuantLib, a free-software/open-source library
for financial quantitative analysts and developers - http://quantlib.org/
QuantLib is free software: you can redistribute it and/or modify it... | ALGO | 0.99995 | 7.218852 | {
"github_metadata": {
"branch": "master",
"commit_count": 17543,
"repo_created_at": "2015-12-17T16:29:33.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 6151,
"forks": 1964,
"issues": 51,
"pull_requests": 11
},
"file_meta": {
"content_id":... |
a317850e-9837-4f50-ba57-b90ed3843606 | agusaldasoro/tc-2016 | Dia6/F.cpp | #include <bits/stdc++.h>
using namespace std;
vector<int> low;
vector<int> state;
vector<int> depth;
vector<pair<int, int> > puentes;
vector<bool> puntosDeArticulacion;
int n, m;
vector<vector<int> > theMatrix;
stack<pair<int,int> > edges;
vector<unordered_map<int, bool> > componentesBiConexas;
void calcularLow(int i... | ALGO | 0.999642 | 4.176622 | {
"github_metadata": {
"branch": "master",
"commit_count": 38,
"repo_created_at": "2016-07-18T17:11: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": "99d1b50d7... |
4e464d07-fdef-4783-829f-015cfb9e62c4 | JacobianDet/CompeteUp | 637/D.cpp | #include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
using namespace std;
using namespace __gnu_pbds;
#define INF (1LL<<59)
#define MV 200001
#define LMV 21
#define ff first
#define ss second
#define pb push_back
#define eb emplace_back
#define emp emplace
#define whoam... | ALGO | 0.999761 | 3.656371 | {
"github_metadata": {
"branch": "master",
"commit_count": 6,
"repo_created_at": "2018-08-04T16:37:05.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 1,
"issues": 0,
"pull_requests": 2
},
"file_meta": {
"content_id": "c5177d6080... |
0db5fa2b-ac8f-48c1-8a61-5f45684ea67b | acc-cosc-1337-summer-2023/midterm-giovanny-garcia | src/question_1/main.cpp | #include "question1.h"
using std::cout; using std::cin;
int main()
{
int x;
cout << "Please Enter a whole number between 1 and 15: (Enter 0 to exit)\n";
cin >> x;
do
{
if (x > 0 && x <= 15)
{
get_fib_sequence(x);
cout << "Please Enter a whole number between 1 ... | ALGO | 0.984203 | 3.589233 | {
"github_metadata": {
"branch": "master",
"commit_count": 5,
"repo_created_at": "2023-06-25T01:48:20.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "39e32325913... |
f29a42bd-44fc-4772-b8dd-fae51283ee33 | RaulTheMiner17/ISSPRAC | BackupCodes/rsa.cpp |
#include <iostream>
#include <cmath>
using namespace std;
// Function to check if a number is prime or not
bool isPrime(int n) {
if (n <= 1) {
return false;
}
for (int i = 2; i <= sqrt(n); i++) {
if (n % i == 0) {
return false;
}
}
return true;
}
// Function to find GCD... | ALGO | 0.999993 | 5.243408 | {
"github_metadata": {
"branch": "main",
"commit_count": 8,
"repo_created_at": "2024-04-22T08:29: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": "7077253228fd... |
7ffae964-0aeb-4036-87f5-567e614f3553 | weeska/sg-experiment-battle-calculator-cpp | src/main.cpp | #include <algorithm>
#include <chrono>
#include <iostream>
#include <map>
#include <vector>
#include "battle_calculator.h"
#include "ships.h"
int main()
{
const Fleet attacker({
{Ship::heavy_fighter, 1000000},
{Ship::light_fighter, 1000000},
});
const Fleet defender({
{Ship::heavy... | TOOL | 0.915991 | 4.84924 | {
"github_metadata": {
"branch": "main",
"commit_count": 1,
"repo_created_at": "2023-01-22T19:46: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": "e5634ea46d57... |
89189c80-2b7d-4571-beb1-8e5196cf36c7 | ishandutta2007/codeforces-z | zlobober/normal/383/B.cpp | #include <cstdio>
#include <map>
#include <vector>
#include <algorithm>
using namespace std;
const int N = 400500;
map<int, vector<int> > bad;
void relax(vector<pair<int, int> >& S, const vector<int>& B)
{
vector<pair<int, int> > res;
for (int i = 0; i < S.size(); )
{
S[i].second = *upper_bound(B... | ALGO | 0.999799 | 3.266541 | {
"github_metadata": {
"branch": "main",
"commit_count": 1,
"repo_created_at": "2024-10-30T16:43: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": "09ebcaa62faf... |
9acd5f82-6e0f-4d16-b46f-dc27ceed381e | xobe19/CP-Learning | hash_table.cpp | #include <iostream>
#include <bits/stdc++.h>
using namespace std;
class HashMapNode{
public:
string key;
int data;
HashMapNode* next;
HashMapNode(string key, int data) {
this -> key = key;
this -> data = data;
this -> next = NULL;
}
~HashMapNode() {
delete this -> next;
}
};
class HashMap {
public:
int... | ALGO | 0.978153 | 4.14724 | {
"github_metadata": {
"branch": "main",
"commit_count": 4,
"repo_created_at": "2021-02-23T13: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": "4fb94b0fee09... |
58a7effc-1d6c-4a57-979c-e38be558e111 | PERAPRO/codigosCP | RPC_s/RPC2024/04/Increasing.cpp | /// Write by <NAME> .PERAPRO
#include<bits/stdc++.h>
using namespace std;
#define fast_io ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);
#define pb push_back
#define ff first
#define ss second
#define all(s) s.begin(), s.end()
#define mp make_pair
typedef long long ll;
typedef unsigned long long ull;
typedef l... | ALGO | 0.999941 | 3.756479 | {
"github_metadata": {
"branch": "master",
"commit_count": 15,
"repo_created_at": "2020-09-19T12:47:07.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "7a932ca9a... |
2489bde6-105f-4d79-80ae-6be7a0765b50 | Sd-Invol/shoka | TheWaySoFar-Training/2015-12-05/d.cpp | #include <iostream>
#include <cstdio>
#include <cstring>
#include <algorithm>
using namespace std;
char str1[1005], str2[1005];
int f[1005][1005];
void print(int n, int m) {
if (n == 0 && m == 0) return ;
if (n > 0 && m > 0 && str1[n] == str2[m] &&
f[n][m] == f[n - 1][m - 1] + 1) {
print(n - ... | ALGO | 0.999993 | 3.320784 | {
"github_metadata": {
"branch": "master",
"commit_count": 348,
"repo_created_at": "2013-10-04T08:20:51.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 37,
"forks": 11,
"issues": 1,
"pull_requests": 0
},
"file_meta": {
"content_id": "aca63e... |
9d7628c5-f23f-4741-aa8b-7654bddb509a | jason-marshall/STLIB | test/unit/levelSet/IntersectionCircle.cc | // -*- C++ -*-
#include "stlib/levelSet/IntersectionCircle.h"
#include "stlib/numerical/equality.h"
using namespace stlib;
using numerical::areEqual;
int
main()
{
//
// makeBoundaryIntersection()
//
// 3-D
{
typedef float T;
const std::size_t D = 3;
typedef std::array<T, D> Point;
typedef g... | TEST | 0.981451 | 6.090769 | {
"github_metadata": {
"branch": "master",
"commit_count": 3,
"repo_created_at": "2017-05-10T18:09:58.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "502d0630fb... |
940ffe2a-4b83-4bce-a923-ee046fc2eba0 | chromium/pdfium | core/fxge/dib/cfx_imagetransformer.cpp | // Copyright 2017 The PDFium Authors
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
// Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com
#include "core/fxge/dib/cfx_imagetransformer.h"
#include <math.h>
#include <array>
#include <i... | ALGO | 0.96411 | 7.524134 | {
"github_metadata": {
"branch": "main",
"commit_count": 17478,
"repo_created_at": "2019-11-11T18:46:42.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 425,
"forks": 94,
"issues": 4,
"pull_requests": 1
},
"file_meta": {
"content_id": "716c19... |
fe8ca0d6-7e10-4c1a-8f76-ed14731d2259 | 3shisan3/LeetCode-Solution | 3110/main.cpp | #include <iostream>
#include <string>
#include <cstdlib> // for abs()
using namespace std;
class Solution
{
public:
int scoreOfString(string s)
{
int score = 0;
for (int i = 0; i < s.size() - 1; ++i)
{
score += abs(s[i] - s[i + 1]);
}
return score;
}
};
... | ALGO | 0.997739 | 5.130319 | {
"github_metadata": {
"branch": "note",
"commit_count": 76,
"repo_created_at": "2020-09-01T03:10: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": "4ffea7deff2... |
18c3065a-f24e-4c27-a9e9-34e9385805a6 | outk/competitive-programming | codeforces/cpp/ecrdiv2c.cpp | #include <bits/stdc++.h>
using namespace std;
int main() {
int t;
cin >> t;
for (int p=0; p<t; p++) {
string s;
cin >> s;
bool failed = false;
map<char, pair<char, char>> v;
for (int i=0; i<26; i++) {
auto e = make_pair('0', '0');
char k =... | ALGO | 0.99998 | 4.323104 | {
"github_metadata": {
"branch": "master",
"commit_count": 89,
"repo_created_at": "2020-01-11T05: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": "a1045f7c5... |
146a5347-7f2a-419d-8d9f-12875ba7e06a | ahmedfahad04/IIT-LAB | 4th Semester Labs/CSE 402_Database Management System I/B+ Tree/B_PLUS_TREE.cpp | #include <bits/stdc++.h>
#include <time.h> // for clock_t, clock(), CLOCKS_PER_SEC
#include <unistd.h> // for sleep()
using namespace std;
using namespace std::chrono;
// NUMBER OF MAX CHILD;
int n, maxNodes;
struct NODE
{
int totalNodes;
NODE *parentNode, *nextNode;
string *ENGLISH, *BANGLA;
... | ALGO | 0.998669 | 3.757009 | {
"github_metadata": {
"branch": "main",
"commit_count": 216,
"repo_created_at": "2022-01-08T05:39:13.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 5,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "68c0552d0a... |
d6944e3d-cab0-4800-8174-6962f2de7783 | realAYAYA/UnrealEngine-ToonLit | UnrealEngine/Engine/Plugins/Experimental/Water/Source/Runtime/Private/GerstnerWaterWaves.cpp | // Copyright Epic Games, Inc. All Rights Reserved.
#include "GerstnerWaterWaves.h"
#include "Engine/Engine.h"
#include "GerstnerWaterWaveSubsystem.h"
#include "Math/RandomStream.h"
#include "Misc/LargeWorldRenderPosition.h"
#include UE_INLINE_GENERATED_CPP_BY_NAME(GerstnerWaterWaves)
// -----------------------------... | ALGO | 0.99744 | 6.671202 | {
"github_metadata": {
"branch": "5.4",
"commit_count": 164,
"repo_created_at": "2023-03-14T06:10:37.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 66,
"forks": 9,
"issues": 1,
"pull_requests": 0
},
"file_meta": {
"content_id": "6bb3e08d0a... |
3ab05375-1286-4e22-b10d-62351649eca9 | beyzoskaya/DataStructures_Algorithms | data_structures/ınsertionSort/insertionSort.cpp | #include <iostream>
using namespace std;
/*
simple insertion sort
template<typename Comparable>
void insertionSort(vector<Comparable> & a)
{
int j;
for(int p = 1; p < a.size(); p++)
{
Comparable temp = a[p];
for(j = p; j > 0 && temp < a[j-1]; j--)
a[j] = a[j-1];
... | ALGO | 0.999916 | 5.75126 | {
"github_metadata": {
"branch": "main",
"commit_count": 5,
"repo_created_at": "2023-04-23T00:09: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": "5485c9c562ad... |
0341b622-f0ca-45fd-b029-422d90c1f2b9 | google/filament | third_party/spirv-headers/tools/buildHeaders/jsonToSpirv.h | // Copyright (c) 2014-2024 The Khronos Group Inc.
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and/or associated documentation files (the "Materials"),
// to deal in the Materials without restriction, including without limitation
// the rights to use, copy, modi... | TOOL | 0.917747 | 7.413471 | {
"github_metadata": {
"branch": "main",
"commit_count": 7301,
"repo_created_at": "2018-08-03T17:26:00.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 18658,
"forks": 1993,
"issues": 155,
"pull_requests": 23
},
"file_meta": {
"content_id": "... |
f8331058-3685-4a9f-a899-64f21db90b94 | pkhaan/Cpp-Projects | EXTRAS/Threads/Threads.cpp | // Threads.cpp : Defines the entry point for the console application.
//
#include <thread>
#include <math.h>
#include <random>
#include <iostream>
using namespace std;
std::default_random_engine generator;
std::uniform_real_distribution<double> distribution(0.0, 1.0);
void EstimatePI(double * result, long count)
... | ALGO | 0.99646 | 5.489211 | {
"github_metadata": {
"branch": "main",
"commit_count": 3,
"repo_created_at": "2020-10-15T14:34: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": "27e316dad0e3... |
8c9f4866-c6f6-4b2f-9f76-853fb5f7067b | CoderRaushan/CPP_programs_by_raushan_kumar | Sgpa calculator/cal_phy_g_marks_to_sgpa_with_men_sgpa.c++ | #include <iostream>
using namespace std;
int main()
{
int n, c, m1 = 4, PHY = 4, BEE = 4, EGD = 3, PEEM = 3, PHYSICSLAB = 1, BEELAB = 1, MENT = 1;
int c1 = m1 + PHY + BEE + EGD + PEEM + PHYSICSLAB + BEELAB + MENT;
double arr[8], o, o1, o2, o3, o4, o5, o6, o7;
string sub[] = {"Physics", "math", "Bee... | ALGO | 0.957811 | 3.134274 | {
"github_metadata": {
"branch": "main",
"commit_count": 195,
"repo_created_at": "2023-10-04T18:36: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": "0790e194f3... |
34786460-5361-476d-b087-5cc1091561fe | lmwang4321/Leetcode_CPP | 1-100/11_Container_with_Most_Water.cpp | //11. Container with Most Water
#include <iostream>
#include <vector>
using namespace std;
/* Brute Force:
class Solution {
public:
int maxArea(vector<int>& height) {
int count = 0;
int max_size = 0;
int bsize = 0;
for (int close = 0; close < height.size(); ++close){
fo... | ALGO | 0.999921 | 5.968668 | {
"github_metadata": {
"branch": "main",
"commit_count": 3,
"repo_created_at": "2021-12-28T21:17: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": "f434c844885c... |
d3dfb68d-3626-49af-bdeb-30c3495a5d4b | mattulbrich/llreve | reve/reve/include/PathAnalysis.h | /*
* This file is part of
* llreve - Automatic regression verification for LLVM programs
*
* Copyright (C) 2016 Karlsruhe Institute of Technology
*
* The system is published under a BSD license.
* See LICENSE (distributed with this file) for details.
*/
#pragma once
#include "MarkAnalysis.h"
namespace smt ... | TOOL | 0.922583 | 7.243621 | {
"github_metadata": {
"branch": "master",
"commit_count": 1128,
"repo_created_at": "2016-02-03T15:05:05.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 19,
"forks": 6,
"issues": 5,
"pull_requests": 0
},
"file_meta": {
"content_id": "4121e1... |
8fb65d14-7750-4e27-91d1-dc6bb6c0525a | dariomnz/Cpp-parallelism-image-filter | image-seq.cpp | #include <iostream>
#include <unistd.h>
#include <fstream>
#include <vector>
#include <dirent.h>
#include <string.h>
#include <chrono>
#include <omp.h>
using std::vector;
using namespace std::chrono;
using clk = high_resolution_clock;
// Alinea los datos a una palabra
#pragma pack(1)
// Definicion de nuestros tamaño... | DATA | 0.989907 | 4.238101 | {
"github_metadata": {
"branch": "master",
"commit_count": 2,
"repo_created_at": "2022-02-13T17:15: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": "1d3443bc76... |
84541af9-d3a8-45ff-8145-5433f271e93c | lisnb/leetcode | leecode-II/NumberOfDigitOne/源.cpp | #include <algorithm>
#include <iostream>
#include <vector>
using namespace std;
class Solution {
public:
int countDigitOne(int n) {
return countDigit(n, 1);
}
private:
int countDigit(int n, int digit)
{
if (n < digit)
return 0;
if (n == digit)
return 1;... | ALGO | 0.999466 | 5.138598 | {
"github_metadata": {
"branch": "master",
"commit_count": 65,
"repo_created_at": "2014-07-20T14:34:03.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "46c010243... |
08922102-23cc-46a8-98f5-c75be65e8bda | NgTienHungg/PTIT-Source | CodePTIT - DSA/DSA01009 - XÂU AB ĐẶC BIỆT.cpp | // https://code.ptit.edu.vn/student/question/DSA01009
// XÂU AB ĐẶ<NAME>T
#include <bits/stdc++.h>
using namespace std;
int n, k;
string s;
vector<string> res;
void solve() {
string z(k, 'A');
int pos = s.find(z, 0);
if (pos != -1) {
string sub = s.substr(pos + 1);
if (sub.find(z) == -1)
... | ALGO | 0.999934 | 3.812749 | {
"github_metadata": {
"branch": "main",
"commit_count": 106,
"repo_created_at": "2021-07-04T02:14:52.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 130,
"forks": 36,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "b2de60c... |
e6e022ac-dafd-46a8-936a-615e74a3cd96 | wangsiping97/My-LeetCode-Solutions | 1259.cpp | // You are given an even number of people num_people that stand around a circle and each person shakes hands with someone else, so that there are num_people / 2 handshakes total.
// Return the number of ways these handshakes could occur such that none of the handshakes cross.
// Since this number could be very big, ret... | ALGO | 0.999995 | 4.901189 | {
"github_metadata": {
"branch": "master",
"commit_count": 393,
"repo_created_at": "2019-02-07T16:23:05.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 17,
"forks": 2,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "2818aba... |
4f6514fb-93fc-4891-aa5d-3b5d0a970388 | dfs28/SPR | elastic_net_weights.cpp | #include <Rcpp.h>
using namespace Rcpp;
// This is a simple example of exporting a C++ function to R. You can
// source this function into an R session using the Rcpp::sourceCpp
// function (or via the Source button on the editor toolbar). Learn
// more about Rcpp at:
//
// http://www.rcpp.org/
// http://adv-r.ha... | ALGO | 0.932986 | 6.276955 | {
"github_metadata": {
"branch": "main",
"commit_count": 3,
"repo_created_at": "2021-06-30T19:07: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": "50fc78dd1e15... |
c4d9620c-cf89-4f10-a356-0feef0b0a7fe | jwalke17/cryptographyclass | PA/02/elgamal.cpp | #include <iostream>
#include <sstream>
#include <stdio.h>
#include <time.h>
#include <gmp.h>
#include <gmpxx.h>
#include <string>
#include <vector>
using namespace std;
//<NAME>
void usage(int);
int main(int argc, char *argv[]){
if(argc != 2){
usage(0);
}
string line;
istringstream iss (... | ALGO | 0.998727 | 3.73054 | {
"github_metadata": {
"branch": "master",
"commit_count": 3,
"repo_created_at": "2018-02-04T19:48: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": "486d4ab33a... |
c6d8cad1-d230-4e36-8576-ba5219df8705 | palthedog/icfpc2020 | app/bot/bot.cc | #include "bot.h"
#include <map>
#include <iostream>
using namespace std;
V targetV(GameResponse game, const Ship& ship) {
auto pos = ship.position();
bint dx = -pos.x;
bint dy = -pos.y;
bint cos90 = 0;
bint sin90 = 1;
bint cos_90 = 0;
bint sin_90 = -1;
bint tvx0 = cos90 * dx - sin90 * dy;
bi... | TOOL | 0.970593 | 4.350019 | {
"github_metadata": {
"branch": "master",
"commit_count": 52,
"repo_created_at": "2020-07-17T09:28: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": "a35f99456... |
1526e524-f96b-4221-9a21-46f352d3f201 | nmcl/sandbox | CuttingEdge/15031993/Placement.old/Network/SingleCopy.cc | /*
* Copyright (C) 1993
*
* Department of Computing Science,
* The University,
* Newcastle upon Tyne,
* UK.
*/
#include <iostream.h>
#ifndef SINGLECOPY_H_
#include "SingleCopy.h"
#endif
#ifndef CLIENT_H_
#include "Client.h"
#endif
#ifndef MACHINE_H_
#include "Machine.h"
#endif
#ifndef OBJECT_H_
#include "Ob... | TOOL | 0.973901 | 4.288826 | {
"github_metadata": {
"branch": "master",
"commit_count": 3730,
"repo_created_at": "2015-12-17T19:26:42.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 28,
"pull_requests": 3
},
"file_meta": {
"content_id": "8221e9... |
55b6927b-9670-4b46-8925-99661567b2f2 | ramstick/GoBot | go.cpp | #include <iostream>
#include <queue>
using namespace std;
#define NUM_MATCHES 50
#define NUM_GENERATIONS 50
#define BOARD_SIZE 19
struct Coord{
short x,y;
Coord(short x, short y){
this->x = x;
this->y = y;
}
};
queue<Coord> empty;
struct GoBoard {
short board [BOARD_SIZE][BOARD_SIZE... | ALGO | 0.999328 | 3.994529 | {
"github_metadata": {
"branch": "master",
"commit_count": 7,
"repo_created_at": "2020-05-07T01:39:04.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "e5d69be8cb... |
b6a2a621-55d6-4c9c-932a-e597dc599897 | ishikhatomar/data-structures | linked-list/single-linked-list/linear-single-linked-list.cpp | #include <iostream>
struct node
{
int data;
struct node *next;
};
node *head = NULL;
node *getNode()
{
node *temp = new node();
if (temp == NULL)
{
std::cout << "space full";
exit(1);
}
temp->next = NULL;
return temp;
}
void insertAtEnd(int data)
{
node *temp = getNod... | ALGO | 0.998677 | 4.193884 | {
"github_metadata": {
"branch": "main",
"commit_count": 6,
"repo_created_at": "2023-12-02T15:31: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": "d6f3373f9636... |
2db03709-4673-448b-ac46-497efbec1f96 | joelind/zxing-iphone | symbian/ZXingBarcodeReader/group/zxing/common/LocalBlockBinarizer.cpp | /*
* LocalBlockBinarizer.cpp
* zxing
*
* Created by <NAME> on 17/10/2009.
* Copyright 2008 ZXing 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
*
... | ALGO | 0.938268 | 6.581959 | {
"github_metadata": {
"branch": "master",
"commit_count": 1287,
"repo_created_at": "2010-07-25T12:27:11.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 82,
"forks": 16,
"issues": 3,
"pull_requests": 0
},
"file_meta": {
"content_id": "0b86c... |
fe46dbd0-8884-4242-bcb8-1b46d003fbd0 | ankitsultana/competitive | LightOJ/String/SuffixArray/1347.cc | /* Author: <NAME>
* Problem Name: Aladdin and the Magical Lamp (1347)
*/
#include <cstdio>
#include <algorithm>
#include <string>
#include <cassert>
#include <vector>
#include <cstdint>
using namespace std;
template<typename T, typename Compare = std::less<T> >
struct sparse_table {
int n;
vector<vector<T> >... | ALGO | 0.99982 | 4.29418 | {
"github_metadata": {
"branch": "master",
"commit_count": 105,
"repo_created_at": "2016-01-31T18:46:15.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "2fa3caa0... |
6bcd44d6-ac02-4b61-8fcb-09fed87ed5b0 | williamchanrico/competitive-programming | Toki Learning/PrimaPrima.cpp | #include <bitset>
#include <iostream>
#include <sstream>
#include <vector>
using namespace std;
vector<int> primes;
bitset<10000001> bs;
long long sieve_size, n, m, ans;
void sieve(long long x)
{
sieve_size = x;
bs.set();
bs[0] = bs[1] = 0;
for (long long a = 2; a <= sieve_size; a++)
if (bs[a]... | ALGO | 0.99998 | 4.265536 | {
"github_metadata": {
"branch": "master",
"commit_count": 41,
"repo_created_at": "2017-03-20T19:20:11.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 3,
"forks": 3,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "0b999e257... |
e05e8b95-7c75-449e-9c70-68baf4a1c11b | motianyi/parallel_edit_distance | 2A_OpenMP/renjiem-seqalignomp.cpp | // CPP program to solve the sequence alignment
// problem. Adapted from https://www.geeksforgeeks.org/sequence-alignment-problem/ and
// fixed an error when initializing the dp array :-)
#include <sys/time.h>
#include <string>
#include <cstring>
#include <iostream>
using namespace std;
int getMinimumPenalty(std::stri... | ALGO | 0.99999 | 4.571122 | {
"github_metadata": {
"branch": "master",
"commit_count": 27,
"repo_created_at": "2020-09-02T16:55:11.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "bf461cf66... |
5648fbca-d210-4742-b196-87fac8a36176 | ishandutta2007/codeforces-k | keshi/normal/1354/E.cpp | //In the name of GOD
#include <bits/stdc++.h>
using namespace std;
typedef int ll;
const ll maxn = 5e3 + 100;
const ll mod = 1e9 + 7;
const ll inf = 1e9;
#define fast_io ios::sync_with_stdio(false);cin.tie(0);cout.tie(0);
#define file_io freopen("input.txt" , "r+" , stdin) ; freopen("output.txt" , "w+" , stdout);
#d... | ALGO | 0.999947 | 3.668959 | {
"github_metadata": {
"branch": "main",
"commit_count": 1,
"repo_created_at": "2024-04-11T06:06: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": "5c911ea2dc0c... |
70ed25b6-1319-4338-8875-02d2b8059341 | StanleyJo-37/competitive-programming-chatbots-comprasion | submissions/gemini/sub82.cpp | #include <iostream>
#include <vector>
#include <algorithm>
#include <map>
using namespace std;
// Structure to represent a breakfast item
struct Breakfast {
int id; // Original index
int a, c, l, r; // Attractiveness, Cost, Left bound, Right bound
};
// Custom comparison function for sorting by cost in desce... | ALGO | 0.99977 | 5.005246 | {
"github_metadata": {
"branch": "main",
"commit_count": 76,
"repo_created_at": "2025-04-17T15:54: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": "957e86bde8d... |
08175a1c-0c46-4ce8-b2ee-32823736a136 | AlexandruBran/TicTacToe | tictactoe/game.h | #ifndef GAME_H
#define GAME_H
#include <vector>
#include <QRandomGenerator>
#include <QElapsedTimer>
struct Game
{
public:
using Score = int;
enum
{
DepthMin = 2,
CpuTimePerMoveMs = 1000,
};
enum ScoreDefines
{
UndefinedMin = -10000,
CpuLose = -1000,
T... | ALGO | 0.950773 | 6.002548 | {
"github_metadata": {
"branch": "main",
"commit_count": 4,
"repo_created_at": "2021-10-06T18:10: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": "b59763484ff2... |
b33142af-72d7-4c76-a3ef-8e3eaa6399d5 | abufarhad/Programming | C++ Practice/Number Theory/B - Euclid Problem UVA - 10104 .cpp |
#include<bits/stdc++.h>
#include<stdio.h>
using namespace std;
#define ll long long
#define sci(x) scanf("%d",&x)
#define scl(x) scanf("%lld",&x)
#define scd(x) scanf("%lf",&x)
#define scc(x) scanf("%[^\n]s",x); // For charecter string input , It will read all charecter untill Enter new line .
#define pfi(x) print... | ALGO | 0.999721 | 3.308287 | {
"github_metadata": {
"branch": "master",
"commit_count": 12,
"repo_created_at": "2019-04-09T18:30:10.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 3,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "c4b2d1eff... |
d77ebc10-b3ef-47f9-bac2-5cc5e9dde507 | donbasta/competitive-programming | submissions/online-judges/vjudge/cp-algo-bfs-dfs/A.cpp | #include <bits/stdc++.h>
using namespace std;
using ll = long long;
using ld = long double;
const int INF = 2e9;
void solve() {
int n;
cin >> n;
unordered_map<int, vector<int>> adj;
for (int i = 0; i < n; i++) {
int a, b;
cin >> a >> b;
adj[a].push_back(b);
adj[b].push... | ALGO | 0.999929 | 4.878451 | {
"github_metadata": {
"branch": "master",
"commit_count": 175,
"repo_created_at": "2018-10-17T04:26:32.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "b54d2fd7... |
82a8d06b-9ac5-46d7-b522-6f729fae6c09 | lzh12139/MySolutions | training/20200219-day4/H.cpp | #include <bits/stdc++.h>
using namespace std;
#define ff first
#define ss second
typedef long long ll;
typedef pair<int, int> pii;
int h[100010];
ll tmp[100010], minn[100010], maxx[100010];
int main()
{
int n, q;
scanf("%d%d", &n, &q);
for (int i = 0; i <= n; i++)
scanf("%d", &h[i]);
while (q--... | ALGO | 0.999958 | 3.239841 | {
"github_metadata": {
"branch": "master",
"commit_count": 32,
"repo_created_at": "2019-12-31T07:56: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": "ed241f5c8... |
1fa0516c-5a12-4fac-a32c-668332309933 | Waterhaus/Schwartz | ShwartzSolver/ShwartzDirect.h | #pragma once
#include <iostream>
#include "Vector.h"
#include "Matrix.h"
#include "BoxDomain.h"
#include "CircleDomain.h"
double Intercetion(double R, double Val)
{
return sqrt(R*R - Val*Val);
}
void ShwartzDirect_MAIN(int SIZE, double w,double v, double EPS, int MAX_ITER)
{
double Radius = 4.5;
double HorY = 2... | ALGO | 0.999824 | 3.975661 | {
"github_metadata": {
"branch": "master",
"commit_count": 15,
"repo_created_at": "2018-05-20T09:31: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": "290435cf0... |
7e87596f-fd35-4b48-8b0a-bae523563352 | sarthakgarg/programming-challenges | Contests/Competitive/79c.cpp | #include<stdio.h>
#include"iostream"
#include<string.h>
using namespace std;
typedef long long ll;
#define REP(i,n) for(int i=0;i<n;i++)
#define REPP(i,a,b) for(int i=a;i<b;i++)
#define INF 10000000
char ch, str[100005], pat[16];
int t[16], n, m, s, test, dp[100005];
void build() {
int l, mx;
t[0] = -1;
REP(i, m) {
... | ALGO | 0.999685 | 4.376022 | {
"github_metadata": {
"branch": "master",
"commit_count": 1,
"repo_created_at": "2016-12-05T19:45: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": "a6f92a2be6... |
344b1e15-ba98-4e40-8794-716ea6015c20 | nishitdixit/DSA_450 | 16.cpp | #include<bits/stdc++.h>
using namespace std;
long long int inversionCount(long long arr[], long long N)
{
int count=0;
count+=inversionCount()
// int inv_count = 0;
// for (int i = 0; i < n - 1; i++)
// for (int j = i + 1; j < n; j++)
// if (arr[i] > arr[j])
// inv_... | ALGO | 0.999946 | 4.141239 | {
"github_metadata": {
"branch": "master",
"commit_count": 9,
"repo_created_at": "2021-06-21T05:46:46.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "02646bccd2... |
80b82a22-ec37-4c7b-a334-766d33d001c4 | DenizOzal/DenizOzal-CS202-Fundamental-Structures-of-Computer-Science-2- | HW4/21802414_hw4/HashTable.h | /*
* C++ Program to Implement Hash Tables with Quadratic Probing
*/
#include <iostream>
#include <cstdlib>
#define MIN_TABLE_SIZE 10
using namespace std;
/*
* Node Type Declaration
*/
enum EntryType { Legitimate, Empty, Deleted };
/*
* Node Declaration
*/
struct HashNode
{
... | ALGO | 0.999785 | 5.914165 | {
"github_metadata": {
"branch": "main",
"commit_count": 4,
"repo_created_at": "2021-08-08T11:00: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": "50c441a5f8a9... |
a258131f-8cfa-43b5-965b-e79dac2c711a | Electromagnetic-Wave-Modeler/Propagation-Modeler | src/obstacle/mur.cpp | #include <cmath>
#include <algorithm>
#include <stdexcept>
#include <iostream>
#include <ostream>
#include "../../headers/obstacle.hpp"
void Mur::precalculerParametresGeometriques() {
// Calcul du point médian
params_geo.mid_x = (x1 + x2) * 0.5;
params_geo.mid_y = (y1 + y2) * 0.5;
// Vecteur directi... | ALGO | 0.997931 | 5.814132 | {
"github_metadata": {
"branch": "main",
"commit_count": 79,
"repo_created_at": "2025-02-14T15:04:51.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "558a21dfad91... |
eb1cebec-1e09-45e7-ab5b-dd928a8fc5a1 | sahil7-17/Graph | TopoSort(Kahn's Algorithm BFS).cpp | vector<int> topologicalSort(vector<vector<int>>& adj) {
int v = adj.size(); // Graph mein total vertices (nodes) ki sankhya nikaalo
vector<int> inDegree(v); // Har node ka in-degree (incoming edges) track karne ke liye vector
queue<int> q; // Nodes ko process karne ke liye queue
// Step 1: ... | ALGO | 0.999995 | 6.729811 | {
"github_metadata": {
"branch": "main",
"commit_count": 9,
"repo_created_at": "2025-03-09T18:32: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": "d9d32deead2f... |
54e61089-c11b-4346-bcf7-7e65166eec58 | dudrbs7575/Boj-solve | dp/2096.cpp | #include <iostream>
#include <algorithm>
#include <cmath>
#include <map>
#include <stdio.h>
#include <string>
#include <string.h>
#include <vector>
#include <set>
#include <queue>
using namespace std;
using pii = pair<int, int>;
#define INF 0x3f3f3f3f
int board[100'001][3];
int max_dp[2][3];
int min_dp[2][3];
int N;... | ALGO | 0.99998 | 3.551269 | {
"github_metadata": {
"branch": "main",
"commit_count": 226,
"repo_created_at": "2022-02-06T14:51:48.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "9d26c3bddd... |
8554c00b-bfb3-46ff-ac05-63f0105a85ca | filipeabelha/gym-solutions | cdf/603c.cpp | #include <bits/stdc++.h>
using namespace std;
mt19937_64 llrand(random_device{}());
#define st first
#define nd second
#define mp make_pair
#define pb push_back
#define cl(x, v) memset((x), (v), sizeof(x))
#define db(x) cerr << #x << " == " << x << endl
#define dbs(x) cerr << x << endl
#define _ << ", " <<
#define gc... | ALGO | 0.999982 | 3.786335 | {
"github_metadata": {
"branch": "master",
"commit_count": 1023,
"repo_created_at": "2017-03-27T00:56:34.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "7362cc8... |
d30654a3-2dc7-498f-99c5-203aa6086557 | b04901043/107-2_Financial_Computation | HW3/HW3_2.cpp | #include<iostream>
#include<stdio.h>
#include<iomanip>
#include<cmath>
#include<fstream>
#include<ctime>
#include<random>
#include<algorithm>
using namespace std;
vector<vector<double> > inverse(vector<vector<double> > A){
vector<vector<double> > invA=A;
for(int i=0;i<A.size();i++){
for(int j=0;j<A[0].s... | ALGO | 0.999712 | 3.06316 | {
"github_metadata": {
"branch": "master",
"commit_count": 38,
"repo_created_at": "2019-03-03T03:30: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": "0d02af968... |
e6873842-e0c7-4824-b098-e4d8e1bfc8d8 | rweather/skinny-c | arduino/libraries/Skinny/Skinny64.cpp | /*
* Copyright (C) 2017 Southern Storm Software, Pty Ltd.
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),
* to deal in the Software without restriction, including without limitation
* the rights to use, copy, ... | ALGO | 0.92617 | 4.017949 | {
"github_metadata": {
"branch": "master",
"commit_count": 46,
"repo_created_at": "2017-11-05T09:45:13.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 20,
"forks": 5,
"issues": 0,
"pull_requests": 1
},
"file_meta": {
"content_id": "9bc4a21d... |
cc795539-06cc-4bfa-ad0f-d47897ba9f24 | MaxSally/Competitive_Programming | Codeforces/917B_MADMAX.cpp | //https://codeforces.com/problemset/problem/917/B
/*
* Author : MaxSally
*/
/******** All Required Header Files ********/
#include<bits/stdc++.h>
using namespace std;
/******* All Required define Pre-Processors and typedef Constants *******/
#define SCD(t) scanf("%d",&t)
#define SCLD(t) scanf("%ld",&t)
#define SCLLD... | ALGO | 0.999901 | 3.897257 | {
"github_metadata": {
"branch": "master",
"commit_count": 23,
"repo_created_at": "2020-06-09T02:39:04.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "1718020bd... |
894270c1-c044-4d49-90e3-a99dcc2d41e0 | JamesZhange/JZWinFunction | JZSystemFunction/Math/JZMath.h | #pragma once
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
#include <complex>
#include <iostream>
#include <valarray>
// const double PI = 3.141592653589793238460;
// typedef std::complex<double> Complex;
// typedef std::valarray<Complex> CArray;
typedef std::complex<float> FFTComplex;
typedef std::vala... | ALGO | 0.999551 | 4.044907 | {
"github_metadata": {
"branch": "master",
"commit_count": 11,
"repo_created_at": "2017-03-14T13:28: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": "eb2a0e6d7... |
0e1da92d-5fbd-4892-96ff-1f6623b8f8fc | luojinlongjjj/android-faiss | app/src/main/cpp/source/faiss_32/distances.cpp | /**
* Copyright (c) Facebook, Inc. and its affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/
// -*- c++ -*-
#include "distances.h"
#include <cmath>
#include <omp.h>
#include "utils.h"
#include "FaissAssert.h"
#include "... | ALGO | 0.999074 | 7.122569 | {
"github_metadata": {
"branch": "master",
"commit_count": 3,
"repo_created_at": "2020-06-22T13:11:46.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 48,
"forks": 5,
"issues": 1,
"pull_requests": 0
},
"file_meta": {
"content_id": "cda8435a5... |
b17adc1b-5f8a-4300-8de4-66309de7fd6c | Mrhuangyi/leetcode-Solutions | Cpp/Medium/75. 颜色分类.cpp | /*
给定一个包含红色、白色和蓝色,一共 n 个元素的数组,原地对它们进行排序,使得相同颜色的元素相邻,并按照红色、白色、蓝色顺序排列。
此题中,我们使用整数 0、 1 和 2 分别表示红色、白色和蓝色。
注意:
不能使用代码库中的排序函数来解决这道题。
示例:
输入: [2,0,2,1,1,0]
输出: [0,0,1,1,2,2]
进阶:
一个直观的解决方案是使用计数排序的两趟扫描算法。
首先,迭代计算出0、1 和 2 元素的个数,然后按照0、1、2的排序,重写当前数组。
你能想出一个仅使用常数空间的一趟扫描算法吗?
*/
法一,计数排序。
class Solution {
public:
void sort... | ALGO | 0.999971 | 5.79418 | {
"github_metadata": {
"branch": "master",
"commit_count": 744,
"repo_created_at": "2018-04-18T11:21:28.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 8,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "cb3eddcc... |
511aa134-7345-47d3-81f4-2c211bdde7a2 | DOPEgduranti/cpp | cpp09/ex02/PmergeMe.cpp | /* ************************************************************************** */
/* */
/* ::: :::::::: */
/* PmergeMe.cpp :+: :+: :+: ... | ALGO | 0.990945 | 5.618974 | {
"github_metadata": {
"branch": "main",
"commit_count": 4,
"repo_created_at": "2024-06-28T10:21: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": "b3072d66f5db... |
ebba63e0-687b-468b-8107-dc2193fa867e | ishandutta2007/codeforces-n | nuip/normal/663/A.cpp | #include <string>
#include <vector>
#include<iostream>
#include<cstdio>
#include<cstdlib>
#include<stack>
#include<queue>
#include<cmath>
#include<algorithm>
#include<functional>
#include<list>
#include<deque>
#include<bitset>
#include<set>
#include<map>
#include<unordered_map>
#include<cstring>
#include<sstream>
#incl... | ALGO | 0.999954 | 3.585327 | {
"github_metadata": {
"branch": "main",
"commit_count": 1,
"repo_created_at": "2024-10-30T15:35: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": "79287c0f00d8... |
be45b80a-c7a1-407b-bcdf-40d180542e52 | finderkiller/datastructure | stackChar/stackChar/stackChar.cpp | #include <iostream>
#include <stdlib.h>
#include <string>
using namespace std;
struct stackNode{
char data;
struct stackNode *nextPtr;
};
typedef struct stackNode StackNode;
typedef StackNode *StackNodePtr;
void push(StackNodePtr *sPtr, char item);
char pop(StackNodePtr *sPtr);
void printStack(StackNodePtr current... | ALGO | 0.99695 | 4.568185 | {
"github_metadata": {
"branch": "main",
"commit_count": 6,
"repo_created_at": "2020-12-31T01: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": "ac405ae10208... |
ccd5f85b-915e-4b69-95b9-5765b12f10f7 | Trilokesh29/Interview_Questions | leetcode/merge_two_sorted_lists.cpp | // https://leetcode.com/problems/merge-two-sorted-lists/
/**
* 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) {}
... | ALGO | 0.999953 | 6.013554 | {
"github_metadata": {
"branch": "master",
"commit_count": 30,
"repo_created_at": "2021-11-08T07:37: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": "91469551d... |
ff6746cb-ecdc-4fb6-8594-66ac51a3fa71 | TheHotChilli/HPC_lib | HPC_lib/BLAS/gemm/packing.hpp | #ifndef HPC_BLAS_GEMM_PACKING_HPP
#define HPC_BLAS_GEMM_PACKING_HPP
#include <cstddef>
#include <HPC_lib/utils/conjugate.hpp>
namespace hpc { namespace blas {
/**
* @brief Panelizes and packs a matrix (block) A into a flat array p using a specified block size MR.
*
* This function is a utility function that ... | ALGO | 0.989974 | 6.380447 | {
"github_metadata": {
"branch": "main",
"commit_count": 17,
"repo_created_at": "2023-07-12T17:33:41.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "b24f2a9df87... |
23f7ade7-39e1-4bc5-8162-345f0e5fb2d9 | robotic-picker-sp22/team4 | perception/src/segmentation.cpp | #include "perception/segmentation.h"
#include "geometry_msgs/Pose.h"
#include "pcl/PointIndices.h"
#include "pcl/point_cloud.h"
#include "pcl/point_types.h"
#include "pcl_conversions/pcl_conversions.h"
#include "ros/ros.h"
#include "sensor_msgs/PointCloud2.h"
#include "pcl/filters/extract_indices.h"
#include "visualiza... | ALGO | 0.976364 | 6.769667 | {
"github_metadata": {
"branch": "noetic-devel",
"commit_count": 75,
"repo_created_at": "2022-04-07T18:32:39.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 0,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "839b... |
072740b0-710d-4774-8c03-439e02865894 | muleyashutosh/Codechef-CodeBase | DSA_Learning_Series/Contest_2/PSHOT.cpp | #include <iostream>
using namespace std;
int main () {
int t;
cin >> t;
while(t--) {
int n;
cin >> n;
string goals;
cin >> goals;
int awin = 0, bwin = 0, alose = 0, blose = 0;
int i;
for( i = 0 ; i < goals.length(); i++) {
if( ((awin > bwin... | ALGO | 0.99984 | 3.541436 | {
"github_metadata": {
"branch": "master",
"commit_count": 20,
"repo_created_at": "2020-06-07T08:46: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": "33c6017dd... |
0cb4112e-68af-4e56-a672-3db53974d747 | hzratali/DSA-Problems | Shortest Source to Destination Path - GFG/shortest-source-to-destination-path.cpp | //{ Driver Code Starts
// Initial Template for C++
#include <bits/stdc++.h>
using namespace std;
// } Driver Code Ends
// User function Template for C++
class Solution {
public:
int shortestDistance(int N, int M, vector<vector<int>> A, int X, int Y) {
// code here
if(A[0][0] == 0) return -1;
... | ALGO | 0.999969 | 5.645838 | {
"github_metadata": {
"branch": "main",
"commit_count": 4049,
"repo_created_at": "2022-10-19T11:13: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": "94ad01c13... |
690abdd2-6ca4-4ceb-9c6b-14fcf48a4616 | ankit-prabhavak/Learn-DSA-in-Cpp | Array/Problems/MaximumSubarraySum.cpp | #include <iostream>
using namespace std;
int main(){
int n = 5;
int arr[5] = {10,-11,4,5,6};
int sum;
int max = INT16_MIN;
//worst case scenario: O(n3)
// for(int start = 0; start < n; start++){
// for(int end = start; end < n; end++){
// sum = 0;
// for(int i = start... | ALGO | 0.999335 | 4.237685 | {
"github_metadata": {
"branch": "main",
"commit_count": 86,
"repo_created_at": "2025-01-19T15:37:22.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "0c403189f8a... |
aca4c1f0-96f0-405f-bc09-95861e2821cb | jeniffer9/ETHZ-AlgoLab-2020 | 1. Partial Sums Technique/1. Even Pairs.cpp | #include <iostream>
#include <vector>
void testcase() {
int n; std::cin >> n;
std::vector<int> bits(n);
for (int i = 0; i < n; ++i) {
std::cin >> bits[i];
}
int sum =0, even = 0, odd = 0;
for (int i = 0; i < n; ++i) {
sum += bits[i];
if (sum % 2 == 0) {
++even;
} else {
++odd... | ALGO | 0.999968 | 4.884717 | {
"github_metadata": {
"branch": "main",
"commit_count": 53,
"repo_created_at": "2021-01-01T12:24:50.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "06eddd79571... |
13a56c6f-9129-42ec-956b-c44b08dd10e1 | Mintroxiss/s21_containers | src/files/s21_set.cpp | #include "../include/s21_set.h"
namespace s21 {
// Конструктор со списком инициализации
template <typename key_type>
set<key_type>::set(const std::initializer_list<value_type> &items) {
for (const value_type &item : items) {
this->insert(item);
}
}
// Оператор присваивания (копирования)
template <typename ke... | ALGO | 0.981074 | 5.634302 | {
"github_metadata": {
"branch": "master",
"commit_count": 2,
"repo_created_at": "2025-01-06T09:31:47.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "4de85b7589... |
4847db1d-b6af-4704-9783-276069eef7ac | caiwaifung/algo | cf/698/d.cc | #include <algorithm>
#include <set>
#include <cassert>
#include <cmath>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <iostream>
#include <string>
#include <vector>
using namespace std;
#define sz(a) static_cast<int>(a.size())
#define all(a) a.begin(), a.end()
#define rep(i, a, b) for(int i=int(a); ... | ALGO | 0.999828 | 3.554158 | {
"github_metadata": {
"branch": "master",
"commit_count": 608,
"repo_created_at": "2015-05-10T11:28:16.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 3,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "b63af9a7... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.