uuid string | repo_name string | relative_path string | content string | category string | algo_rel_score float64 | quality_score float64 |
|---|---|---|---|---|---|---|
5b24e275-a4ef-4a85-8b34-b2d4836078e6 | akbarraka/Materi-11-Praktikum-Searching | Praktikum Searching/GD2_D4 MI 2019A_Akbar Rakasiwi_19051397077.cpp | #include <iostream>
int data[100000];
int batas;
int triggerAscending = 0;
int triggerDescending = 0;
void hapusDanReset();
void tampilData()
{
for (int x = 0; x < batas; x++)
{
std::cout << "Data Index Ke-" << x << ": " << data[x] << "\n";
}
hapusDanReset();
}
void ascending()
{
for (int x = 0; x < batas; x+... | ALGO | 0.997794 | 3.705923 |
5438d4a9-2a31-4e84-a3e5-2b63e42ab402 | SiYouDi/xdoj | 函数的最大值.cpp | #include<stdio.h>
#include<math.h>
int main()
{
double max=0;
double a;
scanf("%lf",&a);
for(float i =0;i<10.0001;i+=0.0001)
{
double fx=-pow(i,3)+a*pow(i,2);
if(fx>=max)
max=fx;
}
printf("%.2lf",max);
return 0;
}
| ALGO | 0.999858 | 3.373074 |
5c64a13d-6bfa-497f-ae00-dbbd2be6cecf | ishandutta2007/codeforces | mangooste/normal/1335/C.cpp | #include <algorithm>
#include <cmath>
#include <cstring>
#include <iomanip>
#include <iostream>
#include <map>
#include <queue>
#include <random>
#include <set>
#include <string>
#include <vector>
using ll = long long;
using namespace std;
// #define int long long
#define all(a) a.begin(), a.end()
signed main() {
... | ALGO | 0.999951 | 4.484929 |
4e34c786-326f-41cc-95c5-4073ee492ad1 | SHRESTHGUPTA89/leetcode | 3264-final-array-state-after-k-multiplication-operations-i/3264-final-array-state-after-k-multiplication-operations-i.cpp | class Solution {
public:
vector<int> getFinalState(vector<int>& nums, int k, int multiplier) {
while(k!=0){
vector<int> ans = help(nums);
int min = ans[0];
int mi = ans[1];
min *= multiplier;
nums[mi] = min;
k--;
}
retur... | ALGO | 0.999991 | 4.802919 |
83b05851-ab0e-463a-be37-1a1e2fd713bf | ishandutta2007/codeforces | zdolny_kaczor/normal/1343/E.cpp | //Konrad Paluszek,University of Warsaw(former XIV LO Staszic)
//#STAY AT HOME
#ifndef LOCAL
#pragma GCC optimize("O3")
#endif
#define TIME (chrono::steady_clock::now().time_since_epoch().count())
#include<bits/stdc++.h>
#include<ext/pb_ds/assoc_container.hpp>
#include<ext/pb_ds/tree_policy.hpp>
#define xfm(a,b)a##b
#de... | ALGO | 0.999854 | 4.831272 |
f1496f0f-b2a3-4edc-bb36-7bd7b994ffe3 | Mohammad-Adilkhan3/gfg | mirrorTree.cpp | void mirror(Node* node) {
// code here
if(!node)return;
mirror(node->left);
mirror(node->right);
swap(node->left,node->right);
}
| ALGO | 0.999995 | 5.691655 |
8e52cb5a-cbf2-49a2-9bd4-786bdfa360fc | ThedRk1607/CPtemplates | InterviewPrep/Tree/BST/kthMin.cpp |
class Solution {
public:
void dfs(TreeNode*root,int &count,int &res,int k){
if(root==NULL)return;
dfs(root->left,count,res,k);
count++;
if(count==k){
res=root->val;
return ;
}
dfs(root->right,count,res,k);
}
int kthSmallest(TreeNo... | ALGO | 0.999996 | 5.704284 |
d8a5c28c-0420-42e3-801f-3ee275e0c540 | bwangelme/CAlgo | Heap/heap.cpp | //
// Created by michael tsui on 2019/1/2.
//
#include "heap.h"
namespace Heap {
PriorityQueue Initialize(int maxElements) {
if (maxElements < MIN_PQ_SIZE) {
Error("maxElements too small");
return nullptr;
}
auto heap = (PriorityQueue) malloc(sizeof(struct HeapStruct));
if (heap == n... | ALGO | 0.995873 | 4.81364 |
96c57f22-a91c-42de-92f2-25e81836e56b | salonijaiswal7412/DSA | DP/2D/UniqueGrids.cpp | //memoization
class Solution {
public:
int f(int i,int j,vector<vector<int>>& dp){
if(i==0 && j==0) return 1;
if(i<0 || j<0) return 0;
if(dp[i][j]!=-1) return dp[i][j];
int up=f(i-1,j,dp);
int left=f(i,j-1,dp);
return dp[i][j]=up+left;
}
int unique... | ALGO | 0.999995 | 6.5558 |
3a21828a-d7f9-4296-838e-0b1f46ebeb59 | bendeanwilly/BenClone2 | ALGORITHMS/Array/LeadersInArray.cpp | /*
Finding the leader ( elements greater than neighbouring elements ) in an array.
*/
#include <bits/stdc++.h>
#define ll long long
using namespace std;
void op(vector <ll> &arr)
{
int size=arr.size();
int cur_ldr=INT_MIN;
for(ll i=size-1;i>=0;i--)
{
if(arr.at(i)>cur_ldr)
{
c... | ALGO | 0.999986 | 4.404811 |
75dfc041-692d-4b4b-b304-f6740e909b0a | karlinarayberinger/PRIMARY_WEBSITE_COPY_15_NOVEMBER_2022 | fibonacci_sequence.cpp | /* preprocessing directives */
#include <iostream> // command line input and output
#include <fstream> // file input and output
#define MAXIMUM_N 45 // constant which represents maximum N value
/* function prototypes */
int compute_Nth_fibonacci_sequence_term_using_recursion(int N, std::ostream & output, int & C);
int... | ALGO | 0.999976 | 7.443712 |
4e2b5dbd-7163-44f5-a361-67d350a830b3 | jahirbd350/XPSC-04 | Week-03/Day-01/A_Is_It_a_Cat.cpp | #include<bits/stdc++.h>
#define ll long long
using namespace std;
int main()
{
int t;
cin>>t;
while (t--)
{
int n;
cin>>n;
string s;
cin>>s;
vector<char> v;
for(int i=0; i<n; i++){
v.push_back(tolower(s[i]));
}
auto it = unique... | ALGO | 0.999284 | 4.112464 |
9c8ca023-32ed-4edf-847f-9afe0e1c7abe | Sitto2002/LeetCode | FindNtermInFibonacci.cpp | #include <iostream>
using namespace std;
int find(int f){
if (f <= 1) {
return f;
}
return find(f-1) + find(f-2);
}
int fibonacci (int n) {
int a =0, b=1, temp;
cout << a << " " << b << " ";
for (int i=2; i<n; i++){
temp = a+b;
a = b;
b = temp;
cou... | ALGO | 0.99677 | 4.001546 |
d8c5012d-6c18-4faf-a413-9a39f70a5ada | Lokesh-Kumar-121/leetcode | 0009-palindrome-number/0009-palindrome-number.cpp | class Solution {
public:
bool isPalindrome(int x) {
string str=to_string(x);
string temp=str;
reverse(temp.begin(),temp.end());
if(str==temp)
return true;
else return false;
}
}; | ALGO | 0.999967 | 6.006169 |
1e5e8c1a-a6e1-4335-8b79-ab6a049a5660 | ishandutta2007/codeforces | andreysergunin/normal/318/A.cpp | #include <stdio.h>
#include <iostream>
#include <vector>
#include <algorithm>
#include <cstdlib>
#include <cmath>
#include <cstring>
#include <set>
#include <map>
#include <stack>
#include <ctime>
using namespace std;
int main() {
//freopen("input.txt", "r", stdin);
//freopen("output.txt", "w", stdout);
l... | ALGO | 0.999511 | 3.408454 |
e31dd5dd-2646-4dca-8885-ea2ba1749cd6 | Awaisgardezi0457/Beginner-To-Advanced-C-plus-plus-Course | C++/chapter5/123.cpp | //swap using Pointers:
#include <iostream>
using namespace std;
void swap(int* x,int* y){
int t=*x;
*x=*y;
*y=t;
}
int main()
{
int x=12,y=45;
cout<<x<<" "<<y<<endl;
swap(&x,&y);
cout<<x<<" "<<y;
} | ALGO | 0.999365 | 4.115699 |
e8d9ea46-68ea-4cc7-8220-ab56c5ec1416 | ArifKhan18/Competitive-Programming-II | codeforces/C_Removing_Smallest_Multiples.cpp | #include <bits/stdc++.h>
using namespace std;
using ll = long long;
using ull = unsigned long long;
using ld = long double;
#define endl '\n'
#define all(x) (x).begin(), (x).end()
#define rall(x) (x).rbegin(), (x).rend()
#define point(x) fixed << setprecision(x)
#define Fast... | ALGO | 0.999753 | 4.31312 |
5f06975f-62dd-484a-b45a-200278945b0c | jyx-fyh/algorithm | source/Dijkstra.cpp | //
// Created by ButcherX on 23-11-15.
//
#include"../header/heapEnhanced.h"
#include"../header/graph.h"
struct wrap
{
graphNode* node;
int dis;
wrap(graphNode* _node, int _dis):node(_node), dis(_dis){}
};
struct cmptor
{
bool operator()(const wrap* a, const wrap* b) {
return a->dis > b->dis;//... | ALGO | 0.999813 | 4.227677 |
841cd13f-0b9e-45f2-a606-098019fe5bde | THEDAKSHGAUR/cpp | cpp started 05_17_24/prac codes/12.GenericAndBinaryTree/10_30.cpp | //level order traversal
#include<iostream>
#include<queue>
using namespace std;
class Node{
public:
int data;
Node *left;
Node *right;
Node(int val){
this->data=val;
this->left=NULL;
this->right=NULL;
}
};
Node * createTree(){
cout<<"Enter the value :: "<<endl;
... | ALGO | 0.999889 | 4.886978 |
8e603110-5a11-4f46-9041-c542a501b5ba | siobhan-saoirse/siobhans-tf-src | src/game/server/tf/bot/behavior/scenario/capture_the_flag/tf_bot_escort_flag_carrier.cpp | #include "cbase.h"
#include "bot/tf_bot.h"
#include "bot/behavior/scenario/capture_the_flag/tf_bot_escort_flag_carrier.h"
#include "bot/behavior/scenario/capture_the_flag/tf_bot_attack_flag_defenders.h"
#include "bot/behavior/scenario/capture_the_flag/tf_bot_deliver_flag.h"
extern ConVar tf_bot_flag_escort_range;
Co... | ALGO | 0.984863 | 6.130558 |
a4551882-02f5-4ff3-9902-f3b27afe4dae | gvpavlov/Tom-Jerry | Tom and Jerry/field.cpp | #include "field.h"
void Board::makeBoard(int row, int column, const int tomX,
const int tomY, const int jerryX, const int jerryY)
{
for(int i = 0; i <= column; i++)
for(int j = 0; j <= row; j++)
board.push_back(Square(j, i));
// Assign squares to Tom and Jerry.
findSquare(tomX, tomY, tom);
(*tom).symbol =... | ALGO | 0.995795 | 3.985183 |
4d63f414-cb16-418b-aa01-2a1cbfb33807 | ehigham/ProjectEuler | src/src_cpp/prime_factor.cpp | // prime_factor.cpp calculates the largest prime factor of 600851475143.
// (C) Edmund Higham, Nov 2014
#include <iostream>
#include <time.h>
#include <ctime>
#define BIGNUM unsigned long
using namespace std;
int main(void){
BIGNUM A, B, C;
time_t start, finish;
A = 600851475143; // Number we want to find th... | ALGO | 0.999789 | 5.377944 |
8c53caa7-6dae-45d9-80d5-3a936b10ffcb | watashi/AlgoSolution | leetcode/weekly-330/2549.cpp | class Solution {
public:
int distinctIntegers(int n) {
set<int> st;
queue<int> q;
st.insert(n);
q.push(n);
while (!q.empty()) {
int s = q.front();
q.pop();
for (int i = 1; i <= n; ++i) {
if (s % i == 1 && st.insert(i).second) {
q.push(i);
}
}
}... | ALGO | 0.999781 | 6.051463 |
cb386e9a-b9a4-4653-9f96-d7fe30e666df | shrinivas-patil/Data-Structure-Algorithms | 04 Complete Cpp STL/Functors/functorOne.cpp | #include<iostream>
using namespace std;
class functorOne{
public:
bool operator()(int a, int b){
//compare in desc order
//if a>b->true, a should be placed before b
return a > b;
}
};
int main() {
functorOne cmp;
if(cmp(10,5)==true){
cout<<"10 is ... | ALGO | 0.995574 | 4.301303 |
846a1ca4-4b68-446c-878f-caaee3a42791 | m4oughi/100DaysofCode | pureCPP/0008. Day 8/Function Overloading/012. Inline Functions in Overloading/006. Performance Consideration - Inline Functions with Large Data Types/main.cpp | #include <iostream>
#include <vector>
using namespace std;
class Operations {
public:
// Inline function with vector passed by reference
inline void process(const vector<int>& v) {
cout << "Processing large vector. Size: " << v.size() << endl;
}
// Inline function with vector passed by value (... | TOOL | 0.942682 | 7.726414 |
9b64f51d-95c4-487f-badf-3b925f3155c5 | hfinkel/llvm-project-cxxjit | libcxx/test/std/iterators/predef.iterators/insert.iterators/insert.iter.ops/insert.iter.op=/lv_value.pass.cpp | // <iterator>
// insert_iterator
// requires CopyConstructible<Cont::value_type>
// insert_iterator<Cont>&
// operator=(const Cont::value_type& value);
#include <iterator>
#include <vector>
#include <cassert>
#include "nasty_containers.hpp"
template <class C>
void
test(C c1, typename C::difference_type j,
... | TEST | 0.860129 | 4.017076 |
83be8398-55b9-4c49-a1c8-0d6c31ddb2ab | kimusamu/PS_Test | Practice/Practice/Study/2025.03.19.cpp | #include <iostream>
#include <vector>
#include <algorithm>
#include <stack>
#include <string>
#include <map>
#include <unordered_map>
using namespace std;
/*
unordered_map<char, char> bracketPair = { {')', '('}, {']', '['}, {'}', '{'} };
bool isValid(string& s, int start)
{
stack<char> st;
unsigned int sz = ... | ALGO | 0.99967 | 5.442802 |
e5e6d88e-5c99-41f3-8449-0f80e7fd8ca7 | SamuelWu2001/LeetCode2024 | Trees/662. Maximum Width of Binary Tree/solution.cpp | /**
* Definition for a binary tree node.
* struct TreeNode {
* int val;
* TreeNode *left;
* TreeNode *right;
* TreeNode() : val(0), left(nullptr), right(nullptr) {}
* TreeNode(int x) : val(x), left(nullptr), right(nullptr) {}
* TreeNode(int x, TreeNode *left, TreeNode *right) : val(x), l... | ALGO | 0.999915 | 6.149157 |
e6a0f26d-0918-4732-a350-8074cc4ac749 | north-h/Match_code | 2023/Codeforces_-_SMU_Autumn_2023_Trial_8/B_Tea_Party.cpp | /*
* ==================================================================================
* Author: north_h
* Time: 2023-10-04 10:13:58
*
* Problem: B. Tea Party
* Contest: Codeforces - SMU Autumn 2023 Trial 8
* URL: https://codeforces.com/group/L9GOcnr1dm/contest/475594/problem/B
* MemoryL: 256 MB
* Tim... | ALGO | 0.999991 | 4.803826 |
63d9a645-5d7b-4e52-8f38-4e8fa5d20d16 | lrquad/TongueSimulation | TongueQT/TongueQT/src/bullet3-2.83.7/src/Bullet3OpenCL/BroadphaseCollision/b3GpuGridBroadphase.cpp |
#include "b3GpuGridBroadphase.h"
#include "Bullet3Geometry/b3AabbUtil.h"
#include "kernels/gridBroadphaseKernels.h"
#include "kernels/sapKernels.h"
//#include "kernels/gridBroadphase.cl"
#include "Bullet3OpenCL/Initialize/b3OpenCLUtils.h"
#include "Bullet3OpenCL/ParallelPrimitives/b3LauncherCL.h"
#define B3_BROADPHA... | ALGO | 0.969577 | 6.278336 |
b079e1d8-bc92-47fd-9f96-1bd90bee8f5e | EkanshGupta-02/LeetCode-Solution | Merge Sort - GFG/merge-sort.cpp | //{ Driver Code Starts
#include <stdio.h>
#include <bits/stdc++.h>
using namespace std;
/* Function to print an array */
void printArray(int arr[], int size)
{
int i;
for (i=0; i < size; i++)
printf("%d ", arr[i]);
printf("\n");
}
// } Driver Code Ends
class Solution
{
public:
void merge(i... | ALGO | 0.999867 | 6.41383 |
c6d91388-a058-47b7-9271-f0d38f246f83 | Rishabh-raj-kumar/HashMap-and-HashTables | custom_sort.cpp | #include "bits/stdc++.h"
using namespace std;
int main()
{
string str = "abcd";
map<char,int>maps;
for(int i=0;i<str.length();i++)
{
maps[str[i]]++;
}
vector<string>ans;
string order = "cba";
for(int i=0;i<order.length();i++)
{
if(maps.find(order[i]) != maps.end())
{
auto temp = maps.find(ord... | ALGO | 0.999991 | 3.959214 |
15ec4999-9c00-4109-9cae-484324e2ffd5 | rhgkstjf/algorithm-practice | 10250.cpp | #include<iostream>
using namespace std;
int main()
{
int T,H,W,N;
cin >> T;
for (int k = 0; k < T; k++)
{
cin >> H >> W >> N;
if (H >= 1 && W >= 1 && W <= 99 && N >= 1 && N <= H * W)
{
int i = N % H;
int j = N / H;
if (i > 0)
j++;
else
i = H;
cout << (i * 100) + j << endl;
}
}
re... | ALGO | 0.999339 | 3.5111 |
7480e1be-e5e9-414e-b55d-439f5e265a2a | ShreyaPrasad1209/Data-Structures-and-Algorithm-C- | Bitwise Tricks/FindTheDifference.cpp | class Solution {
public:
char findTheDifference(string s, string t) {
char v = 0;
for (char c: s) v ^= c;
for (char c: t) v ^= c;
return v;
}
};
| ALGO | 0.999966 | 6.479029 |
1dee3b66-ee72-4622-9233-ce458ed158ee | irvanbelajarit/contohprogram_pointer_rekursif_cpp | Kelompok 7/Sourcecode.cpp | #include <bits/stdc++.h>
using namespace std;
void permutasi(){
int n, p, x1=1, x2=1, hasil;
cout<<"Masukan Nilai N = ";
cin>>n;
cout<<"Masukan Nilai P = ";
cin>>p;
for(int i = 1; i <= n; i++){
x1 = x1*i;
}for(int i = 1; i <= n-p ; i++){
x2 = x2*i;
}
hasil = x1/x2;
cout<<"Nilai Permutasi dari "<<n<<en... | ALGO | 0.998872 | 3.745725 |
be34839d-88f5-4294-b474-705fecf5edd7 | qzmp/BGCP | GCPEA/LegalSpecimen.cpp | #include "LegalSpecimen.h"
void LegalSpecimen::mutate()
{
for (size_t i = 0; i < colors.size(); i++) {
for (size_t j = 0; j < colors[i].size(); j++)
{
if (rand() % colors.size() < mutationValue * colors.size())
{
fillValidColor(i, j);
}
}
}
}
void LegalSpecimen::fillValidColor(int node, int color... | ALGO | 0.972587 | 4.330527 |
47918490-9bf3-44e2-8663-0593896e3d19 | Saberml/UnrealEngine4 | Engine/Source/ThirdParty/CryptoPP/5.6.2/include/esign.cpp | // esign.cpp - written and placed in the public domain by Wei Dai
#include "pch.h"
#include "esign.h"
#include "asn.h"
#include "modarith.h"
#include "nbtheory.h"
#include "sha.h"
#include "algparam.h"
NAMESPACE_BEGIN(CryptoPP)
void ESIGN_TestInstantiations()
{
ESIGN<SHA>::Verifier x1(1, 1);
ESIGN<SHA>::Signer x2(... | ALGO | 0.939729 | 7.411178 |
059ddb22-ee68-47ff-aeaf-f6b6f37f58f0 | mlevim/lammps-nequip-test | src/TALLY/compute_heat_flux_tally.cpp | #include "compute_heat_flux_tally.h"
#include "atom.h"
#include "comm.h"
#include "error.h"
#include "force.h"
#include "group.h"
#include "memory.h"
#include "pair.h"
#include "update.h"
using namespace LAMMPS_NS;
/* ---------------------------------------------------------------------- */
ComputeHeatFluxTally::Co... | ALGO | 0.940438 | 6.012297 |
b4c1e377-3bfb-4267-ba75-a3caa17cd279 | nianqiaoju/agents | src/static_xx_gibbs_cpp.cpp | #include <Rcpp.h>
#include <R.h>
using namespace Rcpp;
// [[Rcpp::export]]
LogicalVector static_xx_gibbs_cpp(LogicalVector xx_previous,
NumericVector alpha,
double rho,
int y) {
int N = xx_previous.length();
Logic... | ALGO | 0.999662 | 5.058206 |
1c59c099-54c1-4c86-9433-7ee956632755 | hichemaichour/ACM-ICPC | Contests/ACM Contests/Rocky 2007/tree+.cpp | #include <iostream>
#include <fstream>
#include <sstream>
#include <iomanip>
#include <algorithm>
#include <vector>
#include <deque>
#include <list>
#include <stack>
#include <queue>
#include <set>
#include <map>
#include <bitset>
#include <string>
#include <iterator>
#include <functional>
#include <complex>
#inclu... | ALGO | 0.999542 | 3.265463 |
4dc9f5f0-e658-44af-b6e8-6f923e833580 | Mohammad-Sabbir-Ahmed/Competitive-Programming | LightOj/1072 - Calm Down.cpp | #include <stdio.h>
#include <string.h>
#include <math.h>
#include <stdlib.h>
#include <ctype.h>
#include <algorithm>
#include <iostream>
#include <vector>
#include <map>
#include <set>
#include <string>
#include <sstream>
#include <queue>
#define PI acos(-1)
using namespace std;
int main(){
freopen("in.txt","r"... | ALGO | 0.999405 | 3.545579 |
0428fbc3-c09a-4996-9ae1-9d6d234e196c | priyanshudhoni/Albanerowork | question18.cpp | #include<bits/stdc++.h>
using namespace std;
int main()
{
int n;
cin>>n;
int a[n];int j,k=0;
for(j=1;j<=n;j++)
{
if(n%j==0)
{
a[k]=j;k++;
}
}
for(j=0;j<k;j++)
cout<<a[j]<<" ";
}
| ALGO | 0.999983 | 4.208085 |
b0305267-b6cb-4383-9a72-1b1c7ef61cb8 | babikov02/lab-10 | Задание 3/Задание 3.cpp | #include "iostream"
#include "fstream"
#include "string"
using namespace std;
int main()
{
setlocale(NULL, "rus");
ifstream in("f.txt");
int count = 0;
cout << "Введите букву: " << endl;
char sym;
cin >> sym;
while (in.peek() != EOF) {
string n;
getline(in, n);
if (n[0] == sym)
count++;
}
cout << coun... | ALGO | 0.970329 | 3.687885 |
d6fecbe8-2bb2-4eca-84c5-de0e0f713c4c | kashroh/code | feb173_1.cpp | #include<iostream>
#include<vector>
#include<algorithm>
#include<limits.h>
#include<bits/stdc++.h>
using namespace std;
bool check(int u,int v,vector<int>& seq,int ind,int n)
{
if(u>v)
return false;
else if(u<0 || v<0 ||u>=n || v>=n)
return false;
else if(v-u+1>seq[ind])
return false;
return true;
}
int dp(int u,int v,... | ALGO | 0.999967 | 3.700688 |
fcba0a45-acb7-42bf-855a-e295a486ffc9 | 113bommy/deepmind_codecontests_refine | cpp_gold_filter_file/cpp_train_7457_12.cpp | #include <bits/stdc++.h>
using namespace std;
int a[100010], t[100010], f[10010];
int n, m, q, l, r, cnt;
int phi(int x) {
int sz = sqrt(x);
memset(t, 0, sizeof(t));
int tot = 0;
int ans = x;
for (int i = 2; i <= sz; i++) {
if (x % i == 0) t[++tot] = i;
while (x % i == 0) x /= i;
}
if (x != 1) t[+... | ALGO | 0.999975 | 4.288622 |
c4484858-a5fe-463e-9fba-bd09e7fa5f71 | frishma/cpp | 三只小猪.cpp | #include<iostream>
int main()
{
using namespace std;
int a=0;
int b=0;
int c=0;
cout<<"Сa b c"<<endl;
cin>>a;
cin>>b;
cin>>c;
if(a>b)
{
if(a>c)
{cout<<"Сa"<<endl;
}
else
{
cout<<"Сc"<<endl;
}
}
else
{
if(c>b){
cout<<"Сc"<<endl;
}
else
{cout<<"Сb"<<endl;
}
}
return 0;
}
| ALGO | 0.999124 | 3.261924 |
f021a7db-5d7f-424d-a30a-3455040147da | Charbel-11/Competitive-Programming | Contests/Codeforces/Educational 94/A.cpp | #include <iostream>
#include <string>
#include <map>
#include <set>
#include <cstring>
#include <vector>
#include <cmath>
#include <algorithm>
using namespace std;
typedef long long ll;
int main() {
ios::sync_with_stdio(0);
cin.tie(0), cout.tie(0);
int t; cin >> t;
while (t--) {
int n; cin >> n;
string s; c... | ALGO | 0.999982 | 3.71503 |
2dd2d9ac-2a60-4bce-90c8-0b682b198bbb | ShashwatC/Ray | ext/glm/test/core/core_func_integer_find_msb.cpp | // This has the programs for computing the number of leading zeros
// in a word.
// Max line length is 57, to fit in hacker.book.
// Compile with g++, not gcc.
#include <cstdio>
#include <cstdlib> // To define "exit", req'd by XLC.
#include <ctime>
#define LE 1 // 1 for little-endian, 0 for big-endian.
... | ALGO | 0.999105 | 3.19451 |
3a526199-03ca-4c76-ba21-6605e37e56d8 | sahiltambe18/DSA_F | 230-kth-smallest-element-in-a-bst/kth-smallest-element-in-a-bst.cpp | /**
* Definition for a binary tree node.
* struct TreeNode {
* int val;
* TreeNode *left;
* TreeNode *right;
* TreeNode() : val(0), left(nullptr), right(nullptr) {}
* TreeNode(int x) : val(x), left(nullptr), right(nullptr) {}
* TreeNode(int x, TreeNode *left, TreeNode *right) : val(x), l... | ALGO | 0.999995 | 6.204681 |
8bd07248-4196-48b7-9b9c-b422309f83ac | zhu-han/CASTLE | env/fairseq/fairseq/clib/libbase/balanced_assignment.cpp | /*
C++ code for solving the linear assignment problem.
Based on the Auction Algorithm from https://dspace.mit.edu/bitstream/handle/1721.1/3265/P-2108-26912652.pdf and the implementation from:
https://github.com/bkj/auction-lap
Adapted to be more efficient when each worker is looking for k jobs instead of 1.
*/
#includ... | ALGO | 0.999207 | 7.113842 |
8f69b824-c2ce-4814-bf7d-cdc27b07d131 | MOHDDANISH007/Question1 | Anagram_or_not.cpp | #include <iostream>
#include <map>
class Solution {
public:
bool isAnagram(std::string s, std::string t) {
if (s.length() != t.length()) {
return false;
}
map<char, int> m1;
map<char, int> m2;
// Count occurrences in the first string
for (int i = 0; i <... | ALGO | 0.999733 | 6.988323 |
ced6c7c3-f6eb-4aa8-bdeb-6e323517de8d | Pandey0008/Cpp | Pattern 4.cpp | #include<bits/stdc++.h>
using namespace std;
void pattern4(int n){
for(int i=1;i<=n;i++){
for(int j=1;j<=i;j++){
cout<<i <<" ";
}
cout<<"\n";
}
}
int main(){
int n;
cout<<"Enter the number"<<"\n";
cin>>n;
pattern4(n);
} | ALGO | 0.999437 | 4.14144 |
43a71964-cdb6-4102-9c44-9f03344151b9 | chenshaolong/C-Design-Patterns-and-Derivatives-Pricing-Exercises-Chapters-9-13 | C++ Design Patterns and Derivatives Pricing Exercises Chapters 9-13/Chapter 8/TreeAmerican.cpp | // C++ Design Patterns and Derivatives Pricing---Listing 8.5, page 146
#include "TreeAmerican.h"
#include <algorithm>
TreeAmerican::TreeAmerican(double FinalTime,
const PayOffBridge& ThePayOff_)
: TreeProduct(FinalTime),
ThePayOff(ThePayOff_)
{
}
TreePro... | ALGO | 0.917784 | 6.092403 |
76c07809-c1dc-4904-8475-2d187d9d57f6 | huanzochen/c-plusplus_playground | std_lib/list/list.cpp | #include <iostream>
#include <list>
using namespace std;
class Solution {
list<int> doubleLinkedList;
public:
// create LinkedList
Solution(){
doubleLinkedList = list<int>(4, -1);
doubleLinkedList.push_front(10);
doubleLinkedList.push_back(20);
doubleLinkedList.push_back(30);
doubleLinkedLi... | ALGO | 0.983428 | 5.306667 |
e76ddfb4-3dd1-43f6-ae09-95003d298f70 | rnsishan/Data_Structures_in_cpp | recursion 1b stringToInteger.cpp | /*
String to Integer
Write a recursive function to convert a given string into the number it represents. That is input will be a numeric string that contains only numbers, you need to convert the string into corresponding integer and return the answer.
*/
#include <iostream>
#include<cstring>
#include<cmath>
using nam... | ALGO | 0.999048 | 5.87962 |
545e37f9-f053-4bf7-8d1b-92efa6e17bf7 | AzizulHakimFayaz/Random_problems | A_Ilya_and_Bank_Account.cpp | #include <bits/stdc++.h>
using namespace std;
int main(){
string n;
cin>>n;
int k = n.length();
string num[k];
for(int i = 0;i<k-1;i++){
if(i==k-2){
num=num + n[k-1];
}
num[i]=n[i];
}
cout<<num<<endl;
} | ALGO | 0.999725 | 3.832366 |
5b3e1add-507d-4cec-935e-7fba2761aac3 | danishm026/IP | spoj/BUSYMAN/BUSYMAN.cpp | #include<stdio.h>
#include<algorithm>
#define MAX_N 100009
using namespace std;
struct Activity {
int start;
int finish;
};
bool compareActivityInterval(Activity firstActivity, Activity secondActivity) {
return firstActivity.finish < secondActivity.finish;
}
int maxNumberOfActivitiesThatCanBePerformed(Activity *... | ALGO | 0.999882 | 4.434592 |
2dbf79cc-c4e2-4d2d-9632-24d02c0ff7f0 | beepsid/leetcode | 66_plus_one/plus_one.cpp | class Solution {
public:
vector<int> plusOne(vector<int>& digits) {
int n = digits.size();
bool allNines = true;
for (int digit : digits) {
if (digit != 9) {
allNines = false;
break;
}
}
if (allNines) {
vector<int> result(n + 1, 0);
... | ALGO | 0.999904 | 7.111916 |
e3ad1300-2841-4d08-a187-f38b046ccb35 | minhson/snipersim_for_NVM_based_PIMs | test/bitmap-index-cim/main-cim-16-3.cpp | #include "/home/sonlm/workplace/DRAM-CIM/Ours/sniper/include/sim_api.h"
#define __STDC_LIMIT_MACROS
#define __STDC_CONSTANT_MACROS
#include <iostream>
#include <string>
#include <math.h>
#include "bitvector.h"
#include "ibis.h"
#include "index.h"
//#include "iapi.h"
int main()
{
int weeks = 3;
int users = 16... | DATA | 0.927403 | 3.104171 |
10de9554-5422-4b2a-b62f-b985afb0ef4d | yuli821/CXL-DMSim-cache | src/systemc/tests/systemc/misc/user_guide/chpt11.1/mean.cpp | /*****************************************************************************
mean.cpp --
Original Author: Martin Janssen, Synopsys, Inc., 2002-02-15
*****************************************************************************/
/*****************************************************************************
... | ALGO | 0.999323 | 4.69205 |
24670d76-1296-469b-b73d-3ad56fcadf1b | adiojha629/JIRP_LRM | active16/src/automata_learning_utils/lib/libalf/src/normalizer_msc.cpp | #include <stdlib.h>
#include <list>
#include <queue>
#include <string>
#include <stdio.h>
#ifdef _WIN32
#include <winsock.h>
#else
#include <arpa/inet.h>
#endif
#include "libalf/alphabet.h"
#include "libalf/normalizer.h"
#include "libalf/normalizer_msc.h"
#include "libalf/serialize.h"
namespace libalf {
using nam... | ALGO | 0.950949 | 3.893256 |
ccba7b51-ca37-4ac1-91e0-2d4b43d6f5eb | Mr-Python-in-China/LuoguProblem | ABC350E.cpp | #include <bits/extc++.h>
using namespace std;
namespace pbds = __gnu_pbds;
using ui = unsigned int;
using uli = unsigned long long int;
using li = long long int;
using ld = long double;
ld f(uli n, unsigned char a, ui x, ui y) {
static unordered_map<uli, ld> mem;
auto g = mem.emplace(n, 0);
if (!g.second) return ... | ALGO | 0.994323 | 3.743743 |
7eff0276-f27b-49bc-8ee6-0f1a91619252 | NYU-ZYJCS/Leetcode | 1590-make-sum-divisible-by-p/1590-make-sum-divisible-by-p.cpp | class Solution {
public:
int minSubarray(vector<int>& nums, int p) {
int x = 0;
for (auto num : nums) x = (x + num) % p;
if (x == 0) return 0;
unordered_map<int, int> idx;
int y = 0, res = nums.size();
idx[0] = -1;
for (int i = 0; i < nums.si... | ALGO | 0.999963 | 5.820357 |
5f1b2415-8e05-4e5d-833d-835244d8279e | J0shhT/Kattis | problems/keytocrypto/main.cpp | #include <iostream>
#include <string>
using namespace std;
inline int getOffset(char letter)
{
return letter-'A';
}
inline char getLetterWithOffset(char letter, int offset)
{
int current = getOffset(letter);
int fullOffset = ((current+offset)%26);
if (fullOffset < 0)
fullOffset = 26+fullOffset;
//std::cout <... | ALGO | 0.999938 | 4.467193 |
79550a59-9686-4c68-837b-47150ad11e1e | J9214/Baekjoon | c++/중력_큐.cpp | #include <iostream>
#include <queue>
using namespace std;
deque<int> Deque;
int main()
{
ios_base::sync_with_stdio(0);
cin.tie(0);
int N;
cin >> N;
string query;
string order;
int wall = 0;
bool isHorizon = true; //수평인가
bool isReverse = false;
//왼쪽이 뒤다 반대로 생각하자
for (int i = 0; i < N; ++i)
{
cin >> q... | ALGO | 0.999148 | 4.280849 |
ada85436-6b6f-4ff5-a58f-4ce45adaaac8 | harshaithireddy/GeeksForGeeks-Codes | Difficulty: Medium/Rat in a Maze Problem - I/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:
void solver(vector<vector<int>> &mat, vector<string> &res, int n, int i, int j, string curr){
if(i == n || j == n || i < 0 ||... | ALGO | 0.999789 | 6.729945 |
f85787d9-a36f-4b0b-834b-3b582307715d | sarvex/leetcode-jai | solution/2600-2699/2600.K Items With the Maximum Sum/Solution.cpp | class Solution {
public:
int kItemsWithMaximumSum(int numOnes, int numZeros, int numNegOnes, int k) {
if (numOnes >= k) {
return k;
}
k -= numOnes;
if (numZeros >= k) {
return numOnes;
}
k -= numZeros;
return numOnes - k;
}
}; | ALGO | 0.999962 | 5.283049 |
d74fe4a2-a634-4b6a-a032-ce25b072c328 | Tanmaygupta8503/Leetcode-GFG-Code-Repo | 1863. Sum of All Subset XOR Totals/code.cpp | class Solution {
public:
int subsetXORSum(vector<int>& nums) {
vector<vector<int>> subsets;
vector<int> current;
generateSubsets(nums, 0, current, subsets);
int sum = 0;
for(auto vec : subsets) {
int xorr = 0;
for(int i : vec) {
xorr ^=... | ALGO | 0.999994 | 5.874333 |
040f9476-fd71-43fc-b0d9-8e31998bc2dc | niuhua6677/learn | Biggroup/week1/DbLinkedList/Sources/Dmain.cpp | #include "Dblist.h"
int main() {
DLinkList head = NULL;
int num, x;
char commond;
while (1) {
system("cls");
showmenu();
DLinkList move = head;
cin >> commond;
switch (commond) {
case'1'://
head = DLinkListCreatT();
system("pause");... | ALGO | 0.997466 | 3.547519 |
f79ec5c3-5741-421d-a9e8-8ad157bb5e98 | VuDinhLongg/Competitive_Programming | ICPC/Vong Luyen Tap So 2 (03-08-2025)/D.cpp | // LonggVuz
#include<bits/stdc++.h>
using namespace std;
#define el cout << '\n'
#define inc(i, a, b, c) for(int32_t i=a; i<=b; i+=c)
#define dec(i, a, b, c) for(int32_t i=a; i>=b; i-=c)
#define fo(i, a, b) for(int32_t i=a; i<=b; i++)
#define fd(i, a, b) for(int32_t i=a; i>=b; i--)
#define out(x) return void(cout << (x... | ALGO | 0.999245 | 4.428702 |
dfb95a35-ca78-44b0-aedf-2a0422d15248 | HarshitMongre/Problem-Solving | lecture32.cpp | #include<bits/stdc++.h>
using namespace std;
void reachDest(int source, int destination){
cout << source << " , " << destination << endl;
if(source == destination){
cout << "Reached!"<< endl;
return;
}
reachDest(source+1, destination);
}
// Fibonacci series :
int fibonacci(int n){
... | ALGO | 0.999489 | 4.315514 |
1e59d77e-77db-4680-9daa-305cabcea71c | Radhesh-Sarma/Competitive-Coding | codeforces/1282/B2.cpp | #include<bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
#pragma comment(linker, "/stack:200000000")
#pragma GCC optimize("O3")
#pragma GCC optimize("Ofast")
#pragma GCC optimize("unroll-loops")
using namespace std;
using namespace __gnu_pbds;
#define ordered_set tre... | ALGO | 0.999931 | 3.741418 |
9f66d59d-bd2c-40e9-aaf8-c49346a61e25 | angel-utn/laboratorio1-20232c | Clase 05/Viernes Virtual/Ejemplo While 2/main.cpp | #include <iostream>
using namespace std;
int main(){
int n = 1, cpares = 0;
while(n != 0){
cout << "Número: ";
cin >> n;
if (n % 2 == 0){
cpares++;
}
}
cout << "Cantidad pares: " << cpares << endl;
return 0;
} | ALGO | 0.993058 | 4.455234 |
7fdcacdd-dd5c-4043-97d6-525505e1551c | adityakumar002216/60_days_code | 12_day.cpp | class Solution {
public:
int longestSubarray(vector<int>& nums) {
int n = (int)nums.size();
int mx = *max_element(nums.begin(),nums.end());
int i = 0;
int ans = 0;
while(i < n) {
if(nums[i] == mx) {
int curr = 0;
while(i < n && num... | ALGO | 0.999954 | 5.85055 |
60a48ccc-19b3-4eb1-bc09-5ce5ff822bf4 | liguigui/kamyu104-LeetCode | C++/cracking-the-safe.cpp | // Time: O(k^n)
// Space: O(k^n)
// https://en.wikipedia.org/wiki/De_Bruijn_sequence
// https://en.wikipedia.org/wiki/Lyndon_word
class Solution {
public:
string crackSafe(int n, int k) {
const int M = pow(k, n - 1);
vector<int> P;
for (int i = 0; i < k; ++i) {
for (int q = 0; ... | ALGO | 0.999926 | 7.001552 |
7837f71c-b1bf-4aee-8a58-526bd675abcd | TijilM/leetcode_solutions | 77.Combinations.cpp | class Solution {
public:
vector<vector<int>> combine(int n, int k) {
vector<vector<int>> ans;
vector<int> curr;
vector<int> nums;
func(ans,curr,n,k,1);
return ans;
}
void func(vector<vector<int>>&ans, vector<int> &curr,int n,int k,int start){
if(curr.size()==k... | ALGO | 0.999992 | 6.111214 |
60f09eca-b801-4293-a9f2-0e9b3d288e3e | L-Azria/flutterForamation_expenseTracker | windows/runner/utils.cpp | #include "utils.h"
#include <flutter_windows.h>
#include <io.h>
#include <stdio.h>
#include <windows.h>
#include <iostream>
void CreateAndAttachConsole() {
if (::AllocConsole()) {
FILE *unused;
if (freopen_s(&unused, "CONOUT$", "w", stdout)) {
_dup2(_fileno(stdout), 1);
}
if (freopen_s(&unuse... | TOOL | 0.9988 | 6.76073 |
762d1af3-1b4e-427c-bee0-defadc17f114 | 33arsenic75/Trading-Strategies-Implementation | LinearModel/Linear_Regression.cpp | #include <iostream>
#include <vector>
#include"Linear_Regression.h"
LinearRegression::LinearRegression(const std::vector<std::vector<double>>& input, const std::vector<double>& output)
: X(input), y(output), intercept(0.0) {
size_t num_features = X[0].size();
coefficients.resize(num_features, 0.0);
}
Linea... | ALGO | 0.982125 | 5.442666 |
8eb46fee-5318-454e-80ad-1aa30e278d26 | lost-name-man/ACM-Code | DingPa2025/8/1006.cpp | #include <cstddef>
#include <iostream>
#include <algorithm>
#include <cmath>
#include <cstring>
#include <string>
#include <cstdlib>
#include <vector>
#include <map>
#include <list>
#include <queue>
#include <deque>
#include <stack>
#include <set>
#include <functional>
#include <unordered_set>
#include <unordered_map>
... | ALGO | 0.999476 | 4.257552 |
0abb5eab-a113-4ae0-8a65-a37f257b87d3 | raincross7/code-similarity | codes/train_code/problem360/problem360_199.cpp | #include <bits/stdc++.h>
using namespace std;
int main()
{
int64_t N, a, b, c, d;
cin >> N;
vector<pair<int64_t, int64_t>> A(N), B(N);
for (int i = 0; i < N; i++)
{
cin >> a >> b;
A.at(i) = make_pair(a, b);
}
for (int i = 0; i < N; i++)
{
cin >> c >> d;
B.at(i) = make_pair(c, d);
}
... | ALGO | 0.999649 | 4.210394 |
55730c0d-c133-4f6d-bf44-09b9d160d4f3 | master-fury/30-Day_LeetCoding_Challenge_2020 | Week_1/Counting_Elements.cpp | class Solution {
public:
int countElements(vector<int>& arr) {
set <int> s;
for(int x:arr){
s.insert(x);
}
int count=0;
for(int x:arr){
if(s.count(x+1)==1)
count++;
}
return count;
}
}; | ALGO | 0.999648 | 5.443324 |
4675dc99-a2b7-4467-906b-d14a01484966 | lalitapunmagar1/Data-structures-and-Algorithm | Recursion/TOH.cpp | #include <iostream>
#include<math.h>
using namespace std;
void TOH(int n, char sour, char temp, char des){
int steps=0;
if (n == 1) {
cout << "Move Disk " << n << " from " << sour << " to " << des << endl;
return;
}
TOH(n - 1, sour, des, temp);
cout << "Move Disk " << n << " from " << ... | ALGO | 0.999832 | 4.599111 |
1339505d-d999-4b69-bf7e-96c2fe91b6b7 | iRobot42/Codewars | 8 kyu /To square(root) or not to square(root).cpp | #include <cmath>
std::vector<int> squareOrSquareRoot( const std::vector< int >& a ) {
std::vector< int > v( a.size() );
return { v.begin(), transform( a.cbegin(), a.cend(), v.begin(),
[]( int i ){ auto r{ sqrt( i )}; return fmod( r, 1 ) ? i * i : r; })};
}
| ALGO | 0.994998 | 3.574432 |
78555143-906d-4c46-96a7-3b0b300e4229 | dbdxnuliba/RBDyn-provides-a-set-of-classes-and-functions-to-model-the-dynamics-of-rigid-body-systems. | src/FK.cpp | // associated header
#include "RBDyn/FK.h"
// includes
// RBdyn
#include "RBDyn/Joint.h"
#include "RBDyn/MultiBody.h"
#include "RBDyn/MultiBodyConfig.h"
namespace rbd
{
void forwardKinematics(const MultiBody & mb, MultiBodyConfig & mbc)
{
const std::vector<Joint> & joints = mb.joints();
const std::vector<int> & ... | ALGO | 0.989886 | 5.12435 |
21d2c586-3876-4dfd-9c7e-eb6838b0c01d | hoangmanhkhiem/laptrinhonline.club | DemMauVoLonMonsterEnergy.cpp | #include<stdio.h>
#include<math.h>
int main() {
int A,B,C;
scanf("%d%d%d",&A,&B,&C);
if(A==B&&B!=C||B==C&&C!=A||C==A&&A!=B)
printf("2");
else if(A==B&&B==C)
printf("1");
else
printf("3");
} | ALGO | 0.999946 | 4.116194 |
fea0bfa9-a9a8-4e37-bb63-abd7463d8105 | SWEG-2014-EC-Batch/Code-Elite | FoP-I/Kidus Hawoltu/Printing_patterns_1.cpp | #include <iostream>
using namespace std;
int main(){
int row, col, num;
cout<<"Enter the number of rows: ";
cin>>row;
cout<<"Enter the number of columns: ";
cin>>col;
cout<<"Enter the starting number: ";
cin>>num;
for(int i=0;i<row*col;++i){
cout<<num+i<<' ';
if((i+1)%col... | ALGO | 0.985622 | 3.316953 |
edc9dd04-11b1-407f-a9f1-6fc93fbf466f | Hasib-17/Competetive_Programming | Graph/SCC(Kosaraju's Algo)_simpler templete.cpp | #include <bits/stdc++.h>
using namespace std;
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
using namespace __gnu_pbds;
#define ordered_set tree<int, null_type, less<int>, rb_tree_tag, tree_order_statistics_node_update>
#define fast \
ios_base::sync_with_st... | ALGO | 0.999955 | 5.255985 |
dfc63cb0-b530-4e32-a7b3-2bd42c930e5a | ishandutta2007/codeforces | rainair/normal/575/A.cpp | #include <bits/stdc++.h>
#define fi first
#define se second
#define DB double
#define U unsigned
#define P std::pair
#define LL long long
#define LD long double
#define pb emplace_back
#define MP std::make_pair
#define SZ(x) ((int)x.size())
#define all(x) x.begin(),x.end()
#define CLR(i,a) memset(i,a,sizeof(i))
#defin... | ALGO | 0.999937 | 3.689036 |
c6dcb28e-765d-4daf-a6be-775296bb8f63 | anaypaul/LeetCode | SortColors.cpp | class Solution {
public:
void swap(int *a, int *b){
int t = *a;
*a = *b;
*b = t;
}
void sortColors(vector<int>& nums) {
int index0 = 0;
int index1 = 0;
int index2 = nums.size() - 1;
while(index1<=index2){
if(nums[index1] == 0){
... | ALGO | 0.999967 | 5.429719 |
3d6eb4a1-8fd9-40c3-a6d9-3dd71512b0e1 | IntelLabs/c3-llvm | mlir/lib/Dialect/Affine/Utils/LoopUtils.cpp | #include "mlir/Dialect/Affine/LoopUtils.h"
#include "mlir/Analysis/SliceAnalysis.h"
#include "mlir/Dialect/Affine/Analysis/AffineAnalysis.h"
#include "mlir/Dialect/Affine/Analysis/LoopAnalysis.h"
#include "mlir/Dialect/Affine/Analysis/Utils.h"
#include "mlir/Dialect/Affine/IR/AffineOps.h"
#include "mlir/Dialect/Affine/... | ALGO | 0.978753 | 8.044133 |
827d7621-73cb-4e74-bf7b-77d9ae8f834a | gitInitArjunn/DailyLeet | SeatEveryone.cpp | // 2037. Minimum Number of Moves to Seat Everyone
class Solution {
public:
int minMovesToSeat(vector<int>& seats, vector<int>& students) {
sort(seats.begin(), seats.end());
sort(students.begin(), students.end());
int moves = 0;
for(int i = 0; i < students.size(); i++){
mo... | ALGO | 0.999905 | 5.027382 |
b8c7ee5a-4a89-4b6d-af2a-e94bf3cb2edb | zhupailiangx/opencv4.8 | modules/calib3d/src/ptsetreg.cpp | #include "precomp.hpp"
#include <algorithm>
#include <iterator>
#include <limits>
#include "usac.hpp"
namespace cv
{
int RANSACUpdateNumIters( double p, double ep, int modelPoints, int maxIters )
{
if( modelPoints <= 0 )
CV_Error( Error::StsOutOfRange, "the number of model points should be positive" );
... | ALGO | 0.999069 | 6.006679 |
bded2fb6-6a3b-4dc0-8a00-4ce00f4611d0 | ysonggit/codelib | cci/9-9-place_queues.cpp | #include <iostream>
#include <cmath>
using namespace std;
/* Eight queen puzzle algorithm:
http://en.wikibooks.org/wiki/Algorithm_Implementation/Miscellaneous/N-Queens
*/
const int N = 8;
int position[N];
// if the k^th queen should be placed on i^th position of given row
bool is_safe(int queen_number, int row_posi... | ALGO | 0.998284 | 4.461338 |
189d2248-00ae-4d57-a693-f3dc68980193 | Monal-Patel/amrsolver | lib/boost/libs/graph/example/edge_coloring.cpp | #include <iostream>
#include <boost/config.hpp>
#include <boost/graph/adjacency_list.hpp>
#include <boost/graph/edge_coloring.hpp>
#include <boost/graph/properties.hpp>
/*
Sample output
Colored using 5 colors
a-d: 4
a-f: 0
b-c: 2
b-e: 3
b-g: 1
b-j: 0
c-d: 0
c-e: 1
d-f: 2
d-i... | ALGO | 0.995845 | 6.263834 |
694d4228-5054-4f61-8898-2af9aa88f48c | fenychn0206/OI-Codes | Luogu/小鱼的航程.cpp | #include <bits/stdc++.h>
using namespace std;
int main(){
long long x, n;
cin >> x >> n;
long long week;
week = (x + n) / 7 * 2;
cout << (n - week) * 250;
return 0;
} | ALGO | 0.999863 | 3.092865 |
4282b19a-d2d9-4dc4-98fb-2b1ffab5780a | MariaChrysafis/CompetitiveProgramming | AtCoder/dp/s.cpp | #include <iostream>
#include <vector>
using namespace std;
const int MOD = 1e9 + 7;
vector<vector<int>> new_dp;
vector<vector<int>> old_dp;
vector<vector<int>> identity;
int to_int(char c){
return c - '0';
}
int main(){
string K;
cin >> K;
int D;
cin >> D;
new_dp.resize(D), old_dp.resize(D);
... | ALGO | 0.999913 | 4.841053 |
dbb482de-f5ab-46f6-846c-4ef27a8523b8 | RZXQ/cpp | TCTM/Regular_Courses/Level_4/code/LESSON_08/L4_08_HOMEWORK/分糖果.cpp | #include<bits/stdc++.h>
using namespace std;
int main() {
int n, l, r;
cin >> n >> l >> r;
if (r / n * n > l) cout << n - 1;
else cout << r % n;
return 0;
}
| ALGO | 0.999861 | 3.012449 |
47c60237-20fe-4414-b35e-141969d35e73 | sujal-p0408/Leetcode-Solved-Problems | 0034-find-first-and-last-position-of-element-in-sorted-array/0034-find-first-and-last-position-of-element-in-sorted-array.cpp | class Solution {
public:
int findFirst(vector<int>& nums, int target)
{
int n=nums.size();
int low=0;
int high=n-1;
int ans=-1;
while(low<=high)
{
int mid=low+(high-low)/2;
if(nums[mid]==target)
{
ans=mid;
high=mid-1;
}
else if(n... | ALGO | 0.999966 | 6.538935 |
58f25b4d-ef36-4014-a6e0-d15ba4e6f4d8 | vitorcostadev/CPlusPlus | Algorithms II/Modularization/ex02.cpp | /*
Elabore uma função que realize a conversão de Fahrenheit (F) para graus Celsius (C), onde F é passado como
parâmetro e C é retornado. Sabe-se que os pontos de fusão e ebulição nas escalas Celsius e Fahrenheit são: 0ºC
e 100ºC, e 32ºF e 212ºF, respectivamente. Crie também um programa para testar tal função.
Formula:... | TOOL | 0.934849 | 5.34729 |
b5ac5141-31d5-4946-b453-633aaa33b5a3 | IronDumpling/computer-graphics-algos | bounding-volume-hiercarchy/libigl/include/igl/polar_dec.cpp | // From Olga's CGAL mentee's ARAP code
template <
typename DerivedA,
typename DerivedR,
typename DerivedT,
typename DerivedU,
typename DerivedS,
typename DerivedV>
IGL_INLINE void igl::polar_dec(
const Eigen::PlainObjectBase<DerivedA> & A,
Eigen::PlainObjectBase<DerivedR> & R,
Eigen::PlainObjectBase<D... | ALGO | 0.999788 | 6.383218 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.