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 |
|---|---|---|---|---|---|---|---|
acf60ef0-7831-4ea4-8e77-e9f719ca4072 | tanktejas/All_Solutions | 363-max-sum-of-rectangle-no-larger-than-k/363-max-sum-of-rectangle-no-larger-than-k.cpp | // class Solution {
// public:
// vector<vector<int>>pre;
// int maxSumSubmatrix(vector<vector<int>>& mat, int ko) {
// int msum=INT_MIN;
// int n=mat.size();
// int m=mat[0].size();
// pre.resize(n+1,vector<int>(m+1,0));
// pre[n... | ALGO | 0.999878 | 5.401797 | {
"github_metadata": {
"branch": "master",
"commit_count": 1278,
"repo_created_at": "2022-04-11T17:12:58.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "f32fd00... |
bb7c7a19-67f6-400f-b09f-e254e0314da7 | AbouOpenSource/GrahamHill | MyPolygon.cpp | //
// Created by abou on 18/11/2019.
//
#include <algorithm>
#include <stack>
#include "MyPolygon.h"
MyPolygon::MyPolygon(int nmax) : Nmax(nmax) {
ptsTriangle=vector<Triangle>();
tabPts = new Vector2D[nmax];
N=0;
}
bool polarComparaison(Vector2D P1, Vector2D P2){
double a1 = asin(P1.p_y/sqrt(P1.p_x*... | ALGO | 0.999268 | 4.688935 | {
"github_metadata": {
"branch": "master",
"commit_count": 6,
"repo_created_at": "2019-11-29T16:49: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": "209a9c539a... |
f27a6872-330f-4a55-b607-bfa04015c8c1 | ideahitme/algorithms | algorithms/course_2/merge_tables/code.cpp | #include <algorithm>
#include <vector>
#include <queue>
#include <iostream>
#include <queue>
using namespace std;
int find_parent(int i, vector<int> &p){
while(p[i] != i){
int j = p[i];
p[i] = p[j];
i = p[j];
}
return i;
}
void merge(int i, int j, vector<int> &h, priority_queue<long long> &max, vector<int> ... | ALGO | 0.999959 | 3.997396 | {
"github_metadata": {
"branch": "master",
"commit_count": 17,
"repo_created_at": "2016-05-19T02:37:52.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "2c6daa881... |
fa106a98-6cae-4841-85ea-05a4870ede22 | chrisbaldwin2/BPlus-HashJoin | src/node.cpp | #include"../include/common.hpp"
#include"../include/node.hpp"
#include<string>
#include<iostream>
int node_enumerator = 0;
Node::Node(int32_t order){
// std::cout<<"Node constructor called"<<std::endl;
children.clear();
values.clear();
this->order = order;
leaf = false;
root = false;
this-... | ALGO | 0.997191 | 4.819823 | {
"github_metadata": {
"branch": "main",
"commit_count": 9,
"repo_created_at": "2023-04-03T21:59: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": "7fc18308838f... |
f5cc561f-777c-4360-a7b7-e79631e67fe7 | DenisKholodov/ProgC- | 8-PoleChudesOOP/WhellWithClass.cpp | #include <iostream>
#include <vector>
#include <string>
#include <windows.h>
#include <locale.h>
class Word
{
private:
const std::string m_word;
std::vector<char> m_arrEnigma;
public:
Word(std::string word);
Word& showChars();
std::string getAnswer();
std::vector<char> &getArrEnigma();
... | ALGO | 0.99849 | 4.189428 | {
"github_metadata": {
"branch": "main",
"commit_count": 16,
"repo_created_at": "2023-09-14T21:11: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": "940192e555b... |
b96d5712-8972-4642-81aa-84b73df19269 | chaudao-ucla/chern_qmd | nonadiabaticqmdcode2/analysis.hpp | //
// analysis.hpp
// GA_solver-TBMD
//
// Created by <NAME> on 10/2/17.
// Copyright © 2017 <NAME>. All rights reserved.
//
#ifndef analysis_hpp
#define analysis_hpp
#include <stdio.h>
#include "util.hpp"
#include "model.hpp"
using namespace std;
class Measurement {
public:
double dt;
int numSteps;
... | ALGO | 0.992672 | 4.815068 | {
"github_metadata": {
"branch": "master",
"commit_count": 3,
"repo_created_at": "2019-09-29T20:13: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": "bf23f37b6b... |
e8322502-7d7b-4ea0-b12b-0b1f34e9e139 | pafin10/CompetitiveProgrammingExercises | year_1_contests/contests/codeforces14/2.cpp | #include <iostream>
#include <vector>
#include <string>
#include <sstream>
#include <fstream>
#include <string>
#include <algorithm>
#include <cmath>
#include <map>
#include <set>
#include <bitset>
using namespace std;
#define ll long long
#define endl "\n"
#define it(i, start, n) for (int i = start; i < n; ++i)
#defi... | ALGO | 0.999714 | 4.350433 | {
"github_metadata": {
"branch": "main",
"commit_count": 31,
"repo_created_at": "2023-09-09T12:04: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": "32409ed76a6... |
e3022916-2802-4e3d-a8dd-c4825592f203 | ishandutta2007/codeforces-u | unused/normal/822/D.cpp | #include <bits/stdc++.h>
using namespace std;
int dp[5000005];
bool notprime[5000005];
int div_[5000005];
constexpr int MOD = 1000000007;
void getprime()
{
for (int i = 2; i <= 5000000; i++)
{
if (notprime[i]) continue;
div_[i] = i;
for (int j = i * 2; j <= 5000000; j += i)
{
... | ALGO | 0.999929 | 5.299739 | {
"github_metadata": {
"branch": "main",
"commit_count": 1,
"repo_created_at": "2024-10-30T16:31: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": "c3f13448f01e... |
59091c19-cef7-4d0d-8faa-721ce76b0f42 | beast-45/Leetcode | 0905-length-of-longest-fibonacci-subsequence/0905-length-of-longest-fibonacci-subsequence.cpp | class Solution {
public:
int solve(int j , int k , vector<int> &arr , unordered_map<int,int> &mp){
int target = arr[k] - arr[j];
if(mp.count(target) && mp[target] < j){
int i = mp[target];
return solve(i , j , arr , mp) + 1;
}
return 2;
}
int lenLonge... | ALGO | 0.999954 | 5.381488 | {
"github_metadata": {
"branch": "main",
"commit_count": 2521,
"repo_created_at": "2024-08-24T09:34:26.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 3,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "94e0242a1... |
60c8843d-7302-469a-8aaa-e11eae279c67 | coin-or/Bcp | Applications/MaxCut/Generators/gen4.cpp | // Copyright (C) 2000, International Business Machines
// Corporation and others. All Rights Reserved.
/* This gnerator generates $G_{grid}$ :
An n-by-n grid with edge weigths chosen uniformly from {-maxw,+maxw}.
(For now we'll solve this problem by treating it as a complete graph. Sort
of inefficient...)
*/
... | ALGO | 0.979064 | 3.642957 | {
"github_metadata": {
"branch": "master",
"commit_count": 473,
"repo_created_at": "2014-12-28T02:02:49.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 30,
"forks": 14,
"issues": 9,
"pull_requests": 1
},
"file_meta": {
"content_id": "d7af426... |
a40bfe84-76db-4a2c-95cd-ffb83fbe0810 | andy01248/data-structure-cpp | amazon_OA2/Ksubstring_Kchars.cpp | #include<iostream>
#include <string>
#include<stack>
#include<queue>
#include<map>
#include<set>
#include<algorithm>
using namespace std;
class solution{
public:
vector<string>KSubString(string s, int K){
vector<string> shabi;
shabi.push_back("shabi");
if ( s.empty()==1 || K==0) return ... | ALGO | 0.999359 | 4.422187 | {
"github_metadata": {
"branch": "master",
"commit_count": 14,
"repo_created_at": "2019-12-01T14:56: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": "66d04e88a... |
801d2949-62f5-41b7-b16e-18adc1d0c91a | cselab/aphros | src/solver/curv.ipp | // Created by <NAME> on 25.12.2019
// Copyright 2019 ETH Zurich
#include <array>
#include <exception>
#include <fstream>
#include <limits>
#include <map>
#include <memory>
#include "approx.h"
#include "debug/isnan.h"
#include "embed.h"
#include "geom/block.h"
#include "normal.h"
#include "parse/curv.h"
#include "reco... | ALGO | 0.994967 | 5.115637 | {
"github_metadata": {
"branch": "master",
"commit_count": 4898,
"repo_created_at": "2020-01-08T11:39:44.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 426,
"forks": 51,
"issues": 14,
"pull_requests": 0
},
"file_meta": {
"content_id": "0bee... |
112eb418-2764-4a96-a5bb-648a678c3461 | dakk/italian_osdev_archive | italios/kernel_1/include/fpu_emu/fpu_trig_value.h | #ifdef __FPU_EMU__
#ifndef __FPU_TRIG_VALUE__
#define __FPU_TRIG_VALUE__
#include <stddef.h>
#include <fpu_type.h>
namespace fpu_trig_value {
//valori per i seni
static const long double VSIN0 = (0xBFFF00000000LL << 48) + 0x000000000000LL;
static const long double VSIN1 = (0xBFFF3FFD8483LL << 48) +... | TOOL | 0.99195 | 5.007232 | {
"github_metadata": {
"branch": "master",
"commit_count": 16,
"repo_created_at": "2024-04-04T10:56:58.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "741e752e7... |
50e76e2e-24c1-4a52-8dcb-60ee7af1d04f | firmread/natureOFcode | chp02-forces-03-forces-many-realgravity/src/ofApp.cpp | /**
* Acceleration with Vectors
* Original Processing code by <NAME>.
* OF rendition by firmread
*
* Demonstration of the basics of motion with vector.
* A "Mover" object stores location, velocity, and acceleration as vectors
* The motion is controlled by affecting the acceleration (in this case towards the mous... | TOOL | 0.934705 | 4.839908 | {
"github_metadata": {
"branch": "master",
"commit_count": 69,
"repo_created_at": "2013-02-21T21:56:21.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 149,
"forks": 38,
"issues": 0,
"pull_requests": 2
},
"file_meta": {
"content_id": "035411... |
5232abba-9794-4e4b-adb2-27caeac58371 | dilin993/MultiCameraPeopleTrackingSystem1-0-UDP | client/src/BGSDetector.h | //
// Created by dilin on 10/23/17.
//
#ifndef TRACK_BGSDETECTOR_H
#define TRACK_BGSDETECTOR_H
#include <fstream>
#include <opencv2/opencv.hpp>
#include <opencv2/bgsegm.hpp>
#include "Detector.h"
#include "Histogram.h"
// #define BGS_DEBUG_MODE
#define FRAME_WAIT 300
#define N_FEATURES 6
class Blob
{
public:
... | ALGO | 0.91533 | 5.833488 | {
"github_metadata": {
"branch": "master",
"commit_count": 46,
"repo_created_at": "2017-11-20T02:06:02.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 1,
"issues": 1,
"pull_requests": 0
},
"file_meta": {
"content_id": "bb4d737d8... |
13eea45f-ad86-42bd-a956-28f5fe267330 | indy256/codelibrary | cpp/structures/treap_bst_shared_ptr.cpp | #include <bits/stdc++.h>
using namespace std;
mt19937_64 rng(chrono::steady_clock::now().time_since_epoch().count());
struct Treap;
using pTreap = shared_ptr<Treap>;
struct Treap {
int key;
long long prio;
int size;
pTreap l, r;
Treap(int key) : key(key), prio(rng()), size(1), l(nullptr), r(nu... | ALGO | 0.999973 | 4.910384 | {
"github_metadata": {
"branch": "main",
"commit_count": 1484,
"repo_created_at": "2011-03-17T20:38:29.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1994,
"forks": 524,
"issues": 95,
"pull_requests": 3
},
"file_meta": {
"content_id": "589... |
656c83b4-02c3-4ea3-8f5e-1d023adc72aa | Codensity30/Strivers-A2Z-DSA-Sheet | 06.Bit Manipulation/2. Interview Problems/02. Exceptionally odd.cpp | /*
QUESTION:
Given an array of N positive integers where all numbers occur an even number of times except one number which occurs an odd number of times. Find the exceptional number.
Example:
Input: N = 7, Arr[] = {1, 2, 3, 2, 3, 1, 3}
Output: 3
Explanation: Number 3 occurs three times, which is an odd number of times... | ALGO | 0.999972 | 6.296414 | {
"github_metadata": {
"branch": "main",
"commit_count": 88,
"repo_created_at": "2023-05-29T13:38:11.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 213,
"forks": 70,
"issues": 1,
"pull_requests": 0
},
"file_meta": {
"content_id": "a105a374... |
75bbd757-e5c0-4e69-badc-ca80476139dc | ishandutta2007/codeforces-k | kan/normal/562/D.cpp | #include <bits/stdc++.h>
using namespace std;
#define re return
#define fi first
#define se second
#define sz(x) ((int)x.size())
#define all(x) x.begin(), x.end()
#define fill(x,y) memset(x,y,sizeof(x))
#define mp make_pair
#define pb push_back
#define j0 j237849523
#define j1 j5435324
#define y0 y2543
#define y1 y54... | ALGO | 0.99992 | 4.271509 | {
"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": "3514acb4dab6... |
f6a351a5-b5fe-4bca-8f51-d0cc8f76579c | SourceryOne/Arduino-ADSR | ArduinoADSR/B54_envelopeStartnLoop.ino | void envelopeStartnLoop1() {
//GATE ON start the Loop once the Gate is activated.
/*
Ok, if gate is on, then play the amount of loops set by nLoopLengthCh1. if gate is released, continue to play until nLoop1Count>nLoopLengthCh1.
IF nLoop1Count>nLoopLengthCh1 before the gate is released, then just wait for the g... | ALGO | 0.99177 | 4.235858 | {
"github_metadata": {
"branch": "main",
"commit_count": 7,
"repo_created_at": "2024-11-08T13:53:03.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "13ab4cef5828... |
cc1278ba-63c1-4fad-9c26-0a37bbd62f3d | shay-ff/cpp-files | Codeforces/Live/1011/B_Serval_and_Final_MEX.cpp | /**
* created: 2025-03-22 20:30:46
**/
#include <bits/stdc++.h>
using namespace std;
#ifndef ONLINE_JUDGE
#include "../debug.cpp"
#else
#define debug(...)
#define debugArr(...)
#endif
#define int long long
#define show(x) cout << x << endl
#define sz(x) (int)(x.size())
signed main(){
ios_base::sync_with_stdio(f... | ALGO | 0.999437 | 3.924667 | {
"github_metadata": {
"branch": "main",
"commit_count": 2,
"repo_created_at": "2025-05-08T13:22: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": "d5ec180e0eac... |
9b356d78-1238-479a-9df6-b5dfcd985a30 | bluemarlon/TDA-of-K-means-on-1st-PL | Features_MPI.cpp | #include <iterator>
#include <iostream>
#include <fstream>
#include <sstream>
#include <vector>
#include <string>
#include <math.h>
#include <stdlib.h>
#include <stdio.h>
#include <limits>
#include <random>
#include <mpi.h>
#include <cstdlib>
#include <algorithm>
#include <time.h>
using namespace std;
//read one ... | DATA | 0.999276 | 3.618396 | {
"github_metadata": {
"branch": "master",
"commit_count": 6,
"repo_created_at": "2019-05-11T21:56:09.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "3014b28fda... |
2175deb9-a5b7-4368-b2c2-3ee0485b252d | Abdelrahman-Bishr/Lidar | src/quiz/cluster/cluster.cpp | /* \author <NAME> */
// Quiz on implementing simple RANSAC line fitting
#include "../../render/render.h"
#include "../../render/box.h"
#include <chrono>
#include <string>
#include "kdtree.h"
// Arguments:
// window is the region to draw box around
// increase zoom to see more of the area
pcl::visualization::PCLVisua... | ALGO | 0.999451 | 5.048262 | {
"github_metadata": {
"branch": "master",
"commit_count": 4,
"repo_created_at": "2020-05-22T03:14: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": "af03d3d06a... |
e7927cee-6fb2-4f3c-82e8-dd9c904bf675 | the-badcoder/UVA-Solutions | 10130.cpp | /// <NAME>
/**
Practice like <NAME>
Play Like Leo Messi..
**/
#include <bits/stdc++.h>
using namespace std;
#define PI acos(-1.0)
#define Pi 3.141592653589793
#define ff first
#define ss second
#define pb push... | ALGO | 0.999896 | 3.213846 | {
"github_metadata": {
"branch": "master",
"commit_count": 17,
"repo_created_at": "2017-10-02T09:26:54.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "a89ff8fb5... |
e2f09037-670e-4349-91cf-5c016fe608df | weiii8708271688/UVA | UVA/821/36198025_AC_120ms_0kB.cpp | #include <bits/stdc++.h>
using namespace std;
int main() {
int a, b, t = 1;
while(cin >> a >> b) {
if(!a && !b) break;
vector<vector<int>> dist;
set<int> s;
dist.assign(101, vector<int>(101, 10000));
do{
s.insert(a);
s.insert(b);
dis... | ALGO | 0.997994 | 3.720922 | {
"github_metadata": {
"branch": "master",
"commit_count": 1,
"repo_created_at": "2022-10-19T12:29:36.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "4ab9d178fe... |
528b2b7c-ee38-4484-a874-b9f08aed589e | kazTI/Bordspel | Code/bord_arduino/path.ino | #include "Piece.h"
float getSlope(Piece *p){
return (((float)destinationY - (float)p->getYPosition())
/ ((float)destinationX - (float)p->getXPosition()));
}
float getPerpendicular(Piece *p){ //R1 * R2 = -1
return ((-1) / getSlope(p));
}
float getB(Piece *p){ //B = ((Ax-Y) *-1)
return (((getSlop... | ALGO | 0.984996 | 3.210756 | {
"github_metadata": {
"branch": "main",
"commit_count": 1,
"repo_created_at": "2021-08-25T20:06: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": "91e26cdb248d... |
d937ae01-9a6a-4983-bdd9-612ea9880e71 | USTCwangsheng/pySCUBA | pySCUBA/iblock/src/energycalculators.cpp | /*
* bondedenergies.cpp
*
* Created on: 2019年12月2日
* Author: hyiu
*/
#include "iblock/intrctblck.h"
#include "geometry/calculators.h"
#include "iblock/backboneff.h"
#include "iblock/vsctypes.h"
using namespace NSPintrct;
template<>
double Bond::energy(const std::array<NSPgeometry::XYZ, 2> &crd,
std::array... | ALGO | 0.995026 | 6.113248 | {
"github_metadata": {
"branch": "master",
"commit_count": 27,
"repo_created_at": "2024-03-08T09:43:46.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 5,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "a541971f6... |
4ec00676-2a5d-4a71-a923-ff745feadf50 | liuawen/Learning-Algorithms | leetcode/1229-Meeting-Scheduler/cpp-1229/main2.cpp | /// Source : https://leetcode.com/problems/meeting-scheduler/
/// Author : liuyubobobo
/// Time : 2019-10-19
#include <iostream>
#include <vector>
#include <queue>
using namespace std;
/// Using Priority Queue
/// Time Complexity: O(nlogn)
/// Space Complexity: O(1)
class Solution {
public:
vector<int> minAva... | ALGO | 0.999992 | 5.996917 | {
"github_metadata": {
"branch": "master",
"commit_count": 24,
"repo_created_at": "2019-08-06T13:26:41.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 7,
"forks": 2,
"issues": 0,
"pull_requests": 10
},
"file_meta": {
"content_id": "a32592bc... |
a6751820-1528-4838-aad8-05310cc58795 | xuau34/competitive-programming | PTC/2017-10/ITSA2.cpp | #include <cstdio>
#include <utility>
#include <algorithm>
using namespace std;
int T, N, M, Q;
pair<int, int> arr[1005];
void ini(void){
scanf("%d", &N);
for(int i = 0; i < N; ++i) scanf("%d%d", &arr[i].first, &arr[i].second);
sort(arr, arr + N);
//for(int i = 0; i < N; ++i) printf("(%d, %d) ", arr[i].first, ar... | ALGO | 0.999936 | 3.680365 | {
"github_metadata": {
"branch": "master",
"commit_count": 1,
"repo_created_at": "2019-07-22T14:49: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": "dac85d36de... |
ab20d326-ce2d-411b-b57e-7531734549af | sumitkrp1234/CS641A | assignment 4/fetch_ip.cpp | #include <iostream>
#include <fstream>
#include<bits/stdc++.h>
using namespace std;
using INT = unsigned int;
INT IP[] = {
58,50,42, 34,26,18,10,2,
60,52,44,36,28,20,12,4,
62,54, 46, 38, 30, 22, 14,6,
64, 56, 48, 40,32,24, 16, 8,
57, 49, 41, 33,25,17, 9,1,
59, 51,43,35,27,19,11,3,
61,53,45,37,29,21,13, ... | ALGO | 0.998228 | 4.243775 | {
"github_metadata": {
"branch": "main",
"commit_count": 2,
"repo_created_at": "2022-07-02T11:31:43.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "429232a2585e... |
c056aa77-eb92-4222-9adf-f53d80f20b86 | iridescent2836/LeetCode | 190.cpp | #include "header.h"
/**
* Method bit by bit:
* time: O(logn)
* space: O(1)
* bad wirtting style
*/
class Solution {
public:
uint32_t reverseBits(uint32_t n) {
uint32_t ans = 0;
uint32_t mask = 1;
mask = mask & n;
ans = ans | mask;
for(int i = 0; i < 31; i++){
... | ALGO | 0.999977 | 5.47815 | {
"github_metadata": {
"branch": "main",
"commit_count": 16,
"repo_created_at": "2025-02-22T03:13: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": "6c3ef29e335... |
fda65e06-3bb7-41af-878f-e8761a46e266 | ronierlima/ed.quixada.ufc | 01_princesa/main.cpp | #include <iostream>
using namespace std;
void rodar(int pessoas[], int& qtdPessoas){
int aux = pessoas[0];
for(int i = 0; i < qtdPessoas - 1; i++ )
pessoas[i] = pessoas[i + 1];
pessoas[qtdPessoas - 1] = aux;
}
void matar(int pessoas[], int& qtdPessoas){
for(int i = 1; i ... | ALGO | 0.999992 | 3.315852 | {
"github_metadata": {
"branch": "master",
"commit_count": 38,
"repo_created_at": "2018-04-01T22:47: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": "64a1067b1... |
006b50c1-6a63-45e0-b352-d19c131bc242 | JSwidinsky/CompetitiveProgramming | leetcode/1844.cpp | #include <bits/stdc++.h>
using namespace std;
#define debug(a) cerr << #a << " = " << (a) << endl;
#define fst first
#define snd second
#define sz(x) (int)(x).size()
#define all(X) begin(X), end(X)
#define rall(X) rbegin(X), rend(X)
#define FOR(s, n) for(int i = s; i < n; ++i)
typedef long long int ll;
typedef unsign... | ALGO | 0.999735 | 4.156301 | {
"github_metadata": {
"branch": "master",
"commit_count": 3,
"repo_created_at": "2019-12-03T20:06:54.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "37a58be38e... |
f8ff99dc-16ca-47f0-93c9-033d5b156dc8 | krithikvaidya/DSA-Problems-Solutions | Hackerrank/__data-structures/stacks/maximum-element.cpp | #include <bits/stdc++.h>
using namespace std;
struct Stack
{
int data;
Stack* next;
};
Stack* push(int val)
{
Stack* node = new Stack();
node -> data = val;
node -> next = NULL;
return node;
}
int printMax(Stack* top)
{
int max = INT_MIN;
while(top != NULL)
{
if(top -> dat... | ALGO | 0.999946 | 3.905236 | {
"github_metadata": {
"branch": "master",
"commit_count": 24,
"repo_created_at": "2019-10-31T16:07: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": "f9c18e09f... |
e77cf86b-a41d-4903-8626-83f6fb07f248 | prepare/Graphics2DVariants | Fog/Src/Fog/G2d/Imaging/ImageResize_SSE2.cpp | // [Fog-G2d]
//
// [License]
// MIT, See COPYING file in package
// [Precompiled Headers]
#if defined(FOG_PRECOMP)
#include FOG_PRECOMP
#endif // FOG_PRECOMP
// [Dependencies]
#include <Fog/Core/Acc/AccSse2.h>
#include <Fog/Core/Global/Global.h>
#include <Fog/Core/Global/Init_p.h>
#include <Fog/Core/Math/Function.h>
... | ALGO | 0.961793 | 5.791688 | {
"github_metadata": {
"branch": "master",
"commit_count": 20,
"repo_created_at": "2014-08-02T01:13:16.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "5754fe87a... |
2cf5db17-60bd-435d-90a3-e16fbd9e9e89 | naghekyan/codility-lessons-solutions-cpp | Flags.h | //
// Flags.h
// Test
//
// Created by <NAME> on 4/9/18.
// Copyright © 2018 <NAME>. All rights reserved.
//
#ifndef Flags_h
#define Flags_h
#include <cmath>
#include <algorithm>
#include <numeric>
#include <vector>
#include <iostream>
#include <set>
#include <string>
#include <map>
#include <unordered_map>
#inc... | ALGO | 0.999585 | 5.19956 | {
"github_metadata": {
"branch": "master",
"commit_count": 11,
"repo_created_at": "2018-03-29T07:10: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": "b0f8998d7... |
09666c92-2d96-4731-8234-42ff09ade8b7 | farhanishtiyak/Problem-Solving-CP | Codeforces/C_Beautiful_Triple_Pairs.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 Sezar ios_base::sync_with_stdio(false), cin.tie(NULL), cout.tie(NULL)
// // #define tc(t) int t; cin >> t; while (t--)
... | ALGO | 0.999914 | 5.572741 | {
"github_metadata": {
"branch": "master",
"commit_count": 64,
"repo_created_at": "2022-08-15T11:54:00.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "f3fa5c396... |
91825c29-63b5-4629-a655-fbb603143a05 | Vishal-Agarwal12/cp | smallest multiple of x in range [L,R] in O(1) time.cpp | ERROR: type should be string, got "https://codeforces.com/contest/1708/problem/B\n\n#include <bits/stdc++.h>\n#define ll long long\nusing namespace std;\n\nint findDivisibleByX(int l, int r, int x)\n{\n if (l % x == 0)\n {\n return l;\n }\n\n int start = (l + x - 1) / x * x;\n if (start > r)\n {\n return -1;\n }\n\n return start;\n}\n\nvoid solve()\n{\n int n, l, r;\n cin >> n >> l >> r;\n vector<int> v;\n\n for (int i = 1; i <= n; i++)\n {\n int result = findDivisibleByX(l, r, i);\n if (result != -1)\n {\n v.push_back(result);\n }\n else\n {\n cout << \"NO\" << endl;\n return;\n }\n }\n\n cout << \"YES\" << endl;\n for (auto y : v)\n cout << y << \" \";\n cout << endl;\n}\n\nsigned main()\n{\n ios::sync_with_stdio(false);\n cin.tie(nullptr);\n\n int t;\n cin >> t;\n while (t--)\n solve();\n\n return 0;\n}\n" | ALGO | 0.999926 | 4.268451 | {
"github_metadata": {
"branch": "main",
"commit_count": 170,
"repo_created_at": "2023-03-14T04:58: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": "0cb38e2c64... |
2ff92ecc-9390-4e9a-adb6-1e1a6e4d6ba5 | ishandutta2007/codeforces-a | akulyat/normal/1509/C.cpp | #include <bits/stdc++.h>
#pragma GCC optimize ("O3", "unroll-all-loops")
#pragma GCC target ("sse4.2")
using namespace std;
#define F first
#define S second
typedef long long ll;
typedef long double ld;
typedef pair<ll, ll> pll;
typedef pair<int, int> pii;
ifstream in;
ofstream out;
const long long kk... | ALGO | 0.999941 | 4.019193 | {
"github_metadata": {
"branch": "main",
"commit_count": 4,
"repo_created_at": "2024-04-11T00:51:41.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "6aa383390cbb... |
d6350a70-549c-4cb1-9f37-9c11caf8feaf | anasdevv/dsa_cplus | 2.cpp | #include<iostream>
#include<math.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) {}
};
ListNode* addTwoNumbers(ListNode* l1, ListNode* ... | ALGO | 0.999866 | 4.49425 | {
"github_metadata": {
"branch": "main",
"commit_count": 1,
"repo_created_at": "2023-06-24T10:31: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": "11c83273dd44... |
f28be0c6-a1b1-4a7f-a875-f60d3c36109e | Rohan-90/GFG_Solutions | Medium/Painting the Fence/painting-the-fence.cpp | //{ Driver Code Starts
#include <bits/stdc++.h>
#include<stdio.h>
#include<math.h>
using namespace std;
// } Driver Code Ends
class Solution{
public:
long long dpMemo(int n, int k , vector<int> & dp){
long long mod = 1000000007;
if(n == 1) return k;
if(n == 2) return (k*k)% mod;
... | ALGO | 0.999982 | 5.876735 | {
"github_metadata": {
"branch": "main",
"commit_count": 214,
"repo_created_at": "2023-10-10T19:54:10.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "7e9a99748d... |
24886088-7496-4ba9-842c-314d58dea08c | taehyungz/Algorithm | acmicpc.net/07576.cpp | #include <iostream>
#include <cstdio>
#include <queue>
#include <utility>
using namespace std;
int box[1000][1000];//토마토 보관 박스
int check[1000][1000] = { -1 };//썩은 날짜 기록
queue<pair<int, int>> q;//BFS 위치 저장
int M, N;
pair<int, int> pair_arr[4] = { make_pair(0,1), make_pair(1,0),
make_pair(-1,0), make_pair(0,-1) };... | ALGO | 0.999986 | 3.649503 | {
"github_metadata": {
"branch": "master",
"commit_count": 128,
"repo_created_at": "2021-05-11T18:03: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": "9abd2199... |
8174a478-56b0-4f1d-a4de-e9d2d9559b52 | lozovska/RPRP | lab4/lab4_3.cpp | #include <cstdio>
#include <process.h>
#include <windows.h>
// Структура узла списка
struct Node {
explicit Node(unsigned x) : value(x) {}
Node* next = nullptr; // следующий узел
unsigned value = 0; // хранимое значение
};
// Класс списка (очереди на односвязном списке)
class Queue {
public:
Queue() =... | ALGO | 0.992527 | 4.086959 | {
"github_metadata": {
"branch": "main",
"commit_count": 14,
"repo_created_at": "2022-11-09T21:32: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": "6fb93298c49... |
31e10bd8-3334-43bf-8da0-3668eed8e1fa | PASSIONLab/CombBLAS | mfiles/graph_preprocessor.cpp | #include <iostream>
#include <string>
#include <utility>
#include <map>
#include <cstdio>
#include <vector>
#include <sys/file.h>
#include <stdint.h>
#include <algorithm>
using namespace std;
template<typename _ForwardIterator>
bool is_sorted(_ForwardIterator __first, _ForwardIterator __last)
{
if (__first == __las... | ALGO | 0.999088 | 3.964557 | {
"github_metadata": {
"branch": "master",
"commit_count": 4785,
"repo_created_at": "2020-08-14T05:56:52.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 79,
"forks": 29,
"issues": 11,
"pull_requests": 2
},
"file_meta": {
"content_id": "150ea... |
23fd78da-218f-4f10-9aa3-822d20ef8363 | ChoiEungi/data-structure-algorithm | DataStructureProjcect/StackProject/s20205188_03.cpp | #include <iostream>
#include <fstream>
#include <string>
#include <sstream>
#include <stdexcept>
using namespace std;
ifstream inputfile; // ifstream: used to read from files
ofstream outputfile; // ofstream: used to create files and write on files
template <typename E>
class ArrayStack {
enum { DEF_CAPACITY = 10... | ALGO | 0.999551 | 4.075844 | {
"github_metadata": {
"branch": "main",
"commit_count": 15,
"repo_created_at": "2021-06-12T13:33:12.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "3a8371144cb... |
a81c9865-5040-41c1-8bf7-d6034b497390 | FiRebourn088/Data-Structures | Searching & Sorting/QuickSort.cpp | #include <bits/stdc++.h>
using namespace std;
void display(int Arr[],int size){
for(int i = 0; i < size; i++){
cout << Arr[i] << " ";
}
cout << endl;
}
void swap(int* x, int* y){
int temp = *x;
*x = *y;
*y = temp;
}
int partition(int Arr[],int low,int high){
int pivot = Arr[high];... | ALGO | 0.99996 | 5.398258 | {
"github_metadata": {
"branch": "main",
"commit_count": 2,
"repo_created_at": "2022-11-12T05:21: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": "c991ec951d59... |
6c8f1f93-3ac2-4e4a-ab38-8e40918d0b00 | the-robot/coding-challenges | coding-challenges/grokking-coding-interview/06-in-place-reversal-of-a-linkedlist/reverse-linked-list-ii.cpp | // https://leetcode.com/problems/reverse-linked-list-ii/
/**
* 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.999971 | 6.323715 | {
"github_metadata": {
"branch": "master",
"commit_count": 375,
"repo_created_at": "2018-10-23T02:00:48.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 13,
"forks": 4,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "0516fda... |
9c6b9b31-6fef-4cb2-9abf-40f5440fdca4 | 1tygoime/a | ntu/HANA2.cpp | #include <bits/stdc++.h>
using namespace std;
int dp[201][201], dp1[201][201], dp2[201][201], dp3[201][201], a[201][201];
#define can(x) !a[i][j] || a[i][j] == x
const int MOD = 1e7;
int main(){
int m, n;
cin >> m >> n;
for(int i = 1; i <= m; i++)
for(int j = 1; j <= n; j++) cin >> a[i][j];
dp[1][1] = d... | ALGO | 0.999962 | 4.013326 | {
"github_metadata": {
"branch": "main",
"commit_count": 34,
"repo_created_at": "2021-10-12T16:31:22.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "86bb2d2fed2... |
df9cf0d0-3873-4999-82ab-2bd0d83e16fc | vhbb/cmssw | RecoHI/HiJetAlgos/plugins/VoronoiAlgorithm.h | #ifndef __VoronoiAlgorithm_h__
#define __VoronoiAlgorithm_h__
#include <cmath>
#include <CGAL/Exact_predicates_inexact_constructions_kernel.h>
#include <CGAL/Delaunay_triangulation_2.h>
#include <CGAL/Voronoi_diagram_2.h>
#include <CGAL/Delaunay_triangulation_adaptation_traits_2.h>
#include <CGAL/Delaunay_triangulati... | ALGO | 0.997401 | 5.978004 | {
"github_metadata": {
"branch": "vhbbHeppy80X",
"commit_count": 163384,
"repo_created_at": "2013-07-23T13:22:20.000Z",
"is_fork": true,
"is_org_owned": true,
"forked_from": "cms-sw/cmssw",
"stars": 4,
"forks": 5,
"issues": 19,
"pull_requests": 6
},
"file_meta": {
"cont... |
38809e01-5e1c-4e97-ba69-dc903b3f59d7 | alexandraback/datacollection | solutions_5634947029139456_0/C++/Diusrex/solution.cpp | #include <cstdio>
#include <vector>
using namespace std;
int GetBinary(int num)
{
int addition = 1, returnValue = 0;
while (num)
{
if (num & 1)
returnValue += addition;
addition <<= 1;
num /= 10;
}
return returnValue;
}
int main()
{
... | ALGO | 0.999938 | 3.669032 | {
"github_metadata": {
"branch": "master",
"commit_count": 58,
"repo_created_at": "2017-03-08T11:33:58.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 4,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "521b6c897... |
1e0982ca-daa7-4d0b-9ae4-012695ac6d4b | gaoxy914/ARSP | src-arsp/quadtree.cpp | #include "quadtree.h"
void QuadTree::_init_iterator(const int& m) {
_iter.m_sigma = new int[m];
memset(_iter.m_sigma, 0, m*sizeof(int));
_iter.m_index.resize(_n);
iota(begin(_iter.m_index), end(_iter.m_index), 0);
_iter.m_beta = 1;
_iter.m_xi = 0;
}
void QuadTree::_clear(Node *node) {
if (... | ALGO | 0.998897 | 4.326081 | {
"github_metadata": {
"branch": "main",
"commit_count": 52,
"repo_created_at": "2022-03-14T05:41: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": "7f67feb0372... |
13d6b3d5-f5c9-4385-9bbc-60b95352eeb2 | Krishna-Reddy-Padala/GFG | Easy/Wave Array/wave-array.cpp | //{ Driver Code Starts
#include<bits/stdc++.h>
using namespace std;
// #include <algorithm>
// } Driver Code Ends
class Solution{
public:
// arr: input array
// n: size of array
//Function to sort the array into a wave-like array.
void convertToWave(int n, vector<int>& arr){
// Yo... | ALGO | 0.999828 | 5.463143 | {
"github_metadata": {
"branch": "main",
"commit_count": 239,
"repo_created_at": "2023-06-26T16:28:36.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "6749b46ccd... |
42a35b1f-a9c8-4841-b189-ab97dfdfcaa7 | guilhermesilveira/uva-problems | v1/ok/c168.cpp | #include <iostream>
#include <vector>
#include <string.h>
#include <stdio.h>
#include <stdlib.h>
#define FOR(a,b) for(a=0;a<b;a++)
using namespace std;
vector<int> conn[30];
bool ac[30];
int main() {
int i,j,k,l;
char s[10000];
int len;
while((gets(s))) {
len = strlen(s);
if(s[0]=='#') break;
FO... | ALGO | 0.99635 | 3.054502 | {
"github_metadata": {
"branch": "master",
"commit_count": 1,
"repo_created_at": "2010-12-15T00:27:34.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 9,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "e22cdf21a3... |
0d7f4613-1527-4fb0-9210-56da7fe147e2 | priyanka8625/DSA-Daily-Problems-2024 | 05_May_Daily_Problems/10_GFG_Combination Sum II_MySoln.cpp | class Solution{
public:
vector<vector<int>> CombinationSum2(vector<int> arr,int n,int k)
{
//code here
vector<vector<int>> ans;
sort(arr.begin(), arr.end());
vector<int> temp;
generateSum(arr, n, k, temp, ans, 0);
return ans;
}
void generateSum(vector<int>... | ALGO | 0.999937 | 5.831608 | {
"github_metadata": {
"branch": "main",
"commit_count": 530,
"repo_created_at": "2024-01-01T09:11: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": "178dbbe4ba... |
7a2fe12b-70f4-46bb-8eda-cd39d101d083 | YJ243/python_codingTest | codetree_dxdy/snakeLovesApple_해설1.cpp | /*
* 2024.1.26
* 1. 배열을 이용한 시뮬레이션
* 뱀의 위치를 머리~꼬리까지 순서대로 vector 배열에 담아 관리
* 머리와 꼬리에 주의를 기울이고, 몸이 꼬이는 조건도 머리와 다른 부분이 겹치는지만 확인하면 됨
* 꼬리를 없애는 것을 먼저 해야지 올바른 답을 낼 수 있음
* 즉 tail을 삭제한 이후에 head를 새로 추가하면서 몸이 꼬이는 경우가 있는지 확인하기
* 사과가 모든 격자에 전부 주어지는 경우 최대 N^2까지 몸이 늘어날 수 있고,
* 뱀의 머리 부분을 앞에 추가하는 것+겹치는지 판단 위해 뱀 몸통 각각의 위치를 모두 봐야... | ALGO | 0.999889 | 4.739806 | {
"github_metadata": {
"branch": "main",
"commit_count": 102,
"repo_created_at": "2023-04-11T06:07: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": "e7d0a9f360... |
2c0de0ef-5a26-4215-8a20-d3c8b25eeda8 | TAFFO-org/TAFFO | test/polybench-cuda/datamining/correlation/correlation.cpp | /**
* correlation.cu: This file is part of the PolyBench/GPU 1.0 test suite.
*
*
* Contact: <NAME> <<EMAIL>>
* <NAME> <<EMAIL>>
* <NAME> <<EMAIL>>
* Web address: http://www.cse.ohio-state.edu/~pouchet/software/polybench/GPU
*/
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
#include <assert.h>
#includ... | ALGO | 0.983773 | 5.003997 | {
"github_metadata": {
"branch": "master",
"commit_count": 584,
"repo_created_at": "2021-11-26T18:18:14.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 18,
"forks": 12,
"issues": 1,
"pull_requests": 0
},
"file_meta": {
"content_id": "9502163... |
abfd5f1e-e87b-453a-9eba-9e073cdc3e90 | michaelkimm/InhaUnivGameProgramDevelopment | GalsPanic/figureDraw.cpp |
#include <iostream>
#include <vector>
#include <tchar.h>
#include "figureDraw.h"
#ifndef PI
#define PI 3.141592
#endif // !PI
void DrawGrid(HDC hdc, POINT p1, POINT p2, UINT n) // 시작 위치, 끝 위치, 선의 개수
{
LONG dx = (p2.x - p1.x) / n; // 가로 칸 개수
LONG dy = (p2.y - p1.y) / n; // 세로 칸 개수
// 가로 선 그리기
for (LONG j = p1.y... | TOOL | 0.973256 | 4.82095 | {
"github_metadata": {
"branch": "main",
"commit_count": 9,
"repo_created_at": "2021-07-13T10:11: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": "c53293ac2948... |
d6ab0008-90df-454a-8b2a-380b9229ac92 | Delthin/leetcode-solution | leetcode/editor/cn/[2595]奇偶位数.cpp | /**
给你一个 正 整数 n 。
用 even 表示在 n 的二进制形式(下标从 0 开始)中值为 1 的偶数下标的个数。
用 odd 表示在 n 的二进制形式(下标从 0 开始)中值为 1 的奇数下标的个数。
请注意,在数字的二进制表示中,位下标的顺序 从右到左。
返回整数数组 answer ,其中 answer = [even, odd] 。
示例 1:
输入:n = 50
输出:[1,2]
解释:
50 的二进制表示是 110010。
在下标 1,4,5 对应的值为 1。
示例 2:
输入:n = 2
输出:[0,1]
... | ALGO | 0.999909 | 5.529922 | {
"github_metadata": {
"branch": "main",
"commit_count": 95,
"repo_created_at": "2025-02-12T03:52: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": "65f0285ae62... |
2f226bc3-f602-459e-a838-e842d2d6d831 | kundan6930/coding_contest | codeforces/Codeforces Round 916 (Div. 3)/E_1_Game_with_Marbles_Easy_Version.cpp | #include <bits/stdc++.h>
using namespace std;
using ll = long long;
int main()
{
int t;
cin >> t;
while (t--)
{
ll n;
cin >> n;
vector<ll> a(n), b(n);
vector<pair<ll,ll>> pro_a(n);
for (int i = 0; i < n; i++)
{
cin >> a[i];
}
fo... | ALGO | 0.999996 | 3.828299 | {
"github_metadata": {
"branch": "main",
"commit_count": 7,
"repo_created_at": "2024-02-09T17:42: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": "77f9e3119057... |
504ff354-10df-4954-8684-b46cbec602f8 | Jalanjii/optimalalgocpp | Problems/090.cpp | #include <iostream>
#include <cmath>
//#include <climits>
#include <string>
//#include <algorithm>
using namespace std;
int main() {
freopen("input.txt", "r", stdin);
freopen("output.txt", "w", stdout);
string s, s1 = "", s2 = "";
getline(cin, s);
int len = s.length();
int n, c = 0; cin >> n;
for (int i = 0; i... | ALGO | 0.99973 | 3.330888 | {
"github_metadata": {
"branch": "master",
"commit_count": 73,
"repo_created_at": "2021-01-30T02:43: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": "9879a1e16... |
be381dba-4858-4e47-a6f2-9602830f2f4c | Autokaka/C-Single-Ranking | ACM/南工大2018-暑期实训6/大佬们的代码/NJTECH2018-SHUJIASHIXUN 1003.cpp | #include <cmath>
#include <iostream>
#include <cstring>
#include <string>
#include <algorithm>
#include <cstdio>
#include <vector>
#include <set>
#include <map>
using namespace std;
#define mod 1000000007
const int maxn = 100010;
typedef long long ll;
ll n;
#define A 4
struct Matrix{
ll a[A][A];
};
Matrix mul(Ma... | ALGO | 0.999957 | 3.728359 | {
"github_metadata": {
"branch": "master",
"commit_count": 15,
"repo_created_at": "2019-03-17T01:13: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": "53d15ad29... |
6eed88ee-4d23-4416-8f3a-b248265f2e48 | smhuang426/ImageProcess | FrameDifferenceMethod/FrameDifferenceMethod/FrameDifferenceMethod.cpp | //
// main.cpp
// Moving_Object_Tracking
//
// Created by Noah on 2015/12/26.
// Copyright © 2015年 Noah. All rights reserved.
//
#include <iostream>
//#include <opencv/cv.h>
//#include <opencv/highgui.h>
#include <opencv2/opencv.hpp>
using namespace cv;
using namespace std;
//our sensitivity value to be used in ... | ALGO | 0.956664 | 5.051522 | {
"github_metadata": {
"branch": "master",
"commit_count": 4,
"repo_created_at": "2016-01-17T10:24: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": "9dacfb20fc... |
98e04fa6-bed2-4645-b01f-533fa9f5cf08 | RPerobeli/AlgoritmosED | Aula2/Aula2Qt/Aula2Criptografia/main.cpp | #include <QCoreApplication>
#include <stdio.h>
#include <iostream>
#include <limits>
using namespace std;
int row=0, column=0;
int Matriz[5][5] = {
{12, 13, 14, 15, 16},
{11, 2, 3, 4, 17},
{10, 1, 0, 5, 18},
{9, 8, ... | ALGO | 0.991259 | 3.649849 | {
"github_metadata": {
"branch": "master",
"commit_count": 19,
"repo_created_at": "2020-07-23T14:53:36.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "41d6a9f82... |
614e0086-f242-4a8f-a037-66bf5bb8ca3a | raincross7/code-similarity | codes/train_code/problem245/problem245_247.cpp | #include <bits/stdc++.h>
typedef long long ll;
using namespace std;
#define repr(i,a,b) for(int i=a;i<b;i++)
#define rep(i,n) for(int i=0;i<n;i++)
#define invrepr(i,a,b) for(int i=b-1;i>=a;i--)
#define invrep(i,n) invrepr(i,0,n)
#define repitr(itr,a) for(auto itr=a.begin();itr!=a.end();++itr)
#define P pair<int,ll>
con... | ALGO | 0.999989 | 3.981604 | {
"github_metadata": {
"branch": "main",
"commit_count": 3,
"repo_created_at": "2024-03-06T05:07: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": "0b308c743aaa... |
3ece43eb-dc4d-4007-96aa-2aa2f44151f4 | LLSwillow/cpp.study | 6.1/03set.cpp | #include <iostream>
#include <set>
#include <unordered_set> //不自动排序
using namespace std;
set<int> a; // set容器 自动去重 且自动排序
unordered_set<int> b; // 不排序
int main()
{
a.insert(4);
a.insert(4);
a.insert(9);
a.insert(1);
for (int x : a)
{
cout << x;
}
cout << endl;
b.ins... | ALGO | 0.96557 | 3.314843 | {
"github_metadata": {
"branch": "master",
"commit_count": 19,
"repo_created_at": "2023-05-16T08:49: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": "1f588ef68... |
f3eab24d-06fc-4d89-ba6d-77e3430459d0 | delphi001/DelphiPka | src/delphi/solver/solver_fastSOR_initOddEvenItr.cpp | /*
* solver_fastSOR_initOddEvenItr.cpp
*
* Created on: Feb 5, 2014
* Author: chuan
*/
#include "solver_fastSOR.h"
void CDelphiFastSOR::initOddEvenItr(const int& forWhom)
{
int ix,iy,iz;
delphi_integer ip,iq;
delphi_integer iadd1,iadd2,itemp1,itemp2,star,fin;
/*
* setup periodic boundaries
... | ALGO | 0.999224 | 3.783763 | {
"github_metadata": {
"branch": "master",
"commit_count": 58,
"repo_created_at": "2017-06-05T19:43:49.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 9,
"forks": 5,
"issues": 1,
"pull_requests": 0
},
"file_meta": {
"content_id": "20f268f17... |
64fc148d-b01f-4b83-88f6-c24bf48635aa | sonugiri1043/Cracking-The-Coding-Interview | 17-Hard/10-Majority-Element.cpp | /*
Majority Element:
A majority element is an element that makes up more than half of the items in an array.
Given a positive integers array, find the majority element. If there is no majority element,
return -1. Do this in O( N) time and O( 1) space.
Input: 1 2 5 9 5 9 5 5 5
Output: 5
Solution: Boyer–M... | ALGO | 0.999993 | 6.000445 | {
"github_metadata": {
"branch": "master",
"commit_count": 262,
"repo_created_at": "2019-01-25T06:37:03.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 18,
"forks": 15,
"issues": 0,
"pull_requests": 2
},
"file_meta": {
"content_id": "504336... |
f8147dfc-4d08-4f02-a69b-390d8141b3cc | SiyamX7/codeforces | 2064C.cpp | #include <bits/stdc++.h>
using namespace std;
template <typename T>
void print(const vector<T>& vec) {
for (const auto& val : vec) {
cout << val << " ";
}
cout << endl;
}
#define fast ios::sync_with_stdio(0);cin.tie(0);cout.tie(0);
#define ll long long
#define vi vector<int>
#defi... | ALGO | 0.999974 | 4.691639 | {
"github_metadata": {
"branch": "main",
"commit_count": 17,
"repo_created_at": "2025-02-10T05:40: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": "4289019be4d... |
a8f1f419-cdcf-497b-a94f-3e0d3344032c | HarryNguyen2662/codeKingToan | other/1736C2.cpp | #include<bits/stdc++.h>
using namespace std;
#define NMOD 3
#define fi first
#define se second
#define pb push_back
#define log 18
#define mask(i) (1ll << (i))
#define setp(x) setprecision(x)
#define ALL(v) v.begin(), v.end()
#define ck(n, i) (((n) >> (i)) & 1)
#define getbit(x) __builtin_popcount(x)
const double P... | ALGO | 0.999601 | 3.982928 | {
"github_metadata": {
"branch": "main",
"commit_count": 1,
"repo_created_at": "2022-12-20T15:17: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": "16d021ba99a9... |
52fcf760-90d0-4cbc-86e8-0bc57f9db858 | rahulnagavally/SFND_Unscented_Kalman_Filter | src/ukf.cpp | #include "ukf.h"
#include "Eigen/Dense"
using Eigen::MatrixXd;
using Eigen::VectorXd;
/**
* Initializes Unscented Kalman filter
*/
UKF::UKF() {
// if this is false, laser measurements will be ignored (except during init)
use_laser_ = true;
// if this is false, radar measurements will be ignored (except durin... | ALGO | 0.954457 | 4.831124 | {
"github_metadata": {
"branch": "master",
"commit_count": 1,
"repo_created_at": "2020-12-28T01:02: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": "aa5fc19e93... |
d1c7c34b-2f40-4fa7-a91b-2faa390c522d | Garv2022/DSA-on-Finger-Tips... | Linked List/Linked List Ques/removeDuplicates.cpp | #include <bits/stdc++.h>
using namespace std;
//sorted linked list
Node * uniqueSortedList(Node * head) {
// Write your code here.
if(head == NULL)
{
return NULL;
}
//non-empty list
Node* curr =head;
while(curr!= NULL)
{
if( (cur... | ALGO | 0.999921 | 4.831433 | {
"github_metadata": {
"branch": "main",
"commit_count": 12,
"repo_created_at": "2023-07-12T10:23: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": "90145670599... |
ee7fbec7-9bcd-4b2c-81e9-1bd40874335a | qsc789/experiment | 1/1.2/newtest.cpp | #include"test.h"
void SeqListInit(SL* ps)
{
SeqListPushBack(ps, "NULL", -1, -1);
}
void SeqListPushBack(SL* ps, string name, int x, int y)
{
city temp;
temp.CityName = name;
temp.x = x;
temp.y = y;
(ps->a).push_back(temp);
}
void SeqListInsert(SL* ps, int pos, string str, int x, int y)
{
//int end = ps->size - ... | ALGO | 0.998034 | 3.569145 | {
"github_metadata": {
"branch": "main",
"commit_count": 27,
"repo_created_at": "2024-04-06T12:37:26.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "9fe4b004048... |
63082b6c-4303-4088-a380-cef5bff083b0 | BallisticLA/RandBLAS | RandBLAS/sparse_data/coo_matrix.hh | // Copyright, 2024. See LICENSE for copyright holder information.
//
// Redistribution and use in source and binary forms, with or without
// modification, are permitted provided that the following conditions are met:
//
// (1) Redistributions of source code must retain the above copyright notice,
// this list of condi... | TOOL | 0.962694 | 7.541927 | {
"github_metadata": {
"branch": "main",
"commit_count": 498,
"repo_created_at": "2021-12-07T19:47:32.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 92,
"forks": 10,
"issues": 11,
"pull_requests": 2
},
"file_meta": {
"content_id": "7ca55f4a... |
845b05f8-9ecc-4bbe-a685-5e2fe8dcf6ae | rioyokotalab/FRANK | src/classes/hierarchical.cpp | #include "FRANK/classes/hierarchical.h"
#include "FRANK/classes/dense.h"
#include "FRANK/classes/low_rank.h"
#include "FRANK/classes/matrix.h"
#include "FRANK/classes/matrix_proxy.h"
#include "FRANK/classes/initialization_helpers/cluster_tree.h"
#include "FRANK/classes/initialization_helpers/matrix_initializer.h"
#inc... | ALGO | 0.966643 | 6.339855 | {
"github_metadata": {
"branch": "master",
"commit_count": 1230,
"repo_created_at": "2018-02-28T06:00:21.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 2,
"forks": 2,
"issues": 11,
"pull_requests": 0
},
"file_meta": {
"content_id": "65a51e5... |
50c54f76-2aef-4417-b444-e4345f7f2544 | dameness/algoritmos2-cpp | atividades etapa 1/atividade_2_bernardo_damiani/ex7.cpp | #include <iostream>
#include <cstring>
using namespace std;
/*
Escreva um programa que recebe uma string qualquer do usuário e imprime a
mesma string em três formatos: todas as letras em maiúsculo, todas as letras em
minúsculo e somente as letras iniciais de cada palavra em maiúsculo o restante em
minúsculo.
*/
int ma... | TOOL | 0.983953 | 4.363148 | {
"github_metadata": {
"branch": "main",
"commit_count": 96,
"repo_created_at": "2023-02-27T14:14: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": "34df3259138... |
4758c9da-b9bb-46d3-8529-e4c60617086d | sh54/BlueprintSorting | Source/BlueprintSorting/Private/BPCHandler_BubbleSortArray.cpp | #include "CoreMinimal.h"
#include "BPCHandler_BubbleSortArray.h"
#include "BPCHandler_BaseSortArray.h"
#include "BPNode_BaseSortArray.h"
#include "Engine/Blueprint.h"
#include "Engine/MemberReference.h"
#include "Engine/BlueprintGeneratedClass.h"
#include "EdGraph/EdGraph.h"
#include "EdGraphSchema_K2.h"
#include "K2N... | ALGO | 0.999262 | 6.987917 | {
"github_metadata": {
"branch": "master",
"commit_count": 5,
"repo_created_at": "2017-05-01T07:22:24.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 16,
"forks": 5,
"issues": 0,
"pull_requests": 1
},
"file_meta": {
"content_id": "06e616136... |
4d548aa3-57ce-4eb5-8435-b113ba9a6da9 | malibinYun/algorithm | BOJ/BOJ_2775.cpp | #pragma warning(disable: 4819)
// 2775 부녀회장이 될테야
//
//문제
// 평소 반상회에 참석하는 것을 좋아하는 주희는 이번 기회에 부녀회장이 되고 싶어 각 층의 사람들을 불러 모아 반상회를 주최하려고 한다.
// 이 아파트에 거주를 하려면 조건이 있는데, “a층의 b호에 살려면 자신의 아래(a-1)층의 1호부터 b호까지 사람들의 수의 합만큼 사람들을 데려와 살아야 한다” 는 계약 조항을 꼭 지키고 들어와야 한다.
// 아파트에 비어있는 집은 없고 모든 거주민들이 이 계약 조건을 지키고 왔다고 가정했을 때, ... | ALGO | 0.999755 | 4.91989 | {
"github_metadata": {
"branch": "master",
"commit_count": 183,
"repo_created_at": "2019-07-17T06:02: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": "489ef3a4... |
ba08e47a-f348-4432-a738-f698f8925723 | sheikh-arman/Competitive_Programming | Practice/codeforces/test.cpp | <<<<<<< HEAD
#include<stdio.h>
int main(){
int n;
scanf("%d", &n);
for( int i=1; i<=n; i++){
int num;
int c = 0;
scanf("%d", &num);
if(num==1){
c=c+2;
}
else if(num%3==0){
c = c+(num/3);
}
else if(num%3==1){
... | ALGO | 0.99979 | 3.144594 | {
"github_metadata": {
"branch": "master",
"commit_count": 798,
"repo_created_at": "2020-02-27T18:46: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": "05bd00e1... |
a4fcb450-9d7d-4e92-99b8-ba3e821d6591 | david-moravec/homeworks | satelit/main.cpp | #include <iostream>
#include <vector>
#include <cmath>
#include <fstream>
#include <stdlib.h>
#include "src/tangentAprox.hpp"
#include "src/ODEstruct.hpp"
double pythagoras(const double& a, const double& b) {
double c;
c = sqrt(pow(a, 2) + pow(b, 2));
return c;
}
double Energy(const ODEstruct& X) {
double E;... | ALGO | 0.999986 | 4.120626 | {
"github_metadata": {
"branch": "master",
"commit_count": 9,
"repo_created_at": "2020-05-10T07:47: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": "fc00f41972... |
efd4fad3-1dc1-4b3d-b187-33bc07a05775 | Huxingyu/Code_practice | Chapter 8/4_BST/004.cpp | //PAT A1043
//这道题目(内存/&)用的很活,学习到了
#include <stdio.h>
#include <stdlib.h>
#include <vector>
#define max 10
using namespace std;
struct node{
int data;
node* lchild;
node* rchild;
};
void insert(node* &root,int x){
if(root==NULL){
root=new node; //e1-非法的内存访问
root->data=x;
... | ALGO | 0.999998 | 4.117802 | {
"github_metadata": {
"branch": "master",
"commit_count": 130,
"repo_created_at": "2020-02-21T13:11: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": "d64642e8... |
67af57ca-7829-498e-b2d9-d71de41526d2 | adithya-subramani/IT5008-COMPUTER_GRAPHICS | UNIT-1/line-clipping/cohen-sutherland.cpp | #include ".././line-drawing/DDA.cpp"
#include <stdlib.h>
#include <stdio.h>
#include <GL/gl.h>
#include <GL/glut.h>
// Clipping window coordinates
int w_x0=150,w_y0=100,w_x1=450,w_y1=400;
// Starting and ending point of line
int xs=30,ys=30,xe=500,ye=480;
void myInit(void)
{
glClearColor(0.0, 0.0, 0.0, 0.0);
... | ALGO | 0.999732 | 5.395518 | {
"github_metadata": {
"branch": "main",
"commit_count": 2,
"repo_created_at": "2023-02-11T09:41: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": "286e394687dc... |
04e4014a-ffe6-4132-8df4-b691c3237ae4 | alexandraback/datacollection | solutions_2463486_0/C++/kouri128/C.cpp | #include <iostream>
#include <vector>
#include <cmath>
using namespace std;
typedef long long ll;
bool isFairNumber(ll n)
{
ll m = 0;
ll t = n;
while (t > 0)
{
m = m * 10 + t % 10;
t /= 10;
}
return n == m;
}
void getFairNumbers(vector<ll>& table, ll begin, ll end)
{
for... | ALGO | 0.999607 | 5.057859 | {
"github_metadata": {
"branch": "master",
"commit_count": 58,
"repo_created_at": "2017-03-08T11:33:58.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 4,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "5b2683668... |
974b77fa-a6b9-4fde-b3b6-176e61866ecf | dharmendramehta622/numerical-method | rugla-false-method(false-position-method)/main.cpp | #include<iostream>
#include<iomanip>
#include<math.h>
/*
Defining equation to be solved.
Change this equation to solve another problem.
*/
#define f(x) cos(x) - x * exp(x)
using namespace std;
int main()
{
/* Declaring required variables */
float x0, x1, x, f0, f1, f, e;
int step = 1;
/* Setting precisio... | ALGO | 0.999981 | 4.569531 | {
"github_metadata": {
"branch": "master",
"commit_count": 17,
"repo_created_at": "2024-08-22T02:11:19.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "540d391f2e... |
712b7078-5a8a-4cd9-a18b-bc5e683200a1 | sandychn/Programming-Contest-Practice | ACM/Codeforces/Pratice/274A-CFR168-Div1-R1600.cpp | #include <bits/stdc++.h>
using namespace std;
typedef long long LL;
typedef long double LD;
typedef unsigned long long ULL;
const int INF = 0x3F3F3F3F;
const LL INFLL = 0x3F3F3F3F3F3F3F3FLL;
const LL MOD = 1e9 + 7;
#ifdef _LOCAL
#include "locals.h"
#else
#define show(...)
#endif
int main() {
int n, k;
vector... | ALGO | 0.999961 | 3.672667 | {
"github_metadata": {
"branch": "master",
"commit_count": 81,
"repo_created_at": "2019-07-26T01:45: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": "18d8d84c9... |
98bf56cb-3220-4c08-9078-df0f0635f5b5 | colinotp/quaternion-sequences | cpp/generate_matching_instances.cpp | #include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <stdbool.h>
#include <time.h>
#include <fftw3.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <array>
#define MAX_N 70
//#define PRINT_PSDS
double* fft_signal;
fftw_complex* fft_result;
fftw_plan plan;
int paf(const int n, const int* A, con... | ALGO | 0.99747 | 4.00759 | {
"github_metadata": {
"branch": "main",
"commit_count": 90,
"repo_created_at": "2023-05-26T21:19:04.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 3,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "9068bc0be5e... |
f01cda68-4e67-49b7-88c1-79062ea7788f | Ausp3x/competitive-programming | [5] NOI.PH Training 2024/[5] ABaKoDa 2024/D. Deerly Departed.cpp | // 人外有人,天外有天
// author: Ausp3x
#pragma GCC optimize("O3, fast-math")
#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
using namespace std;
using namespace __gnu_pbds;
#define fi first
#define se second
#define pb push_back
// #define DEBUG
typedef long long lng;
typedef __int128 lll;
template<... | ALGO | 0.999997 | 3.828925 | {
"github_metadata": {
"branch": "main",
"commit_count": 37,
"repo_created_at": "2023-04-28T14:29: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": "77e78ce27a2... |
f8e0cd96-b676-499a-a8cc-06549e362082 | Anubhav12345678/competitive-programming | CHEFLIKESGOODSEQUENCESCODECHEFVVVVVIMPGREEDY.cpp | #include <bits/stdc++.h>
using namespace std;
#define ll long long
int main() {
ios_base::sync_with_stdio(false);
cin.tie(NULL);
ll i,j,k,l,n,t;
cin>>t;
while(t--)
{
ll q;
cin>>n>>q;
ll a[n];
for(i=0;i<n;i++) cin>>a[i];
ll ans=1;
for(i=1;i<n;i++)
if(a[i]!=a[i-1]) ans++;
while(q--)
{
ll x,y... | ALGO | 0.999652 | 3.697726 | {
"github_metadata": {
"branch": "master",
"commit_count": 1,
"repo_created_at": "2020-11-18T08:04:21.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "0b111cb41d... |
720162b1-5298-443d-8dbb-3204264a943d | technolapin/sable | pink/src/python/pymedianfilter.cpp | /*
This software is licensed under
CeCILL FREE SOFTWARE LICENSE AGREEMENT
This software comes in hope that it will be useful but
without any warranty to the extent permitted by applicable law.
(C) UjoImro, 2009-2010
Université Paris-Est, Laboratoire d'Informatique Gaspard-Monge, Equipe A3SI, ESIEE Par... | TOOL | 0.926881 | 5.916801 | {
"github_metadata": {
"branch": "master",
"commit_count": 550,
"repo_created_at": "2019-05-06T09:42:28.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2,
"forks": 2,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "cb507059... |
5d5a2a6c-032b-467b-af33-12e7793ca534 | Aman0106/DSA-Learning | Love Babbar DSA/Algorithms/QuickSort.cpp | #include <iostream>
#include <vector>
using namespace std;
void printArray(vector<int> &arr, int n){
for(int i=0; i<n; i++){
cout<<arr[i]<<" ";
}
cout<<endl;
}
int partition(vector<int>& arr, int start, int end){
int pivot = arr[start];
int count = 0;
for(int i=start+1; i<=en... | ALGO | 0.999991 | 5.830411 | {
"github_metadata": {
"branch": "master",
"commit_count": 81,
"repo_created_at": "2022-06-07T12:39: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": "6e4470c62... |
532c6dd6-d76a-4a48-bda7-d42c6fcf423d | Tharun212/DSA | stack/postfix evaluation.cpp | #include <stdio.h>
#include <stdlib.h>
#include <ctype.h>
#define MAX_SIZE 100
typedef struct{
int stack[MAX_SIZE];
int top;
} Stack;
void push(Stack *s, int value)
{
if (s->top==MAX_SIZE-1)
{
printf("Stack overflow\n");
exit(1);
}
s->stack[++s->top]=value;
}
int pop(Stack*s)
{
... | ALGO | 0.99972 | 3.887182 | {
"github_metadata": {
"branch": "main",
"commit_count": 21,
"repo_created_at": "2023-08-31T17:18: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": "626aa79c565... |
542608ef-6124-4808-8039-931486832d8f | dragonslayerv2/Competitive-Programming | codechef/turbosort.cpp | #include<stdio.h>
#include<string.h>
#define MAX 1000010
#define MAXFLAGS MAX/32+1
int flags[MAXFLAGS];
#define isSet(n) (flags[n>>5]&(1<<(n&31)))
#define unset(n) (flags[n>>5] &= ~(1<<(n&31)))
#define set(n) (flags[n>>5]|=(1<<(n&31)))
#define GETCHAR getchar_unlocked
#define PUTCHAR putchar_unlocked
inline int rea... | ALGO | 0.999824 | 3.460007 | {
"github_metadata": {
"branch": "master",
"commit_count": 94,
"repo_created_at": "2014-01-16T18:08:00.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 14,
"forks": 5,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "a3ca2904... |
2027abbc-87ab-4295-9cae-f849b56e0ea0 | aqfaridi/Competitve-Programming-Codes | SPOJ/SPOJ/TANGLED.cpp | #include <iostream>
#include <cstdio>
#include <cstring>
#include <cmath>
#include <cstdlib>
#include <climits>
#include <cassert>
#include <iomanip>
#include <vector>
#include <utility>
#include <map>
#include <set>
#include <list>
#include <stack>
#include <queue>
#include <deque>
#include <bitset>
#include <complex>... | ALGO | 0.999842 | 3.217958 | {
"github_metadata": {
"branch": "master",
"commit_count": 3,
"repo_created_at": "2016-02-14T20: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": "b169a61929... |
b2c95fb5-ba1a-4622-bd41-6928124bcf94 | aammya8/Digital_Media_Database | main.cpp | //Project Description: Create a database that includes video games, music, and movies. Allow user to add, search, and delete database items.
//Name: <NAME>
//Date: 3-13-2021
//------------------------------------------------------------MAIN CLASS------------------------------------------------------------
#include ... | TOOL | 0.929209 | 3.308965 | {
"github_metadata": {
"branch": "main",
"commit_count": 3,
"repo_created_at": "2021-03-14T08:32: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": "01ad274ed654... |
fc88d795-80ad-4ab9-a069-47200d0963bb | ruanchristian/competitive-programming | Codeforces/1528A.cpp | #include <bits/stdc++.h>
using namespace std;
// Problema: Parsa's Humongous Tree
#define ll long long
#define all(x) x.begin(), x.end()
const int MAX = 1e5+1;
int n, l, r, v[MAX][2];
ll dp[MAX][2];
vector<int> g[MAX];
void dfs(int u) {
for (int v : g[u]) {
g[v].erase(find(all(g[v]), u));
dfs(... | ALGO | 0.999863 | 4.258531 | {
"github_metadata": {
"branch": "master",
"commit_count": 7,
"repo_created_at": "2023-07-23T03:35:12.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "3f1111d524... |
714f1f59-3015-43a6-adcb-f0d171ceba7e | gddavis21/CarND-Term2-Unscented-Kalman-Filter | src/ukf.cpp | #include "ukf.h"
#include "Eigen/Dense"
#include <iostream>
using namespace std;
using Eigen::MatrixXd;
using Eigen::VectorXd;
using Eigen::Vector2d;
static const double PI = acos(-1.0);
static const int STATE_DIM = 5;
static const int AUG_STATE_DIM = STATE_DIM + 2;
static const int NUM_SIGMA_PTS = 2*AUG_STATE_DIM + ... | ALGO | 0.978277 | 7.030986 | {
"github_metadata": {
"branch": "master",
"commit_count": 15,
"repo_created_at": "2018-03-18T19:23: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": "0f9e2d624... |
72694649-73df-435a-8955-9550aa7f4089 | porag525/Algorithms | Sorting And Searching/Sorting/Selection_Sort.cpp | /*
Author : <NAME>
Date of Creation: 19 January 2024
##################
# Selection Sort #
##################
-----------------
Time Complexity:
-----------------
Best Case : Ω(n^2)
Average Case : θ(n^2)
Worst Case: O(n^2)
------------------
Space Complexity:
----------------... | ALGO | 0.999959 | 5.887821 | {
"github_metadata": {
"branch": "main",
"commit_count": 4,
"repo_created_at": "2023-12-12T05:17:06.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "c039c0816577... |
e963683c-13c9-4e8f-b473-60b25df3f216 | rishitkhare/3DRenderer | render.cpp | #include "render.h"
/*
* Take an array of triangles (in world space)
* and converts them all into screen space (z=0).
*/
void convertToWindowCoordinates(Tri *meshdata, int triCount, Tri *screenSpaceData, Camera c) {
for(int i = 0; i < triCount; i++) {
// TODO perform space transformations
// (... | ALGO | 0.979246 | 5.007577 | {
"github_metadata": {
"branch": "main",
"commit_count": 5,
"repo_created_at": "2023-06-14T18:11: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": "7b268b90b8bc... |
fee7d2cb-ebb5-4c63-9f5e-f9fa36250511 | VGL-Op/Learn-DSA-with-VGL | Linked List/Linked List 4/Leetcode725.cpp | //725. Split Linked List in Parts
#include <iostream>
#include <vector>
using namespace std;
// Definition for singly-linked list.
struct ListNode {
int val;
ListNode *next;
ListNode() : val(0), next(nullptr) {}
ListNode(int x) : val(x), next(nullptr) {}
ListNode(int x, ListNode *next) : va... | ALGO | 0.999837 | 5.849177 | {
"github_metadata": {
"branch": "main",
"commit_count": 1,
"repo_created_at": "2023-08-20T09:30:05.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "c6a03541567a... |
c224876b-dbe2-41ab-86ac-01296284064d | Hashish-y/DSA_practise | Data Structures/Arrays/searching/Maximum equilibrium sum in an array M-2.cpp | /*C++ program to find the maximum value of prefix sum which is also suffix for index i in arr[]
Input : arr[] = {-1, 2, 3, 0, 3, 2, -1}
Output : 4
Prefix sum of arr[0..3] = Suffix sum of arr[3..6]
Input : arr[] = {-2, 5, 3, 1, 2, 6, -4, 2}
Output : 7
Prefix sum of arr[0..3] = Suffix sum of arr[3..7] */
#include <b... | ALGO | 0.999986 | 5.372716 | {
"github_metadata": {
"branch": "main",
"commit_count": 36,
"repo_created_at": "2021-01-15T05:48: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": "ddd2425eb1a... |
ccbf6900-fe4e-4ca7-8761-642428ff3b29 | joohyun333/Algorithm_Study_Group | 3주차/파이프 옮기기1/파이프 옮기기 1_cakeme.cpp | #include <iostream>
#include <string>
#include <sstream>
#include <algorithm>
#include <queue>
#include <vector>
#include <array>
#include <map>
#include <unordered_map>
int r, c, N, ans;
int mat[20][20];
void input()
{
std::cin >> N;
for (int y = 1; y <= N; ++y)
{
for (int x = 1; x <= N; ++x)
{
std::cin >>... | ALGO | 0.999839 | 4.426627 | {
"github_metadata": {
"branch": "master",
"commit_count": 287,
"repo_created_at": "2021-03-17T12:48:34.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 1,
"pull_requests": 5
},
"file_meta": {
"content_id": "63358cd7... |
24084bfc-c865-4405-be99-c7f8d416afe8 | ishandutta2007/codeforces-a | alexluchianov/normal/1286/B.cpp | #include <iostream>
#include <vector>
using namespace std;
using ll = long long;
#define MIN(a, b) (((a) < (b)) ? (a) : (b))
#define MAX(a, b) (((a) < (b)) ? (b) : (a))
int const nmax = 2000;
int cost[1 + nmax], sz[1 + nmax], sol[1 + nmax];
bool failure = 0;
vector<int> g[1 + nmax];
void dfs2(int node, int target){... | ALGO | 0.999984 | 3.777435 | {
"github_metadata": {
"branch": "main",
"commit_count": 4,
"repo_created_at": "2024-04-11T00:51:41.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "4b1d4f975d2e... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.