uuid string | repo_name string | relative_path string | content string | category string | algo_rel_score float64 | quality_score float64 |
|---|---|---|---|---|---|---|
456c6758-8ec3-419b-94c6-c382298a6327 | JanviJachak/CPP-Programs | Program360.cpp | #include<iostream>
using namespace std;
template <class T>
T Addition(T No1, T No2)
{
T Ans = 0.0;
Ans = No1 + No2;
return Ans;
}
int main()
{
int iValue1 = 10, iValue2 = 11, iRet = 0;
float fValue1 = 10.9, fValue2 = 11.6, fRet = 0.0;
double dValue1 = 18.9, dValue2 = 15.6, dRet = 0.0;
iRe... | ALGO | 0.991063 | 4.706303 |
dd2d6470-1c88-4e41-a7d0-bf8ec1881263 | Chineseguuys/huawei2020Codecraft | main_1_19.cpp | #include <iostream>
#include <string>
#include <fstream>
#include <sstream>
#include <string.h>
#include <unistd.h>
#include <vector>
#include <math.h>
#include <pthread.h>
#include <ctype.h>
#include <errno.h>
#include <stdlib.h>
#include <stdio.h>
// 使用 mmap 需要的头文件
#include <sys/mman.h>
#include <sys/types.h>
#inc... | DATA | 0.899906 | 3.302529 |
31babff2-4ea6-4d87-9b48-58df04b0fd6a | donbasta/leetcode-submissions | Hard/1335.cpp | class Solution {
public:
int minDifficulty(vector<int>& jobDifficulty, int d) {
int n = jobDifficulty.size();
vector<vector<int>> dp(n + 1, vector<int>(d + 1));
const int INF = 2e9;
int mx = 0;
for (int i = 1; i <= n; i++) {
mx = max(mx, jobDifficulty[i - 1]);
... | ALGO | 0.999937 | 6.438235 |
803e6657-116d-4153-9764-cfbae25311db | ShudhanshuGR8/N_Days_of_Code | Beginner_Programs/C++_lb_functions_hw_4/C++_lb_functions_hw_4/C++_lb_functions_hw_4.cpp | #include <iostream>
using namespace std;
//Program - 1
//void update(int a) {
// a = a / 2;
//}
//
//
//int main() {
//
// int a = 10;
//
// update(a);
// cout << a << endl;
//}
// int update_1(int a) {
// a -= 5;
// return a;
//}
// int main() {
// int a = 15;
// update_1(a);
// cout << a << endl;
// return 0;... | ALGO | 0.960817 | 3.358119 |
c5ff77c5-5a5e-4397-b456-73a23c0f9260 | JiantengChen/BIT-CST | 数据结构与算法设计DataStructure/final/T1.2.cpp | #include <iostream>
#include <cstdio>
using namespace std;
#define TRUE 1
#define FALSE 0
#define OK 1
#define ERROR 0
#define OVERFLOW -2
#define MAXSIZE 100
typedef int ElemType;
typedef int Status;
typedef struct LNode
{
ElemType data;
struct LNode *next;
} LNode, *LinkList;
Status InitList_L(LinkList &L)... | ALGO | 0.999885 | 3.866748 |
855029b9-edc0-4744-af2c-291d6254cb24 | ankitjaat007/BaatChet | windows/runner/utils.cpp | #include "utils.h"
#include <flutter_windows.h>
#include <io.h>
#include <stdio.h>
#include <windows.h>
#include <iostream>
void CreateAndAttachConsole() {
if (::AllocConsole()) {
FILE *unused;
if (freopen_s(&unused, "CONOUT$", "w", stdout)) {
_dup2(_fileno(stdout), 1);
}
if (freopen_s(&unuse... | TOOL | 0.998733 | 6.76775 |
21c50184-4239-4f82-b334-b9cba2533ba4 | Jetezh/Pert-9---Tree | soal3_level_order.cpp | #include <iostream>
#include <cstdlib>
using namespace std;
class node {
public:
int data;
node* left;
node* right;
};
void printCurrentLevel(node* root, int level);
int height(node* node);
node* newNode(int data);
void printLevelOrder(node* root) {
int h = height(root), i;
for(i... | ALGO | 0.999964 | 6.202439 |
4687b313-ce04-4fb6-9193-73329ce93157 | alexshapran-as/Optimization_methods_lab4-aka-lab5- | simplex.cpp | #include <iostream>
#include <fstream>
#include "simplex.h"
#include <vector>
#include <cstdlib>
#include <algorithm>
#include <string>
#include <iomanip>
void set_data(std::vector<double> &c, std::vector<double> &b, std::vector<std::vector<double>>& a, unsigned int &n, unsigned int &m)
{
using std::cout;
using std:... | ALGO | 0.999299 | 3.729698 |
8a4a4a7d-fdec-4ba5-a2d6-7eadc943c2a5 | Coder-Vippro/Code | Archived/GiaHung/N0202B.cpp | #include <bits/stdc++.h>
using namespace std;
int main()
{
freopen("N0202B.inp","r",stdin);
freopen("N0202B.out","w",stdout);
int n;
cin>>n;
if(10<=n && n<100 && n%10==n/10)
cout<<"YES";
else cout<<"NO";
return 0;
}
| ALGO | 0.99967 | 3.336261 |
229db05f-f212-4268-9bbf-ad02161a4708 | caomuqing/caric_docker | ws_caric/src/rotors_simulator/rotors_control/src/rate_controller.cpp | #include "rotors_control/rate_controller.h"
RateController::RateController()
: gravity_(9.81),
mass_(1.56779) {
}
RateController::~RateController() {}
std::shared_ptr<ControllerBase> RateController::Clone() {
std::shared_ptr<ControllerBase> controller(new RateController);
return controller;
}
void Rate... | ALGO | 0.864555 | 6.197266 |
7fa55e1b-fb1b-4f4e-aba8-22553777324b | varshini41/c-programming | day 3/large_integer.cpp | #include <stdio.h>
#include <stdlib.h>
int* increment(int* digits, int size, int* resultSize) {
digits[size - 1] += 1;
int i,j;
for (i = size - 1; i > 0 && digits[i] == 10; i--) {
digits[i] = 0;
digits[i - 1] += 1;
}
if (digits[0] == 10) {
digits[0] = 0;
(*resultSize) ... | ALGO | 0.999687 | 6.590503 |
bfd899d3-0aca-4bba-b500-85b58d4ba645 | ishandutta2007/codeforces | fastmath/normal/955/C.cpp | #include <bits/stdc++.h>
using namespace std;
#define int long long
const int MAXN = 1e6 + 7;
const int INF = 1e18 + 7;
vector <int> a;
set <int> ms;
bool ch(int n) {
int l = 0;
int r = 1e9 + 7;
while (l < r - 1) {
int m = (l + r) / 2;
if (m * m <= n) {
l = m;
}
... | ALGO | 0.999739 | 4.106386 |
3ae8bbb8-bdd7-4d4b-bf4d-2d39fbbfcb51 | rafid-dev/Sally | src/main.cpp | #include <iostream>
#include "network.hpp"
#include "types.hpp"
int main(int argc, char const *argv[])
{
Network::Init();
Board board;
int32_t output = Network::Evaluate(board);
std::cout << output << std::endl;
return 0;
}
| WEB | 0.945132 | 4.723705 |
0fc5b2ff-c42b-45ca-bc3a-4f92192c7a26 | 2018331056shanto/Problem-Solving | Mixed code Library/MathematicalAddition.cpp | #include<bits/stdc++.h>
using namespace std;
int row[110],col[110];
int dp[110][110];
int visited[110][110];
int MCM(int beg,int ind)
{
if(beg>=ind)
return 0;
if(visited[beg][ind])
return dp[beg][ind];
int ans=1<<30;
for(int mid=beg;mid<ind;mid++)
{
int ansl=MCM(beg,mid);
... | ALGO | 0.999979 | 3.78918 |
bed61eb3-d427-479b-8086-36b5afa2b994 | gopoma/competitive-programming | CSES/SortingAndSearching/TasksandDeadlines.cpp | //* sometimes pragmas don't work, if so, just comment it!
//? #pragma GCC optimize ("Ofast")
//? #pragma GCC target ("avx,avx2")
//! #pragma GCC optimize ("trapv")
//! #undef _GLIBCXX_DEBUG //? for Stress Testing
#include <bits/stdc++.h> //? if you don't want IntelliSense
using namespace std;
// building blocks
usi... | ALGO | 0.999849 | 4.933758 |
3efae3c1-4b05-4916-8a6b-fbbf3ebb0398 | sulabhmatele/Highway-Path-Planning_SelfDrivingCar_Term3_P1 | src/Eigen-3.3/bench/dense_solvers.cpp | #include <iostream>
#include "BenchTimer.h"
#include <Eigen/Dense>
#include <map>
#include <vector>
#include <string>
#include <sstream>
using namespace Eigen;
std::map<std::string,Array<float,1,8,DontAlign|RowMajor> > results;
std::vector<std::string> labels;
std::vector<Array2i> sizes;
template<typename Solver,type... | TOOL | 0.997494 | 6.326138 |
3b8754a0-c5e8-4368-9966-8c57dded25df | maenk/codechef | laddus.cpp | #include<iostream>
using namespace std;
int main()
{
int T;
cin>>T;
for(int t=0;t<T;t++)
{
int laddus=0;
int n;
cin>>n;
string origin;
cin>>origin;
string activity;
for(int i=0;i<n;i++)
{
cin>>activity;
if(activity=="CONTEST_WON")
{
int rank;
cin>>rank;
if(rank>20)
laddus+=300;
else
laddus+=320-rank;
}
else if(act... | ALGO | 0.99731 | 4.223749 |
8601471f-2359-4585-8402-cae483138834 | jabirsubaktagin16/problem-solving-accepted | Toph/Mount Everest.cpp | #include<bits/stdc++.h>
using namespace std;
int main()
{
int T;
long long int a;
cin>>T;
while(T--)
{
cin>>a;
cout<<8848-a<<endl;
}
return 0;
}
| ALGO | 0.99434 | 3.099943 |
db9005da-00b9-4a0c-bc00-db7279cbaa18 | Husainbw786/LeetCode | 0015-3sum/0015-3sum.cpp | class Solution {
public:
vector<vector<int>> threeSum(vector<int>& nums) {
set<vector<int>>st;
vector<vector<int>>v;
int n = nums.size();
vector<int>temp(3);
sort(nums.begin(),nums.end());
int i,j,k;
for(i=0;i< n-2;i++)
{
j = i+1;
... | ALGO | 0.999906 | 5.856092 |
5b5b4821-70b3-4e66-a9d9-b1131cfe6b1f | zhaojinzhou/WORKSPACE | rocksdb/src/main.cpp | #include <iostream>
#include <vector>
#include "rocksdb/db.h"
#include <faiss/IndexFlat.h>
#include <boost/asio/thread_pool.hpp>
int main() {
boost::asio::thread_pool pool(10);
std::cout <<"213";
rocksdb::DB* db;
rocksdb::Options options;
options.create_if_missing = true;
// 打开数据库(路径建议使用绝对路径)
... | TOOL | 0.955253 | 5.617766 |
20f200ee-be56-4358-a7e1-54c7caa09e91 | DavidChibukhchian/Algorithms | IV_semester/Contest-2/E.cpp | #include <iostream>
#include <complex>
#include <vector>
#include <algorithm>
//-------------------------------------------------------------------------------------------------
typedef std::complex<long double> complex;
//----------------------------------------------------------------------------------------------... | ALGO | 0.999468 | 3.316675 |
6b600e44-bd56-42c6-9885-372e6ec37cc5 | Chandra-Sekhar-Dutta/Basic-CPP-program | Operator Overloading.cpp | #include<iostream>
using namespace std;
class Complex {
private:
int real, imag;
public:
Complex(int r=0, int i=0)
{real = r; imag = i;}
// This is automatically called when '+' is used with
// between two Complex objects
Complex operator + (Complex obj) {
Complex res;
res.real = real + obj.real;
res.ima... | ALGO | 0.9918 | 4.512587 |
0ec21436-a443-4761-81fa-210d9dcfa215 | ajayk-git/mca301 | billboard_revenue.cpp | #include<iostream>
#include<cstdlib>
using namespace std;
int * final_bill_board ;
int sumBillBoard(int * a ,int s){
int sum = 0;
for (int i = 0; i < s; ++i)
{
sum = sum+a[i];
}
return sum;
}
int maxBillBoard(int * a ,int s,int temp){
int max = 0;
int index = 0;
for (i... | ALGO | 0.999898 | 3.373153 |
209d151a-e04c-4bb2-ac99-23cff967d2e1 | phaiyaz/oppsproject | 20_functiontemplateforswapping.cpp | #include<iostream>
using namespace std;
template <typename T>
void swapalues(T& a,T& b){
T temp=a;
a=b;
b=temp;
}
int main(){
int x=10,y=30;
swapalues(x,y);
cout<<"swapped int x="<<x<<",y"<<y<<endl;
float a=4.90,b=6.80;
swapalues(a,b);
cout<<"swppend float a="<<a<<",b"<<b<<endl;
char c1='A',c2='B';
swap... | ALGO | 0.979229 | 3.75599 |
62cded81-1460-4e25-a76e-56e72eb68a2e | larus-breeze/sw_sensor | sw_stm32/Communication/SHA256.cpp | /***********************************************************************//**
* @file SHA256.cpp
* @brief SHA256 implementation
* @author Jérémy LAMBERT
* @copyright Copyright (c) 2021 Jérémy LAMBERT (SystemGlitch)
* @license MIT License
Permission is hereby granted, free of charge, to any person obtaining ... | ALGO | 0.99747 | 6.651268 |
35e2b67f-79ad-4a39-96fb-3102806d9134 | HPC-Fortran2CPP/Fortran2Cpp | data/readable_format/cpp/file875.cpp | #include <iostream>
#include <vector>
// Simulate the parallel functionality in a single-threaded context.
class SimulatedParallelArray {
public:
std::vector<int64_t> a;
std::vector<int> b;
int me; // Simulated process ID
SimulatedParallelArray(int processID) : me(processID) {
a.resize(7, 0);
... | ALGO | 0.997338 | 5.273894 |
bc5b0963-8c28-4a09-9fa1-49691b0d34d8 | nikki-infinte/LeetCode_30Days_Challenge | 726-number-of-atoms/number-of-atoms.cpp | class Solution {
public:
string countOfAtoms(string formula) {
int n = formula.length();
stack<unordered_map<string,int>> st;
st.push(unordered_map<string,int>());
int i = 0;
while(i < n){
if(formula[i] == '('){
st.push(unordered_map<string,int>()... | ALGO | 0.999997 | 5.173946 |
8cd02e0f-e870-445a-9ddb-80053ac87ec0 | ishandutta2007/codeforces | toxel/normal/1371/B.cpp | #include <bits/stdc++.h>
void solve(){
int n, r;
scanf("%d%d", &n, &r);
long long ans = 0;
if (r >= n){
++ ans;
}
r = std::min(n - 1, r);
printf("%lld\n", ans + 1ll * r * (r + 1) / 2);
}
int main(){
int test;
scanf("%d", &test);
while (test --){
solve();
}
... | ALGO | 0.999603 | 4.544707 |
f52ba61c-a5c2-4579-a6cc-b4034fe68731 | SK1965/cp-sheet | presentfromlena.cpp | #include<bits/stdc++.h>
using namespace std;
void design(vector<vector<int>>& mat , int n){
for(int i=0;i<=n;i++){
int k=0;
for(int j=0;j<=n;j++){
if(i+j>=n){
mat[i][j]=k;
k++;
}
}
}
for(int i=0;i<=n;i++){
int k=0;
... | ALGO | 0.999981 | 3.470275 |
574ab27a-9f44-47fb-9b5e-75253caacd0f | manishtomar-cpi/DSA-CP | searching/advance-Binary-Search/searchInRotatedSortedArray.cpp | #include <iostream>
#include <vector>
using namespace std;
int search(vector<int> &nums, int target)
{
// for(int i =0 ;i<nums.size();i++){
// if(nums[i]==target){
// return i;
// }
// }
// return -1;
int low = 0;
int high = nums.size()-1;
int mid = (low+high)/2;
... | ALGO | 0.999967 | 5.265139 |
93f6c04c-e294-482e-9130-16fe6ed15c98 | csis2020/leetcode-study-2022 | MinjiJu/2022-06-16-contains-duplicate.cpp | // using set
class Solution {
public:
bool containsDuplicate(vector<int>& nums) {
set<int> s;
for(auto num:nums){
if(s.find(num)!=s.end()) return true;
s.insert(num);
}
return false;
}
};
class Solution {
public:
bool containsDuplicate(vector... | ALGO | 0.999936 | 5.702954 |
e2c614bb-39a4-4644-a7e0-b655198c76f1 | SysMo/smoflow3d | com.sysmo.smoflow3d/src/third-party/eigen/unsupported/doc/examples/FFT.cpp | // To use the simple FFT implementation
// g++ -o demofft -I.. -Wall -O3 FFT.cpp
// To use the FFTW implementation
// g++ -o demofft -I.. -DUSE_FFTW -Wall -O3 FFT.cpp -lfftw3 -lfftw3f -lfftw3l
#ifdef USE_FFTW
#include <fftw3.h>
#endif
#include <vector>
#include <complex>
#include <algorithm>
#include <iterator>... | ALGO | 0.98566 | 6.121914 |
4d97f4cc-d515-498e-9b0d-d69dbf686415 | za233/Polaris-Obfuscator | src/libcxx/test/libcxx/fuzzing/nth_element.pass.cpp | // UNSUPPORTED: c++03, c++11
#include <algorithm>
#include <cstddef>
#include <cstdint>
#include <vector>
#include "fuzz.h"
// Use the first element as a position into the data
extern "C" int LLVMFuzzerTestOneInput(const std::uint8_t *data, std::size_t size) {
if (size <= 1) return 0;
const size_t partition_... | TEST | 0.992918 | 6.228318 |
9544ca5f-7f6b-4fa4-a528-eecd025deca5 | Irfan-Riyad/Codeforces-solution | A_Odd_Divisor.cpp | #include <bits/stdc++.h>
using namespace std;
#define ll long long
#define pb push_back
#define f first
#define s second
#define mp make_pair
#define vi vector<int>
#define vll vector<ll>
#define pii pair<int, int>
#define all(p) p.begin(), p.end()
#define mid(s, e) (s + (e - s) / 2)
#define eb emplace_back
#define ul... | ALGO | 0.999547 | 4.783389 |
074ba57d-94a0-4685-9636-4619c879e030 | piotrcurious/esp8266_solar_battery_monitor | lead_acid_junkbox/voltage_epaper/junkbox/graph_compressor/multipoly/multi_poly6a2_tidy/norm_fix/3.cpp | // Add helper function for already normalized time evaluation
static double evaluatePolynomialNormalized(const float *coefficients, uint8_t degree, double tNorm) {
double result = 0.0;
double tPower = 1.0; // tNorm^0 = 1
for (int i = 0; i < degree; i++) {
result += coefficients[i] * tPower;
... | ALGO | 0.999063 | 5.703953 |
1db6652a-dd84-475b-8754-c313bfaf33ed | mhwen/competitive-programming | USACO/2023_Open/bronze_rotate_and_shift.cpp | #include <iostream>
#include <vector>
#include <algorithm>
#include <queue>
#include <map>
#include <set>
#include <functional>
#include <numeric>
#include <fstream>
using namespace std;
typedef long long ll;
int main() {
ios::sync_with_stdio(false);
cin.tie(nullptr);
int n, k, t;
cin >> n >> k >> t;
vector<int... | ALGO | 0.999988 | 3.259885 |
d15cff76-130c-4cbe-879b-ece0a39e872f | AlexandruValeanu/Competitive-Programming | Varena/Canibali.cpp | #include <bits/stdc++.h>
using namespace std;
const int Nmax = 2048 + 1;
struct Canibal
{
int X, Y, Z, T;
bool operator < (const Canibal& A) const
{
return (X < A.X && Y < A.Y && Z < A.Z && T < A.T);
}
bool operator == (const Canibal& A) const
{
return (X == A.X && Y == A.Y ... | ALGO | 0.999906 | 4.228792 |
392d7aa4-e0d6-4551-8d6f-120451ea7a89 | ACM-Obsidian/Obsidian | 2014-02-25/A.cpp | #include <cstdio>
#include <cmath>
#include <vector>
#include <deque>
#include <algorithm>
const long double eps = 1e-12;
struct point2 {
long double x, y;
point2 (void) {}
point2 (long double _x, long double _y) : x(_x), y(_y) {}
point2& operator += (point2 a) {
x += a.x, y += a.y;
return *this;
}
point2& o... | ALGO | 0.999721 | 3.659842 |
ea65177d-608a-4854-973c-497062a88110 | hpc-app/gromacs-rocm-2.1.96 | src/gromacs/linearalgebra/gmx_lapack/strtri.cpp | #include <cmath>
#include "../gmx_blas.h"
#include "../gmx_lapack.h"
#include "lapack_limits.h"
#include "gromacs/utility/real.h"
void
F77_FUNC(strtri,STRTRI)(const char *uplo,
const char *diag,
int *n,
float *a,
int *lda,
int *info)
{
int a_dim1, a_offset, i__1, i__3, i__4, i__5;
int j, jb, nb, nn;
... | ALGO | 0.997822 | 4.852308 |
d0399372-56e6-4f0a-810e-a0ac5c4ed7a9 | BrunoLad/POO2017.2Monael | poo11048216/Pratica/pratica3/LES.cpp | #include <iostream>
class Lista{
private:
int *itens;
int tamanho;
int quantidade;
public:
Lista(int);
void setTamanho(int);
void setQuantidade(int);
void setItens(int, int);
int getTamanho();
int getQuantidade();
int getItens... | ALGO | 0.998894 | 4.583081 |
b949d6c2-474e-468e-b1b3-9c0683a6762b | IcaroTARique/ExercicioLP_2 | Barrier/workers.cpp | #include <iostream>
#include <pthread.h>
#include <cstdlib>
#include <ctime>
#include <thread>
#include <atomic>
#include <chrono>
#define NUM_THREAD 5
using namespace std;
//using namespace std::chrono_literals;
int contador = 0;
int n = NUM_THREAD;
int cont = n;
std::atomic_flag lock = ATOMIC_FLAG_INIT;
// TRABAL... | TOOL | 0.993401 | 4.262267 |
cdea24be-62f8-4e97-a0c2-7352838fd4b8 | yitianhao/gpu_sched_new | gpu-sched-exp/minor/boost_1_61_0/libs/dll/example/tutorial7/tutorial7.cpp | #include <vector>
#include "../b2_workarounds.hpp"
//[callplugcpp_tutorial7
#include <boost/dll/shared_library.hpp>
#include <boost/dll/library_info.hpp>
#include <iostream>
void load_and_execute(const boost::filesystem::path libraries[], std::size_t libs_count) {
const std::string username = "User";
for (st... | TOOL | 0.944934 | 5.023736 |
d59ea0e6-3d16-465c-a45b-9a6563217e7f | sinian666/code_41_18 | cpp_副本3/chapter_sorting/merge_sort.cpp | /**
* File: merge_sort.cpp
* Created Time: 2022-11-25
* Author: Krahets (<EMAIL>)
*/
#include "../utils/common.hpp"
/* 合并左子数组和右子数组 */
// 左子数组区间 [left, mid]
// 右子数组区间 [mid + 1, right]
void merge(vector<int> &nums, int left, int mid, int right) {
// 初始化辅助数组
vector<int> tmp(nums.begin() + left, nums.begin() ... | ALGO | 0.999989 | 5.834587 |
dd3715a8-d75b-4492-abde-0915011a8bdc | grisaia-dev/Lesson_5 | Task_2/Task_2.cpp | #include <iostream>
class Triangle {
public:
Triangle() : Triangle(10, 20, 30, 50, 60, 70) {}
std::string get_name() { return name; }
int get_side_a() { return side_a; }
int get_side_b() { return side_b; }
int get_side_c() { return side_c; }
int get_corner_a() { return corner_a; }
int get_... | TOOL | 0.859806 | 3.950074 |
f61bc048-4ee9-49e2-8db9-071c4479dfda | j-a-h-i-r/Online-Judge-Solutions | Uva/544 - Heavy Cargo.cpp | #include<iostream>
#include<map>
#include<queue>
#include<cstdio>
using namespace std;
struct node {
int c;
string n;
node(string a, int b) {
n = a; c = b;
}
friend bool operator<(node a, node b) {
return a.c<b.c;
}
};
int maxWeight(map<string,vector<node> > &g, string src, str... | ALGO | 0.99971 | 3.749292 |
81a60752-1674-43a7-83c2-ff3704a308d6 | alpeerkaraca/mobile-programming-2023 | work_6/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.76073 |
093159a9-4d35-4df9-927b-3774560b3bb6 | Shivani08-spec/strive-s-SDE-sheet | 2d-matrix_search.cpp | class Solution {
public:
bool searchMatrix(vector<vector<int>>& matrix, int target) {
bool x = false;
int row = matrix.size();
int col = matrix[0].size();
int start =0;
int end = (row*col)-1;
int mid;
while(start<=end){
mid = start+(end-st... | ALGO | 0.999942 | 6.085082 |
9bc2bebd-8122-4489-bbaa-e0a68a6b792e | Shre26ya/Leetcode-Bootcamp-NYU-Fall-23 | Practice/1038.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.999949 | 5.188557 |
f3860a34-7de1-48be-ac15-9acc4fdaf95c | 42somoim/42somoim1 | ulee/05_2run_Zrun2/12_골드바흐의추측.cpp | #include <iostream>
#include <algorithm>
#include <math.h>
using namespace std;
const int MAX = 1000000;
int is_prime(int input)
{
for (size_t i = 2; i <= sqrt(input); i++)
{
if (input % i == 0) return (0);
}
return (1);
}
int main()
{
cin.tie(NULL); cout.tie(NULL); ios_base::sync_with_stdio(false);
int num ... | ALGO | 0.999709 | 3.924614 |
bf03894f-22c5-4723-9224-6ecbce3ad265 | ScandiumOS-14/android_bionic | libm/builtins.cpp | #include <math.h>
#include "fpmath.h"
double fabs(double x) { return __builtin_fabs(x); }
float fabsf(float x) { return __builtin_fabsf(x); }
long double fabsl(long double x) { return __builtin_fabsl(x); }
#if defined(__aarch64__) || defined(__riscv) || defined(__i386__) || defined(__x86_64__)
float ceilf(float x) {... | ALGO | 0.948032 | 6.683326 |
d22973f2-f054-4ed4-a757-4d159987ba41 | pralinkhaira/gfg-soln | Hard/Huffman Decoding/huffman-decoding.cpp | //{ Driver Code Starts
#include <bits/stdc++.h>
#define MAX_TREE_HT 256
using namespace std;
map<char, string> codes;
map<char, int> freq;
//MinHeap structure
struct MinHeapNode
{
char data;
int freq;
MinHeapNode *left, *right;
MinHeapNode(char data, int freq)
{
left = right = NULL;
this->data = data;
this-... | ALGO | 0.999971 | 6.290915 |
12c11c4f-7f7b-417b-83a2-bdcf538145c8 | aizsfgk/leetcode-cn | editor/cn/[1719]重构一棵树的方案数.cpp | //给你一个数组 pairs ,其中 pairs[i] = [xi, yi] ,并且满足:
//
//
// pairs 中没有重复元素
// xi < yi
//
//
// 令 ways 为满足下面条件的有根树的方案数:
//
//
// 树所包含的所有节点值都在 pairs 中。
// 一个数对 [xi, yi] 出现在 pairs 中 当且仅当 xi 是 yi 的祖先或者 yi 是 xi 的祖先。
// 注意:构造出来的树不一定是二叉树。
//
//
// 两棵树被视为不同的方案当存在至少一个节点在两棵树中有不同的父节点。
//
// 请你返回:
//
//
// 如果 ways == 0 ,返回... | ALGO | 0.999891 | 5.959439 |
19708ba1-7a4b-4c76-af11-a23d8bc1be9d | alllef/Discrete-structures-lab-3 | main.cpp | #include <iostream>
#include <vector>
#include <queue>
#include <stack>
#include <string>
#include <fstream>
#include <iomanip>
#include<Windows.h>
using namespace std;
void initializeGraph(int &picks, int &ribs, vector<int> &start, vector<int> &end);
void BFS(int startPick, int &picks, int &ribs, vector<int> &start... | ALGO | 0.998166 | 4.492307 |
cba5252d-61cb-4652-9c19-91162b1ea6f7 | TheMarineLord2/Projekt-Grafika-Komputerowa-2025 | GK2025-Funkcje.cpp | // podstawowe funkcje
#include "GK2025-Funkcje.h"
#include "GK2025-Zmienne.h"
#include "GK2025-Paleta.h"
#include "GK2025-Dithering.h"
#include "GK2025-MedianCut.h"
#include "GK2025-Pliki.h"
void Funkcja1() {
narzuconaV1();
SDL_UpdateWindowSurface(window);
}
void Funkcja2() {
narzuconaV2();
SDL_Up... | TOOL | 0.863708 | 4.080023 |
86564a8c-2a70-4333-aff5-e2d0e3425691 | Kavin1421/Leetcode-Solution | 0300-0399/0375.Guess Number Higher or Lower II/Solution.cpp | class Solution {
public:
int getMoneyAmount(int n) {
vector<vector<int>> dp(n + 10, vector<int>(n + 10));
for (int l = 2; l <= n; ++l) {
for (int i = 1; i + l - 1 <= n; ++i) {
int j = i + l - 1;
dp[i][j] = INT_MAX;
for (int k = i; k <= j; +... | ALGO | 0.999944 | 5.438869 |
8286115f-645b-4073-a7e6-0158f01e0ca8 | hungho77/TREE | Red_BlackTree/SourceRB.cpp | #include"RBTree.h"
#include<iostream>
using namespace std;
RBNode* RBTree::NIL = new RBNode();
void main()
{
RBTree T;
int n;
cout << "Creat Red-Black Tree" << endl;
do
{
cout << "Input element key (press -1 to exit): ";
cin >> n;
if (n == -1)
break;
T.insert(n);
} while (1);
cout << "All element of... | ALGO | 0.995997 | 3.52121 |
6dddb2f6-8a9a-4625-9223-51c651679458 | yuhui-xie/agvWin | Eigen3/doc/examples/DenseBase_middleRows_int.cpp | #include <Eigen/Core>
#include <iostream>
using namespace Eigen;
using namespace std;
int main(void)
{
int const N = 5;
MatrixXi A(N,N);
A.setRandom();
cout << "A =\n" << A << '\n' << endl;
cout << "A(2..3,:) =\n" << A.middleRows(2,2) << endl;
return 0;
}
| ALGO | 0.965146 | 3.307581 |
8c257ec6-b94d-44a3-a3a5-9552f89ad765 | anubhavitis/Competitive-Programming | 1-Codeforces/Global Round 8/D.cpp | //Mark XXVII
#include<bits/stdc++.h>
#define big(x) greater<x>()
#define ll long long int
#define mp make_pair
#define pb push_back
#define lb lower_bound
#define ub upper_bound
#define all(x) x.begin(), x.end()
#define PI 3.14159265
#define deb(x) cerr<<#x<<" : "<<x<<"\n";
#define deball(x) for(auto iit:x) cerr<<iit<... | ALGO | 0.999955 | 4.225336 |
0e94cd48-5235-46d9-a8ab-e846a8fd068c | ikumarshubham/Practicecpp | 1979-find-greatest-common-divisor-of-array/1979-find-greatest-common-divisor-of-array.cpp | class Solution {
public:
int findGCD(vector<int>& nums) {
int size=nums.size();
sort(nums.begin(),nums.end());
int smallest=nums[0];
int largest=nums[size-1];
return __gcd(smallest,largest);
}
}; | ALGO | 0.999959 | 5.805366 |
a1e32608-7096-41d1-ac72-1dd089410e85 | raincross7/code-similarity | codes/train_code/problem487/problem487_140.cpp | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef long double ld;
#define pi 3.14159265359
#define inf 2147483647
#define INF 9223372036854775807
#define mod 1000000007
#define mod2 998244353
int main() {
vector<string> S(3);
for (int i = 0; i < 3; i++) {
cin >> S.at(i);
... | ALGO | 0.99986 | 5.07515 |
cfb25d72-823b-470e-9488-366501fb3041 | virtualsecureplatform/llvm-rv16k | clang-tools-extra/clang-tidy/utils/OptionsUtils.cpp | #include "OptionsUtils.h"
namespace clang {
namespace tidy {
namespace utils {
namespace options {
static const char StringsDelimiter[] = ";";
std::vector<std::string> parseStringList(StringRef Option) {
SmallVector<StringRef, 4> Names;
Option.split(Names, StringsDelimiter);
std::vector<std::string> Result;
... | TOOL | 0.93949 | 7.20541 |
2ea7bb30-b464-41aa-bae5-3e47b3a31afc | omkarugale7/codeforces | questions/77_string_LCM.cpp | #include <bits/stdc++.h>
using namespace std;
typedef long long int ll;
void solve()
{
string s, t;
cin >> s >> t;
if (s.size() == t.size())
{
if (s == t)
cout << s << "\n";
else
cout << -1 << "\n";
return;
}
if (s.size() > t.size())
swap(s... | ALGO | 0.999976 | 4.546046 |
140c1f8a-78d6-45db-bb73-1d5db33ca608 | vampcoder/Online-Programmes | Codechef/july long 2015/3.cpp | #include<iostream>
using namespace std;
int main()
{
long long t, n, k, x;
cin >> t;
while(t--){
cin >> n >> k;
int a[n];
int c = 0, l = k;
for(int i = 0; i < n; i++){
cin >> x;
if(l < a[i]){
l += k;
}
}
}
}
| ALGO | 0.999791 | 3.110461 |
439e675e-ab0b-453a-8cf8-c534f1cc825f | ramsafin/ros-cpp-tutorials | src/threads/locks.cpp | #include <iostream>
#include <mutex>
#include <thread>
// общая переменная, будем увеличивать значение в одном потоке, а в другом уменьшать
int shared_data = 0;
std::mutex mtx; // переменная, которая позволяет разделять доступ к данным из разных потоков
void increment() {
for (int i = 0; i < 10; ++i) {
// за... | ALGO | 0.97003 | 4.940851 |
12266126-9b48-475d-8e74-eb37013d964a | sakshamrathi21/Competitive_Programming | problems_solved/1808b.cpp | #include<bits/stdc++.h>
using namespace std;
#define int long long
signed main () {
ios::sync_with_stdio(0);
cin.tie(0);
int t;
cin >> t;
while (t--) {
int n, m;
cin >> n >> m;
int c[n][m];
vector<vector<int>> s(m, vector<int>(n));
for (int i = 0 ; i < n ; i ... | ALGO | 0.999796 | 3.591389 |
ed44cead-fb1c-4aed-9361-4bec699d8b8d | Masuma-Afroz-Juthi/Tools-for-learning-DSA | 3_Problem_Solving/Road_To_Grandmaster/800_Challenges/112A.cpp | #include "iostream"
using namespace std;
int solve(string str1,string str2){
for (int i = 0; i < str1.length(); ++i) {
if(tolower(str1[i]) < tolower(str2[i])){
return -1;
}
else if(tolower(str1[i]) > tolower(str2[i])){
return 1;
}
}
return 0;
}
int ... | ALGO | 0.999997 | 3.710575 |
c71409bf-3c1f-45e3-9c66-227a3617ff4d | aptana/studio3 | native/wintty/utils.cpp | #include "stdafx.h"
#include "utils.h"
HANDLE GetParentProcess(void)
{
HANDLE hParentProcess = NULL;
HANDLE hProcessSnap = ::CreateToolhelp32Snapshot(TH32CS_SNAPPROCESS, 0);
if( hProcessSnap != INVALID_HANDLE_VALUE )
{
PROCESSENTRY32 pe32;
pe32.dwSize = sizeof(PROCESSENTRY32);
if( ::Process32First(hProcessSn... | TOOL | 0.972061 | 4.184192 |
ccfb9862-1b07-4869-a0ff-b19bafb0e6df | rahul-singh-takuli56/LeetCode-Solution | 0203-remove-linked-list-elements/0203-remove-linked-list-elements.cpp | /**
* Definition for singly-linked list.
* struct ListNode {
* int val;
* ListNode *next;
* ListNode() : val(0), next(nullptr) {}
* ListNode(int x) : val(x), next(nullptr) {}
* ListNode(int x, ListNode *next) : val(x), next(next) {}
* };
*/
class Solution {
public:
ListNode* removeEleme... | ALGO | 0.999883 | 5.724744 |
658e2231-64e3-42a1-bf6e-ea5008fd4064 | 20kaushik02/leetcode-gulag | 981-time-based-key-value-store/driver.cpp | #include "soln.cpp"
int main()
{
TimeMap timeMap;
timeMap.set("foo", "bar", 1); // store the key "foo" and value "bar" along with timestamp = 1.
cout << timeMap.get("foo", 1) << endl; // return "bar"
cout << timeMap.get("foo", 3) << endl; // return "bar", since there is no value corresponding to foo at timesta... | ALGO | 0.945829 | 5.192967 |
de1688b3-70c3-442b-91e5-c783eea22a91 | RHaran98/code_chef | TLG_hr.cpp | #include<iostream>
using namespace std;
int main() {
ios_base::sync_with_stdio(false); //Make cin as fast as scanf
cin.tie(NULL);
int t, lead = 0;
cin>>t;
int x=0,y=0, x_, y_;
int max = 0;
while (t--) {
cin >> x_ >> y_;
x += x_;
y += y_;
lead = x - y;
if... | ALGO | 0.999953 | 3.982387 |
24f29729-7994-4886-8b6a-92cf0787ced6 | MrityunjayNPandey/vscode | CP/B_Nastia_and_a_Good_Array.cpp | /**
* codeforces: _joKer_0
* codechef: joker_0000
* created: 16-11-2022 13:56:11
**/
// clang-format off
#ifdef ONLINE_JUDGE
#pragma GCC optimize("Ofast", "unroll-loops")
#pragma GCC target("avx,avx2,fma")
#endif
#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
using namespace std; ... | ALGO | 0.999718 | 3.698549 |
efa0b8ea-6473-4eee-b06c-f425b6c6d50f | pah-10/Studies-C-Plus-Plus | ED/entrega/Fila.cpp | #include <cstdlib>
#include <iostream>
#include <string>
#include "Fila.h"
using namespace std;
Fila::Fila() {
inicio = NULL;
fim = NULL;
}
bool Fila::vazia() {
return (inicio == NULL);
}
bool Fila::cheia() {
return false;
}
bool Fila::inserir(int x) {
PonteiroElemento p;
p = new elemento;
... | TOOL | 0.974946 | 4.448651 |
33db703e-a606-4f0d-a529-490f7fdb9488 | Nurtilekb/To-do-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.9988 | 6.76073 |
4eb59fc4-4353-4655-aef7-bb0fd1260dc2 | projeto-de-algoritmos-2025/PD_Leet_Code | MinInsert/mininsert.cpp | class Solution {
public:
int minInsertions(string s) {
string rev = s;
reverse(rev.begin(), rev.end());
int n = s.size();
vector<vector<int>> dp(n + 1, vector<int>(n + 1, 0));
for (int i = 1; i <= n; ++i) {
for (int j = 1; j <= n; ++j) {
if (s[i -... | ALGO | 0.999981 | 6.283494 |
4abf635a-0189-4c23-b5a4-60456f16a4d0 | kunalrathodofficial/C-programming | uppercase.cpp | #include<iostream>
using namespace std;
int main(){
char ch;
cin>>ch;
if (ch>='A' && ch<='Z')
{
cout<<"Upper Case";} else if (ch>='a' && ch<='z')
{
cout<<"Lower Case";
}
else{ cout<<"not a english letter";}
return 0;
} | ALGO | 0.895287 | 3.86115 |
086afc31-087a-40ee-b4af-7b28a9e7170b | Piero24/Food-recognition-and-leftover-estimation | src/detector.cpp | #include <iostream>
#include <list>
#include <ctime> // DEBUG
#include "opencv2/core.hpp"
#include <opencv2/highgui.hpp>
#include <opencv2/imgproc.hpp>
#include "opencv2/imgcodecs.hpp"
#include <opencv2/imgproc/imgproc.hpp>
#include "opencv2/ximgproc/segmentation.hpp"
#include "../include/detector.h"
std::vector<std... | ALGO | 0.985966 | 4.162596 |
c1568b3d-f4ed-4e8a-891a-bad3efa4910c | ruby-kim/Algorithm | Baekjoon(BOJ)/2000~2999/2753.cpp | #include <iostream>
using namespace std;
int leap_year(int n)
{
if(n%4==0 && (n%100!=0 || n%400==0)) return 1;
return 0;
}
int main()
{
ios_base::sync_with_stdio(0);
cin.tie(0);
cout.tie(0);
int year;
cin>>year;
cout<<leap_year(year);
return 0;
} | ALGO | 0.999812 | 4.234575 |
19328e3c-1724-42c2-9e4a-99c8faecddb5 | ishandutta2007/codeforces | kiyoshi0205/normal/1296/A.cpp | #pragma GCC optimize("Ofast")
#include<bits/stdc++.h>
// #include<ext/pb_ds/assoc_container.hpp>
// #include<ext/pb_ds/tree_policy.hpp>
// #include<ext/pb_ds/tag_and_trait.hpp>
// using namespace __gnu_pbds;
using namespace std;
using ll=long long;
#define double long double
using datas=pair<ll,ll>;
using ddatas=pair<d... | ALGO | 0.999645 | 3.994176 |
5efe3466-ed5e-4f1b-a52d-0190bf2780cb | Ishaan-11/Launchpad | hackerblocks2/SELECTION SORT ( ITERATIVE , LINKED LIST).cpp | /*
Implement Selection Sort in a linked list using iterative methods
Input Format:
Enter the size of the linked list N and take N more inputs
Output Format:
Display the elements of the sorted list in a space separated manner
Sample Input:
4
9
6
3
2
Sample Output:
2 3 6 9
Time Limit: 4 sec
*/
#include<iostream>
using... | ALGO | 0.999991 | 4.994758 |
670cbe5d-2546-42c8-93ce-3ecafeb2d329 | biswass101/code_chef_solutions | Contesst/Div-4/Ja korchi/Minimum_XOR.cpp | #include<bits/stdc++.h>
#define ROCKET ios :: sync_with_stdio(false); cin.tie(nullptr); cout.tie(nullptr);
#define ll long long
#define fr(x, s, e, b) for(ll x = s; x < e; x = x + b)
#define rfr(x, s, e, b) for(ll x = s; x >= e; x = x - b)
#define efr(val, where) for(auto& val : where)
#define all(x) x.begin(), x.end()... | ALGO | 0.999951 | 5.507839 |
4dcfda42-1c12-4ac1-a073-fad3845ba39c | psiudo/Algorithm | C++/프로그래머스/1/12916. 문자열 내 p와 y의 개수/문자열 내 p와 y의 개수.cpp | #include <string>
#include <iostream>
using namespace std;
bool solution(string s) {
int count = 0;
for (char ch : s) {
if (ch == 'p' || ch == 'P') count++;
if (ch == 'y' || ch == 'Y') count--;
}
if (count == 0) {
cout << "True" << endl;
return true;
} else {
... | ALGO | 0.999372 | 4.683834 |
7fab744b-0348-46bc-8867-30ac179c8560 | MisYue/VR-SV | SatelliteSystem/Norad/cNoradSGP4.cpp | #include "cNoradSGP4.h"
#include "math.h"
#include "cJulian.h"
#include "cOrbit.h"
#include "cVector.h"
#include "coord.h"
//////////////////////////////////////////////////////////////////////////////
cNoradSGP4::cNoradSGP4(const cOrbit &orbit) :
cNoradBase(orbit)
{
m_c5 = 2.0 * m_coef1 * m_aodp * m_betao2 ... | ALGO | 0.999749 | 6.020233 |
6d6f8c27-6971-4497-afc9-aac7d6cf2b91 | yogeshdhawale/leetcode_problems | 2024/Feb/2092_0502_2.cpp | /*
2092. Find All People With Secret
Hard
Topics
Companies
Hint
You are given an integer n indicating there are n people numbered from 0 to n - 1. You are also given a 0-indexed 2D integer array meetings where meetings[i] = [xi, yi, timei] indicates that person xi and person yi have a meeting at timei. A person may at... | ALGO | 0.99999 | 5.700376 |
3f5ae391-3a18-4835-b02a-e3368dce9b4d | johangardhage/retro-book-tricks3dgurus | ORIGINAL/SOURCE/T3DIICHAP16/T3DLIB12.CPP | // T3DLIB12.CPP - rasterizers that support textures with transparent pixels
// I N C L U D E S ///////////////////////////////////////////////////////////
#define DEBUG_ON
#define WIN32_LEAN_AND_MEAN
#include <windows.h> // include important windows stuff
#include <windowsx.h>
#include <mmsystem.h>
#include <o... | TOOL | 0.953288 | 3.040757 |
7a43b3dd-1449-4991-a92c-0f85234fec17 | yuyichao/cs-doc | Programming/C_C++/C++_Primer_Plus中文第四 五版 源码+习题/C++_Primer_Plus中文第四 五版 源码+习题/C++_Primer 第四版 习题解答 源码/源码/5/cnt_found.cpp | #include <string>
#include <iostream>
int main()
{
// read a word to look for
std::string search_word;
std::cin >> search_word;
// initialize variables to detect and count
// occurences of search_word in the input
bool found = false;
int occurrence_count = 0;
std::string next_word;
while (std::cin >> next_... | ALGO | 0.997052 | 5.042742 |
abf21034-ee80-4288-9a87-f65bfc2e5abd | PhiLong1st/Competitive_Programming | Codeforces/Codeforces_Round_1017_(Div. 4)/2094C.cpp |
/*
Code by: KoKoDuDu
Created: 2025.04.14 00:04:54
*/
#include <bits/stdc++.h>
#define int long long
#define pll pair<int, int>
using namespace std;
const int MOD = 1e9 + 7;
void solve() {
int n;
cin >> n;
vector<vector<int>> a(n + 1, vector<int>(n + 1));
for (int i = 1; i <= n; ++i) {
... | ALGO | 0.999864 | 4.301919 |
b8bfd142-6183-4319-be9b-9103364fcd05 | Sachindebug/LeetCode-Problems | 0141-linked-list-cycle/0141-linked-list-cycle.cpp | /**
* Definition for singly-linked list.
* struct ListNode {
* int val;
* ListNode *next;
* ListNode(int x) : val(x), next(NULL) {}
* };
*/
class Solution {
public:
bool hasCycle(ListNode *head) {
ListNode *slow=head;
ListNode *fast=head;
while(fast && fast->next)
... | ALGO | 0.999788 | 5.403394 |
7fa316e6-4a30-48ce-8497-36e5abc44f11 | fyrsta7/LLM_on_ASAC | result_api_backup/en_without_annotation_mzn/deepseek-coder_loop10/Magic_Square-7.cpp | #include <iostream>
#include <vector>
#include <algorithm>
using namespace std;
void generateMagicSquare(int N) {
vector<vector<int>> square(N, vector<int>(N, 0));
int x = 0, y = N / 2;
for (int num = 1; num <= N * N; ++num) {
square[x][y] = num;
int newX = (x - 1 + N) % N;
int new... | ALGO | 0.999894 | 5.39231 |
3817302b-ab5c-497e-a90c-999429059408 | yujin1292/Solved-Algorithm-problem | BOJ/[백준] 8983 사냥꾼/[백준] 8983 사냥꾼/소스.cpp | #include <iostream>
#include <algorithm>
#include <vector>
#define ll long long
#define fastio ios_base::sync_with_stdio(false); cin.tie(0); cout.tie(0)
using namespace std;
ll M, N, L;
vector<ll> guns;
bool could_hunted(ll start_x, ll end_x) {
ll start = 0;
ll end = M - 1;
ll mid;
while (start <= end) {
mid... | ALGO | 0.999986 | 4.067715 |
be42f3ae-c7ed-48ce-8064-5787a4875f4c | rodalladea/tcc2 | collector-project/opencv-2.4.9/modules/contrib/src/openfabmap.cpp | #include "precomp.hpp"
#include "opencv2/contrib/openfabmap.hpp"
/*
Calculate the sum of two log likelihoods
*/
namespace cv {
namespace of2 {
static double logsumexp(double a, double b) {
return a > b ? log(1 + exp(b - a)) + a : log(1 + exp(a - b)) + b;
}
FabMap::FabMap(const Mat& _clTree, double _PzGe,
... | ALGO | 0.992866 | 6.137975 |
ca1beee7-c491-4573-ae34-24e07d144a55 | Leorasaharia/LeetCode-Solutions | 0137-single-number-ii/0137-single-number-ii.cpp | class Solution {
public:
int singleNumber(vector<int>& nums){
int n=nums.size();
for(int i=0;i<n;++i){
bool found=false;
for(int j=0;j<n;++j){
if(i!=j && nums[i]==nums[j]){
found=true;
break;
}
... | ALGO | 0.999948 | 5.394646 |
87a6a18b-4886-432f-b5c9-c117af660a0d | offamitkumar/UVA--Online-Judge | Solution/Problem_000642/642 Word Amalgamation.cpp | #include <bits/stdc++.h>
using namespace std;
#define int int64_t
signed main(void){
ios::sync_with_stdio(false);
cin.tie(nullptr);
cout.tie(nullptr);
#ifdef HELL_JUDGE
freopen("input","r",stdin);
freopen("output","w",stdout);
#endif
string s;
map<string, set<string>>f;
while(cin >> s... | ALGO | 0.999792 | 4.175752 |
d71bddb2-1fed-4c2a-8162-d7869a2c512c | LukasHromadnik/CVUT | FEL-KO/Úkoly/03/Source/examples.cpp | struct Example {
int numberOfNodes;
double ** input;
};
Example initializeAndSetupFirstExample() {
int numberOfNodes = 4;
double ** input = initializeMatrix(numberOfNodes, 0.0);
input[0][0] = 5;
input[0][1] = 9;
input[0][2] = 3;
input[0][3] = 6;
input[1][0] = 8;
input[1][1] = 7... | ALGO | 0.926338 | 3.974786 |
eba0ade4-d49b-4680-8bfc-6532bb6b3c6a | bijaylaxmibehera/DSA | Lecture_04/HW/part_08.cpp | /*
1 2 3 4 5
2 3 4 5
3 4 5
4 5
5 */
#include <iostream>
using namespace std;
int main()
{
int n;
cin >> n;
int row = n;
int space = 0;
while (row >= 1)
{
int col = 1;
while (col <= space)
{
cout << " ";
col++;
}
... | ALGO | 0.999888 | 4.076705 |
ca63a8a1-cf60-49c3-bd9f-9e9aec89d979 | ishandutta2007/codeforces | alishahali1382/normal/771/D.cpp | #include <bits/stdc++.h>
#pragma GCC optimize ("O2")
#pragma GCC optimize ("unroll-loops")
//#pragma GCC optimize("no-stack-protector,fast-math")
using namespace std;
typedef long long ll;
typedef long double ld;
typedef pair<int, int> pii;
typedef pair<pii, int> piii;
typedef pair<ll, ll> pll;
#define debug(x) cerr<<... | ALGO | 0.999759 | 3.565972 |
c918a5cf-2573-4dde-a850-97b9da3fa345 | Hariharanreddy/Questions-solved-on-GFG-and-Leetcode. | Remove loop in Linked List - GFG/remove-loop-in-linked-list.cpp | // { Driver Code Starts
// driver code
#include <iostream>
using namespace std;
struct Node
{
int data;
Node* next;
Node(int val)
{
data = val;
next = NULL;
}
};
void loopHere(Node* head, Node* tail, int position)
{
if(position==0) return;
Node* walk = head;
... | ALGO | 0.999965 | 3.993715 |
b9086223-47a4-4e30-ac94-ccf59a740eca | mactavish10/APS-2020 | Sort the Substring.cpp | #include <bits/stdc++.h>
#define int long long int
#define MP make_pair
#define PB push_back
#define rep(i, a, b) for (int i=a; i<b; i++)
#define endl "\n"
using namespace std;
int32_t main()
{
ios_base::sync_with_stdio(false);
cin.tie(NULL);
// your code goes here
int t , n , l , r;
string s ;
c... | ALGO | 0.999878 | 3.907728 |
f2246674-4319-4725-a61c-717724de25d5 | asu-crypto/mpsica | thirdparty/linux/miracl/miracl_osmt/source/brute.cpp | /*
* Program to factor numbers using brute force.
*
* Requires: big.cpp
*/
#include <iostream>
#include "big.h"
using namespace std;
#define LIMIT 10000
#ifndef MR_NOFULLWIDTH
Miracl precision=50;
#else
Miracl precision(50,MAXBASE);
#endif
int main()
{
int n,p;
Big x;
miracl *mr=&precision;
... | ALGO | 0.999062 | 4.669192 |
973d0983-89af-4ff3-b602-12f447d9fa40 | repositron/mypract | tests/AbCodilityTest.cpp | //
// Created by ljw on 14/06/21.
//
#include "gtest/gtest.h"
#include "../AbCodility.h"
//! Using the google test framework, check all elements of two containers
#define EXPECT_ITERABLE_BASE( PREDICATE, REFTYPE, TARTYPE, ref, target) \
{ \
const REFTYPE& ref_(ref); \
const TARTYPE& target_(target); \
R... | TEST | 0.939003 | 6.311115 |
e2e7984c-51e5-402a-9ba1-2f540bd2700f | codemonkeyricky/lc | 2466.cpp | #include <iostream>
#include <vector>
#include <cassert>
#include <stack>
#include <queue>
#include <algorithm>
#include <unordered_map>
#include <unordered_set>
#include <map>
#include <set>
#include <bitset>
#include <numeric>
#include <cmath>
using namespace std;
struct TreeNode
{
int val;
TreeNode *left;
... | ALGO | 0.999888 | 4.661663 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.