uuid string | repo_name string | relative_path string | content string | category string | algo_rel_score float64 | quality_score float64 |
|---|---|---|---|---|---|---|
c7711fe3-98d8-4ab7-a864-b5c467192059 | AhmedKrimi/self-driving-car-nanodegree-udacity | nd013-c6-control-starter/project/pid_controller/eigen-3.3.7/unsupported/doc/examples/PolynomialUtils1.cpp | #include <unsupported/Eigen/Polynomials>
#include <iostream>
using namespace Eigen;
using namespace std;
int main()
{
Vector4d roots = Vector4d::Random();
cout << "Roots: " << roots.transpose() << endl;
Eigen::Matrix<double,5,1> polynomial;
roots_to_monicPolynomial( roots, polynomial );
cout << "Polynomial:... | ALGO | 0.998476 | 4.015535 |
27334184-ca8d-4cf5-9a55-cdd4e4b55de5 | Ashu2309/-6companies30days | Goldman Sachs/Problem2_Overlapping_Rectangles.cpp | #include <bits/stdc++.h>
using namespace std;
class Solution {
public:
int doOverlap(int L1[], int R1[], int L2[], int R2[]) {
// code here
if(L1[0]> R2[0] || L2[0]>R1[0])
return false;
if(L1[1]<R2[1] || L2[1]<R1[1])
return false;
return true;
... | ALGO | 0.962184 | 4.069413 |
36cd640f-514e-45aa-b076-fb6df2eada13 | pluveto/leet | 2021-08-14/p278.cpp | #include <iostream>
#include <cstdio>
#include <vector>
using namespace std;
// The API isBadVersion is defined for you.
// bool isBadVersion(long long int version);
class Solution
{
private:
bool isBadVersion(long long int i)
{
return i >= 1;
}
public:
int firstBadVersion(long long int n)
... | ALGO | 0.999743 | 5.410266 |
fddbec68-8240-4e1b-ba53-5668b7729767 | alexandraback/datacollection | solutions_2464487_0/C++/AngryBird1234/main.cpp | #include <iostream>
#include <cstdio>
#include <cstring>
#include <string>
#include <cmath>
#include <map>
//#include <pair>
#include <algorithm>
using namespace std;
typedef long long LL;
int fk;
int main()
{
freopen( "A-small-attempt0.in", "r", stdin );
freopen( "A-small-attempt0.out", "w", stdout );
int... | ALGO | 0.999261 | 3.516304 |
6b727bb8-ceb1-45b8-ba0a-284a9ce9406a | YamilGastonDiaz/Laboratorio-1 | Actividades de aula/1.Decisión/ejercicio4.cpp | #include <iostream>
#include <cstdlib>
using namespace std;
int main(){
string nomArticulo, formaPago;
float precioUnitario, subTotal, descuentoE=0.85, descuentoQ=0.95, recargoT=1.1, total;
int cantVendidaArt, cantNumRifas=0;
char pagos;
cout<<"ingrese el nombre del articulo: ";
getline(cin, nomArticulo);
cout<<"ingr... | TOOL | 0.953416 | 3.867467 |
65e00ee0-c4c8-4975-9ddf-305cc328387b | Patrick-Ali/210CT-Programming-Algorithms-Data-Structures | FinalPrograms/Matrix.cpp | #include <iostream>
//idea for an array of pointers http://stackoverflow.com/questions/8617683/return-a-2d-array-from-a-function
int** addMatrix(const int matrix1[3][3], const int matrix2[3][3])
{
//std::cout << matrix1[1][1] << " " << matrix2[1][1] << std::endl;
// Creaate a pointer that will point to an arr... | ALGO | 0.998858 | 3.760076 |
7fdb3e57-67d6-449d-ad77-b08432a00072 | Minnael/PROGRAMACAO-PARALELA | TAREFA 13/task13.cpp | #include <iostream>
#include <fstream>
#include <vector>
#include <iomanip>
#include <omp.h> // BIBLIOTECA PARA PARALELIZAÇÃO COM OPENMP
using namespace std;
const int NX = 200; // TAMANHO DO GRID NA DIREÇÃO X
const int NY = 1000; // TAMANHO DO GRID NA DIREÇÃO Y
const int S... | ALGO | 0.999895 | 5.495374 |
1082a266-07ec-4fec-bc78-0c8c029fd78d | sketchpunk/jniunrar | jni/unrar/suballoc.cpp | /****************************************************************************
* This file is part of PPMd project *
* Written and distributed to public domain by Dmitry Shkarin 1997, *
* 1999-2000 *
* Cont... | TOOL | 0.931887 | 5.660089 |
0e0fd09b-2fe4-4dd3-81b3-2455ff29055c | Harshdeep7r7/-6Companies30days | Day 26-30(Walmart)/12.cpp | #include<bits/stdc++.h>
using namespace std;
#define fr(i , x, y) for(int i=x; i<y ;i++)
vector<int> ans;
int ch[20009]={0};
int ls[20009]={0};
int fun(vector<int> &a){
int n = a.size();
if(n==2){
if(a[0]!=0 && a[1]!=0){
return 0;
}
if(a[0]==0){
ans.push_back(a[1]);
r... | ALGO | 0.999981 | 4.185445 |
53b2c336-643a-4071-9c3e-4a4a24593d8b | parallel101/course | 06/04_arena/04/main.cpp | #include <iostream>
#include <tbb/parallel_for.h>
#include <vector>
#include <cmath>
#include <mutex>
int main() {
size_t n = 1<<13;
std::vector<float> a(n * n);
std::recursive_mutex mtx;
tbb::parallel_for((size_t)0, (size_t)n, [&] (size_t i) {
std::lock_guard lck(mtx);
tbb::parallel_f... | ALGO | 0.999284 | 4.38598 |
a6c4d7a9-c80c-4a51-bbd3-5ea48e2d38a8 | RaisulislamRimon/problem-solving-online-judge | icpc/ICPC MOC Contest 2020 - CodeMarshal/C. Triangle - Copy.cpp | #include <iostream>
using namespace std;
int main()
{
int a, b, c;
cin >> a >> b >> c;
// if three sides with equal length == Equilateral Triangle
if (a == b && b == c)
cout << "Equilateral Triangle\n";
// normal triangle == Bad Triangle
else if (a != b && b != c && a != c)
... | ALGO | 0.999767 | 5.241107 |
0753af1f-b75e-4eb9-a95d-1ab2a2944254 | LeeHyungGeol/Algorithm_BaekJoon | 백준_if문/[백준 골드 3] 19535번.cpp | // Ʈ, dfs, շ
// ư .
// D-Ʈ , G-Ʈ 츦 Ѵ.
// G-Ʈ : ش ڽ 3 ̻ , nC3 Ѵ.
// D-Ʈ : ش ڽ ڽ ڽ 1 Ѵ.
// G-Ʈ : 1. Tree ϹǷ, next cur Ŀ Ѵ. 2. ڽİ 2 ̻̾ Ѵ.
// N 30 ̹Ƿ overflow Ƿ, long long Ÿ ش.
// : https://bba-dda.tistory.com/entry/%EB%B0%B1%EC%A4%80C-19535-%E3%84%B7%E3%84%B7%E3%84%B7%E3%85%88
// https://h... | ALGO | 0.999895 | 5.295209 |
f115b620-5e91-4307-b95e-e01f7f9b3454 | ishandutta2007/codeforces | waterfalls/normal/513/B1.cpp | #include <cstdio>
#include <algorithm>
using namespace std;
int n;
long long m;
int num[50];
int main() {
scanf("%d%I64d",&n,&m);
int l = 0;
int r = n-1;
for (int i=0;i<n-1;i++) {
if (m<=((1LL)<<(n-i-2))) {
num[l] = i+1;
l+=1;
} else {
num[r] = i+1;... | ALGO | 0.999995 | 3.505161 |
89697449-ef30-4d7b-8c28-5f7f3aa2275d | kisho1131/Leetcode-Practice | Rod Cutting - GFG/rod-cutting.cpp | // { Driver Code Starts
// Initial Template for C++
#include <bits/stdc++.h>
using namespace std;
// } Driver Code Ends
// User function Template for C++
class Solution{
public:
int cutRod(int price[], int n) {
int dp[n + 1][n + 1];
for (int i = 0; i < n + 1; i++)
for (int j = 0;... | ALGO | 0.999401 | 5.522198 |
5cfd2864-1300-48c0-8a55-0abdec296d21 | Jia-Sian/OJ | zj/b680.cpp | #include <iostream>
#include <cstdio>
#include <algorithm>
#include <vector>
using namespace std;
int go(int n){
if(n==0)return 1;
return 10*go(n-1);
}
int main(){
int n;
while(cin>>n){
vector< pair<long long,int> > data(n);
for(int i=0;i<n;i++){
long long tmp1;
s... | ALGO | 0.997547 | 3.066949 |
8230f4d7-cd9c-4fcd-802c-86cef5d5a315 | pegasuskmurase/AMES-GRBAfterglow | src/module/gammagamma.cpp | // \file gammagamma.hpp
// \brief Basic class for gamma-gamma pair annihilation process
#include "module/gammagamma.hpp"
#include "module/constants.hpp"
#include "module/utility.hpp"
#include <fstream>
GammaGamma::GammaGamma(Source &s) : s(s) {
setAngular();
ReadCross();
}
void GammaGamma::Losstime(const std::ve... | ALGO | 0.980884 | 4.662137 |
ba2f015e-a9e8-4089-af9e-00b66e46219f | AdvTrainEvalSrcDomain/adv-train-evaluation-source-code-domain | code-imitator/data/dataset_2017/dataset_2017_8/try/5304486_5760761888505856_try.cpp | #include <cstdio>
#include <iostream>
#include <cstring>
#include <cctype>
#include <algorithm>
#define MAXN 25
#define MAXM 25
#define MAXR 26
using namespace std;
struct Rectangle
{
char ch;
int sx;
int sy;
int ex;
int ey;
Rectangle()
{
}
Rectangle(char a,int b,int c,int d,int e)
... | ALGO | 0.999826 | 3.974516 |
21c60125-d741-4300-b93d-d8d5c52079b4 | raincross7/code-similarity | codes/train_code/problem089/problem089_240.cpp | #include <iostream>
#include <string>
using namespace std;
int main() {
int i, n, one, two;
string p1, p2;
cin >> n;
one = 0; two = 0;
for (i=0; i < n; i++) {
cin >> p1 >> p2;
if (p1 == p2) {
one += 1;
two += 1;
}
else if (p1 > p2) {
one += 3;
}
else if (p1 < p2)... | ALGO | 0.999726 | 3.628404 |
d99fba56-3540-40dd-a8c0-0ea1c66c6c90 | pawangoyal02/SdeSheetChallenge | Trie/MaximumXORWithAnElementFromArray2.cpp | #include<bits/stdc++.h>
struct Node{
Node* links[2];
bool containsKey(int ind){
return (links[ind]!=NULL);
}
Node* get(int ind){
return links[ind];
}
void put(int ind, Node* node){
links[ind]= node;
}
};
class Trie{
Node* root;
public:
Trie... | ALGO | 0.999981 | 5.487337 |
53b9f656-a6da-4e60-9e9c-dd70646bcdca | KhoiBui16/Fullhouse_Code_Online | DSA/Contest/11_QuyHoachDong/Bai_21/Maximum_path_sum2.cpp | #include <bits/stdc++.h>
using namespace std;
const int maxn = 1000;
int dp[maxn][maxn];
int main()
{
int n; cin >> n;
int a[n + 1][n + 1];
for (int i = 1; i <= n; i++)
for (int j = 1; j <= n; j++)
cin >> a[i][j];
dp[0][0] = 0;
for (int i = 1; i <= n; i++)
{
for (in... | ALGO | 0.999888 | 3.915052 |
0f564f01-fe37-424a-8ccc-8bf9c7662a10 | abhay-byte/DSA_Practice | CB/LEC24/1-replace-pi.cpp | #include <iostream>
#include <vector>
#include <algorithm>
using namespace std;
void f(char inp[], int i)
{
// base case
if(inp[i] == '\0')
{
return;
}
// recursive case
// f(i) = a fn that replaces all the pi with 3.14
// in the inp[i...n-1]
if (inp[i] == 'p' and inp[i + 1] ... | ALGO | 0.999842 | 3.335498 |
d6d159c4-15d9-49a9-99c4-224cc61add83 | Ahmedsabib/USACO | USACO Training Gateway/Dual Palindromes.cpp | /*
ID: jakesnu1
PROG: dualpal
LANG: C++17
*/
#include <bits/stdc++.h>
using namespace std;
bool is_palindrome(string S) {
for (int i = 0; i < (int)S.size()/2; ++i) {
if (S[i] != S[(int)S.size() - 1 - i]) return 0;
}
return 1;
}
string check(int N, int M) {
string res = "";
while (M) {
int rem = M%N... | ALGO | 0.999686 | 4.050466 |
ba90b260-e087-45ef-b491-546481dbbd57 | codewithaman07/codeforces | C_2_Skibidus_and_Fanum_Tax_hard_version.cpp | #include <bits/stdc++.h>
using namespace std;
#define Aman() ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL);
#define endl '\n'
#define int long long
#define pb push_back
#define f(x,n) for(int i = x ; i<n ; i++)
#define all(x) x.begin(),x.end()
const int M = 1e9+7;
const int N = 1e6 + 1;
void solve()... | ALGO | 0.999977 | 4.425353 |
63ac0c93-ae02-484e-adc3-fd9e77a09ce3 | Mostafa-Moin26/LeetCode | Fibonacci Number.cpp | // Problem link ------>
https://leetcode.com/problems/fibonacci-number/description/
// Solutions ------>
class Solution {
public:
int fib(int n) {
if (n <= 1) return n;
return fib(n - 1) + fib(n - 2);
}
};
// using dp Tabulation method
class Solution {
public:
int dp[32];
int fib(int... | ALGO | 0.999996 | 6.770682 |
e5319214-b8b4-40ae-92a1-59986cf09dde | Sam071100/Data-Structures-and-Algorithms | Array ADT/insert.cpp | #include <iostream>
using namespace std;
struct array
{
int A[10];
int size;
int length;
};
void display(struct array arr)
{
cout <<"\nElements are: \n";
for (int i = 0; i < arr.length; i++)
{
cout <<arr.A[i]<<" ";
}
}
void Append(struct array *arr,int x) // Add a new element at the ... | ALGO | 0.985187 | 4.065565 |
1f6fa1c9-af7f-480b-8f6c-f44c58bad02c | Iman-Howlader/Competitive-Programming | Pre-Bootcamp-S16/AP_Fox_and_Number_Game.cpp | /**
* Author : iman320
* Created: 2023-12-31 11:12:49
**/
#include <bits/stdc++.h>
using namespace std;
#define fast ios_base::sync_with_stdio(false), cin.tie(0), cout.tie(0)
#define nl '\n'
#define ll long long
#define all(x) x.begin(), x.end()
#define prec(n) fixed << setprecision(n)
#define yes cout << "YES\n... | ALGO | 0.999994 | 4.90054 |
cef14236-ff0e-4375-8af0-451f348cf8c1 | zhuwenboa/data_struct | data/leetcode/144.cpp | #include<iostream>
#include<vector>
#include<algorithm>
#include<stack>
using namespace std;
struct TreeNode {
int val;
TreeNode *left;
TreeNode *right;
TreeNode(int x) : val(x), left(NULL), right(NULL) {}
};
class Solution {
public:
vector<int> preorderTraversal(TreeNode* root)
{
if(... | ALGO | 0.999995 | 5.980993 |
c65a7815-474d-4cf8-a287-dba07007a36d | SpaghettiCodes/42kl-42klcursus | 5fifth/cpp/module02/ex02/Fixed.cpp | #include "Fixed.hpp"
#include <cmath>
Fixed::Fixed() : raw_bits(0) {}
Fixed::Fixed(Fixed const &ori)
{
*this = ori;
}
Fixed::Fixed(int const inum)
{
int raw_bits = inum<<(no_frac_bits);
if (inum < 0)
raw_bits = raw_bits | (1<<31);
this->raw_bits = raw_bits;
}
Fixed::Fixed(float const fnum)
{
raw_bits = roun... | TOOL | 0.896529 | 5.435875 |
5d635639-d6b2-4504-9f15-a9200f46c459 | diwas7777/CodesHub | Cpp/check_array.cpp | // C++ program to find given two array
// are equal or not
#include <bits/stdc++.h>
using namespace std;
// Returns true if arr1[0..n-1] and arr2[0..m-1]
// contain same elements.
bool areEqual(int arr1[], int arr2[], int N, int M)
{
// If lengths of array are not equal means
// array are not equal
if (N != M)
re... | ALGO | 0.999931 | 6.288811 |
a8a43347-8db4-48f3-ae9e-cf5e4d7c6d9f | ishandutta2007/codeforces | hank55663/normal/917/B.cpp | #include<bits/stdc++.h>
#define mp(a,b) make_pair((a),(b))
#define pii pair<int,int>
#define pdd pair<double,double>
#define pll pair<LL,LL>
#define pb(x) push_back(x)
#define x first
#define y second
#define sqr(x) ((x)*(x))
#define EPS 1e-6
#define mii map<int,int>
#define MEM(x) memset(x,0,sizeof(x))
#define MEMS(x)... | ALGO | 0.999949 | 3.991953 |
730d4a1d-95a9-4835-90a9-21738a5600f0 | dkhanna97/ACM | UVA/10041.cpp | #include <iostream>
#include <limits.h>
#include <vector>
#include <math.h>
#include <algorithm>
#include <string>
#include <stdio.h>
using namespace std;
//http://uva.onlinejudge.org/external/100/p10041.pdf
int main(void){
int num_cases = 0;
cin >> num_cases;
for (int i = 0; i < num_cases; ++i){
int num_relat... | ALGO | 0.999844 | 3.990197 |
436afae7-77b2-402b-a902-76da894e9237 | thetruemox/at_progs | lab_02/my_regex/main_fun.cpp | #include <iostream>
#include <string>
#include <list>
#include <map>
#include "My_Regex.h"
#include "DFA_Builder.h"
#include "NFA_Builder.h"
using namespace std;
int main()
{
string reg = "a.b.c";
My_Regex my_rx1(reg);
/* restore_regex
my_rx1.restore_regex("rstr_reg.txt");
*/
/* invers... | ALGO | 0.966099 | 3.546785 |
64256470-32ab-42fa-9cc2-b0b1c1b597c0 | sc624/fa17 | mp4/FloodFilledImage.cpp | #include "cs225/PNG.h"
#include <list>
#include <iostream>
#include <queue>
#include "colorPicker/ColorPicker.h"
#include "imageTraversal/ImageTraversal.h"
#include "Point.h"
#include "Animation.h"
#include "FloodFilledImage.h"
using namespace cs225;
/**
* Constructs a new instance of a FloodFilledImage with a ima... | TOOL | 0.859544 | 6.704304 |
c794599f-3e83-4351-b6ce-2f4b42e58a54 | lianlian51/LeetCode | HOT100/LeetCode22/LeetCode22/LeetCode22/test.cpp | class Solution {
public:
void DFS(int n, int left, int right, string& tmp, vector<string>& result)
{
if (tmp.size() == n * 2)
{
result.push_back(tmp);
return;
}
if (left < n)
{
tmp.push_back('(');
DFS(n, left + 1, right, tmp, result);
tmp.pop_back();
}
// ֹЧ
if (right < left)
{
tmp... | ALGO | 0.999829 | 6.271451 |
8e4d079d-0777-421d-a8f8-38cbb45920fc | abner-math/PlaneDetection | eigen3/failtest/colpivqr_int.cpp | #include "../Eigen/QR"
#ifdef EIGEN_SHOULD_FAIL_TO_BUILD
#define SCALAR int
#else
#define SCALAR float
#endif
using namespace Eigen;
int main()
{
ColPivHouseholderQR<Matrix<SCALAR,Dynamic,Dynamic> > qr(Matrix<SCALAR,Dynamic,Dynamic>::Random(10,10));
}
| TEST | 0.961298 | 3.159166 |
aceac679-dc77-42f6-b6cf-8de5d8c7208d | pratyaksh1610/Codeforces | Implementation/A - George and Accommodation.cpp | //https://codeforces.com/contest/467/problem/A
#include <iostream>
using namespace std;
int main()
{
int n, a = 0;
cin >> n;
while (n--)
{
int p, q;
cin >> p >> q;
if (q - p >= 2)
++a;
}
cout << a << endl;
return 0;
}
| ALGO | 0.999491 | 4.107005 |
05d86f2e-97cc-4ff6-b666-55657d381ca4 | varyushka/CPP | pz3_1.cpp | #include <iostream>
using namespace std;
int main() {
for (int num = 1000; num <= 9999; ++num) {
int a1 = num / 100; // Взяти перші дві цифри числа
int a2 = num % 100; // Взяти останні дві цифри числа
if (a1 == a2) {
cout << num << endl;
}
}
return 0;
} | ALGO | 0.999538 | 4.994248 |
8fae176e-d052-4560-8262-7cb6dc65f8a6 | yeetholmes619/Codeforces | practice/274545C.cpp | //Author = Anirudh Srikanth (yeetholmes619) [B20CS006]
#include<bits/stdc++.h>
#define curtime chrono::high_resolution_clock::now()
#define timedif(start,end) chrono::duration_cast<chrono::nanoseconds>(end - start).count()
using namespace std;
#define RESET "\033[0m"
#define BR "\033[1m\033[31m" ... | ALGO | 0.999981 | 3.718562 |
c5600209-5aaf-48cc-902c-9b97804f54eb | bulbulT/technical-interview-prep | binary-tree-preorder-traversal/binary-tree-preorder-traversal.cpp | /**
* Definition for a binary tree node.
* struct TreeNode {
* int val;
* TreeNode *left;
* TreeNode *right;
* TreeNode() : val(0), left(nullptr), right(nullptr) {}
* TreeNode(int x) : val(x), left(nullptr), right(nullptr) {}
* TreeNode(int x, TreeNode *left, TreeNode *right) : val(x), l... | ALGO | 0.999979 | 6.145905 |
fec74e16-48aa-46ac-925f-40af1d3c4a38 | tsukud-y/estiva | estivaplus/src/main.cpp | #include "estivaplus.h"
#include "viennacl.h"
#include "stwart.h"
int main(){
Matrix A = makeA();
Vector b = makeb(A.size());
Vector x(A.size());
SolverWithStwart(A,x,b);
b = viennacl::linalg::prod(A,x);
printMatrix(A);
printVector(b);
return 0;
}
| ALGO | 0.998734 | 3.190998 |
3ec2a8d9-96eb-4491-940a-41b2a995b31d | B21DCCN712/C_plus_Ptit | PhepChiaDuVaApDung/ChiaDu.cpp | #include<iostream>
using namespace std;
int main(){
int t;
cin>>t;
while(t--){
int m,n;
cin>>m>>n;
int check=0;
for(int i=1;i<n;i++){
if((m*i)%n==1){
check=1;
cout<<i<<endl;
break;
}
}
if(check==0) {
cout<<"-1"<<endl;
}
}
}
| ALGO | 0.999946 | 3.898787 |
2ef9b378-0ac8-4932-a52c-73f6f5ddf1fb | nhu220840/C-plus-Tutorial | Vong lap/GiaiPhuongTrinh.cpp | #include <bits/stdc++.h>
using namespace std;
int main(){
int a, b, n;
cin >> a >> b >> n;
int check = 0;
for(int i = 0; i <= n / b; i++){
if((n - b * i) % a == 0){
check = 1;
}
}
if(check == 1)
cout << "YES" << endl;
else
cout << "NO" << endl;... | ALGO | 0.999941 | 3.742659 |
4d171a35-ec22-4ec3-8a0c-322b1523137a | iam1513/Competitive-Programming | Atcoder Contests/Beginner/A1/CD.cpp | #include <bits/stdc++.h>
#define ll long long
#define pll pair<ll, ll>
#define vll vector<ll>
#define mll map<ll, ll>
#define sl set<ll>
#define sc set<char>
#define pb push_back
#define MOD 1000000007
#define PI 3.1415926535897932384626433832795
using namespace std;
ll gcd(ll a, ll b) { return b == 0 ? a : gcd(b,... | ALGO | 0.99997 | 4.65882 |
e3d0f39c-6696-4d9d-a748-bd6504053a89 | ishandutta2007/codeforces | ra16bit/normal/590/B.cpp | #include <stdio.h>
int xa,ya,xb,yb,xv,yv,xw,yw,vm,t;
double l,r,h,x,y,vm2;
int main() {
scanf("%d%d%d%d",&xa,&ya,&xb,&yb);
scanf("%d%d%d%d%d%d",&vm,&t,&xv,&yv,&xw,&yw);
vm2=1.*vm*vm;
xb-=xa; yb-=ya;
l=0; r=1e9;
while (l+1e-11<r) {
h=(l+r)*0.5;
if (h>t) {
x=xb-(h-t)*xw-1.*t*xv;
y=yb-(h-t)... | ALGO | 0.999972 | 3.127 |
3eb9eb41-0a03-46c0-8591-ba480ebdea4b | VirtualAnalogy/Paraphrasis | ThirdParty/CoreAudio/PublicUtility/CASpectralProcessor.cpp | //#include "AudioFormulas.h"
#include "CASpectralProcessor.h"
#include "CABitOperations.h"
#include <Accelerate/Accelerate.h>
#define OFFSETOF(class, field)((size_t)&((class*)0)->field)
CASpectralProcessor::CASpectralProcessor(UInt32 inFFTSize, UInt32 inHopSize, UInt32 inNumChannels, UInt32 inMaxFrames)
: mFFTSize(... | ALGO | 0.985224 | 4.955308 |
f08798ad-1239-4871-a268-b56dfcc746eb | ISOLDE-Project/riscv-llvm | llvm/lib/CodeGen/AsmPrinter/DbgEntityHistoryCalculator.cpp | #include "llvm/CodeGen/DbgEntityHistoryCalculator.h"
#include "llvm/ADT/STLExtras.h"
#include "llvm/ADT/SmallSet.h"
#include "llvm/ADT/SmallVector.h"
#include "llvm/CodeGen/LexicalScopes.h"
#include "llvm/CodeGen/MachineBasicBlock.h"
#include "llvm/CodeGen/MachineFunction.h"
#include "llvm/CodeGen/MachineInstr.h"
#incl... | TOOL | 0.920705 | 7.954088 |
a08c5c36-553a-4db3-a90a-d2547510d2d8 | Ashish-118/DSA_Course | DP/0/1knapsack.cpp | #include <bits/stdc++.h>
int solve(vector<int> weight, vector<int> value, int index, int capacity, vector<vector<int>> &dp)
{
if (index == 0)
{
if (weight[index] <= capacity)
return value[index];
else
return 0;
}
if (dp[index][capacity] != -1)
return dp[i... | ALGO | 0.999995 | 5.739866 |
fe1f43b0-f3fe-4610-bea1-e992294ff95d | Electron1997/Algorithms | Graphs/floyd_warshall.cpp | // Solution to https://www.spoj.com/problems/ROHAAN
#include <bits/stdc++.h>
#define f first
#define s second
#define loop(i, n) for (int i = 0; i < n; ++i)
#define read(a, n) loop($, n) cin >> a[$];
#define show(a, n) \
loop($, n) cout << a[$] << " "; \
cout << endl;
using namespace std;
t... | ALGO | 0.999718 | 4.284162 |
1fc49dd0-9836-428c-8751-10d5a7f7fa6f | TuxMiester/First | CodeChef/Even_Sum.cpp | #include<bits/stdc++.h>
using namespace std;
int main(){
int t;
cin>>t;
while(t--){
int n;cin>>n;
int a[n];
for (int i = 0; i < n; i++)
{
cin>>a[i];
}
int count_odd = 0, count_even = 0;
for(int i=0;i<n;i++){
if(a[i]%2==0){
... | ALGO | 0.999889 | 4.350252 |
d5ee612d-60da-451d-b716-d532776be551 | aditya3492gupta/CrackYourPlacement | HEAP/767.reorganize-string.cpp | class Solution
{
public:
string reorganizeString(string S)
{
string res = "";
unordered_map<char, int> mp;
priority_queue<pair<int, char>> pq;
for (auto s : S)
mp[s] += 1;
for (auto m : mp)
pq.push(make_pair(m.second, m.first));
while (p... | ALGO | 0.999988 | 5.661736 |
de426130-ec61-4ac9-a8d8-e0fa85c7a573 | Cyvid7-Darus10/C-plus-plus | algo/lcm.cpp | #include <iostream>
long long lcm_naive(int a, int b) {
for (long l = 1; l <= (long long) a * b; ++l)
if (l % a == 0 && l % b == 0)
return l;
return (long long) a * b;
}
int gcd_fast(int a, int b) {
if (a % b == 0)
return b;
return gcd_fast(b, a % b);
}
int lcm_fast(int a, int b) {
return a*... | ALGO | 0.999691 | 4.812271 |
7e66eb9b-56b0-4829-8fd5-18f42d5dbd6c | belikeakash/Leetcode | Ceil in BST - GFG/ceil-in-bst.cpp | //{ Driver Code Starts
#include <bits/stdc++.h>
using namespace std;
struct Node {
int data;
struct Node* left;
struct Node* right;
};
// Utility function to create a new Tree Node
Node* newNode(int val) {
Node* temp = new Node;
temp->data = val;
temp->left = NULL;
temp->right = NULL;
... | ALGO | 0.999945 | 6.3524 |
876f4a8a-65f0-433f-b969-a63eeeef6a61 | UvarovDenis/ACMP | Task_#970.cpp | #include <stdio.h>
#include <iostream>
using namespace std;
int main()
{
freopen("input.txt","r",stdin);
freopen("output.txt","w",stdout);
int n, m, k;
cin >> n >> m >> k;
if (n==k+m || m==k+n || k==m+n){cout << "YES";}
else {cout << "NO";}
return 0;
} | ALGO | 0.999973 | 3.242771 |
48422a06-cbe5-4109-906d-20223232d546 | LNQLdvfu/optimization_method | Lab2_optimization_method/main.cpp | #include <iostream>
#include <vector>
#include <cmath>
#include <Eigen/Dense>
#include <chrono>
#include <random>
using namespace Eigen;
using namespace std;
using vec = Matrix<double, Dynamic, 1>;
using mat = Matrix<double, Dynamic, Dynamic>;
mat gen_matrix( int dim) {
Eigen::MatrixXd random_matrix(dim,dim) ;
// ... | ALGO | 0.99996 | 4.555548 |
a46cf7c3-9ec5-47a6-84ce-6196a18003ab | ishandutta2007/codeforces | tmwilliamlin168/normal/1285/E.cpp | #include <bits/stdc++.h>
using namespace std;
#define ll long long
#define ar array
int n;
ar<int, 2> a[200000];
vector<int> v;
struct node {
bool lc, rc, ac;
int ans, lz;
} st[1<<20];
void cmb(int i) {
if(st[i].lz)
return;
if(st[2*i].ac&&st[2*i+1].ac) {
st[i].ac=1;
st[i].ans=0;
} else {
st[i].ac=0;
... | ALGO | 0.999973 | 4.439357 |
26ed4377-39f9-49b4-898f-2805ad28f722 | ValeriiKoniushenko/VaKon2D | dependencies/boost_1_80_0/libs/math/example/policy_ref_snip6.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_ref_snip6
#include <boost/math/distributions/negative_binomial.hpp>
using boost::math::negative_binomial;
// Use the default rounding policy integer_round_outwards.
// Lower ... | ALGO | 0.998262 | 4.85992 |
f04bf920-e9d4-43f4-ab56-969719c4819a | Wos2610/SPOJ | BCFIBO.cpp | #include<iostream>
#include<vector>
using namespace std;
#define M 1000000
#define MOD 1000000007
vector<long long> f(M + 6, 0);
void fibo(int n){
f[0] = 0;
f[1] = 1;
int i;
for(i = 2; i <= M ; i++){
f[i] = (f[i - 1] % MOD + f[i - 2] % MOD) % MOD;
}
cout << f[n];
}
int main(){
i... | ALGO | 0.999965 | 4.334192 |
f6d939b5-966a-46e0-ba79-57fe54ae31ac | clbclb/stage3 | Surakarta_game/Surakarta_Game/surakarta_agent_mine.cpp | #include "surakarta_agent_mine.h"
#include <algorithm>
#include <cstdlib>
#include <random>
#include <vector>
#include "global_random_generator.h"
#include "surakarta_common.h"
#include "widget.h"
SurakartaMove SurakartaAgentMine::CalculateMove() {
// TODO: Implement your own ai here.
// 生成from集与to集
std::v... | ALGO | 0.999871 | 4.386251 |
6daa79ae-e271-4b77-b20a-075eb3346db2 | dash-anirudh/RISC-V_Simulator | utils.cpp | #include <iostream>
#include <unordered_map>
#include <string>
#include <cmath>
#include "utils.h"
using namespace std;
// returns without 0x prefix
string signExtend(string input, int64_t base){
int64_t num;
char msb = input[0];
if (base == 2)
{
num = 64 - input.size();
}
else if (bas... | ALGO | 0.992794 | 4.727033 |
81394b56-933c-49a0-b346-b05f6bb6e072 | LeeHyungJoo/learn_Algorithm | 프로그래머스/lv2/12909. 올바른 괄호/올바른 괄호.cpp | #include<string>
#include <iostream>
#include <stack>
using namespace std;
bool solution(string s)
{
stack<int> checks;
for (auto c : s)
{
if (c == '(')
checks.push(0);
else
{
if (checks.empty())
{
return false;
}
... | ALGO | 0.998771 | 5.315578 |
f006b030-4095-4cfa-853a-7c8eac5050a6 | wowoto9772/Hungry-Algorithm | BOJ/6462/solution.cpp | #include <stdio.h>
#include <limits.h>
#include <algorithm>
#define n 20
using namespace std;
int d[22][22];
int main(){
int f;
int tc = 0;
while (scanf("%d", &f) == 1){
for (int i = 1; i <= 20; i++){
for (int j = 1; j <= 20; j++){
d[i][j] = INT_MAX;
}
}
for (int i = 1; i <= f; i++){
int a;
... | ALGO | 0.99762 | 3.514219 |
ed5e03b0-bc1e-4f8d-ae69-50ef5e5508a6 | AleksandrGHub/Alarm-system | Library/PackageCache/com.unity.ide.visualstudio@2.0.12/Editor/COMIntegration/COMIntegration~/COMIntegration.cpp | #include <iostream>
#include <sstream>
#include <string>
#include <filesystem>
#include <windows.h>
#include <shlwapi.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 made to Visual Studio can fail after ... | TOOL | 0.96573 | 6.969462 |
d254c304-cde9-46a5-b850-d39eec7ef97b | Swapnil67/dsa | Trees/01-easy/13-subtree-of-another-tree.cpp | /*
* Leetcode - 572
* Subtree of Another Tree
* Example 1:
* Input: root = [3,4,5,1,2], subRoot = [4,1,2]
* Output: true
* https://leetcode.com/problems/subtree-of-another-tree/
* https://www.naukri.com/code360/problems/subtree-of-another-tree_893071
*/
#include <vector>
#include <iostream>
typedef struct TreeNode ... | ALGO | 0.999409 | 6.886504 |
044e5241-f089-4a9f-9aee-89dddf8d5116 | Shashi-Sekar/Algorithms | LeetCode/Graphs/lc207.cpp | /*
LC 207. Course Schedule
Ideas:
Algorithm:
Time Complexity:
*/
#include<iostream>
#include<vector>
using namespace std;
class Solution{
bool cycle(vector<vector<int>>& graphs, vector<int>& visited, int start_node){
/*
Returns true if there is a cycle in the graph
*/
if(vis... | ALGO | 0.999864 | 6.49947 |
967d36d1-a516-4369-a091-d501445c61bf | rajur02/Udemy_Abdul_Bari | MyProject/Sec6_ConditionalStatements/o61DynamicDeclaration.cpp | #include <iostream>
using namespace std;
int main()
{
int a=10, b=5;
if(int c=a+b; c>10)
{
cout << c;
}
return 0;
} | TOOL | 0.878738 | 3.035989 |
12b8bf0c-3bf6-4154-b10b-6f0ecffa9cce | SysCall97/My-Codeforces-solutions | C. Book Reading.cpp | /***************************************************************
* Name: KAZI NUR ALAM MASHRY *
* School: MAWLANA BHASHANI SCIENCE & TECHNOLOGY UNIVERSITY *
* CSE (14TH BATCH) *
***********************************************************... | ALGO | 0.999831 | 3.79221 |
404411db-519d-4c7c-9e84-59bf48e4b160 | Rhinos2/DroidBullet | app/src/main/framework/bullet/btContinuousDynamicsWorld.cpp | #include "btContinuousDynamicsWorld.h"
#include "btQuickprof.h"
//collision detection
#include "btCollisionDispatcher.h"
#include "btSimpleBroadphase.h"
#include "btCollisionShape.h"
#include "btSimulationIslandManager.h"
//rigidbody & constraints
#include "btRigidBody.h"
#include "btSequentialImpulseConstraintSolver... | ALGO | 0.982928 | 5.815824 |
aeafee69-83b5-4df4-a49b-d2cd88080764 | katherine-atwell/boids-simulation | eigen-dir/doc/examples/Tutorial_ArrayClass_interop_matrix.cpp | #include <Eigen/Dense>
#include <iostream>
using namespace Eigen;
using namespace std;
int main()
{
MatrixXf m(2,2);
MatrixXf n(2,2);
MatrixXf result(2,2);
m << 1,2,
3,4;
n << 5,6,
7,8;
result = m * n;
cout << "-- Matrix m*n: --" << endl << result << endl << endl;
result = m.array() * ... | ALGO | 0.999037 | 4.306757 |
78c4324f-d1bf-4947-a51a-f5029427fb0e | 91marek/ID3 | id3lib/UMDecisionTree.cpp | /*
* UMDecisionTree.cpp
*/
#ifdef DEBUG
#include <boost/assert.hpp>
const float EPSILON = 0.00001F;
#endif
#include "UMDecisionTree.hpp"
#include <limits>
using namespace id3lib;
using std::vector;
using std::string;
using std::invalid_argument;
using boost::shared_array;
using std::numeric_limits;
using std::istr... | ALGO | 0.960732 | 5.600565 |
5fbe7ed7-0f54-472d-bd1a-04d54bdd1c5a | Inter129/PS-mac | acmicpc/100__/10026.cpp | #include <vector>
#include <algorithm>
#include <queue>
#include <iostream>
#include <map>
#include <set>
#include <math.h>
#include <numeric>
#include <cassert>
#include <stack>
#include <cstring>
#include <climits>
int x_move[] = {0, 0, 1, -1}, y_move[] = {1, -1, 0, 0};
typedef long long ll;
typedef unsigned long u... | ALGO | 0.999298 | 4.111141 |
fe20dc79-c9f8-4dd9-8210-472e1479f84e | syurskyi/Python_Topics | 125_algorithms/_examples/_algorithms_challenges/leetcode/leetCode/LinkedList/21_MergeTwoSortedLists.cpp | /*
* @Author: <EMAIL>
* @Last Modified time: 2016-04-28 11:19:51
*/
/**
* Definition for singly-linked list.
* struct ListNode {
* int val;
* ListNode *next;
* ListNode(int x) : val(x), next(NULL) {}
* };
*/
// Recursively
class Solution {
public:
ListNode* mergeTwoLists(ListNode* l1, ListN... | ALGO | 0.999994 | 5.421933 |
2ccc9c22-8868-41b7-99e0-b85d16543b90 | STARFALL088/CP | CodeForces/27E.cpp | #pragma GCC optimize("Ofast,unroll-loops,no-stack-protector,fast-math")
#include <bits/stdc++.h>
using namespace std;
// Type definitions
typedef long long ll;
typedef long long lli;
typedef long double lld;
typedef pair<int, int> pii;
typedef pair<lli, lli> pll;
typedef vector<int> vi;
typedef vector<vi> vvi;
typedef... | ALGO | 0.999777 | 5.016712 |
e185bd88-3d23-47ac-8999-0d78b61ad511 | QuMuLab/planner-for-relevant-policies | src/VAL/typecheck.cpp | #include "typecheck.h"
#include "ptree.h"
#include <functional>
#include "main.h"
#include "Exceptions.h"
#include <algorithm>
namespace VAL {
void TypeHierarchy::addDown(const PTypeRef & t1,const PTypeRef & t2)
{
GIC i = downGraph.find(&t1);
GIC j = downGraph.find(&t2);
if(i == downGraph.end())
{
i = graph.fin... | ALGO | 0.944266 | 4.021828 |
b2ccea40-f4fa-4ccb-b6ab-da110794b53c | chopingu/competitive_programming | neetcode/arrays_and_hashing/contains_duplicate.cpp | #include<bits/stdc++.h>
using namespace std;
class Solution {
public:
bool hasDuplicate(vector<int>& nums) {
unordered_map<int, bool> mp;
for(auto i: nums)
if(mp.find(i) == mp.end())
mp[i] = true;
else
return true;
return false;
... | ALGO | 0.999473 | 5.106798 |
b92a4ee3-b06e-469f-bf3b-df66c084b487 | Layty/CppPrimer | 9th/9.31.cpp | // 大佬使用了 advance(prv, 2) 来操作迭代器
/*第316页中删除偶数值元素并复制奇数值元素的程序不能用于list或forward_list。
修改程序,使之也能用于这些类型
*/
#include <forward_list>
#include <iostream>
#include <list>
#include <vector>
using namespace std;
template <typename T>
void print(T src)
{
for (auto ch : src)
cout << ch <<",";
cout<<endl;
}
int m... | TOOL | 0.969401 | 3.311188 |
2b65a7a6-2212-4462-ae45-1f0683e0eab1 | ishandutta2007/codeforces | ksun48/normal/1630/C.cpp | #include <bits/stdc++.h>
using namespace std;
int main(){
ios_base::sync_with_stdio(false), cin.tie(nullptr);
int n;
cin >> n;
vector<int> a(n);
for(int& x : a){
cin >> x;
x--;
}
vector<int> last_occ(n, -1);
vector<pair<int,int> > intervals;
for(int i = 0; i < n; i++){
int r = last_occ[a[i]];
if(r >= ... | ALGO | 0.999982 | 4.287005 |
1d0155c2-6df2-4125-adfe-bcdbe430d0c6 | crazysoldier/clonecoin-scrypt | src/addrman.cpp | #include "addrman.h"
using namespace std;
int CAddrInfo::GetTriedBucket(const std::vector<unsigned char> &nKey) const
{
CDataStream ss1(SER_GETHASH, 0);
std::vector<unsigned char> vchKey = GetKey();
ss1 << nKey << vchKey;
uint64 hash1 = Hash(ss1.begin(), ss1.end()).Get64();
CDataStream ss2(SER_GE... | ALGO | 0.958368 | 5.985336 |
eb4a7bb0-6935-4973-ae80-676c9d56e91b | chicco83/CHIRON-EVO | CHIRON/OLD MARLIN/FW/marlin 2.0.7/Marlin-2.0.7/buildroot/share/PlatformIO/variants/LERDGE/variant.cpp | #include "pins_arduino.h"
#ifdef __cplusplus
extern "C" {
#endif
const PinName digitalPin[] = {
PB_12,
PB_13,
PB_14,
PB_15,
PD_8,
PD_9,
PD_10,
PD_11,
PD_12,
PD_13,
PD_14,
PD_15,
PG_2,
PG_3,
PG_4,
PG_5,
PG_6,
PG_7,
PG_8,
PC_6,
PC_7,
PC_8,
PC_9,
PA_8,
PA_9,
PA_10,
PA_11,
PA_12,
PA_13,
PA_1... | CONFIG | 0.920319 | 5.010884 |
57e33b9a-5b30-4725-b071-53c825eed428 | wildcat-rocketry/llvm | libcxx/test/std/containers/associative/map/map.ops/equal_range_transparent.pass.cpp | // UNSUPPORTED: c++03, c++11
// <map>
// class map
// template<typename K>
// pair<iterator,iterator> equal_range(const K& x); // C++14
// template<typename K>
// pair<const_iterator,const_iterator> equal_range(const K& x) const;
// // C++14
#include <cassert>
#include <map>
#inc... | TEST | 0.981067 | 5.229283 |
419821a0-747b-433a-bab0-638b60cf394b | 113bommy/deepmind_codecontests_refine | cpp_source_filter_file/cpp_train_2117_7.cpp | #include <bits/stdc++.h>
using namespace std;
const int INF = (int)1.1e9;
const int maxN = 1 << 18;
struct SegTree {
vector<int> T;
SegTree() { T = vector<int>(2 * maxN, -INF); }
void upd(int v, int x) {
for (v += maxN; v; v /= 2) {
T[v] = max(T[v], x);
}
}
int get(int l, int r) {
int ans = ... | ALGO | 0.999992 | 3.656801 |
6f200315-4230-4063-8b6c-0641af0bebcc | JhaoZ/leetcode-sols | 0253-meeting-rooms-ii/meeting-rooms-ii.cpp | class Solution {
public:
int minMeetingRooms(vector<vector<int>>& intervals) {
std::unordered_map<int, int> prefix;
std::unordered_set<int> keys;
for (auto& vec : intervals) {
prefix[vec[0]] += 1;
keys.insert(vec[0]);
prefix[vec[1]] -= 1;
keys.... | ALGO | 0.999994 | 6.423057 |
f738f258-fb9a-4289-9943-b6636ae31d24 | liuzilun/CODE | src/StudyNetWork/CodingInterviewChinese2/22_KthNodeFromEnd/KthNodeFromEnd.cpp | //==================================================================
// ָOfferԹپͱ⡷
// ߣκ
//==================================================================
// 22еk
// Ŀһеk㡣Ϊ˷ϴ˵ϰߣ
// 1ʼβǵ1㡣һ6㣬
// ͷ㿪ʼǵֵ123456ĵ3
// ֵΪ4Ľ㡣
#include <cstdio>
#include "..\Utilities\List.h"
ListNode* FindKthToTail(ListNode* pListHead, uns... | ALGO | 0.996141 | 5.066403 |
ee326c94-1db9-4a25-be11-50a078bf7294 | jhasudhakar/leetcode | 96_unique_bst_count.cpp | class Solution
{
public:
int numTrees(int n)
{
int ret = 0;
unsigned int* count = new unsigned int [n+4];
for(unsigned int i=0; i<=n; i++)
{
count[i] = 0;
}
count[0] = 1;
count[1] = 1;
count[2] = 2;
if(n<=2) {
ret = count[n];
delete [] count;
... | ALGO | 0.999989 | 5.558069 |
5a1a844f-db7d-4f4f-a09e-1ca41f91381a | bartekKarczewski/Stroustrup-PPP-exercises | chapter-4/exercise-15.cpp | /*Chapter 4 ** excercise 15:
Program displays n number of primes in ascending order */
#include "../std_lib_facilities.h"
#include <iostream>
void display(vector<int> primes){
for(auto item: primes){
cout << item << " ";
}
}
void get_primes(int amount, vector<int> &primes){
for(int i = 3; pr... | ALGO | 0.993316 | 4.691838 |
307e6521-8c52-49cb-8816-1cb82d153203 | danXyu/hacker_rank | algorithms/arrays_and_sorting/quicksort4.cpp | #include <cmath>
#include <cstdio>
#include <vector>
#include <iostream>
#include <algorithm>
using namespace std;
// Global variable to keep track of quickSort swaps.
int numQuickSortSwaps = 0;
int insertionSortShifts(vector<int> arr);
void quickSort(vector<int>& arr, int i, int k);
int partition(vector<int>& arr, i... | ALGO | 0.999976 | 4.734619 |
9fe3da65-bc95-417c-9cc6-f92d9b863cfe | TheAlphaBoy/Leetcode-Questions | 0094-binary-tree-inorder-traversal/0094-binary-tree-inorder-traversal.cpp | /**
* Definition for a binary tree node.
* struct TreeNode {
* int val;
* TreeNode *left;
* TreeNode *right;
* TreeNode() : val(0), left(nullptr), right(nullptr) {}
* TreeNode(int x) : val(x), left(nullptr), right(nullptr) {}
* TreeNode(int x, TreeNode *left, TreeNode *right) : val(x), l... | ALGO | 0.999998 | 6.55478 |
27f8b367-64dd-4de4-9ab3-175e9a031951 | haliluysal/udemy-akfsf | src/kalmanfilter_lkf_student.cpp | // ------------------------------------------------------------------------------- //
// Advanced Kalman Filtering and Sensor Fusion Course - Linear Kalman Filter
//
// ####### STUDENT FILE #######
//
// Usage:
// -Rename this file to "kalmanfilter.cpp" if you want to use this code.
#include "kalmanfilter.h"
#include ... | ALGO | 0.984564 | 7.399373 |
be718a7e-27b9-49eb-b994-43ff58d5c90a | singhpranjal594/LEETCODE-AND-GFG | 39-combination-sum/39-combination-sum.cpp | class Solution {
public:
void re(int i,int target,vector<int>& candidates,vector<vector<int>>&ans,vector<int> &ans1)
{
if(i==candidates.size())
{
if(target==0)
{
ans.push_back(ans1);
}
// return;
return;
}
... | ALGO | 0.999976 | 6.342691 |
a5798ad2-18f6-4078-bd87-b1f27ffe1aea | Mayurakkar10/c-practicals | function/FunctionRecursion/countdigits.cpp | #include<stdio.h>
int count=0;
int main()
{
int num;
void countDigits(int);
printf("\nEnter a number: ");
scanf("%d",&num);
countDigits(num);
return 0;
}
void countDigits(int num)
{
if(num!=0)
{
num = num/10;
++count;
countDigits(num);
}
else
{
... | ALGO | 0.999652 | 3.687627 |
4dd989f8-9a5e-4830-88c4-89972fbe32e5 | Ayesha049/all_contest_codes | ALL CODES/L2 T2 practice/accounting.cpp | #include<bits/stdc++.h>
using namespace std;
int isprime(int n)
{
if(n==2)
return 1;
for(int i=2;i*i<=n;i++)
{
if(n%i==0)
return 0;
}
return 1;
}
int main()
{
int ta,tb,n;
cin>>ta>>tb>>n;
int a=abs(ta);
int b=abs(tb);
if((a==0 && b!=0) )
cou... | ALGO | 0.999977 | 4.315185 |
9024688a-5bd5-4fc5-b385-d3aa94059741 | abhijitmondall/XPSC | Contests/Codechef/CC_C18-Div4/Maximise_Sum.cpp | #include <bits/stdc++.h>
using namespace std;
int main()
{
ios::sync_with_stdio(false);
cin.tie(NULL);
int t;
cin >> t;
while (t--)
{
int n;
cin >> n;
vector<int> v(n);
for (int i = 0; i < n; i++)
{
cin >> v[i];
}
sort(v.begin(), v.end());
i... | ALGO | 0.99998 | 4.428486 |
a08479a8-4c91-427b-b7ad-fbadf23fbc30 | CodeLikeMagic/Code-Buzz | 0938-range-sum-of-bst/0938-range-sum-of-bst.cpp | /**
* Definition for a binary tree node.
* struct TreeNode {
* int val;
* TreeNode *left;
* TreeNode *right;
* TreeNode() : val(0), left(nullptr), right(nullptr) {}
* TreeNode(int x) : val(x), left(nullptr), right(nullptr) {}
* TreeNode(int x, TreeNode *left, TreeNode *right) : val(x), l... | ALGO | 0.999997 | 6.4262 |
1be39e60-8156-49b8-aef7-67eb9f47113c | MoeinGhaniyoun/LLVM-SLH-RISCV | libcxx/test/std/containers/associative/map/map.ops/equal_range_transparent.pass.cpp | // UNSUPPORTED: c++03, c++11
// <map>
// class map
// template<typename K>
// pair<iterator,iterator> equal_range(const K& x); // C++14
// template<typename K>
// pair<const_iterator,const_iterator> equal_range(const K& x) const;
// // C++14
#include <cassert>
#include <map>
#inc... | TEST | 0.981067 | 5.229283 |
b11810a9-4656-45e7-b358-a50c63aab14e | raincross7/code-similarity | codes/train_code/problem209/problem209_96.cpp | #include <bits/stdc++.h>
using namespace std;
// #include <atcoder/all>
// using namespace atcoder;
typedef long long ll;
typedef pair<ll,ll> P;
typedef pair<P,ll> PLL;
typedef pair<P,P> PP;
typedef vector<ll> llVEC;
typedef vector<P> PVEC;
typedef priority_queue<P,PVEC,greater<P> > PPQ;
typedef priority_queue<ll, llV... | ALGO | 0.999678 | 4.246736 |
d3edf1ad-4150-4df7-afb3-a655965a9cc3 | raincross7/code-similarity | codes/train_code/problem367/problem367_162.cpp | #include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <iostream>
#include <string>
#include <vector>
#include <map>
#include <unordered_map>
#include <queue>
#include <algorithm>
#include <bits/stdc++.h>
#include <cmath>
#include <limits>
using namespace std;
typedef long long LL;
using Graph = vector<... | ALGO | 0.999864 | 4.488688 |
79bb7358-73ae-4233-9852-591c1eabc59b | gajgeospatial/boost_1_86_0 | libs/intrusive/example/doc_list_algorithms.cpp | struct my_node
{
my_node *next_, *prev_;
//other members...
};
//Define our own list_node_traits
struct my_list_node_traits
{
typedef my_node node;
typedef my_node * node_ptr;
typedef const my_node * const_nod... | ALGO | 0.992914 | 6.41823 |
c28952f1-b670-4810-9714-9899e0452b85 | jina4066/MJU-PS-Study | YOUNGHWAN/백준/2108_통계학.cpp | #include <bits/stdc++.h>
using namespace std;
int main()
{
ios_base::sync_with_stdio(false);
cin.tie(NULL);
int n;
cin >> n;
vector<int> v(n);
long long sum = 0;
int cnt[8001] = {0};
for (int i = 0; i < n; ++i)
{
cin >> v[i];
sum += v[i];
cnt[v[i] + 4000]+... | ALGO | 0.999966 | 4.274712 |
85c5de0f-ad1b-4068-9193-78bc97af6015 | shitu13/DSA-Practice | Coding-Platforms/LeetCode/leetcode-14.cpp | /// Longest Common Prefix - LEETCODE 14
class Solution {
public:
string longestCommonPrefix(vector<string>& strs) {
string ans = "";
for (int i = 0; i < strs[0].length(); i++) {
char ch = strs[0][i];
bool match = true;
for (int j = 1; j < strs.size(); j++) {
... | ALGO | 0.999906 | 5.905684 |
b994c59a-5375-430b-bd8e-3af03853c98a | sarvex/leetcode-nelua | solution/1000-1099/1019.Next Greater Node In Linked List/Solution.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:
vector<int> nextLarge... | ALGO | 0.999989 | 5.956039 |
8de83d2b-983f-4c21-8234-286fb9e6a5bf | babajr/Path_I | XIII_Patterns/pattern10.cpp | /*
Print below Pattern for input n.
1. n = 3
*
**
***
**
*
*/
#include <iostream>
using namespace std;
/*
Aproach for Pattern related problems:
There are 4 general rules for solving a pattern-based question:
1. We always use nested loops for printing the patterns.
For the outer loop, we count the number of line... | ALGO | 0.99996 | 5.211109 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.