uuid string | repo_name string | relative_path string | content string | category string | algo_rel_score float64 | quality_score float64 |
|---|---|---|---|---|---|---|
ec26a6de-82a3-4f57-bb14-1ec3794951cc | Programming-Metholodogy-II-Fa18/linking-assignment-DrewKoskinen | Problem3.cpp | #include <iostream>
#include"linkedlist.cpp"
using namespace std;
int main() {
int Num1, Num2, Num3, Num4, Num5;
linkedList list;
cout << "Please enter number1:" << endl;
cin >> Num1;
list.Push(Num1);
cout << "Please enter number2:" << endl;
cin >> Num2;
list.Push(Num2);
cout << "P... | ALGO | 0.9996 | 3.867236 |
4f168fef-5e83-4cbb-906c-3bc636fc5a8b | lovethiscode/boost | libs/intrusive/example/doc_rbtree_algorithms.cpp | struct my_node
{
my_node(int i = 0)
: int_(i)
{}
my_node *parent_, *left_, *right_;
int color_;
//other members
int int_;
};
//Define our own rbtree_node_traits
struct my_rbtree_node_traits
{
typedef my_node node;
typedef my_node * ... | ALGO | 0.999881 | 6.599195 |
58ee1459-3f90-49d7-97a6-1c9dca9053a1 | jamperezmondragon/Competitive-Programming | cf/1734/E.cpp | #include <bits/stdc++.h>
using namespace std;
using ll = long long;
using vi = vector<int>;
using vl = vector<ll>;
using pi = pair<int, int>;
using vii = vector<vector<int>>;
using mii = map<int, int>;
#define in(a) for (auto &e : a) cin >> e
#define sz(x) int((x).size())
#define all(a) a.begin(), a.end()
#define ptp p... | ALGO | 0.999745 | 3.337139 |
179edbdf-306b-41ea-9583-59a396a99535 | aajibade1/Circuit-Partition-Algorithm- | eigen/doc/snippets/JacobiSVD_basic.cpp | MatrixXf m = MatrixXf::Random(3,2);
cout << "Here is the matrix m:" << endl << m << endl;
JacobiSVD<MatrixXf> svd(m, ComputeThinU | ComputeThinV);
cout << "Its singular values are:" << endl << svd.singularValues() << endl;
cout << "Its left singular vectors are the columns of the thin U matrix:" << endl << svd.matrixU(... | ALGO | 0.999827 | 3.463409 |
d0cb2092-be2b-4518-ac3d-287704799d90 | vihanagarwal18/leetcode | 0287-find-the-duplicate-number/0287-find-the-duplicate-number.cpp | class Solution {
public:
int findDuplicate(vector<int>& nums) {
set<int> u;
for(auto& p:nums){
if(u.find(p)!=u.end()) return p;
u.insert(p);
}
return -1;
}
}; | ALGO | 0.999976 | 5.838529 |
5b56e2fe-05a8-459a-b3cc-b66632bc5b31 | 1092772959/My-ACM-code | 模板/数据结构/主席树-静态第k大.cpp | #include<cstdio>
#include<cstring>
#include<algorithm>
#include<cmath>
using namespace std;
typedef long long LL;
const int N = 200005;
const int INF = 0x3f3f3f3f;
int n,q,tot;
struct lp{
int l,r,sum;
lp(){l=r=sum=0;}
}cw[N*20];
int ar[N],br[N],now[N];
int root[N];
void update(int l,int r,int last,int &cur,int ... | ALGO | 0.999968 | 4.172748 |
48646db5-628f-48c8-8252-866ca426bd91 | redcyph/array | 2SumBetter.cpp | //TC: O(N), SC: O(N)
#include <bits/stdc++.h>
using namespace std;
vector<int> twoSum(int n, vector<int> &arr, int target) {
unordered_map<int, int> mpp;
for (int i = 0; i < n; i++) {
int num = arr[i];
int moreNeeded = target - num;
if (mpp.find(moreNeeded) != mpp.end()) {
... | ALGO | 0.99992 | 6.110073 |
e63da9c6-bfda-4b64-9555-90694985ec34 | Dysprosium0626/dyvm | src/dfa.cpp | //
// Created by Dysprosium on 2023/3/8.
//
#include "dfa.hpp"
#include <unordered_set>
#include <queue>
namespace dyvm {
bool SameSet(std::unordered_set<int> &s1, std::unordered_set<int> &s2) {
if (s1.size() != s2.size()) {
return false;
}
std::unordered_set<int> intersect;
for (auto x : s1) {
if (s... | ALGO | 0.999687 | 6.626295 |
c36e9aa9-6182-4b39-bdb7-017342252ebe | deverfan44/Problem-Solving | Week_2/Day_7/number_of_segment_with_big_sum.cpp | #include <bits/stdc++.h>
#define ll long long
using namespace std;
// it's my code
int main() {
ios::sync_with_stdio(false);
cin.tie(NULL);
int n;
ll k;
cin >> n >> k;
vector<ll> v(n);
for(int i=0; i<n; i++)
{
cin >> v[i];
}
int l=0,r=0;
ll sum=0,ans=0;
whil... | ALGO | 0.999986 | 4.094548 |
13e32657-a11e-46e1-90e3-9129ed5cb75e | saadahmad358/Prayer-Times-Flutter-App- | app/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.998485 | 6.76775 |
4de83cfd-d9e2-4f85-b4ad-8a18220d7ad7 | daizhenyang/OJs | Leetcode/BalancedBinaryTree.cpp | #include <vector>
#include <cstring>
#include <algorithm>
using namespace std;
struct TreeNode {
int val;
TreeNode *left;
TreeNode *right;
TreeNode(int x) : val(x), left(NULL), right(NULL) {}
};
class Solution {
public:
int judge(TreeNode * root) {
if(root == NULL) return 0;
int lheight = judge(roo... | ALGO | 0.999758 | 5.990901 |
91b2fa7d-7781-4ed0-8bc0-d087a4c42f5d | Anmolawasthi117/Dsa_using_C- | Contest/array_parity.cpp | #include <iostream>
#include <vector>
#include <bits/stdc++.h>
using namespace std;
vector<int> sortArrayByParity(vector<int> &nums)
{
for (int i = 0; i < nums.size(); i++)
{
if (nums[i] % 2 == 0)
{
nums[i] = 0;
}
else
nums[i] = 1;
}
sort(nums.begi... | ALGO | 0.999969 | 5.094356 |
b5bed00e-c058-47e4-af10-d248862175c7 | imanolgzz/ICPC-CrusadersMTY | TrainingCamp_Mexico2024/day_1/L.cpp | #include <iostream>
#include <unordered_map>
using namespace std;
int main(){
string s;
cin>>s;
int l=0;
int r=s.length()-1;
int diff=0;
while(l<r && diff<2){
if(s[l] == s[r]){
l++;
r--;
}else{
diff++;
l++;
r--;... | ALGO | 0.999976 | 4.053035 |
5613244f-9464-4b0b-8513-5b33dbf6007c | Dim314159/intro-to-AI | Nearest_neighbor/main.cpp | /************************************************
* CS 170, Nearest Neighbor
* 2019.11.06 D.Koltsov
*
* *********************************************/
#include "search.h"
int main()
{
Search my_search("my_data.txt");
std::cout << "\n\t\tChoose:\n\t1 for Forward Selection only\n\t2 for F... | ALGO | 0.992992 | 3.812304 |
7116b8e9-9a2e-428f-b631-0a431d3676d9 | se9fault/LeetCode-400 | 10-Backtracking/320_Generalized_Abbreviation.cpp | /*
Write a function to generate the generalized abbreviations of a word.
Example:
Given word = "word", return the following list (order does not matter):
["word", "1ord", "w1rd", "wo1d", "wor1", "2rd", "w2d", "wo2", "1o1d", "1or1",
"w1r1", "1o2", "2r1", "3d", "w3", "4"]
*/
class Solution {
public:
vector<string> ... | ALGO | 0.999197 | 6.696977 |
24d7fbb4-0d17-415b-980f-305aeab0731e | mohsenamjadi/LoadBalancer | tools.cpp | #include "tools.hpp"
using namespace std;
vector<string> Tools::splitBySpace(string statement){
vector<string> result;
string token;
for(int i=0; i<statement.length(); i++){
if(statement[i] != ' ')
token += statement[i];
else{
if(token.length()) {
re... | TOOL | 0.881388 | 4.362604 |
50c9eb74-024a-46f0-a533-6c8b0a9068db | Rodagui/CodeForces-Solutions | wizardsDuel.cpp | /*A. Wizards' Duel*/
#include <bits/stdc++.h>
using namespace std;
int main(){
ios_base::sync_with_stdio(0);
cin.tie(0);
cout.tie(0);
double dist, ans, harry, vold;
cin >> dist >> harry >> vold;
ans = (dist/ (harry + vold));
ans = harry * ans;
cout << ans;
return 0;
} | ALGO | 0.999404 | 3.2699 |
1514049b-a22e-4859-9679-ab2a718ed915 | sheldoer/Suda_examination_notes | 初试笔记/王道数据结构题实现代码/4.3.17/源.cpp | #include"head.h"
/*
㷨˼룺õݹֲͬһزƵϢûзزƵϢƣ
*/
int main(void) {
int num[Max1];
for (int i = 0; i < Max1; i++)
num[i] = i + 1;
BiTree T1;
Creattree(T1, num, 0, Max1);
int num2[Max2];
for (int i = 0; i < Max2; i++)
num2[i] = i + 1;
BiTree T2;
Creattree(T2, num, 0, Max2);
printf("%4s \n", semble(T1, T2) ? "yes" :... | ALGO | 0.999637 | 3.353697 |
b0f56611-5741-43ba-b273-1b75be8b1994 | hamidhosen42/STL-Standard-Template-Library | Almost everything about STL Priority queue.cpp | #include<bits/stdc++.h>
using namespace std;
#define hamid() ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);
#define endl '\n';
int main()
{
hamid();
priority_queue<int> p;
p.push(1);
p.push(2);
p.push(3);
p.push(4);
cout<<"Size:"<<p.size()<<endl;//4
cout<<p.top()<<endl;//4
p.... | ALGO | 0.99894 | 3.839933 |
2aa118dd-4259-4138-a569-9b7ed41ce341 | JustJie2002/Leetcode | Contest/W415/D.cpp | /********************************************
* author : Jie Chen (4th Year CS)
* school : Rochester Institute of Technology
* created: 09.14.2024 22:58:25
*********************************************/
using i64 = long long;
mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());
constexpr int MOD = ... | ALGO | 0.999941 | 6.434164 |
3054d5d7-e995-453d-86e7-fdacf4ac6316 | shammo18/Sports-Programming | Wet Shark and Flowers.cpp | //Bismillahir Rahmanir Rahim
//#pragma GCC optimize("Ofast,unroll-loops")
//#pragma GCC target("avx,avx2,fma")
#include<bits/stdc++.h>
#include<ext/pb_ds/assoc_container.hpp>
#include<ext/pb_ds/tree_policy.hpp>
#define ll long long
#define ull unsigned long long
#define pii pair<int,int>
#define pll pair<l... | ALGO | 0.998897 | 3.59529 |
8955f414-f1f1-4df7-8987-08d3bfae8b76 | paoqi1997/LanQiao | 基础练习/BASIC-21.cpp | /**
* 基础练习 Sine之舞
*/
#include <iostream>
using namespace std;
void An(int);
void Sn(int);
int main()
{
int n;
cin >> n;
Sn(n);
return 0;
}
void An(int n)
{
for (int i = 1; i <= n; ++i)
{
if (i == 1)
cout << "sin(" << i;
else
{
if (i % 2 ... | ALGO | 0.99811 | 4.003116 |
f3eb0868-fb22-4443-acf8-ba4e3ef157d5 | alexandraback/datacollection | solutions_5636311922769920_0/C++/snowbear/program1.cpp | #include "assert.h"
#include <algorithm>
#include <bitset>
#include <cctype>
#include <cmath>
#include <cstdio>
#include <deque>
#include <functional>
#include <iomanip>
#include <iostream>
#include <map>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <stdio.h>
#include <stdlib.h>
#include... | ALGO | 0.999249 | 3.297063 |
d572c824-bd2d-4b19-9898-528b9a2fdd65 | AgentPengin/PhucCNH | CP-Code/VNOJ/DHBB21_EASYTASK.cpp | #include<bits/stdc++.h>
#define fastio ios_base::sync_with_stdio(0);cin.tie(0);cout.tie();
#define fi first
#define se second
#define ll long long
#define EL "\n";
#define time cerr << "\nTime elapsed: " << 1.0 * clock() / CLOCKS_PER_SEC << " s.\n "
#define db(x) do { std::cerr << #x << ": " << x << EL;} while (0)
co... | ALGO | 0.9999 | 3.232691 |
c510f179-d16c-457a-aedd-d4a9e53956da | parteek10/LeetCodeContest | Weekly306/B.cpp | // Solution for Weekly Contest 306 B Solution
#define ll long long
class Solution {
public:
int edgeScore(vector<int>& edges) {
ll n=edges.size();
vector<ll> dp(n,0);
for(ll i=0;i<n;i++)
{
ll u=i;
ll v=edges[i];
dp[v]+=... | ALGO | 0.999978 | 5.040854 |
20267837-60e8-4a34-b2a1-5b6819530b1d | lavnesh694/leetcode | c++/Array/first_occurence.cpp | # include<iostream>
using namespace std;
int strStr(string haystack, string needle) {
for(int i=0;i<haystack.length();i++){
string s= haystack.substr(i,needle.length());
// cout<<s<<endl;
if(s==needle){
return i;
... | ALGO | 0.999755 | 4.889694 |
d62e69eb-f1a9-4477-96b5-6c81f4207302 | cxxxin/LeetCode | 1051.cpp | #include <iostream>
#include <algorithm>
#include <vector>
using namespace std;
/*
高度检查器
学校打算为全体学生拍一张年度纪念照。根据要求,学生需要按照 非递减 的高度顺序排成一行。
排序后的高度情况用整数数组 expected 表示,其中 expected[i] 是预计排在这一行中第 i 位的学生的高度(下标从 0 开始)。
给你一个整数数组 heights ,表示 当前学生站位 的高度情况。heights[i] 是这一行中第 i 位学生的高度(下标从 0 开始)。
返回满足 heights[i] != expected[i] 的 下标数量 。... | ALGO | 0.999961 | 4.856202 |
aee32d90-eb1b-442b-9f86-ebb061fa792a | shivangi806/DSA | 1663-smallest-string-with-a-given-numeric-value/1663-smallest-string-with-a-given-numeric-value.cpp | class Solution {
public:
string getSmallestString(int n, int k) {
int c=0;
string s;
for(int i=0;i<n;i++){
s+='a';
}
k=k-n;
if(k==0){
return s;
}
for(int i=n-1;i>=0;i--){
if(k==0){
return s;
}
... | ALGO | 0.999934 | 5.24325 |
1ad37e70-d840-4dd6-acee-f69dd1090849 | sahanivinay/Love_DSA_Sheet | Reverse string.cpp | class Solution {
public:
void reverseString(vector<char>& s) {
int start = 0;
int end = s.size()-1;
while(start<end)
{
char temp = s[start];
s[start++]= s[end];
s[end--] = temp;
}
}
};
| ALGO | 0.999192 | 6.164354 |
b579aff3-3df5-4efd-b18f-729aecc12002 | zdavid01/kofultet | 2.godina/aisp/3/faktorijel.cpp | #include <iostream>
using namespace std;
int main(){
int n;
cin >> n;
unsigned long long res = 1;
for(int i = 1; i<=n; i++){
res*=i;
cout << res << '\n';
}
return 0;
}
| ALGO | 0.999859 | 4.371327 |
35fb6bc4-dd9e-4831-bbf9-7e40a8550cf7 | SiyangShao/codes | ICPC/OfficialICPC/21SEERC/G.cpp | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
int main() {
ios::sync_with_stdio(false);
cin.tie(nullptr), cout.tie(nullptr);
int n;
ll ans = 0;
cin >> n;
vector<pair<ll, ll>> x(n * 2);
for (auto &[a, b] : x) {
cin >> a >> b;
ans += abs(a - b);
}
sort(x.begin(), x.end(), [](auto x, aut... | ALGO | 0.999789 | 3.708021 |
2511f898-ac2b-4aca-9d56-66e678c89758 | shantanu9890/Stack-Queue | inbuilt_stack.cpp | #include <iostream>
#include <bits/stdc++.h>
#include <stack>
using namespace std;
int main(){
stack <int>s;
s.push(10);
s.push(20);
s.push(30);
s.push(40);
cout<<s.top()<<endl;
s.pop();
cout<<s.size()<<endl;
cout<<s.empty()<<endl;
cout<<s.top()<<endl;
} | TOOL | 0.882554 | 3.498758 |
c37d781f-b4ff-4e94-8d6b-cd3af515daea | rahman-sohan/CP_Solved | EOlymp/901/22943238_WA_3ms_1800kB.cpp | #include <bits/stdc++.h>
using namespace std;
int isOPerator(char ch)
{
if(ch =='+' || ch =='-' || ch=='*')
return 1;
else return 0;
}
int main()
{
int N,cnt=0;
string str;
cin>>str;
for (int i = 0; i < str.size(); i++)
{
if(str[i]=='-' && i==0)
continue;
... | ALGO | 0.999901 | 4.076601 |
040dcb30-5745-4e95-8948-2fa00b8908ed | ssafy11-study/test | src/week3/19597_1조_정종화.cpp | //https://www.acmicpc.net/submit/19597
#include <iostream>
#include <algorithm>
#include <vector>
using namespace std;
using lld = long long;
#define MX 150
#define MOD 100000007
#define fastio cin.tie(0)->sync_with_stdio(0)
#define pi pair<int, int>
#define pl pair<lld, lld>
int T, N;
string v[MX][2];
int w[150];
boo... | ALGO | 0.999971 | 4.240469 |
d85dc547-5a33-4a1c-bda4-02eddaf23e32 | Ali-Hasan-Khan/CP-res | basic cpp/t.cpp | #include<iostream>
using namespace std;
int main()
{
long long n;
cin >> n;
while (true) {
cout << n << " ";
if (n == 1) break;
if (n%2 == 0) n /= 2;
else n = n*3+1;
}
cout << "\n";
} | ALGO | 0.999957 | 4.133916 |
ae8f65a7-f5a7-449f-b3b9-8d5ff5953bb1 | tafaB/problems | study/tree.cpp | /*
NOTEPAD:
REPRESENTATION:
1
2 3
4 5
BFS and DFSs of above Tree
Breadth First Traversal : 1 2 3 4 5
//code here
Depth First Traversals:
Preorder Traversal : 1 2 4 5 3
//code here
Inorder Traversal : 4 2 5 1 3
//co... | ALGO | 0.999978 | 4.172571 |
232e7b30-38c2-4fdb-81b5-53a1004e81c3 | Keshari818/LeetCode | 0204-count-primes/0204-count-primes.cpp | class Solution {
public:
int countPrimes(int n) {
vector<bool> prime(n+1,true);
for(int p=2;p*p<=n;p++){
if(prime[p]){
for(long long j=(long long)p*p; j<n; j+=p){
prime[j]=false;
}
}
}
int cnt=0;
for(... | ALGO | 0.99988 | 5.5945 |
550eeaad-6b68-4364-b5dc-c7d11ab6f8ba | Proyecto3Grupo02/Aegis | AegisEngine/Dependencias/Bullet/src/src/BulletCollision/BroadphaseCollision/btSimpleBroadphase.cpp | #include "btSimpleBroadphase.h"
#include "BulletCollision/BroadphaseCollision/btDispatcher.h"
#include "BulletCollision/BroadphaseCollision/btCollisionAlgorithm.h"
#include "LinearMath/btVector3.h"
#include "LinearMath/btTransform.h"
#include "LinearMath/btMatrix3x3.h"
#include "LinearMath/btAabbUtil2.h"
#include <ne... | TOOL | 0.852793 | 6.866664 |
058f7625-73e2-4350-92bb-e5ad189d1f8a | brico-labs/LoRa | WorkshopOSHWDem18/Projects/3_TTN_Gateway_with_Sensors/libraries/aes/AES-128_V10.cpp | /******************************************************************************************
*
* File: AES-128_V10.cpp
* Author: Gerben den Hartog
* Compagny: Ideetron B.V.
* Website: http://www.ideetron.nl/LoRa
* E-mail: <EMAIL>
*******************************************************************... | ALGO | 0.971058 | 5.319456 |
e0b9e8cd-d4c0-46f8-bc0d-1d550923806c | Sumanth-NR/CompetitiveProgramming | Platforms/CSES/Mathematics/Josephus_Queries.cpp | #include <bits/stdc++.h>
using namespace std;
typedef long long int ll;
const int MOD = 1e9 + 7;
void solve() {
int k, n;
cin >> n >> k;
/**
* Let's say the sequence we have is of the form ak + b \n
* Initially, a = 1 and b = 0 \n
* If k < n/2, we can calculate the k-th element to be remove... | ALGO | 0.99994 | 3.871307 |
d07b8bcb-491f-4cd0-925c-a8d08382d09b | lkeller19/currency_app | 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 |
42e9a1bf-8388-418c-bb6d-ee45c408fbbc | leonardofmoura/Programming | Exercises/2_2b.cpp | #include <iostream>
using namespace std;
int main() {
double in1, in2, in3; //values to be introduced
double min1 ,min2, min3; // minimum value
int test; //stores the position os the min value (if its in1 it stores the value 1 etc...)
//input
cout << "Insert 3 numbers: ";
cin >> in1 >> in2 >> ... | ALGO | 0.999917 | 4.14052 |
a8ee046d-ee22-4286-89f2-f2e527f6924b | grefen/CGChess | src/move_do.cpp | // move_do.cpp
// includes
#include "attack.h"
#include "board.h"
#include "colour.h"
#include "hash.h"
#include "move.h"
#include "move_do.h"
#include "piece.h"
#include "pst.h"
#include "random.h"
#include "types.h"
#include "value.h"
// prototypes
static void square_clear( board_t *board, int square, int piece, ... | ALGO | 0.966167 | 6.124726 |
16be15bd-8819-4f95-ada7-e23ca37f57d0 | AkashKumarMaurya01/LEET-POTD | GREEDY/330_Patching Array.cpp | #include<bits/stdc++.h>
using namespace std;
class Solution
{
public:
int minPatches(vector<int>& nums, int n) {
long long maxReach =0;
int patch=0;
int i=0;
while(maxReach<n)
{
if(i<nums.size() && (nums[i]<=maxReach+1))
{
maxReac... | ALGO | 0.999824 | 5.867842 |
63e4a123-0c81-4b6c-97bb-20ae0a905265 | csh-apprentice/Time_Based_SL | src/MACHDYN/compute_smd_tlsph_num_neighs.cpp | // clang-format off
#include <cstring>
#include "compute_smd_tlsph_num_neighs.h"
#include "atom.h"
#include "update.h"
#include "modify.h"
#include "comm.h"
#include "force.h"
#include "memory.h"
#include "error.h"
#include "pair.h"
using namespace LAMMPS_NS;
/* ------------------------------------------------------... | ALGO | 0.991638 | 6.89843 |
9188cb8d-90ee-4fab-8906-fa8da0bb61e5 | kezhengjie/m3u8dc | thirdparty/include/cryptopp/tea.cpp | // tea.cpp - modified by Wei Dai from code in the original paper
#include "pch.h"
#include "tea.h"
#include "misc.h"
// http://github.com/weidai11/cryptopp/issues/503
#if defined(__xlC__) || defined(__SUNPRO_CC)
# define MAYBE_VOLATILE(x) (*const_cast<volatile word32*>(&x))
#else
# define MAYBE_VOLATILE(x) (x)
#endif... | ALGO | 0.996473 | 7.759282 |
69bd9fce-a13f-477e-a8f5-7fa958ef2cf1 | 01shuaib01/Data-Structure-And-Algorithm | Pattern/pattern8.cpp |
#include <iostream>
using namespace std;
int main()
{
int n = 6;
// for rows.
for (int row = 1; row <= n; row++)
{
// outer spaces
for (int col = 1; col <= n - row; col++)
{
cout << " ";
}
if (row == 1)
{
cout << "*";
}... | ALGO | 0.994747 | 3.838147 |
14e1ac31-b78c-4668-ada8-c2816287d20b | anshika2609/coding | linked_list_cycle.cpp | /**
* Definition for singly-linked list.
* struct ListNode {
* int val;
* ListNode *next;
* ListNode(int x) : val(x), next(NULL) {}
* };
*/
class Solution {
public:
bool hasCycle(ListNode *head)
{
ListNode *p=head,*q=head;
while(p && q && q->next)
{
... | ALGO | 0.999666 | 4.915285 |
53d1d3e5-7f35-4136-9a58-392c97f1662c | vineethakagitha/Extra-problems | Linked list Problems/Medianofll.cpp | //To find Median of given linkedlist.
//Specify NULL when you complete entering the list you wish to.
#include<stdio.h>
#include<stdlib.h>
#include<conio.h>
typedef struct node{
int data;
node *link;
};
int medianof(node*);
void main()
{
int n;
node *t=(node*)malloc(sizeof(node)),*head;
head = t;
printf("Enter th... | ALGO | 0.999979 | 3.837945 |
dbaba84d-ea49-4aba-9a2d-760f5e370825 | ishandutta2007/codeforces | ffao/normal/167/B.cpp | #include <vector>
#include <list>
#include <map>
#include <set>
#include <deque>
#include <stack>
#include <bitset>
#include <algorithm>
#include <numeric>
#include <utility>
#include <sstream>
#include <iostream>
#include <iomanip>
#include <cstdio>
#include <cmath>
#include <cstdlib>
#include <ctime>
#include <cstrin... | ALGO | 0.999938 | 3.511095 |
997e4258-ac4c-4a00-90e3-5b1b4918e9d7 | Arpad96/CPP-2021 | lab04/PointSet.cpp | #include <iostream>
#include "PointSet.h"
#include "Point.h"
#include <vector>
#include <math.h>
#include <time.h>
#include <stdlib.h>
#define M 2000
using namespace std;
PointSet::PointSet(int n)
{
for (int i = 0; i < n; i++)
{
Point p1(rand() % 2000, rand() % 2000);
points.push_back(p1);
}
computeDistan... | ALGO | 0.994268 | 3.639928 |
df3f6244-0e52-4f5d-902e-701b5c67b0e9 | shlok-2003/DSA-Notes | 16_Queue/ImplementationOfQueue.cpp | #include <iostream>
#include <cmath>
using namespace std;
class Queue{
private:
int front, rear, size;
int* arr;
public:
Queue() {
size = 1000005;
front = rear = 0;
arr = new int[size];
}
void push(int x) {
if(rear ==... | ALGO | 0.998766 | 4.415482 |
69faa4c7-5594-445b-a320-b79c9447f290 | adelnobel/Training-for-ACM-ICPC-problems | Ad-hoc/UVA11786 - Global Raining at Bididibus/Code.cpp | #include <cstdlib>
#include <iostream>
#include <vector>
#include <cstring>
#include <cassert>
#include <cstdio>
#include <algorithm>
#include <map>
#include <set>
using namespace std;
typedef long long ll;
int Y[10006 * 2];
int main() {
#ifndef ONLINE_JUDGE
freopen("in.in", "r", stdin);
#endif
i... | ALGO | 0.936909 | 3.249678 |
52742091-550c-4a78-850a-5af6bf3e4d5e | harshit2101/leetcode | 312-burst-balloons/312-burst-balloons.cpp | class Solution {
public:
int dp[302][302];
// int solve(int i,int j,vector<int>& nums){
// if(i>j) return 0;
// if(dp[i][j]!=-1) return dp[i][j];
// int maxi=INT_MIN;
// for(int ind=i;ind<=j;ind++){
// int cost=nums[i-1]*nums[ind]*nums[... | ALGO | 0.999987 | 4.966319 |
3284a612-931a-493b-95dc-89c0bb06d7b7 | Gurubalan-GIT/CCC | C++/Compiler-Design/First&Follow/main.cpp | #include<iostream>
#include<cstring>
#include<stdio.h>
using namespace std;
char first[20] = "";
int in(char arr[20], char sym)
{
for(int i = 0; arr[i]!='\0'; i ++)
if(arr[i] == sym)return 1;
return 0;
}
char * First(char sym, char prod[][20], int n)
{
int k = strlen(first);
if(!isalnum(sym)){i... | ALGO | 0.999915 | 3.668916 |
5ad97af4-9c28-48dd-8f41-76d9a9683600 | 7Marius/Moteur-d-auto-compl-tion-simple- | ressource.cpp | #include<iostream>
#include"centre.h"
int length(std::string word)
{
int j = 0;
for(int i = 0; word[i] != '\0'; i++)
{
j++;
}
return j;
} | TOOL | 0.900388 | 3.240733 |
337ffafb-d5a2-4101-912a-1a67019ea124 | Woooosz/AlgorithmTrainSet | 1046. Shortest Distance (20).cpp | /*
1046. Shortest Distance (20)
时间限制
100 ms
内存限制
65536 kB
代码长度限制
16000 B
判题程序
Standard
作者
CHEN, Yue
The task is really simple: given N exits on a highway which forms a simple cycle, you are supposed to tell the shortest distance between any pair of exits.
Input Specification:
Each input file contains one test case. ... | ALGO | 0.999989 | 3.984221 |
275a9630-613a-429e-b7a7-607d7513abcc | BandhiyaHardik/Leetcode_Solutions | daily_problems/1611_Minimum_One_Bit_Operations _to_Make _Integers_Zero.cpp | class Solution {
public:
int minimumOneBitOperations(int n) {
if(n == 0)
return 0;
vector<long long> function(32, 0);
function[0] = 1;
for(int i = 1; i <= 31; i++) {
function[i] = 2*function[i-1] + 1;
}
int result = 0;
... | ALGO | 0.999915 | 6.380418 |
172469ae-9cad-4e71-aab0-bda5f6858563 | CookiC/UVaOJ | Chapter 7. Brute Force/12113 - Overlapping Squares.cpp | #include<cstdio>
#include<cstring>
#include<iostream>
#include<set>
#include<ctime>
using namespace std;
struct State{
unsigned G[4][4];
State(unsigned *a){
memcpy(G,a,16*sizeof(unsigned));
}
State(const void *a){
memcpy(G,a,16*sizeof(unsigned));
}
bool operator < (const State b)const{
if(memcmp(this,&b,s... | ALGO | 0.999894 | 3.497532 |
8e91b0eb-483e-4450-9137-011ed0be3afe | Subbuleo23/finding-nemo | CB/AlgoSummerJune19/Session14/Rats.cpp | #include <iostream>
#include <unordered_map>
using namespace std;
int numrats(int *arr, int n) {
unordered_map<int, int> mp;
int ans=0;
for(int i=0;i<n;i++) {
if(arr[i]==0) {
ans+=1;
continue;
}
if(mp.find(arr[i])==mp.end()) {
mp[arr[i]]=0;
ans+=(arr[i]+1);
} else {
mp[arr[i]]++;
if(mp[arr... | ALGO | 0.999904 | 4.132474 |
cf500bd7-dd2e-4354-b5dd-f82b552fef79 | GarageGames/Qt | qt-5/qtwebengine/src/3rdparty/chromium/third_party/icu/source/tools/toolutil/package.cpp | #include "unicode/utypes.h"
#include "unicode/putil.h"
#include "unicode/udata.h"
#include "cstring.h"
#include "uarrsort.h"
#include "ucmndata.h"
#include "udataswp.h"
#include "swapimpl.h"
#include "toolutil.h"
#include "package.h"
#include "cmemory.h"
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
stat... | TOOL | 0.903836 | 5.444123 |
26382bb4-a868-4439-a93a-218522639a0a | vRaphiel/Algoritmos-y-Estructura-de-Datos-1 | Labos/Labo01/ejercicios.cpp | #include <iostream>
int f (int x, int y){
if(x>y){
return x+y;
}else{
return x*y;
}
}
int menorDivisorDesde (int n, int k){
if(n==k){
return n;
}else if(n % k == 0){
return k;
}else{
menorDivisorDesde(n, (k+1));
}
}
int menorDivisor(int n){
retu... | ALGO | 0.999357 | 4.640439 |
96b5f91c-6f3e-4902-94f8-ebd7a31d6375 | access-softek/llvm-project | compiler-rt/test/fuzzer/AbsNegAndConstant64Test.cpp | // abs(x) < 0 and y == Const puzzle, 64-bit variant.
#include <cstddef>
#include <cstdint>
#include <cstdio>
#include <cstdlib>
#include <cstring>
extern "C" int LLVMFuzzerTestOneInput(const uint8_t *Data, size_t Size) {
if (Size < 16) return 0;
int64_t x;
uint64_t y;
memcpy(&x, Data, sizeof(x));
memcpy(&y, ... | ALGO | 0.97164 | 5.1078 |
fb6da777-bdd6-43c2-84f5-01101734f6ec | FullteaR/CompetitiveProgramming | AtCoder/ABC179/C.cpp | #include <iostream>
using namespace std;
int main(void){
long N;
cin>>N;
long retval=0;
for(long i=1;i<=N;i++){
if(i*i<N){
retval+=1;
}
for(long j=i+1;j<=(N/i)+20;j++){
if(i*j<N){
retval+=2;
}
}
}
cout<<retval<<endl;
return 0;
}
| ALGO | 0.999357 | 3.353722 |
ecf20194-916b-42ec-ad69-061124af3fc4 | TheCrazyCoder28/HacktoberFest-Starter | c++/selectionSort.cpp | #include <iostream>
using namespace std;
void selectionSort(int arr[], int n)
{
for (int i = 0;i < n;i++)
{
int current = i;
//second loop for unsorted part ie right side
for (int j = i + 1;j < n;j++)
{
if (arr[j] < arr[current])
{
curre... | ALGO | 0.99996 | 4.809612 |
334bf2fa-0572-4718-bb9b-29c53f9e8c6e | FastFeynmanDiagrammatics/FastFeynmanDiagrammatics | ffd/packages/WickBlockOracle/test/test.cpp | #include<ffd/std.hpp>
#include<ffd/core.hpp>
#include"../../PackagesMath.hpp"
#include"../../QuadraticAction.hpp"
#include"../../WickBlockOracle.hpp"
using namespace ffd::user_space;
int main(){
std::array<int, 2> x1{0,1}, x2{-1, 0};
QuadraticAction<Real> H_0 = (Bar(Psi_(1))(x1)*Psi_(1)(x2))*(-1.);
H_0 += FlipS... | ALGO | 0.9113 | 3.070653 |
a3c651a7-1f14-4252-a9e0-5becaf63710c | adhyayanrajpoot1/LeetCode | 374-guess-number-higher-or-lower/374-guess-number-higher-or-lower.cpp | /**
* Forward declaration of guess API.
* @param num your guess
* @return -1 if num is higher than the picked number
* 1 if num is lower than the picked number
* otherwise return 0
* int guess(int num);
*/
class Solution {
public:
int guessNumber(int n) {
int maxNumbe... | ALGO | 0.999994 | 5.921804 |
57b3e0e1-d064-4539-8487-4cd5ffaf5054 | sarvex/leetcode-clojurescript | lcci/04.03.List of Depth/Solution.cpp | /**
* Definition for a binary tree node.
* struct TreeNode {
* int val;
* TreeNode *left;
* TreeNode *right;
* TreeNode(int x) : val(x), left(NULL), right(NULL) {}
* };
*/
/**
* Definition for singly-linked list.
* struct ListNode {
* int val;
* ListNode *next;
* ListNode(int x)... | ALGO | 0.999928 | 6.170911 |
b92eea2e-63ab-4736-b5f7-1611f675689d | hemantgarg1452/Stack-Sheet | Longest Valid Parentheses.cpp | class Solution {
public:
int longestValidParentheses(string s) {
stack<int>st;
st.push(-1);
int res = 0;
for(int i=0; i<s.size(); i++){
if(s[i]=='('){
st.push(i);
} else {
st.pop();
}
if(st.empty()){
... | ALGO | 0.999519 | 6.029901 |
a9830c34-b8ef-457f-bb93-3aa91aa10d6a | aa35037123/gpe- | 出現4次/DungeonMaster.cpp | #include<iostream>
#include<cstdio>
#include<queue>
using namespace std;
int L,R,C;
struct Position{
int l;
int r;
int c;
int minute;
//constructor:在創建struct時可以直接把相關數據放在()裡面,初始化很方便
//:後面為<struct內的element>(讓此數值等於多少),意思為element = x
//constructor後面要加上{}
Position(int l, int r, int c, int ... | ALGO | 0.99985 | 3.625612 |
b1ee1b87-a60d-4eb0-a097-e2b62cd70cf5 | Anirudh257/Leetcode_Solutions | 0078-subsets/0078-subsets.cpp | class Solution {
public:
// Time complexity: O(2^n*n), Space complexity: O(1)
vector<vector<int>> subsets(vector<int>& nums) {
vector<vector<int>> subs;
int size = nums.size();
int numSubs = (1 << size); // 2^size
for (int num = 0; num < numSubs; num++) {
vec... | ALGO | 0.999866 | 6.607495 |
6bb7fb52-7e1a-4de9-a246-0b0ca868829c | alexandraback/datacollection | solutions_5648941810974720_0/C++/mgch/main.cpp | #include <stdio.h>
#include <algorithm>
#include <assert.h>
#include <set>
#include <map>
#include <complex>
#include <iostream>
#include <time.h>
#include <stack>
#include <stdlib.h>
#include <memory.h>
#include <bitset>
#include <math.h>
#include <string>
#include <string.h>
#include <queue>
#include <vector>
using ... | ALGO | 0.999694 | 3.962482 |
fef948cb-6fb5-4a96-9e75-b68019f963f4 | Nikh9123/PracticeCPP | prcQ.cpp | using namespace std;
#include <bits/stdc++.h>
class stack1
{
int q[50];
int max, rear, front;
public:
stack1();
int IsEmpty();
int Isfull();
void Insert(int);
int Delete();
};
stack1 ::stack1()
{
max = 50;
front = rear = -1;
}
int stack1 ::IsEmpty()
{
if (rear == front)
{
... | ALGO | 0.997713 | 3.951142 |
3968d056-e4dc-4854-8467-4c0ef8c7039e | phitronio/XPSC_Batch_04 | Segment Tree Lazy/Addition and Sum.cpp | #include <bits/stdc++.h>
using namespace std;
const int maxN = 1e5 + 9;
long long a[maxN], t[maxN * 4], lazy[maxN * 4];
void push(int n, int b, int e) {
if (lazy[n] == 0) {
return;
}
t[n] += (1LL * (e - b + 1) * lazy[n]);
if (b != e) {
int l = (2 * n), r = (2 * n) + 1;
lazy[l] += lazy[n]... | ALGO | 0.999931 | 5.282135 |
ed5c8927-0149-4005-b266-465c3cbf34d7 | hikon27/godotengine-godot | thirdparty/glslang/glslang/MachineIndependent/parseConst.cpp | //
// Traverse a tree of constants to create a single folded constant.
// It should only be used when the whole tree is known to be constant.
//
#include "ParseHelper.h"
namespace glslang {
class TConstTraverser : public TIntermTraverser {
public:
TConstTraverser(const TConstUnionArray& cUnion, bool singleConstP... | TOOL | 0.954705 | 5.912715 |
8111ff7f-9d5f-4949-a628-bdaf640d4c02 | openjdkgit/jfx17u | modules/javafx.web/src/main/native/Source/WebCore/platform/network/RFC8941.cpp | #include "config.h"
#include "RFC8941.h"
#include "ParsingUtilities.h"
#include "RFC7230.h"
#include <wtf/text/StringBuilder.h>
#include <wtf/text/StringHash.h>
#include <wtf/text/StringParsingBuffer.h>
#include <wtf/text/StringView.h>
namespace RFC8941 {
using namespace WebCore;
template<typename CharacterType> co... | TOOL | 0.874691 | 7.554702 |
ab6e9bb7-f69a-4f30-8a24-1b2992619052 | S2T-ANAND/TRADITIONAL-ALGO | next greater element.cpp | #include <bits/stdc++.h>
#define all(v) v.begin(),v.end()
#define sz(x) (int)x.size()
#define endl "\n"
#define ld long double
using namespace std;
typedef long long int ll;
#ifdef ONLINE_JUDGE
#define debug(...)
#else
#define debug(...) cerr<<__LINE__ <<"::"<< "[" << #__VA_ARGS__ << "]->",debug_out(__VA_ARGS__)
#endif... | ALGO | 0.999967 | 4.537694 |
85f9642f-df0c-4c38-a3f3-d534a3fc776f | BIT-zhaoyang/competitive_programming | uva10306.cpp | #include <iostream>
#include <vector>
#include <cstring>
#include <string>
#include <algorithm>
#include <map>
#include <climits>
#include <cmath>
#include <set>
#include <bitset>
#include <sstream>
#include <iomanip>
#define _ ios_base::sync_with_stdio(0), cin.tie(0), cout.tie(0), cout.precision(15);
using namespace s... | ALGO | 0.999811 | 3.845831 |
dbef0dad-57a5-4533-8cea-7029ab59cf43 | Cernewein/2048 | damierdyn.cpp | #include "damierdyn.h"
#include <iostream>
using namespace std;
DamierDyn::DamierDyn(int lignes, int colonnes, int v,QObject *parent){
T = NULL;
Redim(lignes,colonnes);
Init(v);
score=0;
}
DamierDyn::DamierDyn(const DamierDyn &d,QObject *parent){
T = NULL;
Redim(d.L,d.C);
for(int i=0; i<L;... | ALGO | 0.986591 | 3.105512 |
26716d3a-fb92-4e00-9b90-8a9debbb2de9 | n0ming/algorithm-solutions | Baekjoon/2446.cpp | #include <iostream>
using namespace std;
int main(){
int N;
cin >> N;
for(int i=N; i>=1; i--){
for (int j=0; j<N-i;j++){
cout <<" ";
}
for(int j=2*i-1; j>=1;j--){
cout <<"*";
}
cout << "\n";
}
for(int i=2; i<=N; i++){
for (int... | ALGO | 0.999963 | 3.719963 |
44aec4f2-e4ef-4697-b811-a6b63c3bd411 | sshockwave/Online-Judge-Solutions | EZOJ/Contests/1396/A.cpp | #include <iostream>
#include <cstdio>
#include <cstring>
#include <cassert>
#include <cctype>
#include <vector>
using namespace std;
typedef long long lint;
#define cout cerr
#define ni (next_num<int>())
template<class T>inline T next_num(){
T i=0;char c;
while(!isdigit(c=getchar())&&c!='-');
bool flag=c=='-';
flag... | ALGO | 0.999989 | 3.997163 |
00399f48-21f8-404a-97aa-8ca9a9c60f01 | muggalladevisai/cpp | template class tem with int float.cpp | #include <iostream>
using namespace std;
template <class t,class t1>
class name
{
t x;
t1 y;
public:name(t a,t1 b)
{
x=a;
y=b;
}
t1 sum()
{
return x+y;
}
};
int main() {
name <int,float>obj(4,5.6);
cout<<obj.sum();
return 0;
}
| ALGO | 0.921544 | 4.063145 |
a9c776c2-30fa-42a0-bec0-1817b4284f5b | yssgood/LeetCode-Premium | 0582-kill-process/0582-kill-process.cpp | class Solution {
public:
map<int,int> hashMap;
vector<int> answer;
void dfs(vector<vector<int>>& adj, int hashNode){
answer.push_back(hashNode);
for(int next : adj[hashNode]){
dfs(adj,next);
}
}
vector<int> killProcess(vector<int>& pid, vector<int>& ppid, int ... | ALGO | 0.999972 | 6.029058 |
b9e5b9ef-05ce-4e33-b67d-70614f23771a | asu-crypto/mpsica | thirdparty/linux/boost/tools/quickbook/src/include_paths.cpp | #include "native_text.hpp"
#include "glob.hpp"
#include "include_paths.hpp"
#include "state.hpp"
#include "utils.hpp"
#include "quickbook.hpp" // For the include_path global (yuck)
#include <boost/foreach.hpp>
#include <boost/range/algorithm/replace.hpp>
#include <boost/filesystem/operations.hpp>
#include <cassert>
na... | TOOL | 0.964733 | 4.829107 |
42795eb1-0d43-4628-beab-7d0c909004d5 | ArhamChouradiya/Basic-Computer-Graphics-Programs | LAB13.CPP | #include<iostream.h>
#include<conio.h>
#include<graphics.h>
void main()
{
int gd=DETECT,gm;
initgraph(&gd,&gm,"..\\BGI");
cout<<"Bresenham circle drawing algorithm\nArham Chouradiya\n17115013\n20/8/19";
circle(250,250,100);
getch();
closegraph();
}
| ALGO | 0.998586 | 3.835402 |
55294d27-50cb-411e-8f45-ac816f02a8a7 | SundownRises/LEETCODE | 234-palindrome-linked-list/palindrome-linked-list.cpp | /**
* Definition for singly-linked list.
* struct ListNode {
* int val;
* ListNode *next;
* ListNode() : val(0), next(nullptr) {}
* ListNode(int x) : val(x), next(nullptr) {}
* ListNode(int x, ListNode *next) : val(x), next(next) {}
* };
*/
class Solution {
public:
bool isPalindrome(Lis... | ALGO | 0.999891 | 6.249382 |
3612d055-4541-44cd-a5a0-3931f420a865 | SciGWood/42_CPP | CPP_09/ex02/main.cpp | /* ************************************************************************** */
/* */
/* ::: :::::::: */
/* main.cpp :+: :+: :+: ... | TEST | 0.982846 | 5.184846 |
caff62cc-d758-40f3-8ac7-92b1fa20c0f6 | afsanamim04/Codeforces-Another | MIN = GCD.cpp | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
int main() {
ios::sync_with_stdio(0);
cin.tie(0);
int T, n;
cin >> T;
while (T--) {
cin >> n;
vector<ll> a(n);
for (ll &x : a) {
cin >> x;
}
int p = min_element(a.begin(), a.end()) - a.begin();
ll g = 0;
for (int i = 0; i < n; ++... | ALGO | 0.999865 | 4.363902 |
aba03d10-51eb-48ac-ac64-faa13e23e7c3 | arcgt/nori | ext/nanogui/ext/eigen/lapack/lu.cpp | #include "common.h"
#include <Eigen/LU>
// computes an LU factorization of a general M-by-N matrix A using partial pivoting with row interchanges
EIGEN_LAPACK_FUNC(getrf,(int *m, int *n, RealScalar *pa, int *lda, int *ipiv, int *info))
{
*info = 0;
if(*m<0) *info = -1;
else if(*n<0) ... | ALGO | 0.999391 | 5.816968 |
02303f72-a5b2-4139-9ba3-4ef5ea078d9b | xinhao94/hello-world | abstract.cpp | #include <iostream>
#include <algorithm>
#include <string>
#include <math.h>
#include <vector>
using namespace std;
class Shape{
public:
// Declaration of an abstract method (aka pure virtual member function)
virtual double getArea() const = 0;
// Destructor, also needs to be virtual
... | ALGO | 0.994352 | 6.361541 |
923e105c-783d-46c8-80ce-b1baded6fecf | Yijun-Jeon/BaekjoonOnlineJudge | 백준/Bronze/2588. 곱셈/곱셈.cpp | #include <iostream>
using namespace std;
int main(void)
{
int A, B;
cin >> A >> B;
cout << A * (B % 10) << endl;
cout << A * (B % 100 / 10) << endl;
cout << A * (B / 100) << endl;
cout << A * B << endl;
return 0;
}
| ALGO | 0.999711 | 3.203901 |
9a8fcc67-afa6-4315-a12d-8ef6130c44b9 | pandeyashutosh02/LeetCode | 2888-minimum-index-of-a-valid-split/2888-minimum-index-of-a-valid-split.cpp | class Solution {
public:
int minimumIndex(vector<int>& nums) {
unordered_map<int, int> mp;
for(auto x : nums)mp[x]++;
int dominant=0, maxx=0;
for(auto i : mp) {
if(i.second>maxx) {
maxx=max(maxx, i.second);
dominant=i.first;
}
... | ALGO | 0.999998 | 5.827571 |
5ecbcf3a-9d1a-40f7-b6fb-f9584754d9c2 | abunaim1/data_structure | week2- linked_list/module-7 singly_list(Recap)/recap_singly_list.cpp | #include <iostream>
using namespace std;
class Node
{
public:
int value;
Node *next;
Node(int value)
{
this->value = value;
this->next = NULL;
}
};
void insert_any_pos(Node *head, int pos, int v)
{
Node *newNode = new Node(v);
Node *temp = head;
for (int i = 1; i <= pos -... | ALGO | 0.992095 | 4.08533 |
d901d608-07e0-40c2-b03e-78b0bd3c2422 | Source-SDK-Resources/source-sdk-gameui | sp/src/tier1/checksum_sha1.cpp | /*
100% free public domain implementation of the SHA-1
algorithm by Dominik Reichl <<EMAIL>>
=== Test Vectors (from FIPS PUB 180-1) ===
SHA1("abc") =
A9993E36 4706816A BA3E2571 7850C26C 9CD0D89D
SHA1("abcdbcdecdefdefgefghfghighijhijkijkljklmklmnlmnomnopnopq") =
84983E44 1C3BD26E BAAE4AA1 F95129E5 E54670F1
... | ALGO | 0.960342 | 6.585141 |
149b62da-478c-401c-a521-263a9116820e | yooniversal/PS | BOJ/dfs, bfs/4179.cpp | //4179
#include <iostream>
#include <string>
#include <cstring>
#include <cstdio>
#include <vector>
#include <deque>
#include <queue>
#include <stack>
#include <cmath>
#include <algorithm>
#include <map>
using namespace std;
#define INF 1000000001
#define MAX 1001
typedef long long ll;
typedef vector<int> vi;
typedef ... | ALGO | 0.999931 | 4.388108 |
d72422f2-6f1a-4065-b6ac-c22b630e7332 | UynUyn2k10103/Algorithm | xau_nhi_phan_ke_tiep.cpp | #include <bits/stdc++.h>
#define fastIO() ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);
#define ll long long
#define fori(i,a,b) for (ll i = a; i < b; i++)
#define forr(i,a,b) for (ll i = a - 1; i >= b; i--)
#define pb push_back
#define mp make_pair
#define F fist
#define S second
using namespace std;
string ... | ALGO | 0.999731 | 4.18276 |
fff72861-0d81-4cc9-b175-798492181bc2 | aTonyXiao/DataStructures | P3/StackLi.cpp | #include "StackLi.h"
#include <iostream>
using namespace std;
/**
* Construct the stack.
*/
template <class Object>
StackLi<Object>::StackLi( )
{
topOfStack = NULL;
}
/**
* Copy constructor.
*/
... | ALGO | 0.955291 | 6.356909 |
e5480f0e-be43-4867-9e6a-23ef192fdaa1 | syurskyi/Python_Topics | 125_algorithms/_examples/_algorithms_challenges/leetcode/leetCode/Greedy/122_BestTimeToBuyAndSellStockII.cpp | /*
* @Author: <EMAIL>
* @Last Modified time: 2016-08-22 20:03:11
*/
class Solution {
public:
/*
As long as there is a price gap, we gain a profit.
*/
int maxProfit(vector<int>& prices) {
int max_profit = 0;
for(int i=1; i<prices.size(); i++){
int diff = prices[i] - prices... | ALGO | 0.999681 | 6.010928 |
eb2727b0-425d-4ffb-a1ec-b34eab3f86fb | saffronjam/Algorithms | Source/Algorithms/HeapSort.cpp | #include "HeapSort.h"
namespace Se
{
HeapSort::HeapSort() :
Algorithm("Heap Sort")
{
}
void HeapSort::Sort()
{
for (long i = static_cast<long>(Elements().size() / 2 - 1); i >= 0 && _state != State::BeingCollected; i--)
{
PauseCheck();
Heapify(Elements().size(), i);
}
for (long i = static_cast<long>(Elements... | ALGO | 0.998139 | 4.942717 |
1b33af86-45af-4aee-b5ab-bb5f198378f4 | MartinBanky/qt5-base | src/corelib/tools/qcollator_icu.cpp | #include "qcollator_p.h"
#include "qstringlist.h"
#include "qstring.h"
#include <unicode/utypes.h>
#include <unicode/ucol.h>
#include <unicode/ustring.h>
#include <unicode/ures.h>
#include "qdebug.h"
QT_BEGIN_NAMESPACE
void QCollatorPrivate::init()
{
cleanup();
UErrorCode status = U_ZERO_ERROR;
QByteAr... | TOOL | 0.871792 | 6.593875 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.