uuid string | repo_name string | relative_path string | content string | category string | algo_rel_score float64 | quality_score float64 |
|---|---|---|---|---|---|---|
b9d95d42-2f7d-453e-aeaa-ba55da98b891 | rcmasallera/Mealy-FOR-UTN | Mealy/Mealy.cpp | #include "AFDS.h"
#ifndef Mealy, Status
#define Mealy AFND::Mealy
#define Status AFND::status
#endif
int main() {
std::cout << "as1qw2rt3ui4bn5\n\n"; //TRANSITION RULE
Mealy new_machine(5, true); //(n, bool, start_status)
new_machine.set_condition("as5qw3rt1ui2bn3");
std::cout << new_machine.actual_status().code ... | ALGO | 0.998866 | 4.694723 |
64dcb5c9-5f58-48ef-9cd2-e386cde11d72 | MohamedIrfanAM/cp | dsa-sheet/16.cpp | #include <bits/stdc++.h>
using namespace std;
// Extended Boyer-Moore Majority Voting Algorithm
class Solution
{
public:
vector<int> majorityElement(vector<int> &nums)
{
int x = 0;
int m = -1;
int x1 = 0;
int m1 = -1;
int y = 0;
for (auto a : nums)
{
if (x == 0 && a != m1)
... | ALGO | 0.999958 | 5.519863 |
17616282-389b-4402-9739-0ec43b64abc0 | JagdishPathakji/GFG-Problem-Solving-Tracker | Difficulty: Easy/Sum of k smallest elements in BST/sum-of-k-smallest-elements-in-bst.cpp | //{ Driver Code Starts
//Initial Template for C++
#include <bits/stdc++.h>
using namespace std;
struct Node
{
int data;
struct Node *left;
struct Node *right;
};
// Utility function to create a new Tree Node
Node* newNode(int val)
{
Node* temp = new Node;
temp->data = val;
temp->left = NULL;
temp->right = NULL... | ALGO | 0.999256 | 6.362746 |
37c3527d-0476-4e70-8598-2223f350a8e0 | cansuynk/Algorithm-Studies | binary_tree_deletion.cpp | // { Driver Code Starts
#include <bits/stdc++.h>
using namespace std;
struct Node
{
int data;
struct Node *left;
struct Node *right;
};
Node* newNode(int val)
{
Node* temp = new Node;
temp->data = val;
temp->left = NULL;
temp->right = NULL;
return temp;
}
Node* buildTree(string str... | ALGO | 0.999818 | 6.189136 |
56c4d337-9054-4507-acd4-4780fd5ac952 | StXoTTaBbl4/University | Autumn/OS/lab1-custom/src/shell.cpp | #include <iostream>
#include <windows.h>
#include <wtsapi32.h>
#include <string>
#include <sstream>
#include <fstream>
#include <thread>
#include <vector>
#include "bits/stdc++.h"
#include "./utility/shell_styles.h"
using namespace std;
/**
* Структура, описывающая обработанную команду, с выставленными флагами пере... | TOOL | 0.960467 | 3.860576 |
7e0756b1-d8c5-4a3f-b421-43777a995d7b | mailpraveens/Algorithms-in-CPlusPlus | Programs/Dynamic Programming/CoinChange.cpp | #include "CoinChange.h"
int coinChangeProblem(int * denomination, int n, int changeToMake){
int M[n+1];
M[0] = 0;
// M[i] gives min coins to make change i from given values
for (int i = 0; i < changeToMake; i++) {
M[i] = INT_MAX;
int temp = INT_MAX;
for (int j = 0; j < n; j++) {... | ALGO | 0.999894 | 5.403268 |
d565293d-9784-46f4-9ff0-f64680d3d1c1 | Samir-Sadaf25/CSE-Fundamentals-with-Phitron | C++ For DSA/Week 2/module 6.5/N_Max_Subsequence.cpp | #include <bits/stdc++.h>
using namespace std;
int main()
{
int n;
cin >> n;
string s;
cin >> s;
int count = 0;
for (int i = 0; i < n; i++)
{
if (s[i] == s[i + 1])
{
count++;
}
}
cout << n - count << endl;
return 0;
} | ALGO | 0.999942 | 4.22416 |
938d1021-4548-4cc8-9ae0-c90fe475dc7e | sency90/boj | 2475.cpp | #include <stdio.h>
int main() {
int d, sum=0;
for(int i=0; i<5; i++) {
scanf("%d", &d);
sum += d*d;
}
printf("%d", sum%10);
return 0;
}
| ALGO | 0.99982 | 3.663936 |
bb3e1a34-8f01-4ecb-b299-7acb25bd8337 | rajatsen91/XtremeContextualBandits | lib/eigen/bench/benchmark.cpp | // g++ -O3 -DNDEBUG -DMATSIZE=<x> benchmark.cpp -o benchmark && time ./benchmark
#include <iostream>
#include <Eigen/Core>
#ifndef MATSIZE
#define MATSIZE 3
#endif
using namespace std;
using namespace Eigen;
#ifndef REPEAT
#define REPEAT 40000000
#endif
#ifndef SCALAR
#define SCALAR double
#endif
int main(int ar... | ALGO | 0.983906 | 3.675187 |
a1d7f93c-8711-4842-ae34-4b6c02b3d160 | abuhanif2020331005/CP | B_1_The_Strict_Teacher_Easy_Version.cpp | #include<bits/stdc++.h>
using namespace std;
#define int long long
int32_t main()
{
int t;
cin>>t;
while(t--)
{
int n,m,q;
cin>>n>>m>>q;
int a,b,c;
cin>>a>>b>>c;
if(c<min(a,b))
{
cout<<min(a,b)-1<<endl;
}
else if(c>max(a,b))
... | ALGO | 0.999943 | 3.999607 |
df652afb-150f-4d11-9352-f2a4129d09b1 | jinhan814/solutions | ICPC/GERMAN/gcpc23_d.cpp | #include <bits/stdc++.h>
using namespace std;
int main() {
cin.tie(0)->sync_with_stdio(0);
int a, b, c, d, e; cin >> a >> b >> c >> d >> e;
int l = a + b + c + d + e;
int r = 4 * a + 6 * b + 8 * c + 12 * d + 20 * e;
int x = l + r >> 1, y = l + r + 1 >> 1;
cout << x << ' ';
if (x != y) cout << y << ' ';
while (... | ALGO | 0.99995 | 3.002905 |
8cf08f15-de25-40a0-b3b7-6e9880d6f0c7 | imarkmccastro/Castro | Formative_3_CCS0007/M3.6-Formative.cpp | /*
String to Words
Example Output:
Enter a String: one two three four
four
three
two
one
Enter a string: the man with a dog
dog
a
with
man
the
*/
#include <iostream>
#include <cstring>
using namespace std;
int main() {
char str[100];
char continueSystem = 'Y';
while (continueSystem == 'Y' || contin... | TOOL | 0.962193 | 5.385092 |
56a72e52-2d77-46bd-a9f7-2d58ee5ead57 | omarhosny206/Data-Structures-and-Algorithms-Specialization | 2- Data Structures/Week 3/Content/2- K Largest Elements/K Largest Elements.cpp | #include <iostream>
#include <bits/stdc++.h>
using namespace std;
void kLargestElements(int *Items, int Size, int kElements)
{
sort(Items, Items + Size, greater<int>());
cout << "[ ";
for (int i = 0; i < kElements; i++)
cout << Items[i] << " ";
cout << "]";
}
int main()
{
int Items[7] = {... | ALGO | 0.999296 | 4.071172 |
88968077-1629-41c9-b98d-76d366c01c96 | blxxd-bvrn/source-sdk-2013-develop | sp/src/public/rope_physics.cpp | #include "rope_physics.h"
#include "tier0/dbg.h"
// memdbgon must be the last include file in a .cpp file!!!
#include "tier0/memdbgon.h"
CBaseRopePhysics::CBaseRopePhysics( CSimplePhysics::CNode *pNodes, int nNodes, CRopeSpring *pSprings, float *flSpringDistsSqr )
{
m_pNodes = pNodes;
m_pSprings = pSprings;
m_flNo... | ALGO | 0.975697 | 6.455757 |
c3ad9bba-347e-44c9-a5b0-0528323aa986 | ZebraCakes/advent_of_code | 2021/src/day_04.cpp | #include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include "amp_defs.h"
i32 stride = 5;
struct board
{
i32 data[25];
b32 hits[25];
i32 winning_draw;
board *next;
};
board*
get_last_board(board *root)
{
board *last = root;
while(last && last->next)
{
last = last->next;
... | ALGO | 0.98901 | 3.635625 |
cb9fde6b-cc02-48e0-ab9d-ca29b60ce1eb | Wild-Donkey/Code | Tests/2020/2020.7/2020.7.8/C.cpp | #include <algorithm>
#include <cmath>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <ctime>
#include <iostream>
#include <map>
#include <queue>
#include <vector>
using namespace std;
int t, n, ans[105],cnt;
bool flg;
char ch;
string s,a[105];
struct Node{
int have;
Node *son[27];
}N[1005], *cntn=N... | ALGO | 0.999983 | 3.638358 |
9432083a-4c79-4254-90b1-b011f76f1575 | Rainboylvx/pcs | luogu/1097/2.cpp | /* author: Rainboy email: <EMAIL> time: 2020年 08月 04日 星期二 10:56:44 CST */
#include <bits/stdc++.h>
using namespace std;
const int maxn = 1e5+5;
int n,m;
int a[200005];
int main(){
cin >> n;
int i,j;
for(i=1;i<=n;++i){
cin >> a[i];
}
//[1,n+1) [1,n]
sort(a+1,a+n+1);
int cnt = 1;
... | ALGO | 0.999979 | 3.626927 |
d458c409-1028-4425-8a25-fe2831072b97 | janakrishnan123/class-3 | SUM OF TWO PRIME NUMBERS.cpp | #include <stdio.h>
#include <stdbool.h>
bool isPrime(int num);
int main() {
int n;
printf("Enter a number: ");
scanf("%d", &n);
bool found = false;
for(int i = 2; i <= n/2; i++) {
if(isPrime(i)) {
if(isPrime(n - i)) {
printf("%d can be expressed as the sum of ... | ALGO | 0.99933 | 4.923294 |
6d0d35b4-13c0-484f-87cd-759270ad5af9 | karla-mond/EjerciciosPOO | 2/Tarea2LineStatistics.cpp | //Tarea 2, CPP LineStatistics
// Karla Mondragón, A01025108
#include<string>
#include<iostream>
#include"Tarea2LineStatistics.h"
using namespace std;
LineStatistics::LineStatistics() {}
LineStatistics::LineStatistics(ElementLine whosLast): whosLast(whosLast) {}
ElementLine LineStatistics::getWhosLast()
{
return... | ALGO | 0.870675 | 4.09995 |
9f3a25d9-8667-438e-b30e-f165acb932d3 | sean-clayton/godot | thirdparty/bullet/BulletCollision/CollisionShapes/btOptimizedBvh.cpp | #include "btOptimizedBvh.h"
#include "btStridingMeshInterface.h"
#include "LinearMath/btAabbUtil2.h"
#include "LinearMath/btIDebugDraw.h"
btOptimizedBvh::btOptimizedBvh()
{
}
btOptimizedBvh::~btOptimizedBvh()
{
}
void btOptimizedBvh::build(btStridingMeshInterface* triangles, bool useQuantizedAabbCompression, const b... | ALGO | 0.97317 | 6.780021 |
d0c4201b-c878-4d21-9774-0cea11c77e7a | FilatovDmitrij/Lab_vs_IVT_24 | Sem_1/if/swich+/swich.cpp | #include <iostream>
using namespace std;
int main()
{
int a;
float b, c;
cin >>a >>b >>c;
switch (b)
{
case 1: cout << b + c; break;
case 2: cout << b - c; break;
case 3: cout << b * c; break;
case 4:
{
if (c == 0)
{
cout << "Tupich?";
}
... | ALGO | 0.999298 | 3.643413 |
98fe3aec-96ca-4104-b4f0-1582e262c552 | luishpmendes/motsp | src/solver/weighted_sum/branch_and_cut/branch_and_cut_callback.cpp | #include "solver/weighted_sum/branch_and_cut/branch_and_cut_callback.hpp"
namespace motsp {
void Branch_and_Cut_Callback::find_subtour(
unsigned num_vertices,
std::vector<std::vector<double>> x_val,
unsigned * tour_len,
std::vector<unsigned> & tour) {
std::vector<bool> seen(num_vert... | ALGO | 0.999092 | 5.524736 |
adaa7e12-345f-40a1-9e60-14d945ce77c0 | dzo/frameworks_base | libs/hwui/utils/SortedListImpl.cpp | #include "SortedListImpl.h"
namespace android {
namespace uirenderer {
///////////////////////////////////////////////////////////////////////////////
// Sorted list implementation, not for direct use
///////////////////////////////////////////////////////////////////////////////
SortedListImpl::SortedListImpl(size_... | TOOL | 0.999275 | 6.40382 |
da483590-2472-4ea3-bd23-7ead0a9139ff | ErRohit2/That-Is-All-About-Cpp | function.cpp | #include<iostream>
using namespace std;
int add(int a , int b)
{
int c;
c=a+b;
return c;
}
int main()
{
int a,b;
cout<<"Enter a Number - "<<endl;
cin>>a;
cout<<"Enter B number - "<<endl;
cin>>b;
cout<<"The Sum Of A nd B is "<<add(a,b)<<endl;
}
| TOOL | 0.880892 | 3.616021 |
da86cd8f-07ea-4d4b-b216-be39c9fbc3aa | GurleenRajpal/DS-Cpp-Codes | _24_CP_Recursion/3_number_of_digits.cpp | // Number of Digits
// Send Feedback
// Given the number 'n', find out and return the number of digits present in a number .
// Input Format :
// Integer n
// Output Format :
// Count of digits
// Constraints :
// 1 <= n <= 10^6
// Sample Input 1 :
// 156
// Sample Output 1 :
// 3
// Sample Input 2 :
// 7
// Sample O... | ALGO | 0.99991 | 4.242806 |
c2f2b5a5-6794-482b-8237-ac022fe62a0e | AdvTrainEvalSrcDomain/adv-train-evaluation-source-code-domain | code-imitator/data/dataset_2017/dataset_2017_8_formatted_macrosremoved/lazyBit/8294486_5654117850546176_lazyBit.cpp | #include <bitset>
#include <deque>
#include <iomanip>
#include <iostream>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <cassert>
#include <cmath>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <ctime>
#include <string>
#include <algorithm>
#include <functional>
#inclu... | ALGO | 0.999838 | 4.284759 |
badbf406-24c2-44a2-a32f-cb3237d1ef58 | iannisdezwart/centre-aligned-code | centre-align-code.cpp | #include <bits/stdc++.h>
using namespace std;
int main(int argc, char **argv)
{
if (argc < 3)
{
fprintf(stderr,
"Usage: ./centre-align-code input.c output.c [ max_cols = 80 ]\n");
}
const char *input_file_name = argv[1];
const char *output_file_name = argv[2];
size_t max_cols = 80;
if (argc > 3)
max_c... | TOOL | 0.93732 | 5.936288 |
fbef6ba4-4a25-48d6-a9e8-1a81aeddec72 | dhruveshpatel25/DSA | 13-Binary Tree/062-Binary Tree Basics/Homework/InOrder_PreOrder_PostOrderTraversal.cpp | #include<iostream>
#include<queue>
#include<stack>
using namespace std;
class Node{
public:
int data;
//left subtree
Node *left;
//right subtree
Node *right;
Node(int data){
this->data=data;
this->left=NULL;
this->right=NULL;
}
};
//creation of binary tre... | ALGO | 0.999879 | 5.198208 |
422a3f4d-e0ae-4be7-9099-fedd9332993a | Bill-Huangz/NYCU-elementary-graph-theory | HW3-111550160/HW3_1-111550160.cpp | #include <bits/stdc++.h>
//#define int long long
#define double long double
#define Nanase_Kurumi_aka_menhera_chan_is_mine ios::sync_with_stdio(false);cin.tie(0);cout.tie(0); // 好孩子不要查這行
#define pb push_back
#define ALL(i) i.begin(),i.end()
#define gcd(i,j) __gcd(i,j)
#define fi first
#define se second
//#define X firs... | ALGO | 0.999974 | 4.163072 |
e59e3bfa-c58c-4b61-8020-4fc7eea5caac | kirteeprajapati/Competitive-Coding | CodeForces cpp/431A - Black Square.cpp | #include <iostream>
using namespace std;
int main()
{
int a[4], count = 0;
for (int i = 0; i < 4; i++)
cin >> a[i];
char s;
while (cin >> s)
{
if (s == '1')
count += a[0];
else if (s == '2')
count += a[1];
else if (s == '3')
count ... | ALGO | 0.997038 | 3.365776 |
c5da5331-1eab-4748-bb4f-ba26d119ab1f | tarek013096/Computer-Algorithm- | Computer Al. Lab 04/Task_04.cpp | #include<iostream>
#include<cmath>
using namespace std;
void Merge(int arr[] , int p , int q , int r)
{
int n1 = q - p + 1;
int n2 = r - q;
int L[n1] , R[n2];
for(int i = 0 ; i < n1 ; i++)
{
L[i] = arr[p + i];
}
for(int j = 0 ; j < n2 ; j++)
{
R[j] = arr[q + 1 + j];
... | ALGO | 0.999961 | 4.121679 |
23e70fcc-730d-4ab6-8933-2d76611c9f1c | Anikcsejnu/cpp-problem-solving | C++/lightoj/Beginner/1022.cpp | #include<bits/stdc++.h>
#define pi 2*acos (0.0)
using namespace std;
int main()
{
int t;
double r, area, a;
cin>>t;
for(int i = 1;i<=t;i++)
{
area = 0;
cin>>r;
a = 2*r;
area = a*a - pi*(r*r);
printf("Case %d: %0.2lf\n", i, area);
}
return 0;
}
| ALGO | 0.998857 | 4.043937 |
e58cf7ae-d902-4578-aa2f-68769f0d60bb | cran/spacefillr | src/generate_point_functions.cpp | #include <Rcpp.h>
using namespace Rcpp;
#include "util.h"
#include "pj.h"
#include "pmj.h"
#include "pmj02.h"
#include "sobol.h"
#include "halton_sampler.h"
#include "samplerBlueNoise.h"
#include "rng.h"
// [[Rcpp::export]]
List rcpp_generate_sobol_set(uint64_t N, unsigned int dim, unsigned int scramble) {
List f... | TOOL | 0.95673 | 5.231536 |
5aaafa41-45ee-4574-b7e4-c124cb94a3af | vs666/Algorithms_1 | MergeSort.cpp | #include <iostream>
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
bool comp(const ll &a, const ll &b)
{
return a <= b;
}
void merge(ll *ar, ll l, ll u)
{
ll mid = (l + u) / 2;
ll size1 = mid - l + 1, size2 = u - mid;
ll a1[size1], a2[size2];
for (int x = l; x <= u; x++)
... | ALGO | 0.999953 | 5.50032 |
bf5e2a91-994b-4ea8-bb1a-753981cee125 | RoboticsPolyu/IPN_MPC | app/circle_trajectory_test.cpp | #include "color.h"
#include "trajectory_generator/Trajectory_generator.h"
#include "quadrotor_simulator/Dynamics_control_factor.h"
#include "quadrotor_simulator/Quadrotor_SO3.h"
#include <gtsam/nonlinear/Values.h>
#include <gtsam/inference/Symbol.h>
#include <gtsam/nonlinear/LevenbergMarquardtOptimizer.h>
#include <gt... | ALGO | 0.985901 | 4.044251 |
7cf63c72-eeae-43d7-a3e9-1ce41aa06423 | evilcat-x/leetcode-reboot | contest/weekly-128/1012.cpp | class Solution
{
public:
int bitwiseComplement(int N)
{
if (N == 0)
return 1;
int b = 1;
int result = 0;
while (N != 0)
{
result += (1 - (N % 2)) * b;
N = N >> 1;
b = b << 1;
}
return result;
}
};
| ALGO | 0.999977 | 5.821844 |
db61cb95-5e0d-41e9-b230-00146e5a71af | ishandutta2007/codeforces | kmjp/normal/1580/C.cpp | #include <bits/stdc++.h>
using namespace std;
typedef signed long long ll;
#define _P(...) (void)printf(__VA_ARGS__)
#define FOR(x,to) for(x=0;x<(to);x++)
#define FORR(x,arr) for(auto& x:arr)
#define FORR2(x,y,arr) for(auto& [x,y]:arr)
#define ALL(a) (a.begin()),(a.end())
#define ZERO(a) memset(a,0,sizeof(a))
#define ... | ALGO | 0.999771 | 3.651214 |
fb648ac7-e6b7-4423-a683-8a0c3ba33b16 | aditi970/DATA-STRUCTURES | reversestring.cpp | #include<iostream>
#include<string.h>
using namespace std;
int main ()
{
char str[50], temp;
int i, j;
cout << "Enter a string : ";
gets(str);
j = strlen(str) - 1;
for (i = 0; i < j; i++,j--)
{
temp = str[i];
str[i] = str[j];
str[j] = temp;
}
cout << "\nReverse string : " << str;
return 0;
}
| ALGO | 0.998223 | 3.83639 |
775280c2-e21b-4349-8401-d7711c787271 | MonalSD/Learn-C- | Recurssion/q28.cpp | // Write a Program to count the number of digits in a number using recursion
#include<iostream>
using namespace std;
int c_ount(int n)
{
static int count =0;
if(n!=0)
{
count++;
c_ount(n/10);
}
return count;
}
int main()
{
int n;
cout<<"Enter number: ";
cin>>n;
cout... | ALGO | 0.999796 | 6.075506 |
961d4e6b-59d6-4c1c-a169-2f695fa1636e | ZhenyingZhu/ClassicAlgorithms | src/CPP/src/leetcode/WordBreak.cpp | /*
* [Source] https://leetcode.com/problems/word-break/
* [Difficulty]: Medium
* [Tag]: Backtracking
* [Tag]: Dynamic Programming
*/
#include <iostream>
using namespace std;
// [Solution]: First compute the min and max length of dict words. Then try to seperate words from s[0,min] and s[min+1,end] to s[0,max] a... | ALGO | 0.998174 | 5.404079 |
f1272988-52e1-46bb-8c95-014f0d3f2bf2 | firewood/topcoder | atcoder/abc_206/c.cpp | #include <algorithm>
#include <cctype>
#include <cmath>
#include <cstring>
#include <iostream>
#include <sstream>
#include <numeric>
#include <map>
#include <set>
#include <queue>
#include <vector>
using namespace std;
int64_t solve(int64_t N, std::vector<int64_t> A) {
int64_t ans = 0;
map<int64_t, int64_t> m;
for... | ALGO | 0.999833 | 4.721509 |
0c7de97d-2a1b-468e-9370-1bb175d310b5 | raincross7/code-similarity | codes/train_code/problem279/problem279_231.cpp | #include <iostream>
#include <stack>
using namespace std;
using ll = long long;
#define rep(i, n) for (int i = 0; i < (int)(n); ++i)
int main() {
string s;
cin >> s;
int n = s.length();
stack<char> t;
int ans = 0;
for (int i = 0; i < n; ++i) {
if (t.empty()) {
t.push(s[i]);
continue;
... | ALGO | 0.999882 | 3.944988 |
c419e8fd-854f-440b-9b6f-11d54da3af13 | yash-pratap-singh/fjf | 900-1000/57_MAX_MEX_CUT.cpp | #include<iostream>
#include<vector>
#include<map>
#include<climits>
#include<algorithm>
#include<math.h>
#include<queue>
#include<stack>
#define pb push_back
#define vi vector<int>
#define ll long long
using namespace std;
int main(){
int t; cin>>t;
while(t--){
int n; cin>>n;
string s1,s2;
cin>>s1;
... | ALGO | 0.999873 | 4.242922 |
990666b5-4a95-4d52-ad08-7b3aaa8d4df7 | janhohenheim/boost | libs/geometry/doc/index/src/examples/rtree/value_index.cpp | //[rtree_value_index
#include <boost/geometry.hpp>
#include <boost/geometry/geometries/point.hpp>
#include <boost/geometry/geometries/box.hpp>
#include <boost/geometry/index/rtree.hpp>
#include <cmath>
#include <vector>
#include <iostream>
#include <boost/foreach.hpp>
namespace bg = boost::geometry;
namespace bgi =... | ALGO | 0.999833 | 6.078147 |
1641710f-9b82-4f46-b812-66aa56c2051a | hma40/Cpp-Competitive-Programming | USACO/2014_15_USACO/Gold/MoovieMooving.cpp | #include <bits/stdc++.h>
using namespace std;
using ll = long long;
struct movie {
int duration;
int showtimes;
vector<int> startTimes;
};
int main() {
ios_base::sync_with_stdio(false);
cin.tie(0);
freopen("movie.in", "r", stdin);
freopen("movie.out", "w", stdout);
int n,l;
cin >> n... | ALGO | 0.999949 | 3.823267 |
203c8051-2558-4084-96ab-18a23dd4515d | Ginakira/Code-Archive | Leetcode/LeetCode2766.cpp | // LeetCode 2766 重新放置石块
#include <algorithm>
#include <array>
#include <numeric>
#include <queue>
#include <stack>
#include <string>
#include <tuple>
#include <unordered_map>
#include <unordered_set>
#include <vector>
using namespace std;
class Solution {
public:
vector<int> relocateMarbles(vector<int>& nums, ... | ALGO | 0.999931 | 5.889174 |
643d1aff-6f39-42ff-8530-9f034c450f19 | seeharrr/programming-fundamental | sum , product and average.cpp | #include<iostream>
using namespace std;
int main()
{
int a,b,c ,d ;
int sum,product;
float average;
cout<<"enter a";
cin>>a ;
cout<<"enter b";
cin>>b;
cout<<"enter c";
cin>>c;
cout<<"enter d";
cin>>d;
sum = a+b+c+d;
cout<<"the value of sum ="<<sum<<endl;
product = a*b*c*d;
cout<<"the value of product ="<<product<<en... | TOOL | 0.988138 | 3.098509 |
5a3c5bbb-a71b-4ab1-a995-a61b0bfa1b14 | briansenas/Genetic-and-Memetic-Classification | inc/eigen-3.4.0/bench/sparse_product.cpp |
//g++ -O3 -g0 -DNDEBUG sparse_product.cpp -I.. -I/home/gael/Coding/LinearAlgebra/mtl4/ -DDENSITY=0.005 -DSIZE=10000 && ./a.out
//g++ -O3 -g0 -DNDEBUG sparse_product.cpp -I.. -I/home/gael/Coding/LinearAlgebra/mtl4/ -DDENSITY=0.05 -DSIZE=2000 && ./a.out
// -DNOGMM -DNOMTL -DCSPARSE
// -I /home/gael/Coding/LinearAlgebr... | ALGO | 0.987115 | 4.164869 |
eeff904e-6b62-4475-bbf3-de3259b50273 | vuhonganh/myUVA | 00437-The-Tower-Of-Babylon/main.cpp | //uva 437 The tower of babylon
//type: dynamic programming (not really, but we have to remember the memo table)
//Key point: one block -> 3 objects, after that, use iteration with the contiguous-updating memo table
#include <cstdio>
#include <vector>
#include <cassert>
using namespace std;
struct Obj
{
int x, y, z... | ALGO | 0.999085 | 4.760397 |
50754eab-f570-4246-ac35-4a93a4c5abe9 | sensen963/AtCoder | ABC/ABC071/B.cpp | #include <iostream>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <algorithm>
#include <string>
#include <sstream>
#include <complex>
#include <vector>
#include <list>
#include <queue>
#include <deque>
#include <stack>
#include <map>
#include <set>
#include <fstream>
#include <numeric>
using namespac... | ALGO | 0.999871 | 3.806349 |
32356f06-0443-4d07-bd47-b62adb2ba88d | 20sw084/Clock | 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 |
fe0ac47f-eb89-4936-a592-eaef816fcedb | MirYeasirAbrar/CodeQuest-to-Career | Codeforces/Problem Set/1873A - Short Sort.cpp | #include <bits/stdc++.h>
#define endl '\n'
using namespace std;
int main() {
cin.tie(nullptr)->sync_with_stdio(false);
int t; cin >> t;
while(t--){
string s; cin >> s;
cout << ((s == "abc" || s == "bac" || s == "cba" || s == "acb") ? "YES" : "NO") << endl;
}
return 0;
} | ALGO | 0.999809 | 4.92216 |
d871f370-d53b-4ea5-820f-4ad0caabade1 | ishandutta2007/codeforces | pavel.savchenkov/normal/553/B.cpp | #include <cstdio>
#include <iostream>
#include <algorithm>
#include <cstring>
#include <string>
#include <vector>
#include <set>
#include <map>
#include <utility>
#include <cstdlib>
#include <memory>
#include <queue>
#include <cassert>
#include <cmath>
#include <ctime>
#include <complex>
#include <bitset>
using namesp... | ALGO | 0.999989 | 3.135174 |
4609a9b2-7031-4bdf-ae5a-21b8f3e42225 | ajitm722/Barrier-Synchronized-Home-Temperature-Processor | src/TemperatureProcessor.cpp | #include "TemperatureProcessor.h"
#include "Temperature.h"
#include <chrono>
#include <thread>
#include <numeric> // For std::reduce
void ProcessMeasurement(Temperature &temp)
{
const auto &values = temp.readings; // Extract the temperature measurements
// Simulate cleaning and filtering data by introducing... | TOOL | 0.927644 | 6.790048 |
f47ceb0c-0ca4-425f-bf65-8792c880406b | TinkerBoard-Android/rockchip-android-ndk | sources/cxx-stl/llvm-libc++/libcxx/test/algorithms/alg.nonmodifying/alg.is_permutation/is_permutation_pred.pass.cpp | // <algorithm>
// template<class ForwardIterator1, class ForwardIterator2, class BinaryPredicate>
// bool
// is_permutation(ForwardIterator1 first1, ForwardIterator1 last1,
// ForwardIterator2 first2, BinaryPredicate pred);
#include <algorithm>
#include <functional>
#include <cassert>
#include "... | TEST | 0.883073 | 6.815845 |
816fbf89-be08-4e28-8a66-17f2903d9991 | bosiaf/Mater_thesis | src/HIVEvo/lib/epi.cpp | //
// Created by iotn_ on 04.04.2018.
//
#include <random>
#include <vector>
#include "par_class.h"
#include "epi.h"
#include "TransitionMatrix.h"
//CALCULATE NEXT INFECTION TIME
unsigned epi::epidemics::next_inf_time(mt19937& rng) {
double rate = 0;
//calculate overall rate
for (auto& i : h_vec) {
rate += ... | ALGO | 0.997154 | 4.73012 |
1b393d8f-5f6b-4509-aba3-d0e034f730d4 | ayushsachann/cpprepo | rhombus_pattern.cpp | #include<iostream>
using namespace std;
int main(){
int n;
cin>>n;
for(int i = 1; i <= n; i++){
for(int j = 1; j <= n-i; j++){
cout<<" ";
}
for(int j = 1; j <= n; j++){
cout<<" *";
}
cout<<endl;
}
} | ALGO | 0.999849 | 3.712633 |
23950395-bafa-4dad-84cc-4ebf2c374330 | 123MRaahimRizwan/Complete-DSA-Placement-Course | LinkedList_Traversal.cpp | #include <iostream>
using namespace std;
class Node
{
public:
int data;
Node *next;
Node(int data) : data(data), next(NULL) {}
Node() {}
};
void linkedListTraversal(Node *ptr)
{
while (ptr != NULL)
{
cout << ptr->data << endl;
ptr = ptr->next;
}
}
int main()
{
Node *h... | ALGO | 0.989377 | 4.587453 |
170c6678-a695-4260-b462-bd416fce78d0 | Tatwi/RescueGirlies | src/supertux/gameconfig.cpp | #include "supertux/gameconfig.hpp"
#include <stdexcept>
#include "addon/addon_manager.hpp"
#include "control/joystickkeyboardcontroller.hpp"
#include "lisp/writer.hpp"
#include "lisp/parser.hpp"
#include "util/reader.hpp"
#include "supertux/globals.hpp"
Config::Config() :
profile(1),
fullscreen_size(800, 600),
... | CONFIG | 0.881343 | 6.302119 |
cffa1b06-2a7a-48d8-81a1-7fc9130cf96d | ulb-info2-group5/Royal-Blocks | lib/Bcrypt.cpp/src/bcrypt.cpp | /* This password hashing algorithm was designed by David Mazieres
* <<EMAIL>> and works as follows:
*
* 1. state := InitState ()
* 2. state := ExpandKey (state, salt, password)
* 3. REPEAT rounds:
* state := ExpandKey (state, 0, password)
* state := ExpandKey (state, 0, salt)
* 4. ctext := "OrpheanBehold... | ALGO | 0.984293 | 6.782584 |
572ee1e8-30ff-4e8c-a1c3-7fdafc53c7c3 | wildcat-rocketry/llvm | llvm/tools/llvm-xray/xray-graph-diff.cpp | #include "xray-graph-diff.h"
#include "xray-graph.h"
#include "xray-registry.h"
#include "xray-color-helper.h"
#include "llvm/ADT/iterator_range.h"
#include "llvm/Support/FormatVariadic.h"
#include "llvm/XRay/Trace.h"
using namespace llvm;
using namespace xray;
static cl::SubCommand GraphDiff("graph-diff",
... | TOOL | 0.950939 | 7.628364 |
1e355068-af48-4244-900f-e6fe558bf398 | vastopol/cs_intro_programs | CS_12/programs/program7/IntList.cpp | //IMPLEMENTATION
#include "IntList.h"
#include <iostream>
#include <algorithm>// fix
using namespace std;
/*
///IntNode used by IntList class
struct IntNode
{
int data;
IntNode *next;
IntNode(int data) : data(data), next(0) {}
};
///IntList protected
//IntNode POINTERS
IntNode * head;
IntNo... | ALGO | 0.992986 | 5.050739 |
5d6ddbc9-b46a-4d99-8a0e-fca009c22a0e | ishandutta2007/codeforces | adamant/normal/914/C.cpp | #include <bits/stdc++.h>
using namespace std;
#define int int64_t
const int mod = 1e9 + 7;
int fact[1111], rfact[1111];
int nCr(int n, int r) {
if(n < 0 || r < 0 || n < r) {
return r == 0;
}
return fact[n] * rfact[r] % mod * rfact[n - r] % mod;
}
int cnt(string s, int k) {
int n = s.size()... | ALGO | 0.999989 | 5.055005 |
25b9ade2-16dd-45f2-80ec-9ea1d045f976 | rocketman123456/ArchViz-All | engine/3rd_party/eigen/unsupported/doc/examples/FFT.cpp | // To use the simple FFT implementation
// g++ -o demofft -I.. -Wall -O3 FFT.cpp
// To use the FFTW implementation
// g++ -o demofft -I.. -DUSE_FFTW -Wall -O3 FFT.cpp -lfftw3 -lfftw3f -lfftw3l
#ifdef USE_FFTW
#include <fftw3.h>
#endif
#include <vector>
#include <complex>
#include <algorithm>
#include <iterator>... | ALGO | 0.99414 | 6.129515 |
24ff9981-1ed6-45d2-a475-c629c71fc077 | Sr-Lobinho/Faculdade-Ciencia-da-Computacao | AEDs1/Lista01/Ex36.cpp | #include <iostream>
using namespace std;
int main(int argc, char** argv) {
float altura, peso, imc, pesoi, dif = 0;
cout << "Informe sua altura: ";
cin >> altura;
cout << "Informe seu peso: ";
cin >> peso;
imc = peso/pow(altura, 2);
if (imc < 16){
cout << "Magreza Grave";
}
else if (imc < 17){
cout << "Ma... | TOOL | 0.937099 | 3.827639 |
b28f74ed-a1fe-4e7b-8bfb-f3898227fe5f | Vitoom/Cplusplus-code | Word Search II/main.cpp | #include <iostream>
#include <vector>
#include <unordered_map>
#include <unordered_set>
#include <string>
using namespace std;
class Solution {
struct Tries {
string word;
unordered_map<char, Tries*> char_map;
bool isStr;
Tries(): isStr(false), word("") {}
};
void insert(st... | ALGO | 0.999848 | 5.653117 |
4222539a-4c67-45f3-85f4-e1080f55e681 | Jin-SukKim/GameEngine_Graphics | GameEgine/GraphicsRenderer/Lib/DirectXTK-main/Src/Geometry.cpp | #include "pch.h"
#include "Geometry.h"
#include "Bezier.h"
using namespace DirectX;
namespace
{
constexpr float SQRT2 = 1.41421356237309504880f;
constexpr float SQRT3 = 1.73205080756887729352f;
constexpr float SQRT6 = 2.44948974278317809820f;
inline void CheckIndexOverflow(size_t value)
{
... | ALGO | 0.990487 | 7.870293 |
5bd7fb08-63fb-4162-823f-6cfb330ccb2c | BurakCakan/Object-Oriented-Programming-Class-Projects | hw-03-[702201003]/hw3q3.cpp | //Burak Çakan - 702201003 - 04.02.2020
#include<iostream>
#include<list>
#include<set>
#include<algorithm>
#include<vector>
#include<string>
#include<fstream>
using namespace std;
class Matrix_COO{
private:
vector<int> vect1;
vector<int> vect2;
vector<double> vect3;
public:
Matrix_COO(string path_file){
ifstream... | DATA | 0.962192 | 3.091577 |
8e20590d-7fab-4d8b-b287-250c66ffcc60 | Avinash7223/my-c-programs | practices/eletric bill.cpp | #include<stdio.h>
int main()
{
float units,a,bill;
scanf("%f",&units);
if(units<=50)
{
a=(units*(0.50));
bill=(a+(0.2*a));
printf("the total amount is%f",bill);
}
else if((units>50)&&(units<=100))
{
a=(units*(0.75));
bill=(a+(0.2*a));
printf("the total amount is%f",bi... | ALGO | 0.999688 | 3.610385 |
2879711f-62f8-4eaa-bab3-0c73b98ea5d1 | FalseG0d/Algorithm-Data-Structure | LeetCode/Medium/NextPermutation.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<int> nextPermutation(int N, vector<int> arr){
// code here
// 1 2 3 4
// 1 2 4 3
// 1 3 2 4
... | ALGO | 0.99996 | 5.949417 |
218dc902-dc9f-44b8-8dde-a06d9247de1d | KazukiInoue/shot_detection | selectPrincipalColorThemes.cpp | #include <numeric>
#include "function.h"
using namespace std;
void selectPrincipalColorThemes(vector<vector<double>> &colorThemes, cv::Mat src, const int clusterNum,const int numToExtract ,vector<vector<double>> clusterInfo) {
/* clusterInfo =[x_center, y_center, pixelRatio, blue_center, green_center, red_center] ... | ALGO | 0.996572 | 4.36114 |
0a30bed4-d160-476e-be1f-b6ea0438b47a | tanvi14001/Codes | 128-longest-consecutive-sequence/longest-consecutive-sequence.cpp | class Solution {
public:
int longestConsecutive(vector<int>& nums) {
unordered_set<int> numSet(nums.begin(), nums.end());
int longest = 0;
for (int n : numSet) {
if (numSet.find(n - 1) == numSet.end()) {
int length = 1;
while (numSet.find(n + lengt... | ALGO | 0.999926 | 5.737335 |
a790aaf0-8369-45de-8e0a-17bceed1bfad | parth-jangam/leethub | 0802-find-eventual-safe-states/0802-find-eventual-safe-states.cpp | class Solution {
public:
vector<int> eventualSafeNodes(vector<vector<int>>& graph) {
int n=graph.size();
vector<int>adj[n];
for(int i=0;i<n;i++){
for(auto x:graph[i]){
adj[x].push_back(i);
}
}
vector<int>indegree(n,0);
for(int i... | ALGO | 0.999997 | 6.149931 |
7d75433b-e729-40a7-877a-114bf49004bb | Swaraj-pal/test | Sheet assignments/Arrays/CyclicRotation.cpp | // { Driver Code Starts
#include <stdio.h>
void rotate(int arr[], int n);
int main()
{
int t;
scanf("%d",&t);
while(t--)
{
int n;
scanf("%d",&n);
int a[n] , i;
for(i=0;i<n;i++)
scanf("%d",&a[i]);
rotate(a, n);
for (i = 0; i < n; i++)
... | ALGO | 0.999413 | 4.719544 |
db83f1ff-4fb9-43f5-ae2b-642736e203f4 | BharatiSukanya/CODEONFEST-Program | 101. Symmetric Tree.cpp | Given the root of a binary tree, check whether it is a mirror of itself (i.e., symmetric around its center).
Example 1:
Input: root = [1,2,2,3,4,4,3]
Output: true
Example 2:
Input: root = [1,2,2,null,3,null,3]
Output: false
Solution :
Time Complexity - O(n) where n is the number of nodes in the tree
class Solution... | ALGO | 0.999932 | 6.869717 |
b1b3a094-9f98-4617-8dd7-adf71e757817 | Ape-Alive/flutter_template | 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 |
af8bc36b-375f-47c6-a5a6-8225e37d5767 | subhashis002/CPP | STL/find1.cpp | #include<iostream>
#include<list>
#include<algorithm>
using namespace std;
int main(){
list<int> col1;
list<int>::iterator pos;
//insert element from 20 to 40
for(int i=20; i <=40; i++){
col1.push_back(i);
}
/*find the position of elemnet with value 3
* there is none, so pos get... | ALGO | 0.999726 | 4.135678 |
513f66f7-8be2-4117-ac7e-f51449e6a338 | 20pjh/cpp | b.Week_2/p97_1.cpp | #include <iostream>
using namespace std;
int main() {
for (int i = 1; i <= 5; i++) {
for(int j = 1; j <= i; j++){
cout << j;
}
cout << endl;
}
return 0;
}
#include <iostream>
using namespace std;
int main() {
for (int i = 5; i >= 1; i--) {
for(int ... | ALGO | 0.999645 | 3.236256 |
b8c8e945-2343-4e3b-9d4b-65672260869d | rakesh-i/codingproblems | fileevenodd.cpp | //Read integers from a file and put even and odd number in different files.
#include<iostream>
#include<math.h>
#include<ctype.h>
#include<cstring>
#include <cfloat>
using namespace std;
int main()
{
FILE *fp1, *fp2;
int number;
fp1 = fopen("DATA", "w");
for(int i=1;i<=30; i++){
scanf("%d", &nu... | TOOL | 0.995585 | 3.582238 |
8e16ac53-81fc-40d4-ad8a-17930d7cc319 | vusec/typesan | llvm/lib/CodeGen/CalcSpillWeights.cpp | #include "llvm/CodeGen/VirtRegMap.h"
#include "llvm/CodeGen/CalcSpillWeights.h"
#include "llvm/CodeGen/LiveIntervalAnalysis.h"
#include "llvm/CodeGen/MachineBlockFrequencyInfo.h"
#include "llvm/CodeGen/MachineFunction.h"
#include "llvm/CodeGen/MachineLoopInfo.h"
#include "llvm/CodeGen/MachineRegisterInfo.h"
#include "l... | ALGO | 0.996362 | 7.797577 |
61897182-2213-45cb-8384-a7c517620899 | hjiang13/LLMs-in-IR | POJ-104/5/1176.cpp | #include <iostream>
using namespace std;
int main ()
{
int i,j,k,js,l;
char c[600],d[600];
double a,b;
cin >> "%lf%s%s",&a,c,d);
if (strlen(c)!=strlen(d))
{
printf ("error");
return 0;
}
l=strlen(c);
js=0;
for (i=0; c[i]!='\0'; i++)
{
if ((c[i]=='A'||c[i]=='G'||c[i]=='C'||c[i]=='T')&&(d[i]=='A'||d[i]=='G'||d[i]=='C'||d... | ALGO | 0.999745 | 3.12694 |
bf139069-9217-4f95-b3d1-97f98bd8a2ad | DaidigCoin/DaidigCore | src/script/interpreter.cpp | #include "interpreter.h"
#include "primitives/transaction.h"
#include "crypto/ripemd160.h"
#include "crypto/sha1.h"
#include "crypto/sha256.h"
#include "pubkey.h"
#include "script/script.h"
#include "uint256.h"
typedef std::vector<unsigned char> valtype;
namespace {
inline bool set_success(ScriptError* ret)
{
i... | ALGO | 0.900839 | 5.606839 |
f55fa53d-7c1d-4d7f-bab7-19540b55bdb0 | ishandutta2007/codeforces | kuribohg/normal/842/D.cpp | #include<iostream>
#include<cstdio>
#include<algorithm>
#include<cstring>
using namespace std;
const int MAXN=1<<20;
int n,m,a[MAXN],c[MAXN];
struct Seg
{
int l,r;
int val;
}T[MAXN<<2];
void MakeTree(int x,int l,int r)
{
T[x].l=l,T[x].r=r;
if(l==r) {T[x].val=c[l-1];return;}
int mid=(l+r)>>1;
Mak... | ALGO | 0.999983 | 3.97196 |
9f82360c-d6d5-48be-8c2d-07ce3abb738a | kuldeeprec/amazontestserieslivegfg | tree/leftsumootree.cpp | #define MAX_HEIGHT 100000
// Tree Node
struct Node
{
int data;
Node* left;
Node* right;
};
// Utility function to create a new Tree Node
Node* newNode(int val)
{
Node* temp = new Node;
temp->data = val;
temp->left = NULL;
temp->right = NULL;
return temp;
}
int leftLeavesSum(Node *root);
// ... | ALGO | 0.995744 | 6.670337 |
80f982ec-a106-48b3-b3e3-67afdd827533 | servinmeow/SERVINHAJI | CircularQueue.cpp | #include <iostream>
using namespace std;
class CircularQueue
{
public:
CircularQueue(int s) : size(s), rear(-1), front(-1)
{
queue = new int[size];
}
void enqueue(int value)
{
if ((rear + 1) % size == front)
{
cout << "Queue is full" << endl;
return;... | ALGO | 0.956858 | 5.432643 |
a99daebd-b50e-499f-be14-4c455a60a8e8 | pingchungchang/codebook | 2_Graph/Incremental_SCC.cpp | struct IncrementalSCC{
#define pii pair<int,int>
#define fs first
#define sc second
#define tiii tuple<int,int,int>
//if u == v : ans[i] = -1
//if not connected : ans[i] = m
//all 0-indexed
int n;
vector<int> ans;
int m;
vector<tiii> all;
vector<int> SCC(int n,vector<vector<int>>& paths){
vector<int> scc_id(n... | ALGO | 0.999899 | 4.523758 |
8e4ef498-d0d4-4acd-bc22-c90172c64844 | mohsenuss91/FileIO-1 | main.cpp | #include <iostream>
#include <fstream>
#include <string>
#include <sstream>
using namespace std;
void sortArray(int x[]);
int main()
{
int x=0, n=0,largestNum=0;
int numbers[10000];
string line;
ifstream myfile; //Declaration
myfile.open("data10k.txt"); //File name
while (myfile.good()){
... | ALGO | 0.993165 | 3.657224 |
c3076cdd-8122-4e76-a08c-9ef7763f9ac0 | Tanichka2006/lab-2.0 | lab2.1.chukh/main.cpp | #include <iostream>
#include <cmath>
using namespace std;
int main() {
double a;
cin >> a;
cout << a << endl;
cout << "Your number is ";
cout << a << endl;
double z1 = ((a + 2) / sqrt(2 * a) - a / (sqrt(2 * a) + 2) + 2 / (a - sqrt(2 * a))) * (sqrt(a) - sqrt(2)) / (a + 2);
double z2 = 1 /... | ALGO | 0.986624 | 3.542697 |
9d102a89-48fc-42f1-82c9-af31bfcc05a0 | il999/CompetitiveProgramming | codeforces/1822/G1.cpp | #include <iostream>
#include <vector>
#include <map>
#include <set>
#include <algorithm>
#include <string>
#include <queue>
#include <array>
using namespace std;
using ll=long long;
const int MOD=998244353;
int add(int x, int y)
{
return ((x + y) % MOD + MOD) % MOD;
}
int mul(int x, int y)
{
return x * 1ll * y... | ALGO | 0.999801 | 5.009353 |
0711a140-34cc-4000-9dd5-55e281769e6b | lunixbochs/fs-uae-gles | src/archivers/lha/shuf.cpp | /* ------------------------------------------------------------------------ */
/* LHa for UNIX */
/* shuf.c -- extract static Huffman coding */
/* */
/* Modified Nobutaka Watazaki */
/* */
/* Ver. 1.14 Source All chagned 1995.01.14 N.Wa... | ALGO | 0.998879 | 5.938353 |
021e6317-5168-4370-84c4-880f0ea72430 | ishandutta2007/codeforces | temotoloraia/normal/888/E.cpp | #include <bits/stdc++.h>
#define F first
#define S second
#define mp make_pair
#define pb push_back
#define ll long long int
#define LEFT(a) ((a)<<1)
#define RIGHT(a) (LEFT(a) + 1)
#define MID(a,b) ((a+b)>>1)
#define MAX(a,b) ((a)>(b)?(a):(b))
#define MIN(a,b) ((a)<(b)?(a):(b))
using namespace std;
int n, m;
int a[40];... | ALGO | 0.999987 | 4.135806 |
5708b3a5-bde3-4f48-83b0-e5238982fedb | arvaldez/flutter-quiz-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.998859 | 6.785645 |
f743d34e-f3d7-4690-8487-a7b6ae091b1c | Aryagithubk/CrackYourPlacement | 90-subsets-ii/subsets-ii.cpp | class Solution {
public:
void helper(int ind,vector<int>&nums,int n,vector<int>&v,vector<vector<int>>&ans){
ans.push_back(v);
for(int i=ind; i<n; i++){
if(i > ind and nums[i] == nums[i-1]){
continue;
}
v.push_back(nums[i]);
helper(i+1,n... | ALGO | 0.99998 | 6.139557 |
9240580c-f8c4-4919-82b4-25871f8df7bd | avinashdhakne/LeetCode | 0875-koko-eating-bananas/0875-koko-eating-bananas.cpp | class Solution {
public:
int minEatingSpeed(vector<int>& piles, int h) {
int start = 1;
int end = *max_element(piles.begin(), piles.end());
// if(piles.size() == 1){
// return piles.front();
// }
while(start <= end){
int mid = start +... | ALGO | 0.999961 | 6.080567 |
438ea044-7973-419e-afc0-aafbc83336a0 | SREEDHAR-1/CSA5058 | exp 17.cpp | #include <stdio.h>
#include <stdint.h>
static const int IP[] = { 2, 6, 3, 1, 4, 8, 5, 7 };
static const int IP_INV[] = { 4, 1, 3, 5, 7, 2, 8, 6 };
static const uint64_t KEY = 0x133457799BBCDFF1;
static const uint64_t CIPHERTEXT = 0x0123456789ABCDEF;
uint64_t permute(uint64_t input, const int *table, int size) {
uint64... | ALGO | 0.999898 | 3.844141 |
d74311d9-5d3a-4592-ad07-3d28c2d6e9c1 | FelixKimmerle/Raytracer | Raytracer.cpp | #include "Raytracer.hpp"
#include "Sphere.hpp"
#include "Lambertian.hpp"
#include "Metal.hpp"
#include <iostream>
vec3 color(const Ray &r, Object *world, unsigned int depth)
{
hit_record rec;
if (world->hit(r, 0.001, MAXFLOAT, rec))
{
Ray scattered(vec3({0, 0, 0}), vec3({0, 0, 0}));
vec3 at... | ALGO | 0.871367 | 4.527936 |
69d8b00b-dc47-4f4a-a71e-0da8717fee35 | Ellon-M/cpp | cppfiles/c++files/oddnumberoutputwhileloopcpp.cpp | #include <iostream>
using namespace std;
int main(){
int nums;
nums=0;
while(nums<=10){
if(nums%2!=0){
cout<<nums<<endl;
}
nums++;
}
return 0;
}
| ALGO | 0.997324 | 3.636594 |
2ea04320-2f5a-4f3f-a50c-4cca3982d839 | vivekm92/practice | interviewBit-cpp/src/arrays/positive-negative.cpp | #include <iostream>
using namespace std;
// https://www.interviewbit.com/problems/positive-negative/
// T(n) : O(n) ; S(n) : O(1)
vector<int> positiveNegative(vector<int> &A) {
int pCount = 0, nCount = 0;
for (auto &a : A) {
if (a > 0) pCount++;
else if (a < 0) nCount++;
}
return {p... | ALGO | 0.997767 | 4.955436 |
793c5c08-476e-4968-98bd-7e7c3df2d1b9 | AlaminPu1007/leet-code | Leet-Code/695. Convert 1D Array Into 2D Array/2022_Convert_1D_Array_Into_2D_Array.cpp | #include <bits/stdc++.h>
using namespace std;
class Solution
{
public:
vector<vector<int>> construct2DArray(vector<int> &original, int m, int n)
{
vector<vector<int>> res;
if (original.size() != (n * m))
return {};
for (int i = 0; i < m; i++)
{
int startIdx = i * n;
int endIdx =... | ALGO | 0.999395 | 5.420768 |
5066df77-438f-499a-8783-e51d06a03dbf | YuxingTang/third_party-llvm | lib/Analysis/PostDominators.cpp | #include "llvm/Analysis/PostDominators.h"
#include "llvm/ADT/DepthFirstIterator.h"
#include "llvm/ADT/SetOperations.h"
#include "llvm/IR/CFG.h"
#include "llvm/IR/Instructions.h"
#include "llvm/IR/PassManager.h"
#include "llvm/Support/Debug.h"
#include "llvm/Support/GenericDomTreeConstruction.h"
using namespace llvm;
#... | ALGO | 0.988458 | 7.119006 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.