uuid string | repo_name string | relative_path string | content string | category string | algo_rel_score float64 | quality_score float64 |
|---|---|---|---|---|---|---|
a668685d-7110-4c96-8e3f-4c16117db799 | Rajankumar9955/CPP-DSA | Tree/BST.cpp | #include<iostream>
using namespace std;
class node{
public: int data;
class node *l,*r;
node(int d){
data=d;
l=NULL;
r=NULL;
}
};
node *bst(node *root,int v)
{
if(root==NULL)
{
return new node(v);
}
if(v<root->data)
{
root->l=bst(root->l,v);
... | ALGO | 0.999923 | 4.146993 |
2d6a4415-23d1-4de5-afdd-84712828255a | Metrological/cobalt | src/third_party/llvm-project/llvm/lib/CodeGen/SafeStack.cpp | #include "SafeStackColoring.h"
#include "SafeStackLayout.h"
#include "llvm/ADT/APInt.h"
#include "llvm/ADT/ArrayRef.h"
#include "llvm/ADT/SmallPtrSet.h"
#include "llvm/ADT/SmallVector.h"
#include "llvm/ADT/Statistic.h"
#include "llvm/Analysis/AssumptionCache.h"
#include "llvm/Analysis/BranchProbabilityInfo.h"
#include ... | TOOL | 0.943924 | 3.384649 |
76c6c4ea-47d4-4d46-8b8e-70d35db2669a | kai-wei-kfuse/daily-code | 2022/202210/20221010/acwing1016.cpp | #include <bits/stdc++.h>
using namespace std;
int main() {
int n;
cin >> n;
vector<int> ve(n + 1);
vector<int> q(n + 1), sum(n + 1);
for (int i = 1; i <= n; i++) {
cin >> ve[i];
sum[i] = ve[i];
q[i] = 1;
}
int len = 0, ans = 0;
for (int i = 1; i <= n; i++) {
... | ALGO | 0.99996 | 4.008036 |
df053bbd-9bfc-4594-a86a-4fae6d736f4a | redscientistlabs/PPSSPP52X-Vanguard | Core/MIPS/RiscV/RiscVCompFPU.cpp | // Official git repository and contact information can be found at
// https://github.com/hrydgard/ppsspp and http://www.ppsspp.org/.
#include "Core/MIPS/RiscV/RiscVJit.h"
#include "Core/MIPS/RiscV/RiscVRegCache.h"
// This file contains compilation for floating point related instructions.
//
// All functions should ha... | ALGO | 0.972522 | 6.114419 |
3472d468-36f4-4cbb-8aa4-cd6e61726b84 | ravigod22/CompetitiveProgrammingUNI | Codeforces/1991/c2.cpp | #include <bits/stdc++.h>
using namespace std;
int main() {
ios_base::sync_with_stdio(false);
cin.tie(nullptr);
int tt; cin >> tt;
while (tt--) {
int n; cin >> n;
vector<long long> a(n);
for (auto& e : a) cin >> e;
int cnt = 0;
for (int i = 0; i < n; ++i) if (a[i]... | ALGO | 0.998624 | 4.362255 |
1ec739dc-2d3f-4ffa-b110-75c68364286c | shbhmexe/Code-Chef-Sol | 500 - 1000/CheflandGames.cpp | //Question 38
#include <bits/stdc++.h>
using namespace std;
int main() {
int T;
cin >> T;
while (T--) {
int R1, R2, R3, R4;
cin >> R1 >> R2 >> R3 >> R4;
if (R1 == 0 && R2 == 0 && R3 == 0 && R4 == 0)
cout << "IN\n";
else
cout << "OUT\n";
}
retu... | ALGO | 0.981826 | 3.71755 |
3ad81acd-7aee-4db7-96c5-fcb3e5fe336c | lonnewolf120/DS_Algo | Graph Theory, DSU, Trees/MCC/4/d.cpp | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef long double ld;
ll MOD = 998244353;
double eps = 1e-12;
#define forn(i,e) for(ll i = 0; i < e; i++)
#define forsn(i,s,e) for(ll i = s; i <= e; i++)
#define rforn(i,s) for(ll i = s; i >= 0; i--)
#define rforsn(i,s,e) for(ll i = s; i >= e... | ALGO | 0.999943 | 4.93926 |
fcaf1678-6651-4e73-b803-56d5420f7599 | vikashChouhan/CP | checkingAngramUsingXor.cpp | #include<bits/stdc++.h>
using namespace std;
int main()
{
//anagram
// s1.size == s2.size
// cnt of each element in both string must be same
//won't work aa bb as anagram
string s1,s2;
cin>>s1>>s2;
int ans = 0;
if(s1.length()!=s2.length())
cout<<"Not anagram";
else
for(int i=0;i<s1.length();i++)
an... | ALGO | 0.999989 | 3.799942 |
37414968-c8aa-4b8d-99ca-b91cfad0dce1 | wannabetolkien/LeetCode | Danish_National_Sort.cpp | // QUESTION - Danish National Flag Sorting ( Sort 0,1,2)
/*
Given an array nums with n objects colored red, white, or blue,sort them in-place so that objects of
the same color are adjacent,with the colors in the order red, white, and blue.We will use the integers
0,1 and2 to represent the color red, white, and blu... | ALGO | 0.999831 | 4.907674 |
14c93ae5-9174-4c4f-9985-55d30d0ba937 | GarrisonSoftware/Assignments_C | Assignment/Poly.cpp | /*Clay Garrison
CSCI 1010
Section 001
Assignment 8-2
Create a function to calculate the value of a polynomial with a value given by the user.*/
#include<iostream>
using namespace std;
//Function to calculate the value of the polynomial.
double poly(double x)
{
double value ;
value = (3 * x * x * x * x * x) + ... | ALGO | 0.997333 | 4.605138 |
3c328388-5e9b-4601-b6b0-849ac78d9ab5 | mario-dnlm/leetcode_exercises | challenge2021/june/23-Reverse-Linked-List-II.cpp | #include <iostream>
#include <vector>
using namespace std;
/**
* 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) {}... | ALGO | 0.999981 | 5.32118 |
9a3ef75c-957d-47cd-8e02-0fcd26dfc0d4 | realVibhorGupta/CplusplusBasics2 | Series4/src/Series4.cpp | /*
* Series4.cpp
*
* Created on: Jan 30, 2016
* Author: vibhor
*/
#include<iostream>
using namespace std;
int main()
{
int n;
int j;
cout<<"enter the number: ";
cin>>n;
for(int i=1;i<=n;i++){
j= i * i;
cout<<j<<endl;
}
}
| ALGO | 0.991173 | 3.888898 |
7ea1678f-a0ef-4ac0-a626-0f7db608f90f | FarhanYorah/Branding-MobileApp | 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 |
e1c885b8-ba9e-4241-98bd-613626d2386c | sky8c9/Prac | AtCoder/ABC/259/E.cpp | #include <iostream>
#include <vector>
#include <map>
#include <algorithm>
using namespace std;
void task() {
int n;
cin >> n;
vector<vector<pair<int, int>>> nums(n);
map<int, int> mx;
for(int i = 0; i < n; i++) {
int m;
cin >> m;
for(int j = 0; j < m; j++) {
int p,e;
cin >> p >> e;
nums[i].empla... | ALGO | 0.999297 | 3.911559 |
9b8b7f76-2704-452d-8e15-d2cfe5f604f3 | RaresRacsan/LeetCode-Solutions | Top 150 interview/h-index.cpp | class Solution {
public:
int hIndex(vector<int>& citations) {
int v[1001] = {0};
for(int i = 0; i < citations.size(); i++){
v[citations[i]]++;
}
int nr = 0;
for(int i = 1000; i >= 1; i--){
if(v[i] != 0){
nr += v[i];
}
... | ALGO | 0.999968 | 6.262232 |
9207dd33-d865-4cf0-8525-987e42a31b59 | salsaman/LiVES | lives-plugins/weed-plugins/farneback_analyser.cpp | // farneback_analyser.cpp
// weed plugin
// (c) G. Finch (salsaman) 2012
//
// Computes a dense optical flow using the Gunnar Farneback’s algorithm.
// calculates array flow, s.t.:
// prevImg(y,x) = nextImg( y + flow(y,x)[0], x + flow(y,x)[1] )
// input is nextImg : this is cached in memory to provide prevImg for the... | ALGO | 0.999061 | 6.824268 |
6d2998fb-9e21-4dfb-86cd-d0d095aef5f3 | DrZhang818/my-first-project | Problems/LeetCode/C459/A.cpp | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef double db;
typedef pair<int,int> PII;
typedef unsigned long long ull;
const int inf = 1000000000;
class Solution {
public:
bool checkDivisibility(int n) {
int a = 0, b = 1, x = n;
while(x) {
int pop = x % 10;
... | ALGO | 0.999599 | 4.723409 |
22995ed0-a4e4-4980-b273-19f2e6e13832 | dev-sabbir/SolvedProblems | accepted/10235.cpp | #include<stdio.h>
#include<math.h>
#include<string.h>
int prime[10000010];
int isPrime(int n)
{
int i,flag=1;
if(n==1)return 0;
else if(n==2||n==3)
{
return 1;
}
else
{
for(i=2;i<=sqrt(n)+1;i++)
{
if(n%i==0){flag=0;}
}
if(flag==0)return 0... | ALGO | 0.999941 | 3.426543 |
3686d967-86c4-4d9f-b0e0-7c93e3cb869d | Peterschuellermann/Model-Predictive-Control | src/Eigen-3.3/doc/examples/TutorialLinAlgSelfAdjointEigenSolver.cpp | #include <iostream>
#include <Eigen/Dense>
using namespace std;
using namespace Eigen;
int main()
{
Matrix2f A;
A << 1, 2, 2, 3;
cout << "Here is the matrix A:\n" << A << endl;
SelfAdjointEigenSolver<Matrix2f> eigensolver(A);
if (eigensolver.info() != Success) abort();
cout << "The eigenvalues of A ... | ALGO | 0.99907 | 3.846247 |
64b3609f-b137-4377-8aaf-3e408ac75330 | starswap/CompetitiveProgramming | CodeForces/1739/C.cpp | #include <bits/stdc++.h>
using namespace std;
const long long MOD = 998244353;
long long choose(long long n, long long r) {
// n! (n-1)! * n n
// ------- = ------------------- = ----- * (n-1) C r
// r!(n-r!) = r! (n-1-r)! * (n-r) n - r
//
if (n == r) {return 1;}
el... | ALGO | 0.999796 | 4.562326 |
a922d8c9-b891-4485-b6ae-e57cd248e25b | NaguleshN/CPP-practice | classObj/ocurrence.cpp | // You are using GCC
#include<iostream>
#include<string>
using namespace std;
class Occurrence{
string word;
public:
void setString(string s){
word=s;
}
void getOccurence(char ch){
int len = word.length();
int count=0;
for(int i=0; i<len;i++){
... | ALGO | 0.999717 | 4.056336 |
e59afccf-b088-4768-b4cf-128618f31839 | umaidansari12/CP_Backup | 23_searching_and_sorting/fetch_items_to_display_2.cpp | #include<bits/stdc++.h>
using namespace std;
class Solution {
public:
// static const int param = 0, order = 0;
static bool compareTo( const pair<pair<string, string>, pair<int, int>> &a, const pair<pair<string, string>, pair<int, int>> &b ) {
bool res;
string paramOrder = a.first.second;
int param = paramOrder[... | ALGO | 0.999543 | 4.695649 |
6fc46849-6b46-417f-91d7-4b5777098379 | devjeanfraga/challenges-C- | challenge-auto-estrada.cpp | #include <iostream>
using namespace std;
int main() {
// Escreva seu cdigo aqui
unsigned long int n, result = 0; // 0 a (2.147.483.648 + 2.147.483.647) = 4.294.967.295 | signed = -2.147.483.648 a 2.147.483.647 4bytes
string blockList;
cin >> n >> blockList;
for (int j = 0; j < n; j++) {
char block ... | ALGO | 0.998618 | 3.746023 |
e53a00e5-2c9c-40b6-bed2-b964d47923a1 | mostafa-cse/Most-Used-Templates-from-Various-Sources | Miscellaneous/Logarithmic Subarray Aggregator.cpp | #include<bits/stdc++.h>
using namespace std;
const int N = 1e5 + 9;
int a[N];
int32_t main() {
ios_base::sync_with_stdio(0);
cin.tie(0);
int n; cin >> n;
for (int i = 1; i <= n; i++) {
cin >> a[i];
}
vector<pair<int, int>> v; // stores the number of times a subarray gcd occurs ending at each index
m... | ALGO | 0.999873 | 4.108536 |
9413a270-ef39-4858-8891-544e3a1d2ae6 | orijoon98/Algorithm_Study | C++/sw/SW_부서진타일_12052.cpp | #include <bits/stdc++.h>
using namespace std;
#define endl '\n'
int T, N, M;
char board[50][50];
int dx[4] = {0, 0, 1, 1};
int dy[4] = {0, 1, 1, 0};
void Track(int x, int y, char c){
if(x == N && y == M) return;
if(c == '.'){
if(x+1 == N && y+1 == M) return Track(x+1, y+1, '\0');
else if(y+1 ... | ALGO | 0.999867 | 4.41852 |
00ae6f8d-40df-4bae-ac32-a1b6f1058ae0 | MDOBAIDULLAHalmahdy/XPSC | Week 17/Day 4/W_11_D_378QAQ_and_Mochas_Array.cpp | #include<bits/stdc++.h>
#define ll long long int
#define endl "\n"
using namespace std;
int main()
{
ll t;
cin >> t;
while(t--)
{
ll n; cin >> n;
ll a[n];for(int i = 0 ;i<n;i++)cin >> a[i];
sort(a , a+n);
ll fi = a[0];ll se = 1e9+1;
bool f = 1;
... | ALGO | 0.999728 | 4.017307 |
c48a84c0-43eb-4f18-a4ca-bbd83cfd1388 | MahinAshraful/CodeWatch_Data | sample-data/p00009/s027840390.cpp | #include <bits/stdc++.h>
using namespace std;
const int MAX = 1000100;
bool prime[MAX];
void sieve(){
fill(prime, prime+MAX, true);
prime[0] = prime[1] = false;
for(int i=2; i*i < MAX; i++){
if(!prime[i]) continue;
for(int j=i*i; j < MAX; j += i) prime[j] = false;
}
}
int main(){
sieve();
int n;
while(c... | ALGO | 0.999476 | 4.336163 |
66ee4875-21ff-4390-862c-d34f6576135c | ishandutta2007/codeforces | pikel_rik/normal/687/C.cpp | #include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#define all(x) (x).begin(), (x).end()
using namespace __gnu_pbds;
using namespace std;
using ull = unsigned long long;
using ll = long long;
template <typename T> using ordered_set = tree<T, null_type, less<>, rb_tree_tag, tree_order_statistics_node_up... | ALGO | 0.999992 | 3.492621 |
069bb332-0fde-4c6e-8a52-d4d4da1e9182 | njustzsm/leetCode | 94. Binary Tree Inorder Traversal/源.cpp | #include<iostream>
#include<vector>
using namespace std;
struct TreeNode {
int val;
TreeNode *left;
TreeNode *right;
TreeNode(int x) : val(x), left(NULL), right(NULL) {}
};
vector<int>result;
void Recursion(TreeNode*curNode)
{
if (curNode->left != NULL)
Recursion(curNode->left);
result.push_back(curNode-... | ALGO | 0.999894 | 4.989522 |
9000b917-31ae-4675-a87d-cb729553c4f1 | pay-of-hope/C | MaxSubArray2.cpp | #include<iostream>
#include<ctime>
using namespace std;
int main()
{
long long t_1 = clock();
int arr[] = {13,-3,-25,20,-3,-16,-23,18,20,-7,13,-5,-22,15,-4,7};
int dp[16]={0};
int e;
for(int i = 0; i <= 15; i++)
{
if(i==0)
{
dp[i] = arr[i];
e = i;
}
else
{
if(arr[i] < ... | ALGO | 0.999993 | 3.854956 |
4a4d1675-49e4-48be-a8c1-f6a17cdeb3ec | KayaiJia/snake | gameover.cpp | #include <stdio.h>
#include "head.h"
#include <stdlib.h>
extern int endcode;
extern int score;
extern int HighScore;
void gameover(void) {
system("cls");
if (endcode == 1) {
Lostdraw();
gotoxy(35, 9);
color(12);
printf("ײǽˣϷ!");
}
else if (endcode == 2) {
Lostdraw();
gotoxy(35, 9);
color(12);
prin... | TOOL | 0.875916 | 3.249098 |
62f834ac-47f1-4c26-b65c-3c0c113bacea | chakitg/cp_solutions | gfg-potd/Mobile numeric keypad.cpp | There is a standard numeric keypad on a mobile phone. You can only press the current button or buttons that are directly up, left, right, or down from it (for ex if you press 5, then pressing 2, 4, 6 & 8 are allowed). Diagonal movements and pressing the bottom row corner buttons (* and #) are prohibited.
Given a numbe... | ALGO | 0.999692 | 6.996251 |
37caf76f-d557-4a1a-a26b-8659ae1b4b95 | largetalk/leetcode | 042_trap_rain_water.cpp | /*
* Given n non-negative integers representing an elevation map where the width of each bar is 1, compute how much water it is able to trap after raining.
*
* Example:
*
* Input: [0,1,0,2,1,0,1,3,2,1,2,1]
* Output: 6
*/
#include <stdio.h>
#include <iostream>
#include <algorithm>
#include <unordered_map>
#inclu... | ALGO | 0.999977 | 7.135155 |
3aceda86-7777-4a04-8905-e49fa88a0e6d | Han8464/PTA-code | 1128/1128/1128solution.cpp | #include <cstdio>
#include <cstdlib>
#include <string>
#include <map>
#include <set>
#include <iostream>
using namespace std;
int main()
{
int k;
string result[250];
scanf("%d", &k);
for(int i = 0; i < k; i++)
{
set<int> set_q;
int q[1012];
int n;
scanf("%d", &n);
int flag = 0;
for(int j = 1; j <= n; ... | ALGO | 0.99997 | 3.567852 |
a437b556-d42a-4a87-bea1-f94500f50269 | mohithnd/dsa_in_cpp | rohitnegi/queues/05_queue_reversal.cpp | #include <iostream>
#include <vector>
#include <stack>
#include <queue>
using namespace std;
void print(queue<int> q)
{
if (q.empty())
{
cout << "Queue Is Empty" << endl;
return;
}
while (!q.empty())
{
cout << q.front() << " ";
q.pop();
}
cout << endl;
}
voi... | ALGO | 0.998292 | 4.506568 |
8851746b-ad87-4aa9-820f-8e2915ba8635 | kushuu/competitive_programming_all | leetCode/reverse-integer/Accepted/5-29-2020, 11_30_09 PM/Solution.cpp | // https://leetcode.com/problems/reverse-integer
class Solution {
public:
int reverse(int x) {
int rev = 0;
while (x != 0) {
int pop = x % 10;
x /= 10;
if (rev > INT_MAX/10 || (rev == INT_MAX / 10 && pop > 7)) return 0;
if (rev < INT_MIN/10 || (rev ==... | ALGO | 0.999945 | 6.207248 |
e996315f-f5af-44ca-8c68-a67e99e83868 | 218001605/cpp | swapArray.cpp | #include <iostream>
#include <array>
#include <string>
using namespace std;
void swap(int* array1,int array1size, int* array2,int array2size){
int temp=0;
if(array1size==array2size){
for(int i=0;i<array1size;i++){
temp=array1[i];
array1[i]=array2[i];
a... | ALGO | 0.999663 | 4.333652 |
ddd9948c-5dd8-44cb-86a0-b5c7e976e810 | pawanbgs0/OOPs | Array/array_m.cpp | #include "array.h"
int main()
{
int size_array;
cout << "Give the size of Array: ";
cin >> size_array;
Array (a1size_array);
Array a2(size_array);
Array res(size_array);
cin >> a1;
cout << "A1 INPUT OVER" << endl;
cin >> a2;
cout << "A2 INTPUT OVER" << endl;
res = a1 + a... | TOOL | 0.972901 | 3.616933 |
0260c93a-c853-4562-aee0-e292f3595d84 | nitinkaplas123/DSA-Daily | Level_1/Bit_Magic/11)subset_78.cpp | Solution 1-:
Diagram -:
Notebook 1 page 38
Solution 1-:
Steps-:
1)using recusrion
2)Two recusrive function
1st is for not included
2nd is for included
Code-:
void helper(vector<int>nums,int index,vector<int>v1,vector<vector<int>>&v)
{
if(index==nums.size())
{
v.push_back(v1);
... | ALGO | 0.999961 | 6.489989 |
46485b0d-c896-46f0-9e74-75d805beddb9 | Mattus02/Kattis | 4.0_ballotboxes.cpp | // Problem: https://open.kattis.com/problems/ballotboxes
#include <iostream>
#include <queue>
using namespace std;
struct City {
int population;
int ballots;
};
bool operator<(City a, City b) {
return (double)a.population / a.ballots < (double)b.population / b.ballots;
}
int main() {
int N, B;
... | ALGO | 0.999746 | 4.639739 |
675d377a-00a1-497a-b54c-813e056a5b08 | bytedance/terark-zip | 3rdparty/boost-include/libs/math/tools/generate_rational_test.cpp | #define BOOST_MATH_POLY_METHOD 0
#define BOOST_MATH_RATIONAL_METHOD 0
#include <boost/random.hpp>
#include <boost/math/tools/rational.hpp>
#include <iostream>
#include <fstream>
#include "mp_t.hpp"
int main()
{
using namespace boost::math;
using namespace boost::math::tools;
static const unsigned max_order ... | TEST | 0.969533 | 5.052736 |
c2e9bcc9-f9f9-4337-8f1b-55b046fe43a0 | Yue-0/SF-Tracker | src/sf_tracker/src/costmap.cpp | /* @author: YueLin */
#include <cmath>
#include <tf/tf.h>
#include <ros/ros.h>
#include <tf/transform_listener.h>
#include "sensor_msgs/LaserScan.h"
#include "nav_msgs/OccupancyGrid.h"
#include "std_msgs/Float32MultiArray.h"
#include "utils/bfs.hpp"
#define ROS_INIT(node) ros::init(argc, argv, node)
#define swap(... | TOOL | 0.987525 | 4.419421 |
03d16dd5-ca68-4bad-a0d0-4bb8add99193 | neutrinoxtronicmaster/hello-algo | en/codes/cpp/chapter_sorting/bucket_sort.cpp | /**
* File: bucket_sort.cpp
* Created Time: 2023-03-30
* Author: krahets (<EMAIL>)
*/
#include "../utils/common.hpp"
/* Bucket sort */
void bucketSort(vector<float> &nums) {
// Initialize k = n/2 buckets, expected to allocate 2 elements per bucket
int k = nums.size() / 2;
vector<vector<float>> buckets... | ALGO | 0.999905 | 5.984838 |
23a4a9dd-8eef-4ff6-b9f9-59e2840f4fb7 | AnamayNarkar/Leetcode | 2929.Distribute_Candies_Among_Children_II.cpp | class Solution {
public:
long long distributeCandies(int n, int limit) {
long long finalAns = 0;
for (int i = 0; i <= min(limit, n); i++) {
if (n - i > 2 * limit) {
continue;
}
int remaining = n - i;
int minToGiveToSecondGuy = max(0, re... | ALGO | 0.999992 | 5.383964 |
ac3fe934-f89c-49fb-b662-a7737828cb06 | Prachi04Sharma/5th-Training | 150leetcode.cpp | //leetcode : 141 linked list cycle
#include <iostream>
using namespace std;
// 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) {}
};
... | ALGO | 0.999826 | 6.421143 |
82282242-c38f-4376-b4a0-0490a55f0357 | arata8492/test | ES Game Library 2016/ES Game Library 2016/ES Game Library/SDK/Physics/Box2D/include/Box2D/Dynamics/Contacts/b2ChainAndCircleContact.cpp | #include <Box2D/Dynamics/Contacts/b2ChainAndCircleContact.h>
#include <Box2D/Common/b2BlockAllocator.h>
#include <Box2D/Dynamics/b2Fixture.h>
#include <Box2D/Collision/Shapes/b2ChainShape.h>
#include <Box2D/Collision/Shapes/b2EdgeShape.h>
#include <new>
b2Contact* b2ChainAndCircleContact::Create(b2Fixture* fixtureA, ... | ALGO | 0.987147 | 6.49728 |
b29f432b-1763-4721-ac8a-a4f6bfadaad4 | ADITYA-0208/Leetcode-er | 2161-partition-array-according-to-given-pivot/2161-partition-array-according-to-given-pivot.cpp | class Solution {
public:
vector<int> pivotArray(vector<int>& nums, int pivot) {
int low = 0, mid = 0;
for (int num : nums) {
if (num < pivot) low++;
else if (num == pivot) mid++;
}
int h = low + mid;
mid = low;
int l = 0;
vect... | ALGO | 0.999978 | 6.30109 |
c0d5964b-8d95-4a36-87c9-f79b49d2aae5 | rylahs/Algorithm-2024- | BOJ/24.02/24.02.19/1012.cpp | #include <bits/stdc++.h>
using namespace std;
#define X first
#define Y second
int board[52][52];
bool isvisited[52][52];
int dy[4] = { -1, 0, 1, 0 };
int dx[4] = { 0, -1, 0, 1 };
int main(void)
{
ios::sync_with_stdio(false);
cin.tie(nullptr);
int testCase;
cin >> testCase;
while (testCase--)
{
int m, n,... | ALGO | 0.999919 | 3.938519 |
ab728945-866c-42b8-903f-d4e2947b4c19 | SaurabhKumar171/data_structure_and_algorithms | Arrays/DSA_sheet/Matrix/1_Spiral_traverse_on_matrix.cpp | #include <iostream>
#include <limits.h>
#include <vector>
using namespace std;
vector<int> spiralOrder(vector<vector<int>> &matrix) {
if (matrix.empty())
return {};
int top = 0;
int left = 0;
int bottom = matrix.size() - 1;
int right = matrix[0].size() - 1;
int count = 0;
int total_elements = matr... | ALGO | 0.999934 | 5.290808 |
473b42a0-96ba-44b2-b986-4cc95037aa00 | DXrew98/First-School-Ex. | Project1/Source2.cpp | #include<iostream>
#include<climits>
#include <ctime>
int main_exercise_arrays() {
/*
int data[10]{ 10,9,8,7,6,5,4,3,2,1 };
for (int i = 0; i < 10; i++)
std::cout << data[i] << std::endl;
system("pause");
*/
/*
std::cout << "Please input 5 numbers" << std::endl;
int numbers[5];
std::cin >> numbers[4] >... | TOOL | 0.927251 | 3.392628 |
5386b184-37e1-4659-94f7-b8e4a09d54e2 | rishabh9260/My-Practice-Programs-And-Projects | C++ Projects/Data Structures/QueueUsingStack.cpp | #include<bits/stdc++.h>
using namespace std;
void insert(stack<int> &p, stack<int> &s)
{
int x;
cout<<"\nEnter the element: ";
cin>>x;
p.push(x);
}
void deleteElement(stack<int> &p, stack<int> &s)
{
if(p.empty())
{
cout<<"Underflow!!";
}
else
{
while(!p.empty())
... | ALGO | 0.959777 | 4.107973 |
bdb2c214-701c-49d2-9db2-d48c3b860c7b | spfantasy/LeetCode | 190_Reverse_Bits/190.cpp | #include <vector>
#include <string>
#include <bitset>
#include <cctype> //char
#include <sstream> //std::istringstream
#include <unordered_map>
#include <unordered_set>
#include <iostream> //std::cin,std::cout
#include <unordered_map>
using namespace std;
class Solution {
public:
uint32_t reverseBits(uint3... | ALGO | 0.999954 | 4.944768 |
fcbfc5ba-00f3-4b5f-81ca-050cf7e56686 | FineArtz/SJTUOJ | Dijkstra.cpp | /* Dijkstra */
#include <iostream>
#include <cstring>
using namespace std;
const int INF = 10000;
int a[100][100];
int dist[100], pr[100];
int n, m, st;
void dijkstra(int st){
bool v[100];
memset(v, 0, sizeof(v));
for (int i = 1; i <= n; ++i){
dist[i] = a[st][i];
if (dist[i] == INF) pr[i]... | ALGO | 0.999956 | 4.10464 |
6a0f2ac7-8df2-44f5-b9e8-28495651a8c9 | Sakib577/CPP_Programming | DSA/String_basic/Replacement.cpp | #include <iostream>
using namespace std;
int pMatch(string T, string P){
int TLen=T.length();
int PLen=P.length();
for (int i = 0; i <= TLen-PLen; i++)
{
for (int j = 0; j < PLen; j++)
{
if(P[j] != T[i+j]){
break;
} else if (j == PLen-1)
... | ALGO | 0.999236 | 4.553772 |
126520f0-f7cf-4400-b492-17727eda530f | wownero/wownero | src/blockchain_utilities/blockchain_prune_known_spent_data.cpp | #include <boost/algorithm/string.hpp>
#include "common/command_line.h"
#include "serialization/crypto.h"
#include "cryptonote_core/tx_pool.h"
#include "cryptonote_core/cryptonote_core.h"
#include "cryptonote_core/blockchain.h"
#include "blockchain_db/blockchain_db.h"
#include "version.h"
#undef MONERO_DEFAULT_LOG_CATE... | TOOL | 0.954911 | 6.803562 |
c4a46b88-de60-4d88-ad94-4c1fceec2311 | Feroz455/Fundamentals-Of-Computer-Algorithms | Chapter_01/Algorithm/Algorithm_1-28.cpp | /*
Page 72
Prime0(n, a)
// Returns true if n is a prime and false otherwise.
// a is the probability parameter.
{
q:= n - 1;
for i :=1 to large do // Specify large.
m := 9; y := 1; a := Random() mod q + 1;
// Choose a random number in the range [1, n – 1].
z := a;
// Compute a^n-1 mod n.
wh... | ALGO | 0.999687 | 5.379791 |
920e9aa5-0f5b-4571-b313-ca23e0dc228d | aex-tmp/platform_packages_apps_AEXOTA | jni/boost_1_57_0/libs/math/tools/bessel_derivative_append_negative.cpp | #include <fstream>
#include <utility>
#include <functional>
#include <map>
#include <vector>
#include <iterator>
#include <algorithm>
#include <boost/multiprecision/mpfr.hpp>
#include <boost/program_options.hpp>
#include <boost/lexical_cast.hpp>
#include <boost/math/special_functions/bessel.hpp>
template <class T>
T... | TOOL | 0.860391 | 6.166668 |
63a29673-1d45-401a-a44d-b96f611fbadf | timot3/ECE522-Speculative-Coherence | GEM5Simulation/gem5/src/systemc/tests/systemc/misc/unit/data/general/add_promote/datawidth.cpp | /*****************************************************************************
datawidth.cpp --
Original Author: Martin Janssen, Synopsys, Inc., 2002-02-15
*****************************************************************************/
/**************************************************************************... | ALGO | 0.95367 | 5.691682 |
ca542ae9-38e2-483c-8726-d862dc5fdc3a | 8secz-johndpope/godot-gravar | thirdparty/squish/rangefit.cpp | #include "rangefit.h"
#include "colourset.h"
#include "colourblock.h"
#include <cfloat>
namespace squish {
RangeFit::RangeFit( ColourSet const* colours, int flags, float* metric )
: ColourFit( colours, flags )
{
// initialise the metric (old perceptual = 0.2126f, 0.7152f, 0.0722f)
if( metric )
m_met... | ALGO | 0.921923 | 7.034783 |
2d9be666-ce71-4c78-af97-bcfd976b1899 | yinhaijing123/offer | leetcode/125 验证回文串/isPalindrome.cpp | /*************************************************************************************************************************
问题描述:给定一个字符串,验证它是否是回文串,只考虑字母和数字字符,可以忽略字母的大小写。
思路分析:分别从前和从后遍历字符串。找到字符/数字字符比较。
注意:字母不区分大小写
*******************************************************************************************************... | ALGO | 0.999858 | 4.837085 |
23d6c095-ff25-47cb-b855-d8846e1f7467 | MohammedTanner/SHA-256-FPGA-Hardware-vs-Software-Implementation | shatest.cpp | #include <iostream>
#include <fstream>
#include <hls_stream.h>
#include <hls_vector.h>
#include "ap_axi_sdata.h"
#include "sha256.h"
using namespace std;
#define N 64
int main() {
hls::stream< ap_axiu<32,2,5,6> > stateREG;
hls::stream< ap_axiu<8,2,5,6> > idata;
hls::stream< ap_axiu<8,2,5,6> > ohash;
... | ALGO | 0.996498 | 5.853401 |
df9f3a08-a5dd-4373-b10d-dcb980324d14 | swimmingturtle165/Codeforces-Submissions--Ordered | codeforces/1234/D.cpp | #include<bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
using namespace std;
using namespace __gnu_pbds;
typedef unsigned long long int ull;
typedef long long int ll;
typedef long double ld;
typedef pair<ll,ll> pll;
#define FOR(i,a,b) ... | ALGO | 0.999786 | 4.617432 |
41431fde-3f06-4d1f-aef9-06645b895d0d | rubabaa499/Algorithm | alo.cpp | #include<iostream>
using namespace std;
void printArr(int arr[],int n)
{
for(int k=0 ; k < n ;k++)
{
cout<<" "<< arr[k]<<" ";
}
cout<<endl;
}
void insertion(int arr[],int n)
{
for(int i=1; i<n ;i++)
{
int temp=arr[i];
int j=i-1;
while(j >= 0 && arr[j]> temp)
... | ALGO | 0.999898 | 4.916956 |
954effd9-6fd0-4d90-838b-5a6a4a51872a | abhiram4580/DSA_CODE_BABBAR | stack/longest_balanced_paranthesis.cpp | #include<iostream>
#include<bits/stdc++.h>
using namespace std;
int findMaxLen(string s) {
// code here
int ans=0;
stack<int>st;
st.push(-1);
for(int i=0;i<s.length();i++){
if(s[i]=='('){
st.push(i);
}
else{
... | ALGO | 0.997696 | 4.51932 |
48b0e34d-588d-48d1-8b20-03a16c8cd7d1 | ehnryx/acm | ucf-01jun2019/equilateral.cpp | #include <bits/stdc++.h>
using namespace std;
#define _USE_MATH_DEFINES
#define For(i,n) for (int i=0; i<n; i++)
#define FOR(i,a,b) for (int i=a; i<=b; i++)
#define Down(i,n) for (int i=n-1; i>=0; i--)
#define DOWN(i,a,b) for (int i=b; i>=a; i--)
typedef long long ll;
typedef long double ld;
typedef pair<int,int> pii... | ALGO | 0.999789 | 4.383038 |
97122e2a-1379-4318-ae9e-f9ac338d7297 | DennissimOS/platform_frameworks_wilhelm | src/itf/IAndroidConfiguration.cpp | /* AndroidConfiguration implementation */
#include <android/log.h>
#include "sles_allinclusive.h"
#include <SLES/OpenSLES_Android.h>
#include <android_runtime/AndroidRuntime.h>
static SLresult IAndroidConfiguration_SetConfiguration(SLAndroidConfigurationItf self,
const SLchar *configKey,
const void ... | TOOL | 0.853148 | 6.590043 |
1edb89cd-c53b-493c-9196-fc45956ae9b6 | WIZARD-CXY/pl | leetcode2/graphvaildtree_bfs.cpp | class Solution {
public:
bool validTree(int n, vector<pair<int, int>>& edges) {
vector<bool> vis(n,0);
vector<int> parent(n,0);
for(int i=0; i<n; i++){
parent[i]=i;
}
vector<vector<int> > G(n);
//set up the graph
for(auto e : edge... | ALGO | 0.999922 | 5.550492 |
8f29a3d7-bdc1-4680-b375-e09ec739a371 | aanzolaavila/competitive-problems | icpc/solved/3379/3379 - Two Ends.cpp | #include <bits/stdc++.h>
#define loop(i, ii, ff) for(i = ii; i < ff; i++)
#define MIN(x, y) ((x) < (y) ? (x) : (y))
#define MAX(x, y) ((x) > (y) ? (x) : (y))
#define ABS(x) MAX((x), -(x))
#define INRANGE(v, min, max) ((min) <= (v) && (v) <= (max))
#define RANGE(v, min, max) MAX(MIN((v), (max)), (min))
#define DEC(v, n)... | ALGO | 0.99977 | 3.464128 |
48747dd5-0898-4670-92a5-c6039bfeb754 | muchenhen/MyRayTracing | eigen/failtest/colpivqr_int.cpp | #include "../Eigen/QR"
#ifdef EIGEN_SHOULD_FAIL_TO_BUILD
#define SCALAR int
#else
#define SCALAR float
#endif
using namespace Eigen;
int main()
{
ColPivHouseholderQR<Matrix<SCALAR,Dynamic,Dynamic> > qr(Matrix<SCALAR,Dynamic,Dynamic>::Random(10,10));
}
| TEST | 0.933827 | 3.159166 |
7a683a93-012f-4d4b-83ae-b881913ac6b3 | OleksiyKots/Lab_13.5 | Lab_5/Lab_5/Lab_5.cpp | #include <iostream>
#include <fstream>
#include <Windows.h>
using namespace std;
struct Elem {
Elem* link;
double info;
};
void push(Elem*& top, double value) {
Elem* tmp = new Elem;
tmp->info = value;
tmp->link = top;
top = tmp;
}
double pop(Elem*& top) {
if (top == nullptr) {
ce... | ALGO | 0.999822 | 3.676604 |
5cf5a190-c2db-40bc-a63d-3cea30dda1b2 | cmariot/Matrix | exercises/ex11.cpp | /*
Exercise 11 : Determinant
*/
# include <iostream>
# include "matrix.hpp"
int main()
{
// One thing that turns out to be surprisingly useful for understanding a given transformation is to measure exactly how much a given transformation stretches and squishes things. More specifically, to measure the factor by ... | ALGO | 0.999484 | 5.607837 |
ffa67125-d9d3-4eb3-a935-4142301f9ddd | koushik-ch/Leetcode-Solutions | Rat in a Maze Problem - I - GFG/rat-in-a-maze-problem-i.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:
vector<char> vals={'U','D','L','R'};
vector<int> dx{-1,1,0,0};
vector<int> dy={0,0,-1,1};
vector<string> f... | ALGO | 0.999897 | 6.322694 |
2584addc-db6d-4dcf-8aea-c1f26dd8a99d | prudvi-satya-teja/leetcode-problems | 3485-maximize-score-of-numbers-in-ranges/3485-maximize-score-of-numbers-in-ranges.cpp | class Solution {
public:
bool isValid(long long mid, vector<int>& start, long long d) {
long long ele = start[0] + mid;
bool ans = true;
for(int i=1; i<start.size(); i++) {
long long st = start[i];
long long end = st + d;
if(ele > end) {
r... | ALGO | 0.99998 | 5.469204 |
0de3e1ca-ef55-41d1-a906-66f0cde17f38 | Toufik-Islam/XPSC_Phitron | Week 9/Day 5/B_Mahmoud_and_Ehab_and_the_bipartiteness.cpp | /*\~~~~~~~~~~~~~~~~~\
\ TOUFIK \
\ ISLAM \
\~~~~~~~~~~~~~~~~~\*/
#include <bits/stdc++.h>
using namespace std;
const int N = (int)1e6 + 5;
const int M = (int)1e9 + 5;
const int md = (int)1e9 + 7;
#define ll long long
#define ld long double
#define vi vector<int>
#define vll vector<ll>
... | ALGO | 0.999834 | 4.800698 |
ee059790-18bb-4845-8c08-4e7c0488cae2 | ishandutta2007/codeforces | xellos/normal/1591/D.cpp | // iostream is too mainstream
#include <cstdio>
// bitch please
#include <iostream>
#include <algorithm>
#include <vector>
#include <set>
#include <map>
#include <queue>
#include <stack>
#include <list>
#include <chrono>
#include <random>
#include <cstdlib>
#include <cmath>
#include <ctime>
#include <cstring>
#include ... | ALGO | 0.99997 | 4.630352 |
7628864d-9d17-4cec-a93d-a0ca26653acd | HONGYANGGAN/leetcode | solution/2500-2599/2533.Number of Good Binary Strings/Solution.cpp | class Solution {
public:
int goodBinaryStrings(int minLength, int maxLength, int oneGroup, int zeroGroup) {
const int mod = 1e9 + 7;
int f[maxLength + 1];
memset(f, 0, sizeof f);
f[0] = 1;
for (int i = 1; i <= maxLength; ++i) {
if (i - oneGroup >= 0) {
... | ALGO | 0.999969 | 5.907407 |
dbe1b2ec-9a1e-436e-9d4d-9afa2b006832 | ermolaevv/ppc-2024-autumn | tasks/mpi/kondratev_ya_max_col_matrix/perf_tests/main.cpp | #include <boost/mpi/timer.hpp>
#include <random>
#include <vector>
#include "core/perf/include/perf.hpp"
#include "mpi/kondratev_ya_max_col_matrix/include/ops_mpi.hpp"
std::vector<std::vector<int32_t>> getRandomMatrix(uint32_t row, uint32_t col) {
int32_t low = -200;
int32_t high = 200;
std::random_device dev;... | TEST | 0.876821 | 5.991343 |
f4819b1a-211f-416f-915a-69698d00000b | ClootBooters24/WarstlerC_Graphics_Assignment6 | ray_trace.cpp | //---------------------------------------
// Program: ray_trace.cpp
// Purpose: Demonstrate ray tracing.
// Author: John Gauch
// Date: Spring 2019
//---------------------------------------
#include <cmath>
#include <cstdio>
#include <cstdlib>
#ifdef MAC
#include <GLUT/glut.h>
#else
#include <GL/glut.h>
#endif
usin... | ALGO | 0.99795 | 4.665563 |
28de0e85-a682-4d8b-abe9-2a978de4a945 | kirankumar-medikurthy/must-do-dsa-problems | 49_Coin Change Problem/Ideal Solutions/coinChange.cpp | #include<bits/stdc++.h>
using namespace std;
int coinChange(int n, int amount, int coins[]) {
// Function to calculate minimum number of coins required to form the amount
vector<int> dp(amount + 1, INT_MAX); // dp vector to store minimum coins needed to make each smaller or sub amount less than the target amount
d... | ALGO | 0.99997 | 5.48372 |
17c2824a-8818-4be8-9c97-d73f5f28718f | yagnesh-3/DSA_practise | 1715-split-a-string-into-the-max-number-of-unique-substrings/split-a-string-into-the-max-number-of-unique-substrings.cpp | class Solution {
public:
int tot;
void solve(int ind, const string& s, set<string>& used, int curr) {
if (ind == s.size()) {
tot = max(tot, curr);
return;
}
string temp;
for (int i = ind; i < s.size(); i++) {
temp.push_back(s[i]);
... | ALGO | 0.999993 | 6.145236 |
d663815c-1011-4b11-b807-140a059e973b | johannesgerer/jburkardt-cpp | sgmga/sgmga_aniso_normalize_prb.cpp | # include "sandia_rules.hpp"
# include "sgmga.hpp"
# include <cstdlib>
# include <iomanip>
# include <iostream>
# include <cmath>
int main ( );
void sgmga_aniso_balance_tests ( );
void sgmga_aniso_balance_test ( double alpha_max, int dim_num, double level_weight[] );
void sgmga_aniso_normalize_tests ( );
void sgmga_a... | TEST | 0.956645 | 5.802691 |
cb1e5736-ebc9-478f-b501-59a35eccf131 | Takumi-Dev-king/CPP-Algorithms | searching/linear.cpp | // Linear search is a simple algorithm that checks each element in the array sequentially
// until the desired element is found or the array is fully traversed.
// Time Complexity:
// Best case: O(1)
// Worst case: O(n)
// Average case: O(n)
// Space Complexity:
// O(1)
#include <iostream>
using namespace std;
int ... | ALGO | 0.999901 | 6.063506 |
f7117c89-0eaa-4286-a0f3-603fa80e9a92 | Liux7/ASC | hpcg/src/ComputeRestriction_ref.cpp |
//@HEADER
// ***************************************************
//
// HPCG: High Performance Conjugate Gradient Benchmark
//
// Contact:
// Michael A. Heroux ( <EMAIL>)
// Jack Dongarra (<EMAIL>)
// Piotr Luszczek (<EMAIL>)
//
// ***************************************************
//@HEADER
/*!
@file Compute... | ALGO | 0.998871 | 5.748579 |
52db0d3f-eac4-4f07-8f0d-2f3aa125903a | SeungPyo-Jeon/Baekjoon-Algorithm | algorithm/sorting/QuickSort.cpp | #include <iostream>
#include <stdio.h>
using namespace std;
void swap( int* a, int* b){
int temp = *a;
*a = *b;
*b = temp;
}
void quickSort( int arr[] , int Left, int Right){
if( Right-Left <= 0 ) return ;
int pIndex = Left;
int pivot = Right;
int idx = Left;
for( idx ; idx < Ri... | ALGO | 0.999986 | 4.542373 |
2679985c-ff19-4e94-90da-0bd3666d6467 | Heli2002/flutterpractical | 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 |
3532b714-e86e-4a71-9e42-9e9b6b7c916d | kamisamaaaaaaaaaaaaaaaaaaaa/cmu15445_projects | third_party/murmur3/MurmurHash3.cpp | // This source file was originally from:
// https://github.com/PeterScott/murmur3
//
// We've changed it for use with VoltDB:
// - We changed the top-level functions defined below to return
// their hash by value, rather than accept a pointer to storage
// for the result
// Note - The x86 and x64 versions ... | ALGO | 0.983756 | 7.052542 |
d148e0e6-cf03-4931-9e5c-8bcb4fc5b2ac | tianxintian/cpp | stl/insert_iterator.cpp | ///
/// @file insert_iterator.cpp
/// @author haowang(<EMAIL>)
/// @date 2018-04-27 11:31:53
///
#include <iostream>
#include <vector>
#include <iterator>
#include <list>
#include <set>
using std::cout;
using std::endl;
using std::vector;
using std::list;
using std::set;
using std::ostream_iterator;
using... | TOOL | 0.928064 | 4.294746 |
c5093b4d-df10-40b4-ae96-b192eeba96b9 | Yawn-Sean/Daily_CF_Problems | daily_problems/2024/12/1216/personal_submission/cf95b_alwaysce.cpp | #include <bits/stdc++.h>
using namespace std;
using i64 = long long;
const int inf = 1000000007;
i64 mod = 1e9+7;
int main() {
ios::sync_with_stdio(false);
cin.tie(nullptr);
string s;
cin >> s;
int n = s.size();
if (n % 2) {
int half = (n + 1) / 2;
cout << string(half, '4') << string(half, '7');
} else ... | ALGO | 0.999854 | 5.669037 |
97d389b0-f1d3-4a07-a029-885db583f71a | Namanvijay/CP | codeforces/friends.cpp | //@@@@@@@@@@ JAI BAJRANG BALI @@@@@@@@@
//@@@@@ COMPILED BY NAMAN VIJAYVARGIYA @@@@@@@
#include<bits/stdc++.h>
using namespace std;
#define ll long long int
#define pb push_back
#define mk make_pair
ll mod=pow(10,9)+7;
int main()
{
ll n;
cin>>n;
vector <ll> v(n+1,0),v1,v2,v3;
queue <ll> q;
for(ll i=0;i<n;i++)
{
... | ALGO | 0.999995 | 3.34788 |
10f972cb-3c24-4618-a569-3115be5d0b5b | ImMasterSam/NSYSU_DataSructure | hw8/上傳/hw8-B123040049.cpp | #include <iostream>
#include <fstream>
#include <iomanip>
#include <cstring>
#include <vector>
#include <stack>
#include <map>
using namespace std;
// Author: B123040049 劉育希
// Date : 2024/09/23
/*
Purpose:
以Huffman 演算法製作一個檔案壓縮與解壓縮之軟體
-> Huffman演算法為無失真壓縮方法
操作範例:
huffman –c –i infile –o outfile... | ALGO | 0.996389 | 3.609414 |
1afd62dc-7205-4c20-989f-ba626e08e735 | movingone/algorithm_study | 6/4.cpp | #include <bits/stdc++.h>
using namespace std;
int n = 10;
int arr[10] = {7, 5, 9, 0, 3, 1, 6, 2, 4, 8};
void quickSort(int* arr, int start, int end) {
if (start >= end) return; // 원소가 1개인 경우 종료
int pivot = start; // 피벗은 첫 번째 원소
int left = start + 1;
int right = end;
while (left <= right) {
... | ALGO | 0.999918 | 5.394323 |
d37884b7-e0bd-4f2e-994e-74a6f03e9cbd | Luckyblock233/OI-code | Luogu/P1443 马的遍历.cpp | //ʹ㷨:BFS
//ȽʼΪ-1.
//,ijʼѹ
//ÿѭ,ȡĵ,öܵĵ
//µھΧ,ûб(ΪIJһȵIJ
//µIJΪԭ+1
//Ϊʱ
//㲽
#include<cstdio>
#include<algorithm>
#include<cstring>
#include<queue>
using namespace std;
int n,m;
int xm,ym;
int ax[10]={2,-2,2,-2,-1,1,-1,1};//仯
int ay[10]={1,1,-1,-1,2,2,-2,-2};
int step[410][410];//沽
queue <int> x;
queue <int> y;
void... | ALGO | 0.99989 | 3.07321 |
53894e93-94d0-4fd6-b62e-5e6ed1e5515c | honggoonin/SoftMark | llvm-6.0.0/lib/Analysis/PostDominators.cpp | #include "llvm/Analysis/PostDominators.h"
#include "llvm/IR/Function.h"
#include "llvm/IR/PassManager.h"
#include "llvm/Pass.h"
#include "llvm/Support/raw_ostream.h"
using namespace llvm;
#define DEBUG_TYPE "postdomtree"
//===----------------------------------------------------------------------===//
// PostDominat... | TOOL | 0.952463 | 7.454155 |
c5aeee76-2a7c-41e5-a18f-d8d13db2d306 | Johniel/contests | atcoder/abc397/E/main.cpp | // github.com/Johniel/contests
// atcoder/abc397/E/main.cpp
#include <bits/stdc++.h>
#define each(i, c) for (auto& i : c)
#define unless(cond) if (!(cond))
using namespace std;
template<typename P, typename Q> ostream& operator << (ostream& os, pair<P, Q> p);
template<typename P, typename Q> istream& operator >> (i... | ALGO | 0.99998 | 5.092832 |
3baf88ae-31bf-438c-8c31-53a1d1b2480d | mmphys/MLU | MLU/Analyse/corr.cpp | #include <MLUconfig.h>
#include <stdio.h>
#include <typeinfo>
#include <MLU/MLU.hpp>
using scalar = double;
using Complex = std::complex<scalar>;
using Fold = MLU::Fold<scalar>;
using SC = MLU::Sample<Complex>;
using VScalar = MLU::Vector<scalar>;
using VComplex = MLU::Vector<Complex>;
using MScalar = MLU::Matrix<scal... | DATA | 0.954938 | 5.951126 |
5e3aa4c7-b998-4e1c-a3ae-790b52ca80e1 | chirayu86/DSA | SortAndSEARCH/TrailingZero.cpp | int countTrailingZeroes(int x) {
int count = 0;
for (int i = 5; x / i > 0; i *= 5) {
count += x / i;
}
return count;
}
// Function to find the smallest number whose factorial has at least n trailing zeroes
int findSmallestNumber(int n) {
if (n == 0) {
return 0; // 0! = 1 has 0 trail... | ALGO | 0.999972 | 7.656356 |
0e7d7bf9-cec8-44b7-a562-ca51b40f4e24 | adityasonani/Educational-DP-Contest | D_Knapsack1Recur.cpp | /**
* @author: adityasonani
* */
#include <bits/stdc++.h>
// #pragma GCC optimize("Ofast")
// #pragma GCC target("avx,avx2,fma")
#define int long long
#define ld long double
#define ln "\n"
#define fastio ios_base::sync_with_stdio(0); cin.tie(nullptr)
#define MOD... | ALGO | 0.999993 | 5.099738 |
9740f8c8-98f0-44a8-80f7-ccb44b091a92 | Maksasj/megaboost | libs/graph/test/floyd_warshall_test.cpp | // Authors: Lauren Foutz
// Scott Hill
#include <boost/graph/floyd_warshall_shortest.hpp>
#include <map>
#include <algorithm>
#include <iostream>
#include <boost/random/linear_congruential.hpp>
#include <boost/graph/graph_utility.hpp>
#include <boost/graph/properties.hpp>
#include <boost/graph/bellman_ford_s... | TEST | 0.998475 | 6.259902 |
47fc5dc2-65c3-4658-a876-1f96d3fcde94 | HAYQ333/SummerSchool | 2TvericAmenamecBajanarary/c++.cpp |
#include
int main() {
int a, b;
int max, min;
std::cout << "Enter first number: ";
std::cin >> a;
std::cout << "Enter second number: ";
std::cin >> b;
if (a > b) {
max = a;
min = b;
} else {
max = b;
min = a;
}
for (int i = m... | ALGO | 0.999209 | 5.393677 |
a1904364-c58f-4184-b3c3-786e611ae8af | NikitosII/LinearDoubleLinkedList | LinearDoubleLinkedList/LinearDoubleLinkedList.cpp | #include "LinearDoubleLinkedList.h"
#include <iostream>
DoubleLinkedList::DoubleLinkedList() {
head_city = nullptr;
head_reg = nullptr;
}
void DoubleLinkedList::insertCity(string name, string region, int pop) {
City* newCity = new City(name, region, pop);
if (head_city == nullptr) {
head_city ... | ALGO | 0.998502 | 3.93472 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.