uuid stringlengths 36 36 | repo_name stringlengths 5 123 | relative_path stringlengths 5 4k | content stringlengths 33 2.85M | category stringclasses 6
values | algo_rel_score float64 0.85 1 | quality_score float64 3 8.76 |
|---|---|---|---|---|---|---|
b86c0986-6e3d-447d-99c5-208a819cc651 | tahsinsoha/Problem-solving- | Codeforces/trans mine.cpp | #include<bits/stdc++.h>
using namespace std;
int main(){
int t;
string s;
cin>>t;
while(t--){
cin>>s;
stack<char>st;
for(int i=0;i<s.size();i++){
if(s[i]=='+'||s[i]=='-'||s[i]=='*'||s[i]=='/'||s[i]=='^'||s[i]=='%') st.push(s[i]);
else if(s[i]==')'){
cout<<st.top();
st.pop();
}
else if (s... | ALGO | 0.999877 | 4.109041 |
981b1699-f092-4b01-8543-0aac5541f84a | corbinbaker/PokerMonteCarlo | PokerMonteCarlo/PokerMonteCarlo/AlphaPlayer.cpp | #include "AlphaPlayer.h"
#include "Player.h"
#include "Hand.h"
#include "BetHistory.h"
#include "PlayerType.h"
int AlphaPlayer::getBet(Hand opponent, BetHistory bh, int bet2player, bool canRaise, int pot) {
/*This is a derived class of Player that evaluates domain information for the current AI player and decides on ... | ALGO | 0.989606 | 5.850858 |
feb06c7f-77ab-4273-8bd5-1afd60b28b17 | rleish/relative_nav | kinect_vo/src/ransac.cpp | /*!
* \file ransac.cpp
* \author Robert Leishman
* \date March 2012
*
* \brief This implements the methods outlined in ransac.h
*/
#include "ransac.h"
using namespace cv;
//
//the contructor, initialize everything
//
RANSAC::RANSAC(int iters,
int inlier_thres,
double consensus_... | ALGO | 0.999391 | 5.691524 |
7b02a8c8-347f-4ab3-8bd5-5156f7c3e7b0 | mainulislamfahim/BlogApp | 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 |
d56faa20-0665-4a8b-b5a5-62c673c2e065 | haeramkeem/alGo | problem-archive/DP/L337_House_Robber_III.cpp | /**
* Leetcode 337) https://leetcode.com/problems/house-robber-iii/
*
* House Robber III
*/
#include <iostream>
#include <vector>
using namespace std;
/* ----- Domain ----- */
struct TreeNode {
int val;
TreeNode *left;
TreeNode *right;
TreeNode() : val(0), left(nullptr), right(nullptr) {}
Tre... | ALGO | 0.99991 | 6.606576 |
e3ffd632-2c82-4104-9491-7eb0f8b33f73 | dg31234df1/chill | internal/core/src/index/VectorMemIndex.cpp | #include "index/VectorMemIndex.h"
#include <unistd.h>
#include <cmath>
#include <cstring>
#include <filesystem>
#include <memory>
#include <string>
#include <unordered_map>
#include <unordered_set>
#include "common/Tracer.h"
#include "common/Types.h"
#include "common/type_c.h"
#include "fmt/format.h"
#include "index... | DATA | 0.882005 | 7.237284 |
52b78278-aea4-462c-8b98-285917be3adb | zhushaoben/training | 2020暑假训练/2020牛客暑期多校训练营(第一场)/H.Minimum-cost Flow.cpp | #include<bits/stdc++.h>
using namespace std;
const int N=55,M=205,inf=0x3f3f3f3f;
typedef long long LL;
struct Edge{
int next,to,w,fl;
}edge[M];
int n,m,s,t,fi[N],se,dis[N],pre[N],flow[N];
bool vis[N];
inline char getc(void) {
static char buf[1 << 18], *fs, *ft;
return (fs == ft && (ft = (fs = buf) + fread(bu... | ALGO | 0.999858 | 3.551984 |
1c773321-0404-43d8-ac42-991b1374c9f7 | Jss2005/Coding-Crew | APseries.cpp | #include <bits/stdc++.h>
using namespace std;
class Solution
{
public:
int nthTermOfAP(int a1, int a2, int n)
{
return a1+(n-1)*(a2-a1); //direct formula
}
};
int main() {
int t;
cin >> t;
while (t--) {
int a1, a2, n;
cin >> a1 >> a2 >> n;
Solution ob;
... | ALGO | 0.999732 | 4.860835 |
f4698adc-1325-451f-8af9-44851e33039d | masashi99/compete | atcoder/abc106/d/D.cpp | #include <bits/stdc++.h>
#define rep(i, n) for (int i = 0; i < n; i++)
#define repc(e, c) for (auto&& e : c)
#define all(a) (a).begin(), (a).end()
using namespace std;
typedef long long ll;
int main() {
int n, m, q;
cin >> n >> m >> q;
vector<int> s(n + 1, 0);
map<int, int> mp;
map<int, vector<int>... | ALGO | 0.999787 | 4.118316 |
549e4c56-986d-4cae-b7fa-d99a0074830d | Raiden22/TrioraCore2 | src/server/scripts/EasternKingdoms/ZulAman/boss_janalai.cpp | /* ScriptData
SDName: Boss_Janalai
SD%Complete: 100
SDComment:
SDCategory: Zul'Aman
EndScriptData */
#include "ScriptPCH.h"
#include "zulaman.h"
#include "GridNotifiers.h"
enum eEnums
{
SAY_AGGRO = -1568000,
SAY_FIRE_BOMBS = -1568001,
SAY_SUMMON_HATCHER = -1568002,
... | ALGO | 0.957696 | 3.208755 |
d6484aaf-567a-40b7-a0b5-dbe324893300 | UjjwalSharma01/Cpp-and-DSA | Searching and sorting/class 2 final.cpp | // Finding the square root of the number
/*
## Intuition
- kisi bhi number ka square root zero and us number ke beechme kahi toh lie krega and we can find that number using binary search
## Approach
1. we will take one array from zero to that number
2. Then we will find the the mid of the obtained array, we will comp... | ALGO | 0.999777 | 5.074732 |
02f8c8ce-6e1b-480e-bade-5ce142dd5bea | PrakashsahGit/C-Function-questions | Defult argument.cpp | #include<iostream>
using namespace std;
int add(int x,int y=0,int z=0){
int r=x+y+z;
return r;
}
int main(){
cout<<add(2)<<endl;
cout<<add(2,3,5)<<endl;
cout<<add(2,3)<<endl;
}
| TOOL | 0.992922 | 4.143233 |
549ac809-adb0-4538-a657-9039080505b3 | SH7072/DSA-cpp | 14_SetStl/2_MultiSetStl.cpp | // Ordered sets-Multiset
// Can contain duplicate elements, implemented using balanced BST
// Elements in sorted order,
// random access not possible in O( 1) or O( logn)
// Time- insertion-O(logn)
// Deletion- O(LogN)
// Lower/Upper Bound- O(LogN)
#include <bits/stdc++.h>
using namespace std;
int main()
{
... | ALGO | 0.998631 | 4.938053 |
262b242e-d47e-403e-a7fd-5557ca49fda5 | SaneaV/CEITI-Projects | C++ Labs/30.11.2017.13.cpp | //Дана матрица А(n,m). Подсчитать количество элементов больше чем X (X - вводится с клавиатуры)
#include <iostream>
#include <stdlib.h>
#include <windows.h>
using namespace std;
main()
{
SetConsoleCP(1251);
SetConsoleOutputCP(1251);
int n,m;
cout<<"Введите количество строк: ";
cin>>n;
cout<... | ALGO | 0.994193 | 3.022077 |
377cc8e4-5584-44ea-ab14-47ec94b64a0a | tixidi/ros_stent_graft | iiwa_test/src/IIWA/Eigen-3.3.3/doc/examples/TutorialLinAlgInverseDeterminant.cpp | #include <iostream>
#include <Eigen/Dense>
using namespace std;
using namespace Eigen;
int main()
{
Matrix3f A;
A << 1, 2, 1,
2, 1, 0,
-1, 1, 2;
cout << "Here is the matrix A:\n" << A << endl;
cout << "The determinant of A is " << A.determinant() << endl;
cout << "The inverse of A is:\n... | ALGO | 0.999572 | 4.186114 |
59d72a07-f9d2-4ce4-95b2-24eb2ca25f69 | ishandutta2007/codeforces | killerx/normal/1684/D.cpp | #include <bits/stdc++.h>
#define eprintf(args...) fprintf(stderr, args)
#define rep(i, n) for (int i = 0; i < (int)(n); ++ i)
const int mxn = 2e5 + 5;
int n, k;
int a[mxn];
int va[mxn];
inline void Main() {
scanf("%d %d", &n, &k);
rep(i, n) scanf("%d", &a[i]), va[i] = -a[i] + (n - i - 1);
std::sort(va, va + n);
... | ALGO | 0.999883 | 4.026505 |
5d77ef6b-2f44-487a-8c84-2ee08332f6e2 | michigan-traffic-lab/autoware | src/universe/autoware.universe/perception/probabilistic_occupancy_grid_map/src/utils/utils.cpp | #include "utils/utils.hpp"
#include <tier4_autoware_utils/geometry/geometry.hpp>
#include <string>
namespace utils
{
// used in laserscan based occupancy grid map
bool transformPointcloud(
const sensor_msgs::msg::PointCloud2 & input, const tf2_ros::Buffer & tf2,
const std::string & target_frame, sensor_msgs::ms... | TOOL | 0.920116 | 5.705402 |
ac51ae53-a536-4ee3-8e9b-7062c6f30986 | reneldegazon/reng | modules/face/src/bif.cpp | /*
This file contains implementation of the bio-inspired features (BIF) approach
for computing image descriptors, applicable for human age estimation. For more
details we refer to [1,2].
REFERENCES
[1] Guo, Guodong, et al. "Human age estimation using bio-inspired features."
Computer Vision and Pattern Recognit... | ALGO | 0.996824 | 6.43536 |
ea579604-5519-4f74-b2af-063f9c63ac54 | ebesin/navigation | nav2_constrained_smoother/src/constrained_smoother.cpp | #include <algorithm>
#include <string>
#include <memory>
#include <utility>
#include <vector>
#include "nav2_constrained_smoother/constrained_smoother.hpp"
#include "nav2_core/exceptions.hpp"
#include "nav2_util/node_utils.hpp"
#include "nav2_util/geometry_utils.hpp"
#include "nav2_costmap_2d/costmap_filters/filter_va... | ALGO | 0.958207 | 6.896137 |
e0f5a262-af75-4033-a01f-413b1abe0056 | abeesh/llvm-wine-patched | clang/lib/DirectoryWatcher/windows/DirectoryWatcher-windows.cpp | #include "DirectoryScanner.h"
#include "clang/DirectoryWatcher/DirectoryWatcher.h"
#include "llvm/ADT/STLExtras.h"
#include "llvm/Support/ConvertUTF.h"
#include "llvm/Support/Path.h"
#include "llvm/Support/Windows/WindowsSupport.h"
#include <condition_variable>
#include <mutex>
#include <queue>
#include <string>
#inclu... | TOOL | 0.921699 | 7.539796 |
c99ed88f-b295-4cad-bbb5-614fbdf17ede | huajian1069/monte-carlo | main.cpp | #include <iostream>
#include <map>
#include <vector>
#include <cmath>
#include "Exception/Exception.hpp"
#include "Distribution/Distribution.hpp"
#include "Distribution/Uniform.hpp"
#include "Distribution/Normal.hpp"
#include "Distribution/Exponential.hpp"
#include "Distribution/Geometric.hpp"
#include "Moments/Moments... | TEST | 0.985954 | 5.282936 |
a0a8c181-e634-40bc-a1f7-e3ef79d73b8a | YeyeQian/arv-q-project | gem5-arv-q-isa-simulator/src/systemc/tests/systemc/misc/unit/data/datawidth_signed/bits_to_bits/datawidth.cpp | /*****************************************************************************
datawidth.cpp --
Original Author: Martin Janssen, Synopsys, Inc., 2002-02-15
*****************************************************************************/
/**************************************************************************... | ALGO | 0.979934 | 5.296924 |
cc8a5a6d-9d4b-4017-912c-e56ebaabd252 | raincross7/code-similarity | codes/train_code/problem425/problem425_273.cpp | #include <iostream>
int main() {
int h, w;
for (std::cin >> h >> w; h !=0 && w != 0; std::cin >> h >> w) {
for (int i = 0; i < h; ++i) {
for (int j = 0; j < w; ++j) {
std::cout << '#';
}
std::cout << std::endl;
}
std::cout << std::endl;... | ALGO | 0.998989 | 3.902868 |
6c397b91-8c26-476a-9ca1-4c7fded98a29 | naveenvenk17/DSA_practice | BFME-IET/tempCodeRunnerFile.cpp | #include <bits/stdc++.h>
using namespace std;
// #pragma GCC target ("avx2")
// #pragma GCC optimization ("O3")
// #pragma GCC optimization ("unroll-loops")
#define MOD (1000000000 + 7)
#define pb(x) push_back(x)
#define mp(x, y) make_pair(x, y)
#define nl '\n'
#define all(x) x.begin(), x.end()
#define print(vec, l, r... | ALGO | 0.999857 | 3.908328 |
fc75a140-5c8f-436b-83ef-000bb7522916 | developer-diganta/leetcode-questions | 101-symmetric-tree/101-symmetric-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.999975 | 6.539526 |
62d820a3-776d-4788-97b2-a916273eb9a6 | DeepInMind12345/UEToonShading | Engine/Plugins/Experimental/AlembicImporter/Source/ThirdParty/Alembic/openexr/OpenEXR/IlmImf/ImfHuf.cpp | //-----------------------------------------------------------------------------
//
// 16-bit Huffman compression and decompression.
//
// The source code in this file is derived from the 8-bit
// Huffman compression and decompression routines written
// by Christian Rouet for his PIZ image file format.
//
//-----------... | ALGO | 0.979848 | 6.422013 |
34a141dd-6523-4af5-bb98-72a0f0c9e8cf | ishandutta2007/codeforces | -skyline-/normal/510/B.cpp | #include<cmath>
#include<math.h>
#include<ctype.h>
#include<algorithm>
#include<bitset>
#include<cassert>
#include<cctype>
#include<cerrno>
#include<cfloat>
#include<ciso646>
#include<climits>
#include<clocale>
#include<complex>
#include<csetjmp>
#include<csignal>
#include<cstdarg>
#include<cstddef>
#include<cstdio>
#i... | ALGO | 0.999984 | 3.058479 |
c26f53bc-fb28-46ba-b8fe-fbb24b33f3d8 | ArtificialZeng/pytorch-explained | aten/src/ATen/native/cpu/BlasKernel.cpp | #define TORCH_ASSERT_NO_OPERATORS
#include <ATen/Dispatch.h>
#include <ATen/native/CPUBlas.h>
#include <c10/util/irange.h>
#include <c10/util/Unroll.h>
namespace at::native {
namespace cpublas {
namespace {
template <typename scalar_t, typename opmath_t>
void scale_(int64_t m, int64_t n, opmath_t alpha, scalar_t *a, ... | ALGO | 0.935636 | 7.511662 |
a288615b-abe1-4f8f-9d99-f2f3a174f877 | nkufree/opencv-cmake-template | deps/eigen-3.4.0/test/visitor.cpp | #include "main.h"
template<typename MatrixType> void matrixVisitor(const MatrixType& p)
{
typedef typename MatrixType::Scalar Scalar;
Index rows = p.rows();
Index cols = p.cols();
// construct a random matrix where all coefficients are different
MatrixType m;
m = MatrixType::Random(rows, cols);
for(Ind... | TEST | 0.853831 | 6.871651 |
6fa3f811-3744-4b5f-9a0e-8a258498a26b | Madhab-Karmaker/UVA | 11489.cpp | ///Lord Krishna
#include<bits/stdc++.h>
using namespace std;
int make_divisible(string str)
{
int cnt = 0,sum=0;
if(str.size() == 1)
return 1;
for(int i=0; i<str.size(); i++)
{
sum+=str[i]-'0';
}
for(int i=0; i<str.size(); i++)
{
if((sum - (str[i]-'0')) %3 == 0 and su... | ALGO | 0.999316 | 4.241479 |
478c2c29-9aac-494c-bad8-03356fae2716 | Yehn-an/px4-Autopilot-v1.14.2 | src/modules/control_allocator/ControlAllocation/ControlAllocationSequentialDesaturation.cpp | /**
* @file ControlAllocationSequentialDesaturation.cpp
*
* @author Roman Bapst <<EMAIL>>
* @author Beat Küng <<EMAIL>>
*/
#include "ControlAllocationSequentialDesaturation.hpp"
void
ControlAllocationSequentialDesaturation::allocate()
{
//Compute new gains if needed
updatePseudoInverse();
_prev_actuator_sp =... | ALGO | 0.980223 | 6.773466 |
34013e40-5a2b-48da-b5eb-195ce6e142b3 | PlanarG/Code | Practise/6.28/dalao.cpp | #include <bits/stdc++.h>
using namespace std;
const int N = 2000010;
typedef long long LL;
int A[N], B[N], C[N], id[N], n;
LL seed;
LL rnd() { return seed = ((seed * 19260817) ^ 233333) & ((1 << 24) - 1); }
void gen(int a[]) {
for (int i = 1; i <= n; i++) a[i] = i;
for (int i = 1; i <= n; i++) swap(a[i], ... | ALGO | 0.999756 | 3.420682 |
8104aab1-0f93-4bfe-837b-ee0ad741b778 | Baza-Foundation/baza-coin | src/zedwallet/Transfer.cpp | ///////////////////////////////
#include <zedwallet/Transfer.h>
///////////////////////////////
#include <Common/Base58.h>
#include <Common/StringTools.h>
#include <config/CryptoNoteConfig.h>
#include <CryptoNoteCore/CryptoNoteBasicImpl.h>
#include <CryptoNoteCore/CryptoNoteTools.h>
#include <CryptoNoteCore/Transact... | TOOL | 0.942144 | 5.876323 |
85cd333e-5cd4-4e46-8c45-037b51d398e6 | shantanu2002git/LEET-QS | 0199-binary-tree-right-side-view/0199-binary-tree-right-side-view.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.999788 | 6.21569 |
cd4dcb72-b6f8-4da2-92f5-8735b690a13a | vanphong93/DataStructureAlgorithms | test02/de02.cpp | #include <iostream>
#include <time.h>
using namespace std;
// Câu 1 xây dựng cấu trúc dữ liệu sinh viên
struct SinhVien
{
int maSV;
string hoTen;
float diemMH;
};
typedef SinhVien SV;
// Bước 1.Tạo cấu trúc node
struct node
{
SV data;
node *pnext;
};
// Bước 2.Tạo cấu trúc danh sách lkđ
struct Li... | ALGO | 0.99845 | 3.647073 |
4730b513-270a-4e05-9507-c144ff0fb98d | g-jensen/cses | repetitions.cpp | #include <iostream>
int main(int argc, char const *argv[]) {
std::string input;
std::cin >> input;
size_t highest = 0;
size_t length = 0;
size_t l = input.size();
char prev = input[0];
for (size_t i = 1; i < l; i++) {
if (prev == input[i]) {
length++;
} else... | ALGO | 0.999731 | 4.82017 |
4633c994-282e-4116-ac47-e25581f5f09f | quangbach1709/Study_cpp_py | C++in_class/bt_ham/b4.cpp | #include<iostream>
using namespace std;
bool kiem_tra_so_nguyen_to(int n)
{
if (n <= 1) {
return false;
}
for (int i = 2; i * i <= n; i++) {
if (n % i == 0) {
return false;
}
}
return true;
}
void nhap_mang(int arr[],int n)
{
for (int i = 0; i < n; i++)
{
cout<<"Nhap ph... | ALGO | 0.99948 | 4.111655 |
5dff6a79-3093-4446-a621-5363223657f6 | dilatedtime/Data-Structures-Algorithm | Codeforces/NeedArrays.cpp | #include <iostream>
#include <stack>
using namespace std;
int main()
{
int t;
cin >> t;
int n;
while (t--)
{
cin >> n;
int num;
stack<int> st;
for (int i = 0; i < n; i++)
{
cin >> num;
if (st.empty())
{
... | ALGO | 0.999434 | 4.555644 |
07a88910-406c-4605-91b7-1bef4053867b | TarunSaini063/Coding | Codechef/Selection of Cities.cpp | #include <bits/stdc++.h>
using namespace std;
#define ld double
#define ll long long
#define pb emplace_back
#define mk make_pair
#define mod 1000000007
#define ff first
#define ss second
#define FIO ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL);
#define all(x) x.begin(),x.end()
ll power(ll n)
{
ll a... | ALGO | 0.999969 | 5.021931 |
e1fbaf69-4614-4847-af5a-c326bcd46c6c | CarbonROM/android_device_google_cuttlefish | host/frontend/webrtc/lib/utils.cpp | #include "host/frontend/webrtc/lib/utils.h"
#include <map>
#include <json/json.h>
namespace cuttlefish {
namespace webrtc_streaming {
namespace {
std::string ValidateField(const Json::Value &obj, const std::string &type,
const std::string &field_name,
const Json:... | TOOL | 0.922184 | 7.693287 |
9d29c501-1787-4cc2-8f07-870c5a06ac99 | gcp-vais-team1/lammps | src/CG-DNA/bond_oxdna_fene.cpp | /* ----------------------------------------------------------------------
Contributing author: Oliver Henrich (University of Strathclyde, Glasgow)
------------------------------------------------------------------------- */
#include "bond_oxdna_fene.h"
#include "atom.h"
#include "comm.h"
#include "constants_oxdna.... | ALGO | 0.998347 | 5.905204 |
c413d915-0e68-4523-bd3c-b43015630128 | UserBits/OI-Codes | Luogu/P1965[快速幂][数学]转圈游戏.cpp | #include <cstdio>
#include <cstdlib>
int gcd(int x,int y){
return y==0?x:gcd(y,x%y);
}
int q_pow(int x,int y,int mod){
int r=1;
while(y){
if(y&1)
r=r*x%mod;
x=x*x%mod;
y>>=1;
}
return r;
}
int main(){
int n,m,k,x;
scanf("%d%d%d%d",&n,&m,&k,&x);
int mod... | ALGO | 0.999992 | 3.587821 |
1b3391c0-30ad-4e1e-b6f6-11d3425e89ae | Mugdha-Hazra/180-Questions-Striver-SDE-sheet-in-CPP | Transpose of Matrix - GFG/transpose-of-matrix.cpp | //{ Driver Code Starts
#include <bits/stdc++.h>
using namespace std;
// } Driver Code Ends
class Solution
{
public:
//Function to find transpose of a matrix.
void transpose(vector<vector<int> >& matrix, int n)
{
// code here
for(int i=0; i<n; i++)
{
for(int ... | ALGO | 0.999961 | 5.367355 |
9b98a125-5d95-4214-84cd-92b20985ad93 | TechnicJelle/RosegardenRecipesEditor | 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.998784 | 6.761023 |
2e7efa82-59d6-43d5-88fd-b669f418dcd5 | tomaskarban/CoreMarkCpp | CoreListJoin.cpp | #include "CoreListJoin.h"
#include "CoreMatrix.h" // for core_bench_matrix
#include "CoreState.h" // for core_bench_state
#include "CoreUtil.h" // for crcu16, crc16
#include <utility> // for move
list_head *core_list_find(list_head *list, list_data *info);
list_head *core_list_reverse(list_head *list);
list_head ... | ALGO | 0.999594 | 4.748102 |
0f0c74c9-ec3f-40e0-b79e-f7a823f6a4ee | aditya-263/sample | sw.cpp | // C++ program to find sum of all minimum and maximum
// elements Of Sub-array Size k.
#include <bits/stdc++.h>
using namespace std;
// Returns sum of min and max element of all subarrays
// of size k
int SumOfKsubArray(int arr[], int N, int k)
{
// To store final answer
int sum = 0;
// Find all subarray... | ALGO | 0.999934 | 5.541723 |
c35a598b-ccec-4ca7-8202-3e1695021bac | ishandutta2007/codeforces | rxdoi/normal/949/A.cpp | #include<bits/stdc++.h>
#define For(i,x,y) for (int i=x;i<y;i++)
#define pb push_back
#define mp make_pair
#define fi first
#define se second
#define lf else if
#define dprintf(...) fprintf(stderr,__VA_ARGS__)
using namespace std;
typedef long long ll;
typedef double db;
typedef pair<int,int> pii;
typedef vector<int... | ALGO | 0.999608 | 3.229984 |
097d4fa9-1d98-4613-bfff-9e9e6b5a3a22 | ANCHAL628/Leetcode-Google | 929-unique-email-addresses/929-unique-email-addresses.cpp | class Solution {
public:
int numUniqueEmails(vector<string>& emails) {
set<string>s;
for(auto x: emails)
{
string temp="";
for(auto y: x)
{
if(y!='+' and y!='@' and y!='.' )
temp+=y;
if(y=='+' or y==... | ALGO | 0.999691 | 5.712931 |
335be544-750d-4cb8-8ba5-d84b2beec370 | artem-barsov/CP | opencup/XXII/XiAn/L.cpp | #include <bits/stdc++.h>
#define _CRT_DISABLE_PERFCRIT_LOCKS
using namespace std;
int main(int argc, char const *argv[]) {
ios_base::sync_with_stdio(false);
cin.tie(NULL);
cout.tie(NULL);
std::string s, line;
while (getline(cin, line))
s += line + ' ';
for (int i = 0; i + 4 < s.length... | ALGO | 0.993368 | 3.752875 |
1167fb0c-420b-4bc9-9b5c-851b1d596985 | njrafi/Competitive-Programming-Solutions | CodeForces/746A - Compote - 23109735.cpp | #include <bits/stdc++.h>
#ifndef ONLINE_JUDGE
#define gc getchar
#define pc putchar
#else
#define gc getchar_unlocked
#define pc putchar_unlocked
#endif
using namespace std;
#define vi vector<int>
#define vll vector<i64>
#define si set<int>
#define vs vector<string>
#define pii pair<int, int>
#define vpi vector<pii>
#d... | ALGO | 0.99962 | 3.846491 |
668c1e90-5a25-4400-bc08-b4aef8e878ee | errantProgrammer/Algorithms | CodeWars/8kyu/CPP/CountOfPositivesSumOfNegatives.cpp | // src: https://www.codewars.com/kata/576bb71bbbcf0951d5000044/
#include <vector>
std::vector<int> countPositivesSumNegatives(std::vector<int> input)
{
if (input.size() == 0) return {};
int cant_positive = 0, sum_negative = 0;
for(auto i: input){
if ( i > 0) cant_positive++;
if ( i < 0) sum_negat... | ALGO | 0.998772 | 5.507399 |
b54b4332-2077-47c9-bbbb-2a9cefe92f37 | Naman4925/LeetCode | Valid Substring - GFG/valid-substring.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:
int findMaxLen(string s) {
// code here
stack<int> st;
int count=0;
st.push(-1);
for(int i=0;... | ALGO | 0.998371 | 5.835251 |
0a33cf48-4dc9-4702-8ba0-4a004dd01228 | abnsweis/Algorithms-Problem-Solving-Level-3 | Problems_From_30_to_40/Problem_33/app.cpp | #include <iostream>
#include <string>
using namespace std;
string ReadString(){
string str="";
cout << "Please Enter Your String : ";
getline(cin,str);
return str;
}
bool isVowel(char ch1){
ch1 = tolower(ch1);
return ( (ch1 == 'a') || (ch1 == 'e') || (ch1 == 'i') || (ch1 == 'o') || (ch1
== 'u') );
}
sho... | ALGO | 0.998827 | 5.304345 |
ab208401-db3f-46d3-96d3-7fd7ee70af97 | TheInferentialImp/Quantitative-Research-and-Testing | c++ strats/main.cpp | // Author: Alexander Yousif (730622857)
// BT V1.0 C++
#include <iostream>
#include <cmath>
#include <fstream>
using namespace std;
// Define function to calculate Bollinger Bands
void calcBollingerBands(double *price,double &upperBand,
double &lowerBand) {
double sum = 0.0, sumSquared = 0.0, mean = 0.0, sd = 0.0;
... | ALGO | 0.999918 | 5.806854 |
43cbca42-9d64-4996-a87c-b98f81f6acfb | ddangcong80/codetree-TILs | 231225/3의 배수 출력하기/print-multiple-of-number-three.cpp | #include <iostream>
using namespace std;
int main() {
int i = 3, n;
cin >> n;
while(i <= n) {
cout << i << " ";
i += 3;
}
return 0;
} | ALGO | 0.99956 | 3.778794 |
e006e8d8-0c3f-49eb-992b-2e40ff440d5a | droidy12527/AlgorithmsInPythonandCpp | codeforces-Beautiful_Matrix.cpp | #include<bits/stdc++.h>
using namespace std;
void solve(){
vector<vector<int>> matrix;
int val;
int h, k;
for(int i = 0; i < 5; i++){
vector<int> temp;
for(int j = 0; j < 5; j++){
cin >> val;
temp.push_back(val);
}
matrix.push_back(temp);
temp.clear();
}
for(int i = 0 ... | ALGO | 0.999864 | 3.807108 |
3ff3522b-43bb-43af-8601-afd224bba51f | enruedabe/Programacion2020-2 | 2020-09-25_Fileinput_output/Newton-file-IO.cpp | #include <iostream>
#include <fstream>
#include <cmath>
#include <string>
using fptr = double(double);
double f(double x);
double g(double x);
double deriv(double x);
double bisection(double xl, double xu, double eps, fptr fun, int nitermax);
double regulafalsi(double xl, double xu, double eps, fptr fun, int nitermax)... | ALGO | 0.999882 | 4.483704 |
3630e55d-ac94-446c-b024-991851d83ae6 | iains/LLVM-7-branch | libcxx/test/std/algorithms/alg.modifying.operations/alg.partitions/partition.pass.cpp | // <algorithm>
// template<BidirectionalIterator Iter, Predicate<auto, Iter::value_type> Pred>
// requires ShuffleIterator<Iter>
// && CopyConstructible<Pred>
// Iter
// partition(Iter first, Iter last, Pred pred);
#include <algorithm>
#include <cassert>
#include "test_iterators.h"
struct is_odd
{
... | TEST | 0.940728 | 6.65771 |
bfc0b8d5-5c1f-41f7-b8cf-b89b96a80051 | myscale/MyScaleDB | src/Functions/array/arrayCompact.cpp | #include <Columns/ColumnDecimal.h>
#include <Columns/ColumnsNumber.h>
#include <Common/HashTable/HashTable.h>
#include <DataTypes/DataTypesDecimal.h>
#include <DataTypes/DataTypesNumber.h>
#include <Functions/FunctionFactory.h>
#include <Functions/array/FunctionArrayMapped.h>
namespace DB
{
/// arrayCompact(['a', '... | ALGO | 0.955883 | 7.674312 |
9912aa1f-34c2-4afc-bafc-8a0c7ed4a1ed | rammiah/OnlineJudge | nowcoder/HUST/最小年龄的3个职工.cpp | #include <string>
#include <iostream>
#include <vector>
#include <algorithm>
#include <cctype>
#include <map>
#include <iomanip>
#include <cmath>
#include <cstring>
#include <cstdlib>
#include <cstdio>
#include <queue>
using namespace std;
struct Employ {
int id;
string name;
int age;
friend bool ope... | ALGO | 0.998452 | 3.982739 |
d0ce9a25-6fa4-473d-8df2-2aec2e5f6228 | ericjuice/NetworkSecurity_homework_2023 | lab2/RSA/bigInt.cpp | #include "bigInt.h"
#include <iostream>
#include <string>
#include <algorithm>
#include <cmath>
using namespace std;
const double PI = acos(-1.0);
bigInt string2bigInt(string s)
{
bigInt b("0");
int l = s.length();
for(int i = 0;i < l;i ++)
{
int n = s[i];
string num(3,'0');
num[2] += n%10;
num[1] += (n/10... | ALGO | 0.998863 | 3.558415 |
b43a7f5a-f575-43f0-933f-961fab4ed9eb | 189569400/ORE-Engine | QuantExt/qle/instruments/impliedbondspread.cpp | #include <boost/make_shared.hpp>
#include <ql/math/solvers1d/brent.hpp>
#include <ql/termstructures/yieldtermstructure.hpp>
#include <qle/instruments/impliedbondspread.hpp>
using namespace QuantLib;
namespace QuantExt {
namespace {
class PriceError {
public:
PriceError(const Bond& engine, SimpleQuote& spread, R... | ALGO | 0.999794 | 7.702565 |
25603138-5c27-424f-a0b1-a40ba8dcb400 | ishandutta2007/codeforces | archuser84/normal/997/A.cpp | #define _USE_MATH_DEFINES
#define FAST ios::sync_with_stdio(false),cin.tie(0),cout.tie(0);
#include <bits/stdc++.h>
#define Loop(x, l, r) for(int x = l; x < r; ++x)
#define LoopR(x, l, r) for(int x = (r)-1; x >= l; --x)
#define all(x) x.begin(), x.end()
#define Kill(x) return cout << (x) << '\n', 0
#define YN(flag) ((f... | ALGO | 0.999939 | 3.872483 |
e1afa497-de9c-4d31-879d-475091ea312a | RicardoYam/DataEscrowSystem | attested_tls/server/host/boost_1_85_0/libs/hana/example/maximum.cpp | #include <boost/hana/assert.hpp>
#include <boost/hana/equal.hpp>
#include <boost/hana/greater.hpp>
#include <boost/hana/integral_constant.hpp>
#include <boost/hana/maximum.hpp>
#include <boost/hana/tuple.hpp>
namespace hana = boost::hana;
int main() {
// without a predicate
BOOST_HANA_CONSTANT_CHECK(
h... | TEST | 0.944944 | 5.637891 |
f409c5c3-a845-4a05-bdd6-d78071adb9ec | vrangr1/competitive-programming | contests/atcoder/beginner_contests/abc_347/e.cpp | /***************************************************
* Author : Anav Prasad
* Nick : vrangr
* Created : Sat Mar 30 18:13:05 IST 2024
****************************************************/
#include <iostream>
#include <vector>
#include <string.h>
#include <ctype.h>
#include <set>
#include <stdlib.h>
#include <map>
#i... | ALGO | 0.99997 | 3.855975 |
941efe04-8122-4223-925e-0e4a5ba96275 | anurag94459/LeetCode | 1957-delete-characters-to-make-fancy-string/1957-delete-characters-to-make-fancy-string.cpp | class Solution {
public:
string makeFancyString(string s) {
string res;
int n=s.size();
for(int i=0;i<n-2;i++){
if(s[i]!=s[i+1] || s[i]!=s[i+2]){
res+=s[i];
}
}
res+=s[n-2];
res+=s[n-1];
return res;
}
}; | ALGO | 0.999949 | 5.054236 |
3f2fa879-d56a-4a0d-975a-fb0490691e4e | Vera-Firefly/Mesa25.0 | src/amd/compiler/aco_insert_delay_alu.cpp | #include "aco_builder.h"
#include "aco_ir.h"
#include <map>
#include <stack>
#include <vector>
namespace aco {
namespace {
/* On GFX11+ the SIMD frontend doesn't switch to issuing instructions from a different
* wave if there is an ALU stall. Hence we have an instruction (s_delay_alu) to signal
* that we should s... | TOOL | 0.94976 | 5.786856 |
452b864c-27d8-45e3-99d0-ff44cbed400a | thangnguyen0903/CTDL-GT | CTDL085.cpp | #include <bits/stdc++.h>
using namespace std;
#define ll long long
int main() {
int t; cin >> t;
while(t--)
{
ll n; cin >> n;
vector<int> a;
while(n)
{
a.push_back(n % 10);
n /= 10;
}
reverse(a.begin(), a.end());
int vt = a.size();
for(in... | ALGO | 0.999917 | 4.651388 |
704bb1bc-38b1-457b-aa27-8b57941f24ad | KYENS/gem5_InCache | src/systemc/tests/systemc/misc/v1.0/dash6/dist.cpp | /*****************************************************************************
dist.cpp -- Implementation of the odometers.
Original Author: Ali Dasdan, Synopsys, Inc.
*****************************************************************************/
/************************************************************... | ALGO | 0.995669 | 6.558409 |
4d2d248b-3049-4f3f-8a53-74897dbc7da2 | Mktcoin-official/Mktcoin | src/stakeinput.cpp | #include "chain.h"
#include "main.h"
#include "stakeinput.h"
#include "wallet.h"
//!PIV Stake
bool CPivStake::SetInput(CTransaction txPrev, unsigned int n)
{
this->txFrom = txPrev;
this->nPosition = n;
return true;
}
bool CPivStake::GetTxFrom(CTransaction& tx)
{
tx = txFrom;
return true;
}
bool C... | ALGO | 0.853099 | 4.175755 |
b2fc0c30-e092-4853-afd5-07d99f22001c | PotterHeads/advent-of-code | aoc-2021/day7/day7part1.cpp | #include <bits/stdc++.h>
using namespace std;
int main(){
std::ios::sync_with_stdio(false); std::cin.tie(NULL);
freopen("in.txt", "r", stdin);
vector<int> locations;
string line,num;cin>>line;
stringstream ss(line);
int sum = 1e9;
while(getline(ss,num,',')){
locations.push_back(stoi... | ALGO | 0.999602 | 4.400009 |
1396c06a-0266-4069-bac3-4bad3809d43d | ganshuoos/C-Primer- | equal.cpp | //equal.cpp -- equality vs assignment
#include<iostream>
int main(int argc, char const *argv[])
{
/* code */
using namespace std;
int quziscores[10] = {20,20,20,20,20,19,20,18,20,20};
cout << "Doing it right : \n";
int i;
for (int i = 0; quziscores[i] == 20 ; ++i)
{
/* code */
cout << "quiz " << i << " is a... | ALGO | 0.991828 | 3.554977 |
79e97339-a66c-4a9d-9705-29485396557a | honey0632/GFG-2024-Daily | 12-13-2024.cpp | // Sorted and Rotated Minimum
// https://www.geeksforgeeks.org/problems/minimum-element-in-a-sorted-and-rotated-array3611/1
#include<bits/stdc++.h>
using namespace std;
class Solution {
public:
int findMin(vector<int>& arr) {
// complete the function here
int n=arr.size();
int low=0, hig... | ALGO | 0.999987 | 5.840411 |
10189e7a-a245-45a3-a38e-5f534f59355f | ayushhhmeena/CodeForces | Chef and Brain Speed.cpp | /*
Author:- Ayush Meena
*/
#include<bits/stdc++.h>
using namespace std;
#define ll long long
int main(){
ios::sync_with_stdio(false); cin.tie(NULL);
ll x,y; cin>>x>>y;
if(x>=y){
cout<<"NO";
}else{
cout<<"YES";
}
return 0;
} | ALGO | 0.999937 | 3.297968 |
7d3d1857-6e70-4cfc-9e5c-5038ea3f48b8 | exkuretrol/CPP-Programming-Language | Wed/UVa10107.cpp | #include <iostream>
#include <algorithm>
#include <vector>
using namespace std;
#define question "UVa10107"
#define input question ".in.txt"
#define output question ".out.txt"
int main()
{
vector<int> v;
int n;
freopen(input, "r", stdin);
freopen(output, "w", stdout);
while (cin >> n)
{
... | ALGO | 0.999958 | 4.035358 |
698c2256-ef7a-4b81-a0d5-b454a632fbf6 | Edisonwei54/my-hello-algo-stu | en/codes/cpp/chapter_sorting/heap_sort.cpp | /**
* File: heap_sort.cpp
* Created Time: 2023-05-26
* Author: krahets (<EMAIL>)
*/
#include "../utils/common.hpp"
/* Heap length is n, start heapifying node i, from top to bottom */
void siftDown(vector<int> &nums, int n, int i) {
while (true) {
// Determine the largest node among i, l, r, noted as m... | ALGO | 0.999993 | 5.893078 |
2e0ef32f-a68a-41e2-904f-20ee6bb7f052 | speedhunter001/cpp | semester-2-oop-project-wxwidgets/paint/formulas.cpp | #include <cmath>
int get_width(int x1, int x3) {
return x3 - x1;
}
int get_height(int y1, int y3) {
return y3 - y1;
}
int get_distance(int x1, int y1, int x2, int y2) {
int distance;
distance = sqrt( pow( (x2 - x1), 2 ) + pow( (y2-y1), 2 ) );
return distance;
} | ALGO | 0.977676 | 4.398592 |
11e46ed7-e40e-4f48-8fc3-cff48ff3deb1 | kaushikmukunda/code_challenges | sprint/Equations/eq.cpp | #include <iostream>
#include <vector>
#include <math.h>
#include <string.h> // memset
#include <stdlib.h>
#include <stdio.h>
#define MOD 1000007
using namespace std;
// Sieve of Erathostenes
static vector<long long>* generate_primes(long long limit)
{
vector<long long> *primes = new vector<long long>;
long ... | ALGO | 0.999967 | 4.617504 |
d875ee5e-4be1-4427-be0c-b20acb029615 | VanDien2006/DSA | ThucHanh/OnTapCuoiKy/Bai10/Bai10.cpp | /*###Begin banned keyword - each of the following line if appear in code will raise error. regex supported
###End banned keyword*/
#include <iostream>
#include <queue>
using namespace std;
struct TNODE {
int key;
TNODE* pLeft;
TNODE* pRight;
};
typedef TNODE* TREE;
//###INSERT CODE HERE -
TNODE *CreateTNode(int x... | ALGO | 0.999954 | 4.178188 |
464c30da-a7ca-454f-9569-630d37d05ef2 | rukletsov/bo | src/io/ini_reader.cpp |
#include "bo/pch.h"
#include <boost/assert.hpp>
#include <boost/regex.hpp>
#include "bo/io/ini_reader.hpp"
namespace bo {
namespace io {
void IniReader::set_settings(const IniReaderSettings& settings)
{
settings_ = settings;
}
void IniReader::read_file(const String& file_name)
{
Line line;
String cur_s... | TOOL | 0.94098 | 7.39055 |
86c98d72-468f-439b-a623-c29ef6212a3e | JamesQAQ/Coding-Practices | LeetCode/Medium/0763. Partition Labels/2022-06-16_Accepted.cpp | class Solution {
int first[26], last[26];
public:
vector<int> partitionLabels(string s) {
for (int i = 0; i < 26; i++) {
first[i] = -1;
}
for (int i = 0; i < s.length(); i++) {
int index = s[i] - 'a';
if (first[index] == -1) {
firs... | ALGO | 0.999912 | 6.115611 |
c246dce5-3f8a-41bc-82b3-295265a5c5ab | heavenMOJANG/ICPC | .history/programmes_C_Cpp/HDU/2025“钉耙编程”中国大学生算法设计春季联赛(2)/1008_20250315124301.cpp | #pragma GCC optimize(1)
#pragma GCC optimize(2)
#pragma GCC optimize(3, "Ofast", "inline")
#include <bits/stdc++.h>
#define int long long
using namespace std;
constexpr int INF = 0x7fffffff;
void solve() {
int n, m; cin >> n >> m;
vector<int> g[3 * n + 1];
int ok = 1;
for (int i = 0; i < m; ++ i) {
... | ALGO | 0.999963 | 5.625453 |
1b7f1586-71c9-459d-9884-54824a27bd9d | Ellie023/algorithm_baekjoon | 11404.cpp | #include <iostream>
using namespace std;
static int n,m;
static long mdistance[101][101];
const int Max =10000001;
int main() {
ios::sync_with_stdio(false);
cin.tie(NULL);
cout.tie(NULL);
cin>>n>>m;
for(int i=1; i<=n; i++){
for(int j=1; j<=n; j++){
if(i==j){
... | ALGO | 0.999978 | 4.092472 |
14dfbf6b-e01e-4d09-a0e2-cede8360bec6 | intel/hyperscan | src/nfagraph/ng_dominators.cpp | /** \file
* \brief Calculate dominator and post-dominator trees.
*
* A small wrapper around the BGL's lengauer_tarjan_dominator_tree algorithm.
*/
#include "ng_dominators.h"
#include "ue2common.h"
#include "ng_holder.h"
#include "ng_util.h"
#include <boost-patched/graph/dominator_tree.hpp> // locally patched vers... | ALGO | 0.999866 | 7.522296 |
60dc804e-ca7a-48cf-a766-df2aa0cc9914 | nakul1010/DSALGO | Number of subsets with product less than k - GFG/number-of-subsets-with-product-less-than-k.cpp | // { Driver Code Starts
#include <bits/stdc++.h>
using namespace std;
// } Driver Code Ends
//User function Template for C++
class Solution {
public:
int subseq(int arr[],int n,int k,int product,int &cnt)
{
if(product>k)
return 0;
if(n<0)
{
// cnt++;
... | ALGO | 0.999863 | 4.690005 |
88b3f9b2-7f04-4b44-9eef-4f1166139c24 | brunodev85/mesa3d-custom | zink-22.2.5/src/intel/compiler/brw_fs_copy_propagation.cpp | /** @file brw_fs_copy_propagation.cpp
*
* Support for global copy propagation in two passes: A local pass that does
* intra-block copy (and constant) propagation, and a global pass that uses
* dataflow analysis on the copies available at the end of each block to re-do
* local copy propagation with more copies avai... | ALGO | 0.970425 | 6.92548 |
07a96c88-1569-4e22-9b81-c0251dff1df1 | raincross7/code-similarity | codes/train_code/problem361/problem361_497.cpp | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef long double ld;
int main() {
cin.tie(0);
ios::sync_with_stdio(false);
ll N, M;
cin >> N >> M;
if(N >= M / 2LL) {
cout << M / 2LL << endl;
return 0;
}
ll ans = N;
M -= N * 2LL;
ans += M /... | ALGO | 0.999963 | 3.467545 |
5c1ff33c-24e8-47b8-b108-0b52bb535126 | singhjyotiraditya/Daily-LeetCode-Problems | 1512-number-of-good-pairs/1512-number-of-good-pairs.cpp | class Solution {
public:
int numIdenticalPairs(vector<int>& nums) {
int n=nums.size();
int count=0;
for (int i=0; i<n; i++){
for (int j=i+1; j<n; j++){
if (nums[i] == nums[j]){
count++;
}
}
}
ret... | ALGO | 0.999947 | 5.978744 |
6fe7100d-5df2-4a3f-9fb8-c5974331586e | brandoni27/CPlusPlus-ClassPrograms | P56_MoveTheLargestNumber.cpp | //Brandon Washington
#include <iostream>
using namespace std;
void shiftright (int myarray[], int size);
int main (void)
{
int myarray []= {1, 3, 5, 7, 9};
shiftright( myarray, 5);
for ( int i=0; i<5; i++)
{
cout << myarray[i] << ' ';
}
return(0);
}
void shiftright (int myarray[], int size)
{
int temp;
int ... | ALGO | 0.999949 | 3.742097 |
323373ba-c1c5-443b-acc0-ebc25811cfc8 | JohnItoo/Solvay | codeforces/rounds/CF-279B.cpp | // Problem: B. Books
// Contest: Codeforces - Codeforces Round #171 (Div. 2)
// URL: https://codeforces.com/problemset/problem/279/B
// Memory Limit: 256 MB
// Time Limit: 2000 ms
//
// Powered by CP Editor (https://cpeditor.org)
#include <bits/stdc++.h>
using namespace std;
#define _CRT_SECURE_NO_DEPRECATE // suppre... | ALGO | 0.999915 | 4.828133 |
ee22b82d-f607-4a81-849a-2304b6a052b0 | Movazed/LeetCode_problem_Set_and_daily | leetcode_287.cpp | class Solution {
public:
int findDuplicate(vector<int>& nums) {
int left = 1;
int right = nums.size() - 1;
while(left < right){
int mid = left + (right - left) / 2;
int count = 0;
for(int num: nums){
if(num <= mid){
co... | ALGO | 0.999933 | 6.291554 |
6654af22-373d-4b0e-b69a-1b5f489d39e4 | raincross7/code-similarity | codes/train_code/problem021/problem021_418.cpp | #include <bits/stdc++.h>
using namespace std;
using ll = long long;
using ull = unsigned long long;
using ld = long double;
#define MOD 1000000007LL
#define rep(i, n) for(ll (i) = 0LL;(i) < (ll)(n);(i)++)
#define rep2(i, s, e) for(ll (i) = (ll)(s);(i) < (ll)(e);(i)++)
#define repi(i, n) for(ll (i) = 0LL;(i) <= (ll)(... | ALGO | 0.999925 | 3.412599 |
336afbe8-38ca-4686-a175-7965b30ec513 | 113bommy/deepmind_codecontests_refine | cpp_source_filter_file/cpp_train_783_11.cpp | #include <bits/stdc++.h>
using namespace std;
const int maxn = 2e4 + 50;
const int maxm = 1e6 + 50;
const long double eps = 1e-19;
const int max_index = 62;
const int inf = 0x3f3f3f3f;
const int MOD = 1e9 + 7;
inline int read() {
char c = getchar();
while (!isdigit(c)) c = getchar();
int x = 0;
while (isdigit(c... | ALGO | 0.999934 | 4.099 |
467355dc-09e9-4693-ba63-7ca132c7b612 | matoilic/thesis | Libraries/opencv/modules/stitching/src/exposure_compensate.cpp | #include "precomp.hpp"
using namespace std;
namespace cv {
namespace detail {
Ptr<ExposureCompensator> ExposureCompensator::createDefault(int type)
{
if (type == NO)
return new NoExposureCompensator();
if (type == GAIN)
return new GainCompensator();
if (type == GAIN_BLOCKS)
return... | ALGO | 0.985679 | 5.611152 |
53d3ff13-9af0-422f-8b06-90cfcfc3eef7 | ishandutta2007/codeforces | ohweonfire/normal/1381/C.cpp | #include <bits/stdc++.h>
namespace IO
{
char gc()
{
#ifdef FREAD
static char buf[1<<21], *P1 = buf, *P2 = buf;
if(P1 == P2)
{
P1 = buf;
P2 = buf + fread(buf, 1, 1<<21, stdin);
if(P1 == P2) return EOF;
}
return *(P1++);
#else
return getchar();
#endif
}
template<typename Tp> bool get1(Tp &x)
{
bool neg = 0;... | ALGO | 0.999998 | 3.565634 |
9ca3f69c-1ea6-44ae-853a-767872802b16 | samapti01/Algorithm-using-C | recursively/prog5.cpp |
/*************************
NAME : SAMAPTI CHAR
PROGRAM :Implement bubble sort .
Program no : 05
Date : 2021.02.17
**************************/
#include <stdio.h>
#include<stdlib.h>
void recurbublSort(int arr[], int len){
int temp;
if (len == 1){
return;
}
for (int i=0; i<len-1; i++){
if (arr[... | ALGO | 0.999954 | 4.119728 |
49b3e8df-995d-48a5-aad8-267bcfdd91a4 | Harleen365/100_Days_Coding_Challenge | Day 3/pairsum.cpp | #include <bits/stdc++.h>
vector<vector<int>> pairSum(vector<int> &arr, int s){
// Write your code here.
vector< vector<int> >ans;
for(int i=0;i<arr.size();i++){
for(int j=i+1;j<arr.size();j++){
if (arr[i] + arr[j] == s) {
vector<int> temp;
temp.push_back(min(arr[i], arr[j]));... | ALGO | 0.999738 | 4.378407 |
f220d5e7-de2a-47d0-b0b8-3150bc40f4c5 | P2Tree/LLVM_for_cpu0 | llvm/lib/CodeGen/EdgeBundles.cpp | #include "llvm/CodeGen/EdgeBundles.h"
#include "llvm/CodeGen/MachineBasicBlock.h"
#include "llvm/CodeGen/MachineFunction.h"
#include "llvm/CodeGen/Passes.h"
#include "llvm/Support/CommandLine.h"
#include "llvm/Support/GraphWriter.h"
#include "llvm/Support/raw_ostream.h"
using namespace llvm;
static cl::opt<bool>
View... | TOOL | 0.90324 | 7.549636 |
f8ae3f6a-da07-449b-99ad-aa5e69f4bfb9 | huxingyi/autoremesher | thirdparty/cgal/CGAL-5.1-beta1/examples/Generator/random_polygon2.cpp | #include <CGAL/Exact_predicates_inexact_constructions_kernel.h>
#include <CGAL/point_generators_2.h>
#include <CGAL/random_polygon_2.h>
#include <CGAL/Polygon_2.h>
typedef CGAL::Exact_predicates_inexact_constructions_kernel K;
typedef K::Point_2 Point_2;
typedef std::list<Point_2> ... | ALGO | 0.958659 | 4.458213 |
eee3e157-ce68-44b6-a9c7-1fb9c9a3e310 | ishandutta2007/codeforces | nutella3000/normal/1420/A.cpp | #include <bits/stdc++.h>
using namespace std;
#define int long long
#define ll long long
#define mp make_pair
#define pii pair<int, int>
#define fi first
#define se second
#define all(_v) _v.begin(), _v.end()
#define sz(a) (int) (a.size())
typedef long double ld;
const int inf = 1e15;
signed main() {
cin.tie(0)... | ALGO | 0.999704 | 4.538594 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.