uuid string | repo_name string | relative_path string | content string | category string | algo_rel_score float64 | quality_score float64 |
|---|---|---|---|---|---|---|
d11b3912-1b67-421a-b6b4-514c9bf99d22 | Pedro-gomes8/DistributedSystems | TP2/producerConsumer/miller-rabin-primality-test.cpp | #include <bits/stdc++.h>
#include "miller-rabin-primality-test.h"
// CODE FOR MILLER ET AL.
// ALL CREDITS GO TO THEM
// time complexity is O(k*logN) where k is the number of iterations that is set in the producerConsumer.cpp file (under the 'consumer' function scope)and N is the number I wish to find the primality of.... | ALGO | 0.999151 | 4.872034 |
d7a47a13-4bfd-476d-99c7-1554a37e952a | Prakash251299/Leetcode | Problems/368LargestDivisibleSubset.cpp | class Solution {
public:
void display(vector<int>&v){
for(auto x:v){
cout<<x<<" ";
}
cout<<"\n";
}
vector<int> largestDivisibleSubset(vector<int>& nums) {
sort(nums.begin(),nums.end());
int m = 0;
vector<int>sz(nums.size(),1);
vector<int>in... | ALGO | 0.999945 | 4.963813 |
9a1daea8-a0e2-4b63-8c1d-e203c9c7e406 | yang48699997/code | exercise/2024holiday/daily-task1.0/0801/Challenge_NPC_2.cpp | #include <bits/stdc++.h>
using namespace std;
struct DSU{
vector<int> fa,size;
DSU(int n):fa(n),size(n,1){
for(int i=0;i<n;i++)fa[i]=i;
}
int find(int x){
if(fa[x]==x)return x;
fa[x]=find(fa[x]);
return fa[x];
}
bool merge(int x,int y){
x=find(x);
... | ALGO | 0.999935 | 4.868757 |
cf502538-7a2d-4eed-9a9b-bd8f126103c5 | Krem-Waniliowy/Semestr_III | Lab4_Zadanie_6.cpp | #include <iostream>
#include <string>
#define N 10
using namespace std;
int add(int a, int b) {
return a + b;
}
int substract(int a, int b) {
return a - b;
}
int multiply(int a, int b) {
return a * b;
}
int divide(int a, int b) {
if (b == 0) {
cout << "Blad - dzielenie przez zero.\n";
... | ALGO | 0.915574 | 4.876753 |
6d72c2a3-a56c-47df-846e-db64b7af4b64 | relu00123/CodingTest | 프로그래머스/lv1/42889. 실패율/실패율.cpp | #include <string>
#include <vector>
#include <algorithm>
using namespace std;
struct Info
{
int StageNum;
double FailureRate;
Info (int _StageNum, double _FailureRate)
: StageNum(_StageNum)
, FailureRate(_FailureRate)
{}
bool operator < (const Info& _Other)
{
... | ALGO | 0.999937 | 4.797257 |
41588eec-5d5f-4704-8e25-5b0fb43a0ad8 | Schumacher-LBM/OLB | examples/optimization/domainId3d/domainId3d.cpp | // Disable SIMD for ADf
#undef PLATFORM_CPU_SIMD
#include <olb.h>
#include "helper.h" // Will be removed once SuperLatticeFieldReductionO enables indicator support
#include "domainId3d.h"
using DUAL_DYNAMICS = DualPorousBGKDynamics<T,DESCRIPTOR>; // Dynamics of dual problem
using OBJECTIVE = functors::L2Distanc... | ALGO | 0.99957 | 5.507551 |
ea7a6df5-23f1-4618-ac20-65312767eb95 | rutvasolanki2128/SE_assignment | C/module3.2/32.cpp | /*32. Write a C program to input basic salary of an employee and calculate
its Gross salary according to following:
Basic Salary <= 10000 : HRA = 20%, DA = 80%
Basic Salary <= 20000 : HRA = 25%, DA = 90%
Basic Salary > 20000 : HRA = 30%, DA = 95% */
#include<stdio.h>
int main(){
int a,hra,da,c;
printf("enter your b... | ALGO | 0.963133 | 3.471879 |
1df628d4-1295-463b-a00c-044e7ae3871c | Radhesh-Sarma/Competitive-Coding | codeforces/1166/B.cpp | #include<bits/stdc++.h>
using namespace std;
#define IOS ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);
#define endl "\n"
#define f first
#define s second
#define int long long
#define PB push_back
#define MP make_pair
#define db long double
#define all(a) a.begin(), a.end()
#defi... | ALGO | 0.99971 | 4.104132 |
57e266b0-9d42-4b4f-ae5d-074be60f4176 | aa01912001/LeetCode | No_99/Recover Binary Search 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.999999 | 6.148214 |
9f857df4-4fac-4ef8-98ed-2c783db23551 | prakash1909/data-structure-and-algorithms | binary search tree/230. Kth Smallest Element in a BST .cpp | #include<iostream>
#include<vector>
#include<map>
#include<unordered_map>
#include<queue>
#include<stack>
#include<math.h>
#include<set>
using namespace std;
void print(int a[], int n) {
for (int i = 0; i < n; i++) {
cout << a[i] << " ";
}
cout << endl;
}
void print(vector<int> a) {
int n = ... | ALGO | 0.999977 | 4.669788 |
e9bdf9bb-ca50-4455-a35c-8f57545d23ae | kinatraa/Laptrinhonline.club | Diencapsocong.cpp | #include <bits/stdc++.h>
using namespace std;
#define ll long long
#define endl "\n"
const int MOD = 1000000007;
int main()
{
ios_base::sync_with_stdio(false);
cin.tie(0);
cout.tie(0);
int n;
vector<int> a;
stack<int> check;
int kt = 0, cnt = 0, i = 0;
while (cin >> n)
{
a.push_back(n);
if (i > 0 && a[i] ... | ALGO | 0.999996 | 3.338938 |
52acfc7b-72dc-4651-a656-b90aa35477ff | Minusie357/Algorithm | BackjoonAlgorithm/11724. 연결 요소의 개수.cpp | //#include <iostream>
//#include <vector>
//#include <queue>
//using namespace std;
//
////#define DEBUG
//#ifdef DEBUG
//#include <chrono>
//#include "Utility.h"
//
//chrono::system_clock::time_point Start;
//chrono::nanoseconds Time;
//#endif
//
//
//
//int main()
//{
// ios::sync_with_stdio(false);
// cin.tie(NULL);... | ALGO | 0.999792 | 5.183936 |
b5a5a0a2-34ff-4e19-904c-5cb75caf4aaa | alexandraback/datacollection | solutions_5756407898963968_0/C++/wulongict/Magican.cpp | #include <cstdio>
#include <iostream>
#include <vector>
using namespace std;
void solve(int caseNum)
{
int Len = 4;
vector<int> number;
int data[4]={0,0,0,0};
int row;
scanf("%d",&row);
for (int i = 0; i < 4; i++)
{
scanf("%d %d %d %d",&data[0],&data[1],&data[2],&data[3]);
if (row == i+1)
{
number.ass... | ALGO | 0.998568 | 3.988669 |
297432d7-4b28-4d2e-a163-8f317aaa84e5 | MouryaVishal/A2Z_Questions | 12 Greedy Algorithms [Easy, Medium/12.1 Easy Problems/1 Assign Cookies.cpp | #include<bits/stdc++.h>
using namespace std;
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), left(left), right(... | ALGO | 0.999904 | 4.745687 |
9ec549cc-1219-4b10-a9fc-e4cb043671f6 | fwdzh/cp_code | XCPC/Provincial/2024Sichuan/F.cpp | // Date: 2025-03-02
// Time: 16:14:11
#include <bits/stdc++.h>
using namespace std;
void solve()
{
int x, y, r, vx, vy;
cin >> x >> y >> r >> vx >> vy;
// 可以直接算出圆心放在哪个矩形可以使得满足条件。
// 然后判断圆心的运动轨迹是否会经过这个区域。
// 可以将顶点都带入直线方程,看是否都在直线同侧。
// 运动路径可以表示为 vx * (Y-y) = vy * (X-x)
// 圆心需要在
int lx, ... | ALGO | 0.999564 | 4.122596 |
a2ee320b-b9a3-493b-9dd6-1efd9a62ea9a | Exawind/amr-wind | amr-wind/equation_systems/temperature/temperature.cpp | #include "amr-wind/equation_systems/temperature/temperature.H"
#include "amr-wind/equation_systems/AdvOp_Godunov.H"
#include "amr-wind/equation_systems/AdvOp_MOL.H"
#include "amr-wind/equation_systems/BCOps.H"
namespace amr_wind::pde {
template class PDESystem<Temperature, fvm::Godunov>;
template class PDESystem<Temp... | ALGO | 0.963359 | 4.456029 |
62abc369-7601-42ba-ad33-fc8b9d6fcf29 | Tuhil926/cpp | practice/how_much_does_daytona_cost.cpp | #include <bits/stdc++.h>
using namespace std;
#define endl "\n"
#define tc \
long long _t; \
cin >> _t; \
while (_t--)
typedef long long ll;
#define int long long
// type name short forms
#define vvll vector<vector<long long>>
#define vll vector<long long>
#define pll pair<long long, long long>
... | ALGO | 0.999899 | 4.260301 |
b32b776d-2bd3-4965-8cc3-16fead99ba34 | gitlarky/PoreDy | include/Eigen/doc/examples/matrixfree_cg.cpp | #include <iostream>
#include <Eigen/Core>
#include <Eigen/Dense>
#include <Eigen/IterativeLinearSolvers>
#include <unsupported/Eigen/IterativeSolvers>
class MatrixReplacement;
using Eigen::SparseMatrix;
namespace Eigen {
namespace internal {
// MatrixReplacement looks-like a SparseMatrix, so let's inherits its trai... | ALGO | 0.999138 | 6.112806 |
e1b23e81-523d-46cc-8320-f743aab62345 | ddiazghub/codeforces | A. Cupboards.cpp | // Problem: A. Cupboards
// Contest: Codeforces Round 152 (Div. 2)
// Judge: Codeforces
// URL: https://codeforces.com/problemset/problem/248/A
// Memory Limit: 256
// Time Limit: 2000
// Start: Wed May 22 21:24:06 2024
#include <iostream>
using namespace std;
int main() {
int n, l(0), r(0);
cin >> n;
for (in... | ALGO | 0.999874 | 4.831982 |
f7ed6265-d570-430f-832a-275c62e6db6d | MikamiTetsuro365/Atcoder | ABC134/D.cpp | #include <iostream>
#include <vector>
#include <algorithm>
#include <random>
#include <string>
#include <cmath>
#include <sstream>
#include <istream>
#include <iomanip>
#include <typeinfo>
#include <stack>
using namespace std;
typedef long long ll;
ll N;
vector< ll > divisor(ll n) {
vector< ll > ret;
for(ll i = 1... | ALGO | 0.999982 | 3.362016 |
8ec9b6ee-5e65-48d6-97b7-b6fa3b9abd24 | adarshdbg/LeetCode | Depth-first Search/construct-binary-tree-from-inorder-and-postorder-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.999984 | 5.998131 |
7fc7cc17-2d8a-4954-9dbd-df104367f5b4 | CcTtry/LeetCodeRecord | code/31 nextPermutation.cpp | class Solution {
public:
void nextPermutation(vector<int>& nums) {
const int N = nums.size();
int left = N -1 , right = N - 1, end = N - 1;
for(int i = N - 2; i >= 0; i--) {
if (nums[i] < nums[i + 1]) {
left = i;
// cout<<"left = "<<left<<endl;
... | ALGO | 0.999996 | 5.347928 |
9a1309c1-c862-467a-ac52-b53b487c66cf | pappoja/ByteTrack | deploy/TensorRT/cpp/src/bytetrack.cpp | #include <fstream>
#include <iostream>
#include <sstream>
#include <numeric>
#include <chrono>
#include <vector>
#include <opencv2/opencv.hpp>
#include <dirent.h>
#include "NvInfer.h"
#include "cuda_runtime_api.h"
#include "logging.h"
#include "BYTETracker.h"
#define CHECK(status) \
do\
{\
auto ret = (... | DATA | 0.877528 | 3.830464 |
9a215501-d9db-4dcc-8c70-1597774fc282 | saurabhjn76/Competitive-Coding | CodeChef/Cook/MARCH/ROBOTG.cpp | #include "bits/stdc++.h"
using namespace std;
# define s(n) scanf("%d",&n)
# define sc(n) scanf("%c",&n)
# define sl(n) scanf("%lld",&n)
# define sf(n) scanf("%lf",&n)
# define ss(n) scanf("%s",n)
#define R(... | ALGO | 0.999518 | 3.839842 |
816e7587-16ac-4912-9057-c61e38d8e7df | ishandutta2007/codeforces | mangooste/normal/1143/F.cpp | #include <algorithm>
#include <array>
#include <cassert>
#include <iostream>
#include <vector>
using namespace std;
using ll = long long;
#define sz(a) int(a.size())
#define all(a) (a).begin(), (a).end()
istream& operator >> (istream &in, __int128 &x) {
ll value;
in >> value;
x = value;
return in;
}
... | ALGO | 0.999963 | 5.119056 |
bce146fa-3ca8-40e4-8bb4-a451532a17ce | chakitg/cp_solutions | gfg-potd/Merge Sort on Doubly Linked List.cpp | Given Pointer/Reference to the head of a doubly linked list of n nodes, the task is to Sort the given doubly linked list using Merge Sort in both non-decreasing and non-increasing order.
Example 1:
Input:
n = 8
value[] = {7,3,5,2,6,4,1,8}
Output:
1 2 3 4 5 6 7 8
8 7 6 5 4 3 2 1
Explanation: After sorting the given
li... | ALGO | 0.999998 | 6.182775 |
189534ec-b54b-4be9-8222-05a4d8fb297a | 2515299122/algorithm_study | programmercarl/tree/no55_117.cpp | //给定一个二叉树:
//
//
//struct Node {
// int val;
// Node *left;
// Node *right;
// Node *next;
//}
//
// 填充它的每个 next 指针,让这个指针指向其下一个右侧节点。如果找不到下一个右侧节点,则将 next 指针设置为 NULL 。
//
// 初始状态下,所有 next 指针都被设置为 NULL 。
//
//
//
// 示例 1:
//
//
//输入:root = [1,2,3,4,5,null,7]
//输出:[1,#,2,3,#,4,5,7,#]
//解释:给定二叉树如图 A 所示,你的函数应该填充它的每个 next... | ALGO | 0.999555 | 6.397962 |
949edcc1-53eb-432c-9074-12a5cc9e39bb | XRFoundation/three-physx | physx-js/PhysX/kaplademo/source/kaplaDemo/MathUtils.cpp | #include "MathUtils.h"
#include "foundation/PxMat33.h"
#include "PhysXMacros.h"
//---------------------------------------------------------------------
void jacobiRotate(PxMat33 &A, PxMat33 &R, int p, int q)
{
// rotates A through phi in pq-plane to set A(p,q) = 0
// rotation stored in R whose columns are eigenvect... | ALGO | 0.999756 | 5.643109 |
08dc8b5e-57f0-48a6-8c38-36a3af8be3b8 | wide777/AtCoder | ABC/ABC097/A.cpp | #include <bits/stdc++.h>
using namespace std;
using ll = long long;
#define REP(i, n) for(int i = 0; i < (int)(n); i++)
int main() {
int a, b, c, d;
cin >> a >> b >> c >> d;
if((abs(a - c) <= d) || (abs(a - b) <= d && abs(b - c) <= d)) {
cout << "Yes" << endl;
} else {
cout << "No" << e... | ALGO | 0.999894 | 3.286765 |
6be5ec29-412d-4ac9-abb4-bfaa31351942 | SoleMin/problem_solving_complexity | w3_p3/3.cpp | #include <iostream>
#include <cstring>
#include <vector>
#include <string>
#include <sstream>
#include <algorithm>
using namespace std;
typedef vector<int> vi;
int solved[101][10], penalty[101][10];
inline bool mySort(int i, int j)
{
int isolve = 0, ip = 0, jsolve = 0, jp = 0;
for (int a = 0; a < 10; a++) if (so... | ALGO | 0.946909 | 3.132173 |
c07c3c55-2031-4cca-aee1-24802df6890e | H4ckta/TA | listaExc2/ex3.cpp | const int buttonPin = 2;
const int ledPins[] = {3, 4, 5, 6, 7, 8, 9};
int contador = 0;
bool buttonState = false;
bool lastButtonState = false;
bool direcaoCrescente = true;
unsigned long ultimoTempo = 0; // Variável para armazenar o último tempo de mudança de contador
unsigned long intervalo = 1000; // Inter... | ALGO | 0.989911 | 6.225183 |
a81c3962-4497-48b5-80e4-c569eed8deef | raincross7/code-similarity | codes/train_code/problem032/problem032_118.cpp | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef long double ld;
typedef pair<int, int> Pii;
typedef pair<int, ll> Pil;
typedef pair<ll, ll> Pll;
typedef pair<ll, int> Pli;
#define fi first
#define se second
const ll MOD = 1e9 + 7;
const ll MOD2 = 998244353;
const ll MOD3 = 1812447359;
c... | ALGO | 0.99997 | 4.443474 |
72b2fc34-6bcd-40dc-9877-31cdc7413025 | Syncpine/LeetCodeSolutions | Array/2733. Neither Minimum nor Maximum.cpp | class Solution {
public:
int findNonMinOrMax(const std::vector<int>& nums)
{
int minNum = nums[0];
int maxNum = nums[0];
for(auto num : nums)
{
minNum = std::min(num, minNum);
maxNum = std::max(num, maxNum);
}
for(auto num : nums)
... | ALGO | 0.99986 | 5.323806 |
8cd762e8-d2d4-4ed2-aab9-278ba2a8c093 | kumari-jyoti/DataStructures-Algorithms | sumfi.cpp | #include <iostream>
#include <vector>
#include <algorithm>
using namespace std;
vector<int> fill_fi(vector<int> a, int n){
vector<int> fi;
int count;
for(int i=0;i<n;i++){
count=0;
for(int j=i+1;j<n;j++)
if(a[i]<a[j]) count++;
fi.push_back(count);
}
fi.push_back(0);
return fi;
}
void unordered_pairs(... | ALGO | 0.99983 | 3.972095 |
383cf5ee-a2dd-4651-9dfa-b001c2e2093e | DuoZhangRobotics/Bilevel-Differential-Grasp-Optimization | ThirdParty/Ipopt-3.12.11/Ipopt/src/LinAlg/IpSumMatrix.cpp | #include "IpoptConfig.h"
#include "IpSumMatrix.hpp"
#ifdef HAVE_CSTDIO
# include <cstdio>
#else
# ifdef HAVE_STDIO_H
# include <stdio.h>
# else
# error "don't have header file for stdio"
# endif
#endif
namespace Ipopt
{
SumMatrix::SumMatrix(const SumMatrixSpace* owner_space)
:
Matrix(owner_space),
... | ALGO | 0.937831 | 6.269224 |
7912379c-5290-4bed-a892-92ef0a21a1d9 | eungyukm/C_Pluse_Basic | Basic_91/Basic_91/Basic_91.cpp | // C++20 기준
#include <iostream>
#include <vector>
using namespace std;
class Graph
{
int vertexCount;
vector<vector<int>> adj;
public:
Graph(int vertices) : vertexCount(vertices), adj(vertices) {}
void AddEdge(int u, int v)
{
adj[u].push_back(v);
adj[v].push_back(u); // 무방향 그래프
... | ALGO | 0.989592 | 6.352713 |
e5679dc3-5446-48f1-8040-239310771fe0 | kks227/BOJ | 1100/1197.cpp | #include <cstdio>
#include <cstring>
#include <queue>
#include <map>
#include <utility>
#include <algorithm>
using namespace std;
typedef map<int, int> intMap;
typedef pair<int, int> intPair;
#define INF 1000000000000LL
class graph{
public:
graph(int n):size(n){
len = new intMap[n];
}
~graph(){... | ALGO | 0.999962 | 4.168925 |
3c0c48bc-09bd-4485-bda4-3a46b94c3000 | ishandutta2007/codeforces | supy/normal/801/D.cpp | #include<cstdio>
#include<cstdlib>
#include<algorithm>
#include<cmath>
#include<iostream>
#include<cstring>
#include<queue>
#include<cmath>
#define MAXN 20005
#define MAXM 200050
#define INF 0x7f7f7f7f
#define ll long long
#define rep(i,a,b) for (int i=(a); i<=(b); i++)
#define clr(x) memset(x,0,sizeof(x));
using names... | ALGO | 0.999508 | 3.448658 |
1fe268d8-23d6-4b84-adf5-b776adff8e3e | KodatunoOrg/KOD_TEST | UA/SampleFunc3.cpp | #include "StdAfxQt.h"
#include "SampleFunc.h"
// Function: Smp3xCAM
// スキャンパスを生成するシンプルな3xCAM
//
// Parameter:
// *S - 加工面(一つの面のみ)
// *C - 生成するスキャンパスのガイドカーブ
// R - ボールエンドミル半径
// N - スキャニングライン分割数(N < 100)
// H - 素材上面のZ座標
// D - Z方向分割数(粗加工用)
void Smp3xCAM(NURBSS *S,NURBSC *C,double R,int N,double H,int D)
{
double gr... | TOOL | 0.878242 | 3.68033 |
3ea444bd-64af-4946-b2c0-ae105f8cc487 | amitkrjha-geek/leetcode | 164-maximum-gap/164-maximum-gap.cpp | class Solution {
public:
int maximumGap(vector<int>& nums) {
if(nums.size()<2)return 0;
sort(nums.begin(),nums.end());
int ans=0,n=nums.size();
for(int i=0;i<n-1;i++)
{
ans=max(ans,nums[i+1]-nums[i]);
}
return ans;
}
}; | ALGO | 0.999967 | 5.185845 |
57ea0371-11d7-4d00-a51c-8346f2725822 | zguoch/gmsh | contrib/kbipack/gmp_normal_form.cpp | #include<stdlib.h>
#include"gmp_blas.h"
#include"gmp_matrix.h"
#include"gmp_normal_form.h"
/* The unaltered matrix and identity left and right factors */
static gmp_normal_form *
create_gmp_trivial_normal_form(gmp_matrix * A,
inverted_flag left_inverted,
inverted_flag right_inverted)
{
size_t row... | ALGO | 0.999883 | 4.326169 |
eb1948c1-8d4e-4255-93c1-b00225563cf0 | muyatk/Some_C_Coding_Exercises | String_Handling_16.cpp | #include "stdio.h"
#include "stdlib.h"
#include "string.h"
#pragma warning ( disable : 4996 )
char** SentenceSplit(char* pc, int* nWords) {
if (pc == NULL) {
return 0;
}
if (*(pc) == 0) {
*nWords = 0;
return 0;
}
const char* P = (char*)malloc(strlen(pc) + 1);
//strcpy(P, pc);
P = pc;
// Ok I ha... | ALGO | 0.996212 | 3.397143 |
5a47bd56-69fd-4b05-92ae-fc17b5d311ce | a-ma-n/Leetcode-Solutions | 131-palindrome-partitioning/131-palindrome-partitioning.cpp | class Solution {
public:
vector<vector<string>> partition(string s) {
vector<vector<string>> res;
vector<string> path;
func(0,s,path,res);
return res;
}
void func(int index,string s,vector<string> &path,vector<vector<string>> &res){
if(index == s.si... | ALGO | 0.999959 | 6.437951 |
26f62ebb-96b5-4151-8410-0c536bcf1d05 | Andrew-J-Li/UTPC-practice | Daily/arr.cpp | #include <bits/stdc++.h>
#define endl "\n"
#define ll long long
using namespace std;
int main() {
ios::sync_with_stdio(0);
cin.tie(0);
cout.tie(0);
vector<bool> sieve (6000000);
sieve[0] = true; sieve[1] = true;
for (ll i = 4; i < sieve.size(); i += 2) sieve[i] = true;
for (ll i = 3; i < s... | ALGO | 0.999815 | 4.203393 |
b9a0d453-1843-4600-bea8-a7d429b690f8 | Brio-yj/AlgorithmStudyBarkingDog | chanwan/week4/graph/11724.cpp | #include <iostream>
#include <vector>
using namespace std;
vector <vector<int>> v;
vector <int> cash;
int solve(int n){
cash[n]=1;
vector<int>::iterator en;
en = v[n].end();
for(auto it=v[n].begin();it!=en;it++){
if(cash[*it]==0){
solve(*it);
}
}
return 0;
}
int mai... | ALGO | 0.999841 | 3.79992 |
3f3ba23d-02b4-425a-ab01-fb31ae8a7d3a | dumganhar/firefox | tools/jprof/bfd.cpp | // vim:ts=8:sw=2:et:
#include "leaky.h"
#ifdef USE_BFD
#include <stdio.h>
#include <string.h>
#include <fcntl.h>
#include <unistd.h>
#include <libgen.h>
#include <bfd.h>
#include <cxxabi.h>
static bfd *try_debug_file(const char *filename, unsigned long crc32)
{
int fd = open(filename, O_RDONLY);
if (fd < 0)
... | TOOL | 0.872928 | 6.554977 |
47db01b4-8539-4598-a15e-26d478e15c94 | roytam1/gecko28a1-vc8 | gfx/skia/src/effects/gradients/SkSweepGradient.cpp | #include "SkSweepGradient.h"
SkSweepGradient::SkSweepGradient(SkScalar cx, SkScalar cy, const SkColor colors[],
const SkScalar pos[], int count, SkUnitMapper* mapper)
: SkGradientShaderBase(colors, pos, count, SkShader::kClamp_TileMode, mapper),
fCenter(SkPoint::Make(cx, cy))
{
fPtsToUnit.setTrans... | TOOL | 0.962807 | 7.458201 |
7f3df5e4-31be-4e49-b3af-5aa5b58b7a09 | MinatoAk/TechDemo | AlgorithmDemo/cpp/interview/72. 编辑距离.cpp | #include <iostream>
#include <cstring>
#include <algorithm>
#include <vector>
using namespace std;
string s1, s2;
int n, m;
int main() {
// 输入:s1 = "horse", s2 = "ros"
// 输出:3
// 输入:word1 = "intention", word2 = "execution"
// 输出:5
cin >> s1 >> s2;
n = s1.length(), m = s2.length();
s1 = "... | ALGO | 0.99998 | 4.901042 |
dce7ffff-9def-4d9b-8eb6-125751c1d244 | saidul-islam98/Codeforces-Codes | Next Round.cpp | #include<bits/stdc++.h>
using namespace std;
int main(){
int n,k,res=0,comp;
cin>>n>>k;
int sc[n];
for(int i=0;i<n;i++){
cin>>sc[i];
}
comp=sc[k-1];
for(int i=0;i<n;i++){
if(sc[i]<comp){
break;
}
else if(sc[i]>0){
res++;
}
... | ALGO | 0.999964 | 3.46676 |
5748add7-10d9-4952-a4d9-92fffdeba2b5 | Vinyas-13/Leetcode | 0102-binary-tree-level-order-traversal/0102-binary-tree-level-order-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.999977 | 6.086392 |
b11b5505-60ff-45a7-922c-a4a5f1915e3b | siwenhongyi/leetcodeAlgorithms | cpp/dynamic-programming/1513.仅含 1 的子串数.cpp | /*
* @lc app=leetcode.cn id=1513 lang=cpp
*
* [1513] 仅含 1 的子串数
*/
#include "head.h"
using namespace std;
// @lc code=start
using ll = long long;
static constexpr int P = int(1E9) + 7;
class Solution {
public:
int numSub(string s) {
map<ll, ll> cnt;
ll pre = 0;
int ret = 0;
for (char ch : s)
... | ALGO | 0.99991 | 6.259168 |
c12c624c-103f-48b9-b1dc-6558b6fafe56 | bb-worm/AlgoStudy2021 | friends/week8/subarray-sum-equals.cpp | // https://leetcode.com/problems/subarray-sum-equals-k/
#include <iostream>
#include <vector>
#include <unordered_map>
using namespace std;
class Base {
public:
virtual int subarraySum(vector<int>& nums, int k) = 0;
};
// TLE
// O(n^2)
class Solution1 : public Base {
public:
int subarraySum(vector<int>& num... | ALGO | 0.999654 | 6.485732 |
3b137e4a-1b11-4c64-8ec1-6c39b18cab3e | pr7prashant/Leetcode | 120-triangle/120-triangle.cpp | class Solution {
public:
int solve(vector<vector<int>>& triangle, int row, int col, vector<vector<int>>& dp) {
if (row == triangle.size()) return 0;
if (dp[row][col] != -1) return dp[row][col];
int res1 = triangle[row][col] + solve(triangle, row + 1, col, dp);
int r... | ALGO | 0.999993 | 6.472632 |
55c008c3-3df0-4d4c-bd88-feab02dcbb2b | Adesanya-Toba/Coding-Tests | Structy/binary_tree-max_path.cpp | /**
* @file binary_tree-max_path.cpp
* @author Toba Adesanya (<EMAIL>)
* @brief Write a function, maxPathSum, that takes in a pointer to the root of
* a binary tree that contains number values. The function should return
* the maximum sum of any root to leaf path within the tree.
*
* You... | ALGO | 0.999978 | 6.316453 |
0d78a510-6f0d-4872-a3b5-5697acf266a2 | Abu-Zakaria/problemsets | 581/A.cpp | #include <bits/stdc++.h>
using namespace std;
#define endl '\n'
#define PRINT(stuff) std::cout << stuff << endl
#define PRINT_NO_LINE(stuff) std::cout << stuff
#define PRINT_VEC(stuff) \
for (size_t i = 0; i < stuff.size(); i++) \
{ \
PRINT(... | ALGO | 0.999882 | 4.453527 |
5e565c82-2c55-49f7-aa7d-34cb1ae2cc45 | stoeckley/Nintendoish | src/Core/CPU.cpp | #include "CPU.h"
#include "NES.h"
#include <iostream>
#include <sstream>
#include <iomanip>
#include <stdio.h>
using namespace std;
using namespace NES;
CPU::CPU(NES::Memory &memory):
memory(memory),
debugTable {
"BRK", "ORA", "NMI", "SLO", "NOP", "ORA", "ASL", "SLO", "PHP", "ORA", "ASL", "ANC", "NOP"... | TOOL | 0.917188 | 6.133796 |
2afda00b-b443-4243-99b5-4740061c66f5 | 113bommy/deepmind_codecontests_refine | cpp_source_filter_file/cpp_train_2550_7.cpp | #include <bits/stdc++.h>
using namespace std;
const int mo = 1000000007;
const int N = 205;
const int dx[] = {-2, -2, -1, -1, 1, 1, 2, 2};
const int dy[] = {-1, 1, -2, 2, -2, 2, -1, 1};
int vis[N][N], n;
int dis[N][N], cnt[N];
pair<int, int> q[N * N];
long long T;
int main() {
scanf("%lld%d", &T, &n);
for (int i = ... | ALGO | 0.99994 | 4.296574 |
52a3778b-4498-442c-94fb-ba084dccfdd0 | Dervun/Homeworks | 1/homework 2/task_2_6/main.cpp | /*!
* > Реализовать консольную игру "Быки и коровы" (http://goo.gl/J1LKti).
*/
#include <cstdio>
#include <ctime>
#include <cstdlib>
main()
{
const int quantityOfNumeral = 4;
int array[quantityOfNumeral];
srand (time(NULL));
array[0] = 1 + rand() % 9;
for (int i = 1; i < quantityOfNumeral; i++) ... | TEST | 0.988882 | 3.926842 |
da229a63-cad3-477b-8832-1083239a4b02 | kkisic/Procon | CPP/AOJ/Vol16/1619.cpp | #include <cmath>
#include <iostream>
#include <vector>
#include <queue>
#include <map>
#include <set>
#include <algorithm>
#include <utility>
#include <iomanip>
#define int long long int
#define rep(i, n) for(int i = 0; i < (n); ++i)
using namespace std;
typedef pair<int, int> P;
const int INF = 1e15;
const int MOD... | ALGO | 0.999848 | 3.973554 |
ac948562-224f-4bfa-9036-f0a41086a2a1 | PranavJayachandran/AOC | day12.cpp | #include <bits/stdc++.h>
#include <complex>
#include <queue>
#include <set>
#include <unordered_set>
#include <list>
#include <chrono>
#include <random>
#include <iostream>
#include <algorithm>
#include <cmath>
#include <string>
#include <vector>
#include <map>
#include <unordered_map>
#include <stack>
#include <iomani... | ALGO | 0.999944 | 4.767204 |
77112d6a-210e-4d90-acc9-f194eaf593c3 | Takeyeldean/150-problems-DS-A | problems/Remove Duplicates from Sorted Array II/code.cpp | class Solution {
public:
// Time complexity
int removeDuplicates(vector<int>& nums) {
int p=0;
int cnt = 1;
for(int i=1;i<nums.size();i++)
{
if(nums[i] != nums[p])
{
nums[++p] = nums[i];
cnt = 1;
}
else if(cnt<2)
{
nums[++p]... | ALGO | 0.999719 | 6.228983 |
eaf0fd79-a0bb-4954-adf0-314e8eb413f5 | dnx4015/pbrt-importance-sampling | pbrt-v2-master/src/integrators/diffuseprt.cpp | // integrators/diffuseprt.cpp*
#include "stdafx.h"
#include "integrators/diffuseprt.h"
#include "sh.h"
#include "light.h"
#include "scene.h"
#include "camera.h"
#include "intersection.h"
#include "paramset.h"
#include "montecarlo.h"
// DiffusePRTIntegrator Method Definitions
DiffusePRTIntegrator::DiffusePRTIntegrator(... | ALGO | 0.996909 | 6.748645 |
71015143-d4fa-4345-a899-1ab814c68a56 | 113bommy/deepmind_codecontests_refine | cpp_gold_filter_file/cpp_train_12773_1.cpp | #include <bits/stdc++.h>
using namespace std;
int main() {
long long a, b, c, d;
cin >> a >> b >> c >> d;
char arr[50][50];
cout << 50 << " " << 50 << endl;
for (long long i = 0; i < 25; i++) {
for (long long j = 0; j < 50; j++) {
arr[i][j] = 'A';
}
}
long long i = 0;
long long j = 0;
wh... | ALGO | 0.999777 | 3.514982 |
4212df92-e526-4918-9cd7-b8b62f260dcf | Fi281001/c- | chuhoachuthuong.cpp | #include<bits/stdc++.h>
using namespace std;
int main() {
string s;
while(getline(cin,s)){
int dem=0, dem1=0;
int n=s.length();
for(int i=0;i<n;i++){
if(s[i]>='A'&&s[i]<='Z')
dem++;
else {
if(s[i]>='a'&&s[i]<='z')
dem1; }
}
if(dem>dem1) {
for(int i=0;i<n;i++){
if(s[i]>='A'&&s[i]<='Z... | ALGO | 0.999893 | 4.524484 |
30124be1-17d7-4d8e-ad2a-660358f171ef | avibega23/DATA-STRUCTURES-AND-ALGORITHMS | OLD PRACTICE/Daily DSA practice/January DSA Leetcode Problems/Longest_Consecutive_Sequence_In_A_Array.cpp | #include <bits/stdc++.h>
int longestSuccessiveElements(vector<int>&a) {
// Write your code here.
sort(a.begin(),a.end());
int maxCnt = -1;
int cnt = 1;
for(int i =0;i < a.size();i++)
{
if(a[i+1]-a[i]==1)
{
cnt++;
}
else if(a[i+1]-a[i]==0)
{
... | ALGO | 0.999943 | 4.646693 |
1ce48059-5b1c-49e9-b88a-437ecdf3561d | GyosunShin/ProblemSolving | 프로그래머스 문제풀이/카카오/2020 KAKAO BLIND RECRUITMENT/외벽 점검(3rd).cpp |
// OUTPUT
// ϱ ϴ ģ ּҰ return
// 쿡 -1 return
// 1 <= ܺ <= 200
// 1 <= weak.size() <= 15
// 1 <= dist.size() <= 8 == ģ
#include <string>
#include <vector>
#include <cmath>
#include <bitset>
#include <iostream>
#include <algorithm>
using namespace std;
int humanNum;
int weakNum;
int N;
vector<int> pick... | ALGO | 0.999925 | 4.253126 |
bde5459c-dd4d-4cda-b5b3-14582c3a9154 | MariaAkterKhadiza/phitron | DATA STRUCTURE/week_1(intro_ds)/assignment_01(module_4)/Insert_it.cpp | #include <bits/stdc++.h>
using namespace std;
int main()
{
ios::sync_with_stdio(false);
cin.tie(nullptr);
int N;
cin >> N;
vector<int>v1(N);
for(int i=0;i<N;i++){
cin>>v1[i];
}
int M;
cin >> M;
vector<int>v2(M);
for(int i=0;i<M;i++){
cin>>v2[i];
}
i... | ALGO | 0.999807 | 4.031082 |
65add1df-9131-4381-9793-8b5ab504083e | coolyuyuyu/leetcode | algorithm_0000-0999/643-Maximum Average Subarray I/main.cpp | class Solution {
public:
double findMaxAverage(vector<int>& nums, int k) {
assert(k <= nums.size());
int sum = std::accumulate(nums.begin(), nums.begin() + k, 0);
int maxSum = sum;
for (size_t i = k; i < nums.size(); ++i) {
sum -= nums[i - k];
sum += nums[i];... | ALGO | 0.999714 | 7.001348 |
07a9d37d-bb3f-41fa-8ec2-bcf4b60c4995 | ishandutta2007/codeforces | andreikkaa/normal/1531/E2.cpp | /*
* C++11 code template for contests.
* @author: Andrei Kalendarov
* @e-mail: <EMAIL>
*/
//#define ANDREIKKAA_ALLOCATOR
const int _ML = 228;
const char _inpf[] =
#if defined(ANDREIKKAA)
"input.txt"
#else
""
#endif
;
const char _outf[] =
#if defined(ANDREIKKAA)
""
#else
""
#endif
;
#if defined(ANDREI... | ALGO | 0.999993 | 4.148417 |
255b700b-68a0-495f-b570-2207a18dfc17 | Ragdha-Elgaidi/cpp-lessons-M_s_DataTypesAndVariables | SwapingThreeNumbers.cpp | #include<iostream>
using namespace std;
int main() {
int num1, num2, num3, temp = -1;
/*
We can reduce a hard to easier problems
We solve it as separate swap operations
*/
cin >> num1 >> num2 >> num3;
// swap num1, num2
temp = num2;
num2 = num1;
num1 = temp;
// swap num2, num3
temp = num3;
num3 = num2... | ALGO | 0.999968 | 3.966819 |
dd45bc31-00cf-4cdd-ae7f-b840fbc65c5f | SlimRoms/android_external_webkit | Source/WebCore/webaudio/RealtimeAnalyser.cpp | #include "config.h"
#if ENABLE(WEB_AUDIO)
#include "RealtimeAnalyser.h"
#include "AudioBus.h"
#include "AudioUtilities.h"
#include "FFTFrame.h"
#if ENABLE(WEBGL)
#include "Float32Array.h"
#include "Uint8Array.h"
#endif
#include <algorithm>
#include <limits.h>
#include <wtf/Complex.h>
#include <wtf/MathExtras.h>
#i... | TOOL | 0.88176 | 7.276381 |
481bdb48-394d-4ed8-952d-c6274f9dd049 | John-barca/C-Plus-Plus | 跳台阶/跳台阶/test.cpp | #include <iostream>
using namespace std;
//һһףn̨ףж
//class Solution {
//public:
// int jumpFloor(int number) {
// if (number == 0)
// {
// return 0;
// }
// if (number == 1)
// {
// return 1;
// }
// if (number == 2)
// {
// return 2;
// }
// int first = 1;
// int second = 2, third = 0;
// for (int ... | ALGO | 0.99994 | 4.650852 |
22c7fdf8-4210-43e7-a8fe-2d3da34dcd60 | kabuto64425/Atcoder | ABC/ABC101_200/ABC167/Telepoter.cpp | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define REP(i,n) for(ll i=0;i<ll(n);i++)
#define REPD(i,n) for(ll i=n-1;i>=0;i--)
#define FOR(i,a,b) for(ll i=a;i<=ll(b);i++)
#define FORD(i,a,b) for(ll i=a;i>=ll(b);i--)
#define INF 1000000000000 //10^12:∞
#define MOD 1000000007 //10^9+7:合同式の法
sign... | ALGO | 0.999995 | 4.448984 |
16122f3b-225f-4657-8fc6-65a6196662d9 | 951390752/Algorithm_analysis_and_design-homework | homework_2/floyd.cpp | #include<iostream>
#include<algorithm>
#include<cstring>
using namespace std;
const int N = 210, INF = 1e9;
int n, m, k, d[N][N];
void floyd() {
for (int k = 1; k <= n; k++)
for (int i = 1; i <= n; i++)
for (int j = 1; j <= n; j++)
d[i][j] = min(d[i][j], d[i][k] + d[k][... | ALGO | 0.999986 | 4.282135 |
84c388f4-d929-4715-908c-d19393c11621 | Scientificresearch/PU-DEMO | liblinear-2.11/tron.cpp | #include <math.h>
#include <stdio.h>
#include <string.h>
#include <stdarg.h>
#include "tron.h"
#ifndef min
template <class T> static inline T min(T x,T y) { return (x<y)?x:y; }
#endif
#ifndef max
template <class T> static inline T max(T x,T y) { return (x>y)?x:y; }
#endif
#ifdef __cplusplus
extern "C" {
#endif
exte... | ALGO | 0.999718 | 5.879037 |
62cd37fe-acae-4618-865c-e037fe55639c | davc19/Ejemplos---Pilas | Ejemplos-Pilas/Ejemplo-Nodo/Pila-Nodo.cpp | #include <iostream>
using namespace std;
struct Nodo
{
int dato;
Nodo* Siguiente;
};
void AgregarPila(Nodo*&, int);
void EliminarPila(Nodo*&, int&);
void ImprimirPila(Nodo*&);
int main()
{
int n, rep;
Nodo* pila = NULL;
cout << "Tamao de la Pila : ";
cin >> rep;
for (size_t i = 0; i < rep; i++)
{
cout <... | ALGO | 0.997992 | 4.303372 |
d0e92436-e277-405e-85e4-3cb46a9545bd | jshilong/GPT4RoI | mmcv-1.4.7/mmcv/ops/csrc/parrots/assign_score_withk.cpp | // Modified from
// https://github.com/CVMI-Lab/PAConv/tree/main/scene_seg/lib/paconv_lib/src/gpu
#include "pytorch_cpp_helper.hpp"
#include "pytorch_device_registry.hpp"
void assign_score_withk_forward_impl(int B, int N0, int N1, int M, int K, int O,
int aggregate, const Tensor& p... | DATA | 0.950286 | 6.103683 |
59faaa3b-1a77-460e-8ebf-8674197ec6ff | appinho/SAPathPlanningControl | PathPlanning/src/Eigen-3.3/bench/geometry.cpp |
#include <iostream>
#include <Eigen/Geometry>
#include <bench/BenchTimer.h>
using namespace std;
using namespace Eigen;
#ifndef SCALAR
#define SCALAR float
#endif
#ifndef SIZE
#define SIZE 8
#endif
typedef SCALAR Scalar;
typedef NumTraits<Scalar>::Real RealScalar;
typedef Matrix<RealScalar,Dynamic,Dynamic> A;
type... | ALGO | 0.932177 | 5.941502 |
f7245493-9d2c-42b0-8b45-5274ed210958 | yplusplus/aabbyy | 20180901/l.cpp | #include <stdio.h>
#include <map>
#include <queue>
#include <vector>
#include <string.h>
#include <iostream>
#define pb push_back
#define mp make_pair
#define _cls(a) memset(a,-1,sizeof(a));
#define ll long long
using namespace std;
int n,m,K;
vector< pair<int,ll> > g[100010];
struct Node {
int u;
int k;
... | ALGO | 0.999908 | 4.247386 |
f2313631-b5e2-4d00-a229-643a667d4aa9 | deanindaeyong/codetree-TILs | 240711/문자열 순서 바꾸기/change-order-of-strings.cpp | #include <iostream>
#include <string>
using namespace std;
int main() {
// Please write your code here.
string s,t;
cin>>s>>t;
cout<<t<<endl<<s;
return 0;
} | ALGO | 0.999726 | 3.416496 |
e3302d9d-98d1-4b04-bb8a-82a91dfaf1e4 | ullasreddy-chennuri/Interview-Prep-Programs | Arrays/submatrix_sum_queries.cpp |
#include<bits/stdc++.h>
using namespace std;
int main(){
int m,n;
cin>>m>>n;
int query;
cin>>query;
int a[1000][1000];
for(int i=0;i<m;i++){
for(int j=0;j<n;j++){
cin>>a[i][j];
}
}
//making a prefix sum matrix
//column wise sum
for(int i=0;i<m;i... | ALGO | 0.99917 | 3.893642 |
2ddc76d2-c182-45c7-abf0-aa5aa3596d16 | jbush001/NyuziToolchain | lib/CodeGen/CFIInstrInserter.cpp | #include "llvm/ADT/DepthFirstIterator.h"
#include "llvm/CodeGen/MachineFunctionPass.h"
#include "llvm/CodeGen/MachineInstrBuilder.h"
#include "llvm/CodeGen/MachineModuleInfo.h"
#include "llvm/CodeGen/Passes.h"
#include "llvm/CodeGen/TargetFrameLowering.h"
#include "llvm/CodeGen/TargetInstrInfo.h"
#include "llvm/CodeGen... | TOOL | 0.959041 | 7.937283 |
b26fae2d-eff4-4189-987a-dd664942b7cb | Prathibha28/codeforces | 1185A - Ropewalkers.cpp | #include <bits/stdc++.h>
using namespace std;
#include<array>
int main()
{
int a[3],d,p=0,n=0;
for(int i=0;i<3;i++){
cin>>a[i];
}
cin>>d;
sort(a,a+3);
while((a[1]-a[0])<d){
a[0]=a[0]-1;
n++;
}
while((a[2]-a[1])<d){
a[2]=a[2]+1;
p++;
}
cout<... | ALGO | 0.999702 | 3.222322 |
6328ce6d-57c5-45f0-b5ca-864206ca3700 | niravnb/InterviewBit | 1. Arrays/MinStepsinInfiniteGrid.cpp | /*
You are in an infinite 2D grid where you can move in any of the 8 directions :
(x,y) to
(x+1, y),
(x - 1, y),
(x, y+1),
(x, y-1),
(x-1, y-1),
(x+1,y+1),
(x-1,y+1),
(x+1,y-1)
You are given a sequence of points and the order in which you need to cover the points. Give the min... | ALGO | 0.999713 | 5.343342 |
34ed3aa2-2f93-4fe9-86e6-fcda1a3be5e7 | saipavan2702/my-leetcode | problems/longest_arithmetic_subsequence_of_given_difference/solution.cpp | class Solution {
public:
int longestSubsequence(vector<int>& arr, int di) {
int n=arr.size();
unordered_map<int,int>dict;
int hi=0;
for(int &i:arr){
if(dict.find(i-di)!=dict.end())
dict[i]=dict[i-di]+1;
else
dict[i]=1;
hi=... | ALGO | 0.999237 | 6.092488 |
ae149927-aba7-428b-a3de-6d7bcb4507dd | 113bommy/deepmind_codecontests_refine | cpp_gold_filter_file/cpp_train_2368_0.cpp | #include <bits/stdc++.h>
using namespace std;
const int N = 5e6 + 10;
int n, m, a[N], vis[N];
vector<int> e[N];
void dfs(int x) {
if (vis[x]) return;
vis[x] = 1;
for (int i = 0; i < e[x].size(); i++) dfs(e[x][i]);
for (int i = 0; i < n; i++)
if (x & (1 << i)) dfs(x - (1 << i));
}
int main() {
scanf("%d%d"... | ALGO | 0.999933 | 4.748891 |
16f57964-c636-476f-b847-0f4a22b3a3d1 | mhk0904/CppStudy | library/arrange.cpp |
#include "header.h"
//#include "public.cpp"
BookData* CreateLibrary(int max)
{
BookData *pData = NULL;
pData = new BookData;
if (max > 0)
{
pData->maxlist = max;
pData->currentlist = 0;
pData->bookLb = NULL;
}
else
{
cout << "error CrateLibrary : BookData != NULL" << endl;
return NULL;
}
pData->... | TOOL | 0.997611 | 3.318491 |
ad100985-035b-4ca2-8a01-5e734227b7d0 | alwwithu/ezcoincrypto | src/protocol.cpp | #include "protocol.h"
#include "util.h"
#include "utilstrencodings.h"
#ifndef WIN32
# include <arpa/inet.h>
#endif
namespace NetMsgType {
const char *VERSION="version";
const char *VERACK="verack";
const char *ADDR="addr";
const char *INV="inv";
const char *GETDATA="getdata";
const char *MERKLEBLOCK="merkleblock";
c... | TOOL | 0.850821 | 6.33575 |
c11a8d5b-9cd2-4324-8d4c-22c7452b28a6 | quantosaurosProject/quantLib | ql/legacy/libormarketmodels/lfmhullwhiteparam.cpp | /* -*- mode: c++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
#include <ql/math/matrixutilities/pseudosqrt.hpp>
#include <ql/legacy/libormarketmodels/lfmhullwhiteparam.hpp>
namespace QuantLib {
LfmHullWhiteParameterization::LfmHullWhiteParameterization(
const boost::shared_ptr<LiborForw... | ALGO | 0.991922 | 6.92006 |
5ad9f1fa-9486-4dda-bd9d-927a1cb9a511 | IDEA-CUHK/FlatDD | extern/taskflow/benchmarks/binary_tree/main.cpp | #include "binary_tree.hpp"
#include <CLI11.hpp>
void binary_tree(
const std::string& model,
const size_t num_layers,
const unsigned num_threads,
const unsigned num_rounds
) {
std::cout << std::setw(12) << "size"
<< std::setw(12) << "runtime"
<< std::endl;
for(size_t i=1; i<=num_... | TOOL | 0.861097 | 7.101547 |
30c4420a-95b8-405b-99bc-a36dbe98bb6e | DreDasLT/Informatika | Cplus/01 - Masyvas/01 - Krituliai/Krituliai.cpp | #include <fstream>
#include <iostream>
#include <iomanip>
using namespace std;
int main()
{
int dskaicius, dienos[10], isvisokrituliu = 0, nelijodienu = 0, lietingosdienos = 0, krituliuvidurkis = 0;
ifstream fd("Duomenys.txt");
fd >> dskaicius;
for ( int i = 0; i < dskaicius; i++ )
{
fd >> die... | TOOL | 0.993097 | 3.383765 |
cf8b650f-47ff-4aea-8545-2dc28cbdcca5 | UtkarshTiwariDevs/Datastructure-and-algorithm | 39 Stack aditya/minElement/minElemO(n).cpp | #include<bits/stdc++.h>
using namespace std;
stack<int> s;
stack<int> ss;
void push(int a)
{
s.push(a);
cout<<a<<" Pushed\n";
if(ss.size() == 0 || a <= ss.top())
ss.push(a);
}
void pop()
{
if(s.size()==0)
{
cout<<"Nothing to pop";
return;
}
int ans = s.top();
s.... | ALGO | 0.999725 | 4.214855 |
813b6d13-63ef-4fc8-a237-3838c8901b62 | ojhdt/code | cpp/homework5-7.cpp | #include <bits/stdc++.h>
using namespace std;
class MyString
{
public:
MyString(char *istr) : str(istr)
{
// cout << "Constructor" << endl;
};
char * concat(MyString &s)
{
char *sstr = s.str;
char * cp = str;
char * res = new char(size()+s.size()+1);
char * c... | TOOL | 0.888114 | 3.827491 |
e9cd4b06-5007-4ad3-9f35-8b8676e5169a | APTX-4869-hxb/toothlib | include/igl/per_face_normals.cpp | #define SQRT_ONE_OVER_THREE 0.57735026918962573
template <typename DerivedV, typename DerivedF, typename DerivedZ, typename DerivedN>
IGL_INLINE void igl::per_face_normals(
const Eigen::MatrixBase<DerivedV>& V,
const Eigen::MatrixBase<DerivedF>& F,
const Eigen::MatrixBase<DerivedZ> & Z,
Eigen::PlainObjectBase<D... | ALGO | 0.99951 | 5.417843 |
b2978f0d-8311-4a85-bdfd-3f5d656587d3 | Khong-cam-xuc/CODE_T | 28tech/BT/Sliding_Window/bai5.cpp | /**
* Author: Andrew
* Created: 30.04.2024 12:49:02
**/
#include <bits/stdc++.h>
#pragma GCC target("popcnt,lzcnt,bmi,bmi2,abm")
using namespace std;
#ifdef Andrew
#include "debug.h"
#else
#define debug(x...)
#endif
#define TIME (1.0 * clock()/ CLOCKS_PER_SEC)
#define FOR(i,a,b) for(int i = (a);i <= (b);++i)... | ALGO | 0.999979 | 4.740728 |
11986bf8-68be-44fe-aa6f-3a1c669c3e95 | GabbyLayr/Lista-de-atividades-03 | 5. Fatorial.cpp | //Elabore um algoritmo para calcular N! (fatorial de N) sendo que o valor inteiro de N
//fornecido pelo usurio. Sabe-se que: N! = 1x2x...x N-1 x N e 0! = 1. Use o enquanto...faa.
#include<stdio.h>
#include<locale.h>
#include <stdlib.h>
#include<math.h>
int main(){
//Declarao de variveis:
int numero, fat = 0, ... | ALGO | 0.999887 | 3.597482 |
29e040aa-d3cc-46f9-83a1-5ec488b86bdd | jessyoon14/leetcode | 5.longest-palindromic-substring.cpp | /*
* @lc app=leetcode id=5 lang=cpp
*
* [5] Longest Palindromic Substring
*/
// @lc code=start
class Solution {
public:
string longestPalindrome(string s) {
// find max odd-length palindrome
int maxLen = 1, bestLeft = 0;
for (int i = 0; i < s.size(); i++) {
int left = i, ... | ALGO | 0.999949 | 6.599626 |
2dcac694-54af-4b9b-8221-8caac7483e62 | aviskarrr/labofcpp | lab07/1.cpp | // Write a program to illustrate single, multiple, multilevel, hierarchial
// inheritance.
#include<iostream>
using namespace std;
class ddbase
{
// int ma;
public:
void display(){
cout<<"hello";
}
};
class chora_1:public ddbase{
public:
void chora(){
cout<<"... | TOOL | 0.908847 | 4.266293 |
a31b71da-9f52-4ff0-9627-f73d07c29951 | chetan9265/DSA | circlet/TWELVESERIES.cpp | #include<iostream>
using namespace std;
int main(){
for(int i=5;i>=1; i--){
for(int k=2; k<=i; k++){
cout<<" ";
}
for(int j=5; j>=i; j--){
cout<<"*"<<"";
}
cout<<endl;
}
return 0;
} | ALGO | 0.999513 | 3.01269 |
b1713a15-f2f2-4d72-80ac-edf5a66f92db | raincross7/code-similarity | codes/train_code/problem436/problem436_40.cpp | #include <iostream>
#include <bits/stdc++.h>
using namespace std;
using ll = int64_t;
#define rep(i,n) for(int i = 0; i < ((int)(n)); i++) // 0-indexed昇順
int main() {
int N; cin >> N;
vector<int> A(N);
rep(i,N) cin >> A.at(i);
sort(begin(A), end(A));
int mi = 1<<30;
for (int i = A[0]; i <= A[... | ALGO | 0.999739 | 4.14718 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.