uuid string | repo_name string | relative_path string | content string | category string | algo_rel_score float64 | quality_score float64 |
|---|---|---|---|---|---|---|
d2344232-ccf6-4049-837c-ad96b41e71eb | anagorko/zpk2014 | home/mzwierz/z1/sto.cpp | #include <iostream>
using namespace std;
int main(){
int A, B, K;
cin>>A>>B>>K;
int liczba =0;
int bok_1=A/K;
int bok_2=B/K;
if(bok_1<1 && bok_2<1){
liczba=0;
}
if(bok_1>2 && bok_2>2){
liczba = bok_1*bok_2;
liczba = liczba - (bok_1-2)*(bok_2-2);
}
else{
liczba = bok_1*bok_2;
}
cout<<liczba;
}
| ALGO | 0.999885 | 3.822806 |
2b22e5cd-aa84-4b63-90fd-2c911bceb5c5 | JRgit03/Algorithm | atcoder/abc/323/C_World_Tour_Finals.cpp | #include <bits/stdc++.h>
#define IOS ios::sync_with_stdio(false);cin.tie(nullptr);cout.tie(nullptr);
using namespace std;
typedef long long ll;
void solve(){
int n,m; cin>>n>>m;
vector<int> score(m),id(m);
for(int i=0;i<m;i++) {
id[i] = i; cin>>score[i];
}
sort(id.begin(),id.end(),[&](i... | ALGO | 0.999806 | 4.320581 |
debc9507-dcb1-41bb-857a-37037ff8e38b | RedwanPlague/cses_problems | Sorting-and-Searching/Distinct-Numbers.cpp | // https://cses.fi/problemset/task/1621/
#include <iostream>
#include <set>
using namespace std;
typedef long long ll;
int main () {
ios_base::sync_with_stdio(false); cin.tie(nullptr);
int n;
cin >> n;
set<int> st;
for (int i=0; i<n; i++) {
int a;
cin >> a;
st.insert(a);... | ALGO | 0.999251 | 4.492307 |
151f6ffb-e953-4620-9a01-6015fec3e132 | my2universe/Swordoffer | 剑指offer/Fibonacci.cpp |
class Solution {
public:
int Fibonacci(int n) {
if (n <= 0)
return 0;
if (n == 1)
return 1;
int first=0,second=1,third = 0;
for (int i=2;i<=n;i++)
{
third = first + second;
first = second;
second = third;
}
return third;
}
}; | ALGO | 0.999994 | 5.910031 |
ef0729f0-7f43-4a5f-a321-89f45acc57db | ishandutta2007/codeforces | natsugiri/normal/150/B.cpp | #include<cstdio>
#define MOD 1000000007
typedef long long LL;
LL powMod(LL x,int y,LL mod){
if(y<1)return 1;
if(y%2)return x*powMod(x,y-1,mod)%mod;
return powMod(x*x%mod,y/2,mod);
}
int main(){
int n,m,k;
scanf("%d%d%d",&n,&m,&k);
if(k==1 || k>n){
printf("%d\n",(int)powMod(m,n,MOD));
}else if(n==k)... | ALGO | 0.999995 | 3.98223 |
fcb0b664-6905-41de-b348-6ca995e6c808 | deepin-community/wpewebkit | Source/ThirdParty/skia/src/utils/SkParsePath.cpp | #include "include/core/SkPath.h"
#include "include/core/SkPoint.h"
#include "include/core/SkScalar.h"
#include "include/core/SkStream.h"
#include "include/core/SkString.h"
#include "include/core/SkTypes.h"
#include "include/utils/SkParse.h"
#include "include/utils/SkParsePath.h"
#include "src/core/SkGeometry.h"
#inclu... | TOOL | 0.962197 | 7.398327 |
57394529-0237-48a5-b721-415c713e5c1b | Shantanu221/Leetcode_solutions | Dynamic_Programming/2.coin_change.cpp | class Solution {
public:
int coinNum(vector<int>& coins,int amount,vector<int> &dp){
if(amount<0) return INT_MAX;
if(amount==0) return 0;
if(dp[amount]!=-1) return dp[amount];
int best=INT_MAX;
for(auto x:coins){
if(coinNum(coins,amount-x,dp)!=INT_MAX)
... | ALGO | 0.999969 | 5.827103 |
590085c8-5852-4b86-8307-9702e5f939b7 | jianjin33/Leetcode | 173.二叉搜索树迭代器.cpp | /*
* @lc app=leetcode.cn id=173 lang=cpp
*
* [173] 二叉搜索树迭代器
*/
// @lc code=start
/**
* Definition for a binary tree node.
* struct TreeNode {
* int val;
* TreeNode *left;
* TreeNode *right;
* TreeNode(int x) : val(x), left(NULL), right(NULL) {}
* };
*/
#include <vector>
using namespace st... | ALGO | 0.999976 | 6.639125 |
9c5edaf8-7173-4d52-a300-39c1fa93e605 | soham6125/Competitive-Programming | Atcoder/AtCoder Beginner Contest 209/A.cpp | #include <bits/stdc++.h>
#define ll long long int
#define loop(a,b,i) for(long long int i=a;i<b;i++)
#define loopr(a,b,i) for(long long int i=a;i>=b;i--)
#define cn continue;
#define pb push_back
#define db double
#define mp make_pair
#defi... | ALGO | 0.999789 | 4.028838 |
4dfddf75-3b2f-4701-a2ee-dc77300a92b9 | himTresor1/cpp_exercises | Question5.cpp | #include <iostream>
#include <math.h>
using namespace std;
int main(){
float volume;
float pi= 3.14;
float radius;
cout<< "Please enter radius of the sphere";
cin>>radius;
volume =(4/3)*pi*radius;
cout<< "The volume is : " << volume<<endl;
return 0;
}
| ALGO | 0.956409 | 3.438507 |
05e3e963-ee86-4b0c-9b9f-f4d9c0410ad3 | kelchuri/CPrograms | reverse_sentence/reverse_sentence/reverse_sentence.cpp | // reverse_sentence.cpp : Defines the entry point for the console application.
//
#include "stdafx.h"
#include "malloc.h"
void reverse(char *start,char *end)
{
char letter;
while(start<end)
{
letter=*start;
*start++=*end;
*end--=letter;
}
}
char* reverse_words(char *input)
{
if(input == ... | ALGO | 0.998004 | 3.932392 |
604d4e21-cac2-4a1d-b2dc-6ce483aa55d8 | 22satnam/Leetcode | 2671-frequency-tracker/2671-frequency-tracker.cpp | #include<unordered_map>
class FrequencyTracker {
public:
unordered_map<int,int>map;
unordered_map<int,int>frequency;
FrequencyTracker() {
}
void add(int number) {
int oldfrequency=map[number];
int newfrequency=++map[number];
frequency[oldfrequency]--;
fr... | ALGO | 0.998944 | 6.070256 |
326c9094-0a47-47ae-bd23-a0d134786905 | Kamrul101/cpp_practice | Bit manipulation/petrAndACombinationLockCF.cpp | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef long double ld;
#define optimize() ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);
#define endl "\n"
#define MOD 1000000007
#define mem(a,b) memset(a, b, sizeof(a) )
const int mx =20;
int a[mx];
int main() {
optimize();
int n;
... | ALGO | 0.999949 | 3.746713 |
29325a4a-ed3f-4aa2-a1c6-a4c1271c92be | Shwet310/LeetCode__Practice | 2958-length-of-longest-subarray-with-at-most-k-frequency/2958-length-of-longest-subarray-with-at-most-k-frequency.cpp | class Solution {
public:
int maxSubarrayLength(vector<int>& nums, int k) {
int ans=0;
unordered_map<int,int>mp;
int n=size(nums);
for(int l=0,r=0;r<n;r++){
mp[nums[r]]++; //inserting value in window from right
//if newly inserted element exceed frequencey poped ... | ALGO | 0.999958 | 6.210455 |
c992e95e-451c-49fc-a8f8-577e31605532 | Wastams/UB-ANC-Agent | apm_planner/libs/qwt/qwt_math.cpp | // vim: expandtab
#include "qwt_math.h"
/*!
\brief Find the smallest value in an array
\param array Pointer to an array
\param size Array size
*/
double qwtGetMin(const double *array, int size)
{
if (size <= 0)
return 0.0;
double rv = array[0];
for (int i = 1; i < size; i++)
rv = qw... | ALGO | 0.999599 | 4.917202 |
6bf63a9e-81c0-4cf7-9fb0-652aec735f60 | Md-Noman-Biswas/Codeforces_problems | B_Lecture.cpp | #include<bits/stdc++.h>
using namespace std;
#define ll long long
#define nl "\n"
#define YES cout << "YES\n"
#define NO cout << "NO\n"
#define pb push_back
#define mod 1000000007
const int N = 1e5 + 7;
void solve(){
ll n, m;
cin >> n >> m;
map<string, string> mp;
for(int i=0; i<m; i++){
string... | ALGO | 0.999986 | 4.496162 |
f0e3a441-9b17-48bc-8fb5-bb23c16cf782 | adikul30/competitive-programming | codechef/FLOW017.cpp | #include <iostream>
using namespace std;
int main() {
int a,b,c,t;
cin>>t;
while(t>0){
cin>>a>>b>>c;
if(a>b&&a>c){
if(b>c)
cout<<b<<endl;
else
cout<<c<<endl;
}
else if(b>c&&b>a){
if(a>c)
cout<<a<<endl;
else
cout<<c<<endl;
}
else if(c>b&&c>a){
if(a>b)
cout<<a<<endl;
e... | ALGO | 0.999973 | 3.659554 |
d4367d7c-e3e0-4131-bc11-7e4250bc3fb7 | Farid4hmed/-CrackYourInternship | Trees (Easy-Medium)/findPreSuc.cpp | void findPreSuc(Node* root, Node*& pre, Node*& suc, int key)
{
while(root and root->key!=key){
if(key<root->key) {
suc = root;
root = root->left;
}
else{
pre = root;
root = root->right;
}
}
if(root and root->key==key){
if(ro... | ALGO | 0.999997 | 3.408911 |
e5e0b53e-76c3-404c-9017-2797e58c52e8 | RodrigoNevarez/algorythm-exercises | CodeForces/CypherDecypher/main.cpp | #include <iostream>
const int LIM_SUP = 1000000;
using namespace std;
/** \brief Inicia los valores de la criba, tambien inicia la sumatoria
* \param criba El arreglo dond se guardan los resultados
*/
void IniciarCriba(bool criba[]);
/** \brief Calcula la cantidad de primos en el intervalo [incio,fin]
*
* \param... | ALGO | 0.999801 | 4.913409 |
d916d946-2ede-473d-b5a0-e99382b81483 | ahmedhany14/Hany-s_leetcode | 1052-grumpy-bookstore-owner/1052-grumpy-bookstore-owner.cpp | class Solution {
public:
int maxSatisfied(vector<int>& customers, vector<int>& grumpy, int minutes) {
int n = customers.size(), all = 0;
vector<int> prefix(n + 1);
for(int i = 0; i < n; ++i){
grumpy[i] == 1 ? prefix[i + 1] = customers[i] : all += customers[i];;
prefix... | ALGO | 0.999734 | 6.373712 |
1c003216-a263-4d6f-a3cb-afb7580e79b9 | adoptium/jdk17 | src/hotspot/share/opto/vectorIntrinsics.cpp | #include "precompiled.hpp"
#include "ci/ciSymbols.hpp"
#include "classfile/vmSymbols.hpp"
#include "opto/library_call.hpp"
#include "opto/runtime.hpp"
#include "opto/vectornode.hpp"
#include "prims/vectorSupport.hpp"
#include "runtime/stubRoutines.hpp"
#ifdef ASSERT
static bool is_vector(ciKlass* klass) {
return kla... | TOOL | 0.873166 | 6.821474 |
8f8bfd0b-7fdc-46cd-ad67-0eb5675edf68 | ishandutta2007/codeforces | redstar_13/normal/274/E.cpp | #include<bits/stdc++.h>
#define x first
#define y second
#define pb push_back
using namespace std;
typedef long long INT;
typedef vector<int> VI;
typedef pair<int, int> pii;
template<typename T, typename U> inline void smin(T &a, const U &b) {if(a>b) a=b;}
template<typename T, typename U> inline void smax(T &a... | ALGO | 0.999916 | 3.50744 |
8fb51dc4-a176-4114-a0aa-52316fac91f2 | kyulee2/Algorithm | SparseMatrixMultiplication/t2.cpp | /*
Given two sparse matrices A and B, return the result of AB.
You may assume that A's column number is equal to B's row number.
Example:
Input:
A = [
[ 1, 0, 0],
[-1, 0, 3]
]
B = [
[ 7, 0, 0 ],
[ 0, 0, 0 ],
[ 0, 0, 1 ]
]
Output:
| 1 0 0 | | 7 0 0 | | 7 0 0 |
AB = | -1 0 3 | x | 0 0 0 | = | ... | ALGO | 0.999696 | 6.474943 |
ae072850-833f-4a8b-af7f-8eb6dd1f9b53 | nitin-kumar-sde/Dynamic-Programming | LCS.cpp | #include <iostream>
#include <vector>
#include <string>
#include <set>
#include <map>
#include <unordered_map>
#include <algorithm>
#include <cmath>
#include <fstream>
using namespace std;
#define ll long long
#define ld long double
#define endl '\n'
#define N 1000005
#define MOD 1000000007
int dp[2][1005];
int main... | ALGO | 0.999994 | 4.910218 |
a0415c87-004a-43b5-95ac-158118db15e7 | okadakk/contest | cplus/ABC156_A.cpp | #include <bits/stdc++.h>
using namespace std;
using ll = long long;
const ll INF = ll(1e9) + 1;
#define rep(i, n) for(int i = 0; i < (int)(n); i++)
#define reps(i, n) for(int i = 1; i <= (int)(n); i++)
#define scn(n) scanf("%d", &n)
#define scns(s) scanf("%s", &s)
#define pri(n) printf("%d", n)
#define priln(n) printf... | ALGO | 0.998576 | 3.230926 |
c8fc1cd6-efa7-4323-8bba-dbd24a4f176b | danilovict2/Competitive-Programming-Problems | Codeforces/PreparingOlympiad/PreparingOlympiad.cpp | #include <bits/stdc++.h>
using namespace std;
#define ll long long
#define ull unsigned long long
#define pb push_back
#define pii pair<int, int>
#define vi vector<int>
#define vii vector<pair<int,int>>
#define mp make_pair
#define sz(a) a.size()
#define forn(i, n) for (int i = 0; i < n; ++i)
#define INF 0x3f3f3f3f
t... | ALGO | 0.999929 | 4.514628 |
cda54e5f-3477-43f7-b93d-1ecf7c69139c | andersonmrib/Competitive-Programming | UVA/00357 - Let Me Count The Ways.cpp | #include <bits/stdc++.h>
#define speedBoost ios::sync_with_stdio(0); cin.tie(0);
using namespace std;
typedef vector<int> vi;
typedef long long ll;
int main(){
speedBoost;
vi coins = {1, 5, 10, 25, 50};
vector<ll> dp(30001, 0);
dp[0] = 1;
for(int i=0; i<coins.size(); i++){
for(int j=coins[i]; j<3000... | ALGO | 0.999476 | 4.710912 |
5d11ae72-419f-4f8d-88cf-9104cb501a3a | raincross7/code-similarity | codes/train_code/problem451/problem451_497.cpp | #include <bits/stdc++.h>
using namespace std;
using ll=long long;
int main() {
ll a,b;
cin>>a>>b;
ll d=0;
for(ll i=0;i<a;i++){
ll c;
cin>>c;
if(c>=b){
d+=1;
}
}
cout<<d<<endl;
return 0;
}
| ALGO | 0.999824 | 3.103653 |
68eebd9f-181c-467d-8dd2-79f34078ef0b | Rahul-Palahwat/LeetCode_Problems | String Permutations - GFG/string-permutations.cpp | //{ Driver Code Starts
#include<bits/stdc++.h>
using namespace std;
// } Driver Code Ends
class Solution{
public:
//Complete this function
vector<string> ans;
void solve(vector<bool> vis, string &s , string temp){
if(temp.size() == s.size()){
ans.push_back(temp);
return;... | ALGO | 0.99996 | 6.627524 |
f4346ff1-ff9c-4510-9498-c06dd5fbd02a | pavel-ryzhov/global_vars | runs/005713.cpp | #include <iostream>
#include <vector>
using namespace std;
struct TPair
{
int start;
int end;
};
struct Link
{
int target;
int weight;
};
vector<TPair> pairs;
int n, l;
vector < vector<Link> > g;
vector<char> used;
vector<int> tin, tout;
int timer;
vector < vector<Link> > up;
void dfs (Link lnk, Link p) {
use... | ALGO | 0.999914 | 4.331567 |
1a34b6bb-9a0a-41b5-9ef8-5530c19db6dc | Charlot-DEDJINOU/Matrix | Resolution LU C++/lu.cpp | #include "lu.h"
LU_decomp::LU_decomp(int taille)
{
N=taille;
L=new Matrix(N,N,"L",Matrix::as_matrix);
U=new Matrix(N,N,"U",Matrix::as_matrix);
mk=new Matrix(N,N,"mk",Matrix::as_matrix);
x=new Matrix(N,1,"x",Matrix::as_vector);
y=new Matrix(N,1,"y",Matrix::as_vector);
}
LU_decomp::~LU_decomp(... | ALGO | 0.998616 | 3.019275 |
18dc4a08-8f70-43ad-8385-603c1377b9e1 | Riya2497/GFGSolutions | stacks&queues/Time_to_rot_all_oranges.cpp | #include<bits/stdc++.h>
using namespace std;
// } Driver Code Ends
class Solution {
public:
int orangesRotting(vector<vector<int>>& grid) {
// Code here
queue<pair<int, int>> q;
int i, j, count;
bool flag ;
for(i=0; i<grid.size(); i++){
for(j=0; j<grid... | ALGO | 0.999966 | 6.197028 |
13203373-12f8-464b-af69-d450c135b275 | LottieWang/MultiStep_baseline | multistep/cc_color.cpp | void cc_color_propagate(graph& g, bool* valid,
int* valid_verts, int num_valid,
int* cc_maps)
{
#if DEBUG
double elt, elt2, start_time;
start_time = timer();
#endif
int num_verts = g.n;
bool* in_queue = new bool[num_verts];
bool* in_queue_next = new bool[num_verts];
int* queue = new int[num_verts];
i... | ALGO | 0.998426 | 4.981389 |
3fce3ac9-92c7-4b4b-8cce-81800f59559a | jaredramey/AutomationTest_Playground | Engine/Source/Runtime/Core/Private/Misc/URLRequestFilter.cpp | #include "Misc/URLRequestFilter.h"
#include "Algo/AnyOf.h"
#include "Algo/Find.h"
#include "Algo/ForEach.h"
#include "Containers/Array.h"
#include "Containers/StringView.h"
#include "Containers/UnrealString.h"
#include "CoreGlobals.h"
#include "Misc/CommandLine.h"
#include "Misc/ConfigCacheIni.h"
#include "Misc/Parse.h... | CONFIG | 0.852484 | 7.056308 |
88ffafef-1e75-4100-bb22-3fb3bd9948aa | jaouad2001/kattis-problems | Digit Swap.cpp | #include <iostream>
using namespace std ;
int main() {
int n ,b ,t,s;
cin>> n ;
t = n/ 10;
s = n%10;
b= (s *10)+t ;
cout<< b ;
} | ALGO | 0.991189 | 3.560821 |
81e76ed8-a20c-4890-926f-1cae039e5838 | randompitch/Data-Structures-Algorithms | Contests/CodeForces/13/2.cpp | #include <iostream>
#include <vector>
#include <string>
#include <stack>
#include <queue>
#include <algorithm>
#include <map>
#include <unordered_map>
#include <set>
#include <unordered_set>
#include <limits.h>
using namespace std;
typedef long long ll;
int main()
{
ios::sync_with_stdio(0);
cin.tie(0);
... | ALGO | 0.99998 | 4.359594 |
50564c7d-7c3d-456c-8482-9c9d49b93f24 | mohidmahin20/timus | timus 1000.cpp | #include<iostream>
using namespace std;
int main()
{
int a,b,sum=0;
cin >> a >> b;
sum=a+b;
cout << a << "+" << b << "=" << sum;
} | ALGO | 0.99258 | 3.968364 |
2c80b58a-154d-4a59-b627-9f04dd65d51c | YEWPO/OI-algorithms | 数论/【模板】数论分块.cpp | #include <bits/stdc++.h>
using namespace std;
template<typename T>
inline void read(T &x) {
T s = 0, w = 1;
char ch = getchar();
while (ch < '0' || ch > '9') {
if (ch == '-') w = -w;
ch = getchar();
}
while (ch >= '0' && ch <= '9') {
s = (s << 1) + (s << 3) + ch - '0';
... | ALGO | 0.999896 | 4.050479 |
46b136e5-2c98-432d-983b-9c8ff89348c8 | ishandutta2007/codeforces | olphe/normal/1485/D.cpp | #include "iostream"
#include "climits"
#include "list"
#include "queue"
#include "stack"
#include "set"
#include "functional"
#include "algorithm"
#include "string"
#include "map"
#include "unordered_map"
#include "unordered_set"
#include "iomanip"
#include "cmath"
#include "random"
#include "bitset"
#include "cstdio"
... | ALGO | 0.999796 | 3.553221 |
19ba0948-636a-401d-98d3-1bbca1d0be24 | SchiopAdrian/Projects | Mailender/mobile_ui/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.997311 | 6.76775 |
6051958c-3d7a-4100-beda-841f1ffe322c | sif69/codeforces-solution-by-sif_69 | codeforces/1846/A.cpp | #include<bits/stdc++.h>
using namespace std;
#define ll long long
#define lg long long
#define fi(i,L,R) for (ll i = L ; i <= R ; i++)
#define fd(i,R,L) for (ll i = R ; i >= L ; i--)
#define s1 string
#define p_b push_back
#define st(n) sort(a,a+n)
#define rev reverse(a,a+n... | ALGO | 0.999774 | 4.082936 |
3ca5d180-d457-463f-9bdc-fd05f0dbc8ba | CodeTrans-Research/RefuTra | result/translate/transcoder/java2cpp/c++_eval/CAESAR_CIPHER.cpp | #include <iostream>
#include <cstdlib>
#include <string>
#include <vector>
#include <fstream>
#include <iomanip>
#include <bits/stdc++.h>
using namespace std;
string f_gold ( string text, int s ) {
string result = "";
for ( int i = 0;
i < text . length ( );
i ++ ) {
if ( isupper ( text [ i ] ) ) result += c... | ALGO | 0.999822 | 5.535923 |
ddb99b26-0687-434c-b6dd-f3b56677b4ad | jacking9898/StuCppSecond | StuCppSecond/main06.cpp | #define _CRT_SECURE_NO_WARNINGS
#include <iostream>
#include <vector>
#include <algorithm>
#include <string.h>
#include <deque>
#include <stack>
#include <queue>
#include <list>
#include <functional>
#include <set>
#include <string>
#include <map>
using namespace std;
/**
* Ż
*/
void test01vec()
{
vector<int> v;
... | TOOL | 0.989989 | 3.110492 |
83f82321-89e5-4e0d-8ab1-3bff6c5fa0e7 | Srajan-Jaiswal/Codeforces-Contests | Codeforces Round #713 (Div. 3)_C.cpp | #include <bits/stdc++.h>
using namespace std;
#define int long long
#define fr(i, a, n) for (int i = a; i < n; i++)
#define fre(i, a, b) for (int i = a; i <= b; i++)
#define endl '\n'
#define no cout << "NO" << endl
#define yes cout << "YES" << endl
#define mem(name, value) memset(name, value, sizeof(name))
#define pb ... | ALGO | 0.999933 | 3.699651 |
7850b9f4-a1c8-4ec8-bbc8-152a1f669a8e | VitorCostaF/CompetitiveProgramming | Codeforces/C++/Round486_Div3/SubstringsSortB.cpp | #include<iostream>
#include<vector>
#include<algorithm>
using namespace std;
bool compara(string a, string b) {
if(a.size()<=b.size()){
/*int i,j,k;
for(k=0;k<b.size();k++) {
j=k;
i=0;
while(i<a.size() && j<b.size()) {
if(a[i]==b[j]) {
i++;
j++;
}
else
break;
}
if(i==a.... | ALGO | 0.999971 | 3.6376 |
0bd240f0-fc20-4cf4-8e9b-6d5e619e14e7 | suyash3312/DSA | GenericAndBinaryTrees/BalancedBinaryTree.cpp | class Solution {
public:
int height(TreeNode* root){
if(root == NULL){
return 0;
}
int leftHeight = height(root -> left);
int rightHeight = height(root -> right);
int finalAns = max(leftHeight, rightHeight) + 1;
return finalAns;
}
bool isBalanced(T... | ALGO | 0.999574 | 6.61763 |
ef8d9038-a573-4320-ab99-dc07428439de | 1234vishalsharma/Data-Structure | Graphs/implement.cpp | #include<iostream>
#include<unordered_map>
#include<list>
#include<vector>
using namespace std;
template <typename T>
class graph{
public:
void add(vector<T> mp[],T x,T y){
// if direction = 0 means it is an undirected graph
// id direction = 1 means it is an directed garph
mp[x].push_b... | ALGO | 0.999518 | 4.882961 |
929a4115-c064-4ca5-a8a6-ba692f2f3471 | julianogm/beecrowd | 4-estruturas-bibliotecas/1861.cpp | #include <bits/stdc++.h>
using namespace std;
int main(){
string x,y;
map<string,int>A;
while(cin >> x >> y){
cin.ignore();
A[y]=-1;
if(A[x]!= -1) A[x]++;
}
cout << "HALL OF MURDERERS" << endl;
for(map<string,int>::iterator pt=A.begin();pt!=A.end();pt++){
if(p... | ALGO | 0.999466 | 3.535838 |
c6fccc9e-77eb-4b1e-a91a-4effe848141d | DriWater/MicroMeta | src/resampling.cpp | #include <RcppArmadillo.h>
// [[Rcpp::depends(RcppArmadillo)]]
using namespace Rcpp;
arma::vec colSums_c(arma::mat tmp){
// return a column vector that is a column summation of matrix
int cols = tmp.n_cols;
arma::vec res(cols, arma::fill::none);
for (int i = 0; i< cols; i++){
res(i) = sum(tmp.col(i));
}
... | ALGO | 0.970173 | 4.525726 |
d468ce3d-8590-43ae-ac45-d8a15611637d | ishandutta2007/codeforces | jovanb/normal/26/A.cpp | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef long double ld;
int main(){
ios_base::sync_with_stdio(false);
cout.precision(10);
cout<<fixed;
int n;
cin >> n;
int res=0;
for(int i=6; i<=n; i++){
int cnt=0;
int x = i;
for(int j=2; j<=x; ... | ALGO | 0.999798 | 4.233037 |
b354a1ee-fcfa-4657-9195-fcd8422dbd58 | maiphuonghoang/AppleOfMyEye | C++/BaiTap/DanhSachLienKet/Stack/apdungStack2.cpp | #include <bits/stdc++.h>
using namespace std;
/*
I love this game
=> game this love I
*/
struct Node {
string data;
Node *next;
};
typedef struct Node* node;
node makeNode(string x){
node newNode = new Node();
newNode->data = x;
newNode->next = NULL;
return newNode;
}
bool empty(node top){
... | ALGO | 0.999793 | 4.478151 |
081d35e0-4372-4ea3-ba9b-45aa7f728464 | chinmay021/Interview-Preparation | tree/tree(intermediate)/binary tree/kth ancestor.cpp | int helper(Node *root, int &k, int node, int &ans)
{
if (!root)
{
return 0;
}
if (root->data == node)
{
return 1;
}
if (helper(root->left, k, node, ans) || helper(root->right, k, node, ans))
{
k--;
if (k == 0)
{
ans = root->data;
... | ALGO | 0.999997 | 4.901088 |
434abb3b-864d-4ac0-bc86-2b2de878906c | ishandutta2007/codeforces | ra16bit/normal/19/A.cpp | #include <cstdio>
#include <algorithm>
#include <map>
#include <string>
#include <cstring>
#include <vector>
using namespace std;
int i,j,ii,n,nn,k[200],a,b,x,y,c[200],d[200],e[200];
char ss[200],tt[200];
string s,t,st[200];
vector <string> r;
map <string, int> m;
bool cmp(int i, int j) {
return (c[i]>c[j] || (c[i]==... | ALGO | 0.999501 | 3.426241 |
80efb881-a881-4459-9478-1a70a09eabe9 | SavoSyka/Sturcts_Cpp | Boof_arr.cpp | #include <iostream>
#include <chrono>
#include <fstream>
int* createArray (int size){
int *arr = new int[size];
for (int i = 0; i<size; ++i){
arr[i]=i;
}
return arr;
}
void deleteArray(int* arr) {
delete[] arr;
}
void printArray (int* arr, int size){
for (int i = 0; i<size; ++i){
... | ALGO | 0.999106 | 3.860929 |
f857bc81-a9ad-4ac3-86b3-125491838a64 | prakhar-singh09/DSA | 05_linked_list/04_delete_loop.cpp | /*
link: https://practice.geeksforgeeks.org/problems/remove-loop-in-linked-list/1#
sol: https://www.geeksforgeeks.org/detect-and-remove-loop-in-a-linked-list/
*/
// ----------------------------------------------------------------------------------------------------------------------- //
/*
using hashing
... | ALGO | 0.999953 | 5.595521 |
ffe0984c-799b-44a6-987c-a8df052d041e | Rivera56/fuvi | bateria de ejercicios c++/bateria de ejercicios c++/problema29.cpp | /*
Nombre del archivo: problema29.cpp
autor: pablo vargas
lugar: itv
intrucciones:
*/
#include<iostream>
using namespace std;
int main() {
float num1;
float num2;
float num3;
float sumadelos3nums;
cout << " ingrese el primer numero" << endl;
cin >> num1;
cout << " ingrese el segundo numero" << endl;
cin >> n... | ALGO | 0.999532 | 3.586757 |
e2d88658-541a-412b-a761-d29c72fdbc9f | CDPS/Competitive-Programming | RPC/2017/Round 1/coverage.cpp | #include <bits/stdc++.h>
using namespace std;
int parent[5000];
int Rank [5000];
int cant [5000];
vector<int> g[5000];
int n;
int maxi;
int findset(int x){
if(parent[x]!=x)
parent[x] = findset(parent[x]);
return parent[x];
}
void unionset(int x, int y){
int px= findset(x); int py= findset(y)... | ALGO | 0.999765 | 4.019952 |
d934a559-4e5c-4d00-8be7-0ff53d71335e | deepanshu-12-10/DATA-STRUCTURE-ALGORITHM | rough/pattern14.cpp | #include <iostream>
using namespace std;
int main()
{
int n;
cin >> n;
int i = 1;
while (i <= n)
{
int spaces = 1;
while (spaces < i)
{
cout << " ";
spaces++;
}
int j=n;
while(j>=i){
cout<<i;
j--;
... | ALGO | 0.999977 | 3.890917 |
fce11159-e7a8-4dcf-96f6-8ebf187cdb92 | raincross7/code-similarity | codes/train_code/problem262/problem262_308.cpp | #include<iostream>
#include<iomanip>
#include<cmath>
#include<string>
#include<cstring>
#include<vector>
#include<list>
#include<algorithm>
#include<map>
#include<set>
#include<queue>
#include<stack>
using namespace std;
typedef long long ll;
#define fi first
#define se second
#define mp make_pair
#define rep(i, n) for... | ALGO | 0.999991 | 3.550885 |
9f2f1c48-6ce8-4a82-a1cf-f60576891246 | wenqiangwangsustech/FP16-LSRK | Efficiency/src/src_willimson_wave_con/src_willimson_con/src_con_med_fp/init_pml_para.cpp | /*================================================================
* ESS, Southern University of Science and Technology
*
* File Name:propagate.cpp
* Author: Wenqiang Wang, <EMAIL>
* Created Time:2021-11-05
* Discription:
*
================================================================*/
#include "heade... | ALGO | 0.994825 | 3.477109 |
81da86a6-7360-41fe-a5cd-3fd5ff146e0c | exploitfn/Mega-Source-Leak | comm cord/kdmapper/utils.cpp | #include "utils.hpp"
std::wstring utils::GetFullTempPath() {
wchar_t temp_directory[MAX_PATH + 1] = { 0 };
const uint32_t get_temp_path_ret = GetTempPathW(sizeof(temp_directory) / 2, temp_directory);
if (!get_temp_path_ret || get_temp_path_ret > MAX_PATH + 1) {
// Log(L"[-] Failed to get temp path" << std::endl);... | TOOL | 0.906489 | 5.180206 |
08755847-1106-42d5-bbc6-c92b6890dedd | fightcadeorg/fightcade-snes9x | src/win32/glslang/glslang/MachineIndependent/parseConst.cpp | //
// Traverse a tree of constants to create a single folded constant.
// It should only be used when the whole tree is known to be constant.
//
#include "ParseHelper.h"
namespace glslang {
class TConstTraverser : public TIntermTraverser {
public:
TConstTraverser(const TConstUnionArray& cUnion, bool singleConstP... | TOOL | 0.947755 | 6.69327 |
c66dbaad-af0a-4553-805b-1bc98dcf297c | mtouseeb0008/GFG-LEET-DSA-QUESTION | Implement two stacks in an array - GFG/implement-two-stacks-in-an-array.cpp | //{ Driver Code Starts
#include<bits/stdc++.h>
using namespace std;
// } Driver Code Ends
class twoStacks
{
int *arr;
int size;
int top1, top2;
public:
twoStacks(int n=100)
{
size = n;
arr = new int[n];
top1 = -1;
top2 = size;
}
//Function to ... | ALGO | 0.997615 | 5.501232 |
3c6da06b-2bd7-4983-b817-b43614e4ebb3 | Vacbo/SupaaaaComp | atv-08/avgs_calculator.cpp | #include <iostream>
#include <string>
#include <sstream>
#include <vector>
#include <iomanip> // For std::fixed and std::setprecision
int main() {
// Variables to hold parsed data
std::string line;
std::vector<int> values;
std::vector<double> times;
int value;
double time;
// Read from st... | ALGO | 0.998979 | 6.786952 |
c9bc48bb-0dc5-4160-b0f1-03014bd2ff44 | MagnaChain/MagnaChain-dev-master | src/magnachain-cli.cpp | #if defined(HAVE_CONFIG_H)
#include "magnachain-config.h"
#endif
#include "chain/chainparamsbase.h"
#include "misc/clientversion.h"
#include "io/fs.h"
#include "rpc/client.h"
#include "rpc/protocol.h"
#include "utils/util.h"
#include "utils/utilstrencodings.h"
#include "support/events.h"
#include "univalue.h"
#includ... | WEB | 0.977841 | 6.811591 |
b773b50b-204a-451d-ac92-a15e094b52d6 | SanskarKansal/Code | CP/B_Longest_Divisors_Interval.cpp | #include <iostream>
#include <vector>
#include <set>
using namespace std;
int main() {
int t;
cin >> t;
while(t--) {
long long n;
cin >> n;
int i=1;
while(n%i==0){
i++;
}
cout<<i-1<<endl;
}
return 0;
}
| ALGO | 0.999843 | 4.508883 |
3d37a7aa-0f01-468f-b2da-de775c33e50c | android-la64/llvm-project | libcxx/test/std/algorithms/alg.sorting/alg.min.max/min_init_list.pass.cpp | // UNSUPPORTED: c++03
// <algorithm>
// template<class T>
// T
// min(initializer_list<T> t);
#include <algorithm>
#include <cassert>
#include "test_macros.h"
int main(int, char**)
{
int i = std::min({2, 3, 1});
assert(i == 1);
i = std::min({2, 1, 3});
assert(i == 1);
i = std::min({3, 1, 2}... | TEST | 0.992941 | 4.9407 |
1b89a6ac-f1bb-4bc5-a163-faf22000a13c | Cepeen/ClueNotepad | 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 |
293b47f8-bf61-434a-981f-6dfa13836cb5 | beanbo/InsertionSortOnAsm | SortVstavkamiOnAssembly/SortVstavkamiOnAssembly.cpp | #include <iostream>
int main()
{
int massAsm[10], massC[10];
int temp;
for (int counter = 0; counter < 10; counter++) // input numbers
{
std::cout << "Enter mass[" << counter << "]: ";
std::cin >> temp;
massAsm[counter] = temp;
massC[counter] = temp;
}
system("cls"); // clear console
int begA, endA,... | ALGO | 0.995383 | 3.79462 |
ad20b096-7041-4f82-bfbd-f5211d706c4a | HarshitRuwali/HackerRank-Solutions | C++/Virtual Functions.cpp | #include <cmath>
#include <cstdio>
#include <vector>
#include <iostream>
#include <algorithm>
using namespace std;
class Person{
public:
string name;
int age;
virtual void getdata(){
cin >> this->name >> this->age;
}
virtual void putdata() {
cout << this->name << " " << this->age <<... | ALGO | 0.979887 | 3.356256 |
a87485c6-c26e-40c6-ab72-db6bec966765 | ShunNedachi/Unity-FPS-GunSword | Unity-FPS-GunSword/Library/PackageCache/com.unity.ide.visualstudio@2.0.16/Editor/COMIntegration/COMIntegration~/COMIntegration.cpp | #include <iostream>
#include <sstream>
#include <string>
#include <filesystem>
#include <windows.h>
#include <shlwapi.h>
#include <fcntl.h>
#include <io.h>
#include "BStrHolder.h"
#include "ComPtr.h"
#include "dte80a.tlh"
constexpr int RETRY_INTERVAL_MS = 150;
constexpr int TIMEOUT_MS = 10000;
// Often a DTE call m... | TOOL | 0.955261 | 6.937841 |
acfffeda-da42-490b-8157-1f9f371ff5e8 | farjanay11/Spring-2021-22 | INTRODUCTION TO PROGRAMMING/Lab/LAB(5)/main.cpp | #include <iostream>
using namespace std;
int main()
{
int arr[3],count,i,lowest_num;
cout<< "Number of students:"<<endl;
cin>>count;
cout<<count<<endl;
for(i=0;i<count;i++){
cin>>arr[i];}
lowest_num=arr[0];
for(i=0;i<count;i++)
{
if(arr[i]<lowest_num)
{
... | ALGO | 0.996733 | 3.562804 |
2b90ea4e-2f9a-4ff7-a7e5-1637399ae85b | openparallel/VideoStreamProcessor | jni/cvaux/src/cvfindface.cpp | ///////////////////////////////////////////////
//// Created by Khudyakov V.A. <EMAIL>
//////////////////////////////////////////////
#include "_cvaux.h"
#include "_cvfacedetection.h"
CvSeq * cvFindFace(IplImage * Image,CvMemStorage* lpStorage)
{
FaceDetection FD;
FD.SetBoosting(false);
FD.FindFace(Image)... | ALGO | 0.986979 | 3.510973 |
a4c8e61d-d263-4964-bc35-b87f8472844b | takumi152/atcoder | arc126a.cpp | #include <iostream>
#include <iomanip>
#include <vector>
#include <algorithm>
#include <utility>
#include <string>
#include <queue>
#include <stack>
#include <unordered_set>
using namespace std;
typedef long long int ll;
typedef pair<int, int> Pii;
const ll mod = 998244353;
int main() {
cin.tie(0);
ios::sync_wi... | ALGO | 0.999956 | 4.359244 |
7450f117-de9f-43a0-9881-9dbf77e9519f | fardragon/AdventOfCode2021 | day4/main.cpp |
#include "shared.hpp"
#include "BingoBaord.hpp"
#include <iostream>
#include <chrono>
std::pair<std::vector<std::uint8_t>, std::vector<Board>> ParseInput(const std::vector<std::string> &input);
std::vector<std::uint8_t> ParseNumbers(std::string_view numbers);
std::vector<std::uint8_t> ParseBoardElements(std::string... | ALGO | 0.992319 | 6.067158 |
54b4cd7a-96df-4efd-b024-6c5636a53754 | HosungJoo/BOJ_Algorithm | 프로그래머스/3/42898. 등굣길/등굣길.cpp | #include <string>
#include <vector>
#include <algorithm>
using namespace std;
int map[101][101];
int dp[101][101];
int dx[]={-1,0};
int dy[]={0,-1};
int solution(int m, int n, vector<vector<int>> puddles) {
int answer = 0;
int row = n;
int col = m;
for(int i=0;i<puddles.size();i++){
... | ALGO | 0.999123 | 5.474672 |
d7c49681-84a4-49d6-b7d8-339b6689005e | aryan04-t/PositiveBigInt-Datatype-Cpp | 00_Short Vector Implementation/02_Testing.cpp | #include"positivebigint.h"
int main(){
try{
string s1, s2;
cin >> s1 >> s2;
short n;
cin >> n;
PositiveBigInt prev2 = s1;
PositiveBigInt prev1 = s2;
PositiveBigInt curr("0");
for (short i = 2; i < n; ++i) {
PositiveBigInt temp... | ALGO | 0.998414 | 3.948391 |
1d083d06-aa98-4a76-a7c9-07515fd976f7 | fashopnil/phitron | C++/Week 6/Module 20 stack/stack using dynamic array again.cpp | #include<bits/stdc++.h>
using namespace std;
class Stack{
public:
int *a;
int stack_size;
int array_cap;
Stack()
{
a= new int[1];
array_cap=1;
stack_size=0;
}
void increase_size()
{
int *tmp=new int[array_cap*2];
for (int i = 0; i < array_cap; i+... | ALGO | 0.995088 | 4.044475 |
7afadee8-52cc-4563-9ed3-217c928d0638 | myunbin/PS | BOJ/9993.cpp | #include <bits/stdc++.h>
using namespace std;
#pragma GCC optimize("Ofast")
#pragma GCC target("fma,sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,avx2,tune=native")
#pragma GCC optimize("unroll-loops")
#define fileio() freopen("input.txt","r",stdin); freopen("output.txt","w",stdout)
#define fio() ios_base::sync_with_std... | ALGO | 0.999696 | 3.941592 |
34f03ab5-c6b1-4196-be48-4bbf5ef5c9d0 | dudgus197493/studyNote | Algorithms/SequentialSearch/LinkedList.cpp | #include <iostream>
#include "LinkedList.h";
void InitList(LinkedList* _pList)
{
_pList->iCount = 0;
_pList->pHeadNode = nullptr;
}
void PushBack(LinkedList* _pList, int _iData)
{
// 1. Node ä
Node* pNewNode = (Node*)malloc(sizeof(Node));
pNewNode->iData = _iData;
pNewNode->pNextNode = nullptr;
// 2. ù° Ȯ
... | TOOL | 0.988607 | 3.953588 |
d3428543-6848-4b49-80bc-c9792ec80670 | Feroz455/The-CPP-Standard-Template-Library-STL | STL Sets/end.cpp | /*
Cpp_STL_Reference
SET
program end
iterator end();
const_iterator end() const;
*/
#include<iostream>
#include<algorithm>
#include<set>
using namespace std;
//merge function
template<typename T>
T Merge(T a , T b)
{
T t(a);
t.insert(b.begin(), b.end());
return t;
}
//main begin
int main()
{
set<int> s... | ALGO | 0.986936 | 4.181505 |
454bb44c-9c4e-4ec0-b161-0701b753fa60 | Voxelab-64/Aquila | firmware/Sources/Marlin/src/module/delta.cpp | /**
* delta.cpp
*/
#include "../inc/MarlinConfig.h"
#if ENABLED(DELTA)
#include "delta.h"
#include "motion.h"
// For homing:
#include "planner.h"
#include "endstops.h"
#include "../lcd/ultralcd.h"
#include "../MarlinCore.h"
#if HAS_BED_PROBE
#include "probe.h"
#endif
#if ENABLED(SENSORLESS_HOMING)
#include ... | ALGO | 0.948345 | 7.036858 |
4b59bf4b-6a38-4122-a982-c34d1bae39c0 | sarthaksinha02/Sarthak-cpp-assignment | maximum_number_of_word.cpp | #include <iostream>
#include <string>
using namespace std;
int main() {
string sentence;
int maxWords = 0, currentWords = 0;
cout << "Enter a sentence: ";
getline(cin, sentence);
for (int i = 0; i < sentence.length(); i++) {
if (sentence[i] == ' ') {
currentWords++;
}
... | ALGO | 0.99985 | 5.068486 |
b10eecb9-4ff9-4a21-93b2-d618181737e0 | 22BCS10030/Ranjan_WWC-2024 | Documentary/day3/ques5.cpp | #include <iostream>
#include <cmath>
const int MOD = 1e9 + 7;
int minimumNonZeroProduct(int p) {
// Calculate 2^p - 1 (the largest number in the range)
long long maxNum = (1LL << p) - 1;
// Calculate the minimum non-zero product modulo MOD
long long minProduct = maxNum * (maxNum - 1) % MOD;
... | ALGO | 0.999972 | 6.412759 |
74cdad5e-7fa3-4160-976a-b4bf3494108a | jyotiranjankalta81/Data-Structure-And-Algorithm- | learningMaterial/BinarySearchTree/checkBST.cpp | // Approach
// node>left child
// node<right child
// all Nodes
// subhrasmitaasfor
// Approach 2
// max of left subtree(maxL)
// min of right subtree(minR)
// Approach 2
// node<maxL
// node<minR
// Approach 3
// min allowed
// max allowed
// min allowed <node
// max allowed>node
// Strateg... | ALGO | 0.99998 | 5.371189 |
3345dd89-bcc0-4594-a83c-e19ab0048200 | priyanka100204/DSA-programs | DATA_struc/power2.cpp | #include<iostream>
using namespace std ;
#include<math.h>
bool ispoweroftwo( int n ){
for(int i = 0 ; i< 30 ;i++){
if (n== pow(2,i) ){
return 1 ;
}
}
return 0 ;
}
int main ()
{
int n ;
cin >> n ;
bool found = ispoweroftwo( n ) ;
cout << found ;
} | ALGO | 0.999368 | 4.412594 |
f62e7bf0-362b-4da1-8ec2-56931e4ffe74 | Mohitlenka22/DsaThroughCpp | Hashing/subarrSum.cpp | #include <bits/stdc++.h>
using namespace std;
int main()
{
int n, pref_sum = 0, res = 0, sum;
cin >> n;
int a[n];
cout << "Enter array ";
for (int i = 0; i < n; i++)
cin >> a[i];
cout << "Enter sum: ";
cin >> sum;
unordered_set<int> s;
for (int i = 0; i < n; i++)
{
... | ALGO | 0.999992 | 3.544711 |
f2a1d527-f7c0-4bbf-b4ff-ba3b2e29b73c | manikanta2901/ubuntu | .history/imp/cpp/DataStructures/trees/treeUsingVector_20200702170023.cpp | #include<iostream>
#include<bits/stdc++.h>
#define printVect(vect,dataStruct) for(vector<dataStruct> :: iterator it = vect.begin(); it !=vect.end();it++){cout << *it << " ";}
using namespace std;
const int N = 1e5 + 5,logN = 25;
void printAdjaList(int q,vector<int>adj){
for(int i = 0; i < q; i++){
print... | ALGO | 0.999521 | 3.951217 |
e9da8742-99a3-4c6e-901d-0afa067f1492 | Yashu3624/DSA-LEETCODE-GFG | 1816-truncate-sentence/1816-truncate-sentence.cpp | class Solution {
public:
string truncateSentence(string s, int k) {
int count = 0 ;
string ans ="";
for(int i = 0 ; i < s.size() ; i++){
if(s[i]==' ')
count++;
if(count==k)
break;
ans += s[i];
}
return ans;
... | ALGO | 0.999951 | 5.565891 |
637975ec-4b3c-4e9b-a2e9-e5c8761e1b9d | pranith7867/Coding | Codestudio/Love_babbar_sde_sheet/1_Arrays/7_Rotate array.cpp | #include<bits/stdc++.h>
using namespace std;
void solve(vector<int> &arr,int k)
{
vector<int> temp;
for(int i=0;i<k;i++)
{
temp[i] = arr[i];
arr[i] = arr[i+k];
arr[i+k] = temp[i];
}
}
int main() {
//Write your code here
int n;
cin>>n;
vector<int> arr(n);
... | ALGO | 0.999948 | 3.093722 |
68c2d78f-64a2-4c02-ab03-7533043f0d43 | hu-hy17/SimpleGL | libraries/libigl/include/igl/matrix_to_list.cpp | #include <Eigen/Dense>
template <typename DerivedM>
IGL_INLINE void igl::matrix_to_list(
const Eigen::MatrixBase<DerivedM> & M,
std::vector<std::vector<typename DerivedM::Scalar > > & V)
{
using namespace std;
V.resize(M.rows(),vector<typename DerivedM::Scalar >(M.cols()));
// loop over rows
for(int i = 0;... | TOOL | 0.891725 | 4.576457 |
fcafa0a1-43a3-4b66-97a7-dcd5c3910ebb | eliemichel/OpenMfxForBlender | extern/bullet2/src/BulletCollision/CollisionShapes/btConvexTriangleMeshShape.cpp | #include "btConvexTriangleMeshShape.h"
#include "BulletCollision/CollisionShapes/btCollisionMargin.h"
#include "LinearMath/btQuaternion.h"
#include "BulletCollision/CollisionShapes/btStridingMeshInterface.h"
btConvexTriangleMeshShape ::btConvexTriangleMeshShape(btStridingMeshInterface* meshInterface, bool calcAabb)
... | ALGO | 0.989223 | 7.605254 |
3832964d-7161-4635-88fb-37ac24095028 | DrItanium/llvm12_960 | lib/Support/MD5.cpp | #include "llvm/Support/MD5.h"
#include "llvm/ADT/ArrayRef.h"
#include "llvm/ADT/SmallString.h"
#include "llvm/ADT/StringRef.h"
#include "llvm/Support/Endian.h"
#include "llvm/Support/Format.h"
#include "llvm/Support/raw_ostream.h"
#include <array>
#include <cstdint>
#include <cstring>
// The basic MD5 functions.
// F... | ALGO | 0.991711 | 7.516697 |
b871d7bf-971e-4e6f-92e5-6a907f7f3a57 | ishandutta2007/codeforces | bidzilya/normal/580/C.cpp | #include <iostream>
#include <vector>
#include <algorithm>
using namespace std;
int n, m;
vector<int> a;
vector<vector<int> > g;
int ans = 0;
void Dfs(int v, int pr, int cm)
{
if (a[v]) {
++cm;
if (cm > m) {
return;
}
} else {
cm = 0;
}
bool is_leaf = true;
... | ALGO | 0.999919 | 4.797671 |
68824f80-de82-4e5e-a0e6-1b129c8daf8b | bijuli74/cpp_codes | playlist.cpp | #include <bits/stdc++.h>
using namespace std;
const int mxN = 2e5;
int n, a[mxN];
// **********
int main(){
cin >> n;
map<int, int> mp;
int ans = 0;
for(int i=0; i<n; ++i) {cin >> a[i];}
for(int i=0, j=0; i<n; ++i){
while(j<n && mp[a[j]] <1){
mp[a[j]]++;
++j;
}
ans = max(j-i, ans);
mp[... | ALGO | 0.999881 | 4.322794 |
3180010b-7d77-4c14-973e-e1760c2d1fdd | jionychiow/jadecore547 | dep/g3dlite/source/filter.cpp | /**
@file filter.cpp
@author Morgan McGuire, http://graphics.cs.williams.edu
@created 2007-03-01
@edited 2007-03-01
Copyright 2000-2007, Morgan McGuire.
All rights reserved.
*/
#include "G3D/filter.h"
namespace G3D {
void gaussian1D(Array<float>& coeff, int N, float std) {
coeff.resize(N);
flo... | ALGO | 0.998611 | 4.061213 |
578fd24f-ff9a-424f-b544-c3385bbf4c66 | m10barcp1/Algorithsm-DS | DayConLienTiepCoTongLonNhat.cpp | #include<bits/stdc++.h>
using namespace std;
long long maxSubArray(long long *a, long long n){
long long max = a[0];
for ( int i = 0; i<n; i++){
long long S = 0;
for ( int j = i; j<n; j++){
S+=a[j];
if(max<S) max = S;
}
}
return max;
}
void solve(){
long long a[100000], n;
cin >> n;
for ( int i = 0... | ALGO | 0.999698 | 4.693357 |
b7265523-4520-41c5-868c-27ea217ba0e0 | ufukynz/far-cry-1.34-complete-source | SourceCode/CryAISystem/Graph.cpp | // Graph.cpp: implementation of the CGraph class.
//
//////////////////////////////////////////////////////////////////////
#include "stdafx.h"
#include "Graph.h"
#include "Heuristic.h"
#include "CAISystem.h"
#if !defined(LINUX)
#include <assert.h>
#endif
#include "Cry_Math.h"
#include <ISystem.h>
#include <Cry_Came... | ALGO | 0.997555 | 3.457151 |
dcbf12bd-5c24-4448-8910-6496c3ddd409 | nyankiti/algorithm_job | atCoderEnv/problems/tessoku-book/a49/a49_greedy.cpp | #include <bits/stdc++.h>
using namespace std;
#include <atcoder/all>
using namespace atcoder;
/* alias */
using ull = unsigned long long;
using ll = long long;
using vi = vector<int>;
using vvi = vector<vi>; // 二次元vector
using vs = vector<string>;
using pii = pair<int, int>;
/* macro */
#define rep(i, a, n) for (int i... | ALGO | 0.999875 | 4.475653 |
a34a2fbc-3cb2-4372-bf63-080aca536d90 | SandeepKushwaha/CPP-Course-For-Absolute-Beginners | Introduction_to_programming/3_operators/assignments/h.cpp | #include<iostream>
using namespace std;
// ==================================================
// What would be the output of the following code?
// ==================================================
int main() {
int x = 5;
x <<= 2;
cout << x << endl;
// A. 10
// B. 20
// C. 40
// D. 5
... | ALGO | 0.997194 | 3.345737 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.