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 |
|---|---|---|---|---|---|---|---|
7e181035-296f-4e32-86bf-0b72a05f84b0 | ViccHub/Victor | src/ai/minmax.cpp | #include "minmax.hpp"
enum class Strategy { MIN, MAX };
/// @brief Flips the given strategy, cyling it.
/// @param s
/// @return MIN if MAX, MAX if MIN
/// @note time complexity O(1)
Strategy flip(Strategy s){
switch (s)
{
case Strategy::MIN:
return Strategy::MAX;
default:
return Strategy::MIN;
... | ALGO | 0.99651 | 5.789599 | {
"github_metadata": {
"branch": "Othello",
"commit_count": 1,
"repo_created_at": "2023-01-17T01:58: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": "1c7dd9cdc... |
e82a4980-faef-4916-9aaa-f58aea0ea0ab | johnwalle/Snake-Game-OpenGL | snake.cpp | #include <GL/glut.h>
#include <deque>
#include <cstdlib>
#include <ctime>
#include <vector>
#include <string>
// Grid settings
const int GRID_SIZE = 20; // 20x20 grid
const float CELL_SIZE = 2.0f / GRID_SIZE; // Map grid to OpenGL [-1, 1]
const int WINDOW_SIZE = 600; // Window size in pixels
// Snake and game setting... | TOOL | 0.93362 | 7.069014 | {
"github_metadata": {
"branch": "main",
"commit_count": 12,
"repo_created_at": "2025-06-11T07:21:21.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "14d32ba1eec... |
cfe70279-4ee3-42d6-bc42-089f4daf1286 | lnxhigh/Baekjoon | 백준/Gold/13172. Σ/Σ.cc | #include <iostream>
#define M_MAX 10000
#define ll long long
#define X 1000000007LL
using namespace std;
ll M;
ll N[M_MAX+1];
ll S[M_MAX+1];
ll answer = 0LL;
ll power(ll a, ll p) {
if (p == 0LL) return 1;
else if (p == 1LL) return a % X;
ll root = power(a, p / 2LL);
ll res = (root * root) % X;
if... | ALGO | 0.999981 | 5.110618 | {
"github_metadata": {
"branch": "main",
"commit_count": 1355,
"repo_created_at": "2023-11-23T13:44: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": "9c4db29a8... |
7b343505-a45f-4a28-b987-af830477bb53 | ishandutta2007/codeforces-i | irkstepanov/normal/1554/E.cpp | #include <bits/stdc++.h>
#define all(a) (a).begin(), (a).end()
#define sz(a) (int)(a).size()
#define pb push_back
#define mp make_pair
using namespace std;
typedef long long ll;
typedef long double ld;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;
typedef pair<ld, ld> pld;
const int mod = 998244353;
void a... | ALGO | 0.999527 | 4.819241 | {
"github_metadata": {
"branch": "main",
"commit_count": 1,
"repo_created_at": "2024-04-11T05:39: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": "50eec84901ed... |
f96b663e-5b7b-4a46-8666-5d3ad522d35f | SinghRajan41/code | MY_CPP/CF/1793C.cpp | #include<bits/stdc++.h>
#define ll long long int
#define ull unsigned long long int
using namespace std;
void solve();
ll add_mod_m(ll a, ll b,ll m);
ll sub_mod_m(ll a,ll b,ll m);
ll mul_mod_m(ll a,ll b,ll m);
ll div_mod_m(ll a,ll b,ll m);
ll extended_euclid(ll a,ll b, ll *x,ll * y);
ll binExp_Mod_M(ll a,ll b,ll m);
ll... | ALGO | 0.999956 | 3.427285 | {
"github_metadata": {
"branch": "main",
"commit_count": 61,
"repo_created_at": "2022-08-14T06:03: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": "2c7dcc74a94... |
4b65711c-713f-4829-8fe3-65a49bfc2156 | GitadarshSingh/CPP | T11mothswitch.cpp | // T4tutorials problem practice of switch case.
//Question 11:
//C++ Program to take the value from the user as input the month number and print number of days in that month. Using switch statement
#include<iostream>
using namespace std;
int main()
{
int months ;
cout<<"Enter the months number : ";
... | ALGO | 0.934455 | 4.014281 | {
"github_metadata": {
"branch": "main",
"commit_count": 1,
"repo_created_at": "2023-07-26T14:23: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": "3b8146762bcd... |
0c88fb1d-3d46-48d3-8a56-232aa3049b44 | joskar1999/Graph-Algorithms | GraphLON.h | #pragma once
#include "Graph.h"
class GraphLON : public Graph
{
private:
std::vector<std::vector<int>> graphList;
std::vector<int> tmpList;
void transformMatrixToList()
{
for (int i = 0; i < this->numberOfNodes; i++)
{
tmpList.clear();
for (int j = 0; j < this->numberOfNodes; j++)
{
if (graphMat... | ALGO | 0.996044 | 4.244816 | {
"github_metadata": {
"branch": "master",
"commit_count": 9,
"repo_created_at": "2018-04-21T20:01: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": "23060f2527... |
40217ace-c960-4234-a07f-e22ffd34d22f | RosettaCommons/rosetta | source/src/utility/keys/Key2Vector.hh | // -*- 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... | TOOL | 0.929241 | 6.729955 | {
"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": "43ae... |
866b82b4-5f1c-4c59-88b7-6a38e1e6e354 | Joy57/Data-Structures | ExpressionTree.cpp |
#include "ExpressionTree.h"
template <typename DataType>
ExprTree<DataType>::ExprTreeNode::ExprTreeNode ( char elem, ExprTreeNode *leftPtr, ExprTreeNode *rightPtr )
{
dataItem = elem;
left = leftPtr;
right = rightPtr;
}
template <typename DataType>
ExprTree<DataType>::ExprTree ()
{
root = 0;
}
template <typenam... | ALGO | 0.97652 | 5.043294 | {
"github_metadata": {
"branch": "master",
"commit_count": 14,
"repo_created_at": "2017-06-24T22:54: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": "3f5082748... |
c1871f71-1ef2-480a-a984-25d15261ad9f | gengdd/Leetcode | 88_mergesortedarray.cpp | #include <iostream>
#include <vector>
using namespace std;
//错误
//class Solution {
//public:
// void merge(vector<int>& nums1, int m, vector<int>& nums2, int n) {
// vector<int> num;
// for (int i=0;i<m;i++){
// for (int j=0;j<n;j++){
// if (nums1[i]<=nums2[j]){
// ... | ALGO | 0.999987 | 5.212691 | {
"github_metadata": {
"branch": "master",
"commit_count": 1,
"repo_created_at": "2019-05-25T10:57:10.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "690972b0fa... |
07b3297f-f956-415f-9df4-f69134ff86da | moveit/moveit_task_constructor | core/include/moveit/task_constructor/stages/connect.h | /*********************************************************************
* Software License Agreement (BSD License)
*
* Copyright (c) 2017, Bielefeld University
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the followin... | ALGO | 0.952738 | 3.7156 | {
"github_metadata": {
"branch": "master",
"commit_count": 1410,
"repo_created_at": "2017-03-12T15:47:58.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 222,
"forks": 171,
"issues": 104,
"pull_requests": 18
},
"file_meta": {
"content_id": "0... |
b4925ea7-ffad-4a04-a313-543050461449 | Koweiyi/LC_cpp | lc6.cpp | #include<bits/stdc++.h>
using namespace std;
// @lc code=start
class Solution {
public:
string convert(string s, int numRows) {
if(numRows == 1)
return s;
vector<vector<char>> resV(numRows, vector<char>());
for(int i = 0 ; i < s.size() ; i ++ )
{
in... | ALGO | 0.999998 | 5.817681 | {
"github_metadata": {
"branch": "master",
"commit_count": 5,
"repo_created_at": "2020-06-15T06:41: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": "932161d63f... |
65012c91-1f39-4b2c-9fa2-298b48dfe40a | arrayfire/forge | src/backend/opengl/font_atlas_impl.hpp | /*******************************************************
* Copyright (c) 2015-2019, ArrayFire
* All rights reserved.
*
* This file is distributed under 3-clause BSD license.
* The complete license agreement can be obtained at:
* http://arrayfire.com/licenses/BSD-3-Clause
*****************************************... | TOOL | 0.917085 | 7.153152 | {
"github_metadata": {
"branch": "main",
"commit_count": 729,
"repo_created_at": "2015-05-19T17:50:08.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 235,
"forks": 47,
"issues": 18,
"pull_requests": 1
},
"file_meta": {
"content_id": "80e9076... |
b7924fed-ffad-4175-af19-d413c5a4c932 | vi5hnuu/love-babbar-dssa-sheet-sol | graph/695. Max Area of Island.cpp | /*
You are given an m x n binary matrix grid. An island is a group of 1's (representing land) connected 4-directionally (horizontal or vertical.) You may assume all four edges of the grid are surrounded by water.
The area of an island is the number of cells with a value 1 in the island.
Return the maximum area of an ... | ALGO | 0.999969 | 6.507646 | {
"github_metadata": {
"branch": "master",
"commit_count": 14,
"repo_created_at": "2022-08-02T00:45: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": "2259c640e... |
dca7560c-c14f-480e-8d2c-2186fa46ec87 | ShahjalalShohag/code-library | Dynamic Programming Optimizations/Subset Union of Bitsets.cpp | #include<bits/stdc++.h>
using namespace std;
const int N = 2e5 + 9;
int x[N], y[N], c[N], dp[1 << 20], msk[N], ans[N];
int32_t main() {
ios_base::sync_with_stdio(0);
cin.tie(0);
int n, m, r; cin >> n >> m >> r;
for (int i = 1; i <= n; i++) {
cin >> x[i] >> y[i];
}
// total m bitsets and size of each ... | ALGO | 0.999981 | 4.281215 | {
"github_metadata": {
"branch": "main",
"commit_count": 952,
"repo_created_at": "2018-11-18T08:49:47.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 3240,
"forks": 840,
"issues": 2,
"pull_requests": 0
},
"file_meta": {
"content_id": "450f5... |
03fbf105-1e35-40ed-9e59-1cfa2cb7a350 | TarunCore/compiler-design-lab | SOCKET PROGRAMMING/ErrDetection/twodim.cpp | #include <bits/stdc++.h>
using namespace std;
int countBits(string bits){
int count=0;
for(int i=0;i<bits.size();i++){
if(bits[i]=='1'){
count++;
}
}
return count;
}
void printRow(string s, int parity){
for(char &cc:s){
cout << cc << " ";
}
cout << " ";... | ALGO | 0.99998 | 4.131225 | {
"github_metadata": {
"branch": "main",
"commit_count": 3,
"repo_created_at": "2024-10-07T16:19: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": "f4aeb956c0e9... |
9de62824-410b-40ae-9fc5-6e9eca6c00bf | jinhan814/BOJ | cpp/18235.cpp | #include <bits/stdc++.h>
#define fastio cin.tie(0)->sync_with_stdio(0)
using namespace std;
int n, a, b;
bitset<500'001> A, B;
int Sol() {
queue<int> Q1, Q2; Q1.push(a), Q2.push(b);
for (int i = 1; i < 20; i++) {
const int delta = 1 << i - 1; A.reset(), B.reset();
for (int sz = Q1.size(); sz-- > 0;) {
auto c... | ALGO | 0.999792 | 3.549887 | {
"github_metadata": {
"branch": "main",
"commit_count": 203,
"repo_created_at": "2021-08-24T15:30: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": "f234175fe2... |
0eb2a333-96c8-4328-8160-02dd073bd331 | bortolo/TUTORIAL_CODE | TestQuad1D/main.cpp |
#include <iostream>
#include <string>
#include <fstream>
#include <math.h>
#include <dlfcn.h>
#include "../Geometry/Geometry.hpp"
#include "../Quadrature/NumericalQuad.hpp"
#include "../QuadratureRules/Quadrature1D.hpp"
#include "../FactoryQuad/QuadFactory.hpp"
double xquad(double x)
{
return x;
}
int main (int... | ALGO | 0.993606 | 4.009947 | {
"github_metadata": {
"branch": "master",
"commit_count": 9,
"repo_created_at": "2014-03-05T20:20: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": "db4c473657... |
27d324f5-cb90-462a-9481-14f4bde47075 | Rayhke/BaekjoonHub_Cplusplus | 백준/Gold/10026. 적록색약/적록색약.cc | #include <iostream>
#include <vector>
#include <stack>
using namespace std;
vector <vector<char>> v(100, vector<char>(100));
stack <int> x, y;
bool r[100][100];
bool q[100][100];
int N;
void D(int n, int m) {
x.push(m); y.push(n); char C = v[n][m]; // main 에서 ' n ' 와 ' m ' 의 역할과 여기서 ' x ' 와 ' y ' 역할이 헷갈렸음 (거꾸로)
wh... | ALGO | 0.999876 | 3.996359 | {
"github_metadata": {
"branch": "main",
"commit_count": 1851,
"repo_created_at": "2023-03-07T15:53: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": "2deb44d08... |
5ba5adeb-5025-49ce-a478-c7f02049e3f4 | eyasir329/CP_Archive | 09_number_theory/1_primes_coprime_divisors_factorization_perfect_square/2_primes_factorization_legendre/spoj_FACT0.cpp | #include <bits/stdc++.h>
using namespace std;
#define endl '\n'
using ll = long long;
vector<ll> factorize(ll n) {
vector<ll> ret;
if (n == 1) {
return ret;
}
for (ll i = 2; i * i <= n; i++) {
if (n % i == 0) {
while (n % i == 0) {
n /= i;
ret.push_back(i);
}
}
}
if... | ALGO | 0.999989 | 5.01243 | {
"github_metadata": {
"branch": "main",
"commit_count": 97,
"repo_created_at": "2023-09-06T01:32:52.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 2,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "435c68eff71... |
10579b80-79ce-499e-9f8f-75727a028627 | Jay7221/competitve-programming | other_contests/CodeDuet_Round1/C.cpp | #include<bits/stdc++.h>
using namespace std;
#define ll long long
void solve(){
int n;
cin >> n;
string s;
cin >> s;
vector<vector<int>> pre(n, vector<int>(26));
for(int i = 0; i < n; ++i){
++pre[i][s[i] - 'a'];
}
for(int i = 1; i < n; ++i){
for(int j = 0; j < 26; ++j){
pre[i][j] += pre[i - 1][j];
}
}... | ALGO | 0.999955 | 3.947056 | {
"github_metadata": {
"branch": "main",
"commit_count": 2,
"repo_created_at": "2024-12-20T15:54:08.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "c86e6125fb72... |
0a4677ab-255d-4294-ae0b-fa4f90f203f9 | yftsai/uva-online-judge | contest_volumes/volume_113/11348.cpp | // #easy
#include <iostream>
#include <unordered_map>
using namespace std;
int main()
{
unordered_map<uint16_t, uint8_t> owners;
cout.setf(ios::fixed);
cout.precision(6);
uint16_t k, n, m, type;
cin >> k;
for (uint16_t t = 1; t <= k; t++) {
owners.clear();
cin >> n;
for... | ALGO | 0.997427 | 4.190197 | {
"github_metadata": {
"branch": "master",
"commit_count": 188,
"repo_created_at": "2016-01-28T02:37: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": "96d039e7... |
b69c0f36-41ee-4212-9f19-85418d3813af | qwop-os/c- | 拓扑排序.cpp | /*
#include<iostream>
using namespace std;
const int maxvex=100;
typedef bool state;
int indegree[maxvex]{};
typedef struct edgenode {
int adj;
//int weight;
edgenode* next;
} edgenode;
typedef struct vexnode {
char data;
edgenode* firstedge;//指向箭头的点
int in;
}vexnode, adjlist[maxvex];
typedef st... | ALGO | 0.99994 | 4.005769 | {
"github_metadata": {
"branch": "main",
"commit_count": 9,
"repo_created_at": "2021-12-08T01:42: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": "0e982735f1ee... |
e73e187e-9496-414e-8a2b-7cc76e1f6eeb | ycjuan/kaggle-2014-criteo | solvers/gbdt/src/train.cpp | #include <iostream>
#include <omp.h>
#include "common.h"
#include "timer.h"
#include "gbdt.h"
namespace {
struct Option
{
Option() : nr_tree(30), nr_thread(1) {}
std::string Tr_path, TrS_path, Va_path, VaS_path, Va_out_path, Tr_out_path;
uint32_t nr_tree, nr_thread;
};
std::string train_help()
{
ret... | DATA | 0.96166 | 6.45813 | {
"github_metadata": {
"branch": "master",
"commit_count": 15,
"repo_created_at": "2014-10-08T07:39:29.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1261,
"forks": 620,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "6485... |
94ca7bfd-cd3a-4f1e-9b2a-134cb46cf508 | daquinoo/Misc | LinkedList.cpp | // Simple C++ LinkedList class implementation.
class MyLinkedList {
public:
struct Node {
int val;
Node* next;
Node(int val) : val(val), next(nullptr) {}
};
Node* head;
int size;
MyLinkedList() : head(nullptr), size(0) {}
int get(int index) {
if (index < 0 ||... | ALGO | 0.998462 | 5.985471 | {
"github_metadata": {
"branch": "main",
"commit_count": 53,
"repo_created_at": "2024-05-06T00:44: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": "a623e99a537... |
4467ace8-87b0-441f-b75f-afbd40675ac7 | wpddmcmc/RM2019_TGeek | roborts_vision/executor/gimbal/gimbal_control.cpp | #include <cmath>
#include <stdio.h>
#include "gimbal_control.h"
//air friction is considered
float GimbalContrl::BulletModel(float z, float v, float angle) { //x:m,v:m/s,angle:rad
float t, y;
t = (float)((exp(init_k_ * z) - 1) / (init_k_ * v * cos(angle)));
y = (float)(v * sin(angle) * t - GRAVITY * t * t / 2)... | ALGO | 0.999717 | 3.798545 | {
"github_metadata": {
"branch": "master",
"commit_count": 2,
"repo_created_at": "2019-06-16T02:09:57.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "e8c4971b26... |
c480b20f-15f2-4687-9e25-90a6b696787a | oils-for-unix/oils | vendor/souffle/utility/FileUtil.h | /*
* Souffle - A Datalog Compiler
* Copyright (c) 2021, The Souffle Developers. All rights reserved
* Licensed under the Universal Permissive License v 1.0 as shown at:
* - https://opensource.org/licenses/UPL
* - <souffle root>/licenses/SOUFFLE-UPL.txt
*/
/********************************************************... | TOOL | 0.935459 | 7.26952 | {
"github_metadata": {
"branch": "master",
"commit_count": 11425,
"repo_created_at": "2016-11-15T19:19:09.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 3156,
"forks": 165,
"issues": 544,
"pull_requests": 29
},
"file_meta": {
"content_id": ... |
c5e9e5ef-470e-4f4e-8f6d-212ec167fd04 | billhj/Etoile2015 | auxiliary/animation/IK/JacobianDLSSVDSolver.cpp | /**
* Copyright(C) 2009-2012
* @author <NAME>
* @file JacobianDLSSVDSolver.cpp
* @brief
* @date 1/2/2011
*/
#include "JacobianDLSSVDSolver.h"
namespace Etoile
{
double epsilon = 1.2;
void JacobianDLSSVDSolver::solveOneStep(IKChain* chain, Vector3_ target, bool enableConstraints)
{
chain->updat... | ALGO | 0.996988 | 4.373155 | {
"github_metadata": {
"branch": "master",
"commit_count": 321,
"repo_created_at": "2015-05-04T09:31: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": "bdd45c82... |
7d504493-78d3-491a-9386-7d4c9e7fbd9a | livewaves/Cpp_Samples | linkedlist/linkedlist-9-02.cpp | // removing duplicates from an unsorted SLL
#include <iostream>
using namespace std;
struct Node
{
int data;
Node * next;
};
Node *tail, *head;
class singly
{
public:
singly()
{
// used just to avoid any garbage values; initialization
head = NULL;
... | ALGO | 0.99991 | 3.884885 | {
"github_metadata": {
"branch": "main",
"commit_count": 139,
"repo_created_at": "2024-02-15T10:03: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": "c1c8631ae5... |
357f385a-4d87-4a49-ae83-259343003eae | JohanSmet/aoc_2022 | 17/cpp/part2.cpp | #include <algorithm>
#include <array>
#include <iostream>
#include <string>
#include <string_view>
#include <unordered_map>
#include <vector>
using namespace std;
constexpr int32_t BLOCK_SIZE = 4;
constexpr int32_t BLOCK_COUNT = 5;
constexpr int32_t WORLD_WIDTH = 7;
struct Coord {
int32_t x;
int32_t y;
};
using... | ALGO | 0.999944 | 5.202609 | {
"github_metadata": {
"branch": "main",
"commit_count": 30,
"repo_created_at": "2022-12-01T11:53:42.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "94e38fc4d70... |
10761709-8551-4af3-83f6-a49bdfda783f | xplodwild/android_external_Focal | hugin/lines/FindN8Lines.h | // -*- c-basic-offset: 4 -*-
/** @file FindN8Lines.h
*
* @brief declaration of find lines algorithm
*
* @author <NAME>
*
* finds straightish, non-crossing lines in an edge map,
* using 8-neighborhood operations.
* This functions are intended to be used inside HuginLines lib, not to be called from outside
... | ALGO | 0.999028 | 4.647124 | {
"github_metadata": {
"branch": "master",
"commit_count": 84,
"repo_created_at": "2013-07-02T08:25:25.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 25,
"forks": 38,
"issues": 1,
"pull_requests": 0
},
"file_meta": {
"content_id": "7277b40... |
a3931e88-92de-4b30-89a2-05c85e63d83d | Nevsky12/GPU-course | code/september/snowman/main.cpp | #include <algorithm>
#include <fstream>
#include <ranges>
#include <iostream>
#include <utils/camera.h>
#include <utils/sphere.h>
int main()
{
Sphere const sphere[4] =
{
{
.origin = {0.f, 0.1f, 0.f},
.radius = 0.5f,
},
{
.origin = {0.f, 0.7f, 0.f},
... | ALGO | 0.983481 | 6.24549 | {
"github_metadata": {
"branch": "main",
"commit_count": 55,
"repo_created_at": "2023-09-10T16:51:21.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "1456e179ae6... |
5c6a4a4c-6b25-459f-a960-e7d777615ff3 | KangGilHwan/Gil | BaseballGame-Gil.cpp | #include <stdio.h>
#include <stdlib.h>
#include<conio.h>
#include <time.h>
#pragma warning(disable:4996)
void creatNum(int random[]) { //게임에 필요한 1~9까지 중복이 아닌 랜덤 숫자를 만드는 함수
int i = 0;
srand((int)time(NULL));
do {
for (i = 0; i < 3; i++) {
random[i] = rand() % 9 + 1;
}
} while (random[0] == random[1] || r... | ALGO | 0.999546 | 3.584099 | {
"github_metadata": {
"branch": "master",
"commit_count": 4,
"repo_created_at": "2018-02-09T07:33: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": "b6fe986936... |
afbedc54-22c3-4d03-bcd6-be817f13dddc | qq734628996/ac-code | HDU/1059/14981848_AC_436ms_2148kB.cpp | #include <bits/stdc++.h>
using namespace std;
#define REP(i,n) for(int i = 0; i < n; i++)
#define PER(i,n) for(int i = n-1; i >= 0; i--)
#define FOR(i,l,r) for(int i = l; i <= r; i++)
#define ROF(i,l,r) for(int i = r; i >= l; i--)
#define TR(e,x) for(auto e = x.begin(); e != x.end(); e++)
#define DEBUG(x) cout << #x <... | ALGO | 0.998937 | 3.901328 | {
"github_metadata": {
"branch": "master",
"commit_count": 3,
"repo_created_at": "2019-05-23T08:33: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": "66a9a5d9de... |
04ddcd0a-c1a3-4d8e-9060-b5be6f9ccde5 | somathias/CartilageCBM | src/population/force/RepulsionCubicForce.cpp | #include "RepulsionCubicForce.hpp"
template<unsigned DIM>
RepulsionCubicForce<DIM>::RepulsionCubicForce()
: CubicGeneralisedLinearSpringForce<DIM>()
{
}
template<unsigned DIM>
void RepulsionCubicForce<DIM>::AddForceContribution(AbstractCellPopulation<DIM>& rCellPopulation)
{
// Throw an exception message if no... | ALGO | 0.980648 | 6.936393 | {
"github_metadata": {
"branch": "master",
"commit_count": 321,
"repo_created_at": "2022-06-27T11:48:33.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "0ca7d02c... |
9494fcd5-ef97-44fb-983d-ce6073e9c143 | rkverma2022/Graph-Algorithm | 02_Graph_Represenation_Directed_Graph.cpp | // Online C++ compiler to run C++ program online
#include <bits/stdc++.h>
using namespace std;
int main() {
// Write C++ code here
int n, m;
cout<<"Number of nodes = ";
cin>>n;
cout<<"Number of Edges = ";
cin>>m;
vector<int> adj_list[n + 1];
for(int i = 1; i<m+1; i++)
{
... | ALGO | 0.999912 | 5.1498 | {
"github_metadata": {
"branch": "main",
"commit_count": 32,
"repo_created_at": "2023-09-16T15:34:20.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "a33d478c8ce... |
363ec0ac-4a2b-4589-bd99-9cb924ad2913 | sarah-keren/ER-UMD-2018 | non_deterministic/planners/mdp-lib-umd/test/testRace.cpp | #include <iostream>
#include <ctime>
#include <fstream>
#include <sstream>
#include <unistd.h>
#include "../include/solvers/DeterministicSolver.h"
#include "../include/solvers/EpicSolver.h"
#include "../include/solvers/LAOStarSolver.h"
#include "../include/solvers/LRTDPSolver.h"
#include "../include/solvers/Solver.h"
... | ALGO | 0.997164 | 5.207542 | {
"github_metadata": {
"branch": "master",
"commit_count": 30,
"repo_created_at": "2018-02-19T08:55:44.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "88685190e... |
d6ce744b-f623-4354-9599-577b1d5af4f0 | saahiravroy/DSA | Lecture 1/3.find_repeat_and_missing_number.cpp | #include<bits/stdc++.h>
using namespace std;
pair<int,int> repeat_and_missing(vector<int> & v, int n){
int Repeat, Missing;
//Repeat - Missing = (sumtill 1 to n - sum )
//Repeat2 - Missing2 = (sumtill 1 to n2 - sum )
//Repeat + Missing = ()/(1)
int sum1 = 0, sum2=0, sum3=0, sum4=0;
for (int... | ALGO | 0.999792 | 3.612311 | {
"github_metadata": {
"branch": "master",
"commit_count": 2,
"repo_created_at": "2022-12-19T04:26: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": "7d9185c4bb... |
c991386a-d1d6-4179-a301-db14caef2888 | Mikayel5464/CPP_Synergy | Homeworks/Algorithms/Sorting/counting_sort.cpp | #include <iostream>
#include <vector>
template <typename T>
void arrayPrint(const std::vector<T>& arr) {
for (int i = 0; i < arr.size(); ++i) {
std::cout << arr[i] << " ";
}
std::cout << std::endl;
}
template <typename T>
void countingSort(std::vector<T>& arr) {
if (arr.empty()) {
ret... | ALGO | 0.999911 | 5.881649 | {
"github_metadata": {
"branch": "main",
"commit_count": 14,
"repo_created_at": "2024-08-22T09:25:11.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "23a5dd4ec46... |
d95bb04b-16a5-49d9-8300-22a9f0aa82d6 | Tayeb-Ahmed-TAS/DSA-with-CPP | 04 - 2D Arrays/03 - Spiral Pattern/Spiral_Print.cpp | #include <iostream>
using namespace std;
void Spiral_Print(int arr[][10], int row, int col) {
// 4 variables
int startRow = 0;
int endRow = row - 1; // 3
int startCol = 0;
int endCol = col - 1; // 3
// Outer Loop (Traverse array boundary)
while (startCol <= endCol and startRow <= endRow) {
// Start... | ALGO | 0.99984 | 5.807204 | {
"github_metadata": {
"branch": "main",
"commit_count": 156,
"repo_created_at": "2024-06-22T06:35: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": "79e7c919a3... |
b4c80e6b-ff4a-48f0-b8e3-54595c131f81 | yuyu0127/DA | src/1.2-1.cpp | #include <iostream>
#include <cmath>
#include <iomanip>
typedef long double d_type;
/* 再帰(定義どおり) */
d_type fib_rec(int n) {
if (n <= 1) {
return n;
}
return fib_rec(n-2) + fib_rec(n-1);
}
/* 反復 */
d_type fib_ite(int n) {
if (n==0) return 0;
d_type a = 0;
d_type b = 1;
while(n > 1)... | ALGO | 0.999877 | 4.465683 | {
"github_metadata": {
"branch": "master",
"commit_count": 1,
"repo_created_at": "2019-01-09T05:16: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": "600ed156a3... |
eb44448b-f1af-4757-b302-0d56bde633f5 | trilinos/Trilinos | packages/percept/src/percept/mesh/mod/smoother/ReferenceMeshSmootherAlgebraic.cpp | // Copyright 2002 - 2008, 2010, 2011 National Technology Engineering
// Solutions of Sandia, LLC (NTESS). Under the terms of Contract
// DE-NA0003525 with NTESS, the U.S. Government retains certain rights
// in this software.
//
// Use of this source code is governed by a BSD-style
// license that can be found in the L... | ALGO | 0.999764 | 5.155892 | {
"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":... |
e834b168-e4c1-4168-9a69-cbc5d4024c56 | agonzalez45/OOP | lab9/problem5/SortableCircleData.h | #ifndef SortableCircleData_h
#define SortableCircleData_h
#include <vector>
using namespace std;
class Sortable {
public:
virtual bool compare (const Sortable * s) = 0;
virtual void print () = 0;
Sortable(){
}
virtual ~Sortable(){
cout << "~Sortable()" << endl;
}
};
... | TOOL | 0.926881 | 4.136963 | {
"github_metadata": {
"branch": "master",
"commit_count": 1,
"repo_created_at": "2016-09-12T08:15:25.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "6369279eae... |
7d7cee4d-249d-4879-a079-6dd3435a9c36 | StarfishC/DataStructures | Chapter2-LinearList/src/exercise1_zhangming/2-1-2.cpp | // File: 2-1-2.cpp
// Author: csh
// Date: 2020/07/12
// Update: 2021/02/20
// ===================
#include <iostream>
// An是A[]的长度,Bn是B[]的长度
template <typename T>
int compare(T A[], int An, T B[], int Bn)
{
// 过滤掉公共前缀
int i = 0;
while(i < An && i < Bn && A[i] == B[i])
i++;
if(i ... | ALGO | 0.9999 | 4.388363 | {
"github_metadata": {
"branch": "master",
"commit_count": 157,
"repo_created_at": "2020-04-29T01:18:14.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 12,
"forks": 4,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "1e3dfa9... |
f8737e36-ee71-41ff-bb9e-19542e4d5e7e | XiangLi-CS/Goat-Game | CSC8503/BehaviourTreeEnemy.cpp | #include "BehaviourTreeEnemy.h"
//NOT WORKING
BehaviourTreeEnemy::BehaviourTreeEnemy(GameWorld* a, const Vector3& initPosition) {
worldRef = a;
prePos = initPosition;
BehaviourAction* SeekPlayer = new BehaviourAction
("Seek Player", [&](float dt, BehaviourState state) -> BehaviourState
{
PlayerObject* playe... | ALGO | 0.948873 | 3.841551 | {
"github_metadata": {
"branch": "main",
"commit_count": 6,
"repo_created_at": "2023-01-31T23:06: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": "5e5342f459ef... |
22589fa0-e381-4421-9062-e2cbcb2c10ed | hayaten0415/Competitive-programming | AtCoder/ABC/ABC082/D.cpp | #include <bits/stdc++.h>
#define rep(i, n) for (int i = 0; i < (n); i++)
#define rrep(i, n) for (int i = (n - 1); i >= 0; i--)
#define ALL(v) v.begin(), v.end()
using namespace std;
using P = pair<int, int>;
typedef long long ll;
template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return 1; } return 0;... | ALGO | 0.999968 | 3.728249 | {
"github_metadata": {
"branch": "master",
"commit_count": 1321,
"repo_created_at": "2019-02-17T01:01:06.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 1,
"pull_requests": 0
},
"file_meta": {
"content_id": "0f38f14... |
4e5b6188-1fb0-4cc8-9d07-b4815e0befff | DavidBuzatu-Marian/AdeventOfCode | Day13_1.cpp | #include <stdint.h>
#include <algorithm>
#include <fstream>
#include <iostream>
#include <string>
#include <unordered_map>
#include <vector>
using namespace std;
vector<string> splitLine(string &line) {
size_t pos;
vector<string> res;
while ((pos = line.find(" = ")) != std::string::npos) {
res.pus... | ALGO | 0.999554 | 5.505892 | {
"github_metadata": {
"branch": "main",
"commit_count": 27,
"repo_created_at": "2020-12-06T10:31: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": "5af56827105... |
93311579-0f31-45af-a55e-da6aafd50700 | jindalshivam09/cppcodes | Sept cook off/bignumber.cpp | /*
Name: segment trees
Copyright: no rights
Author: <NAME>
Date: 16/09/13 23:33
Description: to solve queries in log n time use segment tree
*/
#include<iostream>
#include<vector>
#include<utility>
#include<cmath>
using namespace std;
#define MAX 1000000
#define MOD 1000000007
string number;
vector<int> values... | ALGO | 0.999915 | 4.236328 | {
"github_metadata": {
"branch": "master",
"commit_count": 7,
"repo_created_at": "2014-08-21T11:49: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": "104c556651... |
45cc0573-ed70-4d2f-b032-84d5333d7b56 | ishandutta2007/codeforces-m | m_99/normal/1579/E2.cpp | #include <stdio.h>
#include <bits/stdc++.h>
#include <cassert>
#include <vector>
#include <cassert>
#include <numeric>
#include <type_traits>
namespace atcoder {
namespace internal {
#ifndef _MSC_VER
template <class T>
using is_signed_int128 =
typename std::conditional<std::is_same<T, __int128_t>::value ||
... | ALGO | 0.99974 | 4.482197 | {
"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": "f0f8f389f6a3... |
45d58128-74ad-4b3e-a479-3b4ab01abbab | Honghonghong123/December | 12-7.cpp | #include<bits/stdc++.h>
using namespace std;
long long int ss(int x)
{
int sum = 1;
for(int i = 2; i <= x; i++)
sum *= i;
return sum;
}
int Cn(int n, int m)
{
if(n < m) swap(n, m);
return ss(n) / ss(m) / ss(n - m);
}
int main()
{
int n, m, c1, c2;
cin >> n >> m >> c1 >> c2;
long long int road = 0;
road = s... | ALGO | 0.999978 | 3.392089 | {
"github_metadata": {
"branch": "main",
"commit_count": 11,
"repo_created_at": "2023-12-03T15:15: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": "d371c441e48... |
60a5a02d-8d23-43ee-ab57-27ed16384e3c | Garoika/shifrovanie | РОСП.cpp | #include <iostream>
#include <bitset>
#include <string>
using namespace std;
string TextToBinary(string word) {
string binary;
for (int i = 0; i < word.length(); i++) {
char c = word[i];
bitset<8> bits(c);
binary += bits.to_string();
}
return binary;
}
void generateGamma(int a,... | ALGO | 0.997316 | 4.210881 | {
"github_metadata": {
"branch": "main",
"commit_count": 37,
"repo_created_at": "2023-02-01T22:26:11.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "a50f49b7e79... |
985b76a0-6b99-4424-88a1-32087bde4bc5 | godotengine/godot | thirdparty/jolt_physics/Jolt/Physics/Constraints/ConstraintPart/SpringPart.h | // Jolt Physics Library (https://github.com/jrouwe/JoltPhysics)
// SPDX-FileCopyrightText: 2021 <NAME>
// SPDX-License-Identifier: MIT
#pragma once
JPH_NAMESPACE_BEGIN
#ifndef JPH_PLATFORM_DOXYGEN // Somehow Doxygen gets confused and thinks the parameters to CalculateSpringProperties belong to this macro
JPH_MSVC_SUP... | ALGO | 0.992228 | 6.828501 | {
"github_metadata": {
"branch": "master",
"commit_count": 76043,
"repo_created_at": "2014-01-04T16:05:36.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 98972,
"forks": 22820,
"issues": 5000,
"pull_requests": 3866
},
"file_meta": {
"content... |
c0187b75-b2ce-4ec6-80ca-f6d9fd4696cf | geetikajhanji11/DSA | Leetcode/3-binary-search/medium/2358-maximum-number-of-groups-entering-a-competition.cpp | /*******************************************************************
*******************************************************************/
#include<iostream>
#include<bits/stdc++.h>
using namespace std;
class Solution {
bool canFormGroup(int groups, vector<int>& grades) {
// basically = (n * (n + 1)) / ... | ALGO | 0.999852 | 5.229379 | {
"github_metadata": {
"branch": "master",
"commit_count": 186,
"repo_created_at": "2022-01-21T15:57:13.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "ddb4cefb... |
b7e96463-c2b0-4de6-9330-5c1bb8411856 | SummitChen/MachineExploration | source/TerrainDetectionManager.cpp | #include "TerrainDetectionManager.h"
#include "Common.h"
#include "TerrainRuler.h"
#include <vector>
#include "time.h"
#include "esStrFBMC.h"
using namespace BWTA;
bool quadratic_solver(float p_a, float p_b, float p_c, float & x_1, float & x_2){
float p_d = ( p_b * p_b ) - ( 4 * p_a * p_c);
if ( p_d >= 0)
{
x_... | ALGO | 0.988128 | 4.10832 | {
"github_metadata": {
"branch": "master",
"commit_count": 3,
"repo_created_at": "2015-01-10T02:49: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": "5d74b74d0b... |
f2a48231-ea0d-475e-809c-33501e9a9d2d | binthafra/Numerical-Methods | qes1_c173229.cpp |
#include <iostream>
using namespace std;
int main()
{
int fmat[3][3], Smat[3];;
cout<<"Enter the Faculty matrix\n";
for(int i=0;i<3;i++)
for(int k=0;k<3;k++)
cin>>fmat[i][k];
cout<<"Enter the Salary matrix\n";
for(int h=0;h<3;h++)
cin>>Smat[h];
//finding determinan... | ALGO | 0.999869 | 3.88243 | {
"github_metadata": {
"branch": "main",
"commit_count": 2,
"repo_created_at": "2021-07-14T12: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": "efa1639fa225... |
1ecbefc7-8949-49a5-ba07-4711d86baf7b | bamboo-hust/icpc-trainings | gp_warsaw_19/h.cpp | #include <bits/stdc++.h>
#define double long double
using namespace std;
const int N = 3e5 + 5;
const double INF = 1e9;
vector<int> cand[N];
vector<int> a[N];
double E[N];
double power[N];
int n, m;
void gen1() {
n = 18;
for (int i = 2; i < n; ++i) {
a[1].push_back(i); a[i].push_back(1);
a[... | ALGO | 0.999786 | 3.790404 | {
"github_metadata": {
"branch": "master",
"commit_count": 43,
"repo_created_at": "2019-09-04T14:35:45.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "bca541f1ef... |
51050e0c-fbc9-492f-9c7b-7a2e794c0d06 | Merisho/comprog | practice/cf_4b_before_an_exam.cpp | // Problem URL: https://codeforces.com/problemset/problem/4/B
#include <iostream>
#include <vector>
#include <utility>
#include <math.h>
using namespace std;
using ll = long long;
using ld = long double;
void solve() {
int d, s;
cin >> d >> s;
vector<pair<int, int> > t(d);
int min_s = 0;
int max_s = 0;
for (aut... | ALGO | 0.999988 | 3.069798 | {
"github_metadata": {
"branch": "master",
"commit_count": 86,
"repo_created_at": "2019-10-19T08:36: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": "984bc2394... |
7f1c2f68-ea47-4164-85fc-2cb6d583b35d | Kawser-nerd/CLCDSA | Source Codes/CodeJamData/11/22/16.cpp | #include <cassert>
#include <cctype>
#include <climits>
#include <cmath>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <algorithm>
#include <functional>
#include <iostream>
#include <map>
#include <numeric>
#include <queue>
#include <set>
#include <stack>
#include <string>
#include <utility>
#includ... | ALGO | 0.999749 | 3.465616 | {
"github_metadata": {
"branch": "master",
"commit_count": 20,
"repo_created_at": "2019-09-30T05:38:13.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 22,
"forks": 8,
"issues": 1,
"pull_requests": 0
},
"file_meta": {
"content_id": "7d68708a... |
1cd8060c-acf0-4142-861b-2ae563e207fb | ImnIrdst/ICPC-Practice-2015-TiZii | UVa/Comptitive Programming/Ch-08 More Advanced Topics/02 Two Components - DP 1D Range Sum Query/UVa 10871 - Primed Subsequence - AC.cpp | #include <iostream>
#include <cstdio>
#include <vector>
#include <bitset>
#define MAX (100000+100)
#define INF (int64)1e12
#define int64 long long
using namespace std;
bitset<MAX> isp;// isprime
vector<int64> primes;
int64 bound;
void genprime(){
isp.set(); isp[0]=isp[1]=0; bound++;
for(int64 i=2 ; i<=bound ... | ALGO | 0.999476 | 3.491746 | {
"github_metadata": {
"branch": "master",
"commit_count": 44,
"repo_created_at": "2016-04-08T04:18: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": "36ecb34aa... |
c356f66b-ea28-4e3a-940c-7f47ed97b55b | JeffCottonBWFC/ProjectEulerSubmissions | SolutionsFile/_Problem11 (Largest Product in Grid).cpp | #include <iostream>
#include <math.h>
#include <fstream>
#include "mMatrix.h"
//Problem 11 (COMPLETE)
//In the 20×20 grid below, four numbers along a diagonal line have been marked in red. The product of these numbers is 26 × 63 × 78 × 14 = 1788696.
// 08 02 22 97 38 15 00 40 00 75 04 05 07 78 52 12 50 77 91 08
// 49... | ALGO | 0.99819 | 3.689794 | {
"github_metadata": {
"branch": "main",
"commit_count": 42,
"repo_created_at": "2021-05-10T15:24:55.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "de789717a10... |
6f0cd858-43d8-4093-9e72-1554198ec172 | SongHeeJae/algorithm | 백준/3878 - 점 분리.cpp | #include <iostream>
#include <algorithm>
#include <vector>
using namespace std;
typedef long long ll;
int t, n, m;
ll x, y, bx, by;
vector<pair<ll, ll>> blackPos, whitePos, blackHull, whiteHull;
// 시계 음수, 반시계 양수, 일직선 0
int ccw(ll x1, ll y1, ll x2, ll y2, ll x3, ll y3) {
ll cw = (x1 * y2 + x2 * y3 + x3 * y1) - (y1 *... | ALGO | 0.999962 | 4.209752 | {
"github_metadata": {
"branch": "master",
"commit_count": 792,
"repo_created_at": "2021-01-13T17:22: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": "871ffeda... |
7b098449-7b98-44c3-bc94-51db43229fff | fzi-forschungszentrum-informatik/Lanelet2 | lanelet2_core/include/lanelet2_core/geometry/Polygon.h | #pragma once
#include <boost/geometry/geometries/register/ring.hpp>
#include "lanelet2_core/geometry/LineString.h"
#include "lanelet2_core/primitives/CompoundPolygon.h"
#include "lanelet2_core/primitives/Polygon.h"
/***********************************************************************
* BOOST GEO... | ALGO | 0.963764 | 5.829907 | {
"github_metadata": {
"branch": "master",
"commit_count": 591,
"repo_created_at": "2018-08-24T13:52:17.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 857,
"forks": 338,
"issues": 9,
"pull_requests": 6
},
"file_meta": {
"content_id": "60e0e... |
39461a0a-e467-4cc4-b350-a2516db8dc1b | UlyanaGru/users_logs | users_logs.cxx | #include <iostream>
#include <fstream>
#include <vector>
#include <string>
#include <algorithm>
#include <map>
#include <ctime>
#include <unordered_set>
using namespace std;
// Структура для хранения данных о событии
struct LogEntry {
tm date; // Время события
int user; // ID пользователя
... | DATA | 0.985224 | 6.712765 | {
"github_metadata": {
"branch": "master",
"commit_count": 25,
"repo_created_at": "2025-07-09T05:16: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": "6ca3c297e... |
752408c3-6bf7-4c9a-aff8-9c7ef8dae7b9 | AlpYilmazz/Algorithmic_Competition_v2 | Summer Camp Expert/Qualification/E_Things.cpp | #include <iostream>
#include <cstdio>
#include <algorithm> // sort
#include <cmath>
#include <vector>
#include <stack>
#include <queue>
#include <string>
#include <set>
#include <utility>
using namespace std;
typedef long long int lli;
typedef pair<lli,lli> p_ii;
#define IOS ios_base::sync_with_stdio(false); cin.tie... | ALGO | 0.999998 | 3.589169 | {
"github_metadata": {
"branch": "master",
"commit_count": 11,
"repo_created_at": "2019-06-26T13:00:03.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "c8524093f... |
f3235dba-cfc7-4df6-83cd-9c0d3fdd9698 | Utkarsh-code/DSA-Playlist | CP/35.cpp | #include<bits/stdc++.h>
using namespace std;
#define int long long
#define ff first
#define ss second
#define pb push_back
#define pi pair<int, int>
int mod=1e9+7;
int inf=1e18;
int ninf=-1e18;
int pown(int x, int y){
int res=1;
while(y){
if(y&1) res=(x*res)%mod;
x=(x*x)%mod;
y>>=1... | ALGO | 0.999966 | 5.004325 | {
"github_metadata": {
"branch": "main",
"commit_count": 32,
"repo_created_at": "2021-04-11T06:31:41.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "d924f6d1d90... |
01729713-d27f-4fa7-9b2f-f8236bb67fbd | toltec-astro/kidscpp | include/tula/algorithm/ei_stats.h | #pragma once
#include "tula/eigen.h"
#include <type_traits>
namespace tula::alg {
inline auto shape = [](const auto &m) {
return std::make_pair(m.rows(), m.cols());
};
inline auto span = [](const auto &v) {
return v.coeff(v.size() - 1) - v.coeff(0);
};
inline auto step = [](const auto &v, Eigen::Index i = ... | ALGO | 0.999141 | 7.087572 | {
"github_metadata": {
"branch": "v0.1.x",
"commit_count": 51,
"repo_created_at": "2019-10-15T21:17:47.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "4bf9260c10... |
f595987a-c7f0-4ad6-ba31-3d6a62f373e0 | alexandraback/datacollection | solutions_5753053697277952_0/C++/lljjcc/main.cpp | #include <algorithm>
#include <iostream>
#include <sstream>
#include <cstring>
#include <cstdlib>
#include <string>
#include <fstream>
#include <vector>
#include <cstdio>
#include <cmath>
#include <queue>
#include <stack>
#include <map>
#include <set>
using namespace std;
#define INF 0x3f3f3f3f
const int N=1005;
const ... | ALGO | 0.999931 | 3.103898 | {
"github_metadata": {
"branch": "master",
"commit_count": 58,
"repo_created_at": "2017-03-08T11:33:58.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 4,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "5148976a4... |
a9eb3968-367a-4b8f-b540-b7df2ab01c3f | arunthe01/arun-s-leet | cousins in binary tree .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.999975 | 5.980266 | {
"github_metadata": {
"branch": "main",
"commit_count": 11,
"repo_created_at": "2021-07-26T13:15:55.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "e3f39d4b30b... |
a1265575-c544-434c-ba6e-5a4e0ddfc4a4 | DavoGrant/harmonica | harmonica/light_curve/fluxes.cpp | #include <cmath>
#include <vector>
#include <numeric>
#include <algorithm>
#include <Eigen/Core>
#include <Eigen/Eigenvalues>
#include "fluxes.hpp"
#include "../constants/constants.hpp"
using namespace std::complex_literals;
Fluxes::Fluxes(int ld_law, double us[], int n_rs, double rs[],
int pnl_c, in... | ALGO | 0.999577 | 5.830701 | {
"github_metadata": {
"branch": "main",
"commit_count": 194,
"repo_created_at": "2022-03-16T11:07:06.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 10,
"forks": 4,
"issues": 1,
"pull_requests": 1
},
"file_meta": {
"content_id": "6d6b7c02e... |
058791bb-21d6-4564-81e8-9985665554ff | EdiedRamos/Algorithms | Practice/UVa Online Judge/uHunt/Graph/10397.cpp | //Coder: Yeshayah
#include <bits/stdc++.h>
using namespace std;
#define MN 760
struct Edge {
int a, b;
double dt;
};
struct Point {
double x, y;
};
int ds[MN], _r[MN], n, r;
vector<Point> pointl;
vector<Edge> edgel;
bool cmp(Edge a, Edge b) {
return a.dt < b.dt;
}
double Distance(Point a, Point b)... | ALGO | 0.999795 | 4.231421 | {
"github_metadata": {
"branch": "main",
"commit_count": 561,
"repo_created_at": "2020-10-26T16:54: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": "1e3be1f0ff... |
933a2795-6365-4487-a96d-a6ef94f51239 | zakuro9715/aoj | 0157.cpp | #include<iostream>
#include<vector>
#include<algorithm>
using namespace std;
int dp[200];
vector<pair<int, int>> m;
int main()
{
while(true)
{
fill(dp, dp + 200, -1);
m.clear();
for(int i = 0; i < 2; i++)
{
int a;
cin >> a;
if(!a)
return 0;
for(int j = 0; j < a; j+... | ALGO | 0.998266 | 3.290732 | {
"github_metadata": {
"branch": "master",
"commit_count": 23,
"repo_created_at": "2015-03-08T01:36: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": "b5ede7d17... |
e73a9eec-1ead-4587-8858-ab5f9e7e20f6 | ishaanjav/USACO-Solutions | Silver 2019 Dec/moobuzz.cpp | /*
* Created by ishaanjav
* github.com/ishaanjav
* USACO Solutions: https://github.com/ishaanjav/USACO-Solutions
*/
#include <fstream>
#include <iostream>
using namespace std;
#define ll long long
#define pb push_back
#define ins insert
#define mp make_pair
#define pii pair<int, int>
#define pil pair<int, ll>
#de... | ALGO | 0.999943 | 3.550658 | {
"github_metadata": {
"branch": "main",
"commit_count": 47,
"repo_created_at": "2020-11-22T17:38:37.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "74f6e8367be... |
044031df-8dd0-4723-865a-bfaa9a5b3d7c | BenjaminHung8405/human-resource-manager | BT04_02_QLNV_sv.CPP | //Su dung toan tu cin va cout
#include <conio.h>
#include <stdio.h>
#include <math.h>
#include <string.h>
#include<stdlib.h>
#include <iomanip>
#include <iostream>
using namespace std;
#define MAX_TEN 50
#define MAX_MASO 10
#define LCB 1800000
//Class Nhanvien
class NhanVien
{ protected: //private:
char HoT... | TOOL | 0.945046 | 3.24751 | {
"github_metadata": {
"branch": "main",
"commit_count": 1,
"repo_created_at": "2024-10-29T12:50: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": "38d7673cac0f... |
4601f37e-705c-4610-a9ac-04d91e59e209 | wonderlzy/leetcode_cpp | 700_799/756_paramid_transition.h | //
// 756_paramid_transition.h
// cpp_code
//
// Created by zhongyingli on 2018/8/23.
// Copyright © 2018 zhongyingli. All rights reserved.
//
#ifndef _56_paramid_transition_h
#define _56_paramid_transition_h
class Solution {
public:
bool pyramidTransition(string bottom, vector<string>& allowed) {
uno... | ALGO | 0.999143 | 5.125339 | {
"github_metadata": {
"branch": "master",
"commit_count": 79,
"repo_created_at": "2018-06-11T06:22:29.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 3,
"forks": 2,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "286983d1c... |
682cabdc-82fc-4b1e-b32c-97525e7cd5a7 | Warrio111/Learn-MultiThreading-With-Modern-Cplusplus- | Assigment1FizzBuzzGame.cpp | #define _CRT_SECURE_NO_WARNINGS
#include <iostream>
#include <thread>
using namespace std;
/*
A group of children sit in a circle, counting numbers out loud.
The first child says "one", the next child says "two", the next child says "three", and so on.
However, if the number is divisible by 3, they say "fizz" instead... | ALGO | 0.99587 | 5.336335 | {
"github_metadata": {
"branch": "main",
"commit_count": 4,
"repo_created_at": "2023-12-25T15:12: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": "d547f477a6f2... |
02994d78-5c5f-4d6e-8023-42c07b6e0b53 | destinyson7/All-Codes | Codeforces/1140C.cpp | #include <bits/stdc++.h>
using namespace std;
typedef long long int ll;
typedef unsigned long long int ull;
typedef long double ld;
typedef pair <ll, ll> pll;
typedef pair <int, int> pii;
#define pb push_back
#define mp make_pair
#define ff first
#define ss second
#define all(a) a.begin(), a.end()
#define sz(a) (ll)... | ALGO | 0.999981 | 3.980114 | {
"github_metadata": {
"branch": "master",
"commit_count": 213,
"repo_created_at": "2019-12-02T11:53: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": "e694cefd... |
1f10bfa4-ec5c-4b88-907f-9a4ed343743b | yz1019117968/FSE-24-UniTrans | cleaned_data/transcoder_evaluation_gfg/cpp/LEXICOGRAPHICALLY_NEXT_STRING.cpp | // Copyright (c) 2019-present, Facebook, Inc.
// All rights reserved.
//
// This source code is licensed under the license found in the
// LICENSE file in the root directory of this source tree.
//
#include <iostream>
#include <cstdlib>
#include <string>
#include <vector>
#include <fstream>
#include <iomanip>
#include... | ALGO | 0.995465 | 4.282532 | {
"github_metadata": {
"branch": "main",
"commit_count": 5,
"repo_created_at": "2024-04-06T11:00:54.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 20,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "c8b4a737e64... |
96c802f5-777e-4d44-9f85-e7012fcdbc5f | omkaranu04/CP_DSA | AZ Course/Linked List/reverse_list_hard.cpp | #include <bits/stdc++.h>
using namespace std;
struct ListNode
{
int val;
ListNode *next;
ListNode() : val(0), next(nullptr) {}
ListNode(int x) : val(x), next(nullptr) {}
ListNode(int x, ListNode *next) : val(x), next(next) {}
};
ListNode *revList(ListNode *head)
{
ListNode *curr = head;
Li... | ALGO | 0.999985 | 5.050435 | {
"github_metadata": {
"branch": "master",
"commit_count": 29,
"repo_created_at": "2025-01-09T08:35: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": "10f95be4c... |
0e3b778a-eacc-4e2c-8ae6-ee957aadeb4e | JayantGoel001/Dynamic-Programming | The painters partition problem.cpp | #include <iostream>
#define int long long int
using namespace std;
// Time Complexity is (k*n^2) And Space Complexity is (kn).
int partitionTD(int *cumSum,int n,int k,int **dp){
if (k==1){
dp[k][n] = cumSum[n] - cumSum[0];
return dp[k][n];
}
if (n==1){
dp[k][n]=cumSum[1];
ret... | ALGO | 0.999961 | 5.284187 | {
"github_metadata": {
"branch": "master",
"commit_count": 101,
"repo_created_at": "2020-04-28T06:16:35.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 8,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "2c762f1a... |
5c0ea4a4-9192-494f-b828-7b2906c8afd5 | AdamJCrawford/UCM-Classes | CSE 100/Lab 12/acrawford7.cpp | #include <iostream>
#include <vector>
using namespace std;
struct Connection
{
int other_node;
int weight;
};
struct Node
{
int index;
int distance = 1073741823;
Node *parent = nullptr;
vector<Connection> pair;
};
vector<Node> nodes;
void relax(No... | ALGO | 0.999775 | 4.070636 | {
"github_metadata": {
"branch": "master",
"commit_count": 4,
"repo_created_at": "2022-11-11T05:49: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": "ba084a847e... |
434160d6-4e31-4a0f-ae67-c29a3d8f9e51 | confusedconsciousness/geeks-for-geeks | DP/subsequence_having_product_less.cpp | // This code is not complete
#include<iostream>
#include<vector>
using namespace std;
int product(int *A, int n, int k, int s){
if(n == 0){
return 0;
}
if(s > k){
return 0;
// prune this branch
}
if(s == k){
return 1;
}
if(s < k){
// we have three opt... | ALGO | 0.999702 | 3.607258 | {
"github_metadata": {
"branch": "master",
"commit_count": 21,
"repo_created_at": "2019-07-20T04:45: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": "4eeb64c26... |
bb33ba85-a5b6-411e-947a-e6bf05bdab8e | nvatuan/CP | web@codeforces/compete/c1350-1399/c1393/c.cpp | #include <bits/stdc++.h>
using namespace std;
int n;
int a[100001];
void solve() {
cin >> n;
map<int, int> occ;
for (int i = 0; i < n; i++) {
cin >> a[i];
occ[a[i]]++;
}
int maxOcc = 0;
int maxInd = 0;
for (int i = 0; i < n; i++) {
if (occ[a[i]] > maxOcc) {
... | ALGO | 0.999583 | 4.268284 | {
"github_metadata": {
"branch": "master",
"commit_count": 16,
"repo_created_at": "2020-08-26T03: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": "c0e616336... |
02103f46-2e52-4b29-8139-74934587a25d | auiwjli/Cminusf-Compiler | src/passes/Mem2Reg.cpp | #include "Mem2Reg.hpp"
#include "IRBuilder.hpp"
#include "Value.hpp"
#include "DeadCode.hpp"
#include <memory>
void Mem2Reg::run() {
// 创建支配树分析 Pass 的实例
dominators_ = std::make_unique<Dominators>(m_);
// 建立支配树
dominators_->run();
// 以函数为单元遍历实现 Mem2Reg 算法
for (auto &f : m_->get_functions()) {
... | ALGO | 0.964571 | 4.819803 | {
"github_metadata": {
"branch": "main",
"commit_count": 1,
"repo_created_at": "2025-04-13T08:25: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": "a689b08144c2... |
120aac46-2547-4818-9827-7891b0f58311 | xuzhezhaozhao/TopCoder | 612/D23/PowersOfTwo.cpp | #include <algorithm>
#include <functional>
#include <numeric>
#include <utility>
#include <iostream>
#include <sstream>
#include <iomanip>
#include <bitset>
#include <string>
#include <vector>
#include <stack>
#include <deque>
#include <queue>
#include <set>
#include <map>
#include <cstdio>
#include <cstdlib>
#includ... | ALGO | 0.998397 | 4.670912 | {
"github_metadata": {
"branch": "master",
"commit_count": 96,
"repo_created_at": "2013-05-31T05:38:34.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2,
"forks": 3,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "19f9b07ae... |
5d0e5055-2562-4e0e-82b9-71ca638148c6 | robyntopers/AI_Fall_2016 | Proj3/PartiallyKnownGrid.cpp | #include "PartiallyKnownGrid.h"
using namespace std;
PartiallyKnownGrid::PartiallyKnownGrid(std::string instance_name) {
start_ = kInvalidXYLoc;
curr_ = kInvalidXYLoc;
goal_ = kInvalidXYLoc;
width_ = -1;
height_ = -1;
ifstream map;
map.open(instance_name.c_str());
// Read the dimensions of the grid.
string ... | ALGO | 0.945602 | 6.106559 | {
"github_metadata": {
"branch": "master",
"commit_count": 27,
"repo_created_at": "2016-09-19T16:49:42.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "490353b1f... |
2c12cbdc-0467-4e91-9092-1c402b4c66a1 | MatthewColvin/Parallel-CS4000 | Homework 3/Sequential/GameOfLife.cc | /*
<NAME>
Homework 3
Decription: Class used to simulate the Game of life invented by <NAME>.
*/
#include <iostream>
#include <thread>
#include "GameOfLife.h"
std::vector<std::vector<int>> GameOfLife::SimulateLife(std::vector<std::vector<int>>& b, int life_cycles){
board = b; // laod... | ALGO | 0.997894 | 4.840412 | {
"github_metadata": {
"branch": "master",
"commit_count": 33,
"repo_created_at": "2019-02-18T16:00: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": "595ed4b28... |
6090058b-c98f-44ef-911f-0ce5902b212d | ishandutta2007/codeforces-c | crashed/normal/571/E.cpp | #include <cstdio>
#include <cstdlib>
#include <iostream>
#include <algorithm>
#define rep( i, a, b ) for( int i = (a) ; i <= (b) ; i ++ )
#define per( i, a, b ) for( int i = (a) ; i >= (b) ; i -- )
typedef long long LL;
const int mod = 1e9 + 7;
const int MAXN = 105, MAXD = 6e3 + 5;
template<typename _T>
void read( ... | ALGO | 0.999898 | 3.616354 | {
"github_metadata": {
"branch": "main",
"commit_count": 1,
"repo_created_at": "2024-04-11T01:17: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": "e2dfb8dab916... |
ed9810a4-4665-469e-b8f5-20f3fe6792f1 | avvinci/cp | implementation/feb_LC_18_Q3.cpp | // avvinci - sem 8
// #include"prettyprint.hpp"
#include<bits/stdc++.h>
using namespace std;
typedef pair<long long int , long long int> P;
#define mod 1000000007
#define pb push_back
#define mk make_pair
#define fs first
#define sc second
#define ll long long int
#define fr(it,st,en) for(it=st;it<en;it++)
#def... | ALGO | 0.999682 | 3.649528 | {
"github_metadata": {
"branch": "master",
"commit_count": 37,
"repo_created_at": "2017-09-05T05:14:14.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 4,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "5d7f43881... |
3c07f6af-0840-4828-aaf7-40701cae5918 | SaratBobbili/CP | cp3/chp2/lds/borrowers.cpp | #include<iostream>
#include<utility>
#include<algorithm>
#include<vector>
#include<string>
#include<map>
using namespace std;
int main(){
string s;
vector< pair<string,string> > shelf;
map <string,int> bookorder;
while(getline(cin,s) && s !="END"){
string title,author;
size_t s_len = s.size();
size_t fou... | TOOL | 0.996561 | 3.766787 | {
"github_metadata": {
"branch": "master",
"commit_count": 34,
"repo_created_at": "2017-11-19T22:47: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": "9ae27ce6d... |
62151940-86c8-4971-bd7d-c7ba7a44b6d6 | alpc40/learning_opencv | mingpian/1test.cpp | #include "imgproc.hpp"
#include "highgui.hpp"
#include<iostream>
#include<dirent.h>
#include<errno.h>
#include<string>
#include<fcntl.h>
#define uchar unsigned char
using namespace std;
using namespace cv;
string dir_path= "/home/alpc40/opencv/mingpian/picture/";
string img_path;
string win0="imageshow",win1="erode",w... | ALGO | 0.997237 | 3.44567 | {
"github_metadata": {
"branch": "master",
"commit_count": 21,
"repo_created_at": "2017-04-20T09:15: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": "856d0b9ff... |
a2418683-66c0-4db0-9392-20640a81a5f2 | one-saurabhsingh/Competitive-Coding | codeforces/B_1_Bouquet_Easy_Version.cpp | #include "bits/stdc++.h"
#define int long long
#define uint unsigned long long
#define vi vector<int>
#define vvi vector<vi >
#define vb vector<bool>
#define vvb vector<vb >
#define fr(i,n) for(int i=0; i<(n); i++)
#define rep(i,a,n) for(int i=(a); i<=(n); i++)
#define nl cout<<"\n"
#define dbg(var) cout<<#var<<"="<<va... | ALGO | 0.99996 | 4.238222 | {
"github_metadata": {
"branch": "main",
"commit_count": 29,
"repo_created_at": "2024-07-04T06: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": "b6ce1449fb7... |
3c8b6e6d-face-4201-8fe9-3c73a24b6052 | sourabh789-oss/CODESOFT | guessno.cpp | #include <iostream>
#include <cstdlib>
#include <time.h>
using namespace std;
void guessNumber(int guessno, int actualnum, int nguesses)
{
while (guessno != actualnum)
{
if (guessno > actualnum)
{
cout << "enter the lower number please" << endl;
cin >> guessno;
... | ALGO | 0.97331 | 3.28422 | {
"github_metadata": {
"branch": "main",
"commit_count": 11,
"repo_created_at": "2024-07-02T19:28: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": "3487f67bb8b... |
fc18380c-86db-40d9-8df9-b7d04bbf2fc2 | E3SM-Project/E3SM | components/homme/src/share/cxx/utilities/BfbUtils.hpp | #ifndef HOMME_BFB_UTILS_HPP
#define HOMME_BFB_UTILS_HPP
#include "PackTraits.hpp"
#include <Kokkos_Core.hpp>
namespace Homme
{
// Set the least significant n bits of the fraction to 0. Use this for
// BFB-testing between GPU and host. Zero the n least significant bits of y in
// y = pow(x, e),
// for example.
// ... | ALGO | 0.980232 | 7.209486 | {
"github_metadata": {
"branch": "master",
"commit_count": 64504,
"repo_created_at": "2014-07-03T19:04:08.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 381,
"forks": 425,
"issues": 535,
"pull_requests": 54
},
"file_meta": {
"content_id": "... |
f81cb809-1fb5-4dbb-9fad-d30e54551824 | GraphPKU/BREC | SparseWL/kernels/main.cpp | #include <cstdio>
#include "src/AuxiliaryMethods.h"
#include "src/ColorRefinementKernel.h"
#include "src/ShortestPathKernel.h"
#include "src/GraphletKernel.h"
#include "src/GenerateTwo.h"
#include "src/GenerateThree.h"
#include "src/Graph.h"
#include <iostream>
#include <chrono>
using namespace std::chrono;
using name... | ALGO | 0.995889 | 3.352072 | {
"github_metadata": {
"branch": "Release",
"commit_count": 23,
"repo_created_at": "2023-04-16T03:31:02.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 22,
"forks": 6,
"issues": 1,
"pull_requests": 0
},
"file_meta": {
"content_id": "0627a326... |
e048f63f-c7b9-4cc6-b550-43016ca8fe44 | itohdak/Codeforces | Div2/prev/592/D.cpp | #include <bits/stdc++.h>
using namespace std;
#define ll long long
#define REP(i,m,n) for(int i=(int)(m); i<(int)(n); i++)
#define rep(i,n) REP(i,0,n)
#define RREP(i,m,n) for(int i=(int)(m); i>=(int)(n); i--)
#define rrep(i,n) RREP(i,n-1,0)
#define REPL(i,m,n) for(ll i=(ll)(m); i<(ll)(n); i++)
#define repl(i,n) REPL(i,... | ALGO | 0.999943 | 3.895768 | {
"github_metadata": {
"branch": "master",
"commit_count": 46,
"repo_created_at": "2018-05-21T14:37: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": "e70ee880e... |
d3d67582-a18b-4f48-8570-49c3a6db13da | lovezzt/algorithm | dp/hdu3967.cpp | solution:
这题是问你[A, B]之内的f(n, K)和,其中f(n, k) 定义为 n 的划分数目使得n = (ab)。(a + b) % K = 0。
这题不难,用类似数位dp的思想,我们先枚举共有几位,对于共有tot位的情况,我们枚举第一个数有x位,然后第二个数有tot - x位,
然后枚举第一个数模K余i,那么第二个数模K余(K-i)%K,然后统计各有几个数相乘即可。
code:
#include <iostream>
#include <cstdio>
#include <cstring>
#include <cstdlib>
#include <algorithm>
using namespace std;
... | ALGO | 0.999752 | 3.97984 | {
"github_metadata": {
"branch": "master",
"commit_count": 24,
"repo_created_at": "2013-08-28T16:34: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": "f69831511... |
4b0fd057-e96d-4926-afd3-3347807914b2 | didw/coding | algospot/fossil.cpp | #include <iostream>
#include <vector>
using namespace std;
typedef struct {
double x, y;
} point;
vector<point> hull1, hull2;
vector<pair<point, point>> upper, lower;
void decompose(const vector<point>& hull) {
int n = hull.size();
for (int i = 0; i < n; ++i) {
if (hull[i].x < hull[(i+1)%n].x)
... | ALGO | 0.99997 | 4.932251 | {
"github_metadata": {
"branch": "master",
"commit_count": 96,
"repo_created_at": "2015-12-01T04:53:06.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "57b47d218... |
47392c83-9e84-45b5-b20d-42cace5591f5 | aayushi-droid/Edabit-Solutions | 5. Very Hard/caesarsCipher.cpp | #include <bits/stdc++.h>
using namespace std;
/* Problem-Task :
<NAME> protected his confidential information by encrypting it using a cipher. Caesar's cipher (check Resources tab for more info) shifts each letter by a number of letters.
If the shift takes you past the end of the alphabet, just rotate back to... | ALGO | 0.999836 | 5.226269 | {
"github_metadata": {
"branch": "master",
"commit_count": 230,
"repo_created_at": "2020-07-26T16:56:41.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 38,
"forks": 150,
"issues": 0,
"pull_requests": 1
},
"file_meta": {
"content_id": "c3b1c... |
29328f0e-bf30-45d6-9d25-d0c16861dff3 | SamueleVid/competitive_programming | olinfo/calculator/code.cpp | #include <bits/stdc++.h>
using namespace std;
#define ll long long
// tecnicamente basterebbe 3001, però per esempio per 2728 servirebbe 4096
const int K = 5000;
// sicuramente MAXOP <= 2 * log2(K)
const int MAXOP = 24;
struct expr {
ll ops = 1e9;
ll lexp;
ll rexp;
string op;
};
expr dp[K];
void print... | ALGO | 0.99987 | 4.495826 | {
"github_metadata": {
"branch": "main",
"commit_count": 355,
"repo_created_at": "2023-12-24T09:09: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": "6345d58dca... |
9857eec0-940e-4103-94be-c9991da6fbea | khaliavka/cpp-search-server | search-server/search_server.h | #pragma once
#include <algorithm>
#include <execution>
#include <list>
#include <map>
#include <set>
#include <stdexcept>
#include <string>
#include <string_view>
#include <type_traits>
#include <vector>
#include "concurrent_map.h"
#include "document.h"
#include "string_processing.h"
constexpr size_t MAX_RESULT_DOCUM... | WEB | 0.996114 | 7.585045 | {
"github_metadata": {
"branch": "main",
"commit_count": 40,
"repo_created_at": "2022-09-06T05:51: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": "9a5c8b87b09... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.