uuid string | repo_name string | relative_path string | content string | category string | algo_rel_score float64 | quality_score float64 |
|---|---|---|---|---|---|---|
9479ad46-e03e-42e0-9796-f31311f5d142 | leonardoAnjos16/Competitive-Programming | Codeforces/misha_and_permutations_summation.cpp | #include <bits/stdc++.h>
using namespace std;
#define long long long int
struct FenwickTree {
private:
int n;
vector<int> tree;
public:
FenwickTree(int n) {
this->n = n + 1;
clear();
}
void clear() {
tree.assign(n + 1, 0);
}
void add(int i, int x) {
if (... | ALGO | 0.999991 | 3.862077 |
d506128e-6f4a-482b-a784-c510a442655b | kagasan/atcoder | NAIST/NAIST1119/1.cpp | #include "bits/stdc++.h"
using namespace std;
typedef long long ll;
typedef pair<ll, ll> P;
#define rep(i, n) for(ll (i) = 0; (i) < (n); (i)++)
#define rep1(i, n) for(ll (i) = 1; (i) <= (n); (i)++)
#define rrep(i, n) for(ll (i) = (n) - 1; (i) >= 0; (i)--)
#define rrep1(i, n) for(ll (i) = (n); (i) >= 1; (i)--)
const ll ... | ALGO | 0.999618 | 3.761228 |
2aae7cd4-a7d2-463c-bdde-afee7d07e6e1 | tripti2502/Leetcode | Number of Provinces - GFG/number-of-provinces.cpp | //{ Driver Code Starts
#include <bits/stdc++.h>
using namespace std;
// } Driver Code Ends
//User function Template for C++
class Solution {
private:
void dfs(int node, vector<int>adjls[], int vis[]){
vis[node]=1;
for(auto it: adjls[node]){
if(!vis[it]){
dfs(it,adjls... | ALGO | 0.999981 | 6.537682 |
3d2af0e6-2c69-4877-b00d-feab83080c7b | UndefinedCpp/EmeraldChessEngine | src/eval.cpp | #include "eval.h"
#include "weight.h"
#include <array>
#include <cmath>
#define INPUT_SIZE 768
#define FEATURE_SIZE 32
#define LAYER1_SIZE 128
std::pair<bool, Value> checkGameStatus(Position& board) {
// Generate legal moves to validate checkmate or stalemate
Movelist moves = board.legalMoves();
if (moves... | ALGO | 0.999689 | 7.398144 |
dae16740-5e1e-4062-b5b6-13c08d26ade5 | Shrijeet14/Leetcode-Submissions | 160-Intersection-of-Two-Linked-Lists.cpp | /**
* Definition for singly-linked list.
* struct ListNode {
* int val;
* ListNode *next;
* ListNode(int x) : val(x), next(NULL) {}
* };
*/
//Method-1 : Hashing Method
// class Solution {
// public:
// ListNode *getIntersectionNode(ListNode *headA, ListNode *headB){
// map<ListNode* , in... | ALGO | 0.99995 | 5.346665 |
8dc63ba0-d32f-4662-93b3-44b651f9517b | upesacm/21DaysOfCode | DibyasomPuhan/Spam detecting NeuralNet/Solution/Spam Detector_Optimised.cpp | #include<bits/stdc++.h>
using namespace std;
//typedef unsigned long long int ll;
class neuron
{
public:
bool weight, bias;
neuron()
{
weight=1;
bias=0;
}
_initialize(long long w, long long b)
{
weight = (w%2==0)?true:false;
bias = (b%2==0)?true:false;
// cout << weight << " " << bias << endl;
... | ALGO | 0.999593 | 3.377515 |
fd481375-23c4-4653-85e7-8fa653579edc | Arvi-Saleque/Code_Template | code/Graph Theory/shortest cycle in a unweighted undirected.cpp | const int N = 1e5 + 9;
vector<int> graph[N+5];
void find_shortest_cycle(int n) {
int ans = INT_MAX;
for(int i=0;i<n;i++) {
vector<int> dis(n, INT_MAX);
vector<int> parents(n, -1);
dis[i] = 0;
queue<int> Q;
Q.push(i);
while(!Q.empty()) {
int par = Q.fr... | ALGO | 0.999458 | 4.130567 |
a889fc6b-7884-4ac5-9285-5443d71b9f57 | danilob/Raytracing | structure/kdtree.cpp | #include "kdtree.h"
#include "photon.h"
#include <iostream>
#include <algorithm>
#include <cmath>
bool flag;
KdTree::KdTree()
{
}
void KdTree::createHeap()
{
std::vector<Photon*> list(photons);
balance(&list, 0, photons.size(), 0);
}
void KdTree::balance(std::vector<Photon*> *list, int begin, int end, int i... | ALGO | 0.999573 | 4.442184 |
0b0139d4-9e19-4e16-8973-1e96a99e8e27 | MedAzizTousli/Competitive-Programming-Solutions | AtCoder/ABC132/A - Fifty-Fifty.cpp | #include<bits/stdc++.h>
#define ll long long
using namespace std;
int main()
{
map<char, int> mp;
for (int i=0; i<4; i++)
{
char x;
cin >> x;
mp[x]++;
}
bool y = true;
for (map<char, int>::iterator it = mp.begin(); it != mp.end(); it++)
if (it->second != 2)
... | ALGO | 0.999704 | 3.684936 |
dc9cd479-ea4c-4675-995f-26dd6ba71e19 | FaiiFaiipuipui/DSA_CEDT1 | d57_q3_zuma.cpp | #include <bits/stdc++.h>
using namespace std;
int main ()
{
list <int> buds;
int N{}, K{}, V{};
cin >> N >> K >> V;
for (int i = 0; i < N; i++)
{
int value{};
cin >> value;
buds.push_back(value);
}
auto curr = buds.begin();
for (int i = 0; i < K; i++) curr++;
curr = buds.insert(curr, V);... | ALGO | 0.999975 | 3.23516 |
2cacdf31-33b3-4170-ba34-917976fccade | Clno1/Cplusplus | Testcode/stringstream.cpp | #include<bits/stdc++.h>
using namespace std;
//ϰstringstream
//ô֪һжٶʱ뵽string棬Ȼٶд
//ôҲDz֪һӦٶǿȴ浽string
struct PersonInfo {
string name;
vector<string> phones;
};
int main()
{
string lines,word;
vector<PersonInfo> people;
while (getline(cin,lines)) { //ÿζȡһ
PersonInfo info; //һ
istringstream record(lines... | TOOL | 0.956548 | 4.697295 |
d64dc353-f282-4e0e-a8bd-61ca6b2cd9ec | Rasel66/CSE-3105-Numerical-methods- | NewtonRP.cpp | #include<iostream>
#include<cmath>
#include<math.h>
using namespace std;
float NT2(float x)
{
return 3*x*x-1;
}
float NT1(float x)
{
return pow(x,3)-x-1;
}
int main()
{
float a,b,c,x0,accuracy=0.0001;
int i=1;
cout<<"Enter two number: "<<endl;
cin>>a>>b;
if(a<b && NT1(a)*NT1(b)<0)
{
... | ALGO | 0.999911 | 4.097344 |
f0cfb093-0ed1-4264-8c06-bba37390c1ee | CBNU-Core-algorithm/binary-search | 박건우/반도체설계/portOptimization.cpp | #include <iostream>
#include <vector>
using namespace std;
int find(vector<int> vec, int start, int end, int portNum) {
int mid = 0;
while (start < end) {
mid = (start + end) / 2;
if (vec[mid] < portNum) {
start = mid + 1;
}
else {
end = mid - 1;
... | ALGO | 0.999977 | 4.557749 |
e0d4be34-138c-4962-a707-f92722110cc2 | daguilastro/LeetCode | Contains Duplicate.cpp | #include <vector>
#include <unordered_set>
using namespace std;
bool containsDuplicate(vector<int> &nums)
{
unordered_set<int> values;
for (int num : nums)
{
if (values.count(num))
return true;
values.insert(num);
}
return false;
}
// El poder de los hashmaps es genial
... | ALGO | 0.999934 | 5.506864 |
29dda619-5131-456b-9ec5-1ce77fdb64b2 | TheRickyZhang/CompetitiveProgramming | Notes/CIS4930/HW/HW8/Q1.cpp | #include <bits/stdc++.h>
using namespace std;
// Template written by Ricky Zhang
using vi = vector<int>; using ll = long long; using vll = vector<long long>; using vb = vector<bool>; using pii = pair<int, int>;
using pll = pair<ll, ll>; using vpii = vector<pii>; using vpll = vector<pll>; using pq = priority_queue<ll>;... | ALGO | 0.999936 | 3.798077 |
fcdf6af2-a9f3-497a-96ea-7d5323228bb5 | iriealex/alexino_codemagic | 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.998733 | 6.76775 |
d0a3e92f-ca13-440c-b624-7edc416edbd0 | hoanghai1607/TriTueNhanTao | Project1/dfs.cpp | #include<stdio.h>
#include<vector>
using namespace std;
int n, m;
vector<int> a[100];
//cung cap mang co 100 dinh
bool visited[100];
//kiem tra dinh da duoc duyet qua chua
void nhap() {
printf("Nhap so dinh: "); scanf_s("%d", &n);
printf("Nhap so canh: "); scanf_s("%d", &m);
//n la so dinh
//m la so canh noi ca... | ALGO | 0.999878 | 4.048625 |
56949cd6-3632-4819-8969-92aa0f07ada3 | TanuBhati199/LeetCode | 0150-evaluate-reverse-polish-notation/0150-evaluate-reverse-polish-notation.cpp | class Solution {
public:
int evalRPN(vector<string>& tokens) {
stack<int>st;
for(string c:tokens){
if(c=="+"){
int second=st.top();
st.pop();
int first=st.top();
st.pop();
st.push(first+second);
... | ALGO | 0.9999 | 6.074789 |
809c3bab-7c90-4600-bf8d-8891f2a3189a | sergrigordeev/yandex-cpp-courses | 02-yellow/excersises/w05-26-figures/w05-26-figures/main.cpp | #include <iostream>
#include <vector>
#include <string>
#include <sstream>
#include <limits>
#include <cmath>
#include <iomanip>
#include "test_runner.hpp"
#include "assertation_tools.hpp"
using namespace std;
class Figure{
public:
virtual string Name() const = 0;
virtual float Perimeter() = 0;
virtual fl... | TOOL | 0.921047 | 5.299429 |
65071237-4bde-41da-a1dc-1b3ebe247792 | ishuu7/Interview-Preparation | Array/Rotate-image.cpp | // https://leetcode.com/problems/rotate-image/
// O(1) Extra Space, Very cool solution.
class Solution {
public:
void rotate(vector<vector<int>>& m) {
int n = m.size();
for(int i=0; i<n; i++)
for(int j=0; j<i; j++)
swap(m[i][j], m[j][i]); // firstly made transpose of the... | ALGO | 0.999942 | 7.047585 |
f0d5ec23-9d2b-4ae0-8121-1cca7c148fe5 | NEWBEE108/Leet_code | 005. Best Time to Buy and Sell Stock II/main.cpp | #include <iostream>
#include "solution.h"
int main()
{
//vector<int> prices;
vector<int> prices = {4, 3, 4, 5, 7, 8, 9, 10, 4, 6, 3};
Solution s;
std::cout << s.maxProfit(prices) << std::endl;
}
| ALGO | 0.9908 | 5.664156 |
45a2a940-0321-4540-90bd-a35a6095cf48 | ushmita4/Leetcode-2025 | 05. May/longestunequaladjacentgroupssubsequenceII.cpp | class Solution {
public:
vector<string> getWordsInLongestSubsequence(vector<string>& words,
vector<int>& groups) {
int n = groups.size();
vector<int> dp(n, 1);
vector<int> prev(n, -1);
int maxIndex = 0;
for (int i = 1; ... | ALGO | 0.999991 | 6.056621 |
b30436ed-a7b5-448c-9c8e-e99b911c0042 | jpessoa/UFMS-2021-2-prog2 | prof/vetor1.cpp | /*Escreva um programa para realizar operacoes sobre um vetor, conforme menu a seguir
[1] - Inserir vetor
[2] - Imprimir vetor
[3] - Remover o menor elemento
[4] - Sair
Opcao 1 - o usuario informa n, a quantidade de elementos a inserir no vetor, seguido dos
elementos. Considere que n <= 50. Sempre que a opcao 1 for e... | ALGO | 0.99707 | 3.771622 |
ad99b236-752e-4d11-a97e-830337e1504a | amitkumar0902/The_Quiet_Revolution | Two-gram.cpp | #include<bits/stdc++.h>
using namespace std;
#define ll long long int
int main()
{
ll n,i;
string s,k;
cin>>n>>s;
multiset<string>s1;
for(i=0;i<s.length()-1;i++){
string t;
t.push_back(s[i]);
t.push_back(s[i+1]);
s1.insert(t);
}
ll max=0;
for(i=0;i<s.lengt... | ALGO | 0.999851 | 3.0793 |
ef7aec09-5bc6-4904-bce4-36f30de21c7a | wikigogeta2005/axel_ramirez1946 | Lenguaje c++/Correcciones/ejercicio1.cpp | #include <iostream>
using namespace std;
main()
{
int num1,num2,num3;
cout<<"Por favor, Ingrese un primer numero: ";
cin>>num1;
cout<<"Por favor, Ingrese un segundo numero: ";
cin>>num2;
cout<<"Por favor, Ingrese un tercer numero: ";
cin>>num3;
if (num1==num2&&num2==num3)
{
... | ALGO | 0.993685 | 3.436548 |
0371ca51-9183-4761-a283-0c7ee3ee58a7 | VA-run23/Data-Structures-And-Algorithms | Binary_trees/postIn2BinaryTree.cpp | //
#include <bits/stdc++.h>
using namespace std;
struct Node{
int data;
struct Node* left;
struct Node* right;
Node(int val){
data= val;
left=NULL;
right =NULL;
}
};
int search(int inOrder[], int start, int end, int val){
for(int i=start; i<=end; i++){
if(i... | ALGO | 0.999997 | 6.168953 |
9280b3f0-d874-41c4-a031-b8dfef4d0004 | YatharthChauhan2362/B.Tech-Computer-Engineering | SEM-5/Design and Analysis of Algorithms (CE355)/DAA Practicals/Practical_2_1.cpp | // Bubble Sort
#include <iostream>
using namespace std;
int counter = 0;
void bubbleSort(int arr[], int size)
{
int temp;
for (int i = 0; i < size; i++)
{
for (int j = 0; j < size - i - 1; j++)
{
if (arr[j] > arr[j + 1])
{
temp = arr[j];
... | ALGO | 0.999273 | 5.287948 |
8d45d8a6-0d96-4146-a057-dcd7fd848604 | lalitx17/DeepSeapp | maxLen.cpp | // MaxLen.cpp
#include <iostream>
#include <list>
#include <type_traits>
#include <vector>
template <typename Range1, typename Range2>
auto maxLen(Range1 const &a, Range2 const &b) -> std::enable_if_t<
std::is_same_v<decltype(a.size()), std::size_t> &&
std::is_same_v<decltype(b.size()), std::size_t>, // bo... | TOOL | 0.935918 | 5.041642 |
eea931dd-4f65-464c-9af5-7dabab414241 | Yuessiah/Destiny_Record | CODEFORCES/902B_Coloring_a_Tree.cpp | #include<bits/stdc++.h>
using namespace std;
const int maxn = 1e4 + 10;
vector<int> G[maxn];
int c[maxn], cnt;
bool vis[maxn];
void draw(int u, int p) {
for(int i = 0, l = G[u].size(); i < l; i++) {
int v = G[u][i];
if(vis[v]) continue;
//printf("(%d, %d) %d\n", u, v, c[u]);
vis[v] = true;
if(c[v] != p) c... | ALGO | 0.9994 | 3.712126 |
e15daf79-5a80-4322-875f-3115e7232bdf | Ritik2703/Competitive-coding-tips | leet_code_problems/missing_number.cpp | /**
* Given an array containing n distinct numbers taken from 0, 1, 2, ..., n, find the one that is missing from the array.
*
* For example,
* Given nums = [0, 1, 3] return 2.
*/
#include <iostream>
#include <vector>
int missingNumber( std::vector<int>& nums ) {
int missing_sum = 0;
for ( auto n : nums ) {
m... | ALGO | 0.998919 | 6.364129 |
19164868-4961-4aaf-af99-35cb3bd87035 | Mohamed-Kamal40/banking-system | main.cpp | #include <iostream>
#include <climits>
using namespace std;
#include "Client.h"
#include "HelperFunctions.h"
#include "LinkedList.h"
#include "Cashier.h"
#include "Queue.h"
/***********************************************************************************
Name:Algorithm -> CPU Scheduling Using RR Funct... | ALGO | 0.997453 | 3.315346 |
ba440315-dad8-4ba0-a6c8-394be3ba9a2f | Aamodit/GFG-Daily | Difficulty: Easy/Sort 0s, 1s and 2s/sort-0s-1s-and-2s.cpp | //{ Driver Code Starts
#include <bits/stdc++.h>
using namespace std;
// } Driver Code Ends
class Solution {
public:
void sort012(vector<int>& arr) {
int n = arr.size();
int i = 0;
int j = n - 1;
int idx = 0;
while(idx <= j){
if(arr[idx] == 0){
s... | ALGO | 0.999551 | 6.370062 |
a2a84c78-c51e-44ae-9798-1c3092dbb0a5 | AntelopeIO/cdt-llvm | lib/CodeGen/GlobalISel/Localizer.cpp | #include "llvm/CodeGen/GlobalISel/Localizer.h"
#include "llvm/Analysis/TargetTransformInfo.h"
#include "llvm/ADT/DenseMap.h"
#include "llvm/CodeGen/MachineRegisterInfo.h"
#include "llvm/Support/Debug.h"
#define DEBUG_TYPE "localizer"
using namespace llvm;
char Localizer::ID = 0;
INITIALIZE_PASS_BEGIN(Localizer, DEBU... | ALGO | 0.855629 | 7.885206 |
9e59e73f-f17b-4f5f-9046-0e94a9398696 | jungh150/PS | baekjoon/11404.cpp | #include <iostream>
#include <vector>
using namespace std;
long long INTMAX = 1e15;
int main() {
ios_base::sync_with_stdio(0);
cin.tie(0);
cout.tie(0);
int n, m;
cin >> n >> m;
vector<vector<long long>> dst(n + 1, vector<long long>(n + 1, INTMAX));
for (int i = 0; i < m; i++) {
l... | ALGO | 0.999993 | 4.78116 |
704a6bf0-10e4-44be-8278-0aef362cde2b | an1ruddh/oops | list.cpp | #include<iostream>
#include<new>
using namespace std;
struct nod
{
int info;
struct nod*next;
};
typedef struct nod node;
class list
{
node *f;
public:
list()
{
f=NULL;
}
void ins(int num)
{
node *p=new node;
p->info=num;
p->next=f;
f=p;
}
void del()
{
node *temp=f;
if(f==NULL)
cout<<"\nNo elements to delete.\n";
else
... | ALGO | 0.997984 | 4.056127 |
949f4640-7edb-40ff-a355-3cd7097575f2 | anonymous-atom/DSA_CPP | Recursion/head_recur.cpp | //
// Created by karun on 19/8/22.
//Head Recursion, Function Call At The Beginning Of The Programme.
#include <iostream>
using std::cout;
void fun(int n) {
if(n > 0) {
fun(n-1);
std::cout<<n<<std::endl;
}
}
int main() {
fun(4);
} | ALGO | 0.999766 | 4.867329 |
32ac7c80-af4f-4dc7-b5cb-a60187c6a2d0 | nainshree-raj/Leetcode_Hustle | Left and Right Sum Differences.cpp | QUESTION : Given a 0-indexed integer array nums, find a 0-indexed integer array answer where:
answer.length == nums.length.
answer[i] = |leftSum[i] - rightSum[i]|.
Where:
leftSum[i] is the sum of elements to the left of the index i in the array nums. If there is no such element, leftSum[i] = 0.
rightSum[i] is the sum o... | ALGO | 0.999979 | 6.263248 |
eb54fba6-ee99-477d-94c4-a2f5ef79011f | RajDharkar/competitive-programming | Contests/USACO/Usaco Guide Gold/dynamic programming/hootpaperscissors.cpp | #include<bits/stdc++.h>
using namespace std;
using ll = long long;
using pi = pair<int,int>;
using pl = pair<ll,ll>;
#define f first
#define s second
// #include "C:\Users\rajve\Documents\GitHub\competitive-programming\debugging.h"
//HOOF = 0, PAPER = 1, SCISSORS = 2, so to check if a beats b we do a-b mod 3 == 1
i... | ALGO | 0.999938 | 3.546294 |
18819361-e737-4bf4-a500-f83c98cbd72d | Kuldeep8081/DSA_problems_and_solutions | 679-24-game/24-game.cpp | class Solution {
public:
bool judgePoint24(vector<int>& cards) {
vector<double> nums(cards.begin(), cards.end());
return solve(nums);
}
private:
bool solve(vector<double>& nums) {
if (nums.size() == 1) {
return fabs(nums[0] - 24.0) < 1e-6;
}
int n = nums.... | ALGO | 0.998103 | 5.782221 |
3276c79d-37d5-4ff8-ba08-56bbcb083be2 | saitama138/HackerrankContest | Solonhoncacsodungtruc.cpp | /*
Cho một dãy số nguyên dương có n phần tử. Hãy liệt kê số các phần tử trong dãy lớn hơn tất cả các số đứng trước nó (Phần tử đầu tiên được coi là một phần tử thỏa mãn).
Input Format
Dòng đầu tiên là số lượng phần tử trong mảng. Dòng thứ 2 là N phần tử trong mảng.
Constraints
2≤n≤10^6; 1≤ai≤10^9
Output Format
L... | ALGO | 0.999929 | 4.180346 |
3b3c22e1-87e7-4bc1-b3f0-13f7a1b6ba61 | shivamEr/DSA-In-CPP | Trees/no_sibilng_tree.cpp | #include <iostream>
#include <vector>
using namespace std;
// Node class definition
class node {
public:
int data;
node* left;
node* right;
node(int d) {
data = d;
left = NULL;
right = NULL;
}
};
// Function to build the binary tree from input
node* buildTree() {
int d... | ALGO | 0.999975 | 6.19381 |
6fc5fa4e-d1b1-4669-9903-8b73f56a5193 | Jackarain/tinyrpc | third_party/boost/libs/multiprecision/example/constexpr_float_arithmetic_examples.cpp | // Contains Quickbook snippets used by boost/libs/multiprecision/doc/multiprecision.qbk,
// section Literal Types and constexpr Support.
#include <iostream>
#include <boost/config.hpp>
#ifdef BOOST_HAS_FLOAT128
#include <boost/multiprecision/float128.hpp>
#endif
//[constexpr_circle
#include <boost/math/constants/con... | TOOL | 0.922055 | 7.648418 |
ff6fff90-3e68-495d-98da-738578ff1133 | alexcoronacion/ProgramC- | ER_VisualC++/ArrayFunction.cpp | //
// Created by alexc on 8/2/2022.
//
#include "iostream"
using namespace std;
void myFunction(int myNumbers[5]);
int main(){
int myNumbers[5]={10,20,30,40,50};
myFunction(myNumbers);
return 0;
}
void myFunction(int myNumbers[5]){
for(int i=0;i<5;i++){
cout<<myNumbers[i]<<"\n";
}
} | ALGO | 0.942787 | 3.294604 |
6930947c-cb84-4388-9680-ff4746a28f1f | nanbeiwei2014/ecoChain | bitcoin-0.12.0/src/pubkey.cpp | #include "pubkey.h"
#include <secp256k1.h>
#include <secp256k1_recovery.h>
namespace
{
/* Global secp256k1_context object used for verification. */
secp256k1_context* secp256k1_context_verify = NULL;
}
/** This function is taken from the libsecp256k1 distribution and implements
* DER parsing for ECDSA signatures, ... | TOOL | 0.898337 | 6.575982 |
56b029b3-0979-40d3-8ff9-e8f799f9210c | MichaelJohmson/passport | USACO training problems/Sector 1.4/combo.cpp | /*
ID: ethanhp1
LANG: C++14
TASK: combo
*/
#include <bits/stdc++.h>
using namespace std;
//given the small constraints on this problem, we can just brute force it. Then just use a set to store the values, then find the length of the set (if any values are duplicated nothing will happen). Finished 12:37 PST on 10/21/202... | ALGO | 0.999379 | 4.637469 |
6a80745a-bc7c-4c3e-b6a6-2bed6a70ed5c | TheCatGang/system_netd | server/MDnsSdListener.cpp | #include "MDnsSdListener.h"
#include <arpa/inet.h>
#include <dirent.h>
#include <errno.h>
#include <linux/if.h>
#include <netdb.h>
#include <netinet/in.h>
#include <pthread.h>
#include <resolv.h>
#include <stdlib.h>
#include <string.h>
#include <sys/poll.h>
#include <sys/socket.h>
#include <sys/types.h>
#define LOG_T... | TOOL | 0.884944 | 5.927479 |
5b4484aa-e70a-480c-97c8-f6cff6a7f347 | vawait/ACM | CodeForces/Gym100379E Addition in the Fibonacci number system.cpp | /*
* Author: vawait
* Created Time: 2015/8/12 13:29:43
* Problem: Gym100379E Addition in the Fibonacci number system
*/
#include<cstdio>
#include<iostream>
#include<cstring>
#include<cstdlib>
#include<cmath>
#include<algorithm>
#include<string>
#include<map>
#include<set>
#include<vector>
#include<queue>
#include... | ALGO | 0.999974 | 3.223292 |
512c8b51-2f2b-42ca-88bf-620962f60eb9 | SLIIT-FacultyOfComputing/tutorial-03b-IT21219498 | exercise03.cpp | #include <iostream>
using namespace std;
int volume(int height, int width, int length);
struct Box
{
int Height, Width, Length;
}box1, box2;
int main()
{
int totalVolume;
cout << "Enter Box 1 Height : ";
cin >> box1.Height;
cout << "Enter Box 1 Width : ";
cin >> box1.Width;
cout <<... | TOOL | 0.954534 | 3.991553 |
d568ecbb-7d0a-45eb-aa19-ebbb96d2be32 | sanchit-sinha/CP | Contests/IITK-Contests/Deep Dive into CP/Combi+Constructive:contest/D/BRUTE/bad__Good.cpp | #include <bits/stdc++.h>
using namespace std;
#define endl '\n'
typedef long long int64;
typedef pair<int,int> pii;
typedef vector<int> vi;
const double eps = 1e-9;
const int oo = 0x3f3f3f3f;
const int mod = 1000000007;
struct point {
int x, y, z, ix;
bool operator<(const point &p) const {
if (x !... | ALGO | 0.999985 | 4.3906 |
f110797f-be1a-481d-9f6e-6c6435aedd21 | mdibuhossain/graphic.h_vscode_tamplate | Home/src/bresenham_line.cpp | #include <bits/stdc++.h>
#include <graphics.h>
using namespace std;
int main() {
int x1, y1, x2, y2, dx, dy, p;
int gd = DETECT, gm;
initgraph(&gd, &gm, "");
cout << "enter the value of x1,y1: ";
cin >> x1 >> y1;
cout << "enter the value of x2,y2: ";
cin >> x2 >> y2;
dx = abs(x1 - x2);
... | ALGO | 0.998132 | 3.403317 |
fefe2a06-6a39-41c5-b468-ae194442ae79 | hardik44ss/100-Days-of-Code | Day 53/deSorting.cpp | #include <bits/stdc++.h>
#include <numeric>
using namespace std;
int main(){
ios::sync_with_stdio(false);
cin.tie(0);
int T; cin >> T;
while (T--) {
int n; cin >> n;
vector<int> nums(n);
int diff = 1e9;
bool sorted = true;
for (int i = 0; i < n; i++) {
... | ALGO | 0.999948 | 4.420225 |
acc69c69-8204-4468-a160-5a4759e3d111 | Noymul-Islam/problems | quick sort.agian.cpp | #include<cstdio>
#include<cstring>
using namespace std;
void Qsort(int a[],int beg,int end);
int part(int a[],int beg, int end);
int main()
{
int a[100];
int n;
printf("How many data???\n\n");
scanf("%d",&n);
for(int i=1;i<=n;i++)
scanf("%d",&a[i]);
int beg=1,end=n;
Qsort(a... | ALGO | 0.999954 | 3.876722 |
3c4abb8e-1cbf-4a98-a0de-b055eb042564 | 113bommy/deepmind_codecontests_refine | cpp_gold_filter_file/cpp_train_10030_6.cpp | #include <bits/stdc++.h>
using namespace std;
int a, b, r;
int main() {
cin >> a >> b >> r;
if (a >= 2 * r && b >= 2 * r) {
cout << "First\n";
} else {
cout << "Second\n";
}
return 0;
}
| ALGO | 0.9999 | 4.030025 |
96295824-f28f-48da-9ba1-3aa2335ff684 | pmneila/PyTrw | trw/src/core/minimize.cpp | #include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include <assert.h>
#include "MRFEnergy.h"
#include <vector>
template <class T> int MRFEnergy<T>::Minimize_TRW_S(Options& options,
std::vector<int>& iterList,
... | ALGO | 0.999999 | 4.449591 |
a6d0d7e9-ccae-4da5-9b70-311760fce862 | Leshy4/Cpp17-REF-and-Practice | SOLUTIONS & Examples Chp 1-19/Chapter 08 Example/Ex8_09B.cpp | // Passing an array to a function - pass by reference improved
#include <iostream>
#include <array> // for std::size()
double average10(const double (&)[10]); // Function prototype
int main()
{
double values[] { 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0, 10.0 };
// double values[] { 1.0, 2.0, 3.0... | ALGO | 0.962315 | 6.345326 |
b8ee296b-a0bd-44c8-9202-9c31edfdbf40 | cerebropine/DSA | backtracking/palindrome_partition.cpp | #include<bits/stdc++.h>
using namespace std;
/*
Example 1:
Input: s = "aab"
Output: [["a","a","b"],["aa","b"]]
*/
class Solution {
public:
vector<vector<string>> result;
vector<vector<string>> partition(string s) {
vector<string> currentList;
dfs(s, 0, currentList);
return result;
... | ALGO | 0.999829 | 6.392718 |
0238de95-0f31-44cd-9904-da702214e5c2 | menaehab/Codeforces-Solutions | 0 - 1000 problems/Digits.cpp | #include <iostream>
using namespace std;
int main()
{
int n;
cin >> n;
string x;
for (int i = 0; i < n; i++)
{
cin >> x;
for (int j = size(x) -1; j >= 0; j--)
{
cout << x[j];
cout << " ";
}
cout << endl;
}
}
| ALGO | 0.999952 | 4.047281 |
18c96773-2f03-40dc-8acf-2327cacc4b70 | kellazo/PinballGame | Pinball/Box2D/Box2D/Common/b2Math.cpp | #include <Box2D/Common/b2Math.h>
const b2Vec2 b2Vec2_zero(0.0f, 0.0f);
/// Solve A * x = b, where b is a column vector. This is more efficient
/// than computing the inverse in one-shot cases.
b2Vec3 b2Mat33::Solve33(const b2Vec3& b) const
{
float32 det = b2Dot(ex, b2Cross(ey, ez));
if (det != 0.0f)
{
det = 1.0f... | ALGO | 0.999199 | 6.990869 |
bfc83ef9-07de-436a-add0-a73cad3c02b8 | jose-melo/competitive-programming-studies | Desafios/Aula20/E.cpp | #include <bits/stdc++.h>
using namespace std;
#define ll long long int
#define pii pair<int, int>
#define INF 0x3f3f3f3f
#define fi first
#define mp make_pair
#define se second
#define FI(n) for(int i = 0; i < n; i++)
#define FOR(i,a,n) for (int i=(a);i<(n);++i)
#define t cout << "TESTE" << endl
#define debug(x) if(o... | ALGO | 0.999881 | 4.208604 |
7c743984-c817-45d4-8a38-1b7176aa3a6b | bm-mit/Codeforces | 556A_CaseOfTheZerosAndOnes.cpp | //* 202780837 Apr/20/2023 13:04UTC+7 Minh4893IT A - Case of the Zeros and Ones GNU C++17 Accepted 62 ms 500 KB
#include <bits/stdc++.h>
using namespace std;
int main()
{
string s;
getline(cin, s);
getline(cin, s);
int count[2] = {};
for (auto c : s)
++count[c - '0'];
cout << abs(... | ALGO | 0.999989 | 5.149136 |
52545e46-0447-4901-a6a2-1699cb9146b1 | sheeluofficial/practice | OthersCode/LeetCode-Solutions-master/LeetCode-Solutions-master/C++/all-possible-full-binary-trees.cpp | // Time: O(n * 4^n / n^(3/2)) ~= sum of Catalan numbers from 1 .. N
// Space: O(n * 4^n / n^(3/2)) ~= sum of Catalan numbers from 1 .. N
/**
* Definition for a binary tree node.
* struct TreeNode {
* int val;
* TreeNode *left;
* TreeNode *right;
* TreeNode(int x) : val(x), left(NULL), right(NULL... | ALGO | 0.999982 | 6.809805 |
8083e814-11e8-4b10-a27e-066b35916805 | lorddlazaro/Seight | Seight/Seight/EuclideanHeightMeasure.cpp | #include "stdafx.h"
#include <iostream>
#include "EuclideanHeightMeasure.h"
#include <vector>
using namespace std;
using namespace cv;
EuclideanHeightMeasure::EuclideanHeightMeasure()
{
}
EuclideanHeightMeasure::~EuclideanHeightMeasure()
{
}
float EuclideanHeightMeasure::perform(Mat image)
{
cout << "in EuclideanH... | ALGO | 0.946384 | 3.401028 |
aa42faf9-64f5-4f85-921c-73a3685831a0 | AhmedMZaher/CP | A. Olesya and Rodion.cpp | #include <iostream>
#include <string>
#include<cmath>
using namespace std;
int main()
{
long long n,t;
cin>>n>>t;
if (n == 1 && t == 10)
{
cout << -1;
return 0;
}
if( t!=10){
for(int i=0;i<n;i++)cout<<t;
... | ALGO | 0.999601 | 3.375794 |
480443f6-54af-45a8-b2ae-777f5ec9a403 | reillypascal/RSAlgorithmicVerb | Source/FDNs.cpp | // Collection of FDN (feedback delay network) algorithms
#include "FDNs.h"
#include <cstddef>
GeneralizedFDN::GeneralizedFDN() = default;
GeneralizedFDN::GeneralizedFDN(int order, std::string type)
{
delayCount = order;
std::map<std::string, int> typeMapping
{
{ "Anderson", 1 },
{ "c... | ALGO | 0.998658 | 5.362744 |
f0a77e92-6d69-494b-9b72-7927366ec52c | AlexTheDagon/CPP | InfoArena/Sg1/main.cpp | #include <iostream>
#include <fstream>
using namespace std;
ifstream in("sg1.in");
ofstream out("sg1.out");
int n,k,d1,d2;
int dp[120][120][100];
void add(int l1,int c1,int l2,int c2)
{
int ii=1,t=0;
for(ii=1;ii<=dp[l1][c1][0] || ii<=dp[l2][c2][0] || t;++ii)
{
dp[l2][c2][ii]=((t+=dp[l1][c1][ii]+dp[l... | ALGO | 0.999642 | 3.407046 |
7574202d-784e-45f7-a8e0-5343749bfcf9 | sajalkumar07/MY-DSA | qustions/array/11rotatedarray.cpp | #include <iostream>
#include <algorithm>
using namespace std;
int main(){
int n;
cout<<"enter the size of array :";
cin>>n;
int arr[n];
cout<<"enter the elements of array : ";
for(int i=0; i<n; i++){
cin>>arr[i];
}
int k;
cout<<"amout of rotation : ";
cin>>k;
int ... | ALGO | 0.999886 | 3.99609 |
5dcbf4df-cd21-4392-abfa-72ef1ba75dd3 | mstolfig/sailing-simulator | source/extern/bullet3/src/BulletInverseDynamics/MultiBodyTree.cpp | #include "MultiBodyTree.hpp"
#include <cmath>
#include <limits>
#include <vector>
#include "IDMath.hpp"
#include "details/MultiBodyTreeImpl.hpp"
#include "details/MultiBodyTreeInitCache.hpp"
namespace btInverseDynamics {
MultiBodyTree::MultiBodyTree()
: m_is_finalized(false),
m_mass_parameters_are_valid(true),
... | ALGO | 0.955298 | 6.481207 |
6260d8d4-9e08-45cc-9a67-8653c87dc3f8 | Boklazhenko/itstephomework | ps/week7.1/task2/zorina/hw2.cpp | //Написать программу, выполняющую сортировку одномерного массива целых чисел методом вставок.
#include <iostream>
#include <stdlib.h>
#include <ctime>
using namespace std;
int main()
{
srand(time(NULL));
const int size = 20;
int arr[size];
for (int i = 0; i < size; ++i)
{
arr[i] = rand() % 100;
cout << arr[i... | ALGO | 0.999959 | 3.687078 |
54643a93-c600-4579-a131-51b8a52a2e26 | AbuzarAslam/pfweek7 | table.cpp | #include<iostream>
using namespace std;
main()
{
int number;
cout << "Enter number...";
cin >> number;
for(int num=1;num<=10;num=num+1)
{
cout << number << " * " << num << " = " << num*number << endl;
}
} | ALGO | 0.989605 | 3.165371 |
2ef919d1-b13f-4ea1-a2a5-b26673cb36dd | KMJ192/CodeStorage | cpp/code/programmers/brute_force/큰수만들기.cpp | #include<iostream>
#include<vector>
#include<string>
#include<queue>
using namespace std;
priority_queue<string> total;
vector<vector<int>> temp;
// ڿ, ڿ ߶ߵǴ ġ ִ 迭
string ExtractString(string object, vector<int> position) {
if (object.size() < position.size()) return "";
int cnt = 0;
string tmp;
... | ALGO | 0.999986 | 4.395561 |
e362fcf3-223f-41a5-9aa0-97abfdbc73ae | Pratyushkyadav/Competetive-Programming | Codeforces/Equal Candies.cpp | #pragma GCC optimize("O3,inline,unroll-loops,fast-math")
#pragma GCC optimize("aggressive-loop-optimizations")
#include <bits/stdc++.h>
using namespace std;
#define inf INT_MAX
#define infl 1e18
#define pb push_back
#define el '\n'
#define NO cout << "NO" << el
#define YES cout << "YES" << el
#define all(v) begin(v), ... | ALGO | 0.999714 | 5.690463 |
a0c0b10e-bb6f-4e51-a20a-0dd996c64dd9 | Smurtiakashjena-120/c-language | c lang/triangle side.cpp | #include<stdio.h>
int main()
{
int s1,s2,s3;
printf("enter the length of 1st side:");
scanf("%d",&s1);
printf("enter the length of 2nd side:");
scanf("%d",&s2);
printf("enter the length of 3rd side:");
scanf("%d",&s3);
if ((s1==s2 )&&(s2==s3))
{printf("it is an equilateral triangle");
}
else if ((s1==s2)|... | ALGO | 0.998622 | 3.318602 |
21f0ff6b-2429-4b45-a0f8-4e4316c2b117 | kajalk141/LeetCode-Solutions | 113-path-sum-ii/113-path-sum-ii.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.999942 | 5.953606 |
c39968c5-bf11-4fef-ad62-c89781c4083a | ishandutta2007/codeforces | -armageddon-/normal/1672/D.cpp | //Original Code:
//#include <self/utility>
//#include <self/debug>
//using namespace std;
//
//int n;
//int a[200005];
//int b[200005];
//int s[200005];
//void solve()
//{
// cin>>n;
// for(int i=0;i<n;i++)
// {
// scanf("%d",a+i);
// a[i]--;
// }
// for(int i=0;i<n;i++)
// {
// scanf("%d",b+i);
// b[i]--;
// s[i]... | ALGO | 0.999972 | 4.247925 |
d14d484c-48b7-4e37-9b23-ea887e6ef2ad | inovia/IronHSP | package/win32/android/extlib/src/BulletCollision/CollisionDispatch/btSphereTriangleCollisionAlgorithm.cpp | #include "btSphereTriangleCollisionAlgorithm.h"
#include "BulletCollision/CollisionDispatch/btCollisionDispatcher.h"
#include "BulletCollision/CollisionShapes/btSphereShape.h"
#include "BulletCollision/CollisionDispatch/btCollisionObject.h"
#include "SphereTriangleDetector.h"
#include "BulletCollision/CollisionDispatch... | ALGO | 0.994697 | 6.832207 |
c15663e2-cf14-4573-872d-735f8ebcb805 | alexandraback/datacollection | solutions_5640146288377856_1/C++/subhamdtu/stud.cpp | #include<bits/stdc++.h>
#define s(n) scanf("%d",&n)
#define sl(n) scanf("%lld",&n)
#define p(n) printf("%d\n",n)
#define ll long long
#define pb push_back
#define mp make_pair
#define LN 21
ll mod=1000000007;
using namespace std;
int main()
{
int t,i,p,j,r,c,n,w;
cin>>t;
for(p = 1 ;p<=t;++p)
{
cin... | ALGO | 0.999757 | 3.6233 |
88ef3250-ebd1-410d-bb7b-30e05bbcf4a9 | marunmurali/Autoware_AGV | src/autoware/core_perception/points_preprocessor/nodes/ray_ground_filter/ray_ground_filter.cpp | #include <iostream>
#include <algorithm>
#include <vector>
#include <ros/ros.h>
#include <sensor_msgs/PointCloud2.h>
#include <pcl_ros/point_cloud.h>
#include <pcl_conversions/pcl_conversions.h>
#include <pcl/point_types.h>
#include <pcl/features/normal_3d.h>
#include <pcl/features/normal_3d_omp.h>
#include <pcl/filter... | DATA | 0.938561 | 6.168523 |
7a13ddc0-da7b-4723-b736-9aa380498f21 | MeMrBerlin/Placement_help | Coding Platforms(codechef,codeforces,etc)/Codeforces/469_A.cpp | #include <bits/stdc++.h>
#include <vector>
#include <algorithm>
using namespace std;
int main()
{
int n;
cin >> n;
set<int> s1, s2;
set<int> s3;
for (int i = 1; i <= n; i++)
{
s3.insert(i);
}
int x;
cin >> x;
for (int i = 0; i < x; i++)
{
int a;... | ALGO | 0.999792 | 3.248529 |
bad4919c-a27c-426e-ab2a-709e66870c79 | VIPULSINGH18/Array-practice-DSA | 3aug.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.999963 | 6.008719 |
54bcfa8e-d59c-4a36-a540-a443d13c8860 | Ragu1313/Problems-Solved | 2215-finding-3-digit-even-numbers/2215-finding-3-digit-even-numbers.cpp | class Solution {
public:
vector<int> findEvenNumbers(vector<int>& digits) {
// sort(digits.begin(),digits.end());
vector<int> ans ;
int n = digits.size();
set<int> res ;
// for(int i : digits){
// if((i&1)==0){
// even.push_back(i);
// ... | ALGO | 0.999935 | 5.75729 |
91d07896-7936-473d-beb6-5a343572bceb | raincross7/code-similarity | codes/train_code/problem449/problem449_196.cpp | #include <bits/stdc++.h>
using namespace std;
#define ll int64_t
//ライブラリ始まり
//定数
//円周率
const double PI = 3.1415926535897932384;
//天井
const int INF = 1000000000; // = 10^9
const ll LINF = 1000000000000000; // = 10^15
//ABC文字列
const string ABC = "ABCDEFGHIJKLMNOPQRSTUVWXYZABC";
const string abc = "abcdefghijklmnopqr... | ALGO | 0.999545 | 4.039044 |
6ac574fc-5802-4c32-821a-94180a1a9b81 | cmershen1/water-questions | hdu/5965.cpp | #include<bits/stdc++.h>
using namespace std;
typedef long long ll;
const int maxn=11111;
const int mod=1e8+7;
char s[maxn];
int num[maxn],dp[maxn];
int main()
{
int T;
scanf("%d",&T);
while(T--)
{
scanf("%s",s);
int n=strlen(s);
for(int i=0;i<n;i++)
num[i+1]=s[i]-'0';... | ALGO | 0.999944 | 4.323003 |
ed19b5b8-03ed-4c69-ad11-0e6165ca8ca0 | moondemon68/cp | Codeforces/PastContests/1385/B.cpp | #include <bits/stdc++.h>
#define fi first
#define se second
#define pb push_back
#define mp make_pair
#define MOD 1000000007
#define INF 1234567890
#define pii pair<int,int>
#define LL long long
using namespace std;
int main () {
//clock_t start = clock();
ios_base::sync_with_stdio(false);
cin.tie(NULL);
... | ALGO | 0.999901 | 3.809278 |
e51af0f1-cf8c-4999-8aee-b1f2cb71886a | sharmadeepak1999/leetcode-problems | Geek's Training - GFG/geeks-training.cpp | //{ Driver Code Starts
#include <bits/stdc++.h>
using namespace std;
// } Driver Code Ends
class Solution {
public:
int maximumPoints(vector<vector<int>>& points, int n) {
// Code here
vector<int> dp(4, 0);
dp[0] = max(points[0][1], points[0][2]);
dp[1] = max(points[0][0], points[... | ALGO | 0.999755 | 5.786702 |
fa0db41c-7bd6-4506-a926-c1bd56400433 | ishandutta2007/codeforces | danya090699/normal/1334/E.cpp | #include <bits/stdc++.h>
#define int long long
using namespace std;
const int mod=998244353, sz=100;
int fact[sz], rev[sz];
int po(int x, int y)
{
int re=1;
while(y)
{
if(y&1) re=re*x%mod;
y>>=1;
x=x*x%mod;
}
return re;
}
main()
{
fact[0]=1, rev[0]=1;
for(int a=1; a<s... | ALGO | 0.999808 | 4.97839 |
b822dd27-2b2d-4c1b-91ac-b5bc50cef374 | Ashish-Chokhani/Competitive_Programming | Codeforces/1203B.cpp | #include <bits/stdc++.h>
using namespace std;
void solve()
{
int n;
cin >> n;
vector<int> arr(4*n);
map<int, int> mp;
for (int i = 0; i < 4*n; i++)
{
cin >> arr[i];
mp[arr[i]]++;
}
for (auto it : mp)
{
if (it.second % 2 != 0)
{
cout << "NO... | ALGO | 0.999685 | 4.138701 |
afba5199-0e07-4642-863a-0b87df730860 | adityachivu/competitive | codeforces/contests/332/a.cpp | #include <iostream>
using namespace std;
int main() {
long long int a, b, c;
cin >> a >> b >> c;
long long int arr[4] = {a+b+c, 2*(a+b), 2*(a+c), 2*(b+c)};
long long int mini = 10000000;
for ( int i = 0; i < 4; i++)
{
if ( arr[i] < mini )
mini = arr[i];
}
cout << mini;
return 0;
}
| ALGO | 0.999907 | 3.561151 |
019ba309-839e-45db-a434-0d416223e05f | ishandutta2007/codeforces | qwqcorz/normal/1438/C.cpp | #include<bits/stdc++.h>
using namespace std;
int read()
{
int s=0;
char c=getchar(),lc='+';
while (c<'0'||'9'<c) lc=c,c=getchar();
while ('0'<=c&&c<='9') s=s*10+c-'0',c=getchar();
return lc=='-'?-s:s;
}
void write(int x)
{
if (x<0)
{
putchar('-');
x=-x;
}
if (x<10) putchar(x+'0');
else
{
write(x/10);
... | ALGO | 0.999931 | 3.352038 |
5b59a403-5548-4784-8b29-f10e43909f65 | ambujtripathi988/Coding | LeetCode/Permutations Method 1(Using Mapping Array).cpp |
// https://leetcode.com/problems/permutations/
// Method 1 : Using Mapping Array :
// Time Complexity : O(N! * N)
class Solution {
public:
void subset(vector<int>& nums , vector<int>& ds , vector<vector<int>>& ans , vector<int>& arr)
{
if(ds.size() == nums.size())
{
ans.push_... | ALGO | 0.999991 | 6.846262 |
cb230279-dd9c-429e-b3e9-cd5515a06878 | Daria228-016/artificial---intelligence | AI.cpp | #include "AI.h"
void AI::train(int dividend, int divisor, int expectedResult) // Добавляем обучающие данные в вектор
{
trainingData.push_back(make_tuple(dividend, divisor, expectedResult));
}
int AI::predict(int dividend, int divisor) // Простой алгоритм: возвращаем остаток от деления
{
return dividend ... | ALGO | 0.910243 | 3.280871 |
8ce0b799-4253-4798-b375-f2e160d0c167 | vihaanrao/225honors | 05/prefix_sum.cpp | #include <iostream>
#include <vector>
#include <omp.h>
#include <chrono>
#include <fstream>
void parallel_prefix_sum(std::vector<int>& arr, int N) {
#pragma omp parallel for
for (int i = 1; i < N; ++i) {
arr[i] += arr[i - 1];
}
}
void measure_performance(int N, int num_threads, std::ofstream& file... | ALGO | 0.995992 | 6.735514 |
f111d0f2-bd47-4f3f-96e6-59335ed84542 | alreadySagor/XPSC-Batch-4 | Week_1/Day_1/B_Counting.cpp | /**
* author: SAGOR AHMED
* created: M A R C H , 2024
**/
#include <bits/stdc++.h>
using namespace std;
int main() {
ios::sync_with_stdio(false);
cin.tie(0);
int a, b;
cin >> a >> b;
int total = 0;
if (a < b) {
for (int i = a; i <= b; i++) {
total++;
... | ALGO | 0.999921 | 4.11396 |
f5b87f68-b6fe-44dc-81af-dc7a67167391 | ryan-4u/DSA-cpp- | Basics/Source-01-CollegeWallah/Array/Lec Problems/3/PrefixSum.cpp | #include<iostream>
#include <vector>
using namespace std ;
int main ()
{
int n ;
cout<<"Enter No of elements in array: ";
cin>>n;
vector<int> v ;
cout<<"Enter Elements : ";
for(int i=0; i<n ;i++)
{
int ele;
cin>>ele;
v.push_back(ele);
}
for(int i=1 ; i<n;i++)
... | ALGO | 0.99917 | 3.563054 |
13ffc5f1-a618-4e21-8f57-73777a5ce23c | RitchieLab/biobin | tags/2.0.3/updater/loki/loadPops/ldspline/src/ldspline/snpspline.cpp | #include "snpspline.h"
#include <algorithm>
#include <iostream>
#include <assert.h>
namespace Spline {
SnpSpline::SnpSpline(int idx, int rsid, int pos, uint64_t offset) :pos(pos), rs(rsid), idx(idx), offset(offset), usIdx(0), dsIdx(0), pins(0) {}
SnpSpline::~SnpSpline() {}
void SnpSpline::AddStatsUpstream(int idx, ... | DATA | 0.953767 | 5.758937 |
ac35b4c3-89a9-4bc3-b3b8-e9fafd5f7618 | sachinbarupal/LeetCode-Solutions | 2698. Find the Punishment Number of an Integer/2698. Find the Punishment Number of an Integer.cpp | class Solution {
public:
bool isPunishNum = false;
void isValid(string &dig,int &n,int i,int sum){
if(sum==n and i>=dig.size()){
isPunishNum = true;
return;
}
for(int k=i;k<dig.length();++k){
string subs = dig.substr(i, k-i+1);
int... | ALGO | 0.99948 | 4.724353 |
68982641-6ccf-41c0-ba07-124a5db3415e | mohammadarif-github/Daily_solved.cpp | Week 14/Day 7/C_Very_Easy_Task.cpp | /*
Author :--
!~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~!
| |
| |
| cout<< "MOHAMMAD ARIFUL ISLAM"<< endl |
| |
| |
!~~~~~~~~... | ALGO | 0.999832 | 3.349417 |
4294d7e6-4a20-43da-b35a-cc07f1647f6e | Briancbn/trashy-splashy | cpg/include/CPG.cpp | /*
* CPG.cpp
*
* Created on: 17 Mar 2018
* Author: Chen Bainian
*/
#include "CPG.h"
#include <iostream>
namespace CPG {
CPG::CPG(int8_t _joint_num, float _frequency, float _alpha, float _beta, float _mu, float _update_interval, const std::vector<float>& initial_amplitude, const std::vector<float>& initial... | ALGO | 0.998321 | 4.890265 |
6737df93-f1bc-4c49-8f99-2f7e990b0549 | pokedigi596/NTU-CSIE-Computer-Vision-2019 | HW04/main.cpp | #include<cstdio>
#include<cstdlib>
#include<cmath>
#include<fstream>
#include<opencv2/core/core.hpp>
#include <opencv2/highgui/highgui.hpp>
#include<opencv2/imgproc/imgproc.hpp>
using namespace cv;
void binarize(Mat img)
{
for (int i = 0; i < img.rows; i++)
{
for (int j = 0; j < img.cols; j++)
{
img.at<ucha... | ALGO | 0.920341 | 4.690366 |
b65dd7f2-be94-4084-afd4-490f399fda7d | RedstonedLife/CameraOn | BSSLF/src/main/java/com/weilerhaus/productKeys/ProductKeySectionWorker.cpp | #include <string>
#include <iostream>
#include "ProductKeySectionWorker.h"
int BasicProductKeySectionWorker::buildProductKeySection(long seed, BasicProductKeyEncodingData &encodingData) {
int a = (int)(((int)encodingData->getA()) % 25);
int b = (int)(((int)encodingData->getB()) % 3);
if(((int)a) % == 0) {
... | ALGO | 0.987493 | 4.199138 |
3db694d2-6138-465b-8b05-87feefa82fb5 | Bishtashish/parallel_workspace | activity-lcs/lcs/lcs2.cpp | #include <stdio.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>
#include <iostream>
#include <unistd.h>
#include <chrono>
#include "par_loop.hpp"
#include <mutex>
#include <thread>
#include <omp.h>
#ifdef __cplusplus
extern "C" {
#endif
void generateLCS(char* X, int m, char* Y, int n);
void che... | ALGO | 0.998704 | 4.46131 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.