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 |
|---|---|---|---|---|---|---|
6f8768d6-116f-448b-9a84-4ed8f807899d | jeycobs/MAI-OOP | lw_4/main.cpp | #include <iostream>
#include <memory>
#include "include/point2d.hpp"
#include "include/figures.hpp"
#include "include/vector.hpp"
int main(int argc, char** argv) {
Rectangle<double> rec;
rec.a = Point2d(0.0, 0.0);
rec.b = Point2d(0.0, 3.0);
rec.c = Point2d(1.0, 3.0);
rec.d = Point2d(1.0, 0.0);
... | TOOL | 0.865777 | 4.02835 |
31e8f189-052b-44c0-a853-3b6364a0bf89 | otherjlo/CS106B-Stanford-Solutions | Assignment3/0b-KarelGoesHome/src/KarelGoesHome.cpp | /*
* File: KarelGoesHome.cpp
* -----------------------
* Starter file for the KarelGoesHome problem.
*/
#include <iostream>
#include <iomanip>
#include "error.h"
using namespace std;
/* Function prototypes */
int countPaths(int street, int avenue);
/* Main program */
int main() {
cout<<countPaths(2, 3)<<end... | ALGO | 0.995587 | 4.713905 |
6d11ad1e-0985-4f16-b818-1246f7487587 | kareemshaaban221/ICPC-problem-solved-in-Cpp | lvl-00/Basics/lvl-00-task-08.cpp | #include <iostream>
#include <iomanip>
#include <string>
using namespace std;
int main()
{
double sal;
cin >> sal;
double nSal = 0, mEarned = 0; int inPrec = 0;
if(sal >= 0.00 && sal <= 2000.00)
{
if(sal < 400.01)
{
inPrec = 15;
mEarned = sal*15/100;
... | ALGO | 0.994957 | 3.729746 |
93608af1-c299-4563-ac47-a098b9f7e6a5 | 1571859588/Visual_RM | base_tasks/work1/luogu/6/P5739.cpp | #include<bits/stdc++.h>
using namespace std;
long long jie(int n){
if(n==1) return 1;
return n*jie(n-1);
}
int main(){
int n;
cin>>n;
long long m=jie(n);
cout<<m<<endl;
return 0;
}
| ALGO | 0.999984 | 4.699146 |
b2054c1d-3606-4c2d-9e3d-de68d4392d22 | Vanilla-Player/ICPC | Templates/Queries/Segment_Tree_New.cpp |
int t[4*(MAX_N+1)]; // 1 mas para tener en posicion 0 sgt[0] = 0
int nums[MAX_N + 1]; // los nums lo almaceno para calcular el valor del update
void build_tree(int a[], int v, int tl, int tr){
if(tl == tr){
t[v] = a[tl];
}else{
int tm = (tl + tr)/2;
build_tree(a, 2*v, tl, tm);
... | ALGO | 0.99997 | 3.921651 |
be210fd2-98d8-4355-9eca-9d9ea26e9dd7 | NIWAFisheriesModelling/SPM | src/Selectivities/Children/CDoubleExponentialSelectivity.cpp | // Local headers
#include "CDoubleExponentialSelectivity.h"
#include "../../Helpers/CComparer.h"
#include "../../Helpers/CError.h"
//**********************************************************************
// CDoubleExponentialSelectivity::CDoubleExponentialSelectivity()
// Default constructor
//************************... | ALGO | 0.953901 | 6.463291 |
1c2f05be-e816-4f3f-b4bd-1ebf83bc7d5f | ShelpAm/competitive_programming | poj/2559/main.cpp | #include <algorithm>
#include <array>
#include <cmath>
#include <cstddef>
#include <iostream>
#include <ranges>
#include <stack>
#include <string_view>
#include <vector>
using ::std::size_t;
// constexpr bool debug{false};
template<typename T> T read()
{
T tmp;
std::cin >> tmp;
return tmp;
}
template<typename ... | ALGO | 0.999904 | 5.768293 |
8590e670-37ef-4566-bc74-d2b9b2ae0b2e | mohamedibrahim1990/CH9_C-CrashCourse | 9-Lambda Expression/18-Listing9-18/18-Listing9-18/18-Listing9-18.cpp | // 18-Listing9-18.cpp : This file contains the 'main' function. Program execution begins and ends there.
//
#include <iostream>
#include <cstdio>
#include <cstdint>
int main()
{
char to_count{ 's' };
auto s_counter = [to_count](const char* str) {
size_t index{}, result{};
while (str[index]) {
... | ALGO | 0.908839 | 6.644933 |
594836e3-9bb5-487e-abf9-31e09157e19e | paul2705/OI | OJ/usaco/contest/18USOCB2.cpp | #include<iostream>
#include<cstdio>
using namespace std;
int n,m,k;
int a[150],loc[150],lis[150];
int main(){
freopen("milkorder.in","r",stdin);
freopen("milkorder.out","w",stdout);
scanf("%d%d%d",&n,&m,&k);
for (int i=1;i<=m;i++) scanf("%d",&a[i]);
for (int i=1,x;i<=k;i++){
scanf("%d",&x); scanf("%d",&loc[x]);
... | ALGO | 0.999991 | 3.111667 |
b9162b01-ae46-47d3-9b63-eb944ef6128e | chanhee000/C-Programming | 행렬/20230516/20230516/main.cpp | #define _CRT_SECURE_NO_WARNINGS
#include<stdio.h>
#define ROWS 3
#define COLS 3
int main(void)
{
int A[ROWS][COLS] = { {1,2,3},{4,5,6},{7,8,9} };
int B[ROWS][COLS] = { {1,2,3},{4 ,5 ,6},{7 ,8 ,9}};
int C[ROWS][COLS];
int a, b;
for (a = 0; a < ROWS; a++)
for (b = 0; b < COLS; b++)
C[a][b] = A[a][b] + B[a][b... | ALGO | 0.999043 | 3.395282 |
db95669d-ae4d-43a4-ad6b-51f582fae34a | nirmit06/DSA_Dynamic_Programming | coin_change_1_max_ways.cpp | #include<bits/stdc++.h>
#define ll long long
#define mod 1000000007
using namespace std;
bool isPrime(int n)
{
if (n <= 1)
return false;
for (int i = 2; i < n; i++)
if (n % i == 0)
return false;
return true;
}
int main()
{
int n;
cin>>n;
int sum;
cin>>sum;
in... | ALGO | 0.999908 | 3.525532 |
d7aff72b-e6b2-43f2-9c23-c5c942ca9638 | Mrwatermolen/XFDTD | examples/3d_pec_sphere_bistatic_rcs.cpp | #include <chrono>
#include <filesystem>
#include <memory>
#include <utility>
#include "boundary/perfect_match_layer.h"
#include "electromagnetic_field/electromagnetic_field.h"
#include "helper.h"
#include "material/material.h"
#include "monitor/field_monitor.h"
#include "monitor/movie_monitor.h"
#include "nffft/nffft_... | ALGO | 0.918948 | 5.960535 |
8f7de102-8a23-4cc6-b2db-a16ea96cdaea | Strekalowa/RBPOlabb2 | task9_main.cpp | #include "strekalova.h"
int main()
{
cout << "x: ";
cin >> strekalova::x;
strekalova::f();
cout << "f(x): " << setprecision(5) << strekalova::result << endl;
system("pause");
return 0;
}
| TOOL | 0.948818 | 3.954909 |
f45cd8de-0e2e-46d7-ad98-3d7dce4268c7 | lewsn2008/leetcode | 3Sum/3Sum.cpp | // 3Sum.cpp : ̨Ӧóڵ㡣
//
#include "stdafx.h"
#include <vector>
#include <algorithm>
using namespace std;
class Solution {
typedef vector<int>::iterator vit;
public:
vector<vector<int> > threeSum(vector<int> &num) {
vector<vector<int> > res;
if (num.size() < 3) return res;
/* sort the vector num */
sort(num.be... | ALGO | 0.999923 | 4.986727 |
dd5c5383-bc2d-4d9a-830c-da048e49ec4f | starpiens/PS | BOJ/15922.cpp | #include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include <math.h>
#include <iostream>
#include <algorithm>
#include <string>
#include <stack>
#include <queue>
#include <vector>
#include <set>
#include <map>
#include <unordered_set>
#include <unordered_map>
#include <list>
#define INF 2100000000
typedef lon... | ALGO | 0.998593 | 3.494396 |
3f059c98-d448-4645-b3eb-16198c468fbe | josephvitt/cpp_dataStructure | 05-Binary-Search-Tree/Course Code (C++)/07-Binary-Search-Tree-Remove-Min-and-Max/main.cpp | #include <iostream>
#include <queue>
#include <cassert>
#include <ctime>
using namespace std;
// 二分搜索树
template <typename Key, typename Value>
class BST{
private:
// 树中的节点为私有的结构体, 外界不需要了解二分搜索树节点的具体实现
struct Node{
Key key;
Value value;
Node *left;
Node *right;
Node(Key... | ALGO | 0.999663 | 4.619723 |
395113a2-dd47-4b64-a6f4-22b0b39af8c9 | cmottao/CompetitiveProgrammingSolutions | codeforces/A/1814.cpp | // Made by Cristian Motta (cmottao)
#include <bits/stdc++.h>
using namespace std;
#define int long long int
#define double long double
const int MAX = 1e6 + 10;
const int MIN = -MAX;
const int INF = 1e9;
const int MOD = 1e9 + 7;
void solve() {
int n, k; cin >> n >> k;
if(n % 2 == 0 || n % k == 0 || (k % 2 =... | ALGO | 0.999876 | 4.981419 |
55aa51f0-a1ca-4974-bd78-f4d2e1253c09 | CallMeIStar/smarthomelogin | 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.9988 | 6.76073 |
558a0fd4-37c3-45c6-9775-308cc9534aed | Snehakri/DSA-with-leetcode | 0994-rotting-oranges/0994-rotting-oranges.cpp | class Solution {
public:
int orangesRotting(vector<vector<int>>& grid) {
int n=grid.size();
int m=grid[0].size();
int days=0;
vector<vector<int>> dp(n,vector<int>(m,0));
queue<pair<pair<int,int>,int>> q;
int countone=0;
for(int i=0;i<n;i++){
for(in... | ALGO | 0.99998 | 6.094635 |
7226ccd5-241f-4597-927c-b519f3ec37d4 | MarjaanZare/BASILISK | src/architecture/utilities/avsEigenSupport.cpp | #include <iostream>
#include <math.h>
#include "avsEigenSupport.h"
#include "rigidBodyKinematics.h"
#include "architecture/utilities/macroDefinitions.h"
/*
Contains various support algorithms related to using the Eigen Library
*/
/*! This function provides a general conversion between an Eigen matrix and
an outpu... | ALGO | 0.997107 | 5.790165 |
674254be-9f83-4445-84a8-0419b21645f3 | creativeabhi13/c-plus-plus | patternprob3.cpp | /* Print Half Pyramid Pattern using Stars
*
**
***
****
*****
******
int n;
cin>>n;
for(int i=1; i<=n; i++){
for(int j=1; j<=i ; j++)
{
cout<<"*";
}
cout<<endl;
}
Print inverted Half Pyramid Pattern using Stars
******
*****
****
***
**
*
int n;
cin>>n;
for(int i=n; i>=1; i--){
for(int j... | ALGO | 0.999684 | 4.127963 |
16e5febc-e89a-4f4c-9d6f-85777af9a8d6 | yubindy/mygit | leection/113.cpp | #include "leection.h"
#include <vector>
class Solution {
public:
vector<vector<int>> rul;
vector<vector<int>> pathSum(TreeNode* root, int target) {
if(!root){
return rul;
}
vector<int> vals;
dfs(root,target,vals,0);
return rul;
}
void dfs(TreeNode* roo... | ALGO | 0.999995 | 5.866356 |
4110aa99-aab7-461a-9847-e4f569e9894f | Kaustubh22327/CFsols | C_Stripes.cpp | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
int main() {
int t;
cin>>t;
while(t--){
int n;
int reds,blues=0;
vector<string>vt(8);
for(long i = 0; i< 8; p++){
cin>>vt[p];
}
for(auto str:vt){
for(int i=0;i<8;i++){... | ALGO | 0.999524 | 4.148981 |
0ae7e4e3-7b33-43a2-9d14-a130d2a33e97 | DevilianOS/frameworks_av | media/libstagefright/codecs/amrnb/common/src/int_lpc.cpp | /*
Pathname: ./audio/gsm-amr/c/src/int_lpc.c
Functions:
------------------------------------------------------------------------------
REVISION HISTORY
Description: Updated template used to PV coding template.
Changed to accept the pOverflow flag for EPOC compatibility.
Description: Per review comments, replac... | ALGO | 0.994999 | 6.3164 |
5af03996-c3dd-4a06-8417-482de5f2a92d | giantbalance/RPR | pin/pin-3.11-97998-g7ecce2dac-gcc-linux/source/tools/Smc/sse.cpp | #include <iostream>
#include <iomanip>
using std::cout;
using std::endl;
#define N 1024
int main(int argc, char** argv);
#if defined( __GNUC__)
#include <stdint.h>
typedef uint8_t UINT8; //LINUX HOSTS
typedef uint16_t UINT16;
typedef uint32_t UINT32;
typedef uint64_t UINT64;
typedef int8_t INT8;
typedef int16_t I... | TOOL | 0.892503 | 3.539395 |
d87137e9-8ee6-4df9-af42-74e6a155ea74 | PorUna-byte/DSAAAIC | Skip_List/Skip_List/Skip_Lists.cpp | #include "Skip_Lists.hpp"
#define InitLevel 4
#define error_val -1
#define p 0.5
void oom(){
printf("out of memory\n");
exit(-1);
}
void *Malloc(size_t size)//A simple warpper to simplify the code
{
void *ptr=malloc(size);
if(ptr==NULL)
oom();
return ptr;
}
void *Realloc(void* old_ptr,size_t... | ALGO | 0.999573 | 3.690433 |
7388d435-5522-41ff-88da-4e06f44e1c1c | PranavKumar27/CPP_WORKSPACE | P10_2_Even_Odd_Number_Thread_Interview.cpp |
#include<iostream>
#include<thread>
#include<mutex>
#include<condition_variable>
using namespace std;
#define MAX 100
mutex m;
condition_variable cv;
int counter = 0;
void Print_Even()
{
while(true)
{
unique_lock<mutex> lock(m);
cv.wait(lock,[](){ return counter%2 == 0;});
... | ALGO | 0.961869 | 4.816943 |
b21bf27b-dcca-4927-8ef6-8ca6d2841233 | bxck75/Python_Helpers | dlib_local/tools/htmlify/to_xml.cpp |
#include "to_xml.h"
#include "dlib/dir_nav.h"
#include <vector>
#include <sstream>
#include <iostream>
#include <fstream>
#include <stack>
#include "dlib/cpp_tokenizer.h"
#include "dlib/string.h"
using namespace dlib;
using namespace std;
// ---------------------------------------------------------------------------... | TOOL | 0.877566 | 3.550773 |
659a2b4d-e0df-4f2a-9bcb-bc84199f6f15 | lukereichold/Coding-Challenges | hackerrank/Strings/make-it-anagram.cpp | // https://www.hackerrank.com/challenges/make-it-anagram
// Given two strings (they can be of same or different length), find the minimum number of
// character deletions required to make two strings anagrams.
#include <iostream>
#include <algorithm>
#include <cmath>
using namespace std;
int main() {
string str1, st... | ALGO | 0.999974 | 4.812423 |
78e67fd2-237c-4d89-b857-512e65465393 | sarvex/leetcode-cyber | solution/1000-1099/1030.Matrix Cells in Distance Order/Solution.cpp | class Solution {
public:
vector<vector<int>> allCellsDistOrder(int rows, int cols, int rCenter, int cCenter) {
queue<pair<int, int>> q;
q.emplace(rCenter, cCenter);
vector<vector<int>> ans;
bool vis[rows][cols];
memset(vis, false, sizeof(vis));
vis[rCenter][cCenter] =... | ALGO | 0.999954 | 4.71996 |
7f902d6a-eee9-46fb-8c67-9680b5a12a44 | transbot/ThinkingInCPPChinese | ThinkingInCpp中文版代码/C11/CarBuilder.cpp | // ʾ㲥Ĺ
//{L} ZThread
#include <iostream>
#include <string>
#include "zthread/Thread.h"
#include "zthread/Mutex.h"
#include "zthread/Guard.h"
#include "zthread/Condition.h"
#include "zthread/ThreadedExecutor.h"
#include "TQueue.h"
using namespace ZThread;
using namespace std;
class Car {
int id;
bool engine, dr... | TOOL | 0.869143 | 5.303382 |
58762286-5511-4703-bdc4-cb4ff9230feb | ishandutta2007/codeforces | 300iq/normal/794/D.cpp | #include <iostream>
#include <vector>
#include <algorithm>
#include <string>
#include <set>
#include <map>
#include <list>
#include <time.h>
#include <math.h>
using namespace std;
const int N = 3e5 + 7;
vector <int> g[N];
vector <int> rg[N];
int main()
{
int n, m;
scanf("%d%d", &n, &m);
for (int i = 0; ... | ALGO | 0.999996 | 4.179879 |
8743d49b-4223-4d43-956f-43fcd53f8e34 | NTU-Robotic-Lab/AtomManipulator | AtomManipulator/OpenGL_Model/newmat10/jacobi.cpp | //$$jacobi.cpp jacobi eigenvalue analysis
//#define WANT_STREAM
#define WANT_MATH
#include "include.h"
#include "newmatap.h"
#include "precisio.h"
#include "newmatrm.h"
#ifdef use_namespace
namespace NEWMAT {
#endif
#ifdef DO_REPORT
#define REPORT { static ExeCounter ExeCount(__LINE__,18)... | ALGO | 0.999976 | 5.60464 |
a24825d6-8e31-4c6d-9027-5510347efcaa | milliax/cpp | special/P-1-9_pending/main.cpp | #include <bits/stdc++.h>
#define int long long
using namespace std;
int chase[20];
int q(int n) {
int ans = 0;
for (int i = 0; i < n; ++i) chase[i] = i;
bool valid = true;
do {
for (int i = 0; i < n; ++i) {
for (int j = i + 1; j < n; ++j) {
if (abs(chase[i] - chase... | ALGO | 0.999254 | 3.702562 |
6853b423-aadd-4641-ba42-fc054afd5486 | vfolunin/archives-solutions | URI Online Judge/1984.cpp | #include <iostream>
#include <algorithm>
#include <vector>
#include <set>
#include <map>
#include <string>
using namespace std;
int main() {
freopen("input.txt", "r", stdin);
freopen("output.txt", "w", stdout);
string s;
cin >> s;
reverse(s.begin(), s.end());
cout << s << "\n";
} | ALGO | 0.999932 | 5.12224 |
aaf71307-6256-4c3e-8d1e-c9f57e6a32dc | Seo-Faper/Data_Structure_with_C | ProblemSolve/1405.cpp | #include <iostream>
using namespace std;
int N;
double WORD[4];
int dx[4] = {1, -1, 0, 0}; // 상하좌우
int dy[4] = {0, 0, 1, -1};
int vis[101][101];
double dfs(int x, int y, int d)
{
if (vis[x][y]) // 이미 지나간 곳아면 실패다.
return 0;
if (d == 0)
{
return 1;
}
vis[x][y] = true;
double ans =... | ALGO | 0.999321 | 3.354627 |
973eddd8-7280-4657-93d0-5dd7efc996cb | NifpdDD/parallelPSU | lab5-3/task3.cpp | #include <iostream>
#include <fstream>
#include <thread>
#include <mutex>
#include <condition_variable>
#include <climits>
#include <algorithm>
#include <random>
#include <vector>
#include <chrono>
using namespace std;
class Event {
public:
template<typename Duration>
bool wait_for(const Duration& timeout) {
... | ALGO | 0.999421 | 5.642914 |
abd74c9f-bcaf-4d41-b42b-79c04b63002b | ishandutta2007/codeforces | popovicirobert/normal/1117/D.cpp | #include <bits/stdc++.h>
#define lsb(x) (x & (-x))
#define ll long long
#define ull unsigned long long
#define ld long double
// 217
// 44
using namespace std;
const int MOD = (int) 1e9 + 7;
inline void mod(int &x) {
if(x >= MOD)
x -= MOD;
}
class Matrix {
private:
inline void mod(int &x) {
... | ALGO | 0.999993 | 4.252737 |
4470b5ae-4491-4e75-bde5-5100b2272972 | aleena340/data-structures-lab | lab 2/q4.cpp | #include <iostream>
using namespace std;
class StudentRegistry
{
int *students;
int totalStudents;
public:
StudentRegistry()
{
students = nullptr;
totalStudents = 0;
}
StudentRegistry(int *students, int size)
{
totalStudents = size;
this->students = new int... | TOOL | 0.989903 | 4.490313 |
22795495-3e10-4042-b5e9-20703c9b9ddd | raincross7/code-similarity | codes/train_code/problem045/problem045_299.cpp | #include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
using namespace std;
using namespace __gnu_pbds;
#define ordered_set tree<int, null_type,less<int>, rb_tree_tag,tree_order_statistics_node_update>
#define ll long long
#define FASTIO ios_base::sync_with_stdio(0);cin.t... | ALGO | 0.999134 | 4.720065 |
a580d133-f90d-4dd6-aa66-3bace9f0f942 | rahulbits/DSA-PRACTICE | BITMANIPULATION_UNIQUEELEMENT2.cpp | #include<bits/stdc++.h>
using namespace std;
int main(){
int n;cin>>n;
int arr[n];
int xr = 0;
for(int i=0;i<n;i++){
cin>>arr[i];
xr = xr^arr[i];
}
int pos = 0;
int temp = xr;
while( temp&1 == 0 ){
pos++;
temp = temp >> 1 ;
}
int mask = (1<< pos) ;
int nxr = 0;
for(int i=0;i<n;i++){
if(arr[i] & ma... | ALGO | 0.999998 | 3.444909 |
dd464df0-0ac6-4d39-bef0-4dc60a5d30f9 | ishandutta2007/codeforces | shayan.p/normal/771/D.cpp | // new day,new strength,new thougts
#include<bits/stdc++.h>
#define MP make_pair
#define PB push_back
#define PF push_front
#define POB pop_back
#define POF pop_front
#define F first
#define S second
#define sz(c) int((c).size())
#define REP(i,n) for(int i=0;i<int(n);i++)
#define REPD(i,n) for(int i=int(n)-1;i>=0;i--)... | ALGO | 0.999938 | 3.421609 |
f130b52e-7a88-4fd8-a477-f990ca26ffe5 | a2k34lttct/vnoi_solution | secondthread_tree_richtree.cpp | /*Code by Hoang Thai*/
#include <bits/stdc++.h>
#define pb push_back
#define ff first
#define ss second
#define BIT(x, i) (((x) >> (i)) & 1)
#define MASK(i) (1LL << (i))
#define bit_count(x) __builtin_popcount(x)
#define bit_countll(x) __builtin_popcountll(x)
#define fto(i, a, b) for (int i = (int) a; i <= (int) b; +... | ALGO | 0.999637 | 4.157491 |
58f612dc-9fa5-453c-a237-7a9cf36fa972 | Hackerifyouwant/contest | google_code/part1/2.cpp | #include<iostream>
#define ll long long
#define endl '\n'
using namespace std;
ll t,n[1005];
string s[1005];
int main(){
cin>>t;
for(int i=0;i<t;i++){
cin>>n[i];
cin>>s[i];
}
for(int i=0;i<t;i++){
cout<<"Case #"<<i+1<<": ";
for(int y=0;y<s[i].size();y++){
... | ALGO | 0.999633 | 3.308554 |
2bd9795f-e07e-406d-82f2-30e2a4dc0631 | Darling1116/Darling_1116 | Tree12_7.cpp/Tree12_7.cpp/Tree12_7.cpp |
#define _CRT_SECURE_NO_WARNINGS
#include <stdio.h>
#include <stdlib.h>
#include <assert.h>
#include <stack>
#include <queue>
using namespace std;
typedef struct TreeNode{
int val;
TreeNode *left;
TreeNode *right;
TreeNode(){
val = NULL;
left = NULL;
right = NULL;
}
TreeNode(int x){
val = x;
left = N... | ALGO | 0.999037 | 4.611153 |
23d6ae57-a10a-4a09-b951-8473256e0851 | AntoBrandi/Self-Driving-and-ROS-2-Learn-by-Doing-Plan-Navigation | Section9_Build_the_Robot/bumperbot_ws/src/bumperbot_motion/src/pure_pursuit.cpp | #include <algorithm>
#include "nav2_util/node_utils.hpp"
#include "tf2/utils.h"
#include "tf2_geometry_msgs/tf2_geometry_msgs.hpp"
#include "bumperbot_motion/pure_pursuit.hpp"
namespace bumperbot_motion
{
void PurePursuit::configure(
const rclcpp_lifecycle::LifecycleNode::WeakPtr & parent,
std::string name, std::... | TOOL | 0.961549 | 6.059279 |
e14540b3-342f-405b-893c-b3fcb23b0ed5 | UserUnauthorized/OI-Codes | HZ/31.2.cpp | //HZ - 31.2
//Luogu - P1896
#include<bits/stdc++.h>
using namespace std;
constexpr int maxn = 10, maxs = 1 << 9;
unsigned long long n, k, cnt(0), ans(0);
unsigned int dp[maxn][maxs][maxn * maxn];
unsigned int bit[maxs], sum[maxs];
inline void init();
inline bool compatible(int x, int y);
void dfs(int x, int num, ... | ALGO | 0.999967 | 4.014563 |
8bc323ba-9b50-41b3-8c3c-3d017bc60c83 | hinchantedgali/DsaSheetStriver | sortZerosOnesTwos.cpp | #include <bits/stdc++.h>
using namespace std;
void sortArray(int arr[], int n)
{
int low = 0, mid = 0, high = n - 1;
while (mid <= high)
{
if (arr[mid] == 0)
{
swap(arr[mid], arr[low]);
low++;
mid++;
}
else if (arr[mid] == 1)
{
... | ALGO | 0.999973 | 5.134684 |
3ecc9c6c-f302-4a16-a8c9-f0cd081319a1 | alexey-malov/monty-hall | monty-hall/main.cpp | #include <iostream>
#include <random>
#include <chrono>
#include <string>
using namespace std;
int main(int argc, char* argv[])
{
mt19937 rndGen(static_cast<unsigned>(chrono::steady_clock::now().time_since_epoch().count()));
uniform_int_distribution<> distr(0, 2);
const int NUM_GAMES = 1'000'000;
int numWins = 0;... | ALGO | 0.999114 | 4.395672 |
653fd038-32ed-4304-b346-f118da90b9ef | AbhishekJain18/Cpp_Logical_Problems | ChkVowels.cpp | //Accept String from user and check wheather it contains vowels or not
#include<iostream>
using namespace std;
///////////////////////////////////
bool ChkVowel(char *str)
{
while(*str != '\0')
{
if(
*str == 'A' || *str == 'a' ||
*str == 'E' || *str == 'e' ||
*str == ... | ALGO | 0.997787 | 5.224551 |
dc20835a-019c-48e1-b8c2-81540b779f7d | whquddn55/Algorithm_BojSolves | 4000/4883.cpp | #include <bits/stdc++.h>
using namespace std;
#define INF INT_MAX / 2
#define MAXSIZE 100001
int n;
vector<vector<int> > arr;
int dp[MAXSIZE][3];
int get(int r, int c ) {
if (r < 0 || c < 0 || c >= 3)
return INF;
if (r == 0 && c == 1)
return arr[r][c];
int& ret = dp[r][c];
if (ret != -1) return ret;
return ... | ALGO | 0.997752 | 3.334643 |
8af6f4ad-9378-4086-8cf1-54b7b98c7669 | kshitizrai/Coursera-Algorithm-Toolbox | changing money.cpp | #include<iostream>
#include<vector>>
using namespace std;
int main()
{
int n;
// cout<<"Enter the money=";
cin>>n;
int amount = 0;
int number = 0;
while(amount+10<=n)
{
amount = amount + 10;
number++;
}
while(amount+5<=n)
{
amount = amount + 5;
numb... | ALGO | 0.999305 | 3.131727 |
44708c41-0b3c-41ac-ba80-bcd4577d6793 | mkp0/CP | CodeForce/489B - BerSU Ball.cpp | #include <bits/stdc++.h>
#define ll long long
#define pi (3.141592653589)
#define all(x) (x).begin(), (x).end()
#define vi vector<int>
#define vll vector<long long>
#define pii pair<int, int>
#define pll pair<long long, long long>
#define pb push_back
#define mp make_pair
#define S second
#define loop(i, a, b, c) for ... | ALGO | 0.999943 | 3.926018 |
5549a29c-fe23-4749-a8b5-1c795032f2ef | ut0s/atcoder | ABC/ABC129/a.cpp | /**
@date Time-stamp: <2019-06-09 21:02:12 tagashira>
@file a.cpp
@title A - Airplane
@url https://atcoder.jp/contests/abc129/tasks/abc129_a
**/
#include <algorithm>
#include <cmath>
#include <iomanip>
#include <iostream>
#include <string>
#include <vector>
using namespace std;
int main(int argc, char* argv[... | ALGO | 0.99943 | 4.080571 |
042b3d41-9fd7-4379-a031-83ca54996263 | leonardoAnjos16/Competitive-Programming | Codeforces/problem_about_weighted_sum.cpp | #include <bits/stdc++.h>
using namespace std;
#define long long long int
struct SegmentTree {
private:
const int NOP = -1e9 - 5;
int n;
vector<int> a;
vector<int> lazy;
vector<pair<long, long>> tree;
public:
SegmentTree(vector<int> &a, int n) {
this->n = n;
this->a = a;
... | ALGO | 0.999872 | 5.72331 |
13f13a43-acf2-4c22-bde5-8d6129e66382 | yggdrasil-917/Ryujin | ThirdParty/vulkan/spirv-tools/source/comp/markv_codec.cpp | // Contains
// - SPIR-V to MARK-V encoder
// - MARK-V to SPIR-V decoder
//
// MARK-V is a compression format for SPIR-V binaries. It strips away
// non-essential information (such as result ids which can be regenerated) and
// uses various bit reduction techiniques to reduce the size of the binary.
//
// MarkvModel... | TOOL | 0.954778 | 7.725429 |
2fbb1544-3a9d-4b2b-b0e6-ebb87b1e3d7e | GeoDrk/Fundamentos-de-programacion-Geovanni-Joel-Ramirez-Rivas | Unidad 5/potencia funciones 10.12.24.cpp | //Geovanni Joel Ramirez Rivas
//24041219
#include <iostream>
#include <windows.h>
#include <stdio.h>
using namespace std;
int potencia(int n,int e);
int main()
{
int num,exponente;
cout<<"Dame el numero a elevar:\n";
cin>>num;
cout<<"Dame la potencia:\n";
cin>>exponente;
cout<<num<<" elevado a: "<<exponente<<" =... | ALGO | 0.999385 | 4.149535 |
d2ba6220-a601-499c-bf29-f4a39fea1f96 | OmarHariry/LeetCode | 198-house-robber/198-house-robber.cpp | class Solution {
public:
int getMax(vector<int>&nums, int start, int end, vector<int>&dp){
if(start == end)
return nums[end];
if(start > end)
return 0;
if(dp[start] != -1)
return dp[start];
int pick = nums[start] + getMax... | ALGO | 0.999954 | 5.779762 |
ea056a28-fe7e-49df-8bde-664d575a1e60 | evgeniyfeder/itmo | algo/labs/range_quaries/parking.cpp | #include <iostream>
#include <vector>
#include <string>
#include <algorithm>
std::string file_name = "parking";
class parking_tree {
private:
void update(int cur_ind) {
if (heap[2 * cur_ind + 1] != NOT_EXIST) {
heap[cur_ind] = heap[2 * cur_ind + 1];
}
else if (heap[2 * cur_ind] != NOT_EXIST)
heap[cur_ind]... | ALGO | 0.999835 | 4.568903 |
c6e46fef-f995-4601-ae6c-1853449119bb | Xwyzworms/ProblemSolving | codechef/BasicProgramming/CompressVideo.cpp | #include<iostream>
int main ()
{
int t;
std::cin>>t;
while(t--)
{
int n;
std::cin>>n;
int a[n];
for(int i =0 ; i< n ;i++)
{
std::cin>>a[i];
}
int ans=1;
for(int i =0 ; i<n-1 ; i++)
{
if(a[i] != a[i+1])
... | ALGO | 0.999696 | 4.095584 |
d9977324-7148-41d1-9555-8b40bbf15926 | TanjimTajwar/Algorithm_Lab_Task | Max_Flow/C++/FindMaximumFlow.cpp | #include <iostream>
#include <vector>
#include <queue>
#include <climits>
using namespace std;
class FindMaximumFlow {
private:
int vertices;
vector<vector<int>> capacity;
vector<int> parent;
public:
FindMaximumFlow(int v) : vertices(v) {
capacity.resize(v, vector<int>(v, 0));
parent.... | ALGO | 0.99998 | 6.494564 |
8eba6c59-2f00-4d16-8f61-37555a19d49b | tres-xxx/Codeforces-Exercises | A/900-999/939A-LoveTriangle.cpp | #include <iostream>
using namespace std;
int main(){
int n;
cin >> n;
int l[n+1];
bool f = false;
for(int i = 1; i <= n; i++){ cin >> l[i]; }
for(int i = 1; i <= n; i++){
if(l[l[l[l[i]]]] == l[i] && l[l[l[i]]] != l[i]){
f = true;
break;
}
}
if(f){ cout << "YES"; }
else{ cout << "NO"; }
cout << end... | ALGO | 0.999989 | 3.636399 |
b3185623-68d1-420b-9d71-1300f8965da2 | GunjanRajTiwari/leetcode | 852.cpp | // Peak Index in a Mountain Array
class Solution {
public:
int peakIndexInMountainArray(vector<int>& arr) {
int l = 0, r = arr.size(), m;
while(l<r){
m = (l+r)/2;
if(arr[m]>arr[m-1] && arr[m]>arr[m+1]) return m;
if(arr[m]<arr[m-1]){
r=m;
... | ALGO | 0.999989 | 5.743234 |
752b70af-2d35-40d7-84c0-aa1034111131 | raincross7/code-similarity | codes/train_code/problem479/problem479_227.cpp | #include<bits/stdc++.h>
using namespace std;
#define endl "\n"
#define ll long long
#define MOD 1000000007
//#define ONLINE_JUDGE
vector< vector<char> > grid;
vector< vector<ll> > ans;
ll totalPaths(int H,int W){
if(W<0 || H<0){
return 0;
}
if(H==0 && W==0){
return 1;
}
if(grid[H][W]=='#'){
return 0;
}
... | ALGO | 0.999973 | 4.524296 |
8d9d6dd8-2732-441b-9316-3a47b67b37b4 | sarvex/leetcode-ruby | solution/0000-0099/0076.Minimum Window Substring/Solution.cpp | class Solution {
public:
string minWindow(string s, string t) {
int need[128]{};
int window[128]{};
int m = s.size(), n = t.size();
for (char& c : t) {
++need[c];
}
int cnt = 0, j = 0, k = -1, mi = 1 << 30;
for (int i = 0; i < m; ++i) {
... | ALGO | 0.999995 | 6.581265 |
d6745240-7834-45a9-b0e5-c02cddf8b4df | ikorotkin/gromacs_fhmd | src/gromacs/topology/index.cpp | #include "gmxpre.h"
#include "index.h"
#include <assert.h>
#include <ctype.h>
#include <stdlib.h>
#include <string.h>
#include <algorithm>
#include "gromacs/topology/atoms.h"
#include "gromacs/topology/block.h"
#include "gromacs/topology/invblock.h"
#include "gromacs/topology/residuetypes.h"
#include "gromacs/utili... | TOOL | 0.868077 | 3.656699 |
762bca22-4c04-4766-bc3f-b1f4b7471a51 | AI1379/OILearning | Practices/Training/Competition/SummerVacation/20190724/source/jn02-41_192.168.100.41_wuyaokun/jump.cpp | #include<bits/stdc++.h>
using namespace std;
int h,w,m;
int a[400][400];
int b[400][400],ans;
void s(int x,int y)
{
if(b[x][y]) return ;
b[x][y]=1;
// cout<<x<<y<<endl;
if(x<1||x>w||y<1||y>h) return ;
if(a[x+1][y]<=a[x][y]+m&&a[x+1][y]>=a[x][y]-m) s(x+1,y);
if(a[x-1][y]<=a[x][y]+m&&a[x-1][y]>=a... | ALGO | 0.999915 | 3.513793 |
56c07949-283c-44b6-9da9-1784f7199f84 | Yaseungho/myCodes | Baekjoon_Solving/Baekjoon_11727.cpp | #include <iostream>
#define MOD 10007
using namespace std;
int dp[1001];
int func(int n) {
if (n == 1) return 1;
if (n == 2) return 3;
if (dp[n] != 0) return dp[n];
int ret = (func(n - 1) % MOD + (2 * func(n - 2)) % MOD) % MOD;
dp[n] = ret;
return ret;
}
int main() {
int N;
cin >> N;
cout << func(N);
return... | ALGO | 0.99999 | 4.7048 |
af7198e3-4a60-490b-81e0-188ff8f80d32 | joshuaMarple/Data_Structures | Lab11/main.cpp | #include "min_span_tree.h"
#include <stdlib.h>
#include <fstream>
#include <iostream>
#include <sstream>
#include <string>
int main() {
min_span_tree* mst = new min_span_tree("data.txt");
return 0;
} | ALGO | 0.941423 | 3.511573 |
a4726708-9fc8-427c-9642-d19ac9f37388 | OscarATF/03_busqueda | binaria.cpp | #include <iostream>
using namespace std;
int Binaria(int[],int,int);
void interDirDer(int[],int);
void imprimirArreglo(int[],int);
int main() {
int n,dato;
cout<<"\tMETODO DE BUSQUEDA BINARIA\n"<<endl;
cout<<"Ingrese la capacidad del arreglo: "; cin>>n;
int arreglo[n];
for (int i=0;i<n;i++) {
cout<<"Ingrese el... | ALGO | 0.999889 | 4.663322 |
5152c684-5dcc-49f2-ae18-ac0a22ddc998 | jac-mac/EECS560-Lab1 | Executive.cpp | #include "Executive.h"
#include <unistd.h>
Executive::Executive(std::string fileName)
{
this->fileName = fileName;
ptr = new LinkedList<int>;
}
Executive::~Executive()
{
delete ptr;
}
void Executive::run()
{
int num = 0;
std::ifstream inFile;
inFile.open(fileName);
fileRetry(inFile);
initializeList... | TOOL | 0.9283 | 4.29355 |
4f21e8d2-584e-411a-b772-f599edf8f4a8 | KhushiJain123/CPP-207 | KHU_OV1.CPP | //program for demonstrate binary +(plus) operator overloading using friend function.
#include<iostream.h>
#include<conio.h>
class fbinary
{
private:
int a,b;
public:
void get();
void show();
fbinary friend operator +(fbinary f4,fbinary f5);
};
void fbinary::get()
{
cout<<"enter value of a and b->"<<endl;
ci... | ALGO | 0.986392 | 5.420347 |
9aafc355-0eee-475d-9b4d-f4ba1bed9aa1 | Pavelanln/Coppy | aten/src/ATen/native/cpu/SoftMaxKernel.cpp | #include <memory>
#define TORCH_ASSERT_ONLY_METHOD_OPERATORS
#include <ATen/native/cpu/SoftmaxKernel.h>
#include <algorithm>
#include <iterator>
#include <numeric>
#include <ATen/Dispatch.h>
#include <ATen/Parallel.h>
#include <ATen/TensorIterator.h>
#include <ATen/OpMathType.h>
#include <ATen/core/Tensor.h>
#include... | DATA | 0.985043 | 7.303364 |
5c64497a-ceba-4282-854f-05d61b545764 | Scurrlin/LC_Python_vs_Cpp | Searching/33_Search_in_Rotated_Sorted_Array/solution33.cpp | #include <vector>
using namespace std;
class Solution {
public:
int search(vector<int>& nums, int target) {
int L = 0, R = nums.size() - 1;
while (L <= R) {
int mid = L + (R - L) / 2;
if (nums[mid] == target) {
return mid;
}... | ALGO | 0.99999 | 6.371885 |
ad2122d0-8d39-4b76-abeb-7b1c749a142e | sikuner/book-code | 竹林蹊径——深入浅出windows驱动开发/11/ASIO/common/register.cpp | #include <windows.h>
#include <stdio.h>
#pragma warning(disable:4995)
#pragma warning(disable:4996)
typedef struct keylist
{
HKEY mainKey;
HKEY subKey;
char *keyname;
struct keylist *next;
} KEYLIST, *LPKEYLIST;
#define CLSID_STRING_LEN 100
#define MAX_PATH_LEN 360
#define DEV_ERR_SELFREG -... | TOOL | 0.870484 | 5.414399 |
3966cb17-62db-4cb9-afd9-91f909ba7156 | neelkanjariya1996/Data-Structures | Graph/detect_cycle_in_directed_graph.cpp | #include <iostream>
#include <list>
using namespace std;
class Graph
{
int V;
list <int> *adj;
bool is_cyclic_util (int v, bool visited [], bool rec_stack []);
public:
Graph (int V);
void add_edge (int v, int w);
bool is_cyclic ();
};
Graph :: Graph (int V)
{
this->V = V;
adj = new list <int> [V];... | ALGO | 0.999399 | 5.463071 |
cafb2eca-8810-43ac-a6d0-e7fd8234d02a | fefergrgrgrg/smileyCoin | src/jeeq.cpp | #include <string.h>
#include <stdbool.h>
#include <boost/endian/conversion.hpp>
#include <vector>
#include <stdexcept>
#include <openssl/ec.h>
#include <openssl/bn.h>
#include <openssl/obj_mac.h>
#include <openssl/crypto.h>
#include <openssl/rand.h>
#include <openssl/sha.h>
#include <openssl/err.h>
#include "key.h"
... | ALGO | 0.994541 | 6.114044 |
9a07cdc6-87b9-4023-a7e9-6ab23ce22fc3 | Moong0122/problem-solving | SW Expert Academy/3431(준환이의 운동관리).cpp | #include<iostream>
using namespace std;
int main(){
int t;
int l,u,x;
cin >> t;
for(int i=1;i<=t;i++){
cin >> l >> u >> x;
if(x < l)
cout << "#" << i << " " << l-x << endl;
else if(x >= l && x <= u)
cout << "#" << i << " 0" << endl;
else
cout << "#" << i << " -1" << endl;
}
return 0;
} | ALGO | 0.999378 | 3.239531 |
73b34977-1df1-4f20-ba3b-2ec3070500da | sarvex/leetcode-matlab | solution/2400-2499/2446.Determine if Two Events Have Conflict/Solution.cpp | class Solution {
public:
bool haveConflict(vector<string>& event1, vector<string>& event2) {
return event1[0] <= event2[1] && event1[1] >= event2[0];
}
}; | ALGO | 0.999928 | 5.719764 |
9e5d5fec-5621-4dac-9b00-aeac01aaaaf1 | summerspringwei/hope-comput-library | src/core/Rounding.cpp | #include "arm_compute/core/Rounding.h"
#include "arm_compute/core/Error.h"
#include "support/ToolchainSupport.h"
#include <cmath>
using namespace arm_compute;
using namespace std;
int arm_compute::round(float x, RoundingPolicy rounding_policy)
{
using namespace std;
int rounded = 0;
switch(rounding_poli... | TOOL | 0.928924 | 6.465801 |
797b8ca6-f528-40f3-b739-a69da50de302 | subhojitt/DSA | recursion-02/sumarray.cpp | #include<iostream>
using namespace std;
int f(int *arr, int idx, int n){
if(idx== n-1){
return arr[idx];
}
return (arr[idx]+ f(arr, idx+1 , n));
}
int main(){
int arr[]= {1,2,3,4,7};
int n =5 ;
cout<<f(arr , 0 ,n);
return 0;
} | ALGO | 0.999956 | 4.028286 |
c7eb05d3-895a-4223-b2c7-d08656eeb8b6 | karthik0702/ADA_LAB | median.cpp | #include <iostream>
#include <ctime>
#include <cstdlib>
#include <vector>
#include <bits/stdc++.h>
using namespace std;
int main()
{
int n1,n2,m;
cout<<"N1: ";
cin>>n1;
cout<<"N2: ";
cin>>n2;
int a1[n1], a2[n2];
for (int i = 0; i < n1; i++)
{
cin>>a1[i];
}
for (int i = 0; i < n2; i++)
{
cin>>a2[i];
}
s... | ALGO | 0.999989 | 3.866746 |
67ac58e2-6f49-43e1-8c9c-4a91fee3e755 | KareemSolimanDev/programmingAdvices_problemSolving_level_2 | 39-copy_prime_numbers_to_array.cpp | #include <iostream>
#include <time.h>
#include <math.h>
using namespace std;
int ReadPositiveNum(string msg)
{
int num = 0;
do
{
cout << msg << endl;
cin >> num;
} while (num <= 0);
return num;
}
int RandomNumber(int from,int to)
{
int number=rand() % (to - from + 1) + from;
... | ALGO | 0.999076 | 3.611212 |
08e2e005-77f8-4959-91a9-6d518164aa35 | welshimeat/Self_Study | C_STUDY/HW57.cpp | #include <stdio.h>
#include <string.h>
void inputstr(char (*)[20]);
void sortstr(char (*)[20]);
void printstr(char (*)[20]);
int main(){
char str[5][20];
inputstr(str);
sortstr(str);
printstr(str);
return 0;
}
void inputstr(char (*str)[20]){
for(int i=0; i<5; i++){
printf("# %d ڿ ԷϽÿ : ", i+1);
s... | ALGO | 0.99927 | 3.240416 |
8489d517-c9a6-4c00-ae45-1c8bb8e85ab4 | baopingli/leetcode_lb | 414.cpp | #include<iostream>
#include<vector>
#include<algorithm>
using namespace std;
class Solution {
public:
int thirdMax(vector<int>& nums) {
sort(nums.begin(),nums.end());
it=unique(nums.begin(),nums.end());
nums.erase(it,nums.end());
int n=nums.size();
if(n<3)
return ... | ALGO | 0.999466 | 4.667769 |
21af98b7-3b55-4e2a-bb2e-3470ce68a8fb | qianfeng0/CodePractice | LeetCode/108_ConvertSortedArraytoBST.cpp | /**
Given an array where elements are sorted in ascending order, convert it to a height balanced BST.
*/
/**
* Definition for a binary tree node.
* struct TreeNode {
* int val;
* TreeNode *left;
* TreeNode *right;
* TreeNode(int x) : val(x), left(NULL), right(NULL) {}
* };
*/
#include <stdio.h... | ALGO | 0.999993 | 6.114739 |
6b55e90e-0f6b-4a13-bdd5-4e32d4666f84 | sheepduke/leetcode | src/1. Two Sum/main.cpp | #include <iostream>
#include <vector>
using namespace std;
/**
* 1. Two Sum
Easy
Given an array of integers, return indices of the two numbers such that they
add up to a specific target.
You may assume that each input would have exactly one solution, and you may
not use the same element twice.
Example:
Gi... | ALGO | 0.998708 | 6.687671 |
a52cc988-a32b-4699-ac0c-c33b44baf468 | andsopwn/acmicpc | 17000/17425.cpp | #include <iostream>
#include <bits/stdc++.h>
using namespace std;
int MAX = 1000000;
long long dp[1000001];
long long n[1000001];
int main() {
int i, j, C, P;
ios_base::sync_with_stdio(false);
cin.tie(NULL);
cout.tie(NULL);
fill_n(dp, MAX + 1, 1);
for (i = 2 ; i <= MAX ; i++) ... | ALGO | 0.999675 | 3.895854 |
93cd4a3e-dc5c-4684-91a4-506880fcd54e | TheArchitectEngineer/Fuchsia_llvm | libc/src/math/amdgpu/frexpf.cpp | #include "src/math/frexpf.h"
#include "src/__support/common.h"
#include "declarations.h"
#include "src/__support/macros/config.h"
namespace LIBC_NAMESPACE_DECL {
LLVM_LIBC_FUNCTION(float, frexpf, (float x, int *p)) {
return __builtin_frexpf(x, p);
}
} // namespace LIBC_NAMESPACE_DECL
| ALGO | 0.909038 | 5.170382 |
09aff6e3-9a66-4ae9-8970-d9a3e53866b4 | jmanday/Master | TFM/library/boost_1_63_0/libs/graph/example/degree_centrality.cpp | //[degree_centrality_example
#include <iostream>
#include <iomanip>
#include <boost/graph/undirected_graph.hpp>
#include <boost/graph/exterior_property.hpp>
#include <boost/graph/degree_centrality.hpp>
#include "helper.hpp"
using namespace std;
using namespace boost;
// The Actor type stores the name of each vertex... | ALGO | 0.999219 | 7.26299 |
0e31879a-f458-473f-8978-935280a414bf | parasite-e/XPSC | week 3/Day 5/Musical Puzzle.cpp | #include<bits/stdc++.h>
using namespace std;
int main()
{
int t;
cin >> t;
while(t--)
{
int n;
cin >> n;
string s;
cin >> s;
set<pair<char, char>>st;
for(int i = 0; i<n-1; i++)
{
char a = s[i];
char b = s[i+1];
... | ALGO | 0.999722 | 3.86823 |
b1a2672a-d8db-4937-b0f8-a44b00a93f77 | Redleaf23477/ojcodes | codeforces/edu158/B.cpp | #include <bits/stdc++.h>
using namespace std;
using LL = long long;
void solve() {
int n; cin >> n;
vector<int> arr(n);
for (auto &x : arr) cin >> x;
LL ans = arr[0] - 1;
for (int i = 1; i < n; i++) {
if (arr[i] > arr[i - 1]) {
ans += arr[i] - arr[i - 1];
}
}
cou... | ALGO | 0.999645 | 5.202159 |
399d6fc7-cb84-427a-8028-698e7ee82257 | sjtao98/Leetcode_backup_2 | 0059_Spiral_Matrix_II/59_Spiral_Matrix_II.cpp | /**
Runtime: 0 ms, faster than 100.00% of C++ online submissions for Spiral Matrix II.
Memory Usage: 6.6 MB, less than 16.73% of C++ online submissions for Spiral Matrix II.
*/
class Solution {
public:
vector<vector<int>> generateMatrix(int n) {
vector<vector<int>> ans(n, vector<int>(n, 0));
int c =... | ALGO | 0.999915 | 4.968573 |
f80976c1-51be-4ab7-8913-17eb7e56a049 | Zhanghq8/Udacity_Path_planning | src/Eigen-3.3/bench/sparse_transpose.cpp |
//g++ -O3 -g0 -DNDEBUG sparse_transpose.cpp -I.. -I/home/gael/Coding/LinearAlgebra/mtl4/ -DDENSITY=0.005 -DSIZE=10000 && ./a.out
// -DNOGMM -DNOMTL
// -DCSPARSE -I /home/gael/Coding/LinearAlgebra/CSparse/Include/ /home/gael/Coding/LinearAlgebra/CSparse/Lib/libcsparse.a
#ifndef SIZE
#define SIZE 10000
#endif
#ifndef... | ALGO | 0.982877 | 5.132639 |
a7577e6a-a165-42c2-9adc-bc76f4cc109d | harshithalwan1/Leetcode | 155StackMin.cpp | #include<iostream>
#include<vector>
#include<string>
#include<stack>
using namespace std;
class MinStack {
public:
struct ListNode {
int val;
int min;
ListNode *next;
ListNode(int x, int m) : min(m), val(x), next(NULL) {}
};
ListNode *head {};
MinStack() {
}
... | ALGO | 0.999822 | 5.453551 |
c25b5ff3-69da-4ac8-bad7-da8775c4e856 | bala-chandar12/DSA-C- | very_easy/[220] To the Power of [VE].cpp | /*
#### To the Power of _____ ####
Create a function that takes a base number and an exponent number and returns the calculation.
[Examples]
___
calculateExponent(5, 5) ➞ 3125
calculateExponent(10, 10) ➞ 10000000000
calculateExponent(3, 3) ➞ 27
_____
[Notes]
___
*) All test inputs will be positive integers.
*)... | ALGO | 0.998954 | 3.623093 |
671fd4d1-d519-4c03-9b6e-312fdd3fc8ad | jkl1385/Data_Structure_Algorithm_Practice | Data_Structure_Algorithm_Practice/IntStack.cpp | #include <iostream>
using namespace std;
class IntStack {
private:
int max;
int ptr;
int* stk;
public:
int initialize(int);
int push(int);
int pop(int*);
int peek(int*) const;
void clear();
int capacity() const;
int size() const;
int isEmpty() const;
int isFull() const;
int search(int) const;
void print(... | TOOL | 0.990458 | 4.218669 |
f9df400b-055d-4ea4-9bea-f94103010164 | hjiang13/LLMs-in-IR | processed_data/DecompiledResuts_Human_x_164_O1/MetaLLama_Human_x_164_O1_decompiled/CPP_121.cpp | #include <stdint.h>
int solution(int* arr, int size) {
int sum = 0;
int i;
for (i = 0; i < size; i++) {
if (arr[i] % 2 == 1) {
sum += arr[i];
}
}
return sum;
}
| ALGO | 0.999896 | 5.089934 |
124baff5-a1f4-49bb-926b-79efba30d6ab | TITANBGG/C-3 | C-3-main/Untitled3.cpp | #include<stdio.h>
#include<stdlib.h>
//15 kiiinin maa alnacak zam yaplacak 8000 ve zeri %25
//8000 alt kiiler %25 ve 1000 tl alacak
void zam(int dizi[])
{
for(int i=0;i<15;i++)
if(dizi[i]<=8000)
dizi[i]=dizi[i]*1.25;
else
dizi[i]=dizi[i]*1.25+1000;
}
int main(){
int maas[15];
printf("Ltfen maaslari girin... | ALGO | 0.99644 | 3.04776 |
70257da1-5ea9-4462-b348-03ae5c8a0330 | heturing/FSPA | llvm/lib/CodeGen/MachineInstrBundle.cpp | #include "llvm/CodeGen/MachineInstrBundle.h"
#include "llvm/ADT/SmallSet.h"
#include "llvm/ADT/SmallVector.h"
#include "llvm/CodeGen/MachineFunctionPass.h"
#include "llvm/CodeGen/MachineInstrBuilder.h"
#include "llvm/CodeGen/Passes.h"
#include "llvm/CodeGen/TargetInstrInfo.h"
#include "llvm/CodeGen/TargetRegisterInfo.h... | TOOL | 0.890304 | 7.917451 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.