uuid string | repo_name string | relative_path string | content string | category string | algo_rel_score float64 | quality_score float64 |
|---|---|---|---|---|---|---|
e3c7141d-d6e8-451f-92f7-031fa9cc0314 | ishandutta2007/codeforces-t | thenymphsofdelphi/normal/1367/A.cpp | #include<bits/stdc++.h>
using namespace std;
// Optimization
//#pragma GCC optimize("O3")
#define endl '\n'
// Shortcut
#define int long long
#define eb emplace_back
#define pb push_back
#define pob pop_back
#define mp make_pair
#define upb upper_bound
#define lwb lower_bound
#define fi first
#define se second
#def... | ALGO | 0.999894 | 4.447476 |
638524eb-95f7-47d3-a5ca-24dcc5539ab2 | hjiang13/LLMs-in-IR | POJ-104/29/1064.cpp | #include <iostream>
using namespace std;
double qh(int n);
int main(){
int m,k;
int x[10000];
cin >> "%d",&m);
for(k=0; k<m; k++){
cin >> "%d",&x[k]);
}
int *ptr;
for(k=0; k<m; k++){
ptr=&x[k];
cout << "%.3lf\n",qh(*ptr));
}
return 0;
}
double qh(int n){
int i;
double f1=1.0,f2=2.0;
double cur=f2/f1,e;
for(i=2; i<=n; i... | ALGO | 0.999761 | 3.066775 |
51a1cce6-f1dc-4220-bf7b-bf706967c862 | shreyansh-1711/placements | dsa/13_dp/8_Painting_fence.cpp | /* TOPIC: */
// TIME COMPLEXITY: O()
// SPACE COMPLEXITY: O()
// REFERENCE:
#include <bits/stdc++.h>
using namespace std;
class Solution{
// #define MOD 1000000007
public:
// long long int add(int a, int b){
// return (a%MOD + b%MOD)%MOD;
// }
// long long int multi(int a, int b){
... | ALGO | 0.999949 | 4.762191 |
ca92874e-24ad-4258-8c99-58753802f13a | velazqua/competitive-programming | online-judges/UVa/615/615.cpp | /* Alex Velazquez
* Start: Thu Oct 25 10:40:25 EDT 2012
* End :
*/
#include <algorithm>
#include <bitset>
#include <cmath>
#include <cstdio>
#include <cstdlib>
#include <ctime>
#include <deque>
#include <functional>
#include <iomanip>
#include <iostream>
#include <list>
#include <map>
#include <numeric>
#include <qu... | ALGO | 0.99887 | 4.225448 |
5f7b130b-27b9-435c-982b-0e209fc5fea7 | liaojh1998/Competitive-Programming | CodeChef/JULY17/CALC.cpp | #include <bits/stdc++.h>
using namespace std;
class FastIO{
//#define getchar() (getchar_unlocked()) //For hackerrank
private:
//inline if read speed is needed, huge compilation time required though
//safe no fread implementation
int readInt(int &n){
register int c;
n = 0;
bool neg = false;
c = getchar();
... | ALGO | 0.999953 | 4.082985 |
6bfb85c3-def2-498a-b44e-23fa204efea5 | marianelia/MAI | OOP/oop_exercise_05/oop_exercise_05.cpp | // Лагуткина Мария Сергеевна, М8О-206Б-19
//Вариант 14: пятиугольник, список
#include <iostream>
#include <cmath>
#include <array>
#include <algorithm>
#include <iterator>
#include <memory>
#include <cmath>
#include <string>
using namespace std;
const double PI = 3.1415;
template <class T>
using vertex_t = pair<T, ... | ALGO | 0.998927 | 4.388837 |
1771d5ac-3d41-467b-9fab-7d6a44deb6e4 | kalpesh915/9211_2324 | cpp/overloading2.cpp | #include<iostream>
using namespace std;
class Math{
public:
void sum(int i, int j){
cout<<"\n Sum is "<<(i + j);
}
void sum(int i, int j, int k){
cout<<"\n Sum is "<<(i + j + k);
}
void sum(int i, int j, int k, int l){
cout<<"\n Sum is "<<(i + j + k + l);
}
void... | ALGO | 0.854615 | 4.91576 |
659ec93f-4d44-4652-bafa-5938959f1f60 | ishandutta2007/codeforces | s2speed/normal/915/A.cpp | #include<bits/stdc++.h>
#include<fstream>
using namespace std;
#pragma GCC optimize ("Ofast")
#define all(x) x.begin() , x.end()
#define gcd __gcd
typedef long long int ll;
typedef pair<ll , ll> pll;
typedef pair<int , int> pii;
typedef long double db;
struct piii {
int first , second , third;
};
const ll MAX_N ... | ALGO | 0.99998 | 4.033754 |
dd7daa62-f38b-4f7e-b111-9868ebebc182 | PerciValXIII/Dynamic-Programming-Questions | equal-subset-sum-partition.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 equalPartition(int N, int arr[])
{
int sum = 0;
for(int i =0;i<N;i++)
{
sum=sum+arr[i];
... | ALGO | 0.999774 | 5.708895 |
f7ef4864-c8bf-44fa-ba17-ddbe92c58206 | hughbzhang/NBA_Prediction | scripts/winHistory.cpp | // This file prints out the win history of any given team in any given year.
// Input the parsed data for that year (these files are stored in PARSED_DATA_WITH_DATE_AND_OT)
#include <cstdio>
#include <iostream>
#include <fstream>
#include <map>
#include <assert.h>
using namespace std;
const int numTeams = 30;
string... | ALGO | 0.992487 | 3.769024 |
74f08fd6-9adb-43c4-86e0-3f19bab54ec3 | raghavKasyap/cp_templates | segment_tree/05_range_assign_query_value.cpp | #include <bits/stdc++.h>
using namespace std;
const int INF = 1e9;
const int MOD = 1000000007; // 998244353
#define fastIO \
ios::sync_with_stdio(false); \
cin.tie(NULL); ... | ALGO | 0.999884 | 5.229487 |
36f53f48-09a8-4276-b3a5-713d4f8f303d | DF-erlian/tao | gem5-stable/src/systemc/tests/systemc/misc/unit/data/datawidth_bool_to_signed/promote/datawidth.cpp | /*****************************************************************************
datawidth.cpp --
Original Author: Martin Janssen, Synopsys, Inc., 2002-02-15
*****************************************************************************/
/**************************************************************************... | ALGO | 0.943173 | 5.659448 |
5fd75a3f-0648-4b61-a628-c1cf5e08bd5c | TimKingNF/leetcode | test/cn/_55_II.ping-heng-er-cha-shu-lcof.cpp | //
// Created by <EMAIL> on 2020/6/15.
//
#include "gtest/gtest.h"
#include "header.h"
#include "_55_II.ping-heng-er-cha-shu-lcof.h"
namespace LeetCode_55_II {
typedef string ArgumentType;
typedef bool ResultType;
typedef tuple<ArgumentType, ResultType> ParamType;
struct convert {
int operator() (string v) {
... | TEST | 0.984751 | 6.492941 |
0d58aff3-2236-40a4-9b90-8d280aa07cba | tapilyoca/compprog-notebook | DATASTRUCTS/segtree_lazy.cpp | #ifndef SNIPPETS_HPP
#include "../snippets.hpp"
#endif
/* Lazy propagating range sum segtree with range addition updates.
It might be convenient to replace ll val with a struct,
and then overload the + operator */
struct Segtree {
ll l, r;
Segtree *lt, *rt;
ll val;
ll lazy = 0;
void combine() {
... | ALGO | 0.998495 | 6.280519 |
cae841b7-62dc-45e9-ab18-e3401f9dd3e1 | beelisais2793/FX | Synthesizer/Waves/PhysicalModel/Physically-based-modelling/FluidSimulation/FluidSimulation/include/eigen-eigen-323c052e1731/bench/bench_gemm.cpp |
// g++-4.4 bench_gemm.cpp -I .. -O2 -DNDEBUG -lrt -fopenmp && OMP_NUM_THREADS=2 ./a.out
// icpc bench_gemm.cpp -I .. -O3 -DNDEBUG -lrt -openmp && OMP_NUM_THREADS=2 ./a.out
// Compilation options:
//
// -DSCALAR=std::complex<double>
// -DSCALARA=double or -DSCALARB=double
// -DHAVE_BLAS
// -DDECOUPLED
//
#include... | TOOL | 0.973816 | 5.829477 |
32a9f639-a37a-4c00-bd8f-a0fcf1bce7e1 | ishandutta2007/codeforces | bigbag/normal/1472/D.cpp | /**
* created: 04/01/2021, 16:43:18
**/
#include <bits/stdc++.h>
using namespace std;
const int max_n = 200222, inf = 1000111222;
int t, n, a[max_n];
int main() {
//freopen("input.txt", "r", stdin);
//freopen("output.txt", "w", stdout);
scanf("%d", &t);
while (t--) {
scanf("%d", &n);
... | ALGO | 0.999986 | 4.689977 |
5645eb2f-1b25-4922-9322-3ae08357dd91 | helloobaby/llvm_msvc | lldb/test/API/commands/log/basic/main.cpp | #include <cstdlib>
#include <string>
#include <fstream>
#include <iostream>
int
product (int x, int y)
{
int result = x * y;
return result;
}
int
sum (int a, int b)
{
int result = a + b;
return result;
}
int
strange_max (int m, int n)
{
if (m > n)
return m;
else if (n > m)
ret... | ALGO | 0.93521 | 4.377622 |
d1e201bf-f5d7-45d5-a94d-1446daf0f39f | shweta-raj12/Basic-C- | swapping_without_using_third_variable.cpp | // C++ program to swap two numbers without using 3rd variable
#include <bits/stdc++.h>
using namespace std;
// Driver code
int main()
{
int a = 2, b = 3;
cout << "Before swapping a = " << a << " , b = " << b
<< endl;
// applying algorithm
b = a + b;
a = b - a;
b = b - a;
cout <... | ALGO | 0.999894 | 4.527406 |
cf14b49f-0280-4987-8485-8d0e93bda4d9 | madhuiitb/CPP_New | Day1/Function_overloading/inline.cpp | #include <iostream>
using namespace std;
int Square(int x){
return x*x;
}
# define Square1(x) x*x
# define Square2(x) x*x
inline int Square3(int x){
return x*x;
}
int main(){
int val = 5;
int result = Square(val);
cout<<"Square Value::- "<<result<<endl;
int result1 = Square1(val);
cout<<"Square2 Val... | ALGO | 0.888685 | 4.926609 |
4a716b4c-f089-4602-a9e0-1646984989cc | Riyaz-khan-shuvo/codeChef | CHEFONDATE.cpp | #include <bits/stdc++.h>
using namespace std;
int main()
{
int t, a, b;
scanf("%d", &t);
while (t--)
{
scanf("%d %d", &a, &b);
if (a >= b)
{
printf("YES\n");
}
else
{
printf("NO\n");
}
}
return 0;
} | ALGO | 0.999849 | 4.010845 |
bd71d519-5056-429b-a13f-1047037777ff | NCommander/openbsd-src-with-branches | gnu/llvm/llvm/tools/llvm-tapi-diff/DiffEngine.cpp | using namespace llvm;
using namespace MachO;
using namespace object;
StringRef setOrderIndicator(InterfaceInputOrder Order) {
return ((Order == lhs) ? "< " : "> ");
}
// The following template specialization implementations
// need to be explicitly placed into the llvm namespace
// to work around a GCC 4.8 bug.
nam... | TOOL | 0.861514 | 5.478912 |
73b977d9-acef-45c4-a290-50c51f72333e | leokang123/Algorithm | 2.7.해시/회사있사람_해시.cpp | #include <bits/stdc++.h>
using namespace std;
int main (void) {
cin.tie(nullptr)->sync_with_stdio(false);
unordered_set <string> s;
int n; cin >> n;
while (n--) {
string a, b; cin >> a >> b;
if (b == "enter") s.insert(a);
else s.erase(a);
}
// unoreder_set이기 때문에 정렬하려면 다른 자료형에 담아야함
vector <st... | ALGO | 0.998509 | 4.740858 |
3da173ea-df86-479f-aff0-09a8a53b9abb | Prontent11/CP | C_Paint_the_Array.cpp | #include <bits/stdc++.h>
using namespace std;
#define ar array
#define ll long long
const int MAX_N = 1e5 + 1;
const ll MOD = 1e9 + 7;
const ll INF = 1e9;
void solve() {
int n;cin>>n;
vector<ll>a(n);
for (int i = 0; i < n; i++)
{
cin>>a[i];
}
ll gEven=0, gOdd=0;
for (int i = 0; i <n; i+=2)
{
gEven=__gcd(g... | ALGO | 0.999953 | 4.290817 |
1add97e4-ad7f-4550-b07c-643b018d9688 | RuYunW/homework_code | git面向对象程序设计及C++/实验6/chapt_3_demo/example3_26.cpp | //example3_26.cppļһЩͨ
#include<iostream>
#include "example3_26_student.h"
using namespace std;
const int N=10;
void menu();
void OutputStu( Student *array );
void InputStu(Student *array);
int SearchStu( Student *array, char *na);
int count=0;
int main()
{
Student array[N];
int choice;
do
{
menu();
cout<<"... | TOOL | 0.914772 | 3.20201 |
10c0f242-d4b1-4972-9f3a-703d734eddde | RUiN-jiarun/LeetCode | 322.零钱兑换.cpp | /*
* @lc app=leetcode.cn id=322 lang=cpp
*
* [322] 零钱兑换
*/
// @lc code=start
class Solution {
public:
int coinChange(vector<int>& coins, int amount) {
vector<int> dp(amount+1, amount+1);
dp[0] = 0;
for (int i = 0; i < dp.size(); i++) {
for (int coin : coins) {
... | ALGO | 0.999915 | 6.113142 |
e3648546-aa0d-4c52-9c45-3d4387eaeb71 | kaiumuddin/DSA-Codes | Dynamic_Programming_Old/canSum-howSum-bestSum/bestSum.cpp | #include <bits/stdc++.h>
using namespace std;
using ull = unsigned long long int;
map<int, ull> memo = {};
void pMemo()
{
for (auto e : memo)
cout << e.first << "\t" << e.second << endl;
}
void pVector(vector<int> &v)
{
for (int i = 0; i < v.size(); i++)
cout << v.at(i) << " ";
cout << e... | ALGO | 0.999749 | 5.066031 |
c03da748-5929-4d87-916b-6c1529c8d47f | sadraiiali/ShootYekZarb | player/Lib/rcsc/action/kick_table.cpp | // -*-c++-*-
/*!
\file kick_table.cpp
\brief kick planner and cache holder class Source File
*/
/////////////////////////////////////////////////////////////////////
#ifdef HAVE_CONFIG_H
#include <config.h>
#endif
#include "kick_table.h"
#include <rcsc/player/world_model.h>
#include <rcsc/geom/ray_2d.h>
#inclu... | ALGO | 0.980165 | 5.78673 |
6553eac9-3e48-43b7-9893-1518664179b1 | daniell107/Practica2 | Punto2R5.cpp | /*
* Nombre del archivo: Punto2R5.cpp
* Descripcion: A este programa se le ingresa un puntero, que apunta a
* un entero y lo eleva al cuadrado y despues debe retornar el entero.
* Autor: Carlos Daniel Marin 1663787
* Javier Alexis Orozco 1663928
* Daniel Mejia 1663916
* Fecha de creacion: 26 / Abril... | ALGO | 0.983406 | 3.641802 |
162f7695-533e-43dc-96e8-216cff2ac729 | DuyMinh0102/My_Work | List STR_B - 18-10-2024/str_b5/str_b5.cpp | #include <bits/stdc++.h>
using namespace std;
string s;
int m1, m2;
int main()
{
getline(cin , s);
m1 = s.size()/2-1;
if (s.size()%2 == 0) m2=m1+1;
else m2 = s.size()/2 + 1;
for (int i = m1; i >= 0; i--){
if (s[i] != s[m2]){
c... | ALGO | 0.999968 | 3.352525 |
8ee5e1eb-2d31-46bb-bc12-166fe0604ff5 | rahulkumardev24/Flutter-All-Animation- | 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.998733 | 6.76775 |
7ef5d80e-af90-4c94-b04d-628026f0bf39 | Pyk017/Competetive-Programming | GFG/Arrays/Cyclically rotate an array by one/Solution .cpp | #include<bits/stdc++.h>
using namespace std;
void rotate(int arr[], int n) {
int i = n - 1;
int temp = arr[i];
while (i > 0) {
arr[i] = arr[i - 1];
i -= 1;
}
arr[0] = temp;
}
int main() {
int n;
cin >> n;
int a[n], i;
for (i = 0; i < n; i++) {
... | ALGO | 0.999983 | 4.408078 |
1be6f19e-06d6-45f0-aa1a-c1a9bbdd8dff | Volkov27/first | Brackets/brackets/brackets.cpp | #include <stdio.h>
#include <stdlib.h>
#include <malloc.h>
#include <string.h>
#define STACK_MAX_SIZE 100
typedef struct Stack_tag {
char data[STACK_MAX_SIZE];
int size;
} Stack_t;
void push(Stack_t* stack, char value) {
stack->data[stack->size] = value;
stack->size++;
/*printf_s("%c", value);*/
... | ALGO | 0.999346 | 3.131662 |
b678380f-2b3d-49c6-84f2-aba063ab86f0 | rishi4069/CipherSchools-T.A.-Assessment | unique_array_sum.cpp | #include <bits/stdc++.h>
using namespace std;
vector<int>num_arr(int N)
{
vector<int> v;
for (int i = 1; i <= N / 2; i++) {
v.push_back(i);
v.push_back(-i);
}
if (N % 2 == 1)
v.push_back(0);
return v;
}
int main()
{
int N;
cin>>N;
vector<int> v;
v=num_arr(N);... | ALGO | 0.999863 | 4.592143 |
1bce333e-b530-4fd7-8506-5a503a6a4cc0 | TheCenturiaGames/Sobrassada_Engine | SobrassadaEngine/Libs/RecastDetour/Detour/Source/DetourNavMeshBuilder.cpp | #include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <float.h>
#include "DetourNavMesh.h"
#include "DetourCommon.h"
#include "DetourMath.h"
#include "DetourNavMeshBuilder.h"
#include "DetourAlloc.h"
#include "DetourAssert.h"
static unsigned short MESH_NULL_IDX = 0xffff;
struct BVItem
{
unsigned short ... | ALGO | 0.992218 | 7.030249 |
26700662-f821-4231-87ef-0518fc9fdf83 | micklevast/Striver-191-SDE_Sheet-Vishal_chauhan | Day20/Q5/meth0_i.cpp | #include<bits/stdc++.h>
using namespace std;
class Solution {
public:
bool isValidBST(TreeNode* root, TreeNode* minNode = nullptr, TreeNode* maxNode = nullptr) {
if (root == nullptr) {
return true;
}
if ((minNode && root->val <= minNode->val) || (maxNode && root->val >= maxNode-... | ALGO | 0.999986 | 6.939436 |
82b5d737-02e0-4174-a415-8172b80a8cbb | YBenPan/Competitive-Programming | USACO/Silver/recording.cpp | #include <bits/stdc++.h>
using namespace std;
#define LL long long
#define pb push_back
#define MOD 1000000007
#define int LL
#define vi vector<long long>
#define pi pair<long long, long long>
pi a[155];
bool cmp(pi x, pi y)
{
if (x.second == y.second) return x.first < y.first;
return x.second < y.second;
}
mai... | ALGO | 0.999951 | 4.253364 |
a2a3ccb5-8780-4f34-9662-aa26627f06af | ishandutta2007/codeforces | tearinfree/normal/938/A.cpp | #include <cstdio>
int main() {
int n;
char str[101];
scanf("%d%s",&n,str);
int f=0;
for(int i=0;i<n;i++) {
if(str[i] == 'a' || str[i] == 'e' || str[i] == 'o' || str[i] == 'i' || str[i] == 'u' || str[i] =='y') {
if(!f) printf("%c",str[i]);
f=1;
}
else printf("%c",str[i]),f=0;
}
} | ALGO | 0.999102 | 3.43184 |
e0a7f389-9f3e-41e0-8c34-e9479d67dd67 | sreakdgeek/Path-Planning | src/Eigen-3.3/doc/examples/Tutorial_ReductionsVisitorsBroadcasting_broadcast_simple_rowwise.cpp | #include <iostream>
#include <Eigen/Dense>
using namespace std;
int main()
{
Eigen::MatrixXf mat(2,4);
Eigen::VectorXf v(4);
mat << 1, 2, 6, 9,
3, 1, 7, 2;
v << 0,1,2,3;
//add v to each row of m
mat.rowwise() += v.transpose();
std::cout << "Broadcasting result: " << std::... | ALGO | 0.993095 | 4.296038 |
2a0f360c-0870-4257-b0ec-91dc410a665a | MatthieuCrouzet/8INF840-D1 | exercice1/bataille.cpp | // Devoir1_CROUZET_BRANGER_8INF840_A2016.cpp : Defines the entry point for the console application.
#include <cstdlib>
#include <iostream>
#include "Pile.h"
#include "Carte.h"
#include "Joueur.h"
#include <ctime>
using namespace std;
void remplir_pile(Pile<Carte> & p)
{
for (int i = 0; i < 100;i++)
{
Carte c = C... | TOOL | 0.853001 | 3.209655 |
64008c63-c662-4bf5-9ddc-bd7c908a7f09 | harsh-kain/leetcode_problems | intersectionOfLinkedList.cpp | #include<iostream>
using namespace std;
// Definition for singly-linked list.
struct ListNode {
int val;
ListNode *next;
ListNode(int x) : val(x), next(NULL) {}
};
class Solution {
public:
ListNode *getIntersectionNode(ListNode *headA, ListNode *headB) {
ListNode * curr = headA;
int le... | ALGO | 0.999724 | 5.139327 |
c970c717-7b24-4db5-b038-857aedc4e288 | jakshat2/Codeforces-Div.-2-A-Ladder-a2oj-Solutions | A_Buy_the_String.cpp | #include <bits/stdc++.h>
#define lli long long int
#define endl "\n"
//scanf("%d", &n);
//printf("YES\n" );
using namespace std;
int main()
{
typedef vector<int> vi;
typedef pair<int, int> pi;
ios::sync_with_stdio(0);
cin.tie(0);
cout.tie(0);
int t;
cin >> t;
while (t--)
{
i... | ALGO | 0.999337 | 3.538079 |
af8ccbec-2ae7-4cb9-bb69-a7963af65342 | ethanrublee/catkin-opencv | modules/objdetect/src/lsvmparser.cpp | #include "precomp.hpp"
#include <stdio.h>
#include "string.h"
#include "_lsvmparser.h"
#include "_lsvm_error.h"
int isMODEL (char *str){
char stag [] = "<Model>";
char etag [] = "</Model>";
if(strcmp(stag, str) == 0)return MODEL;
if(strcmp(etag, str) == 0)return EMODEL;
return 0;
}
int isP ... | TOOL | 0.949423 | 3.983332 |
17b28961-2662-4cc1-8c00-3b6c8d576546 | 18-RAJAT/ONLINE-JUDGE | C_Lunar_New_Year_and_Number_Division.cpp | #include<bits/stdc++.h>
using namespace std;
#define int long long
signed main()
{
int n;
cin>>n;
int a[n];
for(int i=0;i<n;++i)
{
cin>>a[i];
}
sort(a,a+n);
int sum=0;
for(int i=0;i<n/2;++i)
{
sum+=(a[i]+a[n-i-1])*(a[i]+a[n-i-1]);
}
cout<<sum<<"\n";
re... | ALGO | 0.999973 | 4.165069 |
b115b4e1-718f-4157-af69-1d96b0455b78 | Kavarna/Path-tracer | PathTracer/Assimp/code/PostProcessing/TriangulateProcess.cpp | /** @file TriangulateProcess.cpp
* @brief Implementation of the post processing step to split up
* all faces with more than three indices into triangles.
*
*
* The triangulation algorithm will handle concave or convex polygons.
* Self-intersecting or non-planar polygons are not rejected, but
* they're pr... | ALGO | 0.932066 | 7.361982 |
7ed6439a-4e96-426a-ae49-b9641a52396f | lchyeon0123/Kairos | libraries/opencv/samples/cpp/peopledetect.cpp | #include <opencv2/objdetect.hpp>
#include <opencv2/highgui.hpp>
#include <opencv2/imgproc.hpp>
#include <opencv2/videoio.hpp>
#include <iostream>
#include <iomanip>
using namespace cv;
using namespace std;
class Detector
{
enum Mode { Default, Daimler } m;
HOGDescriptor hog, hog_d;
public:
Detector() : m(... | ALGO | 0.984084 | 7.277886 |
db1291b3-11cf-4c16-894d-25efa0195594 | Aleena-Mishra-10/Data-Structure | String/Split the binary string into substrings with equal number of 0s and 1s.cpp | int maxSubStr(string str, int n)
{
// To store the count of 0s and 1s
int count0 = 0, count1 = 0;
// To store the count of maximum
// substrings str can be divided into
int cnt = 0;
for (int i = 0; i < n; i++) {
if (str[i] == '0') {
count0++;
}
... | ALGO | 0.999858 | 5.847803 |
1f0b46f5-bb5c-4783-96e6-fa0c04b16595 | zigal0/Coursera_git | Framework/test_equation.cpp | #include <iostream>
#include <map>
#include <set>
#include <sstream>
#include <stdexcept>
#include <string>
#include <vector>
#include <cmath>
using namespace std;
template<class T>
ostream &operator<<(ostream &os, const vector<T> &s) {
os << "{";
bool first = true;
for (const auto &x : s) {
if (!... | ALGO | 0.998219 | 4.393319 |
53854b4f-9c05-4bb7-8f2c-cae179e1bab5 | SumitKrShakya/Dsa-Practice-Questions | Striver Sheet/array/022. BFS of graph.cpp | //{ Driver Code Starts
#include <bits/stdc++.h>
using namespace std;
// } Driver Code Ends
class Solution {
public:
// Function to return Breadth First Traversal of given graph.
vector<int> bfsOfGraph(int V, vector<int> adj[]) {
vector<int>ans;
vector<int>vis(V,0);
queue<int>q;
... | ALGO | 0.999795 | 6.275231 |
db4419e6-6a6c-4904-9da8-898d5c51abb9 | mdshadesh/Beecrowd-Online-Judge-main | 1093.cpp | #include<iostream>
#include <stdio.h>
#include <math.h>
using namespace std;
double gambler(int n1, int n2, int at){
double dado;
if(at == 3){
return (double)n1/(double)(n1+n2);
}else{
dado = 1.0 - (6-at)/6.0;
dado = (1 - dado)/dado;
... | ALGO | 0.998973 | 3.273785 |
4f0af4c8-73c6-4cfe-82f9-064dff2a43db | ayushkr667/NoDayoff | Day17/Check if Number Is Perfect Square.cpp | // Given an integer n, return whether n = k * k for some integer k.
// This should be done without using built-in square root function.
/////////////////////////////////////////////////////////////////////////
bool solve(int n) {
if (n <= 1) return true;
int l = 1;
int r = n / 2;
while (l <= r) {
... | ALGO | 0.998161 | 4.727839 |
ff91bc6c-aac1-4bee-822c-8f4483c1cfcf | xrLil-Batya/X-Ray_1.6_Sources_VS2019 | src/xrGame/ai/ai_monsters_misc.cpp | ////////////////////////////////////////////////////////////////////////////
// Module : ai_monsters_misc.cpp
// Created : 23.07.2002
// Modified : 23.07.2002
// Author : Dmitriy Iassenev
// Description : Miscellanious routines for monsters
/////////////////////////////////////////////////////////////////////////... | ALGO | 0.929449 | 4.506481 |
4e37b812-64f4-45b9-9db1-3f57bbbcbfc2 | t4ichi/algo-method | 動的計画法 (DP)/3 章:部分和問題とナップサック問題/q5.cpp | #include <bits/stdc++.h>
using namespace std;
int main(){
int n,m;
cin >> n >> m;
vector<int> w(n);
for(int i = 0;i < n;i++)cin >> w[i];
const int INF = 1001001;
vector<vector<int>> dp(n+1,vector<int>(m+1,INF));
dp[0][0] = 0;
for(int i = 0;i < n;i++){
for(int j = 0;j <= m;j++){
... | ALGO | 0.999998 | 4.207587 |
a7f90d65-d432-4260-a97f-0dd26a6eed2a | utukaule/DSA | LB live DSA/4 Searching and Sorting/1 Searching/BinarySearch.cpp | #include <iostream>
#include <vector>
using namespace std;
int binerySearch(int arr[], int target, int size)
{
int start = 0;
int end = size - 1;
int mid = start+(end-start)/2;
while (start <= end)
{
int element = arr[mid];
if (element == target)
{
return mid;... | ALGO | 0.999761 | 5.308258 |
b4a6f3cd-ccb4-4c2f-8d69-ab346ffc2a02 | azer89/AnimationPak | AnimationPak/NANOFLANNWrapper2D.cpp | /* ---------- ShapeRadiusMatching V2 ---------- */
#include "NANOFLANNWrapper2D.h"
#include "UtilityFunctions.h"
#include "PointCloud2D.h"
#include "A2DVector.h"
using namespace nanoflann;
NANOFLANNWrapper2D::NANOFLANNWrapper2D() : _pointKDTree(0), _leaf_max_size(10)
{
}
NANOFLANNWrapper2D::~NANOFLANNWrapper2D()
{... | ALGO | 0.958753 | 5.546435 |
60136213-8c00-4000-be8f-6dd2ff9a5d68 | krishnavaidy/euler | largestprime/largestprime.cpp | #include <algorithm>
#include <cmath>
#include <cstdint>
#include <iostream>
class LargestPrime {
private:
public:
uint64_t largestPrime(uint64_t n) {
uint64_t largest_prime = 0;
auto upper_bound = sqrt(n);
for (uint64_t i=2; i<=upper_bound; i++) {
while (n%i==0 && n>0) {
n = n/i;
l... | ALGO | 0.999946 | 5.540199 |
0cef8c6a-5c63-4e9d-9d6b-836c3b39c170 | Ansh-Vikalp/OOPM | Adv_Virtual.cpp | #include <iostream>
using namespace std;
class Vehicle
{
public:
virtual void speed()
{
cout << "In speed of vehicle" << endl;
}
virtual void maintainence()
{
cout << "In Maintainance of Vehicle" << endl;
}
virtual void value()
{
cout << "In Value of Vehicle" ... | TOOL | 0.857163 | 6.236366 |
2a41e642-9ea3-4dce-b357-c6b784983955 | Vishnuvarthan4/Data-Structures-Using-C | data structure/Stack Array.cpp | #include<stdio.h>
#include<stdlib.h>
#define MAX 4
int stack[MAX];
char top =-1;
void push();
void pop();
void display();
int isfull();
int isempty();
int main()
{
int num;
while(1)
{
printf("choose what operation \n 1.push 2.pop 3.display \nOption --> ");
scanf("%d",&num);
switch(num)
{
ca... | ALGO | 0.925795 | 3.665536 |
4d0ba2ff-0329-4e16-b918-436e796053dd | Lhunten01/LeetCode_DSA | 2347-count-nodes-equal-to-average-of-subtree/2347-count-nodes-equal-to-average-of-subtree.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, T... | ALGO | 0.999927 | 6.961101 |
b7babe8b-d567-4ce1-8b06-8816cebfb01e | arisu101/leetcode | longest_common_prefix.cpp | #include <algorithm>
#include <climits>
#include <iostream>
#include <vector>
using namespace std;
class Solution {
public:
string longestCommonPrefix(vector<string> &strs) {
if (strs.empty())
return "";
int minLength = 200;
for (const auto &s : strs) {
minLength = min(minLength, (int)s.size()... | ALGO | 0.998683 | 5.289526 |
a1b3bcb5-16dc-4d1b-8b20-766863333e59 | Sleepingkoala/SDCNanoDegree_term2_MPC_P5 | src/Eigen-3.3/doc/snippets/Triangular_solve.cpp | Matrix3d m = Matrix3d::Zero();
m.triangularView<Eigen::Upper>().setOnes();
cout << "Here is the matrix m:\n" << m << endl;
Matrix3d n = Matrix3d::Ones();
n.triangularView<Eigen::Lower>() *= 2;
cout << "Here is the matrix n:\n" << n << endl;
cout << "And now here is m.inverse()*n, taking advantage of the fact that"
... | ALGO | 0.998439 | 3.70449 |
8672ac9f-efd1-4b80-b018-923503ba5d2e | MuhammadAbuBakarQureshi/Cpp-Learning-Journey | Quadratic Equation/QuadraticEquation.cpp | #include <iostream>
#include <math.h>
using namespace std;
int main()
{
float a, b, c;
cout << "Enter value of a : ";
cin >> a;
cout << "Enter value of b : ";
cin >> b;
cout << "Enter value of c : ";
cin >> c;
float discriminant, x1, x2, realPart, imaginaryPart;
discrimin... | ALGO | 0.997175 | 3.817451 |
c338a399-1078-43a1-b6c4-1dccfd1ed4dd | ArjunTa1war/codeforces | 1328b.cpp | #include <iostream>
#include <string>
#include <algorithm>
#include <cmath>
#include <numeric>
#define ll long long
using namespace std;
void solve()
{
ll n,k;
cin>>n>>k;
ll sum=0,x=0;
for (int i = 1; i <= n; i++)
{
sum+=i;
if (sum>=k)
{
x =i;
break;
}
... | ALGO | 0.999927 | 3.607603 |
c81927fe-ccd9-4d37-9e2c-8e6f03ae7802 | akbtech17/dsa | TUF/Number Theory/Prime Number/4_PrintCountOfPrimesInRange.cpp | // 4_PrintCountOfPrimesInRange.cpp
// https://hack.codingblocks.com/app/practice/1/1039/problem
// https://ide.codingblocks.com/s/640449
#include <bits/stdc++.h>
#define MAX 1000000
using namespace std;
// Approach - Prime Sieve
// TC - O(NlogLogN)
// SC - O(N)
class PrimeSieve {
public:
vector<bool> primeSieve() {
... | ALGO | 0.99973 | 5.294063 |
0882237f-e119-4e13-9f5b-8a9c46bd434b | saadqaiser11/PD-Semester1 | Programing Fundamentals/PF Lab7/task7.cpp | #include<iostream>
#include<iomanip>
using namespace std;
main()
{
int count,num;
float n1 = 0,n2 = 0,n3 =0,n4 =0 ,n5 = 0;
float p1,p2,p3,p4,p5;
cout << "Enter numbers count: ";
cin >> count;
for(int x = 1; x <= count;x++)
{
cout << "Enter a number: ";
cin >> num;
i... | ALGO | 0.985492 | 3.050053 |
ea56d261-dd50-4d66-b40a-6dc4d8f7ead2 | delwar03/CF | M_Believe.cpp | #include <bits/stdc++.h>
#define int long long
#define endl '\n'
using namespace std;
const int M = 1e9 + 7;
const int N = 3e5 + 10;
const int INF = 1e15 + 10;
int binPow(int a, int b) {
int res = 1;
while(b) {
if(b & 1) res = (res * a);
a = (a * a);
b >>= 1;
}
return res;
}
vo... | ALGO | 0.999757 | 4.265134 |
402dded9-9493-4649-9fc1-bd9a7c455a1e | M45UDrana/DS-Algo-Problem-Solving | codeforces/1279A.cpp | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<int, int> pii;
typedef pair<string, int> psi;
#define ff first
#define ss second
#define pb(a) push_back(a)
#define mp(a,b) make_pair(a,b)
#define d(a,b,c) cout<<a<<" "<<b<<" "<<c<<'\n'
#define IO ios_base::sync_with_stdio(0);cin.tie... | ALGO | 0.999883 | 4.003395 |
3047d552-540e-4656-96ce-ff4eca3d995a | ploynapat10/prob-solve | week1/ku01_thief.cpp | #include <iostream>
using namespace std;
int main() {
int N, K, T;
int curr_person = 1;
int checked_person = 0;
cin >> N >> K >> T;
int checked_gift[N + 5] = {0};
while (true) {
if (checked_gift[curr_person] == 0) {
checked_gift[curr_person] = 1;
checked_perso... | ALGO | 0.999987 | 3.871171 |
18ac08f1-f3e3-4bf0-83a5-4c8c2da0c109 | ccj5351/DAFStereoNets | src/cpp/MiddEval3/code/imageLib/Convolve.cpp | #include "Image.h"
#include "Error.h"
#include "Convert.h"
#include "Convolve.h"
static int TrimIndex(int k, EBorderMode e, int n)
{
// Compute the index value 0 <= k < n (return -1 for Zero mode)
switch (e)
{
case eBorderReplicate: // replicate border values
return __max(0, __min(n-1, k));
... | ALGO | 0.979662 | 6.849186 |
46fc9a6b-2c11-4853-810c-a3916db0a317 | aydarbek30/ADS_labs | Lab1/Problem f.cpp | #include <iostream>
#include <queue>
#include <cmath>
using namespace std;
bool is_prime(int n){
queue <int> div;
for(int i = 1; i <= n; i++){
if(n % i == 0){
div.push(i);
}
}
if(div.size() == 2){
return true;
}
return false;
}
int main(){
int n;
ci... | ALGO | 0.999966 | 4.443029 |
7bac675f-11d0-4da8-a47a-6250fe44f499 | kbagoli1999/RockPaperScissor | RockPaperScissor/RockPaperScissor/RockPaperScissor.cpp | // RockPaperScissor.cpp : This file contains the methods for following classes : RockPaperScissor, Player, ComputerPlayer and ActualUser
#include <bits/stdc++.h>
#include <iostream>
#include <stdlib.h>
#include <time.h>
#include "RockPaperScissor.h"
using namespace std;
// Method to begin Rock Paper Scissor Game
vo... | TOOL | 0.8539 | 3.37156 |
734fcb09-e2de-432a-874b-8b6d2c290797 | zhumake1993/physx | d3d12-physx/PhysXSDK/source/geomutils/src/intersection/GuIntersectionEdgeEdge.cpp | #include "GuIntersectionEdgeEdge.h"
#include "PsMathUtils.h"
#include "CmPhysXCommon.h"
using namespace physx;
bool Gu::intersectEdgeEdge(const PxVec3& p1, const PxVec3& p2, const PxVec3& dir, const PxVec3& p3, const PxVec3& p4, PxReal& dist, PxVec3& ip)
{
const PxVec3 v1 = p2 - p1;
// Build plane P based on edge ... | ALGO | 0.998415 | 5.781967 |
52a9c1d9-fe13-46ef-b7b2-74a13ad8da6e | parksandrecfan/breploader | src/ps/psedge.cpp | #include <edge.h>
// #include <parasolid.h>
#include <assert.h>
#include <float.h>
namespace pspy {
PSEdge::PSEdge(int id, std::string export_id) {
_id = id;
this->export_id = export_id;
PK_ERROR_t err = PK_ERROR_no_errors;
PK_CURVE_t curve;
PK_CLASS_t curve_class;
PK_VECTOR_t ends[2];
P... | TOOL | 0.974179 | 6.700305 |
b1b684cd-30bd-4127-a337-23e193cad780 | SebasProgrammer/Programacion-Competitiva | clases/clase_07_1909/cola_de_prioridad.cpp | #include <bits/stdc++.h>
using namespace std;
int main() {
priority_queue<int> Q;
Q.push(5); //insertar elemento en O(log n)
Q.push(20);
Q.push(4);
Q.push(10);
cout << Q.top() << "\n"; //devuelve el mayor elem en O(1)
Q.pop(); //borra el mayor elem. en O(log n)
cout << Q.top();
} | ALGO | 0.999317 | 3.871594 |
77f203d6-d53f-4ccd-8ade-50e9b7598b8b | Naeem739/CP | O-Chef & Tupels.cpp | #include <bits/stdc++.h>
using namespace std;
typedef long long int ll;
typedef pair < ll, ll > Pair;
#define endl '\n'
#define Pair pair<ll,ll>
#define all(a)(a).begin(), (a).end()
const ll inf = 1e18 + 123;
const int N = 1e6 + 123;
void answer() {
int n,a,b,c;
cin >> n >> a >> b >> c;
... | ALGO | 0.999846 | 4.329462 |
c6341a36-3e2a-4bf7-a060-3d4d245ad6da | OneDay-OneAlgorithm/KimSangMin | 2/3474_brief.cpp | #include <bits/stdc++.h>
using namespace std;
int n, a;
int main() {
ios_base::sync_with_stdio(false);
cin.tie(NULL);
cout.tie(NULL);
cin >> n;
for(int i = 0; i < n; i++){
cin >> a;
int ret5 =0;
for(int five = 5; five <= a; five*=5) {
ret5 += a / five;
... | ALGO | 0.99978 | 3.811975 |
b68d0782-4ade-45b8-942f-359b88ed2594 | mybirth0407/backjoon_solution | 1212.cpp | #include <iostream>
#include <vector>
using namespace std;
string arr[8] = {"000", "001", "010", "011", "100", "101", "110", "111"};
int main() {
string s;
cin >> s;
long result = 0;
int k = 0;
vector<string> v;
int c = s[0] - '0';
v.push_back(arr[c]);
if (c == 1) {
v[0].erase(v[0].begin());
... | ALGO | 0.999962 | 4.112671 |
169eb057-cb26-4efa-81d0-ad6c83e02663 | hzding621/algorithms | leetcode/cpp/004_median_of_two_sorted_arrays.cpp | #include <iostream>
#include <vector>
#include <algorithm>
using namespace std;
class Solution {
public:
double find_median(const vector<int>& v) {
int n = v.size()-1;
if ( n % 2 ) {
// even length
return (v[n/2] + v[n/2+1]) / 2.0;
} else {
return v[n/2... | ALGO | 0.999985 | 5.889211 |
c6f50286-939d-4146-853d-eb227fda1189 | md-qubais/Data_Structures_Algorithms_and_Competitive_Programming | search_in_rotated_and_sorted_2.cpp | #include<bits/stdc++.h>
#define IOS ios_base::sync_with_stdio(false); cin.tie(NULL)
#define int long long
#define endl "\n"
#define qubais_judge freopen("input.txt","r",stdin); freopen("output.txt","w",stdout)
using namespace std;
bool search(vector<int>& v, int k){
int s=0;
int e=v.size()-1;
while(s<=e){
int mid... | ALGO | 0.999964 | 4.622747 |
4c85774d-2a53-47ca-b9d7-f4c876ad7eba | raincross7/code-similarity | codes/train_code/problem206/problem206_321.cpp | #include <bits/stdc++.h>
using namespace std;
const int INF = 1001001001;
int main() {
int x;
cin >> x;
if (x < 1200) cout << "ABC" << endl;
else cout << "ARC" << endl;
return 0;
} | ALGO | 0.989453 | 4.11671 |
e7e7d763-04d5-4529-9dd3-411becc6bc26 | jencymaryjoseph/learned-cardinality-duckdb | duckdb/extension/icu/third_party/icu/common/ucharstrieiterator.cpp | #include "unicode/utypes.h"
#include "unicode/ucharstrie.h"
#include "unicode/unistr.h"
#include "uvectr32.h"
U_NAMESPACE_BEGIN
UCharsTrie::Iterator::Iterator(ConstChar16Ptr trieUChars, int32_t maxStringLength,
UErrorCode &errorCode)
: uchars_(trieUChars),
pos_(uchars_... | ALGO | 0.976807 | 7.70004 |
ef472e70-205f-4d37-8828-17a0609e8b27 | Smad122/C-Plus-Hash-Tables | tA3/tA3.cpp | #include <iostream>
#include <string>
#include <vector>
#define SizeTable 1500
struct HashTable
{
private:
void FillVectors()
{
for (int i = 0; i < SizeTable; i++)
{
states.push_back(0);
array.push_back("");
}
}
public:
std::vector<std::string> contains;
std::vector<std::string> array;
std::vector<i... | ALGO | 0.99858 | 4.501041 |
f4483599-989b-4934-ac5e-161d81d21318 | james-harder/CS211 | Examples/Week2/plusplus.cpp | #include <iostream>
using namespace std;
int main(void)
{
int x = 5;
cout << 2 * (x++) << endl;
cout << x << endl;
return 0;
}
| TOOL | 0.988473 | 3.840982 |
c137ba8d-1edd-4b2f-8e40-96c5eceaffa1 | ishandutta2007/codeforces | ksun48/normal/1190/D.cpp | #include <bits/stdc++.h>
using namespace std;
#define rep(i, a, b) for(int i = a; i < (b); ++i)
#define trav(a, x) for(auto& a : x)
#define all(x) x.begin(), x.end()
#define sz(x) (int)(x).size()
typedef long long ll;
typedef pair<int, int> pii;
typedef vector<int> vi;
struct FT {
vector<ll> s;
FT(int n) : s(n) {}
... | ALGO | 0.999951 | 3.526925 |
cc9b35e3-9fdc-4c40-8218-9755196466cb | ianvindian/device_yu | gps/utils/LocHeap.cpp | #include <LocHeap.h>
class LocHeapNode {
friend class LocHeap;
// size of of the subtree, excluding self, 1 if no subtree
int mSize;
LocHeapNode* mLeft;
LocHeapNode* mRight;
LocRankable* mData;
public:
inline LocHeapNode(LocRankable& data) :
mSize(1), mLeft(NULL), mRight(NULL), mDa... | ALGO | 0.997679 | 6.439088 |
e6838212-0d43-40a6-b4dd-63ce90f492c6 | muKaustav/DSA | Binary Search Tree/bstPreorder.cpp | #include <bits/stdc++.h>
using namespace std;
class Node
{
public:
int data;
Node *left, *right;
Node(int val)
{
data = val;
left = right = NULL;
}
};
void inorder(Node *root)
{
if (!root)
return;
inorder(root->left);
cout << root->data << " ";
inorder(roo... | ALGO | 0.999982 | 6.095571 |
6fcbbad9-1543-42d6-ab41-0c2d84c5fe98 | Dhruvesh16/android_frameworks_av | media/codecs/amrnb/common/src/sqrt_l.cpp | /*
Pathname: ./audio/gsm-amr/c/src/sqrt_l.c
------------------------------------------------------------------------------
REVISION HISTORY
Description: Updated template. Changed function interface to pass in a
pointer to overflow flag into the function instead of using a
global flag. ... | ALGO | 0.999956 | 5.857356 |
2bd69eb2-df7d-4c0a-8a4e-f5e23921208a | SandeepAswathnarayana/self-driving-car-engineer-nd | CarND-Path-Planning-Project/src/Eigen-3.3/test/sparseLM.cpp | #include "main.h"
#include <Eigen/LevenbergMarquardt>
using namespace std;
using namespace Eigen;
template <typename Scalar>
struct sparseGaussianTest : SparseFunctor<Scalar, int>
{
typedef Matrix<Scalar,Dynamic,1> VectorType;
typedef SparseFunctor<Scalar,int> Base;
typedef typename Base::JacobianType JacobianT... | TEST | 0.990686 | 6.130261 |
8f165f0f-1322-4707-85b7-c3ca260e6832 | rhiswell/15418 | assignment3/tools/graphTools.cpp |
#include <algorithm>
#include <climits>
#include <iomanip>
#include <iostream>
#include <string>
#include <vector>
#include "../common/graph.h"
#define CMD_TEXT2BIN "text2bin"
#define CMD_INFO "info"
#define CMD_PRINT "print"
#define CMD_NOOUTEDGES "noout"
#define CMD_NOINEDGES "noin"
#define CMD_... | ALGO | 0.983972 | 5.90026 |
06f79772-b272-4d92-a60c-3d1684f41179 | HonsChon/Godot4.1_CoOperation | thirdparty/astcenc/astcenc_weight_align.cpp | #if !defined(ASTCENC_DECOMPRESS_ONLY)
/**
* @brief Functions for angular-sum algorithm for weight alignment.
*
* This algorithm works as follows:
* - we compute a complex number P as (cos s*i, sin s*i) for each weight,
* where i is the input value and s is a scaling factor based on the spacing between the weigh... | ALGO | 0.999214 | 7.415002 |
f5e82965-714b-436a-bdf3-3bd3d159333f | ssungho/study-coding-test | 프로그래머스/lv3/43105. 정수 삼각형/정수 삼각형.cpp | #include <string>
#include <vector>
#include <algorithm>
using namespace std;
int solution(vector<vector<int>> triangle)
{
int memo[500][500]; // 세로, 가로
int answer = 0;
for(int i = 0; i < triangle[triangle.size() - 1].size(); i++)
{
memo[triangle.size() - 1][i] = triangle[triangle.size() - 1]... | ALGO | 0.999955 | 5.47507 |
023123e3-0c69-450f-8a3f-b6a9001e0132 | HoneyMonster7/frankenstein | initial_tests/graphstat.cpp |
#include <boost/graph/adjacency_list.hpp>
#include <boost/graph/visitors.hpp>
#include <boost/graph/breadth_first_search.hpp>
#include <cstdlib>
#include<string>
#include<time.h>
int main (int argc, char* argv[]){
using namespace boost;
const int matsize=100;
std::cout<<"Prob(out of 10000): ";
int prob;
std::cin>>p... | ALGO | 0.998886 | 4.468362 |
33f666c8-2ade-456d-b2e0-8b0daeba18fc | VARcrypt/VARcoin | src/script/sign.cpp | #include "script/sign.h"
#include "key.h"
#include "keystore.h"
#include "policy/policy.h"
#include "primitives/transaction.h"
#include "script/standard.h"
#include "uint256.h"
typedef std::vector<unsigned char> valtype;
TransactionSignatureCreator::TransactionSignatureCreator(const CKeyStore* keystoreIn, const CTra... | ALGO | 0.944871 | 6.630202 |
5d5ad7cc-9cbb-4478-b4e4-6193c1c4ab8f | AlgorithmStudy-PDA-4th/new-algo | WEEK01/sehyeon/bj 9205 맥주 마시면서 걸어가기.cpp | #include<iostream>
#include<cstring>
#include<queue>
using namespace std;
bool isvisit[100];
pair<int, int> place[100];
int end_x, end_y;
bool bfs(int a, int b, int cnt) {
queue<pair<int, int>> q;
q.push({ a, b });
while (!q.empty()) {
pair<int, int> tmp = q.front();
q.pop();
if (abs(tmp.first - end_x) + ab... | ALGO | 0.999955 | 4.119985 |
4e415881-7dfc-4d4f-b528-ec502b8ff956 | orangeistoxic/DataStructure_Summer2024 | Lab8.cpp | #include<iostream>
#include<string.h>
using namespace std;
int main(){
string ipt;
int N;
cin>>N;
getchar();
string keyboardData=" `1234567890-=qwertyuiop[]asdfghjkl;'zxcvbnm,./";
while(N--){
getline(cin,ipt);
for(int i=0;i<ipt.length();i++){
if(ipt[i]>='A' && ipt... | ALGO | 0.99966 | 3.675766 |
8c68b41c-e79b-43aa-8a59-a4df83a86e9d | Bittu121/DSA_Foundation | string/9_prefixString.cpp | #include<bits/stdc++.h>
using namespace std;
void possiblePrefix(char input[]){
for(int i=0;input[i]!='\0';i++){
for(int j = 0;j<i;j++){
cout<<input[j]<<" ";
}
cout<<endl;
}
}
int main(){
char input[100];
cin>>input;
possiblePrefix(input);
cout<<input;
} | ALGO | 0.999259 | 4.013365 |
cf07dc58-1d7d-4382-ab08-0f34740ce379 | indjec/College-C | Desktop/c++/const1.cpp | #include <iostream>
using namespace std;
class complex
{
int x, y;
public:
complex() {}
complex(float a)
{
x = y = a;
}
complex(float real, float imag)
{
x = real;
y = imag;
}
friend complex sum(complex, complex);
friend void show(complex);
};
complex s... | ALGO | 0.931595 | 4.382053 |
3b68ecff-cfe5-4f22-b358-eb765e2c6be1 | valber-8/geosci | lmp/alt/neigh_gran.cpp | #include "neighbor.h"
#include "neigh_list.h"
#include "atom.h"
#include "group.h"
#include "fix_shear_history.h"
#include "error.h"
using namespace LAMMPS_NS;
/* ----------------------------------------------------------------------
granular particles
N^2 / 2 search for neighbor pairs with partial Newton's 3rd... | ALGO | 0.999744 | 5.934742 |
ee70ee30-ff42-44e3-8315-8404e3854407 | freebsd/wireless | contrib/llvm-project/llvm/lib/Transforms/Utils/BypassSlowDivision.cpp | #include "llvm/Transforms/Utils/BypassSlowDivision.h"
#include "llvm/ADT/DenseMap.h"
#include "llvm/ADT/STLExtras.h"
#include "llvm/ADT/SmallPtrSet.h"
#include "llvm/Transforms/Utils/Local.h"
#include "llvm/Analysis/ValueTracking.h"
#include "llvm/IR/BasicBlock.h"
#include "llvm/IR/Constants.h"
#include "llvm/IR/Derive... | ALGO | 0.96802 | 7.925408 |
a2ac156d-066c-4f9d-b5af-bc86ca5594ea | Zeta0080-cell/c-- | 二叉树-前序遍历.cpp | //-ȫ
//:еһԪ
//Ķ:ӵеΪĶ
//Ķ:ڸֵ
//Ҷ:Ϊ0Ľն˽
//ն˽:ȲΪ0Ľ
//˫ͺ:ĸΪýĺӣӦأýΪӵ˫
//:IJδӸʼ壬Ϊһ㣬ĺΪڶ
#include<bits/stdc++.h>
#define MAXSIZE 100
using namespace std;
typedef int ElemType;
typedef struct TreeNode{
ElemType data;//
TreeNode *lchild;//ָָ
TreeNode *rchild;//ָҺָ
}TreeNode;
typedef TreeNode* BiTree;//һָTreeNode͵ָ
ch... | ALGO | 0.999859 | 3.326849 |
39e9fb32-f12c-4a88-bd5d-6f996ead2856 | moonpiee/codepy | rank.cpp | #include<iostream>
#include<bits/stdc++.h>
#include<string>
#include<vector>
using namespace std;
#define ll long long
int main(){
#ifndef ONLINE_JUDGE
freopen("input.txt","r",stdin);
freopen("output.txt","w",stdout);
#endif
ll n;
string s,t;
cin>>n;
ll p[n];
ll x;
ll th_r;
l... | ALGO | 0.999978 | 3.553921 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.