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 |
|---|---|---|---|---|---|---|---|
d2221865-db35-4f1c-810e-030bdfecf49d | ishandutta2007/codeforces-p | pikel_rik/normal/380/C.cpp | #include <bits/stdc++.h>
using namespace std;
const int N = 1000 * 1000;
int n, m;
string s;
struct node {
int ans;
int opening;
int closing;
node() {
ans = 0;
opening = 0;
closing = 0;
}
node(char c) {
ans = 0;
if (c == '(') {
opening = 1;
closing = 0;
} else {
opening = 0;
closing =... | ALGO | 0.999933 | 4.662003 | {
"github_metadata": {
"branch": "main",
"commit_count": 1,
"repo_created_at": "2024-10-30T15:49: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": "00c6ebfc3146... |
201c8bd7-0e8f-4648-a2d5-4ba91221304f | dgallitelli/SDPPolito2017 | Lab13/Lab13/main.cpp | #define UNICODE
#define _UNICODE
#define _CRT_SECURE_NO_WARNINGS
#include <windows.h>
#include <tchar.h>
#include <process.h>
#include <stdio.h>
#include <stdlib.h>
#include <time.h>
#define LEN 256
#define MAXLEN 254
#define QUEUE_LEN 10
#define print(f_, ...) WaitForSingleObject(sStdOut, INFINITE); _tprintf((f_),... | TOOL | 0.9912 | 3.492048 | {
"github_metadata": {
"branch": "master",
"commit_count": 28,
"repo_created_at": "2017-05-30T11:11:15.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "db57628bf... |
24fa597f-5b53-4439-b6ad-f7d38bab04fe | lungchin-tw/Practices | C++/fork/main.cpp |
#include <stdio.h>
#include <unistd.h>
#include <sys/wait.h>
#include <stdlib.h>
/*
** Try: man fork
** Try: man getpid
** Try: man 3 printf
*/
void child_routines() {
pid_t my_pid = getpid();
printf("[%d]: I'm a child process.\n", my_pid);
printf("[%d]: I'm a child process, Start Sleeping.\n", my_pid);
... | TOOL | 0.911411 | 4.101879 | {
"github_metadata": {
"branch": "master",
"commit_count": 430,
"repo_created_at": "2017-05-04T10:42:42.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 7
},
"file_meta": {
"content_id": "87d7ed3a... |
404c7bee-7396-4e08-bb8c-d434b7cd0d93 | AbhijeetSRawat/DSA | dsa love babbar/sum_of_nodes_of_longest_path.cpp | #include<iostream>
#include<queue>
#include<limits.h>
using namespace std;
class node{
public:
int data;
node* left;
node* right;
node(int data){
this->data = data;
this->left= NULL;
this->right=NULL;
}
};
node* buildtree(node* &root){
cout<<"enter the data for th... | ALGO | 0.999917 | 3.846416 | {
"github_metadata": {
"branch": "main",
"commit_count": 2,
"repo_created_at": "2025-05-29T11:07:47.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "a206670706f9... |
ae3411e5-bae7-425b-8f87-e0e2dc0f27c3 | Buchen-Apple/MyCode | 1_C 과제/5차과제_완료/Project1/Project1/과제3.cpp | // 3. 랜덤 테이블
// 첫번째 진짜 랜덤과 뽑기 부분은 같으나 rand() 함수를 대체할 우리만의 랜덤을 만든다.
// 우리가 만드는 랜덤은 지정된 범위 안에서 중복값이 절대 나오지 않는 랜덤 함수.
#include "stdio.h"
#include "stdlib.h"
#include "time.h"
#include "string.h"
#include "conio.h"
#define ITEM_COUNT 7
struct st_ITEM
{
char m_Name[30];
int m_Rate; // 아이템이 뽑힐 비율
};
st_ITEM g_Gatcha[... | TOOL | 0.944046 | 3.437382 | {
"github_metadata": {
"branch": "Master",
"commit_count": 305,
"repo_created_at": "2018-07-24T07:39:25.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "98d7b781... |
5a2c5aea-a388-4b43-ae9c-f7c68642316b | ishandutta2007/codeforces-l | l7-56/normal/1578/L.cpp | #include <bits/stdc++.h>
typedef long long ll;
using namespace std;
const int maxn = 1e5 + 10;
int T,n,ans[maxn],mx[maxn];
struct node {
int a,b,id;
bool operator < (const node &x) const { return a < x.a; }
}v[maxn];
int main() {
scanf("%d", &T);
while (T--) {
scanf("%d", &n);
for (int i = 1; i <= n; ++i) sca... | ALGO | 0.999629 | 3.568027 | {
"github_metadata": {
"branch": "main",
"commit_count": 1,
"repo_created_at": "2024-04-11T06:17: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": "237c95a55828... |
789129f1-41c5-43a2-acef-7749452863a8 | ishandutta2007/codeforces-s | shayan.p/normal/1007/B.cpp | // Remember...
#include<bits/stdc++.h>
#define F first
#define S second
#define PB push_back
#define sz(s) int((s).size())
#define bit(n,k) (((n)>>(k))&1)
using namespace std;
typedef long long ll;
typedef pair<int,int> pii;
typedef pair<ll,ll> pll;
typedef pair<pll,ll> pl3;
typedef pair<pii,int> pi3;
const int ma... | ALGO | 0.99915 | 4.909935 | {
"github_metadata": {
"branch": "main",
"commit_count": 1,
"repo_created_at": "2024-10-30T16: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": "2f521c439d7f... |
f75e9433-3b07-465a-8034-f04110a314d0 | falafel72/robotics-control | vision/distStream.cpp | /*
Receives stereo camera feed and calculates disparity map.
Returns distance value in the middle of the screen.
*/
//Import header files
#include <opencv2/core/core.hpp>
#include <opencv2/highgui/highgui.hpp>
#include <opencv2/imgproc/imgproc.hpp>
#include <opencv2/calib3d/calib3d.hpp>
#include <iostream>
#inc... | ALGO | 0.994892 | 5.58356 | {
"github_metadata": {
"branch": "master",
"commit_count": 10,
"repo_created_at": "2016-12-04T12:24: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": "0e54cfede... |
d9ebcd5c-8e81-410c-97aa-7b7262c63c19 | mohithnd/dsa_in_cpp | codedamn/linear_data_structures/19_queues_using_stacks.cpp | #include <iostream>
#include <stack>
using namespace std;
class Queue
{
public:
int size;
stack<int> s1;
stack<int> s2;
Queue(int size)
{
this->size = size;
}
bool empty()
{
if (s1.empty() && s2.empty())
{
return true;
}
return false;... | ALGO | 0.99635 | 4.652737 | {
"github_metadata": {
"branch": "main",
"commit_count": 254,
"repo_created_at": "2023-10-24T16:33: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": "c9c2d6109d... |
ed0b7c40-8e65-4030-8350-8815e469dab5 | Saurabhmishra1909/DSA | Medium/Modify Linked List-1/modify-linked-list1.cpp | //{ Driver Code Starts
//Initial Template for C++
#include <bits/stdc++.h>
using namespace std;
struct Node* modifyTheList(struct Node *head);
struct Node
{
int data;
struct Node* next;
Node(int x){
data = x;
next = NULL;
}
};
void print(Node *head)
{
Node *temp=head;
wh... | ALGO | 0.999936 | 5.200719 | {
"github_metadata": {
"branch": "master",
"commit_count": 664,
"repo_created_at": "2023-03-23T23:57:25.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "4d0902f2... |
e2304e2e-3722-4508-8815-8af9f5eaa1d6 | gauravahlawat81/Codeforces | Cover it!.cpp | #include <bits/stdc++.h>
using namespace std;
#define FOR(i, j, k) for (int i = (j); i <= (k); i++)
#define FFOR(i, j, k) for (int i = (j); i < (k); i++)
#define DFOR(i, j, k) for (int i = (j); i >= (k); i--)
#define bug(x) cerr << #x << " = " << (x) << '\n'
#define pb push_back
#define mp make_pair
#define bit(s, i) (... | ALGO | 0.999978 | 3.927579 | {
"github_metadata": {
"branch": "master",
"commit_count": 8,
"repo_created_at": "2020-02-24T18:34: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": "c806d3ce97... |
f1e64af5-ce4c-44c3-965c-bb553013fef1 | open-airlab/VTNMPC-Autonomous-Wind-Turbine-Inspection | Wind-Turbine-Inspection/WTI_px4_modified/src/lib/FlightTasks/tasks/FlightTaskOrbit.cpp | /****************************************************************************
*
* Copyright (c) 2017 PX4 Development Team. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
* 1. Redistri... | ALGO | 0.946104 | 6.85787 | {
"github_metadata": {
"branch": "main",
"commit_count": 64,
"repo_created_at": "2022-05-10T08:14:07.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 30,
"forks": 4,
"issues": 1,
"pull_requests": 0
},
"file_meta": {
"content_id": "e375bd927b5... |
1481f0c9-1547-4500-aa02-6b2a42a185e4 | spaghetti-source/algorithm | other/gregorian_calendar.cc | //
// Calendar
//
// Description:
// A code for converting gregorian date <=> julian day number.
//
#include <iostream>
#include <vector>
#include <cstdio>
#include <algorithm>
#include <functional>
using namespace std;
#define fst first
#define snd second
#define all(c) ((c).begin()), ((c).end())
#define TEST(s)... | ALGO | 0.990049 | 3.83117 | {
"github_metadata": {
"branch": "master",
"commit_count": 448,
"repo_created_at": "2013-01-15T08:18:11.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 792,
"forks": 160,
"issues": 2,
"pull_requests": 16
},
"file_meta": {
"content_id": "80d... |
d238709b-23ac-42c9-9bf6-a3daf6c922e8 | Pxguin/cpp | usaco/contests/gold/2012/dec/first.cpp | #include <bits/stdc++.h>
using namespace std;
#define pb push_back
#define f first
#define s second
#define F0R(i, a) for (int i = 0; i < (a); i++)
#define all(x) x.begin(),x.end()
#define v vector
bool adj[30000][26][26];
bool vis[26], stk[26], flag = false;
void dfs(int i, int j) {
vis[j] = stk[j] = true;
... | ALGO | 0.999909 | 3.585659 | {
"github_metadata": {
"branch": "main",
"commit_count": 352,
"repo_created_at": "2024-01-02T19: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": "6683a2322c... |
441f9239-0511-41b6-8cd3-2aeb2c06903c | jyuan2pace/CS232S21 | assign6/task6/labyrinth/MazeGenerator.cpp | #include "MazeGenerator.h"
#include <utility>
#include <random>
#include <vector>
#include <map>
#include <queue>
#include <unordered_set>
#include <algorithm>
using namespace std;
namespace {
template <typename T> using Grid = vector<vector<T>>;
/* Creates a blank grid maze of the given size. */
templ... | ALGO | 0.998763 | 6.74067 | {
"github_metadata": {
"branch": "main",
"commit_count": 125,
"repo_created_at": "2021-01-25T16:53:24.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 13,
"forks": 20,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "b885e010... |
00bfb080-1566-45ef-8e2a-fc79718a1f41 | edouardmenayde/rush-hour | src/Situation.h | #ifndef RUSH_HOUR_SITUATION_H
#define RUSH_HOUR_SITUATION_H
#include <vector>
#include <array>
#include <string>
#include <ostream>
#include <optional>
#include "Vector2.h"
#include "Car.h"
#include "Direction.h"
using namespace std;
class Move {
public:
Direction direction;
uint8_t car_index; // We know we wil... | ALGO | 0.980063 | 4.895888 | {
"github_metadata": {
"branch": "master",
"commit_count": 70,
"repo_created_at": "2019-02-26T20:36:43.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "cf963b02d... |
ece363d5-1e60-4a09-8a54-b590fc2d268f | coldnew/leetcode-solutions | src/0206/0206-Reverse-Linked-List.cpp | #include <stack>
#include "leetcode_utils.h"
/**
* 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) {}
* };
*/
clas... | ALGO | 0.999941 | 6.162299 | {
"github_metadata": {
"branch": "master",
"commit_count": 128,
"repo_created_at": "2022-03-10T03:01:16.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "4dd8b0ae... |
6d567fcb-1a3f-4597-bc98-de520465b288 | Mohit-Kumar-3114/DSA | Array/Lec-1/13.cpp | // Longest subarray with given sum k
#include <bits/stdc++.h>
using namespace std;
// Brute O(n^3) and O(1)
int getLongestSubarray(vector<int>& a, long long k) {
int n = a.size();
int len = 0;
for (int i = 0; i < n; i++) {
for (int j = i; j < n; j++) {
long long s = 0;
... | ALGO | 0.999737 | 5.368423 | {
"github_metadata": {
"branch": "master",
"commit_count": 146,
"repo_created_at": "2025-01-02T08:08: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": "c960df8d... |
1b97ee2c-7f68-42b7-82c4-367b3dd57295 | ijpq/15418 | assignments/assignment3/part2/bfs/main.cpp | #include <cstdio>
#include <cstdlib>
#include <cstring>
#include <iomanip>
#include <string>
#include <iostream>
#include "bfs.h"
#define MASTER 0
#define SILENT "silent"
#define NUM_RUNS 5
int is_same(int *a, int *b, int size) {
for (int i = 0; i < size; i++)
if (a[i] != b[i]) return i;
return size;
}
void... | ALGO | 0.96588 | 5.702436 | {
"github_metadata": {
"branch": "master",
"commit_count": 65,
"repo_created_at": "2021-02-05T11:07:15.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 7,
"forks": 3,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "adc02b072... |
60cfd8e1-209d-4515-ae2f-1563b6ef313b | klb3713/aoapc-book | TrainingGuide/exercises/ch4/01-BasicProblems/uva11817.cpp | // UVa11817 Tunnelling the Earth
// <NAME>
#include<cstdio>
#include<cmath>
using namespace std;
const double R = 6371009;
double torad(double deg) {
return deg/180 * M_PI;
}
void get_coord(double lat, double lng, double& x, double& y, double& z) {
lat = torad(lat);
lng = torad(lng);
x = R*cos(lat)*cos(lng);
... | ALGO | 0.999694 | 4.179635 | {
"github_metadata": {
"branch": "master",
"commit_count": 198,
"repo_created_at": "2013-09-22T01:26:51.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 181,
"forks": 56,
"issues": 1,
"pull_requests": 0
},
"file_meta": {
"content_id": "cf891... |
8e751892-d6d3-4068-8769-6888e00f52a7 | ishandutta2007/codeforces-d | dj3500/normal/246/E.cpp | #include <iostream>
#include <cstdio>
#include <string>
#include <vector>
#include <set>
#include <map>
#include <queue>
#include <cmath>
#include <algorithm>
#include <sstream>
#include <stack>
#include <cstring>
#include <iomanip>
#include <ctime>
using namespace std;
#define pb push_back
#define INF 1001001001
#defi... | ALGO | 0.999439 | 3.668375 | {
"github_metadata": {
"branch": "main",
"commit_count": 1,
"repo_created_at": "2024-04-11T01:31: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": "ed48abfefe38... |
4650da31-b9f6-4590-b6a0-891be828dafd | hjiang13/LLM4IR | results/Task2_IR_Decompilation/DecompiledResuts_Human_x_164_O1/GPT35_Human_x_164_O1_decompiled/test/CPP_16.cpp | ```cpp
#include <string>
#include <cctype>
int count_distinct_characters(std::basic_string<char> *str) {
char *data = &str->_M_dataplus._M_p;
std::size_t size = str->_M_dataplus._M_string_length;
if (size == 0) {
return 0;
}
char *end = data + size;
char *current = data;
char *unique_chars = nu... | TEST | 0.98383 | 5.98902 | {
"github_metadata": {
"branch": "main",
"commit_count": 19,
"repo_created_at": "2025-05-21T20:32:42.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 6,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "04a7a13aa6f... |
f3a166a9-b9bd-4750-bf82-abfe352ae607 | URLinkEVA/AC-project | ACWweekly/75/排队.cpp | #include <iostream>
#include <cstring>
#include <algorithm>
using namespace std;
const int N = 110;
struct Category
{
int id, pr;
string name;
bool operator< (const Category& t) const
{
if(pr != t.pr) return pr < t.pr;
else return id < t.id;
}
}category[N];
int get_pr(string ... | ALGO | 0.999607 | 3.419771 | {
"github_metadata": {
"branch": "main",
"commit_count": 378,
"repo_created_at": "2021-10-06T10:00: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": "d1d70481ad... |
4ef2d2bc-830e-49c1-ba0b-9c8169181e9d | Rushali-Sarkar/data-structures-algorithms | algorithms/geeks_for_geeks/rotateArray.c++ | #include<iostream>
#include<vector>
using namespace std;
vector<int> rotate(vector<int> arr, int rotations) {
vector<int> temp;
int size = arr.size();
rotations = rotations % size;
for (int i = 0; i < rotations; i++)
temp.push_back(arr[i]);
int index = 0;
for (int i = rotations; i ... | ALGO | 0.999905 | 4.657327 | {
"github_metadata": {
"branch": "master",
"commit_count": 46,
"repo_created_at": "2020-09-06T18:50:16.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "90dd93737... |
fcfe1d74-45e7-4041-985e-78825dfe95e8 | Honeta/ACM-ICPC | 21Autumn/211102/B.cpp | #include <iostream>
int main() {
int t;
std::cin >> t;
while (t--) {
long long x, n;
std::cin >> x >> n;
long long ans;
if (x % 2) {
switch (n % 4) {
case 0: ans = x;break;
case 1: ans = x + n;break;
case 2: ans = x ... | ALGO | 0.999965 | 4.16186 | {
"github_metadata": {
"branch": "main",
"commit_count": 1,
"repo_created_at": "2022-01-27T12:44: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": "a5af8c1a7287... |
a13530ec-e8db-4977-9b40-7212076332cc | dsbrown1331/aaai-2018-code | src/conf_bound_test.cpp | #include <iostream>
#include <iomanip>
#include <cmath>
#include <stdlib.h>
#include <ctime>
#include "../include/mdp.hpp"
#include "../include/confidence_bounds.hpp"
#define GRID_WIDTH 4
#define GRID_HEIGHT 4
#define MIN_R -2
#define MAX_R 2
#define CHAIN_LENGTH 6000
using namespace std;
int main( ) {
vector<... | ALGO | 0.998932 | 4.661839 | {
"github_metadata": {
"branch": "master",
"commit_count": 63,
"repo_created_at": "2018-02-13T18:09:27.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 5,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "6f5e55cb9... |
be90462c-cafe-428e-a4e1-6faad29a6dc2 | sfc9982/ACM-Code | 2022-C-Homework/HW-String/D.cpp | //
// Created by sfc9982 on 2022/5/28.
//
#include <algorithm>
#include <cmath>
#include <cstring>
#include <functional>
#include <iomanip>
#include <iostream>
#include <queue>
#include <stack>
#include <string>
using namespace std;
char a1[5000], b1[5000];
int a[5000], b[5000], c[5000], x;
int main()
{
ios::sy... | ALGO | 0.999987 | 4.276441 | {
"github_metadata": {
"branch": "master",
"commit_count": 43,
"repo_created_at": "2022-02-10T14:18:25.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 3,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "b0cfa409f... |
67e231d0-4ad3-4e99-b44b-395cd022cdf8 | LittleYang0531/CQ-CSP-S-2022 | CQ-S00408/holiday/holiday.cpp | //freopen("holiday.in","r",stdin);
//freopen("holiday.out","w",stdout);
//froepen .in","w",stdin
//fropeen frpeoen feroepn gets
//Hahaha~ You're fooled~
//For more information, read the code below.
#include<queue>
#include<cstdio>
#include<vector>
#include<cstdlib>
#include<cstring>
#include<algorithm>
#define hooch ;
... | ALGO | 0.999882 | 3.303334 | {
"github_metadata": {
"branch": "main",
"commit_count": 2,
"repo_created_at": "2022-10-31T10:15: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": "a730d921ff74... |
01401f48-7c12-4820-b9ee-edbaff76434d | devendrajohari/Competitive-Programming | Day4/rowWithMaxOnes.cpp | /*
Given a boolean 2D array of n x m dimensions where each row is sorted. Find the 0-based index of the first row that has the maximum number of 1's.
Example 1:
Input:
N = 4 , M = 4
Arr[][] = {{0, 1, 1, 1},
{0, 0, 1, 1},
{1, 1, 1, 1},
{0, 0, 0, 0}}
Output: 2
Explanation: Row 2 contai... | ALGO | 0.999975 | 5.742239 | {
"github_metadata": {
"branch": "main",
"commit_count": 17,
"repo_created_at": "2022-03-27T04:15: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": "a36ec8623e3... |
13a634f2-7c56-499d-acea-48d5930dc460 | djp952/pvr.rtlradio | src/dabdsp/MathHelper.h | /*
* Copyright (C) 2018
* <NAME> (<EMAIL>)
*
* Copyright (C) 2017
* <NAME> (<EMAIL>)
*
* This file is based on SDR-J
* Copyright (C) 2010, 2011, 2012
* <NAME> (<EMAIL>)
*
* This file is part of the welle.io.
* Many of the ideas as implemented in welle.io are derived from
* oth... | TOOL | 0.955262 | 6.293073 | {
"github_metadata": {
"branch": "main",
"commit_count": 315,
"repo_created_at": "2020-05-11T15:08:58.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 5,
"forks": 7,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "b43454b205... |
000778f6-bdc8-4df3-b17d-d726994ce12a | codewasp942/Code | 20220708/ele/ele.cpp | #include <bits/stdc++.h>
using namespace std;
const int maxn = 1e6 + 5;
int n, mx = INT_MIN;
vector<int> graph[maxn], ans;
queue<int> q;
int pre[maxn], nxt[maxn];
int main() {
freopen("ele.in", "r", stdin);
freopen("ele.out", "w", stdout);
scanf("%d", &n);
pre[0] = n + 1;
nxt[0] = 1;
pre[n + 1] = n;
nxt[n + 1... | ALGO | 0.999976 | 3.898206 | {
"github_metadata": {
"branch": "master",
"commit_count": 61,
"repo_created_at": "2022-08-27T01:22:34.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "47d7f5df0... |
9bd6c9b0-29f7-4c19-852d-aa7067eb3d82 | DavidHerel/PAL | hw5/main.cpp | #include <iostream>
#include <string>
#include <algorithm>
#include <vector>
#include <set>
#include <math.h>
#include <time.h>
#define MIN(x,y) ((x) < (y) ? (x) : (y)) //calculate minimum between two values
/*
void print(std::set<int> const &s)
{
std::copy(s.begin(),
s.end(),
std::ostre... | ALGO | 0.999795 | 4.034057 | {
"github_metadata": {
"branch": "main",
"commit_count": 16,
"repo_created_at": "2020-10-12T17:48: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": "227c767d3bf... |
17cb8bfa-6653-4da1-a1fe-75ebc4a8b8e4 | mdmasudrana271/cp | Week-3/Day-1/B_Odd_Queries.cpp | #include <bits/stdc++.h>
#define ll long long int
using namespace std;
int main()
{
// write c++ program code
ios::sync_with_stdio(false);
cin.tie(NULL);
int t;
cin >> t;
while (t--)
{
int n, q;
cin >> n >> q;
vector<int> v(n + 1);
for (int i = 1; i <= n; i++... | ALGO | 0.999916 | 4.719799 | {
"github_metadata": {
"branch": "main",
"commit_count": 139,
"repo_created_at": "2024-03-15T12:38: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": "ff9f4b5b3d... |
7642db5d-efb4-41a9-8cd2-285ddd1f4781 | OpenSourceRisk/Engine | QuantExt/qle/methods/fdmquantohelper.cpp | /*
Copyright (C) 2020 Quaternion Risk Management Ltd
All rights reserved.
This file is part of ORE, a free-software/open-source library
for transparent pricing and risk analysis - http://opensourcerisk.org
ORE is free software: you can redistribute it and/or modify it
under the terms of the Modified BSD License... | ALGO | 0.991305 | 6.169832 | {
"github_metadata": {
"branch": "master",
"commit_count": 24865,
"repo_created_at": "2016-10-07T09:15:00.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 567,
"forks": 245,
"issues": 58,
"pull_requests": 7
},
"file_meta": {
"content_id": "ca... |
a8214a18-2166-4ea7-9bf2-516af5e1e1cc | Yashu3624/DSA-LEETCODE-GFG | 1092-maximum-difference-between-node-and-ancestor/maximum-difference-between-node-and-ancestor.cpp | /**
* Definition for a binary tree node.
* struct TreeNode {
* int val;
* TreeNode *left;
* TreeNode *right;
* TreeNode() : val(0), left(nullptr), right(nullptr) {}
* TreeNode(int x) : val(x), left(nullptr), right(nullptr) {}
* TreeNode(int x, TreeNode *left, TreeNode *right) : val(x), l... | ALGO | 0.999921 | 5.67595 | {
"github_metadata": {
"branch": "main",
"commit_count": 2664,
"repo_created_at": "2023-03-26T07:10:47.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "152ca7965... |
09dcdd00-de00-45f7-b6c4-38378137126c | AndrewYGHUB/leet | solution/2000-2099/2039.The Time When the Network Becomes Idle/Solution.cpp | class Solution {
public:
int networkBecomesIdle(vector<vector<int>>& edges, vector<int>& patience) {
int n = patience.size();
vector<vector<int>> g(n);
vector<bool> vis(n);
for (auto& e : edges)
{
int u = e[0], v = e[1];
g[u].push_back(v);
... | ALGO | 0.999987 | 5.288975 | {
"github_metadata": {
"branch": "main",
"commit_count": 4,
"repo_created_at": "2022-07-21T06:56: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": "b393b8fc4d08... |
44024f5f-cbb0-4297-af64-bedadab95868 | DianaMarciniak/Repository_1 | Hmwk/Assignment_5/isPrime/main.cpp | /*
* Author: <NAME>
* Created on Jan 30 4:11 PM
* Purpose: isPrime
*/
//System Libraries
#include <iostream>
using namespace std;
//User Libraries
#include <cmath> //For the sqrt function
//Global Constants - Math/Physics Constants, Conversions,
// 2-D Array Dimensions
//Function Prototypes
b... | ALGO | 0.998762 | 4.522733 | {
"github_metadata": {
"branch": "main",
"commit_count": 6,
"repo_created_at": "2024-02-01T03:05: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": "9fc5a66c7798... |
37f16e22-1e4c-46aa-b61e-c755cb4eef08 | Kevin898y/OpenCv | is4.cpp | #include <opencv2/opencv.hpp>
#include <iostream>
#include <cmath>
#include <string>
using namespace std;
using namespace cv;
void detectAndDisplay(Mat&, CascadeClassifier, CascadeClassifier);
int main()
{
Mat frame;
CascadeClassifier face_cascade, eyes_cascade;
String face_cascade_name = "haarcascade_frontalface_a... | ALGO | 0.968959 | 5.249008 | {
"github_metadata": {
"branch": "master",
"commit_count": 27,
"repo_created_at": "2016-07-27T18:02: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": "cc7950b6e... |
860b0fdf-f7fb-4df3-b9cc-5aeea9ba9cc1 | sushmitasah/-100daysofcodingchallenge | problem 8 sorting array elements by its frequency.cpp | Problem:-
/*Given an array A[] of integers, sort the array according to frequency of elements. That is elements that have higher frequency come first. If frequencies of two elements are same, then smaller number comes first.
Input Format:
The first line of input contains an integer T denoting the number of test case... | ALGO | 0.999971 | 5.198936 | {
"github_metadata": {
"branch": "master",
"commit_count": 37,
"repo_created_at": "2019-06-12T11:54:30.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "6df7c9828... |
bc94cae2-0b73-4153-9255-b04cd7c1c456 | luotuoqingshan/acm | NWERC2014/I.cpp | #include <cstdio>
#include <cstring>
#include <algorithm>
#include <iostream>
using namespace std;
typedef long long LL;
int n;
LL L;
LL d[20][20];
#include <unordered_set>
typedef unsigned long long ull;
unordered_set<LL> mp[14][(1<<14) + 5];
int a[20];
int m;
bool flag;
void dfs(int k,int st,LL sum,int type){
... | ALGO | 0.999912 | 3.759949 | {
"github_metadata": {
"branch": "master",
"commit_count": 28,
"repo_created_at": "2016-12-07T15:08: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": "79f46f7c8... |
92e7bf84-d311-4854-a8c1-64a2e7de84bc | Glory-Day/Solutions | Programmers/Level-01/Cpp/푸드_파이트_대회.cpp | #include <iostream>
#include <deque>
#include <vector>
#include <string>
using namespace std;
string solution(vector<int> food) {
string answer = "";
int n = food.size();
for (int i = 0; i < n; i++) {
food[i] /= 2;
}
for (int i = 1; i < n; i++) {
for (int j = 0; j < food[i]; ... | ALGO | 0.999983 | 4.712924 | {
"github_metadata": {
"branch": "master",
"commit_count": 1250,
"repo_created_at": "2021-12-29T11:48: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": "c7ffc89... |
6d381379-18c6-4d02-9948-91c701d17d30 | RocYan98/PAT | A1085.cpp | #include <iostream>
#include <algorithm>
using namespace std;
int ls[100010];
int main() {
int n, p, res = 0;
scanf("%d%d", &n, &p);
for (int i = 0; i < n; ++i) {
scanf("%d", &ls[i]);
}
sort(ls, ls + n);
for (int i = n - 1; i >= 0; --i) {
int max = ls[i];
int temp = max... | ALGO | 0.999947 | 3.701957 | {
"github_metadata": {
"branch": "master",
"commit_count": 38,
"repo_created_at": "2020-03-21T15:30:10.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 3,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "da27ccf38... |
eae3e649-119c-4e4b-84f4-1caac5f11ec5 | KMSBismarck1402/IT | cpp/past_cpp/CPRDIV.cpp | #include <bits/stdc++.h>
using namespace std;
int pttsnt(int n){
int a,s=1;
for(int i = 2; i <= n; i++)
{
a = 0;
while(n % i == 0)
{
++a;
n /= i;
}
if(a)
{
//cout << i;
// if(a > 1) cout << "^" << a;
... | ALGO | 0.999931 | 4.153337 | {
"github_metadata": {
"branch": "main",
"commit_count": 67,
"repo_created_at": "2023-10-02T12:08: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": "ffc4dccfa92... |
411edf3d-7069-42cb-9049-27cf6fd7892b | animeshkarmakarAK/Computer-Programming | LightOj/doubleEndedQueue.cpp | /* solved by- myself solved complete*/
#include<bits/stdc++.h>
using namespace std;
#define qii queue<int>
int main(int argc, char const *argv[])
{
int t;
cin>>t;
for(int tc = 1; tc <= t; tc++)
{
int n,m;
cin>>n>>m;
printf("Case %d:\n",tc);
deque<int>q;
wh... | ALGO | 0.999407 | 4.126125 | {
"github_metadata": {
"branch": "master",
"commit_count": 3,
"repo_created_at": "2019-04-22T16:47:34.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "0e89c14b7e... |
1e6d45c3-aae1-41a6-b0ac-692cc4569163 | NEU-ZYXi/LeetCode-cpp | 43. Multiply Strings.cpp | class Solution {
public:
string multiply(string num1, string num2) {
int n = num1.size(), m = num2.size();
vector<int> tmp(n + m, 0);
for (int i = n - 1; i >= 0; --i) {
for (int j = m - 1; j >= 0; --j) {
int prod = (num1[i] - '0') * (num2[j] - '0');
... | ALGO | 0.999996 | 5.880858 | {
"github_metadata": {
"branch": "master",
"commit_count": 139,
"repo_created_at": "2019-12-11T21:52: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": "7ed24b8c... |
aa11dada-b5d7-4075-b0ec-4987d73245b4 | rudemora/ED | juez17/juez17/juez17.cpp | // juez17.cpp : Este archivo contiene la función "main". La ejecución del programa comienza y termina ahí.
//
#include <iostream>
#include <string>
#include <queue>
#include <stack>
#include <fstream>
using namespace std;
/*@ <answer> */
bool isVowel(char vowel) {
return tolower(vowel) == 'a' || tolower(vowel) ... | ALGO | 0.999896 | 4.662895 | {
"github_metadata": {
"branch": "main",
"commit_count": 26,
"repo_created_at": "2024-02-18T21:08:51.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "ef9b2a7cbeb... |
efd3ec8f-9949-4ad0-a84f-d234c552edaa | paulosantosphs/brkga-mTTP | mTTPDecoder.h | //
// Created by paulo on 17/02/18.
//
#ifndef BRKGA_MTTP_MTTPDECODER_H
#define BRKGA_MTTP_MTTPDECODER_H
#include <list>
#include <vector>
#include <algorithm>
#include <stdlib.h>
#include <time.h>
#include "brkgaAPI/MTRand.h"
#include "mTTPChromosome.h"
class mTTPDecoder {
public:
mTTPDecoder(const std::vector... | ALGO | 0.999374 | 4.785862 | {
"github_metadata": {
"branch": "master",
"commit_count": 6,
"repo_created_at": "2018-08-06T19:45:41.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "7bd2dcfab2... |
1fc4d997-8cf5-48ed-92a5-0e9f98e0b258 | shahnehal0407/CPP | 207-course-schedule/course-schedule.cpp | class Solution {
public:
bool dfs(int node, vector<vector<int>>& adj, vector<int>& vis, vector<int>& recStack) {
vis[node] = 1;
recStack[node] = 1;
for (auto it : adj[node]) {
if (!vis[it]) {
if (dfs(it, adj, vis, recStack)) return true;
} else if (re... | ALGO | 0.999885 | 6.393298 | {
"github_metadata": {
"branch": "main",
"commit_count": 236,
"repo_created_at": "2024-12-05T17:46:22.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "854d3edc73... |
e9cc2a1c-47e8-471d-8e78-6aa0abdccdf4 | justSomeGuyWhoLearnedToCode/someSimpleFunctions | C/p2_zigzag.cpp | /*
Title: zigzag
Author: <NAME>
email: <EMAIL>
Purpose: to print out a binary tree's nodes in zigzag order, meaning
that the printing will be done first from leftmost node to the rightmost node,
then the print out will continue on the next level down from the leftmost to
the rightmost, back and forth until all levels... | ALGO | 0.999994 | 5.391509 | {
"github_metadata": {
"branch": "master",
"commit_count": 8,
"repo_created_at": "2017-02-03T00:00: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": "e501f1a77f... |
af912037-d615-4830-86f7-a0149677ac1f | RamezEssam/AOC-2024 | DAY12/src/day12.cpp | #include <iostream>
#include <string>
#include <fstream>
#include <cstring> // For std::strerror
#include <cerrno> // For errno
#include <vector>
#include <sstream>
#include <stdexcept>
#include <tuple>
#include <unordered_set>
#include <queue>
const char* INPUT_FILE_PATH = "..\\..\\DAY12\\input\\input.txt";
type... | ALGO | 0.999491 | 5.40198 | {
"github_metadata": {
"branch": "master",
"commit_count": 18,
"repo_created_at": "2024-12-06T17:13:47.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "a87467c8b... |
4047689e-237c-41c9-8310-fd195009a763 | dotSlash-Adwitiya/Dynamic-Programming | HouseRobber-II.cpp | #include<bits/stdc++.h>
using namespace std;
int rob(vector<int>& nums) {
int prevIdx = nums[0], prev2Idx = 0, currIdx = 0;
// * Applying the logic excluding the LAST Element
for(int i = 1; i < nums.size()-1; i++) {
int take = nums[i] + prev2Idx;
int notTake = prevIdx;
currIdx = max(take, notT... | ALGO | 0.99998 | 4.963398 | {
"github_metadata": {
"branch": "main",
"commit_count": 91,
"repo_created_at": "2024-06-18T17:32: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": "31aea1aa42f... |
5bb0f754-db55-482c-8553-99245003927c | jinoo7099/algorithm | boj/c++/2xx/2206.cpp | #include <bits/stdc++.h>
#define ll long long
#define pii pair<int, int>
#define endl '\n'
#define sp ' '
#define X first
#define Y second
using namespace std;
const int dx[4] = {-1, 0, 1, 0};
const int dy[4] = {0, 1, 0, -1};
int n, m;
string d[1002];
int vis[1002][1002][2]; // 0 -> block 사용, 1 -> block 사용 안함
int ... | ALGO | 0.999973 | 4.30796 | {
"github_metadata": {
"branch": "master",
"commit_count": 83,
"repo_created_at": "2022-03-12T04:58: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": "91a46f1d8... |
9a8a7d32-c0a1-4448-b661-86b2f710d5e7 | BhaskarBVV/PenCode | Binary Tree/Pseudo-Palindromic Paths in a Binary Tree.cpp | class Solution
{
public:
void dfs(TreeNode *root, int &cnt, int odd, map<int, int>&mp)
{
if (root == NULL)
{
return;
}
// checking for the count of that number
// for making a plaindrome, only <=1 number should have odd counts, while all other should be present even numbe... | ALGO | 0.999973 | 5.163921 | {
"github_metadata": {
"branch": "main",
"commit_count": 615,
"repo_created_at": "2021-09-03T14:47:29.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 3,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "82e6529b8d... |
9f1e2303-c6f5-4827-a0ed-7630d773afc1 | simonrozsival/racer | catkin_ws/src/racer/include/racer/following_strategies/target_error_calculator.h | #pragma once
#include <iostream>
#include <vector>
#define _USE_MATH_DEFINES
#include <cmath>
#include "racer/math/angle.h"
#include "racer/track/occupancy_grid.h"
#include "racer/vehicle/rpm.h"
#include "racer/vehicle/trajectory.h"
namespace racer::following_strategies {
template <typename State> class target_erro... | ALGO | 0.99671 | 7.03746 | {
"github_metadata": {
"branch": "master",
"commit_count": 888,
"repo_created_at": "2018-02-10T18:07: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": "c45c0ee1... |
2ec82f58-afe9-4782-b3d6-2eee638c80b8 | aryamanarora/competitive-programming | competitions/usaco/training_pages/1/1.6/pprime.cpp | /*
ID: aryaman4
TASK: pprime
LANG: C++14
*/
#include <iostream>
#include <vector>
#include <fstream>
#include <algorithm>
#include <string>
#include <cmath>
using namespace std;
vector<long long> pals = {1, 3, 5, 7, 9};
bool is_prime (long long x)
{
bool prime;
if (x <= 1) return false;
else if (x == 2)... | ALGO | 0.999944 | 4.483202 | {
"github_metadata": {
"branch": "master",
"commit_count": 49,
"repo_created_at": "2018-06-13T03:25:36.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 9,
"forks": 1,
"issues": 2,
"pull_requests": 0
},
"file_meta": {
"content_id": "9a3c302d8... |
9e4dcfd4-b56d-49ca-8287-7eed3c07d056 | gKSD/GraphAlgorithms | Graph.cpp | //
// Created by sofia on 03.04.16.
//
#include <stdexcept>
#include <vector>
#include <algorithm>
#include "Graph.h"
// печать матриц, конкретная матрица для печати задается индентификатором identfier
void Graph::print_matrix(std::string const& identifier)
{
#define print_matrix_impl(m) \
{ \
for (auto const &... | ALGO | 0.991229 | 3.937208 | {
"github_metadata": {
"branch": "master",
"commit_count": 3,
"repo_created_at": "2016-04-04T20:10: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": "783017c8bd... |
0d6659b1-bfaa-465e-be7e-170e2878421c | hunjin-choi/huchoi-git | 42seoul/cpp/cpp07/ex01/main.cpp | #include "iter.hpp"
std::ostream &operator<<(std::ostream &ost, int ptr[])
{
ost<<ptr[0]<<" "<<ptr[1]<<" "<<ptr[2]<<" "<<ptr[3];
return ost;
}
std::ostream &operator<<(std::ostream &ost, float ptr[])
{
ost<<ptr[0]<<" "<<ptr[1]<<" "<<ptr[2]<<" "<<ptr[3];
return ost;
}
class Awesome
{
public:
Awesome( void ) : ... | TOOL | 0.939034 | 5.160049 | {
"github_metadata": {
"branch": "main",
"commit_count": 1113,
"repo_created_at": "2020-12-22T02:22: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": "998c496fe... |
b9b59b32-2cc6-4612-9dfc-e93568098a8c | capn-freako/ibisami | src/ami_rx.cpp | /** \file ami_rx.cpp
* \brief Implementation of AmiRx class.
*
* Original author: <NAME> <br>
* Original date: May 20, 2015
*
* Copyright (c) 2015 <NAME>; all rights reserved World wide.
*/
#include <sstream>
#include <string>
#include <vector>
#include <algorithm>
#include <memory>
#include "include/ami_rx.... | ALGO | 0.924132 | 6.500208 | {
"github_metadata": {
"branch": "master",
"commit_count": 56,
"repo_created_at": "2015-04-29T12:41:57.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 13,
"forks": 5,
"issues": 4,
"pull_requests": 0
},
"file_meta": {
"content_id": "4cc05628... |
3d0c1c60-fd45-4ce9-80c1-3551e3e67119 | JaySsuh/library-management | libraryManagement.cpp | #include <algorithm> // std::find_if
#include <iostream>
#include <limits>
#include <string>
#include <vector> //Book objects are stored in a vector
// Book class and its derived classes
class Book {
protected: //protected vals
int isbn;
std::string title;
std::string author;
int edition;
std::string publish... | TOOL | 0.990227 | 5.106525 | {
"github_metadata": {
"branch": "main",
"commit_count": 3,
"repo_created_at": "2024-01-23T23:03:39.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "4753cf746e28... |
9eaf3552-11d7-4d82-8e6a-398daf8166d1 | raincross7/code-similarity | codes/train_code/problem004/problem004_44.cpp | #include <bits/stdc++.h>
using namespace std;
int main() {
int N, K, R, S, P; cin >> N >> K >> R >> S >> P;
string T; cin >> T; int64_t sum = 0;
vector<bool> vec(N, true);
for (int i = 0; i < N - K; i++) {
if (vec[i] && T.at(i) == T.at(i + K)) vec[i + K] = false;
}
for (int i =... | ALGO | 0.998224 | 4.493718 | {
"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": "43e4ef3d01bd... |
4d668a3d-1e28-444d-9dd6-54ce5dcd493c | Vaa3D/vaa3d_tools | released_plugins/v3d_plugins/bigneuron_siqi_stalker_v3d/lib/ITK_include/itkManifoldParzenWindowsPointSetFunction.h | /*=========================================================================
*
* Copyright Insight Software Consortium
*
* 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
*
* h... | ALGO | 0.986147 | 7.461014 | {
"github_metadata": {
"branch": "master",
"commit_count": 7983,
"repo_created_at": "2016-01-27T18:19:17.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 110,
"forks": 70,
"issues": 11,
"pull_requests": 12
},
"file_meta": {
"content_id": "342... |
8d34bdf3-c7c3-4ef0-81e0-2426b7e5f0a5 | Uintah/Uintah | src/CCA/Components/Wasatch/Expressions/Particles/ParticleGasMomentumSrc.h | #ifndef ParticleGasMomentumSrc_h
#define ParticleGasMomentumSrc_h
#include <expression/Expression.h>
#include <spatialops/particles/ParticleFieldTypes.h>
#include <spatialops/particles/ParticleOperators.h>
//====================================================================
/**
* @class ParticleGasMomentumSrc
*... | TOOL | 0.908236 | 5.895698 | {
"github_metadata": {
"branch": "master",
"commit_count": 55375,
"repo_created_at": "2019-09-03T20:22:50.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 63,
"forks": 23,
"issues": 12,
"pull_requests": 1
},
"file_meta": {
"content_id": "3e55... |
8aa6005e-70c5-45f8-ac4f-7a3605cda652 | sharmaachintya/DSA | Trees/Heap/MergeKSortedArrays.cpp | #include<iostream>
#include<bits/stdc++.h>
using namespace std;
class node{
public:
int data;
int i;
int j;
node(int data, int row, int col)
{
this->data = data;
i = row;
j = col;
}
};
class compare{
public:
bool opera... | ALGO | 0.999989 | 5.16686 | {
"github_metadata": {
"branch": "main",
"commit_count": 554,
"repo_created_at": "2022-03-12T16:03:17.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 3,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "af40e2b06b... |
22129534-cb4f-406d-a821-185da147c269 | Lydxn/Competitive-Programming | DMOJ/acmtryouts2b.cpp | #include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
using namespace std;
using namespace __gnu_pbds;
typedef long long ll;
typedef unsigned long long ull;
typedef long double ld;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;
typedef pair<ll, int> plli;
typedef pair<int, ll> pill;
typedef pair<pa... | ALGO | 0.999792 | 3.959315 | {
"github_metadata": {
"branch": "main",
"commit_count": 14,
"repo_created_at": "2021-04-25T03:16:41.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "2f770a9016a... |
ebdc1f6b-3791-475c-ac77-26fd5db101ef | jaeseung-lee/ps | cc/12904.cpp | #include <iostream>
#include <vector>
using namespace std;
#define endl '\n'
vector<char> S;
vector<char> T;
void input();
void solve();
int main() {
cin.tie(NULL);
cout.tie(NULL);
input();
solve();
return 0;
}
void input() {
while (true) {
char temp = getchar();
if (temp == '\n') {
break;
}
el... | ALGO | 0.999961 | 3.422263 | {
"github_metadata": {
"branch": "main",
"commit_count": 60,
"repo_created_at": "2021-09-20T13:02: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": "d759660bb4f... |
eb7f34b2-50a4-4d62-b744-9eefbc772b25 | corteva/trino-odbc | src/driver/config/driverConfig.cpp | #include "driverConfig.hpp"
#include "../../util/capitalize.hpp"
#include "../../util/writeLog.hpp"
std::vector<std::string> LOG_LEVEL_NAMES = {
"None", "Error", "Warn", "Info", "Debug", "Trace"};
std::vector<LogLevel> LOG_LEVEL_VALUES = {
LL_NONE, LL_ERROR, LL_WARN, LL_INFO, LL_DEBUG, LL_TRACE};
std::map<L... | CONFIG | 0.93111 | 6.081589 | {
"github_metadata": {
"branch": "main",
"commit_count": 13,
"repo_created_at": "2025-01-24T16:13:51.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 10,
"forks": 4,
"issues": 1,
"pull_requests": 0
},
"file_meta": {
"content_id": "f0b6f606a6f... |
0c3f7ef0-92d3-45f6-a29d-7a431295dd92 | Marwanthe0/XPSC | Week_9/Day_3/D_Ingenuity_2.cpp | #include <bits/stdc++.h>
using namespace std;
#define ll int64_t
#define M 1000000007
#define N 1000000
#define endl "\n"
#define all(v) v.begin(), v.end()
#define forn for (int i = 0; i < n; i++)
#define yes cout << "YES" << endl
#define no cout << "NO" << endl
void marwan()
{
int n;
cin >> n;
string s;
... | ALGO | 0.999964 | 4.15411 | {
"github_metadata": {
"branch": "main",
"commit_count": 144,
"repo_created_at": "2024-10-27T17:56: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": "2b557d8ffd... |
7a560ec0-8a14-44f6-9897-67d35fcd87e6 | Neverous/xivlo08-11 | 2008/2008-10-30/ram9.cpp | /* 2008
<NAME>
XIV LO Wrocław
*/
/* COLLATZ
* 1.Dla danej liczby naturalnej b rozważamy następujący ciąg c(b):
* Pierwszym elementem ciągu jest liczba b;
* Kolejne elementy ciągu tworzymy na podstawie poprzedniego g następującej zasady:
* a. Jeśli poprzedni element jest liczbą parzystą,
* to kolejny otrzymuje... | ALGO | 0.999777 | 4.269559 | {
"github_metadata": {
"branch": "master",
"commit_count": 2,
"repo_created_at": "2016-03-22T13:45:07.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "cfc3b31474... |
b854127e-d9d9-4b42-a68c-adc99c49c9b2 | rajaditya-m/Recalc_Final_Demo_Fork | src/marching_cube/hammock_level_set.h | #pragma once
#ifndef HAMMOCK_LEVEL_SET
#define HAMMOCK_LEVEL_SET
#include <Eigen/Dense>
#include <cmath>
#include "vector_lib.h"
class HammockLevelSet {
public:
typedef Eigen::Vector3d Vec3;
HammockLevelSet(double width, double height, double radius,
int nx, int ny) {
width_ = width;
heig... | TOOL | 0.928098 | 5.656166 | {
"github_metadata": {
"branch": "master",
"commit_count": 2,
"repo_created_at": "2015-05-29T20:00:42.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "40a76e5df9... |
6edc784d-838c-44ec-9594-524c5383e3f5 | n-west/bliss | bliss/drift_search/integrate_drifts.cpp |
#include "drift_search/integrate_drifts.hpp"
#include "kernels/drift_integration_bland.hpp"
#include "kernels/drift_integration_cpu.hpp"
#if BLISS_CUDA
#include "kernels/drift_integration_cuda.cuh"
#endif
#include <bland/bland.hpp>
#include <fmt/core.h>
#include <fmt/ranges.h>
using namespace bliss;
std::vector<fr... | ALGO | 0.985199 | 6.475673 | {
"github_metadata": {
"branch": "main",
"commit_count": 198,
"repo_created_at": "2023-11-29T19:20:17.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 8,
"forks": 3,
"issues": 9,
"pull_requests": 0
},
"file_meta": {
"content_id": "964f8c5608... |
07cba3ef-40e5-46b2-98dc-606e17d5bfbd | minus3theta/contest | lib/bit.cpp | // 1-indexed
template <class T, class Op = T (*) (T, T)>
struct Bit {
int n;
vector<T> dat;
Op op;
T unit;
Bit(int n, Op op = Op(), T unit = T()) : n(n), dat(n + 1, unit), op(op), unit(unit) {
}
Bit(const vector<T> &arr, Op op = Op(), T unit = T())
: n(arr.size()), dat(arr.size() + 1), op(op), unit(un... | ALGO | 0.998782 | 6.145123 | {
"github_metadata": {
"branch": "master",
"commit_count": 601,
"repo_created_at": "2016-10-02T12:21:10.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 407
},
"file_meta": {
"content_id": "524692... |
712f6331-aaa6-472f-a0b6-a5e3f07dbe56 | Priyankachilhate/project | sum.cpp | #include <iostream>
using namespace std;
int n,num;
class A {
public:
A() { mData = -1; mNext = NULL; }
~A() {}
int data() { return mData; }
void setData(int data) { mData = data; }
A* next() { return mNext; }
void setNext(A* next) { mNext = next; }
private:
... | ALGO | 0.999753 | 4.029652 | {
"github_metadata": {
"branch": "master",
"commit_count": 3,
"repo_created_at": "2017-03-09T14:22: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": "163a12f206... |
9e387e5c-a853-4842-b390-4cade81c8f63 | andyyang200/CP | Competitive Programming/Contests/CSacademy/Round 33/Numbers Tournament/rename_this.cpp | //<NAME>
#include <iostream>
#include <stdio.h>
#include <sstream>
#include <fstream>
#include <string>
#include <string.h>
#include <vector>
#include <deque>
#include <queue>
#include <stack>
#include <set>
#include <unordered_set>
#include <map>
#include <unordered_map>
#include <algorithm>
#include <functional>
#inc... | ALGO | 0.999821 | 3.185095 | {
"github_metadata": {
"branch": "master",
"commit_count": 2,
"repo_created_at": "2019-10-24T22:41: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": "e4ae2bddad... |
62cbbd80-35fa-40f4-9a0a-c120bac4c1b3 | sageslayers/CP | CoderClassCompfest/Paradigma Penyelesaian Masalah/Divide&Conquer/a.cpp | #include <bits/stdc++.h>
using namespace std ;
int n , a , b;
long long ans ;
long long binser(long long l , long long r ) {
if( r >= l ){
long long mid = (l + r) / 2 ;
long long kpk = 1ll*a* (b / __gcd(a,b));
long long res = (mid / a) + (mid / b ) - (mid / kpk ) ;
bool check = false ;
if ( mid % a == 0 || mid %... | ALGO | 0.999935 | 4.23353 | {
"github_metadata": {
"branch": "master",
"commit_count": 20,
"repo_created_at": "2019-12-06T13:38: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": "8a63929b1... |
c354268f-b650-418a-ba1f-cb9afa7d761a | shivansh2502/Competitive-Programming | codechef/long/sept_2020/Find_XOR.cpp | #include<bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
using namespace __gnu_pbds;
using namespace std;
#define f(i,n) for(int i=0;i<n;i++)
#define fs(i,s,n) for(int i=s;i<n;i++)
#define ff first
#define ss second
#define int long long
#define pb push_bac... | ALGO | 0.999417 | 3.681446 | {
"github_metadata": {
"branch": "master",
"commit_count": 14,
"repo_created_at": "2020-01-16T12:54: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": "6aec38943... |
26232710-5fee-45ae-b44f-22f1f42632e4 | simongog/sdsl-lite | examples/sa-int-construct-from-file.cpp | #include <iostream>
#include <fstream>
#include <sdsl/suffix_trees.hpp>
using namespace sdsl;
using namespace std;
int main(int argc, char* argv[])
{
if (argc > 1) {
string file = string(argv[1]);
string ofile = file + ".sa";
if (argc > 2) {
ofile = argv[2];
}
... | ALGO | 0.993571 | 3.903471 | {
"github_metadata": {
"branch": "master",
"commit_count": 1969,
"repo_created_at": "2013-02-28T22:34:07.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2269,
"forks": 354,
"issues": 71,
"pull_requests": 25
},
"file_meta": {
"content_id": "... |
ec6eb134-d802-4355-bed8-95e08d898bf6 | chkg2a/Competitive-Programming | LeetCode/NeetCodeIo/Stack/739.temperature.cpp | #include <algorithm>
#include <chrono>
#include <iostream>
#include <stack>
#include <unordered_map>
#include <unordered_set>
#include <vector>
using namespace std;
/*vector<int> dailyTemperatures(vector<int> &temperatures) {*/
/* vector<int> output;*/
/* for (int i = 0; i < temperatures.size(); i++) {*/
/* int c... | ALGO | 0.999455 | 5.54719 | {
"github_metadata": {
"branch": "main",
"commit_count": 48,
"repo_created_at": "2024-09-18T14:49: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": "de04531f4fd... |
3f6773ad-2c6e-4d05-a54b-f2303835703d | larizasandoval/regresion-lineal | regresionl.cpp | #include "regresionl.h"
#include <iostream>
using namespace std;
RegresionL::RegresionL()
{
numeroPuntos=0;
}
RegresionL::RegresionL(int numeroPunto)
{
numeroPuntos=numeroPunto;
}
void RegresionL::establecerNumeroPuntos(int n)
{
numeroPuntos=n;
Puntos_ = new Punto[numeroPuntos];
}
int RegresionL::... | ALGO | 0.950378 | 3.651464 | {
"github_metadata": {
"branch": "main",
"commit_count": 3,
"repo_created_at": "2022-03-08T04:02: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": "8ea2dc88e49b... |
5421111a-2077-4527-8b3a-61e7aa94c878 | iamishansharma/Placement-Preparation | DSA/LeetCode/Tree/Lowest Common Ancestor of Deepest Leaves.cpp | /**
* Definition for a binary tree node.
* struct TreeNode {
* int val;
* TreeNode *left;
* TreeNode *right;
* TreeNode() : val(0), left(nullptr), right(nullptr) {}
* TreeNode(int x) : val(x), left(nullptr), right(nullptr) {}
* TreeNode(int x, TreeNode *left, TreeNode *right) : val(x), l... | ALGO | 0.999983 | 6.206055 | {
"github_metadata": {
"branch": "master",
"commit_count": 238,
"repo_created_at": "2020-04-28T15:51:37.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 13,
"forks": 13,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "db94c9... |
459d16eb-861a-4252-aedd-f9794627d06a | buckeye-cn/ACM_ICPC_Materials | solutions/kattis/coci06/v_hcz.cpp | // https://open.kattis.com/problems/v
#include <cstdlib>
#include <cstdint>
#include <cstdio>
#include <cmath>
#include <cstring>
#include <string>
#include <iostream>
using namespace std;
int get_digits(long i) {
int result = 0;
while (i) {
result |= 1 << (i % 10);
i /= 10;
}
retur... | ALGO | 0.999277 | 3.920943 | {
"github_metadata": {
"branch": "master",
"commit_count": 1094,
"repo_created_at": "2017-09-09T18:26:27.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 40,
"forks": 6,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "815d25e... |
57d1d487-e5da-4422-8ead-7236420fb83c | pmmm3/Universidad | Segundo/SCD/scd_prac/semaforos/4fumadores.cpp | #include <iostream>
#include <thread>
#include <chrono>
#include<mutex>
#include<random>
#include <unistd.h> //Para el sleep()
#include <stdlib.h> // necesario para random(), srandom()
#include <time.h> // necesario para time()
#include "Semaphore.h" // incluye tipo 'Semaphore'
using namespace std ; // permite acortar... | ALGO | 0.959415 | 3.840395 | {
"github_metadata": {
"branch": "main",
"commit_count": 10,
"repo_created_at": "2021-11-25T21:54: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": "265aeee3855... |
e5efecf5-3c82-4ca0-ab49-08598433d096 | CitrusSin/AlgorithmProblemAnswers | Contest/ThirdEnt/k_table.cpp | #include <bits/stdc++.h>
using namespace std;
int reg[11][11];
int calculate(int a, int b) {
if (a > b) return reg[b-1][a-1];
double da = a, db = b;
int sq = max(a, b);
double total = 0;
constexpr double step = 1e-2;
for (double x=-sq; x<=sq; x+=step) {
for (double y=-sq; y<=sq; y+=step... | ALGO | 0.997993 | 4.541064 | {
"github_metadata": {
"branch": "main",
"commit_count": 141,
"repo_created_at": "2023-01-08T13:54: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": "544616df8c... |
4906f125-e745-4afe-816e-c6eae35330a9 | rishisankar/icpc | codeforces/689/C.cpp | #include <bits/stdc++.h>
using namespace std;
// COMPILER: GNU C++17
int main() {
int t;
cin >> t;
cout.setf(ios::fixed);
cout.precision(10);
for (int i = 0; i < t; ++i) {
int n, m;
cin >> n >> m;
vector<int> vec(n);
for (int j = 0; j < n; ++j) {
cin >... | ALGO | 0.999838 | 3.764527 | {
"github_metadata": {
"branch": "main",
"commit_count": 324,
"repo_created_at": "2021-01-08T15:36:08.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "87d5c9c9df... |
e2218e1b-026c-441f-be67-fd6b6e5824e2 | RosettaCommons/rosetta | source/src/core/energy_methods/BranchEnergy.cc | // -*- mode:c++;tab-width:2;indent-tabs-mode:t;show-trailing-whitespace:t;rm-trailing-spaces:t -*-
// vi: set ts=2 noet:
//
// (c) Copyright Rosetta Commons Member Institutions.
// (c) This file is part of the Rosetta software suite and is made available under license.
// (c) The Rosetta software is developed by the co... | ALGO | 0.981909 | 6.812221 | {
"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": "9e8c... |
4afc0719-503d-48f3-a020-19ed69c0135d | vuanvin/leetcode | JianzhiOfferII/097.cpp | #include <bits/stdc++.h>
using namespace std;
class Solution {
public:
int numDistinct(string s, string t) {
int n = s.size();
int m = t.size();
if (m == 0 || n < m) { return 0; }
vector<vector<unsigned>> f(m, vector<unsigned>(n, 0));
f[0][0] = ((t[0] == s[0]) ? 1 : 0);
... | ALGO | 0.999989 | 5.616308 | {
"github_metadata": {
"branch": "C++",
"commit_count": 73,
"repo_created_at": "2020-10-15T09:46:39.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "721b4099dedc... |
9c195bc9-8b93-433c-85c3-d77512f4afeb | suvigyavijay/IntroPDP | A1/A1Q1/a1.hpp | /* SUVIGYA
* VIJAY
* suvigyav
*/
#ifndef A1_HPP
#define A1_HPP
#include <vector>
#include <omp.h>
std::vector<float> compute_col_sums(const std::vector<float>& K, int kernel_size) {
std::vector<float> col_sums(kernel_size, 0.0f);
for (int col = 0; col < kernel_size; col++) {
for (int row = 0; ... | ALGO | 0.997 | 5.564063 | {
"github_metadata": {
"branch": "main",
"commit_count": 16,
"repo_created_at": "2023-09-29T08:46:49.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "c21b8d0a6b3... |
77d7fe9e-714f-4d7a-bf18-004f6d8c3d5b | yeedaKing/CSCI-2421-Assignment-3 | List.h | //
// List.h
// DoublyLinkedList
//
// Created by <NAME> on 9/24/20.
//
#include<iostream>
#include "Node.h"
using namespace std;
#ifndef List_h
#define List_h
class List
{
private:
Node* headPtr;
Node* tailPtr;
public:
List()
{
headPtr = new Node();
tailPtr = new Node();
he... | TOOL | 0.959725 | 5.220142 | {
"github_metadata": {
"branch": "main",
"commit_count": 11,
"repo_created_at": "2024-02-24T22:37:07.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "bec7a527c61... |
4bc32b1e-158f-4bf8-89b4-35ebec125964 | gabrielms98/aulasEDD | pratica14/arquivosAula14/geraDigitosCPF.cpp | #include <iostream>
#include <string>
#include <cstdlib>
#include <iomanip>
using namespace std;
int converte(char c);
int main(){
int n;
cin >> n;
string cpf;
for(int i=0; i<n; i++){
int somaP=0;
int somaS=0;
int nPrimeiro=10;
cin >> cpf;
for(int j=0; j<9; j++){
somaP+=converte(c... | ALGO | 0.999415 | 3.896487 | {
"github_metadata": {
"branch": "master",
"commit_count": 16,
"repo_created_at": "2018-05-15T20:32: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": "8199b0810... |
87809082-1439-42d5-9af5-6f53ee97e754 | zxc6147/algorithm | Algo/b2447별찍기.cpp | // https://www.acmicpc.net/problem/2447
#include <iostream>
#include <cstring>
using namespace std;
void draw(char** arr, int n) {
for (int i = 0; i < n; i++) {
for (int j = 0; j < n; j++) {
cout << arr[i][j];
}
cout << endl;
}
}
// 만약 n == 9면
// 3<= <6까지 공백
void setBlank(char** arr, int n, int startRow... | ALGO | 0.999687 | 4.208031 | {
"github_metadata": {
"branch": "master",
"commit_count": 5,
"repo_created_at": "2021-06-10T08:52: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": "863917a7c8... |
4776ebb5-df9f-4de1-adbe-37a4fd48433b | ebeilmann/DixieStateUniversity | cs4300/ai-lib/src/Search/Graph.cpp | #include "ai_search.h"
namespace ai
{
namespace Search
{
Graph::Graph(Problem *problem_in, Fringe *fringe_in)
: Algorithm(problem_in, fringe_in)
{
}
Graph::~Graph()
{
}
bool Graph::Search()
{
number_nodes_generated = 0;
max_nodes_stored = 0;
... | ALGO | 0.999976 | 5.682771 | {
"github_metadata": {
"branch": "master",
"commit_count": 228,
"repo_created_at": "2015-01-30T18:03:05.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 2,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "3f6c5889... |
9c302035-ad59-4126-a5a0-0e2f43f75045 | MichaelWDalby/CheyetteLocalVolatility | CompFin_32/xlExport.cpp | #include <windows.h>
#include <cmath>
#include "xlcall.h"
#include "framework.h"
#include "xlOper.h"
#include "../Utility/kMatrixAlgebra.h"
#include "../Utility/kBachelier.h"
#include "../Utility/kBlack.h"
#include "../Utility/xlUtils.h"
#include "../Utility/kFd1d.h"
#include "../Utility/kCheyette.h"
// Wrappers
... | TOOL | 0.993776 | 4.017516 | {
"github_metadata": {
"branch": "master",
"commit_count": 1,
"repo_created_at": "2023-05-29T20:33:12.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "5c9f8644d4... |
dc91b4a3-a20e-469c-aa30-d35e0896b8cc | koide3/ndt_omp | include/pclomp/voxel_grid_covariance_omp_impl.hpp | /*
* Software License Agreement (BSD License)
*
* Point Cloud Library (PCL) - www.pointclouds.org
* Copyright (c) 2010-2011, <NAME>, Inc.
*
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* ... | ALGO | 0.998963 | 6.551726 | {
"github_metadata": {
"branch": "master",
"commit_count": 63,
"repo_created_at": "2018-01-01T07:55:38.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 795,
"forks": 354,
"issues": 28,
"pull_requests": 4
},
"file_meta": {
"content_id": "316e... |
9d36beae-022f-4a84-be1a-99577f2078b5 | ishandutta2007/codeforces-m | majk/normal/1237/D.cpp | /**
* code generated by JHelper
* More info: https://github.com/AlexeyDmitriev/JHelper
* @author majk
*/
#ifndef MAJK_LIB
#define MAJK_LIB
#include <vector>
#include <stack>
#include <iostream>
#include <unordered_map>
#include <unordered_set>
#include <map>
#include <iomanip>
#include <set>
#include <functional>... | ALGO | 0.999979 | 4.155603 | {
"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": "7d4609cd3220... |
b660a914-e646-483f-b927-b39e116f6d73 | kagemiku/atcoder-contests | abc/085/d.cpp | #include <iostream>
#include <vector>
#include <map>
#include <string>
#include <cmath>
#include <algorithm>
#define FOR(i,a,b) for(int (i)=(a);(i)<(b);(i)++)
#define REP(i,n) FOR(i,0,n)
#define RER(i,n) FOR(i,0,(n+1))
#define pb push_back
#define mp(a,b) make_pair((a),(b))
#define mset(m,v) mems... | ALGO | 0.999861 | 3.745679 | {
"github_metadata": {
"branch": "master",
"commit_count": 36,
"repo_created_at": "2016-02-03T10:48: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": "9067d054a... |
8158df71-811f-47e3-84e2-4dd18538507e | vldk-exists/LeetCode-daily-tasks | task21.cpp | /*
In MATLAB, there is a handy function called reshape which can reshape an m x n matrix into a new one with a different size r x c keeping its original data.
You are given an m x n matrix mat and two integers r and c representing the number of rows and the number of columns of the wanted reshaped matrix.
The reshape... | ALGO | 0.998852 | 6.128582 | {
"github_metadata": {
"branch": "main",
"commit_count": 71,
"repo_created_at": "2025-05-14T16:31: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": "4e4107e52ab... |
c9790296-89eb-4ba1-98cd-c5c0a57613e2 | IntelligentSoftwareSystems/Galois | libpangolin/include/pangolin/mgraph.h | #pragma once
#include <set>
#include <string>
#include <vector>
#include <sstream>
#include <fstream>
#include <iostream>
#include <algorithm>
#include "pangolin/types.h"
struct MEdge {
IndexT src;
IndexT dst;
ValueT elabel;
MEdge() : src(0), dst(0), elabel(0) {}
MEdge(IndexT from, IndexT to, ValueT el) : sr... | ALGO | 0.986987 | 3.302524 | {
"github_metadata": {
"branch": "master",
"commit_count": 9932,
"repo_created_at": "2018-06-18T17:33:03.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 331,
"forks": 139,
"issues": 57,
"pull_requests": 7
},
"file_meta": {
"content_id": "e52... |
001ed8b7-dec3-40ba-81f2-4a21e40f8fac | Radcan81654/leetcode-exercise | 所有可达路径/2025.2.14.cpp | //https://kamacoder.com/problempage.php?pid=1170
#include <iostream>
#include <vector>
using namespace std;
vector<int> path;
vector<vector<int>> result;
//当前遍历的结点start,到达结点cur
void dfs(vector<vector<int>>& arr, int cur, int n)
{
if (n == cur)
{
result.push_back(path);
return;
}
for (int... | ALGO | 0.999995 | 4.15742 | {
"github_metadata": {
"branch": "main",
"commit_count": 78,
"repo_created_at": "2024-11-19T05: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": "cd5be5a1a4e... |
4ea39502-c586-4386-96ec-2446707231dd | Big-Red-Sat/Big-Red-Sat-1 | Flight Hardware/flight_computer/v3/Firmware/brs_fc_v2/brs_fc_v2.ino | #include "Energia.h"
#include "FSS100.h"
#include <MCP9808.h>
#include <OneWire.h>
#include <stdio.h>
#include "NSL_EPS.h"
#include <Wire.h>
#include <MLX90393.h>
#include <TinyBME280.h>
#include <ICM20649.h>
#define DEBUGGING
//#define SOLAR_TEST
//#define ROTATION_TEST
#define STATIC_TEST
//#define POWER_TEST
//#def... | TOOL | 0.936256 | 5.404579 | {
"github_metadata": {
"branch": "main",
"commit_count": 209,
"repo_created_at": "2023-11-23T02:37:26.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 4,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "17af2cdfdc6... |
0f8f5822-71b4-435f-b544-3e777919c314 | Aditya9790/DSA-in-Cpp | Recursion/N-Queen.cpp | #include<bits/stdc++.h>
using namespace std;
// check if a queen is placed at arr[x][y] then is it safe .
// i.e. there is no any other queen placed in row x, col y and in left and right upper diagonal.
// say we are at index x such that x<col then we will only check for indices ranging from 0 to x i.e. in that col... | ALGO | 0.999935 | 4.66589 | {
"github_metadata": {
"branch": "main",
"commit_count": 10,
"repo_created_at": "2022-05-18T08:25: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": "dbac8ce3983... |
320b4d16-7882-4ac3-af9f-b119733e859d | iaayushmaan/Codeforces-Codes | D_Apple_Tree.cpp | #include <map>
#include <set>
#include <stack>
#include <vector>
#include <math.h>
#include <climits>
#include <string.h>
#include <iostream>
#include <algorithm>
#include <unordered_set>
#include <unordered_map>
#define ll long long
#define loop(o, n) for (int i = 0; i < n; i++)
#define py cout << "YES" << endl
#defin... | ALGO | 0.999783 | 4.07389 | {
"github_metadata": {
"branch": "main",
"commit_count": 5,
"repo_created_at": "2023-07-14T19:48: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": "32d41314b17a... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.