uuid string | repo_name string | relative_path string | content string | category string | algo_rel_score float64 | quality_score float64 |
|---|---|---|---|---|---|---|
3afc2cc0-e3dd-44b0-a4b8-bda049b8c1e1 | hiro-tacky/practice | algorithm/2-3/2-3-5.cpp | //個数制限付き部分和問題
#include <iostream>
#include <string>
#include <vector>
#include <algorithm>
#include <numeric>
#include <queue>
#include <iomanip>
#include <climits>
#include <string>
#include <cmath>
#include <utility>
using namespace std;
using ll = long long int;
using p = pair<int, int>;
#define NUM 1000000007
ve... | ALGO | 0.999977 | 4.000353 |
df30c09c-7752-43e9-8dff-e40ccfd0de38 | andrewei1316/OJSubmit | DATASOURCE_HDUSubmit/5389/5389_20150906-144103_468MS_7668K_WA.cpp | #include <cstdio>
#include <cstring>
int f(int a, int b)
{
if((a+b)%9)
return (a+b) % 9;
return 9;
}
const int maxsize = 100050;
int x[maxsize];
int dp[maxsize][15];
int main()
{
int t;
scanf ( "%d", &t );
while(t--)
{
int n;
int a, b;
scanf ( "%d%d%d", &n, &a, &b... | ALGO | 0.999786 | 3.726676 |
73adc4c5-8040-4886-b3a0-b5ec16be289a | mmehmetgokce/dataStructers | Lab_Work_2/Lab_Work_2_q4.cpp | #include <iostream>
using namespace std;
int fibonacci(int n) {
if (n == 0) return 0;
if (n == 1) return 1;
return fibonacci(n - 1) + fibonacci(n - 2);
}
int main() {
int n;
cout << "Enter the number of terms of series: ";
cin >> n;
cout << "Fibonacci Series: ";
for (int i = 0; i < n;... | ALGO | 0.999887 | 5.72143 |
da1e6a55-9231-4be9-9b27-57fd5a0fdba8 | ishandutta2007/codeforces | natsugiri/normal/862/B.cpp | #include<stdio.h>
#include<iostream>
#include<vector>
#include<algorithm>
#include<string>
#include<string.h>
using namespace std;
typedef long long LL;
typedef vector<int> VI;
#define REP(i,n) for(int i=0, i##_len=(n); i<i##_len; ++i)
#define EACH(i,c) for(__typeof((c).begin()) i=(c).begin(),i##_end=(c).end();i!=i##... | ALGO | 0.999905 | 4.475176 |
1f6f2798-0d76-4290-b7b9-d4f391366b18 | TusharGautam29/C- | Binary Tree/Assignment 3/Q1.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.999929 | 6.265191 |
2afcae9d-8e59-4347-b1ad-8972472cf783 | Anshika91/codechef_practice | Shoe Fit.cpp | #include <iostream>
using namespace std;
int main() {
int t,n,c=0;
cin>>t;
for(int i=0;i<t;i++)
{
c=0;
for(int j=0;j<3;j++)
{
cin>>n;
if(n==0)
c++;
}
if(c==0||c==3)
cout<<0<<endl;
else
cout<<1<<endl;
}
return 0;
}
| ALGO | 0.999685 | 3.483622 |
6fac55d0-894f-47bb-bd75-8e4423541ed2 | albertonl/comp | OIE/course/1/j_duplicates.cpp | #include <bits/stdc++.h>
#pragma GCC optimize("O3")
typedef long long ll;
using namespace std;
int main () {
ios_base::sync_with_stdio(false);
cin.tie(nullptr);
ll n;
cin >> n;
vector<ll> v(n);
set<ll> s;
for (ll i = 0; i < n; i++) {
cin >> v[i];
}
for (ll i = n-1; i >= 0; i--) {
if (!s.c... | ALGO | 0.999976 | 4.035196 |
8ce5d72d-d1d6-4fe3-9440-29098a99512b | yongyouhe/openmm_ImageCharge | platforms/common/src/CommonImageKernels.cpp | #include "CommonImageKernels.h"
#include "CommonImageKernelSources.h"
#include "openmm/common/BondedUtilities.h"
#include "openmm/common/ComputeForceInfo.h"
#include "openmm/internal/ContextImpl.h"
#include "openmm/common/IntegrationUtilities.h"
#include "openmm/common/ContextSelector.h"
#include "openmm/common/Express... | ALGO | 0.997097 | 5.59548 |
82e2e3fe-ebc2-4c65-a25d-c0633ca1622a | FalconUA/ctl | log_shanks.cpp | #include "ctllog.hpp"
#include "typespec.hpp"
#include <map>
namespace mp {
template <typename T>
T log_shanks(T const& a, T const& b, T const& m, TypeSpecifications<T> const& algo)
{
T n = algo.sqrt(m) + 1;
T an = 1;
for (T i=0; i<n; ++i)
an = (an * a) % m;
std::map<T, T> vals;
for (T i=1, cur=... | ALGO | 0.99904 | 4.44569 |
4a0809c8-fc68-4650-bd68-302f664fa52a | bbrianxiao/Leetcode | Backtracking/17. Letter Combinations of a Phone Number/solution.cpp | class Solution {
vector<string> retval;
unordered_map<char, string> letters = {
{'2', "abc"}, {'3', "def"}, {'4', "ghi"}, {'5', "jkl"},
{'6', "mno"}, {'7', "pqrs"}, {'8', "tuv"}, {'9', "wxyz"}};
public:
void helper(string digits, int index, string temp) {
if (index == digits.size() ... | ALGO | 0.999771 | 6.900289 |
4a94a916-3ec8-4ecb-b35e-0a16bbb01282 | adarshyoga/TaskProf_RegionDiffSched | src/tprof-tbb-lib/examples/parallel_for/tachyon/src/objbound.cpp | /*
* objbound.cpp - This file contains the functions to find bounding boxes
* for the various primitives
*/
#include "machine.h"
#include "types.h"
#include "macros.h"
#include "bndbox.h"
#define OBJBOUND_PRIVATE
#include "objbound.h"
static void globalbound(object ** rootlist, vector * gmin, vector... | ALGO | 0.982324 | 5.294161 |
041bb593-a0c2-40cf-9b37-26fd9e12aac7 | ishandutta2007/codeforces | leaf1415/normal/1406/E.cpp | #include <iostream>
#include <cstdio>
#include <cmath>
#include <ctime>
#include <cstdlib>
#include <cassert>
#include <vector>
#include <list>
#include <stack>
#include <queue>
#include <deque>
#include <map>
#include <set>
#include <bitset>
#include <string>
#include <algorithm>
#include <utility>
#define llint long ... | ALGO | 0.999821 | 3.007768 |
721f8d15-30d5-46af-a6b2-45f5344c2be8 | Pundiraryan/AC_Solutions_CPH | second.cpp | #include<bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
#define int int64_t
#define ordered_set tree<int, null_type,less<int>, rb_tree_tag,tree_order_statistics_node_update>
using namespace std;
using namespace __gnu_pbds;
template <class type1>
using ordered_multiset = tre... | ALGO | 0.999898 | 3.960324 |
95c8e0a3-8582-487c-b255-609f486dcbaa | rohitsinghkcodes/Hacktober-CP-contributions | INTERVIEWBIT/Trees/RecoverBinarySearchTree.cpp | // https://www.interviewbit.com/problems/recover-binary-search-tree/
/**
* Definition for binary tree
* struct TreeNode {
* int val;
* TreeNode *left;
* TreeNode *right;
* TreeNode(int x) : val(x), left(NULL), right(NULL) {}
* };
*/
vector<int> Solution::recoverTree(TreeNode* A) {
// Do not... | ALGO | 0.999999 | 5.642891 |
6317306f-4284-412e-be9d-3d7a9a8f4cb8 | mozilla/spiderweb-spidernode | deps/chakrashim/core/lib/Backend/GlobOptFields.cpp | /*
Field Hoisting
--------------
The backward pass calculates field load values that are reachable from the loop top.
It optimistically assumes that a[] doesn't kill any fields in the hopes that glob opt
will have more information to not kill the field.
During the forward pass the root prepass will assume that the fie... | ALGO | 0.884128 | 3.9001 |
6b8ecb58-3892-49f9-b98d-1b8e8dd07c61 | Raghav1806/Geeks-for-Geeks-DS | treeTraversal.cpp | // Tree traversals: Inorder, Preorder and Postorder
#include <iostream>
using namespace std;
struct Node{
int data;
struct Node *left;
struct Node *right;
};
struct Node *newNode(int x){
struct Node *newptr = new Node;
newptr->data = x;
newptr->left = NULL;
newptr->right = NULL;
return newptr;
}
// Bottom-up... | ALGO | 0.99972 | 5.664883 |
67c495cb-dbc0-4c2d-aee3-8f5d0d82ea0c | DeepRoboticsLab/Lite3_MotionSDK | lib/eigen3/doc/examples/Tutorial_ArrayClass_mult.cpp | #include <Eigen/Dense>
#include <iostream>
using namespace Eigen;
using namespace std;
int main()
{
ArrayXXf a(2,2);
ArrayXXf b(2,2);
a << 1,2,
3,4;
b << 5,6,
7,8;
cout << "a * b = " << endl << a * b << endl;
}
| ALGO | 0.992007 | 3.527115 |
c761bc59-b3e5-4e61-9e7a-847f76a7afa3 | NoOneofConsequencePrime/Solutions | LeetCode/C++/monotonic-array.cpp | #include <iostream>
#include <vector>
#include <string>
#include <algorithm>
#include <queue>
#include <stack>
#include <deque>
#include <unordered_set>
#include <numeric>
using namespace std;
bool isMonotonic(vector<int>& nums) {
int chk = 0;
for (int i = 1; i < nums.size(); i++) {
if (nums[i] > nums[... | ALGO | 0.999869 | 5.207267 |
03cf6a37-6327-4557-b60e-7e34e2f36a96 | SVitalik/Project2 | 2 курс/Лабораторная работа 2_1/Лабораторная работа 2_1/Лабораторная работа 2_1.cpp | #include <iostream>
#include <string>
using namespace std;
int main()
{
setlocale(LC_ALL, "rus");
const int MAX(100);
char mass[MAX];
int i, c = 0, s = 0;
cout << "Введите текст: " << endl;
cin.getline(mass, 100);
for (i = 0; mass[i] != '\0'; i++)
if (mass[i] != ' ' && s == 0)
... | ALGO | 0.998859 | 3.795037 |
682873a7-3365-4adc-af5e-15cdda35cacb | n01e0/pRETzel_logic | libcxx/test/std/algorithms/alg.sorting/alg.set.operations/set.union/set_union_move.pass.cpp | // <algorithm>
// template<InputIterator InIter1, InputIterator InIter2, typename OutIter,
// CopyConstructible Compare>
// requires OutputIterator<OutIter, InIter1::reference>
// && OutputIterator<OutIter, InIter2::reference>
// && Predicate<Compare, InIter1::value_type, InIter2::value_type... | TEST | 0.94649 | 5.695879 |
17617265-1120-4d02-9b27-c67fd7031ad2 | morris821028/UVa | volume013/1342 - That Nice Euler Circuit.cpp | // Euler characteristic, V - E + F = 2
#include <stdio.h>
#include <math.h>
#include <algorithm>
#include <set>
#include <map>
#include <assert.h>
#include <vector>
#include <string.h>
using namespace std;
#define eps 1e-8
struct Pt {
double x, y;
Pt(double a = 0, double b = 0):
x(a), y(b) {}
Pt operato... | ALGO | 0.999812 | 4.186244 |
8aafa083-5a35-4bc4-9063-876a6c329790 | HexRabbit/ACMpractice | poj1751.cpp | #include <cstdio>
#include <algorithm>
#include <iostream>
#include <vector>
#include <cstring>
#include <cmath>
using namespace std;
struct Line
{
int a,b;
double c;
};
Line line[750*750/2];
int x[800],y[800];
vector<Line> ans;
int dset[800];
bool cmp(Line a,Line b) {return a.c < b.c;}
int findrt(int p)
{
if(p == d... | ALGO | 0.999988 | 3.870853 |
43830128-2cdb-4afd-990c-b04d7fa24eb0 | ThySethsarakvath/Data_Structure-Algorithm_TP02 | ex2a.cpp | #include <iostream>
int pow(int m , int n){
if( n == 0){
return 1;
}
else {
return m*pow(m,n-1);
}
}
using namespace std;
int main(){
int m,n;
cout << "Enter a number: ";
cin >> m;
cout << "Enter the power: ";
cin >> n;
cout << m << "^" << n << " = " << pow(m,n... | ALGO | 0.998311 | 5.156183 |
96da0310-5578-4254-b75a-f1028d859ac1 | maborg/treepie2 | treepie2/treepie2.cpp | // treepie2.cpp : Defines the entry point for the application.
//
#include <windows.h>
#include "treepie2.h"
#include "OpenfileBox.h"
#include "AllDir.h"
#define MAX_LOADSTRING 100
#include <GL/gl.h>
#include <GL/glu.h>
#include <vector>
#include <commctrl.h>
#include <stdio.h>
#include <math.h>
bool DrawSplash... | TOOL | 0.902606 | 3.655094 |
2db1fc0a-09e3-45a0-b9aa-aab25580576a | winds-zzf/study-datastructure | program/数据结构实验4/4017.cpp | #define TRUE 1
#define FALSE 0
#define OK 1
#define ERROR 0
#define OVERFLOW -1
typedef int Status;
#include<stdio.h>
#include<stdlib.h>
int outdata[50]; //ȫ
int pt = -1;
//ʽ洢ṹ
typedef struct BiTNode
{
int data; //
struct BiTNode* lchild, * rchild; //
}BSTNode, * BSTree; //
//IJ
BSTree SearchBST(BST... | ALGO | 0.999997 | 3.836866 |
c72fdb73-bc14-4c01-94c7-e368dea512c5 | beast-45/Leetcode | 0072-edit-distance/0072-edit-distance.cpp | class Solution {
public:
int solve(int i , int j , int m , int n , string &word1 , string &word2 , vector<vector<int>> &mem){
if(i == m){
return n-j;
}
else if(j == n){
return m-i;
}
if(mem[i][j] != -1){
... | ALGO | 0.999999 | 6.112281 |
5a44631f-227b-45de-9369-17d7e2e04eab | hossaintaufiq/CP-DSA-COURSE | midturm.cpp | #include<bits/stdc++.h>
using namespace std ;
int main(){
// int t ;
// cin>>t;
// while(t--){
// int a[3];
// for(int i=0;i<3;i++){
// cin>>a[i];
// }
// int multiplication;
// int devide;
// for(int i=0;i<3;i++){
// multiplication=a[0]*a[2];
// devide=multiplication/(a[1]+a[0]);
// }
... | ALGO | 0.999638 | 3.938655 |
b94a01fb-fb30-48be-8cab-c5b44e9a5de9 | ishandutta2007/codeforces | atreus/normal/1146/E.cpp | /***
* Virtual Contest: Forethought Future Cup - Elimination Round
***/
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
const int maxn = 1e5 + 10;
int a[maxn], x[maxn], par[maxn], b[maxn], sum[maxn];
char s[maxn];
int main(){
ios_base::sync_with_stdio(false);
int n, q;
cin >> n >> q;
for (... | ALGO | 0.999984 | 3.196221 |
79baa759-1e40-47a3-9aa7-238924bbbb42 | 113bommy/deepmind_codecontests_refine | cpp_gold_filter_file/cpp_train_5586_4023.cpp | #include <bits/stdc++.h>
using namespace std;
int main() { puts("Odd"); }
| ALGO | 0.999136 | 3.548951 |
db8c1415-4d2a-41b6-8f14-5045711d5a62 | mathletedev/cp | USACO/1352.i.cpp | #include <iostream>
#include <set>
#include <vector>
int T, C;
std::set<int> targets;
std::string commands;
std::vector<int> calc_suffix(int offset, int final_pos) {
std::vector<int> suffix(C + 1, 0);
int pos = final_pos + offset;
std::set<int> visited;
for (int i = 0; i < C; ++i) {
switch (commands[C - i - 1]... | ALGO | 0.999922 | 4.595688 |
57b9787a-b04a-4901-9f4d-788e35a7476c | pankajjindal/DailyCoding | c++/datastructures/stl/iter/backinserter1.cpp | #include <vector>
#include <algorithm>
#include <iterator>
#include "print.hpp"
using namespace std;
int main()
{
vector<int> coll;
// create back inserter for coll
// - inconvenient way
back_insert_iterator<vector<int> > iter(coll);
// insert elements with the usual iterator interface
*iter ... | TOOL | 0.865091 | 5.823095 |
30319280-5900-478e-aa81-0804fb55db02 | SathyasriS27/Programming-with-C-and-Python | Programs/Hackerrrank/Stacks and Queues/gameOfTwoStacks.cpp | #include <iostream>
#include <bits/stdc++.h>
using namespace std;
int twoStacks(int maxSum, vector<int> a, vector<int> b) {
int sumSelections = 0;
int n = 0;
while (sumSelections < maxSum) {
int minimum = min(a[0], b[0]);
sumSelections += minimum;
n++;
if (minimum == a[0]... | ALGO | 0.999903 | 4.961318 |
19b22a41-b7ee-4d1b-acfe-50f679e2bbeb | sahilwep/DSA-Workspace | Leetcode/Medium/3419_Minimize_the_Maximum_Edge_Weight_of_Graph.cpp | /*
// 3419. Minimize the Maximum Edge Weight of Graph
// Problem Statement:
-> You are given two integers, n and threshold, as well as a directed weighted graph of n nodes numbered from 0 to n - 1.
-> The graph is represented by a 2D integer array edges, where edges[i] = [Ai, Bi, Wi] indicates that there ... | ALGO | 0.999977 | 6.585843 |
adc7518b-3fc2-4171-a8b8-a8e389be30a0 | slitvinov/lammps-sph-multiphase | lib/atc/ATC_TransferPartitionOfUnity.cpp | // ATC headers
#include "ATC_TransferPartitionOfUnity.h"
#include "ATC_Error.h"
#include "FE_Engine.h"
#include "LammpsInterface.h"
#include "Quadrature.h"
#include "PerPairQuantity.h"
#ifdef HAS_DXA
#include "DislocationExtractor.h"
#endif
// Other Headers
#include <vector>
#include <map>
#include <set>
#include <ut... | ALGO | 0.99103 | 4.313367 |
87654980-5780-4c60-ac79-ebaae8f413b8 | yuhan4688/2023aaia2 | week10/week10-1b.cpp | //C++的版本要小心class solution{ 和 public 不要動到
class Solution {
public:
int tribonacci(int n) {
int a[40]={0,1,1};//前三項項準備好 後面的37項沒寫都是0
for(int i=3;i<=n;i++){
a[i]=a[i-1]+a[i-2]+a[i-3];//前三項相加 得到新項
}
return a[n]; //答案要算出第n項
}
}; | ALGO | 0.999953 | 4.940327 |
4101387d-e033-4a81-922d-9713cc79a950 | Phantasm-Studios/UnrealEngine | Engine/Source/ThirdParty/IntelTBB/IntelTBB-4.4u3/examples/parallel_for/polygon_overlay/polyover.cpp | // Polygon overlay
//
#include <iostream>
#include <algorithm>
#include <string.h>
#include <cstdlib>
#include <assert.h>
#include "tbb/tick_count.h"
#include "tbb/blocked_range.h"
#include "tbb/task_scheduler_init.h"
#include "tbb/parallel_for.h"
#include "tbb/mutex.h"
#include "tbb/spin_mutex.h"
#include "polyover.h"... | ALGO | 0.993326 | 4.973134 |
9c98040c-f466-4c2b-bcef-1cc8657f1c04 | Mocknbrd/Codeforces_solutions | Code/1644D.cpp | #include <bits/stdc++.h>
using namespace std;
#define ios \
ios_base::sync_with_stdio(0); \
cin.tie(0); \
cout.tie(0);
#define puts(statement) cout<<statement<<endl
#define cin(statement) cin>>statement
#define YY puts("YES")
#define NN puts("NO")
#define yy puts("Yes... | ALGO | 0.999954 | 4.48326 |
20b74e71-bfad-483f-a7e0-075f6b380a47 | federicoSettimo/ROQJ | Examples/ph_cov_pop.cpp | #include "../roqj_pop.h"
using namespace std;
using namespace Eigen;
double gamma_p (double t) {return 1.;}
double gamma_m (double t) {return 1.;}
double gamma_z (double t) {return -.5*tanh(t);}
//double gamma_p (double t) {return exp(-2.*t);}
//double gamma_m (double t) {return exp(-t);}
//double gamma_z (double t) ... | ALGO | 0.999915 | 3.189682 |
1eb8058b-b0a4-42a3-845b-926efeee9ee7 | RobSenseTech/Phenix_DevKit_V1.0 | pilot_cpu1/src/libraries/SITL/SIM_Tracker.cpp | /// -*- tab-width: 4; Mode: C++; c-basic-offset: 4; indent-tabs-mode: nil -*-
/*
antenna-tracker simulator class
*/
#include "SIM_Tracker.h"
#include <stdio.h>
namespace SITL {
Tracker::Tracker(const char *home_str, const char *frame_str) :
Aircraft(home_str, frame_str)
{}
/*
update function for position (nor... | TOOL | 0.932601 | 7.084971 |
07949552-dfac-41fd-ab0a-5fa1004d8dde | Anuskawebb/Leetcode-Problems | 0007-reverse-integer/0007-reverse-integer.cpp | class Solution {
public:
int reverse(int x) {
long reversed = 0;
while (x != 0) {
reversed = reversed * 10 + x % 10;
x /= 10;
if (reversed > INT_MAX || reversed < INT_MIN) {
return 0;
}
}
return static_cast<int>(rever... | ALGO | 0.999928 | 6.17521 |
e1361cb2-45b3-4fcb-a670-654f6500a79a | ankuragarwal0408/My-practice | TRAPPING RAIN WATER O(N) SPACE SOL.CPP | int trap(vector<int>& height)
{
int n=height.size();
if(n==0)
return 0;
vector<int>maxL(n,0),maxr(n,0);
maxL[0]=height[0];
for(int i=1;i<n;i++)
maxL[i]=max(maxL[i-1],height[i]);
maxr[n-1]=height[n-1];
for(int i=n-2;i>=0;i--)
maxr... | ALGO | 0.999972 | 6.420452 |
3c8c4f46-c3a4-408e-9079-7d127ba962d7 | Ankur800/New-Coding-Repo | CPP/Tree/sumAtKthLevel.cpp | #include<iostream>
#include<queue>
using namespace std;
class Node {
public:
int data;
Node* left;
Node* right;
Node(int _data) {
data = _data;
left = NULL;
right = NULL;
}
};
int sumAtKthLevel(Node* root, int k) {
if(root == NULL) {
return -1;
}
int currentLevel = 0;
int sum = 0;
queue<Node*>q;
q.... | ALGO | 0.999968 | 4.591302 |
1cd1c9cb-d480-456c-9f29-8b2faf80fb96 | cfsengineering/CEASIOMpy | installation/Pentagrow/include/genua/trafo.cpp | #include "trafo.h"
using namespace std;
// SSE2 implementation in genua/incubator
// gain is only about 10% -- not worth the hassle
void vertex_transform_4d(int npt, const double T[],
const double A[], double B[])
{
double A0, A1, A2, A3;
int j;
for (j=0; j<npt; ++j) {
A0 = A[4*j... | ALGO | 0.958458 | 5.922338 |
e675a12e-d2d3-431c-a2e5-1672cb7928f5 | Tejesh2001/CinderBox2D | src/CinderBox2D/Dynamics/Contacts/cb2CircleContact.cpp | #include <CinderBox2D/Dynamics/Contacts/cb2CircleContact.h>
#include <CinderBox2D/Dynamics/cb2Body.h>
#include <CinderBox2D/Dynamics/cb2Fixture.h>
#include <CinderBox2D/Dynamics/cb2WorldCallbacks.h>
#include <CinderBox2D/Common/cb2BlockAllocator.h>
#include <CinderBox2D/Collision/cb2TimeOfImpact.h>
#include <new>
cb2... | ALGO | 0.909942 | 6.883247 |
7dffcb6a-d4d5-4aa2-9d40-f1761cdb0570 | AnkitMalvi1/Data-Structures-Algorithms | 036 Quick Sort (Recursion)/QuickSort.cpp | // CodeStudio: Quick Sort
#include<iostream>
using namespace std;
#include <bits/stdc++.h>
int partition(vector<int> &arr,int s,int e)
{
int pivot = arr[s];
int cnt = 0;
for(int i=s+1;i<=e;i++){
if(arr[i]<=pivot)
cnt++;
}
// place pivot at right position
int pivotIndex = ... | ALGO | 0.99999 | 5.774602 |
5115c19d-5380-4088-b1d4-e7ce24a79eeb | Akhila502/Threaded-Binary-Search-Tree | BST_214101050.cpp | // BST_214101050.cpp : Defines the entry point for the console application.
//
/* Standard includes */
#include "stdafx.h"
#include <iostream>
#include <string>
#include <cassert>
#include <vector>
#include <fstream>
/* Project includes */
#include "BST.h"
using namespace std;
/***********************************... | ALGO | 0.997527 | 3.844181 |
8409291d-400e-458f-afd5-4b0c25ecb625 | kawanokun0210/TD2_2 | externals/DirectXTex/DirectXTexMipmaps.cpp | #include "DirectXTexP.h"
#include "filters.h"
using namespace DirectX;
using namespace DirectX::Internal;
using Microsoft::WRL::ComPtr;
namespace
{
constexpr bool ispow2(_In_ size_t x) noexcept
{
return ((x != 0) && !(x & (x - 1)));
}
size_t CountMips(_In_ size_t width, _In_ size_t height) n... | TOOL | 0.87836 | 6.526328 |
9553a5ea-5ec9-402e-b0bf-461eb97953bd | Ayush73nigam/codore | intersection_of_2sortedarr_brut.cpp | #include<bits/stdc++.h>
#define ll long long
using namespace std;
void solve();
#define io freopen("input.txt", "r",stdin);freopen("output.txt","w",stdout);
int main()
{
ios_base::sync_with_stdio(false);cin.tie(0);cout.tie(0);
#ifndef ONLINE_JUDGE
io
#endif
solve();
return 0;
}
#include<vector>
vecto... | ALGO | 0.999997 | 3.982692 |
35144859-0fa9-4efa-bf20-1552e6f27697 | muskan300600/DSA | Heap/9.kth largest.cpp | #include <iostream>
#include <algorithm>
#include <map>
#include <queue>
#include <vector>
#define MAX 100
using namespace std;
int main()
{
int k = 4, n = 6;
int arr[] = {1, 2, 3, 4, 5, 6};
priority_queue<int> pq;
vector<int> v;
for (int i = 0; i < n; i++)
{
pq.push(-arr[i]);
i... | ALGO | 0.999818 | 3.806879 |
3dbef710-28bc-46bb-ac74-763d1781b2a4 | MaxiCM-Test/android_packages_apps_OTAUpdates | jni/boost_1_57_0/libs/graph/example/prim-example.cpp | int
main()
{
using namespace boost;
typedef adjacency_list < vecS, vecS, undirectedS,
property<vertex_distance_t, int>, property < edge_weight_t, int > > Graph;
typedef std::pair < int, int >E;
const int num_nodes = 5;
E edges[] = { E(0, 2), E(1, 3), E(1, 4), E(2, 1), E(2, 3),
E(3, 4), E(4, 0)
};
... | ALGO | 0.999755 | 3.9867 |
07052dde-a292-466e-9f33-ec778255664c | marcogroot/advent_of_code_2024_cpp | 10_2.cpp | #include "util.h"
#include <algorithm>
#include <iostream>
#include <set>
#include <sstream>
#include <unordered_map>
#include <unordered_set>
#include <utility>
#include <vector>
using namespace std;
vector<pair<int, int>> directions{{-1, 0}, {0, 1}, {1, 0}, {0, -1}};
void dfs(int r, int c, long long &answer, vecto... | ALGO | 0.999673 | 6.122109 |
ff303f12-3727-479d-a90c-811d72f2611c | ddyeon/AlgorithmSTD | kakao/yuni_보석쇼핑.cpp | #include <string>
#include <vector>
#include <queue>
#include<unordered_map>
using namespace std;
unordered_map<string, int> uno;
unordered_map<string, int> tmp;
queue<pair<int, int>>q;
vector<int> solution(vector<string> gems) {
vector<int> answer;
for (int i = 0; i < gems.size(); i++) uno[gems[i]]++;
int ... | ALGO | 0.999955 | 5.481304 |
b3eb744e-a971-4c5c-86b8-d844337de433 | SeokBeomKo/Inha_Cpp | 2023_06_02.cpp | //#include <iostream>
//#include <cstring>
//#include <vector>
//
//using namespace std;
//
//template<typename Any>
//Any add(Any a, Any b)
//{
// return a + b;
//}
//
//template<typename T>
//void Swap(T& a, T& b);
//template<typename T>
//void Swap(T& a, T& b, int n);
//void Show(int a[]);
//const int Lim = 8;
//
//... | TOOL | 0.978131 | 3.273103 |
3cf084ad-0f3d-49d6-a7c8-8c7b22809063 | ishandutta2007/codeforces | rns_cus/normal/1381/D.cpp | #include <bits/stdc++.h>
using namespace std;
#define N 100100
int n, st, ed, dep[N], mx[N], smx[N], fa[N], nxt[N];
vector <int> adj[N];
bool vis[N];
void dfs(int *mx, int u, int pa = 0) {
dep[u] = dep[pa] + 1;
fa[u] = pa;
mx[u] = 0;
for (auto v : adj[u]) {
if (v == pa) continue;
dfs(... | ALGO | 0.999962 | 4.124125 |
2171396d-66d9-4f2f-88fe-da1b288347c2 | adityasingh10012007/leetcodeSol | 0662-maximum-width-of-binary-tree/0662-maximum-width-of-binary-tree.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),... | ALGO | 0.999968 | 6.336238 |
10e164c1-6ed6-4bf5-b778-57704acde377 | yapatta/ant_book | 2/2-6/kukan_sosu.cpp | #include <bits/stdc++.h>
using namespace std;
using unko = long long;
const unko MAX_N = 1e6+7;
/*
* b-a <= 1e6 に着目
* [a, √a] におけるエラトステネスの篩を求める
*
*/
vector<unko> prime;
bool isPrime[MAX_N];
void eratos(unko b) {
for(unko i=2;i*i<b;i++) {
if(isPrime[i]) {
prime.push_back(i);
for(unko j=2*i;j*j<b;j+=i) {
... | ALGO | 0.999829 | 4.372186 |
89b082cc-f7b7-4b63-9b8c-2db424bd8b3a | jacklin5168/LeetcodeLocal | cpp/801.minimum-swaps-to-make-sequences-increasing.cpp | /*
* @lc app=leetcode id=801 lang=cpp
*
* [801] Minimum Swaps To Make Sequences Increasing
*
* https://leetcode.com/problems/minimum-swaps-to-make-sequences-increasing/description/
*
* algorithms
* Medium (35.54%)
* Total Accepted: 16.3K
* Total Submissions: 45.8K
* Testcase Example: '[1,3,5,4]\n[1,2,3,7... | ALGO | 0.999982 | 5.935671 |
6c008bda-34c4-4d63-b834-159f5fd7bf71 | navnikum/CodingTechiedelight | Arrays/Easy_1sInSortedBinaryArray.cpp | /*TechieDelight
Topic : Arrays
Question : Sorted binary array, find 1s efficiently in it
*/
// T : O(n) ; S : O(1)
// Linear search for 1st occurence of 1. and subtrace from array size
// T : O(logn) ; S : O(logn)
// using Recursion
int count(int A[], int n){
if (A[n-1] == 0)
return 0;
if (A[0] == 1)
return... | ALGO | 0.999399 | 5.32464 |
0b3ec3cb-84e3-47b0-8130-f726d78880c4 | AmodSeth/Competitve_Programming | C++/pattern_1.cpp | /*
1. for outer loop count the number of lines/rows
2. for the inner loop focus on the columns and connect it to the rows
3. first print them inside the innerloop
4. observe symmetry if possible (optional)
*/
/*
* * * * *
* * * * *
* * * * *
* * * * *
* * * * *
*/
#include<bits/stdc++.h>
#define ... | ALGO | 0.99985 | 4.068085 |
bdb394f0-26aa-437a-afda-b702f9c5f718 | golaced/OmniBotSeries-Tinker | OmniBotHub/Linux/control_task2/eigen/doc/special_examples/Tutorial_sparse_example_details.cpp | #include <Eigen/Sparse>
#include <vector>
#include <QImage>
typedef Eigen::SparseMatrix<double> SpMat; // declares a column-major sparse matrix type of double
typedef Eigen::Triplet<double> T;
void insertCoefficient(int id, int i, int j, double w, std::vector<T>& coeffs,
Eigen::VectorXd& b, con... | ALGO | 0.998077 | 5.388735 |
16b594ce-f096-4b6d-a62f-ad1c8edaeeb8 | olimpiadi-informatica/oii | 2016/nazionali/aeroporto/sol/inversa.cpp | /**
* Soluzione ottima ma a partire dalla fine
*
* Autore: Giorgio
*
* Descrizione: Viene fatta una ricerca binaria sul K minimo ed una volta
* trovato viene realizzato linearmente ma partendo dalla fine.
* La complessità è R*log(T).
*/
#define MAXT 1000000
#include <algorithm>
using namespace std;
boo... | ALGO | 0.999885 | 4.233345 |
d9d621eb-ead6-4e8e-9e0e-7f92f3bc70ea | doocs/leetcode | solution/0500-0599/0547.Number of Provinces/Solution.cpp | class Solution {
public:
int findCircleNum(vector<vector<int>>& isConnected) {
int n = isConnected.size();
int ans = 0;
bool vis[n];
memset(vis, false, sizeof(vis));
auto dfs = [&](this auto&& dfs, int i) -> void {
vis[i] = true;
for (int j = 0; j < n;... | ALGO | 0.999903 | 6.333524 |
01f57461-37be-489e-ac2c-a84dcf8168f1 | kasiyan16/Programming1 | 19_lab/19_lab.cpp | #include <iostream>
#include <cmath>
#include <iomanip>
using namespace std;
double customFunction(double x) {
return cos(pow(x, 2) + 1) - abs(sin(2 * x) - 5.76);
}
int main() {
const int size = 4;
double matrix[size][size];
for (int n = 0; n < size; ++n) {
for (int k = 0; k < size; ++k) {
... | ALGO | 0.998709 | 5.029284 |
36af2903-c941-4690-8885-b5bec838205f | shuangde/ACM-ICPC-Record | Codeforces/cf-217/B.cpp | #include <cstdio>
#include <iostream>
#include <vector>
#include <algorithm>
using namespace std;
int main () {
int n;
scanf("%d", &n);
vector<int>vt[n];
for (int i = 0; i < n; ++i) {
int m; scanf("%d", &m);
for (int j = 0; j < m; ++j) {
int x; scanf("%d", &x);
... | ALGO | 0.999964 | 3.975649 |
0cbfa9a6-a37f-43bb-924b-4ac97ae083b6 | a1batross/Paranoia2_original | utils/p2vis/winding.cpp | // winding.c
#include "qvis.h"
void pw( winding_t *w )
{
for( int i = 0; w && i < w->numpoints; i++ )
Msg( "(%5.1f, %5.1f, %5.1f)\n", w->p[i][0], w->p[i][1], w->p[i][2] );
}
/*
=============
AllocWinding
=============
*/
winding_t *AllocWinding( int numpoints )
{
if( numpoints > MAX_POINTS_ON_WINDING )
COM_Fat... | ALGO | 0.998722 | 5.464025 |
e3c7361d-fa9c-4cbf-b2de-02b52865998a | JabedWeb/cpp-contest-solutions | A_Vlad_and_the_Best_of_Five.cpp | //https://atcoder.jp/contests/abc326/tasks/abc326_c
////https://codeforces.com/contest/266/problem/A
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
const int mod = 1e9 + 7;
const int N = 1e5 + 5;
int solve(int a,vector <int> &v){
}
void solve(){
string s;
cin >> s;
int co... | ALGO | 0.999913 | 5.82589 |
09960197-6449-4da5-8a17-04122af58302 | saurabh-vit/GfG | Difficulty: Medium/Sum of Subarrays/sum-of-subarrays.cpp | class Solution {
public:
int subarraySum(vector<int>& arr) {
// code here
int n = arr.size();
int total = 0;
for (int i = 0; i < n; i++) {
total += arr[i] * (i + 1) * (n - i);
}
return total;
}
}; | ALGO | 0.999864 | 5.714227 |
a8bcf081-d6e5-4395-9156-5e75ab9f75b8 | jinchengXie99/algorithm | 1023.cpp | /*************************************************************************
> File Name: 1023.cpp
> Author: Chengxing
> Mail: <EMAIL>
> Created Time: 二 2/15 16:29:54 2022
************************************************************************/
#include<iostream>
using namespace std;
int main ()
{
int arr[10];... | ALGO | 0.999964 | 3.738294 |
700428f0-cc3c-4693-b297-73af4df95d5f | Wise-Wizard/DSA-Problems | Stacks & Queues/84.largest-rectangle-histogram.cpp | class Solution
{
private:
vector<int> nextSmallerElement(int n, vector<int> &heights)
{
vector<int> next(n);
stack<int> elements;
elements.push(-1);
for (int i = n - 1; i >= 0; i--)
{
int curr = heights[i];
while (elements.top() != -1 && heights[el... | ALGO | 0.999916 | 6.08322 |
c45c102a-cf6b-4230-884d-36a7493d3328 | mortie/llvm-axa-backend | libcxx/test/std/algorithms/alg.sorting/alg.sort/partial.sort/partial_sort.pass.cpp | // <algorithm>
// template<RandomAccessIterator Iter>
// requires ShuffleIterator<Iter> && LessThanComparable<Iter::value_type>
// constexpr void // constexpr in C++20
// partial_sort(Iter first, Iter middle, Iter last);
#include <algorithm>
#include <cassert>
#include "test_macros.h"
#include "test_iterators... | TEST | 0.985878 | 7.498962 |
64b031e8-cc93-4827-b92e-695a413f62c0 | arnavn101/cpp_code | bit_operations.cpp | #include <bits/stdc++.h>
using namespace std;
void printBitRepresentation(int number){
for(int i=31; i>=0; --i){
if (number & (1<<i)){
cout << "1";
}
else{
cout << "0";
}
}
cout << "\n";
}
void print_BinarySet(int number){
for(int i = 0; i < 32;... | ALGO | 0.998389 | 4.734201 |
03be6c32-6c06-4daa-ad4a-29d393317704 | Anastasiia-Ni/CodeWars-LeetCode | Leetcode_Hard/Trapping_Rain_Water.cpp | /* Given n non-negative integers representing an elevation map where the width of each bar is 1,
compute how much water it can trap after raining.
Example 1:
Input: height = [0,1,0,2,1,0,1,3,2,1,2,1]
Output: 6
Explanation: The above elevation map (black section) is represented by array [0,1,0,2,1,0,1,3,2,1,2,1]. In th... | ALGO | 0.999996 | 7.183416 |
c5a8fa04-b2e5-4bef-8097-d1d5d41ea77d | reteppeter/AdventOfCode2021 | Day8/day8.cpp | #include "./../../../shared/rtpcore.h"
#include "./../../../shared/maths/RTPMath.h"
#include <algorithm>
#include <fstream>
#include <charconv>
#include "../sharedAoC.h"
/*class SAT{
public:
Array2D<byte> possible;
SAT(size_t size): possible(size, size, true){};
void reset(){
for(auto& p: possible){ p = 0; }... | ALGO | 0.998678 | 5.98306 |
5401c3c2-86d7-4691-ad13-b386392fb2e3 | smnahidhasan/Competitive-Programming | Codeforces/Ladder/Time to Level up - Round 4 (CF-1500)/AAn.cpp |
/*
Author's Handle : Crazy_Dreamer
Author's Name : S M Nahid Hasan
*/
#include<bits/stdc++.h>
using namespace std;
#define ll long long
#define dl double
#define forn(i,a,n) for (ll i=a;i<n;i++)
#define per(i,a,n) for (ll i=n-1;i>=a;i--)
#define pb pu... | ALGO | 0.999955 | 4.359741 |
a668838f-ac66-41f5-8cf9-f8cea08cd2e7 | MrityunjayNPandey/vscode | CP/B_Haunted_House.cpp | /**
* codeforces: _joKer_0
* created: 22-10-2023 12:44:19
**/
// clang-format off
#ifdef ONLINE_JUDGE
#pragma GCC optimize("Ofast", "unroll-loops")
#pragma GCC target("avx,avx2,fma")
#endif
#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
using namespace std; using namespace __gnu_pbds;
#d... | ALGO | 0.999587 | 4.657034 |
c1a580e7-bf65-477c-9b17-bab50617de69 | ducthangbui/Learning | Algrhothim & Struct/Bai tap cau truc/Bai VIII. Thao tac voi file/5. tap tu va so lan xuat hien trong s1 va s2.cpp | #include "D:\lap trinh\c++\function.cpp"
struct tu
{
char word[100];
int n;
void Print()
{
cout<<"Tu \""<<word<<"\" xuat hien "<<n<<" lan \n";
}
};
vector <tu> T1,T2;
void Xuly()
{
ifstream f1("data1.in"),f2("data2.in");
tu x;
int k;
while(f1)
{
f1>>x.word;x.n=1;
if(!f1) break;
k=1;
for(int i=0;i<T... | ALGO | 0.998586 | 3.411698 |
d88edffe-0f14-488b-a1b6-ed3fe1944e89 | Moongss/ps | Baekjoon/1000-9999/1100.cpp | #include <bits/stdc++.h>
#define endl "\n"
#define fastio cin.tie(0)->sync_with_stdio(0)
using namespace std;
#define x first
#define y second
#define all(v) v.begin(), v.end()
#define compress(v) sort(all(v)), v.erase(unique(all(v)), v.end())
#define lower(v, x) (int)(lower_bound(all(v), x) - v.begin())
#define upper... | ALGO | 0.99935 | 3.832333 |
bb833116-19f0-42d4-83b2-32e2ed254299 | Ratinkumar/Leetcode-GFG | 0069-sqrtx/0069-sqrtx.cpp | class Solution {
public:
int mySqrt(int x) {
int start=0;
int end=x;
int ans=-1;
while(start <= end)
{
long long int mid=start+(end-start)/2;
if(mid*mid == x)
return mid;
else if(x > mid*mid)
{
ans=mi... | ALGO | 0.999992 | 5.23259 |
19f4e45f-8540-4656-aed8-4e1e82236fde | Jibesh04/Design-and-Analysis-of-Algorithm | Lab6/MCM.cpp | /*
Sashmit Kabi
Tanmaya Kumar Naik
Basant Xalxo
Mohammed Swalleh Aman
Sarthak Priyadarshi Mahanta
Bibek Kumar Meher
Prem Prabhujeet
Subhranshu Sekhar Panda
Soumya Ranjan Padhi
Mitradev Rana
Debraj Swain
Prerit Kumar Jain
Anshu Agrawal
Ashish Kumar Mishra
Sandeep Kumar Nayak
Jyotiraditya Biswal
Jibesh Kumar Panda
Prerit... | ALGO | 0.999822 | 4.054538 |
fc61e9ec-089d-430b-a4dd-162cd9247c13 | rezaaditama/learn_cpp | Bahan Laprak/Array.cpp | //#include <iostream>
//using namespace std;
//
//int main(){
//
// int b,k, tbl[3][4]={{2,4,6,8},{1,3,5,7},{2,3,4,5}};
//
// for(b=0; b<3; b++){
// for(k=0; k<4; k++){
// cout<<tbl[b][k]<<" ";
// }
// cout<<endl;
// }
//}
//#include <iostream>
//using namespace std;
//
//int main(){
//
// //mengisi elemen ses... | ALGO | 0.969108 | 3.36479 |
84465551-4bf0-45fd-acbd-624a06cec891 | coolcash/RubyCoin | src/rpcmisc.cpp | #include "base58.h"
#include "init.h"
#include "main.h"
#include "net.h"
#include "netbase.h"
#include "rpcserver.h"
#include "timedata.h"
#include "util.h"
#ifdef ENABLE_WALLET
#include "wallet.h"
#include "walletdb.h"
#endif
#include <stdint.h>
#include <boost/assign/list_of.hpp>
#include "json/json_spirit_utils.h"... | WEB | 0.853115 | 3.345804 |
f5526ec4-f3bb-4da4-9415-56143497f2dc | dianaMihaelaDiaconu/AOC-2020 | Day2.cpp | #include <fstream>
#include <iostream>
#include <vector>
#include <string>
#include <regex>
#include <algorithm>
std::ifstream f("input.txt");
std::vector<std::string> readEntries()
{
std::string entry;
std::vector<std::string> entries;
while (std::getline(f, entry))
{
entries.push_back(entry);
}
return entr... | ALGO | 0.987953 | 5.129065 |
4e72e9e6-0c0f-4b5b-94c1-6b65aaf77c23 | sid-am-ahd935/Aliahns | C++/Patterns/triangleStar1.cpp | #include<iostream>
using namespace std;
int main(){
int n;
//pattern triangle star
cout<<"Put the value:";
cin>>n;
for (int i=1;i<=n;i++){
for(int j=1;j<=i;j++){
cout<<"*"<<" ";
}
cout<<endl;
}
return 0;
}
| ALGO | 0.999811 | 3.877766 |
5f4d30a2-74d9-4ea6-917d-912594e775e6 | orekiousun/Code | C++/LeetCode/Offer/Offer-Sort-40-getLeastNumbers.cpp | #include<iostream>
using namespace std;
#include<vector>
#include<algorithm>
/*
输入整数数组 arr ,找出其中最小的 k 个数。例如,输入4、5、1、6、2、7、3、8这8个数字,则最小的4个数字是1、2、3、4。
排完序返回即可,也可以考虑使用优先队列
*/
vector<int> getLeastNumbers(vector<int>& arr, int k) {
sort(arr.begin(), arr.end());
vector<int> ans(k);
for (int i = 0; i < k... | ALGO | 0.999867 | 4.876172 |
b9558f8b-bd20-402b-8536-8c97dd8d562e | Code-Mars/LeetCode | 0623-add-one-row-to-tree/0623-add-one-row-to-tree.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.999993 | 6.050241 |
7bf6281f-746b-42d9-affc-69dbdb41b1d5 | Himanshu07-debug/POTD | Leetcode/June/8_june.cpp | #include<bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
using namespace std;
using namespace __gnu_pbds;
#define endl '\n'
const long long MOD = 1e9 + 7;
const long long INF = LLONG_MAX >> 1;
const long long NINF = LLONG_MIN;
struct node{
int data;
node* le... | ALGO | 0.999641 | 4.247612 |
b7a3792b-2d05-4fc1-b601-8c638cfef65a | GunioRobot/scribe-dependencies | boost_1_41_0/libs/numeric/ublas/doc/samples/matrix_range_project.cpp | #include <boost/numeric/ublas/matrix.hpp>
#include <boost/numeric/ublas/matrix_proxy.hpp>
#include <boost/numeric/ublas/io.hpp>
int main () {
using namespace boost::numeric::ublas;
matrix<double> m (3, 3);
for (unsigned i = 0; i < m.size1 (); ++ i)
for (unsigned j = 0; j < m.size2 (); ++ j)
... | ALGO | 0.996707 | 3.857002 |
0bcd39e6-b874-489c-a86b-d471f16086a4 | ismasou/Finite-Medium-Splitting-Rates-Using-Non-perturbative-Kernel | src/EQCDInMomentumSpace.cpp | namespace EQCD
{
double gi = std::sqrt(2.763515753);
double blogbCoef = gi * gi * (0.027075) / C_F;
// VALUES OF ASYMPTOTICS FOR b-> 0 //
double bbLnbCoef = 3.0*ZETA_3/(4.0*pow(M_PI,3))*(1.0+Nf/4.0);
double bbCoef = bbLnbCoef*(1.0-EULERGAMMA-std::log(mDOvergT*0.5)); //0.129*gSqr/4.0;
double lo... | ALGO | 0.988525 | 3.511619 |
398c339c-e837-42a0-8d11-c294e2d43f83 | Amarpraja/DSAL-Practicals | Exp15.cpp | // Implementation of a direct access file -Insertion and deletion of a record from a direct
// access file
#include <iostream>
#include <fstream>
#include <unordered_map>
using namespace std;
struct Record
{
int key;
string data;
Record(int k, const string &d) : key(k), data(d) {}
};
class DirectAccess... | ALGO | 0.989219 | 5.946308 |
544f6879-265c-43e4-9332-7d893efe639e | Chan531/BaekJoon_Online_Judge | 스타트택시.cpp | #include <iostream>
#include <vector>
#include <queue>
#include <algorithm>
#include <cstring>
#define p pair<int, int>
using namespace std;
struct info {
int y, x, dis, cfuel; // cfuel -> ᷮ
};
int n, m, fuel, cy, cx, mindis = 1e9;
// cy, cx -> ǥ, mindis -> ° Ÿ
int map[21][21], visited[21][21], dir[4... | ALGO | 0.999812 | 4.109229 |
f378ebb7-1a8d-48bb-89bb-20757ce9c008 | FacundoCG/Competitive-Programming | Codeforces/Round 933 - Div 3/problemA.cpp | #include <bits/stdc++.h>
using namespace std;
int main() {
ios :: sync_with_stdio(0);
cin.tie(0);
int t;
cin >> t;
for (int i = 0; i < t; i++) {
int n, m, k;
cin >> n >> m >> k;
vector<int> leftPocket(n);
vector<int> rightPocket(m);
int res = 0;
f... | ALGO | 0.999865 | 3.849101 |
10a1c46b-8b4e-4721-923d-627fd04b7dad | pranavajith/CP-Practice | CP (Until Creation of Repo)/Second100/1512D.cpp | #include <bits/stdc++.h>
#include <iostream>
#include <set>
#include <cmath>
#include <map>
#include <sstream>
using namespace std;
#define ll long long
// #define TxtIO freopen("input.txt","r",stdin); freopen("output.txt","w",stdout); freopen("error.txt", "w", stderr);
void solve(){
ll n, sum1=0;
cin>>n;
... | ALGO | 0.999614 | 3.790507 |
1e912ebe-5720-414f-aa67-ec572ab68553 | akrabulislam/UVA | 13026.cpp | #include <bits/stdc++.h>
using namespace std;
int main()
{
int t,test=1;
cin>>t;
while(t--)
{
int n;
string lis[100000];
cin>>n;
for(int i=0; i<n; i++)
{
cin>>lis[i];
}
string mom;
cin>>mom;
printf("Case %d:\n",test++)... | ALGO | 0.999944 | 3.598776 |
94ad2f72-1da9-4893-bc26-22074628bf15 | YaizaCano/A | src/dictionary/separate_chaining/separate_chaining_vector.cpp | #include "separate_chaining_vector.h"
/* =================================
* PUBLIC
* =================================*/
SeparateChainingVector::SeparateChainingVector(int tableSize, HashFunction &hash) {
m = tableSize;
h = &hash;
dictionary = std::vector<std::vector<int> > (m);
collisions = 0;... | ALGO | 0.973201 | 5.332411 |
60a80bd4-b7b6-46ee-856e-c60502cd1ba9 | JustinSparrrow/DateStructure | myStudy/leetcode/Algorithm/queue.cpp | #include <iostream>
#include <algorithm>
#include <queue>
using namespace std;
int main(){
int n = 10, m = 1;
queue<int> q;
for(int i = 0; i < n; i++) q.push(m++);
while (q.size()){
cout << q.front() << ' ';
q.pop();
}
cout << endl;
//队列的清空(无clear()方法)
while (q.size())... | ALGO | 0.999726 | 3.690261 |
02e5aa7c-bc86-439d-aa9b-a27b66d61fd0 | abellagonzalo/go2012 | player/src/Components/BodyDetector.cpp | #include "BodyDetector.h"
BodyDetector::BodyDetector()
{
this->_Kinematics = Kinematics::getInstance();
this->escale = 1000.0;
}
BodyDetector::~BodyDetector()
{
}
void
BodyDetector::init(const string newName, AL::ALPtr<AL::ALBroker> parentBroker)
{
Component::init(newName, parentBroker);
try {
this->pmotion =... | ALGO | 0.959249 | 4.758118 |
88438a73-7430-433d-bd31-cd915ffa3d9e | Luohaothu/kokkos-learn | kokkos-tutorials/Intro-Full/Exercises/02/Solution/exercise_2_solution.cpp | #include <limits>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <sys/time.h>
#include <Kokkos_Core.hpp>
void checkSizes( int &N, int &M, int &S, int &nrepeat );
int main( int argc, char* argv[] )
{
int N = -1; // number of rows 2^12
int M = -1; // number of columns 2^10
int S... | TEST | 0.886057 | 5.584057 |
f7d237e5-ec6a-4f88-a824-b75aaf1410c2 | DGomez06/TDS-ProyectoFinal_frontend | 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 |
0f85ed2b-7cd4-4711-a6b9-c90d5842b317 | wuyuhang05/My-OI-Code | 517/128C.cpp | /*
* Time: 2019-11-13 21:19:20
*/
#include <algorithm>
#include <iostream>
#include <cstring>
#include <climits>
#include <cstdlib>
#include <cstdio>
#include <bitset>
#include <vector>
#include <cmath>
#include <ctime>
#include <queue>
#include <stack>
#include <map>
#include <set>
#define fi first
#define se secon... | ALGO | 0.999874 | 3.737001 |
04fe838d-b82d-4a4f-9875-854a7a161442 | himanshubaid/LEETCODE | Shortest path in Directed Acyclic Graph - GFG/shortest-path-in-directed-acyclic-graph.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:
vector<int> shortestPath(int N,int M, vector<vector<int>>& edges){
vector<pair<int,int>>adj[N];
for(int i=0;i<M;i++)
... | ALGO | 0.999885 | 5.86552 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.