uuid string | repo_name string | relative_path string | content string | category string | algo_rel_score float64 | quality_score float64 |
|---|---|---|---|---|---|---|
139d0980-76a3-4690-9ba7-235430b6a56b | seiko-iwasawa/my-library | my-library/Graph/Mincost.cpp | #include <bits/stdc++.h>
using namespace std;
const int N = 107;
const int M = 1007;
const int INF = 1e9 + 7;
struct Edge {
int v, u, c, f, w;
int cf() { return c - f; }
Edge() {}
Edge(int v, int u, int c, int f, int w) : v(v), u(u), c(c), f(f), w(w) {}
};
int n, m;
Edge edges[2 * M];
vector<int> g[N];
v... | ALGO | 0.999931 | 4.445378 |
46ef9f5f-20b3-4e51-b5d5-e687e216357b | ashutosh1598/Codeforces | 528/3.cpp | #include"iomanip"
#include"iostream"
#include"limits"
#include"cmath"
#include"vector"
#include"algorithm"
#include"list"
#include"queue"
#include"stack"
#include"set"
#include"map"
#include"string"
#include"cstring"
#include"assert.h"
using namespace std;
#define ff first
#define ss second
#define all(v) v.begin(),v.e... | ALGO | 0.999911 | 3.478022 |
56f30e79-f1eb-4323-a744-23da1b905c2e | ClockAnge/CPP_Production | libsrc/calc/src/calculator.cpp | #include "calc/calculator.h"
using namespace std;
double Calculator::calculate() {
return expr();
}
double Calculator::expr() {
double left = term();
Token t = getNextToken();
while (t.type == Token::Type::Plus || t.type == Token::Type::Minus) {
double right = term();
if (t.type == To... | ALGO | 0.991529 | 4.749995 |
09ac5334-9b6e-4325-96f7-4b71c2660edb | TuringKi/llvm-project-12-wasi | clang/lib/DirectoryWatcher/mac/DirectoryWatcher-mac.cpp | #include "DirectoryScanner.h"
#include "clang/DirectoryWatcher/DirectoryWatcher.h"
#include "llvm/ADT/STLExtras.h"
#include "llvm/ADT/StringRef.h"
#include "llvm/Support/Error.h"
#include "llvm/Support/Path.h"
#include <CoreServices/CoreServices.h>
#include <TargetConditionals.h>
using namespace llvm;
using namespace... | TOOL | 0.890157 | 7.554053 |
8dfa9772-fb18-476b-bdc6-214347f2599d | Sadat-09/Codeforces | E_Romantic_Glasses.cpp | #include <iostream>
#include <vector>
using namespace std;
bool hasEqualSumSubarray(const vector<int>& a) {
int n = a.size();
vector<long long> prefixSum(n + 1, 0);
for (int i = 0; i < n; i++) {
prefixSum[i + 1] = prefixSum[i] + (i % 2 == 0 ? a[i] : 0);
}
long long oddSum = 0, evenSum = ... | ALGO | 0.999577 | 6.174014 |
9175a95b-6567-4eac-a46d-8868354521c8 | wintersteiger/openenclave-tmp | 3rdparty/libcxx/libcxx/test/std/containers/sequences/vector.bool/size.pass.cpp | // <vector>
// class vector
// size_type size() const noexcept;
#include <vector>
#include <cassert>
#include "test_macros.h"
#include "min_allocator.h"
int main()
{
{
typedef std::vector<bool> C;
C c;
ASSERT_NOEXCEPT(c.size());
assert(c.size() == 0);
c.push_back(false);
assert(c.size()... | TEST | 0.894882 | 5.699568 |
70cc63b1-8aef-4318-819f-3d45311a1bba | zkck/ethz-algolab2019 | potw10/main.cpp | #include <iostream>
// BGL
#include <boost/graph/adjacency_list.hpp>
#include <boost/graph/connected_components.hpp>
// BGL incremental connected components
#include <boost/foreach.hpp>
#include <boost/graph/graph_utility.hpp>
#include <boost/graph/incremental_components.hpp>
#include <boost/pending/disjoint_sets.hpp... | ALGO | 0.999136 | 4.97291 |
8ae83cdd-e5c6-45ed-8504-f616943ad7a1 | Abdulhanan987/pd-3 | task13.cpp | #include <iostream>
using namespace std;
main( ){
cout<<"Enter first number: ";
int x;
int y;
y=0;
cin>>x;
y = y + x;
cout<<"Enter second number: ";
cin>>x;
y = y + x;
cout<<"Enter third number: ";
cin>>x;
y = y + x;
cout<<"Enter fourth... | ALGO | 0.987703 | 3.264714 |
842a6049-2cf5-4f58-aa88-602b5ff09dfb | oregenal/hackerrank | sherlockAndTheValidString.cpp | #include <bits/stdc++.h>
using namespace std;
/*
* Complete the 'isValid' function below.
*
* The function is expected to return a STRING.
* The function accepts STRING s as parameter.
*/
string isValid(string s) {
int abc[26] = {0};
vector<int>container;
bool gotit = false;
for(size_t i = 0; i < s.size();... | ALGO | 0.999992 | 4.831955 |
edaa1044-2c8f-4265-9138-5e3517fcdb92 | aryan-99/leetcode | easy/27-RemoveElement.cpp | /*
27. Remove Element
10/8/2023
Time: 14m 13s
Note: initial approach was complicated, revised it after trying too hard
*/
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[... | ALGO | 0.999862 | 6.139341 |
f4b29332-3492-41e2-8e33-82434a3afeda | jih189/fixtureless_fixturing_place_and_pick_re-grasping | perception/include/igl/orientable_patches.cpp | template <typename DerivedF, typename DerivedC, typename AScalar>
IGL_INLINE void igl::orientable_patches(
const Eigen::PlainObjectBase<DerivedF> & F,
Eigen::PlainObjectBase<DerivedC> & C,
Eigen::SparseMatrix<AScalar> & A)
{
using namespace Eigen;
using namespace std;
// simplex size
assert(F.cols() == 3... | ALGO | 0.997151 | 3.965466 |
e3926fdf-292f-4884-bd0f-11f3076c7da7 | hoyou0201/BOJcpp | 완료/25-07-23/10216.cpp | #include <iostream>
#include <vector>
#include <algorithm>
using namespace std;
struct circle{
int x, y, r;
};
int n, T, s;
vector<circle> c;
vector<int> g;
int pow(int a){
return a*a;
}
bool isis(circle c1, circle c2){
return pow(c1.x-c2.x)+pow(c1.y-c2.y) <= pow(c1.r+c2.r);
}
int find(int i){
if(g[... | ALGO | 0.999611 | 4.533772 |
196ccb7b-37f3-49fe-a0fe-38d49d1ee561 | willkim28/oop-in-cpp-244 | w7/w7_home/w7_at_home.cpp | // OOP244 Workshop 7 - Derived Classes
// w7_at_home.cpp
// Version 2.0
// Date 2018/10/31
// Author Hasan Murtaza, Chris Szalwinski
// Description
// This file is the client module for Workshop 7
/////////////////////////////////////////////////////
#include <iostream>
#include "Hero.h"
#include "SuperHero.h"
using ... | TOOL | 0.909345 | 3.987437 |
91699575-d897-47d5-a993-03fe48d5b4bf | SadeepNanda/Octobertask | Codeforces677(2).cpp | #include <iostream>
#include <bits/stdc++.h>
using namespace std;
int main() {
int t;
cin>>t;
while(t--)
{
int n,k=0,s=0,e=0;
cin>>n;
int a[n+1];
for(int i=0;i<n;i++)
cin>>a[i];
if((count(a,a+n,1)==1)||n<=2)
{cout<<... | ALGO | 0.999931 | 3.950669 |
395adb9d-9296-45e4-afcc-b8cd76f7b1d8 | mfclabber/prog-alg_exam | chapter2_data_structures/graph_incidence_matrix.cpp | // 5. Адаптировать реализацию класса Graph для представления графа в виде матрицы инцидентности.
#include <iostream>
using namespace std;
class Graph {
private:
bool** adjMatrix;
bool** incidence_matrix;
int numVertices;
int count;
public:
Graph(int numVertices) {
this->numVertices = numV... | ALGO | 0.999639 | 5.718884 |
ff728e35-00d9-4783-b0f8-1585739ea558 | zf-w/mini_problem_collection_before_y2023m11 | Leetcode/Leetcode.20.valid-parentheses/Leetcode.20.valid-parentheses.cpp | // @lc app=leetcode id=20 lang=cpp
#include <stack>
#include <string>
using namespace std;
// @lc code=start
class Solution {
public:
bool isValid(string s) {
stack<char> stk;
const int kLength = s.length();
for(int i = 0; i < kLength; i++) {
char curr_char = s[i];
if... | ALGO | 0.998589 | 6.935519 |
33aef80e-3608-4cc2-b4da-61a86d16284f | j00v/midas_coin | src/denomination_functions.cpp | #include "denomination_functions.h"
using namespace libzerocoin;
// -------------------------------------------------------------------------------------------------------
// Number of coins used for either change or a spend given a map of coins used
// ----------------------------------------------------------------... | ALGO | 0.997099 | 6.637038 |
1c84a343-2839-4547-a2fa-e1595f796f75 | lastole/libraw | src/demosaic/dht_demosaic.cpp | /*
* функция вычисляет яркостную дистанцию.
* если две яркости отличаются в два раза, например 10 и 20, то они имеют такой
* же вес при принятии решения об интерполировании, как и 100 и 200 --
* фотографическая яркость между ними 1 стоп. дистанция всегда >=1
*/
#include "../../internal/dmp_include.h"
static inli... | ALGO | 0.999079 | 3.216283 |
1c52ca88-27ee-4866-a54e-39e024dc831b | berneylin/LeetCode2019Spring | 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) {}
* };
*/
class Solution {
public:
ListNode *getIntersectionNode(ListNode *headA, ListNode *headB) {
int lenA=0, lenB=0; // the length of list A and B, respec... | ALGO | 0.999857 | 5.277568 |
d555f4ed-6c00-4974-9e5c-4055a780acde | Taejin1221/Re-PS | Baekjoon/Baekjoon12778.cpp | // Baekjoon12778.cpp
#include <iostream>
using namespace std;
int main(void) {
ios_base::sync_with_stdio(false);
cin.tie(0); cout.tie(0);
int t;
cin >> t;
while (t--) {
int n; char prob;
cin >> n >> prob;
if (prob == 'C') {
for (int i = 0; i < n; i++) {
... | ALGO | 0.999323 | 4.229861 |
c006cb90-1b68-4224-962a-b7cffc9c0a96 | vaidikcode/Docs | CP 31/seven.cpp | #include <bits/stdc++.h>
using namespace std;
int main() {
ios::sync_with_stdio(false);
cin.tie(nullptr);
// Taking inputs
int T;
cin >> T;
while (T--) {
int n, m;
cin >> n >> m;
string x, s;
cin >> x >> s;
// Say the max on m is to be 25,
// a... | ALGO | 0.999967 | 5.465583 |
a1e83412-cf51-4566-bc6b-ffc4b4890709 | squaresLab/BatFix | results/transcoder/results/python/semantics/program_COUNT_TRAILING_ZEROES_FACTORIAL_NUMBER.cpp | #include <iostream>
#include <cstdlib>
#include <string>
#include <vector>
#include <fstream>
#include <iomanip>
#include <vector>
#include <map>
#include <unordered_map>
#include <set>
#include <unordered_set>
#include <numeric>
#include <algorithm>
using namespace std;
int f_gold ( int n ) {
int count = 0;
for ( ... | ALGO | 0.999564 | 5.464164 |
a0bdd331-232f-44a8-89bb-8b603a1b0029 | ldt9/ECE0302_ICEs_and_Projects | ICEs/ICE9/ICE9/Starter Code/binarytree/test.cpp | #include <iostream>
using std::cout;
using std::endl;
#include "BinaryTree.h"
typedef std::string ItemType;
typedef void (*FunctionType)(ItemType& anItem);
void PrintNode(ItemType& i) { cout << i << endl; };
int main(int argc, char** argv)
{
BinaryTree<ItemType, FunctionType> T1("B");
BinaryTree<ItemType, F... | ALGO | 0.994603 | 4.796543 |
bfb67fd4-245f-4698-8ebe-2c848a5adf0a | alberto-santini/maritime-vrp | src/preprocessing/graph_generator.cpp | #include <algorithm>
#include <stdexcept>
#include <unordered_map>
#include <string>
#include <utility>
#include "graph_generator.h"
namespace mvrp {
namespace GraphGenerator {
std::shared_ptr<Graph>
create_graph(const ProblemData &data, const ProgramParams ¶ms, std::shared_ptr<VesselClass> ve... | ALGO | 0.997323 | 6.708929 |
1e7204fc-d95a-4aa7-818b-a157ba692c5b | anasdevv/dsa_cplus | tree.cpp | #include<iostream>
using namespace std;
struct TreeNode{
TreeNode *left;
TreeNode *right;
int val;
TreeNode(){
left = right = NULL;
}
TreeNode(int val){
this->val = val;
left = right = NULL;
}
};
TreeNode *findMax(TreeNode *root){
if(root == NULL)
return NULL;
if(root->left == NULL && root->right == NU... | ALGO | 0.999979 | 4.532835 |
d1838b2d-1cc8-4e31-95b4-12290403195f | MohamedAfifii/ProblemSolving--Arabic-II | Solutions/SPOJ/BUGLIFE.cpp | #include <bits/stdc++.h>
using namespace std;
typedef pair<int, int> pii;
typedef pair<pii, int> piii;
typedef vector<pii> vii;
typedef long long ll;
typedef long double ld;
typedef pair<ll,ll> pll;
#define loop(n) for(int i = 0; i < (n); i++)
#define lp(x, s, e) for(int x = (s); x < (e); x++)
#define l... | ALGO | 0.999917 | 4.455796 |
158925e9-4979-4958-9687-64ed6d5906c7 | sarvex/leetcode-java | solution/0600-0699/0673.Number of Longest Increasing Subsequence/Solution.cpp | class Solution {
public:
int findNumberOfLIS(vector<int>& nums) {
int maxLen = 0, ans = 0, n = nums.size();
vector<int> dp(n, 1), cnt(n, 1);
for (int i = 0; i < n; ++i) {
for (int j = 0; j < i; ++j) {
if (nums[i] > nums[j]) {
if (dp[j] + 1 > dp... | ALGO | 0.999997 | 6.360723 |
7446abc3-754f-43f6-8412-3cda46f3f58a | greenplum-db/gpdb-archive | src/backend/gporca/libgpopt/src/xforms/CXformSimplifySubquery.cpp | #include "gpopt/xforms/CXformSimplifySubquery.h"
#include "gpos/base.h"
#include "gpopt/operators/CExpressionHandle.h"
#include "gpopt/operators/CNormalizer.h"
#include "gpopt/operators/COperator.h"
#include "gpopt/xforms/CXformUtils.h"
#include "naucrates/md/IMDScalarOp.h"
using namespace gpmd;
using namespace gpop... | TOOL | 0.979596 | 4.886559 |
0c9d633d-d03c-48d4-b6c7-e42ea6ea60a2 | gilbert12tw/CP-Code-Archive | Contest/GYM102920/E.cpp | #include<bits/stdc++.h>
#define loli
using namespace std;
typedef long long ll;
#define int ll
#define pii pair<int, int>
#define X first
#define Y second
#define F first
#define S second
#define vi vector<int>
#define SZ(a) ((int)a.size())
#define ALL(v) v.begin(), v.end()
#define pb push_back
#define eb emplace_back
... | ALGO | 0.99994 | 4.249681 |
c1331993-7203-491d-8803-45eb36ed6144 | itzDeepansu/DSA | 543-diameter-of-binary-tree/diameter-of-binary-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.999956 | 6.755959 |
335b9db7-b147-444d-8907-0b54241a2cc1 | aditya-manohar/crtcodes | bit.cpp | #include<stdio.h>
int main()
{
int x=0,l,r;
printf("Enter the lower limit : ");
scanf("%d",&l);
printf("Enter the upper limit : ");
scanf("%d",&r);
for(int i=l;i<=r;i++)
{
x = x^i;
}
printf("%d",x);
return 0;
}
| ALGO | 0.999854 | 3.467641 |
15b4cb13-38b4-46b6-a50a-3a670d3a54b8 | raincross7/code-similarity | codes/train_code/problem257/problem257_486.cpp | #include <bits/stdc++.h>
using namespace std;
// count how many '1' is in the vector
int num(vector<vector<int>> v) {
int sum = 0;
for(int i = 0; i < v.size(); i++) {
for(int j = 0; j < v.at(0).size(); j++) {
if(v.at(i).at(j) == 1)
sum++;
}
}
return sum;
}
// change the numbers in a cer... | ALGO | 0.999863 | 4.531878 |
16ace7d6-a6ec-47fc-96c8-ab6e39b1817b | mpetri/FM-Index | libcds/src/static/coders/HuffmanCoder.cpp | #include <HuffmanCoder.h>
namespace cds_static
{
using namespace cds_utils;
HuffmanCoder::HuffmanCoder(uint * symb, size_t n) {
uint max_v = 0;
for(size_t i=0;i<n;i++)
max_v = max(max_v,symb[i]);
uint * occ = new uint[max_v+1];
for(size_t i=0;i<max_v+1;i++)
... | ALGO | 0.901977 | 5.608457 |
097ccfc7-fb46-4a81-9042-d930c791a05d | jcastaneda30/ExerciseAlgorithms | C++/Basic/Arreglos/ex.cpp | #include<iostream>
using namespace std;
int main(){
int suma=1,numero[]={1,2,3,4,5,6,7,8,9,10};
for(int i:numero){
suma*=i;
}
cout<<suma;
return 0;
} | ALGO | 0.999527 | 3.953261 |
6ee433ee-393f-438c-ab8e-6e0efbcbe05e | DoesDevStuff/Leetcode_Cpp_practice | LongestSubString.cpp | class Solution {//Time complexity: O(n)
public: //Space complexity: O(n)
int lengthOfLongestSubstring(string s) {
int n = s.size();
unordered_set<char> substr;//Unordered set to store the characters of sliding window
int i = 0, j = 0, max_i = 0;
while(j < n){
if(substr.f... | ALGO | 0.999539 | 5.911491 |
41304446-3c8d-4196-a1dc-9317689ed504 | MONUkushawaha987/DSA_GEEK_EASY_Problems | Logic Building Problems/Basic Problems/Arithmetic progression/More problems related to Arithmetic Progression/Print all triplets in sorted array that form AP/method2.cpp | // C++ program to print all triplets in given
// array that form Arithmetic Progression
#include <bits/stdc++.h>
using namespace std;
// Function to print all triplets in
// given sorted array that forms AP
void printAllAPTriplets(int arr[], int n)
{
for (int i = 1; i < n - 1; i++)
{
// Search other two element... | ALGO | 0.999393 | 5.037466 |
1b254e9f-e9a8-41f6-b9dc-19fce9a25db0 | maxpricop/max_programare_ceiti | programareProcedurala/lucruInClasa/martie/11/litere/litere.cpp | #include <cctype>
#include <fstream>
int main() {
std::ifstream inputFile("input.txt");
std::ofstream outputFile("output.txt");
char currentCharacter;
while (inputFile >> currentCharacter) {
outputFile << (char)toupper(currentCharacter);
}
inputFile.close();
outputFile.close();
... | TOOL | 0.917606 | 5.548631 |
26d7138f-4dd2-44ec-8389-9a8efb5e3685 | Mahdi-Rom/android_external_webkit | Source/WebCore/platform/graphics/filters/FEConvolveMatrix.cpp | #include "config.h"
#if ENABLE(FILTERS)
#include "FEConvolveMatrix.h"
#include "Filter.h"
#include "RenderTreeAsText.h"
#include "TextStream.h"
#include <wtf/ByteArray.h>
namespace WebCore {
FEConvolveMatrix::FEConvolveMatrix(Filter* filter, const IntSize& kernelSize,
float divisor, float bias, const IntPoint&... | TOOL | 0.965729 | 7.062279 |
b962cf5a-eccb-4455-8e8f-68677ad928f2 | stevenbai0724/Codeforces-Solutions | Binary Search/step2A.cpp | #include <bits/stdc++.h>
using namespace std;
#define int unsigned long long
signed main(){
cin.tie(nullptr)->sync_with_stdio(false);
int w,h,n;
cin >>w>>h>>n;
int l = 0, r = (int)1e18;
while(l+1<r){
int m = (l+r)/2;
if((m/w)*(m/h) <n) l = m;
else r = m;
}
cout<<r;... | ALGO | 0.999452 | 4.476809 |
4a5a44b0-25b9-461b-9caf-134410ee4f9c | iotkitv3/iotkit | QEI/QEI.cpp | /**
* @author Aaron Berk
*
* @section LICENSE
*
* Copyright (c) 2010 ARM Limited
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation t... | TOOL | 0.947805 | 7.365778 |
d5cf52c0-5e7f-4f7b-bb6c-6093e1709e62 | HULLZHU/C- | TaylorSeries.cpp | //
// Created by 38516 on 2019/5/1.
//
#include <iostream>
using namespace std;
double exp( double x, int n)
{
static double p = 1, f=1;
double r = 0;
if ( n == 0)
return 1;
else
{
r = exp(x,n-1);
p = p * x;
f = f * n;
return r + p/f;
}
}
double e_ta... | ALGO | 0.999939 | 4.033666 |
1fbc7df9-f960-4f66-b04e-1b50ffa09582 | rPankaj05/Leetcode_Solutions | Remove and Reverse - GFG/remove-and-reverse.cpp | //{ Driver Code Starts
//Initial Template for C++
#include <bits/stdc++.h>
using namespace std;
// } Driver Code Ends
//User function Template for C++
class Solution {
public:
string removeReverse(string s) {
vector<int> vec(26,0);
for(auto it:s){
vec[it-'a']++;
}
i... | ALGO | 0.99973 | 6.144328 |
d2ff6b0f-814b-4694-b8a4-0f71f876feb3 | guneykan/MathLibrary | vector_lib/vector.cpp | #include <iostream>
#include "vector.h"
#include <math.h>
using namespace std;
vector::vector(float x1,float x2,float x3){
this->x1=x1;
this->x2=x2;
this->x3=x3;
}
float vector::getComponent(int index){
switch(index) {
case 1 : return this->x1;
case 2 : return this->x2;
case 3 : return this->... | TOOL | 0.887022 | 3.596751 |
12457652-50fb-4695-a5bd-09d1a42810cc | da35b03x4v1vcxv/Leetcode | 207.cpp | #include <cstdio>
#include <vector>
#include <utility>
using namespace std;
struct edge {
int pointTo;
edge(int point) {
pointTo = point;
}
};
struct graphNode{
vector<edge> outTo;
int inDegree;
bool taken;
graphNode() {
taken = false;
inDegree = 0;
}
};
class Sol... | ALGO | 0.999669 | 4.414834 |
3e8a3ef9-0be6-4c64-95a5-1dbef483f241 | vishruthys/Probabilistic-Cache-Replacement | src/systemc/tests/systemc/misc/unit/data/datawidth_unsigned/truncation/datawidth.cpp | /*****************************************************************************
datawidth.cpp --
Original Author: Martin Janssen, Synopsys, Inc., 2002-02-15
*****************************************************************************/
/**************************************************************************... | ALGO | 0.969401 | 5.344794 |
c79acd3e-da9f-4ae1-9f5b-f873c12a1904 | astromme/Neural-Object-Detection | libgng/gng.cpp | #include "gng.h"
#include "node.h"
#include "edge.h"
#include "point.h"
#include "pointsource.h"
#include <math.h>
#include <QDebug>
#include <QHash>
using namespace GNG;
// constructor
GrowingNeuralGas::GrowingNeuralGas(int dimension, qreal minimum, qreal maximum)
: m_pointGenerator(0),
m_pickCloseToCountdo... | ALGO | 0.990369 | 5.2498 |
70e97cce-ce63-4fea-9f4a-50a6b614701f | burentop/FirstNOfFibonacci | FirstNOfFibonacci/main.cpp | #include "../../../std_lib_facilities.h"
int main()
{
vector<int> fibonacci;
int n;
cout << "Please enter how many numbers of the Fibonacci series you want to see.\n";
cout << "Must be at least 3 (and more than 46 won't print): ";
cin >> n;
cout << '\n';
if (n > 2) {
fibon... | ALGO | 0.976618 | 4.972445 |
a6e1a18a-c561-42a2-8c27-0c442a35cd97 | sapro313/leetcode-practice | last_word.cpp | class Solution {
public:
int lengthOfLastWord(string s) {
int i=s.size()-1;
bool is_last=false;
int count=0;
while(i>=0){
if(s[i]!=' '){
count++;
is_last=true;
}
else if(s[i]==' '&&is_last){
break;
... | ALGO | 0.99943 | 5.664699 |
db84a85c-2a63-4029-b54a-043bd96a55ed | priyadarshii786/Geeks_for_Geeks | Easy/Twice Counter/twice-counter.cpp | //{ Driver Code Starts
#include <bits/stdc++.h>
using namespace std;
// } Driver Code Ends
class Solution
{
public:
int countWords(string list[], int n)
{
//code here.
map<string, int>mp;
for(int i=0; i<n; i++)
{
mp[list[i]]++;
}
... | ALGO | 0.999302 | 5.884382 |
b47a6ddd-b713-4c76-88c8-b891a0dbe626 | ishandutta2007/codeforces | robezh/normal/79/D.cpp | #include <bits/stdc++.h>
using namespace std;
#define rep(i, a, b) for(int i = a; i < (b); ++i)
#define trav(a, x) for(auto& a : x)
#define all(x) begin(x), end(x)
#define sz(x) (int)(x).size()
#define subnb true
#define Lnb true
typedef long long ll;
typedef long double ld;
typedef pair<int, int> pii;
typedef pair<ll... | ALGO | 0.999963 | 3.571382 |
cf52ef93-6d00-4b91-9386-0fce1a2ca469 | LiKe-rm/Human-and-ChatGPT-Code-Dataset | Codes Generated From ChatGPT/cpp_gpt3.5_功能重现/authors10_acejr1337_TerryDavisCoin_src_merkleblock.cpp | #include <iostream>
#include <vector>
#include <cstdint>
#include <cstring>
#include <algorithm>
using namespace std;
// ϣΪһΪ 32 ֽڵֽ
typedef uint8_t blockhash_t[32];
// 彻ϣΪһΪ 32 ֽڵֽ
typedef uint8_t txhash_t[32];
// Bloom Filter
class CBloomFilter {
public:
CBloomFilter(int nElements, double falsePositiveR... | ALGO | 0.99685 | 5.718332 |
487ce4a4-3a7b-457c-ae82-699e2539aa97 | Chillee/CompProgramming | a2ojdiv2E/28/main.cpp | #include <bits/stdc++.h>
using namespace std;
const int MAXN = 1e5 + 5;
int N;
vector<int> adjlist[MAXN];
vector<int> children[MAXN];
bool vis[MAXN];
int depth[MAXN];
bool root(int cur, int curDepth) {
if (vis[cur])
return false;
vis[cur] = true;
depth[cur] = curDepth;
for (auto i : adjlist[cu... | ALGO | 0.998235 | 4.509441 |
202ea085-6c09-43ab-8126-cd49d3cb25d5 | ishandutta2007/codeforces | gabrielpessoa/normal/1043/C.cpp | #include <bits/stdc++.h>
using namespace std;
const int ms = 1e5+5;
int a[ms];
int main() {
ios::sync_with_stdio(0); cin.tie(0);
string s;
cin >> s;
int big = s.size();
for(char c = 'a'; c <= 'z'; c++) {
for(int i = big; i > 0; i--) {
if(s[i-1] == c) {
//cout << i << ' ' << big << ' ' << char(c) << end... | ALGO | 0.999956 | 3.23017 |
dc55b211-96c5-4135-8c47-e0059cee11b6 | gkyle/handicam | markers.cpp | #include "markers.hpp"
using namespace std;
using namespace cv;
Markers::Markers(Config& config, bool stabilizeMarkers) {
cameraMatrix = config.cameraMatrix;
distCoeffs = config.distCoeffs;
image_width = config.image_width;
markerboard_width = config.markerboard_width;
markerboard_height = config.markerboar... | TOOL | 0.935287 | 6.058857 |
b7270950-5759-4c12-a42c-11f20e78c737 | Sohel440/CP-learning-phase | codeforces/C_Raspberries.cpp | #pragma GCC optimize("Ofast")
#pragma GCC target("avx,avx2,fma")
#pragma GCC optimization("unroll-loops")
#include <iostream>
#include <bits/stdc++.h>
// #include "utilities.cpp"
using namespace std;
#define int long long
#define pb push_back
#define all(x) x.begin(), x.end()
#define rall(x) x.rbegin(), x.rend()
#defin... | ALGO | 0.998465 | 4.094101 |
4efb831c-cfcb-40c7-85ce-f87b26ed7c00 | Pashkorb/Console-Snake- | Snake/Snake.cpp | // Snake.cpp
#include "Snake.hpp"
Snake::Snake(int x, int y) : direction('R') {
select.push_back({x, y});
}
const std::vector<std::pair<int, int>>& Snake::GetSelect() const {
return select;
}
char Snake::getDirection() const {
return direction;
}
void Snake::setDirection(char dir) {
direction = dir;... | TOOL | 0.928156 | 5.681868 |
28c1df0c-06b6-4131-b038-e23d10d60213 | Shalu099/Leetcode | 3-longest-substring-without-repeating-characters/longest-substring-without-repeating-characters.cpp | class Solution {
public:
int lengthOfLongestSubstring(string s) {
vector<bool>count(256,0);
int first=0,second=0,len=0;
while(second<s.size())
{
while(count[s[second]]){
count[s[first]]=0;
first++;
}
count[s[second]]=1;
len=max(len,seco... | ALGO | 0.999937 | 5.771217 |
6260f02c-a042-45b4-9836-8d3c91dfdeac | AmiEklasMohin/Codeforces | BersuBall.cpp | #include <iostream>
#include <algorithm>
#include <vector>
#include <map>
using namespace std;
int main() {
int numberOfBoys, numberOfGirls, maxPairs, in;
vector<int>boysDancingSkill;
map<int, int>girlsDancingSkill;
cin >> numberOfBoys;
maxPairs = 0;
for (int i = 0; i < numberOfBoys; i += 1) {
... | ALGO | 0.9998 | 3.745831 |
fedd63cc-83b9-4326-9551-ba211a0736a1 | PaulDVS/C343PaulVSClassWork | Class11/Recursion Separate string and int.cpp | #include<iostream>
#include<string>
#include<vector>
using namespace std;
void separate(string n, vector<string> &output){
if(n.size() == 0){
return;
}
else if(n.size() == 1){
if(isalpha(n.at(0))){
output.at(0).push_back(n.at(0));
}
else{
output.at(1).push_back(n.at(0));
}
}
else{
if(isalpha(n.a... | ALGO | 0.989791 | 4.049135 |
eade013c-68f8-44ad-b311-7df94bf24b60 | sanjiv0286/CP-Daily-Practice-Problems | A_Phoenix_and_Puzzle.cpp | // DATE: 23-06-2023
// TIME: 20-08-54
#include <bits/stdc++.h>
#include <unordered_set>
using namespace std;
#define ll long long
#define all(a) a.begin(), a.end()
#define forn(i, n) for (int i = 0; i < n; i++)
#define rep(i, a, b) for (int i = a; i <= b; i++)
#define dep(i, b, a) for (int i = b; i >= a; i--)
#defin... | ALGO | 0.998903 | 5.087544 |
081f09a1-aef4-449f-9a74-68cd0f54b189 | USC-NSL-DDB/Quicksand | app/imagenet/opencv/modules/imgproc/src/intersection.cpp | /*M///////////////////////////////////////////////////////////////////////////////////////
//
// IMPORTANT: READ BEFORE DOWNLOADING, COPYING, INSTALLING OR USING.
//
// By downloading, copying, installing or using the software you agree to this license.
// If you do not agree to this license, do not download, instal... | ALGO | 0.999852 | 7.521502 |
c186bf99-1eab-450b-a5b5-2863a31dfea9 | MaheshSharan/LeetCode_Automation | solutions/1000-1099/1032.Stream of Characters/Solution.cpp | class Trie {
private:
Trie* children[26]{};
bool isEnd = false;
public:
void insert(string& w) {
Trie* node = this;
reverse(w.begin(), w.end());
for (char& c : w) {
int idx = c - 'a';
if (!node->children[idx]) {
node->children[idx] = new Trie(... | ALGO | 0.999566 | 6.683311 |
1ca9ca53-5a0e-4e8b-9305-7ace500a1690 | nahigles/EDA_24-25 | Tema5/Ej10_RepetirElemsCola2/Ej10_RepetirElemsCola2.cpp | // Nahia Iglesias Calvo
// EDA-GDV34
#include <iostream>
#include <iomanip>
#include <fstream>
#include "queue_eda.h"
#include <vector>
using namespace std;
template <class T>
class queue_plus : public queue<T> {
using Nodo = typename queue<T>::Nodo;
public:
// Complejidad: Sumatorio de todos los valores del vecto... | ALGO | 0.999135 | 4.510683 |
42e48e1a-72fb-44fa-9886-a544743e0e36 | yuewang199511/EX_KALMAN | src/tools.cpp | #include "tools.h"
#include <iostream>
#include "math.h"
using Eigen::VectorXd;
using Eigen::MatrixXd;
using std::vector;
Tools::Tools() {}
Tools::~Tools() {}
VectorXd Tools::CalculateRMSE(const vector<VectorXd> &estimations,
const vector<VectorXd> &ground_truth) {
/**
* TODO: Calcula... | ALGO | 0.993213 | 6.193398 |
fab95738-f3f8-4253-98d8-4f7f228d9602 | raincross7/code-similarity | codes/train_code/problem127/problem127_468.cpp | #include<bits/stdc++.h>
using namespace std;
using ll = long long;
using pll = pair<ll, ll>;
#define all(x) (x).begin(), (x).end()
#define call(x) (x).cbegin(), (x).cend()
#define rall(x) (x).rbegin(), (x).rend()
#define pb push_back
#define sz(x) ((x).size())
#define UNIQUE(v) v.erase(unique(v.begin(), v.end()), v.e... | ALGO | 0.999697 | 4.217755 |
247c402b-55b7-4258-b307-7cb73f5280d5 | NareshElango/C- | c++/dsa/stack_using_array.cpp | #include<iostream>
using namespace std;
int arr[100], n = 100, top = -1;
void push(int val) {
if (top >= n - 1) {
cout << "Overflow" << endl;
} else {
top++;
arr[top] = val;
}
}
void pop() {
if (top < 0) {
cout << "Empty" << endl;
} else {
cout << "Popped e... | ALGO | 0.993843 | 4.766955 |
d60ff654-2cad-4fa3-82cf-46274af851d9 | markphan03/fundamental-data-structure-algorithm | C++Programs/BruteForce/Iterative-Approach/Permutation/permutation.cpp | #include<iostream>
#include <fstream>
#define MAX 12
#define INPUT_FILE "input.txt"
#define OUTPUT_FILE "output.txt"
using namespace std;
int x[MAX];
int n;
ifstream inputFile;
ofstream outputFile;
/*The technique for generating the next permutation from the current permutation can be constructed as follows:
+ Ide... | ALGO | 0.999802 | 4.672152 |
77a1959b-3e25-48f0-ac77-efa139745069 | ishandutta2007/codeforces | shawn/normal/1591/E.cpp | #include <bits/stdc++.h>
using namespace std;
using LL = long long;
constexpr int maxn = 1000000 + 1;
struct Query{
int l, k, id;
};
int main() {
cin.tie(nullptr)->sync_with_stdio(false);
int t;
for (cin >> t; t; t -= 1) {
int n, q;
cin >> n >> q;
vector<int> a(n + 1), ans(q + 1... | ALGO | 0.999976 | 4.265811 |
5061e8c1-1ca3-4170-a1f1-e745ec0f8cf8 | molloy-lab/Dollo-CDP | src/boost_1_80_0/libs/geometry/test/algorithms/closest_points/pl_ar.cpp | // Boost.Geometry
// Unit Test
// Contributed and/or modified by Vissarion Fysikopoulos, on behalf of Oracle
#ifndef BOOST_TEST_MODULE
#define BOOST_TEST_MODULE test_algorithms_closest_points_pointlike_areal
#endif
#include "common.hpp"
#include "empty_geometry.hpp"
namespace bg = boost::geometry;
//==============... | TEST | 0.97283 | 7.357204 |
9a4fe286-c803-4091-96d2-2e87e49349d9 | WhyKash01/codeForces | C_Turtle_and_Good_Pairs.cpp | #include <bits/stdc++.h>
#define ll long long
#define LCM(a, b) (a) * ((b) / std::__gcd(a, b));
using namespace std;
ll M = 1000000007;
int main()
{
int t;
cin >> t;
while (t > 0)
{
int n;
string s;
cin >> n >> s;
map < int, multiset<char>> m;
map<char,int> charc... | ALGO | 0.999981 | 4.067667 |
83daf4b8-398c-4cf0-a895-fc2616c5532d | hxzinh/VOI | CSCQUERIES/main.cpp | #include <bits/stdc++.h>
#define ll long long
#define INF 0x3f3f3f3f
#define pii pair<int, int>
#define fi first
#define se second
#define ALL(v) (v).begin(), (v).end()
#define popcount(x) __builtin_popcount(x)
#define setp(x) setprecision(x)
#define MASK(x) (1LL << (x))
#define BIT(x, i) ((x) >> (i) & 1)
#define FastI... | ALGO | 0.999533 | 3.717498 |
4522ac98-71b4-4775-bf3a-fb54ad41e1de | zlysm/DSA-CST | PA1/graphics/main.cpp | #include <cstdio>
#include <cstdlib>
const int MAXN = 10000000;
const int MAXS = 60 * 1024 * 1024;
int numbers[MAXN];
char buf[MAXS];
void read() {
int len = fread(buf, 1, MAXS, stdin);
buf[len] = '\0';
int i;
numbers[i = 0] = 0;
for (char *p = buf; *p && p - buf < len; ++p)
if (*p == ' '... | ALGO | 0.999665 | 3.664399 |
95beb5d1-4aa4-4d40-ba53-1da256d80acd | raincross7/code-similarity | codes/train_code/problem449/problem449_11.cpp | #include<bits/stdc++.h>
using namespace std;
int main(){
int a,b,c,d;
cin >> a >> b >> c >> d;
cout << c-(d-b) << " " << d+(c-a) << " " << a-(d-b) << " " << b+(c-a) << endl;
} | ALGO | 0.999541 | 3.317488 |
ed8ed98b-f83d-4558-b7c5-c60c962524d3 | shubhampal39/Coding-blockk-CPP | Array 1.0/insertion_sort.cpp | #include<iostream>
using namespace std;
void insertion_sort(int a[],int n)
{
for (int i = 0; i<n; ++i)
{
int j,element=a[i];
for (int j = i; j>=0 ; --j)
{
if(a[j]<a[j-1])
{
swap(a[j],a[j-1]);
}
else
{break;}
}
}
}
int main()
{
int a[10]={2,5,6... | ALGO | 0.999745 | 4.09101 |
6f8c6549-3f48-4037-be82-e27eadc858ee | ArnaudDumanois/LeetCode | problem/easy/findRestaurant.cpp | //
// Created by arnau on 23/06/2024.
//
vector<string> findRestaurant(vector<string>& list1, vector<string>& list2) {
std::unordered_map<string, int> index;
for (int i = 0; i < list1.size(); i++) {
index[list1[i]] = i;
}
int minSum = INT_MAX;
std::vector<string> res;
for (int i = 0; i <... | ALGO | 0.999788 | 5.911502 |
13b1d2c0-79eb-4d6e-bcfc-4f849ad273f0 | supertask/icpc | tutorial/deque.cpp | #include <iostream>
#include <deque>
#include <algorithm>
using namespace std;
void lambda(int x)
{
cout << x << endl;
}
int main()
{
deque<int> deq;
deq.push_front(3);
deq.push_back(1);
for_each(deq.begin(), deq.end(), lambda);
return 0;
}
| TOOL | 0.99314 | 4.740868 |
06ba3923-5f2b-45e3-b34c-85b45b2fd0c9 | aaryanwadhawan7/DSA-Problems-Solution | Arrays/cntSArrXorK.cpp | // Count number of subarrays with XOR as k
#include <iostream>
#include <vector>
#include <map>
#include <unordered_map>
using namespace std;
int countSubArrays (vector<int> &nums, int n, int k) {
// Similar to prefixSum Approach
int count = 0;
int XOR = 0;
unordered_map <int, int> mpp;
mpp [0] = ... | ALGO | 0.999952 | 5.658943 |
29b6236b-6c62-4901-af2f-595a81e465f6 | jginsburgn/Estructura-De-Datos | Xcode/2EP/2EP.E2/2EP.E2/main.cpp | #include <iostream>
#include "Helper.h"
#include "LinkedList.h"
using namespace vcn;
LinkedList<int> * repeatedElements(LinkedList<int> * original){
LinkedList<int> * repeated = new LinkedList<int>();
for (int i = 0; i < original->size(); ++i) {
for (int j = i + 1; j < original->size(); ++j) {
... | ALGO | 0.999439 | 3.970471 |
273e8d6e-9ed1-47d6-a7d5-853813512241 | Ri-Nai/CompetitionCode | ACM/2023-2024-2/2023-Guilin/G_Hard_Brackets_Problem.cpp | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<int, int> Pr;
#define End(X) return cout << (X) << '\n', void()
bool Nai;
int rd()
{
int res = 0, f = 1;
char c;
do
(c = getchar()) == '-' && (f = -1);
while (!isdigit(c));
while (isdigit(c))
res = (c ^ ... | ALGO | 0.99969 | 3.979965 |
d0bc2aa6-03e7-4557-8b80-3cfae4b3d20f | Saavrm26/mycppprogs | codechef/jan lucnch time/testing.cpp | #include <bits/stdc++.h>
using namespace std;
int main(){
vector<int> A{1,2,3,6};
int l=A.size();
for(int i=0;i<l;i++){
cout<<A[i]<<" " << endl;
}
vector<int> a(l);
copy(A.begin(),A.end(),a.begin());
for(int i=0;i<l;i++){
cout<<a[i]<<" " << endl;
}
} | ALGO | 0.998874 | 3.01852 |
15e41b0d-4849-468c-9f04-7bb4e527bc5f | codingksj/Baekjoon-Solution | 백준/11000~11999/11100~11199/11131.cpp | #include<bits/stdc++.h>
#include<unordered_set>
// ---------- 사용자 정의 자료형 ----------
using namespace std;
typedef long long LL;
typedef unsigned long long ULL;
typedef long double LD;
typedef pair<char, char> Pcc;
typedef pair<char, int> Pci;
typedef pair<char, string> PcS;
typedef pair<int, bool> Pib;
typedef pair<i... | ALGO | 0.999976 | 5.04032 |
35df4a2b-da74-46c7-b37f-8cad6f08939b | ishandutta2007/codeforces | penguinhacker/normal/1077/D.cpp | #include <bits/stdc++.h>
using namespace std;
#define ll long long
#define ar array
int n, k, c[200001];
int main() {
ios::sync_with_stdio(0);
cin.tie(0);
cin >> n >> k;
for (int i=0, a; i<n; ++i)
cin >> a, ++c[a];
int l=1, r=n/k+2;
while(l<r) {
int mid=(l+r+1)/2;
int cnt=0;
for (int i=1; i<=200000; +... | ALGO | 0.999991 | 3.285819 |
e73d1d17-023b-49b4-a531-fde907beaf26 | secomb/FlowEstimateV2_GPU | relax_method.cpp | /************************************************************************
relax_method - for FlowEstimateV1 - TWS May 2019
Use successive overrelaxation approach to solve linear system
*************************************************************************/
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#... | ALGO | 0.999971 | 4.642455 |
e480ba84-83b2-48ed-8bbc-34ac2da9acdd | MiraclesinWang/ACM_exercise | 各种代码/所有不在自己位置上的数的排列.cpp | #include <bits/stdc++.h>
using namespace std;
#define rep(i, x, y) for(int i = x; i < y; i++)
#define INF 0x3f3f3f3f
#define lowbit(x) x&(-x)
#define frt(x) x==fa[x]?x:fa[x]=frt(fa[x])
#define MEM(A, b) memset(A, b, sizeof(A))
#define debug(x) cout<<#x<<":"<<x<<"\n"
typedef long long LL;
const int maxn = 1e4 + 10;
LL ... | ALGO | 0.999825 | 3.59428 |
ae2ba4ce-aad0-41e1-a5ae-c3e2d7ec5c02 | Peepbo/Coding-Test | BAEKJOON/앵그리 창영/CodingTest/CodingTest.cpp | #include <iostream>
#include <cmath>
using namespace std;
int main(void) {
ios_base::sync_with_stdio(false);
cin.tie(NULL);
cout.tie(NULL);
int N, W, H;
float T;
cin >> N >> W >> H;
const float Diagonal = sqrt(W * W + H * H);
while (N--)
{
cin >> T;
if (T <= Diagonal)
{
cout << "DA" << '\n';
}
... | ALGO | 0.999638 | 3.836488 |
0c164397-b3e3-4b50-8944-9a73e26f1ea9 | arpitagrawal24/Leetcode | 2007-find-original-array-from-doubled-array/2007-find-original-array-from-doubled-array.cpp | class Solution
{
public:
vector<int> findOriginalArray(vector<int> &changed)
{
unordered_map<int, int> m;
vector<int> v, dummy;
if (changed.size() &1)
return dummy;
sort(changed.begin(), changed.end());
for (auto &i: changed... | ALGO | 0.999945 | 4.831842 |
3991f724-f8b5-4dcf-81ab-a0551b38e055 | GeorgeLyon/SwiftHDL | mlir/llvm/llvm/lib/Transforms/Scalar/CallSiteSplitting.cpp | #include "llvm/Transforms/Scalar/CallSiteSplitting.h"
#include "llvm/ADT/Statistic.h"
#include "llvm/Analysis/DomTreeUpdater.h"
#include "llvm/Analysis/TargetLibraryInfo.h"
#include "llvm/Analysis/TargetTransformInfo.h"
#include "llvm/IR/IntrinsicInst.h"
#include "llvm/IR/PatternMatch.h"
#include "llvm/Support/CommandL... | ALGO | 0.972879 | 7.79411 |
23c71072-f844-44d5-b0c7-a59bd5c884b1 | Rohitrky2021/JavaSourceCode | =C--P/Coding-blocks-CP-master/Strassens_Algorithm/Strassens_Algorithm.cpp | #include <assert.h>
#include <stdio.h>
#include <stdlib.h>
#include <time.h>
#define M 2
#define N (1<<M)
typedef double datatype;
#define DATATYPE_FORMAT "%4.2g"
typedef datatype mat[N][N]; // mat[2**M,2**M] for divide and conquer mult.
typedef struct
{
... | ALGO | 0.999979 | 4.30688 |
e096bf1a-fbba-4f1b-b8dd-f5a972f23310 | dmkz/competitive-programming | codeforces.com/Codeforces Ladder 1500-1599 (extra)/0137A.cpp | /*
Problem: 137A. Postcards and photos
Solution: implementation, O(n^2)
Author: Dmitry Kozyrev, github: dmkz, e-mail: <EMAIL>
*/
#include <iostream>
#include <string>
int main() {
int answ = 0;
std::string s; std::cin >> s;
while (!s.empty()) {
int i;
for (i = 0; i < ... | ALGO | 0.999816 | 4.280202 |
193f5cc7-638c-4492-901f-3585dd6001c5 | gitlicheng/camdroid | camdroid/frameworks/av/media/libvoicecall/codecs/libamrnb/enc/src/ol_ltp.cpp | /*
------------------------------------------------------------------------------
Pathname: ./audio/gsm-amr/c/src/ol_ltp.c
Funtions: ol_ltp
Date: 04/18/2000
------------------------------------------------------------------------------
REVISION HISTORY
Description: Adding pOverflow to the functions to remo... | ALGO | 0.960869 | 7.347808 |
e0c6bd48-1e1f-4a6a-b0d3-7a5c32fca345 | manikanta2901/ubuntu | .history/codingChallenges/cpp/Codechef/longChallenges/September/answer_20200913172525.cpp | #include<iostream>
#include<bits/stdc++.h>
using namespace std;
#define testcase() int t; cin >> t; while(t--)
int main(){
testcase(){
int size;
cin >> size;
vector<int> velocity,infected;
velocity.push_back(0);
for(int i = 1; i <= size; i++){
int a;
... | ALGO | 0.999919 | 3.588833 |
dadfd871-62ef-4da4-bbd4-ab7ab62a380c | liumuda/text | 上课题/反素数(深度优先搜索 DFS).cpp | #include<iostream>
#include<cstdio>
#include<cstring>
#define inf 0x7fffffff
#define ll long long
using namespace std;
int n,ans=1,num=1;
int p[15]= {1,2,3,5,7,11,13,17,19,23,29,31};
void dfs(int k,ll now,int cnt,int last) {
if(k==12) {
if(cnt>=num) { //Լ ·
ans=now;
num=cnt;
}
return;
}
int t=1;
... | ALGO | 0.999972 | 3.756379 |
f0353508-dced-42b4-8d9d-bb16c0d5f542 | andywu1998/C_and_Cpp | 学校课程代码/算法设计与分析/第2次作业/2-5_2.cpp | #include <iostream>
#include <cstdio>
#include <cstring>
#include <set>
using namespace std;
template <class type>
int ok(type list[], int k, int i){
if (i > k){
for (int t = k; t < i; t++){
if (list[t] == list[i]) return 0;
}
}
return 1;
}
template <class type>
void Perm(type list[], int k, int m){
if (k ==... | ALGO | 0.999961 | 3.647266 |
d8ba3d89-9b37-4f8a-994f-75176b76d19d | shakedc1599/Flights-Gear-Anomaly-Detector | minCircle.cpp | /*
* Created by:
* Shaked Cohen, <EMAIL>.
* Noam Cohen, <EMAIL>.
*/
#include "minCircle.h"
/**
* The function check if point within the circle.
* @param circle circle.
* @param p point.
* @return True the point in the circle, false else.
*/
bool isInside(const Point &p, const Circle &circle) {
return p.di... | ALGO | 0.999979 | 6.667811 |
6f4c240d-7b76-44a0-a2d9-47b75d6a2e8a | ddangu525/AlgorithmStudy | study_algo_gangnam/CNK/codePlus_basic/day11/02_7576_main.cpp | /*
토마토
https://www.acmicpc.net/problem/7576
*/
#include <cstdio>
#include <queue>
using namespace std;
int directions[4][2] = {{0, 1}, {0, -1}, {-1, 0}, {1, 0}};
int e[1000][1000];
int check[1000][1000];
queue<pair<int, int>> q;
void solve(int n, int m) {
while (!q.empty()) {
int node_x = q.front().first;
... | ALGO | 0.999858 | 4.778666 |
ae818265-c2e0-45f6-977e-0e55e4d1701e | mnhtng/C-plus-Algorithm | C++/Char and String/tong2soNguyenLon.cpp | #include <bits/stdc++.h>
using namespace std;
void swapp( string &s ){
for( int i = 0; i < s.size() / 2; i++ ){
char temp = s[i];
s[i] = s[s.size() - 1 - i];
s[s.size() - 1 - i] = temp;
}
}
int main(){
int t;
cin >> t;
while( t-- ){
string s1, s2;
cin >> s1 ... | ALGO | 0.999989 | 4.582646 |
a444f1c7-4894-4484-a4eb-bef7be80a4a7 | Mindjolt2406/Competitive-Programming | MiscContests/Code Galdiators/Semifinal/A.cpp | /*
Rathin Bhargava
IIIT Bangalore
*/
#include<bits/stdc++.h>
#define mt make_tuple
#define mp make_pair
#define pu push_back
#define INF 1000000001
#define MOD 1000000007
#define ll long long int
#define ld long double
#define fi first
#define se second
#define pr(v) { for(int i=0;i<v.size();i++) { v[i]==INF? cout<<"I... | ALGO | 0.999844 | 4.749362 |
98b3d076-4bff-4895-8a64-5e5cd4251c59 | AyushChauhan7983/DAA_Lab_Assignments | week2/ques2.cpp | #include <bits/stdc++.h>
using namespace std;
int main() {
int t;
cin>>t;
while(t--) {
int n;
cin>>n;
int arr[n];
for(int i = 0; i < n; i++)
cin>>arr[i];
vector<int> v;
for(int i = 0; i < n; i++) {
int k = n - 1;
int j = i +... | ALGO | 0.99994 | 4.190783 |
a661fd14-57af-4e32-830e-0986d79d9312 | perlconverter/TransCoderbkp | data/evaluation/geeks_for_geeks_successful_test_scripts/cpp/BREAKING_NUMBER_FIRST_PART_INTEGRAL_DIVISION_SECOND_POWER_10.cpp | #include <iostream>
#include <cstdlib>
#include <string>
#include <vector>
#include <fstream>
#include <iomanip>
#include <bits/stdc++.h>
using namespace std;
int f_gold ( string N ) {
int len = N . length ( );
int l = ( len ) / 2;
int count = 0;
for ( int i = 1;
i <= l;
i ++ ) {
string s = N . substr (... | ALGO | 0.998053 | 5.609984 |
59a90bc0-b942-4cd8-800c-50c6d3badd9c | nafargi/CPP-Leetcode-solutions | Zero Array Transformation III.cpp | class Solution {
public:
int maxRemoval(vector<int>& nums, vector<vector<int>>& queries) {
sort(queries.begin(), queries.end());
priority_queue<int> available;
priority_queue<int, vector<int>, greater<int>> assigned;
int count = 0;
for (int time = 0, k = 0; time < nums.size(... | ALGO | 0.999834 | 5.701211 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.