uuid string | repo_name string | relative_path string | content string | category string | algo_rel_score float64 | quality_score float64 |
|---|---|---|---|---|---|---|
a348d236-2088-4546-a36a-23eb7107239f | yassin549/Programming-Fundamentals-PD-Lab | Week6 PD/Task7.cpp | #include <iostream>
using namespace std;
string arrival(int starth, int startm, int arriveh, int arrivem);
string timediff(int starth, int startm, int arriveh, int arrivem);
int main()
{
int starth, startm, arriveh, arrivem;
string status, diff;
cout << "Enter exam start hour time: ";
cin >> starth;
... | ALGO | 0.996538 | 4.104415 |
11c0ee9d-7dff-4654-9466-543282b9121c | Lee-DongWon/SWExperts_Problems | SW Experts/D1/D1_2068.cpp | #include <iostream>
using namespace std;
int main() {
int t;
cin >> t;
for (int i = 1; i <= t; i++) {
int max = 0;
int a;
for (int j = 0; j < 10; j++) {
cin >> a;
if (a > max) {
max = a;
}
}
cout << "#" << i << " " << max << endl;
}
return 0;
} | ALGO | 0.988366 | 3.531931 |
75d43749-b38b-4218-9409-f62fc41ed008 | surajelijah/Data_Structures | Sliding_Window/2. First_Negative_Number_In_Every_Window_of_Size_K.cpp | // URL - https://www.geeksforgeeks.org/problems/first-negative-integer-in-every-window-of-size-k3345/1
/*
THe above is a constant window, how do you know, it gave the size as fixed and the condition here is to get
the first negative number in the window.
- Now in this question we need give the first negative ele... | ALGO | 0.999998 | 5.340834 |
a63fb229-4e48-42ad-9373-1f0a03fc3f94 | CFOP2357/verano-2020-progra-competitiva | Training Camp Argentina Virtual 2020/dia 9/K.cpp | //por Bernardo
#include <bits/stdc++.h>
using namespace std;
int main(){
int n, t;
cin >> t;
while(t--){
cin>>n;
if(n < 3)
cout << 0 << '\n';
else
cout << n - 2 << '\n';
}
}
| ALGO | 0.999785 | 4.18926 |
7cdbefc5-5893-46ca-b5f1-8bbd04a90e12 | ABB00717/leetcode | problems/cpp/399.evaluate-division.cpp | #include <map>
#include <string>
#include <unordered_map>
#include <vector>
using namespace std;
class Solution {
public:
vector<double> calcEquation(vector<vector<string>> &equations,
vector<double> &values,
vector<vector<string>> &queries) {
... | ALGO | 0.999917 | 6.411982 |
9696040a-a89c-4526-bab6-a49d45f1cdfc | IkenUyh/OOPBaiTH6-CoYen | TH6-Bai3.cpp | #pragma once
#ifndef DIEM_H
#define DIEM_H
#include<iostream>
#include<cmath>
#include<iomanip>
#define epsilon 0.0000000001
#define pi 3.14159265358979323846
using namespace std;
class DIEM{
protected:
double x, y;
static int dem;
public:
~DIEM();
DIEM();
DIEM(double);
... | ALGO | 0.970206 | 3.828206 |
235972c7-cacb-4b66-8dbf-f1b1b39e8124 | HaochiBai1998/Leetcode | 518. Coin Change 2 3.cpp | //
// Created by bhc on 2022/2/15.
//
#include<string>
#include<vector>
using namespace std;
class Solution {
public:
int change(int amount, vector<int>& coins) {
vector<int> dp(amount+1);
dp[0]=1;
for(int coin: coins){
for(int i=coin;i<=amount;++i){
dp[i]+=dp[i... | ALGO | 0.999919 | 5.86774 |
d134cb83-8ada-4081-886e-e273acbd4279 | SanghunOh/Algorithm | BOJ/BackTracking/15650_2.cpp | #include <iostream>
int arr[10];
int visit[10] = {false, };
void findC(int N, int M, int count, int pre){
if(count == M){
for(int i=0 ; i<M ; i++)
std::cout << arr[i] << " ";
std::cout << std::endl;
return;
}
for(int i=0 ; i<N ; i++){
if(visit[i])
continue;
arr[count] = i+1;
if(pre < i+1){
... | ALGO | 0.999925 | 3.412215 |
ca9b7740-5ca6-43d3-897b-b10d15d84842 | yuv-raj-25/cpp-dsa | .history/knapsack_20230925133516.cpp | #include <iostream>
using namespace std;
int knapSack(int W, int wt[], int val[], int n)
{
int i, w;
vector<vector<int> > K(n + 1, vector<int>(W + 1));
for (i = 0; i <= n; i++) {
for (w = 0; w <= W; w++) {
if (i == 0 || w == 0)
{
K[i][w] = 0;
}
else if (wt[i - 1] <= w)
{... | ALGO | 0.999963 | 5.073467 |
691754f0-4bbd-47ab-9388-030d450a3527 | sabithassann/NexChain-App | nexchain/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.997996 | 6.76073 |
b27220b3-b9df-4fc5-ba60-b9ca1688d3d2 | ishandutta2007/codeforces | chemthan/normal/1056/E.cpp | #include <bits/stdc++.h>
using namespace std;
//#pragma GCC optimize("Ofast")
//#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native")
#define ms(s, n) memset(s, n, sizeof(s))
#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 ... | ALGO | 0.999947 | 4.171621 |
57020100-5796-4743-aac4-49684f2e1dc0 | PorcaM/AES | gf.cpp | /* ==================================================
FileName: gf.cpp
Author: SungJoon Lee
StudentID: 12141588
Created: 2016/10/26 Wed
Modified: 2016/10/28 Fri
================================================== */
#include "gf.h"
#define BIT_OF(x) (sizeof(x)*8)
#define MAX_DEGREE(x, max) for (int i = 0; i < BIT_O... | ALGO | 0.999232 | 3.213363 |
86b0b8d8-69c0-4ace-a48a-3689b5e10d03 | sabamadadi/10-Famous-Algorithms-in-Computer-Science | Kruskal's Algorithm.cpp | #include <iostream>
#include <vector>
#include <algorithm>
using namespace std;
// Structure to represent a weighted edge
struct Edge {
int source, destination, weight;
Edge(int src, int dest, int wt) : source(src), destination(dest), weight(wt) {}
};
// Structure to represent a disjoint set for union-find ... | ALGO | 0.999998 | 6.396586 |
7582c9b4-e764-4625-b2ae-b6c6aec1f013 | OyunErbabi/KluLuleburgazMyo | 2.Donem/VeriYapilari/10CalismaSorusu.cpp | #include <iostream>
using namespace std;
int siraNo = 1;
struct node
{
int sira;
string adi;
struct node*next;
};
struct queue
{
int cnt;
struct node*front;
struct node*rear;
};
void initilize(queue * q)
{
q->cnt=0;
q->front=NULL;
q->rear=NULL;
}
bool isEmpty(queue *q)
{
return (q->cnt==0);
}
void enqu... | TOOL | 0.931254 | 3.777835 |
82f15525-5cba-4ea6-a144-bc9b3cdca6fc | coding-ninja-dsa-competitive-package/codig-ninja-dsa-learning | 01-introduction-to-c++/modules/003-test-1/code/003-Number-Star-Pattern.cpp | #include<iostream>
using namespace std;
/**
* Number Star Pattern
* - Print the following pattern for given number of rows.
* N=5,
* 1234554321
* 1234**4321
* 123****321
* 12******21
* 1********1
*/
int main(){
int N;
cin >> N;
int i=1;
... | ALGO | 0.999922 | 4.527062 |
6d2282bf-744c-401e-b0a4-d021a3a8208d | weiyinglee/School-Projects | C++/Class Exercise/Pointer/SwapValue.cpp | #include <iostream>
void swap(int&, int&);
void swap(int*, int*);
int main(){
using namespace std;
int x = 5;
int y = 10;
cout << "x is " << x << " and y is " << y << endl;
swap(x, y);
cout << "After reference swap: x is " << x << " and y is " << y << endl;
cout << "Now x is " << x << " and y is " <... | ALGO | 0.997805 | 5.94243 |
91309118-3f7d-4f56-99b0-dbe469e1cd9e | mauryavinay1407/DSA-cpp | Arrays/Maximum_Ascending_Subarray_Sum.cpp | // problem : https://leetcode.com/problems/maximum-ascending-subarray-sum
/*
Approach - By simply adding the increasing numbers
Time Complexity : O(N)
Space Complexity : O(1)
*/
class Solution {
public:
int maxAscendingSum(vector<int>& nums) {
int sum = nums[0];
int result = sum;
int ... | ALGO | 0.999968 | 6.99212 |
9ee35b15-f4f9-4414-99e8-64ec32787ec7 | YoelRidgway/cpp | module_08/ex01/sources/Span.cpp | #include "Span.hpp"
//OCCF
Span::Span() : _n_max(0) {}
Span::Span(unsigned int n) : _n_max(n) {}
Span::~Span() {}
Span::Span(const Span& copy) : _n_max(copy.getNmax()), _vec(copy.getVec())
{
// for (unsigned int i = 0; i < this->_n_max; i++)
// this->_vec[i] = copy._vec[i];
}
Span& Span::operator = (const Span&... | ALGO | 0.952749 | 4.881179 |
86a1194e-bdb6-481b-bf80-39ba84620a26 | SunnyProdefi/ikfast_test | main.cpp | #include <iostream>
#include <vector>
#include <cmath> // 用于误差计算
#include <limits> // 用于 std::numeric_limits
#include "ikfast_wrapper.cpp" // 替换为包含 Kinematics 类声明的头文件名
float calculateDistance(const std::vector<float>& a,
const std::vector<float>& b) {
float distanc... | ALGO | 0.999126 | 6.301548 |
fccbe45f-3aeb-4659-bd6b-9a51b946ac76 | susantabiswas/Software-Interview-Essentials | Leetcode/Graphs/satisfiability-of-equality-equations.cpp | /*
https://leetcode.com/problems/satisfiability-of-equality-equations/
TC: O(n) + O(wlog(26)) + O(mlog26) ~ O(n),
n = Total no. of equations, w = no. of a == b eq, m = no. of a != b eq
The questions is more about finding the contradictory equations, like
a == b and b != a. These two contradi... | ALGO | 0.999983 | 6.071662 |
d705ce38-5307-4a76-ac7e-6b8659ed1a29 | vanitas-23/Daily_progress | 2187-vowels-of-all-substrings/vowels-of-all-substrings.cpp | class Solution {
public:
long long countVowels(string word) {
long long ans=0;
int n=word.size();
for(int i=0;i<n;i++)
{
if((word[i]=='a') || (word[i]=='e') || (word[i]=='i') || (word[i]=='o')|| (word[i]=='u'))
{
ans+=(i+1)*1ll*(n-i);
... | ALGO | 0.999731 | 5.926827 |
fce25c15-aec3-4e90-b53f-d94cae5803ec | Sarthak-rasal/Cpp-with_DSA | 45 2D arrays/2RowSum.cpp | #include <iostream>
#include <vector>
using namespace std;
void printRowWiseSum(int arr[][3], int rows, int cols)
{
// row wise sum so we will use row wise traversal
cout << "Printing row wise sum : " << endl;
// R W traversal
int sum = 0;
for (int i = 0; i < rows; i++)
{
for (int j =... | ALGO | 0.99981 | 4.460632 |
9a7ec490-c393-4097-ab93-cd8f6f462057 | RawanAhmed7/cp-journal | daily-ps/local-onsite-test2025/ACE-problem.cpp | #include <iostream>
using namespace std;
int main()
{
long long n ;
cin>> n;
if(n%2==0){
cout<<"Mansour";
}else{
cout<<"Youssef"; }
return 0;
}
| ALGO | 0.999819 | 3.240751 |
0493c4c0-bd6c-4c5f-83be-ecf130cd3554 | sulthan-95/Interview-Preparation | sorting/quick_sort.cpp | #include<iostream>
using namespace std;
void swap(int &a,int &b)
{
int temp=a;
a=b;
b=temp;
}
int partition(int *arr,int low,int high)
{
int pivot=arr[high],i=low-1;
for(int j=low;j<high;j++)
{
if(arr[j]<=pivot)
{
i++;
swap(arr[i],arr[j]);
}
}
swap(arr[i+1],arr[high]);
return i+1;
}
void q_sort(int... | ALGO | 0.999972 | 4.246763 |
98eaf713-5fe3-4329-af27-3ebbdb6e7aaa | Thyme0113/astnn_with_semi-supervised_learning | ssl_125/data/src/gcd/recursive33.cpp | int gcd(int x, int y){
if(x == 0){
return y;
}else{
return gcd(y % x, x);
}
}
int main(int argc,char* argv[]){
int a, b;
cin >> a >> b;
cout << gcd(a, b) << endl;
return 0;
}
| ALGO | 0.999603 | 4.90429 |
7bfe0f59-f209-42b5-b7d1-e72cf9c16b70 | duckdb/duckdb-java | src/duckdb/src/storage/temporary_memory_manager.cpp | #include "duckdb/storage/temporary_memory_manager.hpp"
#include "duckdb/main/client_context.hpp"
#include "duckdb/main/connection_manager.hpp"
#include "duckdb/parallel/task_scheduler.hpp"
#include "duckdb/storage/buffer_manager.hpp"
#include <cmath>
namespace duckdb {
TemporaryMemoryState::TemporaryMemoryState(Tem... | TOOL | 0.890268 | 7.020198 |
ca355ba3-ea9e-422f-a75b-5e477066f563 | otavioon/COLA-2022-Tools | datasets/src/algo/codenet/4/s197728475.cpp | #include<bits/stdc++.h>
using namespace std;
typedef long long int ll;
#define all(v) v.begin(),v.end()
#define vi vector<int>
#define mod 1000000007
#define inf 1e17
#define fs first
#define ss second
template <typename T>
void amax(T& x, T y)
{
if( x < y) x = y;
}
template <typename T>
void amin(T& x, T y... | ALGO | 0.999602 | 3.6319 |
9715befa-5f8e-4011-9e58-3b17674dfcb3 | bouiali/Algorithms | Merge sort/main.cpp | #include <iostream>
using namespace std;
void merge_sort(int arr[],int l,int r);
void sorting(int l,int mid,int r,int arr[]);
int main()
{
int arr[10]={1005,975,259,470,365,340,250,195,87,56};
int n=10;
merge_sort(arr,0,n-1);
for(int i=0;i<n;i++)
{
cout<<arr[i]<<" ";
}
return 0;
}
... | ALGO | 0.999815 | 4.052701 |
a4099995-f64a-4e31-9c45-1f699d1062d8 | MaryamAshraff2/OS-LABS | LAB 10/OS LAB 10.cpp | #include <iostream>
using namespace std;
int main() {
int ms, ps, nop, np, rempages;
int s[10], fno[10][20];
int i, j, x, y, pa, offset;
// Input total memory size
cout << "\nEnter the memory size -- ";
cin >> ms;
// Input page size
cout << "\nEnter the page size -- ";
cin >> ps;
... | ALGO | 0.99807 | 4.176456 |
74ff2fe4-6e48-47ba-aa06-7aa829a64f5b | ivabby/Competitive-Programming | LeetCode/30-Day LeetCoding Challenge/May 2020/Uncrossed Lines.cpp | class Solution {
public:
int maxUncrossedLines(vector<int>& A, vector<int>& B) {
int n = A.size() , m = B.size();
int dp[n+1][m+1];
for(int i=0;i<=n;i++)
{
for(int j=0;j<=m;j++)
{
if(i == 0 || j == 0)
dp[i][j] = 0;
... | ALGO | 0.999989 | 6.315259 |
dab758b0-5c32-4ab1-b700-5d48d0fe7222 | SourovCodes/c-programming | codeforces/363-A.cpp | #include <bits/stdc++.h>
using namespace std;
void printDigit(int digit)
{
if (digit >= 5)
{
cout << "-O|";
digit -= 5;
}
else
{
cout << "O-|";
}
if (digit == 4)
cout << "OOOO-";
else if (digit == 3)
cout << "OOO-O";
else if (digit == 2)
... | ALGO | 0.999164 | 4.708045 |
a3936460-9bcf-4530-a9ea-9de85d9577eb | gautamsharma22/leetcode-manual | 632. Smallest Range Covering Elements from K Lists.cpp | class Solution {
public:
struct Node {
int val, row, column;
Node(int val, int i, int j) : val(val), row(i), column(j) {}
};
struct compare {
bool operator() (Node a, Node b) {
return a.val > b.val;
}
};
vector<int> smallestRange(vector<vector<int>>& nums) {
... | ALGO | 0.999965 | 5.573174 |
72ac0b29-2186-410d-9285-82f5a5094531 | platypusperry23/Imp_Codes | codes/cf2.cpp |
# include <bits/stdc++.h>
using namespace std;
#define boost ios_base::sync_with_stdio(false); cin.tie(NULL)
#define ll long long
#define ld long double
#define pi 3.14
#define mkp make_pair
#define pb push_back
#define pf push_front
#define pob pop_back
#define po... | ALGO | 0.999923 | 3.815052 |
084769a8-b288-4e65-9d19-67218a89dea5 | Na-Nazhou/Kattis-Solutions | detaileddifferences.cpp | #include <iostream>
#include <string>
int main() {
int n;
std::cin >> n;
while (n--) {
std::string first, second;
std::cin >> first >> second;
std::cout << first << "\n" << second << std::endl;
for (int i = 0; i < first.length(); i++) {
if (first[i] == second[i])... | ALGO | 0.999496 | 3.943154 |
f8793cee-6476-4964-89f1-5154b0514a74 | azedarach/summerschol-fs-project | models/CNMSSM/CNMSSM_two_scale_susy_scale_constraint.cpp | // File generated at Fri 9 Jan 2015 15:07:03
#include "CNMSSM_two_scale_susy_scale_constraint.hpp"
#include "CNMSSM_two_scale_model.hpp"
#include "wrappers.hpp"
#include "logger.hpp"
#include "ew_input.hpp"
#include "gsl_utils.hpp"
#include "minimizer.hpp"
#include "root_finder.hpp"
#include <cassert>
#include <cmath... | TOOL | 0.886161 | 5.879868 |
3fcf35f1-1226-4b94-9b5c-368548c24c19 | monman53/online_judge | AtCoder/ARC/072/c.cpp | // header {{{
#include <bits/stdc++.h>
using namespace std;
// {U}{INT,LONG,LLONG}_{MAX,MIN}
#define ALPHABET (26)
#define INF INT_MAX
#define MOD (1000000007LL)
using LL = long long;
// }}}
int main() {
std::ios::sync_with_stdio(false);
int n;cin >> n;
vector<LL> a(n);
for(int i=... | ALGO | 0.999991 | 4.009444 |
c5f955fd-5e04-4b82-b218-a9d1656486a6 | Arko98/Alogirthms | Greedy_Knapsack.cpp | #include<stdio.h>
void Greedy_Knapsack(int p[],int w[],int n,int W)
{float x[n];
float load = 0.0,profit = 0.0;
for(int i=0;i<n;i++)
x[i] = 0.0;
int item = 0;
while( item<=n && load<=W)
{if(load+w[item]<=W)
{x[item] = 1;
load = load + w[item];
profit = profit + p[item];
}
else
{f... | ALGO | 0.999981 | 3.60698 |
d397bb75-520b-4c32-ae06-f53e7d14b547 | kevdhan/gofish | go_fish.cpp | //
// Created by kevin on 11/8/2018.
//
#include "go_fish.h"
// FILE: card_demo.cpp
// This is a small demonstration program showing how the Card and Deck classes are used.
#include <iostream> // Provides write_file and cin
#include <cstdlib> // Provides EXIT_SUCCESS
#include <fstream>
#include <string>
/*
#inc... | TOOL | 0.911232 | 6.241038 |
6a4cabdd-4141-4b58-a422-a25dec32a661 | MoulishGA/Curious_Coders_1.0 | Task-9/Prob-2.cpp | #include<iostream>
using namespace std;
int main(){
int n;
cout<<"enter the n : ";
cin>>n;
int arr[n];
for(int i=0;i<=n-1;i++){
cout<<"enter the element : ";
cin>>arr[i];
}
for(int i=0;i<n;i++){
cout<<arr[i]<<" ";
}
cout<<endl;
for(int i=1;i<n;i++){... | ALGO | 0.999849 | 4.233852 |
139a3f38-ae6b-4557-a674-65344135aa09 | atikislam/Codeforces | A_Magic_Numbers.cpp | #include<bits/stdc++.h>
using namespace std;
#define ll long long
#define endl "\n"
#define INF 100000000
#define abc "abcdefghijklmnopqrstuvwxyz"
#define ABC "ABCDEFGHIJKLMNOPQRSTUVWXYZ"
#define PI 3.1415926535897932384626433832795
//define sort function
#define asort(a) sort(a.begin(),a.end())
#define rsort(a) sort(a... | ALGO | 0.999948 | 3.572317 |
49b14d69-119a-4d02-9008-b580cbd32eb1 | UIT-AnhTu-0325/sync-repo | leetcode/_done/y2024/5-2024 + past/_find-the-duplicate-number/main.cpp | #include <iostream>
#include <algorithm>
#include <vector>
#include <unordered_map>
#include <string>
#include <stack>
#include <sstream>
using namespace std;
class Solution
{
public:
int findDuplicate(std::vector<int> &nums)
{
int slow = nums[0];
int fast = nums[0];
// Find the inters... | ALGO | 0.999948 | 5.906141 |
eeda21de-2e91-40a8-9dc7-459b551b4eb4 | AbdurRahimRatulAliKhan/LeetCode-Solutions | C++/check-if-word-can-be-placed-in-crossword.cpp | // Time: O(m * n)
// Space: O(1)
class Solution {
public:
bool placeWordInCrossword(vector<vector<char>>& board, string word) {
for (int d = 0; d < 2; ++d) {
reverse(begin(word), end(word));
for (int transposed = 0; transposed < 2; ++transposed) {
for (int i = 0; i ... | ALGO | 0.999224 | 6.62462 |
925dfd0e-c15d-4a89-972b-f33fb3f126f0 | naveenkm21/LeetCode_DSA | 0338-counting-bits/0338-counting-bits.cpp | class Solution {
public:
vector<int> countBits(int n) {
vector<int> bitCounts(n + 1);
for (int num = 0; num <= n; ++num) {
bitCounts[num] = __builtin_popcount(num);
}
return bitCounts;
}
};
| ALGO | 0.999979 | 6.547554 |
b3664d18-e25f-47fa-bca5-95e193d72354 | TwinklingTui22/python-projects | coding/18aug.cpp |
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
typedef pair<long long, long long> pll;
typedef vector<pll> vpll;
typedef vector<ll> vll;
typedef vector<int> vi;
typedef set<int> si;
typedef set<ll> sl;
typedef vector<string> vs;
typedef vector<char>vc;
//lower_bound... | ALGO | 0.999933 | 4.9047 |
be2ec1a5-7fe6-40b2-be4a-e0e7655ff5ef | manikanta2901/ubuntu | .history/SRM/DAA/knapsack_20210430204039.cpp | // A dynamic programming based
// solution for 0-1 Knapsack problem
#include <bits/stdc++.h>
using namespace std;
int max(int a, int b)
{
return (a > b) ? a : b;
}
int knapSack(int W, int wt[], int val[], int n){
int i, w;
int K[n + 1][W + 1];
for(i = 0; i <= n; i++)
{
for(w = 0; w <= W; w++)
{
if (i == 0... | ALGO | 0.999997 | 5.798946 |
949de966-7b8b-45c4-9dee-785e7cefc7ed | Sahalmp/dukaan-app-uidesigns | 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.998693 | 6.797273 |
2f3d25b0-0374-45ea-8888-4decf19b0b29 | wesley-petit/prerender-shading | externals/opencv/sources/samples/cpp/image_alignment.cpp | /*
* This sample demonstrates the use of the function
* findTransformECC that implements the image alignment ECC algorithm
*
*
* The demo loads an image (defaults to fruits.jpg) and it artificially creates
* a template image based on the given motion type. When two images are given,
* the first image is the input image... | ALGO | 0.996588 | 3.982134 |
c2c36826-52bd-4ed5-8861-21a9c02cd766 | ymahesh/Random | Code/reverseLL.cpp | #include <iostream>
using namespace std;
//node in a linked list
template typename<T>
class node_t{
T data;
shared_ptr<node_t<T>> next;
};
//Reverse a singly linked list
//Recursion takes o(n) space
//Iterative implementation
template<typename T>
shared_ptr<node_t<T>> reverse_linked_list(shared_ptr<node_t<... | ALGO | 0.985947 | 5.203763 |
a6ba9bfd-dcf1-43fc-9d54-ad2dc03b5db9 | trdln/ADS-Autumn-2021 | Additional/History/ADS Elvina/Algo/labs/lab6/d-prefix.cpp | #include <iostream>
#include <vector>
#include <algorithm>
#include <string>
#define ll long long
using namespace std;
vector <int> getPrefix(string &s){
vector <int> res(s.size());
res[0] = 0;
for(int i = 0; i < s.size() - 1; i++){
int j = res[i];
while (j > 0 && s[i + 1] != s[j])
... | ALGO | 0.999979 | 4.501494 |
316e76e6-1849-4289-ad7f-a9bad40f7e21 | elvircrn/ccppcodes | uva455.cpp | #include <iostream>
#include <cstdio>
#include <cstdlib>
#include <string>
#include <cstring>
#include <queue>
#include <stack>
using namespace std;
#define MAX_N 1000100
char needle [MAX_N * 2], haystack [MAX_N * 2], b [MAX_N * 2];
int n, m;
void kmpPreprocess()
{
b [0] = -1;
b [1] = 0;
b [2] = 0;
... | ALGO | 0.999536 | 3.51509 |
6097869f-d5a4-420d-85dc-8a1e451eb193 | gagandeepahuja09/Greedy-Algorithm | LeetCode/Minimum Time Visiting All Points.cpp | class Solution {
public:
int minTimeToVisitAllPoints(vector<vector<int>>& points) {
int ans = 0;
for(int i = 1; i < points.size(); i++) {
ans += max(abs(points[i][1] - points[i - 1][1]), abs(points[i][0] - points[i - 1][0]));
}
return ans;
}
};
| ALGO | 0.999809 | 5.800571 |
ccdceaf4-d7fb-4a4d-8560-d765902bc636 | kwh1108/WenhuiKuang | CS32/HW2/circlular array/circlular array/main.cpp | using namespace std;
int main()
{
CircularArray array(5);
array.insert(5);
array.insert(4);
array.insert(3);
array.insert(2);
array.insert(1);
cout << array.getTail() << endl;
array.erase(5);
array.erase(4);
array.erase(3);
array.erase(2);
array.erase(1);
cout << arra... | ALGO | 0.990574 | 4.337875 |
35a0cc5d-8600-4ac7-862a-c75c866e2f9b | lucky1213/lucky_editor | example/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.998771 | 6.797273 |
a667ecb1-26c8-416f-9e8b-32a3714f893e | rebots-online/maistro-studio | src/importexport/midi/internal/midiimport/importmidi_voice.cpp | #include "importmidi_voice.h"
#include <QSet>
#include "importmidi_tuplet.h"
#include "importmidi_inner.h"
#include "importmidi_chord.h"
#include "importmidi_meter.h"
#include "importmidi_operations.h"
#include "engraving/dom/sig.h"
#include "engraving/dom/mscore.h"
#include "engraving/dom/durationtype.h"
using name... | TOOL | 0.916552 | 6.621342 |
4fe66830-b7dc-4e61-9d8a-6245e213d8a9 | sheroze1123/ppm | serial_opt.cpp | #include <chrono>
#include <cmath>
#include <complex.h>
#include <cstring>
#include <fftw3.h>
#include <fstream>
#include <getopt.h>
#include <iostream>
#include <omp.h>
#include <string>
#include <vector>
#include "common.h"
#include "marshaller.h"
using namespace std;
const char* usage =
"serial -- Serial N-bo... | ALGO | 0.998611 | 5.051773 |
21d7503d-1fed-4b13-8966-4dc831196ddc | tidalmelon/bigram | test/ngram_test.cpp | #include<iostream>
//#include<stdio.h>
#include<string>
#include "../ngram.h"
int main() {
setlocale(LC_CTYPE, "en_US.UTF-8");
Ngram nm;
nm.split(L"产品和服务");
return 0;
}
//#include<vector>
//#include<float.h>
//#include<math.h>
//#include<deque>
//
//#include "pos.h"
//#include "tst.h"
//#include "word... | ALGO | 0.927255 | 3.602569 |
ed532cce-fff8-47fe-9fa7-128827fd4ffd | ishandutta2007/codeforces | volkov_ivan/normal/1404/C.cpp | #include <bits/stdc++.h>
using namespace std;
struct Node{
int mn, posmn, d = 0;
Node() {}
Node(int val, int pos): mn(val), posmn(pos) {}
};
const int N = 1 << 19;
Node t[2 * N];
int a[N];
int ll[N];
vector <int> byval[N];
int ans[N];
int f[N];
void upd0(int pos, int val) {
for (int i = pos; i < N; ... | ALGO | 0.999981 | 4.285879 |
58d32a33-9c03-44f9-8df0-5dc037b5fa6c | ishandutta2007/codeforces | kort0n/normal/1375/E.cpp | #include <bits/stdc++.h>
#define endl "\n"
using namespace std;
typedef long long ll;
typedef pair<ll, ll> l_l;
typedef pair<int, int> i_i;
template<class T>
inline bool chmax(T &a, T b) {
if(a < b) {
a = b;
return true;
}
return false;
}
template<class T>
inline bool chmin(T &a, T b) {
... | ALGO | 0.999973 | 4.086375 |
8fb3412e-192e-421f-b4ac-c354aaa6fea1 | wyrover/book-code | C++ Standard Library Quick Reference/Chapter 4/04 - lower_bound.cpp | #include <iostream>
#include <algorithm>
#include <vector>
int main()
{
std::vector<int> vec{ 11,22,33 };
const int valueToAdd = 18;
auto lower = std::lower_bound(cbegin(vec), cend(vec), valueToAdd);
vec.insert(lower, valueToAdd); // 11,18,22,33
std::cout << std::endl;
}
| ALGO | 0.9993 | 4.92961 |
511f3caf-a4bf-4479-8ee9-cfbb652ec6c4 | observernet/pivx | src/rest.cpp | #include "chain.h"
#include "primitives/block.h"
#include "primitives/transaction.h"
#include "main.h"
#include "httpserver.h"
#include "rpc/server.h"
#include "streams.h"
#include "sync.h"
#include "txmempool.h"
#include "utilstrencodings.h"
#include "version.h"
#include <boost/algorithm/string.hpp>
#include <boost/d... | WEB | 0.937177 | 5.06782 |
20ab8132-7ff2-4d74-8d01-925f75aab0f3 | mrowan137/puzzles | leetcode/2158.cpp | // Runtime: 427 ms, faster than 74.98% of C++ online submissions for Amount of New Area Painted Each Day.
// Memory Usage: 131.2 MB, less than 31.31% of C++ online submissions for Amount of New Area Painted Each Day.
class Solution {
public:
vector<int> amountPainted(vector<vector<int>> &paint) {
// 1. find the ... | ALGO | 0.999848 | 6.155494 |
c3d9b85b-6002-49d5-bd2c-b874c39c81e6 | panyan7/CP | Codeforces/Edu/129/A.cpp | #include <bits/stdc++.h>
using namespace std;
#define ll long long
#define pii pair<int,int>
#define pll pair<long long,long long>
int tt = 1, n, m, k;
void solve() {
cin >> n;
vector<int> a(n);
for (auto& x : a)
cin >> x;
cin >> m;
vector<int> b(m);
for (auto& x : b)
cin >> x;... | ALGO | 0.999975 | 3.755162 |
3f5e206b-2f88-47d0-92ce-54199635b213 | ZHENZHI76/CPP_OJ_exercise | C++算法编程课C1/c++练习/OJ练习/1354.cpp | #include <iostream>
using namespace std;
int main() {
int n;
cin >> n;
int cnt = 1;
for (int i = 0; i < 8; i++) {
if ((n >> i) & 1) {
cnt++;
}
}
cout << cnt << endl;
return 0;
} | ALGO | 0.999266 | 4.208023 |
d12dd837-60f7-4852-a829-fc484c454b78 | sayan-1211/C-- | Dev C++ files/avg_array.cpp | #include<bits/stdc++.h>
using namespace std;
float average(int *,int);
int main ()
{
int n,i;
float avg;
cout << "Enter number of elements" << endl;
cin >> n;
int arr[n];
cout << "Enter any array" << endl;
for (i=0;i<n;i++)
cin >> arr[i];
avg=average (arr,n);
cout << "Average is " << avg;
return 0;
... | ALGO | 0.994425 | 3.444662 |
6846f65c-cb18-4613-a756-4c0d890a600d | SoumyadeepOSD/FLUTTER_ASSIGNMENT | 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 |
889e37e7-23f5-40bf-9cbb-a8274467ad9d | idksarah/cp | bronze/c++/triangles.cpp | #include <iostream>
#include <cstdio>
#include <vector>
using namespace std;
int main() {
int n = 0;
freopen("triangles.in", "r", stdin);
freopen("triangles.out", "w", stdout);
cin >> n;
vector<vector<int>> points(n, vector<int>(2));
for(int i = 0; i < n; i++){
cin >> points[i][0] >> p... | ALGO | 0.999942 | 4.68181 |
3574a86e-063d-474f-9ab3-9644a21620c3 | dbkernel/GreatSQL | extra/icu/source/i18n/numparse_impl.cpp | #include "unicode/utypes.h"
#if !UCONFIG_NO_FORMATTING
// Allow implicit conversion from char16_t* to UnicodeString for this file:
// Helpful in toString methods and elsewhere.
#define UNISTR_FROM_STRING_EXPLICIT
#include <typeinfo>
#include <array>
#include "number_types.h"
#include "number_patternstring.h"
#includ... | TOOL | 0.925476 | 7.780644 |
4789871f-ab6b-47cb-a699-8b71a0782b08 | zxyDEDIRE/ACM_CODE | CodeForces/Codeforces Round 867 (Div. 3)/D.cpp | /*
嵌套变量重复 特殊样例 0 1 2 n 数组越界 开long long
清空 建图别用vector
*/
#include<bits/stdc++.h>
using namespace std;
#define endl "\n"
#define pp(x) array<int,x>
using ull=unsigned long long;
using ll=long long;
using pii=pair<int,int>;
const int dx[]={0,0,1,-1,1,-1,1,-1};
const int dy[]={1,-1,0,0,1,-1,-1,1};
const int mod=998244353... | ALGO | 0.999672 | 4.41721 |
7f0c3528-e0dd-4358-a379-3960793e9f6a | Leoperon/programming-in-c | week811.cpp | #include<stdio.h>
int fun(int x)
{
int fun1;
if(x>100)
fun1=x-10;
else
fun1=fun(fun(x+11));
return fun1;
}
int main()
{
int y;
y=fun(95);
printf("%d",y);
return 0;
}
| ALGO | 0.999909 | 3.386375 |
b6a89f79-7efe-42b6-a043-1e87a95343da | Hadeer-Elsaeed/C-Plus-Plus | probability/bayes_theorem.cpp | /**
* @file
* @brief [Bayes' theorem](https://en.wikipedia.org/wiki/Bayes%27_theorem)
*
* Bayes' theorem allows one to find \f$P(A|B)\f$ given \f$P(B|A)\f$ or
* \f$P(B|A)\f$ given \f$P(A|B)\f$ and \f$P(A)\f$ and \f$P(B)\f$.\n
* Note that \f$P(A|B)\f$ is read 'The probability of A given that the event B
* has occ... | ALGO | 0.999772 | 6.610483 |
0cdadd54-c9cb-482b-9382-f134d7da7038 | bdcbqa314159/leetCodeWork | 0707-design-linked-list/0707-design-linked-list.cpp | class MyLinkedList {
class Node {
public:
int val;
Node *next, *prev;
Node(int val) {
this->val = val;
next = prev = NULL;
}
Node(int val, Node* next, Node* prev) {
this->val = val;
this->next = next;
this->p... | ALGO | 0.999973 | 5.43363 |
279e41c3-dd1a-4fec-b50c-c32b61d9b34c | nuoxoxo/leetcode | leet_BTK_1641_count_sorted_vowel_strs___TLE.cpp | class Solution {
public:
vector<char> v{'a', 'e', 'i', 'o', 'u'};
int countVowelStrings(int n)
{
int res = 0;
backtracking("", 0, n, res);
return res ;
}
void backtracking(string word, int index, int limit, int& res)
{
if (word.length() == lim... | ALGO | 0.99993 | 6.536916 |
e5c3108a-8b7a-4308-acd8-5c294f8269d4 | B21DCCN712/C_plus_Ptit | MangMotChieu/TapHopNguyenToCungNhau.cpp | #include<iostream>
#include<algorithm>
using namespace std;
int main() {
int t; cin >> t;
while (t--) {
long long n, m; cin >> n >> m;
long long sumn = n * (n + 1) / 2;
long long x = (sumn + m) / 2, y = (sumn - m) / 2;
if (__gcd(x, y) == 1&&(sumn+m)%2==0)cout << "Yes\n";
else cout << "No\n";
}
}
| ALGO | 0.999973 | 5.198275 |
336d5162-11f0-448f-8741-54797f7389ec | ishandutta2007/codeforces | lul____sepled1305/normal/1251/E1.cpp | #include<bits/stdc++.h>
using namespace std;
int T;
int main()
{
ios_base::sync_with_stdio(false);
cin.tie(NULL);
cin>>T;
while(T--)
{
int i,n,water=0;
long long ans = 0LL;
cin>>n;
pair<int,int> a[n];
priority_queue<int> pq;
for(i=0;i<n;i++)
{... | ALGO | 0.999927 | 3.924825 |
9b0003a8-3ac4-4ad6-9b18-2b03080e56f0 | allenge007/my_cpp_code | XCPC/2024SYSUCPCOL/d.cpp | #include <bits/stdc++.h>
using namespace std;
typedef long long i64;
const int mod = 1e9 + 7, maxn = 1e5 + 5;
i64 fac[maxn], ifac[maxn];
i64 qpow(i64 x, i64 y) {
i64 res = 1;
while(y) {
if(y & 1) res = res * x % mod;
x = x * x % mod;
y >>= 1;
}
return res;
}
i64 C(i64 n, i64 m) ... | ALGO | 0.999992 | 4.761785 |
d18bcb34-bc7b-46ee-bc98-afbf122b2762 | ChibiKev/Leetcode | 1796. Second Largest Digit in a String/solution.cpp | class Solution {
public:
int secondHighest(string s) {
int firstMax = -1;
int secondMax = -1;
for (int index = 0; index < s.size(); index++){
char value = s[index];
if (isdigit(value)){
int num = (int) value - 48;
if (firstMax < num){
secondMax = firstMax;
... | ALGO | 0.999447 | 5.884737 |
18006b06-1897-4130-b8c3-48ef75dfdb8a | chauhankartik/UVa | LeetCode/DP/322. Coin Change.cpp | #include<bits/stdc++.h>
using namespace std;
class Solution {
public:
int coinChange(vector<int>& coins, int amount) {
int dp[amount+1];
memset(dp, -1, sizeof dp);
dp[0] = 0;
for(int i = 1; i <= amount; i++) {
... | ALGO | 0.999957 | 5.425898 |
1b8ea54b-97f3-4fd4-b991-b0f3b80a60ce | briansenas/Genetic-and-Memetic-Classification | inc/eigen-3.4.0/doc/examples/Tutorial_ReductionsVisitorsBroadcasting_broadcast_1nn.cpp | #include <iostream>
#include <Eigen/Dense>
using namespace std;
using namespace Eigen;
int main()
{
Eigen::MatrixXf m(2,4);
Eigen::VectorXf v(2);
m << 1, 23, 6, 9,
3, 11, 7, 2;
v << 2,
3;
MatrixXf::Index index;
// find nearest neighbour
(m.colwise() - v).colwise().squaredNorm()... | ALGO | 0.999914 | 4.152517 |
c68dcbd4-a6a0-4b89-86a4-51cc7ac7f621 | doum1004/code_assessment | leetcode/leetcode_cpp/designTic-Tac-Toe.cpp | #include <iostream>
#include <vector>
#include <cassert>
#include <stack>
#include "../utils.h"
using namespace std;
/**
https://leetcode.com/problems/design-tic-tac-toe/submissions/
winning conditions
- win matches all in horizontal
- win matches all in vertical
- win matches all in diag
- win matches all in anti d... | ALGO | 0.999824 | 6.919308 |
2a6b9849-8c77-4143-aeab-6416e20b6def | moxlev/AtCoder | abc/abc113D.cpp | #include <iostream>
#include <string>
#include <vector>
#include <map>
#include <algorithm>
#include <numeric>
#include <functional>
#include <cmath>
int main(){
int h, w, k;
long long MOD = 1000000007;
long long c[9] = {1, 1, 2, 3, 5, 8, 13, 21, 34};
std::cin >> h >> w >> k;
long long dp[200][20... | ALGO | 0.999984 | 4.103352 |
76196ba7-8e2a-46c0-9b81-918888c9b284 | dotAlgorithm/algorithm | E코테/정렬 (두 배열의 원소 교체).cpp | #include <bits/stdc++.h>
using namespace std;
int sum;
int main() {
ios_base::sync_with_stdio(false);
cin.tie(NULL);
int n, k;
cin >> n >> k;
int* a = new int[n];
int* b = new int[n];
for(int i = 0; i< n; i++)
cin >> a[i];
for(int i = 0; i< n; i++)
cin >> b[i];
sort(a, a+n);
sort(b, b+n, greater<int>()... | ALGO | 0.999988 | 3.028327 |
b829ce59-ca7e-48d7-be8e-84c0be7f2882 | vbonnici/grafe-sim | analysis/data/p02272/s103662115.cpp | #include <bits/stdc++.h>
#include <tuple>
#define REP(i, n) for(int i=0;i<(int)(n);i++)
#define ALL(x) (x).begin(),(x).end()
#define square(x) (x) * (x)
#define cube(x) (x) * (x) * (x)
const int INF = 1e9;
using namespace std;
int c = 0;
void merge(int a[], int left, int mid, int right) {
int n1 = mid - left;
... | ALGO | 0.999929 | 3.938579 |
efa37875-bf57-45a4-8147-6d8d6b8e2ac3 | sarjakshah/opencv_sarjak | opencv/samples/cpp/tutorial_code/calib3d/stereoBM/SBM_Sample.cpp | /**
* @file SBM_Sample
* @brief Get a disparity map of two images
* @author A. Huaman
*/
#include <stdio.h>
#include <iostream>
#include "opencv2/calib3d/calib3d.hpp"
#include "opencv2/core/core.hpp"
#include "opencv2/imgcodecs.hpp"
#include "opencv2/highgui/highgui.hpp"
using namespace cv;
const char *windowDis... | ALGO | 0.985123 | 6.104431 |
3fe6187f-73ba-4df3-8a8c-aa814e157c21 | YcheCourseProject/CommunityDetection | Benchmark2009/hierarchical_bench2_2/hier_ben_Sources/standard_package/random.cpp | #if !defined(RANDOM_INCLUDED)
#define RANDOM_INCLUDED
#define R2_IM1 2147483563
#define R2_IM2 2147483399
#define R2_AM (1.0/R2_IM1)
#define R2_IMM1 (R2_IM1-1)
#define R2_IA1 40014
#define R2_IA2 40692
#define R2_IQ1 53668
#define R2_IQ2 52774
#define R2_IR1 12211
#define R2_IR2 3791
#define R2_NTAB 32
#define R2_NDIV... | ALGO | 0.991787 | 4.380252 |
b69bf9a7-70ac-4db8-84b4-dd3897ccc1bd | bbman9900/codetree-TILs | 240823/문자열 정렬/string-sort.cpp | #include <iostream>
#include <string>
#include <algorithm>
using namespace std;
int main() {
// 여기에 코드를 작성해주세요.
string s;
cin >> s;
sort(s.begin(), s.end());
cout << s;
return 0;
} | ALGO | 0.999823 | 5.087818 |
97c0547d-8697-4e85-9514-819a74a7e124 | AlexDs20/Fluid-Simulation | src/matrix.cpp | #include <algorithm>
#include <fstream>
#include <iostream>
#include <string>
#include <vector>
#include "matrix.h"
using namespace std;
//--------------------------------------------------
// Template implementation
template matrix<int>::matrix (const int,const int);
template matrix<real>::matrix(const int,const i... | ALGO | 0.883638 | 4.201209 |
e79ff0c7-2c36-4345-b991-2f683978f6ff | Shaky-00/UCAS-Data-Structure | Code/2.11.cpp | #include <iostream>
#include <stdio.h>
using namespace std;
int main(void)
{
int va[1000];
int i = 0;
int j = 0;
int len, target;
while(cin >> va[i]){
i++;
}
len = i;
i--;
target = va[i];
for(j=i-1; j>=0; j--)
{
if(va[j] > target)
continue;
else{
... | ALGO | 0.999963 | 3.214474 |
9c29dcca-a174-4fe3-8276-2fc073f207f1 | chobaa/cpp-algorithm | icpc/cpp/8983.cpp | #include <iostream>
#include <vector>
#include <algorithm>
using namespace std;
vector<pair<int, int>> arr;
vector<int> shoot;
int main()
{
int m, n, l;
cin >> m >> n >> l;
for (int i = 0; i < m; i++)
{
int temp;
cin >> temp;
shoot.push_back(temp);
}
for (int i = 0; i ... | ALGO | 0.99995 | 4.09823 |
dbaf4389-4abb-4e89-a4b8-23b00f50a41f | makio93/competitive-othersites | LeetCode/Problems/DCC/2021/Jun/W4/D23/main0.cpp | #include <bits/stdc++.h>
using namespace std;
// 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) {}
};
// 自力AC
class Solution {
publi... | ALGO | 0.999998 | 5.577871 |
259e97e6-bd38-4dcd-b576-8ea80d8b2fe9 | oktengfei/solverStudy | 3rdparty/sourceCode/eigen-3.4.0/test/denseLM.cpp | #include <iostream>
#include <fstream>
#include <iomanip>
#include "main.h"
#include <Eigen/LevenbergMarquardt>
using namespace std;
using namespace Eigen;
template<typename Scalar>
struct DenseLM : DenseFunctor<Scalar>
{
typedef DenseFunctor<Scalar> Base;
typedef typename Base::JacobianType JacobianType;
typed... | TEST | 0.98608 | 5.868442 |
baf54cab-3f33-4bec-b1f7-f2e1a6495a10 | Yashbhatt7/leetcode | 1910.cpp | #include<iostream>
#include<vector>
#include<string>
std::string removeoccurrences(std::string s, std::string part) {
size_t pos;
while((pos = s.find(part)) != std::string::npos) {
s.erase(pos, part.length());
}
return s;
}
int main() {
std::string s = "daabcbaabcbc";
std::string part ... | ALGO | 0.998564 | 5.998567 |
d6318203-0e35-47d6-9a41-42bd3d07af87 | TheRakibJoy/Algorithms | Linear Algebra/Matrix Exponentiation/CF - GYM - 102644 - B with mat expo.cpp | ///****In the name of ALLAH, most Gracious, most Compassionate****//
#include<bits/stdc++.h>
#define Input freopen("in.txt","r",stdin)
#define Output freopen("out.txt","w",stdout)
#define ll long long int
#define ull unsigned long long int
#de... | ALGO | 0.999875 | 3.216008 |
bca34b6d-7da7-409c-8703-9486bf88754c | kordianpawelec/chess_bot_stockfish | stock_fish/stockfish/src/timeman.cpp | #include "timeman.h"
#include <algorithm>
#include <cassert>
#include <cmath>
#include <cstdint>
#include "search.h"
#include "ucioption.h"
namespace Stockfish {
TimePoint TimeManagement::optimum() const { return optimumTime; }
TimePoint TimeManagement::maximum() const { return maximumTime; }
void TimeManagement::... | ALGO | 0.993111 | 7.379042 |
32b2756a-a955-4cd7-a366-7dd164371e93 | dneuschaefer-rube/rg_hackathon_2015_string | Tools/lol2dae/IlmBase/ImathTest/testProcrustes.cpp | #include "ImathMatrixAlgo.h"
#include "ImathRandom.h"
#include "ImathEuler.h"
#include <iostream>
#include <assert.h>
#include <cmath>
#include <vector>
#include <limits>
// Verify that if our transformation is already orthogonal, procrustes doesn't
// change that:
template <typename T>
void
testTranslationRotationMat... | TEST | 0.981386 | 7.265359 |
86ff33e0-b046-41ed-bcf9-9b0543e6007c | AndreaOrtiz26/ED6ZLEINCSVA_ORTIZ_DELGADO_MARIA_ANDREA | 00 Tareas/MatrizTranspuesta.cpp | #include<iostream>
#include<conio.h>
using namespace std;
int main(){
int numeros[3][3];
for(int i=0;i<3;i++){
for(int j=0;j<3;j++){
cout<<"Digite un numero ["<<i<<"]["<<j<<"]: ";
cin>>numeros[i][j];
}
}
cout<<"Matriz original \n";
for(int i=0;i<3;i++){
for(int j=0;j<3;j++){
cout<<numeros[i][... | ALGO | 0.997695 | 3.399082 |
425425b4-f209-462d-b02b-2dbfa678de29 | allenge007/my_cpp_code | gym/2022-2023 Winter Petrozavodsk Camp, Day 2 GP of ainta/i.cpp | #include <bits/stdc++.h>
using namespace std;
const int N = 8e5 + 10, M = 2e6 + 10;
struct edge {
int from, to;
edge() { }
edge(int a, int b) : from(a), to(b) { }
} edges[M];
int head[N], nxt[M], tot;
inline void init() {
memset(head, -1, sizeof(head));
tot = 0;
}
inline void add_edge(int x, int y) {
edges[to... | ALGO | 0.999823 | 4.78638 |
563ff6e8-ca6e-4cf0-993b-ea544a0b736a | 113bommy/deepmind_codecontests_refine | cpp_source_filter_file/cpp_train_5068_16.cpp | #include <bits/stdc++.h>
using namespace std;
long long bal, ans;
int main() {
long long n, b;
cin >> n >> b;
long long a[n];
for (int i = 0; i < n; i++) {
cin >> a[i];
}
vector<long long> cnt;
for (int i = 0; i < n; i++) {
bal += -1 + (!(a[i] % 2) * 2);
if (bal == 0) {
cnt.push_back(abs... | ALGO | 0.999893 | 3.764994 |
e913d150-3b31-41e4-bfd8-78d2ea87e57f | WYCTSTF/solution | codeforces/contest/1735/c/c.cpp | #include <bits/stdc++.h>
using namespace std;
#define rep(i, a, n) for (int i = a; i <= n; i++)
#define per(i, a, n) for (int i = n; i >= a; i--)
#define mp make_pair
#define pb push_back
#define fi first
#define se second
#define pi acos(-1)
#define il inline
#define rg register
#define SZ(x) ((int)(x).size())
#defi... | ALGO | 0.999988 | 4.981708 |
ae13e1dd-f2d2-4890-aa4c-5917f7bd048a | yhwhu/Cpp-Primer-Plus | Chapter7/ex5.cpp | //
// Created by 粟永华 on 2019/11/9.
//
#include <iostream>
using namespace std;
int factorial(int);
int main(){
int n, res;
cin >> n;
res = factorial(n);
cout << "res: " << res << endl;
return 0;
}
int factorial(int n){
if(n==1){
return 1;
}
return n*factorial(n-1);
}
| ALGO | 0.999865 | 4.720976 |
6d7173ea-046c-4656-9bc6-5932de6c15f1 | anshu0202/DataStructur-Code | ch3/doubly_linked list/insertion_start.cpp | #include<iostream>
using namespace std;
struct node{
int data;
node *plink,*nlink;
};
int main(){
node *head=0,*newnode,*temp;
int choice=1,val,loc,i;
while(choice){
newnode=new node;
cout<<"Enter value of node\n";
cin>>newnode->data;
if(head==0){
head=temp=newnode;
newnode->plink=0;
}
else{
t... | ALGO | 0.99996 | 3.768746 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.