uuid string | repo_name string | relative_path string | content string | category string | algo_rel_score float64 | quality_score float64 |
|---|---|---|---|---|---|---|
11ef6b91-e519-46b3-bd6b-b20e5cca1f12 | nikhil980/gfgcoding | Difficulty: Easy/Delete nodes having greater value on right/delete-nodes-having-greater-value-on-right.cpp | //{ Driver Code Starts
#include <bits/stdc++.h>
using namespace std;
struct Node {
int data;
Node* next;
Node(int x) {
data = x;
next = NULL;
}
};
void print(Node* root) {
Node* temp = root;
while (temp != NULL) {
cout << temp->data << " ";
temp = temp->next;
... | ALGO | 0.999776 | 6.243492 |
ce3b8312-a2ac-463e-a368-1b5ac038987f | helloobaby/llvm_msvc | libcxx/test/std/algorithms/alg.modifying.operations/alg.generate/ranges_generate.pass.cpp | // UNSUPPORTED: c++03, c++11, c++14, c++17
// <algorithm>
// template<input_or_output_iterator O, sentinel_for<O> S, copy_constructible F>
// requires invocable<F&> && indirectly_writable<O, invoke_result_t<F&>>
// constexpr O generate(O first, S last, F gen); // S... | TEST | 0.920344 | 7.342703 |
09ec9d91-8b58-4f41-be71-0490b1d56211 | ishandutta2007/codeforces | mateocv/normal/1400/D.cpp | #include <bits/stdc++.h>
#define pb push_back
#define fst first
#define snd second
#define fore(i,a,b) for(int i=a,ggdem=b;i<ggdem;++i)
#define SZ(x) ((int)x.size())
#define ALL(x) x.begin(),x.end()
#define mset(a,v) memset((a),(v),sizeof(a))
#define FIN ios::sync_with_stdio(0);cin.tie(0);cout.tie(0)
using namespace st... | ALGO | 0.999183 | 3.57508 |
26404d99-abd8-449f-b49b-720992fead17 | KagE-Akumaa/Coding | leetcode/61_Rotate_List.cpp |
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:
ListNode* rotateRight(ListNode* head, int k) {
if (!head || !head->next || k == 0) return hea... | ALGO | 0.999968 | 5.921722 |
12d8c502-2330-4977-8f49-1e2ebd59bddb | rebnh/BeccasTM | turing_machine/input_strings.cpp | #include "input_strings.h"
#include "turing_machine.h"
#include <iostream>
#include <string>
#include <vector>
#include <fstream>
using namespace std;
Input_Strings::Input_Strings(string string_file_name,
const Turing_Machine &turing_machine):
string_status(false)
{
ifstream inp... | TOOL | 0.858084 | 4.268961 |
4da47002-60fe-4b99-b5b7-8ed50c3884a1 | phaXcoin/phaxcoin | src/P2p/NetNodeConfig.cpp | #include "NetNodeConfig.h"
#include <boost/utility/value_init.hpp>
#include <Common/Util.h>
#include "Common/CommandLine.h"
#include "Common/StringTools.h"
#include "crypto/crypto.h"
#include "CryptoNoteConfig.h"
namespace CryptoNote {
namespace {
const command_line::arg_descriptor<std::string> arg_p2p_bind_ip ... | CONFIG | 0.921847 | 6.654748 |
3b7e8eac-2dc9-4681-b8fe-59e0fbc22136 | shohan-hyder/Shohag-Course-Phase-1 | ( Part - 2 )/Class - 2/Problems/Difference Array/Greg and Array.cpp | #include<bits/stdc++.h>
#define ll long long
#define endl '\n'
using namespace std;
int32_t main() {
ios_base :: sync_with_stdio(0);
cin.tie(0); cout.tie(0);
ll n, m, k;
cin >> n >> m >> k;
vector<ll> a(n + 5, 0);
vector<ll> l(m + 5, 0), r(m + 5, 0), d(m + 5, 0);
for (int i = 1; i <= n; ... | ALGO | 0.999863 | 3.661589 |
b56b22a3-d69a-42c5-a63c-c4d9c9d14631 | wshwbluebird/PojSummer2016 | 1125StockbrokerGrapevine.cpp | ////
//// Created by wshwbluebird on 16/7/24.
////
//
//#include <iostream>
//#include <string.h>
//
//using namespace std;
//
//const int INF =20;
//
//int d[101][101];
//
//void Floyde(int n){
//
// for (int i = 1; i <= n ; ++i) {
// for (int j = 1; j <= n ; ++j) {
// d[i][j] = (i==j? 0:INF);
/... | ALGO | 0.998976 | 3.323524 |
a77562d8-e8f8-48a0-a3a4-2f1208f7be61 | hoanganht1k27/Themis | Nopbai/hoanganht1k27/$History/20190610210958883_063695882882691[hoanganht1k27][TREETRIP].cpp | #include<bits/stdc++.h>
#define ii pair<long long,long long>
#define X first
#define Y second
using namespace std;
const long long N=200004;
long long n,A,B,vc=1000000000000000000,f[N][3];
vector<ii> a[N];
void dfs(long long x,long long p)
{
f[x][0]=f[x][1]=vc;
for(long long i=0;i<a[x].size();i++)
{
... | ALGO | 0.999837 | 4.005756 |
e1009f96-7af8-4a96-b66d-2b25d25c36e2 | isaacvp2/pokerproj | AutomatedPokerSimulator.cpp | #include <iostream>
#include <vector>
#include <algorithm>
#include <random>
#include <chrono>
#include <unordered_set>
#include <iomanip>
#include <sstream>
#include <map>
#include <unordered_map>
#include <fstream>
using namespace std;
// Enumerations for Suit and Rank
enum Suit { HEARTS, DIAMONDS, CLUBS, SPADES };... | ALGO | 0.998419 | 6.883904 |
7e7fa87f-98d8-4ae5-be0d-87e6d5ec6ded | capstone-engine/llvm-capstone | libcxx/test/std/algorithms/alg.nonmodifying/alg.find/ranges.find_if.pass.cpp | // <algorithm>
// UNSUPPORTED: c++03, c++11, c++14, c++17
// template<input_iterator I, sentinel_for<I> S, class Proj = identity,
// indirect_unary_predicate<projected<I, Proj>> Pred>
// constexpr I ranges::find_if(I first, S last, Pred pred, Proj proj = {});
// template<input_range R, class Proj = identit... | TEST | 0.985565 | 7.279917 |
e2680828-7f40-4c19-bf21-f580ef289127 | calgagi/competitive_programming | codeforces/1395/C.cpp | /*
* author: calgagi
* Calvin Gagliano
*/
#include <bits/stdc++.h>
using namespace std;
#define ld long double
#define ll long long
int n, m;
const int MAX_N = 200;
int a[MAX_N], b[MAX_N];
void solve() {
cin >> n >> m;
for (int i = 0; i < n; i++) {
cin >> a[i];
}
for (int j = 0; j... | ALGO | 0.999961 | 4.253358 |
3c088d86-c888-4cbc-a012-cc5514e5ecab | Jafrin-khan/Practice | Grouping values - GFG/grouping-values.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:
/*
TC = O(N)
SC = O(N)
*/
int isPossible(int n, int arr[], int K){
// code here
unordered_map<int,int> m... | ALGO | 0.999543 | 5.524576 |
00c8695e-9483-415a-877a-2aa168cc2048 | ishandutta2007/codeforces | 74traktor/normal/1270/A.cpp | #include<bits/stdc++.h>
using namespace std;
main() {
#ifdef HOME
//freopen("input.txt", "r", stdin);
#endif // HOME
ios_base::sync_with_stdio(0);
cin.tie(0);
cout.tie(0);
int t, n, k1, k2, x;
cin >> t;
for (int i = 1; i <= t; ++i) {
cin >> n >> k1 >> k2;
int x1 = 0, x2 = 0... | ALGO | 0.999854 | 3.616015 |
abb97b14-a3a0-4009-a0ff-9db3e1c14973 | santicr/Competitive-Programming | UVa/11777/11777.cpp | #include <iostream>
#include <vector>
#include <algorithm>
using namespace std;
int main(){
int cases, i;
float term1, term2, final, attendance, test1, test2, test3;
cin >> cases;
for(i = 0; i < cases; i++){
vector <float> vec;
scanf("%f %f %f %f %f %f %f", &term1, &term2, &final, &attendance,
&test1, ... | ALGO | 0.995268 | 3.400095 |
b4fe3b32-8d8b-4650-9109-fe9e83ea8c9a | liuawen/Play-Leetcode | Play-Leetcode-master/1359-Count-All-Valid-Pickup-and-Delivery-Options/cpp-1359/main.cpp | /// Source : https://leetcode.com/problems/count-all-valid-pickup-and-delivery-options/
/// Author : liuyubobobo
/// Time : 2020-02-23
#include <iostream>
#include <vector>
using namespace std;
/// Memory Search
/// Time Complexity: O(n * n)
/// Space Complxity: O(n * n)
class Solution {
private:
long long MO... | ALGO | 0.999975 | 5.775363 |
668c9e77-0d26-4d4d-bf34-73da94f12a2a | andongfan/oicode | 1197.cpp | #include<iostream>
using namespace std;
int n,x,y,z,root=0;
struct treetype{int data,prt,lch,rch;}tree[105];
void dfs(int v)
{
if(!v) return;
dfs(tree[v].lch);
dfs(tree[v].rch);
cout<<v<<endl;
}
int main(){
cin>>n;
for(int i=1;i<=n;i++)
{
int x;
cin>>x;
cin>>tree[x].lch>>tree[x].rch;
tree[tree[x].lch].pr... | ALGO | 0.999988 | 3.76749 |
12c5ad8c-934d-4974-893c-cab6a5809bcb | sina-ht/enfle | plugins/archiver/rar/unrar/rs.cpp | #include "rar.hpp"
#define Clean(D,S) {for (int I=0;I<(S);I++) (D)[I]=0;}
void RSCoder::Init(int ParSize)
{
RSCoder::ParSize=ParSize; // Store the number of recovery volumes.
FirstBlockDone=false;
gfInit();
pnInit();
}
// Initialize logarithms and exponents Galois field tables.
void RSCoder::gfInit()
{
fo... | ALGO | 0.998552 | 4.762784 |
28eb7108-a755-4128-bccc-a38aaef87351 | ishandutta2007/codeforces | wzyeustia/normal/1499/F.cpp | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef long double ld;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;
typedef tuple<ll, ll, ll> tll;
typedef vector<ll> vl;
typedef vector<vl> vvl;
#define FOR(i, a, b) for (ll (i) = (a); (i) <= (b); (i)++)
#define ROF(i, a, b) for (ll (i) =... | ALGO | 0.999943 | 4.462678 |
066245e6-f65e-4858-aff0-1d8c54cf97cb | jasonsong380/RISC-V-CPU-Simulator | 207461836-2/CPU.cpp | #include "CPU.h"
#include "inttypes.h"
#include "stdint.h"
instruction::instruction(bitset<32> fetch)
{
// cout << fetch << endl;
instr = fetch;
// cout << instr << endl;
}
CPU::CPU()
{
PC = 0; // set PC to 0
for (int i = 0; i < 4096; i++) // copy instrMEM
{
dmemory[i] = (0);
}
for (int i = 0; i < ... | ALGO | 0.922114 | 4.462315 |
a99c0815-47bc-4391-a98a-261679643711 | TeaqariaWTF/Qingyue | module/jni/libcxx/test/libcxx/algorithms/alg.modifying.operations/copy.pass.cpp | // UNSUPPORTED: c++03, c++11, c++14, c++17
// UNSUPPORTED: libcpp-has-no-incomplete-ranges
// When the debug mode is enabled, we don't unwrap iterators in std::copy
// so we don't get this optimization.
// UNSUPPORTED: libcpp-has-debug-mode
// <algorithm>
// This test checks that std::copy forwards to memmove when a... | TEST | 0.955533 | 7.677214 |
ff38769c-948d-4e8a-bae8-9fc8571d0619 | MasterToycode/HelloWorld | 动态规划/0——1背包问题.cpp | #include <iostream>
#include <vector>
#include <algorithm>
using namespace std;
struct Item
{
int price; // Ʒļֵ
int weight; // Ʒ
};
// ̬滮汾ķ⺯
int FractionalKnapsackDP(vector<Item>& items, int capacity) {
int n = items.size();
vector<vector<int>> dp(n + 1, vector<int>(capacity + 1, 0));
// ̬滮״̬ת
... | ALGO | 0.999823 | 5.228043 |
2c545a08-7f57-48ef-a328-f7ffeca8d5e3 | sbt4104/CodeChef_Contests | July_2022/BINHAPP.cpp | /*
CODE NOT COMPLETE
*/
#include<bits/stdc++.h>
using namespace std;
typedef long long int ll;
class MyStruct{
public:
ll before, after, score;
MyStruct(ll before, ll after, ll score){
this->before=before;
this->after=after;
this->score=score;
}
void print() {
cout<... | ALGO | 0.999501 | 3.603556 |
77d2989c-4681-4cdb-b853-9b08f7cefc4d | nilecoin/nilecoin | src/structs/uint256.cpp | #include "structs/uint256.h"
#include "utils/utilstrencodings.h"
#include <stdio.h>
#include <string.h>
template <unsigned int BITS>
base_uint<BITS>::base_uint(const std::string& str)
{
SetHex(str);
}
template <unsigned int BITS>
base_uint<BITS>::base_uint(const std::vector<unsigned char>& vch)
{
if (vch.si... | TOOL | 0.893049 | 6.549107 |
54ef3b44-b7f3-4d6e-a9f5-cc0f698d0f62 | KnightChan/LeetCode-cpp | Source/p138 Copy List with Random Pointer.cpp | #include "leetcode.h"
/**
A linked list is given such that each node contains an additional random pointer which could point to any node in the list or null.
Return a deep copy of the list.
*/
/**
* Definition for singly-linked list with a random pointer.
* struct RandomListNode {
* int label;
* RandomListN... | ALGO | 0.96962 | 4.653134 |
81b30d73-d951-46f7-baaa-595fefd360e9 | alexandraback/datacollection | solutions_5706278382862336_0/C++/Adhithya/one.cpp | #include <bits/stdc++.h>
using namespace std;
long long gcd(long long a,long long b)
{
if (b==0)
return a;
else
return gcd(b,a%b);
}
int main() {
// your code goes here
long long p,q;
int t,i,b=1;
string s,ps,qs;
scanf("%d",&t);
while(t--)
{
printf("Case #%d: ",b++);
cin >> s;
int si=s.size();
for(i=... | ALGO | 0.999499 | 3.886253 |
9346d6f3-7396-4981-aee2-cd409d3671c6 | abhishekarora9/Codeforces | 796B.cpp | #include <iostream>
using namespace std;
int main ()
{
long long int n ,m ,k;
cin>>n>>m>>k;
int a[1000000]={0};
for (long long int i = 0; i <= n; ++i)
{
a[i]=0;
}
long long int temp;
for (long long int i = 0; i < m; ++i)
{
cin>>temp;
a[temp]=1;
}
long long int temp1,temp2;
long long int finalpost=1... | ALGO | 0.999979 | 3.507637 |
03a5d333-9358-4347-8c22-da09de6f5b30 | MostafaOmar98/competitive-programming | UVA/UVA-10462-SecondMST.cpp | #include<bits/stdc++.h>
//#include <ext/pb_ds/assoc_container.hpp> // Common file
//#include <ext/pb_ds/tree_policy.hpp> // Including tree_order_statistics_node_update
using namespace std;
//using namespace __gnu_pbds;
//typedef tree<
// pair<int, int>, // change type
// null_type,
// less<pair<in... | ALGO | 0.99997 | 4.642225 |
56e727f5-763a-420d-a7fe-37bb95bada25 | kmjp/procon | 2012-2016/2014/bayan/warmup/d.cpp | #include <bits/stdc++.h>
using namespace std;
typedef signed long long ll;
#undef _P
#define _P(...) (void)printf(__VA_ARGS__)
#define FOR(x,to) for(x=0;x<to;x++)
#define ITR(x,c) for(__typeof(c.begin()) x=c.begin();x!=c.end();x++)
#define ZERO(a) memset(a,0,sizeof(a))
#define MINUS(a) memset(a,0xff,sizeof(a))
//-----... | ALGO | 0.999487 | 3.257909 |
9c3c32b3-0a6c-4dd8-8619-8f6b17f922fc | freakFlow/codetree-TILs | 241010/문자열 나누기/divide-string.cpp | #include <iostream>
#include <string>
using namespace std;
int main() {
int n;
string str, ans = "";
cin >> n;
for(int i=0; i<n; i++){
cin >> str;
ans += str;
}
for(int i=0; i<ans.length(); i++){
cout << ans[i];
if(i % 5 == 4) cout << endl;
}
return 0;... | ALGO | 0.999833 | 4.147218 |
78999df6-9203-4ab2-a75b-d01422f28a26 | OscarQuiRid/M9 | UF1_PAC3/main.cpp | #include <iostream>
#include <vector>
#include <unistd.h> // Para fork()
#include <sys/wait.h> // Para wait()
#include <cstdlib> // Para rand() y srand()
#include <ctime> // Para time()
using namespace std;
vector<string> nombres; // Variable global para nombres
int main() {
int N;
cout << "Introduce el... | ALGO | 0.997789 | 4.528247 |
b4ff272a-c501-4a0f-8991-5c2c4b9d8fae | TanmayAJadhav/Tree_Problems | 106_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.999963 | 6.239863 |
8625cf1d-f96c-47a9-8d0f-5e97d4babdb8 | kine1606/cpp | cpp/DSA/TaskDSA/BS.cpp | #include <iostream>
#include <vector>
class Point
{
public:
int m_x;
int index;
bool operator<(const Point& x)
{
if(m_x == x.m_x)
return index < x.index;
return m_x < x.m_x;
}
bool operator>(const Point& x)
{
if(m_x == x.m_x)
return index > x.... | ALGO | 0.999993 | 4.548764 |
be9f76c7-5d12-4ef2-88d4-c6aa99187477 | gaurlakshya/Leetcode_Submissions | Combination Sum III - GFG/combination-sum-iii.cpp | //{ Driver Code Starts
#include <bits/stdc++.h>
using namespace std;
// } Driver Code Ends
class Solution {
public:
void solve(int ind,vector<int>& res, vector<vector<int>>& ans,vector<int> nums,int sze,int sum){
if(ind>=nums.size()){
if(res.size()==sze && sum==0){
ans.push_ba... | ALGO | 0.999904 | 6.407209 |
9c2016df-4f54-46f5-9dd3-cb7bc4364437 | lunacd/cps-ci | src/cps/loader.cpp | #include "cps/loader.hpp"
#include "cps/error.hpp"
#include "cps/utils.hpp"
#include <fmt/core.h>
#include <json/json.h>
#include <tl/expected.hpp>
#include <iostream>
#include <optional>
namespace cps::loader {
namespace {
constexpr static std::string_view CPS_VERSION = "0.10.0";
template <t... | TOOL | 0.861082 | 7.70809 |
739ff036-4367-4751-b227-5025e4788079 | varunsharma10/cpp | CodeForces/711Div2A.cpp | #include <bits/stdc++.h>
using namespace std;
long long int gcd_sum(long long int num) {
long long int tmp = num, digitsum = 0;
while (tmp > 0) {
digitsum += tmp % 10;
tmp /= 10;
}
long long int gcd = __gcd(num, digitsum);
return gcd;
}
int main(void) {
int t;
cin >> t;
while (t-... | ALGO | 0.99982 | 4.392186 |
89f7bcb7-680a-4c48-a2fa-8902df5db11b | johnnyqian/algorithm | ClassicProblem/Josephus/Source.cpp | #include <iostream>
using namespace std;
typedef struct Node
{
int data;
struct Node* Next;
}SLNode;
SLNode* createCircularLinkedList(int n);
int recursive(int n, int m);
int deduction(int n, int m);
int main()
{
freopen("Input.txt", "r", stdin);
int n, k, m; // 1<=k<=n, m>=1
cin >> n >> k >> m;
... | ALGO | 0.999979 | 3.414494 |
c9cca4bc-8bb0-4e3b-a04f-f184ae9330cc | cryptoandcoffee/bto | src/checkpoints.cpp | #include <boost/assign/list_of.hpp> // for 'map_list_of()'
#include <boost/foreach.hpp>
#include "checkpoints.h"
#include "main.h"
#include "uint256.h"
namespace Checkpoints
{
typedef std::map<int, uint256> MapCheckpoints;
// How many times we expect transactions after the last checkpoint to
// be slowe... | TOOL | 0.863662 | 6.241257 |
9970a1ee-3964-4dc0-8f3f-ab6f85b1c8b7 | falconlive09/DSA-Programming | Dynamic Programming/MaxSumofNonAdjacent.cpp | #include <bits/stdc++.h>
using namespace std;
//Using Recursion
int f(int ind,vector<int> &nums)
{
if(ind==0) return nums[ind];
if(ind<0) return 0;
int pick=nums[ind]+f(ind-2,nums);
int notPick=0+f(ind-1,nums);
return max(pick, notPick);
}
int maximumNonAdjacentSum(vector<int> &nums){
// W... | ALGO | 0.99998 | 5.346717 |
4f78eee6-6d64-4ee2-beac-48a733636a4c | TheFusionEngine/FusionEngine | tools/editor/editor_help.cpp | /*************************************************************************/
/* editor_help.cpp */
/*************************************************************************/
/* This file is part of: */
/* ... | TOOL | 0.936392 | 4.156671 |
a49f0ae1-9ef9-4e47-97b5-5eb0ab28aea0 | ishandutta2007/codeforces | bench0310/normal/1726/C.cpp | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
int main()
{
ios::sync_with_stdio(0);
cin.tie(0);
int t;
cin >> t;
while(t--)
{
int n;
cin >> n;
n*=2;
string s;
cin >> s;
s="$"+s;
vector<int> p(n+1,0);
for(int ... | ALGO | 0.999229 | 3.693224 |
0305088b-81fd-4b52-bd50-98eada19ccae | notluigisr/scan_semgrep | funzioni_cpp/6527b19999826ba7e58ef7ee.cpp | DECLAREContigPutFunc(putcontig8bitYCbCr21tile)
{
(void) y;
fromskew = (fromskew * 4) / 2;
do {
x = w>>1;
do {
int32 Cb = pp[2];
int32 Cr = pp[3];
YCbCrtoRGB(cp[0], pp[0]);
YCbCrtoRGB(cp[1], pp[1]);
cp += 2;
pp += 4;
} while (--x);
if( (w&1) != 0 )
{
int32 Cb = pp[2];
int32 Cr = p... | ALGO | 0.944412 | 3.404246 |
82f04f9b-27c8-4f92-b4d0-c583af0eab62 | BornaliSaha/Codeforces-Problems | 1277A.cpp | #include<bits/stdc++.h>
using namespace std;
typedef long long ll;
int main()
{
ll t,n,Tm=0;
cin>>t;
while(t--)
{
Tm=0;
cin>>n;
for(int i=1;i<=9;i++)
{
ll res=0;
while(i)
... | ALGO | 0.999643 | 4.328148 |
10548d66-a160-4566-8dea-3befbdc465a1 | Toysoft/NNvision | darknet_nvenc/opencv_contrib-3.4.4/modules/saliency/samples/computeSaliency.cpp | #include <opencv2/core/utility.hpp>
#include <opencv2/saliency.hpp>
#include <opencv2/highgui.hpp>
#include <iostream>
using namespace std;
using namespace cv;
using namespace saliency;
static const char* keys =
{ "{@saliency_algorithm | | Saliency algorithm <saliencyAlgorithmType.[saliencyAlgorithmTypeSubType]> }"
... | ALGO | 0.982048 | 5.991583 |
1dde6a86-47f2-4919-9c25-6cc6cdb0cdc1 | proxmox/ceph | ceph/src/boost/libs/geometry/test/algorithms/distance/distance_se_geo_ar_ar.cpp | // Boost.Geometry (aka GGL, Generic Geometry Library)
// Unit Test
#ifndef BOOST_TEST_MODULE
#define BOOST_TEST_MODULE test_distance_geographic_areal_areal
#endif
#include <boost/test/included/unit_test.hpp>
#include "test_distance_geo_common.hpp"
#include "test_empty_geometry.hpp"
template <typename Point, typenam... | TEST | 0.986153 | 7.720117 |
f5cd6bca-e4a5-4188-a8bf-ee8c57197bba | jfemon8/XPSC | Week-11/Day-4/C_Torn_Lucky_Ticket.cpp | #include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
#define ll long long
using namespace __gnu_pbds;
using namespace std;
template <typename T>
using pbds = tree<T, null_type, less<T>, rb_tree_tag, tree_order_statistics_node_update>;
int32_t main()
{
ios_base::sy... | ALGO | 0.999744 | 4.514959 |
d2516e34-f820-4437-848c-c9996aff4d32 | trantrongnb/Lap_Trinh_CPP_PTIT | số may mắn-2.cpp | #include<iostream>
using namespace std;
#include<map>
#include<string>
#include<set>
#include<algorithm>
#include<vector>
#include<sstream>
#define ll long long
int MAX=1e9+7;
using namespace std;
set<int> se;
int tong(int n){
int sum=0;
while(n!=0){
sum+=n%10;
n/=10;
}
return sum;
}
voi... | ALGO | 0.999925 | 5.17394 |
74f2bb69-5abb-4ec1-b232-86fb2f686a0f | Vaibhavaggarwal431/intershalla_task_apps | 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.998799 | 6.776823 |
3f117194-d067-43ac-bfce-58ed351d67be | GVenkatachalapathi/CSA0656-DAA | 35.Graph coloring.cpp | #include <stdio.h>
#include <stdbool.h>
#define V 4
void printSolution(int color[]) {
printf("Solution Exists:\n");
printf("Vertex \tColor\n");
for (int i = 0; i < V; i++)
printf("%d \t%d\n", i, color[i]);
}
bool isSafe(int v, int graph[V][V], int color[], int c) {
for (int i = 0; i < V; i++... | ALGO | 0.999857 | 5.216263 |
e4bb59a2-a31d-4986-8d2b-515ae62e8f35 | anishaLATHWAL/Patterns_ques | pattern_9.cpp | /* Produce pattern of the type
1
2 3
4 5 6
7 8 9 10
*/
#include <iostream>
using namespace std;
int main()
{
int n, count=1;
cin >> n;
int rows =1;
while (rows <=n )
{
int cols=1;
while (cols <= rows )
{
cout << count << " ";
count= count+1;
cols =cols+1;
}
cout << endl;
rows= rows+1;
}
... | ALGO | 0.999599 | 4.224148 |
594b88a1-1765-423f-9b38-b0b1c9c28375 | KennyLuong02/workshop4 | main-4-1.cpp | #include <iostream>
using namespace std;
extern int *readNumbers();
extern int secondSmallestSum(int *numbers,int length) ;
int main() {
int* array;
int length = 10;
int sum = 0;
array = readNumbers();
sum = secondSmallestSum(array, length);
cout << sum << endl;
return 0;
} | ALGO | 0.997 | 4.109981 |
5681218f-0a7e-4661-b26e-bbfdf75c2a3b | rajulrs13/SPOJ | AGGRCOW_297.cpp | // Rajul Saxena
// <EMAIL>
#include <algorithm>
#include <iostream>
using namespace std;
int getMinDist(int cows, int stalls[], int n) {
int maxdist = stalls[n - 1] - stalls[0];
int mindist = 0;
int ans = maxdist;
while (maxdist >= mindist) {
int mid = (maxdist + mindist) / 2;
int temp = stalls[0] + mi... | ALGO | 0.999979 | 4.310145 |
08735610-4811-432f-a5c2-5c968aad71dc | TheAlphamerc/absence_manager_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.998733 | 6.76775 |
ee50689e-9873-4451-b453-a79224972b08 | eburimu/ccminer-x22i | pools.cpp | /**
* Functions which handle multiple pools data
*/
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
#include "miner.h"
#include "compat.h"
#include "algos.h"
// to move in miner.h
extern bool allow_gbt;
extern bool allow_mininginfo;
extern bool check_dups;
extern double opt_max_diff... | WEB | 0.956013 | 4.663948 |
1cb07216-6d39-4868-9a35-b58c34710a2e | cwza/cses | 1651-Range Update Queries.cpp | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef vector<int> vi;
typedef vector<vector<int>> vvi;
typedef pair<int, int> pi;
/*
Binary Index Tree with Difference Array Concept
*/
// int n, q;
// const int maxN = 2e5;
// // int x[maxN+1];
// ll tree[maxN+2];
// void add(int idx, int delta) {... | ALGO | 0.999744 | 4.965505 |
180664e0-24c3-45ca-b3de-84ba064fc83e | IlReSenzaNome/Course-cpp | Functions/Functions-2.cpp | #include <iostream>
#include <conio.h>
using namespace std;
template <class TIPOD>
void mostrarabs(TIPOD numero);
int main(){
int num1 = -4;
float num2 = -56.67;
double num3 = -123.5678;
mostrarabs(num1);
mostrarabs(num2);
mostrarabs(num3);
getch();
return 0;
}
template <class TIPO... | TOOL | 0.941443 | 3.418769 |
592459f7-43a0-4821-800d-c57da38f4fae | 113bommy/deepmind_codecontests_refine | cpp_gold_filter_file/cpp_train_7541_1.cpp | #include <bits/stdc++.h>
using namespace std;
template <typename T1, typename T2>
inline void mine(T1 &x, const T2 &y) {
if (y < x) x = y;
}
template <typename T1, typename T2>
inline void maxe(T1 &x, const T2 &y) {
if (x < y) x = y;
}
template <typename T>
ostream &operator<<(ostream &os, const vector<T> &b) {
f... | ALGO | 0.999897 | 4.828146 |
9467cc23-8db7-4f97-a0fd-ae4b8d6944f4 | raincross7/code-similarity | codes/train_code/problem091/problem091_76.cpp | #include <stdio.h>
#include <iostream>
#include <queue>
#include <vector>
#define MAXN 100000
#define INF ( 1LL << 60 )
#define WHITE 0
#define GRAY 1
#define BLACK 2
typedef long long ll;
using namespace std;
int color[MAXN];
ll d[MAXN];
ll bfs ( ll K )
{
deque<ll> Q;
ll now = 1;
for ( int i = 0; i < K; ++... | ALGO | 0.999858 | 3.382944 |
cd7e1da7-3f46-46ce-9c2d-4c2590c0cffb | Nick-Joseph/PlayDate | 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 |
08675eda-bd3e-465a-a976-2d80c9b9a3c3 | harsh0757/Data-Strutures | slidingWindow/L2_MAX_POINTS.cpp | #include <iostream>
using namespace std;
int maxPoint(vector<int>& arr, int k){
int lsum = 0, maxSum = 0, rsum = 0;
// if(k>arr.size()) return -1;
for(int i=0;i<k;i++) lsum = lsum + arr[i];
maxSum = lsum;
int rightIndex = arr.size() - 1;
for(int i=k-1;i>=0;i--){
lsum = lsum - arr[i];... | ALGO | 0.999716 | 4.839553 |
c76f51ba-dd13-47b5-8212-4dfa8a30dab9 | gagreen/Algorithm | jungol/jungol_2814.cpp | #include <stdio.h>
#include <string.h>
int binToDec(char a[], int len);
int main(){
char n[31];
int output;
scanf("%s", n);
output = binToDec(n, strlen(n));
printf("%d", output);
}
int binToDec(char a[], int len){
if(len == 0){
return 0;
}
return binToDec(a, len-1) * 2 + a[len-1] - '0';
}
| ALGO | 0.999062 | 3.782291 |
bbe84ee7-b432-43b6-b968-4573f33aadc7 | fepaf/Competitive-Programming | Resoluções OJ/Neps Academy/373.cpp | #include<bits/stdc++.h>
#define _ ios_base::sync_with_stdio(0); cin.tie(0);
#define endl '\n'
#define INF 0x3f3f3f3f
#define MAX (1<<20)
#define MOD 1000000007
#define i64 long long
#define all(x) (x).begin(),(x).end()
#define sz(x) (int)(x).size()
#define ii pair<int, int>
#define fs first
#define sc second
#define eb... | ALGO | 0.999974 | 3.519238 |
ed2e9cc7-44f1-49dd-a129-027d5430cb36 | Harshit0820/Data-Structures-and-Algorithms | Bubble Sort.cpp | #include<iostream>
using namespace std;
void swap(int *x, int *y){
int temp=*x;
*x=*y;
*y=temp;
}
void Bubble_Sort(int A[],int n){
int i,j;
for(i=0;i<n-1;i++){
for(j=0;j<n-1;j++){
if(A[j]>A[j+1]){
swap(&A[j],&A[j+1]);
}
}
}
}
int main(){
int A[]={3,7,9,10,6,5,12,4,11,2};
int n=10;
Bubble_Sort(... | ALGO | 0.99996 | 4.342317 |
680f105d-cfb8-4a9b-a744-5a25b82928d3 | cyb3rb34s7/Leetcode-prog | 792-number-of-matching-subsequences/792-number-of-matching-subsequences.cpp | class Solution {
public:
bool isSubseq(string &a , string &b){
int i = 0 , j = 0;
while(j<b.size() && i<a.size()){
if(a[i]==b[j])
{
i++;
j++;
}
else
i++ ;
}
return j==b.si... | ALGO | 0.999993 | 5.942532 |
b915fd99-c2ad-4761-9be4-98f3bbba452b | larc/gproshan | src/mdict/d_mesh.cpp | #include "d_mesh.h"
#ifndef CGAL_PATCH_DEFS
#define CGAL_PATCH_DEFS
#define CGAL_EIGEN3_ENABLED
#define CGAL_USE_BOOST_PROGRAM_OPTIONS
#define CGAL_USE_GMP
#define DCGAL_USE_MPFR
#endif
#include <CGAL/Simple_cartesian.h>
#include <CGAL/Monge_via_jet_fitting.h>
// geometry processing and shape analysis framework... | ALGO | 0.988599 | 4.116302 |
c2dea4b1-6e64-499b-8997-8b707e1bac8e | Sandip-1401/DSA-folder | Oct22string.cpp | #include <iostream>
#include <vector>
#include <string>
using namespace std;
// Reverse String in charter array.......
// void reverseString(vector<char> vec){
// int st=0;
// int end=vec.size()-1;
// while(st<end){
// swap(vec.at(st++),vec.at(end--));
// }
// for(char ch : vec){
// ... | ALGO | 0.97862 | 3.623567 |
4f916e31-e6f0-444a-a5e8-2c590c19063b | nicolasmnz/AlgoCo2024-2 | selection-sort.cpp | #include "selection-sort.hpp"
void selectionSort (vector<int>& array) {
int size = array.size();
for (int i = 0; i < size - 1; i++) {
int min_idx = i;
for (int j = i + 1; j < size; j++) {
if (array[j] < array[min_idx])
min_idx = j;
}
if (min... | ALGO | 0.999935 | 5.524967 |
bbd1e9f8-aa1e-4697-9398-128f175ef777 | Husainbw786/GeeksForGeeks | Sliding Window/Maximum Sub Array .cpp | class Solution{
public:
vector<int> findSubarray(int a[], int n) {
// code here
int i = 0;
int j = 0;
long long int sum = 0;
vector<int>v;
long long int max = 0;
int start = 0 ,end = 0;
while(j<n && j >= i)
{
if(a[j] >= 0)
{
sum = sum + a[j]... | ALGO | 0.999925 | 4.669727 |
a492a908-85fe-43c6-89c6-b2680867bed9 | DenisDesimon/LeetCode | 105_Construct_Binary_Tree_from_Preorder_and_Inorder_Traversal.cpp | //#105 Construct Binary Tree from Preorder and Inorder Traversal - https://leetcode.com/problems/construct-binary-tree-from-preorder-and-inorder-traversal/
#include <iostream>
#include <vector>
#include <cassert>
using namespace std;
//Definition for a binary tree node.
struct TreeNode {
int val;
TreeN... | ALGO | 0.999934 | 6.535874 |
5fcb45b7-20a1-4f64-935d-de71e9ad9ea2 | septentrio-gnss/Eridano | src/Septentrio_Arduino_driver.cpp | #include "Septentrio_Arduino_driver.h"
static const uint16_t CRC_SBF_LookUp[256] =
{
0x0000, 0x1021, 0x2042, 0x3063, 0x4084, 0x50a5, 0x60c6, 0x70e7,
0x8108, 0x9129, 0xa14a, 0xb16b, 0xc18c, 0xd1ad, 0xe1ce, 0xf1ef,
0x1231, 0x0210, 0x3273, 0x2252, 0x52b5, 0x4294, 0x72f7, 0x62d6,
0x9339, 0x8318, 0xb37b, 0xa35a, 0xd3bd, 0x... | TOOL | 0.853 | 4.220991 |
60c37b51-b4da-46bb-a30e-058d83c62ba2 | XIAOYAOYITAN/C_leraning | LeetCode/Leetcode刷题/896. 单调数列/69. x的平方根.cpp | //#include <iostream>
//#include <vector>
//#include <set>
//#include <algorithm>
//#include <stack>
//#include <map>
//using namespace std;
//
////ֱľDZ0xҵnn^2<xn+1^2>x,ŻĻʹöַ
////ַľʵϳ˺ܶⰡȣֵһmidlrеһһά
////⣬lrĸ´һ㣬Ȼ
////ٶַ
//class solution {
//public:
// int mysqrt(int x) {
// int l = 0;
// int r = x ;
// int ans = 0;
... | ALGO | 0.999804 | 4.077007 |
e0b0ded8-595a-4226-984c-3bcfacbf63be | ishandutta2007/codeforces | qwertypi/normal/727/A.cpp | #include <iostream>
#include <vector>
#include <algorithm>
using namespace std;
vector<int> ans;
int main(){
int a, b;
cin >> a >> b;
ans.push_back(b);
while(b != a && (b % 2 == 0 || b % 10 == 1) && b != 0){
if(b % 2 == 0){
b /= 2;
}else{
b /= 10;
}
ans.push_back(b);
}
if(a != b){
cout << "NO";
}... | ALGO | 0.99999 | 3.909948 |
4f0c1ffc-6cdc-4f2c-80bf-6f3e24d3ea08 | sunrize0714/AtCoder | ABC/301-400/ABC327/d.cpp | #include<bits/stdc++.h>
using namespace std;
using ll = long long int;
typedef vector<ll> vll;
typedef vector<vll> vvll;
typedef vector<vvll> vvvll;
typedef vector<bool> vb;
#define rep(i,a,n) for(ll i=a;i<n;i++)
#define revrep(i,a,n) for(ll i=n-1;i>=a;i--)
#define mod 998244353
ll modinv(ll a, ll m) {
ll b = m, u... | ALGO | 0.999999 | 4.296562 |
daee6331-e22a-4d4b-ac33-91757a63f56f | elfmz/far2l | multiarc/src/formats/rar/unrar/find.cpp | #include "rar.hpp"
FindFile::FindFile()
{
FirstCall=true;
#ifdef _WIN_ALL
hFind=INVALID_HANDLE_VALUE;
#else
dirp=NULL;
#endif
}
FindFile::~FindFile()
{
#ifdef _WIN_ALL
if (hFind!=INVALID_HANDLE_VALUE)
FindClose(hFind);
#else
if (dirp!=NULL)
closedir(dirp);
#endif
}
void FindFile::SetMask(const std:... | TOOL | 0.916285 | 4.606397 |
43d0b4fd-d342-41a1-9176-536e9c557cd7 | honey0632/GFG-2024-Daily | 08-18-2024.cpp | // Split an array into two equal Sum subarrays
// https://www.geeksforgeeks.org/problems/split-an-array-into-two-equal-sum-subarrays/1
#include<bits/stdc++.h>
using namespace std;
class Solution {
public:
bool canSplit(vector<int>& arr) {
// code here
int sum =0;
int total =0;
f... | ALGO | 0.999573 | 5.524688 |
908e19dd-cd2c-48bc-be70-5d5536c761df | zxr931120/leetcode | cpp/Q142.cpp | ListNode *detectCycle(ListNode *head) {
vector<ListNode *> nxtptr;
ListNode *holdhead = head;
int dangercount = 0;
while (head != nullptr) {
if (head->next == holdhead) {
return head->next;
}
if (head->next == nullptr) {
return head->next;
}
... | ALGO | 0.999183 | 4.423905 |
2c457875-c715-485e-8182-528b195021b4 | pkaiki/MAC0214 | Codeforces/Codeforces Round 912 (Div. 2)/a.cpp | #include <bits/stdc++.h>
#define int long long
using namespace std;
void solve(){
int n, k; cin >> n >> k;
vector<int> v(n);
for(int i=0; i<n; i++) cin >> v[i];
if(k == 1){
for(int i=1; i<n; i++){
if(v[i] < v[i-1]){
cout << "NO\n";
return;
... | ALGO | 0.999902 | 4.13191 |
4d9716da-6719-4e58-9e29-ee9d4d889bf1 | chapuni/llvm-project-legacy | libcxx/test/std/containers/sequences/vector/vector.modifiers/push_back.pass.cpp | // <vector>
// void push_back(const value_type& x);
#include <vector>
#include <cassert>
#include "../../../stack_allocator.h"
#include "min_allocator.h"
#include "asan_testing.h"
int main()
{
{
std::vector<int> c;
c.push_back(0);
assert(c.size() == 1);
assert(is_contiguous_contai... | TEST | 0.94217 | 5.400503 |
0cc09454-e52b-4540-aa84-200a4878b0ed | X-czh/Algorithms-LeetCode | 300-399/342-Power-of-Four.cpp | // Time complexity: O(logn).
// Space complexity: O(1).
class Solution {
public:
bool isPowerOfFour(int num) {
if (num == 1) return true;
if (num % 4 != 0) return false;
int one_fourth_num = num / 4; // avoid overflow
int power_of_four = 1;
while (power_of_four < on... | ALGO | 0.999411 | 6.342107 |
d53bc50b-f275-45e9-bd8d-967fa7fa70a4 | AYoungSn/Algorithm | BaekJoon/Study/0x04강/2493_Top.cpp | #include <iostream>
#include <stack>
using namespace std;
unsigned int arr[500001];
stack<pair<int,int>> ans;
int main(){
ios_base::sync_with_stdio();
cin.tie(NULL);cout.tie(NULL);
int N,i,rec;
cin>>N;
for(i=0;i<N;i++){
cin>> arr[i];
}
for(i=0;i<N;i++){
rec=0;
if(i<1)... | ALGO | 0.999992 | 3.879413 |
6ff2d88f-c03b-4ba6-9cb5-d67f939faac5 | HLRJ/Cpu0_For_LLVM17 | llvm-project-llvmorg-17.0.6/libc/src/math/aarch64/truncf.cpp | #include "src/math/truncf.h"
#include "src/__support/common.h"
namespace __llvm_libc {
LLVM_LIBC_FUNCTION(float, truncf, (float x)) {
float y;
__asm__ __volatile__("frintz %s0, %s1\n\t" : "=w"(y) : "w"(x));
return y;
}
} // namespace __llvm_libc
| ALGO | 0.985145 | 5.708622 |
8b983b8a-17dd-4bfa-9455-34f500dfd361 | justnotanu/leetcode | 1976-182-2466-count-ways-to-build-good-strings/1976-182-2466-count-ways-to-build-good-strings.cpp | #include <iostream>
#include <vector>
using namespace std;
class Solution {
public:
int countGoodStrings(int low, int high, int zero, int one) {
const int MOD = 1e9 + 7;
// Create a DP array to store counts of good strings
vector<long long> dp(high + 1, 0);
dp[0] = 1; // Ba... | ALGO | 0.999946 | 6.249722 |
9099da91-f2f7-4e25-b597-99ca9e5b3cd7 | iblea/iblea_leetcode | 0063-unique-paths-ii/0063-unique-paths-ii.cpp | class Solution {
public:
int uniquePathsWithObstacles(vector<vector<int>>& obstacleGrid) {
int m = obstacleGrid.size();
int n = obstacleGrid[0].size();
if (obstacleGrid[0][0] == 1) {
return 0;
}
if (n == 1 || m == 1) {
for (int i = 0; i < m; i++) {
... | ALGO | 0.999516 | 6.434607 |
301dfa46-22e5-4501-a754-c6f5660a9aa4 | michigan-traffic-lab/autoware | src/universe/autoware.universe/evaluator/kinematic_evaluator/src/metrics_calculator.cpp | #include "kinematic_evaluator/metrics_calculator.hpp"
#include "kinematic_evaluator/metrics/kinematic_metrics.hpp"
namespace kinematic_diagnostics
{
Stat<double> MetricsCalculator::updateStat(
const Metric metric, const Odometry & odom, const Stat<double> stat_prev) const
{
switch (metric) {
case Metric::velo... | TOOL | 0.953583 | 6.31652 |
870e9339-73ea-4298-90f3-f84577dae633 | ChaosExplorer/Machine-Net-Alg | Leetcode/binary_search.cpp | #include <cassert>
#include <vector>
#include <iostream>
using namespace std;
int bSearch(vector<int>&vec, int left, int right, int key) {
if (right <= left) {
if (key != vec[left]) return -1;
return left;
}
int mid = left + (right - left) / 2;
if (key == vec[mid])
// TODO
return mid;
if (key < vec... | ALGO | 0.999976 | 5.104349 |
343af739-13c6-42b2-8410-d748bcd543e8 | SimulIDE/SimulIDE_0.4.13-Final_Sources | src/simulator/circmatrix.cpp | #include <iostream>
#include <math.h>
//#include <iomanip>
#include "circmatrix.h"
#include "simulator.h"
CircMatrix* CircMatrix::m_pSelf = 0l;
CircMatrix::CircMatrix()
{
m_pSelf = this;
m_numEnodes = 0;
}
CircMatrix::~CircMatrix(){}
void CircMatrix::createMatrix( QList<eNode*> &eNodeList )
{
m_eNodeLi... | ALGO | 0.998402 | 3.25517 |
6cefbd04-04e3-4d64-89a0-2863026e3f7c | SouptikDatta/DSA-Assignment-by-Souptik | Q14.cpp | // C++ program to implement Queue using two stacks
#include <bits/stdc++.h>
using namespace std;
struct Queue {
stack<int> s1, s2;
// Enqueue an item to the queue
void enQueue(int x)
{
// Push item into the first stack
s1.push(x);
}
// Dequeue an item from the queue
int deQueue()
{
// if both stacks ... | ALGO | 0.999609 | 5.993506 |
be74cb29-ecdc-48c3-890e-df75723a46d0 | theydvgaurav/LeetCode | 231-power-of-two/power-of-two.cpp | class Solution {
public:
bool isPowerOfTwo(int n) {
if (n==1) return true;
if (n % 2 || n == 0) return false;
return isPowerOfTwo(n/2);
}
}; | ALGO | 0.997677 | 6.1251 |
980b98c2-ca0f-4489-bc97-0923d8fb1ae1 | bubble2k16/snes9x_3ds | source/jma/lzma.cpp | #include "lzma.h"
namespace NCompress {
namespace NLZMA {
UINT32 kDistStart[kDistTableSizeMax];
static class CConstInit
{
public:
CConstInit()
{
UINT32 aStartValue = 0;
int i;
for (i = 0; i < kDistTableSizeMax; i++)
{
kDistStart[i] = aStartValue;
aStartValue += (1 << kDistDirectBits[i... | CONFIG | 0.926424 | 5.82548 |
255940c2-6777-4df8-9444-36b0996331e2 | bdcbqa314159/leetCodeWork | 799-champagne-tower/799-champagne-tower.cpp | class Solution {
public:
double champagneTower(int poured, int query_row, int query_glass) {
double result[101][101] = {0};
result[0][0] = poured;
for(int i = 0; i<100; i++){
for(int j = 0; j<=i; j++){
if(result[i][j]>=1){
result[i+1][... | ALGO | 0.999646 | 5.573187 |
3abf6caf-1111-45c5-8109-c545128b80bb | shikharvermasv/problem_solving | homework/graphs3/detect-cycle-in-a-directed-graph.cpp | class Solution {
public:
// make a visited array and marks the node visited or not , then traverse it using dfs and if the node reaches the visited
// node the it is cyclic otherwise no
bool dfs(int i, vector<int>&vis,vector<int> adj[]){
vis[i] = 2;
for(auto it: adj[i]){
... | ALGO | 0.999902 | 5.765495 |
81e82bd0-6893-4900-83e1-9a469ae4ad45 | muhammad-sayem/AtCoder | B_Remove_It.cpp | #include<bits/stdc++.h>
#define endl '\n'
#define yes "YES"
#define no "NO"
#define ll long long
#define pb push_back
#define pii pair <int,int>
#define pll pair <long long,long long>
#define re... | ALGO | 0.999804 | 3.183186 |
a2cd9155-e9f2-467c-9ff2-f0b04ecf10b5 | jeanchilger/competitive-programming | uri-problems/Beginner/1049 - Animal.cpp | #include <iostream>
#include <stdio.h>
#include <string>
#include <map>
using namespace std;
int main() {
string word1, word2, word3, test;
int responseKey;
cin >> word1;
cin >> word2;
cin >> word3;
std::map<int, std::string> response = {
{21, "aguia"},
{23, "pomba"},
... | ALGO | 0.996604 | 3.758474 |
8822a557-4086-4583-8f97-6480b528bb42 | AIQIYI1/C- | f(n).cpp | #include<stdio.h>
#include<string.h>
int main(){
int f(int n);
int n;//ij
scanf("%d",&n);
printf("%d",f(n));
return 0;
}
int f(int n){
int flag=0;
int i=0,j=0;
int a[100];
char num[100][100];
//1~nָa
for(i=0;i<n;i++){
a[i]=i+1;
}
//ÿֽзֱֽ鵱
for(i=0;i<n;i++){
j=0;
while(a[i]>0){
num[i][j]... | ALGO | 0.999846 | 3.313951 |
8beff078-b402-465c-b9ed-43c1b61112e6 | flpolyproject/spatialcov | Fred-master/src/dynamic_time_warping.cpp | #include <vector>
#include <limits>
#include <boost/chrono/include.hpp>
#include "dynamic_time_warping.hpp"
namespace Dynamic_Time_Warping {
namespace Discrete {
std::string Distance::repr() const {
std::stringstream ss;
ss << value;
return ss.str();
}
Distance distance(const Curve &curve1, co... | ALGO | 0.999691 | 6.508261 |
ebfdb623-dca9-41f6-85e2-9f227db30e7a | aman3107/Revision_DSA_CPP | Basics_CPP/Operators_forLoop/right_angled_triangle.cpp | #include <iostream>
using namespace std;
int main(){
int a,b,c;
cout << "Enter length of largest side" << endl;
cin >> a;
cout << "Enter length of base" << endl;
cin >> b;
cout << "Enter length of height" << endl;
cin >> c;
if(a*a == (b*b)+(c*c)){
cout << "Right Triangle";
... | ALGO | 0.999372 | 3.857337 |
dc33b889-fd13-440b-8565-bf0cb48c630f | motokimura/SCTracker | eigen-eigen-6b38706d90a9/bench/quat_slerp.cpp | #include <iostream>
#include <Eigen/Geometry>
#include <bench/BenchTimer.h>
using namespace Eigen;
using namespace std;
template<typename Q>
EIGEN_DONT_INLINE Q nlerp(const Q& a, const Q& b, typename Q::Scalar t)
{
return Q((a.coeffs() * (1.0-t) + b.coeffs() * t).normalized());
}
template<typename Q>
EIGEN_DONT_INL... | ALGO | 0.991853 | 6.251058 |
8447c5a2-2dc1-45aa-b9a1-277ef383de37 | vsguji/base_btn | example/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.998848 | 6.76073 |
1a1e7c31-fab5-4560-81a0-5555a481e866 | axelgeoffredo/CPlusPLus-Projects | AS08/main.cpp | #include <iostream>
#include <stack>
#include <cmath>
#include <vector>
#include <iomanip>
#include <string>
using namespace std;
bool num(char c){
if (c >= '0' && c <= '9')
return true;
return false;
}
bool operation(char c){
if (c == '+' || c == '-' || c == '*' || c == '/')
return true;
ret... | ALGO | 0.997313 | 3.865186 |
2860cc94-b7ea-4e66-993c-faf95ed9ffbf | Daniel-Li-08/Hooman-Feeder | opencv-4.x/3rdparty/carotene/src/mul.cpp | #include "common.hpp"
#include "vtransform.hpp"
#include <cstring>
#include <cfloat>
#include <cmath>
#include <limits>
namespace CAROTENE_NS {
#ifdef CAROTENE_NEON
namespace {
bool isIntegerScale(f32 scale)
{
return std::fabs(scale - static_cast<s32>(scale)) < FLT_EPSILON;
}
template <s32 shift>
void mulu8(c... | TOOL | 0.945076 | 6.120524 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.