uuid stringlengths 36 36 | repo_name stringlengths 5 123 | relative_path stringlengths 5 4k | content stringlengths 33 2.85M | category stringclasses 6
values | algo_rel_score float64 0.85 1 | quality_score float64 3 8.76 |
|---|---|---|---|---|---|---|
396de16c-32f1-47c7-b092-5b003b659f6d | Karnatinikhil25/Issue_windowssupport_group6 | openMTPK-main/experiment/wolfram/vects2.cpp | #include <cassert>
#include <iostream>
#include <stdio.h>
#include <vector>
using namespace std;
template <typename LHS, typename RHS>
auto vsum(LHS &lhs, RHS const &rhs) {
assert(lhs.size() == rhs.size());
auto lhs_iter = lhs.begin();
auto rhs_iter = rhs.cbegin();
while (lhs_iter != lhs.end() && rhs_... | ALGO | 0.993471 | 5.339647 |
d0f58b74-aa95-4d85-a0f8-c15819db3215 | jun-pac/PS | SCPC2024/1차예선/C.cpp |
#include <bits/stdc++.h>
using namespace std;
#define fi first
#define se second
#define cediv(a,b) ((a)%(b)==0?((a)/(b)):((a)/(b))+1)
#define rng(i,a,b) for(int i=int(a);i<=int(b);i++)
#define rep(i,b) rng(i,0,b-1)
#define gnr(i,b,a) for(int i=int(b);i>=int(a);i--)
#define per(i,b) gnr(i,b-1,0)
#define pb push_back... | ALGO | 0.999648 | 4.989185 |
1c443273-c586-47a7-a3f9-48f747bae4ed | joaquintorres/intro-sims | ising/lib/eigen-3.4.0/bench/geometry.cpp |
#include <iostream>
#include <Eigen/Geometry>
#include <bench/BenchTimer.h>
using namespace std;
using namespace Eigen;
#ifndef SCALAR
#define SCALAR float
#endif
#ifndef SIZE
#define SIZE 8
#endif
typedef SCALAR Scalar;
typedef NumTraits<Scalar>::Real RealScalar;
typedef Matrix<RealScalar,Dynamic,Dynamic> A;
type... | ALGO | 0.863115 | 5.941502 |
38ba2421-be8d-470c-b69e-4b616f02eeca | 2532779/RosalesJerson_CSC5_43952 | Hmwrk/Assignment 2/Gaddis_8thEd_Chap3_Prob7/main.cpp | /*
* File: main.cpp
* Author: Jerson Rosales
* Created on March 17, 2015, 4:43 PM
* Purpose:To Calculate $ earned in movie theater
*/
//System Libraries
#include <iostream>
#include <string>
#include <iomanip>
using namespace std;
//User Libraries
//Global Constants
unsigned char CNVPCT=100;
//Function Pro... | ALGO | 0.944636 | 4.820613 |
6005ce31-4a08-448e-9732-c4f3031390a3 | ishandutta2007/codeforces | kotamanegi/normal/1294/C.cpp | #pragma comment (linker, "/STACK:526000000")
#define _CRT_SECURE_NO_WARNINGS
#include "bits/stdc++.h"
using namespace std;
typedef string::const_iterator State;
#define eps 1e-11L
#define MAX_MOD 1000000007LL
#define GYAKU 500000004LL
#define MOD 998244353LL
#define seg_size 262144
#define pb push_back
#define mp ma... | ALGO | 0.999686 | 3.884819 |
a1bfa3bc-ecb5-4e69-a34d-3718688080ff | Untribium/algolab | 2017/44-buddy_selection.cpp | #include<iostream>
#include<vector>
#include<boost/graph/adjacency_list.hpp>
#include<boost/graph/max_cardinality_matching.hpp>
using namespace std;
using namespace boost;
typedef adjacency_list<vecS, vecS, undirectedS> Graph;
typedef graph_traits<Graph>::vertex_descriptor Vertex;
int main() {
ios_base::sync... | ALGO | 0.99912 | 4.866379 |
eaa4c55e-a3c5-4793-bd9e-a24bc87d311e | Ad4sk0/Sudoku | Sudoku/src/solver/SudokuSolver.cpp | #include "solver/SudokuSolver.h"
optional<pair<int, int>> SudokuSolver::findEmptyCell(const vector<vector<int>>& grid) {
for (int row = 0; row < grid.size(); row++)
{
for (int col = 0; col < grid[row].size(); col++)
{
if (grid[row][col] == 0)
{
return pair<int, int>(row, col);
}
}
}
return nullo... | ALGO | 0.999565 | 6.777954 |
aeb4bead-c496-4cbc-9326-5d8414831553 | sourav9124/Codechef-Beginner | codechef attendance.cpp | #include<bits/stdc++.h>
using namespace std;
int main()
{
int t;
cin>>t;
while(t--)
{
int n;
cin>>n;
int ar[n];
string f[n];
string l[n];
for(int i=0;i<n;i++)
{
cin>>f[i]>>l[i];
}
for(int i=0;i<n;i++)
{
ar[i]=0;
}
for(int i=0;i<n-1;i++)
{
for(int j=i+1;j<n;j++)
{
if(... | ALGO | 0.999948 | 3.072133 |
d63941b5-da1c-4e62-8878-58fad46f05ff | RoshniPande/Competitive-Programming | pset3/pset3_5_coach.cpp | #include <bits/stdc++.h>
using namespace std;
#define pb push_back
stack <int> s;
std::vector<int> v1;
std::vector<int> v2;
std::vector<int> v3;
int dfs(vector<int> adj[], bool vis[])
{
int j=1;
std::vector<int> r;
while(!s.empty())
{
int u=s.top();
r.pb(u);
s.pop();
for (int i = 0; i < adj[u].size(); ++i)
... | ALGO | 0.999904 | 3.607349 |
b81e17af-c80b-436d-9a8f-f304768efccd | BillyHJHamilton/Kosmosinsel | Attack.cpp | #include "Attack.h"
#include "Damage.h"
#include "Fire.h"
#include "Formation.h"
#include "GameConstants.h"
#include "Morale.h"
#include "Random.h"
#include "Unit.h"
#include "UnitType.h"
#include <algorithm>
#include <cassert>
#include <iomanip>
#include <iostream>
void ApplyAttack(
const std::vector<SUnit*>& attack... | ALGO | 0.974082 | 4.486368 |
afe09b58-f8ab-4f76-b539-bd579f5d3505 | lxiao217/study428 | 深度学习/源码/OpenCV/opencv_contrib/modules/alphamat/src/local_info.cpp | // #ifndef local_info
// #define local_info
#include "precomp.hpp"
#include "local_info.hpp"
namespace cv { namespace alphamat {
void local_info(Mat& img, Mat& tmap, SparseMatrix<double>& Wl, SparseMatrix<double>& Dl)
{
float eps = 0.000001;
int win_size = 1;
int nRows = img.rows;
int nCols = img.co... | ALGO | 0.999371 | 3.714187 |
c4ecea60-6462-4a15-bb25-be43e2cb1b24 | ishandutta2007/codeforces | lzr010506/normal/699/D.cpp | #include <iostream>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <algorithm>
#include <cmath>
using namespace std;
const int N=200005;
int n,fa[N],a[N],root,q[N],ins[N],vis[N];
int main()
{
scanf("%d",&n);
for (int i=1; i<=n; i++) scanf("%d",&fa[i]);
for (int i=1; i<=n; i++) a[i]=fa[i];
root=... | ALGO | 0.999934 | 3.886436 |
e87d9907-adf4-4112-bcaa-9e16f70c11e8 | hitoshiQQ/LeetCode | 22. Generate Parentheses/22.3 Generate Parentheses.cpp | // acceleration
const int ZERO = [] {
ios_base::sync_with_stdio(false);
cin.tie(nullptr);
return 0;
}();
class Solution {
void generateParenthesis(vector<char>& current, int open, int close, vector<string>& st) {
if (open == 0 && close == 0) {
st.push_back(string(current.begin(), cu... | ALGO | 0.999871 | 6.14795 |
6729fb7d-e3a2-4588-894e-f9f18823b0ee | Hanamantray8151/Coding-Ninjas-Data-Structures-In-CPP | Binary Search Trees/get_root_to_node_path.cpp | /*
Given a BST and an integer k. Find and return the path from the node with data k and root (if a node with data k is present
in given BST) in a list. Return empty list otherwise.
Note: Assume that BST contains all unique elements.
Input Format :
The first line of input contains data of the nodes of the tree in level... | ALGO | 0.999991 | 4.569593 |
d13290ef-7d97-4aff-9397-7aebdfb70bd2 | QuynhNB/Cplusplus30DaysOfCode | day25_running_time_and_complexity.cpp | #include <cmath>
#include <cstdio>
#include <vector>
#include <iostream>
#include <algorithm>
using namespace std;
int isPrime(int n)
{
if(n < 2)
return 0;
for (int i = 2; i*i <= n; i++)
{
if(n % i == 0)
return 0;
}
return 1;
}
int main() {
/* Enter your code here. R... | ALGO | 0.997832 | 4.304385 |
616e58a0-eed2-4af0-aec0-bcf185b5c140 | bdqnghi/bi-tbcnn | code/bfs/cpp/21.cpp | #include<iostream>
#include<vector>
#include<list>
using namespace std;
void addEdge(vector<int> adj[],int u,int v)
{
adj[u].push_back(v);
adj[v].push_back(u);
}
void BFS(vector<int> adj[],int v,int s)
{
vector<bool> visited(v,false);
list<int> queue;
visited[s]=true;
queue.push_back(s);
v... | ALGO | 0.999911 | 4.320737 |
bbc5297b-2819-4636-9d1f-f1d1e88305f2 | JeanExtreme002/FastSnake | fastsnake/templates/solution.cpp | #include <algorithm>
#include <array>
#include <cassert>
#include <chrono>
#include <cmath>
#include <cstring>
#include <errno.h>
#include <functional>
#include <iomanip>
#include <iostream>
#include <limits>
#include <list>
#include <map>
#include <numeric>
#include <queue>
#include <random>
#include <set>
#include <s... | ALGO | 0.998772 | 4.808604 |
19ad31e1-8ee9-4208-8592-c5254298bbdb | westsider/UnrealEngine-staging-4.20 | Engine/Plugins/Runtime/Synthesis/Source/Synthesis/Private/Flexiverb.cpp | #include "Flexiverb.h"
namespace Audio
{
// Delay line lengths used, in samples. These are chosen because they are mutually prime numbers, extended by a
// constant to minimize ringing products while avoiding any delay line path that would cause noticeable echo.
static const float DelayLineSampleLengths[] = { 16.0f... | TOOL | 0.937984 | 6.594824 |
233759d7-e545-454d-b783-da60a3dcf6e3 | gnovos/iOStuff | CC/Catpcha/libs/Box2D/Dynamics/Contacts/b2CircleContact.cpp | #include <Box2D/Dynamics/Contacts/b2CircleContact.h>
#include <Box2D/Dynamics/b2Body.h>
#include <Box2D/Dynamics/b2Fixture.h>
#include <Box2D/Dynamics/b2WorldCallbacks.h>
#include <Box2D/Common/b2BlockAllocator.h>
#include <Box2D/Collision/b2TimeOfImpact.h>
#include <new>
b2Contact* b2CircleContact::Create(b2Fixture*... | ALGO | 0.94713 | 6.919396 |
d20e68b1-6f31-4ee0-8bc7-37bdeee1b813 | tushardeshmukh04/DAA-WT | DAA/DAA_D3.cpp | /*Implement program to print all subsets of a given
Set or Array
Statement Given a set of positive integers, find all its
subsets.
Input: array = {1, 2, 3}
Output: // this space denotes null element.
{1} {1 2} {1 2 3} {1 3} {2}
{2 3} {3}
Input: 1 2
Output: 1 2 1 2
*/
#include <iostream>
#include <vector>
using names... | ALGO | 0.999653 | 5.548291 |
9e191846-9b5b-4b86-b9a2-1ca1e19c1922 | Sebi1999/Laborator-2sda_multimap | Laborator 2sda_multimap/Main.cpp | #include <iostream>
#include <map>
#include <vector>
#include <algorithm> // pt sortarea functiei
using namespace std;
// functia de comparare a utilitatii pentru a trece la modulul sort ()
bool sortByVal(const pair<string, int>& a,
const pair<string, int>& b)
{
return (a.second < b.second);
}
int main()
{
... | ALGO | 0.999254 | 5.476441 |
330d3d09-bbaa-4aef-9e7f-1bb916e2122b | whxxxxxxxxxx/MedicineTip | windows/runner/utils.cpp | #include "utils.h"
#include <flutter_windows.h>
#include <io.h>
#include <stdio.h>
#include <windows.h>
#include <iostream>
void CreateAndAttachConsole() {
if (::AllocConsole()) {
FILE *unused;
if (freopen_s(&unused, "CONOUT$", "w", stdout)) {
_dup2(_fileno(stdout), 1);
}
if (freopen_s(&unuse... | TOOL | 0.998733 | 6.76775 |
f90f30bc-eb11-485a-ad4e-2669cf5552fb | Rexx0801/codeptit_c_cpp | inmatran1.cpp | #include <bits/stdc++.h>
using namespace std;
int main(){
int t;
cin>>t;
while(t--){
int n;
cin>>n;
long long a[100][100];
for(int i=0;i<n;i++){
for(int j=0;j<n;j++) cin>>a[i][j];
}
for(int i=0;i<n;i++){
if(i%2==0){
for(int j=0;j<n;j++){
cout<<a[i][j]<<" ";
}
}
if(i%2!=0){
f... | ALGO | 0.999734 | 3.028506 |
fe2d5e7f-d9ef-44f8-acc1-0b9ada0f3062 | MSergeyS/cpp-search-server | search-server/search_server.cpp | #include <algorithm>
#include <cmath>
#include <iostream>
#include <iterator>
#include <map>
#include <numeric>
#include <set>
#include <stdexcept>
#include <string>
#include <vector>
#include "document.h"
#include "request_queue.h"
#include "search_server.h"
#include "string_processing.h"
using namespace std;
Searc... | WEB | 0.988889 | 5.567 |
48bb4bcb-a6b6-4e6b-aa47-df345b752e33 | ishandutta2007/codeforces | nantf/normal/1188/C.cpp | #include<bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<int,int> PII;
const int maxn=1111,mod=998244353;
#define MP make_pair
#define PB push_back
#define lson o<<1,l,mid
#define rson o<<1|1,mid+1,r
#define FOR(i,a,b) for(int i=(a);i<=(b);i++)
#define ROF(i,a,b) for(int i=(a);i>=(b);i--)
#define... | ALGO | 0.999942 | 4.232719 |
a7ebfbb4-76df-4c16-9c13-5e99fe2a4a1a | khank080605/code-c | c01021.cpp | #include "stdio.h"
#include "math.h"
int main(){
long long n;
scanf("%lld", &n);
int s=0, i=1, t=n;
while (t!=0){
s+=t%10;
t=t/10;
++i;
}
printf("%d", s);
} | ALGO | 0.999869 | 3.496194 |
0411b65c-9b70-4c8c-ba8f-e1fff8303802 | amsraman/Competitive_Programming | USACO/Training Pages/Chapter 2/2.1/frac1.cpp | /*
ID: adisund1
LANG: C++
TASK: frac1
*/
#include <fstream>
#include <iostream>
#include <vector>
using namespace std;
int gcd(int a, int b)
{
int r = 1;
for(int i = 2; i<=min(a,b); i++)
{
if((a%i==0)&&(b%i==0))
{
r = i;
}
}
return r;
}
int main()
{
int n;
... | ALGO | 0.999864 | 3.726698 |
d0c23a62-8591-4291-b447-cb0dfecdf042 | AnkitShome/Leetcode | 0003-longest-substring-without-repeating-characters/0003-longest-substring-without-repeating-characters.cpp | class Solution {
public:
int lengthOfLongestSubstring(string s) {
int n=s.size();
int i=0,j=0;
int ans=0;
vector<int> vis(256,-1);
while(j<n){
if(vis[s[j]]!=-1){
int l=vis[s[j]];
i=max(i,l+1);
}
vis[s[j]]=j;
... | ALGO | 0.999977 | 6.084699 |
3e9fe690-63d1-4206-bbec-4a937892fdbe | RomanMykush/godot | thirdparty/icu4c/common/ucharstriebuilder.cpp | #include "unicode/utypes.h"
#include "unicode/ucharstrie.h"
#include "unicode/ucharstriebuilder.h"
#include "unicode/unistr.h"
#include "unicode/ustring.h"
#include "cmemory.h"
#include "uarrsort.h"
#include "uassert.h"
#include "uhash.h"
#include "ustr_imp.h"
U_NAMESPACE_BEGIN
/*
* Note: This builder implementation... | TOOL | 0.934004 | 7.110007 |
ebd83fb9-46ed-43b7-acfe-5a3f87948b63 | ykprogram/New-RPG | Program Files/Map/Map_Player.cpp | //̃t@Cł̓}bvɂvC[̎ȏst@CłB
#include "DxLib.h"
#include "../UsePrototype.h"
#include "Map_Player.h"
#define PLAYERMAX 30//cB{͐GȂĂƎv
static int a=0; //グĂƂȂǂ̃[V\̂Ɏg
static int Encountered=0;
SecondPlayer_t SecondPlayer[ PLAYERMAX ];
void Zanzou( Map_Player_t *Player ){
//LN^[‚‚炷
for(int i = PLAYERMAX-1 ; i > 0 ; i --... | TOOL | 0.897079 | 3.764453 |
36b7b45b-bd2f-4b3d-bce0-6bbc5ae0f274 | AmrEsam0/LeetCode | 20.valid-parentheses.cpp | /*
* @lc app=leetcode id=20 lang=cpp
*
* [20] Valid Parentheses
*/
// @lc code=start
#include <bits/stdc++.h>
using namespace std;
class Solution {
public:
bool isValid(string s) {
stack<char> st;
for (int i = 0; i < s.length(); i++) {
if ((s[i] == '(') || (s[i] == '[') || (s[i] ... | ALGO | 0.999173 | 6.985519 |
312af3ca-5d1c-42ad-a9f6-219441a52052 | Lokyj/Ayudantias-Progra | Ayudantia 3/Ejercicio 1.cpp | #include <iostream>
#include <cmath>
using namespace std;
int main()
{
int a,b,primos=0;
bool esprimo;
cout<<"limite inferior: \n";
cin>>a;
cout<<"limite superior: \n";
cin>>b;
for (int i=a+1;i<b;i++){
esprimo=true;
if(i==1){
esprimo=false;
}
... | ALGO | 0.999951 | 4.301063 |
72d81bde-9f17-4c17-a8e7-85cf69a7677f | atembe17/GaussJordan | GaussJordan/GJCPU.cpp | #include "GJCommon.cuh"
//Method to calculate Gaussian Elimination using CPU
void GaussianEliminationCPU(float** matrix, unsigned int numberOfRows, unsigned int numberOfColumns, float** outputMatrix, bool partialPivot) {
//Copy input matrix into output matrix
for (int i = 0; i < numberOfRows; i++)
{
for (int j = 0... | ALGO | 0.999739 | 3.238398 |
6336ba98-79d7-459d-a481-0fbaf822c09c | ishandutta2007/codeforces | zero4338/normal/1537/E1.cpp | #include<bits/stdc++.h>
using namespace std;
int read()
{
int ret=0;bool f=0;char c=getchar();
while(c>'9'||c<'0')f|=(c=='-'),c=getchar();
while(c>='0'&&c<='9')ret=(ret<<3)+(ret<<1)+(c^48),c=getchar();
return f?-ret:ret;
}
const int maxn=5e5+5;
int n,k;
string s,ans;
int nxt[maxn],p;
int main()
{
n=read();k=read()... | ALGO | 0.999999 | 3.551963 |
9ad7ef33-0e5d-4f17-be25-68c414ca7a47 | IraShinking/CPP-Programming-Homework | 波兰计算器-栈模板.cpp | #include <iostream>
#include <sstream>
#include <cmath>
#include <cassert>
using namespace std;
template <class T, int SIZE = 50>
class Stack
{
private:
T list[SIZE];
int top;
public:
Stack();
void push(const T &item);
T pop();
void clear();
const T &peek() const;
bool isEmpty() const;... | ALGO | 0.992058 | 4.236033 |
37bce543-d492-44de-9806-5f6a9e8cd830 | sarvex/solution-cpp | 0441.arranging_coins.cpp | using LL = long;
class Solution {
public:
int arrangeCoins(int n) {
LL left = 1, right = n;
while (left < right) {
LL mid = left + right + 1 >> 1;
LL s = (1 + mid) * mid >> 1;
if (n < s)
right = mid - 1;
else
left = mid... | ALGO | 0.999962 | 6.172589 |
2577a1b1-fb8c-4bb0-b56b-86f9a5e55f67 | ArchitKumar1/LeetCode-Submissions | 1-bit-and-2-bit-characters/Accepted/4-7-2020, 2:48:41 PM/Solution.cpp | // https://leetcode.com/problems/1-bit-and-2-bit-characters
class Solution {
public:
bool isOneBitCharacter(vector<int>& bits) {
ios_base::sync_with_stdio(false);
cin.tie(NULL);
int n = bits.size();
vector<vector<int>> dp(n+1,vector<int>(3,0));
dp[0][0] = dp[0][1] =... | ALGO | 0.999918 | 5.831145 |
9a721cc2-0749-4ade-be9c-72b70bcf0f87 | hikko624/prog_contest | atcoder.jp/nomura_2020/nomura2020_a.cpp | // nomura2020_a
#include <algorithm>
#include <bitset>
#include <complex>
#include <deque>
#include <exception>
#include <fstream>
#include <functional>
#include <iomanip>
#include <ios>
#include <iosfwd>
#include <iostream>
#include <istream>
#include <iterator>
#include <limits>
#include <list>
#include <locale>
#inc... | ALGO | 0.999826 | 4.46669 |
f8d45220-f692-4fa8-b66d-1ba1e625b186 | khanhnamle1994/technical-interview-prep | LeetCode/Generate-Random-Point-in-a-Circle.cpp | /* Given the radius and x-y positions of the center of a circle, write a function randPoint which generates a uniform random point in the circle.
Example 1:
Input:
["Solution","randPoint","randPoint","randPoint"]
[[1,0,0],[],[],[]]
Output: [null,[-0.72939,-0.65505],[-0.78502,-0.28626],[-0.83119,-0.19803]]
Example 2:
... | ALGO | 0.985559 | 5.728838 |
fb6b3499-88a6-4dbc-8bcc-28d0c7366289 | gugugubo/suanfa | liyubobobo/05-Binary-Search-Tree/Course Code (C++)/Optional-09-Binary-Tree-Classic-Nonrecursive-Traversal/Preorder/main2.cpp | /// Source : https://leetcode.com/problems/binary-tree-preorder-traversal/description/
/// Author : liuyubobobo
/// Time : 2018-05-30
#include <iostream>
#include <vector>
#include <stack>
#include <cassert>
using namespace std;
/// Definition for a binary tree node.
struct TreeNode {
int val;
TreeNode *le... | ALGO | 0.999998 | 6.391768 |
85bb3e85-7bb3-4d82-b0b1-11b7b6bcf84f | horn-ice/sorcar | z3-4.8.4/src/tactic/goal.cpp | #include "ast/ast_ll_pp.h"
#include "ast/ast_smt2_pp.h"
#include "ast/for_each_expr.h"
#include "ast/well_sorted.h"
#include "tactic/goal.h"
goal::precision goal::mk_union(precision p1, precision p2) {
if (p1 == PRECISE) return p2;
if (p2 == PRECISE) return p1;
if (p1 != p2) return UNDER_OVER;
return p... | TOOL | 0.967372 | 6.606221 |
21e96e43-30b1-49d3-81df-743fa27e3043 | raincross7/code-similarity | codes/train_code/problem455/problem455_237.cpp | #include <bits/stdc++.h>
using namespace std;
using ll = long long;
typedef pair<int, int> P;
ll Mod = 1000000007;
int main() {
int N;
cin >> N;
ll A[N];
ll now[N];
ll ans = 0;
now[0] = 1;
for (int i = 0; i < N; i++) {
cin >> A[i];
}
for (int i = 1; i < N; i++) {
if (A[i] == now[i-1] + 1) {
... | ALGO | 0.999871 | 3.851507 |
1992f2cf-cb4a-4116-bc2b-c818a6ccaff9 | ue007/robotic | opencv/imgproc_module/Point_Polygon.cpp | #include "opencv2/highgui.hpp"
#include "opencv2/imgproc.hpp"
#include <iostream>
using namespace cv;
using namespace std;
int main(void)
{
const int r = 100;
Mat src = Mat::zeros(Size(4 * r, 4 * r), CV_8U);
vector<Point2f> vert(6);
vert[0] = Point(3 * r / 2, static_cast<int>(1.34 * r));
vert[1] = P... | ALGO | 0.998265 | 4.654735 |
3809f303-7c16-4e58-8c0f-7cfb95768dad | AvniKal/AVNI_coding | hashing/hashing3.cpp | #include<iostream>
#include<map>
#include<vector>
using namespace std;
int main()
{
// When the size of hasp map is greater than 10 to the power 9
int n;
cin>>n;
vector<int> arr(n);
for(int i=0;i<n;i++)
{
cin>> arr[i];
}
// precompute or prestorage
map<int,int> mpp;
// ... | ALGO | 0.999956 | 4.567009 |
f11f8224-bb90-4046-b034-50acdb5994ab | nescitus/LizardBrain | src/bitboard.cpp | #include "lizard.h"
#define FAST_POPCNT
#ifdef FAST_POPCNT
#include <nmmintrin.h>
#include <intrin.h>
int PopCnt(U64 b) {
return (int)_mm_popcnt_u64(b);
}
int PopFirstBit(U64* b) {
U64 bbLocal = *b;
*b &= (*b - 1);
return FirstOne(bbLocal);
}
#else
int PopCnt(U64 b) {
U64 k1 = (U64)0x55555... | ALGO | 0.991767 | 5.344261 |
feb1f7df-2963-4ce7-8ae6-a8e2590a4f80 | qiaozishun4/CSP2024_BJ | BJ-Senior/answers/BJ-S00580/duel/duel.cpp | #include<bits/stdc++.h>
using namespace std;
const int N=1e5+2;
int r[N];
int pl[N];
bool cmp(int a,int b){
return a<b;
}
int main(){
freopen("duel.in","r",stdin);
freopen("duel.out","w",stdout);
int n;
cin>>n;
bool fl=1;
for(int i=1;i<=n;i++){
cin>>r[i];
if(r[i]>2) fl=0;
... | ALGO | 0.999975 | 3.686945 |
a5aca198-558b-44b8-a5d2-0de551d3a2cd | ZeppyXD/GABB-Source | GDLL/md5.cpp | #include "stdafx.h"
/* interface header */
#include "md5.h"
/* system implementation headers */
#include <cstdio>
// Constants for MD5Transform routine.
#define S11 7
#define S12 12
#define S13 17
#define S14 22
#define S21 5
#define S22 9
#define S23 14
#define S24 20
#define S31 4
#define S32 11
#define S33 16
#de... | ALGO | 0.992443 | 6.537237 |
af3d7798-6bfd-4ed6-a106-7559cfae2fe2 | schStudio/UVa_trainning | AOAPC II Beginning Algorithm Contests (Second Edition) (Rujia Liu)/Arrays And Strings/UVa1583_Digit Generator.cpp | #include <cstdio>
#include <cstring>
#include <ctype.h>
#define maxn 100005
int ans[maxn];
void solve()
{
for( int m = 1; m < maxn; ++m ) {
int x = m, y = m;
while( x > 0 ) {
y += x % 10;
x /= 10;
}
if( ans[y]==0 || m<ans[y] )
ans[y] = m;
}
int T, n;
sca... | ALGO | 0.999663 | 4.390314 |
878c71e6-ab85-46e6-a67e-906da6904d9b | jasonjo97/cpp-linear-algebra | src/inverse.cpp | #include <iostream>
#include <vector>
typedef std::vector<std::vector<int>> matrix;
typedef std::vector<std::vector<float>> float_matrix;
matrix cofactor(matrix A, int p, int q, int n){
// initialization
int N = A.size();
int i=0, j=0;
matrix tmp(N);
for (int row=0; row<N; row++){
for (... | ALGO | 0.998268 | 3.839424 |
0152c5ef-f0b6-4e3c-9529-4390ae6a5d7b | radioactive1014/renew | src/unit/eigen/doc/examples/Tutorial_ReductionsVisitorsBroadcasting_rowwise.cpp | #include <iostream>
#include <Eigen/Dense>
using namespace std;
int main()
{
Eigen::MatrixXf mat(2,4);
mat << 1, 2, 6, 9,
3, 1, 7, 2;
std::cout << "Row's maximum: " << std::endl
<< mat.rowwise().maxCoeff() << std::endl;
}
| ALGO | 0.999275 | 3.881483 |
915e1011-844b-4d96-b9c3-15c7fccbb723 | faresfaresCS/ORB_SLAM2 | Thirdparty/g2o/g2o/core/estimate_propagator.cpp | #include "estimate_propagator.h"
#include <queue>
#include <vector>
#include <cassert>
#include <iostream>
#include <algorithm>
#include <fstream>
//#define DEBUG_ESTIMATE_PROPAGATOR
using namespace std;
namespace g2o {
# ifdef DEBUG_ESTIMATE_PROPAGATOR
struct FrontierLevelCmp {
bool operator()(EstimatePropa... | ALGO | 0.999896 | 5.578137 |
792ea5ca-3754-442e-9739-77373b046347 | leonardonm15/competitive_programing | codeforces/round_871/a.cpp | #include <bits/stdc++.h>
using namespace std;
int main() {
string cd = "codeforces";
int t; cin >> t;
while (t--) {
string n; cin >> n;
int df = 0;
for (int i = 0; i < 10; i++) {
if (n[i] != cd[i]) df++;
}
cout << df << endl;
}
}
| ALGO | 0.999363 | 4.798973 |
7df1f4c7-447e-4404-a594-a480f2a4a476 | alvi-uiu/LeetCode | Old-Solved-Problems/53. Maximum Subarray.cpp | /*
And that each person will only have what they endeavoured towards , [53:39]
and that ˹the outcome of˺ their endeavours will be seen ˹in their record˺ , [53:40]
then they will be fully rewarded . [53:41]
*/
#include <bits/stdc++.h>
using namespace std;
void maxSubArray(vector<int> &nums)
{
int ans = 0;
... | ALGO | 0.999962 | 5.552566 |
2a4766e8-e32f-4cb7-bb33-83008216d2e1 | StolasIn/leetcode_Submissions | content/minimum-path-sum/Accepted/2-16-2022, 10_28_16 PM/Solution.cpp | // https://leetcode.com/problems/minimum-path-sum
class Solution {
public:
int minPathSum(vector<vector<int>>& g) {
int m = g.size();
int n = g[0].size();
int dp[m][n];
for(int i=0;i<m;i++){
for(int j=0;j<n;j++){
dp[i][j] = 1e9;
}
}
... | ALGO | 0.99996 | 6.388285 |
31506516-35d4-4a92-8268-26e1a3331d47 | lengender/Code | Code/完美世界/2.cpp | #include <stdio.h>
#include <stdlib.h>
void get_time(int *hour, int *min, int *second, int const time_diff_second)
{
// implement your code here
int h = *hour, m = *min, s = *second;
int flag = 0;
int time = time_diff_second;
if (time_diff_second < 0){
flag = 1;
time = -time_diff_second;
}
int min_time = ... | ALGO | 0.995626 | 3.352269 |
54942b09-5527-4f16-ae41-048531be9fa0 | localhost44374/dsa | MaxHeap.cpp | #include <iostream>
#include <conio.h>
#define MAX 20
using namespace std;
// 1. Node Template-Not Required
// 2. Array Based Template for max-heap
class heap
{
int arr[MAX];
int n;
public:
heap()
{
int i;
for (i = 0; i < MAX; i++)
{
arr[i] = 0;
}
n = 0;
}
void CreateHeap();
void BuildHeap();
void... | ALGO | 0.997848 | 4.280981 |
cad44a98-ee05-4c94-bb2b-747c64064c41 | TAMARIW/Docking-STM | libs/vl53l4ed/VL53L4ED_calibration.cpp | /**
* @file vl53l4ed_calibration.c
* @brief Calibration functions implementation
*/
#include <math.h>
#include "VL53L4ED_api.h"
#include "VL53L4ED_calibration.h"
VL53L4ED_Error VL53L4ED_CalibrateOffset(
Dev_t dev,
int16_t TargetDistInMm,
int16_t *p_measured_offset_mm,
int16_t nb_samples)
{
VL53L4ED_Error... | ALGO | 0.949331 | 5.120772 |
c66372c2-29ba-4346-98f8-445163f7c170 | Dhananjay10313/GitDemo | 1463Bfnarr.cpp | // (ASCII) a=97 A=65
#include <bits/stdc++.h>
using namespace std;
#define test int T;cin>>T;while(T--)
#define int long long
#define pb push_back
#define all(x) (x).begin(),(x).end()
#define sz(x) (int)((x).size())
#define fr firs\t
#defi... | ALGO | 0.999975 | 3.503798 |
51a28d9c-f29e-4eb5-b21e-ed10818ae441 | cchatzis/Nearest-Neighbour-LSH | lsh.cpp | #include "modules/UserInputHandling.h"
#include "modules/CosineHashing.h"
#include "modules/EuclidianHashing.h"
using namespace std;
ifstream inFile; /* Input File */
ifstream qFile; /* Query File */
ofstream outFile; /* Output File */
int k=4; /* Number of LSH Functions */
int L=5; /* Number of Hash Tables */
... | TOOL | 0.952237 | 3.630299 |
88b6326f-e02e-4925-a6f7-e935f44f623e | raushan17938/DSA | Difficulty: Hard/Stock Buy and Sell – Max K Transactions Allowed/stock-buy-and-sell-max-k-transactions-allowed.cpp | //{ Driver Code Starts
#include <bits/stdc++.h>
using namespace std;
// } Driver Code Ends
class Solution {
public:
int maxProfit(vector<int>& prices, int k) {
int n = prices.size();
if (n == 0 || k == 0) return 0;
if (2 * k >= n) {
int profit = 0;
for (int i = 1;... | ALGO | 0.996598 | 6.365065 |
81a53053-76d5-4712-ab6a-ef0a2c0b1ede | ComputerScientist-01/Competitive-programming-solutions | reshape-the-matrix/reshape-the-matrix.cpp | class Solution {
public:
vector<vector<int>> matrixReshape(vector<vector<int>>& mat, int r, int c) {
vector<vector<int>> ans(r,vector<int>(c));
int row= size(mat), column=size(mat[0]);
int total= row*column;
if(r*c != total ) return mat;
int row_nums=0;
int c... | ALGO | 0.99949 | 6.292564 |
7fed7eb7-1b71-4438-86d1-b59777cbcda4 | KangwooChoi/LeetCode | 3342-find-minimum-time-to-reach-last-room-ii/3342-find-minimum-time-to-reach-last-room-ii.cpp | class State {
public:
int x;
int y;
int dist;
State(int x, int y, int dist) : x(x), y(y), dist(dist) {}
};
class Solution {
public:
const int INF = INT_MAX;
int minTimeToReach(vector<vector<int>>& moveTime) {
int n = moveTime.size(), m = moveTime[0].size();
vector<vector<int>> ... | ALGO | 0.999982 | 5.995097 |
8502f2f3-66de-402e-bb96-8aac45e3a65b | uditnarayan13/DSA | Strings/LSKC.cpp | #include <iostream>
#include <bits/stdc++.h>
using namespace std;
void LongestSubstringWithKUniqueCharacters(string str, int k)
{
map<char, int> mp;
int maxWindowSize = INT_MIN;
int start = 0;
int end = 0;
int i = 0;
int j = 0;
while (j < str.length())
{
mp[str[j]]++;
... | ALGO | 0.999979 | 5.435593 |
e09dcea8-4fbf-4680-88a4-83a196599c2c | armin-tavakoli/Circuit-Simulator-CPP | eigen-3.4.0/doc/examples/tut_arithmetic_redux_basic.cpp | #include <iostream>
#include <Eigen/Dense>
using namespace std;
int main()
{
Eigen::Matrix2d mat;
mat << 1, 2,
3, 4;
cout << "Here is mat.sum(): " << mat.sum() << endl;
cout << "Here is mat.prod(): " << mat.prod() << endl;
cout << "Here is mat.mean(): " << mat.mean() ... | ALGO | 0.998908 | 3.872858 |
c4304c26-b2f2-430c-8927-99c9eb367165 | cr1spyshark/heisenberg | main.cpp | #include <iostream>
int main() {
int num;
std::cin >> num;
int array[num];
for (int i = 0; i < num; i++) {
std::cin >> array[i];
}
for (int i = 1; i < num; i++) {
int key = array[i];
int j = i - 1;
while (j >= 0 && array[j] > key) {
array[j + 1] = ... | ALGO | 0.999956 | 4.501017 |
319d1f68-8095-450b-9bc7-8420e3f94f9e | AmaaniGoose/CodingClass2 | resource/Add_node_at_the_end.cpp | #include<stdio.h>
#include<stdlib.h>
struct node
{
int data;
struct node *link;
};
struct node *temp1=NULL;
void create(struct node *temp,int n);
void print(struct node *temp);
void add(struct node *temp);
void add(struct node *temp)
{
if(temp->link!=NULL)
{
add(temp->link);
}
else if(temp->link==NULL)
{
str... | ALGO | 0.993602 | 3.405405 |
5e2de845-1c38-4b6e-8bb2-f2ee70357b98 | andongfan/oicode | 4606.cpp | #include<iostream>
#include<iomanip>
#include<cstring>
#include<cmath>
#include<cstdio>
using namespace std;
typedef long long ll;
ll f[25][15][15][3][3][3]={0},dig[25]={0},a,b;
bool Judge(ll f2,ll f1,ll now)
{
return (f2==f1&&f1==now);
}
ll DFS(ll pos,ll f2,ll f1,bool ei,bool fo,bool cyc,bool hi)
{
if(pos==0) retur... | ALGO | 0.999418 | 3.307884 |
d4b64dab-addd-485b-8a50-b8ae1b5e47ef | leopardshadow/LeetCode | m92.cpp |
// 2022.7.21
/*
偷懶
*/
class Solution {
public:
ListNode* reverseBetween(ListNode* head, int left, int right) {
vector<ListNode*> xs;
ListNode *curr = head;
int i;
for (i = 1; i < left; i++)
curr = curr->next;
for (; i <= right; i++) {
xs.push_back(c... | ALGO | 0.999999 | 5.705952 |
b2e1f311-39dc-4fdc-829f-ea8752a7fa0d | roysukanya16/striverA2Z | Binary tree/check for balanced tree.cpp | //Q---Given a binary tree, find if it is height balanced or not.
//A tree is height balanced if difference between heights of left and right subtrees is not more than one for all nodes of tree.
int height(Node* root){
if(root == NULL){
return 0;
}
return 1 + max(height(root->left),hei... | ALGO | 0.999822 | 5.120455 |
b96bf73b-2604-4423-b4cd-009c7aa87141 | lvyahui8/workspace | 数据结构/P-40-三-2.cpp | #include <stdio.h>
#define MAXSIZE 10
typedef struct{
int arr[MAXSIZE]; //Ա
int last; //Աij
} Node;
//ɾҪβΪԱַ
void Delete(Node * N_hand)
{
int i,p;
//Աظֵ
for(i=0;N_hand->arr[i] != N_hand->arr[i+1];i++);
p=i;//p¼ظֵλ
if(p != N_hand->last) //pûָβ˵лظֵҪɾ
{
for(i=p;i<N_hand->last;i++)
N_hand->arr[i]=N... | ALGO | 0.999692 | 3.581073 |
c49f1eb8-1c8d-425a-9ff9-e77b3bbabe2e | ltwsenya/tp2 | main.cpp | #include <iostream>
#include "NOTE.h"
#include <stdexcept>
void addNote(NOTE*& notes, int& count, int position) {
if (position < 0 || position > count) {
throw std::out_of_range("Invalid position for adding note.");
}
NOTE* newNotes = new NOTE[count + 1];
for (int i = 0; i < position; ++i) {
... | TOOL | 0.946242 | 6.626222 |
ac168b32-6eaf-4844-b43b-b151c16f412e | lewis-revill/agc-llvm-project | clang-tools-extra/clang-tidy/tool/ClangTidyMain.cpp | #include "ClangTidyMain.h"
#include "../ClangTidy.h"
#include "../ClangTidyForceLinker.h"
#include "../GlobList.h"
#include "clang/Tooling/CommonOptionsParser.h"
#include "llvm/Support/InitLLVM.h"
#include "llvm/Support/PluginLoader.h"
#include "llvm/Support/Process.h"
#include "llvm/Support/Signals.h"
#include "llvm/S... | TOOL | 0.918069 | 7.813623 |
2c933ff7-2370-46f9-9905-0dfe4d6ea400 | ringmesh/RINGMesh | third_party/geogram/src/tests/test_nn_search/nn_search_ANN.cpp | #include "nn_search_ANN.h"
namespace GEO {
NearestNeighborSearch_ANN::NearestNeighborSearch_ANN(
coord_index_t dim
) :
NearestNeighborSearch(dim),
ann_tree_(nullptr) {
}
void NearestNeighborSearch_ANN::set_points(index_t nb_points, const double* points) {
set_points(nb... | ALGO | 0.99116 | 6.884867 |
cc2d2a24-112c-45f5-8dd8-38275798dc71 | shashank-taliwal/Leetcode-sols | 0022-generate-parentheses/0022-generate-parentheses.cpp | class Solution {
void util(int opening, int closing, set<string>& ans, string current){
if(opening==0 and closing==0){
ans.insert(current);
return;
}
if(opening>0){
if(opening==closing){
... | ALGO | 0.999669 | 6.388281 |
6091409b-179c-4737-91b2-e915b94190e3 | JoanDico04/Risk_Mobile | Risk Mobile/Library/PackageCache/com.unity.ide.visualstudio@8140e851d83e/Editor/COMIntegration/COMIntegration~/COMIntegration.cpp | #include <iostream>
#include <sstream>
#include <string>
#include <filesystem>
#include <windows.h>
#include <shlwapi.h>
#include <fcntl.h>
#include <io.h>
#include "BStrHolder.h"
#include "ComPtr.h"
#include "dte80a.tlh"
constexpr int RETRY_INTERVAL_MS = 150;
constexpr int TIMEOUT_MS = 10000;
// Often a DTE call m... | TOOL | 0.967588 | 6.933211 |
86bec3e6-30a7-4ba8-93f0-6e5dcb45229f | ishandutta2007/codeforces | zhouyuyang/normal/1037/F.cpp |
#include<bits/stdc++.h>
using namespace std;
#define int long long
const int N=1000005,M=1e9+7;
int n,k,a[N],pre[N],nxt[N],st[N],top;
int calc(int L,int R)
{
int a=L/k,b=R/k,x=L%k,y=R%k;
int ans=a+b;
(ans+=a*k%M*b)%=M;
(ans+=x*b)%=M;
(ans+=y*a)%=M;
if (!x||!y)return ans;
(ans+=max(0LL,x+y-k+1))%=M;
return ans... | ALGO | 0.99998 | 3.990353 |
6bac6282-5655-4470-af81-a3e06313ee0d | WindBlowAssCold/ollvm | llvm/lib/Analysis/DDG.cpp | using namespace llvm;
static cl::opt<bool> SimplifyDDG(
"ddg-simplify", cl::init(true), cl::Hidden,
cl::desc(
"Simplify DDG by merging nodes that have less interesting edges."));
static cl::opt<bool> CreatePiBlocks("ddg-pi-blocks", cl::init(true), cl::Hidden,
cl::de... | ALGO | 0.917446 | 7.857829 |
8b1e89df-23fd-4b27-9841-58c27220c94a | babu-thomas/ds-algos | egyptian_walk.cpp | // Question in below links
// https://icpcarchive.ecs.baylor.edu/index.php?option=onlinejudge&page=show_problem&problem=1759
// Direct link - https://icpcarchive.ecs.baylor.edu/external/37/3758.pdf
// Screenshots - https://i.imgur.com/CxGn2aT.png https://i.imgur.com/vF7FrxV.png
#include <iostream>
using namespace std... | ALGO | 0.996081 | 5.199304 |
0c308bc8-882f-47f3-92dc-a3bef1a9c3e7 | tylerastraub/LD51 | src/Entity/Systems/CollisionSystem.cpp | #include "CollisionSystem.h"
#include "EntityRegistry.h"
#include "vec2.h"
#include "CollisionComponent.h"
#include "PhysicsComponent.h"
#include "TransformComponent.h"
#include "PickupComponent.h"
#include "StateComponent.h"
#include "CheckpointComponent.h"
#include "BootsComponent.h"
#include "HealthComponent.h"
#inc... | ALGO | 0.957414 | 6.08691 |
cf7ae643-694e-4c12-a326-92d510097cdf | pingjuiliao/llvm_openssl | llvm/libcxx/test/std/containers/sequences/forwardlist/forwardlist.modifiers/emplace_after.pass.cpp | // UNSUPPORTED: c++03
// <forward_list>
// template <class... Args>
// iterator emplace_after(const_iterator p, Args&&... args);
#include <forward_list>
#include <cassert>
#include "test_macros.h"
#include "../../../Emplaceable.h"
#include "min_allocator.h"
int main(int, char**)
{
{
typedef Emplace... | TEST | 0.891533 | 5.28892 |
d591b553-0477-41a9-b853-d4f15805f9b8 | Martchus/arch-repo-manager | libpkg/data/config.cpp | #include "./config.h"
#include "./storageprivate.h"
#include <reflective_rapidjson/json/reflector.h>
#include <c++utilities/conversion/stringbuilder.h>
using namespace std;
using namespace CppUtilities;
namespace LibPkg {
Status::Status(const Config &config)
: architectures(config.architectures)
, pacmanDa... | CONFIG | 0.968051 | 7.645947 |
5d1fe00d-bb9e-4f38-a68d-11d75a6ba26e | zishraq/cse246_class_codes_c_cpp | exponentiation.cpp | #include <iostream>
using namespace std;
// O(n)
int exponentiation(int value, int power) {
int answer = 1;
for (int i = 0; i < power; i++) {
answer = answer * value;
}
return answer;
}
// O (log2 n)
int fastExponentiation(int value, int power) {
if (power == 0) {
return 1;
}... | ALGO | 0.999925 | 5.90996 |
54aa453a-dca8-4c3e-ac7b-ad46cb407886 | PRO0FESSOR/DSA | array/all1.cpp |
#include<iostream>
#include<vector>
int main(){
int size = 5;
std::vector<int>arr(size,1);
for(auto i : arr)
{
std::cout<<i<<" ";
}std::cout<<std::endl;
return 0;
}
| TOOL | 0.981523 | 3.222697 |
4384add3-1cf4-4b5a-a95f-be966309d16f | PrathameshPawar119/Cpp-Dsa-Practise-Codes | gfg/array/medium/bs_sqrt.cpp | #include <iostream>
using namespace std;
// Find Square root of number using binary search
long long int BSSqrt(int target)
{
int s = 0;
int e = target;
long long int ans = -1;
long long int sqr = 0;
while(s < e)
{
long long int mid = s+(e-s)/2;
// if(mid < INT_MAX/mid || mid >... | ALGO | 0.999936 | 4.169878 |
e95eee51-100f-445b-8ee3-49b2ae13d75c | Th3will/StepperPiano | MaryHadALittleLamb/Motor.cpp | //Notes.cpp
#include <Arduino.h>
class Motor{
private:
//Device info
// using a 200-step motor (most common)
const int motorSteps = 200;
//driver
int stepPin;
int dirPin;
bool inUse = false;
bool dir;
int del;
bool isPressed;
... | TOOL | 0.872189 | 6.802059 |
17b10d73-043d-42ad-b5e6-36b44d508375 | Taranum01/LeetCode | 124-binary-tree-maximum-path-sum/124-binary-tree-maximum-path-sum.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.999942 | 6.262692 |
b546fe01-557a-4957-9614-672dd68c8468 | Harshdev625/LEETCODE | 1561. Maximum Number of Coins You Can Get/Maximum_Number_of_Coins_You_Can_Get.cpp | class Solution {
public:
int maxCoins(vector<int>& piles) {
sort(piles.begin(),piles.end());
int count=piles.size()/3,i=piles.size()-2;
int ans=0;
while(count){
ans+=piles[i];
i-=2;
count--;
}
return ans;
}
};
| ALGO | 0.999964 | 5.903528 |
f33d4119-ecef-42d7-ae24-47278cc2c66d | LLuviaDevices/device_xiaomi_whyred | gps/utils/LocHeap.cpp | #include <LocHeap.h>
class LocHeapNode {
friend class LocHeap;
// size of of the subtree, excluding self, 1 if no subtree
int mSize;
LocHeapNode* mLeft;
LocHeapNode* mRight;
LocRankable* mData;
public:
inline LocHeapNode(LocRankable& data) :
mSize(1), mLeft(NULL), mRight(NULL), mDa... | ALGO | 0.997679 | 6.439088 |
0e690a6c-ba84-4524-8aeb-d8a2e82f0bbb | peercoin/peercoin | src/policy/fees.cpp | #include <policy/fees.h>
#include <clientversion.h>
#include <consensus/amount.h>
#include <kernel/mempool_entry.h>
#include <logging.h>
#include <policy/feerate.h>
#include <primitives/transaction.h>
#include <random.h>
#include <serialize.h>
#include <streams.h>
#include <sync.h>
#include <tinyformat.h>
#include <ui... | ALGO | 0.984269 | 7.194947 |
6606a2e9-04fb-457d-be02-22fbbd4de5fa | ishandutta2007/codeforces | halyavin/normal/990/F.cpp | #include <algorithm>
#include <string>
#include <iostream>
#include <vector>
#include <utility>
struct Edge {
int to;
int id;
int sign;
Edge(int to, int id, int sign) : to(to), id(id), sign(sign) {}
};
struct Solution {
int n;
std::vector<int> ss;
std::vector<bool> visited;
std::vector... | ALGO | 0.999958 | 4.222628 |
544195fb-da6e-446a-a78a-0d5724fe151f | KrasinAnton/Modern_prog_lang | Lab's/Lb_9/Lb9_2_2.cpp | // Подключение заголовочного файла iostream для ввода/вывода
#include <iostream>
using namespace std;
// Шаблонная функция Sort для сортировки массива типа T
template <class T>
void Sort(T array[], size_t size)
{
int i, j;
T tmp;
// Внешний цикл проходит по массиву от начала до предпоследнего элемента
... | ALGO | 0.998793 | 4.858047 |
ffdc8196-0ea8-461c-9195-fceef9a42d8a | adityapranavbhuvanapalli/leetcodes | 990-verifying-an-alien-dictionary/verifying-an-alien-dictionary.cpp | class Solution {
public:
bool isAlienSorted(vector<string>& words, string order) {
unordered_map<char, char> f;
char y = 'a';
for(const auto& x: order)
f[x] = y++;
for(auto& word: words)
for(auto& x: word)
x = f[x];
vector<string> so... | ALGO | 0.999967 | 6.165766 |
fed0535e-8371-4f66-b5c3-a1b36472c238 | zhangandrew37/Competitive-Programming-Cpp | 0322-coin-change/0322-coin-change.cpp | class Solution {
public:
int coinChange(vector<int>& coins, int amount) {
vector<int> dp(amount+1, INT_MAX);
dp[0] = 0;
sort(coins.begin(), coins.end());
for (int i = 1; i <= amount; i++){
for (int c : coins){
if (c > i || dp[i-c] == INT_MAX) cont... | ALGO | 0.9999 | 5.984307 |
58dd946a-8885-40f5-a459-2e3209d18e55 | avadheshgithub/LeetCode | 05. Recursion/39. Leetcode 37 - Sudoku Solver/prog.cpp | // Sudoku Solver
// Leetcode 37
// time complexity: O(9^(n*n)) where n is the size of the board (9x9)
// space complexity: O(1) since we are not using any extra space that grows with input size
class Solution {
public:
bool isSafe(vector<vector<char>>& board,int row,int col,char dig){
// horizontal
... | ALGO | 0.99982 | 7.127524 |
3f057810-1b9f-4955-8afb-c4fa4067890e | cyruscyliu/videzzo-llvm-project | llvm/lib/Transforms/Utils/BreakCriticalEdges.cpp | #include "llvm/Transforms/Utils/BreakCriticalEdges.h"
#include "llvm/ADT/SetVector.h"
#include "llvm/ADT/SmallVector.h"
#include "llvm/ADT/Statistic.h"
#include "llvm/Analysis/BlockFrequencyInfo.h"
#include "llvm/Analysis/BranchProbabilityInfo.h"
#include "llvm/Analysis/CFG.h"
#include "llvm/Analysis/LoopInfo.h"
#inclu... | TOOL | 0.99936 | 7.712074 |
b65636ce-d85f-4ccd-8864-71e10a60f855 | Falleiz/Centrale-internship | env/Lib/site-packages/sklearn/utils/src/MurmurHash3.cpp | // Note - The x86 and x64 versions do _not_ produce the same results, as the
// algorithms are optimized for their respective platforms. You can still
// compile and run any of them on any platform, but your performance with the
// non-native version will be less than optimal.
#include "MurmurHash3.h"
//-------------... | ALGO | 0.996692 | 7.198757 |
e37b40fb-41dc-4821-83f4-b2f5d0b317d1 | JuJangGwon/algorithm | 소마대비_다시풀기/dp/back_11052.cpp | #include <iostream>
#include <algorithm>
using namespace std;
int map[1001];
int dp[1001];
int main()
{
int n,m;
cin >> n;
for (int i =1; i<=n; i++)
{
cin >> map[n];
}
for (int i =1; i <=n; i++)
{
for (int j = 1; j <=i;j++)
{
dp[i] = max(dp[i], dp[i-j] ... | ALGO | 0.999931 | 3.738016 |
d7f64054-cf4a-4236-a011-e1e076366b8b | balajiofficial/CompetitiveProgramming | Codeforces/932A.cpp | #include<bits/stdc++.h>
using namespace std;
#define ll long long
int main() {
string a;
cin >> a;
char d = a[a.size() - 1];
cout << a << d;
reverse(a.begin(), a.end());
cout << a << "\n";
}
| ALGO | 0.999517 | 3.781746 |
dda52963-494a-41a9-8a63-e1bbcb931caf | safiullah-foragy/Competetive-programming | B.YetnotherrokenKeoard.cpp | #include <bits/stdc++.h>
using namespace std;
int main() {
int t;
cin >> t;
while (t--) {
string s;
cin >> s;
int n = s.size();
vector<int> upper, lower;
for (int i = 0; i < n; ++i) {
if (s[i] == 'b') {
s[i] = ' ';
... | ALGO | 0.99976 | 4.749361 |
7c3273b2-63f9-414b-8d78-16b521c2e6d5 | ishandutta2007/codeforces | aaaaajack/normal/1178/F2.cpp | #include<bits/stdc++.h>
#define N 1001000
#define M 510
#define Q 998244353
using namespace std;
int f[N],a[N];
long long dp[M][M];
vector<int> v[510];
int find(int x){
if(f[x]==x) return x;
return f[x]=find(f[x]);
}
void dp_reset(int n){
for(int i=0;i<=n;i++){
for(int j=i;j<=n;j++){
dp[i][j]=-1;
}
}
}
long ... | ALGO | 0.999997 | 4.678719 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.