uuid string | repo_name string | relative_path string | content string | category string | algo_rel_score float64 | quality_score float64 |
|---|---|---|---|---|---|---|
4953bbb5-6e36-4741-bb24-2b3f437a8f06 | bearl27/SportProgramming | AtCoder/ABC/230s/238/b.cpp | #include<iostream>
#include<vector>
#include<algorithm>
#include<string>
#include<map>
#define _USE_MATH_DEFINES
#include<math.h>
#include<queue>
#include<deque>
#include<stack>
#include<cstdio>
#include<utility>
#include<set>
#include<list>
#include<cmath>
#include<stdio.h>
#include<string.h>
#include<iomanip>
#includ... | ALGO | 0.999869 | 3.476161 |
77b7168e-549d-47a2-be64-3ad7a8181256 | Jonoabbo/Soft20091Project | src/match3Project/match3Project/gridInit.cpp | #include "stdafx.h"
#include "gridInit.h"
GridInit::GridInit()
{
createGrid();
}
void GridInit::createGrid()
{
//seed random
srand(time(NULL));
//create grid of random numbers
for (int i = 0; i < 8; i++)
{
for (int j = 0; j < 8; j++)
{
grid[i][j] = (rand() % 5) + 1;
std::cout << "Position " << i << "... | ALGO | 0.977903 | 3.497309 |
16dfe671-8053-4735-aea9-0567f617a2be | freiler/OpenLB-v1.5 | examples/thermal/porousPlate2d/porousPlate2d.cpp | /* porousPlate2d.cpp:
* The porous plate problem was described e.g. by [Guo et al.,
* International Journal for Numerical Methods in Fluids 39.4 (2002)
* pp. 325–342] to test the model’s accuracy and to determine the
* experimental order of convergence (EOC).
* The problem setup is to simulate a temperature gradi... | ALGO | 0.999252 | 5.174761 |
d7164d49-6673-411d-a8ad-885c1b94b14f | ishandutta2007/codeforces | pinkierabbit/normal/1753/A1.cpp | #include <cstdio>
#include <algorithm>
#include <vector>
#include <utility>
#include <set>
using std::scanf, std::printf;
#define F(i, a, b) for(int i = a; i <= (b); ++i)
#define F2(i, a, b) for(int i = a; i < (b); ++i)
#define dF(i, a, b) for(int i = a; i >= (b); --i)
#define debug(...) std::fprintf(stderr, __VA_ARGS... | ALGO | 0.999459 | 3.583467 |
8afefc14-2038-4aec-bb4e-3d360c9c9263 | 113bommy/deepmind_codecontests_refine | cpp_source_filter_file/cpp_train_10884_1.cpp | #include <bits/stdc++.h>
using namespace std;
namespace BlueQuantum {
int const N = 1e5 + 5, INF = 0x7f7f7f7f;
int e_cnt = 1, ncnt;
int heads[N * 2], cur[N * 2], dep[N * 2], need[N * 2];
int lim[N * 2], cnt[N * 2];
bool typ[N];
map<int, int> xmap, ymap;
struct Edge {
int v, nxt, f;
} e[N * 22];
inline void add(int u,... | ALGO | 0.999899 | 3.983454 |
a900cfcb-5e70-4361-8dcd-50e82e15f8e3 | Arya1011/GfG-Leetcode | Rat in a Maze.cpp | #include <iostream>
using namespace std;
bool ratInMaze(char maze[10][10], int soln[10][10], int i, int j, int m, int n)
{
// Base case
// this will be reached when we finally reach the end of the matrix where we mark the cell as 1 and print the path
if (i == m && j == n)
{
soln[m][n] = 1;
... | ALGO | 0.999654 | 3.795044 |
9dd16bca-42fb-4ade-8c7e-94c1d8e033af | AliMuhammadAsad/Kattis-Solutions | src/phonelist.cpp | #include<bits/stdc++.h>
using namespace std;
int main(){
int t; cin >> t;
while(t--){
int n; cin >> n;
string arr[n]; bool flag = false;
for(int i = 0; i < n; i++){
cin >> arr[i];
}
for(int i = 0; i < n; i++){
for(int j = 0; j < n; j++){
... | ALGO | 0.999788 | 4.458488 |
ce4806ca-394f-46b0-8dc9-53770ce754f0 | LingrajSwami/cpp-programming | Program220.cpp | #include<iostream>
using namespace std;
typedef struct node
{
int data;
struct node *next;
}NODE, *PNODE, **PPNODE;
class SinglyLL
{
public:
PNODE first;
int Count;
SinglyLL()
{
cout<<"Inside constructor\n";
first = NULL;
Count = 0;
... | ALGO | 0.998486 | 4.640337 |
32e7800e-1df5-4119-97fb-9cf43bfd7e26 | rupesh-dharme/LeetCode | 1863-sum-of-all-subset-xor-totals/1863-sum-of-all-subset-xor-totals.cpp | class Solution {
public:
int subsetXORSum(vector<int>& nums) {
int sum = 0, xr = 0;
recurse(nums, 0, nums.size(), xr, sum);
return sum;
}
void recurse(vector<int>& nums, int i, int n, int& xr, int& sum) {
if (i == n) {
sum += xr;
return;
}
... | ALGO | 0.999994 | 5.696484 |
9c5f4f94-32f0-40a3-a4f3-72a07c543052 | ngonguyen1512/Cplus | quicksort.cpp | #include <iostream>
#include <cmath>
using namespace std;
void nhap(int a[], int &n) {
cout<<"Nhap kich thuoc mang n = "; cin>>n;
cout<<"Nhap gia tri mang"<<endl;
for(int i=0; i<n; i++) {
cin>>a[i];
}
}
void xuat(int a[], int &n) {
for(int i=0; i<n; i++) {
cout<<" "<<a[i];
... | ALGO | 0.99996 | 4.554327 |
80cd510d-a76c-400f-a3d7-5e7c01a10a5f | Yusha47/Monarch_Sh | Competitive programming/Practice/B_Fireworks.cpp | #include<bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
const int DEBUGGER = 1;
#define MAX 10000
#define mp make_pair
#define pb push_back
#define II ({ ll TEMP; cin>>TEMP; TEMP; })
#define SI ({ string TEMP; cin>>TEMP; TEMP; })
#define AI(a) ({ int n=sizeof(a)/sizeof(a[0]... | ALGO | 0.99983 | 3.697639 |
58a00550-0cae-4459-b70e-a2d3eaea9d7d | sarvex/leetcode-cobol | solution/1700-1799/1733.Minimum Number of People to Teach/Solution.cpp | class Solution {
public:
int minimumTeachings(int n, vector<vector<int>>& languages, vector<vector<int>>& friendships) {
unordered_set<int> s;
for (auto& e : friendships) {
int u = e[0], v = e[1];
if (!check(u, v, languages)) {
s.insert(u);
s.i... | ALGO | 0.999847 | 5.632493 |
6fb759f1-c958-4ebf-ac33-f64ccb508a23 | Fisch-Alex/anomaly | src/meanvarwithanomaly_mean.cpp | #include <R.h>
#include <Rinternals.h>
#include <Rmath.h>
#include <math.h>
#include <stdlib.h>
#include "Functions.h"
#include <vector>
using namespace anomaly;
std::vector<int> MeanAnomaly(SEXP Rx, SEXP Rn, SEXP Rminlength, SEXP Rmaxlength, SEXP Rbetachange, SEXP Rbetaanomaly, SEXP Ronline)
// SEXP MeanAnomaly(SE... | ALGO | 0.996448 | 4.404986 |
37a34266-1102-4bf4-a32b-a67a05ec3733 | nzjrs/opencv_old_libdc1394 | cxcore/src/cxdrawing.cpp | #include "_cxcore.h"
#define XY_SHIFT 16
#define XY_ONE (1 << XY_SHIFT)
#define CV_DRAWING_STORAGE_BLOCK ((1 << 12) - 256)
typedef struct CvPolyEdge
{
int x, dx;
union
{
struct CvPolyEdge *next;
int y0;
};
int y1;
}
CvPolyEdge;
static void
icvCollectPolyEdges( CvMat* img, C... | ALGO | 0.993192 | 5.84465 |
90e2218c-8829-407c-a4af-c382fd96f9cf | MasterJH5574/RISCV-Simulator | main.cpp | #include <bits/stdc++.h>
#include "instructions.h"
#include "global.h"
#include "stages.h"
using namespace std;
bool check_end(const IF_ID &if_id, const ID_EX &id_ex, const EX_MEM &ex_mem, const MEM_WB &mem_wb) {
if (if_id.empty)
return false;
if (if_id.ins_str != 0x00c68223)
return false;
... | ALGO | 0.926515 | 3.80051 |
132afb11-08d4-4f4e-a1c1-bac6b302b085 | hqdem/hlimds | src/gate/synthesizer/operation/utils.cpp | #include "addition.h"
#include "utils.h"
#include <cassert>
#include <cmath>
namespace eda::gate::synthesizer {
void extend(
model::SubnetBuilder &builder,
model::Subnet::LinkList &word,
const uint32_t width,
const bool signExtend) {
if (word.size() >= width) return;
const auto bit = (signExtend... | ALGO | 0.982402 | 6.542737 |
6eb97b37-aeb4-463d-8e5c-91c318785f22 | Hasheditz/Leetcode-CSES-GFG-Codeforces-Coding-Solutions | CSES Solutions/Introductory Problems/Coin_Piles.cpp | #include<bits/stdc++.h>
using namespace std;
void solve()
{
long long x, y;
cin >> x >> y;
if ((x + y) % 3 == 0 && min(x, y) >= (x + y) / 3)
{
cout << "YES" << endl;
}
else
{
cout << "NO" << endl;
}
}
int main()
{
int t;
cin >> t;
while (t--)
{
... | ALGO | 0.999889 | 4.995734 |
b3158bed-ffcb-4a5e-b8f6-8c8ae4fe814d | SHOVON944/Codeforces | 800/Systwm of Equations.cpp | #include <bits/stdc++.h>
using namespace std;
int main()
{
int n, m;
cin>>n>>m;
int count = 0;
for(int a=0; a<=1000; a++){
for(int b=0; b<=1000; b++){
if(pow(a,2)+b==n && a+pow(b,2)==m) count++; // a*a+b & a+b*b
}
}
cout <<count<< endl;
... | ALGO | 0.999573 | 4.721988 |
e92c191a-bd5c-4cea-bb7a-cbebb8d39a6f | Deepjyoti-Sarmah/Data-Structure-and-Algorithms | BinarySearchProblems/searchinSorted&RotatedArray.cpp | #include<iostream>
using namespace std;
int searchInRotatedArray(int arr[], int key, int left, int right){
if(left>right){
return -1;
}
int mid = (left+right)/2;
if(arr[mid] == key){
return mid;
}
if(arr[left] <= arr[mid]){
if(key>= arr[left] && key<=arr[mid]){
... | ALGO | 0.999997 | 5.389021 |
31876c29-029f-4221-9f2d-77a54dbcf9aa | fandan-nyc/leetcode | cpp/283MoveZeros.cpp | /*
File Name: 283MoveZeros.cpp
Xiaolong Zhang
Question:
Given an array nums, write a function to
move all 0's to the end of it while maintaining
the relative order of the non-zero elements.
For example, given nums = [0, 1, 0, 3, 12], after
calling your function, nums should be [1, 3, 12, 0, 0].
N... | ALGO | 0.999903 | 6.146951 |
347bd4f5-6735-4201-858f-c8f1243d1972 | Tifauv/sat | src/iterativesolver/ResolutionStack.cpp | #include "ResolutionStack.h"
#include <string>
#include "log.h"
namespace sat {
namespace solver {
// CONSTRUCTORS
/**
* Initializes the stack with the first level.
*/
ResolutionStack::ResolutionStack() {
nextLevel();
}
// LEVEL MANAGEMENT
/**
* Creates a new resolution level in the stack.
* This new level bec... | ALGO | 0.996895 | 6.330995 |
8d304775-0a0e-4046-ae2d-0118859f9e6d | Ishavashisht/Leetcode_dsa | 0719-find-k-th-smallest-pair-distance/0719-find-k-th-smallest-pair-distance.cpp | class Solution {
public:
int countFunc(vector<int>&nums,int mid){
int count=0;
int left=0;
for(int right=0;right<nums.size();right++){
while(nums[right] - nums[left] > mid){
left++;
}
count+=right-left;
}
return count;
}
in... | ALGO | 0.999996 | 6.022754 |
1663ae9b-6116-4c9a-b09d-e0104a0f28d4 | Gabriel222003/Linguagem-C | Retangulo_ou_Quadrado.cpp | #include <stdio.h>
main(){
int lado1;
int lado2;
int A;
int P;
scanf("%d",&lado1);
scanf("%d",&lado2);
if(lado1 == lado2){
printf("Quadrado\n");
P = 4*lado1;
}else{
printf("Retangulo\n");
P = 2*(lado1 + lado2);
}
A = lado1*lado2;
printf("Area:%d\nPerimetro:%d",A ,P);
}
| ALGO | 0.999194 | 3.603322 |
57827109-3645-4643-bc16-ad2686787398 | annoygithub/sigmod2021 | third_party/cbmc/src/goto-diff/syntactic_diff.cpp | /*******************************************************************\
Module: Syntactic GOTO-DIFF
Author: Peter Schrammel
\*******************************************************************/
/// \file
/// Syntactic GOTO-DIFF
#include "syntactic_diff.h"
#include <goto-programs/goto_model.h>
bool syntactic_difft:... | TOOL | 0.976597 | 6.405758 |
535bad39-316f-4953-be94-4bc6c22707a5 | joydip007x/CompetitiveCodeArchive | URAL/1225/18700757_WA_1ms_444kB.cpp | #include<bits/stdc++.h>
using namespace std;
#define ll int
#define ret return
///*/////////////////// /// *
/*// author-joydip007x /// */
#define M 9999
ll dp[M] ,n,lmt,t,k;
vector<ll>v;
ll fun(ll last)
{
////cout<<last<<" : ";
if(last<0) ret 0;
if(last==1 ) ret 1;
if(last==0) ret 1;
if(dp[la... | ALGO | 0.999983 | 3.760601 |
ead1e0db-a3e9-4cf0-a836-b321c9e9bb6e | dpeck12/Hackerrank | countUpperCase.cpp | #include <bits/stdc++.h>
using namespace std;
// Complete the camelcase function below.
int camelcase(string s) {
int count = 1;
size_t count_upper = count_if(s.begin(), s.end(),[](unsigned char ch) { return isupper(ch); });
return count + count_upper;
}
int main()
{
ofstream fout(getenv("OUTPUT_PATH... | ALGO | 0.99899 | 5.041463 |
ea3b6156-ad58-423e-8798-a8309debca2b | w2strive/algorithm | 87_二叉树的镜像.cpp | #include <iostream>
#include <string>
using namespace std;
/*
利用二叉树的递归遍历来实现
*/
class Node {
public:
Node(int value) : value(value) { left = nullptr; right = nullptr; }
int value;
Node *left;
Node *right;
};
string getSpace(int num);
void printInOrder(Node *head, int height, string to, int len);
vo... | ALGO | 0.999988 | 5.752648 |
59984dcd-f134-461b-9fe9-0835d2275161 | anshulyadav0135/practice-DSA | AIlab.cpp |
#include <bits/stdc++.h>
using namespace std;
const int Max = 1000;
const int Min = -1000;
int minimax(int depth, int nodeIndex, bool maximizingPlayer, int values[], int alpha, int beta)
{
if (depth==3)
return values[nodeIndex];
if (maximizingPlayer)
{
int best = Min;
for (int ... | ALGO | 0.999938 | 4.258008 |
4b660d31-2577-4d56-af8c-d10fa6059961 | Monal-Patel/amrsolver | lib/boost/libs/circular_buffer/test/bounded_buffer_comparison.cpp | // Comparison of bounded buffers based on different containers.
#include <boost/circular_buffer.hpp>
#include <boost/thread/mutex.hpp>
#include <boost/thread/condition_variable.hpp>
#include <boost/thread/thread.hpp>
#include <boost/timer/timer.hpp>
#include <boost/call_traits.hpp>
#include <boost/bind.hpp>
#include <... | TOOL | 0.857513 | 7.002804 |
536e4d6b-5c06-4e5a-b796-94ebcc63f446 | zhsenl/online-judge | 1153_3.cpp | //֦ͨҼ֦ʮ棬һչٵģ˴ţŻ
//Ҳ˵統ǰ8ߵչ㣬ÿչټĿչȻǸչС
//Ǹûǰ;ĵ㣬죬Ϊôûǰ;Ҫ㵽ˣ
//#include<iostream>
//#include<cstring>
//#include<vector>
//#include<algorithm>
//using namespace std;
//int dir[8][2] = {-1,-2,-1,2,-2,1,-2,-1,1,2,1,-2,2,1,2,-1};
//bool vis[64];
//int ans[64];
//bool legal(int x,int y)
//{
// if(x < 0 || x > 7 || y < 0 || y > 7... | ALGO | 0.996796 | 3.906322 |
101826b1-6673-4f00-8034-f52076dd749d | king-yyf/cpcode | leetcode/lcb106/b.cpp | #ifdef sigma-yyf
#include "/Users/yangyf/Desktop/cpcode/leetcode/lc_help.hpp"
#endif
using namespace std;
using ll = long long;
using ar2 = array<int, 2>;
using ar3 = array<int, 3>;
using ar4 = array<int, 4>;
#define all(c) (c).begin(), (c).end()
#define rall(x) (x).rbegin(), (x).rend()
#define sz(x) (int)(x).size()
... | ALGO | 0.999952 | 4.492255 |
9125099e-f9ad-4eb4-863c-d6c6bbbdb58f | SamuelAdamson/zero-to-hero | LC/misc/LC_153/findMinimumInRotatedSortedArray.cpp | class Solution {
public:
int findMin(vector<int>& nums) {
int n = nums.size();
int l = 0, r = n - 1, mid;
while(l < r) {
mid = l + (r - l)/2;
if(nums[mid] > nums[r]) l = mid + 1;
else r = mid;
}
return nums[l]... | ALGO | 0.999994 | 6.11225 |
b850197a-fed3-491e-aa2e-3c21cf76368a | ManpreettSingh/Work | DSA/12.HashMaps.cpp/Maps.cpp/Questions.cpp/CheckAnagram.cpp | #include <iostream>
#include <vector>
#include <unordered_map>
using namespace std;
bool isAnagram(string &t1,string &t2) { // T.C. O(n) -> where n is the total no of characters and S>C=O(m) where m is the total no of unique characters
unordered_map<char, int> mp; // char,frequency
for (auto c : t1) mp[c]++;
... | ALGO | 0.999983 | 4.717887 |
f7626431-54ac-4861-b0fa-406a23f9c260 | Stocker7692/SDE_SHEET_DSA | DAY-5/Merge_Two_Sorted_Lists.cpp | #include <bits/stdc++.h>
using namespace std;
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:
// ITERATIVE
// TC: O((len(l1)+len(l2)))
... | ALGO | 0.999977 | 5.796239 |
2d8ee651-b570-4e96-b3de-09fd2de29401 | sujkovic/leetcodes | algorithms/mergesort/mergesort.cpp | #include <iostream>
#include <stdlib.h>
#include <vector>
using namespace std;
void merge(vector<int> &vec, vector<int> &left, vector<int> &right) {
int leftIndex = 0;
int rightIndex = 0;
int i = 0;
while (leftIndex < left.size() && rightIndex < right.size()) {
if (left[leftIndex] < right[righ... | ALGO | 0.999758 | 4.910718 |
8d18e970-6213-4691-a9b4-b779af66cc81 | 113bommy/deepmind_codecontests_refine | cpp_source_filter_file/cpp_train_5259_27.cpp | #include <bits/stdc++.h>
using namespace std;
const int M = 100100;
int A[M], pos[M];
int main() {
int i, j, k, temp, maxx = 0, n;
scanf("%d", &n);
for (i = 0; i < n; i++) {
scanf("%d", &A[i]);
pos[A[i]] = i;
}
temp = 1;
maxx = 0;
for (i = 2; i <= n; i++) {
if (pos[i] > pos[i - 1]) {
tem... | ALGO | 0.999885 | 3.809001 |
b1b25644-50e5-4f9c-89e6-d5626ad8d565 | ShahidYasin03/Data-Structures-Practice | Quiz 1 Preparation/Question2.cpp | #include <iostream>
using namespace std;
void remove(int *arr, int &size)
{
int temp[size];
int k = 0;
for (int i = 0; i < size - 1; i++)
{
if (arr[i] != arr[i + 1])
{
temp[k++] = arr[i];
}
}
temp[k++] = arr[size - 1];
for (int i = 0; i < k; i++)
{
... | ALGO | 0.999882 | 4.678824 |
e3a3a42b-5a49-4713-a3df-30160ba0744d | vanshu778/DSA-2025 | Number System/Binary-to-Hexadecimal.cpp | // Multiply each digit by 2ⁿ, where n is the position from the right (starting at 0).
#include <bits/stdc++.h>
using namespace std;
// Function to convert binary to decimal
int binarytoDecimal(long long number) {
int decimal = 0, power = 0;
while (number > 0) {
int lastDigit = number % 10;
de... | ALGO | 0.999693 | 6.87421 |
e95249fd-73e1-41bf-b2a2-75076d5b0852 | mpkottawa/Marlin-2.1.2 | Marlin/src/gcode/bedlevel/G35.cpp | #include "../../inc/MarlinConfig.h"
#if ENABLED(ASSISTED_TRAMMING)
#include "../gcode.h"
#include "../../module/planner.h"
#include "../../module/probe.h"
#include "../../feature/bedlevel/bedlevel.h"
#if HAS_MULTI_HOTEND
#include "../../module/tool_change.h"
#endif
#if ENABLED(BLTOUCH)
#include "../../feature/b... | TOOL | 0.975966 | 6.073866 |
efbf2932-3e62-4b03-bf80-e34522852164 | keviin0/CS150 | Module 10/Random.cpp | // Random.cpp
// Module 10 Project 4
// Author: Kevin Hu
// Problem Statement - Generating random numbers through a function with multiple parameters
/*
Algorithm:
1. Pass min, max, and quantity to printRandom()
2. Generate n random numbers between min and max
3. Print the numbers out
*/
... | ALGO | 0.959975 | 5.52432 |
39e2144c-3165-4d9f-b797-107a33059139 | tgparkk/c-DATA-STRUCTURES-AND-ALGORITHM | lesson1_example/lesson1_example/실습 문제2.cpp | #include <iostream>
#include <vector>
#include <array>
#include <sstream>
#include <algorithm>
#include <random>
#include <chrono>
struct card
{
int number;
enum suit
{
HEART,
SPADE,
CLUB,
DIAMOND
} suit;
std::string to_string() const
{
std::ostringstream os;
if (number > 0 && number <= 10)
os ... | ALGO | 0.998463 | 4.665873 |
fbaa709f-b54f-4301-a4d7-6cde7b0b6825 | wincle626/Synthesizable-approXimate-Linear-Algebra-Library-SXLAL- | EclipseProj/extlib/sp/pX1_mulAdd.cpp | #include "../sp/include/internals.hpp"
#include "../sp/include/platform.hpp"
posit_1_t pX1_mulAdd( posit_1_t a, posit_1_t b, posit_1_t c, int x ) {
//a*b + c
union ui32_pX1 uA;
uint_fast32_t uiA;
union ui32_pX1 uB;
uint_fast32_t uiB;
union ui32_pX1 uC;
uint_fast32_t uiC;
uA.p = a;
uiA = ... | TOOL | 0.86739 | 3.636315 |
8e12085c-f0c2-4b09-b784-565456a549cc | zafor4/Codeforce | 1512A.cpp | #include<iostream>
using namespace std;
int main(){
int test ;
cin>>test;
for (int i=0;i<test;i++){
int n;
cin>>n;
int arr[n];
for (int i=0;i<n;i++){
cin>>arr[i];
}
if (arr[0]!=arr[1] && arr[0]!=arr[2]){
cout<<1<<endl;
}
else if (arr[n-1]!=ar... | ALGO | 0.999836 | 3.242037 |
99dfe135-5cb8-440e-80d3-7dab76e8e1b4 | Geeta-Choudhary/MSC.CS-SEM-I | AAC/AAC/AAC/ClassPrograms/min_in_array.cpp | #include<bits/stdc++.h>
using namespace std;
void minInArray(vector<int>v){
int min=v[0];
for(int i=1;i<v.size();i++){
if(min>v[i]){
min = v[i];
}
}
cout<<"Min : "<<min;
}
int main(){
int n;
cin>>n;
vector<int> v;
for(int i=0;i<n;i++){
int val;
... | ALGO | 0.999829 | 4.714167 |
72fe6980-349d-4647-8b53-3ba0a1ba51ed | ishandutta2007/codeforces | liujunhao/normal/750/E.cpp | #include<cstdio>
#include<algorithm>
#include<cstring>
#include<cmath>
#include<set>
#include<map>
#include<unordered_map>
#include<queue>
#include<stack>
using namespace std;
typedef long long LL;
typedef pair<int,int>pii;
typedef unsigned uint;
typedef unsigned long long uLL;
const double pi=acos(-1);
template<class ... | ALGO | 0.999773 | 3.799051 |
c907c804-8302-4051-b8f2-3a7238b4c07c | rewwea/Function_Templates | Srednee.cpp | #include <iostream>
using namespace std;
template <typename T>
T srednee(T* a, int n) {
T sum = 0;
for (int i = 0; i < n; i++) {
sum += a[i];
}
return sum / n;
}
int main() {
int arr[] = {1, 2, 3, 4, 5};
int size = sizeof(arr) / sizeof(arr[0]);
cout << "Srednee arifmeticheskoe: " <... | ALGO | 0.99868 | 4.325635 |
36088809-e879-4c09-90eb-9fcbe7ae890d | akash-gupta0/DSA | Recursion & Backtracking/02Backtracking/01_MazeCountPaths.cpp | #include <iostream>
using namespace std;
// Consider a 3*3 matrix You have to move from points from (0,0) to (2,2).
// You can move only right and down.
// Problem : Count the total number of paths.
int paths = 0;
void count(int r, int c)
{
if (r == 1 || c == 1)
{
paths++;
return;
}
cou... | ALGO | 0.99991 | 4.555861 |
f2db2f41-e826-43b3-8da0-7ae431df281c | fengye/ppsspp_ot | Core/MIPS/ARM/ArmAsm.cpp | // Official git repository and contact information can be found at
// https://github.com/hrydgard/ppsspp and http://www.ppsspp.org/.
#include "Core/MemMap.h"
#include "Core/MIPS/MIPS.h"
#include "Core/System.h"
#include "Core/CoreTiming.h"
#include "Common/MemoryUtil.h"
#include "Common/CPUDetect.h"
#include "Common/A... | ALGO | 0.964768 | 5.523287 |
7b586340-5e4f-4bd5-982c-874e850f3fd0 | chiunyi23/OnlineJudgeCode | data_structure/J_example2.cpp | #include<iostream>
#include<sstream>
#include<cctype>
using namespace std;
int main()
{
string s;
while( getline( cin, s ) )
{
string oper;
stringstream ss;
char operators[1000] = {0};
int operands[1000] = {0};
int operators_length = 0;
int operands_length = ... | ALGO | 0.9995 | 3.927337 |
18cf9ebb-64e3-4f5b-94ca-c8c38de00577 | ishandutta2007/codeforces | ftiasch/normal/1000/G.cpp | #line 1 "/home/ftiasch/Documents/shoka/heavy_light_decomp_base.h"
#include <algorithm>
#include <vector>
struct HeavyLightDecompositionBase {
using Tree = std::vector<std::vector<int>>;
HeavyLightDecompositionBase(const Tree &tree, int root)
: n(tree.size()), parent(n), size(n), depth(n), top(n), bottom(n) ... | ALGO | 0.999969 | 5.108521 |
a587f7f8-79e1-418a-a4a8-d895ac8b2cc8 | raincross7/code-similarity | codes/train_code/problem119/problem119_157.cpp | #include<iostream>
using namespace std;
int main(){
string s,t;
cin>>s>>t;
int slen= s.length();
int tlen= t.length();
int ans=9999999;
int count=tlen;
for(int i=0;i<slen-tlen+1;i++){
count=0;
for(int j=0,k=i;j<tlen;j++,k++){
if(s[k]!=t[j])
count++;
}
ans= min(ans, count);
}
cout<<ans;
... | ALGO | 0.999992 | 3.695369 |
6451dbf4-51d5-46e8-afa3-dcd551d3cd6a | M-Khashaba/Assignment-3 | Assignment 3 final cpp.cpp | #include <iostream>
#include <string>
#include "Customer.h"
#include "Person.h"
#include "Mechanic.h"
#include "queue.h"
using namespace std;
int main()
{
int size;
int age, id;
string name;
cout << "Enter Number of available Mechanics: ";
cin >> size;
Mechanic* mechanics = new Mechanic[size... | TOOL | 0.872783 | 4.636396 |
faffdf74-1817-4930-b589-cb233b1ee8d2 | brunoduan/mojo-strip | third_party/android_ndk/sources/cxx-stl/llvm-libc++/test/std/numerics/rand/rand.dis/rand.dist.pois/rand.dist.pois.weibull/eval_param.pass.cpp | // <random>
// template<class RealType = double>
// class weibull_distribution
// template<class _URNG> result_type operator()(_URNG& g, const param_type& parm);
#include <random>
#include <cassert>
#include <vector>
#include <numeric>
#include <cstddef>
template <class T>
inline
T
sqr(T x)
{
return x * x;
}
i... | TEST | 0.900749 | 5.452512 |
0b687506-f429-4804-aa10-c66350144083 | lyccrius/OI-Solution | Luogu/P4467 [SCOI2007]k短路.cpp | #include <iostream>
#include <vector>
#include <deque>
#include <queue>
typedef std::vector<int> vic;
typedef std::deque<int> diq;
const int maxN = 50;
const int maxM = 2450;
const int maxK = 200;
const int inf = 1e9;
int n, m, k, a, b;
int u, v, w;
int h[maxN + 10];
struct Graph {
struct Vertex {
int h... | ALGO | 0.999995 | 3.973191 |
6f5ee197-3cee-4d25-ae9b-7507d778cc9d | l4z0-space/SolvedProblems | Others & Greedy/The Knight's Dealer/dpSol.cpp | #include <iostream>
#include <algorithm>
#include <map>
#include <fstream>
#include <math.h>
#include <string>
#include <sstream>
#include <vector>
#include <string.h>
#include <stdio.h>
#include <stdlib.h>
#include <queue>
using namespace std;
typedef long long ll;
map<int,vector<int>>Next;
void setNext(){
Next[0]... | ALGO | 0.999488 | 3.779104 |
2ad4d6f6-19f1-4241-91ac-67c23322c2dc | otavioon/COLA-2022-Tools | datasets/src/algo/poj/0/2559.cpp | #include <math.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <iostream>
#include <iomanip>
using namespace std;
#define LEN 100
#define ASCII 100
#define MAX_N 100
#define MAX_M 100
#define MAX 100
#define ASC 100
#define null 0
#define Len 100
#define SUM 100
#define NUMBER 100
#define SIZE 1... | ALGO | 0.999932 | 3.681457 |
fa2c4eba-e491-4be4-b649-e20bc6e6a3a4 | yyy96/problem-solving | Baekjoon/c++/10799.cpp | #include <iostream>
#include <string>
#include <vector>
#include <stack>
#include <algorithm>
using namespace std;
struct Line {
int s, e;
int cnt;
};
string str;
vector<Line> stick;
vector<Line> cutt;
int solution() {
int result = 0;
stack<int> s;
for (int i = 0; i < str.length(); i++) {
if (str[i] == '(') s... | ALGO | 0.99916 | 4.012971 |
7e3420d1-7a77-4dc1-b2f8-8dde5e83a7ee | Pudged/DataStructFinal | HashChain/HashChain.cpp | #include "HashChain.hpp"
using namespace std;
void HashTable::insert(int key)
{
int index = hashCode(key);
HashNode *newNode = new HashNode(key);
if (table[index] == 0)
{
table[index] = newNode;
}
else
{
insertCollisions++;
newNode->next = table[index];
ta... | ALGO | 0.99838 | 4.652276 |
a17350fa-e4e9-43a8-8937-32b8a0b2b186 | arash-ha/Cpp | Longest Word in Dictionary through Deleting.cpp | /*
Longest Word in Dictionary through Deleting
Given a string and a string dictionary, find the longest string in the dictionary that can be formed by deleting some characters of the given string. If there are more than one possible results, return the longest word with the smallest lexicographical order. If there is ... | ALGO | 0.999903 | 6.428649 |
3cccd951-3502-4531-9e15-be9bdb14da91 | ishandutta2007/codeforces | yukihana0416/normal/1523/B.cpp | #include <cstdio>
#include <cstdlib>
#include <cstring>
#include <ctime>
#include <cmath>
#include <climits>
#include <cassert>
#include <iostream>
#include <vector>
#include <queue>
#include <list>
#include <stack>
#include <deque>
#include <map>
#include <set>
#include <unordered_map>
#include <unordered_set>
#inc... | ALGO | 0.999668 | 3.674385 |
a570b693-cceb-48f6-a4b3-49bfc7253941 | AkshayTiwari27/Leetcode | 368-largest-divisible-subset/largest-divisible-subset.cpp | class Solution {
public:
vector<int> largestDivisibleSubset(vector<int>& nums) {
int n = nums.size();
sort(nums.begin(), nums.end());
vector<int>t(n, 1);
vector<int>prev(n,-1);
int last_index = 0;
int maxi = 1;
for(int i = 1; i<n; i++){
for(int j ... | ALGO | 0.999989 | 5.436564 |
389f06a3-0e2e-41f2-a5d5-3e84b1f4563b | RuoAndo/NII-SOCs-admin-tools | mapreduce/pig/lg/reduce/single_thread_clustering/init-label.cpp | #include <stdio.h>
#include <stdlib.h>
#include <stdbool.h>
#include <math.h>
#include <pthread.h>
#include <string>
#include <iostream>
#include <fstream>
#include <eigen3/Eigen/Dense>
#include <eigen3/Eigen/Core>
#include <eigen3/Eigen/SVD>
#include <random>
#define THREAD_NUM 1
#define CLUSTER_NUM 3
static int c... | DATA | 0.955074 | 3.459335 |
c34ac014-c638-4df0-a385-a7675930c74f | pari2dhi3/GeeksforGeeks | binary_tree/iterative_postorder_traversal.cpp | //Iterative Postorder traversal using 2 stacks
#include<bits/stdc++.h>
using namespace std;
typedef struct tree
{
tree *left;
tree *right;
int val;
}tree;
tree * newnode(int data)
{
tree *node;
node=(tree *)malloc(sizeof(node));
node->left=NULL;
node->right=NULL;
node->val=data;
return node;
}
void postorder(t... | ALGO | 0.999989 | 4.720206 |
ee328adb-d574-40ce-b51f-54540eea4b8f | Giangattt123/DSA_PTIT | Generation algo/Generation_Child.cpp | #include <bits/stdc++.h>
using namespace std;
#define ms(s,n) memset(s,n,sizeof(s))
#define all(a) a.begin(),a.end()
#define present(t, x) (t.find(x) != t.end())
#define sz(a) int((a).size())
#define FOR(i, a, b) for (int i = (a); i < (b); ++i)
#define FORd(i, a, b) for (int i = (a) - 1; i >= (b); --i)
#define pb push... | ALGO | 0.99995 | 3.775016 |
ef3506ff-1d57-40ed-b4ab-237ed374d235 | KSH-code/Problem-Solving | 23722.cpp | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
int gcd(int a,int b){
return b ? gcd(b, a%b) : a;
}
bool solve(){
int a,b,c,d; cin >> a >> b >> c >> d;
if(a+b+c+d==0)return false;
cout << gcd(d,gcd(c,gcd(a,b)));
return true;
}
int main()
{
cin.tie(0)->sync_with_stdio(false... | ALGO | 0.999749 | 5.153174 |
83e6a2c2-17bf-4596-ae73-fced5aa5b4bd | neura-jordan/pytorch_MPS_fork | aten/src/ATen/native/cpu/airy_ai.cpp | #define TORCH_ASSERT_NO_OPERATORS
#include <ATen/native/UnaryOps.h>
#include <ATen/Dispatch.h>
#include <ATen/native/Math.h>
#include <ATen/native/TensorIterator.h>
#include <ATen/native/cpu/Loops.h>
namespace at::native {
inline namespace CPU_CAPABILITY {
static void airy_ai_kernel(TensorIteratorBase& iterator) {
... | ALGO | 0.954191 | 7.131526 |
e5729dcc-c1e6-4556-a07c-3842624137c6 | Satyjeet007/Cpp-Programs | Program320.cpp | #include<iostream>
using namespace std;
template <class T>
struct node
{
T data;
struct node *next;
};
template <class T>
class SinglyLL
{
public:
struct node<T> * First;
SinglyLL();
void InsertFirst(T no);
void Display();
int Count();
};
template <class T>
Singly... | ALGO | 0.979585 | 4.8211 |
13aed901-796d-47c4-8a10-bb7fd0bdd486 | Evitagen7/Evitagen7.github.io | AcWing 357. 疫情控制.cpp | #include<bits/stdc++.h>
using namespace std;
#define mk(a,b) make_pair(a,b)
const int N=50000+200;
int head[N<<1],ver[N<<1],nxt[N<<1],edge[N<<1],tot;
int deep[N],fa[N][22],cnt,n,m,a[N],sum;
int tot2,tot3,tot4,t;
long long dis[N][22],Free[N],need2[N];
bool vis[N],okk,need[N];
pair<long long,int> h[N];//ԵִڵĽڵ
void add(in... | ALGO | 0.999706 | 3.66206 |
484b706b-94dc-476c-8aeb-f1ed1f7c1da5 | yushengtzou/PD2_hw | hw6/parseCorpus.cpp | /* 鄒雨笙 F64081070 程式設計二 第6次作業 2023/5/29
*/
#include <iostream>
#include <fstream>
#include <sstream>
#include <string>
#include <map>
#include <unordered_map>
#include <vector>
#include <algorithm>
using namespace std;
std::string replaceSubstring(std::string str, const std::string& from, const std::string& to) {
... | ALGO | 0.997227 | 4.324463 |
3a960521-144d-4f12-809d-db2d1326a7fb | Developer-Ujjwal/DSA-with-Cpp | BinaryTree/TreeNode.cpp | #include <iostream>
using namespace std;
class Node
{
public:
int val;
Node *left;
Node *right;
Node(int data) : val(data), left(nullptr), right(nullptr) {}
};
void display(Node *root)
{
if(root==nullptr) return;
cout<<root->val<<" ";
display(root->left);
display(root->right);
}
int sum... | ALGO | 0.999475 | 4.353071 |
c9ba944f-405d-4d81-aca0-d041a55f8e8d | tr1ten/DNA | 1670E.cpp | #include <bits/stdc++.h>
using namespace std;
#define ss second
#define ff first
#define int long long
#define rep(i,a,b) for (int i = (a); i < (b); i++)
#define per(i,a,b) for (int i = (b)-1; i >= (a); i--)
#define tkv(vec,sz) rep(i,0,sz) cin>>vec[i]
#define srv(vec) sort(vec.begin(), vec.end())
#define all(x) x.begin... | ALGO | 0.999343 | 4.178195 |
56527376-be51-4dcc-8af0-c1a8a51bb59b | AcdeAsdff/dat_zygisk_location | module/jni/libcxx/test/std/algorithms/alg.nonmodifying/alg.adjacent.find/adjacent_find.pass.cpp | // <algorithm>
// template<ForwardIterator Iter>
// requires EqualityComparable<Iter::value_type>
// constexpr Iter // constexpr after C++17
// adjacent_find(Iter first, Iter last);
#include <algorithm>
#include <cassert>
#include "test_macros.h"
#include "test_iterators.h"
#if TEST_STD_VER > 17
TEST_CONSTEX... | TEST | 0.964115 | 5.936117 |
6a7ca109-fa62-4ab6-8ad7-b86fdb2d7351 | Octo-Siddharth/TCS-NQT-Coding-Questions | 10_Cognizant/22_Swap_2_Numbers_3.cpp | //Program to swap two numbers using STL
#include<bits/stdc++.h>
using namespace std;
int main()
{
int n1, n2;
cin>>n1>>n2;
cout<<"Number 1 = "<<n1<<" Number 2 = "<<n2<<endl;
swap(n1, n2);
cout<<"Number 1 = "<<n1<<" Number 2 = "<<n2<<endl;
} | ALGO | 0.991864 | 4.634889 |
0d293a3e-7ed7-4743-812a-b5f5d1a75156 | Viktoria3-1-2021/Rekursia | Rekfib2/Rekfib2/Rekfib2.cpp | #include <iostream>
using namespace std;
void Fibonacci()
{
int N;
cout << " Введите количество чисел:" << endl;
cin >> N;
int a = 0, b = 1, c;
if (N == 0)
cout << a; //частный случай;
if (N == 1)
cout << a << " " << b; //частный случай;
if (N >= 2)
{
cout << a <... | ALGO | 0.999951 | 3.642386 |
a55ee4b5-bfa5-4ec0-a715-6a8009df9dbe | Balpreet1003/LeetCode | 1769-minimum-number-of-operations-to-move-all-balls-to-each-box/1769-minimum-number-of-operations-to-move-all-balls-to-each-box.cpp | class Solution {
public:
vector<int> minOperations(string boxes) {
int n = boxes.size();
vector<int> left(n, 0), right(n, 0), res(n, 0);
int count = (boxes.at(0) == '1' ? 1 : 0);
for (int i = 1; i < n; i++) {
left[i] = left[i - 1] + count;
count += (boxes.at(... | ALGO | 0.999996 | 6.143423 |
fa4bc1ac-a662-4cb4-bad4-941093f2bbc8 | zhihuiLiang/code-exe | multi_thread/pdu_cons_mutex.cpp | #include <thread>
#include <mutex>
#include <random>
#include <chrono>
#include <iostream>
using namespace std::literals;
struct Node
{
int val;
Node *next;
Node() = default;
Node(int data) : val(data), next(nullptr) {}
};
std::random_device rt;
std::mt19937 gen(rt());
std::uniform_int_distribution<>... | ALGO | 0.993245 | 4.805576 |
c09d0652-b01f-4342-85fd-95e75edc06b9 | prakharr5/ACMBMU_Hacktoberfest | laksh3.cpp | #include <iostream>
int main() {
// Declare and initialize two numbers
int num1 = 5;
int num2 = 10;
// Calculate the sum
int sum = num1 + num2;
// Display the result
std::cout << "The sum of " << num1 << " and " << num2 << " is: " << sum << std::endl;
return 0;
}
| ALGO | 0.997845 | 5.73593 |
c9dbafca-687d-4e6c-b92d-d7c5cceaedb5 | moemode/cs106b-assignments-w21 | Assignment 5/code/GUI/Core.cpp | #include "Core.h"
#include "BarrierGUI.h"
#include "GUIMain.h"
#include "ConsoleMain.h"
#include "EmptyProblemHandler.h"
#include "filelib.h"
#include <algorithm>
#include <map>
#include <set>
using namespace std;
/* Get all #defines out of the config file. */
#define RUN_TESTS_MENU_OPTION()
#define MENU_ORDER(...)
#d... | TOOL | 0.955726 | 6.716819 |
d85793dd-5f41-4273-a496-c396da31089d | Keep-Coding-Club/Algorithm | Kim-Seongyeong/0823_BOJ_2630.cpp | #include <iostream>
#include <stdio.h>
using namespace std;
int n;
int _map[128][128];
int blueCnt = 0, whiteCnt = 0;
void search(int x, int y, int len) {
int flag = _map[x][y];
for (int i = x; i < x+len; i++) {
for (int j = y; j < y+len; j++) {
if (flag != _map[i][j]) {
search(x, y, len / 2);
search(... | ALGO | 0.999032 | 4.328483 |
8a0dc150-8d0d-4ae5-9e36-6283fc02f370 | pbiggar/phc | src/optimize/ssi/ESSA.cpp | #include "optimize/ssa/HSSA.h"
#include "optimize/ssa/Phi.h"
#include "optimize/ssa/SSA_ops.h"
#include "optimize/wpa/Aliasing.h"
#include "optimize/wpa/Whole_program.h"
#include "optimize/Basic_block.h"
#include "optimize/Def_use_web.h"
#include "ESSA.h"
using namespace MIR;
ESSA::ESSA(Whole_program* wp, CFG* cfg)... | ALGO | 0.996227 | 6.052164 |
f7532d94-7fc9-4e0f-ab58-bde802f8c690 | yosukesan/traning | aizu/itp2/itp2_9_b/main.cpp |
#include <iostream>
#include <string>
#include <algorithm>
#include <set>
#include <cmath>
#include <vector>
#include <queue>
#include <unordered_set>
typedef long long ll;
const ll LL_MAX (1LL<<60);
#define rep(i,s,e) for(ll i=(s); i<(e); i++)
using namespace std;
int main()
{
cin.tie(0);
ios::sync_with_... | ALGO | 0.999896 | 3.306258 |
0534ab8f-819b-4848-8c00-4ee5b4fde5d2 | cayanide/WinterTraining | C++/Rough Code Snippets/insertAtHead.cpp | #include<iostream>
using namespace std;
class Node {
public:
int data;
Node* next;
Node(int data){
this->data=data;
this->next=NULL;
}
};
void insertAtHead(Node* &head, int d){
Node* temp=new Node(d);
temp->next=head;
head=temp;
}
void insertAtTail(Node* &head, int d) {
// ... | ALGO | 0.999592 | 3.642967 |
cb1e42b5-b571-43a3-b24e-2dd960bffdff | lttboy25/at_school | b4.cpp | #include <stdio.h>
#include <math.h>
int main() {
float distance,x1,y1,x2,y2;
printf("Nhap diem x1 y1 x2 y2\n");
scanf(" %f%f%f%f",&x1,&y1,&x2,&y2);
distance = sqrt(pow((x2-x1),2)+pow((y2-y1),2));
printf("Distance between the said points: %.4f",distance);
return 0;
} | ALGO | 0.998427 | 3.678653 |
f3ab4b83-6ef9-49c9-9eeb-194f63e71233 | SachithGAnchan/DSAcodes | slargest.cpp | #include<bits/stdc++.h>
using namespace std;
int slargestelement(vector<int> &arr,int n)
{
int largest=arr[0];
int slargest=INT_MIN;
for(int i=0;i<n;i++)
{
if(arr[i]>largest)
{
largest=arr[i];
}
}
for(int i=0;i<n;i++)
{
if(arr[i]>slargest && arr[i]... | ALGO | 0.999866 | 3.505982 |
16d43422-e99e-466f-98fc-3d5978a10689 | K1XE/LeetCode | 面经150/面经150p2/127.单词接龙.cpp | /*
* @lc app=leetcode.cn id=127 lang=cpp
*
* [127] 单词接龙
*/
// @lc code=start
#pragma once
#include <bits/stdc++.h>
#include <ranges>
using namespace std;
#pragma GCC optimize("Ofast,no-stack-protector,unroll-loops")
#define ALL(v) v.begin(), v.end()
#define For(i, _) for (int i = 0, i##end = _; i < i##end; ++i)
#d... | ALGO | 0.999964 | 5.780287 |
069dd4e0-ea56-463f-bd43-fbce1a460840 | NiranjanVpatil/Design-Ananlysis-Of-Algorithm | 305_Activity.cpp | // Design & Implement Activity Selection Problem using Greedy Approach.
# include<iostream>
using namespace std;
int partition(int a[],int s[],int f[],int m,int p);
void swap(int *a, int *b)
{
int temp;
temp = *a;
*a = *b;
*b = temp;
}
void quick_sort(int a[],int s[],int f[],int l, i... | ALGO | 0.99995 | 3.968648 |
508d1ca4-6722-4834-8e95-3d72bf37fe87 | RisshabSingla/LeetCode-C-Solutions | 719-find-k-th-smallest-pair-distance/find-k-th-smallest-pair-distance.cpp | class Solution {
public:
int countPairsWithinDistance(vector<int>& numbers, int targetDistance,
int n) {
int count = 0;
int left = 0;
for (int right = 1; right < n; right++) {
while (numbers[right] - numbers[left] > targetDistance) {
... | ALGO | 0.999995 | 6.191246 |
5d42fc56-82b6-4c95-b913-05b6dce5ace7 | 113bommy/deepmind_codecontests_refine | cpp_gold_filter_file/cpp_train_8918_7.cpp | #include <bits/stdc++.h>
int N, R;
int c[1 << 19];
int main() {
scanf("%d%d", &N, &R);
long long c_sum = 0;
for (int i = 0; i < (1 << N); i++) {
scanf("%d", &c[i]);
c_sum += c[i];
}
printf("%.10f\n", (double)c_sum / (1 << N));
for (int i = 0; i < R; i++) {
int z, g;
scanf("%d%d", &z, &g);
... | ALGO | 0.999512 | 3.115788 |
5cb679e8-fd0d-4382-98c6-e210ac396fe2 | GrangerHub/Stellar-Prey | source/game-logic/libs/bullet-2.80-rev2531/src/BulletSoftBody/btSoftRigidCollisionAlgorithm.cpp | #include "btSoftRigidCollisionAlgorithm.h"
#include "BulletCollision/CollisionDispatch/btCollisionDispatcher.h"
#include "BulletCollision/CollisionShapes/btSphereShape.h"
#include "BulletCollision/CollisionShapes/btBoxShape.h"
#include "BulletCollision/CollisionDispatch/btCollisionObject.h"
#include "btSoftBody.h"
#inc... | ALGO | 0.997314 | 4.667078 |
5d4825c4-b22b-4cc7-9a50-c71a2be22eb6 | swordartyb201/tunguyen-homework-c4e53 | session 1/Untitled-2.cpp | #include <iostream>
#include <math.h>
using namespace std;
int main() {
int n,i;
float s=0;
cout<<"Nhap vao so nguyen n:"<<endl;
cin>>n;
if (n<5,n>100){
cout<<"Nhap lai so nguyen n:"<<endl;
cin>>n;
}
for (i=1;i<=n;i++){
s=sqrt(s+i*i);
cout<<"Tong day so la:"<<s<<endl;
}
return 0;
}
| ALGO | 0.996941 | 3.07651 |
2f251e59-cd0f-4c0f-83fa-54a184e3c342 | 113bommy/deepmind_codecontests_refine | cpp_source_filter_file/cpp_train_4634_13.cpp | #include <bits/stdc++.h>
using namespace std;
int main() {
string s;
cin >> s;
int j = 0;
string t = "hello";
bool b = false;
for (int i = 0; i < s.size(); i++) {
if (s[i] == t[j]) j++;
if (j == t.size() - 1) {
b = true;
break;
}
}
if (b)
cout << "YES";
else
cout << "NO... | ALGO | 0.999902 | 3.437236 |
55e3aee0-d4aa-4212-bde6-13b07fdd1d5b | hemant467/Leet-Code | 📟 Codes 📝/Binary tree inorder traversal.cpp | //The below code implements an iterative solution to perform an inorder traversal of a binary tree.
/**
* 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),... | ALGO | 0.999999 | 7.427633 |
8dd2f0e1-f2cc-46bf-8bb0-3719f08e5b01 | 0xUvaish/LeetHub | 0592-fraction-addition-and-subtraction/0592-fraction-addition-and-subtraction.cpp | class Solution
{
public:
string fractionAddition(string s)
{
int n = s.size();
int i = 0;
int nume = 0;
int deno = 1;
while (i < n)
{
int currN = 0;
int currD = 0;
bool neg = (s[i... | ALGO | 0.999934 | 5.504318 |
9765f340-b5ac-43bf-af8c-8bed74f07d02 | aamirhannan/AZPremiumB3 | color_it.cpp | #include <bits/stdc++.h>
using namespace std;
#define endl '\n'
#define int long long
const int MOD = 1e9 + 7;
const int INF = LLONG_MAX >> 1;
int binary_search_lower(const vector<int>& arr, int target) {
int left = 0, right = arr.size() - 1;
int result = -1;
while (left <= right) {
int mid = left + (right - l... | ALGO | 0.999939 | 4.990597 |
de66f0f5-1702-4f9b-a88c-b27598bf7585 | shaon-cse/DSA-Learning | Pattern/fourthPattern.cpp | /*
*
* *
* * *
* * * *
* * * * *
*/
#include<iostream>
using namespace std;
int main(){
int n;
cout<<"Enter the size of the pattern: ";
cin>>n;
int i=1;
while(i<=n){
int j=1;
while(j<=i){
cout<<"* ";
j+=1;
}
cout<<endl;
i+=1;
}... | ALGO | 0.999765 | 3.906989 |
cfd9cb99-a52b-405e-8792-d13f6bfb5db4 | 113bommy/deepmind_codecontests_refine | cpp_gold_filter_file/cpp_train_11613_18.cpp | #include <bits/stdc++.h>
using namespace std;
int n, m, p;
int chest[305][305];
vector<pair<int, int> > record[90005];
long long dp[305][305];
int xp, yp;
void input() {
scanf("%d %d %d", &n, &m, &p);
for (int i = 1; i <= n; i++)
for (int j = 1; j <= m; j++) {
scanf("%d", &chest[i][j]);
if (chest[i]... | ALGO | 0.999849 | 3.634149 |
26466b39-825a-40ea-bfe2-99ca47ba7b5d | FanniBelics/Spline-surfaces | Spline-surfaces/nurbs.cpp | #include "nurbs.h"
std::vector<std::vector<Point3D>> NURBSSurface(const std::vector<std::vector<Point3D>>& controlGrid, int uResolution, int vResolution, int uDegree, int vDegree, bool isClamped) {
int n = controlGrid.size();
int m = controlGrid[0].size();
if (uDegree >= n || vDegree >= m) {
throw... | ALGO | 0.998133 | 5.897283 |
fc4b4158-aa81-4c1b-8572-62c9ccb88621 | oxygen-hunter/Flashboom | data/big-vul-100/add_attention_code/CodeLlama/top0-100/shortest-path-visiting-all-nodes-Solution.shortestPathLength/177796_Overflow.cpp | static int nfs_readlink_req(struct nfs_priv *npriv, struct nfs_fh *fh,
char **target)
{
uint32_t data[1024];
uint32_t *p;
uint32_t len;
struct packet *nfs_packet;
/*
* struct READLINK3args {
* nfs_fh3 symlink;
* };
*
* struct READLINK3resok {
* post_op_attr symlink_attributes;
* nfspath3 d... | ALGO | 0.997312 | 3.659355 |
57224dec-4012-4365-a0f0-d0468e0648c8 | gemmychen1406/CodePTIT---THCS-2 | Ma_tran_xoan_oc_fi.cpp | #include <stdio.h>
#include <math.h>
#include <string.h>
long long fi(long long x){
if (x == 1) return 0;
if (x == 2) return 1;
if (x > 2) return fi(x - 1) + fi(x - 2);
}
int main () {
int n;
scanf("%d", &n);
int a[n][n];
int k = 1;
for (int i = 0; i <= n/2; i++){
for (int j = i; j < n - i - 1; j++){
a[i][... | ALGO | 0.999889 | 3.127445 |
087fe405-4976-4e1f-a0c9-01df8d5e4090 | ashokpplayer/Convex-Hull | Graham.cpp | #include <iostream>
#include <stack>
#include <stdlib.h>
using namespace std;
struct Point
{
int a, b;
};
Point P0;
Point nextToTop(stack<Point> &S)
{
Point P = S.top();
S.pop();
Point res = S.top();
S.push(P);
return res;
}
int swap(Point &P1, Point &P2)
{
Point temp = P1;
P1 = P2;
... | ALGO | 0.999995 | 5.02212 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.