uuid string | repo_name string | relative_path string | content string | category string | algo_rel_score float64 | quality_score float64 |
|---|---|---|---|---|---|---|
80f7ef6e-e50c-40cb-bcce-4648a289a70b | NewProggie/ShapePP | libshapepp/thirdparty/eigen-2.3.9/bench/sparse_dense_product.cpp |
//g++ -O3 -g0 -DNDEBUG sparse_product.cpp -I.. -I/home/gael/Coding/LinearAlgebra/mtl4/ -DDENSITY=0.005 -DSIZE=10000 && ./a.out
//g++ -O3 -g0 -DNDEBUG sparse_product.cpp -I.. -I/home/gael/Coding/LinearAlgebra/mtl4/ -DDENSITY=0.05 -DSIZE=2000 && ./a.out
// -DNOGMM -DNOMTL -DCSPARSE
// -I /home/gael/Coding/LinearAlgebr... | ALGO | 0.996695 | 4.386344 |
fc904764-0d3c-45d3-b4f2-9636b2c7169f | IftakhirNibir/CPlusPlus-overview | part3/5.cpp | /* This is a example of how to take test case input*/
#include<bits/stdc++.h>
using namespace std;
int main()
{
int t;
cin>>t;
while(t--){
int a,b;
cin>>a>>b;
cout<<a+b;
}
} | ALGO | 0.998268 | 5.190563 |
15a88787-fa92-4042-9a24-721df639d9f6 | Aishwarypatle/DSA_Revision | Patterns/Pattern8.cpp | #include <iostream>
using namespace std;
void pattern(int n){
for(int i= 0 ;i < n ; i++){
for(int j=0; j<i ; j++){
cout << " " ;
}
for(int k=1; k<2*n - 2* i ; k++){
cout << "*" ;
}
for(int j=0; j<i ; j++){
cout << " " ;
}
... | ALGO | 0.999931 | 4.557001 |
aae22a31-fb68-416d-a7dc-2b919d517588 | Tanya401/StriversSDESheetChallenge | Power set.cpp | #include <bits/stdc++.h>
void find(int ind,int n,vector<int>temp,vector<vector<int>>&ans,vector<int>&v){
if(ind == n){
ans.push_back(temp);
return;
}
find(ind+1,n,temp,ans,v);
temp.push_back(v[ind]);
find(ind+1,n,temp,ans,v);
temp.pop_back();
}
vector<vector<int>> pwset(vecto... | ALGO | 0.999908 | 4.976755 |
2242df2f-9d36-4f39-aaa3-36ff715b47b9 | rahulgarg55/LeetCode-GeeskforGeeks-Hustle | remove-element/remove-element.cpp | class Solution {
public:
int removeElement(vector<int>& nums, int val) {
int j=0;
for(int i=0;i<nums.size();i++){
if(nums[i]!=val){
nums[j++]=nums[i];
}
}
return j;
}
}; | ALGO | 0.999373 | 5.996996 |
1d309a34-d534-4f9a-9224-d90ccd5661a6 | Ritesh-Bommaraju/Practice | 700-search-in-a-binary-search-tree/700-search-in-a-binary-search-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.999992 | 6.164828 |
d8358a34-2bee-4ac6-8be8-98f5d701c54a | itsmemdtofik/CPP | Arrays/Easy/RotateArrayRight.cpp | /**
* <pre>
* !Rotate array by D positions to the right (clockwise).
*
* Given an array of integers arr[] of size n, the task is to rotate the array
* elements to the right by d positions.
*
* Examples:
*
* Input: arr[] = {1, 2, 3, 4, 5, 6}, d = 2
* Output: {5, 6, 1, 2, 3, 4}
* Explanation:
* After first ri... | ALGO | 0.999847 | 6.995061 |
b637952f-b930-467e-bd03-2a45fccef968 | chapuni/llvm-project-legacy | klee/lib/Core/SeedInfo.cpp | #include "Common.h"
#include "Memory.h"
#include "SeedInfo.h"
#include "TimingSolver.h"
#include "klee/ExecutionState.h"
#include "klee/Expr.h"
#include "klee/util/ExprUtil.h"
#include "klee/Internal/ADT/KTest.h"
using namespace klee;
KTestObject *SeedInfo::getNextInput(const MemoryObject *mo,
... | ALGO | 0.973097 | 5.832922 |
98a91d04-e386-46f5-837c-46e82d651cfa | fhvirus/CodeArchive | Kattis/jewelrybox.cpp | #include<iostream>
#include<iomanip>
#include<cmath>
using namespace std;
double box(double x, double y){
double h1 = ((x + y) + sqrt(x * x - x * y + y * y)) / 6;
double h2 = ((x + y) - sqrt(x * x - x * y + y * y)) / 6;
if(h1 < 0)return h2 * (x - 2 * h2) * (y - 2 * h2);
else if(h2 < 0)return h1 * (x - 2 * h1) * (y... | ALGO | 0.999959 | 4.000844 |
e50edc8f-a37d-4752-bb94-f609c65f8648 | Jeffrey95/a2oj | 1300/61A.cpp | #include <cstdio>
#include <cstdlib>
#include <string.h>
#include <string>
#include <math.h>
#include <algorithm>
#include <iostream>
#include <queue>
#include <stack>
#include <map>
#include <set>
typedef long long ll;
using namespace std;
int main()
{
#ifdef local
freopen("in.txt", "r", stdin);
//freopen("out.txt"... | ALGO | 0.999949 | 3.544207 |
c413413d-0f73-4c3d-8570-7b78de4f95ab | riceroll/MylarFilmSimulator | lib/libigl/include/igl/extract_manifold_patches.cpp | template<
typename DerivedF,
typename DerivedEMAP,
typename uE2EType,
typename DerivedP>
IGL_INLINE size_t igl::extract_manifold_patches(
const Eigen::PlainObjectBase<DerivedF>& F,
const Eigen::PlainObjectBase<DerivedEMAP>& EMAP,
const std::vector<std::vector<uE2EType> >& uE2E,
Eigen::PlainObjectBase<De... | ALGO | 0.953253 | 4.04915 |
81a8d0e9-d39f-42d4-a4b1-5d3cbe9c7561 | sarvex/leetcode-cobol | solution/0800-0899/0831.Masking Personal Information/Solution.cpp | class Solution {
public:
string maskPII(string s) {
int i = s.find('@');
if (i != -1) {
string ans;
ans += tolower(s[0]);
ans += "*****";
for (int j = i - 1; j < s.size(); ++j) {
ans += tolower(s[j]);
}
return an... | ALGO | 0.987877 | 5.512073 |
74a2e733-695d-421d-8852-772e19612d0c | stellakang/PS | scpc/pre_5-2_02.cpp | #include <iostream>
using namespace std;
int Answer;
int score[5005];
int main(int argc, char** argv)
{
int T, test_case;
scanf("%d",&T);
for(test_case = 0; test_case < T; test_case++)
{
int n;
scanf("%d",&n);
Answer = 0;
int a[n+1], b[n+1];
int similarity = 0;
for(int... | ALGO | 0.999896 | 3.89687 |
192eb706-1e4d-4ea5-afca-39d43a5cc476 | ajay-2344/DSA | 01_C_C++_Essential_Concepts/10_StructureAndFunctions.cpp | #include<bits/stdc++.h>
using namespace std;
struct Rectangle {
int length;
int breadth;
};
// Call by address
void initializeStruct(struct Rectangle *r, int l, int b) {
r -> length = l;
r -> breadth = b;
}
// Call by value
int area(struct Rectangle r) {
return (r.length * r.breadth);
}
// Call ... | TOOL | 0.888534 | 4.442824 |
b0579b33-e35e-4c60-b6b5-b7975d91498f | divyadhimaan/leetcoding | 482-license-key-formatting/482-license-key-formatting.cpp | class Solution {
public:
string licenseKeyFormatting(string s, int K) {
string res;
for (auto i = s.rbegin(); i < s.rend(); i++)
if (*i != '-') { // ignore '-' in original string
if (res.size()%(K+1) == K)
res += '-'; // every (K+1)th char is '-' from tail
... | ALGO | 0.999705 | 6.020063 |
c07df6e3-767b-4f1c-9221-8f1546057b7b | Lim-YongKwan/Algorithm | 백준/BOJ_2448.cpp | #include<iostream>
#define endl "\n"
using namespace std;
char star[10000][10000];
void fold(int y, int x, int size){
if(size > 3){
fold(y ,x ,size/2 );
fold(y + size / 2 ,x - size / 2 ,size/2);
fold(y + size / 2, x + size / 2 ,size/2);
return;
}
star[y][x] = '*';
s... | ALGO | 0.999993 | 3.510624 |
54f50827-136c-48e4-afaa-cf4858fdd79d | sarvex/leetcode-nelua | solution/1800-1899/1819.Number of Different Subsequences GCDs/Solution.cpp | class Solution {
public:
int countDifferentSubsequenceGCDs(vector<int>& nums) {
int mx = *max_element(nums.begin(), nums.end());
vector<bool> vis(mx + 1);
for (int& x : nums) {
vis[x] = true;
}
int ans = 0;
for (int x = 1; x <= mx; ++x) {
int g... | ALGO | 0.999915 | 5.836481 |
88fbc48d-ba2e-4c73-830e-b164741c3913 | jcsaborio/MDP-Planning | ValueIteration/src/vi.cpp | #include "vi.h"
using std::cout;
using std::endl;
VI::VI(VI_PARAMS& params, Maze * maze){
PlanParams.discount = params.discount;
PlanParams.error = params.error;
this->maze = maze;
numActions = maze->getNumActions();
numStates = maze->getRows()*maze->getCols();
V = new double[numState... | ALGO | 0.99756 | 5.2914 |
23231176-3857-42fc-aa0c-7260f42e8d85 | YikHoe/Data_Structure_GA_2402 | Project1/LinkedList.cpp | // References and sources of adapted codes
//
// Agarwal, S. (2021, November 11). Binary Search on Linked List. Naukri.
// https://www.naukri.com/code360/library/binary-search-on-linked-list
//
// GeeksforGeeks. (2013, June 28). QuickSort on Singly Linked List. GeeksforGeeks.
// https://www.geeksforgeeks.org/quick... | ALGO | 0.999975 | 5.905766 |
1b2a712e-1074-4256-9585-a6c76326c7c9 | hzfsls/leetcode-supercrawl | data/0560.subarray-sum-equals-k/code_snippets/sol.cpp | class Solution {
public:
int subarraySum(vector<int>& nums, int k) {
}
}; | ALGO | 0.999754 | 5.991801 |
4de705c1-364e-4e65-9d69-b48bcca95e4a | CSE71/Coding-in-Cpp | Coding/GFG/Strings/String Rotate.cpp | #include<iostream>
using namespace std;
void checkme(string a,string b)
{
int len = a.length();
if(a.length()!=b.length())
{
cout<<0;
return;
}
string first = "",second = "";
first+= b.substr(len-2,2)+b.substr(0,len-2);
second+= b.substr(2,len)+b.substr(0,2);
if(a.c... | ALGO | 0.999932 | 4.297537 |
82b58520-e725-4a92-9997-324428f5c744 | TheCloudlet/leetcode-in-cpp | dynamic-programming/213-house-rober/1-recursive.cpp | /*
* [1,2,3,1]
*
* Think process:
* position p: std::max(cost[p - 2] + cost, cost[p - 1])
*/
class Solution {
public:
int rob(vector<int>& nums) { return maxMoney(nums, nums.size() - 1); }
int maxMoney(std::vector<int> nums, int p) {
if (p < 0) return 0;
return std::max(maxMoney(nums, p - 1), maxMon... | ALGO | 0.999915 | 5.854404 |
b295db8e-791b-4c48-8c11-0dd5c1307b11 | HanbiJang/CodingTestStudy | Other_Problem/백준/Class 2/1259 팰린드롭수/main.cpp | #include <iostream>
#include <vector>
#include <string>
#include <algorithm>
using namespace std;
int main(){
//տ = ڿ ãƶ
int a;
while(1){
cin>>a;
if(a==0) {
//cout<<"yes";
break;
}
int a_ = a;
int tmp=0;
while(a!=0){
tmp = tmp*10 +(a%10);
a/=10;
}
if(tmp==a_) cout<<"y... | ALGO | 0.999951 | 4.259917 |
a8dd3024-02a5-4315-972e-7c83be44ae2d | Wolfiek19/Terminal-Chess-App | pieces.cpp | #include "pieces.h"
#include <iostream>
using namespace std;
Knight::Knight(){
x_knight = 3;
y_knight = 0;
}
bool Knight::Move(int x_knight, int y_knight){
if(x_knight < 0 || x_knight > 9 || y_knight < 0 || y_knight >9){
cout << "This move is out of range" << endl;
return false;
}
... | ALGO | 0.950897 | 3.707477 |
105798cf-1259-406f-affc-8a935b2dafa1 | Edith-vis/Algorithm-Notes | 第10章 提高篇(4)--图算法专题/10.3 图的遍历/A1021DeepestRoot.cpp | #include <iostream>
#include <vector>
#include <algorithm>
#include <cstring>
using namespace std;
#define maxn 100010
int n;
vector<int> G[maxn];
int father[maxn];
bool isRoot[maxn];
bool vis[maxn];
int findFather(int x) {
int a = x;
while (x != father[x]) {
x = father[x];
}
while (a != fat... | ALGO | 0.999985 | 4.203588 |
8f7073bc-a560-4b13-bfa0-f4d6c90f1eae | prakharjain31/SAT-SOLVER | dpll.cpp | #include <bits/stdc++.h>
using namespace std;
int sgn(int x)
{
if(x > 0)
{
return 1;
}
else if(x < 0)
{
return -1;
}
return 0;
}
int check(vector<vector<int> > clauses, vector<int> model)
{
int count = 0;
for(auto clause : clauses)
{
for(auto literal : ... | ALGO | 0.998928 | 5.336479 |
fc59c479-676f-4382-82ed-863bd130ce80 | ivansaul/instagram_page_indicator | 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.998848 | 6.76073 |
c06e1901-d0fd-46ab-86e9-a04b662cf21d | HanpyBin/CP-Note | leetcode/双指针/剑指 Offer 52. 两个链表的第一个公共节点/快慢指针.cpp | /**
* Definition for singly-linked list.
* struct ListNode {
* int val;
* ListNode *next;
* ListNode(int x) : val(x), next(NULL) {}
* };
*/
class Solution
{
public:
ListNode *getIntersectionNode(ListNode *headA, ListNode *headB)
{
// double pointer
int cntA = 0, cntB = 0;
... | ALGO | 0.999461 | 5.228227 |
9e2b013e-c9db-4dc9-8626-b97e7b837096 | priyanshuid/practice-codes | pracPATHadj.cpp | /*This Program Finds A Path From The Given Starting Point To The Given Destination Point And Returns Appropriate Message If Path Does Not Exists*/
/*
On Summer May-03-2013
Reference- Application Of Graph Theory By Vinod Chandra
*/
#include <iostream>
#include <stdio.h>
#include <algorithm>
#include <vector>
us... | ALGO | 0.999655 | 4.182266 |
807233f1-d4ec-4fcb-bf24-218d54ee641e | adarsh1722/Daily-Problems | 1091-shortest-path-in-binary-matrix/1091-shortest-path-in-binary-matrix.cpp | class Solution {
public:
int shortestPathBinaryMatrix(vector<vector<int>>& grid){
if(grid[0][0] == 1){
return -1;
}
int m = grid.size() , n = grid[0].size();
queue<pair<int , int>>q;
int dx[] = {1, 1, 0, -1, -1, -1, 0, 1};
int dy[] = {0, 1, 1, 1,... | ALGO | 0.999996 | 6.057899 |
f03802c8-bebe-422e-9cfa-4e6b5d990057 | Chan531/BaekJoon_Online_Judge | 숫자놀이_1755.cpp | #include <iostream>
#include <vector>
#include <string>
#include <algorithm>
using namespace std;
vector<pair<string, int>> arr;
string eng(char c)
{
switch (c)
{
case '0':
return "zero";
case '1':
return "one";
case '2':
return "two";
case '3':
return "three";
case '4':
return "four";
ca... | ALGO | 0.999518 | 4.440092 |
d77f0330-84da-4a65-a193-1afff246b5bd | 846754497THK/ACM-tools-and-skills | tools/gjd/chu_low.cpp | #include <iostream>
#include <string>
#include<bits/stdc++.h>
using namespace std;
const int MAX = 101;
int main(int argc, const char * argv[]) {
int b, i, la, lc, x;
string str;
int a[MAX], c[MAX];
while(cin >> str >> b) {
memset(a, 0, sizeof(a));
memset(c, 0, sizeof(c));
la = ... | ALGO | 0.99928 | 3.594881 |
b7b07b77-ed3a-4b88-8153-aadad9917a84 | vijaymanikantareddy/LeetCode_GFG_solved | Difficulty: Medium/Merge Without Extra Space/merge-without-extra-space.cpp | //{ Driver Code Starts
#include <bits/stdc++.h>
using namespace std;
// } Driver Code Ends
class Solution {
public:
void mergeArrays(vector<int>& a, vector<int>& b) {
// code here
int i = a.size()-1, j = 0;
while(i >= 0 && j < b.size()){
if(a[i] > b[j]){
swap(a... | ALGO | 0.999629 | 6.543753 |
6d6f6437-b5ee-4962-95af-84189e097126 | Iepak-001/A2OJ-Ladders | littleGirlandGame.cpp | #include<bits/stdc++.h>
using namespace std;
// Each letter frequency is to be stored
// Now how can we check if a palindrome can be formed from freq arr
// if oddFreqCount==0 => Frst will win
// if odd freq=1 => first will remove one char and win
// If oddCount is odd => first will win
// else Second will win
int ma... | ALGO | 0.999998 | 5.203696 |
d5f8d0a3-b43f-4226-934c-469fc1056310 | Chaomin702/leetcode | MinStack/main.cpp | #include <iostream>
#include <vector>
#include <stack>
using namespace std;
class MinStack {
public:
void push(int x) {
_data.push(x);
if (_min.empty() || x <= getMin())
_min.push(x);
}
void pop() {
if (top() == getMin())
_min.pop();
_data.pop();
}
int top() {
return _data.top();
}
int getM... | ALGO | 0.999336 | 5.178093 |
7c9100a1-25ba-4ed4-b041-c8bcbacfb077 | yashika008/Cpp-codes | Sorting/MergeSort.cpp |
#include <iostream>
using namespace std;
void Merge(int A[], int low, int mid, int high){
int i = low;
int j = mid+1;
int k = low;
int B[high+1];
while (i <= mid && j <= high){
if (A[i] < A[j]){
B[k++] = A[i++];
} else {
B[k++] = A[j++];
}
}
... | ALGO | 0.99999 | 4.986611 |
4d628109-b2d1-4c84-b4a9-9ad74e4a887b | valderyaya/Competitive-Programming | TIOJ/1078.cpp | //#pragma GCC optimize("Ofast,unroll-loops,no-stack-protector,fast-math")
#include<bits/stdc++.h>
//#include<bits/extc++.h>
//using namespace __gnu_pbds;
using namespace std;
typedef long long ll;
#define F first
#define S second
#define pb push_back
#define em emplace_back
#define REP(i,n) for(register int i=0;i<(n);+... | ALGO | 0.999957 | 3.96416 |
b68332bb-648f-4672-a5de-45be055bb788 | raincross7/code-similarity | codes/train_code/problem312/problem312_169.cpp | #include<iostream>
#include<iomanip>
#include<vector>
#include<string>
#include<cstring>
#include<map>
#include<set>
#include<queue>
#include<stack>
#include<algorithm>
#include<cmath>
#include<cstdio>
#include<cstdlib>
#include<climits>
#include<fstream>
#define MOD (1000000007)
using namespace std;
typedef long lo... | ALGO | 0.999997 | 3.988355 |
9269a314-5133-4461-9a1e-819fb88d75a1 | Yash-Handa/ds-algo | Sorting/Kth_Smallest_Element.cpp | #include <iostream>
#include <vector>
using namespace std;
template <typename T>
T lomuto(T b, T e)
{
T i = b - 1, j = b;
int pivot = *e;
while (j < e)
{
if (*j < pivot)
{
i++;
swap(*i, *j);
}
j++;
}
i++;
swap(*i, *e);
return i;
}... | ALGO | 0.999988 | 5.084356 |
c661a8b2-5228-44c8-a105-145f7f219b70 | wtomtom/dd | src/rpcblockchain.cpp | #include "checkpoints.h"
#include "main.h"
#include "rpcserver.h"
#include "sync.h"
#include "util.h"
#include <stdint.h>
#include "json/json_spirit_value.h"
#include "utilmoneystr.h"
#include "base58.h"
using namespace json_spirit;
using namespace std;
extern void TxToJSON(const CTransaction& tx, const uint256 has... | WEB | 0.895997 | 6.0343 |
bd86e188-b85f-4ad3-a155-85ef1b6c432f | Maslyatiy/Lists- | 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.9988 | 6.76073 |
117c3869-8aee-47d3-9f6e-1ee07a394499 | Sarthak20Shukla/DSA | LINKED LIST/deleteHead of a doublell.cpp | //deleteHead of a doublell
#include<bits/stdc++.h>
using namespace std;
/*
Following is the class structure of the Node class:
class Node
{
public:
int data;
Node *next;
Node *prev;
Node()
{
this->data = 0;
next = NULL;
prev=NULL;
}
Node(int data)
{
thi... | ALGO | 0.995541 | 3.679576 |
e61e55c4-908c-4237-a851-7aa1a135eef0 | YitongLI2000/ndnSIM-cfnagg | src/ndnSIM/utils/topology/annotated-topology-reader.cpp | /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
// Based on the code by Hajime Tazaki <<EMAIL>>
#include "annotated-topology-reader.hpp"
#include "ns3/nstime.h"
#include "ns3/log.h"
#include "ns3/assert.h"
#include "ns3/names.h"
#include "ns3/net-device-container.h"
#include "ns3/point-to-point-hel... | TOOL | 0.888617 | 4.516999 |
378ea51c-6b64-46f4-ab71-0a1a42440142 | akgmage/data-structures-and-algorithms | Arrays/sign_of_the_product_of_an_array.cpp | // Leetcode 1822 : Sign of the Product of an Array
/*
QUESTION
There is a function signFunc(x) that returns:
1 if x is positive.
-1 if x is negative.
0 if x is equal to 0.
You are given an integer array nums. Let product be the product of all values in the array nums.
Return signFunc(product).
Example 1:
Input: nums ... | ALGO | 0.999903 | 6.710776 |
d2b9d61d-1100-4fe8-bf74-131971b69714 | Mansi05403/CompetitiveProgramming-Codes | Tom_and_Jerry_Chase.cpp | // author : Mansi Agarwal
// 2023-03-23 16:19:25
#include <iostream>
#include <bits/stdc++.h>
using namespace std;
#define int long long int
void solve()
{
int x,y;
cin>>x>>y;
if(x>=y)
cout<<"no"<<endl;
else
cout<<"yes"<<endl;
}
signed main()
{
int t = 1;
cin >> t;
while (t--)
... | ALGO | 0.999886 | 5.12932 |
6adda3e4-99ac-45f0-a4cd-eb9acd350dbf | shivampatel0048/DSA-Practic | Chapter 1 Mathematics/lec-11.cpp | #include <iostream>
#include <vector>
using namespace std;
bool isPrime(int n)
{
for (int i = 2; i < n; i++)
{
if (n % i == 0)
{
return false;
}
}
return true;
}
// void printprime(int n)
// {
// for (int i = 2; i <= n; i++)
// {
// if (isPrime(i))
/... | ALGO | 0.999904 | 4.867269 |
2810addd-4a0c-4ebd-8cd0-5109e69ac9a7 | ishandutta2007/codeforces | teja349/normal/779/B.cpp | //teja349
#include <bits/stdc++.h>
#include <vector>
#include <set>
#include <map>
#include <string>
#include <cstdio>
#include <cstdlib>
#include <climits>
#include <utility>
#include <algorithm>
#include <cmath>
#include <queue>
#include <stack>
#include <iomanip>
//setbase - cout << setbase (16); cout << 100 << end... | ALGO | 0.999798 | 3.224725 |
1ae55015-f204-487e-a6b4-ec430d43526b | KaizoIncc/ESIN_PROJECT | driver_joc_par.cpp | #include <iostream>
#include <fstream>
#include <string>
#include <list>
#include <esin/error>
#include <esin/gen_driver>
#include <esin/util>
#include "anagrames.hpp"
#include "diccionari.hpp"
#include "iter_subset.hpp"
#include "obte_paraules.hpp"
#include "word_toolkit.hpp"
using util::nat;
using util::byte;
usin... | TOOL | 0.89947 | 5.224265 |
bbb02c96-ddf2-42d8-8f54-086aac37736d | UswaArif/PF-programs | week4/class2/c2.cpp | #include<iostream>
using namespace std;
void SevenBoom(int arr[10],int n);
main()
{
int a[10];
int num;
cout<<"Enter the number for the array:";
cin>> num;
for(int x=0; x<num; x++)
{
cout<<"Enter the number:";
cin>> a[x];
}
SevenBoom(a,num);
}
void SevenBoom(int arr[1... | ALGO | 0.993012 | 3.79223 |
eb692e67-131b-45b4-99e8-3a0e89ce6046 | Zenfeuer/algorithms | quicksort_3_way-partition.cpp | #include <iostream>
#include <vector>
#include <stdlib.h>
using namespace std;
void sort3(vector<long> &numbers, long lo, long hi)
{
if (hi <= lo) return;
long lt = lo, gt = hi;
long v = numbers[lo];
long i = lo;
while (i <= gt)
{
if (numbers[i] < v) swap(numbers[lt++], numbers... | ALGO | 0.999976 | 4.088226 |
0fc78b88-24e9-4b25-84e2-fa1bb3cfdf92 | Mann-gupta1/-45dayschallengeby-arshgoyal | Find-the-duplicate.cpp | class Solution {
public:
int findDuplicate(vector<int>& nums) {
int n = nums.size();
for (int i = 0; i < n; i++) {
int curr = abs(nums[i]);
if (nums[curr] < 0) {
return curr;
}
nums[curr] = -nums[curr];
}
return -1;
... | ALGO | 0.99998 | 6.089794 |
e856fac5-8e2c-42be-8d77-aa925eda10c4 | Miguelcpjava/arquidiocese-app | 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 |
1dc7319f-d0f4-4fcc-9d8d-76e334861d4b | anhoangphuc/CP | leetcode/109.cpp | #include <iostream>
using namespace std;
struct ListNode {
int val;
ListNode* next;
ListNode(): val(0), next(nullptr) {}
ListNode(int x): val(x), next(nullptr) {}
ListNode(int x, ListNode* next): val(x), next(next) {}
};
struct TreeNode {
int val;
TreeNode *left;
TreeNode *right;
TreeNode... | ALGO | 0.999993 | 5.631103 |
3a90ff0d-dbf7-49e9-b5d2-9318182c1d2c | IamCheng/code-in-college | 简单查找 .cpp | #include<stdio.h>
int main()
{
int num[1005], n, i;
scanf("%d", &n);
for(i = 1; i <= n; i++)
scanf("%d", &num[i]);
int m;
scanf("%d", &m);
for(i = 1; i <= n; i++)
if(num[i] == m){
printf("%d\n", i);
break;
}
if(i == n+1)
printf("-1\n");
return 0;
} | ALGO | 0.999976 | 3.85148 |
1703b7d5-44d0-48dc-a4a1-eaa76935643f | Chirayu31/dsa-solutions | Tree/two-sum-iv-input-is-a-bst(Efficient).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.999995 | 5.908007 |
5baae5af-94d0-4cdd-95e8-9dc1dbfaf7da | ishandutta2007/codeforces | froggyzhang/normal/1557/E.cpp | #include<bits/stdc++.h>
using namespace std;
const int n=8;
typedef long long ll;
inline ll read(){
ll x=0,f=1;
char c=getchar();
while(c<'0'||c>'9'){
if(c=='-')f=-1;
c=getchar();
}
while(c>='0'&&c<='9'){
x=(x<<1)+(x<<3)+c-'0';
c=getchar();
}
return x*f;
}
int T;
pair<int,int> Ask(int x,int y){
cout<<x<... | ALGO | 0.9996 | 3.398538 |
46ade7f1-2551-4720-9fb5-ca84158155a0 | grandeagle/Competitive-Programming | TopCoder/449 500.cpp | /*
ID: 1107501
TASK: milk2
LANG: C++
*/
#include <bits/stdc++.h>
#define forit(it, a) for(__typeof(a.begin()) it = a.begin(); it != a.end(); it++)
#define pb push_back
#define mp make_pair
using namespace std;
typedef long long ll;
typedef vector<int> vi;
typedef pair<int, int> ii;
typedef vector<ii> vii;
typedef set<... | ALGO | 0.999825 | 3.532841 |
17b246e4-43ed-4531-983b-7e0a883e6742 | eklektos-en-christo/CPP20-Daniel | 07. Data Conversions Overflow & Underflow/7.3_overflow.and.underflow.cpp | //
// Created by Εκλεκτός εν Χριστώ on 18/11/2023.
//
/*
* Overflow: feeding the data more than a type can handle
* Underflow: vice versa of overflow
*/
#include <iostream>
int main()
{
unsigned char data{ 255 };
// overflow
for (int i{ 0 }; i <= 20; ++i)
std::cout << static_cast<int>(data) <... | TOOL | 0.920791 | 4.617449 |
9df68f7a-6c3f-41e8-922c-f96ff73e2f93 | alexandraback/datacollection | solutions_5686313294495744_0/C++/wilyin/1482.cpp | #include <set>
#include <cmath>
#include <stack>
#include <cstdio>
#include <cstring>
#include <iostream>
#include <algorithm>
#include <cstdlib>
#include <numeric>
#include <vector>
#include <ctime>
#include <queue>
#include <list>
#include <map>
#define pi acos(-1.0)
#define INF 0x3f3f3f3f
#define clr(x) memset(x,0,... | ALGO | 0.999929 | 4.186763 |
97d8ccab-cac1-4fea-a574-ed8683a7ca13 | AkashSingh3031/The-Complete-FAANG-Preparation | 1]. DSA + CP/2]. Competitive Programming/04]. Coding Ninjas/1]. Practice/2]. Problem Lists/1]. Lists by Experts/1]. Striver SDE Sheet Problems/C++/078]. Number of Distinct Substring.cpp | struct Node{
Node* children[26];
bool containsKey(char ch){
return ( children[ch - 'a'] != NULL);
}
Node* get(char ch){
return (children[ch - 'a']);
}
void set(Node* node , char ch){
children[ch - 'a'] = node;
}
};
class Trie{
Node *root ;
public:
... | ALGO | 0.999985 | 5.048081 |
a1529071-b4f1-4220-bdc2-6fff8d1a7d72 | hussain123sahil/Problem-of-the-day | 5th_Aug/potd_gfg.cpp | #include<iostream>
#include<vector>
#include<algorithm>
#include<map>
#include<queue>
using namespace std;
class Solution {
public:
vector <int> bottomView(Node *root) {
// Your Code Here
vector<int>ans;
if(root==NULL){
return ans;
}
map<int,int>mp;
q... | ALGO | 0.999992 | 5.916608 |
aff897cc-4cfa-4bd2-bb5a-8c17fe8d573c | gopaljaiswal/Competition-Problems-Solution-CPP-Python | Spoj/FARIDA.cpp | #include <iostream>
typedef long long int ll;
using namespace std;
ll maxLL(ll a, ll b) { return a > b ? a : b; }
ll getAns(ll A[], ll dp[], int N)
{
if (N == 1)
{
return A[0];
}
for (int i = 1; i <= N; i++)
{
dp[i] = maxLL((i > 1) ? dp[i - 1] : 0, (i > 2 ? dp[i - 2] : 0) + A[i - ... | ALGO | 0.999716 | 5.007731 |
96ebc1b0-1b6d-48bd-9c1e-4a6dfd222bf5 | mohamedelraghy/Problem-Solving | Codeforces/1624A - Plus One on the Subset.cpp | #include <bits/stdc++.h>
using namespace std;
#define P(x) cout << #x << " = { " << x << " }\n"
#define Time cerr << "Time Taken: " << (float)clock() / CLOCKS_PER_SEC << " Secs" << "\n";
#define INF 1000000000
// shortcuts for "common" data types in contests
typedef long long ll;
typedef pair<int, int> ii;
t... | ALGO | 0.999626 | 3.677486 |
3e85a5ce-657b-4776-a63d-17473bd073d9 | tboonma/posn61 | POSN2/Exercise8_Basic Graphs/02 Strongly connected/Untitled1.cpp | #include <iostream>
#include <vector>
#include <map>
using namespace std;
vector< vector<int> > tree;
map<int,bool> gone;
bool yeah=1;
int last,first;
int youngohm_motherfucker(int i)
{
cout<<i<<endl;
if(gone[i])
{
yeah=0;
return 0;
}
gone[i]=true;
for(int j=first;j<tree[i].siz... | ALGO | 0.999855 | 3.872798 |
9f5334d9-48a4-4d67-9846-87699871803e | rishisrivastava07/Leetcode-Solving | problem-of-the-day/January/04_uniqueLength3PalindromicSeq.cpp | class Solution {
public:
int countPalindromicSubsequence(string s) {
int n = s.length();
// store unique elements
unordered_set<char> letters;
for(char ch : s) letters.insert(ch);
int result = 0;
// give each letter a chance of forming palindrome
for(char l... | ALGO | 0.999974 | 6.656885 |
ceda3655-ae3c-4d42-8ee1-47dd45c6fdc4 | eastbro-1776/PS2024 | 20.심화2/25192.cpp | #include <iostream>
#include <set>
using namespace std;
int main()
{
int n, cnt = 0;
cin >> n;
set<string> s;
string str;
for (int i = 0 ; i < n ; i++){
cin >> str;
if (str == "ENTER")
{
cnt += s.size();
s.clear();
continue;
}
s.insert(str);
}
cnt += s.size();
cout << cnt;
} | ALGO | 0.991888 | 3.691181 |
7dfd0b6d-d591-4ed2-8a9e-ac7c8d7e4cfe | HieuThu16/Hieu-learn-Leetcode | 50_Pow_x_n.cpp | #include <iostream>
using namespace std;
class Solution {
public:
double myPow(double x, int n) {
// Xử lý trường hợp cơ bản
if (n == 0) return 1; // x^0 = 1
if (x == 0) return 0; // 0^n = 0, nếu n > 0
// Nếu n âm, chuyển thành 1/(x^|n|)
long long exp = n; // Dùng long long... | ALGO | 0.999741 | 6.422447 |
ff7c53bc-45e0-4178-8d96-11834db7b331 | Sazan1209/Formalki-prac2 | src/DFA.cpp | //
// Created by mikhail on 12.10.22.
//
#include "DFA.h"
size_t& DFA::State::operator[](size_t pos) { return moves[pos]; }
DFA::State::State() : moves(kSigmaSize) {}
void DFA::Minimize() {
size_t accepting_states_num = accepting_states_.BitCount();
if (accepting_states_num == 0 || accepting_states_num == states_... | ALGO | 0.999297 | 6.014143 |
26ec339c-16f0-4453-9e9d-832f6351ca62 | rtreale/Problemas-Beecrowd | 1 - INICIANTE/C++17/2685.cpp | #include <iomanip>
#include <iostream>
using namespace std;
int main(){
int m;
while (cin >> m) {
if (m>=0 && m<90) {
cout << "Bom Dia!!" << endl;
}
if (m>=90 && m<180) {
cout << "Boa Tarde!!" << endl;
}
if (m>=180 && m<270) {
cout << "Boa Noite!!" << endl;
}
if (m>=270 && m<360) {
cout << "De Madrugada!!" << e... | ALGO | 0.967966 | 3.289095 |
1fbc36a7-2658-4b48-acf6-c5cf70876a5c | manikanta2901/ubuntu | .history/codingChallenges/cpp/Codechef/longChallenges/Year2021/January/AndOrGame_20210107133419.cpp | #include<bits/stdc++.h>
#include<vector>
#include<iostream>
#include<cmath>
#include<algorithm>
#include<iterator>
#include<string>
#include<map>
#define vv vector
#define F first
#define S second
#define MP make_pair
#define EXECUTE_FASTER ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL);
#define printM... | ALGO | 0.99997 | 3.297765 |
712056b7-9d11-4435-8bd2-67e09ca7f76d | TangZichen0102/cpp_study | 实验舱/实验舱算法A班/作业/11/#E、Lake Counting.cpp | #include <bits/stdc++.h>
using namespace std;
int n, m, ans;
int dx[8] = {-1, 0, 1, 0, 1, -1, 1, -1};
int dy[8] = {0, -1, 0, 1, 1, -1, -1, 1};
char c[105][105];
void dfs(int x, int y) {
if (x > n || y > m || x < 0 || y < 0 || c[x][y] == '.') return;
c[x][y] = '.';
for (int i = 0; i < 8; i++) dfs(x + dx[i]... | ALGO | 0.999897 | 4.437477 |
b4b07ab8-c481-40b4-9613-cda5f12792bd | G0T-cha/G0T-cha.github.io | thirdparty/linux/miracl/miracl_osmt/source/curve/pairing/zzn6a.cpp | /*
* MIRACL C++ Implementation file ZZn6a.cpp
*
* AUTHOR : M. Scott
*
* PURPOSE : Implementation of class ZZn6 (Arithmetic over n^6)
*
* WARNING: This class has been cobbled together for a specific use with
* the MIRACL library. It is not complete, and may not work in other
* applications
*
*/... | ALGO | 0.988806 | 3.168252 |
207f1c79-33de-492c-b2dd-ee646599b301 | raincross7/code-similarity | codes/train_code/problem045/problem045_263.cpp | #include<iostream>
#include<algorithm>
#include<vector>
#include<map>
using namespace std;
typedef long long ll;
const int maxn=5e5+10;
int main()
{
ll a,b,c,d;cin>>a>>b>>c>>d;
ll ans=max(max(a*c,a*d),max(b*c,b*d));
if((a<=0&&b>=0)||(c<=0&&d>=0)) cout<<max(ans,ll(0));
else cout<<ans;
return 0;
} | ALGO | 0.999794 | 4.176908 |
23ec5090-e9d7-4e60-9e97-ba5afbf3f1c0 | peterncy1999/MyFirstRenderer | src/Matrix.cpp | #include "Matrix.h"
Matrix::Matrix() {
val = std::vector<std::vector<float>>(4, std::vector<float>(4, 0));
}
Matrix::Matrix(Vec4f a, Vec4f b, Vec4f c, Vec4f d){
val = std::vector<std::vector<float>>(4, std::vector<float>(4, 0));
val[0][0] = a.x; val[0][1] = a.y; val[0][2] = a.z; val[0][3] = a.t;
val[1][0] = b.x; v... | ALGO | 0.958886 | 4.156702 |
6dd39205-c4ba-4f21-9b72-53fdc1e32049 | Shahriar-Seam/Programming | Other OJs/SPOJ/BSPRIME.cpp | #include <bits/stdc++.h>
using namespace std;
const int sz = 1.02e8 + 5;
vector <bool> marked(sz, true);
vector <int> pref(150199428 + 5, 0);
int pref_index = 0;
void to_bin(int n)
{
int i;
for (i = 31 - __builtin_clz(n); i >= 0; i--) {
if (n & (1 << i)) {
pref[pref_index + 1] = 1 + pref... | ALGO | 0.999807 | 4.830076 |
19a607a1-5870-4d55-8e32-4c420b6e9588 | talatmcc/xpsc_week_08 | week-08/F_Cricket_Match.cpp | #include<bits/stdc++.h>
using namespace std;
int main(){
int t;
cin>>t;
while(t--){
int n,m;
cin>>n>>m;
if(m*6*6 >= n){
cout<<"YES"<<endl;
}
else{
cout<<"NO"<<endl;
}
}
return 0;
} | ALGO | 0.99979 | 3.962599 |
c1c76c9b-d286-47d6-8243-88cbb3b5c663 | aayush751/Leetcode | 1781-check-if-two-string-arrays-are-equivalent/check-if-two-string-arrays-are-equivalent.cpp | class Solution {
public:
bool arrayStringsAreEqual(vector<string>& word1, vector<string>& word2) {
string ans1 = "";
string ans2 = "";
for(int i = 0; i < word1.size(); i++ )
{
ans1 = ans1 + word1[i];
}
for(int i = 0; i < word2.size(); i++ )
{
... | ALGO | 0.998362 | 6.32734 |
d9624b36-0e5f-4f3a-9c04-fc7dbd98765b | devhmac/flutter_masterclass | todo_list/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.998628 | 6.776823 |
e675b168-5922-4e4a-acc2-abbb3ecb3c50 | Pulakesh5/_DSA_ | August 22/24 Aug/Generate IP Addresses gfg.cpp | vector<string>ans;
vector<string> genIp(string &s) {
if(s=="0000")return vector<string>({"0.0.0.0"});
if(s.size()<4 || s.size()>12)return vector<string>();
string res="";
dp(s,0,res,0);
return ans;
}
void dp(string s, int i,string res,int dots){
... | ALGO | 0.998844 | 4.694591 |
10e9a142-ef3e-4eec-b791-246406a9fc3f | Achira-Boonrath/subTetherVortexMATLAB | VortexStuff_LiamThesisCompare/addChaser_box3.cpp | // Created by Eleonora Botta, September 15, 2016
// Modified by Eleonora Botta, September 23, 2016: chaser passed as pointer, for the main to know it
// Modified by Eleonora Botta, September 26, 2016: possibility to have static chaser
// Modified by Eleonora Botta, December 20, 2016: autocompute inertia properties
// M... | TOOL | 0.885489 | 3.639632 |
64ea04fb-850d-4dc8-ae15-996a12d41c61 | HypeRRu/RB-AVL-trees | src/utils/data_process.cpp | #include <vector>
#include <fstream>
#include <iostream>
const std::string avl_insert_ifile = "/home/hyper/C++/alg-cw/tests_results/avl_insert.txt";
const std::string avl_delete_ifile = "/home/hyper/C++/alg-cw/tests_results/avl_delete.txt";
const std::string rb_insert_ifile = "/home/hyper/C++/alg-cw/tests_results/rb_i... | ALGO | 0.988718 | 4.758968 |
ea5b2ade-13ac-444b-a505-9b33197cfeae | PNUHyeonWoo/Baekjoon | cpp/gold/gold5/str_1013_contact.cpp | #include <iostream>
using namespace std;
bool contact(string str);
int main()
{
int n;
cin >> n;
bool* results = new bool[n];
for (int i = 0; i < n; i++)
{
string inp;
cin >> inp;
results[i] = contact(inp);
}
for (int i = 0; i < n; i++)
if (results[i])
cout << "YES\n";
else
cout << "NO\n";
}
... | ALGO | 0.999899 | 3.956311 |
b8d13b26-b763-49b8-a8f5-8ae013719e50 | zhejianguk/FireGuard | Software/parsec/pkgs/apps/facesim/src/Public_Library/Geometry/IMPLICIT_SURFACE.cpp | using namespace PhysBAM;
//#####################################################################
// Function Intersection
//#####################################################################
template<class T> bool IMPLICIT_SURFACE<T>::
Intersection (RAY_3D<T>& ray, const T thickness) const
{
NOT_IMPLEMENTED();
}
/... | TOOL | 0.926761 | 3.883513 |
5c518710-a637-4ecb-86fa-93856cb5b5f4 | jaman24/Online-Contest | Codeforces/Codeforces Round 945 (Div. 2)/B_Cat_Fox_and_the_Lonely_Array.cpp | #include <bits/stdc++.h>
using namespace std;
#define ll long long
#define pb push_back
const ll MOD = 202206214218227;
#define all(x) x.begin(), x.end()
#define FastIO \
ios::sync_with_stdio(0); \
cin.tie(0); \
cout.tie(0);
#define PII pair<int, int>
int check_bit(unsigned int n,... | ALGO | 0.999657 | 4.769883 |
46b414ae-7a9f-4992-afc7-0f303505266a | gjainiitr/Algorithms-and-Data-Structres | Graph/Detect-Cycle-in-an-Undirected-Graph.cpp | /*
Problem URL :- https://practice.geeksforgeeks.org/problems/detect-cycle-in-an-undirected-graph/1
*/
#include<bits/stdc++.h>
using namespace std;
// } Driver Code Ends
/* This function is used to detect a cycle in undirected graph
* adj[]: array of vectors to represent graph
* V: number of vertices
*/
bool dfs... | ALGO | 0.999918 | 6.061206 |
84908923-464a-4f8d-8178-1a7fd30fd2df | alvinzhaowei/VD-STAR | boost_1_66_0/libs/geometry/example/05_b_overlay_linestring_polygon_example.cpp | // Boost.Geometry (aka GGL, Generic Geometry Library)
// NOTE: this example is obsolete. Boost.Geometry can now
// overlay linestrings/polygons.
// This sample will be removed in next version.
#include <fstream>
#include <iostream>
#include <string>
#include <vector>
#include <boost/foreach.hpp>
#include <boost/geo... | ALGO | 0.925966 | 6.723181 |
6e46ce1d-45c6-4468-ade3-d3151b56d55f | snandasena/cpp-advanced-topics | ds/leetcode/14days-cracking/src/missing_numer.cpp | //
// Created by sajith on 11/23/21.
//
class Solution
{
public:
int missingNumber1(vector<int> &nums)
{
auto n = nums.size();
int total = (n + 1) * n / 2;
for (auto &i: nums)
{
total -= i;
}
return total;
}
int missingNumber(vector<int> &num... | ALGO | 0.999725 | 5.866777 |
12a15f97-a4dc-40a0-828b-d79e6c223390 | pongsaphol/submission | OCN/15/1C.cpp | /*
K bound is log3(N)
it mean in any level I will divide in 3 group, for each group size not greater than 3^k
for group "YES", "MAYBE", "NO"
let N is size on this level
and lv is N/3 (size of next level)
for i in [0, 2*lv)
if index is even I will group it "YES" and add i to asking
if index is odd I will group it "MAY... | ALGO | 0.999964 | 3.820565 |
d0141585-a8aa-4041-b2c4-9000c694b995 | shubhampathak09/Atcoder_practise | min subset sum problem.cpp | /// min subset sum
#include<bits/stdc++.h>
using namespace std;
int subsetSum(int arr[],int n,int sum){
int t[n+1][sum+1];
for(int i=0;i<=sum;i++)
t[0][i]=1;
for(int i=0;i<=n;i++)
t[i][0]=1;
for(int i=1;i<=n;i++){
for(int j=1;j<=sum;j++){
if(arr[i-1]<=j){
t[i][j] = t[i-1][j] || t[i-1][j-arr[i-1]]... | ALGO | 0.999949 | 4.115364 |
290a4212-fa71-476a-9435-9354d4cdc364 | mrreda1/problem-solving | usaco/paintbarnOld.cpp | #include <bits/stdc++.h>
#define all(v) v.begin(), v.end()
#define rall(v) v.rbegin(), v.rend()
#define make_unique(x) sort(all(x)), x.erase(unique(all(x)), x.end())
template <typename T> T nxt();
using namespace std;
using llu = unsigned long long;
using ld = long double;
using ll = long long;
const bool T = 0;
co... | ALGO | 0.999865 | 4.049193 |
7fe31b3d-c7f9-4f0a-bed5-e4d3f0e5cfec | Rhushipatil/SPPU-Data-Structure-And-Algorithm-DSA-sem-4-codes | dsa4.cpp |
#include <iostream>
#include <iomanip>
using namespace std;
const int MAX = 30;
class FlightClass
{
FlightClass *link;
string city_name;
int duration;
public:
friend class graph_class;
FlightClass()
{
link = NULL;
city_name = " ";
duration = -1;
}
FlightClass(st... | ALGO | 0.91327 | 3.671506 |
d85e1d97-be33-4b8c-aae6-92f688874227 | WinterSun0729/zxd-1 | Problem Solving and GUI in c++ & fltk/fltk/W12/poly.cpp | #include "poly.h"
#include "Graph.h"
bool is_a_polygon = true;
inline pair<double,double> line_intersect(Point p1, Point p2, Point p3, Point p4, bool& parallel)
{
double x1 = p1.x;
double x2 = p2.x;
double x3 = p3.x;
double x4 = p4.x;
double y1 = p1.y;
double y2 = p2.y;
double y3 = p3.y;
... | ALGO | 0.91309 | 4.651381 |
3af2b1b3-9e27-46d9-b69f-814bd341356b | Marwan513/BayMax | baymax/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.998614 | 6.76073 |
d3f4523f-d4ea-4f12-b3a4-f3ca580f8e81 | NA-varez/Real-Time-Sobel-Filter-Optimization | Archive/lab4/sobel.cpp | /*********************************************
*
* File: sobel.cpp
*
* Description: Contains functions for Sobel
* filter functions
*
* Author: Nicolas Alvarez
*
* Version: 0.1
*
**********************************************/
| ALGO | 0.990758 | 4.528752 |
b6c5d31e-84f7-4734-8b52-d9feaf94cecc | Nidhi-Shah-Einfochips/Programming | C++/C++ Final Assignment/set2_que7.cpp | //NIDHI SHAH SET 2 QUESTION 7
#include<iostream>
#include <bits/stdc++.h>
using namespace std;
int Cutsquares(int,int);
int gcd(int,int);
int main()
{
int b, l;
cout<<"Enter breadth : "<<endl;
cin>>b;
cout<<"Enter length : "<<endl;
cin>>l;
cout <<"Answer = "<< Cutsquares(b, l)<<endl;
return 0;
}
int Cutsquares... | ALGO | 0.999489 | 4.724659 |
12de34b7-01ee-49b4-a5be-0d786619c4b9 | kaiumuddin/DSA-Codes | Linked_List_Phitron/singly_doubly_foundation/16.sort_list.cpp | #include<bits/stdc++.h>
using namespace std;
class Node {
public:
int val;
Node* next;
Node(int val, Node* next = NULL) {
this->val = val;
this->next = next;
}
};
void insertTail(Node*& head, Node*& tail, int val) {
Node* newNode = new Node(val);
if (head == NULL) {
he... | ALGO | 0.999864 | 4.900936 |
943457e6-3e87-4261-b021-77f6391f35d3 | Sergiorosliarte/aedI | code/NodoAvl.cpp | #include "NodoAvl.h"
#include "Lugar.h"
NodoAvl::NodoAvl (Carretera carretera)
{
c = carretera;
clave = c.getDestino()->getNombre();
altura = 0;
hijoDer = NULL;
hijoIzq = NULL;
}
NodoAvl::~NodoAvl ()
{
delete hijoIzq;
delete hijoDer;
}
void NodoAvl::setAltura (int a)
{
altura = a;
}
Carretera * NodoAvl::get... | ALGO | 0.969126 | 3.806115 |
5c30049f-4c5e-48da-902a-758fc19d99c0 | TranDucKhiem14082005/studyC | bai4_Kho_KTLT_TH4.cpp | #include <stdio.h>
#include <stdbool.h>
//thu tu tang dan
bool check(int a[], int l, int r) {
if(l >= r) return true;
int mid = (l + r) / 2;
if(a[mid] > a[mid + 1]) return false;
return check(a,l,mid) && check(a,mid+1,r);
}
//Tim va xuat ra vi tri phan tu nho nhat
int check2(int a[], int l, int r){
if(l== r) retu... | ALGO | 0.999888 | 3.779315 |
c5948f1e-89ed-4b06-94f7-2de8b353f92b | jcancelli/triangular-pool | src/util/config.cpp | #include "config.hpp"
#include <iostream>
#include <stdexcept>
#include <string>
namespace pool {
namespace util {
void validateConfig(Config const& config) {
if (config.r1 < 0) {
throw std::invalid_argument("Error: R1 can't be negative.");
}
if (config.r2 < 0) {
throw std::invalid_argument("Error: R2... | CONFIG | 0.941935 | 6.93087 |
3e207861-1ddc-431b-8714-da0351f6f19a | TengFeiyang01/Algorithm | casual/DP/liner dp/P1757.cpp | #include <bits/stdc++.h>
const int inf = 0x3f3f3f3f;
using i64 = long long;
void solve() {
int m, n;
std::cin >> m >> n;
std::vector<i64> dp(m + 1);
std::map<int, std::vector<std::pair<int, int>>> mp;
for (int i = 0; i < n; ++i) {
int a, b, c;
std::cin >> a >> b >> c;
mp[c].pu... | ALGO | 0.99997 | 4.646312 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.