uuid string | repo_name string | relative_path string | content string | category string | algo_rel_score float64 | quality_score float64 |
|---|---|---|---|---|---|---|
7233b7ed-c417-47b9-bf30-755f59a81500 | rony-saji/ecommerce-provider | ecommerce_app/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.99875 | 6.76775 |
1b5f7fe4-3b14-4d11-9fc7-182068ff40b8 | prathameshpranjale/ProgrammingPractice | codeforces_ladder/contest/Round 966/seatinginbuss.cpp | #include<bits/stdc++.h>
using namespace std;
#define ll long long
#define yes cout<<"YES\n"
#define no cout<<"NO\n"
#define FAST (ios_base::sync_with_stdio(false),cin.tie(NULL))
#define sz(x) (int)(x).size()
int main(... | ALGO | 0.999907 | 4.100419 |
042a0a72-b493-4272-a35a-0d3ebe1cb404 | Re-bro/Algorithm-PS | BOJ/Sorting/[BOJ 16210] DSHS Bank.cpp | #include<bits/stdc++.h>
#define all(v) v.begin(), v.end()
#define sz(x) (int)x.size()
#define ini(x, y) memset(x, y, sizeof(x));
#define pb push_back
#define fi first
#define se second
using namespace std;
using ll = long long;
using pii = pair<int, int>;
using pll = pair<ll, ll>;
const int MOD = (int)1e9 + 7;
const in... | ALGO | 0.999992 | 4.661296 |
7f3d4f54-e16c-42f9-9871-2812ba32269b | ALIFAHMEDONGKON21/XPSCWEEK02 | DAY05/C_Cypher.cpp | #include<bits/stdc++.h>
using namespace std;
#define ll long long int
#define ull unsigned long long int
#define ui unsigned int
//STL :
#define vi vector<int>
#define vb ... | ALGO | 0.99925 | 3.805881 |
c1daeac3-62db-4460-bebf-baf503444a6f | neosfun/neos_fun_game_service | src/tcp_ip_server.cpp | #include "tcp_ip_server.h"
#include <sstream>
#include <iostream>
#include <vector>
#include <sys/stat.h>
#include <sys/time.h>
#include <fstream>
#include <regex> // regex, sregex_token_iterator
#include <stdio.h>
#include <math.h>
// ----------------------------------------------------------------------
// ne... | WEB | 0.876187 | 3.833614 |
f81fe0c8-355a-4c8f-89ae-b4079aa0293c | otavioon/COLA-2022-Tools | datasets/src/algo/codenet/4/s788552365.cpp | #include<bits/stdc++.h>
using namespace std;
typedef long long ll;
int main(){
int n,k,temp; cin >> n >> k;
set<int> S;
while(k--){
cin >> temp;
S.insert(temp);
}
int chk=0;
for(int i=n ; ; i++){
chk = 0;
temp = i;
while(temp>0){
int qq= temp%10;
if(S.find(qq)!=S.end()) chk=1;
// cout << qq << ... | ALGO | 0.999549 | 3.741566 |
e4c87e7d-c450-4a1c-8c14-82330daa8f45 | andrewpak/vision | DeepestConcavity/main.cpp | #include <iostream>
#include <fstream>
#include <string>
#include <cstdlib>
class Concavity {
int numRows, numCols, minVal, maxVal;
int x1, y1, x2, y2;
int maxHeight;
int bestThrVal;
double m;
double b;
int *histAry;
int **displayGraph;
public:
Concavity(std::ifstream &inFileHist, std::ifstream &inFileP... | ALGO | 0.993805 | 3.940522 |
e0e4d88e-9e17-4a19-886d-a4d067df6162 | MhammedAhmmed/LeetCode-Solutions | 1402-count-square-submatrices-with-all-ones/1402-count-square-submatrices-with-all-ones.cpp | class Solution {
bool allOnes(vector<vector<int>>& matrix, int row, int col, int k) {
for (int i = row; i <= row + k; i++) {
for (int j = col; j <= col + k; j++) {
if (!matrix[i][j])
return false;
}
}
return true;
}
public:
... | ALGO | 0.999869 | 5.872075 |
fea43aeb-d169-48d5-9683-7c5b0dfd841e | seandewar/challenge-solutions | leetcode/medium/most-beautiful-item-for-each-query.cpp | // https://leetcode.com/problems/most-beautiful-item-for-each-query
//
// Faster than 100%.
//
// Complexity: runtime O((i+q)*logi), space O(logi) [O(logi + q) if including
// output; where i == size(items), q == size(queries)].
class Solution {
public:
vector<int> maximumBeauty(vector<vector<int>> &items,
... | ALGO | 0.999468 | 6.669662 |
9f84822f-a74c-4818-a7de-4ba4910bc28c | JingCheng26/programme | LeetCode/Offer/51.cpp | class Solution {
public:
int reversePairs(vector<int>& nums) {
//超过时间限制
int cnt=0;
for(int i=0;i<nums.size();i++){
for(int j=i+1;j<nums.size();j++){
if(nums[j]<nums[i]) cnt++;
}
}
return cnt;
}
};
//超出时间限制
class Solution {
public:
... | ALGO | 0.999977 | 5.402812 |
498983c5-e6f6-4240-9397-a3539674884b | facumotta/CompProgrammingProblems | CSES_PROBLEMS/GRAPH_ALGORITHM/Counting_Rooms.cpp | #include <bits/stdc++.h>
using namespace std;
using tint = long long;
#define forn(i, n) for(tint i = 0; i < n; i++)
vector<vector<bool>> visited;
tint n, m;
void dfs(tint i, tint j){
visited[i][j] = true;
if(i-1 >= 0){
if(!visited[i-1][j]){
dfs(i-1, j);
}
}
if(j-1... | ALGO | 0.999812 | 4.723758 |
494ae790-1e1d-4e16-871e-dcc03841abff | Edzemike/Akies_dugnas_c- | opencv/sources/modules/core/src/command_line_parser.cpp | #include "precomp.hpp"
#include <sstream>
namespace cv
{
namespace {
static const char* noneValue = "<none>";
static String cat_string(const String& str)
{
int left = 0, right = (int)str.length();
while( left <= right && str[left] == ' ' )
left++;
while( right > left && str[right-1] == ' ' )
... | TOOL | 0.97447 | 6.614336 |
94e1f965-e3c5-4c55-a833-e9f8e3017c9e | commonapi-someip/boost_1_71_0 | libs/math/example/policy_eg_10.cpp | // Note that this file contains quickbook mark-up as well as code
// and comments, don't change any of the special comment mark-ups!
//[policy_eg_10
/*`
To understand how the rounding policies for
the discrete distributions can be used, we'll
use the 50-sample binomial distribution with a
success fraction of 0.5 o... | ALGO | 0.994891 | 4.302341 |
51188514-f7bd-4df4-a99d-7b8c1fd23362 | Foxpace/BeSafeBox_Android_app | mobile/src/main/cpp/calculations/Classifier.cpp | #define NO_FALL 0
#define FALL 1
#define AFTER_HIGH_ACTIVITY 2
#define FREE_FALL 3
#define ERROR 4
#include "Classifier.h"
#include "Calculations.h"
#include "../datatypes/SensorOutput.h"
#include "../datatypes/DataCarrier.h"
#include "nn/KerasSequentialModel.h"
#include "nn/Parameters.h"
int Classifier::classify(vec... | ALGO | 0.97104 | 4.743179 |
a2ccd5e6-d744-431e-8e82-29fa23ae3b71 | feixh/VISMA | thirdparty/libigl/include/igl/diag.cpp | #include "verbose.h"
// Bug in unsupported/Eigen/SparseExtra needs iostream first
#include <iostream>
#include <unsupported/Eigen/SparseExtra>
template <typename T>
IGL_INLINE void igl::diag(
const Eigen::SparseMatrix<T>& X,
Eigen::SparseVector<T>& V)
{
assert(false && "Just call X.diagonal().sparseView() direc... | ALGO | 0.990934 | 4.965804 |
495afd71-9a1c-4825-8ef9-1780252df892 | yliu-cs/ACM | NowCoder/牛客练习赛22-C.cpp | #include <bits/stdc++.h>
using namespace std;
#define mem(a,b) memset(a,b,sizeof(a))
#define pb push_back
#define mp make_pair
typedef long long ll;
typedef unsigned long long ull;
typedef pair<int,int> P;
const int INF = 0x3f3f3f3f;
const int maxn = 102;
const int mod = 1e9+7;
const double eps = 1e-8;
const double pi ... | ALGO | 0.999017 | 3.697829 |
058cd6f6-e594-4c04-bf44-273e7c5f4ae3 | llukito/leetCode | 1630-arithmetic-subarrays/1630-arithmetic-subarrays.cpp | class Solution {
public:
vector<bool> checkArithmeticSubarrays(vector<int>& nums, vector<int>& l, vector<int>& r) {
vector<bool> bools;
for(int i=0; i<l.size(); i++){
vector<int> vect(nums.begin()+l[i], nums.begin()+r[i]+1);
sort(vect.begin(), vect.end());
if(vect... | ALGO | 0.999953 | 6.183915 |
b345772c-c817-4eb8-8837-f6652f0caf72 | thegamer1907/Code_Analysis | contest/1542582364.cpp | #include <bits/stdc++.h>
#define int long long
#define mk make_pair
#define pb push_back
using namespace std;
const int N = 1123456;
const int mod = 1e9 + 7;
const int inf = 1e9 + 7;
int read()
{
int x;
scanf("%I64d", &x);
return x;
}
int a[N][5];
int d[N];
main()
{
int n, m, i, j;
... | ALGO | 0.999975 | 3.522434 |
95dda4e4-1c53-426b-bc15-922f6ba7052b | SundownRises/LEETCODE | 500-keyboard-row/keyboard-row.cpp | class Solution {
public:
vector<string> findWords(vector<string>& words) {
string row1 = "qwertyuiop";
string row2 = "asdfghjkl";
string row3 = "zxcvbnm";
unordered_map<char, int> charToRow;
for (char c : row1) charToRow[c] = 1;
for (char c : row2) charToRow[c] = 2;
for (char c ... | ALGO | 0.999657 | 6.193287 |
15df3252-1d2d-4dcf-a074-3d2344df7861 | Michaelryang/Boids3D | Source/Boids3D/Private/Boid.cpp | #include "Boid.h"
#include "Components/BoxComponent.h"
#include "BoidBoundsComponent.h"
#include "BoidContainer.h"
#include "BoidManager.h"
#include "Kismet/GameplayStatics.h"
#include "Kismet/KismetMathLibrary.h"
ABoid::ABoid()
{
PrimaryActorTick.bCanEverTick = true;
}
void ABoid::BeginPlay()
{
Super::BeginPlay();... | ALGO | 0.981191 | 5.742272 |
ffd8d1a9-e3f8-4aa8-91a2-6100327919bd | yliu-cs/ACM | LibreOJ/LibreOJ-108.cpp | #include <bits/stdc++.h>
const int N = 4e5 + 5;
int n, m, l;
std::complex<double> a[N], b[N];
int r[N];
void FFT(std::complex<double> a[], int sgn) {
for (int i = 0; i < n; ++i) {
if (i < r[i]) {
std::swap(a[i], a[r[i]]);
}
}
for (int i = 1; i < n; i <<= 1) {
std::complex<double> w(std::cos(M... | ALGO | 0.999981 | 3.116389 |
1ee236da-0aee-47ff-9af2-344992d78c50 | ishandutta2007/codeforces | craborac/normal/1218/B.cpp | // Created by Nikolay Budin
#ifdef DEBUG
# define _GLIBCXX_DEBUG
#endif
#include <bits/stdc++.h>
#define ff first
#define ss second
#define szof(x) ((int)x.size())
#ifndef LOCAL
# define cerr __get_ce
#endif
using namespace std;
typedef long long ll;
typedef long double ld;
typedef pair<int, int> pii;
typedef unsig... | ALGO | 0.999522 | 4.203591 |
89a608a6-f130-4ab7-94d8-db2dd91c009b | ritik1123/cpp-full-placement-code | STAR QUESTION/star-q4.cpp | #include<iostream>
using namespace std;
int main()
{
int n;
cin>>n;
for(int i = 1;i<=n;i++){
for(int j = 1; j<=n;j++){
if(j<=n-i){
cout<<' ';
}
else{
cout<<"*";
}
}
cout<<endl;
}
return 0;
} | ALGO | 0.999955 | 3.629384 |
15cca317-07d1-44f5-908c-7b1cd0a0a6e6 | kyleduval42/f1Tenth_UCSB_2024 | src/f1tenth_simulator/src/precompute.cpp | #include <math.h>
#include <cmath>
#include <vector>
#include "f1tenth_simulator/precompute.hpp"
using namespace racecar_simulator;
std::vector<double> Precompute::get_car_distances(int scan_beams, double wheelbase, double width,
double scan_distance_to_base_link, double angle_min, double scan_ang_incr) {
/... | ALGO | 0.99516 | 4.356725 |
3862cc32-be9b-4e27-82eb-8c6f35b89329 | ossimlabs/ossim-planet | src/ossimPlanet/ossimPlanetTerrainTechnique.cpp | #include <ossimPlanet/ossimPlanetTerrainTechnique.h>
#include <ossimPlanet/ossimPlanetTerrainTile.h>
#include <queue>
#include <osg/Timer>
#include <osg/Geometry>
#if ((OSG_VERSION_INT)>182)
#define USE_OLD_VBO_COMPILE 0
#else
#define USE_OLD_VBO_COMPILE 1
#endif
void ossimPlanetTerrainTechnique::CompileObjects::apply... | TOOL | 0.939989 | 5.350027 |
a9cd0a30-f8bc-4a2b-bfe4-839423cc0344 | mk-l0st/HPC | 03 parallel.cpp | #include<stdio.h>
#include<stdlib.h>
#include<time.h>
#include<omp.h>
void main() {
unsigned long long int num,i;
printf("Enter the number of steps : ");
scanf_s("%llu",&num);
time_t st,et;
st=clock();
double step=1.0/(double)num, pi=0.0;
double *local_pi=(double*)malloc(num*sizeof(double));... | ALGO | 0.999978 | 3.010472 |
b39c354e-9566-4bcb-811e-ce9241d16bc1 | ryzom/ryzomcore | nel/src/3d/quad_effect.cpp | #include "std3d.h"
#include "nel/3d/quad_effect.h"
#include <algorithm>
#include <deque>
#ifdef DEBUG_NEW
#define new DEBUG_NEW
#endif
namespace NL3D
{
// a 2d edge, ordered so that p1 is the highest point of the edge
struct CEdge
{
CEdge(const NLMISC::CVector2f &p1, const NLMISC::CVector2f &p2)
{
if (p1.y < p2... | ALGO | 0.995402 | 4.97463 |
f533d378-6433-48be-9057-ebf7b87bce26 | Shell-Wataru/AtCoder | ABC/ABC277/E.cpp | #define _USE_MATH_DEFINES
#include <iostream>
#include <algorithm>
#include <vector>
#include <deque>
#include <queue>
#include <set>
#include <map>
#include <limits>
#include <cmath>
#include <iomanip>
#include <functional>
#include <random>
#include <unordered_map>
#include <boost/multiprecision/cpp_int.hpp>
using n... | ALGO | 0.99988 | 3.878344 |
3553d538-4826-4bcc-8ea8-4a04d202fd62 | aerys/minko | plugin/serializer/lib/crnlib/crnlib/crn_math.cpp | namespace crnlib
{
namespace math
{
uint g_bitmasks[32] =
{
1U << 0U, 1U << 1U, 1U << 2U, 1U << 3U,
1U << 4U, 1U << 5U, 1U << 6U, 1U << 7U,
1U << 8U, 1U << 9U, 1U << 10U, 1U << 11U,
1U... | ALGO | 0.998623 | 7.247485 |
1ca378ba-486a-40e7-94dc-abdea14abc54 | Yoyuuhi/cpp-atcoder | _result/_AtCoderBeginnerContest222/A-Four_Digits/main.cpp | #include <bits/stdc++.h>
#include <atcoder/all>
#define out(X) cout << (X) << endl;
#ifdef __LOCAL
#define DBG(X) cout << #X << " = " << (X) << endl;
#else
#define DBG(X)
#endif
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define rep2(i, s, n) for (int i = (s); i < (int)(n); i++)
#define all(v) v.begin(), v.e... | ALGO | 0.999909 | 4.928443 |
f42b4bcc-4455-4d2a-a658-c8531be5021b | KAMAL15402/LEETCODE-SOLUTION | 1885-count-number-of-homogenous-substrings/1885-count-number-of-homogenous-substrings.cpp | class Solution {
public:
int countHomogenous(string s) {
int left = 0;
long long res = 0;
for (int right = 0; right < s.length(); right++) {
if (s[left] == s[right]) {
res += right - left + 1;
} else {
res += 1;
... | ALGO | 0.999989 | 6.055093 |
f6041887-44de-4cca-bcd6-7b7da6a30c50 | tjddn2615/CodePractice | codility/lesson6_MaxProductOfThree.cpp | // // you can use includes, for example:
// #include <algorithm>
// #include <queue>
// #include <cmath>
// // you can write to stdout for debugging purposes, e.g.
// // cout << "this is a debug message" << endl;
// bool compare(int a, int b){
// return abs(a) > abs(b);
// }
// int solution(vector<int> &A) {
// ... | ALGO | 0.999921 | 4.890768 |
594d99f8-0d04-4f9d-b6d9-1bdfb48f2831 | chhotabheem/algorithms | linkedlist/get_middle_node_in_list.cpp | struct ListNode
{
int data;
ListNode *next = nullptr;
};
ListNode *get_middle_node_in_list(ListNode *head)
{
if (!head || !head->next)
{
return head;
}
ListNode *slow = head;
ListNode *fast = head;
while (fast && fast->next && fast->next->next)
{
fast = fast->next->... | ALGO | 0.999578 | 5.214447 |
eb7ea0ee-b74d-4c6f-a86a-513e4b67ac8a | Salikhova2110/Assignment5.cp | problem_4.cpp | #include <iostream>
using namespace std;
int main () {
int num1, num2, r, sum=0;
cin>>num1;
num2=num1;
while(num1>0 )
{
r = num1 % 10;
num1 = num1 /10;
sum = sum + r;
}
cout << sum << endl;
if(sum % 5==0) {
cout<<"Yes";
}else{
cout<<"No";
}... | ALGO | 0.999957 | 3.596233 |
b074b262-9ac2-4957-985e-1071edd9d092 | Jaydip2001/DSA_questions_CPP | BSTs_delete.cpp | #include <iostream>
#include <vector>
using namespace std;
class Node{
public:
int data;
Node* left;
Node* right;
Node(int val){
data = val;
left = right = NULL;
}
};
Node* insert(Node* root, int val){
if(r... | ALGO | 0.999986 | 4.797707 |
67662534-a5f8-4af8-a13d-93884cc764e3 | goyalh4164/Data_Structure_Algorithm | STL/3.stl.cpp | #include<iostream>
#include<algorithm>
#include<cmath>
#include<utility>
using namespace std;
struct Interval{
int st;
int et;
};
bool compare(Interval i1,Interval i2){
return i1.st > i2.st;
}
int main(){ //Interval arr[] = {{6,4} , {3,4}, {4,6} , {8,13}};
//sort(arr,arr+4,compare);
int arr[] = {1,3,2,5,7,6};
... | ALGO | 0.992552 | 3.670479 |
5a2f5a54-7de1-42a4-9f79-6dde99fe4514 | marco-tomSuden/MineSlicer | src/libigl/igl/remesh_along_isoline.cpp | template <
typename DerivedV,
typename DerivedF,
typename DerivedS,
typename DerivedU,
typename DerivedG,
typename DerivedJ,
typename BCtype,
typename DerivedSU,
typename DerivedL>
IGL_INLINE void igl::remesh_along_isoline(
const Eigen::MatrixBase<DerivedV> & V,
const Eigen::MatrixBase<Deriv... | ALGO | 0.930164 | 5.418675 |
12646bba-65f6-4a10-b71d-e096e5926bca | BrianLTJ/oj-solutions | realquestions/sjtu-simple-sorting/main.cpp | #include <cstdio>
#include <vector>
#include <algorithm>
using namespace std;
const int MAXM = 1000;
bool cmp(int a, int b) {
return a<b;
}
int main()
{
int n;
scanf("%d", &n);
int * rawNums = new int[n];
for(int i=0;i<n;i++)
scanf("%d", &rawNums[i]);
vector<int> toSort;
// filt... | ALGO | 0.999875 | 4.259281 |
bc03bcfd-fe3e-4292-b63d-c69ba92feb40 | Nhatthang27/CompetitiveProgramming | AtCoder/Beginner-Contest-343/C.cpp |
#include <bits/stdc++.h>
#define int long long
#define fu(i, a, b) for (int i = a; i <= b; i++)
#define fd(i, a, b) for (int i = a; i >= b; i--)
#define pii pair<int, int>
#define pll pair<ll, ll>
#define ff first
#define ss second
using namespace std;
bool check(int x) {
string s = to_string(x);
int l = 0, r... | ALGO | 0.999969 | 5.092558 |
1c1b2c23-b9e1-4537-95ab-62604588dec8 | ritwikranjan/ImportantCodes | selection_sort.cpp | #include <iostream>
using namespace std;
int main()
{
int a[5]={4,7,2,9,1};
for (int i = 0; i < 5 ; i++){
int mini = i;
for (int j = i; j < 5; j++){
if (a[mini]>a[j+1]){
mini = j+1;
}
}
int temp = a[i];
a[i]=a[mini];
a[min... | ALGO | 0.999926 | 3.579217 |
931cc572-1c1b-4972-9ba2-a0b593205f2a | DaNaRim/dut-cpp | src/semester1/CiscoLab2_3_1/cl231.cpp | //https://drive.google.com/drive/u/1/folders/1blm2Q7FBWaqYCuSJSTBCQVkEO6ZweNUB
#include <iostream>
#include <valarray>
using namespace std;
void cl231_2_6_collatzsHypothesis() {
int num;
cin >> num;
int countOperations = 0;
while (num != 1) {
if (num % 2 == 0) {
num /= 2;
... | ALGO | 0.997688 | 5.285047 |
ce1477a5-1c1a-42c7-8d73-d22e19baedb6 | Ragtime-LAB/Ragtime_Panthera | 3_ROS_workspace/ROS1-Noetic+Ubuntu20.04/panther_ws/src/dm_drive/include/eigen/bench/sparse_randomsetter.cpp |
#define NOGMM
#define NOMTL
#define EIGEN_GOOGLEHASH_SUPPORT 1
#include <map>
#include <ext/hash_map>
#include <google/dense_hash_map>
#include <google/sparse_hash_map>
#ifndef SIZE
#define SIZE 10000
#endif
#ifndef DENSITY
#define DENSITY 0.01
#endif
#ifndef REPEAT
#define REPEAT 1
#endif
#include "BenchSparseUt... | TOOL | 0.886318 | 4.686878 |
953e94c9-cd75-4ac9-bd62-6342f15e3148 | DaviEspinosa/FLUTTER | exemplo_persistencia_json/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.999064 | 6.76073 |
1faa2fe3-1a28-4391-a21b-509ba46634c2 | myelovis/C-- | BasiC++/apartmentsize.cpp | #include <iostream>
using namespace std;
////////////////////////////////////////////////////////////////
struct Distance //English distance
{
int feet;
float inches;
};
////////////////////////////////////////////////////////////////
int main()
{
Distance d1, d3; //define two lengths
Distan... | ALGO | 0.852381 | 3.010709 |
d337ff71-86cf-4962-a618-6878b5a80b33 | Eduardocin/EDOO | APS/AP2/Ex1.cpp | #include <iostream>
#include <iomanip>
using namespace std;
int main(){
double a = 0.123456;
cout << setw(15) << left << a << endl;
double b = 23.987;
cout << fixed << setprecision(2) << right << setw(12) << b << endl;
double c = -123.456;
cout << scientific << setprecision(4) << setw(1... | TOOL | 0.890942 | 3.389804 |
e28aebe5-3694-4b95-ab8d-5bef0e727b38 | iRobot42/Leetcode | Easy/Design HashSet.cpp | class MyHashSet {
bitset< int( 1e6 ) + 1 > s;
public:
MyHashSet() {}
void add( int i ) { s.set( i ); }
void remove( int i ) { s.reset( i ); }
bool contains( int i ) { return s.test( i ); }
};
| ALGO | 0.946479 | 5.002466 |
0034d6a8-649d-4d90-bb60-02c66c25d788 | Sp-177/CODEFORCES | A_Vlad_and_the_Best_of_Five.cpp | #include<iostream>
#include<bits/stdc++.h>
using namespace std;
#define ll long long
#define f first
#define s second
#define pb push_back
#define p push
#define vi vector<int>
#define pii pair<int,int>
#define vpi vector<pii>
#define vs vector<string>
#define u_mi unordered_map<int,int>
#define u_mc ... | ALGO | 0.999906 | 4.696142 |
225bb9b7-1f6a-4d15-bd2a-7e5e3412601e | cechallenge/2025 | llvm/openmp/runtime/src/kmp_barrier.cpp | /*
* kmp_barrier.cpp
*/
#include "kmp_wait_release.h"
#include "kmp_barrier.h"
#include "kmp_itt.h"
#include "kmp_os.h"
#include "kmp_stats.h"
#include "ompt-specific.h"
// for distributed barrier
#include "kmp_affinity.h"
#if KMP_MIC
#include <immintrin.h>
#define USE_NGO_STORES 1
#endif // KMP_MIC
#if KMP_MIC &&... | TOOL | 0.975834 | 5.851617 |
b0644893-29e9-498c-ab83-0b5b9c0e249a | jspaper22/bftdetector | bftdetector/cpp/ctloader_mp.cpp | #include <iostream>
#include <fstream>
#include <cstring>
#include <map>
#include <string>
#include <vector>
#include <thread>
#include <mutex>
#include <cstdint>
#define XXH_INLINE_ALL
#include "xxhash.h"
using namespace std;
struct CallTracePack {
int data[5];
uint64_t hash[2];
};
struct RawTraceItem {
char... | DATA | 0.875936 | 4.168239 |
95fa7a58-e0f1-4658-b7c0-0257554e2cf6 | jjunCoder/ProblemSolving | 17406/17406.cpp | #include <iostream>
#include <string>
#include <algorithm>
#include <vector>
using namespace std;
vector<vector<int>> A;
vector<int> rvec, cvec, svec;
vector<int> ops;
int row_size, col_size, k;
void setting();
void permutation();
void rotation(int op_num);
int get_value();
void print();
int main()
{
cin >> row... | ALGO | 0.999927 | 4.010702 |
722aa580-76e1-472d-993d-ec4d48be2ee4 | NoLimitCoin/NoLimitCoin-Core | src/sync.cpp | #include "sync.h"
#include "util.h"
#include <boost/foreach.hpp>
#ifdef DEBUG_LOCKCONTENTION
void PrintLockContention(const char* pszName, const char* pszFile, int nLine)
{
printf("LOCKCONTENTION: %s\n", pszName);
printf("Locker: %s:%d\n", pszFile, nLine);
}
#endif /* DEBUG_LOCKCONTENTION */
#ifdef DEBUG_LOC... | TOOL | 0.97413 | 5.7469 |
049e9806-4af9-4c95-a5ab-524f5382beb7 | AlessandroCilardo/NaplesPU-toolchain | compiler/lib/CodeGen/LiveRegMatrix.cpp | #include "llvm/CodeGen/LiveRegMatrix.h"
#include "RegisterCoalescer.h"
#include "llvm/ADT/Statistic.h"
#include "llvm/CodeGen/LiveInterval.h"
#include "llvm/CodeGen/LiveIntervalUnion.h"
#include "llvm/CodeGen/LiveIntervals.h"
#include "llvm/CodeGen/MachineFunction.h"
#include "llvm/CodeGen/TargetRegisterInfo.h"
#includ... | ALGO | 0.908583 | 7.650435 |
8abdf5e1-a908-4e87-8b84-9623d2a78567 | osemrt/Image-Segmentation | includePixelToCluster.cpp | #include "header_files/declarations.h"
//A function to include a pixel to a cluster
void includePixelToCluster(Mat* image, vector< vector <pxLocation*> >* clusteredPixels, pxLocation centroidLocation, pxLocation* pxLocation) {
//Add the new pixel to the related cluster
clusteredPixels->at(centroidLocation.currentC... | ALGO | 0.993613 | 3.840653 |
23590694-a34c-48bc-9140-54e2f3a942c3 | Haemanth-V/IPMP1921 | Week-5/Stacks_and_Queues/min_stack.cpp | //Question Link: https://leetcode.com/problems/min-stack/
//Method 1 - O(n) space
class MinStack {
stack<pair<int, int>> st;
public:
/** initialize your data structure here. */
MinStack() {
}
void push(int val) {
int min = getMin();
if(min > val)
min = val;... | ALGO | 0.999851 | 6.563442 |
5f7b6c5c-e2ec-421d-9eea-b19d66e3216d | git-bauerseb/comp-programming | codeforces/competitions/div4_round_859/g1.cpp | #include <iostream>
#include <algorithm>
#include <vector>
#include <set>
#include <map>
#include <cstring>
using namespace std;
// Constants
#define MOD 1'000'000'007
// Simple types
#define ll long long
#define ld long double
// Aggeragte types
#define pii pair<int,int>
#define pll pair<long,long>
#define vi vec... | ALGO | 0.999703 | 4.439892 |
026b8988-fc3e-4d46-86a2-361166b05b20 | Rajeshnds/Competitive-Programming | codeforces/dragonmas/codeforces(c++)_old/Boring_appartment/main.cpp | #include<bits/stdc++.h>
using namespace std;
int t;
string x;
int boring(string x){
int a=x[0]-48;
return (a-1)*10+(x.size()*(x.size()+1)/2);
}
int main(){
for(cin>>t;t--;)cin>>x,cout<<boring(x)<<endl;
}
| ALGO | 0.998384 | 4.292454 |
64d1bafb-183b-4685-84cf-2548fe2d3801 | Caoyi2011/cpp | ht/LQ1095.cpp | #include <bits/stdc++.h>
using namespace std;
int main()
{
string str;
cin >> str;
for (int i = str.length()-1;i >=0;i--)
{
cout << str[i];
}
} | ALGO | 0.999799 | 4.912159 |
9e18d57b-3fce-4e85-8baf-14134f7cf16a | green-fox-academy/zbory | week-02/day-1/FiveNumbers/main.cpp | #include <iostream>
int main() {
// Create a program which accepts five integers from the console (given by the user)
// and store them in an array
// print out the values of that array using pointers again
int numbers[5];
for (int i = 0; i < 5; i++) {
std::cout << i + 1 << ". number:";
... | TOOL | 0.985275 | 3.341727 |
a30f3d69-217d-4a4c-99e0-161c4a55b9e2 | RedwanPlague/cses_problems | Graph-Algorithms/Building-Teams.cpp | // https://cses.fi/problemset/task/1668/
#include <iostream>
#include <vector>
#include <queue>
using namespace std;
typedef long long ll;
vector<vector<int>> adj;
vector<int> team;
bool bfs (int src) {
team[src] = 1;
queue<int> que;
que.push(src);
while(!que.empty()) {
int u = que.front();... | ALGO | 0.999996 | 4.918081 |
ce68a0a2-29aa-4f48-aaa2-e603e62e9edd | imraghavagr/DSA-cpp | DP/08.digitDP/02.G_OneSPOJ.cpp | // https://www.spoj.com/problems/GONE/
//We need to find the number of numbers in the range [L,R], whose sum of digits is a prime number
#include<bits/stdc++.h>
using namespace std;
#define ll long long
//1<=l<r<=1e6
//pos = 8
//tight = 0/1 => 2 values
//sum = 8*9 = 72 (max value)
ll dp[10][2][80];
int p[101];
bool i... | ALGO | 0.99988 | 4.995677 |
404841ed-98c3-44ce-9a00-314c145e99d4 | ReznoRMichael/cpp-course-pasja-informatyki-episode4-pseudorandom-number-game | main.cpp | #include <iostream>
#include <cstdlib>
#include <time.h>
#include <stdio.h>
using namespace std;
int liczba, strzal, ile_prob=0;
int main()
{
cout << "Witaj! Pomyslalem sobie liczbe z zakresu 1...100" << endl;
srand(time(NULL)); // inicjowanie randomizera
liczba = rand()%100+1; // losowanie liczby pseudo... | TOOL | 0.950803 | 3.484067 |
baf59095-3988-44a1-bc06-2cf45a4a1b4e | DavidLCPyML/Algorithms | codeforces/contests/UTPC/Jan27/PaperPrintA.cpp | #include <bits/stdc++.h>
using namespace std;
#define vi vector<int>
#define vd vector<double>
#define pii pair<int, int>
#define pdd pair<double, double>
#define vpdd vector<pdd>
#define vpii vector<pii>
#define ll long long
#define vl vector<ll>
#define fastio ios::sync_with_stdio(false);cin.tie(0);
#define mp mak... | ALGO | 0.999907 | 3.284927 |
a534f353-b221-4134-be01-9843c857d194 | CuriousCI/codeforces | 233A.cpp | #include <iostream>
#include <cstdint>
#include <algorithm>
#include <vector>
using namespace std;
int main()
{
ios_base::sync_with_stdio(NULL);
cin.tie(NULL);
uint16_t size;
cin >> size;
if (size & 1)
cout << -1;
else
for (uint16_t item = 1; item <= size; item += 2)
cout << item + 1 << ' ' << item << ... | ALGO | 0.993535 | 3.689494 |
b5e99be4-9d04-4ca7-8e1c-baffdddb276c | RyanKerstetter/boids | boid.cpp | #include "raylib.h"
#include "raymath.h"
#include "qtree.cpp"
float dt = 2;
float max_speed = 2;
float min_speed = 1;
float avoid_radius = 4;
float avoid_factor = .05;
float match_radius = 16;
float match_factor = .1;
float center_radius = 16;
float center_factor = .01;
float clamp(float value, float min, float max){... | ALGO | 0.999168 | 5.990789 |
f40037e7-9bb5-4289-a305-9f06b602ac2c | ishandutta2007/codeforces | yosupo/normal/425/D.cpp | #include <vector>
#include <iostream>
#include <set>
#include <cstdio>
#include <queue>
#include <cstdio>
#include <cstdlib>
#include <cassert>
#include <ctime>
#include <algorithm>
#include <tuple>
#include <algorithm>
#include <limits>
#include <map>
#include <complex>
using namespace std;
typedef long long ll;
type... | ALGO | 0.999668 | 4.461347 |
ef8ebee7-94a6-4fd5-a9f0-8dead6e3c8d6 | MIT-SPARK/Khronos | khronos/src/utils/geometry_utils.cpp | #include "khronos/utils/geometry_utils.h"
#include <hydra/input/input_data.h>
namespace khronos::utils {
Point computeCentroid(const Points& points) {
Point centroid(0, 0, 0);
for (const auto& vertex : points) {
centroid += vertex;
}
return centroid / points.size();
}
VertexMapAdaptor::VertexMapAdaptor(... | ALGO | 0.985237 | 7.429821 |
22c53ce1-c884-4519-818e-e8eae59e6cac | adityabelgaonkar05/CompProgLog | C_Removal_of_Unattractive_Pairs.cpp | #include <bits/stdc++.h>
#define int long long
#define ab adityabelgaonkar
using namespace std;
int32_t main()
{
int t; cin >> t;
while(t--)
{
int n; cin >> n;
string s; cin >> s;
map<char, int> mp;
int maxfreq = 0;
for(auto i : s)
{
mp[i]++;
... | ALGO | 0.999885 | 4.325448 |
41c8c256-20a4-41c0-a645-f46757413111 | sahilwep/DSA-Workspace | Codeforces/800/A_Nearly_Lucky_Number.cpp | /*
// A. Nearly Lucky Number
// we have to count the number of '4' & '7', if they are 4 or 7, then yes : else no
*/
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef vector<int> vi;
typedef pair<int,int> pi;
#define F first
#define S second
#define PB push_back
#define MP make_pair
#defin... | ALGO | 0.99972 | 5.347909 |
9f0a722e-b325-4046-8769-f8a541ff3fce | xmg2024/Leetcode-Solutions | 1501-2000/1980-Find-Unique-Binary-String/cpp-1980/main.cpp | /// Source : https://leetcode.com/problems/find-unique-binary-string/
/// Author : liuyubobobo
/// Time : 2021-08-21
#include <iostream>
#include <vector>
#include <set>
using namespace std;
/// Brute Force
/// Time Complexity: O(n^2)
/// Space Complexity: O(n)
class Solution {
public:
string findDifferentBina... | ALGO | 0.999383 | 5.983335 |
b8f0704c-6fe2-4dfd-abe6-438ee5105b0f | Barney666/Coding_Interview | src/Leetcode/Exercise85.cpp | #include <vector>
#include <stack>
using namespace std;
class Solution {
public:
int maximalRectangle(vector<vector<char>>& matrix) {
if(matrix.size() == 0)
return 0;
vector<int> heights(matrix[0].size());
int result = 0;
// 从上至下求出每一层的heights[],然后传给上一题的函数就可以了
f... | ALGO | 0.999778 | 6.134093 |
d0b8aade-3f8c-4f8d-b74f-aafa518b7fe2 | GabrielOlem/RoboCIn-Project | eigen-eigen-323c052e1731/doc/examples/tut_arithmetic_scalar_mul_div.cpp | #include <iostream>
#include <Eigen/Dense>
using namespace Eigen;
int main()
{
Matrix2d a;
a << 1, 2,
3, 4;
Vector3d v(1,2,3);
std::cout << "a * 2.5 =\n" << a * 2.5 << std::endl;
std::cout << "0.1 * v =\n" << 0.1 * v << std::endl;
std::cout << "Doing v *= 2;" << std::endl;
v *= 2;
std::cout << ... | ALGO | 0.991189 | 3.669638 |
6298455f-83db-4092-ae68-f6f795a46e00 | LeoninCS/My_AlgorithmCode | Algorithm_Code/蓝桥杯/十六届大学B组省赛/F.cpp | #include<bits/stdc++.h>
using namespace std;
using i64 = long long;
const int inf = 1e9;
const i64 INF = 1e18;
void solve()
{
string s1, s2;
cin >> s1 >> s2;
int n = s1.size();
int idxs, idxe;
for(int i = 0; i < n; i++) {
if(s1[i] == '#' || s2[i] == '#') {
idxs = i;
break;
}
}
for(int i = 0; i < n; ... | ALGO | 0.999956 | 4.095809 |
36c23ef5-7e2a-40b6-a257-31c4d9bf2f47 | marko1684/kiaa | kiaa/petlja/fenvikovaStabla/sumaSegmenta.cpp | #include <iostream>
#include <limits>
#include <cmath>
#include <string>
#include <vector>
using namespace std;
void napraviStablo(vector<int>& arr, vector<int>& stablo){
copy(arr.begin(), arr.end(), stablo.begin() + 1);
for(int i = 1; i < stablo.size(); i++){
if(i + (i & -i) < stablo.size()){
... | ALGO | 0.999511 | 4.484832 |
07b3d081-1498-4b12-9049-721dc31f7d5c | codesniper99/Coding-Competitions | Codeforces Round #620 Div2/C/main.cpp | #include <bits/stdc++.h>
#pragma gcc optimize("ofast")
using namespace std;
#define ll long long
#define ull unsigned long long
#define ui unsigned int
#define mod 1000000007
#define us unsigned short
#define IOS ios_base::sync_with_stdio(0);
#define INF LONG_MAX
#define PI 3.1415926535897932384626
#define mp make_pai... | ALGO | 0.999815 | 3.298589 |
d3486710-2adc-47ee-9c2c-f2a03ab335be | ra9hur/Coursera-Probabilistic-Graphical-Models | PA3-markov-networks-for-OCR/PGM_Programming_Assignment_3/inference/inference-src/libdai/src/lc.cpp | #include <iostream>
#include <algorithm>
#include <map>
#include <set>
#include <dai/lc.h>
#include <dai/util.h>
#include <dai/alldai.h>
namespace dai {
using namespace std;
void LC::setProperties( const PropertySet &opts ) {
DAI_ASSERT( opts.hasKey("tol") );
DAI_ASSERT( opts.hasKey("maxiter") );
DAI_ASS... | ALGO | 0.999016 | 6.250454 |
2fdb3dec-e6a1-48bf-91b1-8435b635b5d3 | agaltsevstas/leetcode | easy/MajorityElement.cpp | /*
1 Способ: Алгоритм голосования Мура
Time: O(n)
Memory: O(1)
*/
/*
2 Способ: std::sort
Time: O(nlogn)
Memory: O(1)
*/
/*
3 Способ: std::map
Time: O(n)
Memory: O(n)
*/
class Solution {
public:
#if 1
int majorityElement(vector<int>& nums)
{
int majority = 0;
for (int count = 0; cons... | ALGO | 0.999919 | 5.326017 |
b61e6843-0b5b-4144-9895-cc62b81a3eb0 | Sampurn44/DSA2024 | Pattern/pattern7.cpp | #include <bits/stdc++.h>
using namespace std;
int main()
{
int n=10;
for(int i=0;i<n/2;i++){
for(int j=n/2;j>i;j--){
cout<<" ";
}
for(int k=0;k<i;k++){
cout<<"* ";
}
cout<<endl;
}
//for even n
if (n%2==0){
for(int i=(n/2);i<n;i++){
for(int k=(n/2);k<i;k++){
cout<<" ... | ALGO | 0.999904 | 3.917251 |
9d5dee85-f579-4b0d-91c9-f87920dbf0c1 | MenaTalhHossamAlden/my-competitive-programming | Contests/Codeforces Round 970 (Div. 3)/C. Longest Good Array.cpp | #include <bits/stdc++.h>
using namespace std;
int main() {
int t, l, r, increment, res;
cin>>t;
while(t--) {
cin>>l>>r;
increment = 0;
res = 0;
for(int i=l;i<=r;i+=increment) {
res++;
increment++;
}
cout<<res<<endl;
}
return 0;
... | ALGO | 0.999968 | 3.701762 |
1b5a62e8-1ce4-417a-a599-c6fb01c8a42a | MusshcaB/lynx_cplus | python_cpp/opencv-4.5.1/opencv-4.5.1/samples/tapi/dense_optical_flow.cpp | #include <iostream>
#include <iomanip>
#include <vector>
#include "opencv2/core/ocl.hpp"
#include "opencv2/core/utility.hpp"
#include "opencv2/imgcodecs.hpp"
#include "opencv2/videoio.hpp"
#include "opencv2/highgui.hpp"
#include "opencv2/video.hpp"
using namespace std;
using namespace cv;
static Mat getVisibleFlow(I... | ALGO | 0.982427 | 6.959061 |
342a6e6e-52de-4896-bd2a-e627be235b2f | aj-talaei/Algorithmic-Playground | LeetCode/insert-interval/insert-interval.cpp | // Problem: Insert Interval
// URL: https://leetcode.com/problems/insert-interval/
// Given a set of non-overlapping intervals sorted by start times, insert a new interval and merge if necessary.
#include <vector>
using namespace std;
class Solution {
public:
vector<vector<int>> insert(vector<vector<int>>& interv... | ALGO | 0.999979 | 6.856448 |
1421ef64-09ee-47d7-9039-2b73002ad38b | ankitkumar0624/DSA | 2216-minimum-deletions-to-make-array-beautiful/2216-minimum-deletions-to-make-array-beautiful.cpp | class Solution {
public:
int minDeletion(vector<int>& N) {
stack<int>st;
int m=N.size(),del=0;
for(int i=0;i<m;i++){
st.push(N[i]);
if(!st.empty()&&st.size()>1&&st.size()%2==0){
int t1=st.top();st.pop();
int t2=st.top();st.pop();
... | ALGO | 0.999957 | 5.534561 |
c7805d8a-f8a5-47be-984d-f5f2289441d4 | Ajeetsoni2002/Leetcode-question-practice | 3306. Count of Substrings Containing Every Vowel and K Consonants II.cpp | class Solution {
public:
// Same as 3305. Count of Substrings Containing Every Vowel and K Consonants I
long long countOfSubstrings(string word, int k) {
return substringsWithAtMost(word, k) - substringsWithAtMost(word, k - 1);
}
private:
// Return the number of substrings contain... | ALGO | 0.999935 | 6.255063 |
2fd9260a-ac4a-467c-9769-eba26b3a4393 | msa-iqbal/c-plus-plus-code-solutions | 19.3 (C++) String for check they equal or not by using strcmp().cpp | /// Compare different different String for check they equal or not by using strcmp()
#include <iostream>
#include <cstring>
using namespace std;
int main()
{
char name1 [50] = "Michael ";
char name2 [] = "Scofield";
int result = strcmp(name1, name2); //If both string are same then return '0'
if(resul... | ALGO | 0.995697 | 3.701232 |
4e781820-7f7c-4d9d-b3f5-1470f14aec18 | 1Rayquaza/InterviewBit | Dynamic Programming/Kingdom War.cpp | vector<vector<int> > dp;
int war(vector<vector<int> > &A, int i, int j){
if(dp[i][j] != -1){
return dp[i][j];
}
if(i == A.size()-1 && j == A[0].size()-1){
return dp[i][j] = A[i][j];
}
else if(i == A.size()-1){
return dp[i][j] = A[i][j] + war(A, i, j+1);
}
... | ALGO | 0.999979 | 5.037669 |
b64b2fe7-4174-45b9-a975-870fd441d8b5 | SnehalMarutiSalokhe/CrackYourPlacement | 2-String/reverse-words-in-a-string.cpp | #include<bits/stdc++.h>
using namespace std;
class Solution {
public:
string reverseWords(string s) {
int i =s.length()-1;
string ans = "";
string temp = "";
while(i>=0)
{
if(s[i]!=' ')
temp = s[i]+temp;
... | ALGO | 0.999959 | 5.445439 |
793b18b7-aaec-4e87-b175-10c140b073a3 | maperz/Teaser | source/Teaser/Math/Matrix4.cpp | #include <Teaser/Math/Matrix4.hpp>
namespace Teaser
{
const Matrix4 Matrix4::Identity = Matrix4(Vector4(1, 0, 0, 0),
Vector4(0, 1, 0, 0),
Vector4(0, 0, 1, 0),
Vector4(0, 0, 0, 1));
Matrix4& Matrix4::operator*=(float f)
{
for (int i = 0; i < 4; i++)
{
m[i] *= f;
}
return *this;
}
Matrix4& Matri... | TOOL | 0.912996 | 7.147774 |
c9194c45-838e-485b-9f61-b8e30ffe35bc | HongYoungGee/Algorithm | BOJ/01929/1929.cpp14.cpp | #include <iostream>
#include <vector>
#include <string>
#include <algorithm>
using namespace std;
bool PrimeArray[1000001];
void Eratos(int n)
{
if (n <= 1) return;
for (int i = 2; i <= n; i++) PrimeArray[i] = true;
for (int i = 2; (i*i) <= n; i++)
{
if (PrimeArray[i])
{
for (int j = i*i; j <= n; j += i)... | ALGO | 0.999962 | 3.662234 |
488a43dc-cd46-419b-ba53-495f5e19ccd1 | MahaAmin/Algorithms | Problem_Solving/Codeforces/DIY-Wooden-Ladder.cpp | #include <iostream>
#include <bits/stdc++.h>
using namespace std;
int main(){
int t;
cin>>t;
for(int i=0; i<t; i++){
int n;
cin>>n;
int k = n-2;
int planks[n];
for(int j=0; j<n; j++){
cin>>planks[j];
}
// sort planks in descending order
sort(planks, planks+n, greater<int>()... | ALGO | 0.999775 | 4.004686 |
6af45506-c166-44d0-ac8a-7425069e89bc | jlprieur/jlplib | jlp_wavelib/old_version/imagedemo2.cpp | // IMPORTANT - Algorithm used to display Image is imprecise because of int 8 overflow issues
// and it shouldn't be used to judge the performance of the DWT. The DWT and IDWT outputs
// should be used for performance measurements. I have used maximum value rescaling to
// solve overflow issues and , obviously, it is go... | ALGO | 0.998331 | 4.40864 |
308d2c83-57ed-4485-a9bf-861a5257691e | daviz04/EstructuraDeDatosCloud | Colas/NodoCola.cpp | #include "NodoCola.hpp"
#include "Persona.hpp"
NodoCola::NodoCola(Persona v, NodoCola* sig){
valor = v;
siguiente = sig;
}
NodoCola::~NodoCola(){
} | TOOL | 0.948556 | 3.3654 |
c9d5a9a2-46c4-4120-9811-a95b6e8c547d | Rasel006/Algorithms | Module 15/Counting_Rooms.cpp | #include<bits/stdc++.h>
using namespace std;
// Create the a vector that can store the value of the input
const int N = 1e3;
int n , m;
vector<string> graph_Matrix;
bool visited[N][N];
bool isValid(int i, int j){
return (i >= 0 && i < n && j >= 0 && j < m);
}
void DFS(int i, int j){
if(!isValid(i, j)) return;... | ALGO | 0.999878 | 5.425232 |
2f20f57a-e183-4fce-a231-c3f1831468d0 | mirinta/leet_code | dfs_bfs/1992_find_all_groups_of_farmland.cpp | #include <vector>
/**
* You are given a 0-indexed m x n binary matrix land where a 0 represents a hectare of forested
* land and a 1 represents a hectare of farmland.
*
* To keep the land organized, there are designated rectangular areas of hectares that consist
* entirely of farmland. These rectangular areas are... | ALGO | 0.999983 | 7.114475 |
cf27e482-753c-41cd-9b7e-68a065b23690 | Dhruv-Limbani/Data-Structures | 4_Linked_List/LL_medium/intersection_pt_YLL.cpp | #include<bits/stdc++.h>
using namespace std;
struct ListNode {
int val;
ListNode *next;
ListNode(int x) : val(x), next(NULL) {}
};
class Solution {
public:
ListNode *getIntersectionNode(ListNode *headA, ListNode *headB) {
ListNode* temp1=headA, *temp2 = headB;
while(temp1!=temp2){
... | ALGO | 0.999714 | 4.979166 |
204eccea-1ea2-4ba6-9fdb-6ba68c671611 | jrmuizel/mozilla-cvs-history | js2/src/js2date.cpp | #ifdef _WIN32
#include "msvc_pragma.h"
#endif
#include <algorithm>
#include <list>
#include <map>
#include <stack>
#include <assert.h>
#include <ctype.h>
#include "world.h"
#include "utilities.h"
#include "js2value.h"
#include "numerics.h"
#include "reader.h"
#include "parser.h"
#include "regexp.h"
#include "js2engi... | TOOL | 0.86395 | 6.582828 |
73e41443-4f2b-45df-9f8c-59daa2afac14 | ergt666/learning_cpp | LongestSubstringWithoutRepeatingCharacters.cpp | #include <iostream>
#include <string>
using namespace std;
int main(){
string s = "pwwkew";
string res = "";
int sum = 0;
bool isX = true;
for (int i = 0; i < s.size(); i++){
if(isX){
res += s[i];
if(sum < res.size()) sum = res.size();
}
if (res.find(s[i+1]) != std::s... | ALGO | 0.99991 | 4.469898 |
7b3b49a8-b790-4e02-8c13-6c38b85dce48 | ai-tribunsky/self-driving-nanodegree | Path Planning/src/Eigen-3.3/bench/sparse_lu.cpp |
// g++ -I.. sparse_lu.cpp -O3 -g0 -I /usr/include/superlu/ -lsuperlu -lgfortran -DSIZE=1000 -DDENSITY=.05 && ./a.out
#define EIGEN_SUPERLU_SUPPORT
#define EIGEN_UMFPACK_SUPPORT
#include <Eigen/Sparse>
#define NOGMM
#define NOMTL
#ifndef SIZE
#define SIZE 10
#endif
#ifndef DENSITY
#define DENSITY 0.01
#endif
#ifnd... | ALGO | 0.996587 | 4.187482 |
797921ce-32f7-4748-af92-c47d7f975ce1 | VulpesCorsac/Leetcode | 0000. Leftmost Column with at Least a One/solution.cpp | static auto _ = [] () { ios_base::sync_with_stdio(false); cin.tie(nullptr); return 0; } ();
/**
* // This is the BinaryMatrix's API interface.
* // You should not implement it, or speculate about its implementation
* class BinaryMatrix {
* public:
* int get(int x, int y);
* vector<int> dimensions();
*... | ALGO | 0.999959 | 6.014945 |
39cef4b5-1366-4639-8a68-ae64e9cc57a6 | ishandutta2007/codeforces | vercingetorix/normal/333/A.cpp | #include <iostream>
#include <vector>
#include <algorithm>
#include <string>
#include <ctype.h>
#include <queue>
#include <cstring>
#include <set>
#include <bitset>
#include <map>
#include <chrono>
#include <random>
#include <unordered_map>
#include <stdio.h>
using namespace std;
typedef long long ll;
typedef long do... | ALGO | 0.999577 | 3.343292 |
d6196352-a549-42c6-a34e-46115d196eec | paraspipre/dp-solution | tree/Binary Tree Level Order Traversal.cpp | vector<vector<int>> levelOrder(TreeNode *root)
{
vector<vector<int>> ans;
if (!root)
return ans;
TreeNode *curr = root;
queue<TreeNode *> q;
q.push(curr);
vector<int> v;
v.push_back(root->val);
ans.push_back(v);
while (!q.empty())
{
int n = q.size();
vector<int> x;
... | ALGO | 0.999802 | 5.453346 |
e53025bf-673d-4828-ac94-fd50eb526143 | friedricherbs/CarND-MPC | src/Eigen-3.3/doc/examples/Tutorial_BlockOperations_print_block.cpp | #include <Eigen/Dense>
#include <iostream>
using namespace std;
int main()
{
Eigen::MatrixXf m(4,4);
m << 1, 2, 3, 4,
5, 6, 7, 8,
9,10,11,12,
13,14,15,16;
cout << "Block in the middle" << endl;
cout << m.block<2,2>(1,1) << endl << endl;
for (int i = 1; i <= 3; ++i)
{
cout << "B... | ALGO | 0.969002 | 3.6853 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.