uuid string | repo_name string | relative_path string | content string | category string | algo_rel_score float64 | quality_score float64 |
|---|---|---|---|---|---|---|
49bb4356-c10a-4ae9-aedf-161e04bc5ff1 | Xue-Chenyang/Competitive-Programming | Codeforce/Pairs.cpp | #pragma warning( disable : 4996 )
#define _USE_MATH_DEFINES
#include <bits/stdc++.h>
#include <unordered_set>
#include <math.h>
using namespace std;
void fast() {
ios_base::sync_with_stdio(false);
cin.tie(NULL);
}
int lsone(int l) {
return l & (-1 * l);
}
#define s(a) sort(a.begin(), a.end())
#define u(a... | ALGO | 0.999095 | 3.985272 |
841acb88-4a6e-48b3-8fdf-619e68b3a68f | yaap/system_core | libutils/JenkinsHash.cpp | /* Implementation of Jenkins one-at-a-time hash function. These choices are
* optimized for code size and portability, rather than raw speed. But speed
* should still be quite good.
**/
#include <stdlib.h>
#include <utils/JenkinsHash.h>
namespace android {
#ifdef __clang__
__attribute__((no_sanitize("integer")))
... | ALGO | 0.984629 | 7.082112 |
9f97ed58-6d36-46eb-9da4-d5cbe5760a3a | stefanseefeld/openvsip | benchmarks/expr/vma.cpp | /// Description
/// Benchmark for fused multiply-add and variants such as axpy.
#include <iostream>
#include <vsip/initfin.hpp>
#include <vsip/support.hpp>
#include <vsip/math.hpp>
#include <vsip/random.hpp>
#include "../benchmark.hpp"
using namespace vsip;
/*******************************************************... | ALGO | 0.903534 | 6.733113 |
74e61010-120c-4d79-8f1b-6beb1fc7e70a | CodeRedModding/UnrealEngine3 | Development/Src/D3D9Drv/Src/D3D9Drv.cpp | #include "D3D9DrvPrivate.h"
FLOAT FD3D9EventNode::GetTiming()
{
FLOAT Result = 0;
if (Timing.IsSupported())
{
// Get the timing result and block the CPU until it is ready
const QWORD GPUTiming = Timing.GetTiming();
const QWORD GPUFreq = Timing.GetTimingFrequency();
Result = DOUBLE(GPUTiming) / DOUBLE(GPUF... | TOOL | 0.867951 | 5.677382 |
9194f15e-6885-4af4-9e8e-def67fe63079 | ishandutta2007/codeforces | pechalka/normal/1201/B.cpp | #include <iostream>
#include <vector>
#include <algorithm>
#include <iomanip>
#include <tuple>
#include <map>
using namespace std;
int main(){
int n;
cin >> n;
long long mx = 0, sum = 0;
for (int i = 0; i < n; ++i){
long long x;
cin >> x;
mx = max(mx, x);
sum += x;
}
if (sum >= 2 * mx &&... | ALGO | 0.999898 | 4.294424 |
06933c68-c9a3-414b-8375-f01a5398b574 | sia162/LeetcodeQuestions | k largest elements - GFG/k-largest-elements.cpp | //{ Driver Code Starts
#include <bits/stdc++.h>
using namespace std;
// } Driver Code Ends
//User function template for C++
class Solution{
public:
vector<int> kLargest(int arr[], int n, int k) {
// code here
priority_queue<int> pq;
for(int i=0;i<n;i++) pq.push(arr[i]);
vector<int> a... | ALGO | 0.999975 | 5.778246 |
d5717d43-77ba-43cc-8f34-b972c5a16e3c | Geof23/Gklee | Gklee/lib/Solver/Solver.cpp | #include "klee/Solver.h"
#include "klee/SolverImpl.h"
#include "SolverStats.h"
#include "STPBuilder.h"
#include "klee/Constraints.h"
#include "klee/Expr.h"
#include "klee/TimerStatIncrementer.h"
#include "klee/util/Assignment.h"
#include "klee/util/ExprPPrinter.h"
#include "klee/util/ExprUtil.h"
#include "klee/Intern... | ALGO | 0.998459 | 7.843274 |
cb420065-dfaa-483d-b1df-904bbca1c47d | vherawidatama/device_marble_superior | libinit/libinit_utils.cpp | #define _REALLY_INCLUDE_SYS__SYSTEM_PROPERTIES_H_
#include <sys/_system_properties.h>
#include <vector>
#include <libinit_utils.h>
void property_override(std::string prop, std::string value, bool add) {
auto pi = (prop_info *) __system_property_find(prop.c_str());
if (pi != nullptr) {
__system_propert... | TOOL | 0.883501 | 6.086472 |
bf4bfad1-5a88-420b-b6dd-fe4152124cee | lut1y/Stephen_Prata_Ansi_C_plusplus-6thE-Code-Example-and-Answers | Chapter 5/equal.cpp | // equal.cpp --
#include <iostream>
int equal()
{
using namespace std;
int quizscores[10] =
{ 20, 20, 20, 20, 20, 19, 20, 18, 20, 20};
cout << "Doing it right:\n";
int i;
for (i = 0; quizscores[i] == 20; i++)
cout << "quiz " << i << " is a 20\n";
// : , ,
// .
cout <<... | TOOL | 0.969795 | 3.893317 |
7d76d9db-326e-43de-a5c3-8ea4a81cf368 | suzii21/12jun_suzan_native | module-4/assignment/QUE-17.cpp | //Write a program of to swap the two values using templates
#include <iostream>
using namespace std;
template <typename T>
int swap(T& a, T& b)
{
T temp = a;
a = b;
b = temp;
}
int main()
{
int a, b;
std::cout << "Enter two numbers: ";
std::cin >> a >> b;
std::cout << "Before swap: a = " ... | ALGO | 0.996977 | 5.995817 |
fc8cff34-efe3-4a61-b6d1-69d6bff1bba3 | jcazevedo/leetcode | src/2331-evaluate-boolean-binary-tree.cpp | // 2331. Evaluate Boolean Binary Tree
// https://leetcode.com/problems/evaluate-boolean-binary-tree/
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, T... | ALGO | 0.999816 | 6.602194 |
aff46c75-79fa-4b3a-9cd9-eba227746ab9 | sergiioo101/Coleccion-de-Ejercicios-Libreria-estandar-de-C | Ejercicio2/2b.cpp | #include <string.h>
#include <stdio.h>
int main() {
// Cadena de caracteres
char str[] = "Hola mundo";
// Calcular la longitud de la cadena utilizando strlen()
int length = strlen(str);
// Mostrar la longitud de la cadena
printf("La longitud de '%s' es: %d\n", str, length);
return 0;
}
| TOOL | 0.934764 | 3.969938 |
cbb2c3b8-44e8-4a9c-aefc-226dde91e138 | adityapadwal/Data-Structures-And-Algorithms | CodeHelp-DSA-Busted-Series/Lecture022 Strings/replaceSpaces.cpp | #include<string>
#include<iostream>
using namespace std;
string replaceSpaces(string &str){
string temp = "";
for(int i=0; i<str.length(); i++) {
if(str[i] == ' '){
temp.push_back('@');
temp.push_back('4');
temp.push_back('0');
}
else
{
... | ALGO | 0.999118 | 3.146908 |
dd85050b-34c9-4f71-8ee5-e026c1200b7a | sukhleen-kaur-27/Striver-sde-challenge-questions | missing and repeating number.cpp | // no main function created;
int xorr=0;
for(int i=0;i<n;i++){
xorr = xorr ^ arr[i];
xorr = xorr ^ (i+1);
}
int bitNum = 0;
while (true){
if( (xorr & (1<<bitNum)) !=0){
break;
}
bitNum++;
}
int one = 0;
int zero = 0;
for(int i=0;i<n;i++){
if(arr[i] & (1<<bitNum) !=0){
one = one ^ arr[i];
}
... | ALGO | 0.999867 | 4.098696 |
69876001-7538-4e23-8985-969520e8170c | gan-ta/Algorithm | programmers/방문길이.cpp | #include <cstdio>
#include <string>
using namespace std;
int map[20][20];
int answer = 0;
typedef struct info {
int r;
int c;
}info;
info up_action(info info) {
int nr = info.r - 1;
int nc = info.c;
if (nr < 0 || nr > 10 || nc < 0 || nc > 10) return info;
if ((map[info.r][info.c] & 1) == 0) {
map[info.r][i... | ALGO | 0.999453 | 3.538349 |
fdf3a756-a1aa-4ba4-b547-a4027c2e88c0 | wisakejjak/study | src/cpp_sort/cocktail_shaker_sort.cpp | #include <cmath>
#include <climits>
#include <iostream>
int cocktail_shaker_sort(int* pArray, int startArray, int arraySize){
return 0;
}
int main (){
int arraySize;
std::cin >> arraySize; //size of array
int* pArray = new int [arraySize]; //allocate the memory
for(int i = 0; i < arraySize; i++){ //a... | ALGO | 0.996143 | 4.582531 |
b456d72e-dc78-453c-bde0-ea7127aecd57 | fhajji/ntl | src/pd_FFT.cpp |
// The configure script should define NTL_FP_CONTRACT_OFF
// for icc via the NOCONTRACT variable
#ifdef NTL_FP_CONTRACT_OFF
#pragma fp_contract(off)
#endif
#include <NTL/tools.h>
#ifdef NTL_ENABLE_AVX_FFT
// The configure script tries to prevent this, but we
// double check here. Note that while it is strongly
//... | ALGO | 0.999216 | 4.292642 |
d2c7d61c-922c-4020-8d78-fc4a49f0865c | waris8/cpp | leetcodeNew/src/MergeTwoLists.cpp | #include <iostream>
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) {}
};
ListNode* mergeTwoLists(ListNode* list1, ListNode* list2) {
ListNode* outputHead;
... | ALGO | 0.999633 | 5.599175 |
2dcd3f98-dedc-4922-bc8d-bc85daa0a411 | MXXXXLi/leetcode-C- | code/offer_24_reverse_list_2.cpp | class Solution {
public:
ListNode* reverseList(ListNode* head) {
if(!head) return NULL;
if(!head->next) return head;
ListNode* pre = nullptr;
ListNode* cur = head;
while(cur)
{
//cout<<pre->val<<endl;
ListNode* nex = cur->next;
cur-... | ALGO | 0.999523 | 5.354632 |
8c393d6c-7b93-4d2c-96f4-657930241824 | KrzysiekPWr/designing-effective-algorithms-lab | project1/cityMatrix.cpp | //
// Created by krisk on 12/10/2024.
//
#include "cityMatrix.h"
#include <fstream>
#include <iostream>
cityMatrix::cityMatrix(int size) {
this->size = size;
this->matrix = new int*[size];
for(int i = 0; i < size; i++) {
this->matrix[i] = new int[size];
}
}
cityMatrix::cityMatrix() {
thi... | TOOL | 0.8631 | 3.984276 |
4f7db02d-62d9-4387-9a17-f09d24f8afca | raincross7/code-similarity | codes/train_code/problem414/problem414_364.cpp | //Love and Freedom.
#include<algorithm>
#include<cstring>
#include<cmath>
#include<cstdio>
#define inf 20021225
#define ll long long
#define N 100010
using namespace std;
int read()
{
int f=1,s=0; char ch=getchar();
while(ch<'0'||ch>'9'){if(ch=='-') f=-1; ch=getchar();}
while(ch>='0'&&ch<='9') s=s*10+ch-'0',ch=getch... | ALGO | 0.999994 | 3.679405 |
7084e241-2ba8-43e8-b983-dec568bf3916 | denise813/vbox | src/VBox/Additions/3D/mesa/mesa-21.3.8/src/intel/compiler/brw_predicated_break.cpp | #include "brw_shader.h"
using namespace brw;
/** @file brw_predicated_break.cpp
*
* Loops are often structured as
*
* loop:
* CMP.f0
* (+f0) IF
* BREAK
* ENDIF
* ...
* WHILE loop
*
* This peephole pass removes the IF and ENDIF instructions and predicates the
* BREAK, dropping two instru... | TOOL | 0.946726 | 7.630389 |
7cbb7212-cb62-40a1-b8f3-015f2a64d50a | ptong2556/starling | src/utils.cpp | #include "utils.h"
#include <stdio.h>
const uint32_t MAX_REQUEST_SIZE = 1024 * 1024 * 1024; // 64MB
const uint32_t MAX_SIMULTANEOUS_READ_REQUESTS = 128;
#ifdef _WINDOWS
#include <intrin.h>
// Taken from:
// https://insufficientlycomplicated.wordpress.com/2011/11/07/detecting-intel-advanced-vector-extensions-avx-in... | TOOL | 0.988045 | 6.527309 |
d842425a-1d18-447e-9ba4-21078b47fe0a | ShivzSingh/6Companies30days | 0239-sliding-window-maximum/0239-sliding-window-maximum.cpp | class Solution {
public:
vector<int> maxSlidingWindow(vector<int>& nums, int k) {
vector<int> ans;
int n = nums.size();
if(n < k){
ans.push_back(*max_element(nums.begin() , nums.end()));
return ans;
}
deque<int> q;
int i = 0 , j = 0;
wh... | ALGO | 0.99999 | 5.956967 |
17b712af-b3ff-4301-90dc-1b8840dd0f21 | Mokuroh54/Comp_Prog | CSES/Sort Search/1641_Sum_of_Three_Values.cpp | /*
___
(o,o)
< . >
--"-"---
Rowlet is orz
*/
#include <iostream>
#include <algorithm>
#include <vector>
#include <cmath>
#include <set>
#include <map>
#include <deque>
#include <queue>
#include <stack>
#include <unordered_set>
#include <unordered_map>
#include <bitset>
#include <cstring>
#include <cassert>
using n... | ALGO | 0.999954 | 3.624771 |
9303f7de-c53c-426e-b629-c884af484684 | cyrilggg/ACM | problem/Daily/2022/5/19/792/C.cpp | #include <bits/stdc++.h>
using namespace std;
#define int long long
//#define endl '\n'
#define returnNo return void(puts("No"))
#define returnYes return void(puts("Yes"))
template<typename A, typename B> ostream& operator<<(ostream &os, const pair<A, B> &p) { return os << '(' << p.first << ", " << p.second << ')'; }
... | ALGO | 0.99991 | 3.68506 |
9379d3cb-b5b3-41df-bf4c-6849fe03bdf5 | talhaarshad7/Advanced-Topics | 9) Two Pointers/longest-subarray-with-k-distinct.cpp | #pragma GCC optimize("Ofast")
#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,avx2,fma")
#pragma GCC optimize("unroll-loops")
#include <bits/stdc++.h>
#include <complex>
#include <queue>
#include <set>
#include <unordered_set>
#include <list>
#include <chrono>
#include <random>
#include <iostream>
#incl... | ALGO | 0.999901 | 5.560636 |
f58f3967-1a14-436c-ad05-1d7d976bd4cd | alexandru-andronache/adventofcode | 2021/day17/main.cpp | #include "file.h"
#include "utilities.h"
#include <iostream>
#include <vector>
namespace aoc2021_day17 {
int part_1(std::string_view path) {
std::string input = file::readFileAsString(path);
std::vector<std::string> tokens = utils::splitString(input, " : =.,");
int startX = std::stoi(tokens... | ALGO | 0.996265 | 6.928038 |
47cbe391-c3eb-462d-aa1f-6b505bbe230b | AryanNanda17/Consistent_cpp | HackerCup_Practice_round/CheeseBurger.cpp | #include<iostream>
#include<fstream>
using namespace std;
int main(){
fstream output;
output.open("Cheeseburger_output.txt",ios::out);
int t;
cin>>t;
for(int i=1;i<=t;i++){
int S, D, K;
cin>>S>>D>>K;
int flag=0;
int bun = (S+D)*2;
int ingridents = (S*2) + (D*... | ALGO | 0.999569 | 3.843399 |
c5174b01-b102-4005-b09f-25517247b0a6 | Zhang-Wen-chao/Computer-Systems | C++/代码随想录/Dynamic_Programming/knapsack_problem/474. Ones and Zeroes.cpp | // 474. Ones and Zeroes
// https://leetcode.com/problems/ones-and-zeroes/
#include <iostream>
#include <vector>
#include <string>
#include <algorithm>
int findMaxForm(std::vector<std::string>& strs, int m, int n) {
int size = strs.size();
std::vector<std::vector<int>> dp(m + 1, std::vector<int>(n + 1, 0));
... | ALGO | 0.999906 | 6.756996 |
5358a338-3d2e-486e-9e31-7431e93a7126 | jaredramey/AutomationTest_Playground | Engine/Source/ThirdParty/Intel/TBB/IntelTBB-2019u8/examples/parallel_for/tachyon/src/box.cpp | /*
* box.cpp - This file contains the functions for dealing with boxes.
*/
#include "machine.h"
#include "types.h"
#include "macros.h"
#include "box.h"
#include "vector.h"
#include "intersect.h"
#include "util.h"
int box_bbox(void * obj, vector * min, vector * max) {
box * b = (box *) obj;
*min = b->min;
*... | ALGO | 0.898573 | 6.734089 |
c5ec8ce5-7bf8-4146-9104-a93159adaee0 | hungp1601/BTL-ASM | TC/EXAMPLES/DICTION.CPP | // diction.cpp: Implementation of the Dictionary class
// from Hands-on C++
#include "diction.h"
int Dictionary::find_word(char *s)
{
char word[81];
for (int i = 0; i < nwords; ++i)
if (stricmp(words[i].get_word(word),s) == 0)
return i;
return -1;
}
void Dictionary::add_def(char *word, char... | TOOL | 0.926846 | 5.138919 |
c681059a-681e-41cf-988f-68ff14e9afaa | matthewslouismarie/insidertrading | Library/BribedEmployee.cpp | #include "BribedEmployee.h"
#include <set>
#include "Sec.h"
namespace it
{
void BribedEmployee::updateTarget()
{
for (auto n : allNodes_) {
delete n;
}
std::set<Node *> openList;
std::set<Node *> closedList;
Node * node (createNode (position_, nullptr));
openList.insert (node);
... | ALGO | 0.973826 | 4.97224 |
47504318-e9d9-430f-8ca8-323ddee3943f | yaqubov91/my_leet_solutions | 141_Linked_List_Cycle.cpp | /**
* Definition for singly-linked list.
* struct ListNode {
* int val;
* ListNode *next;
* ListNode(int x) : val(x), next(NULL) {}
* };
*/
class Solution {
public:
bool hasCycle(ListNode *head) {
if(head==NULL)
return false;
if(head->next ==NULL)
return f... | ALGO | 0.999788 | 5.25964 |
b3b30828-1ae6-4433-a310-94ef22a8a2e6 | zhu-hu/Final_OSM_Navigation | perception_all/lidar_perception/src/object_segmentation/object_segmenter.cpp | #include "object_segmentation/object_segmenter.h"
ObjectSegmenter::ObjectSegmenter(const ObjectSegmenterParams& params) {
params_ = params;
}
void ObjectSegmenter::Segmenter(const cv::Mat& grid_map,
const cv::Mat& max_height_map,
const cv::Mat& min_hei... | ALGO | 0.993042 | 6.812777 |
f1f2c30e-d67c-4da5-8b7d-c94560f44869 | ishandutta2007/codeforces | xuanyi/normal/1329/B.cpp | #include<bits/stdc++.h>
#define D(...) fprintf(stderr,__VA_ARGS__)
#define int long long
#define LL long long
#define MP make_pair
#define PB push_back
#define fi first
#define se second
#define ALL(x) (x).begin(),(x).end()
#define SZ(x) ((int)(x).size())
#define rep(i,a,b) for(int i=(a);i<=(b);++i)
#define per(i,a,b) ... | ALGO | 0.999791 | 3.987975 |
3aadf127-7c74-474e-a86b-cc3dfb08db22 | lzyrapx/Algorithmic_Template | Mathematics/CRT(模数互质).cpp |
//Chinese-Remainder-Theorem
// 模必须互质
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
// a solution of ax + by = gcd(a, b)
void extend_Euclid(ll a, ll b, ll *x, ll *y, ll *g)
{
if(a == 0)
{
*x = 0, *y = 1 , *g = b;
return;
}
ll x1,y1;
extend_Euclid(b%a, a, &x1, &y1, g);
*x = y1 - (b/a)*x1... | ALGO | 0.999993 | 4.18985 |
e51820e7-1720-4073-8834-693a87657f8a | Darshanpakhale26/Basic-Codes | prime_number.cpp | // Program given number is prime or not
// #include <iostream>
// using namespace std;
// int main() {
// int n;
// bool isPrime = true;
// cout << "Enter a positive integer: ";
// cin >> n;
// if (n == 0 || n == 1) { // 0 and 1 are not prime numbers
// isPrime = false;... | ALGO | 0.999711 | 4.256631 |
b7f2258d-e1a1-4179-9a6c-e69206b18642 | DatouNie/cworkspace | survival.cpp | /*************************************************************************
> File Name: survival.cpp
> Author: Datou_Nie
> Mail: <EMAIL>
> Created Time: 2017年08月12日 星期六 15时54分55秒
************************************************************************/
#include<iostream>
using namespace std;
int main()
{
int ... | ALGO | 0.999666 | 3.330458 |
2f10791b-c0a7-4674-8b44-136694335e18 | Melodiz/dailycode | Algorithms/some_intern_contests/tinkoff_winter/task_6/test.cpp | #include <iostream>
#include <vector>
#include <random>
#include <chrono>
#include <algorithm>
using namespace std;
struct Point {
long long x, y;
};
// Declare the solve function (implementation not shown)
int solve(int n, const vector<Point>& points);
void test_random_inputs(int num_tests) {
const int MAX... | ALGO | 0.998935 | 6.228899 |
88ae4695-94c6-4bff-b507-1c6f9553e5c8 | jerry950208/Programmers | Programmers_C++/Level 1/위클리_챌린지/2주차_상호평가.cpp | #include <string>
#include <vector>
#include <algorithm>
using namespace std;
string solution(vector<vector<int>> scores){
string answer = "";
vector<int>sum(scores.size(), 0);
vector<int>avg(scores.size(), 0);
for(int i=0; i<scores.size(); i++){
int max_score = -1;
i... | ALGO | 0.999659 | 5.871937 |
6a10b094-c793-4951-a534-966ac39e5653 | thegreatwhite0801/Leetcode-Questions | 0242-valid-anagram/0242-valid-anagram.cpp | class Solution {
public:
bool isAnagram(string s, string t) {
unordered_map<char,int>map1 ;
unordered_map<char,int>map2 ;
for(char& c : s){
map1[c]++ ;
}
for(char&c : t){
map2[c]++;
}
if(map1==map2){
return true ;
}
... | ALGO | 0.999978 | 5.590527 |
2f961d7b-6107-4d0d-b188-c01b51c104f7 | Achira16/My_codes | next_perm.cpp | #include<bits/stdc++.h>
using namespace std;
/* To find all permutations of a sequence of numbers, we go from ascending order to descending order. Therefore to find the next
permuation, we check for the index from the end that deviates from the descending order(we search from the end as we want to maintain
the lexicog... | ALGO | 0.999983 | 4.852076 |
59554e07-0d28-4891-b867-2970a448f4f8 | Sumra-siddiqui/Sumra | 16,program to print multiplication table of a given number.cpp | #include<iostream>
using namespace std;
int main() //printing multiplication table of a number.
{
int i,n,m;
cout<<"Enter a number: ";
cin>>n;
cout<<"Multiplication Table of "<<n<<" is "<<endl;
for(i=1;i<=10;i++)
{
m=n*i;
cout<<n<<" * "<<i<<" = "<<m<<endl;
}
return 0;
}
| ALGO | 0.996288 | 3.26697 |
d200a5d1-19d1-4760-87d3-d75d7225fb2e | NikhilK06/Leet | solutions/1007. Minimum Domino Rotations For Equal Row/1007.cpp | class Solution {
public:
int minDominoRotations(vector<int>& A, vector<int>& B) {
const int n = A.size();
vector<int> countA(7);
vector<int> countB(7);
vector<int> countBoth(7);
for (int i = 0; i < n; ++i) {
++countA[A[i]];
++countB[B[i]];
if (A[i] == B[i])
++countBoth[... | ALGO | 0.999988 | 6.16605 |
0545c9d8-f6ed-426b-b1b9-3baa834b69c4 | MakinoRuki/Codeforces | R905/1888D.cpp | #include <iostream>
#include <cstdio>
#include <cstring>
#include <vector>
#include <algorithm>
#include <unordered_map>
#include <cmath>
#include <set>
#include <map>
#include <queue>
#include <random>
#include <ctime>
#include <list>
#define N 1000005
#define M 635
#define eps 1e-7
using namespace std;
typedef long l... | ALGO | 0.999963 | 3.500614 |
68b92cec-82a7-4655-8873-7b351835ee6c | shakib071/Solved-Problem | A_Quasi_palindrome.cpp | #include<bits/stdc++.h>
using namespace std;
int main(){
string s;
cin>>s;
// cout<<s;
int end=s.size()-1;
// cout<<end<<endl;
while(s[end]=='0'){
end--;
}
int n=end+1;
bool ans=true;
for(int i=0;i<(n/2);i++){
if(s[i]!=s[n-1-i]) ans=false;
}
if(an... | ALGO | 0.999822 | 4.284974 |
49c65004-7b81-470a-aecd-52c372bcda2e | geckods/CodeChef | ICL19/toomanycandies.cpp | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
int main(){
#ifndef ONLINE_JUDGE
freopen("input", "r", stdin);
freopen("output", "w", stdout);
#endif
int t;
cin>>t;
ll n,m,k;
ll abc;
bool done;
for(int test=0;test<t;test++){
cin>>n>>m>>k;
abc = n%... | ALGO | 0.999881 | 3.716942 |
57145469-559e-4f7e-97a1-8bd2cd11c7d8 | hkcs1206/OACP-Assignment | Assignment 6/12 Maximum Flow/MaximumFlow.cpp | /*
Problem Name: Maximum Flow
Author: Vineet Motwani
*/
#include <bits/stdc++.h>
using namespace std;
#define int long long
#define MOD 1000000007
#define vll vector<int>
int n;
bool bfs(vector<vll>& rG, int s, int t, int pp[]) {
bool vis[n+1] = {0};
queue<int> q;
q.push(s);
vis[s] = 1;
pp[s] = -1;
whi... | ALGO | 0.999676 | 4.316576 |
983edf86-1b60-4d21-993a-4064272c9c6b | wakewakame/GravityDesktop | Box2D/Box2D/Box2D/Dynamics/b2Island.cpp | #include "Box2D/Collision/b2Distance.h"
#include "Box2D/Dynamics/b2Island.h"
#include "Box2D/Dynamics/b2Body.h"
#include "Box2D/Dynamics/b2Fixture.h"
#include "Box2D/Dynamics/b2World.h"
#include "Box2D/Dynamics/Contacts/b2Contact.h"
#include "Box2D/Dynamics/Contacts/b2ContactSolver.h"
#include "Box2D/Dynamics/Joints/b2... | ALGO | 0.999964 | 4.619961 |
73571515-3556-4a25-a04b-d7250e84d87a | lucasjoviniano/capivalivro | code/c++/ternary_search.cpp | double ternary_search(double l, double r) {
double eps = 1e-9; // limite para comparação de floats
// podemos, ao invés de comparar por diferença, usar uma quantidade fixa
// 200 a 300 deve ser o suficiente
while (r - l > eps) {
double m1 = l + (r - l) / 3;
double m2 = r - (r - l) / 3;
double f1 = f... | ALGO | 0.999992 | 4.927242 |
2cb519e4-1367-421b-87d8-55129065b509 | sarvex/leetcode-clojure | solution/0900-0999/0904.Fruit Into Baskets/Solution.cpp | class Solution {
public:
int totalFruit(vector<int>& fruits) {
unordered_map<int, int> cnt;
int j = 0, n = fruits.size();
for (int& x : fruits) {
++cnt[x];
if (cnt.size() > 2) {
int y = fruits[j++];
if (--cnt[y] == 0) cnt.erase(y);
... | ALGO | 0.999968 | 6.26123 |
532bbd66-c24b-439e-8bb4-0b84c4d4819e | ArtemPustunniy/ITMO_Algorithms | lab №3/11.cpp | #include <iostream>
using namespace std;
struct Node {
Node *contact;
Node() {
contact = nullptr;
}
};
int Has_Cycle(Node *head){
Node *tortoise = head;
Node *hair = head;
while (true) {
int count = 1;
if (hair->contact == nullptr || tortoise->contact == nullptr) {
... | ALGO | 0.999788 | 4.053654 |
9ebe0163-155e-4c56-b84a-35b411f4bd15 | ishani/Oddity | Oddity/Core/disp_meta.cpp | /*
__ ___ __
____ ____/ /___/ (_) /___ __
/ __ \/ __ / __ / / __/ / / / [ LED matrix VFX core ]
/ /_/ / /_/ / /_/ / / /_/ /_/ /
\____/\__,_/\__,_/_/\__/\__, / [ john & harry ] [ 2012 ]
/____/
*/
#include "oddity.h"
#include "vfx.h... | TOOL | 0.96814 | 4.661531 |
efffa37e-106a-4652-9ccb-343aa1ff332e | anishgupta675/FINAL450 | Heap/Median_in_a_stream_of_Integers/main.cpp | // { Driver Code Starts
#include <bits/stdc++.h>
using namespace std;
// } Driver Code Ends
class Solution
{
public:
priority_queue<int> left;
priority_queue<int, vector<int>, greater<int> > right;
//Function to insert heap.
void insertHeap(int &x)
{
if(right.size()==0) right.push(x)... | ALGO | 0.999985 | 5.64881 |
485c2414-5c81-4c00-8713-13c06a12eee7 | maltanar/fpga-booleanring-bfs | dense-frontier/driver/HardwareBFSManager.cpp | #include "HardwareBFSManager.h"
#include <string.h>
#include <iostream>
using namespace std;
HardwareBFSManager::HardwareBFSManager(unsigned int * inputRegs,
unsigned int * outputRegs) {
m_graphMan = 0;
m_bfsDistance = 0;
m_distanceVector = 0;
m_inputVector = 0;
m_inputVectorWordCount = 0;
m_deallocateBitmap ... | ALGO | 0.987145 | 4.474049 |
deb28687-f5bf-4ddb-bc7f-ea7a980cf0a0 | raincross7/code-similarity | codes/train_code/problem474/problem474_79.cpp | #include <iostream>
#include <vector>
#include <algorithm>
#include <map>
#include <set>
#include <cmath>
#include <cstring>
#include <iomanip>
#include <random>
#include <chrono>
#include <queue>
#include <ctime>
#include <cassert>
using namespace std;
typedef long long ll;
typedef pair<int, int> PII;
typedef pair<ll,... | ALGO | 0.970313 | 3.522035 |
7e415eaf-17a8-4afc-9ccc-3018d7da98db | yebinhi/LeetcodePractice | valid-palindrome/Wrong Answer/7-13-2016, 11:14:37 PM/Solution.cpp | // https://leetcode.com/problems/valid-palindrome
class Solution {
public:
bool isPalindrome(string s) {
int n=s.size();
if(n<=0) return true;
int S=0, E=n-1;
while(S<E){
while(S<n && !isalnum(s[S])) S++;
while(E>=0 && !isalnum(s[E])) E--;
... | ALGO | 0.999654 | 6.708088 |
e4d8e8f7-14b7-47f4-9def-dbb497a5e420 | hthuwal/competitive-programming | old/codechef/chef-and-pepperoni-pizza.cpp | /**
* https://www.codechef.com/COOK109B/problems/PEPPERON
*/
#include<bits/stdc++.h>
#define vi vector<int>
using namespace std;
int n,t;
char pizza[1010][1010];
int left_halfs[1010];
int right_halfs[1010];
int left_pizza;
int right_pizza;
void preprocess()
{
left_pizza = 0;
right_pizza = 0;
for(int i=0;i<n;i... | ALGO | 0.999947 | 4.921694 |
d1ce6d85-3405-4171-b77c-69358f68abe4 | myasincifci/jetbrains-test-task | test_data/C++/fibonacci_search.cpp | /**
* @author sprintyaf
* @file fibonacci_search.cpp
* @brief [Fibonacci search
* algorithm](https://en.wikipedia.org/wiki/Fibonacci_search_technique)
*/
#include <iostream>
#include <vector> // for std::vector class
#include <cassert> // for assert
#include <cstdlib> // for random numbers
#include <algorithm> //... | ALGO | 0.999685 | 6.654191 |
2afe7a3c-eb78-4226-85b1-9336de1d423d | hjiang13/LLMs-in-IR | processed_data/DecompiledResuts_Human_x_164_O2/MetaLLama_Human_x_164_O2_decompiled/CPP_142.cpp | #include <stdio.h>
int sum_squares(int* data, int size) {
int sum = 0;
for (int i = 0; i < size; i++) {
int x = data[i];
if (i % 3 == 0) {
sum += x * x;
} else if (i % 3 == 1) {
sum += x;
} else {
sum += x * x * x;
}
}
return s... | ALGO | 0.996733 | 4.115659 |
4c71c1d2-4904-4b96-8186-f1ed70e7e0ff | ASHISH-GITHUB2495/My-CPP-STL-programms | STL_mapRevise.cpp | //Map
//syntax: map<t1,t2> obj; stores elements in key value combination
//stores key value pair in sorted order on the basis of key
//it generally used in dictionary type problem
//must key should be unique
#include<bits/stdc++.h>
using namespace std;
class Person{
public:
int age;
string name;
bool operato... | ALGO | 0.990187 | 4.589111 |
61b5f157-262a-47e6-af02-332582c4f54a | sachink55/DataStructures-and-Algorithms | Binary and Generic Trees/Asisgnments/Balanced Binary Tree.cpp | //leetcode-110: Balanced Binary Tree
class Solution {
public:
int height(TreeNode* root) {
if(root == NULL ){
return 0;
}
int leftHeight = height(root->left);
int rightHeight = height(root->right);
int finalAns = max(leftHeight, ri... | ALGO | 0.999832 | 6.793765 |
d8ed6bd5-2e33-4cf0-b6ae-12cb0a7f75ca | HellicarAndLewis/ProjectDonk | addons/ofxBulletTrial/lib/bullet/BulletCollision/BroadphaseCollision/btDbvt.cpp | ///btDbvt implementation by Nathanael Presson
#include "btDbvt.h"
//
typedef btAlignedObjectArray<btDbvtNode*> tNodeArray;
typedef btAlignedObjectArray<const btDbvtNode*> tConstNodeArray;
//
struct btDbvtNodeEnumerator : btDbvt::ICollide
{
tConstNodeArray nodes;
void Process(const btDbvtNode* n) { nodes.push_bac... | ALGO | 0.993206 | 6.331945 |
f4df54d9-bec0-45df-8262-2e2b07a07892 | satnam-singh-JustCode/Data-Structures-and-Algorithm- | 100-same-tree/same-tree.cpp | /**
* Definition for a binary tree node.
* struct TreeNode {
* int val;
* TreeNode *left;
* TreeNode *right;
* TreeNode() : val(0), left(nullptr), right(nullptr) {}
* TreeNode(int x) : val(x), left(nullptr), right(nullptr) {}
* TreeNode(int x, TreeNode *left, TreeNode *right) : val(x), l... | ALGO | 0.999977 | 6.568182 |
a0a43ebf-5956-48c3-a2df-7c1060a4119a | ankitagrawal97/leetCode | Top-100-Liked-Questions-LeetCode/34_Find First and Last Position of Element in Sorted Array_sol.cpp | class Solution {
public:
int firstoccurance(vector<int>& nums, int target){
int ans = -1;
int l = 0 ;
int r = nums.size() - 1;
while(l <= r){
int mid = l+(r-l)/2;
if(nums[mid]==target){
ans = mid;
r = mid - 1;
}else if... | ALGO | 0.999917 | 6.357433 |
ed1a5407-044d-40b7-87de-2c0de9778e46 | akitak1ta/Arduino-lift | Libraries/FastLED/src/bitswap.cpp | #define FASTLED_INTERNAL
#include "FastLED.h"
/// Simplified form of bits rotating function. Based on code found here - http://www.hackersdelight.org/hdcodetxt/transpose8.c.txt - rotating
/// data into LSB for a faster write (the code using this data can happily walk the array backwards)
void transpose8x1_noinline(un... | ALGO | 0.995283 | 5.022229 |
1ba2d251-3599-4bad-84d5-64b7ec28ae14 | Gurmeet-Singh657/LeetCode-GFG | Level of Nodes - GFG/level-of-nodes.cpp | //{ Driver Code Starts
#include<bits/stdc++.h>
using namespace std;
// } Driver Code Ends
class Solution
{
public:
//Function to find the level of node X.
int nodeLevel(int V, vector<int> adj[], int X)
{
queue<int> q;
vector<bool> vis(V,0);
vis[0]=true;
q.push(0);
int level=0;
while... | ALGO | 0.999938 | 5.452426 |
437aa064-6b37-4a0d-8b46-a61b4aa5254b | jash13desai/codeforces | 1000/43A - Football.cpp | /*
Problem Name: Football
Problem Type: A - 1000
Problem Link: https://codeforces.com/problemset/problem/43/A
Author: Jash Desai (jash13desai)
*/
// ---------- HEADER ----------
#include<bits/stdc++.h>
using namespace std;
// ---------- TEMPLATES ----------
template<typename... T>
void see(T&... args) { ((cin >> args),... | ALGO | 0.999871 | 4.004397 |
efc2681e-3491-49c3-a904-c827b6e54239 | openharmony-gitee-mirror/third_party_boost | libs/regex/tools/generate/tables.cpp | /*
* LOCATION: see http://www.boost.org for most recent version.
* FILE tables.cpp
* VERSION see <boost/version.hpp>
* DESCRIPTION: Generates code snippets programatically, for cut-and
* paste into regex source.
*/
#include <boost/config.hpp>
#include <map>
#include <... | TOOL | 0.913796 | 3.579304 |
90bd3a3d-2dca-4b64-852d-f70e2a5bcd1c | voidrank/myACMICPCRepo | src/LCA(tarjan).cpp | #include<cstdio>
#include<cstring>
#include<vector>
#include<algorithm>
#include<iostream>
using namespace std;
int n, K, used = 0, Time = 0;
int f[200010], last[200010], ll[200010], dfn[200010], ST[200010];
vector <int> G[200010];
struct node{int a, dis, id;} root[200010];
inline bool cmp(node a1, node a2) {return a1.... | ALGO | 0.999897 | 3.774343 |
26f1aea0-5cc1-4fd3-8311-e485ad76c606 | alexvelea/competitive | contests/codeforcesRound236/b.cpp | //Problem #B from Codeforces 236
#include <cmath>
#include <algorithm>
#include <fstream>
#include <iostream>
#include <vector>
#include <map>
#include <unordered_map>
using namespace std;
#ifdef __APPLE__
#define DEBUG 1
#else
#define DEBUG 0
#endif
#define fi first
#define se second
#define int64 long long
const ... | ALGO | 0.999974 | 3.573756 |
2090822c-cf64-45b7-93fc-8a4a244e394f | PaukIsUha/optimizing_formating_code | predictions/submissions-aizu-coop-gpt35/Codenet/p02370/675162343/response_6.cpp | #include <iostream>
#include <vector>
#include <deque>
#include <stack>
struct Edge {
int tgt_;
Edge(int t) { tgt_ = t; }
};
typedef std::vector<std::vector<Edge>> Adj_list;
std::vector<int> topological_sort(const Adj_list& G) {
const int V = G.size();
std::deque<int> topological_order;
std::vector<int> in... | ALGO | 0.999993 | 5.419641 |
253a67a9-fa47-4a6a-b869-58996156bd2b | mmcluoguan/gameframe | 3rd/cppitertools/examples/groupby_examples.cpp | #include <groupby.hpp>
#include <vector>
#include <iostream>
#include <string>
#include <functional>
int main() {
auto len = [](const std::string& str){ return str.size(); };
std::vector<std::string> vec = {
"hi", "ab", "ho",
"abc", "def",
"abcde", "efghi"
};
std::cout << "str... | TOOL | 0.98679 | 6.126285 |
061c9fd2-8c1a-45f0-afb9-a7aaeff71eeb | raincross7/code-similarity | codes/train_code/problem072/problem072_441.cpp | #include "bits/stdc++.h"
using namespace std;
#define DEBUG(x) cout<<#x<<": "<<x<<endl;
#define DEBUG_VEC(v) cout<<#v<<":";for(int i=0;i<v.size();i++) cout<<" "<<v[i]; cout<<endl
typedef long long ll;
#define vi vector<int>
#define vl vector<ll>
#define vii vector< vector<int> >
#define vll vector< vector<l... | ALGO | 0.999995 | 3.407087 |
338c0871-98d6-4797-b427-c31bc88ad69b | Ankit-Dubey123/Leetcode-Solved-Problems | 0796-rotate-string/0796-rotate-string.cpp | class Solution {
public:
bool rotateString(string s, string goal) {
return s.size()==goal.size() and (s+s).find(goal)!=string::npos;
}
}; | ALGO | 0.999945 | 5.868805 |
19e717c3-bc4f-4f7a-995c-8527b697718b | sanjay-29-29/Cloth-Transfer | open-pose/3rdparty/caffe/src/caffe/layers/softmax_layer.cpp | #include <algorithm>
#include <vector>
#include "caffe/layers/softmax_layer.hpp"
#include "caffe/util/math_functions.hpp"
namespace caffe {
template <typename Dtype>
void SoftmaxLayer<Dtype>::Reshape(const vector<Blob<Dtype>*>& bottom,
const vector<Blob<Dtype>*>& top) {
softmax_axis_ =
bottom[0]->Canon... | DATA | 0.877661 | 7.647714 |
87fe4dce-066d-40c0-b3cf-823468c81a36 | williamviktorsson/HFL24 | lectures/lecture_10/bloc_examples/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.998558 | 6.76775 |
c46d9790-857c-444c-9f3c-e46258cf0086 | Deepakku28/CSES | Sorting and Searching/Sum of Two Values.cpp | #include<bits/stdc++.h>
using namespace std;
#define ll long long int
int main(){
ios_base::sync_with_stdio(0);
cin.tie(0);
ll n,target;
cin>>n>>target;
vector<pair<ll,ll>> val(n);
for(ll i=0;i<n;i++){
cin>>val[i].first;
val[i].second=i+1;
}
sort(val.begin(),val.end());
ll start=0;
ll end=n-1;
while(st... | ALGO | 0.999945 | 4.175558 |
45e99b7d-c8f1-4d96-b850-2847309b36ed | openjdk/jdk20u | src/hotspot/cpu/x86/stubGenerator_x86_64_adler.cpp | #include "precompiled.hpp"
#include "asm/assembler.hpp"
#include "asm/assembler.inline.hpp"
#include "runtime/globals.hpp"
#include "runtime/stubRoutines.hpp"
#include "macroAssembler_x86.hpp"
#include "stubGenerator_x86_64.hpp"
#define __ _masm->
ATTRIBUTE_ALIGNED(32) juint ADLER32_ASCALE_TABLE[] = {
0x00000000U... | ALGO | 0.989767 | 6.613748 |
7fa2db2c-7154-42ac-bf03-5cbb5653b6b6 | mpavageau/LUFS-TruePeak | extern/juce/modules/juce_box2d/box2d/Dynamics/Joints/b2GearJoint.cpp | #include "b2GearJoint.h"
#include "b2RevoluteJoint.h"
#include "b2PrismaticJoint.h"
#include "../b2Body.h"
#include "../b2TimeStep.h"
// Gear Joint:
// C0 = (coordinate1 + ratio * coordinate2)_initial
// C = (coordinate1 + ratio * coordinate2) - C0 = 0
// J = [J1 ratio * J2]
// K = J * invM * JT
// = J1 * invM1 * J1... | ALGO | 0.956919 | 7.039795 |
f5b7f08f-09ff-4b63-9338-33b646c35324 | iamarghamallick/LeetCode-Solutions | 2678-design-graph-with-shortest-path-calculator/2678-design-graph-with-shortest-path-calculator.cpp | class Graph {
public:
vector<vector<pair<int, int>>> adjList;
Graph(int n, vector<vector<int>>& edges) {
adjList.resize(n);
for (auto& e: edges)
adjList[e[0]].push_back(make_pair(e[1], e[2]));
}
void addEdge(vector<int> edge) {
adjList[edge[0]].push_back(make_pair(ed... | ALGO | 0.999965 | 6.036242 |
ec70d188-4acc-4afc-b6ed-4f1949a9a398 | alexandraback/datacollection | solutions_5634947029139456_0/C++/peterz/a.cpp | #include<stdio.h>
#include<string.h>
#include<math.h>
#include<stdlib.h>
#include<iostream>
#include<algorithm>
#include<string>
#include<vector>
#include<set>
#include<queue>
#include<map>
using namespace std;
#define PII pair<int,int>
#define X first
#define Y second
#define PB push_back
#define FOR(i,a,b) for (int i... | ALGO | 0.999846 | 3.921721 |
6a679677-59f8-4529-b898-7d42093474a0 | kenji-kk/cpp-algosiki | full-search/double-loop/5/my.cpp | #include <bits/stdc++.h>
using namespace std;
int main() {
int n;
cin >> n;
int counter = 0;
for(int i=0; i<n; ++i){
bool flag = true;
string s;
cin >> s;
int len = s.length();
for(int j=0; j<len; ++j){
if(s[j] != s[len-1-j]) flag = false;
}
if(flag) counter++;
}
cout << counter << endl;
}
| ALGO | 0.999964 | 4.237834 |
54cbbd35-7448-4e41-8dfb-ecf3e6e2c745 | GrangerHub/Stellar-Prey | source/game-logic/libs/bullet-2.80-rev2531/src/BulletCollision/BroadphaseCollision/btMultiSapBroadphase.cpp | #include "btMultiSapBroadphase.h"
#include "btSimpleBroadphase.h"
#include "LinearMath/btAabbUtil2.h"
#include "btQuantizedBvh.h"
/// btSapBroadphaseArray m_sapBroadphases;
/// btOverlappingPairCache* m_overlappingPairs;
extern int gOverlappingPairs;
/*
class btMultiSapSortedOverlappingPairCache : public btSortedOv... | ALGO | 0.982987 | 4.019304 |
e58d8783-c847-442f-a09f-9179cce4bd8e | GF-Allen/frameworks_av | media/libstagefright/codecs/amrnb/dec/src/dec_lag6.cpp | /*
------------------------------------------------------------------------------
Pathname: ./audio/gsm-amr/c/src/dec_lag6.c
Functions: Dec_lag6
Date: 01/31/2002
------------------------------------------------------------------------------
REVISION HISTORY
Description:
(1) Updated to accept new parameter... | ALGO | 0.99952 | 6.897988 |
8eaa85dc-ffaa-4619-bbe2-aedf2ba0f0c9 | cpvrlab/SLProject4 | externals/libigl/include/igl/oriented_facets.cpp | template <typename DerivedF, typename DerivedE>
IGL_INLINE void igl::oriented_facets(
const Eigen::MatrixBase<DerivedF> & F,
Eigen::PlainObjectBase<DerivedE> & E)
{
E.resize(F.rows()*F.cols(),F.cols()-1);
typedef typename DerivedE::Scalar EScalar;
switch(F.cols())
{
case 4:
E.block(0*F.rows(),0,F.... | ALGO | 0.970396 | 5.161891 |
55bd51c5-7b2f-4628-a153-f6ba9d17f68b | QinHaoChen97/VS_C | Hot100/283.移动零.cpp | // @before-stub-for-debug-begin
#include <vector>
#include <string>
#include "commoncppproblem283.h"
using namespace std;
// @before-stub-for-debug-end
/*
* @lc app=leetcode.cn id=283 lang=cpp
*
* [283] 移动零
*/
// @lc code=start
#include <iostream>
#include <vector>
using namespace std;
/* 操作次数太多
class Solution {... | ALGO | 0.999616 | 6.423001 |
de106f56-31ae-4f4a-878c-df9826d5dff8 | sumondebnath/Problems-Solutions | Leet code/1312_Minimum_Insertion_Steps_to_Make_a_String_Palindrome.cpp | /*
Problem Link: https://leetcode.com/problems/minimum-insertion-steps-to-make-a-string-palindrome/description/
*/
class Solution
{
public:
int minInsertions(string s)
{
string t = s;
reverse(t.begin(), t.end());
int n = s.size();
int m = t.size();
int dp[n + 1][m ... | ALGO | 0.999992 | 6.18788 |
6c451aa0-99ff-4363-9735-bf90a521834b | Perebati/leetcode | stack/155-min_stack.cpp | //Link: https://leetcode.com/problems/min-stack/
//A chave é criar uma stack auxiliar para mapear os valoeres minimos
//Para isso será necessário um ponteiro auxiliar
class MinStack {
private:
vector<int> stack; // stack principal
vector<int> minStack; // stack auxiliar para os mínimos
int min;
... | ALGO | 0.999855 | 6.697436 |
88b30bc8-c457-4f77-9998-62be12d2f82a | danny60106/C- | 5.4 對多個變數求最小值.cpp | #include <stdio.h>
int main() {
int a, b, min ;
printf("Please enter two integers:") ;
scanf("%d %d",&a ,&b ) ;
min = a;
if(min > b){
min = b ;
}
printf("The minimum is %d.\n ", min) ;
return 0 ;
}
/*
int main() {
int a, b, c, min ;
printf("Please enter three integers:") ;
scanf("%d %d %d",&a ,&b ,&c) ;... | ALGO | 0.999079 | 3.132055 |
9bd871bb-93af-4cba-95c7-30b3b60caaa4 | Shinbatsu/Exam-preparation | 26-11.cpp | #include <iostream>
#include <fstream>
#include <algorithm>
using namespace std;
int main() {
fstream F;
F.open("26-11.txt");
int n, S, g, max = -1;
F >> S >> n;
int a[n];
for (int i = 0; i < n; ++i)
F >> a[i];
sort(a, a + n, greater<int>());
long sum = 0;
int i = 0;
... | ALGO | 0.999944 | 3.354519 |
5573e58d-31fb-49c7-b40b-26699d93ed90 | ElgoogUdiab/leetcode_journey | 10/solution_dp.cpp | // The key is go from the end to the beginning
class Solution {
public:
typedef struct token{
char c;
bool isWildcard;
} token_t;
bool isMatch(string s, string p) {
// Parsing token
vector<token_t> tokens;
for(int i=0;i<p.length();++i){
token_t temp;
... | ALGO | 0.999872 | 5.495431 |
87db289d-f86a-47f3-99e6-c4923532cdd6 | Siomek101/counter-strike-community-edition | mp/src/game/client/simple_keys.cpp | #include "cbase.h"
#include "simple_keys.h"
// memdbgon must be the last include file in a .cpp file!!!
#include "tier0/memdbgon.h"
//-----------------------------------------------------------------------------
// Simple key interpolations
//---------------------------------------------------------------------------... | ALGO | 0.858979 | 5.579328 |
c73bfc03-0ba2-42c8-b742-7353a3ebc01d | opensource-hisense/SmartTV-SeriesVidaaU7_NT | oss/part1/cobalt/third_party/llvm-project/libcxx/test/std/containers/container.adaptors/priority.queue/priqueue.cons/ctor_iter_iter_comp_cont.pass.cpp | // <queue>
// template <class InputIterator>
// priority_queue(InputIterator first, InputIterator last,
// const Compare& comp, const container_type& c);
#include <queue>
#include <cassert>
int main()
{
int a[] = {3, 5, 2, 0, 6, 8, 1};
const int n = sizeof(a)/sizeof(a[0]);
std::vector<... | TEST | 0.999178 | 5.031386 |
9d1e3981-2be6-4b7a-9bb3-57418dcca5f9 | SnizhanaDem/LNU_Algorithms-Data-Structures | лаб 1/алгоритм вставки/алгоритми/Сортування вставками.cpp | #include <iostream>
using namespace std;
void insertionSort(int arr[], int n) {
for (int i = 1; i < n; ++i) {
int key = arr[i];
int j = i - 1;
while (j >= 0 && arr[j] > key) {
arr[j + 1] = arr[j];
--j;
}
arr[j + 1] = key;
cout << "Step " << i... | ALGO | 0.999984 | 5.665551 |
65a0b914-ae42-4d46-b3ad-1524caede1c9 | SenseLogic/MYST | BOOST/boost_1_76_0/libs/graph/test/transitive_closure_test.cpp | #include <iostream>
#include <cstdlib>
#include <ctime>
#include <boost/graph/vector_as_graph.hpp>
#include <boost/graph/adjacency_list.hpp>
#include <boost/graph/adjacency_list_io.hpp>
#include <boost/graph/graph_utility.hpp>
#include <boost/graph/transitive_closure.hpp>
#include <boost/timer/timer.hpp>
using namesp... | ALGO | 0.988794 | 6.856215 |
a10d7829-ff99-4a14-81b4-d74d7e6c900b | VeloxChem/VeloxChem | src/t2c_electric_dipole_momentum/ElectricDipoleMomentumDriver.cpp | #include "ElectricDipoleMomentumDriver.hpp"
#include "ElectricDipoleMomentumFunc.hpp"
#include "GtoFunc.hpp"
#include "MatricesFunc.hpp"
#include "OpenMPFunc.hpp"
#include "T2CDistributor.hpp"
auto
CElectricDipoleMomentumDriver::compute(const CMolecularBasis& basis, const CMolecule& molecule, const TPoint<double>& or... | ALGO | 0.992014 | 7.730313 |
a0403691-e7ce-4b8e-879d-1e92aae6026a | ishandutta2007/codeforces | keshi/normal/1366/E.cpp | //In the name of GOD
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
const ll maxn = 2e5 + 100;
const ll mod = 998244353;
const ll inf = 1e18;
#define fast_io ios::sync_with_stdio(false);cin.tie(0);cout.tie(0);
#define file_io freopen("input.txt" , "r+" , stdin) ; freopen("output.txt" , "w+" , st... | ALGO | 0.999995 | 4.35599 |
9aabc5b1-5a8c-44cf-babb-624a87aa7d75 | Amanrastogi04/Leetcode | Children Sum Parent - GFG/children-sum-parent.cpp | //{ Driver Code Starts
//Initial Template for C++
#include <bits/stdc++.h>
using namespace std;
// Tree Node
struct Node {
int data;
Node* left;
Node* right;
};
// Utility function to create a new Tree Node
Node* newNode(int val) {
Node* temp = new Node;
temp->data = val;
temp->left = NULL;
... | ALGO | 0.999457 | 6.992279 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.