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 |
|---|---|---|---|---|---|---|---|
5c9b0685-9991-4162-8bf2-c40c496d517d | sin-diesel/comp-maths-labs | 2nd-sem/transfer-equation/helper.cpp | #include "helper.hpp"
gtype phi(gtype x) {
return x;
}
gtype psi(gtype t) {
return t;
}
gtype f(gtype t, gtype x) {
return t + x;
}
void angle(matrix::matrix_t<gtype>& grid, std::size_t k, std::size_t m, gtype tau, gtype h) {
std::size_t K = grid.get_rows_number();
grid[k-1][m] = f((K - 1 - k) *... | ALGO | 0.999432 | 4.428946 | {
"github_metadata": {
"branch": "master",
"commit_count": 13,
"repo_created_at": "2021-09-22T17:50:53.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 3,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "059dca96d... |
3aecdfea-e088-43ed-86fe-23a813cc5248 | viren-sureja/Love-Babbar-450 | 10_stack_and_queues/32_distance_of_nearest_cell_having_1.cpp | /*
link: https://practice.geeksforgeeks.org/problems/distance-of-nearest-cell-having-1-1587115620/1
sol: https://www.geeksforgeeks.org/distance-nearest-cell-1-binary-matrix/
*/
// ----------------------------------------------------------------------------------------------------------------------- //
/*
... | ALGO | 0.999966 | 5.400115 | {
"github_metadata": {
"branch": "master",
"commit_count": 49,
"repo_created_at": "2021-03-21T14:17:49.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 356,
"forks": 169,
"issues": 0,
"pull_requests": 1
},
"file_meta": {
"content_id": "a8c22... |
e1434b85-9c8f-42e5-a2bd-7c092c909454 | minigalaxy/Baekjoon | cpp/17070/main.cpp | #include <iostream>
#include <queue>
using namespace std;
int N;
bool house[16][16];
int memory[16][16][3] = { 0, };
int dp(int x, int y, int d){
if(memory[x][y][d] > 0) return memory[x][y][d];
for(int i = d - 1; i <= d + 1; i++){
if(i == 0 && x + 1 < N && !house[x + 1][y]) memory[x][y][d] += dp(x... | ALGO | 0.999879 | 4.413394 | {
"github_metadata": {
"branch": "main",
"commit_count": 68,
"repo_created_at": "2025-03-26T02:08: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": "b593942de1d... |
21a519f7-4606-4644-ad76-a2ac8cc42821 | Sunnykumar7/OOPS | areaofcircle.cpp | #include<iostream>
using namespace std;
class Circle {
private:
float radius;
const float PI = 3.14;
static int count;
public:
Circle() {
radius = 0.0;
count++;
}
Circle(float r) {
radius = r;
count++;
}
... | TOOL | 0.967181 | 6.19977 | {
"github_metadata": {
"branch": "main",
"commit_count": 16,
"repo_created_at": "2024-08-13T05:29:56.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "4a19bbbbadf... |
ec3bedad-b9eb-43a5-8aed-4bec342314e7 | shibam-debnath/Leetcode | Cheapest Flights Within K Stops.cpp | // <NAME>
// June ,2022
#include <bits/stdc++.h>
using namespace std;
#define ll long long
class Solution
{
public:
int findCheapestPrice(int n, vector<vector<int>> &flights, int source, int dst, int k)
{
vector<vector<pair<int, int>>> G(n);
for (int i = 0; i < flights.size(); i++)
{
... | ALGO | 0.999094 | 4.625049 | {
"github_metadata": {
"branch": "master",
"commit_count": 1359,
"repo_created_at": "2022-05-15T07:04:30.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 1,
"pull_requests": 0
},
"file_meta": {
"content_id": "b5e8abb... |
be5e07e0-dc36-4c12-9f77-d0fdd850325a | shxntanu/BE-Lab-Assignments | DAA/huffman.cpp | #include <iostream>
#include <queue>
#include <vector>
#include <unordered_map>
using namespace std;
struct HuffmanNode {
char data; // Input character
int frequency; // Frequency of the character
HuffmanNode *left, *right; // Left and right children
HuffmanNode(char dat... | ALGO | 0.999998 | 5.547742 | {
"github_metadata": {
"branch": "main",
"commit_count": 71,
"repo_created_at": "2024-09-24T03:57:58.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "4a5a3814c64... |
3bcad639-6d01-4a90-9644-88b5d929d622 | NXIST-backup/algorithm_trans | algorithm_improve/DataStructure/DSU/acwing237.cpp | /*
Problem Name:程序自动分析
algorithm tag:并查集
*/
#include <algorithm>
#include <cmath>
#include <cstdio>
#include <cstring>
#include <iostream>
#include <map>
#include <queue>
#include <unordered_map>
#include <vector>
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
const int INF = 0x3f3f3f... | ALGO | 0.999973 | 4.934803 | {
"github_metadata": {
"branch": "master",
"commit_count": 147,
"repo_created_at": "2023-04-10T02:29:00.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 45,
"forks": 42,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "3f278f... |
9693e4ad-6815-457d-8f84-d29d2970bb12 | csillagg/euler | 17.cpp | #include <iostream>
using namespace std;
int egyjegyu(int szam) {
int ered;
if (szam == 1 || szam == 2 || szam == 6) {
ered = 3;
} else if (szam == 4 || szam == 5 || szam == 9) {
ered = 4;
} else if (szam == 7 || szam == 8 || szam == 3) {
ered = 5;
}
return ered;
}
int ketjegyu (int szam) {
... | ALGO | 0.998108 | 3.179018 | {
"github_metadata": {
"branch": "master",
"commit_count": 17,
"repo_created_at": "2017-12-19T14:44: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": "50c624138... |
65d5442f-37d6-4d7e-917d-03a9815f6cbb | anoopsharma9213/turboc3 | ASSIGN5.CPP | #include<iostream.h>
#include<conio.h>
#include<process.h>
#include<math.h>
class Rectangle{
int x1,x2,x3,x4;
int y1,y2,y3,y4;
public:
Rectangle()
{
set();
}
void set()
{l:
cout<<"Enter (x1,y1) : ";
cin>>x1>>y1;
if((x1<0||x1>20)||(y1<0||y1>20))
{cout<<"Invalid Coordinates !!!\n";
got... | ALGO | 0.988229 | 3.343084 | {
"github_metadata": {
"branch": "main",
"commit_count": 2,
"repo_created_at": "2021-02-13T15:36:50.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "96e5abd02f98... |
d1a33cb3-1211-4899-9edd-9703f8039e47 | dringakn/ROSExamples | src/example_octomap_frontiers_assigner.cpp | #include <actionlib/client/simple_action_client.h>
#include <geometry_msgs/Point.h>
#include <geometry_msgs/PoseStamped.h>
#include <move_base_msgs/MoveBaseAction.h>
#include <move_base_msgs/MoveBaseFeedback.h>
#include <move_base_msgs/MoveBaseResult.h>
#include <nav_msgs/GetPlan.h>
#include <octomap_frontiers/GetFront... | ALGO | 0.994018 | 5.392082 | {
"github_metadata": {
"branch": "master",
"commit_count": 385,
"repo_created_at": "2020-02-08T09:52:16.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 6,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "29f77b37... |
a7393ac2-d64d-4c19-a20e-3c4ae9318c22 | MiniMinja/USACO.GUIDE | bronze/_2016Feb/balancing.cpp | #include <bits/stdc++.h>
struct Point{
int x, y;
Point(int x, int y){
this->x = x;
this->y = y;
}
};
int whichquadrant(Point* p, int x, int y){
if(p->x > x && p->y > y) return 1;
else if(p->x > x && p->y < y) return 2;
else if(p->x < x && p->y < y) return 3;
else if(p->x < x && p->y > y) return 4;
else {
... | ALGO | 0.999951 | 3.790078 | {
"github_metadata": {
"branch": "master",
"commit_count": 54,
"repo_created_at": "2021-05-19T01:36: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": "8eb914880... |
cacf000a-0e4b-405c-9623-289d96025d82 | AndreasFMueller/SeminarSpezielleFunktionen | buch/chapters/110-elliptisch/images/slcl.cpp | /*
* slcl.cpp
*
* (c) 2022 Prof Dr <NAME>, OST Ostschweizer Fachhochschule
*/
#include <cstdlib>
#include <cstdio>
#include <cmath>
#include <iostream>
#include <fstream>
#include <sstream>
#include <getopt.h>
#include <vector>
#include <gsl/gsl_sf_elljac.h>
namespace slcl {
static struct option longopts[] {
{ "o... | TOOL | 0.970942 | 5.52454 | {
"github_metadata": {
"branch": "master",
"commit_count": 1108,
"repo_created_at": "2021-01-12T16:46:38.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2,
"forks": 24,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "9aed62... |
5e6ad943-e56b-4eae-839c-5597533f2fa1 | Kashikizu/Reverse-Print | Reverse Print.cpp | /*
* @author Kashikizu
* File Creation Date: 23/04/2024 (dd/mm/yyyy)
* Initial Date: 23/04/2024
*/
#include <bits/stdc++.h>
using namespace std;
void printVect(vector<int> a)
{
int n = a.size();
for (int i = 0; i < n; i++)
{
cout << a[i] << " ";
}
cout << endl;
}
vector<int> setVector... | ALGO | 0.99798 | 5.187531 | {
"github_metadata": {
"branch": "main",
"commit_count": 2,
"repo_created_at": "2024-04-22T18:20: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": "350a1e2c430d... |
48c10d92-1b46-4103-95b1-70a65406f306 | yaowalukth/HW | HW5/HW5-9.cpp | /*
ผู้ใช้กรอกพิกัดจำนวน 2 จุดลงในโปรแกรม ให้คุณเขียนโปรแกรมคำนวณหาจุดกึ่งกลางของ 2 จุดนี้
Test case:
Input A Point :
2 2
Input B Point :
4 4
Output:
Mid Point of A and B is ( 3.0, 3.0 )
Test case:
Input A Point :
-3 9
Input B... | ALGO | 0.99882 | 4.844788 | {
"github_metadata": {
"branch": "main",
"commit_count": 104,
"repo_created_at": "2024-07-19T02:58: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": "5e762736c9... |
53d8d622-e085-4265-ba3a-237574e5c72e | ayushpatel5475/DSA-GFG-CODEs | 10. Strings/04_Pallindrome_Check_of_String.cpp | #include <iostream>
#include <string>
#include <algorithm>
using namespace std;
// Pallindrome Check
/*
//naive
bool isPal( string str){
string rev=str;
reverse(rev.begin(), rev.end());
return ( rev==str); //if rev is same as str then return True else false
}
*/
// efficient
bool isPal(string &str) // by... | ALGO | 0.999004 | 5.227023 | {
"github_metadata": {
"branch": "main",
"commit_count": 8,
"repo_created_at": "2024-03-05T11:45: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": "8bf1ee1bcfbd... |
1c0a1484-b1d0-4c34-85a2-54b479754faa | Motitory/code_with_euler | Iron/Ch02. Ternary Operator/2002.cpp | #include <iostream>
using namespace std;
int main(void)
{
int N;
cin >> N;
int arr[N + 1];
int maxv, minv, far, near, sum;
for (int i = 1; i <= N; i++)
cin >> arr[i];
maxv = minv = far = near = sum = arr[1];
for (int i = 2; i <= N; i++) {
maxv = (maxv < arr[i]) ? arr[i] : maxv;
minv = (minv > arr[i]) ... | ALGO | 0.99997 | 3.26822 | {
"github_metadata": {
"branch": "main",
"commit_count": 35,
"repo_created_at": "2022-09-20T15:46:14.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "93107fd6e0a... |
afcf3959-4fd0-4b5e-9482-ce5e6832e763 | yuvrajSingh-rajput/Complete-Data-Structures-Agorithms | trees/03.cpp | //! Take input level-wise
#include<bits/stdc++.h>
using namespace std;
template<typename T>
class TreeNode{
public:
T data;
vector<TreeNode<T>*> children;
TreeNode(int data){
this->data = data;
}
};
TreeNode<int>* takeInputLevelwise(){
int rootData;
cout << "Enter the root data of ... | ALGO | 0.999808 | 3.796226 | {
"github_metadata": {
"branch": "main",
"commit_count": 101,
"repo_created_at": "2024-05-06T00:49:36.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "c3a2a7206a... |
b0182f88-e9bd-4bf5-aac2-6f4187dcc8ab | sanchit339/Strivers-SDE-Sheet | Main.cpp | /**
* @file Main.cpp
* @author ATCoder DP Contest
*
* @brief DP 1 and 1 _ 1 step
*
* @version 0.1
* @date 2023-08-21
*
* @copyright Copyright (c) 2023
*
*/
#include<bits/stdc++.h>
using namespace std;
class Solution {
public:
bool isPrime(string s){
int n = stoi(s);
for(int i = 2 ; ... | ALGO | 0.999987 | 4.636987 | {
"github_metadata": {
"branch": "main",
"commit_count": 129,
"repo_created_at": "2023-07-21T14:04:24.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "8dd4936fd8... |
07adb53d-b137-4850-b0da-cf03725494ff | yuyoyuppe/ckvs | src/ckvs/bptree.hpp | #pragma once
#include <cinttypes>
#include <memory>
#include <queue>
#include <optional>
#include <array>
#include <tuple>
#include <variant>
#include "detail/bptree_detail.hpp"
#include "utils/traits.hpp"
#include "utils/math.hpp"
#include "utils/common.hpp"
#include "utils/backoff.hpp"
//#define VERBOSE_INSPECT
i... | TOOL | 0.962668 | 7.521609 | {
"github_metadata": {
"branch": "dev",
"commit_count": 14,
"repo_created_at": "2019-07-23T18:57:33.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 7,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "c78aa6a6232d... |
105da396-f6c7-4a0d-9ba3-28e84e33c774 | Raaaaaahul/geekforgeeks | trees/constructTree.cpp | #include<bits/stdc++.h>
using namespace std;
struct Node{
int key;
Node* left;
Node* right;
Node(int x)
{
key = x;
left = NULL;
right = NULL;
}
};
int preIdx = 0;
Node* cTree(vector<int>& in,vector<int>& pre,int st,int end)
{
if(st>end)
{
return NULL;
... | ALGO | 0.999997 | 5.416989 | {
"github_metadata": {
"branch": "master",
"commit_count": 53,
"repo_created_at": "2023-02-17T09:04:48.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 4,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "adbb57d22... |
94109f5e-a93c-444a-a3d2-81f08c41227d | google-research/google-research | sparse_user_encoders/trie.h | // Copyright 2025 The Google Research Authors.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law... | ALGO | 0.998596 | 7.585319 | {
"github_metadata": {
"branch": "master",
"commit_count": 4832,
"repo_created_at": "2018-10-04T18:42:48.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 36026,
"forks": 8143,
"issues": 1061,
"pull_requests": 576
},
"file_meta": {
"content_id... |
6f26ab52-de51-48b2-b4c0-471b60be3778 | yannAbouJaoude/Myrepo | UC Riverside/CS012/PROGRAM6/V3/main.cpp | #include <iostream>
using namespace std;
bool diophantine(int a, int b, int c, int &x, int &y);
int PGCD(int a, int b);
int main() {
int a, b, c, x, y;
cout << "Enter a b c" << endl;
cin >> a >> b >> c;
cout << endl;
cout << "Result: ";
if (diophantine(a, b, c, x, y)) {
cout << x <<... | ALGO | 0.999986 | 4.605371 | {
"github_metadata": {
"branch": "master",
"commit_count": 26,
"repo_created_at": "2019-10-25T17:19:42.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "44e0d8162... |
e32322e8-6420-4154-990c-50053c1645d6 | nafi103/Solved-Problems | CSES/Investigation.cpp | #include<bits/stdc++.h>
#include<ext/pb_ds/assoc_container.hpp>
#include<ext/pb_ds/tree_policy.hpp>
using namespace std;
using namespace chrono;
using namespace __gnu_pbds;
/****************************************************************/
#define int long long
#define pi acos(-1.0)
#define mod 1000000007
#define in... | ALGO | 0.999976 | 3.93083 | {
"github_metadata": {
"branch": "main",
"commit_count": 224,
"repo_created_at": "2024-09-04T14:52: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": "4b9e608e3f... |
7154738e-6864-442e-bfbb-cf785dbd1298 | pnthi160403/compettive_programming | test/cf/1_test/3_bai_3_div_1851_C/main.cpp | #include <bits/stdc++.h>
#define ll long long
#define endl '\n'
using namespace std;
int32_t main() {
ios::sync_with_stdio(false); cin.tie(0); cout.tie(0);
int t;
cin >> t;
while(t--) {
int n, k;
cin >> n >> k;
vector<int> a(n);
for(int &x : a)
cin >> x;
... | ALGO | 0.999825 | 4.206066 | {
"github_metadata": {
"branch": "main",
"commit_count": 6,
"repo_created_at": "2023-10-21T05:05: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": "23d49b5a2497... |
7c171f51-8c17-4a7a-8c1d-1cfbaa931ada | amurube/Beginning_Cpp_Programing | Section10/Challange/main.cpp | /*
A simple very old method of sending secret messages is the substitution cipher.
You might have used this cipher with your friends when you were a kid.
Basically, each letter of the alphabet gets replaced by another letter of the alphabet.
For example, every 'a' gets replaced with an 'X', and every 'b' gets replaced ... | ALGO | 0.999419 | 5.39898 | {
"github_metadata": {
"branch": "main",
"commit_count": 6,
"repo_created_at": "2021-08-31T18:01:14.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "3371d7b286e8... |
cb62c707-2791-4b17-a851-52f01239f6fd | sahilsujeet1/DSA-Practice | Code Help Questions/Graphs/shortestPathInUnweightedGraph.cpp | #include <bits/stdc++.h>
using namespace std;
vector<int> shortestPath( vector<pair<int,int>> edges , int n , int m, int s , int t){
// Write your code here
unordered_map<int, list<int>> adj;
unordered_map<int, bool> visited;
unordered_map<int, int> parent;
for(int i=0; i<edges.size(); i++) {
... | ALGO | 0.999995 | 5.354426 | {
"github_metadata": {
"branch": "master",
"commit_count": 204,
"repo_created_at": "2022-03-10T18:30: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": "bee4d20d... |
ad3d0907-fdaa-4203-8d17-30f7cfb704a0 | mehrab2603/Solved-Problems | UVa/11624 - Fire!.cpp | #include <bits/stdc++.h>
#define MAX 1000
using namespace std;
int dirx[] = {0, 0, -1, 1};
int diry[] = {-1, 1, 0, 0};
int r, c;
struct square
{
int x, y; square() {} square(int a, int b) {x = a; y = b;}
};
string mat[MAX];
vector<square> fire;
int ft[MAX][MAX];
void ftcalc();
int bfs(square);
int main()
{
in... | ALGO | 0.999941 | 4.269279 | {
"github_metadata": {
"branch": "master",
"commit_count": 3,
"repo_created_at": "2017-05-23T10:51: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": "171b1f6fdb... |
4bf72cb7-8258-4752-b13d-bbc159916bf8 | lucaskijs/algorithm | 접시 닦기 (한글과컴퓨터학원 3회차 오후 모의고사 - 중등부).cpp | /*
문제
설거지는 씻기와 건조하기의 총 두 단계에 걸쳐 진행된다.
정올이의 주방에는 접시를 쌓을 수 있는 공간이 세 군데 있다.
첫 번째 공간은 설거지가 필요한 접시들이 쌓여있는 공간이고,
두 번째 공간은 씻겨진 접시가 쌓일 공간이며,
세 번째 공간은 건조가 끝난 접시가 쌓일 공간이다.
첫 번째 공간에는 1부터 N까지 번호가 매겨진 N개의 접시가 번호가 큰 접시부터 낮은 접시까지 아래에서 위로 쌓여있다.
정올이는 i분에 그 중 D_i개의 접시를 씻어서 두 번째 공간에 쌓거나,
D_i개의 씻긴 접시를 건조시켜 세 번째 공간에 쌓는다.
여러 개의 접시를 같은 시간대에... | ALGO | 0.999992 | 3.474414 | {
"github_metadata": {
"branch": "main",
"commit_count": 117,
"repo_created_at": "2024-01-19T09:13: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": "fb3520ba0d... |
cd8d1076-5c1f-4bed-8c01-70653d17dc0b | CodingWithAbdou/cpp | Algorithms_level_two/algo_48.cpp | #include <iostream> // Include iostream for input/output operations.
using namespace std; // Use the standard namespace to simplify usage of standard functions.
int MyFloor(float Number)
{
int IntPart; // Variable to store the integer part of the number.
IntPart = int(Number); // Extract the integer par... | ALGO | 0.987552 | 4.632169 | {
"github_metadata": {
"branch": "main",
"commit_count": 22,
"repo_created_at": "2025-01-04T04:57: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": "44bb6458a59... |
8c2d43a1-3db8-411a-99ac-63e12ebd3952 | Ishwarendra/Contests | CODECHEF/Starters116/F.cpp | #include "bits/stdc++.h"
#ifdef LOCAL
#include "F:\CPP\Debug\debug.h"
#else
#define print(...) 1;
#endif
using i64 = long long;
constexpr int inf = 1e9;
void solve()
{
int n;
std::cin >> n;
std::vector<std::vector<int>> adj(n);
for (int i = 0; i < n - 1; i++)
{
int u, v;
std::ci... | ALGO | 0.9999 | 4.718216 | {
"github_metadata": {
"branch": "main",
"commit_count": 6,
"repo_created_at": "2024-02-11T15:50:17.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "c954eb539d4f... |
e98d2f4b-4123-4b5d-b6cc-3b023360eafb | prabhxjottsingh/abdulbari-dsa | Linked List/Doubly Linked List/insert.cpp | #include <bits/stdc++.h>
using namespace std;
struct Node
{
Node *prev;
int data;
Node *next;
} *first = NULL;
void createDoublyLL(int a[], int size)
{
first = new Node;
first->prev = NULL;
first->data = a[0];
first->next = NULL;
Node *p = first;
Node *temp;
for (int i = 1; i <... | ALGO | 0.99984 | 4.42159 | {
"github_metadata": {
"branch": "master",
"commit_count": 50,
"repo_created_at": "2021-09-28T05:20:14.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "6141e616f... |
0cc9568b-93b5-4b1f-b00f-aa034b601d38 | roddeval/SortingAnalysis | SortMethods/HeapSort.cpp | #include "pch.h"
#include "HeapSort.h"
// To heapify a subtree rooted with node i which is
// an index in arr[]. n is size of heap
void HeapSort::heapify(int arr[], int n, int i)
{
int largest = i; // Initialize largest as root
int l = 2 * i + 1; // left = 2*i + 1
int r = 2 * i + 2; // right = 2*i + 2 ... | ALGO | 0.99993 | 5.20152 | {
"github_metadata": {
"branch": "master",
"commit_count": 1,
"repo_created_at": "2021-10-18T08:40: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": "f56ab29430... |
517696ce-ae1d-40f5-96ee-e40182302d3a | m-bronnikov/OLIMP | useful_files/connective_components.h | #include <vector>
#include <iostream>
using namespace std;
void dfs1(int v, vector<int>& used, vector<int>& order) {
used[v] = true;
for (size_t i=0; i<g[v].size(); ++i){
if (!used[g[v][i]]){
dfs1(g[v][i]);
}
}
order.push_back(v);
}
void dfs2 (int v, vector<int>& used, vector<int>& component) {... | ALGO | 0.999966 | 4.727163 | {
"github_metadata": {
"branch": "master",
"commit_count": 125,
"repo_created_at": "2019-10-13T15:25: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": "8e388cc5... |
11ae7722-d8dc-49af-9322-983c55bc2dd0 | RosettaCommons/rosetta | source/src/apps/pilot/will/old/pick_normal_sampling.hh | #ifndef INCLUDED_apps_pilot_will_pick_nurmal_sampling_hh
#define INCLUDED_apps_pilot_will_pick_nurmal_sampling_hh
#include <utility/vector1.hh>
int pick_normal_sampling(double tgtcover){
utility::vector1<int> nsamp;
utility::vector1<double> cover_rad;
nsamp.push_back( 72); cover_rad.push_back( 15.144532085111 );... | ALGO | 0.989432 | 5.889005 | {
"github_metadata": {
"branch": "main",
"commit_count": 11737,
"repo_created_at": "2023-11-17T16:42:18.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 296,
"forks": 100,
"issues": 27,
"pull_requests": 9
},
"file_meta": {
"content_id": "d731... |
52239980-e97f-4a06-985d-4a5df2e74b8c | Himanshu8368/Placement | DSA/array/16_75_sort_color.cpp | #include <vector>
using namespace std;
class Solution {
public:
void sortColors(vector<int>& nums) {
int ones =0;
int twos = 0;
int zeros =0;
for(int i=0;i<nums.size();i++){
if(nums[i]==0){
zeros++;
}
else if (nums[i]==1){
... | ALGO | 0.999987 | 6.123967 | {
"github_metadata": {
"branch": "main",
"commit_count": 36,
"repo_created_at": "2025-05-08T14:17: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": "2f49ab1df6d... |
3af5eae1-a75c-413d-9679-d168d34d3e52 | shoraaa/CompetitiveProgramming | 2. Codes/- Olyimpiad In Informatic/CEOI17_sure.cpp | #include<bits/stdc++.h>
using namespace std;
using ll = long long;
using ld = long double;
const int N = 1e5 + 5;
ld a[N], b[N];
int n;
int main() {
cin.tie(0)->sync_with_stdio(0); cout.tie(0);
cin >> n;
for (int i = 1; i <= n; ++i)
cin >> a[i] >> b[i];
sort(a + 1, a + n + 1, greater<ld>());
sort(b + ... | ALGO | 0.999914 | 3.391793 | {
"github_metadata": {
"branch": "main",
"commit_count": 9,
"repo_created_at": "2023-07-31T18:18:12.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "2b01e33e730c... |
4bc33c7a-0af4-462c-bd42-26ce862775bd | AbdulRasheed02/IPMP | Week 8/D3/p3.cpp | #include <iostream>
#include "tree.cpp"
#include <fstream>
ofstream fp1;
ifstream fp2;
using namespace std;
void serialise(node *root)
{
if (root == NULL)
{
fp1 << -1 << " ";
return;
}
fp1 << root->value << " ";
serialise(root->left);
serialise(root->right);
}
node *deserialise(n... | ALGO | 0.978526 | 3.840649 | {
"github_metadata": {
"branch": "master",
"commit_count": 42,
"repo_created_at": "2021-10-30T07:24:43.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "56b7dfa20... |
3a0e41c1-62ad-4c28-a1d8-d154ebdf477a | yosupo06/library-checker-problems | string/zalgorithm/sol/correct.cpp | #include <iostream>
#include <vector>
using namespace std;
using uint = unsigned int;
using ll = long long;
using ull = unsigned long long;
constexpr ll TEN(int n) { return (n == 0) ? 1 : 10 * TEN(n - 1); }
template <class T> using V = vector<T>;
template <class T> using VV = V<V<T>>;
// s[0..r[i]] == s[i..i+r[i]]
te... | ALGO | 0.999978 | 4.928826 | {
"github_metadata": {
"branch": "master",
"commit_count": 3115,
"repo_created_at": "2019-05-30T20:49:42.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 589,
"forks": 137,
"issues": 98,
"pull_requests": 3
},
"file_meta": {
"content_id": "3c... |
ed28fb85-2e60-4e3d-9563-fda585822201 | tim-rogue/peltier_project | peltier_project.ino | #include <PID_v1.h>
#include "lm335.c"
#include <math.h>
#define TEMP_INPUT_PIN 0
#define PWM_OUTPUT_PIN 3
//value written to OCR2A register to set PWM frequency
int PWM_divisor = 63;
//Define PID Variables we'll be connecting to
double Setpoint, Input, Output;
//might not need this
int integer_out;
//Specify the l... | TOOL | 0.942308 | 5.382095 | {
"github_metadata": {
"branch": "master",
"commit_count": 1,
"repo_created_at": "2017-09-13T21:48: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": "2f7b645167... |
14c6f4af-c6f9-4564-a800-91868a7c79c4 | kamyu104/LeetCode-Solutions | C++/magnetic-force-between-two-balls.cpp | // Time: O(nlogn + nlogr), r is the range of positions
// Space: O(1)
class Solution {
public:
int maxDistance(vector<int>& position, int m) {
sort(begin(position), end(position));
int left = 0, right = position.back() - position.front();
while (left <= right) {
const auto& mid... | ALGO | 0.999983 | 5.819855 | {
"github_metadata": {
"branch": "master",
"commit_count": 19395,
"repo_created_at": "2018-10-11T17:38:35.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 4939,
"forks": 1616,
"issues": 1,
"pull_requests": 55
},
"file_meta": {
"content_id": ... |
63e1fe6f-06e4-429e-8079-e5f431a4f386 | EliranMerhavi/bf-interpeter | main.cpp | #include <iostream>
#include <string>
#include <stack>
#include <string.h>
#define DATA_SIZE 30000
static uint8_t data[DATA_SIZE] = { 0 };
static uint16_t data_pointer = 0;
static std::stack<uint16_t> start_loop_indices;
bool interpert_line(const std::string& line)
{
if (line == "e") return false;
for (uint16_t l... | TOOL | 0.913634 | 4.688566 | {
"github_metadata": {
"branch": "master",
"commit_count": 4,
"repo_created_at": "2022-09-08T15:40: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": "102c8ac742... |
7940bb68-0220-4763-b627-263d446038ed | shyam640/MY-WORKS | Codechef Problems/contest1.cpp | /*You need to calculate the total number of points gained by each player
and find maximum of these values*/
#include<iostream>
#include<stdlib.h>
#include<math.h>
#include<climits>
using namespace std;
int main(){
system("CLS");
int t; //NO. of testcases
cin>>t;
for(int test_case=1;test_case<=... | ALGO | 0.999816 | 3.414618 | {
"github_metadata": {
"branch": "master",
"commit_count": 5,
"repo_created_at": "2020-11-06T08:17:48.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 1
},
"file_meta": {
"content_id": "29d9b038e2... |
0eac1ec5-a9f6-4410-9eb6-b450dce1ace7 | Dalimil/ProjectEuler | Project_Euler_Solutions/Problem_#83_Path_sum_four_ways.cpp | #include <cstdio>
#include <iostream>
#include <sstream>
#include <string>
#include <cmath>
#include <cassert>
#include <algorithm>
#include <vector>
#include <set>
#include <map>
#include <deque>
using namespace std;
typedef long long ll;
typedef pair<double, double> dd;
typedef pair<int, int> ii;
typedef pair<int, ii... | ALGO | 0.999951 | 3.448904 | {
"github_metadata": {
"branch": "master",
"commit_count": 98,
"repo_created_at": "2015-07-13T19:50:17.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 25,
"forks": 22,
"issues": 0,
"pull_requests": 1
},
"file_meta": {
"content_id": "c26af2c... |
fb88bbbd-939b-43b0-9a89-0f16c2c5e7fc | BlueBlueSkyZZ/algorithmLearning | MaxHeap2/MergeSort.h | #ifndef MERGESORT_H_INCLUDED
#define MERGESORT_H_INCLUDED
#include <iostream>
#include <algorithm>
using namespace std;
/**
将arr[L,mid]和arr[mid+1,R]两部分进行归并
*/
template<typename T>
void __merge(T arr[], int L, int mid, int R) {
//开辟临时空间
T tem[R - L + 1];
//存储原数值
for(int i = L; i <= R; i++) {
... | ALGO | 0.999957 | 5.482815 | {
"github_metadata": {
"branch": "master",
"commit_count": 13,
"repo_created_at": "2018-02-28T08:15:02.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "141d881f9... |
bbf86911-ab4a-4197-b8cb-95125fc299ed | rachel-ng/cs135 | hw/e_6-18.cpp | /*
Author: <NAME>
Course: CSCI-135
Instructor: Maryash
Assignment: E6.18
Vector
*/
#include <iostream>
#include <vector>
std::vector<int> append(std::vector<int> a, std::vector<int> b) {
std::vector<int> c;
for (int i = 0; i < a.size(); i++) {
c.push_back(a[i]);
}
for (int i = 0; i < b.si... | ALGO | 0.991874 | 5.546653 | {
"github_metadata": {
"branch": "master",
"commit_count": 207,
"repo_created_at": "2019-09-01T05:20: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": "28932a39... |
0d224e95-dcf8-4229-8259-26014df6e849 | fsshakkhor/competitive-programming | Online Judge Solve/Toph/National Girls' Programming Contest 2019 Preliminary/The Archipelago of Mirpur.cpp | #include<bits/stdc++.h>
using namespace std;
#define fRead(x) freopen(x,"r",stdin)
#define fWrite(x) freopen (x,"w",stdout)
#define LL long long
#define ULL unsigned long long
#define ff first
#define ss second
#define pb push_back
#define ... | ALGO | 0.999959 | 3.642478 | {
"github_metadata": {
"branch": "master",
"commit_count": 236,
"repo_created_at": "2017-02-21T11:40:17.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 36,
"forks": 15,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "7d8cf2... |
c99f108a-f653-4521-9cf9-1dc2fddc1898 | jaepang/bojPractice | math/10974.cpp | /*
* 10974. 모든 순열
* N이 주어졌을 때, 1부터 N까지의 수로 이루어진 순열을 사전순으로 출력하는 프로그램을 작성하시오.
*
* 첫째 줄에 N(1 ≤ N ≤ 8)이 주어진다.
*
* 첫째 줄부터 N!개의 줄에 걸쳐서 모든 순열을 사전순으로 출력한다.
*
*/
#include <stdio.h>
#include <vector>
#include <algorithm>
using namespace std;
int n;
vector <int> subset;
vector <int> nxt;
void swap(int, int);
bool isLarg... | ALGO | 0.999918 | 4.964171 | {
"github_metadata": {
"branch": "master",
"commit_count": 120,
"repo_created_at": "2019-11-23T14:48: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": "09d5e027... |
0e96f770-5ded-4fe2-8d31-6fe38d3429ba | Reqiesko/LIPOAIS_Labs | Lab2/Math.h | #pragma once
#include <iomanip>
#include <iostream>
#include <sstream>
#include "Matrix.h"
template<typename ValueInMatrix>
Matrix<ValueInMatrix> MakeMatrix(int order);
template<typename ValueInMatrix>
Matrix<ValueInMatrix> MakeLeftResidualMatrix(Matrix<ValueInMatrix>* initial, Matrix<ValueInMatrix>* inverted);
temp... | ALGO | 0.998319 | 4.617151 | {
"github_metadata": {
"branch": "master",
"commit_count": 10,
"repo_created_at": "2022-10-02T12:53: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": "ec2acc5e4... |
69d3cf1a-b1fe-4ed6-8c4b-ed8948411426 | YuchenZhao-cn/Multithread-Programming-Homework | Homework08/Q5.cpp | #include <iostream>
using namespace std;
int main() {
int myInt1 = 5;
int myInt2 = 10;
int* myPointer1 = &myInt1;
int* myPointer2 = &myInt2;
int myInt3;
cout << "-----Origin-----" << endl;
cout << "myInt1: " << myInt1 << "\nmyInt2: " << myInt2 << endl;
myInt3 = *myPointer1;
*myPointer1 = *myPointer2;
*myPoin... | ALGO | 0.988469 | 3.364996 | {
"github_metadata": {
"branch": "main",
"commit_count": 7,
"repo_created_at": "2020-11-10T02: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": "77e523d3e325... |
cd90fd7c-ac29-4ea4-a650-2e8ea088f4e2 | rthaiva1/N-dimension-sphere-using-threads | histo_optimized.cpp | #include <random>
#include <vector>
#include <algorithm>
#include <iostream>
#include <map>
#include <assert.h>
#include <unistd.h>
#include <sys/time.h>
#include <sys/resource.h>
#include <math.h>
#include <omp.h>
#include <cmath>
int main(int argc, char **argv) {
if (argc != 3)
{
std::fprintf(stderr, "./s... | ALGO | 0.972351 | 4.729553 | {
"github_metadata": {
"branch": "master",
"commit_count": 1,
"repo_created_at": "2020-02-11T06:42: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": "7a8d6e9295... |
fdcdaa3f-8614-43b5-978a-f34449f6bcba | ishandutta2007/codeforces-h | heart_blue/normal/392/A.cpp | #include <cstdlib>
#include <cctype>
#include <cstring>
#include <cstdio>
#include <cmath>
#include <algorithm>
#include <vector>
#include <string>
#include <iostream>
#include <sstream>
#include <map>
#include <set>
#include <queue>
#include <stack>
#include <fstream>
#include <numeric>
#include <iomanip>
#include <bi... | ALGO | 0.99962 | 3.198671 | {
"github_metadata": {
"branch": "main",
"commit_count": 1,
"repo_created_at": "2024-04-11T02:01:06.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "e26e7c2fb7ef... |
673a4d71-ac04-481a-9f14-926e4dc3396e | shiqi-614/LeetCode | Done/1333.cpp | #include <cstdlib>
#include <cctype>
#include <cstring>
#include <cstdio>
#include <cmath>
#include <algorithm>
#include <vector>
#include <string>
#include <iostream>
#include <sstream>
#include <map>
#include <set>
#include <queue>
#include <stack>
#include <fstream>
#include <numeric>
#include <iomanip>
#include <bi... | ALGO | 0.999815 | 4.406108 | {
"github_metadata": {
"branch": "main",
"commit_count": 68,
"repo_created_at": "2020-12-31T07:05:50.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "e258809f036... |
ae8a1fb2-f2b7-44df-9030-b898ba8d34ba | aru404/self-practice- | single/p/segmentTree/CF1422.cpp | // # Boring Queries
// ## 题面翻译
// 给定一个长度为 $n$ 的序列 $a$ 以及 $q$ 次询问 。
// 每次询问包含 $2$ 个整数 $l,r$ ,你需要求出区间 $[l,r]$ 的最小公倍数对 $10^9 + 7$ 取模的结果。
// 询问强制在线 。对于每次读入的 $x,y$ ,你需要进行以下操作得到 $l,r$ :
// $l=(x+last)\ mod\ n+1,r=(y+last)\ mod\ n+1,$
// 如果 $l$ 比 $r$ 大,你需要交换$l,r$。
// 数据范围:
// $1\leq n,q\leq 10^5,1 \leq a_i\leq 2... | ALGO | 0.999989 | 5.268211 | {
"github_metadata": {
"branch": "main",
"commit_count": 2,
"repo_created_at": "2022-09-05T02:36: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": "a11104d4fcb6... |
cbb5ac05-214f-4adb-b65a-3744a3fff7e2 | Ming-J/LeetCode | 617_Merge_Two_Binary_Trees.cpp | /**
* Definition for a binary tree node.
* struct TreeNode {
* int val;
* TreeNode *left;
* TreeNode *right;
* TreeNode(int x) : val(x), left(NULL), right(NULL) {}
* };
*/
#include <iostream>
using namespace std;
struct TreeNode {
int val;
TreeNode *left;
TreeNode *right;
... | ALGO | 0.999992 | 5.950316 | {
"github_metadata": {
"branch": "master",
"commit_count": 448,
"repo_created_at": "2014-11-04T04:34: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": "036a0889... |
e3be2e60-78e1-4822-86b0-31b339755834 | xeonv3/Direct3D | D3D/D3D/CD.cpp | #include "CD.h"
BOOL TestBoxIntersect(const d3d::BoundingBox &a,const d3d::BoundingBox &b){
if(a._max.x < b._min.x || a._min.x > b._max.x) return false;
if(a._max.y < b._min.y || a._min.y > b._max.y) return false;
if(a._max.z < b._min.z || a._min.z > b._max.z) return false;
return true;
}
void ConstructAABB(AABB *... | ALGO | 0.999112 | 4.165982 | {
"github_metadata": {
"branch": "master",
"commit_count": 8,
"repo_created_at": "2013-08-03T14:10:50.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "2feae512cb... |
ef5709df-c9c5-438e-8957-50a8f55c89c5 | trilinos/Trilinos | packages/rol/src/algorithm/TypeG/fletcher/ROL_FletcherObjectiveE_Def.hpp | // @HEADER
// *****************************************************************************
// Rapid Optimization Library (ROL) Package
//
// Copyright 2014 NTESS and the ROL contributors.
// SPDX-License-Identifier: BSD-3-Clause
// *************************************************************************... | ALGO | 0.996635 | 6.726622 | {
"github_metadata": {
"branch": "master",
"commit_count": 104031,
"repo_created_at": "2015-11-16T19:39:16.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 1299,
"forks": 593,
"issues": 263,
"pull_requests": 61
},
"file_meta": {
"content_id":... |
4bd97764-4e9f-49b8-87b8-49dc2e646dcf | JTBell94/encryption | homework4.cpp | /* <NAME> CSCE1030.001 jtb0192 Homework4 <EMAIL> */
#include<iostream>
#include<fstream>
#include<cstdlib>
#include<string>
using namespace std;
void id(); // declaring the functions to be used later
void encryption();
void decryption();
ifstream in_stream; // global declaration of variables to be used in the functi... | TOOL | 0.995795 | 3.442653 | {
"github_metadata": {
"branch": "master",
"commit_count": 2,
"repo_created_at": "2017-03-30T02:09: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": "b9e73b9964... |
00849b1e-4029-41b8-9660-28e822b87315 | Shailja88/Strivers-SDE-Sheet-Challenge | day5_removeKTHnodeFromback.cpp | /*
Following is the class structure of the Node class:
Brute force
class Node
{
public:
int data;
Node *next;
Node()
{
this->data = 0;
next = NULL;
}
Node(int data)
{
this->data = data;
this->next = NULL;
}
Node(int data, Node* next)
{
thi... | ALGO | 0.999991 | 5.561777 | {
"github_metadata": {
"branch": "main",
"commit_count": 193,
"repo_created_at": "2023-06-04T07:41: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": "1401708833... |
2bc55d9d-ec3e-43fc-9f3e-859ea5d420d7 | GersonCavalheiro/OpenMPSnapshot | May2023/RepCPP/117122510/matrix_kernels.cpp |
#include "core/distributed/matrix_kernels.hpp"
#include <omp.h>
#include <ginkgo/core/base/exception_helpers.hpp>
#include "core/base/allocator.hpp"
#include "core/base/device_matrix_data_kernels.hpp"
#include "core/components/prefix_sum_kernels.hpp"
namespace gko {
namespace kernels {
namespace omp {
namespa... | ALGO | 0.995476 | 6.171597 | {
"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": "d7ba1dcde2... |
3118cfbf-8f19-41e1-b8b4-7a39b860f4da | rjenez/W266-final-project | data/programming-homework-dataset-plagiarism-detection/src/B2016/Z1/Z4/student8428.cpp | /*B 2016/2017, Zadaća 1, Zadatak 4
NAPOMENA: ulaz/izlaz za zadatke je specificiran
javnim autotestovima. Zalbe za ne analiziranje testova
se ne uvazavaju!
NAPOMENA: nece svi (javni) testovi sa zamgera biti
dostupni na c9.
*/
#include <string>
#include <vector>
#include <iostream>
#include <cctype>
#include... | ALGO | 0.950578 | 5.15403 | {
"github_metadata": {
"branch": "main",
"commit_count": 125,
"repo_created_at": "2022-02-09T00:45:24.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 2,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "c5d201b1a2... |
adf2926f-2ea1-478c-9dea-54e794a7a02d | p1kalys/Leetcode-DSA-Vault | 1478-maximum-number-of-events-that-can-be-attended/maximum-number-of-events-that-can-be-attended.cpp | class Solution {
public:
static bool cmp(vector<int> &a, vector<int> &b){
if (a[0] == b[0])
return a[1] < b[1];
return a[0] < b[0];
}
int maxEvents(vector<vector<int>>& v) {
sort(v.begin(), v.end(), cmp);
int len = v.size();
int j = 0;
int ans = ... | ALGO | 0.999994 | 5.632503 | {
"github_metadata": {
"branch": "main",
"commit_count": 1603,
"repo_created_at": "2023-06-11T10:42:27.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "abc578ebf... |
7fda06c1-5454-425b-830a-aa6c485b29c3 | mdirshad17/MATHS | pass.cpp | #include <bits/stdc++.h>
using namespace std;
vector<int> Zalgo(string s)
{
int n = s.size();
vector<int> z(n);
z[0] = 0;
int l = 0, r = 0;
for (int i = 1; i < n; i++)
{
if (i > r)
{
l = r = i;
while (r < n && s[r - l] == s[r])
{
r++;
}
z[i] = r - l;
r--;
} else
{ int k = i - l;
i... | ALGO | 0.999992 | 3.707433 | {
"github_metadata": {
"branch": "main",
"commit_count": 3,
"repo_created_at": "2021-06-30T19:26: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": "bf2b7c808f6d... |
ca96a62d-92f7-4e40-b726-72e70bb1a288 | normalman159/Competitve-Programming | VNOI/atcoder_dp_m.cpp | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
const ll MXN = 2e6 + 5;
const long long INF = 1e15;
const ll MOD = 1e9+7;
const double eps = 1e-12;
#define forn(i,e) for(ll i = 0; i < e; i++)
#define forsn(i,s,e) for(ll i = s; i < e; i++)
#define rforn(i,s) for(ll i = s; i >= 0; i--)
#define r... | ALGO | 0.999982 | 4.551603 | {
"github_metadata": {
"branch": "main",
"commit_count": 21,
"repo_created_at": "2024-01-21T02:54:33.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "36cd398f9a3... |
6ae647f0-bd37-404e-b479-1f8f387f20d5 | Xiangyu-Hu/SPHinXsys | src/shared/kernels/kernel_tabulated.h | /* ------------------------------------------------------------------------- *
* SPHinXsys *
* ------------------------------------------------------------------------- *
* SPHinXsys (pronunciation: s'finksis) is an acronym from Smoothed Particle *
* H... | TOOL | 0.901814 | 5.323487 | {
"github_metadata": {
"branch": "master",
"commit_count": 5288,
"repo_created_at": "2019-05-28T17:05:34.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 406,
"forks": 291,
"issues": 29,
"pull_requests": 28
},
"file_meta": {
"content_id": "8... |
b9d21f90-4536-43ba-896b-927b1b36d8bb | kazeto/phillip | src/binary.h | #ifndef HENRY_BINARY_H
#define HENRY_BINARY_H
#include <string>
#include <vector>
#include <fstream>
#include <iostream>
#include <memory>
#include "./phillip.h"
#include "./lhs/lhs_enumerator.h"
#include "./ilp/ilp_converter.h"
#include "./sol/ilp_solver.h"
namespace phil
{
namespace bin
{
typedef std::vector<s... | TOOL | 0.97795 | 6.244693 | {
"github_metadata": {
"branch": "master",
"commit_count": 308,
"repo_created_at": "2014-02-26T10:45:33.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 22,
"forks": 5,
"issues": 3,
"pull_requests": 0
},
"file_meta": {
"content_id": "9954e1a... |
aaf7e3c3-1a18-4502-ae9c-cf817f082486 | chandradeepkumar16/LeetCode-Ques | 210-course-schedule-ii/210-course-schedule-ii.cpp | class Solution {
public:
bool toposort(int node , unordered_map<int, list<int>>&adj , unordered_map<int,bool>&visited
, stack<int>&s , unordered_map<int, bool> &dfsvisited){
visited[node]=true;
dfsvisited[node]=true;
for(auto n:adj[node]){
... | ALGO | 0.999995 | 6.060019 | {
"github_metadata": {
"branch": "main",
"commit_count": 938,
"repo_created_at": "2022-06-30T17:40:07.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 3,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "b0f188554f... |
4afe5754-eaee-49ec-86ec-b25c8556469a | Forrest-Z/tdt2023algorithm | src/roborts_vision/node_resolve/src/roborts_resolve.cpp | #include "roborts_resolve/roborts_resolve.h"
#include "geometry_msgs/msg/point32.hpp"
namespace Resolve {
ArmorResolve::ArmorResolve() : rclcpp::Node("armor_resolve_node") {
RCLCPP_INFO(this->get_logger(), "begin resolved ");
LoadParam::InitParam("resolve", "./config/camera_param.jsonc");
armorResolveSub = thi... | TOOL | 0.940918 | 4.866313 | {
"github_metadata": {
"branch": "master",
"commit_count": 2,
"repo_created_at": "2024-06-26T11:26: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": "68fd5ecf87... |
3dc89982-c8cf-44e1-8720-484019c1f695 | gilsonshimizu/ldacov | src/slice_NBN.cpp | // [[Rcpp::depends("RcppArmadillo")]]
#include <RcppArmadillo.h>
#include <Rcpp.h>
#include <iostream>
#include <ctime>
#include <fstream>
using namespace Rcpp;
/***************************************************************************************************************************/
/*******************************... | ALGO | 0.999472 | 5.883461 | {
"github_metadata": {
"branch": "master",
"commit_count": 19,
"repo_created_at": "2020-08-05T20:26:21.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2,
"forks": 3,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "10f518897... |
dc5d66cc-50a8-44f8-8183-59838172b395 | ee-lynn/PAT_test | 1082.cpp | #pragma warning (disable:4996)
#include <iostream>
#include <stack>
using namespace std;
string convert(char num)
{
switch(num)
{
case '1':
return "yi";
case '2':
return "er";
case '3':
return "san";
case '4':
return "si";
c... | ALGO | 0.999215 | 3.184174 | {
"github_metadata": {
"branch": "master",
"commit_count": 3,
"repo_created_at": "2017-09-17T14:51:43.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "ce1ba77a42... |
9854d389-88aa-481b-9fe0-cd8e47255558 | krittin-ch/Introduction-to-Algorithms | 3-Data-Structures/11-Hash-Tables/chained-hash-table.cpp | #include <bits/stdc++.h>
using namespace std;
struct Node {
int data;
int key;
Node* prev;
Node* next;
Node(int key, int val) : data(val), key(key), prev(nullptr), next(nullptr) {};
};
class DoubleLinkedList {
private:
Node* head;
public:
DoubleLinkedList() : head(nu... | ALGO | 0.996697 | 5.32354 | {
"github_metadata": {
"branch": "main",
"commit_count": 126,
"repo_created_at": "2024-07-06T15:18: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": "7ded0c7ed7... |
a3497b20-3620-4739-a261-efe85da7c67c | ishandutta2007/codeforces-m | molamola/normal/444/B.cpp | #include<stdio.h>
#include<algorithm>
#include<string.h>
#include<vector>
#include<math.h>
#include<stdlib.h>
#include<set>
#include<ctype.h>
using namespace std;
#define X first
#define Y second
typedef long long ll;
typedef pair<int,int> Pi;
ll x;
int a[100010], b[100010], c[100010];
int n, d;
ll getNextX() {
... | ALGO | 0.99987 | 3.230465 | {
"github_metadata": {
"branch": "main",
"commit_count": 1,
"repo_created_at": "2024-06-06T01:03:30.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "d7458aa47d2c... |
3129d25b-80be-4554-a7d1-4abc54b236c6 | dishant4163/A2Z-DSA-Striver | Step-6 Linked List/Lec-6 Random Hard Problems on LL/2_Design_a_BrowserHistory.c++ | /*//(Design a Browser History_Coding Ninja)-> https://tinyurl.com/4mj3n87y
class Node {
public:
string data;
Node* next;
Node* back;
Node() : data(0), next(nullptr), back(nullptr){};
Node(string x) : data(x), next(nullptr), back(nullptr) {}
Node(string x, Node* ... | ALGO | 0.999734 | 4.58821 | {
"github_metadata": {
"branch": "main",
"commit_count": 732,
"repo_created_at": "2024-07-30T12:22: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": "2e329dbbe7... |
47ad9536-f6f3-4ae5-84db-5c90809bb821 | Muyiyunzi/BUAA-CS-Codes | Codes/2015-1.cpp | /*
//10:27 自做版本
#include <cstdio>
#include <cstring>
int f[1000];
int fNum = 0;
void findFactor(int x) { //求x的所有因子,并保存在f[]中,总数为fNum个
for(int i = 2; i <= x / 2; i++) {
if(x % i == 0) {
f[fNum++] = i;
}
}
}
int main() {
int a, b, sum1 = 1, sum2 = 1;
scanf("%d %d", &a, &b);
... | ALGO | 0.999967 | 3.735193 | {
"github_metadata": {
"branch": "master",
"commit_count": 20,
"repo_created_at": "2020-07-06T05:35:36.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 173,
"forks": 21,
"issues": 2,
"pull_requests": 0
},
"file_meta": {
"content_id": "623aca... |
33e3f682-5ead-4f31-9b1a-3af9089db2e6 | IryVk/Chat-App | src/common/dh_key.cpp | /**
* @file common/dh_key.cpp
* @date 2024-04-22
* @author <NAME>
* @brief This file contains the implementation of the DHKeyExchange class
*
* This file contains the implementation of the DHKeyExchange class, which is used to perform Diffie-Hellman key exchange.
*/
#include "common/dh_key.h"
CryptoPP::AutoSee... | ALGO | 0.998028 | 6.369752 | {
"github_metadata": {
"branch": "main",
"commit_count": 42,
"repo_created_at": "2024-04-19T11:26:32.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "c1862652ad0... |
b32f4e3f-2c71-415a-8f46-a18a69848cfd | MirazShahin/Problem-Solving-in-Different-Online-Judge | LightOJ/Brush (V).cpp | #include <bits/stdc++.h>
#define FastIO \
ios_base::sync_with_stdio(0); \
cin.tie(0); \
cout.tie(0);
#define vii vector<int>
#define vll vector<ll>
#define nn '\n'
#define gcd(a,b) __gcd(a,b)
#define lcm(a,b) (a*b) / gcd(a,b)
#define sp " "
#d... | ALGO | 0.999847 | 4.315722 | {
"github_metadata": {
"branch": "main",
"commit_count": 343,
"repo_created_at": "2022-10-08T05:45: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": "f6adaa04a3... |
57bf5490-aa2c-431d-aef4-83613bd74bdc | Bayyys/Algorithm | Leetcode/practice/454.4-sum-ii.cpp | /*
* @lc app=leetcode.cn id=454 lang=cpp
* @lcpr version=30110
*
* [454] 四数相加 II
*/
// @lcpr-template-start
using namespace std;
#include <algorithm>
#include <array>
#include <bitset>
#include <climits>
#include <deque>
#include <functional>
#include <iostream>
#include <list>
#include <queue>
#include <stack>
#... | ALGO | 0.999854 | 6.423234 | {
"github_metadata": {
"branch": "main",
"commit_count": 48,
"repo_created_at": "2024-03-06T08:58: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": "5ac5b7acaea... |
bfce5767-0276-47ec-ab83-c02837d430e3 | Volgarenok/spbspu-labs-2024-aap-a | sharifullina.sofia/P3/main.cpp | #include <iostream>
#include <fstream>
#include <cstring>
#include <cstdlib>
#include "matrix.hpp"
int main(int argc, char ** argv)
{
if (argc < 4)
{
std::cerr << "Not enough arguments\n";
return 1;
}
if (argc > 4)
{
std::cerr << "Too many arguments\n";
return 1;
}
char* end = nullptr;
... | ALGO | 0.986774 | 4.339174 | {
"github_metadata": {
"branch": "master",
"commit_count": 8754,
"repo_created_at": "2024-10-01T15:31:47.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 3,
"forks": 52,
"issues": 0,
"pull_requests": 16
},
"file_meta": {
"content_id": "fefbd... |
279015a4-b0d9-4263-81ba-faa7f49bcb22 | WladimirTavares/DesafiosProgramacao2020.1 | segment tree/DistinctIntegerRange.cpp | #include <bits/stdc++.h>
using namespace std;
const int MAXV = 5001;
const int MAXN = 1e5 + 1 ;
int n;
bitset<MAXV+1> tree1[2*MAXN];
bitset<MAXV+1> tree2[2*MAXN];
int arr[MAXN];
void build(int *arr, bitset<MAXV+1> *tree) {
//printf("build\n");
for (int i=0; i<n; i++){
tree[n+i].reset();
tree[n+i]... | ALGO | 0.999836 | 4.90144 | {
"github_metadata": {
"branch": "master",
"commit_count": 12,
"repo_created_at": "2020-08-06T17:30:52.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 6,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "73d60228d... |
eb250502-9aa4-44a4-b7cf-02158c63601b | abhijite-bd/Codeforces | E_Eating_Queries.cpp | #include <bits/stdc++.h>
#define ll long long int
#define gcd(a, b) __gcd(a, b)
#define lcm(a, b) (a * b) / gcd(a, b)
#define ss ' '
#define fast() \
ios_base::sync_with_stdio(0); \
cin.tie(NULL); \
cout.tie(NULL)
#define max3(a, b, c) max(max(a, b), c)
#define min3(a, b, c... | ALGO | 0.999906 | 3.676817 | {
"github_metadata": {
"branch": "master",
"commit_count": 1,
"repo_created_at": "2023-03-05T19:39: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": "aadbdd7cd3... |
0ce1ba57-da95-455c-b4f8-4abe08f50490 | jikongabc/test-jikong | niuke.cpp | #include<iostream>
#include<algorithm>
#include<cstring>
#include<map>
#include<set>
#include<vector>
#include<cstring>
using namespace std;
#define int long long
// void solve(){
// int n;
// int a[500005];
// cin >> n;
// for (int i = 0; i < n;i++){
// cin >> a[i];
// }
// sort(a, a + ... | ALGO | 0.999946 | 4.456059 | {
"github_metadata": {
"branch": "main",
"commit_count": 329,
"repo_created_at": "2024-01-31T07:12: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": "2f25c8b7e9... |
5cd031de-b21c-4c5d-85e8-eac0cbe6ac67 | caioaao/cp-solutions | cchef/cook49/shooting/sol.cpp | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
char ma[55][55];
int n,m;
//~ set<vector<bool> > memo[55][55][2][2];
bool dp(int i, int j, bool limpouR, bool temE, ll colLimpas){
if(j == 0 && temE) return false;
if(i == -1) return true;
if(j == 0) limpouR = 0;
//~ cout << i << ' ' <<... | ALGO | 0.999878 | 4.427377 | {
"github_metadata": {
"branch": "master",
"commit_count": 41,
"repo_created_at": "2015-05-03T22:29:59.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "7e76bf1d7... |
6e6510b7-6e2f-44ee-9361-f139aa17c7f7 | FleckensteinF/weya-tools | string_processing/string_ana.h | #ifndef _STRING_ANA_H_
#define _STRING_ANA_H_
namespace Tools{
namespace StringProcessing{
// string analysis functions
bool strempty(std::string haystack);
size_t stringcount(std::string haystack, std::string needle);
bool stringcontains(std::string haystack, std::string needle);
size_t findPare... | TOOL | 0.920806 | 4.916771 | {
"github_metadata": {
"branch": "master",
"commit_count": 5,
"repo_created_at": "2016-12-13T16:27:50.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "d20ae4c285... |
d9b00adc-8390-44e6-bc8a-6ad34f8cf7b6 | makometr/piaa_9383 | Moiseychenko/lab2/source/graph.cpp | #include "graph.h"
void readGraph(std::vector<Node*>& graph, char start, char finish, std::istream& in)
{
char curValue, neighbourValue;
float edgeLength;
Node* startNode = nullptr;
Node* endNode = nullptr;
while (in >> curValue >> neighbourValue >> edgeLength)
{
if (!isalpha(curValue)... | ALGO | 0.999227 | 3.935874 | {
"github_metadata": {
"branch": "main",
"commit_count": 354,
"repo_created_at": "2021-03-03T20:28:29.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 17,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "4f5d6e6bd... |
b72f6b48-dfe6-4b94-9bae-0562fee9d469 | nuts3745/atcoder | abc176/c/c.cpp | #include <bits/stdc++.h>
#define rep(i,n) for (int i = 0; i < (n); ++i)
using namespace std;
using ll = long long;
using P = pair<int,int>;
int main() {
int n;
cin >> n;
vector<int> l(n);
rep(i,n) cin >> l.at(i);
ll count = 0;
for (int i = 1; i < n; i++)
{
if (l.at(i-1) > l.at(i))
... | ALGO | 0.999921 | 4.252045 | {
"github_metadata": {
"branch": "master",
"commit_count": 4,
"repo_created_at": "2020-09-23T15:18:42.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "10812ce05d... |
3d7faa1f-1202-4dd9-a060-e022eed00324 | nirmalsinhp/AlPrac | missing_positve.cpp | #include <bits/stdc++.h>
using namespace std;
int trap(vector<int>& height)
{
size_t l = 0, r = height.size() - 1;
size_t minHt = 0;
int res = 0;
while(l < r)
{
while(l < r && height[l] <= minHt)
{
res += minHt - height[l++];
}
while(l < r && height[r]... | ALGO | 0.99982 | 4.02451 | {
"github_metadata": {
"branch": "main",
"commit_count": 12,
"repo_created_at": "2022-09-24T06:42: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": "08573541059... |
a061d86c-fd31-4e80-bfe4-42cbb808757c | sangwoojun/ulx3s_bsv | projects/nn_fc_zfpe/cpp/main.cpp | #include <time.h>
#include <stdio.h>
#include <stdlib.h>
#include <stdint.h>
#include <algorithm>
#include <cmath>
#include <string.h>
#include <pthread.h>
#include <unistd.h>
#include <queue>
#include "../../../src/cpp/ttyifc.h"
#include "nn_fc.h"
// exponent of single is 8 bit signed integer (-126 to +127)
#define ... | DATA | 0.958601 | 4.532533 | {
"github_metadata": {
"branch": "master",
"commit_count": 66,
"repo_created_at": "2021-02-10T18:55:56.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 14,
"forks": 6,
"issues": 0,
"pull_requests": 1
},
"file_meta": {
"content_id": "20313db6... |
2dbb1614-fee8-4264-bafc-8acbb95c7e82 | zyzkevin/Introduction-to-Computing | Homework/DP2/matrix.cpp | /*
* 矩阵取数
* 张雨泽 1900094801
* 2019/12/28
*/
#include <iostream>
#include <iomanip>
#include <cmath>
#include <cstring>
#include <algorithm>
using namespace std;
int main()
{
int n, m, a[81] = {0}, dp[81][81] = {0}, lef, rig, sum = 0; //lef and rig records boundaries of taken numbers
cin >> n >> m;
... | ALGO | 0.999974 | 3.565747 | {
"github_metadata": {
"branch": "master",
"commit_count": 4,
"repo_created_at": "2020-05-16T03:58: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": "c369ac64aa... |
a8be3374-ec94-4b57-85e9-d5109a0c1a1c | matchyc/RoarGraph | include/efanna2e/distance.h | //
// Created by 付聪 on 2017/6/21.
// Modified by 陈萌 on 2024/4/30.
//
#ifndef EFANNA2E_DISTANCE_H
#define EFANNA2E_DISTANCE_H
#include <immintrin.h>
#include <x86intrin.h>
#include <iostream>
namespace efanna2e {
enum Metric { L2 = 0, INNER_PRODUCT = 1, FAST_L2 = 2, PQ = 3, COSINE = 4 };
class Distance {
public:... | ALGO | 0.984242 | 6.686237 | {
"github_metadata": {
"branch": "main",
"commit_count": 12,
"repo_created_at": "2024-05-01T03:28:05.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 46,
"forks": 11,
"issues": 1,
"pull_requests": 0
},
"file_meta": {
"content_id": "47cb9b631... |
0dde91e7-4878-402a-b223-9407426ed4b0 | AztecProtocol/aztec-packages | barretenberg/cpp/src/barretenberg/sumcheck/sumcheck.hpp | // === AUDIT STATUS ===
// internal: { status: not started, auditors: [], date: YYYY-MM-DD }
// external_1: { status: not started, auditors: [], date: YYYY-MM-DD }
// external_2: { status: not started, auditors: [], date: YYYY-MM-DD }
// =====================
#pragma once
#include "barretenberg/honk/library/grand... | ALGO | 0.930848 | 6.883312 | {
"github_metadata": {
"branch": "next",
"commit_count": 12599,
"repo_created_at": "2023-02-20T16:28:18.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 339,
"forks": 456,
"issues": 929,
"pull_requests": 149
},
"file_meta": {
"content_id": "e... |
a1633b9c-8764-40d1-b62d-71653306c754 | lzyrapx/Competitive-Programming | 百度之星/2020/复赛/C.cpp | #include <cstring>
#include <iostream>
#include <cstdio>
#include <algorithm>
#include <vector>
using namespace std;
typedef long long ll;
const int maxn = 1e5 + 123;
const int mod = 998244353;
int c[maxn];
int main(int argc, char const *argv[])
{
int t;
// cin >> t;
scanf("%d",&t);
while(t--) {
... | ALGO | 0.999916 | 3.707503 | {
"github_metadata": {
"branch": "master",
"commit_count": 240,
"repo_created_at": "2017-05-06T08:23:52.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 48,
"forks": 21,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "455a38... |
46683e2e-95b1-497d-9e1c-0825f6b211d0 | tyrantein/fghjkl | 1Ai.cpp | #include <iostream>
#include <time.h>
#include <conio.h>
#include <stdlib.h>
using namespace std;
template <class T>
void bubblesort(T a[], int n)
{
for (int i = n; i > 2; i--)
for (int j = 0; j < i - 1; j++)
if (a[j] > a[j + 1])
{
T temp;
temp = a[j];
a[j] = a[j + 1];
a[j + 1] = temp;
}
}... | ALGO | 0.999661 | 3.558792 | {
"github_metadata": {
"branch": "master",
"commit_count": 3,
"repo_created_at": "2025-02-02T13:07: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": "cde49e4581... |
ade4bdfc-a481-4c32-95a5-70b113879544 | Gu-nuu/Algorithm_Study_A | 4_그리디 알고리즘/KGW/BOJ 11399.cpp | #include <iostream>
#include <algorithm>
#include <vector>
using namespace std;
int main()
{
ios::ios_base::sync_with_stdio(false);
cin.tie(NULL);
cout.tie(NULL);
int N;
cin >> N;
vector<int> time(N);
for (int i = 0; i < N; i++)
cin >> time[i];
sort(time.begin(), time.end()... | ALGO | 0.999961 | 5.029794 | {
"github_metadata": {
"branch": "main",
"commit_count": 182,
"repo_created_at": "2021-07-20T13:35:33.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "73b201408e... |
3b04eb51-f84e-4efa-ac06-4dd1602318e0 | Toshendrabohra/leetcode | Bipartite Graph - GFG/bipartite-graph.cpp | // { Driver Code Starts
#include<bits/stdc++.h>
using namespace std;
// } Driver Code Ends
class Solution {
public:
void dfs(vector<int> adj[], bool &poss, int x, vector<int> &vis)
{
for(auto &i:adj[x])
{
if(vis[i] == -1)
{
vis [i] = 1 - vis[x];
... | ALGO | 0.999905 | 5.876193 | {
"github_metadata": {
"branch": "main",
"commit_count": 1051,
"repo_created_at": "2021-12-24T12:32: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": "e1ec1bedf... |
34b7402d-c88d-4762-8d86-77f9a7c7ac6f | anis191/Phitron | Second Semester/Introduction to Algorithms/Week-1/Module-4(Assignment)/Count_Apartments.cpp | #include<bits/stdc++.h>
using namespace std;
vector<pair<int,int>>d ={{0,1},{0,-1},{-1,0},{1,0}};
bool vis[1005][1005];
char a[1005][1005];
int n,m;
bool valid(int i,int j){
if (i < 0 || i >= n || j < 0 || j >= m)
return false;
return true;
}
bool valid_cell(int i, int j){
if(a[i][j] == '#')
... | ALGO | 0.999831 | 4.334866 | {
"github_metadata": {
"branch": "main",
"commit_count": 128,
"repo_created_at": "2024-05-20T09:43: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": "bd479da45c... |
bd489326-d0b5-4821-a261-5d5643f686c0 | techwillsaveus/Gamer | examples/QuadGamer/simon.ino | byte x=0;
int delayMils = 300; //larger = easier
byte framesSimon[4][8];
byte go[8];
byte right[8];
byte wrong[8];
volatile byte sequence[30];
void resetSimon() {
gamer.clear();
delay(100);
for(byte b=0;b<x;b++) sequence[b]=0;
x=0;
delayMils = 300;
}
void simonLoop() {
sequence[x]=random(0,4);
if(x>0) {... | ALGO | 0.988047 | 3.86027 | {
"github_metadata": {
"branch": "master",
"commit_count": 77,
"repo_created_at": "2015-04-28T15:04:22.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 19,
"forks": 15,
"issues": 7,
"pull_requests": 2
},
"file_meta": {
"content_id": "fbf69e83... |
6558c8e2-2085-48de-8709-4ad3ea39adf3 | PulkitAsri/DSA | CodeChef/starters/S_61/Minimise_LCS.cpp | #include <bits/stdc++.h>
//#include <algorithm>
//#include <vector>
//#include <string>
//#include <math.h>
#define int long long
#define endl "\n"
using namespace std;
void solve()
{
int n, k;
cin >> n;
string s;
string t;
cin >> s >> t;
vector<int> freqS(26, 0);
vector<int> freqT(26, 0);
for (cha... | ALGO | 0.999979 | 4.149982 | {
"github_metadata": {
"branch": "master",
"commit_count": 36,
"repo_created_at": "2021-09-04T16:01:12.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "6779bc2df... |
b3a3b4a8-6f5c-490f-a661-1b33989ef745 | maratui/maze | src/model/maze.h | #ifndef A1_MAZE_MODEL_MAZE_H_
#define A1_MAZE_MODEL_MAZE_H_
#include <random>
#include <stack>
#include <vector>
#include "point.h"
namespace s21 {
class Maze {
public:
void SetMaze(const std::vector<std::vector<unsigned>> &vertical_walls,
const std::vector<std::vector<unsigned>> &horizontal_walls)... | ALGO | 0.985938 | 6.052696 | {
"github_metadata": {
"branch": "main",
"commit_count": 1,
"repo_created_at": "2024-02-16T15:19: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": "24b4d81ce9e6... |
33808632-9c6a-4640-a96a-f88f65cd5498 | Nikhil-Wagh/Competitive-Coding | 870 C/Maximum splitting.cpp | #include<bits/stdc++.h>
using namespace std;
typedef long long int LL;
typedef long double ld;
#define maxx 10000000000
#define sz 100009
typedef vector<LL> v1;
typedef vector<v1> v2;
typedef pair<LL,LL> ii;
#define pb push_back
#define all(c) (c).begin(),(c).end()
#define tr(c,i) for(typeof((c).begin() i = (c).begin()... | ALGO | 0.99992 | 3.370522 | {
"github_metadata": {
"branch": "master",
"commit_count": 20,
"repo_created_at": "2016-08-18T08:27: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": "8ac1b5652... |
07de770f-e834-4887-ac0d-5de35e1d385a | psastras/vocabtree | modules/bench/bench_all.cxx | #include <config.hpp>
#include "bench_config.hpp"
#include <fstream>
#include <utils/filesystem.hpp>
#include <utils/numerics.hpp>
#include <utils/dataset.hpp>
#include <utils/misc.hpp>
#include <utils/vision.hpp>
#include <utils/logger.hpp>
#include <utils/image.hpp>
#include <utils/cycletimer.hpp>
#include <search/b... | DATA | 0.978145 | 5.413454 | {
"github_metadata": {
"branch": "master",
"commit_count": 148,
"repo_created_at": "2013-10-24T19:20:01.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 13,
"forks": 4,
"issues": 1,
"pull_requests": 0
},
"file_meta": {
"content_id": "3db7445... |
6cf5541c-3821-4ed5-abfb-344dd265c7f3 | ishandutta2007/codeforces-k | kostka/normal/534/E.cpp | //<NAME>
// You are not prepared!
#include "bits/stdc++.h"
using namespace std;
const int MAXN = 200007;
int d[MAXN], e[MAXN];
int go(int a, int b)
{
return abs(d[a]-d[b]);
}
int main()
{
int n;
cin >> n;
for(int i=1; i<=n; i++)
cin >> d[i];
int m;
cin >> m;
for(int i=0; i<m; i++)
{
int a;... | ALGO | 0.999949 | 3.320289 | {
"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": "2ef17c95baff... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.