uuid
string
repo_name
string
relative_path
string
content
string
category
string
algo_rel_score
float64
quality_score
float64
0f0767d0-21f5-42e7-8523-2d521ad1e14d
ishandutta2007/codeforces
interestinglsy/normal/1149/C.cpp
#include <unordered_map> #include <unordered_set> #include <functional> #include <algorithm> #include <iostream> #include <complex> #include <cstdlib> #include <cstring> #include <cassert> #include <climits> #include <iomanip> #include <numeric> #include <bitset> #include <vector> #include <cstdio> #include <cmath> #in...
ALGO
0.999665
3.674238
724aa97d-f462-4ae9-b897-1734e5f7853f
HT13v/bmicounter
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
fd0d5b3e-5360-4db9-b3e1-59e689bb9f13
1-mukesh-1/subs
leetcode/practise/236. Lowest Common Ancestor of a Binary Tree.cpp
/** * Definition for a binary tree node. * struct TreeNode { * int val; * TreeNode *left; * TreeNode *right; * TreeNode(int x) : val(x), left(NULL), right(NULL) {} * }; */ class Solution { public: TreeNode* util(TreeNode* root,TreeNode* p,TreeNode* q){ if(root==nullptr){ ...
ALGO
0.999967
6.08733
ef3578a6-6f8d-48a9-9bbe-66e11617a00b
mk28r/Code-
SocialDistance.cpp
#include<bits/stdc++.h> using namespace std; #define int long long #define ld long double #define nline "\n" #define ff first #define ss second #define pb push_back #define int long long #define fl(i,k,n) ...
ALGO
0.999949
4.265741
219c9d8e-f387-4200-8829-4f085f35cc91
Shubhrajyoti-Dey-FrosTiK/My-Codes
HackerRank/NP Compete 2019/IsItAGraph/IsItAGraph.cpp
#include<bits/stdc++.h> using namespace std; long long int Combinations(long long int n) { long long int sum=0,i,LastVal=0; for(i=0;i<n;i++) {LastVal=sum; sum+=(i+1)*LastVal+2;} return sum; } int main() { long long int Starting,Ending,p1,p2,total=0; cin>>Starting>>Ending>>p1>>p2; total+=Comb...
ALGO
0.999747
3.499057
f796a6b8-b0bd-4ecd-962b-6db2643bcfcc
dassencio/cracking-the-coding-interview
chapter19/19.10/solve.cpp
/* * TASK: Given a method rand5() which generates random integers uniformly in * [1,5], create another method rand7() which generates random integers * uniformly in [1,7]. */ #include <algorithm> #include <cassert> #include <iostream> #include <random> /** * @brief Generates random integers uniformly...
ALGO
0.998946
6.493316
074bd98c-fa52-4de5-bc69-9a344953279d
wotsushi/competitive-programming
etc/gigacode_2019/e.cpp
#pragma region template 2.4 #include <bits/stdc++.h> using namespace std; template <typename T> using pq_asc = priority_queue<T, vector<T>, greater<T>>; typedef long long ll; typedef vector<ll> vi; typedef vector<vi> vvi; typedef pair<ll, ll> ii; typedef vector<ii> vii; typedef vector<string> vs; #define REP(i, n) for ...
ALGO
0.999963
4.538944
4fab9de0-2235-42f4-8214-e6445c76f240
csiefer2/TrilinosMirror2
packages/rol/example/PDE-OPT/thermal-fluids/example_03.cpp
/*! \file example_01.cpp \brief Shows how to solve the Navier-Stokes control problem. */ #include "Teuchos_Comm.hpp" #include "ROL_Stream.hpp" #include "Teuchos_GlobalMPISession.hpp" #include "Teuchos_XMLParameterListHelpers.hpp" #include "Tpetra_Core.hpp" #include "Tpetra_Version.hpp" #include <iostream> #incl...
ALGO
0.998042
4.533219
a0feeb67-8146-48e4-8c41-268c90d4d588
Sanketpatil27/DSA
Linked List/Doubly/DLL_delete_head.cpp
#include <bits/stdc++.h> using namespace std; struct Node { int data; Node *prev; Node *next; Node(int val) { data = val; prev = NULL; next = NULL; } }; void printList(Node *head) { while (head != NULL) { cout << head->data << " "; head = head->...
ALGO
0.999782
5.517822
ba62daa4-fa31-4da1-9bf9-cabf6aeda0df
jfedorov/gromacs
src/gromacs/correlationfunctions/polynomials.cpp
/*! \internal \file * \brief * Implements help function to compute Legendre polynomials * * \author David van der Spoel <<EMAIL>> * \author Anders Gärdenäs <<EMAIL>> * \ingroup module_correlationfunctions */ #include "gmxpre.h" #include "polynomials.h" #include "gromacs/utility/fatalerror.h" real LegendreP(re...
ALGO
0.999918
5.943697
c8da3ee6-9d6c-49d7-8bdb-9686d9485bfe
sidharthtripathi/pepcoding-reupload
binary Tree/print k levels far.cpp
#include <iostream> using namespace std; #include <vector> #include <stack> class Node{ public: int data = 0; Node* left = NULL; Node* right = NULL; Node(int data,Node* left = NULL,Node* right = NULL){ this->data = data; this->left = left; this->right = right; } }; Node* c...
ALGO
0.99998
3.858171
318a8520-f406-4bce-8bf7-34e43fd8a3e2
ishandutta2007/codeforces
ko_osaga/normal/755/E.cpp
#include <bits/stdc++.h> using namespace std; typedef long long lint; typedef long double llf; typedef pair<lint, lint> pi; int main(){ int n, k; cin >> n >> k; if(n <= 3 || k >= 4){ cout << -1; return 0; } if(k == 1){ cout << -1; return 0; } if(k == 2){ if(n == 4){ cout << -1; return 0; } p...
ALGO
0.999781
3.842614
c63f7d91-2925-4d31-a0b8-369134ebdfb0
YJ243/python_codingTest
codetree_dxdy/hugeBomb_풀이.cpp
/* * 2024.1.25 * 해설 풀이 * 시간복잡도: O(M*N^2) * 공간복잡도: O(N^2) */ #include <iostream> #define MAX_N 100 #define DIR_NUM 4 using namespace std; int n, m, r, c; // n: 격자 크기, m: 시간, (r,c) 초기 폭탄의 위치 int grid[MAX_N][MAX_N]; // 0: 빈칸, 1: 폭탄 칸 int next_grid[MAX_N][MAX_N]; // 임시로 옮길 배열 bool InRange(int x,...
ALGO
0.999968
4.972871
db86aab3-8e80-4255-9a5c-119ecc92bdd1
tungisdab/Code-C-Cpp
NamII/17_chia_du.cpp
#include<bits/stdc++.h> using namespace std; int main() { int t; cin>>t; while(t--) { int a,m,k=0; cin>>a>>m; for (int i=0;i<m;i++) { if ((i*a)%m==1) { cout<<i; break; } if (i==m-1) k=1; ...
ALGO
0.99994
3.630932
eed54298-828b-42bf-a33c-2f9e0c3c4b2d
KOROyo123/Caster_Project
third/eigen-3.4.0/doc/examples/nullary_indexing.cpp
#include <Eigen/Core> #include <iostream> using namespace Eigen; // [functor] template<class ArgType, class RowIndexType, class ColIndexType> class indexing_functor { const ArgType &m_arg; const RowIndexType &m_rowIndices; const ColIndexType &m_colIndices; public: typedef Matrix<typename ArgType::Scalar, ...
ALGO
0.969164
6.750382
73d4069b-571a-4b38-a17d-dacd2adc3852
sujal10022005/coding
Pointers/passbyReference.cpp
#include<iostream> using namespace std; void swap(int *x,int *y){ int temp=*x; *x=*y; *y=temp; return; } int main(){ int a=8,b=6; swap(&a,&b); cout<<a<<" "<<b; }
ALGO
0.99967
3.235479
6079a706-7beb-47cb-b4bd-1be00505abcb
liuq901/code
HD/hd_4747.cpp
#include <cstdio> #include <cstring> typedef long long ll; const int N=200010; struct tree { int l,r,ma,all; ll sum; }; tree a[524300]; bool flag[N]; int v[N],f[N],next[N],pos[N]; void updata(int x) { if (a[x].all==-1) return; a[x].ma=a[x].all; a[x].sum=ll(a[x].all)*(a[x].r-a[x].l+1); if...
ALGO
0.999927
3.779795
7f2dc1e4-06b1-4978-8b65-dc95c223c606
ashokabairwaideology/Leet-code-problem
solution/0400-0499/0497.Random Point in Non-overlapping Rectangles/Solution.cpp
class Solution { public: vector<int> s; vector<vector<int>> rects; Solution(vector<vector<int>>& rects) { int n = rects.size(); s.resize(n + 1); for (int i = 0; i < n; ++i) s[i + 1] = s[i] + (rects[i][2] - rects[i][0] + 1) * (rects[i][3] - rects[i][1] + 1); this->rects = rec...
ALGO
0.999817
6.558199
b2685c7a-efcc-4f8d-b22e-464c9a25075c
jesuswr/cp-codes-and-problems
B.young_explorers.cpp
#include <iostream> #include <vector> #include <queue> #include <stack> #include <algorithm> #include <math.h> #include <string> #include <cstring> #include <set> #include <map> #include <unordered_map> using namespace std; typedef long long ll; typedef pair<int,int> pii; typedef pair<int,pair<int,int>> piii; typedef...
ALGO
0.999811
4.505334
10eac2e2-1f82-45c1-80c9-e9dcd433e6e6
qq502233945/Ganymede
src/freestanding/libcxx/test/std/containers/sequences/vector/vector.cons/construct_iter_iter.pass.cpp
// <vector> // template <class InputIter> vector(InputIter first, InputIter last); #include <vector> #include <cassert> #include <cstddef> #include "test_macros.h" #include "test_iterators.h" #include "test_allocator.h" #include "min_allocator.h" #include "asan_testing.h" #if TEST_STD_VER >= 11 #include "emplace_con...
TEST
0.908229
7.322342
32d8d814-72d5-4be9-844a-766f32a77636
Qu-Detao/LeetCode
C++/findTheDuplicateNumber.cpp
/* Given an array nums containing n + 1 integers where each integer is between 1 and n (inclusive), prove that at least one duplicate number must exist. Assume that there is only one duplicate number, find the duplicate one. Note: 1.You must not modify the array (assume the array is read only). 2.You must use only c...
ALGO
0.999929
6.188724
2462bdfd-18ae-4b10-9d65-40362f04fb11
VuLeCoder/LeetCode
Problems/02559.cpp
class Solution { private: bool isVowel(char c) { return (c == 'a' || c == 'e' || c == 'i' || c == 'o' || c == 'u'); } public: vector<int> vowelStrings(vector<string>& words, vector<vector<int>>& queries) { vector<int> preFix(words.size(), 0); if(isVowel(words[0][0]) && isVow...
ALGO
0.999654
6.438788
1521c60e-112c-4032-9397-751379f683a9
zaaii/my_comic
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.998859
6.785645
11b48733-95f8-4454-9cdc-0aa4965d80f4
YKarpachev/cpp_programms
cpp_programms/src/product_3.cpp
#include <boost/multiprecision/cpp_dec_float.hpp> #include <cmath> #include <iomanip> #include <iostream> namespace mp = boost::multiprecision; int main() { mp::cpp_dec_float_50 pi = 4.0; for (int k = 1; k < 10000000; k++) { pi *= (pow(k, 2.0) + k) / (pow(k, 2) + k + 0.25); } std::cout << std::fixed <<...
ALGO
0.999701
4.372481
3b159345-84d0-4edd-a6e8-2e581e04223e
CppSy/leetcode
Cpp/evaluate-division.cpp
class Solution { public: double dfs(unordered_map<string, vector<pair<string, double>>> &mp, string st, string en, set<string> &s) { if (mp.find(st) == mp.end() || mp.find(en) == mp.end()) return -1.0; if (st == en) return 1.0; s.insert(st); for (auto &it : mp[st]) { i...
ALGO
0.99997
6.063141
af65cd1b-39a5-4fa1-b2be-b87c14187dc7
ranmoli/GaussCal
gausscal.cpp
#include "gausscal.h" GaussCal::GaussCal() { _isDirectCal=true; _ellipse=el54; _zonewide=six; // _x=0,_y=0,_latitude=0,_longitude=0; } bool GaussCal::isDirectCal() const { return _isDirectCal; } void GaussCal::setIsDirectCal(bool isDirectCal) { _isDirectCal = isDirectCal; } Ellipse GaussCal::ellipse() const {...
ALGO
0.997724
5.781729
6beb7d56-a8a6-4dbd-a60f-d9cf92470743
vansh-codes/Competitive-Coding-Approaches
Unit2-PrimalityTest/6_factorSum.cpp
#include<bits/stdc++.h> using namespace std; //? https://www.geeksforgeeks.org/problems/factors-sum2016/1 long long factorSum(int n) { long long sum=0; for(int i=1;i*i<=n;i++){ if(n%i==0){ sum += i; if(n/i != i){ sum += n/i; ...
ALGO
0.999931
5.117314
68c0d0bd-ab25-40a2-b9e3-e6de65547af1
Yawn-Sean/Daily_CF_Problems
daily_problems/2024/08/0831/personal_submission/cf1673f_Bonelight.cpp
#include <bits/stdc++.h> using namespace std; #define int long long // #define endl '\n' #define pii pair<int, int> void solve() { int n,q; cin >> n >> q; vector<int> b = {0}; for(int i = 0; i < 5; i ++){ for(int j = (1 << i) - 1; j >= 0; j --){ b.push_back(b[j] | (1 << 2 * i)); ...
ALGO
0.999516
3.958773
8af086e5-b857-45ee-9651-4e76b25aac74
zkoza/cpp-issp
advanced/cpp/z02/newton-function/newton_simple.cpp
#include <iostream> #include <format> int newton(int n, int k) { if (k < 0 || k > n) throw std::out_of_range(std::format("invalid function parameters: n = {}, k = {}", n, k)); if (k == 0 || k == n) return 1; return newton(n - 1, k) + newton(n - 1, k - 1); } int main() { std::cout << ne...
ALGO
0.997881
5.977664
44e3a038-32fc-46d6-98a0-85b5827ff413
hjhj97/ProblemSolving
BOJ/MST/1922-네트워크 연결.cpp
#include<stdio.h> #include<algorithm> #define V_SIZE 1010 #define E_SIZE 100100 using namespace std; struct Edge { int from,to, cost; const bool operator <(const Edge &o) const { return cost < o.cost; } Edge(){} Edge(int from,int to, int cost) :from(from),to(to), cost(cost) {}; }; Edge edge[E_SIZE]; int p[V_SI...
ALGO
0.99997
4.139463
8e5dd1d4-dc05-483f-b463-4b0596c393a2
phumipatc/C_Competitive_Programming
C++ - 2560/2_2_Camp/Test_2/NC_Invitation_Coded.cpp
/* Task : Author : Phumipat C. School : RYW Language: C++ */ #include<bits/stdc++.h> using namespace std; int mic[1010][1010]; char str[1010],inv[1010]; int main(){ int n,m,q=10,k,i,j,len; while(q--){ scanf(" %s",str+1); len=strlen(str+1); for(i=1;i<=len;i++) ...
ALGO
0.99994
3.731379
3e0b901c-082b-4861-bed8-f987b2b0ed41
akmehto1/DSA
Sliing and two pointer/meeso.cpp
// Online C++ compiler to run C++ program online #include <iostream> #include<bits/stdc++.h> using namespace std; int main() { int arr[]={0,0,8,8,8,0,0,5}; unordered_map<int,int>umap; int k=1; umap[0]=1; int ans=0; int count=0; for(int i=0;i<8;i++){ if(arr[i]==5)count++; ...
ALGO
0.999765
3.745514
ae2c612f-0c95-48a0-94e4-12620f1c1a14
ericgjackson/slumbot2019
src/test_agent2.cpp
#include <stdio.h> #include <stdlib.h> #include <memory> #include <string> #include <vector> #include "agent.h" #include "betting_abstraction.h" #include "betting_abstraction_params.h" #include "betting_trees.h" #include "board_tree.h" #include "buckets.h" #include "card_abstraction.h" #include "card_abstraction_para...
TOOL
0.867986
5.324472
73388a92-a517-4fda-bf36-93d6eab2594b
ayyappareddynandipati/LEETCODE
1306-minimum-absolute-difference/1306-minimum-absolute-difference.cpp
const auto __ = []() { struct ___ { static void _() { std::ofstream("display_runtime.txt") << 0 << '\n'; } }; std::atexit(___::_); return 0; }(); class Solution { public: vector<vector<int>> minimumAbsDifference(vector<int>& arr) { sort(arr.begin(),arr.end()); ...
ALGO
0.999983
5.868698
22d7611d-c944-4d73-ba56-196a4446d7a0
AkashSingh3031/Striver-SDE-Sheet-Challenge
20]. Day-20 (Binary Search Tree)/CodeStudio/3]. Construct BST from given keys.cpp
/************************************************************ Following is the TreeNode class structure template <typename T> class TreeNode { public: T val; TreeNode<T> *left; TreeNode<T> *right; TreeNode(T val) { this->val = val; le...
ALGO
0.999986
6.891308
3507ab5f-1c87-4e48-a6e5-90cc45917de5
condratmihai/Universitate
_(g)old/Algoritmica Grafurilor/DFS/Deep_Fried/main.cpp
#include <iostream> #include <fstream> using namespace std; ifstream fin("date.in"); int n, m; int adj[20][20]; int vizitat[20]; int tata[20]; int dist[20]; void DFS(int i, int t) { vizitat[i] = 1; tata[i] = t; dist[i] = dist[t] + 1; cout<<i<<" "<<dist[i]<<endl; for(int j = 1; j <= n; j++) ...
ALGO
0.999691
3.770524
0fa0f1be-e3a3-47c0-9763-13d781bf1845
3lmesias/UE4Course
Engine/Source/ThirdParty/PhysX3/APEX_1.4/module/clothing/embedded/LowLevelCloth/src/TripletScheduler.cpp
#include "TripletScheduler.h" #include "PxMath.h" #include "PsFPU.h" #include "PxMat33.h" #include "PsVecMath.h" #include "PsUtilities.h" using namespace nvidia; using namespace physx::shdfnd::aos; cloth::TripletScheduler::TripletScheduler(Range<const uint32_t[4]> triplets) : mTriplets(reinterpret_cast<const Vec4u*>(...
TOOL
0.976019
5.620721
22634ae9-d541-45da-82a8-ee4de692e723
Justin-roy/DSA-COMPLETE-SERIES
Array/Transposition In Iinear search.cpp
#include <iostream> #include <bits/stdc++.h> using namespace std; void Swap(int *a,int *b){ int temp = *a; *a = *b; *b = temp; } int Transposition_Search(int A[],int n,int k) { for(int i=0;i<n;i++) { if(A[i]==k) Swap(&A[i],&A[i-1]); return i; } return -1; } void Displa...
ALGO
0.999848
4.638529
cbf1759a-a6f1-4a1d-acf6-037ef42c172e
caetanovns/judge-problems
bee_2444.cpp
#include <iostream> #include <bits/stdc++.h> using namespace std; int v, t; void solve() { int volume; for (int i = 0; i < t; i++) { cin >> volume; v += volume; if (v > 100) v = 100; if (v < 0) v = 0; } cout << v << "\n"; } int ma...
ALGO
0.998616
4.461033
0580d29a-d925-4702-8561-1dd5d6aae7b6
smartinsider/cgencore
src/crypto/rfc6979_hmac_sha256.cpp
#include "crypto/rfc6979_hmac_sha256.h" #include <string.h> #include <algorithm> static const unsigned char zero[1] = {0x00}; static const unsigned char one[1] = {0x01}; RFC6979_HMAC_SHA256::RFC6979_HMAC_SHA256(const unsigned char* key, size_t keylen, const unsigned char* msg, size_t msglen) : retry(false) { me...
ALGO
0.940382
6.563017
0d530049-2ca0-4452-93f6-43bfe164f53a
Chenjh-dev/C-exercises
C++练习题/进位与借位(虚函数和多态).cpp
/* λλ麯Ͷ̬ Ŀ ijСѧ꼶ѧʦڽѧӼʱ֣ϵͬѧԷֳ࣬ һȷɼӼ(GroupA)ڶȷɼӷ㣬 ڼ˵ǽλĴ(GroupB)ǼӷĽλ ҲǼĽλ(GroupC)ʾСѧ꼶ûѧ ģ⵱ʦڿijλͬѧʱͬѧĻش ʵʱĻܣ class Group { public: virtual int add(int x, int y)=0;//ӷ virtual int sub(int x, int y)=0;// } GroupA, GroupBGroupCɳ: дҪһGroupָ룬ָͨͳһؽaddsub㡣 һбʾԴӵڶпʼÿռһУÿ£ѧ1Ϊһѧ2Ϊڶѧ3Ϊѧһڶ Ľ 3 1 79+81 2 81-79 3 183+69 160 12 142...
ALGO
0.999011
4.019263
bd8c8a57-176e-46da-bea5-8c526b4be0ad
Fernando-Mauro/zig-zag-code
SPOJ/EZDIJKST.cpp
#include <bits/stdc++.h> #define MAXN 100001 using namespace std; struct nodo{ int x, w; friend bool operator<(nodo a, nodo b) { return a.w < b.w; } }; int T; vector<int> dijkstra(int origen, vector<vector<nodo>> &adj, int c){ vector<int> distancia(c, INT32_MAX); distancia[origen] = 0; pr...
ALGO
0.999958
4.261075
d264599c-19c7-4b55-9cb8-3aa4f418a89d
huggin/gfg
dp/number_coins.cpp
//{ Driver Code Starts #include <bits/stdc++.h> using namespace std; // } Driver Code Ends class Solution { public: int minCoins(int coins[], int M, int V) { // Your code goes here vector<int> dp(V + 1); for (int i = 1; i <= V; ++i) { dp[i] = 1000000; for (int j = 0; j < M; ++j) { if ...
ALGO
0.999983
5.624007
0e0c799d-2137-4010-ba23-5549c980fffd
sumanta-basu/quantum
quantum/lib/python3.11/site-packages/dwave/optimization/src/utils.cpp
#include "dwave-optimization/utils.hpp" #include "dwave-optimization/array.hpp" namespace dwave::optimization { void deduplicate_diff(std::vector<Update>& diff) { if (diff.empty()) return; std::stable_sort(diff.begin(), diff.end()); // Find the index of first non-noop Update. If there are none, leave i...
ALGO
0.998748
7.313399
e52135d8-1e9a-441a-b33d-d2d83290e090
ChaudhariBhavesh/OOT
Expt_13.cpp
#include<iostream> using namespace std; class worker { private: int wg,wd; public: worker(int w,int d) { wg=w; wd=d; } void showData() { cout<<"\nWages is "<<wg<<endl<<"Wdays is "<<wd<<endl; } friend void payment(worker); }; void payment(worker z) { int p=z.wg*z.wd; cout<<"Payment is "<<p<<...
ALGO
0.993159
3.965856
216d3508-7e03-42af-9835-3095aa449d75
emmarice/neutron-mc
src/ke.cpp
#include "../include/ke.h" #include <fstream> #include <cmath> #include <cassert> #include <iostream> #include <iomanip> #include <fstream> #include <utility> #include <sstream> // puts the class in its basic state materialManager::materialManager() { } void materialManager::addCX(std::string a_matName,std::string a_C...
TOOL
0.909223
3.60333
d88be36f-2d92-4633-8f3c-c974be2a788c
Ufrooq/DSA
Stacks/withClasses/AllOperations/firstGreater.cpp
#include <iostream> using namespace std; void firstGreater(int *array, int size) { for (int i = 0; i < size; i++) { for (int j = i + 1; j < size; j++) { if (array[i] < array[j]) { cout << array[i] << " --> " << array[j] << endl; break; ...
ALGO
0.999867
3.651603
33eb8f00-f497-4d78-a3f4-3161580fe547
antenna-one/DReaM
tags/dream-1.18/src/mlc/EnergyDispersal.cpp
#include "EnergyDispersal.h" /* Implementation *************************************************************/ void CEngergyDispersal::ProcessData(CVector<_BINARY>* pbiData) { int i; uint32_t iTempShiftRegister; _BINARY biPRBSbit; /* Init shift register and set all registers to "1" with bit-wise ...
ALGO
0.999639
4.728096
c21dbdec-0b93-43be-8b4f-82c93103d06e
ishandutta2007/codeforces
fsouza/normal/655/B.cpp
#include <algorithm> #include <cassert> #include <climits> #include <cmath> #include <complex> #include <cstdio> #include <cstdlib> #include <cstring> #include <functional> #include <iostream> #include <map> #include <numeric> #include <queue> #include <set> #include <unordered_map> #include <vector> using namespace s...
ALGO
0.999754
3.591171
7ba6c96b-e89c-454c-b89f-80376deee73b
hezhaojiang/leetcode-cpp
368.最大整除子集.cpp
/* * @lc app=leetcode.cn id=368 lang=cpp * * [368] 最大整除子集 */ #include<vector> #include<algorithm> #include<unordered_map> using namespace std; // @lc code=start class Solution { public: vector<int> largestDivisibleSubset(vector<int>& nums) { int N = nums.size(); if (N == 0) return {}; in...
ALGO
0.999836
5.593934
7e9a5c63-34de-4e48-b1bd-48f3ab949a6f
deandrehaijiel/whatsnews
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.998859
6.785645
89a5b2b0-0d15-4ff7-83c8-121989f99756
douglasalves0/cp-notebook
stress-tests/data-structures/LazySegmentTree.cpp
#include "../utilities/template.h" #include "../../content/data-structures/LazySegmentTree.h" static unsigned R; int ra() { R *= 791231; R += 1231; return (int)(R >> 1); } volatile int res; int main() { int N = 10; vi v(N); iota(all(v), 0); random_shuffle(all(v), [](int x) { return ra() % x; }); Node* tr = n...
TEST
0.926929
4.598292
ffc0294f-b5ca-40d8-b6c8-7eccb18409a3
shaofeifei11/SSDR-AL
SSRD_AL_semantic3d/chamfer3D/chamfer_cuda.cpp
#include <torch/torch.h> #include <vector> ///ssdr //#include "common.h" /// NOT ssdr int chamfer_cuda_forward(at::Tensor xyz1, at::Tensor xyz2, at::Tensor dist1, at::Tensor dist2, at::Tensor idx1, at::Tensor idx2); int chamfer_cuda_backward(at::Tensor xyz1, at::Tensor xyz2, at::Tensor gradxyz1, at::Tensor gradxyz2,...
DATA
0.874846
5.818669
376ca81c-ebc1-4cd7-9aa5-deed48268c4f
st9540808/UVa
hw1/10009.cpp
#include <iostream> #include <string> #include <unordered_set> #include <unordered_map> #include <queue> #include <utility> struct Map { std::unordered_map<char, std::unordered_set<char>> cities; void add(char c1, char c2) { auto connect1 = cities.find(c1); auto connect2 = cities.find(c2);...
ALGO
0.999973
5.159643
91d84f7d-2d32-4e4a-8599-7e5e98327c31
ERACL/Arduino-EVShield-Matrix
EVShield-master/Robot_Matrix.cpp
#include "Robot_Matrix.h" #include <math.h> #define PI 3.141592 Robot_Matrix::Robot_Matrix(uint8_t i2c_address) : EVs_Matrix(i2c_address) { } void Robot_Matrix::config( SH_Matrix_Motor motor_left_, SH_Matrix_Motor motor_right_, bool is_motor_left_inverted_, bool is_motor_right_inverted_, long inc_per_met...
TOOL
0.887855
5.281698
934a2223-4a70-4b53-b6c1-1150fc1e7e71
SkynetRTN/radio-cartographer
Processor.cpp
#include "Processor.h" #include "OutputFile.h" #include "Debugger.h" #include "Scan.h" #include "Tools.h" #include "RCR.h" #include <math.h> #include <fstream> #include <algorithm> #include <iostream> #include "Map.h" #include "BackgroundCUDA.h" #include "ProcessorRFI.h" #include "ProcessorThetaGap.h" #include "Process...
ALGO
0.882446
3.251912
400f8624-14df-4100-8037-6eef9b862738
eanswer/LearningToFly
SimulationUI/externals/opengl_viewer/externals/eigen/test/determinant.cpp
#include "main.h" #include <Eigen/LU> template<typename MatrixType> void determinant(const MatrixType& m) { /* this test covers the following files: Determinant.h */ typedef typename MatrixType::Index Index; Index size = m.rows(); MatrixType m1(size, size), m2(size, size); m1.setRandom(); m2.setRan...
TEST
0.899259
7.032337
d0d5da27-aaa0-4a35-a321-ff680f915a1a
shubhgkr/Codechef
Beginner/GOODSET.cpp
/* * @author Shubham Kumar Gupta (shubhgkr) * github: http://www.github.com/shubhgkr * Created on 4/5/20. * Problem link: https://www.codechef.com/problems/GOODSET */ #include <iostream> int main() { std::ios_base::sync_with_stdio(false); std::cin.tie(nullptr); int t; std::cin >> t; while (t--) { int n; ...
ALGO
0.999721
4.628453
0687b938-35f1-420d-a357-974ed39b8355
Aditya-A-Pardeshi/Coding-Hands-On
2 CPP_Programs/8 Problems on string/32_FindLengthOfLargestWord/Main.cpp
/* Write a program which accept string from user and return length of largest word. Input : "I am Hemalata Choudhary" Output : 9 */ #include<iostream> #include<stdio.h> using namespace std; int LargestWordLength(char arr[]) { int iWordCnt = 0; int iWordLen = 0; int iMax = 0; int i = 0; int len = 0; //find len...
ALGO
0.999461
4.027524
d103593c-1aaa-4d9e-96cf-029d0e407bbd
jsm8109jsm/CodingTest
방과후/1일차/18번.cpp
#include <iostream> using namespace std; int main() { int n, m, count=0, maxCount=-1; cin>>n>>m; for(int i=0; i<n; i++){ int a; cin>>a; if(a>m){ count++; if(maxCount < count){ maxCount = count; } } else{ count=0; } } cout<<maxCount; return 0; }
ALGO
0.999935
3.799757
a6a38115-4137-4b0e-8b86-611e7aa13879
ishandutta2007/codeforces
he_ren/normal/1622/F.cpp
#include<bits/stdc++.h> using namespace std; typedef long long ll; typedef pair<int,int> pii; const int MAXN = 1e6 + 5; inline ll rnd(void){ return ((ll)rand()<<45) | ((ll)rand()<<30) | (rand()<<15) | rand();} bool isnp[MAXN]; int pri[MAXN], pcnt = 0; ll val[MAXN]; void sieve(int n) { isnp[0] = isnp[1] = 1; for(int...
ALGO
0.999932
3.622813
2b9a89b0-2056-421c-82c3-7223820f6882
geoffrey-anto/leetcode-solutions
1680-count-all-possible-routes/solution.cpp
class Solution { public: int MOD = 1e9 + 7; vector<vector<int>> dp; int f(int i, int fuel, int end, vector<int>& locations, int n) { if(fuel < 0) { return 0; } if(dp[i][fuel] != -1) return dp[i][fuel]; long long ans = 0; for(int idx=0; idx<n; idx++) { ...
ALGO
0.99997
5.697721
e16e4e27-c3e1-4416-9224-c517bbcbad33
JaazielBennet/UI_20220248
next-gen-ui/step_05_b/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.997003
6.76073
30ec651a-4997-4327-bf9d-c6dd19ee6ff0
Bapan1906/All-_-CPP
Array/Rotetion.cpp
#include <iostream> #include<vector> using namespace std; void rotation(int arr[], int n, int k) { vector<int> v; for (int i = k; i < n; i++) { v.push_back(arr[i]); } for (int i = 0; i < k; i++) { v.push_back(arr[i]); } for (int i = 0; i < n; i++) { arr[i] =...
ALGO
0.999888
5.096663
145800c7-3637-4096-bfbe-92f6ab4cece1
sahilmadaan048/crispy-chainsaw-ladders
1400 to 1499 rating/problem 99(C. Vasya and Basketball)/B. Vasya and Wrestling/main.cpp
// http://codeforces.com/contest/493/problem/B #include "bits/stdc++.h" #define int long long #define uint unsigned long long #define vi vector<int> #define vvi vector<vi > #define vb vector<bool> #define vvb vector<vb > #define fr(i,n) for(int i=0; i<(n); i++) #define rep(i,a,n) for(int i=(a); i<=(n); i++) #define nl...
ALGO
0.999994
4.466838
4b898a91-0ff1-4054-86b7-f22ac4689db3
miiitomi/atcoder
mayocon/20240619/2.cpp
// https://atcoder.jp/contests/abc278/tasks/abc278_c #include <bits/stdc++.h> using namespace std; void solve() { int N, Q; cin >> N >> Q; vector<int> T(Q), A(Q), B(Q), v; for (int i = 0; i < Q; i++) { cin >> T[i] >> A[i] >> B[i]; A[i]--; B[i]--; v.push_back(A[i]); ...
ALGO
0.999942
4.809607
4ab5bf67-4aa5-4cc5-8c93-2b5535e6ee50
mohitshyoran/Leetcode-Problems
Top-150/16. Binary Search/35. Search Insert Position.cpp
Given a sorted array of distinct integers and a target value, return the index if the target is found. If not, return the index where it would be if it were inserted in order. You must write an algorithm with O(log n) runtime complexity. class Solution { public: int searchInsert(vector<int>& nums, int target) { ...
ALGO
0.999994
6.361346
e7715ff0-6bf0-4564-b22f-ac6dd67621d8
hiencoi999/mobile
lesson15/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.998293
6.797273
dc14dd0f-f689-4efc-9f81-c0b50af42d17
kuldeepvarma7413/DSA
Recursion/no_of_BST_can_be_formed_using_n_nodes.cpp
#include<bits/stdc++.h> using namespace std; int dp[10001]; int noOfBST(int n){ if(n==1 || n==0){return 1;} if(dp[n]!=-1){return dp[n];} int ans=0; for(int i=1; i<=n; i++){ ans+=noOfBST(i-1)*noOfBST(n-i); } return dp[n]=ans; } int main(){ memset(dp, -1, sizeof(dp)); cout<<noOfBST...
ALGO
0.999982
5.378471
07a35648-0a3e-415f-9fb9-ed3e72b71cd8
iRath96/variance-aware-path-guiding
visualizer/nanogui/ext/eigen/doc/examples/Tutorial_ReductionsVisitorsBroadcasting_reductions_bool.cpp
#include <Eigen/Dense> #include <iostream> using namespace std; using namespace Eigen; int main() { ArrayXXf a(2,2); a << 1,2, 3,4; cout << "(a > 0).all() = " << (a > 0).all() << endl; cout << "(a > 0).any() = " << (a > 0).any() << endl; cout << "(a > 0).count() = " << (a > 0).count() << endl...
ALGO
0.961612
3.835741
61b07dbe-c80e-41c5-af4d-b40b906677cb
VmtpCin/Photon_mapping
src/surface.cpp
#include "surface.h" Point3 bezier_curve(const std::vector<Point3> &points, double t) { std::vector<Point3> control; control.assign(points.begin(), points.end()); while (control.size() > 1) { for (int i = 0; i < control.size() - 1; i++) control[i] = interpolate(control[i], control[i +...
ALGO
0.981526
4.013703
80fae4bf-7729-40e5-9c77-23e7b0eecc02
blockspacer/bootstrap-redux
ext/boost-1.70.0/libs/graph/example/canonical_ordering.cpp
#include <boost/graph/planar_canonical_ordering.hpp> #include <boost/graph/boyer_myrvold_planar_test.hpp> using namespace boost; int main(int argc, char** argv) { typedef adjacency_list < vecS, vecS, undirectedS, property<vertex_index_t, int>, property<edge_index_t, int> > grap...
ALGO
0.997092
7.278062
5e7b34cf-2334-488b-a28c-4ec64457d0b1
swyoo1121/C-CPP
baekjoon/4134.cpp
#include <iostream> #include <cmath> using namespace std; int n; unsigned int input; int solve (unsigned int target) { unsigned int root = (int)sqrt(target); if (target <= 1) return 1; // 1 입력시 주의 for (int iter = 2; iter < root + 1; iter++) { if (target % iter == 0) return 1; } return ...
ALGO
0.999964
4.09121
99229c85-c78e-4a42-a932-dfebe17388c9
vikas-reddy/programming-practice
array/array-triplet-with-a-given-sum.cpp
#include<iostream> #include<stdlib.h> using namespace std; int computeSum(int temp[]) { return (temp[0] + temp[1] + temp[2]); } int print(int temp[]) { cout << "triplet: " << temp[0] << " " << temp[1] << " " << temp[2] << endl; } void triplets(int arr[], int first, int len, int sum, int temp[], int tempLen) { ...
ALGO
0.99962
4.226509
98c37a34-7be5-440b-bfef-6867be863bce
kienpro307/kien307
T1_BT9.cpp
#include <iostream> #include <cmath> #include <iomanip> using namespace std; int main() { double a, b, c, p, dienTichTamGiac; cin >> a >> b >> c; p = (a + b + c) / 2; if((a+b) > c && (a+c) > b && (b+c) > a) { dienTichTamGiac = sqrt(p * (p - a) * (p - b) * (p - c)); cout << fixed <<...
ALGO
0.999524
4.212644
3d248e78-47ed-4436-9c7d-1d8529f9360b
shindechandrakant/data-structure-Algo
DP/longest-increasing-sub-seq.cpp
#include<iostream> #include<math.h> #include<bits/stdc++.h> using namespace std; #define ll long long int #define MOD 1000000007 #define vi vector<ll> #define pi pair<ll, ll> #define vb vector<bool> #define vs vector<string> #define newline(n) for(int i = 0; i < (n); i++ )cout<<endl; #define infor(vect) for(auto it : (...
ALGO
0.999997
4.226602
ac1a9b79-bae3-4930-b8b8-cc208dcd4c25
sleeping1943/xzm-gb28181
3rd/boost_1_83_0/libs/metaparse/example/constexpr_parser/main.cpp
#include <boost/metaparse/sequence.hpp> #include <boost/metaparse/lit_c.hpp> #include <boost/metaparse/foldl.hpp> #include <boost/metaparse/entire_input.hpp> #include <boost/metaparse/string.hpp> #include <boost/metaparse/build_parser.hpp> #include <boost/metaparse/get_result.hpp> #include <boost/metaparse/start.hpp> #...
TOOL
0.885886
6.695506
1db2cffc-d596-400d-a727-8751817b2ddd
Amr-Elmaghraby/Problem_Solving
064-ProductofArrayExceptSelf/productExceptSelf.cpp
#include <iostream> #include <vector> using namespace std; class Solution { public: vector<int> productExceptSelf(vector<int> &nums) { vector<int> productVec; // Calculate prefix products int prefix = 1; for(int i=0;i<nums.size();++i) { productVec.push_back(p...
ALGO
0.999922
5.525374
bb9c38ac-855d-40bb-b6ed-b258c948dea1
algorithm-random-defense/algorithm_study
src/AS_23_11_week4/jiyeon/19583.cpp
/** * @file 19583.cpp * @author jiyeon * @brief 싸이버개강총회 * @date 2023-11-22 * */ #include <iostream> #include <set> #include <unordered_set> using namespace std; int main() { string start, end, quit; cin >> start >> end >> quit; string time, nickname; unordered_set<string> participant, answer; ...
ALGO
0.996546
4.260981
4df95a05-4e15-4fce-8b05-3fb95a585817
NerdPotatoo/Problem-Solving
VJudge/LONG_CONTEST_1/G.cpp
#include<bits/stdc++.h> using namespace std; #define ll long long void solve() { // CODE HERE int t; cin >> t; while(t--){ int n, sum = 0; cin>>n; vector<int> v; for(int i = 0; i<n; i++){ int a; cin >> a; v.push_back(a); s...
ALGO
0.998892
5.613315
503c919f-56e0-4b0f-aba0-52325459520f
zayim/OOP
AV11/AV11Z1_2.cpp
#include <iostream> #include <cstdlib> using namespace std; bool porediDvaCijelaBroja(const int &a, const int &b) { return a<=b; } template <typename Tip> class cvor { public: cvor *prethodni, *sljedeci; Tip vrijednost; public: cvor() { prethodni=sljedeci=0; vrijednost=Tip(); } cvor (const Tip ...
ALGO
0.999321
4.472388
e3bc743a-38b3-45c5-a4b6-162ac20a358e
Kunal271002/DSA_Cpp
SumOfAllElements.cpp
#include<iostream> using namespace std; int main(){ int n,result = 0; cout<<"Enter the Size of Array : "; cin>>n; int Array[n]; for(int i = 0;i<n;i++){ cin>>Array[i]; } for(int i = 0;i<n;i++){ cout<<Array[i]<<" "<<endl; } for(int i = 0;i<n;i++){ result+=Array[...
ALGO
0.995848
3.578115
1c144882-3196-4628-beeb-af8f784a2e60
mastershashank/LeetcodeDailyChallenge
Day-30.cpp
class Solution { public: int tribonacci(int n) { vector<int>temp={0,1,1}; int var=0; for(int i=3;i<n+1;++i){ var=temp[i-1]+temp[i-2]+temp[i-3]; temp.push_back(var); } return temp[n]; } };
ALGO
0.999968
5.929701
5fc8d5d2-be37-4e7d-9f78-7f65261c0ca8
farzamdorostkar/amon
llvm-project-17.0.6.src/mlir/lib/Dialect/Affine/Transforms/SuperVectorize.cpp
#include "mlir/Dialect/Affine/Passes.h" #include "mlir/Analysis/SliceAnalysis.h" #include "mlir/Dialect/Affine/Analysis/AffineAnalysis.h" #include "mlir/Dialect/Affine/Analysis/LoopAnalysis.h" #include "mlir/Dialect/Affine/Analysis/NestedMatcher.h" #include "mlir/Dialect/Affine/IR/AffineOps.h" #include "mlir/Dialect/A...
TOOL
0.908143
6.626846
9e16ea8a-7be8-40f4-bce7-002728f2b9af
tonywilliams1990/luna
Examples/Spectral/ODE_Rational.cpp
/// \file ODE_Rational.cpp /// \ingroup Examples /// \ingroup Spectral /// The equation \f[ u''(y) - u(y) = -2e^{1-y} \f] is solved on /// \f$ y \in [0,\infty)\f$ subject to the boundary conditions \f$ u(0) = e\f$ /// and \f$ u(y) \to 0 \f$ as \f$ y \to \infty\f$. The system is solved using /// rational Chebyshev funct...
ALGO
0.99977
6.172298
2836548f-afe4-4416-bdcd-4459fc614bee
proghead00/Interview-Competitive-Cpp
Graphs/floodFillColorCount.cpp
#include <bits/stdc++.h> using namespace std; const int N = 100; int arr[N][N], vis[N][N]; int colorCnt[N]; // to map how many colors have how many islands int n, m; int dx[4] = {0, 0, 1, -1}; int dy[4] = {1, -1, 0, 0}; void floodFill(int x, int y, int color) { arr[x][y] = color; vis[x][y] = 1; colorCnt[color]...
ALGO
0.999969
4.254714
7aadc318-3d6f-4d28-a0db-bd6f732f5a41
Vishal-vb-29/Programming
DSA_Apna_college/17_BinarySearch/binarySearch.cpp
#include<iostream> #include<vector> using namespace std; int binarySearch(vector<int> arr,int tar){ int st=0; int end=arr.size()-1; while(st<=end){ int mid=(st+end)/2; if(arr[mid]>tar){ end=mid-1; }else if(arr[mid]<tar){ st=mid+1; }else return mi...
ALGO
0.999916
5.335567
ea5028a9-3470-45bf-a1aa-5519f2a4d661
SlipiFeed/Fast-Track
Final Test/Task 2/task2.cpp
#include <iostream> #include <memory> #include <mutex> #include <thread> /*** * Разработайте программу, демонстрирующую создание двух потоков в C++, где один поток пишет данные в переменную, * а другой читает из нее, с использованием мьютексов для синхронизации доступа. */ void write(int& value, std::mutex& mtx) {...
TOOL
0.940811
6.329685
bd84a26b-8efc-4bef-ba40-e443a2c069af
ishandutta2007/codeforces
ohweonfire/normal/1198/F.cpp
// This amazing code is by Eric Sunli Chen. #include<bits/stdc++.h> using namespace std; template<typename T> bool get_int(T &x) { char t=getchar(); bool neg=false; x=0; for(; (t>'9'||t<'0')&&t!='-'&&t!=EOF; t=getchar()); if(t=='-')neg=true,t=getchar();if(t==EOF)return false; for(; t<='9'&&t>='0'; t=getchar())x=x...
ALGO
0.999976
3.27402
08c0c658-2bd1-444b-8fe7-5264b8a0494c
zetrfvg/Algorithm
杂题/力扣/246. 中心对称数.cpp
/* 简单回文串应用 */ class Solution { public: bool invalid(int x){ return x==2||x==3||x==4||x==5||x==7; } bool check(int x,int y){ if(y<x) swap(x,y); return (x==1&&y==1)||(x==8&&y==8)||(x==6&&y==9)||(x==0&&y==0); } bool isStrobogrammatic(string num) { for(int l=0,r=num.size(...
ALGO
0.999573
5.791119
750e1dba-1e20-4fdd-bd1c-3fe78effeeca
SiddharthMaverick/CodeForces_Solutions
q1220a.cpp
#include<bits/stdc++.h> using namespace std; int main() { int n; cin>>n; string st; cin>>st; int cz=0,c1=0; for(int i=0;i<st.length();i++) { char ch=st[i]; if(ch=='z') { cz++; } if(ch=='n') { c1++; } } ...
ALGO
0.999882
3.054836
ed38df99-354e-4f46-a9cc-7c292ea9cf21
MPTCP-FreeBSD/FB13.1-ML-MPTCP-SRC
contrib/llvm-project/llvm/lib/CodeGen/MachineDominanceFrontier.cpp
#include "llvm/CodeGen/MachineDominanceFrontier.h" #include "llvm/Analysis/DominanceFrontierImpl.h" #include "llvm/CodeGen/MachineDominators.h" #include "llvm/CodeGen/Passes.h" #include "llvm/InitializePasses.h" using namespace llvm; namespace llvm { template class DominanceFrontierBase<MachineBasicBlock, false>; tem...
ALGO
0.989269
7.45205
9bf938fb-3453-47b6-9b7a-c6d03265d86c
ATNoName/Advent_2015
Day25/day25.cpp
#include <string> #include <iostream> #include <fstream> using namespace std; void get_input(ifstream* f, int* row, int* col) { int* operate = row; string line; while (getline(*f, line, ' ')) { try { if (stoi(line)) { *operate = stoi(line); if (operate ==...
ALGO
0.999441
5.013648
9377e21d-9c68-4ed6-842f-fdc56a5f52eb
nguyenhoang4875/CompetitiveProgramming
graph_course/6_euler_tour/1_BestEulerTour.cpp
#include <bits/stdc++.h> #define int long long using namespace std; #define pb push_back #define all(x) x.begin(), x.end() #define sz(a) (int)(a).size() #define el '\n' #define F first #define S second #define For(i, a, b) for (int i = a; i <= (int)b; i++) #define Ford(i, a, b) for (int i = a; i >= (int)b; i--) #defi...
ALGO
0.999952
4.604983
adc442cb-7b6b-457f-8597-f33545c222af
tingdiandedeng/C-plus-plus
Assignment4.2/Assignment4.2/源1.cpp
#include"head.h" #include<iostream> using namespace std; int main() { float sum = 0; for (int i = 1; i <= 49; i++) { Rational A(i, i + 1); sum = sum + A; } cout << sum << endl; return 0; }
ALGO
0.996543
3.61223
b83103f2-d1be-465e-85fe-6974607d0d8c
InawoVictor/expense-tracker-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
17c6494d-dd37-4ac9-8ce6-041ddf7349b7
josehpg98/Algorithms
A-I_2019_1/ExerciciosSwitch/exe2.cpp
#include<iostream> using namespace std; main() { setlocale(LC_ALL,"Portuguese"); int ddd; cout<<"\n informe um DDD de um estado atravs do correspondente nmero: "; cin>>ddd; switch(ddd) { case 61: cout<<"\n o ddd de braslia!"; break; case 71: cout<<"\n o DDD salv...
ALGO
0.99447
4.62402
bb054294-16cd-4e37-a5a3-7a01e4ef91c2
perchuts/CompetitiveProgramming
cf/2085/f.cpp
#include <bits/stdc++.h> #define all(x) x.begin(), x.end() #define sz(x) (int) x.size() #define endl '\n' #define pb push_back #define _ ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL); #define int ll using namespace std; using ll = long long; using ull = unsigned long long; using ii = pair<int,int>; us...
ALGO
0.999745
4.585536
f6a5d3d3-7994-45aa-99c5-8842d843e703
ChengYull/algorithm
algorithm/simpleHash/simpleHash/simple_hash.cpp
#include "iostream" #include "string" using namespace std; /*ӷϣ*/ int addHash(string key){ long long hash = 0; /*1000000007 һʹΪģԼٹϣͻĸ*/ /*ڴ֤intΧ*/ const int MODULE = 1000000007; /*ʹunsigned charַ֤תΪ˼ķ*/ for (unsigned char ch : key){ hash = (hash + (int)ch) % MODULE; } return (int)hash; } /*˷ϣ*/ int mulHash(s...
ALGO
0.999904
4.445596
ad5e7d1e-e77f-4996-a751-39cf4ddc52a3
lijiankou/ml
thirdparty/Eigen/doc/examples/TemplateKeyword_simple.cpp
#include <Eigen/Dense> #include <iostream> using namespace Eigen; void copyUpperTriangularPart(MatrixXf& dst, const MatrixXf& src) { dst.triangularView<Upper>() = src.triangularView<Upper>(); } int main() { MatrixXf m1 = MatrixXf::Ones(4,4); MatrixXf m2 = MatrixXf::Random(4,4); std::cout << "m2 before copy:"...
TOOL
0.993123
5.210898