uuid string | repo_name string | relative_path string | content string | category string | algo_rel_score float64 | quality_score float64 |
|---|---|---|---|---|---|---|
1bbf2953-4e01-4ca4-9245-ae1b40f8bb9a | Aditya-Ingale/LeetCode_Prac | 7785-1930-852-peak-index-in-a-mountain-array/7785-1930-852-peak-index-in-a-mountain-array.cpp | class Solution {
public:
int peakIndexInMountainArray(vector<int>& arr) {
int s = 0;
int e = arr.size()-1;
int mid = s + (e-s)/2;
while(s<e){
if(arr[mid] < arr[mid + 1]){
s = mid + 1;
}else{
e = mid;
}
... | ALGO | 0.999984 | 5.819792 |
9b56545b-03c5-4556-b9ac-31354d8c9981 | SagitaKDX/University-training | testinground52gardern.cpp | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef long double ld;
typedef pair<int, int> pi;
typedef pair<ll, int> pli;
typedef pair<int, ll> pil;
typedef pair<ll,ll> pl;
typedef pair<ld,ld> pd;
typedef vector<int> vi;
typedef vector<bool> vb;
typedef vector<ld> vd;
typedef vector<ll> vl;
... | ALGO | 0.999967 | 3.407159 |
2387c3c0-7258-4745-8ede-044063484578 | abdullahalkafi-dev/code-for-career | December_2024/D1M12Y2024/reverse_function.cpp | #include <bits/stdc++.h>
using namespace std;
int main(){
int n;
cin>>n;
int a[n];
for(int i=0;i<n;i++){
cin>>a[i];
}
reverse(a,a+n);
for(int i=0;i<n;i++){
cout<<a[i]<<" ";
}
return 0;
} | ALGO | 0.999863 | 3.783699 |
543ef566-b457-4cd1-9e9e-9823ed4ca940 | KapilShandilya20/CPP | Practice/SearchElementInArray.cpp | //Search the Element in an Array
#include<iostream>
using namespace std;
using std::cout;
using std::cin;
using std::endl;
int main() {
int i,key ,size;
cout << "Enter the size of Array: ";
cin >> size;
int arr[size];
for(i = 0; i < size; i++) {
cout << "Enter the Element: ";
cin... | ALGO | 0.998002 | 3.568487 |
d8223393-07fa-4310-a21c-7258f016f623 | zilixie/Relief-and-Normal-Mapping | ext/eigen/lapack/svd.cpp | #include "lapack_common.h"
#include <Eigen/SVD>
// computes the singular values/vectors a general M-by-N matrix A using divide-and-conquer
EIGEN_LAPACK_FUNC(gesdd,(char *jobz, int *m, int* n, Scalar* a, int *lda, RealScalar *s, Scalar *u, int *ldu, Scalar *vt, int *ldvt, Scalar* /*work*/, int* lwork,
... | ALGO | 0.99946 | 5.526819 |
be62cb9d-7e8b-4605-8059-4fd99f764404 | HackrHIVE/CP | LeetCode/Single Number III.cpp | #include <iostream>
#include <vector>
#include <unordered_map>
using namespace std;
class Solution
{
public:
vector<int> singleNumber(vector<int> &nums)
{
vector<int> out;
unordered_map<int, int> umap;
for (auto x : nums)
umap[x]++;
for (auto x : umap)
{
... | ALGO | 0.999803 | 5.510098 |
24bdfb00-ed9a-49e0-9b1f-c9551ca39a6c | AdarshNandanwar/DSA-and-Competitive-Programming | InterviewBit/colorful-number.cpp | // https://www.interviewbit.com/problems/colorful-number/
// Method 1 (Hash Table):
int Solution::colorful(int A) {
string s = to_string(A);
int n = s.size();
if(n <= 1) return 1;
// set of product of digits of all subarrays
unordered_set<int> m;
// v[i] : set of product of digits of all subar... | ALGO | 0.997404 | 4.931211 |
682a0deb-44fa-4fbe-ac44-24abae0774be | alexandraback/datacollection | solutions_5769900270288896_0/C++/Dejko/CJ_Noisy_Neighbors.cpp | #include <cstdio>
using namespace std;
int T,total,n,m,num,sol,ones,mapa[20][20],cur,ind;
int main() {
freopen("B-small-attempt0.in","r",stdin);
freopen("BBB.out","w",stdout);
scanf("%d",&T);
for (int t=1; t<=T; t++) {
scanf("%d %d %d",&n,&m,&num);
total=n*m;
sol=1000000;
... | ALGO | 0.99937 | 3.786788 |
1d0c98d1-7043-4459-bbc8-e6ff89b72070 | Anusree-R/Anusree_R_CPP_CipherSchools | lecture40-cipherschools.cpp |
/*#include<iostream>
using namespace std;
int main(){
int array[5] = {23,355,23,21,3};
//arrays are the simplest data structures
return 0;
}
*/
#include<iostream>
using namespace std;
int main(){
//algorithm is logical thinking/solution to proceed towards a problem
int n =23;
int x = n*4;
... | ALGO | 0.999602 | 3.268166 |
0f9cb5e1-ca51-4494-ac66-566f0372c1ba | Abhijit1102/DSA_by_shraddha | standard_libary_cpp/permutation.cpp | #include<iostream>
#include<algorithm>
#include<vector>
using namespace std;
int main(){
string s = "abc";
next_permutation(s.begin(), s.end());
cout << s << endl;
return 0;
}
| ALGO | 0.99969 | 3.711583 |
64b07d96-394e-4a7b-a9d7-c9c42ca71d06 | Leapense/problems | 20837번: Robottävling/cpp/src/main.cpp | #include "main.h"
#include <iostream>
#include <vector>
#include <algorithm>
using namespace std;
namespace
{
bool dfs(int row, const vector<vector<int>> &graph, vector<int> &matchR, vector<bool> &seen)
{
for (int col : graph[row])
{
if (!seen[col])
{
se... | ALGO | 0.999891 | 5.579277 |
eb682a88-e37b-454c-b788-b880d23025ae | DrawFun/OctaneBlender | blender/source/blender/compositor/operations/COM_CalculateStandardDeviationOperation.cpp | #include "COM_CalculateStandardDeviationOperation.h"
#include "BLI_math.h"
#include "BLI_utildefines.h"
extern "C" {
#include "IMB_colormanagement.h"
}
CalculateStandardDeviationOperation::CalculateStandardDeviationOperation() : CalculateMeanOperation()
{
/* pass */
}
void CalculateStandardDeviationOperation::execu... | ALGO | 0.988124 | 5.571067 |
23083d31-18c5-465f-ad6f-28da015a9da2 | JinHai-CN/infinity | third_party/faiss/faiss/IndexBinaryIVF.cpp | // -*- c++ -*-
#include <faiss/IndexBinaryIVF.h>
#include <omp.h>
#include <cinttypes>
#include <cstdio>
#include <algorithm>
#include <memory>
#include <faiss/IndexFlat.h>
#include <faiss/IndexLSH.h>
#include <faiss/impl/AuxIndexStructures.h>
#include <faiss/impl/FaissAssert.h>
#include <faiss/utils/hamming.h>
#in... | ALGO | 0.998828 | 7.160195 |
e3f79b20-555d-4091-9cc1-a9aae3857b4a | sarthakgit21/Placement-Preparation-Program | 0445-add-two-numbers-ii/0445-add-two-numbers-ii.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* reverseList... | ALGO | 0.999959 | 6.072668 |
b2e29f3a-4e2e-40ab-83f0-079f0bcf4769 | ShoshanSmadar/EulerCircleEx1 | eulerCircle/Graph.cpp | #include "Graph.h"
using namespace std;
Graph::Graph(bool isDirected, int numOfVertices, int numOfEdges, vector<pair<int, int>> edges) {
this->isDirected = isDirected;
this->isEulerian = false;
this->numOfEdges = numOfEdges;
for (int i = 0; i < numOfVertices; i++) {
this->vertices.push_back(Ve... | ALGO | 0.999047 | 4.881106 |
30da85a7-517e-48ab-89d0-0becc0ab5856 | Jay7221/competitve-programming | codeforces/global_rounds/GlobalRound28/f.cpp | #include <bits/stdc++.h>
using namespace std;
//#pragma GCC optimize("Ofast,unroll-loops")
//#pragma GCC target("avx,avx2,avx512,fma")
template<typename A, typename B> ostream& operator<<(ostream &os, const pair<A, B> &p) { return os << '(' << p.first << ", " << p.second << ')'; }
template<typename T_container,... | ALGO | 0.999862 | 3.919226 |
82c8468d-47a8-41c4-94d5-4c7f2857b8d3 | harsh4677/Javascript_35_Qn | 0078-subsets/0078-subsets.cpp | class Solution {
public:
void generateSubsets(int index, vector<int>& nums, vector<int>& current, vector<vector<int>>& result) {
result.push_back(current);
for (int i = index; i < nums.size(); i++) {
current.push_back(nums[i]);
generateSubsets(i + 1, nums, current, r... | ALGO | 0.999856 | 6.698334 |
3d2dd9b6-f248-4b3a-961b-bc6b471a737b | Sameerbrundavanam/A2ZDSA | Arrays/Extended_Moore's_Voting.cpp | //Majority Element 2
class Solution {
public:
vector<int> majorityElement(vector<int>& nums) {
vector<int>ans;
int cnt1 = 0, cnt2 = 0;
int ele1 = INT_MIN, ele2 = INT_MIN;
for(int i=0;i<nums.size();i++){
if(cnt1 == 0 and nums[i] != ele2){
cnt1++;
... | ALGO | 0.999977 | 5.360503 |
21124e0f-50d1-4e9b-b57a-7a6522900fd3 | figield/codility-2014 | Lesson_02_Counting_Elements/MissingInteger/solution.cpp | /*
Write a function:
int solution(vector<int> &A);
that, given a non-empty zero-indexed array A of N integers, returns the minimal positive integer that does not occur in A.
For example, given:
A[0] = 1
A[1] = 3
A[2] = 6
A[3] = 4
A[4] = 1
A[5] = 2
the function should return 5.
Assume that:
N... | ALGO | 0.999893 | 4.925834 |
ec805b22-50eb-40f6-a270-3915b976f4e7 | AdityaHegde02/Leetcode-Solved | 2786-visit-array-positions-to-maximize-score/2786-visit-array-positions-to-maximize-score.cpp | class Solution {
public:
long long solve(int i,int rem,vector<int>& nums, int x,vector<vector<long long>> &dp){
if(i >= nums.size()){
return 0;
}
if(dp[i][rem] != -1){
return dp[i][rem];
}
long long take = 0, nottake = 0;
... | ALGO | 0.999967 | 5.400471 |
5f64eaab-87bb-4583-9f39-4df90b544df8 | k-iksana/competitive-programming | contests/codeforces/1768/D.cpp | #include <bits/stdc++.h>
#include <atcoder/dsu>
int main() {
using namespace std;
using namespace atcoder;
ios_base::sync_with_stdio(false), cin.tie(nullptr);
int T; cin >> T;
while (T--) {
int n; cin >> n;
vector<int> p(n);
for (auto& x : p) { cin >> x; --x; }
dsu d(n);
vector<int> where(n);
for (i... | ALGO | 0.999919 | 5.05196 |
9e39d0da-b2fa-4997-81ea-e7e91a3c3662 | JagdishPathakji/Leetcode-Problem-Solving-Tracker | 1706-min-cost-to-connect-all-points/min-cost-to-connect-all-points.cpp | class Solution {
public:
int minCostConnectPoints(vector<vector<int>>& points) {
int n = points.size();
vector<vector<pair<int,int>>> adjlist(n);
for(int i=0; i<points.size(); i++) {
int u = points[i][0];
int v = points[i][1];
for(int j=i+1; j<po... | ALGO | 0.999986 | 5.68813 |
e7912d62-6179-40c7-a05c-1da8d6fb5724 | tedddy/Learn_R | book/adv-r-master/extras/cpp/match.cpp | #include <Rcpp.h>
namespace boost{
std::size_t hash_value(Rcpp::String);
}
#include <boost/unordered_map.hpp>
namespace boost{
std::size_t hash_value(Rcpp::String obj){
return hash_value<SEXP>( obj.get_sexp() ) ;
}
}
using namespace Rcpp;
// // [[Rcpp::export]]
// IntegerVector match1(const Char... | TOOL | 0.97164 | 5.83008 |
4a102940-3d99-4dad-b380-98eba09866e2 | AnasImloul/Leetcode-Solutions | scripts/algorithms/M/Minimum Time Visiting All Points/Minimum Time Visiting All Points.cpp | // Runtime: 13 ms (Top 59.60%) | Memory: 10.2 MB (Top 67.84%)
class Solution {
public:
int minTimeToVisitAllPoints(vector<vector<int>>& points) {
vector<int>sk;
int x,y,maxy=0;
for(int i=0;i<points.size()-1;i++){
for(int j=0;j<points[i].size()-1;j++){
x=abs(points... | ALGO | 0.99986 | 5.849619 |
764e33b8-0457-46dc-a2b0-6c7bb9cdd552 | Honam0905/CP-library | test/yosupo/Tree/tree_diameter_yosupo.test.cpp | #define PROBLEM "https://judge.yosupo.jp/problem/tree_diameter"
#include "Misc/marco.hpp"
#include "Misc/debug.hpp"
const int INF=1e9;
const ll INFI=1e15;
//----------Author: Nguyen Ho Nam,UIT, Saigon-----------------
#include "tree/Tree_diameter.hpp"
int main() {
FT;
int n; cin>>n;
tree_diameter<ll>tre(n);
rep... | ALGO | 0.999441 | 4.568424 |
8f5cd22f-5298-4c7d-be5b-e0a865bdc8e6 | arushi-midha/leetcode | Find the Kth Character in String Game II_3307.cpp | Alice and Bob are playing a game. Initially, Alice has a string word = "a".
You are given a positive integer k. You are also given an integer array operations, where operations[i] represents the type of the ith operation.
Now Bob will ask Alice to perform all operations in sequence:
If operations[i] == 0, append a c... | ALGO | 0.999963 | 6.349962 |
365a2a76-a932-4c07-bc0e-49d29efb9cd8 | Oracynx/Source-Code | Problem/Luogu/P5719.cpp | #include <cstdio>
int n, k;
int main()
{
scanf("%d%d", &n, &k);
int a, b;
int cnt_a, cnt_b;
a = 0;
b = 0;
cnt_a = 0;
cnt_b = 0;
for (int i = 1; i <= n; i++)
{
if (i % k == 0)
{
a += i;
cnt_a++;
}
else
{
b += ... | ALGO | 0.999822 | 3.349532 |
83743c6e-37e6-4fd2-9a6f-8d5686801413 | sarvex/leetcode-beef | solution/2300-2399/2337.Move Pieces to Obtain a String/Solution.cpp | using pii = pair<int, int>;
class Solution {
public:
bool canChange(string start, string target) {
auto a = f(start);
auto b = f(target);
if (a.size() != b.size()) return false;
for (int i = 0; i < a.size(); ++i) {
auto x = a[i], y = b[i];
if (x.first != y.fi... | ALGO | 0.999984 | 5.592188 |
28fb3c04-91e9-4362-9321-b62d2693dff2 | AlexYaoRuihao/CS225_POTD | potd-q60/2048.cpp | using namespace std;
void swap(int &num1, int &num2){
int temp;
temp = num1;
num1 = num2;
num2 = temp;
}
void run2048(int puzzle[4][4], int dir) {
// your code here
//0-left
//1-up
//2-right
//3-down
// cout<<"test: "<<endl;
// cout<<puzzle[1][3]<<endl;
//going left
if(... | ALGO | 0.999819 | 5.16727 |
0521dcde-0fd1-402e-8fbb-ed54d899965b | AbdoEbrahim0/leetCode | 3380-shortest-subarray-with-or-at-least-k-ii/3380-shortest-subarray-with-or-at-least-k-ii.cpp | //fail in next test case
//nums = [1, 72, 32, 2, 95, 67], k = 121
// class Solution {
// public:
// int minimumSubarrayLength(vector<int>& nums, int k) {
// int maxi = nums[0];
// int indx=0;
// int sizeNums = nums.size();
// for (int i = 1; i < sizeNums; i++)
// {
// ... | ALGO | 0.999503 | 5.694582 |
dbeb80eb-dc36-4eb7-86a6-717717080e55 | shibasis0801/showcase | graph/hrankdijkstra.cpp | #include <bits/stdc++.h>
using namespace std;
#define repeat(i, n) for (int i = 0; i < n; ++i)
struct half_edge {
int end;
int weight;
half_edge() {}
half_edge(int e, int w) {
end = e;
weight = w;
}
friend bool operator>(half_edge one, half_edge two);
};
bool operator>(hal... | ALGO | 0.999979 | 4.75937 |
0012bee7-7d18-4f24-b4d2-d0346f65ec88 | StanPlatinum/proofGen | llvm/lib/CodeGen/GlobalISel/CSEMIRBuilder.cpp | #include "llvm/CodeGen/GlobalISel/CSEMIRBuilder.h"
#include "llvm/CodeGen/GlobalISel/GISelChangeObserver.h"
using namespace llvm;
bool CSEMIRBuilder::dominates(MachineBasicBlock::const_iterator A,
MachineBasicBlock::const_iterator B) const {
auto MBBEnd = getMBB().end();
if (B == MBB... | ALGO | 0.992435 | 7.945209 |
fd8666b4-637f-404e-82e4-c02837104d33 | manuelfs/susy_cfa | src/utilities.cpp | //----------------------------------------------------------------------------
// utilities - Various functions used accross the code
//----------------------------------------------------------------------------
#ifndef INT_ROOT
#include "utilities.hpp"
#endif
#include <cmath>
#include <iostream>
#include <string>
... | DATA | 0.864084 | 5.21072 |
1bfd882a-04a6-4412-882d-565203eb05ef | AkashKumarSingh11032001/GeeksForGeeks---Self_Paced_Course | 6. Hashing/SubArraysWithGivenSum.cpp | // Pair vs Subarray
// pair can be non-contiguous while subarray is contiguous
#include<bits/stdc++.h>
using namespace std;
bool Subarray(int a[],int n,int sum){
unordered_set<int>s;
int pre_sum = 0;
for(int i = 0; i <n; i++){
pre_sum += a[i];
if(pre_sum == sum) return true;
if(s.... | ALGO | 0.999853 | 4.645096 |
ded14a23-0271-412d-9528-f5aab45ee45d | NodirJohn/Exam-One | 3/main.cpp | #include <iostream>
using namespace std;
int main()
{
int a , b;
cout << " a tomonni kiriting : ";
cin >> a;
cout << " b tomonni kiriting : ";
cin >> b;
int S = a * b;
int P = (a + b) * 2;
cout << " tortburchakning yuzi : " << S << endl;
cout << " tortburchakning perimetri : " <... | ALGO | 0.906821 | 3.622141 |
0d4a8db9-ab41-4e1e-a744-f4e3da8ee5bb | tusharsharma25/DSA-PROBLEMS | Day-9/factorial.cpp | #include<bits/stdc++.h>
using namespace std;
int fact(int n){
//Base case
if(n==0){
return 1;
}
//rec case
int ans = n * fact(n-1);
return ans;
}
int main()
{
int n;
cin>>n;
cout<<fact(n)<<endl;
return 0;
}
| ALGO | 0.999988 | 5.238444 |
e9cfb388-0b0b-41ae-ab76-9a79ac0fac39 | Evervolv/android_external_skia | src/core/SkCordic.cpp | #include "SkCordic.h"
#include "SkMathPriv.h"
#include "Sk64.h"
// 0x20000000 equals pi / 4
const int32_t kATanDegrees[] = { 0x20000000,
0x12E4051D, 0x9FB385B, 0x51111D4, 0x28B0D43, 0x145D7E1, 0xA2F61E, 0x517C55,
0x28BE53, 0x145F2E, 0xA2F98, 0x517CC, 0x28BE6, 0x145F3, 0xA2F9, 0x517C,
0x28BE, 0x145F, 0xA2F,... | ALGO | 0.983061 | 5.805958 |
dca13368-ea3d-4f70-96e0-39bf4ca92537 | S10P1Algorithm/study | week16/27652/27652_김상범.cpp | #include <iostream>
#include <stdio.h>
#include <vector>
#include <string>
#include <fstream>
#include <cstring>
#include <unordered_map>
using namespace std;
unordered_map<string, int> A[1001];
unordered_map<string, int> B[1001];
class Trie
{
int num;
char val;
Trie* next[26];
Trie(char val) : val(v... | ALGO | 0.999001 | 4.856265 |
3975dcd7-8a81-44a2-8333-180746863e29 | hoticket/pat_basic_test_cpp | prime.cpp | //
// Created by QH on 5/26/2023.
// 如果要获取第n个素数,那么需要判断的最大自然数是多少
//
#include <iostream>
#include <cmath>
using namespace std;
int maxNum;
bool isPrime(unsigned int x) {
for (int i = 2; i <= sqrt(x); i++) {
if (x%i == 0) {
return false;
}
}
return true;
}
int main() {
int n... | ALGO | 0.999844 | 5.070122 |
b7e1d84a-50cc-49a9-ad4b-f9cc8a0a7554 | greencodespace/code_data | c_cpp/명품cpp_프로그래밍/chap04/ex4-9-NewCircleArray.cpp | #include <iostream>
using namespace std;
class Circle {
int radius;
public:
Circle();
Circle(int r);
~Circle();
void setRadius(int r) { radius = r; }
double getArea() { return 3.14*radius*radius; }
};
Circle::Circle() {
radius = 1;
cout << " radius = " << radius << endl;
}
Circle::Circle(int r) {
radius... | TOOL | 0.985977 | 4.581287 |
dbc149ec-fa4e-4d62-b861-eda7f29b438d | GonoBae/CodingTestStudy | Kangwon/GraphSearch/2023-06-02-GetSpace.cpp | #include <iostream>
#include <queue>
#include <vector>
#include <algorithm>
int main()
{
int M, N, K;
std::cin >> M >> N >> K;
// 모눈종이를 배열 통해 그린다
std::vector<std::vector<bool>> array(M, std::vector<bool>(N, false));
// 방문 검사를 위한 배열
std::vector<std::vector<bool>> vis(M, std::vector<bool>(N, fals... | ALGO | 0.999935 | 4.200427 |
530bb1d6-e30b-47fe-be15-673918ff4f60 | 101magikarp101/USACO | cses/additional-problems/school-excursion.cpp | #include <bits/stdc++.h>
using namespace std;
using ll = long long;
#define MOD 998244353
#define MOD2 1000000007
#define vt vector
template <class T> using vvt = vt<vt<T>>;
template <class T> using vvvt = vt<vvt<T>>;
template <class T> using vvvvt = vt<vvvt<T>>;
typedef vt<int> vi;
typedef vvt<int> vvi;
typedef vvvt<i... | ALGO | 0.999963 | 4.552611 |
c38b6a61-b1e0-4a21-8099-cd8dfaa181e6 | AparnaChinya/100DaysOfCode | BuildOrder.cpp | /* CTCI 4.7
BuildOrder - given a list of Projects and dependencies, find build order for the projects to be built.
*/
#include <iostream>
//Topological Sort
// Graph class
class Graph {
int numOfNodes;
list<int> *adjacencyList;
public:
Graph(int numOfNodes);
void addEdges(int from, int to);
... | ALGO | 0.99997 | 6.138652 |
b14230af-cacb-4537-ba00-fd514dc1cf96 | GitHubRepoDescription/Source-Code-from-Tutorials | C++/37_cppBeginners.cpp | #include <iostream>
using namespace std;
int main(){
int bertha[2][3] = {{1,2,3},{7,8,9}};
for(int row=0; row<2; row++){
for(int column=0; column<3;column++){
cout << bertha[row][column] << " ";
}
cout << endl;
}
}
| ALGO | 0.953784 | 3.294813 |
5a5e3e54-e4ef-46f5-8db6-3daf77eb61f4 | shubhamgyd/mission_TCS | Daily_Coding_problems/93_Gym_Locklers.cpp | /*
This question is asked by Facebook. In a gym hallway there are N lockers.
You walk back and forth down the hallway opening and closing lockers.
On your first pass you open all the lockers. On your second pass, you close every other locker.
On your third pass you open every third locker. After walking the hallway ... | ALGO | 0.999885 | 4.057079 |
9aaed0a7-4292-4179-a01a-36d8282969dd | 06suraj/Codeforces-Solution | Codeforces Round #693 (Div. 3)/B - Fair Division.cpp | #include<bits/stdc++.h>
using namespace std;
int main() {
// your code goes here
ios::sync_with_stdio(0);
int t;
cin>>t;
while(t--)
{
int n;cin>>n;int arr[n];for(int i=0;i<n;i++)cin>>arr[i];
int c=0,c1=0;
for(int i=0;i<n;i++)
{
if(arr[i]==1)c++;
else c1++;
}
c1=c1... | ALGO | 0.999696 | 4.174704 |
85706ef6-131a-4f18-a78d-bd7b7052e222 | llvm/clangir | llvm/examples/OrcV2Examples/LLJITWithOptimizingIRTransform/LLJITWithOptimizingIRTransform.cpp | #include "llvm/ExecutionEngine/Orc/LLJIT.h"
#include "llvm/IR/LegacyPassManager.h"
#include "llvm/Pass.h"
#include "llvm/Support/InitLLVM.h"
#include "llvm/Support/TargetSelect.h"
#include "llvm/Support/raw_ostream.h"
#include "llvm/Transforms/IPO.h"
#include "llvm/Transforms/Scalar.h"
#include "../ExampleModules.h"
... | TOOL | 0.984118 | 7.899271 |
41d3b943-a229-4a35-895a-ecbad3aaab4e | 113bommy/deepmind_codecontests_refine | cpp_source_filter_file/cpp_train_8563_19.cpp | #include <bits/stdc++.h>
using namespace std;
int num(int a, int b) {
int sum = 0;
while (a > 0) {
sum += (a % b);
a /= b;
}
return sum + a % b;
}
long long gcd(long long a, long long b) { return ((!b) ? a : gcd(b, a % b)); }
int main() {
int a, sum = 0;
cin >> a;
for (int i = 2; i < a; i++) {
... | ALGO | 0.999574 | 5.078362 |
cd5a9b9b-7495-41fb-be73-628d82bf8e66 | yaga1183/learnopencv | SelectiveSearch/ssearch.cpp | #include "opencv2/ximgproc/segmentation.hpp"
#include "opencv2/highgui.hpp"
#include "opencv2/core.hpp"
#include "opencv2/imgproc.hpp"
#include <iostream>
#include <ctime>
using namespace cv;
using namespace cv::ximgproc::segmentation;
static void help() {
std::cout << std::endl <<
"Usage:" << std::endl <<
... | ALGO | 0.997492 | 6.044246 |
0751f4c9-1813-4c44-ad99-e8faf79ea4b7 | akTARDIGRADE13/competitive-programming-library | verify/data_structure/Unionfind/Unionfind/yosupo_unionfind.test.cpp | #define PROBLEM "https://judge.yosupo.jp/problem/unionfind"
#include "lib/data_structure/Unionfind/Unionfind.hpp"
#include <iostream>
int main() {
int n, q;
std::cin >> n >> q;
akTARDIGRADE13::Unionfind uf(n);
while(q--) {
int t, u, v;
std::cin >> t >> u >> v;
if(t == 0) {
... | ALGO | 0.999902 | 5.810653 |
55834e77-25f1-40d0-96d0-39ebae6a43ca | khaledalam/cpp-convo | conversations_cpp/06_2024/2024_06_02/func_MaximizeTripleProduct_khaled_cpp_182_2024_June_02.cpp | /***
khaled_cpp_182_2024_June_02: 6b74f4c3-aed2-451c-88ed-1eaae11d5db6
func_MaximizeTripleProduct_khaled_cpp_182_2024_June_02
Create a C++ function called MaximizeTripleProduct that takes a non-empty array of type std::vector<int>. The length of
the array should be greater than 2.
The function should return the ma... | ALGO | 0.998041 | 5.950983 |
383a0c7b-73ab-4391-941b-e1d51eeccd3f | arc-src/HackerRank.com-C-14-Solutions | Plus Minus.cpp | #include <bits/stdc++.h>
using namespace std;
vector<string> split_string(string);
vector<float> plusMinus(vector<int> arr) {
int s = arr.size();
vector<float> res;
res.resize(3);
for (int i=0; i<s; i++)
if (arr[i] > 0)
res[0] += 1;
else if (arr[i] < 0)
res[1] ... | ALGO | 0.999505 | 4.31454 |
0ff1dc20-f353-4e4d-b2fb-918fc638fa55 | springer126/C-World | c++/ecnu/ECNU/1053.cpp | #include <iostream>
using namespace std;
int N;
int X;
int F[1000000];
int sum;
int num[200];
void deal()
{
int i,j,k;
scanf("%d%d",&N,&X);
sum=0;
for (i=1;i<=N;++i)
{
scanf("%d",&num[i]);
sum+=num[i];
}
F[0]=1;
for(i=1;i<=X;++i) F[i]=0;
for (k=1;k<=N;++k)
for (j=X;j>=num[k];j--)
F[j]+=F[j-num[k]]... | ALGO | 0.999293 | 3.616017 |
7bf0d7ae-69e3-4995-b192-bb9c556cca64 | chickennugget1/Leetcode-December-Challenge | Week 3/16Dec.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.999948 | 6.370737 |
6ac5caf4-45b1-41b9-bfc2-e1dda3c702ba | mapnn/mapnn | src/ref/cpu/ref_mvn.cpp | #include "reference.h"
#include <math.h>
namespace mapnn {
void RefMVN::run(const Tensors& ins, Tensor& out, Tensors& tmp, Operator& op) {
MVN mvn(op);
L1CHW input(ins[0]);
L1CHW output(out);
//bool normalize_variance = true;
//bool across_channels = true;
float eps = 1e-5;
int size = inp... | ALGO | 0.986384 | 4.167796 |
3f287f57-94aa-49fb-9ba0-da62b47737e1 | premkoomar/newsapp-mob-dev | windows/runner/utils.cpp | #include "utils.h"
#include <flutter_windows.h>
#include <io.h>
#include <stdio.h>
#include <windows.h>
#include <iostream>
void CreateAndAttachConsole() {
if (::AllocConsole()) {
FILE *unused;
if (freopen_s(&unused, "CONOUT$", "w", stdout)) {
_dup2(_fileno(stdout), 1);
}
if (freopen_s(&unuse... | TOOL | 0.998859 | 6.785645 |
4a2f3eee-68f7-4808-bebb-ad93d3f0f8ef | evvic/graph-theory | utilities/graphviz.cpp | #include "graphviz.h"
#include <iostream>
#include <fstream>
#include <map>
using namespace std;
// Constructor
Graphviz::Graphviz() {
cout << "~GRAPHVIZ~" << endl;
path = {};
path_map = {};
dist = {};
}
void Graphviz::setPath(vector<int> p) {
// Path must include start & end node
path = p;... | ALGO | 0.921451 | 4.632417 |
46feb463-a502-4e31-9bfc-32b303288a9e | Aitoly/FA-3sem-Lab5 | Task2/main2.cpp | #pragma warning(disable:4996)
#include<stdio.h>
#include<iostream>
#include<ctype.h>
#include<math.h>
#include<time.h>
#include"Polynomial.h"
//3x^5+3x^4+3x^3+3x^2+3x+3
//2x^5+2x^4+2x^3+2x^2+2x+2
/*
0 Add -
1 Sub -
2 Mult -
3 Div
4 Mod
5 Eval
6 Diff -
*/
int Get_Info(FILE *in, char* line)
{
// !!... | ALGO | 0.997588 | 3.658128 |
c009480d-4b0a-4c27-878d-692963f5e9cc | CodeBySushant/SolvedLeetcode | leetcode-main/leetcode-main/solution/2000-2099/2095.Delete the Middle Node of a Linked List/Solution.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* deleteMiddl... | ALGO | 0.999923 | 5.861026 |
56133757-9387-4eec-a177-9f960344aa0c | abdusselimCSE/Phitron | Conceptual/Number Theory/divisor.cpp | #include <bits/stdc++.h>
using namespace std;
#define ll long long
#define endl '\n'
int main()
{
ios_base::sync_with_stdio(false);
cin.tie(NULL);
int n;
cin >> n;
for (int i = 1; i * i <= n; i++) //O(sqrt(n))
{
if (n % i == 0)
{
cout << i << " ";
if ((... | ALGO | 0.999918 | 5.034016 |
e9c00463-047a-426b-96b6-5fb38debf783 | 8057vivek/Leetcode | 0053-maximum-subarray/0053-maximum-subarray.cpp | class Solution {
public:
int maxSubArray(vector<int>& nums) {
int n = nums.size();
int maximum = INT_MIN;
int currSum=0;
for(int i=0;i<n;i++){
currSum+=nums[i];
maximum = max(maximum, currSum);
if(currSum<0){
currSum=0;
... | ALGO | 0.999974 | 6.343649 |
80cb405d-2e34-4f2a-973d-76915bafb36a | Goutam-patidar/CPP-Programing | CPP-PROGRAMS/prgm to calculate sum of digit .cpp |
#include<conio.h>
#include<iostream>
using namespace std;
int main()
{
int a,r=0,i,c;
cout<<"enter the no.";
cin>>a;
while(a!=0)
{
c=a%10;
a=a/10;
r=r+c;
}
cout<<"sum of digit ="<<r;
getch();
}
| ALGO | 0.99877 | 3.449811 |
e3b6c29a-4cd8-4001-b344-f6e463c8d3eb | Shamim448/C-Practices | countDigits.cpp | /*
Program Name: Counts digits in a number
*/
#include<iostream>
#include<conio.h>
using namespace std;
int main(){
int num, rem, temp,counts=0;
cout<<"Enter Your Number: ";
cin>>num;
temp=num;
while(temp != 0){
rem = temp%10;
temp = temp/10;
counts++;
}
cout<<counts;
getch();
}
| ALGO | 0.998734 | 4.158435 |
4b0cbc96-9bcb-4ee5-bd3b-b00e49917d53 | Machinesaac/PTA-Work | 3-14/3-14.cpp | #include <iostream>
using namespace std;
int main()
{
int arr[12]={31,28,31,30,31,30,31,31,30,31,30,31};
int year,month,day;
int s=0;
cin >> year >> month >> day;
if (!(year%400))
{
arr[1] = 29;
}
for (int i=0;i<month-1;i++)
{
s += arr[i];
}
s += day;
cout << s;
}
| ALGO | 0.999797 | 3.783737 |
3c1c2157-499a-49a6-9113-6952c69d4d10 | MdAlSiam/My-Codeforces-Solutions | 1260B.cpp | #include <bits/stdc++.h>
using namespace std;
int main(){
int test;
scanf("%d", &test);
while(test--){
int a, b;
scanf("%d %d", &a, &b);
if(a > b) swap(a, b);
if(b > 2*a) printf("NO\n");
else if(a == b && b == 0) printf("YES\n");
else if(a == 0 || b == 0) pri... | ALGO | 0.999529 | 3.922921 |
0f9d451c-5b8a-4908-b98e-fe93ec577ecd | sswzfly/leetcode | 526 Beautiful Arrangement.cpp | class Solution {
public:
int countArrangement(int N) {
memset(digit_used, 0, sizeof(digit_used));
return dfs(0, N);
}
private:
int dfs(int dep, int N) {
if(dep == N) {
return 1;
}
int ans = 0;
for(int i = 1; i <= N; i++) {
if(!digit_use... | ALGO | 0.999973 | 6.27724 |
9dffd9b5-1d0f-4d98-802b-3e0dbb2b47c5 | SaksheePhade/Data_structures | vector.cpp | #include<iostream>
#include<vector>
using namespace std;
int main()
{
vector<int> myVector;
int i;
for(i=0;i<5;i++){
myVector.push_back(i);
}
cout << "\nVector : ";
for(i=0;i<myVector.size();i++){
cout << myVector.at(i) << " ";
}
myVector.insert(myVector.begin()+1,77);
cout << endl;
for(i=0;i<myVector.si... | ALGO | 0.902648 | 3.502524 |
3a186038-833e-4e48-a8c7-881b17a8d39e | Gautham/Competitive-Coding | HackerRank/Algorithms/Warmup/Game Of Thrones - I.cpp | #include <iostream>
#include <bitset>
using namespace std;
int main() {
char A[100001];
int i;
cin>>A;
bitset<26> flag;
for (i = 0; A[i] != '\0'; ++i) flag[A[i] - 'a'] = !flag[A[i] - 'a'];
if (flag.count() > (i % 2)) cout<<"NO";
else cout<<"YES";
return 0;
} | ALGO | 0.999919 | 3.89045 |
143e8dd8-796c-408c-adbe-9914417066b9 | shivamngpal/DSA-practice | arrays/DutchNationalFlag.cpp | #include <iostream>
#include<vector>
using namespace std;
void DNF(vector<int> arr, int size){
int l=0,m=0,h=size-1;
while(m<=h){
if(arr[m]==0){
swap(arr[m],arr[l]);
m++,l++;
}
else if(arr[m]==1){
m++;
}
else{
swap(arr[m],a... | ALGO | 0.999971 | 5.33726 |
fb7f3e80-8cf4-40c4-9c70-38e670be857f | pervasive-computing-systems-group/MT-OTM-Solver | src/Random_PathPlanner.cpp | #include "Random_PathPlanner.h"
Random_PathPlanner::Random_PathPlanner() {
// Seed rand()
srand(time(NULL));
}
Random_PathPlanner::~Random_PathPlanner() {
}
//***********************************************************
// Public Member Functions
//***********************************************************
//****... | ALGO | 0.999933 | 5.270635 |
70db56ce-3f78-4cfc-80d0-5bba44d8f92a | afkyyd/engine | Engine/Source/ThirdParty/OpenSubdiv/3.0.2/opensubdiv/osd/ompKernel.cpp | #include "../osd/ompKernel.h"
#include "../osd/bufferDescriptor.h"
#include <cassert>
#include <cstdlib>
#include <omp.h>
#include <vector>
namespace OpenSubdiv {
namespace OPENSUBDIV_VERSION {
namespace Osd {
template <class T> T *
elementAtIndex(T * src, int index, BufferDescriptor const &desc) {
return src ... | ALGO | 0.937153 | 5.413981 |
7959d3ab-7f11-4fb4-adc1-0e4f8dec8da9 | ishandutta2007/codeforces | -imc-/normal/1677/D.cpp | #include <bits/stdc++.h>
using namespace std;
using li = long long;
#define all(v) (v).begin(), (v).end()
void solve(bool read) {
int n, k;
cin >> n >> k;
vector<int> v(n);
for (int i = 0; i < n; ++i) {
cin >> v[i];
}
for (int i = n - k; i < n; ++i) {
if (v[i] != 0 && v[i] != -1) {
cout ... | ALGO | 0.99994 | 4.77228 |
653e5b35-bb83-4fb6-ad36-ebfab5ed9dc7 | deepak-ky/cpp-codes | cpp-codes/array.cpp | #include<iostream>
#include<bits/stdc++.h>
using namespace std;
#define int long long
#define varname(name) #name
#define mod 1000000007
#define wer(x) cout<<"\n"<<varname(x)<<" here : "<<x
#define test int t;... | ALGO | 0.999933 | 3.502091 |
66319b6b-896f-4536-876f-9fa95f147149 | Siyao-Lu/Leetcode | c++/tree/105_construct_binary_tree_from_preorder_and_inorder_traversal.cpp | // tree: leetcode medium
/*
Given two integer arrays preorder and inorder where preorder is the preorder traversal of a binary tree and inorder is the
inorder traversal of the same tree, construct and return the binary tree.
*/
#include <algorithm>
#include <unordered_map>
#include <iterator>
#include <vector>
using na... | ALGO | 0.999958 | 7.057195 |
5a06f3e2-018e-43f6-89fe-269c7ad5f77e | ishandutta2007/codeforces | se1ka2/normal/1196/D1.cpp | #include <iostream>
#include <string>
using namespace std;
char t[200005];
int main()
{
int q;
cin >> q;
for(int c = 0; c < q; c++){
int n, k;
cin >> n >> k;
string s;
cin >> s;
for(int i = 0; i < n + 2; i++){
if(i % 3 == 0) t[i] = 'R';
if(i ... | ALGO | 0.999695 | 4.095874 |
ee2c9d24-3000-4378-9679-5b88692877ec | ishandutta2007/codeforces | beet/normal/840/B.cpp | #include <bits/stdc++.h>
using namespace std;
template<typename T1,typename T2> inline void chmin(T1 &a,T2 b){if(a>b) a=b;}
template<typename T1,typename T2> inline void chmax(T1 &a,T2 b){if(a<b) a=b;}
using Int = long long;
const char newl = '\n';
template<typename F>
struct FixPoint : F{
FixPoint(F&& f):F(forward<... | ALGO | 0.999995 | 4.1499 |
2ed6436d-9966-43a6-84de-872cfd4e3737 | lewis-revill/agc-llvm-project | flang/lib/Decimal/binary-to-decimal.cpp | #include "big-radix-floating-point.h"
#include "flang/Decimal/decimal.h"
#include <cassert>
#include <string>
namespace Fortran::decimal {
template <int PREC, int LOG10RADIX>
BigRadixFloatingPointNumber<PREC, LOG10RADIX>::BigRadixFloatingPointNumber(
BinaryFloatingPointNumber<PREC> x, enum FortranRounding roundin... | ALGO | 0.947562 | 6.644915 |
7cf64396-e6eb-470c-804e-9b4b460b7012 | alexyuxuan/snakegame_- | EnemySnake.cpp | #include "EnemySnake.h"
#include "Snake.h"
#include <cmath>
#include <limits>
#include <random>
namespace sfSnake
{
EnemySnake::EnemySnake()
: hitSelf_(false), direction_(Direction::Right), pendingGrowth_(0),
currentState_(AIState::Wander), decisionTimer_(sf::Time::Zero),
chaseCycleCount_(0), restCyc... | ALGO | 0.998544 | 6.228614 |
d8ba9242-6cf6-43c6-8ce5-f18c20e7f858 | amogh-nagar/Leetcode-Questions | 121-best-time-to-buy-and-sell-stock/121-best-time-to-buy-and-sell-stock.cpp | class Solution {
public:
int maxProfit(vector<int>& prices) {
int diff=0,mint=prices[0];
for(int i=1;i<prices.size();i++){
if(diff<(prices[i]-mint)){
diff=prices[i]-mint;
}
mint=min(mint,prices[i]);
}
return diff;
}
}; | ALGO | 0.999924 | 6.101953 |
f53d426d-9835-4110-95d6-a0bbf2e14fc8 | ivan-guerra/project_euler | benchmark/solns/soln_12/soln_12_benchmark.cpp | #include <benchmark/benchmark.h>
#include "solns/soln_12.h"
static void BM_Soln12(benchmark::State& state) {
for (auto _ : state) {
euler::Soln12({"500"});
}
}
BENCHMARK(BM_Soln12);
| ALGO | 0.97016 | 4.101733 |
120bd04f-41b1-434a-8a23-29649687aee9 | canhung/homework | Bai 1/A11.cpp | #include<iostream>
using namespace std;
int main()
{
double F;
cin >> F;
double C = (F - 32) * (5.00 / 9); // 5/9 luon ra ket qua la 0
cout << C;
return 0;
}
| ALGO | 0.997742 | 3.376323 |
14a4fa2b-33ed-416a-88fe-859be9ac0fcf | auspens/WebServ | src/Config/Config.cpp | /* ************************************************************************** */
/* */
/* ::: :::::::: */
/* Config.cpp :+: :+: :+: ... | CONFIG | 0.986059 | 6.070231 |
39ab02e1-7466-446f-b3f1-8f3724708de9 | rashedcs/Online-Judge | GeeksforGeeks/Decimal-to-any-base-conversion.cpp | /*
Given a decimal number and the base to which it should be converted. Convert the given number to the given base.
Input:
The first line of input contains an integer T denoting the number of test cases.
The first line of each test case is the base and second line of test case is the decimal number.
Output:
Decimal... | ALGO | 0.998272 | 6.101773 |
b15742d4-9364-43ca-aa25-f76dfe58cdf1 | feanored/Boost | Estudos/Estruturas/arrays.cpp | #include <iostream>
using namespace std;
const int MAX_SIZE = 100;
int main() {
int number, i;
double notas[MAX_SIZE], media;
std::cout << "Entre com o número de alunos: ";
std::cin >> number;
media = 0;
std::cout << "Informe as notas de cada aluno, separadas por espaços:"<<std::endl;
for (i=0; i<number; i++... | TOOL | 0.908865 | 3.701046 |
f3099bd2-f6d7-402e-926b-8d47d80cec08 | raincross7/code-similarity | codes/train_code/problem500/problem500_7.cpp | #include<bits/stdc++.h>
using namespace std;
#define rep(i,n) for(int i = 0;i<n;i++)
#define erep(i,n) for(int i = 0;i<=n;i++)
#define rep1(i,n) for(int i = 1;i<n;i++)
#define erep1(i,n) for(int i = 1;i<=n;i++)
typedef long long ll;
#define vint vector<int>
#define vvint vector<vector<int>>
#define vstring vector<strin... | ALGO | 0.999752 | 3.624949 |
ce39f07d-d8bd-4628-bd18-a5a08904717c | haastregt/occlusion_tracking | occlusion_package/CGAL-5.5.2/examples/Triangulation_2/star_conflict_zone.cpp | #include <CGAL/Exact_predicates_inexact_constructions_kernel.h>
#include <CGAL/Delaunay_triangulation_2.h>
#include <CGAL/draw_triangulation_2.h>
#include <CGAL/spatial_sort.h>
#include <array>
#include <vector>
#include <iostream>
typedef CGAL::Exact_predicates_inexact_constructions_kernel K;
typedef K::Point_2 Point... | ALGO | 0.999646 | 7.159151 |
fc775ea2-1ac1-4210-98e0-0a87ade96dba | karouzakisp/llvm-bit-manip | llvm/lib/CodeGen/StackSlotColoring.cpp | #include "llvm/ADT/BitVector.h"
#include "llvm/ADT/SmallVector.h"
#include "llvm/ADT/Statistic.h"
#include "llvm/CodeGen/LiveInterval.h"
#include "llvm/CodeGen/LiveIntervals.h"
#include "llvm/CodeGen/LiveStacks.h"
#include "llvm/CodeGen/MachineBasicBlock.h"
#include "llvm/CodeGen/MachineBlockFrequencyInfo.h"
#include "... | ALGO | 0.974949 | 7.812813 |
6ef6f9fe-d85d-4cd3-8354-2471394ed4df | khushhallchandra/algoPractice | DP/palPartition.cpp | #include<bits/stdc++.h>
using namespace std;
int palPartion(string str){
int i, j, k, L, n = str.length();
int C[n];
bool P[n][n];
for (i=0; i<n; i++)
P[i][i] = true;
for (L=2; L<=n; L++){
for (i=0; i<n-L+1; i++){
j = i+L-1;
if (L == 2)
P[i]... | ALGO | 0.999965 | 4.578804 |
19450857-d3ae-40ee-a567-ac87fb52d928 | jeremyhansen/rooksguide-cplusplus | src/Output/inline_code_6.cpp | #include <iostream>
using namespace std;
int main()
{
double num = 3.14159265;
cout.precision(3);
cout << num << endl;
}
| ALGO | 0.985679 | 3.069118 |
27076eda-28d8-4a2b-a81a-5d95af379001 | mrunaltarwatkar018/Placement_Data_Structures_N_Algorithms | Sliding Window/Number of Substrings Containing All Three Characters.cpp | /* Leetcode Problem No.: 1358. Number of Substrings Containing All Three Characters */
/*
Company Tags : will update soon
Leetcode Link : https://leetcode.com/problems/number-of-substrings-containing-all-three-characters
*/
/*******************************************************... | ALGO | 0.998362 | 6.776311 |
0beec64e-3480-494f-8d9d-0e9b2f2545e6 | efaaz/Cpp-Problem-Solution | Assingments/problem11.cpp | #include <iostream>
using namespace std;
int main()
{
int N;
cout << "Enter the number of students: ";
cin >> N;
float quiz_1[N];
float quiz_2[N];
float worst_quiz[N];
cout << "\nEnter the marks of quiz 1: ";
for (int i = 0; i < N; i++)
{
cin >> quiz_1[i];
}
cout << ... | ALGO | 0.999382 | 4.19447 |
ed7b1c95-df26-48b4-bd4b-609f03857c04 | sarvex/leetcode-factor | solution/0200-0299/0257.Binary Tree Paths/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.999966 | 6.299701 |
f48318e0-d4a1-4b08-b1e7-35eec1df8504 | n01e0/pRETzel_logic | llvm/lib/Transforms/Utils/LoopUnrollRuntime.cpp | #include "llvm/ADT/SmallPtrSet.h"
#include "llvm/ADT/Statistic.h"
#include "llvm/Analysis/LoopIterator.h"
#include "llvm/Analysis/ScalarEvolution.h"
#include "llvm/IR/BasicBlock.h"
#include "llvm/IR/Dominators.h"
#include "llvm/IR/MDBuilder.h"
#include "llvm/IR/Metadata.h"
#include "llvm/IR/Module.h"
#include "llvm/Sup... | ALGO | 0.989405 | 7.807891 |
f8730460-219b-4d97-bc35-7f223e18e142 | nguyenpanda/ComputerGraphic | test_application/physic/Bouncing.cpp | //
// Created by ANH KHOA on 6/11/2024.
//
#include "Bouncing.h"
namespace Physic {
namespace PhyEnv {
double mu = 0.1;
double g = 9.8;
};
Particle_bouncing::Particle_bouncing(int w, int h) {
std::mt19937 mt_pos_1(time(nullptr));
std::uniform_real_distribution<> dist_pos_... | TOOL | 0.965258 | 5.491579 |
ab3f5eb3-8193-43c3-9cfa-f364909ac68e | 101rror/CodeForces | Contests/CF Round 920 (Div 3)/C - Sending Messages.cpp | ///There is none worthy of worship except ALLAH and Muhammad(SWT) is the messenger of ALLAH.
/**
*
* author :: 101rror
*
**/
#include<bits/stdc++.h>
using namespace std;
#define FastRead ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);
#define SuccessfullyExecuted return 0;
#define YES printf("YES\n")... | ALGO | 0.999846 | 3.001054 |
021d166d-4232-4c76-948b-a03429351621 | CoderOJ/contests | tmp/U142563/main.cpp | // PARSER: begin local header '/home/jack/code/creats/Scanner.h'
#ifndef _LIB_SCANNER
#define _LIB_SCANNER 1
#include <stdio.h>
#include <stdlib.h>
class Scanner
{
private:
static const int BUFFER_SIZE = 10000;
char buff[BUFFER_SIZE];
int buffPos, buffLim;
public:
Scanner()
{
buffLim = fread(buff, 1, BU... | ALGO | 0.999871 | 4.409282 |
b77d8997-8ec4-49bf-a6a7-53502d68b151 | jimmy947788/zygisk-florida-gadget | src/libcxx/test/std/algorithms/alg.nonmodifying/alg.search/search_n_pred.pass.cpp | // <algorithm>
// template<class ForwardIterator, class Size, class T, class BinaryPredicate>
// constexpr ForwardIterator // constexpr after C++17
// search_n(ForwardIterator first, ForwardIterator last, Size count,
// const T& value, BinaryPredicate pred);
#include <algorithm>
#include <cassert>
... | TEST | 0.997175 | 7.355083 |
934b9909-c137-4ca8-a620-1d97de643206 | remote-android/platform_external_swiftshader | third_party/LLVM/lib/CodeGen/ShrinkWrapping.cpp | #define DEBUG_TYPE "shrink-wrap"
#include "PrologEpilogInserter.h"
#include "llvm/CodeGen/MachineDominators.h"
#include "llvm/CodeGen/MachineLoopInfo.h"
#include "llvm/CodeGen/MachineInstr.h"
#include "llvm/CodeGen/MachineFrameInfo.h"
#include "llvm/CodeGen/MachineRegisterInfo.h"
#include "llvm/Target/TargetMachine.h"... | ALGO | 0.975279 | 3.59171 |
97b31685-a4e7-48e0-b46d-fcb38cd145a7 | waterwithoutmoon1/HPC | subprojects/eigen-3.4.0/doc/examples/TutorialLinAlgSetThreshold.cpp | #include <iostream>
#include <Eigen/Dense>
using namespace std;
using namespace Eigen;
int main()
{
Matrix2d A;
A << 2, 1,
2, 0.9999999999;
FullPivLU<Matrix2d> lu(A);
cout << "By default, the rank of A is found to be " << lu.rank() << endl;
lu.setThreshold(1e-5);
cout << "With threshold 1e-5... | ALGO | 0.999772 | 4.090376 |
49764ce6-c6d6-41b3-b902-b91502ee6e31 | moupiya0125/DSA | Patterns/pattern6.cpp | #include <bits/stdc++.h>
using namespace std;
int main(){
int n,i,j;
cin>>n;
i=1;
while(i<=n){
j=1;
while (j<=n)
{
cout<<n-j+1;
j++;
}
cout<<endl;
i++;
}
} | ALGO | 0.999979 | 3.747581 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.