uuid string | repo_name string | relative_path string | content string | category string | algo_rel_score float64 | quality_score float64 |
|---|---|---|---|---|---|---|
aede1754-da32-41ac-b133-e40aaebd3ba4 | sahilmahla/CodeChef | CUIETPP/TRICOIN.cpp | // Problem: Coins And Triangle
// Contest: CodeChef - CUIETPP
// URL: https://www.codechef.com/CUIETPP/problems/TRICOIN
// Memory Limit: 256 MB
// Time Limit: 1000 ms
// Code by: sahilmahla
#include <bits/stdc++.h>
using namespace std;
int main(){
int t;
cin>>t;
while(t--){
long long int n;
cin>>n;
cout<<(lo... | ALGO | 0.999617 | 4.960085 |
ee18a87f-3ab1-4244-bd86-cf7901a93cf8 | kento-yoshidu/cpp_algorithm | atcoder/abc3xx/abc387/a.cpp | // https://atcoder.jp/contests/abc387/tasks/abc387_a
#include <iostream>
#include <cmath>
using namespace std;
int func(int a, int b) {
int sum = a + b;
return sum * sum;
}
int main() {
cout << func(20, 25) << endl;
//=> 2025
cout << func(30, 25) << endl;
//=> 3025
cout << func(45, 11)... | ALGO | 0.999422 | 5.718214 |
3d98ab46-bab7-4d42-8138-33af39538536 | mchoi0320/CSCE420_AI | Proj4/parser.cpp | #include <cstdlib>
#include <cstdio>
#include <iostream>
#include <fstream>
#include <vector>
#include <string>
using namespace std;
#include "parser.hpp"
//----------------------------
Expr::Expr(string s) { sym = s; kind = ATOM; }
Expr::Expr(vector<string> tokens,int start)
{
int i=start,n=tokens.size();
kin... | TOOL | 0.973445 | 4.030954 |
6463fadb-38d4-4a1f-9bdb-a0522439b0d7 | Komal-J04/DSA | CodeStudio Questions/2D Arrays/SetMatrixZeroes.cpp | #include <bits/stdc++.h>
void setZeros(vector<vector<int>> &matrix)
{
// Write your code here.
int rows = matrix.size();
int cols = matrix[0].size();
vector<bool> zeroRows(rows, false);
vector<bool> zeroCols(cols, false);
for (int i = 0; i < rows; i++)
{
for (int j = 0; j < cols; ... | ALGO | 0.999532 | 6.393068 |
3f8c4900-26ca-435d-8a22-090b0c19c1aa | m4oughi/100DaysofCode | pureCPP/0046. Day 46/STL Priority Queue/006. Basic Operations - pop()/006. pop() with Lambda Function Comparator/main.cpp | #include <iostream>
#include <queue>
#include <vector>
int main() {
auto cmp = [](int left, int right) { return left > right; }; // Min-Heap
std::priority_queue<int, std::vector<int>, decltype(cmp)> pq(cmp);
pq.push(15);
pq.push(5);
pq.push(20);
std::cout << "Popping elements:\n";
while ... | ALGO | 0.999539 | 5.44113 |
723917ad-e666-4251-b2b4-1f0b082a630f | RigoLigoRLC/Fritzing-build | boost_1_82_0/libs/compute/perf/perf_bolt_saxpy.cpp | #include <iostream>
#include <algorithm>
#include <vector>
#include <bolt/cl/copy.h>
#include <bolt/cl/device_vector.h>
#include <bolt/cl/transform.h>
#include "perf.hpp"
BOLT_FUNCTOR(saxpy_functor,
struct saxpy_functor
{
float _a;
saxpy_functor(float a) : _a(a) {};
float operator() ... | ALGO | 0.973786 | 5.74432 |
ffde26b4-f04a-44a5-ac02-9279e5edcf49 | sekheng/ProgGameEngine | AssignmentTwo/cocos2d/cocos/math/Vec2.cpp | #include "math/Vec2.h"
#include "math/MathUtil.h"
#include "base/ccMacros.h"
NS_CC_MATH_BEGIN
// returns true if segment A-B intersects with segment C-D. S->E is the overlap part
bool isOneDimensionSegmentOverlap(float A, float B, float C, float D, float *S, float * E)
{
float ABmin = std::min(A, B);
float AB... | TOOL | 0.942347 | 7.040969 |
4b636a62-88f4-44e0-a7a5-348c267299a9 | browndeer/lammps-ocl | src/pair_table.cpp | /* ----------------------------------------------------------------------
Contributing author: Paul Crozier (SNL)
------------------------------------------------------------------------- */
#include "mpi.h"
#include "math.h"
#include "stdlib.h"
#include "string.h"
#include "pair_table.h"
#include "atom.h"
#include... | TOOL | 0.99468 | 6.708108 |
f0afe202-3612-4dae-8465-a0e4d6a867f0 | algoboy101/note_blog_leetcode | delete/source/cpp/[872]叶子相似的树.cpp | //请考虑一颗二叉树上所有的叶子,这些叶子的值按从左到右的顺序排列形成一个 叶值序列 。
//
//
//
// 举个例子,如上图所示,给定一颗叶值序列为 (6, 7, 4, 9, 8) 的树。
//
// 如果有两颗二叉树的叶值序列是相同,那么我们就认为它们是 叶相似 的。
//
// 如果给定的两个头结点分别为 root1 和 root2 的树是叶相似的,则返回 true;否则返回 false 。
//
//
//
// 提示:
//
//
// 给定的两颗树可能会有 1 到 100 个结点。
//
// Related Topics 树 深度优先搜索
//leetcode submit region be... | ALGO | 0.999918 | 6.248574 |
2afa8d44-c55f-47fc-bc33-92d2ce15ca8f | ravi956/pepcoding-level1-in-cpp | Basic Data Structures/13_linked_lists/11_linked_list_to_stack_adapter.cpp | #include <bits/stdc++.h>
using namespace std;
struct Node
{
int data;
Node *next;
};
struct LinkedList
{
Node *head, *tail;
int size;
LinkedList()
{
head = NULL;
tail = NULL;
size = 0;
}
void addLast(int val)
{
Node *newNode = new Node();
n... | ALGO | 0.999456 | 4.96865 |
a373d499-bf1e-4eed-9397-cbac2de07942 | Akashkumar888/RECURSION-CPP | lecture-5/mergsort12.cpp | #include<iostream>
using namespace std;
// o(n*log(n)) fastest best sorting
void merge(int a[],int s,int e){
int mid=s+(e-s)/2;
int len1=mid-s+1;
int len2=e-mid;
int *first = new int[len1];
int *second = new int[len2];
// copy for element
int k=s;
for(int i=... | ALGO | 0.999967 | 4.930061 |
20868a13-05b0-40b9-8bb8-799c12cff84b | SuYuxi/yuxi | Algorithms/Union Find/399. Evaluate Division.cpp | #include <bits/stdc++.h>
//Union find + Backtracking + Graph
class DSU {
public:
DSU() {}
string find(string i)
{
if(parent[i] != i)
{
parent[i] = find(parent[i]);
}
return parent[i];
}
bool Union(string i, string j)
{
if(parent.count(i) == 0)
{
parent[i] = i;
rank[i] = 1;
}
if(parent.c... | ALGO | 0.999983 | 6.069957 |
418b03bf-95e2-4a8a-bff0-f1b134c16857 | ashutosh229/testing-app-cv | fruit_apk/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.998719 | 6.76775 |
91a7bc37-592b-45ac-8d3b-1aa93f6e1d11 | P0L3NARUBA/roblox-2016-source-code | Contribs/boost_1_56_0/libs/thread/example/shared_mutex.cpp | #define BOOST_THREAD_PROVIDES_SHARED_MUTEX_UPWARDS_CONVERSIONS
#define BOOST_THREAD_PROVIDES_EXPLICIT_LOCK_CONVERSION
#define BOOST_THREAD_PROVIDES_GENERIC_SHARED_MUTEX_ON_WIN
#include <iostream>
#include <boost/thread/mutex.hpp>
#include <boost/thread/shared_mutex.hpp>
#include <boost/thread/lock_algorithms.hpp>
#inc... | TEST | 0.98122 | 7.350971 |
e1477a64-4de8-47b6-8f22-a972bdd0fb6e | ishandutta2007/codeforces | fanache99/normal/750/C.cpp | //#include <fstream>
#include <iostream>
#include <cstring>
#include <vector>
#include <algorithm>
using namespace std;
//ifstream cin("tema.in");
//ofstream cout("tema.out");
const int INF = 1000000000;
const int LIMIT = 1900;
int main() {
int n;
cin >> n;
int low = -INF, high = INF;
for (int i = 1... | ALGO | 0.999472 | 3.422964 |
6183b325-dd10-4a95-80cb-b26d1d29b3a6 | ishandutta2007/codeforces | sys/normal/1381/C.cpp | #include <bits/stdc++.h>
using namespace std;
const int Maxn = 200005;
int T, n, m, x, y, Free, ord[Maxn], c[Maxn], ans[Maxn], ans2[Maxn], cnt[Maxn], b[Maxn];
vector <int> Ve[Maxn];
struct cmp
{
bool operator () (const int x, const int y)
{
if (cnt[x] == cnt[y]) return x < y;
return cnt[x] < cnt[y];
}
};
priori... | ALGO | 0.999997 | 3.603218 |
40e2e717-a539-45a4-8b2e-8f687cd20ab2 | DivyanshMahida127/LeetCode-Solutions | 0203-remove-linked-list-elements/0203-remove-linked-list-elements.cpp | /**
* Definition for singly-linked list.
* struct ListNode {
* int val;
* ListNode *next;
* ListNode() : val(0), next(nullptr) {}
* ListNode(int x) : val(x), next(nullptr) {}
* ListNode(int x, ListNode *next) : val(x), next(next) {}
* };
*/
class Solution {
public:
ListNode* removeEleme... | ALGO | 0.999897 | 5.718971 |
27ab0531-43e8-4cfe-a7e9-b0a30e1f830c | ishandutta2007/codeforces | mr.robot_28/normal/1413/C.cpp | #include<bits/stdc++.h>
using namespace std;
bool cmp(pair <pair <int, int>, int> a, pair <pair <int, int>, int> b)
{
return a.first.second < b.first.second;
}
signed main() {
ios_base::sync_with_stdio(false);
cin.tie(NULL);
cout.tie(NULL);
vector <int> a(6);
for(int i = 0; i < 6; i++)
{
cin >> a[i];
}
sort(... | ALGO | 0.999944 | 3.629412 |
3666ac11-c722-47fd-a6f8-5ebef961ea4c | rsenwar/cses-solutions | 1682.cpp | // Online C++ compiler to run C++ program online
#include <bits/stdc++.h>
using namespace std;
void dfs1(int u, stack<int>& st, vector<int>& vis, vector<vector<int>>& adj) {
vis[u] = 1;
for(int v: adj[u]) {
if(!vis[v]) {
dfs1(v, st, vis, adj);
}
}
st.push(u);
}
void dfs... | ALGO | 0.999943 | 4.040135 |
aea24c7a-13b1-457d-a52a-ca5778b309f9 | rendon/algorithms_weekly_rally | week21/TavasAndSaddas/main.cpp | // region Template
#include <iostream>
#include <iomanip>
#include <fstream>
#include <sstream>
#include <string>
#include <bitset>
#include <vector>
#include <queue>
#include <map>
#include <set>
#include <cmath>
#include <cctype>
#include <cassert>
#include <cstring>
#include <numeric>
#include <iomanip>
#include <al... | ALGO | 0.997854 | 5.632952 |
1b3f7c22-9967-416a-9545-1984aa3f2948 | TaRun1369/RandomDSA | 2903-insert-greatest-common-divisors-in-linked-list/insert-greatest-common-divisors-in-linked-list.cpp | /**
* Definition for singly-linked list.
* struct ListNode {
* int val;
* ListNode *next;
* ListNode() : val(0), next(nullptr) {}
* ListNode(int x) : val(x), next(nullptr) {}
* ListNode(int x, ListNode *next) : val(x), next(next) {}
* };
*/
class Solution {
public:
ListNode* insertGreat... | ALGO | 0.999973 | 5.580573 |
4f62d821-0330-4aa9-bd7e-8efe160c7b4d | MUNEEBJAVAID/ProblemSolvingDSA.github.io | Binary Search/EKO SPOJ BS.cpp | #include <iostream>
#include <vector>
#include <algorithm>
using namespace std;
bool isPossibeSolution(vector<long long int> trees , long long int M ,
long long int bladHeight){
long long int woodCollects = 0;
for(long long int i = 0; i < trees.size(); i++){
if(trees[i] > bladHeight){
woodCollects... | ALGO | 0.99999 | 5.516217 |
ab301144-6450-45aa-af27-69c3f92eb0be | GuacheSuede/MSSubmission1234567890 | submission/bollinger/boost_1_69_0/libs/compute/perf/perf_stl_includes.cpp | #include <vector>
#include <algorithm>
#include <iostream>
#include "perf.hpp"
int rand_int()
{
return static_cast<int>((rand() / double(RAND_MAX)) * 25.0);
}
int main(int argc, char *argv[])
{
perf_parse_args(argc, argv);
std::cout << "size: " << PERF_N << std::endl;
std::vector<int> v1(PERF_N);
... | TEST | 0.942211 | 5.9701 |
1099768f-5252-4675-aa64-cd5d1cf8e841 | right-x2/Algorithm_study | sw10059.cpp | #include <vector>
#include <iostream>
#include <queue>
#include <cstdlib>
#include <algorithm>
using namespace std;
int n;
string a,b;
int conv(string str)
{
int sum = 0;
int mul = 1;
sum = (str[0]-'0')*10 + (str[1] - '0');
return sum;
}
int main(int argc, char** argv)
{
ios::sync_with_stdio(fa... | ALGO | 0.999122 | 4.954081 |
4ff60c9b-670a-4bf0-b20b-8b9c052ce6e8 | jackieooikk/codeforce | 1100/frogjumps.cpp | #include <iostream>
using namespace std;
int main() {
int t;
cin >> t;
while (t--) {
string s;
cin >> s;
int d = 0;
int a = 0;
for (int i = 0; i <= s.size(); i++) {
a++;
if (s[i] == 'R' || s[i] == '\0') {
d = (d > a) ? d : a... | ALGO | 0.999297 | 4.537828 |
6b585a92-3456-4c87-9861-80b00a8e7483 | Daniel-Schutz/SistemaVestUFMS | FuncoesDev.cpp | #include "funcoes.h"
#include <ctype.h>
#include <math.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
// Desenvolver funcoes
void menu() {
printf("\n.+*****+.MENU.+*****+.\n");
printf("1 - Gerar arquivo de saída .txt\n");
printf("2 - Pesquisar candidatos .txt\n");
printf("3 - Gerar arquivo dos... | TOOL | 0.959348 | 3.63493 |
8bd8f46a-1df2-4b95-bddf-c45109c2d150 | SyedMa3/CP | Product_Pain.cpp | #include <bits/stdc++.h>
using namespace std;
#define ll long long
#define PI 3.1415926535897932384626
#define rep(n) for (int i = 0; i < n; ++i)
#define repc(i, n) for (ll i = 0; i < n; i++)
#define pb push_back
#define mp make_pair
#define F first
#define S second
#define all(x) x.begin(), x.end()
#define rall(x) x.r... | ALGO | 0.999791 | 4.623667 |
a7ad6847-b41c-45a6-b235-3da3f767bdd0 | ja-fort/gem5 | src/systemc/tests/systemc/datatypes/int/arith/arith10/arith10.cpp | /*****************************************************************************
arith10.cpp --
Original Author: Martin Janssen, Synopsys, Inc., 2002-02-15
*****************************************************************************/
/****************************************************************************... | TEST | 0.966412 | 4.808961 |
b781af3a-404d-4163-ab62-a0cd7fc8968c | Factoriall/Algorithm-2021 | Heap/22252_InfoSellerHosuk.cpp | #define _CRT_SECURE_NO_WARNINGS
#include <cstdio>
#include <string>
#include <map>
#include <queue>
using namespace std;
map<string, priority_queue<int>> m;
int main() {
int i;
int Q;
scanf("%d", &Q);
long long infoSum = 0;//100000 * 100000 int Ѿ. ̿ ʿ.
for (i = 0; i < Q; i++) {
int idx;
scanf("%d", &idx... | ALGO | 0.991823 | 3.53252 |
44acdb6b-9b98-4d0f-8436-1d646a1955bb | DangNguyenKhanh/DSA | Data-structure/Linear-data/Stack.cpp | #include<iostream>
using namespace std;
template<class T>
class Node {
public:
T Info;
Node<T>* Next;
public:
Node(T);
void Display();
};
template<class T>
class Stack {
private:
Node<T>* Sp;
int Count;
public:
Stack();
bool IsEmpty();
void Push(T);
T Pop();
T Peek();
void Display();
void Clear();
~Stac... | ALGO | 0.992747 | 3.834137 |
77bbbafd-89ed-4dfa-9e58-15c49e889541 | anuragpratap05/DSA | Searching Sorting/a_searching and sorting_/class2/Count_Inversions_gfg.cpp | #include<bits/stdc++.h>
using namespace std;
long long merge(vector<long long>& arr,long long l,long long r,long long mid)
{
long long lsi=l;
long long lei=mid;
long long rsi=mid+1;
long long rei=r;
//long long j=mid+1;
long long k=0;
long long inversion=0;
vector<long long> temp(... | ALGO | 0.999985 | 4.72315 |
1843b3bd-2d75-4339-bcb6-cd692722efa0 | raincross7/code-similarity | codes/train_code/problem481/problem481_382.cpp | #include <bits/stdc++.h>
using namespace std;
int main() {
string S;
cin >> S;
int N = S.size();
// 0101 で塗る場合
int ans = 0;
for ( int i = 0; i < N; ++i){
int c = S[i] - '0';
int c2 = i % 2;
if ( c != c2 ) ++ans;
}
int ans2 = 0;
for ( int i = 0; i < N; +... | ALGO | 0.999928 | 3.938536 |
b0d9921e-c2e7-4b91-9a85-c40e5b9e924e | shivamkumar4344/Data-Structures-Algorithms | BasicMaths/CountprimeNo.cpp | //sieve of erarothness
#include<bits/stdc++.h>
using namespace std;
//optimal approach in TC = O(n*(log(log n)))
int countPrimes(int n)
{
if(n==0 || n==1) return 0;
vector<bool> prime(n,true);
int count = 0;
for(int i=2;i<n;i++){
if(prime[i]){
count++;
int j = 2*i;
... | ALGO | 0.999619 | 5.212942 |
7cec5a76-6fd4-438a-8e01-914f04a84185 | MehrajShakil/Solving-problem-in-different-OJ | LightOJ/Segment Tree/Fast Queries.cpp | /// BISMILLAHIR RAHMANIR RAHEEM
/// ALLAH IS WATCHING ME
/// Every soul shall taste death.
#include<bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
#include <ext/pb_ds/detail/standard_policies.hpp>
/// order_of_key return number of elements less than x.
/// find_... | ALGO | 0.999928 | 4.401383 |
e9327857-437c-40ff-8ea6-6f8f84b28873 | Ayan-nema/LeetCode-Questions | 2326_Spiral Matrix IV.cpp | /**
* Definition for singly-linked list.
* struct ListNode {
* int val;
* ListNode *next;
* ListNode() : val(0), next(nullptr) {}
* ListNode(int x) : val(x), next(nullptr) {}
* ListNode(int x, ListNode *next) : val(x), next(next) {}
* };
*/
class Solution {
public:
vector<vector<int>> s... | ALGO | 0.999997 | 5.567161 |
10048c2b-4dc2-49f7-93ec-4478fbc2b92e | immjolnir/algos | chenxiaoyu/part2/6.5 可持久化数据结构/hdu4348.cpp | #include<cstdio>
#include<algorithm>
#define lc tr[i].ch[0]
#define rc tr[i].ch[1]
#define Lc tr[j].ch[0]
#define Rc tr[j].ch[1]
#define mid (l+r>>1) //
const int maxn=100005;
using namespace std;
typedef long long int ll;
int n,m;
struct node{
int ch[2];
ll sum,lazy;
}tr[maxn*20];
int cnt,rt[maxn];
void push_... | ALGO | 0.99916 | 4.036839 |
6f814338-45b9-44b7-bbcd-500a0e0f5e18 | bill-auger/av-caster | JuceLibraryCode/modules/juce_graphics/images/juce_ImageConvolutionKernel.cpp | ImageConvolutionKernel::ImageConvolutionKernel (const int size_)
: values ((size_t) (size_ * size_)),
size (size_)
{
clear();
}
ImageConvolutionKernel::~ImageConvolutionKernel()
{
}
//==============================================================================
float ImageConvolutionKernel::getKernelVa... | TOOL | 0.909296 | 6.628236 |
db565844-76d0-4f9f-82d4-ca302ce502ef | MaiESHA0001/DSA_-CodingNinja_cpp | Linklist/Even after odd Linkedlist.cpp | Problem statement
For a given singly linked list of integers, arrange the nodes such that all the even number nodes are placed after the all odd number nodes. The relative order of the odd and even terms should remain unchanged.
Note :
1. No need to print the linked list, it has already been taken care. Only return th... | ALGO | 0.999991 | 4.710158 |
85cffc29-7ea8-4e4f-a34b-6dff16a0ef65 | Nobles3689/practice | 20230801_2_#1463_Check.cpp | //Beakjoon Online Judge #1463
#include <iostream>
#include <algorithm>
using namespace std;
int Min[1000001];
int make1(int n){
if(n<=1){
return 0;
}
int& tmp = Min[n];
if(tmp!=-1){
return tmp;
}
if(n%6==0){
tmp = min(min(make1(n/3), make1(n/2)), make1(n-1)) + 1;... | ALGO | 0.999967 | 4.614144 |
6d70a067-c68c-4c5f-b500-a9f519c84112 | youssef-abdallah/SIC-XE-Assembler | src/Expression.cpp | #include "Expression.h"
Expression::Expression()
{
//ctor
}
Expression::~Expression()
{
//dtor
}
bool Expression::validate(){
string expression = Getexpression();
regex re("([*]|\\w+)([*+/-])([*]|\\w+)");
return (util.matchRegex(expression, re));
}
string Expression::evaluate(){
string oper... | TOOL | 0.887109 | 4.890101 |
3271502e-5c83-4ff6-a73c-24c04c01651e | zerusfree/lab-6.2-rec- | Source.cpp | #include <iostream>
#include <iomanip>
#include <time.h>
using namespace std;
int K(int mas[], const int n)
{
int kilk = 0;
for (int i = 0; i < n; i++)
{
if ((mas[i] % 2) != 0)
kilk += 1;
}
return kilk;
}
void Create(int array[], const int size, const int Low, const int High,co... | ALGO | 0.973874 | 3.963588 |
c713ff92-e20a-4e87-a3da-b25e62d10195 | lhlephuocdao/Algorithm | Data Structures/FenwickTree/Offline2D_BIT.cpp | #include <algorithm>
#include <array>
#include <iostream>
#include <vector>
using namespace std;
/**
* Offline 2D Fenwick Tree implementation.
* Note that all the update and query indices
* are zero-indexed, and that the rows are not
* coordinate compressed in this implementation.
*/
template <typename T> class O... | ALGO | 0.9981 | 6.040218 |
0de098f5-d347-4a6c-aed7-d21a59a98e1a | DUDUKorte/Beecrowd-C_Cpp | Beecrowd_Cpp/1038_Lanche.cpp | #include <bits/stdc++.h>
using namespace std;
int main(){
int cod, qtd;
vector<float> values = {4.00, 4.50, 5.00, 2.00, 1.50};
cin >> cod >> qtd;
cout << "Total: R$ " << fixed << setprecision(2) << qtd * values[cod-1] << endl;
return 0;
} | ALGO | 0.997279 | 4.315362 |
5159238f-46e5-4dfc-b4ab-c7311f6f0a92 | ishandutta2007/codeforces | vercingetorix/normal/12/D.cpp | #include <iostream>
#include <vector>
#include <algorithm>
#include <string>
#include <ctype.h>
#include <queue>
#include <cstring>
#include <set>
#include <bitset>
#include <map>
#include <chrono>
#include <random>
#include <unordered_map>
#include <stdio.h>
using namespace std;
typedef long long ll;
typedef long do... | ALGO | 0.999818 | 3.747659 |
50fe1f23-13d0-4e38-bfd0-790833bc2336 | DheerajSharma22/Dsa-Practice | Tree/Binary Tree/morrisTraversal.cpp | #include <iostream>
#include <bits/stdc++.h>
using namespace std;
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... | ALGO | 0.999973 | 5.957318 |
f0bb92bc-47a9-4159-a39f-f6b2beb4d45f | ABost31/C-review- | cpp/CH2Q1.cpp | //1. Sum of Two Numbers
//Write a program that stores the integers 50 and 100 in variables, and stores the sum of
//these two in a variable named total .
#include<iostream>
using namespace std;
int main (){
int a = 50;
int b = 100;
int c = a+b;
cout << c;
return 0;
} | TOOL | 0.933958 | 3.427488 |
da819aa4-f6a6-4bb4-b177-0b8f0baf0403 | Diaaorabyy/myprogram | 2s comp.cpp | #include <iostream>
#include <string>
using namespace std;
string decimalToBinary(int n) {
// C++ integers are already in 2-complements so you only have to
// extract the bits.
if((n < -128) || (n >= 128)){
cerr << "The number "<< n << " does not fit into a 8-bit 2-complement representation" << endl... | ALGO | 0.997129 | 4.45416 |
1c6ed12f-e839-4981-becb-2aadaa8fe7d7 | Behrouz-Babaki/practice | 11991/11991.cpp | #include <iostream>
#include <vector>
using std::cin;
using std::cout;
using std::endl;
using std::vector;
int main(void) {
int num_elements, num_queries;
while (cin >> num_elements) {
cin >> num_queries;
vector<vector<int> > elements(1000001);
for (int elem_cnt = 1; elem_cnt <= num_elements; elem_cnt... | ALGO | 0.999663 | 4.162144 |
02c86763-43ec-4bdd-ad1f-5975676752bd | nguyenvanthanh312000/Nguy-n-V-n-Th-nh | Demsonguyento[1].cpp | #include<iostream>
using namespace std;
// khai bo c?u trc 1 ci node trong cy nh? phn tm ki?m
struct node
{
int data; // d? li?u ch?a trong 1 ci node
struct node *pLeft; // con tr? lin k?t v?i ci node bn tri <=> cy con tri
struct node *pRight; // con tr? lin k?t v?i ci node bn ph?i <=> cy con ph?i
};
typedef struct... | ALGO | 0.99975 | 3.282903 |
ae32b9c3-e04c-4fce-893e-516d6eb38fee | blazic016/mycpp | udemy/Section-8-Statements-and-Operators-Source-code/ChallengeSolution/main.cpp | // Section 8 Challenge - Solution
/*
For this program I will be using US dollars and cents.
Write a program that asks the user to enter the following:
An integer representing the number of cents
You may assume that the number of cents entered is greater than or equal to zero
The program should the... | ALGO | 0.969028 | 5.270023 |
713c3fdb-7a11-4aea-9719-e00bb5609be8 | notmyst33d/ahsg | thirdparty/bullet/BulletCollision/CollisionShapes/btSdfCollisionShape.cpp | #include "btSdfCollisionShape.h"
#include "btMiniSDF.h"
#include "LinearMath/btAabbUtil2.h"
ATTRIBUTE_ALIGNED16(struct)
btSdfCollisionShapeInternalData
{
BT_DECLARE_ALIGNED_ALLOCATOR();
btVector3 m_localScaling;
btScalar m_margin;
btMiniSDF m_sdf;
btSdfCollisionShapeInternalData()
: m_localScaling(1, 1, 1),
... | ALGO | 0.952745 | 7.036384 |
94e44ef7-7c00-4898-bf97-dbe8613c216e | Rashed112/LeetCode-Solutions | LeetCode Blind 75 solutions/20_valid_parentheses.cpp | class Solution {
public:
bool isValid(string s) {
stack<char>ch;
int n = s.size();
unordered_map<char, char>mp = { {')', '('}, {'}', '{'}, {']', '['}};
for(int i=0;i<n;i++){
if(s[i]=='(' || s[i]=='{'|| s[i]=='['){
ch.push(s[i]);
}
e... | ALGO | 0.999798 | 6.537047 |
2c183b8d-c581-43bf-bdb5-a5361f728b5e | sarthak-star/Leetcode | 114-flatten-binary-tree-to-linked-list/flatten-binary-tree-to-linked-list.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.999945 | 6.231816 |
6d6e2cf5-9253-4762-b25d-99a782f10bb6 | Kartoffelbauer33/vertic | vertic_app/vertic/vertic_project/vertic_client_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.997851 | 6.76775 |
774a50d4-838c-4ddf-8df8-9846f7b06a71 | xiaozzzzwww/libntl | src/mat_poly_ZZ.cpp | #include <NTL/mat_poly_ZZ.h>
#include <NTL/mat_poly_ZZ_p.h>
#include <NTL/mat_poly_lzz_p.h>
NTL_START_IMPL
static
long CharPolyBound(const mat_ZZ& a)
// This bound is computed via interpolation
// through complex roots of unity.
{
long n = a.NumRows();
long i;
ZZ res, t1, t2;
set(res);
for (i = 0; i... | ALGO | 0.998673 | 5.18297 |
af2bfa53-3d9a-495e-8310-e7bfd644b560 | qiuzhu0/alphastar | mmind.cpp | #include <iostream>
#include <string>
using namespace std;
int findFoo(int password, int guess) {
string s1 = to_string(password);
string s2 = to_string(guess);
int counter = 0;
for (int i = 0; i < 4; i++) {
if (s1[i] == s2[i])
counter++;
}
return counter;
}
int findBar(int password, int guess... | ALGO | 0.998988 | 4.34343 |
6031e971-185e-46d9-9c9a-b0661ddc1034 | Eason0210/cpp_primer | ch2/book_sales/example_2_6.cpp | #include <iostream>
#include <string>
#include "Sales_data.h"
using std::cout; using std::cin;
using std::endl;
int main(){
Sales_data data1, data2;
double price = 0;
cin >> data1.bookNo >> data1.units_sold >> price;
data1.revenue = data1.units_sold * price;
cin >> data2.bookNo >> data2.units_sol... | TOOL | 0.97877 | 5.097886 |
f27e8d39-cf3a-4d5c-8ba8-ea9db2f85500 | star-platinum127/atcoder | I - Coins.cpp | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#pragma GCC optimize("Ofast")
#pragma GCC optimize ("unroll-loops")
#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native")
#define mikumywaifu ios_base::sync_with_stdio(0)
#define misakamywaifu cin.tie(0)
#define pb push_back
#de... | ALGO | 0.999907 | 4.340961 |
005d70aa-caca-4d21-8c07-3b91c1dbd46b | KlemenSkok/RPA_datoteke | datoteke-12.cpp | #include <iostream>
#include <fstream>
#include <vector>
#include <string>
using namespace std;
vector<string> parse(string s) {
vector<string> v;
string word;
for(int i = 0; i < s.size(); i++) {
if(s[i] == ' ') {
v.push_back(word);
word.clear();
}
else {
... | TOOL | 0.881219 | 3.627676 |
a13a1446-590c-4959-ad1f-4deb5960cb8d | ML-UCV/ML-CodeBert-DistinctSolutions | Raw Dataset/inversmodular/extended-euclid-algo/train/a4c691e6-a4b7-40b9-9e20-ece25623bad9.cpp | #include <iostream>
#include <fstream>
#include <stack>
#include <algorithm>
#include <string>
#include <queue>
#include <vector>
#include <map>
#include <cmath>
#include <stdio.h>
using namespace std;
ifstream fin("inversmodular.in");
ofstream fout("inversmodular.out");
void gcd(int a, int b, long long& x... | ALGO | 0.999898 | 4.090626 |
3ea94069-df37-4244-807e-b1cb023bb65a | CallMeQan/Training-for-HSG-HCM-vietnam-2024 | cplusplus/ruabo/p.cpp | #include<bits/stdc++.h>
using namespace std;
const int n = 1e6 + 1;
int N;
int cnt[n] , a[n];
int C(int k, int n) {
if (k == 0 || k == n) return 1;
if (k == 1) return n;
return C(k - 1, n - 1) + C(k, n - 1);
}
int main()
{
ios::sync_with_stdio(0);
cin.tie(0);
cin >> N;
int maxNum = -1e6;
... | ALGO | 0.999987 | 4.094029 |
62cd971c-91b2-492b-b584-f40ddfb8c0e0 | Superm4n97/competetive-programming | Codeforces vol 04/1408D.cpp | #include<bits/stdc++.h>
#define ll long long int
#define show(x) cout << #x << " : " << x << endl
#define maxn 2004
#define inf 1000000000000000018
using namespace std;
ll a[maxn] , b[maxn] , c[maxn], d[maxn] , n , m, max_y[4000006];
vector <pair<ll,ll> > vp;
int main()
{
cin >> n >> m;
for (int i=1 ; i... | ALGO | 0.999955 | 3.739854 |
d4d500de-0b78-4638-bc0f-92cd564076df | ChrisYoung1048/RayTracer | hierarchy.cpp | #include <algorithm>
#include "hierarchy.h"
// Reorder the entries vector so that adjacent entries tend to be nearby.
// You may want to implement box.cpp first.
void Hierarchy::Reorder_Entries()
{
if(!entries.size()) return;
TODO;
}
// Populate tree from entries.
void Hierarchy::Build_Tree()
{
if(!entrie... | ALGO | 0.995756 | 5.906243 |
8388659d-ec0c-4222-bccf-391aba311abf | aldzl923/Cpp_project | miniproject/project_4.cpp | #include <iostream>
#include <vector>
using namespace std;
int main() {
int m;
int count = 1;
cout << " â Ȥ ڿ Էּ. : ";
cin >> m;
vector<vector<int>> v(m, vector<int>(m, 0));
int row = 0;
int col = m / 2;
while (count <= m * m) {
v[row][col] = count;
count++;
... | ALGO | 0.9998 | 3.66644 |
6de33cf7-7641-476e-9f0f-fb4373fb16b9 | Cryst67/KattisSolutions | src/problems/timeloop/solutions/timeloop.cpp | #include <iostream>
using namespace std;
int main(){
int trials;
cin >> trials;
for (size_t i = 1; i <= trials; i++)
{
cout << i << " Abracadabra" << endl;
}
return 0;
} | ALGO | 0.916037 | 4.675164 |
e137ebc3-a129-4f4c-9c2b-bde3a4dd1e91 | sureyeaah/Competitive | uva/CH03/10660.cpp | #include <bits/stdc++.h>
using namespace std;
#define DEBUG(x) cout << '>' << #x << ':' << x << endl;
#define FOR0(i,n) for(int i=0, _##i=(n); i<_##i; ++i)
#define FOR(i,l,r) for(int i=(l), _##i=(r); i<_##i; ++i)
#define FORD(i,l,r) for(int i=(r), _##i=(l); --i>=_##i; )
#define repi(i,a) for(__typeof((a).begin()) i=(a)... | ALGO | 0.999945 | 3.122197 |
02b7d94b-3867-4268-9b3c-07353dd04455 | havocp/hwf | deps/spidermonkey/jsdate.cpp | /*
* JS date methods.
*/
/*
* "For example, OS/360 devotes 26 bytes of the permanently
* resident date-turnover routine to the proper handling of
* December 31 on leap years (when it is Day 366). That
* might have been left to the operator."
*
* Frederick Brooks, 'The Second-System Effect'.
*/
#include <... | TOOL | 0.855417 | 5.87951 |
3c2ee0c2-7fce-4f7a-8ab8-b8274fb09f57 | mzooo/calculator | calculator/calculator.cpp | #include <iostream>
#include <stack>
#include <string>
#include <algorithm>
#include <stdexcept>
#include <cmath>
#include <cctype>
struct oper {
char op; //
size_t pre; // 켱
};
//Model
class Calculator {
public:
size_t precedence(const char op) { // 켱 Լ
if (op == '+' || op == '-')
return 1;
if (op == '*... | ALGO | 0.999476 | 5.836616 |
3597e116-4a18-4bbd-97ed-45d29dfa2a18 | Maesla/Path-Planning-Project | src/Eigen-3.3/failtest/fullpivqr_int.cpp | #include "../Eigen/QR"
#ifdef EIGEN_SHOULD_FAIL_TO_BUILD
#define SCALAR int
#else
#define SCALAR float
#endif
using namespace Eigen;
int main()
{
FullPivHouseholderQR<Matrix<SCALAR,Dynamic,Dynamic> > qr(Matrix<SCALAR,Dynamic,Dynamic>::Random(10,10));
}
| TEST | 0.86806 | 3.150836 |
b31bb96f-13c5-420d-b992-08b82a5e7827 | rainliu/leetcode | src/392IsSubsequence/392IsSubsequence.cpp | class Solution {
public:
bool isSubsequence(string s, string t) {
int m = s.size();
int n = t.size();
int i = 0;
int j = 0;
while(i<m&&j<n){
if(s[i]==t[j]){
++i;
}
++j;
}
return i>=m;
}
};
| ALGO | 0.999924 | 6.317825 |
47d08c43-2073-4dcb-812c-def16f8b33b1 | bartsidee/boxee | xbmc/utils/LockFree.cpp | #include "LockFree.h"
#include <stdlib.h>
///////////////////////////////////////////////////////////////////////////
// Fast stack implementation
// NOTE: non-locking only on systems that support atomic cas2 operations
///////////////////////////////////////////////////////////////////////////
void lf_stack_init(lf_... | ALGO | 0.993126 | 5.599742 |
1a32645d-e9d0-4b30-b717-795a46c8338f | darchr/dram-cache-model | src/systemc/tests/systemc/misc/user_guide/chpt4.4/stage2.cpp | /*****************************************************************************
stage2.cpp --
Original Author: Martin Janssen, Synopsys, Inc., 2002-02-15
*****************************************************************************/
/*****************************************************************************... | ALGO | 0.988208 | 5.569631 |
d1b0e4db-629e-43ed-b548-84e08a758301 | rohit-100/cppFiles | book/programmingPrinciplesAndPracticesUsingC++/iostreams/stream_states.cpp | /*
* any stream has four states
* 1.good()
* 2.bad()
* 3.eof()
* 4.fail()
*
*
* if stream.bad() is true then nothing can happend
* to move forward simply raise an exception
*
* if stream.eof() is true we have reached to the
* end of input , simply return
*
* if stream.good() is a state when... | ALGO | 0.942178 | 3.753551 |
56bf2b72-2953-4412-8a81-6a30886dfe4f | Rishithp06/DailyDSA | rishith/recursion/generatesubseqsets.cpp | class Solution {
public:
// Helper function for recursion
void generateSubsets(vector<int>& nums, int index, vector<int>& current, vector<vector<int>>& result) {
// Base case: if we reach the end of the array
if (index == nums.size()) {
result.push_back(current); // Add the current s... | ALGO | 0.999974 | 7.046438 |
9f753436-0261-4852-9a8c-7175940310e3 | hibetterheyj/tag_ws | src/fractal_ros/aruco_fractal/src/aruco_fractal/markerdetector_impl.cpp | #include "markerdetector_impl.h"
#include "cameraparameters.h"
#include "markerlabeler.h"
#include "timers.h"
#include <opencv2/core/core.hpp>
#include <opencv2/imgproc/imgproc.hpp>
#include <opencv2/features2d/features2d.hpp>
#include <opencv2/calib3d/calib3d.hpp>
#include <fstream>
#include <iostream>
#include <vala... | TOOL | 0.980999 | 6.462015 |
e80e81f4-2d98-4a4e-b61a-7de14a0c0b5f | LeRelais/Baekjoon-algorithm | 정렬/2217.cpp | #include <iostream>
#include <algorithm>
using namespace std;
int ropes[100001], n;
int main() {
cin >> n;
for (int i = 0; i < n; i++)
cin >> ropes[i];
sort(ropes, ropes + n);
int maxWeight = 0, idx = 0;
for (int i = n; i > 0; i--) {
if (maxWeight < ropes[idx] * i)
... | ALGO | 0.999955 | 4.059692 |
1c25566d-9536-47be-a0ea-5a48ff764bbb | ishandutta2007/codeforces | nuip/normal/500/C.cpp | #include <string>
#include <vector>
#include<iostream>
#include<cstdio>
#include<cstdlib>
#include<stack>
#include<queue>
#include<cmath>
#include<algorithm>
#include<functional>
#include<list>
#include<deque>
#include<bitset>
#include<set>
#include<map>
#include<cstring>
#include<sstream>
#include<complex>
#include<io... | ALGO | 0.999994 | 3.15747 |
f699f263-9e59-49c7-a690-c981e837b1bb | Antimo51/Homework-on-matu | Lesson 3/3.cpp | #include<stdio.h>
#include<math.h>
#define in Read()
int in{
int i=0,f=1; char ch=0;
while((ch<'0'||ch>'9')&&ch!='-'){
ch=getchar();
if(ch=='a') return -1;
}
if(ch=='-') f=-1, ch=getchar();
while('0'<=ch&&ch<='9') i=(i<<1)+(i<<3)+ch-48, ch=getchar();
return i*f;
}
int fac[100];... | ALGO | 0.999813 | 3.555206 |
98d4dccd-2441-48b3-a046-4cac825fb394 | llynv/CP-files | 2037E.cpp | /*
Code by: linvg
Created: 19.12.2024 14:54:54
*/
#include <bits/stdc++.h>
using namespace std;
#define int long long
#define all(x) (x).begin(), (x).end()
#define sz(x) ((int)(x).size())
string to_upper(string a) { for (int i = 0;i < (int)a.size();++i) if (a[i] >= 'a' && a[i] <= 'z') a[i] -= 'a' - 'A'; return a;... | ALGO | 0.999642 | 4.788507 |
e31fa6b2-27c3-4011-9dc7-5737fcbeab08 | TristanCPP/Time-Tracker-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.9988 | 6.76073 |
43470caa-8d53-4270-8235-3245b9f2bdaa | hwannow/PS | BOJ/15025.cpp | #include<bits/stdc++.h>
#define x first
#define y second
using namespace std;
int n, m;
int main() {
ios::sync_with_stdio(0);
cin.tie(0);
cout.tie(0);
cin >> n >> m;
if (!n && !m) cout << "Not a moose";
else if (n == m) cout << "Even " << n * 2;
else if (n < m) cout << "Odd " << m * 2;
... | ALGO | 0.999913 | 4.024807 |
de64094a-6215-4667-b73b-d7595fc034c3 | Ayush-dvplr/22BCS10322_Ayush_sah_AP | day1/jump.cpp | class Solution {
public:
int jump(vector<int>& nums) {
int near = 0, far = 0, jumps = 0;
while (far < nums.size() - 1) {
int farthest = 0;
for (int i = near; i <= far; i++) {
farthest = max(farthest, i + nums[i]);
}
near = far + 1;
... | ALGO | 0.999991 | 6.17584 |
d6665901-36d4-431d-8643-dc5992799684 | PaNik2000/cpp-practice | practice1/task1/triangle.cpp | #include <iostream>
#include <cmath>
#include "triangle.h"
using namespace std;
Triangle::Triangle(double a, double b, double c)
{
this->a = a;
this->b = b;
this->c = c;
}
bool Triangle::exst_tr()
{
if (a + b > c)
{
if (a + c > b)
{
if (b + c > a) return true;
... | ALGO | 0.986881 | 4.086495 |
c82201d4-a051-46bf-a862-fa49f8bd6622 | ojhaddeepak/gfg | Difficulty: Medium/Word Break/word-break.cpp | //{ Driver Code Starts
#include <bits/stdc++.h>
using namespace std;
// } Driver Code Ends
class Solution {
public:
bool solve(string &s,set<string>& st,int i,vector<int>& dp){
if(i==s.size()) return 1;
if(dp[i]!=-1) return dp[i];
string temp="";
for(int j=i;j<s.size();j++){
... | ALGO | 0.995181 | 6.056531 |
57b343a9-0e7c-47b3-8ca4-ba8bff65242f | aadits1965/CODEFORCES | LEVEL C/C_Different_Differences.cpp | #include<bits/stdc++.h>
using namespace std;
int main(){
int t;
cin >> t;
while (t--){
int n,m,count=0,d=0;
cin>>n>>m;
int j=1;
bool flag=false;
for(int i=1;count<n;i++){
if(n-count<=m-i+1){
cout<<i<<" ";
d=i;
i+=j-1;
j++;
count++;
}
el... | ALGO | 0.999974 | 3.468503 |
e92dd4a6-8d43-452f-86a7-379f33f5967e | eoan-ermine/TooManyLists | src/cpp/stack.cpp | struct Link {
int element;
Link* next;
Link(int element, Link* next) {
this->element = element;
this->next = next;
}
};
struct List {
Link* head;
void push(int element) {
Link* new_node = new Link(element, nullptr);
this->head = new_node;
}
... | ALGO | 0.95327 | 3.77983 |
054e2b36-f899-4af3-9b43-a6fcc56521a9 | ArmanTheParman/deis | src/kernel/coinstats.cpp | #include <kernel/coinstats.h>
#include <chain.h>
#include <coins.h>
#include <crypto/muhash.h>
#include <hash.h>
#include <logging.h>
#include <node/blockstorage.h>
#include <primitives/transaction.h>
#include <script/script.h>
#include <serialize.h>
#include <span.h>
#include <streams.h>
#include <sync.h>
#include <t... | TOOL | 0.864576 | 7.396273 |
262da85d-0b6c-4354-9ac8-c4fd986634c4 | TTP1128/wangjunrui-s-code | UVA/UVA10003 切木棍 Cutting Sticks.cpp | #include<cstdio>
#include<cctype>
#include<algorithm>
#include<cstring>
#define re register
using namespace std;
template <typename T>
inline void read(T& x)
{
x = 0;
char s = getchar();
bool f = false;
while (!(s >= '0' && s <= '9'))
{
if (s == '-')
f = true;
s = getchar();
}
while (s >= '0' && s <= '9')... | ALGO | 0.998966 | 3.083515 |
9eca3d52-96a7-4c38-8bbd-dec957e0f561 | HyoBN/Algorithm_Study | BOJ_PS/boj_01297.cpp | #include <iostream>
#include <cmath>
using namespace std;
int main()
{
int d,h,w;
double x;
cin>>d>>h>>w;
x=sqrt(pow(d,2)/(pow(h,2)+pow(w,2)));
cout<<(int)(h*x)<<' '<<(int)(w*x);
} | ALGO | 0.999569 | 3.238146 |
eb925769-16b2-4da1-ba00-72e6bea43311 | w74srm/tsinghua | leetcode/218.cpp | #include<bits/stdc++.h>
using namespace std;
vector<vector<int>> getSkyline(vector<vector<int>>& buildings)
{
auto cmp = [](const pair<int, int>& a, const pair<int, int>& b) -> bool {return a.second < b.second;};
priority_queue<pair<int, int>, vector<pair<int, int>>, decltype(cmp)> que(cmp);
vector<int> bo... | ALGO | 0.999952 | 4.614228 |
3ed36513-2682-4c0c-90bc-6081742fe8d2 | proxmox/ceph | ceph/src/boost/libs/multiprecision/performance/rational_determinant_bench.cpp | #include <iostream>
#include <vector>
#include <benchmark/benchmark.h>
#include <boost/multiprecision/cpp_int.hpp>
#include <boost/multiprecision/gmp.hpp>
#include <boost/math/special_functions/prime.hpp>
#include <boost/math/special_functions/pow.hpp>
#include <gmpxx.h>
#include <boost/random/mersenne_twister.hpp>
... | TEST | 0.998374 | 5.800617 |
28d4aa21-af75-402d-abc0-86176af5e502 | 3essamzaky/Embedded_linux2024_diploma | cxx_tasks/Polymorphism_STL_tasks/list_funs.cpp | #include <iostream>
#include <deque>
#include <iterator>
#include <list>
template <typename T> void print_list(std::list<T> l){
for(const auto &elem :l)
{
std::cout << elem << " ";
}
std::cout << std::endl;
}
int main(){
std::list<int > l {1,2,3,4,5,4};
std::list<int> l2 (std::nex... | TOOL | 0.93807 | 4.873604 |
0917c6b8-c75a-4f99-980f-bb9097ad4944 | TwinkleGupta07/Leetcode-Practice | 2231-largest-number-after-digit-swaps-by-parity/2231-largest-number-after-digit-swaps-by-parity.cpp | class Solution {
public:
int largestInteger(int num) {
vector<int> odd;
vector<int> even;
int temp = num;
while(temp)
{
if((temp%10)%2==0)
{
even.push_back(temp%10);
}
else
{
... | ALGO | 0.999981 | 5.89159 |
4b28d8c7-ef4f-44c0-8666-0a80df5cd7e4 | nickcellar/qt3d-applesilicon | src/3rdparty/assimp/code/CalcTangentsProcess.cpp | /** @file Implementation of the post processing step to calculate
* tangents and bitangents for all imported meshes
*/
#include "AssimpPCH.h"
// internal headers
#include "CalcTangentsProcess.h"
#include "ProcessHelper.h"
#include "TinyFormatter.h"
using namespace Assimp;
// ------------------------------------... | TOOL | 0.97365 | 3.435014 |
a3f090e5-202b-4aca-96a8-e900f38b1d02 | maqsoodhussain/DataStructures | Queue/Queue_using_LL.cpp | #include<iostream>
using namespace std;
struct node{
int data;
node *next;
};
class Queue{
node *front,*rear;
public:
Queue(){
front=rear=NULL;
}
void enqueue();
void dequeue();
void display();
};
void Queue::enqueue(){
int item;
co... | ALGO | 0.990665 | 3.974852 |
2d5e6e9b-0f27-4073-9c5c-0363b413ab2f | ishandutta2007/codeforces | heart_blue/normal/1393/D.cpp | #include <cstdlib>
#include <cctype>
#include <cstring>
#include <cstdio>
#include <cmath>
#include <algorithm>
#include <vector>
#include <string>
#include <iostream>
#include <sstream>
#include <map>
#include <set>
#include <queue>
#include <stack>
#include <fstream>
#include <numeric>
#include <iomanip>
#include <bi... | ALGO | 0.999889 | 3.26895 |
d12e19ee-c57a-4edd-8322-1f049b4c0d42 | alexandraback/datacollection | solutions_5708284669460480_0/C++/taxicoo/b.cpp | #include <bits/stdc++.h>
using namespace std;
#define ll long long
#define ull unsigned long long
#define mp make_pair
#define pb push_back
vector<string> res;
vector<char> v;
vector<int> ans;
string st, ttt;
int maxx;
void rec(int n, int pos)
{
if (pos == n)
{
res.pb(st);
return;
}
... | ALGO | 0.998208 | 3.530821 |
d169f7dd-e723-426a-9f6a-b3a2e7c9348b | tdubourg/filezilla-encrypted | cryptopp/zinflate.cpp | // zinflate.cpp - written and placed in the public domain by Wei Dai
// This is a complete reimplementation of the DEFLATE decompression algorithm.
// It should not be affected by any security vulnerabilities in the zlib
// compression library. In particular it is not affected by the double free bug
// (http://www.kb... | ALGO | 0.995646 | 4.094634 |
5e2b5208-dab3-429e-81b3-5920c4426b66 | somyadahiaya/SOC-competetive-programming | w4_q4.cpp | #include <bits/stdc++.h>
#include<iostream>
typedef long long ll;
#define REP(i,a,b) for(ll i=a;i<=b;i++)
using namespace std;
vector<ll> factorials;
const long long int MOD = 1000000007;
int mul(int a, int b) {
return (1LL * a * b) % MOD;
}
ll modinv(ll n)
{
ll b = MOD-2;
ll result = 1;
while(b>1)
... | ALGO | 0.999886 | 3.76859 |
10766737-a6e6-42d0-8e36-7d6b44ad2a86 | NouemanKHAL/Competitive-Programming | Codeforces/205/A [Little Elephant and Rozdil].cpp | #include <bits/stdc++.h>
using namespace std;
int main(){
int n;
cin >> n;
int t[n];
int min,index;
cin >> t[0];
min=t[0];
index=0;
for(int i=1;i<n;i++){
cin >> t[i];
if(t[i]<min){
index=i;
min=t[i];
}
}
for(int i=0;i<n;i++){
if(t[i]==min && i!=index){
cout << "Still Rozdil" << endl;
r... | ALGO | 0.999931 | 3.63789 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.