uuid
string
repo_name
string
relative_path
string
content
string
category
string
algo_rel_score
float64
quality_score
float64
b072d5da-150c-4d7d-9f03-17904ff7056e
louie17/RoutePlanning
EigenLib/test/sparse_permutations.cpp
static long int nb_transposed_copies; #define EIGEN_SPARSE_TRANSPOSED_COPY_PLUGIN {nb_transposed_copies++;} #define VERIFY_TRANSPOSITION_COUNT(XPR,N) {\ nb_transposed_copies = 0; \ XPR; \ if(nb_transposed_copies!=N) std::cerr << "nb_transposed_copies == " << nb_transposed_copies << "\n"; \ VERIFY( (#XPR...
TEST
0.873647
6.2616
5a38ccf5-adaf-4dd6-9cd8-d985cae4d974
aryan7778/codechef_solutions
PTMSSNG.cpp
#include<bits/stdc++.h> #include<iterator> #define fastIO ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0); using namespace std; int main(){ fastIO int t; cin>>t; while(t--){ int n; cin>>n; set <long long> x2,y2; for(int i=0;i<4*n-1;i++){ long long x1,y1; cin>>x1>>y1; if(x...
ALGO
0.999408
3.519648
a414823d-16a4-49f6-9875-1eef30798623
ip99202/Algorithm
다이나믹프로그래밍(DP)/2705_팰린드롬 파티션.cpp
#include<iostream> #include<algorithm> #include<vector> using namespace std; int dp[1001]; int main() { ios::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL); dp[1] = 1, dp[2] = 2, dp[3] = 2; for (int i = 4; i <= 1000; i++) { dp[i] = 1; for (int j = 0; j < i; j++) { if ((i - j) % 2 == 1) continue; ...
ALGO
0.999864
4.589708
16d456d0-2a34-4d90-9ef9-3bd7a77d6690
lukeskywokka/BST
lib/lab05/src/expression.cpp
#include "../inc/expression.h" namespace lab5 { /****Auxillary Function prototypes ****/ bool is_number(std::string input_string); bool is_operator(std::string input_string); int get_number(std::string input_string); std::string get_operator(std::string input_string); int operator_priority(s...
ALGO
0.9816
3.954797
6908f0a3-774b-46f8-b26b-0d1221dc5a05
ms303956362/myexercise
dsacpp/src/shiftK/shift2.cpp
/*DSA*/#include "reverse/reverse.h" /*DSA*/#include "UniPrint/print_int_array.h" int shift2 ( int* A, int n, int k ) { //㷨ѭkλO(3n) k %= n; //ȷk <= n reverse ( A, k ); //A[0, k)ãO(3k/2)β /*DSA*/print ( A, n, 0, k ); reverse ( A + k, n - k ); //A[k, n)ãO(3(n - k)/2)β /*DSA*/print ( A, n, k, n ); revers...
ALGO
0.998342
4.367864
9d40a7fc-387d-49ea-8caa-471ba50a6bd7
suehtaMFr/Library
Solutions/UVA/10611 - The Playboy Chimp.cpp
#include <bits/stdc++.h> using namespace std; //Regular show #define mid ((l+r)>>1) #define sz(x) ((int)x.size()) #define fin freopen ("input.txt","r",stdin); #define fout freopen ("output.txt","w",stdout); #define fast ios_base::sync_with_stdio(false),cin.tie(NULL),cout.tie(NULL); //rapadura é doce, mas não é mole...
ALGO
0.999988
3.788862
a4b80bcd-b1ee-48f6-8b43-5a92f0ffe0d6
hugoresende27/c-_Exercicios
Modulo 784 FuncoesEstruturas/Aula11_structs/exc2Funcoes_3.cpp
/* Faça um programa que leia um vetor com tamanho 10 de números inteiros. Após ler, uma função deve criar um novo vetor com base no primeiro (passe o vetor por referência), mas, o novo vetor deve ser ordenado de forma crescente (utilize uma outra função de ordenação que receba o vetor por referência. O programa deve im...
ALGO
0.999438
4.141488
a0eda250-b7ed-4fc9-881e-458d764b9942
YuanJunbin/COMP5411
ext/eigen/doc/examples/Tutorial_BlockOperations_colrow.cpp
#include <Eigen/Dense> #include <iostream> using namespace std; int main() { Eigen::MatrixXf m(3,3); m << 1,2,3, 4,5,6, 7,8,9; cout << "Here is the matrix m:" << endl << m << endl; cout << "2nd Row: " << m.row(1) << endl; m.col(2) += 3 * m.col(0); cout << "After adding 3 times the first colu...
ALGO
0.990478
3.576145
e6dd9b27-c415-4d76-961f-2a992c6a3a74
Donkeyzhenbang/base
demo/algorithm/242.有效的字母异位词.cpp
/* * @lc app=leetcode.cn id=242 lang=cpp * * [242] 有效的字母异位词 */ #include<bits/stdc++.h> using namespace std; // @lc code=start class Solution { public: bool isAnagram(string s, string t) { int letter[26] = {0}; for(auto i :s){ letter[i - 'a'] ++; } for(auto j...
ALGO
0.999937
5.827352
f5bd6ec3-88e5-40de-bffa-021e7adaeace
pankaj11koundal/DSA
with C++/Challenges/Array Problems/LongestSubarrayWithoutDuplicates.cpp
#include<bits/stdc++.h> using namespace std; int longestSubarrayWithoutDuplicates(string str) { int arr[265] = {-1}, start = -1, maxlen = 0; for (int i = 0; i < str.length(); i++) { if (arr[str[i]] > start) { start = arr[str[i]]; } arr[str[i]] = i; maxl...
ALGO
0.999845
5.053102
24dc11fe-c170-457a-abb0-a10f79e05f96
Praveen12222139/cp
Trilogy3.cpp
#include <iostream> #include <string> #include <algorithm> using namespace std; int main() { int n; cin >> n; string ans = ""; // Convert integer n to binary string representation for (int i = 31; i >= 0; i--) { int k = n >> i; if (k & 1) { ans += "1"; } else {...
ALGO
0.999983
5.566095
0423254f-5fd8-4965-a8ac-96d480a22bd5
Blaster2398/Leetcode_practice
2-add-two-numbers/add-two-numbers.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: ListNode* addTwoNumbe...
ALGO
0.999896
6.079407
7b64abc3-8248-43cf-b350-3b9b84a74d4b
moutamarakshit/-CrackYourInternship
day 16/minimum swaps to sort.cpp
//{ Driver Code Starts #include<bits/stdc++.h> using namespace std; // } Driver Code Ends class Solution { public: //Function to find the minimum number of swaps required to sort the array. int minSwaps(vector<int>&nums) { int cnt=0,n=nums.size(); vector<pair<int,int>>vec; for(int i=0;i<n;i...
ALGO
0.999937
6.02668
d968ae56-a19e-4999-998e-b71869a9517f
Omurex/Jothly-Engine
eigen-3.4.0/doc/examples/Tutorial_BlockOperations_corner.cpp
#include <Eigen/Dense> #include <iostream> using namespace std; int main() { Eigen::Matrix4f m; m << 1, 2, 3, 4, 5, 6, 7, 8, 9, 10,11,12, 13,14,15,16; cout << "m.leftCols(2) =" << endl << m.leftCols(2) << endl << endl; cout << "m.bottomRows<2>() =" << endl << m.bottomRows<2>() << endl << ...
ALGO
0.998567
4.092313
c32d0d00-fc33-434c-8114-9d35e5e62bc1
Yejin-Moon/algorithm
C++/Baekjoon/Problem1822.cpp
#include <set> #include <iostream> using namespace std; int main() { ios::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL); set<int> s; int n,m; cin>>n>>m; for(int i=0; i<n; i++) { int a; cin>>a; s.insert(a); } for(int i=0; i<m; i++) { int b; ...
ALGO
0.999963
3.328206
b77ae6a8-dd0d-459b-a809-18d9bd73faa9
plctlab/llvm-project
libcxx/test/std/algorithms/alg.sorting/alg.binary.search/binary.search/binary_search.pass.cpp
// <algorithm> // template<ForwardIterator Iter, class T> // constexpr bool // constexpr after C++17 // binary_search(Iter first, Iter last, const T& value); #include <algorithm> #include <vector> #include <cassert> #include <cstddef> #include "test_macros.h" #include "test_iterators.h" #if TEST_STD_VER > ...
TEST
0.999077
7.441343
6541a7a7-e815-4ea9-921d-214007ee3849
KAAHistory/I3DOA
Lecture04_Recursion/Exercise03/main.cpp
#include <iostream> void print_booklet(int startpage, int endpage) { std::cout << "Sheet " << (startpage + 1) / 2 << " contains pages " \ << startpage << ", " << startpage+1 << ", " \ << endpage -1 << ", " << endpage << ".\n"; if (startpage >= (endpage - 3)) { return; } else { print_booklet(startpage + 2, en...
ALGO
0.92496
4.122822
f5c1e1a7-8137-44f1-8223-38fb5558848d
amanverma21/cp
1321-get-equal-substrings-within-budget/get-equal-substrings-within-budget.cpp
class Solution { public: int equalSubstring(string s, string t, int maxCost) { int n = s.size(); vector<int> prefix(n + 1, 0); for (int i = 0; i < n; i++) prefix[i + 1] = prefix[i] + abs(s[i] - t[i]); int l = 0, r = n; while (l < r) { int m = l + (r - l + 1) / 2; ...
ALGO
0.999991
6.160413
2e7371af-a1c6-433f-a33d-0ee98851399f
Austin2501/DSA-GRIND
C++/STL/stack.cpp
#include <bits/stdc++.h> using namespace std; int main(){ /*STACK FOLLOW LIFO ONLY 3 OPERATIONS CAN BE DONE(T.C. OF ALL OPERATIONS = O(1)) 1->PUSH 2->POP 3->TOP */ stack<int> st; st.push(1); st.push(2); st.push(4); st.push(5); st.emplace(8); cout<<st.top...
ALGO
0.944571
4.150972
fc2c4702-80b2-47cf-89e1-1f3ddb97ac55
Esratjahanmare/Code
Codeforces/A. Turtle and Good Strings.cpp
#include<bits/stdc++.h> using namespace std; #define ll long long #define pb push_back int main() { ios::sync_with_stdio(false); cin.tie(0); ll t; cin>>t; while(t--) { ll n; cin >> n; string s; cin >> s; if (s[0] != s[n-1]) cout << "YES" << endl;...
ALGO
0.999427
4.449268
3a910a84-745d-43a2-ae5a-7ece8351c4ec
jbhartman99/HartmanJacob_CSC5_40718
Hmwk/Assignment 1/Gaddis_7thEd_Chap2_Prob5/main.cpp
/* * File: main.cpp * Author: Jacob Hartman * Created on January 11, 2015, 6:33 PM * Purpose: Gaddis, 7th Ed, Chapter 2, Problem 5 * Title: Average of Values */ //System Libraries #include <iostream> using namespace std; //User Libraries //Global Constants //Function Prototypes //Execution Begins Here in...
ALGO
0.992967
3.898298
e5074a95-647a-41b5-945b-8511b76aa94b
adib3552/codeforce
New Year's Number.cpp
#include<bits/stdc++.h> //999902 using namespace std; int main(){ int t; cin>>t; while(t--){ bool flag=false; long long int n,temp; cin>>n; temp=n; while((temp>=2021 || temp>=2020)){ temp-=2020; if(temp==2020 || temp==2021 || temp%2020==0 || te...
ALGO
0.999792
4.209714
6bc63d63-02ca-4f9c-a6cc-0ab9e2ec9538
peterhyun1234/Algorithm_team_BOJ
YJ/20200818/1194.cpp
#include <iostream> #include <queue> #include <vector> using namespace std; struct room { int x, y, cnt, key; room (int a, int b, int c, int d) { x = a; y = b; cnt = c; key = d; } }; int main() { ios::sync_with_stdio(false); cin.tie(0); cout.tie(0); in...
ALGO
0.99973
4.486543
d425cc6b-8d7e-4ed4-8bac-9224f64a730a
AdeebAbubacker/ChatApp
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
54c886b9-7a41-4311-81d5-7f8917ccacd4
130-SanaAsif/DSA-Practice
Hashing/jewelsStones.cpp
#include<bits/stdc++.h> using namespace std; int jewelsStone(string jewels, string stones){ unordered_map<char,char>mp; int cnt=0; for(int i=0; i<jewels.size(); i++){ mp[jewels[i]]++; } for(int i=0; i<stones.size(); i++){ if(mp.find(stones[i]) != mp.end()){ cnt++; ...
ALGO
0.999812
3.978326
4b60aefe-1d85-4abe-aa92-8ebea4937e9d
ishandutta2007/codeforces
rfpermen/normal/1714/B.cpp
#include<bits/stdc++.h> #pragma GCC optimize("O3") #pragma GCC target("tune=native") #pragma GCC optimize("unroll-loops") using namespace std; template<class A, class B> ostream& operator<<(ostream& os, const pair<A, B> &p) { os << '(' << p.first << ',' << p.second << ')'; return os; } template<class T> ostream...
ALGO
0.999809
4.047275
ce762489-e41f-4d13-8780-80aec4d89fc9
natindo/pointers
array.cpp
#include <iostream> template <typename T1> void CreateTwoDimensionalArray (T1 num, T1 col) { int **arr = new int* [num]; for (size_t i = 0; i < num; i++) { arr [i] = new int [col]; } for (size_t i = 0; i < num; i++) { for (size_t j = 0; j < col; j++) { arr[i][j] = rand() % ...
TOOL
0.862595
4.211668
048480e0-0be8-4f21-83f0-0b3192fdcc8f
ishandutta2007/codeforces
mr.robot_28/normal/1610/E.cpp
#include<bits/stdc++.h> using namespace std; #define x first #define y second #define ll long long #define sz(a) (int)a.size() const ll mod = 1e9 + 7; const ll mod2 = 1e9 + 7; signed main(){ ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL); int count; cin >> count; while(count--)...
ALGO
0.999687
4.047392
2f885251-a4a4-4441-aa4c-bd54c610b9ab
Engineering-Student-An/programmers_solution
프로그래머스/lv1/12977. 소수 만들기/소수 만들기.cpp
#include <vector> #include <iostream> using namespace std; bool is_Prime(int n){ for(int i=2;i<n;i++){ if(n%i==0) return false; } return true; } int solution(vector<int> nums) { int answer = 0; for(int i=0;i<size(nums);i++){ for(int j=i+1;j<size(nums);j++){ for(int k=j+1;...
ALGO
0.999799
5.421632
5dbe306f-9fd1-43e0-8228-81ac059011d0
mikegedelman/advent-of-code-2021
1.cpp
#include <iostream> #include <vector> #include <unistd.h> void part1() { std::string line; std::getline(std::cin, line); int last = std::stoi(line); int num_increased = 0; while(std::getline(std::cin, line)) { int cur = std::stoi(line); if (cur > last) { num_increased +...
ALGO
0.998939
6.065311
54f6d68b-b9ef-4128-bace-5daedd6592ed
Pavankumardontha/Binary_search
Single_element_in_sorted_array.cpp
class Solution { public: int singleNonDuplicate(vector<int>& a) { int n = a.size(); int l = 0; int r = n-1; while(l<=r) { int mid = l + (r-l)/2; if(mid==0 or mid==n-1) return a[mid]; else { // no...
ALGO
0.999934
5.513827
daa4f20f-ccdc-4886-8eee-49fd27bc482c
SatyaKilaru/Week01-CPP4-Cipherschools-
recursion.cpp
#include<bits/stdc++.h> using namespace std; // this is the iterative type of function // int power(int base, int pow){ // int num = 1; // for(int i = 0; i < pow; i++){ // num*=base; //num = num*base; // } // return num; // } int power(int base, int pow){ // 1. base case - It is a ter...
ALGO
0.999911
5.964317
ab814f99-6b23-41a9-9b8f-1dcb3efcae3a
Altu-Bitu-7/Altu-Bitu-BooHyeMin
07_동적계획법/BOJ_11053.cpp
#include <iostream> using namespace std; int main() { ios::sync_with_stdio(false); cin.tie(NULL); int n; cin >> n; int a[1001], dp[1001]; // dp : 각 원소까지의 가장 긴 부분수열 길이 저장 for (int i = 1; i <= n; i++) { cin >> a[i]; } int sum = 0; // 최대 길이 for (int i = 1; i <= n; i++) { ...
ALGO
0.999948
4.682579
c89f0f48-2015-4698-976c-2508f9499b91
Dicer-Zz/CodeingOnOJ
Others/NAIPC2016 C. Greetings!.cpp
#pragma GCC optimize(2) #pragma GCC optimize(3) #include <bits/stdc++.h> using namespace std; #define clr(s, x) memset(s, x, sizeof(s)) typedef long long ll; typedef unsigned long long ull; typedef pair<int, int> pii; inline int read(){int r=0;char c=getchar();while(c<'0'||c>'9') {c=getchar();}while(c>='0'&&c<='9') {r=...
ALGO
0.998707
3.475723
cfb77c44-08cc-4e7b-a92e-3d45e1da8115
Tejalpatel2099/Leetcode
0189-rotate-array/0189-rotate-array.cpp
class Solution { public: void rotate(vector<int>& nums, int k) { int n = nums.size(); k = k % n; vector<int> rotated(n); for (int i = 0; i < n; i++) { rotated[(i + k) % n] = nums[i]; } for (int i = 0; i < n; i++) { nums[i] = rotated[i]; ...
ALGO
0.999992
6.175756
e6ea4927-4b2e-49e6-9114-e407384b4a49
10946009/yuihuang_zj_ans
cpe-level-1/cpp/zj-a465.cpp
#include <bits/stdc++.h> using namespace std; int t, Case, n, ans, r; string s; int main(){ cin >> t; while (t--){ cin >> n; cin >> s; ans = 0; r = -1; for (int i = 0; i < n; i++){ if (s[i] == '.' && i > r){ r = i+2; ans++; ...
ALGO
0.997572
3.313941
85d7f11f-4a78-4885-8a27-4843fa0d21e4
Yao-9/LeetCode150
Python/answer/dp/world_search.cpp
class Solution { private: vector<vector<char> > *board; string *word; bool **used; private: bool isInboard(int i, int j) { if(i < 0)return false; if(i >= board->size())return false; if(j < 0)return false; if(j >= (*board)[i].size())return false; return true; } bool DFS(int si, int sj, in...
ALGO
0.999532
5.549783
70a02c87-0e35-46bf-a13e-4a1a626b9a38
JCastle4/Simulating-Job-Scheduler-
FCFSSchedule.cpp
#include <iostream> #include <vector> #include <fstream> #include <string> using namespace std; void getAvgFCFS(vector<int> input, vector<string> job); void getInput(vector<int> &input, vector<string> &jobVec, string theFile); void getInput(vector<int> &input, vector<string> &jobVec); void toCSV(double avgTurnaround, ...
ALGO
0.9647
4.4371
0ead7cb6-7226-4f8c-afd0-4dbc8ab21eba
alpha74/iLC
P/Prime_in_Diagonal.cpp
// Return max prime number in diagonals of given 2 matrix // https://leetcode.com/problems/prime-in-diagonal/description/ // Aman Kumar // Runtime 81ms Beats88.10%of users with C++ // Memory 38.26MB Beats39.22%of users with C++ bool isPrime(int n) { if(n == 1) return 0; for(int i = 2 ; i * i <= n ; i++) { ...
ALGO
0.999825
5.705865
d0f812af-8490-489e-91f4-559806186c77
Ishanis-CoderMan/Ultimate-Algorithm-CPP-JAVA-PYTHON
Ultimate_Algorithms_Repository/Basic Algorithms/BubbleSort.cpp
// C++ program for implementation of Bubble sort #include <bits/stdc++.h> using namespace std; void swap(int *xp, int *yp) { int temp = *xp; *xp = *yp; *yp = temp; } // A function to implement bubble sort void bubbleSort(int arr[], int n) { int i, j; for (i = 0; i < n-1; i++) ...
ALGO
0.999911
5.5495
0b811b4e-e4aa-423b-b958-3dd764199502
hey-rum-ba/G4G-DSA
Largest number with given sum.cpp
// { Driver Code Starts #include <bits/stdc++.h> using namespace std; // } Driver Code Ends // Function to return Largest Number class Solution { public: //Function to return the largest possible number of n digits //with sum equal to given sum. string largestNumber(int n, int sum) { // Y...
ALGO
0.999865
6.357647
01ccb4ce-5161-4735-ac80-b68356c18e24
Akahara/PebbleEngine
src/utils/bezier_curve.cpp
#include "bezier_curve.h" #include <fstream> vec3 BezierCurve::samplePoint(float t) const { if (t <= 0) return controlPoints.front().position; if (t >= static_cast<float>(controlPoints.size()-1)) return controlPoints.back().position; int ft = static_cast<int>(t); return interpolate(controlPoints[ft], controlP...
ALGO
0.903539
7.476566
f37cbc47-5167-4add-8798-0cde1564c68f
S-K-Siva/codechef_practice
Feb5/InteriorDesign.cpp
#include <iostream> using namespace std; int main() { int t; cin>>t; while(t--){ int x1,y1,x2,y2; cin>>x1>>y1>>x2>>y2; int a = x1+y1; int b = x2+y2; if(a > b){ cout << b << endl; }else{ cout << a << endl; } } return 0; }
ALGO
0.997625
3.348881
6fa8f9fb-3c69-4301-8bd4-61c7885a3bf4
mzf11125/learning-C
asclouseasyoucanstevenversion.cpp
#include <stdio.h> void getIndex(long long int *arr, int size, long long int value){ int l = 0; int r = size - 2; if(arr[r+1] <= value){ printf("%d\n", r+2); return; } while(l <= r){ int m = l + (r - l) / 2; if(arr[m] <= value && value < arr[m + 1]){ printf("%d\n", m+1); return; }else if(arr[m] <...
ALGO
0.999486
3.762384
f7853ff6-9627-4e9c-a5d6-d554ea597fec
Rhett0905yb/BoxOfficePrediction
sourceCode/DataCleasing/final/csv/new/deleteNoMovie.cpp
//deleteNoMovie.cpp //@author: Yibo YU, <EMAIL> #include <stdio.h> #include <iostream> #include <string> #include <string.h> #include <stdlib.h> #include <fstream> #include <sstream> using namespace std; int main(void){ //string addre = "actorRowNoEnter.txt"; //string newdata = "@@@@\n"; string data;...
DATA
0.880405
3.636301
76ebf1dd-30ba-4629-982d-d8feaac27d86
rohsik2/AlgorithmStudy
BaekJoon/6000~6999/6549.cpp
#include <iostream> #include <vector> #include <string> using namespace std; int main() { cin.tie(0); ios::sync_with_stdio(0); while(true){ long long int n_hist; cin>>n_hist; if(n_hist == 0) return 0; vector<pair<long long int, long long int>> hists; // heights, width long long int large =...
ALGO
0.9998
3.827688
86e04672-b08d-4f24-ae4d-511bd0e2e09e
Lavia1337/TSP-PTTKGT
tienhoa/Source1.cpp
#include <iostream> #include <vector> #include <algorithm> #include <random> #include <chrono> #include <iomanip> #include <sstream> #include <fstream> using namespace std::chrono; using namespace std; const int POPULATION_SIZE = 100; const int NUM_GENERATIONS = 100; const double CROSSOVER_RATE = 0.5; const double M...
ALGO
0.999997
5.197831
12c1c223-3675-4611-a8c4-8b10a5e1dd8d
IntelLabs/c3-llvm
llvm/lib/CodeGen/SpillPlacement.cpp
#include "SpillPlacement.h" #include "llvm/ADT/BitVector.h" #include "llvm/CodeGen/EdgeBundles.h" #include "llvm/CodeGen/MachineBasicBlock.h" #include "llvm/CodeGen/MachineBlockFrequencyInfo.h" #include "llvm/CodeGen/MachineFunction.h" #include "llvm/CodeGen/MachineLoopInfo.h" #include "llvm/CodeGen/Passes.h" #include ...
ALGO
0.999261
7.717901
d586d42e-75f9-46dd-94d1-896457043298
checkedc/checkedc-llvm-project
libcxx/test/std/algorithms/alg.sorting/alg.min.max/min_init_list.pass.cpp
// UNSUPPORTED: c++03 // <algorithm> // template<class T> // T // min(initializer_list<T> t); #include <algorithm> #include <cassert> #include "test_macros.h" int main(int, char**) { int i = std::min({2, 3, 1}); assert(i == 1); i = std::min({2, 1, 3}); assert(i == 1); i = std::min({3, 1, 2}...
TEST
0.992941
4.9407
058f0863-ccc3-4787-b34a-dfaa9f27df6d
hjiang13/LLMs-in-IR
POJ-104/90/2053.cpp
#include <iostream> using namespace std; int f(int m,int n){ if(m<n)return f(m,m); if(m==1&&n!=0||n==1&&m!=0)return 1; //??? m>=1 if(m==0||n==0)return 1; //??????????0 if(m>=n)return f(m-n,n)+f(m,n-1); } int main(){ int m,n,t; cin>>t; while(t--){ cin>>m>>n; cout<<f(m,n)<<endl; } }
ALGO
0.999979
5.342568
d6ae3401-2d50-4017-b76d-bfb91a952561
keshavsingh4522/hacktoberfest
DSA/STL/rotate.cpp
#include <bits/stdc++.h> using namespace std; int main() { int n,key; cin>>n; int arr[n]; for(int i=0;i<n;i++) cin>>arr[i]; //cin>>key; rotate(arr,arr+n/2,arr+n); for(int i=0;i<n;i++) cout<<arr[i]<<" "; }
ALGO
0.99993
3.056381
4a1f08be-cdbf-4542-bfb3-977c750c0124
madhu511/Audacity
lib-src/libnyquist/nyquist/nyqstk/src/JetTable.cpp
/***************************************************/ /*! \class JetTable \brief STK jet table class. This class implements a flue jet non-linear function, computed by a polynomial calculation. Contrary to the name, this is not a "table". Consult Fletcher and Rossing, Karjalainen, Cook, and ot...
ALGO
0.993466
5.509292
dfb0325c-583e-4906-9b8c-6eef2140007c
lastoyster/flutter_pin_animation
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.998784
6.761023
89ac5a0c-db45-411a-8956-ac6a54999663
herman2lv/open-jdk-fork
hotspot/src/share/vm/opto/chaitin.cpp
#include "precompiled.hpp" #include "compiler/compileLog.hpp" #include "compiler/oopMap.hpp" #include "memory/allocation.inline.hpp" #include "opto/addnode.hpp" #include "opto/block.hpp" #include "opto/callnode.hpp" #include "opto/cfgnode.hpp" #include "opto/chaitin.hpp" #include "opto/coalesce.hpp" #include "opto/conn...
ALGO
0.971882
4.999085
ae224b14-f3c1-4b11-9275-1f5027f5986f
rncscox/rncsjfx
modules/javafx.web/src/main/native/Source/JavaScriptCore/dfg/DFGPredictionPropagationPhase.cpp
#include "config.h" #include "DFGPredictionPropagationPhase.h" #if ENABLE(DFG_JIT) #include "DFGGraph.h" #include "DFGPhase.h" #include "JSCJSValueInlines.h" namespace JSC { namespace DFG { namespace { static constexpr bool verboseFixPointLoops = false; class PredictionPropagationPhase : public Phase { public: ...
ALGO
0.981925
7.497517
cf2a8e37-76db-4bdc-81ad-7ad0a4bdb77e
jiashaz/Data_structure
recursion1/checkifelementispresent_optimized.cpp
#include<iostream> using namespace std; bool check_if_element_present(int array[],int size,int element){ if(size==0){ return false; } if(array[size]==element){ return true; } return check_if_element_present(array,size-1,element); } int main(){ int arr[5]={1,2,3,4,5}; cout<...
ALGO
0.999625
4.923686
8acb6f98-cb82-4b64-b6df-6e8c324f82f1
ruanlei1112/oceanbase-develop
src/share/scheduler/ob_tenant_dag_scheduler.cpp
#define USING_LOG_PREFIX COMMON #include "ob_tenant_dag_scheduler.h" #include "lib/thread/thread_mgr.h" #include "storage/compaction/ob_tenant_compaction_progress.h" #include "storage/compaction/ob_compaction_dag_ranker.h" #include "storage/compaction/ob_tenant_tablet_scheduler.h" #include "storage/column_store/ob_co_m...
TOOL
0.8717
6.085021
77dab149-6893-4f9f-8e94-4438f8b9d44a
Naganathan05/Leetcode_Solutions
Greedy Algorithms/871. Minimum Number of Refueling Stops.cpp
/*--------------------------- Time Complexity: O(nlogn) Space Complexity: O(n) ------------------------------*/ class Solution { public: int addFuel(int dest, int src, int &remFuel, priority_queue<int> &maxHeap){ int numRefuels = 0; while(dest - src > remFuel){ if(maxHeap.empty()) r...
ALGO
0.999892
5.803983
7e4f931c-82f5-4a72-8fca-8f05b5d938b8
dhanendraverma/Daily-Coding-Problem
Day21.cpp
/***************************************************************************************************************************************** This problem was asked by Snapchat. Given an array of time intervals (start, end) for classroom lectures (possibly overlapping), find the minimum number of rooms required. For examp...
ALGO
0.999937
5.947301
77fe274b-ac97-40e1-a04f-e056f6e4326a
Prabhat2002/Data_Structure_and_Algorithm
Generate Parentheses(revise).cpp
class Solution { public: void paran(vector<string>&res,string s,int i,int j,int n) { if(i==n && j==n) { res.push_back(s); return; } if(i<n) paran(res,s+'(',i+1,j,n); if(i>j) paran(res,s+')',i,j+1,n); return; } ...
ALGO
0.999791
5.73343
1002c3ef-b464-4a16-acca-5e0d81de4ed4
ishandutta2007/codeforces
geothermal/normal/1495/B.cpp
#pragma GCC optimize ("O3") #pragma GCC target ("sse4") #include <bits/stdc++.h> using namespace std; typedef long long ll; typedef long double ld; typedef complex<ld> cd; typedef pair<int, int> pi; typedef pair<ll,ll> pl; typedef pair<ld,ld> pd; typedef vector<int> vi; typedef vector<ld> vd; typedef vector<l...
ALGO
0.999874
4.574041
9fb7ca5d-176e-4d0e-aac1-ad247e1e12f2
lphlch/Data-Structure
1 SeqList-List/HW1-1.cpp
#define _CRT_SECURE_NO_WARNINGS //2021/9/18 #include <iostream> #include <string> #include <cstring> using namespace std; const int MAXSIZE = 20000; /// <summary> /// 存储每个学生的信息 /// </summary> struct Data { char num[8]; char name[14]; }; /// <summary> /// 顺序表 /// </summary> struct SeqList { //data Data students[M...
ALGO
0.992918
3.950429
6377efbc-ea2a-48a4-a178-18991caf6789
rampa069/LIA_RAL
LIA_SpkTools/src/TrainTools.cpp
#if !defined(ALIZE_TrainTools_cpp) #define ALIZE_TrainTools_cpp #include <iostream> #include <fstream> // pour outFile #include <cstdio> // pour printf() #include <cassert> // pour le debug pratique #include <cmath> #include <liatools.h> #include <DoubleSquareMatrix.h> // Small stuff (command line, small functions...
ALGO
0.993457
3.190117
d7ef7e27-775a-46ff-b41f-bf4228153b2a
paul-fornage/CS10A-2
class materials/Gaddis-CPP_10e_SourceCode/Chapter 06/Pr6-17.cpp
// This program shows that a global variable is visible // to all the functions that appear in a program after // the variable's declaration. #include <iostream> using namespace std; void anotherFunction(); // Function prototype int num = 2; // Global variable int main() { cout << "In main, num is " <...
ALGO
0.95005
6.33261
22b30241-b138-4942-8107-de462a960535
prashantpandey9/create-your-own-what-you-want
c++/MergeSort.cpp
# Python program for implementation of MergeSort def mergeSort(arr): if len(arr) > 1: # Finding the mid of the array mid = len(arr)//2 # Dividing the array elements L = arr[:mid] # into 2 halves R = arr[mid:] # Sorting the first half mergeSort(L) # Sorting the second half mergeSort(R) i = j...
ALGO
0.999965
5.702457
8eab1f2e-d9ba-418c-af6d-2a182ab5261c
ctkhanhly/algorithms
uva/chap3/complete_search/1064_network/s.cpp
#include <iostream> #include <unordered_map> #include <algorithm> using namespace std; #define FOR(i,n) for(int i = 0; i < (int)n; ++i) const int N = 5; const int M = 1000; int n, m, mess[N], start[N], sz,res, pacId, p; unordered_map<int,int> buffer[N]; struct Packet{ int P, s,e; }; Packet packets[M]; int main(){ ...
ALGO
0.998753
3.769388
b45b4c74-f567-4241-b377-7243a97de488
Danvil/asp
src/libasp/algos/SLIC.cpp
#include <slimage/algorithm.hpp> #include <asp/algos.hpp> #include <asp/alic.hpp> namespace asp { Segmentation<PixelRgb> SuperpixelsSlic(const slimage::Image3ub& img_rgb, const SlicParameters& opt) { const float density = static_cast<float>(opt.num_superpixels) / (img_rgb.width() * img_rgb.height()); auto img_d...
ALGO
0.989073
4.664113
aaae0889-b633-4524-8060-c43dadffedc3
shentoumengxin/2024Autumn
Data Structure and Algorithm Anlysis/CS203 DSAA Code/.history/lab6/test_20241128190450.cpp
#include <iostream> #include <vector> using namespace std; class Node { public: int val; int level = 0; // 巨人到达时间 bool is_visit = false; // 是否访问过 vector<Node*> children; bool gaint=0; Node(int val = 0) : val(val) {} }; void dfs(Node* root, int level,vector<int> &sorted_gaints) { if (root ...
ALGO
0.999932
4.863274
e1e2e850-ab30-465d-ab22-31a21bd73fa3
cntrump/unrar
crypt5.cpp
static void hmac_sha256(const byte *Key,size_t KeyLength,const byte *Data, size_t DataLength,byte *ResDigest, sha256_context *ICtxOpt,bool *SetIOpt, sha256_context *RCtxOpt,bool *SetROpt) { const size_t Sha256BlockSize=64; // As defined in RFC 48...
ALGO
0.986899
6.931427
bc15c407-15cc-4840-b042-035b570400a6
AndreiBabinskiy/branchingAlgorithm
Задание4(if).cpp
#include <iostream> #define _USE_MATH_DEFINES #include <math.h> using namespace std; void main() { setlocale(LC_ALL, "RUSSIAN"); double z; double k; double x; double y; cout << " z : " << endl; cin >> z; cout << " k : " << endl; cin >> k; if (k < 1) { x = k * pow(z, 3); } else { x = z * (z + 1); ...
ALGO
0.999374
3.538419
5ecdf7dd-158d-43c9-865d-be217f29325a
WiktorGrzankowski/concurrent-Collatz
teams.cpp
#include <utility> #include <deque> #include <future> #include "teams.hpp" #include "contest.hpp" #include "collatz.hpp" ContestResult TeamNewThreads::runContestImpl(ContestInput const &contestInput) { ContestResult result; uint64_t MAX_THREAD_COUNT = this->getSize(); uint64_t CONTEST_SIZE = contestInput...
ALGO
0.992993
4.530669
47dff2f2-034c-4ed2-b19a-0ba228fedaca
nissan259/last_os_project
OS_final-main/PipelineServer.cpp
#include <iostream> #include <thread> #include <queue> #include <mutex> #include <condition_variable> #include <sys/socket.h> #include <netinet/in.h> #include <unistd.h> #include <cstring> #include <sstream> #include <ve...
WEB
0.94793
5.057818
25bd3075-8bae-4c8d-9ddb-79f6e2fdefb6
aryan2404/Leetcode-Problems
206-reverse-linked-list/reverse-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: ListNode* reverseList...
ALGO
0.999906
5.769522
9109fedb-e5cd-446a-8771-f2c86195772f
21A91A04D0/leetcode
0645-set-mismatch/0645-set-mismatch.cpp
class Solution { public: vector<int> findErrorNums(vector<int>& nums) { int n = nums.size(); int sm = 0; for(int i = 0 ; i < n ; i++) { sm +=nums[i]; } int sm_n = (n * (n + 1)) / 2; map<int, int> mp; int rep = 0; for(auto it: nums) ...
ALGO
0.999794
5.419767
81b3977a-111f-4642-b50d-c67bccd18568
hieu03092004/CTDT_GT
ontapdanhsachlienket.cpp
#include <bits/stdc++.h> using namespace std; struct node{ int data; struct node*next; }; typedef struct node node; void duyet(node*head){ while(head!=NULL){ cout<<head->data<<" "; head=head->next; } } node *makeNode(int x){ node*newNode=(node*)malloc(sizeof(node)); // cu phap xin cap phat dong 1 not newNode...
ALGO
0.999949
4.131903
30f83080-01d2-4773-a687-29ecb5dd814e
ScalaDevelopers/Luka
src/uint256.cpp
#include "uint256.h" #include "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.size() != sizeof...
ALGO
0.906604
6.478078
6642433b-ff70-4647-80fe-f8a856d5739a
Y3U18/ollvm-poject
libc/src/math/generic/ilogbf.cpp
#include "src/math/ilogbf.h" #include "src/__support/FPUtil/ManipulationFunctions.h" #include "src/__support/common.h" namespace __llvm_libc { LLVM_LIBC_FUNCTION(int, ilogbf, (float x)) { return fputil::ilogb(x); } } // namespace __llvm_libc
ALGO
0.948211
5.298739
6cf5a801-d524-42c2-b439-e887ccf2d88c
jun1485/C_plus
C++/제네릭 함수(template).cpp
#include <iostream> using namespace std; class Circle { int radius; public: Circle(int radius = 1) { this->radius = radius; } int getRadius() { return radius; } }; template <class T> //제네릭 함수(templete) void myswap(T& a, T& b) { T tmp; tmp = a; a = b; b = tmp; } int main() { int a = 4, b = 5; myswap(a, ...
ALGO
0.998536
5.092471
fb4a5936-8d7f-4070-a9fa-cb644c0e50bd
calipos/colmapThird
RegisterImgGui/colString.cpp
#include "colString.h" #include <algorithm> #include <cstdarg> #include <fstream> #include <sstream> void StringAppendV(std::string* dst, const char* format, va_list ap) { // First try with a small fixed size buffer. static const int kFixedBufferSize = 1024; char fixed_buffer[kFixedBufferSize]; // It ...
TOOL
0.891117
6.343348
71860e72-8884-416d-b49c-fc3c43f3850e
How-u-doing/DataStructures
String/StringSorts/myStringSort_test.cpp
#include "myStringSort.h" #include <iostream> using namespace std; int main() { using namespace myStringSort; string a[13] = { "4PGC938", "2IYE230", "3CIO720", "1ICK750", "1OHV845", "4JZY524", "1ICK750", "3CIO720", "1OHV845", "1OHV845", "2RLA629", "2RLA629", ...
ALGO
0.998262
4.318846
a897a82a-8981-4fa9-88b5-1388fa346fc4
ishandutta2007/codeforces
dmitriy.belichenko/normal/894/B.cpp
#include <iostream> #include <vector> #include <string> #include <algorithm> #include <stack> #include <map> #include <unordered_map> #include <bitset> #include <complex> #include <complex> #include <cmath> #include <iomanip> #include <math.h> #include <cstring> #include <queue> #define mp make_pair #define pb push_bac...
ALGO
0.999993
4.061516
de4c54e6-0afb-4dc5-a452-fd361370976b
Bungmint/competitiveprogramming
contest/dmoj/yac6/C.cpp
using namespace std; #pragma region TEMPLATE using ll = long long; using vi = vector<int>; using pii = pair<int, int>; using vpi = vector<pii>; using pll = pair<ll, ll>; using vl = vector<ll>; using vpl = vector<pll>; using ld = long double; template <typename T, size_t SZ> using ar = array<T, SZ>; template <typename...
ALGO
0.999898
4.001193
3567aa50-2f6c-46ba-a6b8-24a51a93e937
GaisaiYuno/OI-Record-exe-deleted
Grade 10-12/2018 autumn/NOIP/NOIP2018提高组Day1程序包/GD-Senior/answers/GD-0646/track/track.cpp
#include<cstdio> using namespace std; struct e{ int t,nxt,v; }ed[100100]; int cnt=0,n,m; int h[50100],dep[50100]={0},dist[50100]={0},mxtr[50100]={0},f[50100]={0}; void addedge(int f,int t,int v) { ed[++cnt].t=t; ed[cnt].nxt=h[f]; ed[cnt].v=v; h[f]=cnt; } /*void dfs(int now,int fa) { dep[now]=dep[fa]+1; f[now][0]...
ALGO
0.999974
3.63725
844fb60e-e3f0-4876-9380-063fb72bb067
akashghadge/competitive-programming
CP-31/1300/01 D. Divisible Pairs.cpp
/* Notes ** ASCII of 'a'- 97,'z'- 123,'A'- 65,'Z'- 90,'0'- 48,'9'- 57 */ /*Basic Include */ #include <bits/stdc++.h> using namespace std; /* Policy Based Data Structures*/ #include <ext/pb_ds/assoc_container.hpp> #include <ext/pb_ds/tree_policy.hpp> using namespace __gnu_pbds; #define ordered_set tree<ll, null_type, ...
ALGO
0.999527
4.269413
6789bf1d-ea7c-4f1c-92e4-30a773ea8195
waiwai444/oj
uva/10812 - Beat the Spread!/10812.cpp
#include <cstdio> int main() { int tc, s, d, a, b; std::scanf("%d", &tc); while(tc--) { std::scanf("%d%d", &s, &d); if((s+d)&1) std::puts("impossible"); else { a = (s+d)/2; b = s-a; if(b < 0) std::puts("impo...
ALGO
0.999535
4.013961
494bf8c3-543c-4982-a52d-3c67aa252ea5
MuhadJasiR/cleverhire-rest-api
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.99887
6.783439
c84c64dc-361e-45da-8e99-9ebde870d402
CQUzst/Cpp
OpenCV/访问图像像素动态地址法.cpp
#include<opencv2/core/core.hpp> #include<opencv2/highgui/highgui.hpp> #include <iostream> using namespace cv; using namespace std; void colorreduce(Mat &inputImage, Mat &outputImage, int div)//color reduce { outputImage = inputImage.clone(); int rownumber = outputImage.rows; int colnumber = outputImage.cols; for (i...
TOOL
0.923161
3.819586
e75d1df0-a7ff-42b6-8bd5-4ca75da54638
adarsh1722/Daily-Problems
877-stone-game/877-stone-game.cpp
class Solution { public: bool stoneGame(vector<int>& piles) { sort(piles.rbegin() , piles.rend()); int alice = 0 , bob = 0; for(int i = 0 ; i < piles.size() ; i++){ if(i %2 == 0) alice += piles[i]; else bob += piles[i]; ...
ALGO
0.999979
5.198292
76919308-bd47-45ad-bd8a-a4fba91b877a
AkashBawa/programs
v1/binary_search_on_rotated_array.cpp
#include <iostream> using namespace std; int findPivot(int arr[], int n, int start, int end){ int mid = (end + start) / 2; if(arr[mid] > arr[mid - 1] && arr[mid] > arr[mid + 1]){ return mid; } else { if(arr[start] > arr[mid]){ // pivot present on left side return findPivot(arr, n, start, mid - 1); ...
ALGO
0.999968
5.5622
3f7a5d5e-2f6f-415e-a17c-5fb3a605b933
SwallowLee/OS
作業系統概論/hw6.cpp
# include<stdio.h> # include<vector> # include<string> # include<algorithm> # include<iostream> # include<map> using namespace std; int main(void) { FILE *text; int i, j, *place; long long int miss, hit, k, m; char ch, use[6]; fpos_t pos; string replace; vector<string> frame; vector<string>::iterator it, it3; ...
ALGO
0.95867
3.080338
8ab1e1aa-3eab-4f25-94c7-240c1e29a9fc
Agentsiddharth/car---rental-system
arrays,pointers,functions,reference/countwords.cpp
#include <iostream> using namespace std; int count(string s) { int count1 = 1; int n = s.length(); for (int i = 0; i < n; i++) { if (s[i] == ' ') { count1 += 1; } } return count1; } int main() { string s; getline(cin, s); cout << count(s); ret...
ALGO
0.984151
3.542515
8456e799-dbd9-4f65-85ae-d0cc93349b32
razibhasan7/Codechef-beginner-solution
C++/Snake and Ladder.cpp
/*************************** Programmer: Aanisha Mishra Answer is hidden in the question, the maximum length of RS will be when RS is the hypotenuse of the right triangle. The minimum length of RS will be when LS will be the hypotenuse. Hit your brain on this!! ***************************/ #include<bits/stdc++.h> using...
ALGO
0.999807
3.746215
d96fb98c-7122-4ba3-9687-f232f58e6ec8
ShreyanRay/ICPC-Camp-2024-Solutions
contest-1/e.cpp
#include <bits/stdc++.h> using namespace std; #define int long long #define INF (int)1e18 mt19937_64 RNG(chrono::steady_clock::now().time_since_epoch().count()); const int facN = 1e6 + 5; const int mod = 1e9 + 7; // 998244353 int ff[facN], iff[facN]; bool facinit = false; int power(int x, int y){ if (y == 0) ret...
ALGO
0.999659
5.210379
82e2b6a9-2d67-4b79-917c-d3b7c849d867
ParthJohri/LeetCodePractice
0057-insert-interval/0057-insert-interval.cpp
class Solution { public: vector<vector<int>> insert(vector<vector<int>>& intervals, vector<int>& newInterval) { vector<vector<int>> ans,nans; bool f = true; if(intervals.size()==0) return {newInterval}; for(int i=0;i<intervals.size();i++){ if(newInterval[1]<intervals[i][0...
ALGO
0.999988
6.082592
2f595f3b-7577-459a-b12f-2429d6b0431f
g-ch/PX4_MPC
src/modules/navigator/mission_feasibility_checker.cpp
/** * @file mission_feasibility_checker.cpp * Provides checks if mission is feasible given the navigation capabilities * * @author Lorenz Meier <<EMAIL>> * @author Thomas Gubler <<EMAIL>> * @author Sander Smeets <<EMAIL>> * @author Nuno Marques <<EMAIL>> */ #include "mission_feasibility_checker.h" #include "m...
TOOL
0.855109
7.041771
956e1264-1e89-47b8-9f69-b275220ac830
LIT2019046-HritikSoni/Hacktoberfest2022
DSA(C++ codes)/Casimir's_String_Solitaire.cpp
#include <bits/stdc++.h> using namespace std; #define int long long int #define mod 1000000007 #define fast ios::sync_with_stdio(0);cin.tie(0);cout.tie(0); #define vi vector <int> #define pii pair< int ,int > #define all(v) v.begin(),v.end() #define PB push_back #define MP make_pair #define ...
ALGO
0.999844
4.645272
f80d0e33-1ec8-4af4-ad2a-9e244a07a472
fraterrisus/sgt-unruly-solver
cpp/board.cpp
#include <algorithm> #include <vector> #include "board.h" #define USE_HEURISTICS Board::Board() { this->board = 0; this->height = 0; this->width = 0; } Board::Board(int dim) { int size = dim * dim; this->height = dim; this->width = dim; this->board = new Square[size]; } Board::Board(int x, int y) { ...
ALGO
0.99865
5.725226
2800d257-8bec-4460-a764-b28f9d77fcf4
Yash-Raj-Singh/2nd_sem_oops_files
bits_to_change_a_to_b.cpp
#include <iostream> using namespace std; int number_of_bit(int n) { int count = 0; while(n != 0) { n = (n & (n-1)); count++; } return count++; } int xorOP(int a, int b) { int c = a^b; return number_of_bit(c); } int main() { int a, b; cin>>a>>b; cout<<xorOP(...
ALGO
0.999961
4.231438
e4246683-49b3-4adb-95a0-3d8ce2fb4597
Wisc-HCI/authr
authr_pddl/paradiseo/deprecated/eo/contrib/mathsym/test/test_simplify.cpp
#include <FunDef.h> using namespace std; int main() { Sym c1 = SymConst(0.4); Sym c2 = SymConst(0.3); Sym v1 = SymVar(0); Sym expr = (c1 + c2) * ( (c1 + c2) * v1); cout << expr << endl; cout << simplify(expr) << endl; Sym dv = differentiate( exp(expr) , v1.token()); cout <...
ALGO
0.963793
4.638806
2ed24dc7-8485-4d11-8def-4a5ec59a49b6
ZeeJoww/SCL4ICPC
Data-Structure/code/BST/Splay.cpp
#include <iostream> #include <algorithm> const static int maxn = 5e5 + 10, inf = 1e9; struct Node { int val, lsum, rsum, mxsum, sum, ch[2], p, sz; bool rev, same; Node () {} Node (int v, int p) : val(v), mxsum(v), sum(v), p(p), sz(1), rev(false), same(false) { ch[0] = ch[1] = 0; lsum =...
ALGO
0.999901
4.88773