uuid string | repo_name string | relative_path string | content string | category string | algo_rel_score float64 | quality_score float64 |
|---|---|---|---|---|---|---|
aa0d85f9-8073-47e3-86e5-ac3726a37fe8 | mycpp/docs | packrat/lib/x86_64-w64-mingw32/3.3.2/Rcpp/examples/ConvolveBenchmarks/convolve10_cpp.cpp | // -*- mode: C++; c-indent-level: 4; c-basic-offset: 4; tab-width: 8 -*-
// this version expands convolve8_cpp by making Vec mimic the structure of
// NumericVector. It peforms well, so this is is not the structure of
// NumericVector that is the problem. So what is it then ?
//
// could it be because NumericVector is... | ALGO | 0.959596 | 6.101669 |
9ae15301-659a-45eb-9dad-1f73af2761bc | orwellian225/pc-assignment | sssp_dijkstra/sssp_omp.cpp | #include <algorithm>
#include <stdio.h>
#include <string>
#include <fstream>
#include <chrono>
#include <omp.h>
#include "util.h"
static size_t NUM_THREADS;
/// path_t struct can be found in util.h
/// Definition
/// struct path_t {
/// uint32_t distance;
/// std::vector<size_t> path;
/// }
std::vector<path... | ALGO | 0.998358 | 5.243864 |
6e501460-46f0-4c0b-a18e-5e5a31e8775f | xoreos/xoreos | src/common/strutil.cpp | /** @file
* Utility templates and functions for working with strings and streams.
*/
#include <cassert>
#include <cctype>
#include <climits>
#include <cerrno>
#include <cstdarg>
#include <cstdlib>
#include <cstdio>
#include <cstring>
#include <memory>
#include "src/common/system.h"
#include "src/common/string.h"
... | TOOL | 0.900212 | 4.187708 |
52b61e1b-ced2-4ad3-9b2e-f6ad2472fdb1 | KerkkoKuokkanen/AB | srcs/AI/scores/AiScoreCharacterChecks.cpp |
#include "../../../hdr/global.h"
static bool CompareFunction(SDL_Point one, SDL_Point two)
{
return (one.x < two.x);
}
std::vector<SDL_Point> GetCharacterEffectiveDistances(t_AiCharacter *character)
{
std::vector<SDL_Point> ranges = {};
for (int i = 0; i < character->character->abilities.size(); i++)
{
int ran... | ALGO | 0.957081 | 4.525672 |
0071c8b3-74f6-4899-977e-d990e9067cbe | garrison/vmc | vmc-core/MetropolisSimulation.cpp | #include <iostream>
// these three things are included for the exception handling
#include <stdexcept>
#include <string>
#include <boost/lexical_cast.hpp>
#include "Measurement.hpp"
#include "Walk.hpp"
#include "MetropolisSimulation.hpp"
template <typename ProbabilityType>
class invalid_probability_error : public st... | ALGO | 0.99766 | 7.159936 |
7deb65f5-7f20-4e2d-90be-48ac5428a03a | SHawnHardy/SH_M_AC_OLD | Codeforces/635/div1_a.cpp | /*
* @file Codeforces/635/div1_a.cpp
* @author SHawnHardy
* @date 2020-04-16
* @copyright MIT License
*/
#include "algorithm"
#include "cmath"
#include "complex"
#include "cstdio"
#include "cstdlib"
#include "cstring"
#include "iostream"
#include "map"
#include "queue"
#include "set"
#include "stack"
#include "st... | ALGO | 0.99991 | 4.18816 |
eec27af0-199f-40a1-a5e3-bb82fa803681 | cyndel1/src | engine/server/library/serverDatabase/src/shared/ConfigServerDatabase.cpp | #include "serverDatabase/FirstServerDatabase.h"
#include "serverDatabase/ConfigServerDatabase.h"
#include "serverUtility/ConfigServerUtility.h"
#include "sharedFoundation/ConfigFile.h"
#include "sharedFoundation/ExitChain.h"
#include "sharedFoundation/NetworkId.h"
#include <string>
//----------------------------------... | CONFIG | 0.900496 | 5.191446 |
74add7a2-b96e-4fe0-9554-d7eb572e78ef | mehmet4kif/kovalingo | 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 |
b1a57b34-96da-4996-9f6e-79424e2149e1 | JesperBang/02393-cpp | week1/HelloMath.cpp | #include <iostream>
#include <string>
int main() {
double result, x, y, z;
std::cin >> x;
std::cin >> y;
std::cin >> z;
result = (x + y) - z;
std::cout << result;
} | ALGO | 0.999882 | 4.734707 |
51fe70ef-28c6-4121-9144-46ae0d3b5615 | aminjonshermatov/competitive_programming | codeforces/archive/virtual/529/A.cpp | #include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
#pragma GCC optimize("Ofast")
#pragma GCC optimize("unroll-loops")
#pragma GCC optimize("fast-math")
#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native")
using namespace std;
using namespace... | ALGO | 0.999954 | 4.783012 |
36d00331-ec19-4b6c-a0d5-8406b9c6e501 | raincross7/code-similarity | codes/train_code/problem421/problem421_340.cpp | #include<iostream>
#include<vector>
#include<algorithm>
using namespace std;
using ll = long long;
const ll T = 1e9+7;
int main(){
vector<ll> t(4);
ll w[4][4]={};
ll a,b;
for(int i=0;i<3;i++){
cin >> a >> b;
t[a-1]++;t[b-1]++;
}
sort(t.begi... | ALGO | 0.999991 | 3.832142 |
79c7aa00-ac30-429b-9b88-5929c31527d6 | ghufran2508/DATA-STRUCTURES-AND-ALGORITHM-PRACTICE | extras/Stack/Balanced Brackets - Stack.cpp | #include <bits/stdc++.h>
using namespace std;
template <class datatype>
class Stack
{
int size;
int top;
datatype* data;
void resize()
{
datatype* newdata = new datatype[size];
for (int i = 0; i < size; i++)
{
newdata[i] = data[i];
}
... | ALGO | 0.999655 | 5.945119 |
51b19186-7c42-4e73-887e-5c279e2b936d | LCAD-UFES/carmen_lcad | src/rddf_from_image/rddf_from_image_playback.cpp | #include <carmen/carmen.h>
#include "g2o/types/slam2d/se2.h"
#include "rddf_predict_optimizer.h"
#include <vector>
#include <algorithm>
#include <fstream>
#include <carmen/rddf_interface.h>
#include <carmen/rddf_messages.h>
#include <carmen/rddf_index.h>
using namespace g2o;
int camera;
carmen_localize_ackerman_globa... | ALGO | 0.992143 | 3.764363 |
bed24919-1647-4d24-b66e-2c7fc0f65686 | liuq901/code | AOJ/a_0178.cpp | #include <cstdio>
#include <vector>
#include <algorithm>
using namespace std;
int main()
{
while (1)
{
int n;
scanf("%d",&n);
if (n==0)
break;
vector <bool> a[10];
for (int i=1;i<=n;i++)
{
int x,y,z;
scanf("%d%d%d",&x,&y,&z);
... | ALGO | 0.99971 | 3.489124 |
d1eb78ae-16ef-4392-b089-ed1d67a2689a | aneeshkjohny/flutter_course | basics/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.99869 | 6.76073 |
3a9019f0-6476-46c1-afa1-01f48243b335 | mariobiocic/oop_vjezbe | vježba 10. struktura.cpp | #include <iostream>
#include <fstream>
#include <vector>
#include <algorithm>
#include <cmath>
using namespace std;
struct Point
{
double x, y;
Point(double _x, double _y) : x(_x), y(_y) {}
};
vector<Point> readPoints(const string& filename) {
ifstream file(filename);
vector<Point> points;
doub... | ALGO | 0.999841 | 4.421805 |
6a032ab2-f289-462b-a1f5-9b6029d1b2cd | TanishyadavNSUT/Data-Structures-Algorithms | Course/array/reverse_int.cpp | #include<iostream>
using namespace std;
int reverse_int(int n){
int ans = 0;
while(n!=0){
int digit = n % 10;
if((ans>INT_FAST32_MAX/10) ||(ans<INT_FAST32_MIN/10)){
return 0;
}
ans = ans * 10 + digit;
n = n / 10;
}
return ans;
}
int main(){
... | ALGO | 0.999369 | 4.903111 |
45374a73-fd37-4ec8-8ecb-b6466344c821 | abhiranjankumar00/TopCoder-SRM-submissions | GUMIAndSongsDiv1.cpp | #include <iostream>
#include <ctime>
#include <vector>
#include <list>
#include <queue>
#include <map>
#include <set>
#include <deque>
#include <stack>
#include <bitset>
#include <algorithm>
#include <functional>
#include <numeric>
#include <cassert>
#include <utility>
#include <sstream>
#include <iomanip>
#include <cs... | ALGO | 0.999816 | 4.950712 |
5f39305d-6dcf-419d-b950-c4c92ffba986 | SarbajitPbappy/CF | 1368A-C+eq.cpp | #include <cstdio>
int main(){
long t; scanf("%ld", &t);
while(t--){
long a, b, n; scanf("%ld %ld %ld", &a, &b, &n);
long cnt(0);
while(a <= n && b <= n){
if(a < b){a += b;}
else{b += a;}
++cnt;
}
printf("%ld\n", cnt);
}
retu... | ALGO | 0.999743 | 3.468756 |
08e6abbe-e250-4977-ade2-0a12a6b25181 | binhvu2005/ctdl-gt-ss6 | Untitled2.cpp | #include <stdio.h>
#define MAX 100
int stack[MAX];
int top = -1;
int isFull() {
return top == MAX - 1;
}
int isEmpty() {
return top == -1;
}
void push(int value) {
if (isFull()) {
printf("Ngan xep da day!\n");
} else {
stack[++top] = value;
}
}
int pop() {
if (isEmpty()) {
... | ALGO | 0.999193 | 4.351528 |
9d782281-ed4d-4b3d-be98-a98b462e318f | ArutoriaWhite/Competitive-programming | lj1300.cpp | #include <bits/stdc++.h>
#define de(x) cout << #x << "=" << x << ", "
#define dd cout << '\n';
#define rep(i,j,k) for (int i=j; i<=k; i++)
#define SakuraMyWife ios::sync_with_stdio(0), cin.tie(0);
#define ff first
#define ss second
#define int long long
#define SZ(x) ((int)x.size())
#define pb push_back
#define mem(a,x... | ALGO | 0.999955 | 3.091913 |
ca113b58-79c6-4f91-baff-dcb67b63aaf5 | xyokei/data_structure | chapter3_StackAndQueue/exercise/3.1.4_stack_page_67/03_islegal.cpp | //
// Created by AutumnSigni on 2023/8/20.
//
//给定栈 输入输出序列 ,判断是否合法
#include <iostream>
using namespace std;
bool isLegal(char c[]) {
int i = 0;
int j = 0, k = 0;//输入次数 输出次数
while (c[i] != '\0') { //字符型数组未占用全是\0
switch (c[i]) {
case 'I':
j++;
break;
... | ALGO | 0.998489 | 4.180172 |
eb4ab580-8dc3-492c-a8d5-6ad899d79903 | ishandutta2007/codeforces | flashmt/normal/1467/B.cpp | #include <bits/stdc++.h>
using namespace std;
int n, a[300300];
int check(int i)
{
if (i < 1 || i > n - 2)
return 0;
return a[i] < min(a[i - 1], a[i + 1]) || a[i] > max(a[i - 1], a[i + 1]);
}
int main()
{
ios_base::sync_with_stdio(0);
cin.tie(0);
int test;
cin >> test;
while (test--)
{
cin >>... | ALGO | 0.999848 | 4.47473 |
261fc80b-c1a8-40ca-ae1c-4b191fbd9930 | Mohit482006/ACC45DAYSOFCODE-2024- | Day 7 ATM2.cpp | #include <bits/stdc++.h>
using namespace std;
int main() {
// your code goes herein
int t;
cin>>t;
while(t--){
int n,k;
cin>>n>>k;
int a[n];
for(int i=0;i<n;i++){
cin>>a[i];
}
for(int i=0;i<n;i++){
if(a[i]<=k){
k=k-a[i];
cout<<"1";
}else... | ALGO | 0.999915 | 3.439756 |
88a84186-0d12-48e1-afd6-b4961a34c6eb | geodude1992/Leetcode | 74-search-a-2d-matrix/search-a-2d-matrix.cpp | class Solution {
public:
bool searchMatrix(vector<vector<int>>& matrix, int target) {
int left = 0, m = matrix.size(), n = matrix[0].size(), right = m * n - 1;
while(left <= right){
int mid = left + (right - left) / 2;
int mid_val = matrix[mid/n][mid%n];
if(mid_v... | ALGO | 0.999963 | 6.314226 |
a5ca933f-4b3c-460a-85cb-108b6cfd274a | sos22/llvm-project | libcxx/test/std/containers/sequences/forwardlist/forwardlist.modifiers/insert_after_size_value.pass.cpp | // <forward_list>
// iterator insert_after(const_iterator p, size_type n, const value_type& v);
#include <forward_list>
#include <cassert>
#include "min_allocator.h"
int main()
{
{
typedef int T;
typedef std::forward_list<T> C;
typedef C::iterator I;
C c;
I i = c.insert_a... | TEST | 0.953727 | 5.080077 |
b1cfdeab-9d00-4ae1-b66a-c28d38e0c33c | webKanchan1234/LeetCode | 1631-path-with-minimum-effort/1631-path-with-minimum-effort.cpp | class Solution {
public:
int minimumEffortPath(vector<vector<int>>& heights) {
int n=heights.size();
int m=heights[0].size();
priority_queue<pair<int,pair<int,int>>,vector<pair<int,pair<int,int>>>,
greater<pair<int,pair<int,int>>>>q;
vector<vector<int>>dis(n,vector<int>(m,1e... | ALGO | 0.99999 | 6.150456 |
9e0c9f81-6714-4729-a692-2e64285d5e35 | WSM-simon/CP-problems | CCC/CCC 19/CCC 19 S3 - Arithmetic Square/eff_version.cpp | #include <bits/stdc++.h>
#include <experimental/random>
#define ll long long
using namespace std;
const int N = 4;
const ll inf = 1e18 + 3;
const ll MIN = -1e9;
const ll MAX = 1e9;
vector<vector<ll>> grid(N, vector<ll>(N, inf));
void myPrint() {
for (int i = 1; i < N; ++i) {
for (int j = 1; j < N; ++j) ... | ALGO | 0.999853 | 4.311753 |
f5e039f2-e103-42dd-a40e-bdb0092152c4 | aman-dutta/DSA | GFG_Array/Level 1/cyclicallyRotate.cpp | #include <bits/stdc++.h>
using namespace std;
int main(){
int arr[] = {1,2,3,4,5};
int n = sizeof(arr)/sizeof(arr[0]);
//To cyclically rotate an array
//Using 2-Pointer Technique
int i =0;
int j = n-1;
while(i<j){
swap(arr[i], arr[j]);
i++;
}
for(int i=0;i<n;i++)... | ALGO | 0.999725 | 4.134978 |
5ea809f7-880a-4ef4-bda5-f81a927820fd | Kartik9077/DSA | 498-diagonal-traverse/diagonal-traverse.cpp | class Solution {
public:
vector<int> findDiagonalOrder(vector<vector<int>>& mat) {
vector<int>ans;
vector<int>curr;
int i=0,j=0;int z=-1;
while(i<mat.size()&&j<mat[0].size()){
z+=1;
int k=i,p=j;
while(k<mat.size()&&p>=0){
curr.push_... | ALGO | 0.999992 | 6.238821 |
3f4c9082-b433-4072-977a-04180a9c84a1 | NivyaPrakash/CPP_Training | Assignment/Day10_3/Day10_3/pgm08.cpp | #include<iostream>
using namespace std;
void swapping(int& a, int& b);
int main() {
int x, y;
cout << "Enter two numbers: ";
cin >> x >> y;
swapping(x, y);
cout << "After swapping: x = " << x << ", y = " << y << endl;
return 0;
}
void swapping(int &a, int &b) {
a = a + b;
b = a - b;
... | ALGO | 0.996148 | 5.442698 |
01e6dbd6-6eb6-40df-b850-1c2c533cc6a8 | LuisFelipeUnzueta/tarefa_ux_infnet | 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.998859 | 6.785645 |
54af09df-e95d-42c0-9c62-3f458951b03b | jitu7989/DSA | cpp/problems/codechef/Starters141/NearlyEqual.cpp | #include <bits/stdc++.h>;
using namespace std;
using ll = long long;
using ii = pair<ll,ll>;
void solve(){
int n,m;
string a,b;
cin >> n >> m;
cin >> a >> b;
int mn = INT32_MAX;
for (int i = 0; i <= n-m; ++i) {
int cnt = 0;
for (int j = 0,k=i; j < m; ++j,++k) {
if(a[... | ALGO | 0.999856 | 4.797042 |
a28e959e-2073-43f3-9167-505f47d03237 | taejuk/algorithm | chapter30/DRUNKEN.cpp | #include <iostream>
#include <memory>
#include <algorithm>
#include <vector>
using namespace std;
int v;
int adj[500][500];
int drunken[500];
int W[500][500];
int INF = 100000;
// 그냥 floyd 알고리즘을 한 번 실행하고 나서
// k에 대한 경우를 다 고려하면 되는가?
// 도착했을 때,
void solve() {
vector<pair<int,int>> order;
for(int i = 0; i < v; i... | ALGO | 0.999991 | 4.855552 |
ad407fc8-95af-476d-b129-1533e8642d2c | aanupam29/codeforces-problems | 1374E1 - Reading Books (easy version).cpp | #include <bits/stdc++.h>
using namespace std;
#define ll long long int
#define ulli unsigned long long int
#define li long int
#define ff(i,a,b) for(int i=a;i<b;i++)
#define fb(i,b,a) for(int i=b;i>=a;i--)
#define w(t) while(--t >= 0)
#define l(s) s.len... | ALGO | 0.999939 | 3.312922 |
187c81ff-3c9c-4d54-aa4c-7c1c6c766b59 | Techriss/leetcode | 219.cpp | #include <iostream>
#include <vector>
#include <unordered_map>
using namespace std;
// standard map solution
bool containsNearbyDuplicate(vector<int>& nums, int k) {
unordered_map<int, int> m;
for (int i = 0; i < nums.size(); i++) {
if (m.count(nums[i])) {
if (abs(i - m[nums[i]]) <= k) ret... | ALGO | 0.999919 | 6.032433 |
63c48082-31d8-42f6-b617-9f6c77772716 | DionysiosB/CodeForces | 0400-0499/468B-TwoSets.cpp | #include <cstdio>
#include <cstdio>
#include <vector>
#include <set>
int main(){
long n, a, b; scanf("%ld %ld %ld", &n, &a, &b);
std::vector<long> v(n);
std::set<long> s, A, B;
for(long p = 0; p < n; p++){scanf("%ld", &v[p]); s.insert(v[p]);}
bool possible(true);
for(long p = 0; p < n; p++)... | ALGO | 0.999962 | 3.360483 |
17fde681-3f96-4de6-908a-fc6d6d8e3486 | ishandutta2007/codeforces | atreus/normal/1096/C.cpp | #include <bits/stdc++.h>
#define F first
#define S second
#define PB push_back
#define PF push_front
#define MP make_pair
using namespace std;
typedef long long ll;
typedef long double ld;
typedef pair<int,int> pii;
const int mod = 998244353;
int angle[200];
int main(){
ios_base::sync_with_stdio(false);
memset(... | ALGO | 0.999877 | 4.729719 |
ba6e0604-3579-4cd9-a9bd-0091b0f922b3 | dev-jb-007/dev-cp | Codeforces/contest/379-DIV2/a.cpp | #include<bits/stdc++.h>
using namespace std;
int main(){
int n;
cin>>n;
string s;
cin>>s;
int one=0;
for(auto i:s)
{
if(i=='A') one++;
}
if(one>(n-one))
{
cout<<"Anton\n";
}
else if(one==(n-one))
{
cout<<"Friendship\n";
}
else{
cout<<"Danik\n";
}
}
| ALGO | 0.999731 | 3.591632 |
89f979e0-5d81-4cea-8d76-0d5db7976b3b | abathur8bit/ssobjects | stringtokenizer.cpp | #include <stdlib.h>
#include "stringtokenizer.h"
#include <string.h>
char* start;
char* end;
char* next;
char* srcend;
char* parse1(char* src)
{
if(!srcend)
{
srcend=src+strlen(src);
start=src;
end=src;
}
if(end==srcend)
return NULL;
if(next)
start=next;
... | ALGO | 0.920268 | 4.604097 |
f381e61e-8b36-4561-bdba-c5f8792b3669 | kaat0/OpenLinTim | src/timetabling/periodic/evaluation/evaluation.cpp | #include "../../../core/cpp/include/core.hpp"
#include "evaluation.h"
evaluation::evaluation(){}
/**
* Setting up the evaluation model.
* EAN and OD matrix are read in by the core. Then the RoutingEAN is initalized
*/
void evaluation::init(std::string activityfile, std::string eventfile,
std::string timetab... | ALGO | 0.99772 | 5.375565 |
c19f3fd2-7b0c-4e9a-b4c1-bf0253eea024 | pavellevap/code_antiplagiat | test/04/14956.cpp | #include<iostream>
#include<cstring>
#include<cstdio>
#include<algorithm>
#include<vector>
#define REP(i,n) for(int i=0;i<n;i++)
#define PB push_back
using namespace std;
const int MAX_N=5000+10;
vector<int> E[MAX_N];
int n;
int size[MAX_N];
bool can[MAX_N]={};
void dfs(int u,int par){
size[u]=1;
REP(i,E[u].size()... | ALGO | 0.999927 | 3.667134 |
5d0ba8a9-0ecc-435c-8e0e-e82a3d9359d7 | ilrexho2011/Project-EULER-Possible-Solutions-Problems-101_to_200 | Exercise 177/Exercise 177.cpp | #include <stdio.h>
#include <math.h>
#include <stdlib.h>
#define EPS 1e-8
typedef long long ll;
double d2r,r2d;
int equal(double a,double b) {
return fabs(a-b)<EPS;
}
/* only check infinite lines, not segments */
/* 0: lines don't intersect, 1:lines intersect, 2:lines are collinear */
int linesintersect(double x1,do... | ALGO | 0.999786 | 4.022464 |
90da9aa1-93fb-41d4-9398-76102e61a925 | Akamourya18/Recursion-and-Backtracking | N-Queens different forms/N_Queen_bitset.cpp | //Here bitset is used in place of canPlace function and it reduces the time
//complexity of canPlace function to O(1).
//This code only returns the total number of outcomes possible.
#include<bits/stdc++.h>
using namespace std;
bitset<30> col,d1,d2;
void solve(int r,int n,int &ans)
{
if(r==n)
{
ans++;
... | ALGO | 0.999972 | 4.279181 |
1c727df1-39f5-456b-bfaf-eae578e0453f | ishandutta2007/codeforces | okrut/normal/1456/B.cpp | #include <bits/stdc++.h>
#define rep(i,a,b) for (int i=a; i<b; i++)
#define pb push_back
#define fi first
#define se second
#define debug(...) fprintf(stderr, __VA_ARGS__)
using namespace std;
typedef long long ll;
typedef long double ld;
int main ()
{
//ios_base::sync_with_stdio(false);
int n;
scanf ("%d", &n);
... | ALGO | 0.99989 | 3.923402 |
c8db472e-688b-4a9c-b3d2-7e05989c06a5 | AminSheikh506/DSA | functions.cpp | #include <iostream>
using namespace std;
// sum of 2 numbers
int sum(int a, int b){
int s = a + b;
return s;
}
// min of 2 numbers
int min(int a, int b){// Parameters -> placeholders for values to be passed in
if (a < b)
{
return a;
} else {
return b;
}
}
// sum of n nums
i... | ALGO | 0.993387 | 3.669984 |
0fb0275c-f105-4b81-be5c-613f012bfb90 | Sarvesh069/October-LC-Daily | majorityElementII.cpp | #include<bits/stdc++.h>
using namespace std;
vector<int> usingOptimalSolution(vector<int>& nums){
//Using maps
map<int,int> mp;
vector<int>res;
int mini = (int)(nums.size()/3)+1;
for(int i=0;i<nums.size();i++){
mp[nums[i]]++;
}
for(auto it = mp.begin(); it != mp.end(); it++){
... | ALGO | 0.999978 | 5.242134 |
b5e5b6fd-34ee-42ea-aba3-03825334366b | ishandutta2007/codeforces | ezladder/normal/1428/B.cpp | #include <bits/stdc++.h>
#define ll long long
#define db long double
#define x first
#define y second
#define mp make_pair
#define pb push_back
#define all(a) a.begin(), a.end()
using namespace std;
void solve() {
string s;
cin >> s >> s;
int w1 = 0, w2 = 0;
for (int i = 0; i < s.size(); ++i) {
char c = s[i];
... | ALGO | 0.999726 | 3.864037 |
3bb9cce4-ee35-4adb-88fc-b590cbd4a563 | taow-com-prog/problemsolving | Hackerearth/HACKER make-n00b_land-great-again-circuits.cpp | /*
parallel binary search and euler tour on tree
*/
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
int inf_int=1e9;
ll inf_ll=1e18;
typedef pair<int,int> pii;
typedef pair<ll,ll> pll;
#define pb push_back
const double pi=3.1415926535898;
#define dout if(debug) cou... | ALGO | 0.99999 | 3.786737 |
9bfa7c93-5a5f-47d0-82dd-5401bf035017 | VadVergasov/OlympTasks | Google/CodeJam/2019/Round 1B/Fair Fight/main.cpp | using namespace std;
class SegTree() {
vector<long long> tree;
void build(int v, int tl, int tr) {
if (tl == tr) {
tree[v] = a[tl];
} else {
int tm = (tr + tl) >> 1;
build((v << 1), tl, tm);
build((v << 1) + 1, tm + 1, tr);
tree[v] = ... | ALGO | 0.999542 | 4.417486 |
2175eca2-364e-446c-bc0d-240d7bf252c9 | Tittanc/Reponame | UnacademyCourse/GreedyOct/Lecture6/huffmanc.cpp | // Problem Link -
/* By Sanket Singh */
#include<bits/stdc++.h>
//#include<ext/pb_ds/assoc_container.hpp>
//#include<ext/pb_ds/tree_policy.hpp>
//#include <ext/pb_ds/trie_policy.hpp>
//using namespace __gnu_pbds;
#define ll long long int
#define ld long double
#define mod 1000000007
#define inf ... | ALGO | 0.999946 | 3.686253 |
360a130a-d428-4871-affd-63707619f192 | parthlathiya12/Codechef-Submissions | 17_9_SEPT17/test.cpp | #include <bits/stdc++.h>
using namespace std;
int main()
{
freopen("test_in.txt","r",stdin);
int a[10];
for(int i=0;i<10;i++)
cin>>a[i];
for(int i=0;i<10;i++)
{
int temp=0;
while(temp<i && a[temp]<=a[i])temp++;
int idx=i;
int cur_ele=a[i];
while(idx!=temp){
a[idx]=a[idx-1];
idx--;
}
a[t... | ALGO | 0.99988 | 3.468857 |
6ac7a28b-16a2-4523-972f-b5b23111b605 | ishandutta2007/codeforces | abeker/normal/650/D.cpp | #include <cstdio>
#include <cstring>
#include <algorithm>
#include <vector>
using namespace std;
const int MAXN = 400005;
struct fenwick {
int pref[2 * MAXN];
int suff[2 * MAXN];
fenwick() {
memset(pref, 0, sizeof pref);
memset(suff, 0, sizeof suff);
}
void update_pref(int x, int v... | ALGO | 0.999985 | 4.046096 |
7b4c5877-9f5e-4659-9aa0-cd5216cc04b8 | ayushkrrana/DSA-problems | 2107-find-unique-binary-string/2107-find-unique-binary-string.cpp | class Solution {
public:
string findDifferentBinaryString(vector<string>& nums) {
int n = nums.size();
string result = "";
// Constructing the unique binary string
for (int i = 0; i < n; i++) {
result += (nums[i][i] == '0') ? '1' : '0';
}
... | ALGO | 0.999816 | 6.764574 |
52c93343-13f7-4dab-b200-a1cc32e63267 | ufz/ogs | Applications/Utils/GeoTools/addDataToRaster.cpp | #include <tclap/CmdLine.h>
#include <algorithm>
#include <cmath>
#include <memory>
#include <numbers>
#include <numeric>
#include "BaseLib/MPI.h"
#include "GeoLib/AABB.h"
#include "GeoLib/IO/AsciiRasterInterface.h"
#include "GeoLib/Point.h"
#include "GeoLib/Raster.h"
#include "InfoLib/GitInfo.h"
double compute2DGaus... | ALGO | 0.95057 | 7.798653 |
d6bc6f42-0acb-47ef-bdf8-dbb73b5416ee | sakshi-06/Leetcode-daily-tasks | 24-swap-nodes-in-pairs/24-swap-nodes-in-pairs.cpp | /**
* Definition for singly-linked list.
* struct ListNode {
* int val;
* ListNode *next;
* ListNode() : val(0), next(nullptr) {}
* ListNode(int x) : val(x), next(nullptr) {}
* ListNode(int x, ListNode *next) : val(x), next(next) {}
* };
*/
class Solution {
public:
ListNode* swapPairs(L... | ALGO | 0.999997 | 5.831902 |
4f8838a5-9f0a-43f0-8328-932857997ba5 | oxygen-hunter/Flashboom | data/big-vul-100/add_attention_code/Mixtral/top0-100/high-access-employees-Solution.findHighAccessEmployees/177742_DoS_Overflow.cpp | gnutls_session_get_data (gnutls_session_t session,
void *session_data, size_t * session_data_size)
{
gnutls_datum_t psession;
int ret;
if (session->internals.resumable == RESUME_FALSE)
return GNUTLS_E_INVALID_SESSION;
psession.data = session_data;
ret = _gnutls_session_pack (s... | TOOL | 0.931457 | 4.026489 |
cf81b584-8623-4da0-bdb5-6685ab126ac0 | C5Hwang/Online-Judge-Solutions | BZOJ/BZOJ4516.cpp | #include <map>
#include <stdio.h>
#include <stdlib.h>
#define ll long long
#define DEBUG printf("Passsing [%s] in Line %d\n" , __FUNCTION__ , __LINE__) ;
const int MAX_N = 1e5 + 10 ;
struct Node {
int len ;
Node *link ;
std::map<int , Node*> next ;
}sam[MAX_N << 1] ;
ll ans ;
Node *last ;
int n , tot ;
void ext... | ALGO | 0.999741 | 3.679102 |
7106ad1e-c2f3-428a-a009-09b6c53cd55f | 5ko99/FMI-Semester-3 | Seminar/DoubleLinkedList/main.cpp | #include <iostream>
#include <list>
#include <string>
using namespace std;
bool palindrome(list<char> & l){
auto bit=l.end();
bit--;
auto fit=l.begin();
while(bit != fit && next(bit) != fit){
if(*bit != *fit){
return false;
}
bit--;
fit++;
}
return tru... | ALGO | 0.999781 | 3.55408 |
f353e1d4-55e6-40a7-89db-69c9b56cce13 | aman-anand-hub/DSA-HUB | LINKED LIST/mergetwosortedLL.cpp | #include<bits/stdc++.h>
using namespace std;
struct node
{
int data;
node *next;
};
void printlist(node *head)
{
while (head)
{
cout<<head->data<<"->";
head= head->next;
}
cout<<endl;
}
void push(node **head, int data)
{
node *new_node= new node();
new_node->data= dat... | ALGO | 0.999972 | 4.739445 |
4e5d7ea4-a9eb-4a94-aef5-01f82a2c7331 | Siddhant131/programs | c++/sum_row_col.cpp | #include<iostream>
using namespace std;
int main()
{
int r,c;
cout<<"enter rows and columns: ";
cin>>r>>c;
int arr[r][c];
cout<<"enter elements:"<<endl;
for(int i=0;i<r;i++)
{
for(int j=0;j<c;j++)
{
cin>>arr[i][j];
}
}
int sum=0;
for(int i=0;i<... | ALGO | 0.999035 | 3.777708 |
f77340cb-cc00-49e3-b1aa-a4549cd128cd | ashnove/cp-submissions | codeforces/609/C.cpp | /*@author : ashnove*/
#include <bits/stdc++.h>
using namespace std;
#define ll long long int
#define lld long double
#define F first
#define S second
#define endl "\n"
#define nl cout<<endl;
#define pb push_back
#define f(i,a,b) for(ll i=a;i<b;i++)
#define mat vector<vector<ll>>
mat cn(ll n, ll m){return vector< vector... | ALGO | 0.999952 | 3.942064 |
2f721e19-e543-44df-ac00-a7e9aa315293 | zhangshiyun/LAMMPS_STABLE | LAMMPS_STABLE/fix_ave_spatial.cpp | /* ----------------------------------------------------------------------
Contributing author: Pieter in 't Veld (SNL)
------------------------------------------------------------------------- */
#include "stdlib.h"
#include "string.h"
#include "unistd.h"
#include "fix_ave_spatial.h"
#include "atom.h"
#include "upd... | TOOL | 0.883573 | 5.05276 |
7c85de41-7e69-4050-95b8-5dd08c087d90 | SkyFire/sandshroud | Trunk/src/hearthstone-shared/Pathfinding/Detour/DetourCommon.cpp | #include <math.h>
#include "DetourCommon.h"
//////////////////////////////////////////////////////////////////////////////////////////
float dtSqrt(float x)
{
return sqrtf(x);
}
void dtClosestPtPointTriangle(float* closest, const float* p,
const float* a, const float* b, const float* c)
{
// Check if P in... | ALGO | 0.999855 | 7.103926 |
d353a79f-2464-47e9-bc39-e46d4018fea2 | Rashed112/LeetCode-Solutions | solutions/1903_largest_odd_number_in_string.cpp | class Solution {
public:
string largestOddNumber(string num) {
for(int i=num.size()-1;i>=0;i--){
int val = num[i]-'0';
if(val%2){
return num.substr(0,i+1);
}
}
return "";
}
};
| ALGO | 0.999929 | 6.16179 |
e1228727-0cd5-4bf4-81ab-fafaf70b4d9b | muhammadhasan01/cp | Online Judge/Codeforces/Contests/EDU-DIV2/EDU-DIV2-77/C.cpp | #include <bits/stdc++.h>
using namespace std;
int tc;
long long r, b, k;
int main() {
ios_base::sync_with_stdio(0);
cin.tie(0);
cout.tie(0);
cin >> tc;
while (tc--) {
cin >> r >> b >> k;
if (r > b) swap(r, b);
long long g = __gcd(r, b);
cout << (r * (k - 1LL) + g ... | ALGO | 0.999808 | 4.430619 |
6fb8fe4b-857f-4b49-8083-f7c743193633 | SamuellH12/Competitive-Programming-Algorithms | Solutions/Beecrowd/1152 - Estradas Escuras.cpp | #include <bits/stdc++.h>
#define optimize ios::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL)
#define ALL(x) x.begin(), x.end()
#define endl "\n"
#define ll long long
#define vi vector<int>
#define pii pair<int,int>
#define MAXN 110
#define INF 0x3f3f3f3f
#define debug cout<<"ate aqui ok\n"
using namespace std;
... | ALGO | 0.999948 | 4.279638 |
796da1a1-09b8-427f-affe-bca097f83632 | darkwuta/-CSC417-Assignment | Assignment3/extern/libigl/tutorial/306_EigenDecomposition/main.cpp | #include <igl/eigs.h>
#include <igl/cotmatrix.h>
#include <igl/massmatrix.h>
#include <igl/opengl/glfw/Viewer.h>
#include <igl/parula.h>
#include <igl/read_triangle_mesh.h>
#include <Eigen/Sparse>
#include <iostream>
#include <queue>
#include "tutorial_shared_path.h"
Eigen::MatrixXd V,U;
Eigen::MatrixXi F;
int c=0;
do... | ALGO | 0.993898 | 4.296738 |
ecdb66d9-ded9-47c0-a3e2-c39f02218ce2 | Haceau-Zoac/grokking-algorithms | 05.散列表/voted.cpp | #include <iostream>
#include <string_view>
#include <unordered_map>
std::unordered_map<std::string_view, bool> voted{};
auto check_voted(std::string_view name) -> void {
if (voted.find(name) != voted.end()) {
std::cout << "kick them out!\n";
} else {
voted[name] = true;
std::cout << "let them vote!\n"... | ALGO | 0.997483 | 5.391356 |
6d200c16-169f-4c31-b4d6-a6d2d4865486 | himanshusisodiya6377/DSA-QUESTIONS | 0085-maximal-rectangle/0085-maximal-rectangle.cpp | class Solution {
public:
//presmall
//nextsmall
int solve(vector<int>&heights){
int n=heights.size();
vector<int>pre(n,-1);
vector<int>next(n,n);
stack<int>presm;
presm.push(0);
for(int i=1;i<n;i++){
while(presm.size()>0 && heights[presm.top()]>=... | ALGO | 0.999989 | 6.23737 |
4cc4b373-cb49-4b06-9fc9-6661c8f7a098 | leafeonia/leetcode | C++/code/146.cpp | class LRUCache {
public:
struct Node{
int key, value;
Node* prev;
Node* next;
Node(): key(0), value(0), prev(nullptr), next(nullptr) {}
Node(int k, int v): key(k), value(v), prev(nullptr), next(nullptr) {}
};
LRUCache(int capacity) {
cap = capacity;
s... | ALGO | 0.999567 | 6.200704 |
98e28bc1-32f5-494d-8584-5d4dce7b119f | gist-icpc/baekjoon | 10942/10942.cpp | #include <cstdio>
#include <iostream>
long d[2001];
int dp[2001][2001];
int ask(int s, int e) {
if(dp[s][e] > -1)
return dp[s][e];
if (d[s]!=d[e]) {
//numbers don't match
dp[s][e] = 0;
} else if (e-s == 1) {
//same numbers, next to each other
dp[s][e] = 1;
} else {
//make further enquiry
dp[s][e] ... | ALGO | 0.999876 | 3.843422 |
e204d822-169f-45df-b808-6fae19e6c5f5 | justrepo/graphRenderer | Graph.cpp | //
// Created by nikita on 7/16/20.
//
#include "Graph.h"
#include <random>
#include <fstream>
using std::mt19937;
using std::uniform_int_distribution;
using std::random_device;
using std::to_string;
using std::make_shared;
using std::ofstream;
using std::ifstream;
using std::endl;
Graph::~Graph() = default;
void G... | ALGO | 0.955162 | 5.386369 |
6255fd7c-ba82-4c49-8da5-5fddbea12614 | jorgektch/codeforces-solutions | codeforces-round-0871-div4/a.cpp | #include <bits/stdc++.h>
using namespace std;
int main(){
int n; cin >> n;
string cad="codeforces";
for(int i=0; i<n; i++){
int count=0;
string s; cin >> s;
for(int j=0; j<s.size(); j++){
if(s[j]!=cad[j]) count++;
}
cout << count << endl;
}
return 0;
}
| ALGO | 0.999636 | 4.123763 |
480386ed-9765-4e50-8c7c-ecd8a85cf12a | AKMofficial/Daleel | windows/runner/utils.cpp | void CreateAndAttachConsole() {
if (::AllocConsole()) {
FILE *unused;
if (freopen_s(&unused, "CONOUT$", "w", stdout)) {
_dup2(_fileno(stdout), 1);
}
if (freopen_s(&unused, "CONOUT$", "w", stderr)) {
_dup2(_fileno(stdout), 2);
}
std::ios::sync_with_stdio();
FlutterDesktopResyncO... | TOOL | 0.998727 | 6.203655 |
0941ff6d-b968-4724-adae-f908fec4626c | kantuni/Kattis | dicegame.cpp | #include <iostream>
using namespace std;
int main() {
int a1, a2, a3, a4;
int b1, b2, b3, b4;
cin >> a1 >> b1 >> a2 >> b2;
cin >> a3 >> b3 >> a4 >> b4;
int gmin = a1 + a2;
int gmax = b1 + b2;
int emin = a3 + a4;
int emax = b3 + b4;
if (gmin > emax) {
cout << "Gunnar" << endl;
} else if (emin > ... | ALGO | 0.999991 | 4.79853 |
85deca2b-d878-46dc-9613-dbe0a72d11ac | NANDISHSHAH/CodingQuestions | 1. Activity Selection - GFG/1.-activity-selection.cpp | // { Driver Code Starts
#include<bits/stdc++.h>
using namespace std;
// } Driver Code Ends
class Solution
{
public:
//Function to find the maximum number of activities that can
//be performed by a single person.
int activitySelection(vector<int> start, vector<int> end, int n)
{
// Your co... | ALGO | 0.999935 | 5.976579 |
2007040d-df6e-4e97-8bf0-a59f28433a06 | Lqs66/llvm-16.0.4 | libcxx/test/std/algorithms/alg.modifying.operations/alg.rotate/rotate_copy.pass.cpp | // <algorithm>
// template<ForwardIterator InIter, OutputIterator<auto, InIter::reference> OutIter>
// constexpr OutIter // constexpr after C++17
// rotate_copy(InIter first, InIter middle, InIter last, OutIter result);
#include <algorithm>
#include <cassert>
#include "test_macros.h"
#include "test_iter... | TEST | 0.97712 | 7.417317 |
7dbe19fa-515c-4ca5-ab71-15fed3afd85f | erictsaii/leetcode-practice | 1277_Count_Square_Submatrices_with_All_Ones.cpp | class Solution {
public:
int countSquares(vector<vector<int>>& matrix) {
int m = matrix.size();
int n = matrix[0].size();
vector<vector<int>> dp(m, vector<int>(n, 0));
for (int i = 0 ; i < m; i++) {
for (int j = 0; j < n; j++) {
if (matrix[i][j] == 1) {
... | ALGO | 0.999646 | 6.118443 |
a06e0c15-fcd8-4ccf-ba27-0caaee4cb2e8 | saif1642/Competitive-Programming-Solving | string_bonacci.cpp | #include<bits/stdc++.h>
using namespace std;
#define ll long long
vector <string> dp[80];
string fn( int n ) {
if( n == 0 ) {
dp[0]="a";
return dp[0];
}
if( n == 1 ) {
dp[1]="b";
return dp[1];
}
if(dp[n]!=-1)
return dp[n];
else{
dp[n]=f(n-2)+f(n-1... | ALGO | 0.999479 | 3.504107 |
86b89076-3564-423f-9cbf-9b2f996bb990 | StevenL2017/Codeforces | problem/archive/1758/1758C.cpp | #include <iostream>
#include <cstdio>
#include <climits>
#include <cmath>
#include <cstring>
#include <string>
#include <array>
#include <vector>
#include <stack>
#include <queue>
#include <deque>
#include <set>
#include <map>
#include <bitset>
#include <numeric>
#include <algorithm>
#include <functional>
using namesp... | ALGO | 0.999788 | 4.445661 |
e1601d6c-6c55-44f1-b9d7-109c9f1881c7 | Cytin7/ZJUI-CS225-SP22-D7 | Ass9_Ex3&4_bigraph/BiGraph/main.cpp | #include <iostream>
using namespace std;
#include "BiGraph.h"
#include "BiGraph.cpp"
#include "DiGraph.h"
#include "DiGraph.cpp"
#include "queue.h"
int main() {
/*
// testing the insertion of the vertices.
DiGraph<int,char> graph;
BiVertex<int,char>* a = new BiVertex<int,char>;
a->value = 'a';
... | ALGO | 0.994268 | 4.768461 |
2fe9e3e6-578e-4675-a5ae-3b7133a65b78 | acidentally/cplusplus | CodeForces Problems/1804A.cpp | /*TRYING SO HARD LEARNING HOW TO CODE
APPARENTLY I SUCK */
#include <bits/stdc++.h>
using namespace std;
#define int long long
#define fi first
#define se second
#define vi vector<int>
#define vvi vector< vector<int> >
#define endl '\n'
#define fr(i,a,b) for(int i = a; i < b; i++)
#define f(i,a) for(int i = 0; i < a... | ALGO | 0.999529 | 4.884437 |
2debf0bc-e114-436d-b1d8-f57afdb3e562 | yapatta/ant_book | 3/2/big_knapsack.cpp | #include <bits/stdc++.h>
using namespace std;
using ll = long long;
const ll INF = 1e14;
const int MAX_N = 45;
int n;
ll w[MAX_N], v[MAX_N];
ll W;
pair<ll,ll> ps[1 << (MAX_N / 2)]; // 重さ, 価格
void input() {
cin >> n;
for(int i=0;i<n;i++) {
cin >> w[i] >> v[i];
}
cin >> W;
}
void solve() {
int n2 = n / 2;
for(... | ALGO | 0.999909 | 4.027514 |
2429f3a6-9b3a-47e8-a1c2-03a914ec642c | lva98/CAL | trab1/sort.cpp | #include <bits/stdc++.h>
#include "sort.h"
using namespace std;
#define MIN(x, y) (x<y)?x:y
#define MAX(x, y) (x>y)?x:y
#define INF 0x3f3f3f3f
namespace sort {
//PRIVATE
namespace {
auto start = std::chrono::high_resolution_clock::now();
void swap(long long &a, long long &b){
long... | ALGO | 0.999583 | 4.50724 |
a223dc83-ab2b-40de-b47b-19f7c21af1d5 | sinian666/code_102_5 | 1cpp_副本/chapter_stack_and_queue/stack.cpp | /**
* File: stack.cpp
* Created Time: 2022-11-28
* Author: qualifier1024 (<EMAIL>)
*/
#include "../utils/common.hpp"
/* Driver Code */
int main() {
/* 初始化栈 */
stack<int> stack;
/* 元素入栈 */
stack.push(1);
stack.push(3);
stack.push(2);
stack.push(5);
stack.push(4);
cout << "栈 sta... | TOOL | 0.898775 | 5.428926 |
fe059d02-cda8-429b-9218-3f6d92a302e2 | Akm007git/Coding-questions | 0540-single-element-in-a-sorted-array/0540-single-element-in-a-sorted-array.cpp | class Solution {
public:
int singleNonDuplicate(vector<int>& nums) {
int ans = nums[0];
for(int i=1;i<nums.size();i++)
{
ans = ans ^ nums[i];
}
return ans;
}
}; | ALGO | 0.999948 | 5.790319 |
8446d944-7444-484a-9bdf-f27a83f8862d | itsmesaadali/My-Project-in-C- | Bookmanagementsyste..cpp | #include<iostream>
#include<string>
#include<iomanip>
#include<cctype>
using namespace std;
// Books structure
struct Book
{
string title;
string author;
string isbn;
string genre;
bool available;
};
Book* bookArray = new Book[1]; // Array to store books, initially with size 1
int numbooks = 0; //... | TOOL | 0.856202 | 5.900143 |
775c9b8f-4447-49a5-81c2-04a3a5758a2a | mmmhj2/code-competitive | CodeForces/55D/9644866_AC_654ms_21828kB.cpp | #include<iostream>
#include<cstring>
using namespace std;
int const MOD = 2520;
typedef long long int i64;
int hashTable[2525];
i64 dp[20][50][2525];
int ndiv[20];
i64 gcd(i64 a, i64 b){
return (b ? gcd(b, a%b) : a);
}
int Hash(){
int num = 0;
for(int i = 1; i <= MOD; i++){
if(MOD % i == 0)
hashTable[i] = n... | ALGO | 0.999444 | 4.360651 |
2e58c4c7-e730-4f1b-b13e-912f3bb64f80 | GalaxyNET/Dragomir-Sotirov | STL/3/main.cpp | #include <iostream>
#include <string>
#include <vector>
#include <list>
#include <stack>
using namespace std;
int main()
{
cout << "0 (Zero) Terminates:" << endl;
stack<int> integers;
int number = 1;
while (number != 0)
{
if (number < 0)
{
cerr << "Error! Number is below Zero (0)." << endl;
cerr << "T... | ALGO | 0.98291 | 4.842073 |
c24fe234-57c3-4160-99b2-ba0cff3ad036 | ryanj64/CarND_Path_Planning_Project | src/Eigen-3.3/doc/examples/DenseBase_middleRows_int.cpp | #include <Eigen/Core>
#include <iostream>
using namespace Eigen;
using namespace std;
int main(void)
{
int const N = 5;
MatrixXi A(N,N);
A.setRandom();
cout << "A =\n" << A << '\n' << endl;
cout << "A(2..3,:) =\n" << A.middleRows(2,2) << endl;
return 0;
}
| ALGO | 0.85259 | 3.307581 |
3b04890c-4da2-4f98-ba77-f9b69bf07795 | Code-Mars/LeetCode | 0689-maximum-sum-of-3-non-overlapping-subarrays/0689-maximum-sum-of-3-non-overlapping-subarrays.cpp | class Solution {
public:
int m;
vector<vector<string>>dp;
int get(string&s, vector<int>&v){
int ans=0;
string num="";
stringstream ss(s);
while(ss>>num){
ans+=v[stoi(num)];
}
return ans;
}
string solve(int idx, int k, vector<int>&v, int cnt... | ALGO | 0.999941 | 5.163356 |
6e378a30-cf8c-44eb-87b9-7d17ee2286d9 | uxdxdev/bullet-dominos | Bullet/Demos/SoftDemo/SoftDemo.cpp | ///btSoftBody implementation by Nathanael Presson
#include "btBulletDynamicsCommon.h"
#include "BulletSoftBody/btSoftRigidDynamicsWorld.h"
#include "BulletCollision/CollisionDispatch/btSphereSphereCollisionAlgorithm.h"
#include "BulletCollision/NarrowPhaseCollision/btGjkEpa2.h"
#include "LinearMath/btQuickprof.h"
#in... | ALGO | 0.97783 | 5.376619 |
26b015c1-e6b8-4eea-8a22-ec5643bd8b16 | kip-codes/cpp-sandbox | Maze Generation/Maze.cpp | #include "Maze.h"
#include "Cell.h"
/* CMaze()
*/
CMaze::CMaze(int numRows, int numColumns) : maxVal(numRows*numColumns)
{
// STEP 1: Create the nodes in their own equivalence class.
for (int i = 0; i < maxVal; i++){
s.push_back(-1);
CCell ccell;
cells.push_back(ccell);
cells[i].SetLabel(i);
... | ALGO | 0.994391 | 4.938237 |
3c5dc32c-98b8-4f58-bbdc-ed97f173cdfb | adarshroy001/LeetPush | Capacity-To-Ship-Packages-Within-D-Days.cpp | class Solution {
public:
int shipWithinDays(vector<int>& weights, int days) {
int mini = INT_MIN ;
int maxi = 0 ;
for(int &weight: weights ){
mini = max(mini,weight) ;
maxi += weight ;
}
int low = mini , high = maxi ;
while (high>=low){
... | ALGO | 0.999991 | 5.696268 |
b09c2b20-7e94-4cbf-9066-bd2276f8eaea | mvg01/ps | baekjoon cpp/10974(backtracking).cpp | #include <iostream>
#include <vector>
using namespace std;
int n;
int a[8];
int v[8] = { 0 };
void bt(int cnt) {
if (cnt == n) {
for (int i = 0; i < n; i++)
cout << a[i] << ' ';
cout << '\n';
return;
}
for (int i = 0; i < n; i++) {
if (!v[i]) {
a[cnt] = i + 1;
v[i] = 1;
bt(cnt + 1);
v[i] = 0;... | ALGO | 0.999752 | 3.965216 |
f603a1a0-4f56-4b84-a1b7-00e8de3ac4b2 | Upadhyayayush30/LeetCode-Solutions | 1250-longest-common-subsequence/longest-common-subsequence.cpp | class Solution {
public:
int lcs(int i, int j, string & text1, string & text2, vector < vector < int >> & dp) {
if (i == 0 || j == 0) {
return 0;
} else if (dp[i][j] != -1) {
return dp[i][j];
} else if (text1[i - 1] == text2[j - 1]) {
int length = lcs(i - 1, j - 1, text1, text2, d... | ALGO | 0.999951 | 6.146034 |
b8544e9e-71f2-4918-b82d-3bdd604d6c14 | sidraj2002/LinuxTools | fork2/src/LinkList.cpp | /*
* LinkList.cpp
*
* Created on: Feb 22, 2016
* Author: ubuntu
*/
/*
Meant for Practice/ Educational Purposes
Author: Siddharth Rajguru
Purpose: Linked List manipulation and creation
*/
#include <stdio.h>
#include <stdlib.h>
#include <iomanip>
#include <iostream>
#include <cstdlib>
#include <string>
using... | ALGO | 0.997872 | 3.734462 |
0a0e018c-2268-473c-9732-f297b149367f | novaHardware/segmentation | CameraCalibration/cameraCalibrationWithUndistortion.cpp | #include <opencv2/opencv.hpp>
#include <opencv2/calib3d/calib3d.hpp>
#include <opencv2/highgui/highgui.hpp>
#include <opencv2/imgproc/imgproc.hpp>
#include <stdio.h>
#include <iostream>
// Defining the dimensions of checkerboard
int CHECKERBOARD[2]{6,9};
int main()
{
// Creating vector to store vectors of 3D point... | TOOL | 0.996699 | 5.124582 |
7196a378-1e3c-46d2-ba69-cab6f188cd86 | apletea/MMF_Labs | C++ 1 course/3.zolotoesechenie.cpp | #include <iostream>
#include <clocale>
#include <iomanip>
using std::endl;
using std::cout;
using std::cin;
using std::setw;
using std::setfill;
using std::setprecision;
using std::fixed;
using std::right;
// Покажите к чему стремится отношение соседних чисел Фибоначчи.
int main()
{ setlocale(LC_ALL,"Russian");
... | ALGO | 0.999539 | 3.638156 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.