uuid string | repo_name string | relative_path string | content string | category string | algo_rel_score float64 | quality_score float64 |
|---|---|---|---|---|---|---|
d9c8ce15-3dd0-4aa1-bce2-d0a21325cca8 | colinz2/leetcode_solutions | solutions/design-skiplist/design-skiplist.cpp | // @Title: Design Skiplist
// @Author: colinjxc
// @Date: 2022-03-14T12:03:22+08:00
// @URL: https://leetcode-cn.com/problems/design-skiplist
#define kMaxLevel 16
#define N 999
struct Node {
int key;
vector<Node*> next;
Node* Next(int level) {
return next[level];
}
void SetNext(int level, Node* node... | ALGO | 0.999795 | 5.188042 |
f92b5055-b17a-403a-ab30-4ea970b07ba0 | PaukIsUha/optimizing_formating_code | predictions/submissions-aizu-cot-gpt35/Codenet/p00297/873248398/response_7.cpp | #include <algorithm>
#include <iostream>
#include <vector>
using namespace std;
struct SegTree {
int n;
vector<int> Max;
vector<int> Min;
void init(int n_) {
n = n_;
Max.resize(n);
Min.resize(n);
fill(Max.begin(), Max.end(), -inf);
fill(Min.begin(), Min.end(), inf);
}
void min_update... | ALGO | 0.999294 | 4.575032 |
82f098dc-1eef-492c-b755-84a15bbd6d54 | Markus28/multiresolution_algorithms_code | fixed_point_algorithm/src/InverseRadonTransform.cpp | #include <cassert>
#include <math.h>
#include "InverseRadonTransform.h"
InverseRadonTransform::InverseRadonTransform(unsigned int N_phi, unsigned int N_r, double r0): a(N_r+1, std::vector<double>(N_r+1, 0)), b(N_r+1, std::vector<double>(N_r+1, 0)){
R_0 = r0;
this->N_phi = N_phi;
this->N_r = N_r;
h_phi ... | ALGO | 0.99914 | 5.784743 |
2fbf93fe-f34b-4deb-b2ff-2e0c8d98a124 | Hush-Engine/hush-llvm | libcxx/test/std/containers/sequences/vector.bool/insert_range.pass.cpp | // UNSUPPORTED: c++03, c++11, c++14, c++17, c++20
// ADDITIONAL_COMPILE_FLAGS(has-fconstexpr-steps): -fconstexpr-steps=2000000
// template<container-compatible-range<bool> R>
// constexpr iterator insert_range(const_iterator position, R&& rg); // C++23
#include <sstream>
#include <vector>
#include "../insert_range... | TEST | 0.978546 | 7.030161 |
378f97f6-ee05-4bab-b36d-ce006980ac95 | MRwangmaomao/semantic_slam_nav_ros | Thirdparty/g2o/g2o/core/hyper_graph.cpp | #include "hyper_graph.h"
#include <assert.h>
#include <queue>
namespace g2o {
HyperGraph::Vertex::Vertex(int id) : _id(id)
{
}
HyperGraph::Vertex::~Vertex()
{
}
HyperGraph::Edge::Edge(int id) : _id(id)
{
}
HyperGraph::Edge::~Edge()
{
}
void HyperGraph::Edge::resize(size_t size)
{
... | ALGO | 0.973842 | 5.601523 |
a135823c-4a98-4b00-810d-77834fe0b210 | ip99202/Algorithm | DFS, BFS/1697_숨바꼭질.cpp | #include<iostream>
#include<queue>
using namespace std;
queue<pair<int, int>>q;
int visited[100001];
int n, k;
int now, cnt;
int way[3] = { -1,1,2, };
void bfs(int st, int fin) {
visited[st] = 1;
q.push(make_pair(st, cnt));
while (!q.empty()) {
now = q.front().first;
cnt = q.front().second;
if (now == k) {
... | ALGO | 0.999924 | 3.541092 |
41a48426-41de-45fb-a8b7-0d2e22fb6f14 | Max2772/FoA-P-2-Semester- | LabWork_7/Task_3/taskhashtable.cpp | #include "taskhashtable.h"
void TaskHashTable::RemoveNegativeKeys()
{
for (int key = -10; key < 0; ++key) {
int index = hash(key);
if (index < 0 || index >= TABLE_SIZE) {
return;
}
while (!table[index].empty()) {
table[index].pop();
}
}
}
| ALGO | 0.981205 | 3.284692 |
d20f19bc-10c9-46ea-9128-a2565937e826 | siddharthSingh2003/A-to-Z | palindromeString.cpp | #include <iostream>
using namespace std;
bool palindrome(int i, string &s)
{
if (i >= s.length() / 2)
return true;
if (s[i] != s[s.length() - i - 1])
return false;
return palindrome(i - 1, s);
}
int main()
{
string s = "madam";
cout << palindrome(0, s);
cout << endl;
retu... | ALGO | 0.999949 | 4.36046 |
6a11af1f-c982-4f01-8075-4fc7684b7a06 | trinhminhtriet/leetcode | solutions/1700-1799/1732.find-the-highest-altitude/Solution.cpp | class Solution {
public:
int largestAltitude(vector<int>& gain) {
int ans = 0, h = 0;
for (int v : gain) h += v, ans = max(ans, h);
return ans;
}
}; | ALGO | 0.999927 | 6.082428 |
ea84b3ab-4cdc-4a9f-8454-42cf6556de83 | ishangoyal13/fullstackDevelopment | C++/Random_programs/02 Time and Space.cpp | #include <iostream>
#include<cstring>
#include<climits>
using namespace std;
void lps(char array[]) {
int len = strlen(array);
bool array_lps[len][len];
for (int i = 0; i < len; i++) {
for (int j = 0; j < len; j++) {
array_lps[i][j] = false;
}
}
for (int diag = 0; diag < len; diag++) {
int si = 0;
int... | ALGO | 0.999653 | 3.595341 |
fc13437c-497c-4009-a194-98d061674061 | JusticeAU/Crawler-Source | soloud/src/tools/tedsid2dump/sid.cpp | // Issues:
// - Filter cutoff frequencies not 100% accurate
// - Combined waveforms of the 6581 incorrect (SID card used 8580 anyway)
// - filter distortion not emulated
// - no joystick or paddle support
// - probably many more
#include <math.h>
#include <memory.h>
#include "sid.h"
#include "Tedmem.h"
#define ... | ALGO | 0.922956 | 4.7598 |
2e867557-7d2f-427e-9e07-47ceb3ca3ab9 | SirECMG/aoc2024 | aocday1b/aoc1b.cpp | #include <iostream>
#include <unordered_map>
#include <fstream>
#include <vector>
#include <sstream>
/*
--- Part Two ---
Your analysis only confirmed what everyone feared: the two lists of location IDs are indeed very different.
Or are they?
The Historians can't agree on which group made the mistakes or how to read... | ALGO | 0.999368 | 6.056078 |
22dbb3e5-3402-432e-bbf6-a053c5fa88d5 | illillli/codes | codeforce/1538A.cpp | #include <bits/stdc++.h>
#define int long long
#define pll pair<ll, ll>
#define PB emplace_back
#define endl "\n"
#define mod (int)(1E9 + 7)
#define llinf 9223372036854775807
#define intinf 2147483647
#define pi acos(-1)
const int N = 1e5 + 5;
using namespace std;
int t, n;
int arr[N];
signed main()
{
ios::sync_wi... | ALGO | 0.999454 | 4.404616 |
b667ad29-cace-41fc-be47-4f091808fb42 | Countermatt/Brahms-cyclon-expe | local/code/expe_param/brahms/src/utils/string.cpp | #include "utils/string.hpp"
#include "utils/random.hpp"
void splitString(std::vector<std::string> &l, const std::string& s, char sep) {
if (!l.empty())
l.clear();
if (s.empty())
return;
std::string item;
int itemStartPos = 0;
for (unsigned int i = 0; i < s.size(); i++) {
if (s[i] == sep) {
... | TOOL | 0.914243 | 5.655744 |
26af6631-3895-4576-ac3c-c8ce561431fe | Anujain62/cpp | FindSumOfANumberInTheFormOfSingleDigit.cpp | #include<iostream>
using namespace std;
int main(){
int n,sum=0,a;
cout<<"enter a number:";
cin>>n;
while(n>0){
sum+=n%10;
n/=10;
}
while(sum>9){
a=0;
while(sum>0){
a+=sum%10;
sum/=10;
}
sum=a;
}
cout<<"sum = "<<... | ALGO | 0.99988 | 4.167049 |
eb174124-77fb-456a-a9fd-15f28343547f | GoofyAsh6795395/Algorithm | MaximumSubarray/main.cpp | #include <iostream>
using namespace std;
#define maxx 100
int arr[maxx];
typedef struct inf{
int l;
int r;
int sum;
};
struct inf crossingMaximum(int l,int mid,int r){
int idxL,idxR,idxML = mid,idxMR = mid+1;
int maxL = arr[mid],maxR = arr[mid+1],max = arr[mid] + arr[mid+1];
int sumL = arr[m... | ALGO | 0.999831 | 4.477402 |
a57e3888-a7b6-4617-9995-b08618140f1b | Segfault1602/IIR_Benchmark | src/basic_filter.cpp | #include "basic_filter.h"
#include "filter_coeffs.h"
BiquadFilter::BiquadFilter()
{
}
void BiquadFilter::SetCoeffs(std::span<const float> coeffs)
{
b0_ = coeffs[0];
b1_ = coeffs[1];
b2_ = coeffs[2];
a1_ = coeffs[3];
a2_ = coeffs[4];
x0_ = 0.f;
x1_ = 0.f;
x2_ = 0.f;
y0_ = 0.f;
... | ALGO | 0.948876 | 5.756763 |
00922f9a-a7bc-414c-ad33-696536b7cbc9 | in-formant/in-formant | src/analysis/filter/sosfilter.cpp | #include "filter.h"
#include <algorithm>
rpm::vector<double> Analysis::sosfilter(const rpm::vector<std::array<double, 6>>& sos, const rpm::vector<double>& x)
{
rpm::vector<double> y = x;
for (const auto& sec : sos) {
rpm::vector<double> b {sec[0], sec[1], sec[2]};
rpm::vector<double> a {sec[3]... | ALGO | 0.994471 | 5.224421 |
1aa6d0bc-4f45-44d3-b6e5-a1928f2bd634 | SidanthR/MyPepcoding | 3_FunctionAndArray/spanOfArray.cpp | #include <iostream>
int spanOfArray(int* arr, int n) {
int max = arr[0], min = arr[0] ;
for(int i = 0; i < n; i++) {
max = max < arr[i] ? arr[i] : max;
min = min > arr[i] ? arr[i] : min;
}
// std::cout << min << std::endl;
// std::cout << max << std::endl;
return ma... | ALGO | 0.997013 | 4.321001 |
a188e579-e23f-4937-913a-b3d4e7619977 | sumeragizzz/atcoder | src/ABC/212/B.cpp | #include <bits/stdc++.h>
using namespace std;
int main() {
string s;
cin >> s;
bool all = true;
bool next = true;
for (int i = 0; i < s.size() - 1; i++) {
if (s.at(i) != s.at(i + 1)) {
all = false;
}
int t = s.at(i) - '0';
t = t == 9 ? -1 : t;
in... | ALGO | 0.999865 | 3.346602 |
21f228dd-87e1-43d5-bc7c-c31bb8b9ad2a | Gobukgol/Algorithm | DP/B11726.cpp | #include <cstdio>
int main(int argc,const char* argv[]){
int dp[1001];
int n;
scanf("%d",&n);
dp[1] = 1; dp[2] = 2;
for(int i=3;i<=n;i++)
dp[i] = (dp[i-1] + dp[i-2]) % 10007;
printf("%d",dp[n]);
return 0;
}
| ALGO | 0.999967 | 4.280865 |
c76610ed-66da-4f9e-af3c-9f93567c8b25 | pah-10/Studies-C-Plus-Plus | Loops/exe23.cpp | #include <iostream>
#include <math.h>
using namespace std;
int main() {
float denominador = 50, S = 0, termos = 0, i = 1, j=0;
//maneira1
while(i <= 50){
termos = pow(2,i)/denominador;
S = S + termos;
i = i + 1;
denominador = denominador - 1;
}
cout<<"S = "<<S;
cout<<endl;
//maneira2
w... | ALGO | 0.999668 | 3.265582 |
5d6ad593-79a5-4710-8d97-f0894694632b | PrashantSaroj/Leetcode-Practice | cpp/P2530.cpp | #include <bits/stdc++.h>
using namespace std;
class Solution {
public:
long long maxKelements(vector<int>& nums, int k) {
priority_queue<int> maxHeap(nums.begin(), nums.end());
long long score = 0;
while (k--) {
int curMax = maxHeap.top();
maxHeap.pop();
... | ALGO | 0.999936 | 5.543949 |
97daec3a-d49b-4498-88d2-29266eee33fb | psycomp/RambamRoboticsClub | Robotics 2016/libraries/PID_AutoTune_v0/PID_AutoTune_v0.cpp | #if ARDUINO >= 100
#include "Arduino.h"
#else
#include "WProgram.h"
#endif
#include <PID_AutoTune_v0.h>
PID_ATune::PID_ATune(double* Input, double* Output)
{
input = Input;
output = Output;
controlType =0 ; //default to PI
noiseBand = 0.5;
running = false;
oStep = 30;
SetLookbackSec(10);
lastTime = millis... | ALGO | 0.97183 | 5.558713 |
938cb6f8-baf9-430e-b863-45c0fec8a690 | SachRestated/Codeforces-submissions | Div 3. Round 656/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;
#define int long long
#define sz(v) (int)v.size()
#define pr pair<int, int>
#define v1d vector<int>
#define mp make_pair
#define pb push_back
#define v1p vector<pr>
#def... | ALGO | 0.999854 | 4.603753 |
d31a29bc-74a2-4cd8-8a3e-e0d7db9fc85d | luke1546/Algorithm | 프로그래머스/1/12940. 최대공약수와 최소공배수/최대공약수와 최소공배수.cpp | #include <string>
#include <vector>
using namespace std;
int gcd(int a, int b){
return b ? gcd(b,a%b) : a;
}
vector<int> solution(int n, int m){
return {gcd(n,m),n*m/gcd(n,m)};
} | ALGO | 0.999625 | 5.505673 |
aab4c4c1-3dbf-440d-84d4-e41e053b94a7 | reo0105/atcoder | 競プロの鉄則/A16.cpp | #include <bits/stdc++.h>
using namespace std;
int main()
{
int n;
vector<int> a(100005), b(100005);
vector<int> dp(100005, -1);
cin >> n;
for (int i = 2; i <= n; i++) {
cin >> a.at(i);
}
for (int i = 3; i <= n; i++) {
cin >> b.at(i);
}
dp.at(1) = 0;
dp.at(2) ... | ALGO | 0.999943 | 3.260704 |
5367849a-9303-4225-8566-ce201dd5c906 | jihad-islam/My-Programming-Brain | 2. C++/5. Class and String/4.1.reverse_word_print.cpp | #include <bits/stdc++.h>
using namespace std;
void fun(stringstream &ss) // must & dewa lagbe. karon address receive kortesi
{
string w; // new ekta string declare korlam
if (ss >> w) // etai mainly base case. 'ss' variable protibar check korbe tar vitor word ase kina. word thakle 'w' ke diye dibe. na thakle ... | ALGO | 0.996774 | 5.113356 |
ab2d8184-d886-4865-9672-db632b220985 | chapel-lang/chapel-attic | third-party/llvm/llvm-src/lib/Transforms/Scalar/ConstantProp.cpp | #include "llvm/ADT/SmallPtrSet.h"
#include "llvm/ADT/SmallVector.h"
#include "llvm/ADT/Statistic.h"
#include "llvm/Analysis/ConstantFolding.h"
#include "llvm/Analysis/TargetLibraryInfo.h"
#include "llvm/IR/Constant.h"
#include "llvm/IR/InstIterator.h"
#include "llvm/IR/Instruction.h"
#include "llvm/Pass.h"
#include "ll... | TOOL | 0.920386 | 7.834846 |
7085eaa7-86e3-457b-9b18-5926ec58c852 | eldeshue/PS | BOJ/unclassified/2003_solved.cpp |
#include <iostream>
#include <vector>
int main()
{
std::ios_base::sync_with_stdio(false);
std::cin.tie(nullptr);
std::cout.tie(nullptr);
int N, M;
std::cin >> N >> M;
std::vector<int> nums(N);
for (int i = 0; i < N; ++i)
{
std::cin >> nums[i];
}
// two pointer
int cnt = 0, sum = 0, fast = 0, slow = 0;
... | ALGO | 0.999988 | 4.508026 |
fc780c17-46ea-4151-89d8-0d251dcc5a4d | aleafall/DS-A | leetcode/lc0042.cpp | //
// Created by aleafall on 16-11-9.
//
#include <iostream>
#include <vector>
using namespace std;
class Solution {
public:
int trap(vector<int> &height) {
int left = 0, right = height.size() - 1;
int ans = 0, leftMax = 0, rightMax = 0;
while (left <= right) {
if (height[left] <= height[rig... | ALGO | 0.999936 | 6.063752 |
09399133-765d-4ea9-b4a3-961c491f42fb | Nakib-Arman/CSE318---ArtificialIntelligence | 3.ChainReaction/.history/main_20250614175623.cpp | #include <bits/stdc++.h>
using namespace std;
#define DEPTH 3
class Cell {
int orb_num;
int critical_mass;
char color;
public:
Cell() {
this->orb_num = 0;
this->color = 'W';
this->critical_mass = 4;
}
// Cell(int orb_num, char color) {
// this->orb_num = orb_... | ALGO | 0.999319 | 4.687259 |
7aedf044-766f-47ec-a21e-ffe0d82a681d | sm-aminul-islam/SEU-CSE-Practice-Level01 | H.cpp | #include<bits/stdc++.h>
using namespace std;
int32_t main()
{
ios_base::sync_with_stdio(false);
cin.tie(nullptr);
for(int i=1;i<=9;i++)
{
for(int ii=1;ii<=9;ii++)
{
cout<<i<<"x"<<ii<<"="<<i*ii<<"\n";
}
}
return 0;
}
| ALGO | 0.984869 | 3.595941 |
10487bf4-dadd-4275-af2a-4eddd50e9f5d | josuerom/Competitive-Programming | Training/UVa/CP3/Data Structures and Libraries/Linear DS/10855 - Rotated square.cpp | // 2D Array Manipulation
#include <bits/stdc++.h>
using namespace std;
typedef vector<char> vc;
typedef vector<vc> vvc;
vvc rotate(vvc mat) {
int n = mat.size();
vvc target(n, vc(n));
for (int i = 0; i < n; i++) {
for (int j = 0; j < n; j++) {
target[j][n - i - 1] = mat[i][j];
}
}
return target;
}
int so... | ALGO | 0.999757 | 3.952103 |
2ed3230b-9727-4211-a2f5-b6704ba51397 | TheTypoMaster/acg2015 | ex2/src/perspective.cpp | #include <nori/camera.h>
#include <nori/rfilter.h>
#include <Eigen/Geometry>
NORI_NAMESPACE_BEGIN
/**
* \brief Perspective camera with depth of field
*
* This class implements a simple perspective camera model. By default,
* it uses an infinitesimally small aperture, creating an infinite depth
* of field. Use ... | TOOL | 0.985454 | 7.505257 |
e5c57945-aeea-4689-8ab4-8f0c0d895d72 | nikunj-var/DataStructureAlgorithms | LinkedList_CP/linkedlist/sortksortedlist.cpp | //creation of linked list
#include<iostream>
#include<stdlib.h>
using namespace std;
class node{
public:
int data;
node* next=0;
node* prev=0;
node(int data){
this->data=data;
}
};
node* insertlinkedlist( node *head,int data){
node *newnode;
newn... | ALGO | 0.99999 | 3.767159 |
58be0c59-4b5a-4c28-a28e-ae1ed2d12fde | connortoro/school | 150/Module 14/Lab/Lab14part2.cpp | /* Lab14part2.cpp - Reverse array
* Author: Connor Toro
* Module: 14
* Project: Lab 14
* Problem statement: Reverse an Array's Elemtns
*
* Algorithm:
* 1. create fillRandom which takes array, size, min and max ints. it uses the rand function and loops through arrays elements assigning
them to r... | TOOL | 0.985945 | 4.890337 |
b37ff006-8b4b-4710-905f-5b4e314ea3ac | tu-university-homework/IP_pt | 18120254_Week03/Bai06b/Bai06b.cpp | #include <iostream>
using namespace std;
//Tìm số nguyên dương n nhỏ nhất sao cho 1 + 2 + 3 + …… + n > 1000.
int main()
{
int kq = 0;
int i = 1;
while(i< 1000)
{
kq += i;
if (kq > 1000)
{
cout << "So nguyen duong n nho nhat sao cho 1 + 2 + 3 +...+ n > 1000 la: " << i << endl;
break;
}
i++;
}
syste... | ALGO | 0.998757 | 3.223931 |
433e791e-5be1-4866-8f41-7e1064423825 | mamun4122/My-Online-Judge-Submission | Codeforces/Codeforces Round #222 (Div. 1) - 377/377A-Maze.cpp | #include <cassert>
#include <cctype>
#include <climits>
#include <cmath>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <iostream>
#include <sstream>
#include <iomanip>
#include <string>
#include <vector>
#include <list>
#include <set>
#include <map>
#include <stack>
#include <queue>
#include <algorit... | ALGO | 0.998742 | 3.436804 |
a0d462a8-e776-4a56-b20f-e40f0478bf19 | RTBCoin/RTBCoin-QT | src/qt/rpcconsole.cpp | #if defined(HAVE_CONFIG_H)
#include "config/bitcoin-config.h"
#endif
#include "rpcconsole.h"
#include "ui_debugwindow.h"
#include "bantablemodel.h"
#include "clientmodel.h"
#include "guiutil.h"
#include "platformstyle.h"
#include "chainparams.h"
#include "netbase.h"
#include "rpc/server.h"
#include "rpc/client.h"
#in... | TOOL | 0.956092 | 3.302295 |
41c8de03-1d0b-45dc-9b7a-ba41f6a5985c | Lenwin/DSA-CPP | GRAPH/Shortest_path_Undirected_graph.cpp | class Solution {
public:
vector<int> shortestPath(int n, int m, vector<vector<int>>& edges) {
// Code here
//Converting edge list into adjacency list
vector<vector<pair<int,int>>>adj(n+1);
for(int i=0;i<m;i++){
int a = edges[i][0];
int b = edges[i][1];
... | ALGO | 0.999996 | 5.242453 |
5765bbff-80ef-4aca-838b-83fddf58ac8a | Johniel/contests | codeforces/927div3/D/main.cpp | // github.com/Johniel/contests
// codeforces/927div3/D/main.cpp
#include <bits/stdc++.h>
#define each(i, c) for (auto& i : c)
#define unless(cond) if (!(cond))
#define makepair(a, b) make_pair(a, b)
// #define endl "\n"
using namespace std;
template<typename P, typename Q> ostream& operator << (ostream& os, pair<P,... | ALGO | 0.999699 | 5.442792 |
ca289c21-c42a-459b-b097-de0994f263bf | EtheSonX082531/Star_Patterns_By_Me | Squared Shape Star Pattern.cpp | #include<iostream>
using namespace std;
int main()
{
int n;
cout<<"Enter line number:"<<endl;
cin>>n;
for(int i=1; i<=n; i++) {
if(i==1 || i==n) {
for(int j=0; j<n; j++) {
cout<<"* ";
}
cout<<endl;
}
else {
for(int ... | ALGO | 0.999317 | 3.386854 |
5dfc2417-f022-42d8-97af-e92f2e809b88 | arungangaji/codelib | Data Structures/Persistent Meldable Heap.cpp | #include<bits/stdc++.h>
using namespace std;
using ll = long long;
const ll INF = 1e18;
template<typename T>
struct heap {
struct node{
node* ch[2] = {0, 0};
int sz; T val;
int from, to;
node(T val, int from, int to): sz(1), val(val), from(from), to(to) {}
};
node* root = 0;
heap(node* t = 0):... | ALGO | 0.999974 | 4.715631 |
8cbcbdcc-11ec-4810-9f79-9805b2855b69 | Porwal-Hemant/codeforces_900 | Forked.cpp | #include <bits/stdc++.h>
using namespace std;
// "|| "
#define ll long long
#define endl '\n'
#define debug(x) cout << #x << " = " << x << endl
void solve()
{
int a , b ; // possible moves of night
cin >> a >> b ;
int xk , yk ;
cin >> xk >> yk ;
int xq , yq ;
cin >> xq >> yq ;... | ALGO | 0.999938 | 4.205057 |
3d04eb76-403c-4e08-af08-5b853b86c170 | mongodb/mongo | src/mongo/db/pipeline/accumulator_for_bucket_auto.cpp | #include "mongo/db/pipeline/accumulator_for_bucket_auto.h"
#include "mongo/base/string_data.h"
#include "mongo/bson/bsonmisc.h"
#include "mongo/db/exec/document_value/document.h"
#include "mongo/db/exec/document_value/value.h"
#include "mongo/db/pipeline/accumulator.h"
#include "mongo/db/pipeline/accumulator_multi.h"
... | TOOL | 0.870763 | 6.903695 |
cdb2792e-cb73-4e93-ba55-65b20f6efbda | VasisthaPrakhar/LC_Questions | 1372-longest-zigzag-path-in-a-binary-tree/1372-longest-zigzag-path-in-a-binary-tree.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.999777 | 5.497773 |
1438afb4-06ac-47bc-a961-b23be977684a | Ace-Krypton/LeetCode | Easy/ClimbingStairs/tests/test.cpp | #include "../include/solution.hpp"
class ClimbingStairs : public ::testing::Test {
protected:
~ClimbingStairs() override = default;
};
TEST_F(ClimbingStairs, FirstTest) {
int32_t steps = 2;
int32_t result = Solution::climb_stairs(steps);
int32_t expected = 2;
ASSERT_EQ(result, expected);
}
TEST... | ALGO | 0.876023 | 6.325377 |
a143cec3-74a9-433c-adc1-94f4ab2d6b50 | sanjeetboora/CppCompetitive | Leetcode/LinkedList/MergeTwoSortedLists.cpp | /**
* Definition for singly-linked list.
* struct ListNode {
* int val;
* ListNode *next;
* ListNode(int x) : val(x), next(NULL) {}
* };
*/
class Solution {
public:
ListNode* mergeTwoLists(ListNode* l1, ListNode* l2) {
if(l1 == NULL){
return l2;
}
else if(l2 ==... | ALGO | 0.999941 | 5.864803 |
75bf570c-0e26-415c-b21f-5a8e7c8b6185 | Bootz/Stage6JUNK | dep/g3dlite/source/Welder.cpp | /**
@file Welder.cpp
@author Morgan McGuire, Kyle Whitson, Corey Taylor
@created 2008-07-30
@edited 2009-11-29
*/
#include "G3D/platform.h"
#include "G3D/Vector2.h"
#include "G3D/Vector3.h"
#include "G3D/Sphere.h"
#include "G3D/PointHashGrid.h"
#include "G3D/Welder.h"
#include "G3D/Stopwatch.h" // for profilin... | TOOL | 0.994124 | 7.78546 |
028e4526-1be0-49b2-aa2f-44d15c5365b1 | ujjwalkasera01/Questions | 0377-combination-sum-iv/0377-combination-sum-iv.cpp | class Solution {
public:
int combinationSum4(vector<int>& nums, int target) {
int len=nums.size();
vector<uint> dp(target+1,0);
dp[0]=1;
for(int i=1;i<=target;i++){
for(int j=0;j<len;j++){
if(i-nums[j]>=0 )
dp[i]+=dp[i-nums[j]];
... | ALGO | 0.999908 | 6.289843 |
d9e398a8-556a-4644-9626-f59d4ece8dd3 | ADS-bot/Leetcode | 0042-trapping-rain-water/0042-trapping-rain-water.cpp | class Solution {
public:
int trap(vector<int>& height) {
if (height.empty())
return 0;
int ans = 0;
int l = 0;
int r = height.size() - 1;
int maxL = height[l];
int maxR = height[r];
while (l < r)
if (maxL < maxR) {
ans += maxL - height[l];
maxL = max(maxL, he... | ALGO | 0.999963 | 7.305163 |
96d1a0fb-b8a6-4f9a-8505-34c53e6bda78 | justdotheg/Algorithm | 알고리즘/프로그래머스/Level1/정수 내림차순으로 배치하기/개선된 코드.cpp | #include <string>
#include <algorithm>
using namespace std;
long long solution(long long n) {
string s = to_string(n);
sort(s.begin(), s.end(), greater<int>());
long long answer = stoll(s); //string to long long
return answer;
} | ALGO | 0.999641 | 5.772666 |
2c7c0e5d-c3b2-4ecd-a011-61a8db4e1120 | Rishikeshsahoo/CPPPROJECTS | Array string recurssion/Q35_wordDistence2.cpp | #include<bits/stdc++.h>
using namespace std;
int wordDistence2(vector<string> s,string s1,string s2)
{
if(s1==s2)
{
int p=-1,ans=INT_MAX;
for(int i=0;i<s.size();i++)
{
if(s[i]==s1 && p==-1)
p=i;
else if(s[i]==s1 && p!=-1)
ans=min(ans,abs(i-... | ALGO | 0.99991 | 4.086309 |
94382268-0eab-4743-9aba-fc6666e0d4c8 | regismeyssonnier/Data-structure---Tree | Held_Karp.cpp | // Held_Karp.cpp : Ce fichier contient la fonction 'main'. L'exécution du programme commence et se termine à cet endroit.
//
#include <iostream>
#include <algorithm>
#include <list>
#include <vector>
#include <set>
#include <map>
#include <deque>
using namespace std;
#define INF 1000000000
class TSP {
public:
i... | ALGO | 0.999968 | 5.243629 |
cbad0456-04b8-4a7f-9670-d87f6cacf9f2 | joelgwebber/bench2d | c/Box2D_2.3.1/Box2D/Collision/b2CollideCircle.cpp | #include <Box2D/Collision/b2Collision.h>
#include <Box2D/Collision/Shapes/b2CircleShape.h>
#include <Box2D/Collision/Shapes/b2PolygonShape.h>
void b2CollideCircles(
b2Manifold* manifold,
const b2CircleShape* circleA, const b2Transform& xfA,
const b2CircleShape* circleB, const b2Transform& xfB)
{
manifold->pointCou... | ALGO | 0.998197 | 7.764917 |
2a5e5af5-af8d-465b-a202-093c44cee258 | dumpinfo/BulletAccTest | BulletBk/Demos/MultiMaterialDemo/MultiMaterialDemo.cpp | #include "btBulletDynamicsCommon.h"
#include "LinearMath/btIDebugDraw.h"
#include "GLDebugDrawer.h"
#include "MultiMaterialDemo.h"
#include "GL_ShapeDrawer.h"
#include "GlutStuff.h"
#include "BulletCollision/CollisionShapes/btTriangleShape.h"
#include "BulletCollision/CollisionShapes/btTriangleIndexVertexMaterialArray... | ALGO | 0.957037 | 5.728698 |
014ee1b7-c701-4e31-8283-a057637c6716 | alemassaad/CSE306-Computer-Graphic | ASSIGNMENT-1/random_cos.cpp | #include "random_cos.h"
#include "random.h"
Vector random_cos(const Vector &N) {
double r1 = generate_random();
double r2 = generate_random();
double x = cos(2 * M_PI * r1) * sqrt(1 - r2);
double y = sin(2 * M_PI * r1) * sqrt(1 - r2);
double z = sqrt(r2);
Vector T1, T2;
double min_num = s... | ALGO | 0.918254 | 4.149196 |
d2c7297d-3326-408b-899f-41ff4d2ceadd | dlwlxns4/Practice_CodingTest | BJ/BJ1024.cpp | #include <iostream>
#include <vector>
#include <algorithm>
using namespace std;
int main()
{
int N, M, x = -1, lenght = -1;
cin >> N >> M;
for (int i = M; i < 101; ++i)
{
int t = (i - 1) * i / 2;
if ((N - t) % i == 0 & (N - t) / i >= 0)
{
x = (N - t) / i;
lenght = i;
break;
}
}
if (x == -1)
... | ALGO | 0.999949 | 3.813521 |
74e3685f-2845-4600-8697-430774646a08 | ananthkumarmv/Coding-problems | leetcode/69-Sqrt(x).cpp | class Solution {
public:
int mySqrt(int x) {
long int low = 0;
long int high = x;
long int mid;
int ans;
while(low<=high){
mid = low + (high-low)/2;
if(mid*mid == x){
return mid;
}
else if(mid*mid>x){
... | ALGO | 0.999938 | 5.114977 |
c97be622-8073-4d84-97bf-2eb2135b008e | khadija1114/Online-Judge-Solutions | Codeforces/1437c.cpp | #include<bits/stdc++.h>
#define ff first
#define ss second
#define bg begin()
#define en end()
#define pb push_back
#define w(x) scanf("%d",&x);while(x--)
#define ws(x) scanf("%d",&x);getchar();while(x--)
#define rep(i,b) for(i=0;i<=b;i++)
#define ios ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);
#define pi 2*ac... | ALGO | 0.999574 | 3.778217 |
a566f8cd-95c7-4f58-adff-5054e7bcf92d | sebcorv7/mirnaNMT | src/rnn/attention.cpp | #include "attention.h"
#include "graph/node_operators_binary.h"
#include "tensors/tensor_operators.h"
namespace marian {
namespace rnn {
struct AttentionNodeOp : public NaryNodeOp {
AttentionNodeOp(const std::vector<Expr>& nodes)
: NaryNodeOp(nodes, newShape(nodes)) {}
Shape newShape(const std::vector<Ex... | ALGO | 0.984119 | 5.953247 |
bec2c82d-b1dd-4b94-85cd-019216735b1a | scarsty/lammps_m | src/fix_enforce2d.cpp | #include "string.h"
#include "fix_enforce2d.h"
#include "atom.h"
#include "update.h"
#include "domain.h"
#include "respa.h"
#include "error.h"
using namespace LAMMPS_NS;
using namespace FixConst;
/* ---------------------------------------------------------------------- */
FixEnforce2D::FixEnforce2D(LAMMPS *lmp, int ... | ALGO | 0.997804 | 6.805036 |
785bfd33-04c1-409e-ab68-9141c5d6e76b | madeinserver/lithtech | engine/runtime/shared/moveobject.cpp | #include "bdefs.h"
#include "geometry.h"
#include "moveobject.h"
#include "collision.h"
#include "syscounter.h"
#include "geomroutines.h"
#include "objectmgr.h"
#include "packetdefs.h"
#include "de_world.h"
#include "ltserverobj.h"
#include "de_mainworld.h"
#include "ltsysoptim.h"
#include "moveplayer.h"
#include "ful... | TOOL | 0.91213 | 4.591439 |
0daddee7-9e86-4bec-8f45-adfd580835c1 | sarvex/leetcode-lol-code | solution/1600-1699/1615.Maximal Network Rank/Solution.cpp | class Solution {
public:
int maximalNetworkRank(int n, vector<vector<int>>& roads) {
int cnt[n];
int g[n][n];
memset(cnt, 0, sizeof(cnt));
memset(g, 0, sizeof(g));
for (auto& r : roads) {
int a = r[0], b = r[1];
g[a][b] = g[b][a] = 1;
++cnt... | ALGO | 0.999926 | 5.670449 |
73646d82-876e-40d5-93c3-b8d25c354c75 | HACManchester/Tools.3DPrinter.Ender | Firmware/Marlin/src/libs/least_squares_fit.cpp | /**
* Least Squares Best Fit by Roxy and Ed Williams
*
* This algorithm is high speed and has a very small code footprint.
* Its results are identical to both the Iterative Least-Squares published
* earlier by Roxy and the QR_SOLVE solution. If used in place of QR_SOLVE
* it saves roughly 10K of program memory. I... | ALGO | 0.99919 | 5.833176 |
e0ecd761-815a-4867-a18e-54c90a02ea3f | Tanishq747s/Prac_Codes | Working Code Revised/HPC/2 Parallel Bubble and Merge/ParallelBubbleSort.cpp | #include <iostream>
#include <vector>
#include <omp.h>
#include <algorithm>
#include <ctime>
using namespace std;
// Sequential Bubble Sort
void bubbleSort(vector<int> &arr)
{
int n = arr.size();
for (int i = 0; i < n - 1; i++)
{
for (int j = 0; j < n - i - 1; j++)
{
if (arr[j] >... | ALGO | 0.999896 | 5.879163 |
8b5eb2bd-7738-45e6-9d17-6d6f5b637188 | jesuswr/cp-codes-and-problems | L.team_shirts-rpc.cpp | #include <iostream>
#include <vector>
#include <queue>
#include <stack>
#include <algorithm>
#include <math.h>
#include <string>
#include <cstring>
#include <set>
#include <map>
#include <unordered_map>
#include <tuple>
using namespace std;
typedef long long ll;
typedef pair<int, int> pii;
typedef pair<int, pair<int,... | ALGO | 0.999906 | 3.574473 |
18e96f71-7ed3-4522-91ca-01438be3d7f2 | ngthanhtrung23/CompetitiveProgramming | codeforces/588/A.cpp |
#include <bits/stdc++.h>
#define FOR(i,a,b) for(int i=(a),_b=(b); i<=_b; i++)
#define FORD(i,a,b) for(int i=(a),_b=(b); i>=_b; i--)
#define REP(i,a) for(int i=0,_a=(a); i<_a; i++)
#define EACH(it,a) for(__typeof(a.begin()) it = a.begin(); it != a.end(); ++it)
#define DEBUG(x) { cout << #x << " = "; cout << (x) << en... | ALGO | 0.999609 | 3.22027 |
6999de06-5018-4298-87df-2fbf48a30722 | amelia-aabb/frameworks_native | libs/vr/libbufferhubqueue/benchmarks/buffer_transport_benchmark.cpp | #include <android-base/logging.h>
#include <android/native_window.h>
#include <benchmark/benchmark.h>
#include <binder/IPCThreadState.h>
#include <binder/IServiceManager.h>
#include <dvr/dvr_api.h>
#include <gui/BufferItem.h>
#include <gui/BufferItemConsumer.h>
#include <gui/Surface.h>
#include <private/dvr/epoll_file_... | TEST | 0.909108 | 5.248497 |
1a0a4f0e-99b7-42c2-9775-a47efb33eff6 | mkazhdan/ShapeSPH | ShapeDescriptor/ShapeDescriptor.cpp | #include <stdio.h>
#include <stdlib.h>
#include <omp.h>
#include "SignalProcessing/CubeGrid.h"
#include "SignalProcessing/Fourier.h"
#include "Util/Ply.h"
#include "Util/cmdLineParser.h"
#include "Util/Geometry.h"
#include "Util/Util.h"
#include "Util/Rasterizer.h"
#include "Util/EDT.h"
#include "Util/SphereSampler.h"... | ALGO | 0.999668 | 6.207689 |
c5a1bbee-4fdf-40e0-baeb-847b581adb64 | stmxmv/Nitetrichor | tools/RanGen/main.cpp | #include "LearnKit/Random.hpp"
#include "LearnKit/UnionFindSet.hpp"
#include <iostream>
#include <unordered_set>
using std::cout, std::endl;
struct hash_for_pair {
size_t operator()(std::pair<int, int> const &p) const {
return ((size_t)p.first << 32) | p.second;//NOLINT
}
};
void test(NC::Random &rand... | ALGO | 0.93701 | 3.635993 |
eb179855-2bbe-4c4d-90ad-7ac811d17f51 | oxygen-hunter/Flashboom | data/leetcode_cpp/traffic-light-controlled-intersection.cpp | // Time: O(n)
// Space: O(1)
class TrafficLight {
public:
TrafficLight()
: light_{1} {
}
void carArrived(
int carId, // ID of the car
int roadId, // ID of the road the car travels on. Can be 1 (road A) or 2 (road B)
int direction, ... | TOOL | 0.980356 | 6.017619 |
8de19807-fef1-4ace-bb66-0d352e067584 | xon1999/dsacpp | huffman/Huffman_PQ_Test.cpp | /*DSA*/#include "Huffman_PQ_test.h"
/******************************************************************************************
* ۱ɭбȫѻʽʵ֣Թ̶
* ɭֵʵַʽȼʱǰӦĹֻӦ־
* DSA_PQ_ListDSA_PQ_ComplHeapDSA_PQ_LeftHeap
******************************************************************************************/
int main ( int arg... | ALGO | 0.996779 | 4.233752 |
cae7b752-a5e5-41bd-b3f2-dee6a6263278 | MahinAshraful/CodeWatch_Data | sample-data/p00018/s919392144.cpp | #include<iostream>
int main(){
int a[5],i,n,j;
for(i=0;i<5;i++){
std::cin>>a[i];
}
for(i=0;i<5;i++){
for(j=i+1;j<5;j++){
if(a[i]<a[j]){
n=a[i];
a[i]=a[j];
a[j]=n;
}
}
}
for(i=0;i<4;i++){
std::cout<<a[i]<<" ";
}
std::cout<<a[4];
std::cout<<std::endl;
return 0;
} | ALGO | 0.999952 | 3.499629 |
41a51071-ec50-451f-bc5f-6f0bf2498ba6 | Gowthamrayapureddy/Lecture0_ciperschools | Lecture_39.cpp | /*
Buuble sort:
In this algorithm we compare the adjacent elements then interchange them
*/
#include <iostream>
using namespace std;
int main(){
int n;
cout<<"Enter size of array: "<<endl;
cin>>n;
int arr[n];
cout<<"Enter array elements: "<<endl;
for(int i = 0;i<n;i++){
cin>>arr[i];
... | ALGO | 0.999702 | 4.388991 |
9a41f8aa-6325-424b-a429-721bd01bf66a | mahimalmuntashir/CodeForces | 600-699/666A-ReberlandLinguistics.cpp | #include <iostream>
#include <vector>
#include <set>
int main(){
std::set<std::string> suf;
std::string s; std::cin >> s;
long sz = s.size();
std::vector<std::vector<bool> > dp(s.size() + 10, std::vector<bool>(4, 0));
dp[sz][2] = dp[sz][3] = true;
s += "##";
for(long p = sz - 2; p > 4; p--... | ALGO | 0.993726 | 3.477887 |
34c4e985-31fa-42b6-b2ae-d8362be34869 | UjjwalSingh171/LEETCODE_Solutions | 0476-number-complement/0476-number-complement.cpp | class Solution {
public:
int bintodec(vector<int> comp)
{
int n = comp.size();
long long count = 0;
long long pow = 1 ;
for(int i = n-1 ; i>=0 ; i--)
{
count+=comp[i]*pow;
pow *= 2;
}
return (int)count;
}
vector<int> complem... | ALGO | 0.999991 | 5.896964 |
f8c96689-29a6-4de0-8ae2-badc360f7d42 | statosh/Low-Effort-C-Related-Studies | CPP/FP_ДЗ_03_02/FP_ДЗ_03_02/FP_ДЗ_03_02.cpp | #include <iostream>
using namespace std;
void main() {
setlocale(LC_ALL, "Russian");
int seconds_worked;
cout << " , : ";
cin >> seconds_worked;
int workday_seconds = 8 * 3600;
if (seconds_worked >= workday_seconds) {
cout << " !" << endl;
}
else {
int remainin... | ALGO | 0.920849 | 3.71638 |
93149afa-cb8e-47e9-8abd-1d30579e5aea | u-noob-i/ACD-Ladder | DSumGraph.cpp | #include <bits/stdc++.h>
#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>
using namespace std;
#define ll long long
#define ull unsigned long long
#define INF 1e9
... | ALGO | 0.999595 | 3.421826 |
ae9582a5-1233-4468-896c-d0e05be9db81 | NiketSharma28/Coding-Notes | Basic C++/loops/pattern/pattern5.cpp | /*
half pyramid using number
1
2 2
3 3 3
4 4 4 4
5 5 5 5 5
*/
#include<iostream>
using namespace std;
int main()
{
int n;
cout<<"enter any number: ";
cin>>n;
for(int i=1;i<=n;i++)
{
for(int j=1;j<=i;j++)
{
cout<<i;
}
cout<<endl;
}
return 0;
} | ALGO | 0.999803 | 3.894889 |
f1009aee-591d-4f1d-8f43-7ac6733fa3f8 | gogochi/CPE | CPE-10400(UVA100).cpp | #include<iostream>
using namespace std;
int main(){
int a,b;
while(cin>>a>>b){
cout<<a<<" "<<b<<" ";
if(a>b){int c=a;a=b;b=c;}
int maxLen=0;
for(int k=a;k<=b;k++){
int n=k,len=1;
while(true){
if(n==1)break;
if(n%2)n=n*3+1;
else n/=2;
... | ALGO | 0.999944 | 3.937088 |
04e02451-7d4d-454c-ae99-d91780ae5f75 | ITC-Vanadzor/ITC-7 | Hayk_Poghosyan/Homework/26,10/Lavaguyn_Vataguyn.cpp | //lavaguyn ev vataguyn bajanararner
#include <stdio.h>
#include <math.h>
#include <iostream>
int ssum(int a)
{
int t = 0;
while (a)
{
t += a % 10;
a /= 10;
}
return t;
}
void vat()
{
int n, i, res;
std::cout << "nermucq n-@";
std::cin >> n;
int sum = n;
for (i = 2; i <= (int)sqrt((double)n); i++)
if (n%i ... | ALGO | 0.99989 | 4.463748 |
b99b822c-5293-4fd8-9fdd-1cc6807d03aa | Bungmint/competitiveprogramming | contest/codeforces/1648/1648C.cpp | // Problem: C. Tyler and Strings
// Contest: Codeforces - Codeforces Round #775 (Div. 1, based on Moscow Open Olympiad in Informatics)
// URL: https://codeforces.com/contest/1648/problem/C
// Memory Limit: 256 MB
// Time Limit: 2000 ms
//
// Powered by CP Editor (https://cpeditor.org)
using namespace std;
using ll =... | ALGO | 0.999904 | 3.862038 |
673f9f75-cee3-4942-af55-a73f6d4fcb6a | sarvex/leetcode-j | lcof2/剑指 Offer II 005. 单词长度的最大乘积/Solution.cpp | class Solution {
public:
int maxProduct(vector<string>& words) {
int n = words.size();
vector<int> mask(n);
for (int i = 0; i < n; ++i)
for (char ch : words[i])
mask[i] |= 1 << (ch - 'a');
int ans = 0;
for (int i = 0; i < n - 1; ++i)
fo... | ALGO | 0.999653 | 5.746455 |
769d5897-6b1a-4289-91f2-1d414c341a41 | Jade-Maitland/OptimizedCplus-2 | PA7/PA7/Matrix_Mv_SIMD.cpp | #include "Vect_Mv_SIMD.h"
#include "Matrix_Mv_SIMD.h"
Matrix_Mv_SIMD::Matrix_Mv_SIMD(const Vect_Mv_SIMD &tV0,
const Vect_Mv_SIMD &tV1,
const Vect_Mv_SIMD &tV2,
const Vect_Mv_SIMD &tV3)
: v0(tV0), v1(tV1), v2(tV2), v3(tV3)
{
}
Vect_Mv_SIMD Matrix_Mv_SIMD::operator * (const Vect_Mv_SIMD &... | ALGO | 0.993978 | 4.531203 |
457d194b-9c9c-46ed-bbc0-e5256620158a | ishandutta2007/codeforces | kristevalex/normal/991/A.cpp | #include <bits/stdc++.h>
using namespace std;
#define FAST ios_base::sync_with_stdio(false); \
cin.tie(nullptr); \
cout.tie(nullptr)
long long a, b, c, n;
int main()
{
FAST;
cin >> a >> b >> c >> n;
if (a < c || b < c)
{
cout << -1;
return 0;
... | ALGO | 0.999951 | 3.991624 |
324e4c4e-830e-4f1c-a6de-f55c63efa6e0 | MobillaCoin/MobillaCoin | src/SimpleWallet/SimpleWallet.cpp | #include "SimpleWallet.h"
#include <ctime>
#include <fstream>
#include <future>
#include <iomanip>
#include <thread>
#include <set>
#include <sstream>
#include <boost/bind.hpp>
#include <boost/lexical_cast.hpp>
#include <boost/program_options.hpp>
#include <boost/algorithm/string.hpp>
#include <boost/filesystem.hpp>
... | WEB | 0.914044 | 3.63045 |
4d4d1664-e7a3-425f-82bb-007fe39a9b0e | Elsadwi07/Grafkom-Tugas2 | lingkaranB.cpp | #include <GL\glut.h>
#include <iostream>
#include <stdlib.h>
using namespace std;
void init();
void display(void);
void lingkaran(void);
int window_x;
int window_y;
int xcIn,xc,ycIn,yc,rIn,r;
int window_width = 480;
int window_height = 480;
char *judul_window = "Lingkaran Midpoint";
int main(int argc, char **arg... | ALGO | 0.989854 | 4.639735 |
68387343-54af-4feb-a344-98e3b05eb893 | kapiliitr/codechef | practice/palindrome.cpp | #include<iostream>
using namespace std;
bool palindrome(unsigned long long int );
unsigned long long int convert(unsigned long long int , unsigned long long int & );
int main()
{
unsigned long long int n,i,num,pal;
cin>>n;
while(n--)
{
cin>>num;
i=0;
pal=convert(num,i);
c... | ALGO | 0.999919 | 3.881927 |
f5ecd574-f141-4c49-a854-00daf1db040f | LuciferX-Devil/OOPS | Question Practice/PPS2/Q5.cpp | //Write a program that takes in a number and outputs whether it is even or odd. Using
//class.
#include <iostream>
using namespace std;
class EoO{
private:
int num;
public:
EoO(int a){
num=a;
if(num%2==0){cout<<"Even";}
else{cout<<"Odd";}
}
};
int main(){
int a;cin>... | ALGO | 0.973405 | 3.728195 |
88177bc8-ef3b-4c7c-b68d-cfdf4506b1cb | Anny-Moon/PCMC | PCMC_lib/source/Dictionary.cpp | #include "../../include/Dictionary.h"
#include <stdio.h>
#include <stdlib.h>
using namespace std;
Dictionary::Dictionary(const char* fileName)
{
readFile(fileName);
}
Dictionary::Dictionary(const std::vector<std::tuple<std::string, double>> dictionary_in)
{
dictionary = dictionary_in;
}
Dictionary::~Dictio... | TOOL | 0.883708 | 4.144783 |
08ac7e72-1f56-4b39-9eb1-dd5817e0a42a | JaheimMao/LeetCode | 0219_Contains Duplicate II/0219_Solution.cpp | // 0219_Contains Duplicate II
#include<iostream>
#include<vector>
#include<set>
using namespace std;
class Solution {
public:
bool containsNearbyDuplicate(vector<int>& nums, int k) {
set<int> s;
int count = 0;
for(int i : nums){
if(s.find(i) != s.end())
return t... | ALGO | 0.999947 | 5.532557 |
86839473-e741-4fda-9339-fe42356225b3 | Henrywcj/UCLA_CS32_2017Winter | Proj3_Part2/StudentWorld.cpp | #include "StudentWorld.h"
#include "GameConstants.h"
#include "Field.h"
#include <string>
#include <sstream>
#include <vector>
#include <set>
#include <iomanip>
#include <list>
using namespace std;
GameWorld* createStudentWorld(string assetDir)
{
return new StudentWorld(assetDir);
}
StudentWorld::~StudentWorld()
{
/... | TOOL | 0.909248 | 3.097055 |
e330cf7b-f8f3-410e-9c84-4277e0e9e048 | evenp/ILSD | src/ImageTools/digitalstraightsegment.cpp | #include "digitalstraightsegment.h"
DigitalStraightSegment::DigitalStraightSegment ()
: DigitalStraightLine (1, 1, 0, 1)
{
min = 0;
max = 1;
}
DigitalStraightSegment::DigitalStraightSegment (Pt2i p1, Pt2i p2, int type,
int xmin, int ymin, int xmax, int ymax)
... | ALGO | 0.949495 | 6.474338 |
f55ede12-e492-4338-a821-4c14d2dbc387 | fizzydavid/FizzyDavid-s-templates | template/geometry.cpp | //geometry start
const double eps=1e-7;
const double pi=acos(-1);
bool is0(double x){return x>-eps&&x<eps;}
struct point
{
double x,y;
point(double _x=0,double _y=0){x=_x;y=_y;}
point operator+(const point &t)const{return point(x+t.x,y+t.y);}
point operator-(const point &t)const{return point(x-t.x,y-t.y);}
point o... | ALGO | 0.999603 | 3.908063 |
7585d2b7-2e43-4ecf-9446-058329d9bb7f | im2781975/basic-cpp | Tabulation/Quick.cpp | #include<bits/stdc++.h>
using namespace std;
// Function to partition the array
int partition(vector<int> &arr, int low, int high) {
int pivotIndex = low + rand() % (high - low + 1);
int pivot = arr[pivotIndex];
swap(arr[pivotIndex], arr[high]);
int i = low;
for (int j = low; j < high; j++) {
... | ALGO | 0.999995 | 6.029957 |
8106d4bb-31d3-4961-9c9e-c5613ebf56af | MantejSingh19/Cpp-Code | tes3t.cpp | #include<iostream>
using namespace std;
int main()
{
int n,i,j,mid;
cin>>n;
int arr[n];
for(i=0;i<n;i++)
{
cin>>arr[i];
}
i=0,j=n-1,mid=i+(j-i)/2;
while(i<j)
{
if(arr[mid]>=arr[0])
{
i=mid+1;
}
else{
j=mid;
}
mid=i+(j-i)/2;
... | ALGO | 0.999986 | 4.03304 |
3dd873d1-7a2c-413e-807b-bc62e68291f7 | tg9963/DATA-STRUCTURES-ALGORITHMS | all_progs/C and C++/ARRAY/hack4.cpp | #include<iostream>
#include<stdlib.h>
using namespace std;
int main()
{
int test;
cin>>test;
while(test--)
{
int n;
cin>>n;
long long first[n];
long long second[n];
long long min1,min2;
cin>>first[0];
min1=first[0];
for(int i=1;i<n;i++)
{
cin>>first[i];
if(first[i]<min1)
{
min1=first... | ALGO | 0.999926 | 3.487499 |
ca10295c-323f-4a12-a948-ef9987e31918 | SamrawitMM/CPP_Header | MyMathFunction.cpp | #include <iostream>
#include <string>
#include <cmath>
#include "MyMathFunction.h"
using namespace std;
// function definitions
int getPosInt(string msg){
int num = 0;
do{
cout << msg << endl;
cin >> num;
}while(num <= 0);
return num;
}
double areaOfCircle(int r){
return PI * pow(r... | TOOL | 0.940453 | 3.572983 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.