uuid string | repo_name string | relative_path string | content string | category string | algo_rel_score float64 | quality_score float64 |
|---|---|---|---|---|---|---|
d90fe2f1-16da-4b94-82db-da452d170793 | trlste/new-mega-scggm | eigen3/bench/quat_slerp.cpp | #include <iostream>
#include <Eigen/Geometry>
#include <bench/BenchTimer.h>
using namespace Eigen;
using namespace std;
template<typename Q>
EIGEN_DONT_INLINE Q nlerp(const Q& a, const Q& b, typename Q::Scalar t)
{
return Q((a.coeffs() * (1.0-t) + b.coeffs() * t).normalized());
}
template<typename Q>
EIGEN_DONT_INL... | ALGO | 0.996099 | 6.251565 |
fb6c1546-9346-41ff-9ada-577cbe88e7c9 | ishandutta2007/codeforces | dotorya/normal/796/D.cpp | #include <stdio.h>
#include <algorithm>
#include <assert.h>
#include <bitset>
#include <cmath>
#include <complex>
#include <deque>
#include <functional>
#include <iostream>
#include <limits.h>
#include <map>
#include <math.h>
#include <queue>
#include <set>
#include <stdlib.h>
#include <string.h>
#include <string>
#inc... | ALGO | 0.99993 | 3.719696 |
f728ce66-b35c-4603-9acd-2bdd01437f66 | raincross7/code-similarity | codes/train_code/problem467/problem467_344.cpp | #include<bits/stdc++.h>
using namespace std;
int main(){
int e,b;
cin >> e >> b;
int a[b+1]={0};
for(int i=0;i<b;i++){
cin >> a[i];
}
int sum=(e-a[b-1])+a[0];
int m;
for(int i=0;i<b;i++)sum=max(sum,a[i+1]-a[i]);
cout << e-sum << endl;
}
| ALGO | 0.999895 | 3.100441 |
0b48f298-6f02-4c03-ac5e-835f1253a93c | iamshivprasad/LearningDS | Heap/Heap.cpp | // Heap.cpp : This file contains the 'main' function. Program execution begins and ends there.
//
#include <iostream>
#include "MaxHeap.h"
using namespace std;
int main()
{
//MaxHeap myHeap(10);
//int i = 0;
//int element;
//while (i < 10)
//{
// cin >> element;
// myHeap.insertKey(element);
//}
int arr[]... | ALGO | 0.987313 | 4.299724 |
cf62af26-c89b-403d-be93-aa22e1ccdce9 | cheoljoo/educated-advanced-cpp | 2021_2nd_class/DAY3/1_rvalue.cpp | int x = 10;
int foo() { return x; }
int& goo() { return x; }
int main()
{
int v1 = 10, v2 = 10;
v1 = 20;
10 = v1;
v2 = v1;
int* p1 = &v1;
int* p2 = &10;
foo() = 20;
goo() = 20;
const int c = 10;
c = 20;
}
| TOOL | 0.947476 | 3.83686 |
8e092c1d-b8f2-490b-8159-4c2702545856 | wshwbluebird/LC16 | leet81-100/97.InterleavingString.cpp | ////
//// Created by wshwbluebird on 16/9/3.
////
//#include <iostream>
//using namespace std;
//
//
//
//class Solution {
//public:
// bool isInterleave(string s1, string s2, string s3) {
// int l1 = s1.length();
// int l2 = s2.length();
// int l3 = s3.length();
// if(l1 + l2 != l3 ) re... | ALGO | 0.997334 | 4.204621 |
21646c45-3241-420e-a413-5d31638849d1 | Leonardo16AM/ICPC-WF-2023-UH-Top | Extended team reference/number_theory/discrete_roots.cpp | /*
Solve x^k=a (mod n)
*/
vector<ll> discrete_root(ll k, ll a, ll n)
{
if (a == 0)
return {0};
ll g = primitive_root(n);
ll sq = (ll) sqrt(n + .0) + 1;
vector<pair<ll, ll>> dec(sq);
for (ll i = 1; i <= sq; ++i)
dec[i - 1] = {pow(g, ll(i * sq * 1ll * k % (n - 1)), n), i};
sort(dec.begin(), dec.end());
ll a... | ALGO | 0.999938 | 4.487333 |
6910ea20-30b4-4693-8cf8-fa39c07a0e2d | cpe102/lab9-2562-2-Tatsukikun999 | lab9_1.cpp | #include<iostream>
using namespace std;
int main(){
int count[5] = {}; //Declare array count for counting A,B,C,D,F and initialize all element = 0
char grade;
int i=1;
cout << "Please input grade of each student (A-F) or input 0 to exit.\n";
do{
cout << "Student [" <<i<< "]:";
cin >> grade; //The loop must... | ALGO | 0.937982 | 3.386278 |
36831ae2-5554-4802-abe8-8a8ea492f82a | chlos/yandex-cpp | yandex-cpp-01-white/w01/03-eq.cpp | #include <iostream>
#include <cmath>
int main() {
double a, b, c, d;
std::cin >> a >> b >> c;
double x1, x2;
if (a == 0 and b == 0) {
return 0;
}
if (a == 0) {
x1 = x2 = -c / b;
std::cout << x1 << "\n";
return 0;
}
d = b * b - 4 * a * c;
//std::co... | ALGO | 0.999301 | 3.917447 |
4a6f1fbe-af3b-40c0-8152-28b22e2ac2b7 | ishandutta2007/codeforces | redstar_13/normal/521/D.cpp | #include <bits/stdc++.h>
using namespace std;
typedef long long INT;
typedef double DO;
typedef pair<int, int> pii;
typedef vector<int> VI;
typedef pair<DO, int> pdi;
#define NN 101010
int a[NN], T[NN];
pii mx[NN];
vector<pii> add[NN];
vector<pdi> multi;
int main() {
#ifndef ONLINE_JUDGE
freopen("in.in", "r", s... | ALGO | 0.999972 | 3.23619 |
c7be3e36-da32-48ca-8440-284600fb972f | wzulfikar/lab | cpp/CSC2104/labtest2/main.cpp | # include "DList.h"
int randomInt (int MAX = 100) {
return (rand() % MAX) + 1;
}
void makeListOfTenNumbers (DList<int> list) {
cout << "Making list of 10 numbers..\n";
int N = 10;
for (int i = 0; i < N; i++) {
int number = randomInt();
list.push_back(number);
}
}
void deleteList (DList<int> list) {
cout <... | TOOL | 0.965475 | 3.554276 |
93dc1307-add7-4bfa-96d9-ff9a865efeb0 | yongjunleeme/BOJ | 프로그래머스/lv1/131705. 삼총사/삼총사.cpp | #include <bits/stdc++.h>
using namespace std;
int solution(vector<int> number) {
int ans = 0;
for(int i = 0; i < number.size(); i++){
for(int j = i+1; j < number.size(); j++){
for(int k = j+1; k < number.size(); k++){
if(number[i] + number[j] + number[k] == 0) ans++;
... | ALGO | 0.999782 | 5.564481 |
84a901bc-5ec1-4761-9843-e526484ad4fb | D-ENCODER/tic_tac_toe | 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.998689 | 6.787361 |
d2fb869d-562b-4cac-bcf3-fe026b012b24 | naimulhassan2001/resid-plus-user | 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 |
1eb7f6d7-5a36-4286-8350-c8f34dd8b252 | akk312000/Codeforces-solution | constructive.cpp | #include <bits/stdc++.h>
using namespace std;
#define fast_io ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(0);
#define endl "\n"
#define ull unsigned long long
#define pb push_back
typedef long long ll;
typedef pair<int, int> pii;
const int MOD = 1000000007;
signed main()
{
#ifndef ONLINE_JUDGE
freopen("i... | ALGO | 0.999683 | 4.306851 |
7d4e4cb6-67d7-4162-a179-aa50393e997f | shivangi0110/24SS-AllTrans-main | benchmarks/benchmarks_source/8_level/p03242/s391047331.cpp | #include <bits/stdc++.h>
using namespace std;
int main() {
char n[3];
cin >> n;
for (int i = 0; i < 3; i++) {
if (n[i] == '9') {
n[i] = '1';
} else {
n[i] = '9';
}
}
cout << n << endl;
} | ALGO | 0.999567 | 4.431586 |
3587dc6c-08a0-4569-91fe-59f47887423f | syf1913/IBAMR | tests/multiphase_flow/high_density_droplet.cpp | // Config files
#include <SAMRAI_config.h>
// Headers for basic PETSc functions
#include <petscsys.h>
// Headers for basic SAMRAI objects
#include <BergerRigoutsos.h>
#include <CartesianGridGeometry.h>
#include <LoadBalancer.h>
#include <StandardTagAndInitialize.h>
// Headers for application-specific algorithm/data... | ALGO | 0.984964 | 4.859203 |
89d2eabe-0a65-4435-a8ab-fcfab9e525ac | zinnetyazicii/deneyap | hafta 3/bit_islemleri/main.cpp | #include <iostream>
using namespace std;
int main()
{
int x = 23; // x = 0001 0111
int y = 78; // y = 0100 1110
int z = x | y; // z = 0101 1111
cout << "Sonuc: " << z << endl;
return 0;
}
| ALGO | 0.995517 | 3.920363 |
4081f265-f77e-45f0-ab93-3d8cfa5d3449 | MihaiPopescu31/C-Mini-Projects | proiect_subtitution-key/main.cpp |
#include <iostream>
#include<string>
using namespace std;
int main()
{
string alphabet {"abcdefghijklmnopqrstuvwxyz"};
string key {"XZNLWEBGJHQDYVTKFUOMPCIASRxznlwebgjhqdyvtkfuompciasr"};
string secret_message {};
cout<< "Enter your secret message: ";
getline(cin,secret_message);
string encr... | ALGO | 0.998101 | 4.283957 |
33d9f299-aed5-4ad7-a4b4-028296b051d3 | jingwei95/string_split | longest_subsequence.cpp | #include <iostream>
#include <algorithm>
using namespace std;
int main(void){
int num_test;
cin >> num_test;
while(num_test > 0){
int array_length;
cin >> array_length;
long long array[array_length];
int result[array_length];
for(int i = 0; i < array_length; i ++){
result[i] = 1;
}
for(int i = 0; ... | ALGO | 0.999679 | 3.535212 |
f3ee7920-2be8-4bb3-93e6-ce24152fcd06 | MiRoboticsLab/cyberdog_mivins | mivins_core/mivins_frontend/mivins_direct/src/elder_zucker_utilities.cpp | #include <mivins/direct/elder_zucker_utilities.h>
#ifdef __SSSE3__
#include <tmmintrin.h>
#endif
#include <boost/math/special_functions/erf.hpp>
#include <opencv2/imgproc/imgproc.hpp>
#include <opencv2/highgui/highgui.hpp>
namespace mivins
{
namespace elder_zucker
{
void DetectEdges(
const... | ALGO | 0.999697 | 3.248153 |
7af24fbc-c8dc-42e0-aede-2b58b9670336 | igorjoz/matura-informatyka | Materiały, opracowania/CPP/matura 2017 trojki liczb.cpp | #include <iostream>
#include <fstream>
#include <utility>
bool rosnace(int a, int b, int c);
int NWD(int a, int b);
int sumaCyfr(int n);
struct SumaCyfrWWierszach{
int suma;
int iloscWierszy;
};
int main()
{
std::ifstream dane {"liczby.txt"};
std::ofstream wyniki {"wyniki6.txt"};
int pierwsza;
... | ALGO | 0.999248 | 4.158973 |
24114479-a545-4aa0-837d-c4bee3f6f6a4 | lansen31/learngit | C-Plus-Plus/geometry/line_segment_intersection.cpp | /**
* @file
* @brief check whether two line segments intersect each other
* or not.
*/
#include <algorithm>
#include <iostream>
/**
* Define a Point.
*/
struct Point {
int x; /// Point respect to x coordinate
int y; /// Point respect to y coordinate
};
/**
* intersect returns true if segments of two ... | ALGO | 0.999827 | 4.561116 |
f4eeeb25-a9dc-4b6e-8c5b-c5859aa9aa8a | YusahO/bmstu-aa | lab4/prog/lib/algorithms.cpp | #include "algorithms.h"
#include <cmath>
#include <thread>
namespace Algo
{
void c_means(
membership_t &membership, point_vec_t &cluster_centers,
const point_vec_t &data,
double m, double conv_threshold, int max_iters)
{
int iters = 0;
double delta = conv_threshold + 1.... | ALGO | 0.999879 | 6.715531 |
171edd45-63e6-4554-8205-9f98d3093e9b | RichieDatalyst/Semester-Work | OOP/Assignments/l215694_Datalyst_Q1 (4).cpp | #include<iostream>
#include<algorithm>
using namespace std;
int main() {
int n1, n2, T;
int* arr = new int[n1];
int* arr2 = new int[n2];
cout << "Enter The Size Of The Array 1 : ";
cin >> n1;
cout << "Enter The Elements Of The Array 1 : ";
for (int i = 0; i < n1; i++) {
cin >> *(arr ... | ALGO | 0.999854 | 3.771386 |
11f64639-da64-43a8-a126-b3f38c3cd942 | SamBhusnar/SamBhusnar | ccppvscode/bank.cpp | #include<iostream>
using namespace std;
class bankdeposit
{
private:
int year;
int time;
float rate;
int rate;
int returnvalue;
public:
bankdeposit();
bankdeposit(int amount int y,int t,int r);
bankdeposit(int amount int y,int t,int R);
void show(void){
}
};
bankdeposit::bankdepo... | ALGO | 0.914443 | 3.267612 |
f4e0ff5a-046d-4689-bb54-324de5215d66 | joaopaulozz/C | Esfera.cpp | /*
Name: Esfera
Author: Joao Paulo Oliveira
Date: 17/08/18 11:31
Description:
*/
#include<stdio.h>
#include<math.h>
main()
{
double pi = 3.14159;
double r3 = 0.0;
double vol = 0.0;
scanf("%lf",&r3);
r3 = pow(r3,3);
vol = (4/3.0) * pi * r3;
printf("VOLUME = %.3lf\n",vol);
return 0;
}
| ALGO | 0.999283 | 4.742755 |
a8c83046-d29a-4333-b120-dd754039d375 | sh-sho1kat/CODEFORCES | Practice Contest 01/F_Balls_Game.cpp | ///********************** بِسْمِ ٱللَّهِ ٱلرَّحْمَـٰنِ ٱلرَّحِيمِ **********************///
/**
* author: Shefat Hossen Shoikat
* date : 2023-11-10 10:52:46
**/
#include <bits/stdc++.h>
using namespace std;
#define fastio ios_base::sync_with_stdio(false), cin.tie(NULL), cout.tie(NULL)
#define mod 1000000... | ALGO | 0.999955 | 4.787305 |
f3dde747-8520-469a-9fd2-3710b0fee72f | 00200xs-dot/CppCode | LeetCodeProblems/326.3-的幂.cpp | /*
* @lc app=leetcode.cn id=326 lang=cpp
*
* [326] 3 的幂
*/
// @lc code=start
class Solution
{
public:
bool isPowerOfThree(int n)
{
// 判断 n 是否大于零,并且 n 是否能整除 1162261467(3^19)
return (n > 0) && (1162261467 % n == 0);
}
};
// @lc code=end
| ALGO | 0.999229 | 6.415644 |
b8d7e1ed-a892-4734-b3e1-a0ea5639d88e | Franch-Toast/Daily-algorithm-training | Source/219.存在重复元素-ii.cpp | /*
* @lc app=leetcode.cn id=219 lang=cpp
*
* [219] 存在重复元素 II
*/
// @lc code=start
#include "vector"
#include "string"
#include "unordered_map"
using namespace std;
class Solution {
public:
bool containsNearbyDuplicate(vector<int>& nums, int k) {
int n = nums.size();
unordered_map<int,int> inde... | ALGO | 0.999698 | 6.138218 |
9cc43bb7-810c-47cb-8189-bc1424b63f27 | neeraj0225/LeetCode-Challenges | September Challenge/Contains Duplicate III.cpp | #include<bits/stdc++.h>
#include <algorithm>
using namespace std;
class Solution {
public:
bool containsNearbyAlmostDuplicate(vector<int>& A, int k, int t) {
int i,n=A.size(),flag=0;
if(n==0 || k<=0 || t<0)
return false;
if(k<=n)
{
multiset<long long int> st(A... | ALGO | 0.999934 | 5.412203 |
9ea9071e-f7ec-447e-8fa6-3efc187fc8b6 | ishandutta2007/codeforces | qaqaqaqaq/normal/1530/A.cpp | //template update
// #pragma GCC optimize("Ofast")
// #pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx")
// #pragma GCC optimize("unroll-loops")
#include<bits/stdc++.h>
#define int long long
using namespace std;
#define rep(i,n) for (int i=0;i<(int)(n);++i)
#define rep1(i,n) for (int i=1;i<=(int)(n);+... | ALGO | 0.996242 | 3.175061 |
25a290c1-c604-4186-832f-9103b5df27a1 | FarmerJohnLYH/shareOI | JZOJ/2019.1.28/5954.cpp | #include <cstdio>
#include <cstring>
#include <iostream>
#include <algorithm>
#define fo(i,x,y) for(int i=(x);i<=(y);++i)
#define fd(i,x,y) for(int i=(x);i>=(y);--i)
using namespace std;
const int N=500500,mo=998244353;
int n;
int to[N*2],nex[N*2],las[N],tot,all;
int qsm(int a,int b)
{
int rt=1;
fo(i,0,30)
{
if((1... | ALGO | 0.999636 | 4.428774 |
a3c77196-7c6d-4d8e-a8f1-8c13c5be5067 | Finale-Raky/Multimedia-Retrieval-sketch | src/pmp/algorithms/HoleFilling.cpp | #include "pmp/algorithms/HoleFilling.h"
#include <Eigen/Dense>
#include <Eigen/Sparse>
#include "pmp/algorithms/Fairing.h"
using SparseMatrix = Eigen::SparseMatrix<double>;
using Triplet = Eigen::Triplet<double>;
namespace pmp {
HoleFilling::HoleFilling(SurfaceMesh& _mesh) : mesh_(_mesh)
{
points_ = mesh_.vert... | ALGO | 0.999469 | 6.714007 |
f74941bd-0545-46ac-9929-33b8de67ecf8 | Kaminyou/MyLeetcode | cpp_solutions/3228.cpp | class Solution {
public:
int maxOperations(string s) {
reverse(s.begin(), s.end());
int res = 0;
int index = 0;
int cnt = 0;
int n = s.size();
while (index < n) {
if (s[index] == '1') res += cnt;
else {
while (index + 1 < n && s... | ALGO | 0.999982 | 6.221776 |
ea3f2e4c-515c-482c-b8e0-06825dd4e07f | Thalisson-Alves/Competitive-Programming | submissions/CodeForces/1859/a.cpp | #include <bits/stdc++.h>
using namespace std;
#ifdef DEBUG
#include "debug.cpp"
#else
#define dbg(...) 4269
#endif
#define all(x) x.begin(), x.end()
using ll = long long;
using ull = unsigned long long;
const vector<pair<int, int>> dir4{{1,0},{-1,0},{0,1},{0,-1}};
const vector<pair<int, int>> dir8{{1,0},{-1,0},{0... | ALGO | 0.999293 | 3.77337 |
f93a5001-d79b-47e3-abc9-67212fb220e9 | folgerwang/UnrealEngine | Engine/Source/ThirdParty/IntelTBB/IntelTBB-4.4u3/examples/concurrent_hash_map/count_strings/count_strings.cpp | // Workaround for ICC 11.0 not finding __sync_fetch_and_add_4 on some of the Linux platforms.
#if __linux__ && defined(__INTEL_COMPILER)
#define __sync_fetch_and_add(ptr,addend) _InterlockedExchangeAdd(const_cast<void*>(reinterpret_cast<volatile void*>(ptr)), addend)
#endif
#include <string>
#include <cstring>
#include... | TOOL | 0.990352 | 6.254293 |
be503d73-ae13-4f6d-99d1-f1919a30a632 | huynh-vch/code_c | chuong06_dequy/bai006.cpp | // De qui ho tuong
#include <iostream>
using namespace std;
long TinhXn(int);
long TinhYn(int);
int main()
{
int k;
cout << "Nhap k:";
cin >> k;
int kq1 = TinhXn(k);
cout << "Ket qua la 1: " << kq1 << "\n";
int kq2 = TinhYn(k);
cout << "Ket qua la 2: " << kq2 << "\n";
return 1;
}
long... | ALGO | 0.999592 | 3.511981 |
7d111e28-b525-47e3-8808-7f21993d24aa | pkw3322/CodingStudy | week14/BOJ7579.cpp | #include<iostream>
#include<algorithm>
using namespace std;
int n,m,total = 0;
pair<int,int> memorys[101];
int dp[101][10001];
void Solution(){
for(int i = 1; i <= n; i++){
for(int j = 0; j <= total; j++){
if(j-memorys[i].first >= 0){
dp[i][j] = max(dp[i][j],dp[i-1][j-memorys[... | ALGO | 0.999997 | 3.975423 |
c3653ae1-b733-4e36-9098-3aa8910dae50 | RichardoMrMu/yolov5-deepsort-tensorrt | deepsort/src/hungarianoper.cpp | #include "hungarianoper.h"
Eigen::Matrix<float, -1, 2, Eigen::RowMajor> HungarianOper::Solve(const DYNAMICM &cost_matrix) {
int rows = cost_matrix.rows();
int cols = cost_matrix.cols();
Matrix<double> matrix(rows, cols);
for (int row = 0; row < rows; row++) {
for (int col = 0; col < cols; col++... | ALGO | 0.999738 | 4.365909 |
26f010f7-dd5f-42f7-b25b-2f89bbb6ace0 | lucasscharenbroch/kattis-solutions | yinyangstones.cpp | #include <bits/stdc++.h>
using namespace std;
#define rep(i, a, b) for(int i = a; i < (b); i++)
#define all(x) begin(x), end(x)
#define sz(x) (int) (x).size()
typedef long long ll;
typedef pair<int, int> pii;
typedef vector<int> vi;
void init_cin() {
cin.tie(0)->sync_with_stdio(0);
cin.exceptions(cin.failbi... | ALGO | 0.999819 | 4.20067 |
dc4d6a62-15cb-4432-aa20-d5855a770d05 | dotSlash-Adwitiya/Problem-of-the-day | ToeplitzMatrix.cpp | #include<bits/stdc++.h>
using namespace std;
bool isToeplitz(vector<vector<int>>& mat) {
int row = mat.size();
int col = mat[0].size();
for(int i = 0; i<row-1; i++){
for(int j = 0; j<col-1; j++){
// checking for diagonal element equal or not
if(mat[i][j] != mat... | ALGO | 0.999946 | 4.964484 |
4f9907ff-0fc0-412e-a2c2-84db53b6115a | 5ecret99/leetcode | problems/0026-remove-duplicates-from-sorted-array/solution.cpp | class Solution {
public:
int removeDuplicates(vector<int>& nums) {
auto ind = 0;
for(auto n : nums)
if(ind < 1 || n > nums[ind - 1])
nums[ind++] = n;
return ind;
}
};
| ALGO | 0.999819 | 6.307597 |
cce010b2-cbcf-4244-b15d-0bdde49d8d07 | FARHAN-27/DSA-Lab | queue.cpp | #include<bits/stdc++.h>
using namespace std;
#define n 5
//queue using link list
class node{
public:
int data;
node* next;
node(int val){
data=val;
next = NULL;
}
};
class LLQUEUES{
node* front;
node* back;
public:
LLQUEUES(){
front=NULL;
... | ALGO | 0.997949 | 3.834697 |
9d6a753d-ac2f-4265-acf7-4b0dbea9362a | nazikus/nyu-seg | spams-matlab/decomp/mex/mexSOMP.cpp | /*!
* \file
* toolbox decomp
*
* by Julien Mairal
* <EMAIL>
*
* File mexSOMP.h
* \brief mex-file, function mexSOMP
* Usage: alpha = mexSOMP(X,D,list_groups,param);
* */
#include <mexutils.h>
#include <decomp.h>
template <typename T>
inline void cal... | TOOL | 0.997093 | 4.331522 |
912832b6-784c-4f0e-9ef9-55083f2a1c6a | souravbiswassanto/Codeforces | 221C.cpp | #include <bits/stdc++.h>
using namespace std ;
#define ll long long
#define pb push_back
#define mp make_pair
#define MAX 500006
#define MAX1 10000008
#define mem(a,v) memset(a,v,sizeof(a))
template <typename T>
T mymax (T a,T b){return (a>b)?a:b;}
template <typename T>
T mymin (T a,T b){return (a<b)?a:... | ALGO | 0.999988 | 3.461952 |
caf30ae1-6eeb-4fe7-af83-c70894e87d66 | EthanKim8683/High-School-Competitive-Programming | Codeforces/Problemset/All/1380d.cpp | #include<bits/stdc++.h>
using namespace std;
using I=int;
using Lli=long long int;
using B=bool;
const I N=2e5;
const I M=2e5;
const I LOGN=18;
const I MIN=-1e9;
I a_arr[N];
I b_arr[M];
vector<pair<I,I>>rngs;
I main(){
cin.tie(0)->sync_with_stdio(0);
I n,m;cin>>n>>m;
I x,k,y;cin>>x>>k>>y;
for(I i=0;i<n;i++)cin>... | ALGO | 0.999915 | 3.575052 |
7ce4bf83-58e9-4981-b5ba-e216880a8543 | migalha212/code | AED/TP09/055 -Bypartite Graphics.cpp | //* for full implementation in practice of the code check graph.h
/*
bool isBipartite() {
for (int i = 1; i <= n; i++){
nodes[i].visited = false;
nodes[i].state = -1;
}
for(int i = 1; i <= n; i++){
// if a node hasnt been collored yet
if(nodes[i].... | ALGO | 0.977971 | 4.896 |
28683db3-c315-4e02-a191-c628e064816b | kiraware/Learn-C-and-CPP | cpP/1.9.cpp | #include <iostream>
int main()
{
int sum = 50, val = 51;
// keep executing the while as long as val is less than or equal to 10
while (val <= 100) {
sum += val; // assigns sum + val to sum
++val; // add 1 to val
}
std::cout << "Sum of 50 to 100 inclusive is "
<< sum << std::endl;
return 0;
}
| ALGO | 0.997766 | 3.643098 |
ad1829a8-cce4-4ce9-8d48-1c2e605cebf8 | SEONMl/Solutions | venv/Category/DynamicProgramming/N11057.cpp | #include<iostream>
#include<stdio.h>
using namespace std;
int N;
int dp[1001][10];
int main(){
scanf("%d",&N);
int ans=0;
for(int i=0;i<10;i++)dp[1][i]=1;
for(int i=2;i<=N;i++){
for(int j=0;j<10;j++){
for(int k=j;k<10;k++){
dp[i][j]+=dp[i-1][k];
}
... | ALGO | 0.999816 | 4.069886 |
d852a140-76a9-44dd-b283-825daa205f9f | megatron10/codeforces | 276-D/276-D-42353753.cpp | #include <iostream>
#include <algorithm>
#include <vector>
#include <unordered_map>
#include <unordered_set>
#define lli long long int
#define p 100000000
using namespace std;
int main()
{
ios_base::sync_with_stdio(false);
cin.tie(NULL); cout.tie(NULL);
lli l,r,ans;
cin>>l>>r;
ans=l^r;
for(int i=0;i<=5;i++) ans... | ALGO | 0.999918 | 3.046434 |
fc851271-e4f5-43fe-bba1-dc8289fb9705 | UrrOis/Quran-Mobile-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.998799 | 6.776823 |
2769291f-de05-4f5e-801f-3cc047234d57 | Beatrix-0/Competitive-Programming | Let's Recape/Bit Manipulation/Bit Basic/05. Flip bits.cpp | #include<bits/stdc++.h>
using namespace std ;
int main()
{
ios_base::sync_with_stdio(false);
cin.tie(nullptr);
int t ; cin >> t ;
while ( t-- ){
unsigned int n ; cin >> n ;
// flip in a particular position : num = num ^ (1 << position)
// flip the full number : ~num
... | ALGO | 0.999619 | 5.032744 |
8535d3c6-cda6-465a-9f00-732c0a25181c | Lodour/ACM-ICPC | codes/shuoj/1040.cpp | #include <iostream>
#include <cstdio>
#include <cstring>
#include <vector>
#include <algorithm>
using namespace std;
int main() {
#ifdef MANGOGAO
freopen("data.in", "r", stdin);
// freopen("data.out", "w", stdout);
#endif
int n, m, a[10010];
scanf("%d%d", &n, &m);
for (int i = 0; i < n; i++)
scanf("%d", &a[i])... | ALGO | 0.99993 | 3.519669 |
26a99e06-336a-436a-a1d6-a01a5f9a7a35 | Chandanbam/mlops-module6 | myvenv/lib/python3.10/site-packages/sklearn/svm/src/liblinear/tron.cpp | #include <math.h>
#include <stdio.h>
#include <string.h>
#include <stdarg.h>
#include "tron.h"
#ifndef min
template <class T> static inline T min(T x,T y) { return (x<y)?x:y; }
#endif
#ifndef max
template <class T> static inline T max(T x,T y) { return (x>y)?x:y; }
#endif
static void default_print(const char *buf)
{... | ALGO | 0.999474 | 5.836969 |
2715f44c-3d0b-4a35-92bf-d8489e36f027 | amityadav23112000/leetcode-solution | 0643-maximum-average-subarray-i/0643-maximum-average-subarray-i.cpp | class Solution {
public:
double findMaxAverage(vector<int>& nums, int k) {
double res;
int sum=0;
int i=0;
int j=0;
int ans=INT_MIN;
while(j<nums.size()){
sum+=nums[j];
if(j-i+1<k) j++;
else if(j-i+1==k){
ans=max(sum... | ALGO | 0.999939 | 6.123695 |
b69bf76b-08ad-4fd8-9e9a-4793daeae506 | CodePeaceful/AdventOfCode2024 | src/day6/task2.cpp | #include <iostream>
#include "..\utility.hpp"
void solve(std::vector<std::string>);
bool outOfBounds(int top, int left);
void checkForPotentials(std::vector<std::string>& map);
void findStart(const std::vector<std::string>& map, int& top, int& left);
void test(std::vector<std::string> map);
static int width, height,... | ALGO | 0.999305 | 5.142139 |
6cf7dd63-424e-499f-8ca9-b5f1fb9fd6e1 | mishrajiharsh219/leetcode | 0057-insert-interval/0057-insert-interval.cpp | class Solution {
public:
vector<vector<int>> insert(vector<vector<int>>& intervals, vector<int>& newinterval) {
int i=0;
vector<vector<int>> res;
for(int i=0;i<intervals.size();i++){
if(intervals[i][1]<newinterval[0]){
res.push_back(intervals... | ALGO | 0.999978 | 6.00785 |
c3341d41-5c95-4ba7-817c-450c76bf5311 | Stark09Dh/DSA-Practice | December Leetcode/03_Dec.cpp | #include<bits/stdc++.h>
using namespace std ;
string addSpaces(string s, vector<int>& spaces) {
int n = spaces.size() ;
int m = s.length();
string ans;
set<int>st(spaces.begin() , spaces.end()) ;
for(int i = 0 ; i < s.length() ; i++){
if(st.find(i) != st.end()){
ans += ' ';
... | ALGO | 0.999898 | 4.195148 |
d2eebd54-29f7-4d3e-b9b0-5b225b4490f0 | tpgus2603/Boj | recursion/2447.cpp | #include<iostream>
#include<cmath>
#include<string>
using namespace std;
char arr[10000][10000];
void starsquare(int n,int row,int col) //
{
if (n == 3)
{
for (int i = row; i < 3+row; i++)
{
for (int j = col; j <3+col; j++)
{
if ((i == (2 * row + 3) / 2) && (j == (2 * col + 3) / 2))
continue;
... | ALGO | 0.999985 | 3.399136 |
dabbf6b2-6ffa-471c-a29a-eec39f801eff | raincross7/code-similarity | codes/train_code/problem479/problem479_315.cpp |
#include<bits/stdc++.h>
#define ll long long int
#define f(i,n) for(ll i = 0; i < n ; i++)
#define fn(i,n) for(ll i = 1; i < n ; i++)
#define F first
#define pb push_back
#define S second
using namespace std;
ll dp[3005][3005];
char a[1001][1001];
ll r = 10000000, c = 10000000;
ll mn = INT_MAX;
ll mx = 1000000007;
... | ALGO | 0.999979 | 3.946402 |
d9d3c3bb-868b-4967-914c-f18a40ac3c19 | saubhik/LeetCode.cc | src/leetcode/path-in-zigzag-labelled-binary-tree.cpp | //
// Created by saubhik on 2020/02/29.
//
#include <cmath>
#include <vector>
class Solution {
public:
// Runtime: 0 ms, faster than 100.00% of C++ online submissions for Path In
// Zigzag Labelled Binary Tree. Memory Usage: 7.7 MB, less than 100.00% of C++
// online submissions for Path In Zigzag Labelled Binar... | ALGO | 0.99985 | 5.821715 |
ac9fdba6-1d88-4232-9343-4750fee1cd25 | prakharrai1609/Leetcode-submissions | 34-find-first-and-last-position-of-element-in-sorted-array/34-find-first-and-last-position-of-element-in-sorted-array.cpp | class Solution {
public:
int ub(const vector<int>& a, int target) {
int l = 0, r = size(a) - 1, ans = -1;
while (l <= r) {
int m = (l + r) / 2;
if (a[m] > target) {
r = m - 1;
} else {
if (a[m] == target) ans = m;
l ... | ALGO | 0.999909 | 6.59322 |
145157df-314b-4adb-a284-ae0180f24d69 | HYDRO2070/May-Leetcode-Daily-Question | 10-05-2025/2918. Minimum Equal Sum of Two Arrays After Replacing Zeros.cpp | class Solution {
public:
long long minSum(vector<int>& nums1, vector<int>& nums2) {
long long sum1 = 0, sum2 = 0;
int c1 = 0, c2 = 0;
for (int& num : nums1) {
if (num == 0) c1++;
else sum1 += num;
}
for (int& num : nums2) {
if (num == 0) c... | ALGO | 0.999949 | 4.976716 |
bdef98c8-ff58-4177-9b6c-e0e43648a748 | jsanyam/Codes | SPOJ/helix.cpp | #include<iostream>
using namespace std;
int main()
{
long int sum1, sum2, sum;
int n1, n2, i, j;
while(true)
{
cin>>n1;
if(n1 == 0)
break;
sum1 = sum2 = sum = 0;
int arr1[n1];
for(i = 0; i<n1; i++)
cin>>arr1[i];
cin>>n2;
in... | ALGO | 0.999927 | 3.068372 |
093c9e79-8184-4313-8d17-9279513dc82d | ishandutta2007/codeforces | xiaowuc1/normal/725/A.cpp | #include <algorithm>
#include <cassert>
#include <cmath>
#include <complex>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <ctime>
#include <deque>
#include <iostream>
#include <map>
#include <memory>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <string>
#include <unord... | ALGO | 0.999661 | 3.159548 |
86577c6c-2e83-4da2-8d42-4d02f91417fd | ramamimu/Data_structure | code/breadProblemoRoviery.cpp | #include <stdlib.h>
#include <stdbool.h>
#include <stdio.h>
/* Struktur Node */
typedef struct stackNode_t {
int data;
struct stackNode_t *next;
} StackNode;
/* Struktur ADT Stack */
typedef struct stack_t {
StackNode *_top;
unsigned _size;
} Stack;
/* Function prototype */
void stack_init(Stack *... | ALGO | 0.999874 | 3.745855 |
894eb82d-80a2-4a20-820f-de689a5b06d0 | antoniocarrillo69/DDMyFEM | DDM/DDM2D/DDM2DRectangulosParalelo/EjemploDeUso/ResuelveFactorizacionLUBandDisp.cpp | //////////////////////////////////////////////////////////////////////////////////////////////
// Clase para resolver un sistema lineal usando factorizacion LU //
// //
// Anlisis y Diseo y Programacin: ... | ALGO | 0.999432 | 3.211622 |
2140fbb9-f6e0-4e99-af37-4c271bc4798e | Monthy/gr-lida | 3rdparty/Qt7zip/p7zip_src/CPP/7zip/Crypto/HmacSha256.cpp | // HmacSha256.cpp
#include "StdAfx.h"
#include "../../../C/CpuArch.h"
#include "HmacSha256.h"
namespace NCrypto {
namespace NSha256 {
static const unsigned kBlockSize = 64;
void CHmac::SetKey(const Byte *key, size_t keySize)
{
Byte temp[kBlockSize];
size_t i;
for (i = 0; i < kBlockSize; i++)
temp[i] ... | TOOL | 0.862907 | 6.507318 |
bfd38d3f-8450-49ed-bc9d-3a9e39ab6450 | Notstevee/ParallelComputing_CS149 | asst1/prog4_sqrt/main.cpp | #include <stdio.h>
#include <algorithm>
#include <pthread.h>
#include <math.h>
#include <immintrin.h>
#include "CycleTimer.h"
#include "sqrt_ispc.h"
using namespace ispc;
extern void sqrtSerial(int N, float startGuess, float* values, float* output);
static void verifyResult(int N, float* result, float* gold) {
... | ALGO | 0.999626 | 4.481857 |
6b8d4908-99a3-48a8-83f4-692063ff79ba | Fxy2021201516/ACORN_baseline | faiss/gpu/impl/InterleavedCodes.cpp | #include <faiss/gpu/impl/InterleavedCodes.h>
#include <faiss/gpu/utils/StaticUtils.h>
#include <faiss/impl/FaissAssert.h>
namespace faiss {
namespace gpu {
inline uint8_t unpack5(int i, uint8_t vLower, uint8_t vUpper) {
uint8_t v = 0;
// lsb ... msb
// 0: 0 0 0 0 0 1 1 1
// 1: 1 1 2 2 2 2 2 3
... | ALGO | 0.988555 | 5.523519 |
0543cb6a-69bf-4f2b-b051-e7dfe652d328 | stefanreuther/c2ng | game/parser/messageparser.cpp | /**
* \file game/parser/messageparser.cpp
* \brief Class game::parser::MessageParser
*/
#include <algorithm>
#include "game/parser/messageparser.hpp"
#include "afl/io/textfile.hpp"
#include "afl/string/format.hpp"
#include "afl/string/parse.hpp"
#include "game/alliance/offer.hpp"
#include "game/parser/datainte... | TOOL | 0.903785 | 7.093942 |
f68355c8-b4fa-4118-9b99-8904061b94be | liaojh1998/Competitive-Programming | CodeChef/JUNE17/PRMQ (Simpler).cpp | #include <bits/stdc++.h>
using namespace std;
class FastIO{
//#define getchar() (getchar_unlocked()) //For hackerrank
private:
//inline if read speed is needed, huge compilation time required though
//safe no fread implementation
int readInt(int &n){
register int c;
n = 0;
bool neg = false;
c = getchar();
... | ALGO | 0.999964 | 3.542166 |
75bfff80-c1dd-45d0-ab5a-de075871df6e | Datguyprasham/CompetitiveProgramming | CSES problem set/IncreasingArr.cpp | #include <bits/stdc++.h>
using namespace std;
typedef unsigned long long ull;
int main(){
ios_base::sync_with_stdio(false);
cin.tie(NULL);cout.tie(NULL);
ull n,sum=0;cin>>n;
ull arr[n];
for(int i=0;i<n;i++){
cin>>arr[i];
}
for(int i=0;i<n;i++){
if(arr[i]>arr[i+1]){
... | ALGO | 0.999942 | 3.573664 |
e826c3f6-3756-44f6-ad36-034df8079597 | lyccrius/OI-Solution | CodeForces/796D Police Stations.cpp | #include <iostream>
#include <deque>
#include <map>
typedef std::deque<int> dic;
typedef std::map<int, std::map<int, int> > mii;
const int maxN = 3e5;
const int maxK = 3e5;
int n, k, d;
int p[maxK + 10];
int u, v;
dic ans;
namespace graph {
struct Vertex {
int head;
int vis;
int col;
... | ALGO | 0.999913 | 4.502615 |
db26b91e-4f29-487c-b892-ab96daef860c | Viveknaik99/C_Programms | bitwise operator even or odd.cpp | #include <stdio.h>
int main()
{
int number;
printf("Enter an integer: ");
scanf("%d", &number);
if (number & 1) {
printf("%d is odd.\n", number);
}
else
{
printf("%d is even.\n", number);
}
return 0;
}
| ALGO | 0.999473 | 4.10224 |
b5c1cae2-5e35-4564-a011-2e02aea572a4 | gauravdebnath89/language | c++/map1.cpp |
#include <map>
#include <iostream>
using namespace std;
int main()
{
multimap<int,int> m;
m.insert( make_pair(1,1) );
m.insert( make_pair(0,2) );
m.insert( make_pair(1,5) );
m.insert( make_pair(4,5) );
m.insert( make_pair(1,3) );
int key = 1;
multimap<int,int>::con... | ALGO | 0.999275 | 3.801246 |
79fe2b26-6581-457d-b109-f0e4fa07a303 | LEECHHE/acmicpc | solved/2502.cpp | #include <cstdio>
using namespace std;
int fib[35] = { 1, 1 };
int main(){
for( int i = 2 ; i < 35 ; ++i ){
fib[i] = fib[i-1]+fib[i-2];
}
int d, k; scanf("%d%d",&d,&k);
int cnt[2];
if( d == 1 ){
cnt[0] = 1; cnt[1] = 0;
}
else if( d == 2 ){
cnt[0] = 0; cnt[1] = 1;
... | ALGO | 0.999978 | 3.659864 |
8031c34a-f7b4-4e09-a530-342b5892b132 | f4t4nt/competitive-programming | archive/CodeForces/Gym/Nanjing19/chessboard.cpp | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef string str;
typedef char ch;
typedef long double ld;
#define pb push_back
#define elif else if
#define sz(C) (ll) C.size()
#define all(C) C.begin(), C.end()
#define fliip(C) reverse(all(C))
#define ssort(C) sort(all(C))
#define FOR(x, e) fo... | ALGO | 0.999967 | 4.903301 |
2eda7470-1912-49c4-b8b6-cf709f3531fd | Ko-GyeongTae/algorithm | DP/15489.cpp | // https://www.acmicpc.net/problem/15489
#include <iostream>
using namespace std;
int pascal[31][31], R, C, W;
long long sum = 0;
int main()
{
pascal[0][0] = 1;
for (int i = 1; i <= 30; i++)
{
pascal[i][0] = 1;
pascal[i][i] = 1;
for (int j = 1; j < i; j++)
pascal[i][j]... | ALGO | 0.999972 | 4.385979 |
2baa22f2-4aff-493f-b82b-88bd813bbae5 | Long9Ngon/CTDL-GT | 9_duyetDoThi/chuaLamDuoc/ketBan.cpp | // <><> NEVER GIVE UP <><>
// design by CAN NGOC BINH
#include<bits/stdc++.h>
using namespace std;
#define pb push_back
#define ll long long
#define endl '\n'
#define mp make_pair
#define mt make_tuple
#define f first
#define s second
#define eb emplace_back
#define pii pair<int, int>
#define pll pair<ll, ll>
#defin... | ALGO | 0.999918 | 4.554876 |
14f06d96-348f-4374-9545-4b026c12c5f0 | lihzxs/LouGuOJCode | cpp/P2818.cpp | /////////////////////////////////////////////
//
// FileName : First.cpp
// Creator : Fm
// Date : 2019-10-18 20:56
// Comment : OJ(P2818)
//
///////////////////////////////////////////
//#include "pch.h"
#include <iostream>
#include <stdio.h>
#include <stdlib.h>
#include <algorithm>
#include <math.h>
#include <st... | ALGO | 0.999681 | 3.870878 |
031f2bb8-b168-4d80-a878-a812b7b68676 | antzforward/littlepandaIDE_Exams | DailyPractice/2006ZJ_IIC/Code02/main.cpp | #include <iostream>
#include<iomanip>
using namespace std;
double fact(int k)
{
double result = 0.0;
double nsteps = 1.0;
for( int i=1;i<=k;i++)
{
nsteps /= i;
result += nsteps;
}
return result;
}
int main(int argc, char** argv) {
int n=1;
cin>>n;
cout<<"sum="<<fixed<<setprecision(5)<<fact(n);
return 0;
... | ALGO | 0.999881 | 3.629657 |
f1d2dd77-e0c5-4bc5-9392-46c57baba9f9 | lys8325/boj_study | 01110/main.cpp | #include <cstdio>
int getFirst(int tmp){
return tmp / 10;
}
int getSecond(int tmp){
return tmp % 10;
}
int main() {
int n, tmp, next, cnt = 0;
scanf("%d", &n);
next = n;
while(true){
tmp = getFirst(next) + getSecond(next);
++cnt;
next = getSecond(next)*10 + getSecond(... | ALGO | 0.999799 | 3.898671 |
822b2966-eef5-4e6d-99f4-8a3a3746ea26 | diana389/PA-lab | problems/maximum_battery.cpp | #include <bits/stdc++.h>
using namespace std;
#define NMAX 5005
int main() {
/* Enter your code here. Read input from STDIN. Print output to STDOUT */
int n;
std::cin >> n;
std::vector<int> important_meetings;
int battery = 0;
for (int i = 0; i < n; ++i) {
int type, ... | ALGO | 0.999749 | 4.151344 |
f0d6410a-41d8-4454-8050-7f8654af0c7a | alibaba/nann | blaze-benchmark/thirdparty/boost_1_53_0/libs/graph/example/adjacency_matrix.cpp | int main()
{
using namespace boost;
enum { A, B, C, D, E, F, N };
const char* name = "ABCDEF";
// A directed graph
typedef adjacency_matrix<directedS> Graph;
Graph g(N);
add_edge(B, C, g);
add_edge(B, F, g);
add_edge(C, A, g);
add_edge(C, C, g);
add_edge(D, E, g);
add_edge(E, D, g);
add_ed... | ALGO | 0.96789 | 5.275048 |
23357469-d888-4848-ac19-03df24dbbb6a | ujjawalpatidar025/Striver-DSA-Series | Bit Manipulation/Bit manipulation 1.cpp | class Solution {
public:
void bitManipulation(int num, int i) {
// your code here
int mask=1<<(i-1);
cout<< bool(num & mask) <<" "<<(num | mask)<<" "<<(~mask & num);
}
}; | ALGO | 0.990443 | 3.27064 |
b6abae9e-3284-4a94-b92c-bfd662eadfe6 | Bhumika2903/placement_preperation-DSA- | BasicMaths/GCD_Euclidean.cpp | #include <iostream>
#include<bits/stdc++.h>
using namespace std;
int main() {
int n1,n2;
cin>>n1>>n2;
while(n1>0&&n2>0){
if(n1>n2){
n1=n1%n2;
}
else{
n2=n2%n1;
}
}
if(n1==0){
cout<<n2;
}
else{
cout<<n1;
}
return 0;
} | ALGO | 0.99991 | 3.285841 |
2da6f42c-4794-4160-8e11-936854ecf78b | shailpujan88/leetcode-daily-question | 0987-vertical-order-traversal-of-a-binary-tree/0987-vertical-order-traversal-of-a-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.999994 | 5.997568 |
c299fe9e-1ef7-4d91-b8ab-899980ef6071 | Rakesh2908/Leetcode | 61-rotate-list/rotate-list.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* rotateRight... | ALGO | 0.999972 | 5.992697 |
cc3c1b40-3a20-4615-93cb-180be6ebd896 | atheerabed/gnash-fork | libmedia/MediaParser.cpp | #include "MediaParser.h"
#include "log.h"
#include "GnashSleep.h" // for usleep.
#include <boost/bind.hpp>
// Define this to get debugging output from MediaParser
//#define GNASH_DEBUG_MEDIAPARSER
namespace gnash {
namespace media {
MediaParser::MediaParser(std::auto_ptr<IOChannel> stream)
:
_parsingComplete(fals... | TOOL | 0.850997 | 6.212065 |
739ab712-fd99-49df-b7ba-4262537e5bba | AHAAkash/Beecrowd | Beginner/1006 Average 2.cpp | #include <iostream>
#include <iomanip>
using namespace std;
int main() {
double A, B, C;
cin >> A >> B >> C;
double MEDIA = (A * 2 + B * 3 + C * 5) / 10.0;
cout << fixed << setprecision(1);
cout << "MEDIA = " << MEDIA << endl;
return 0;
}
| ALGO | 0.999659 | 4.542707 |
cc45c9f5-b623-4cf8-89db-3d4217a19bc5 | semvlu/cppnote | W06(Operator)/02/main.cpp | #include "PrimeNumber.h"
#include <iostream>
using namespace std;
int main()
{
PrimeNumber p1, p2(13);
PrimeNumber a = ++p1;
PrimeNumber b = p2++;
cout << a.get() << endl;
cout << p1.get() << endl;
cout << b.get() << endl;
cout << p2.get() << endl;
return 0;
}
| TOOL | 0.910222 | 3.535829 |
a9f2507b-30dc-4556-b6b1-998940fc301d | test-lhy/new_my_stl | bst_test.cpp | //
// Created by lhy on 24-9-16.
//
#include "binary_search_tree.h"
#include <cassert>
int main() {
using namespace lhy;
// Create a Binary Search Tree
BinarySearchTree<int> bst;
// Insert some values
bst.insert(10);
bst.insert(5);
bst.insert(15);
bst.insert(10); // Duplicate insertion, should update... | TEST | 0.992052 | 7.582388 |
6466d658-2005-46cd-9a02-7a6c969836c4 | jroopam/aoc_2023 | day_02.cpp | #include<bits/stdc++.h>
#include<regex>
using namespace std;
vector<string> split(string inp, char del) {
stringstream ss(inp);
string word;
vector<string> res;
while(!ss.eof()) {
getline(ss, word, del);
res.push_back(word);
}
return res;
}
int solve(string &inp) {
int id;... | ALGO | 0.986471 | 4.440813 |
44248da4-d6a8-4380-b441-9f8a1558afcb | jarikomppa/speccy | mazeract/tool/map.cpp | #include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <math.h>
#include "well512.h"
WELL512 gRand;
int map[8*8*8];
int floodmap[8*8*8];
int mapdifficulty = 0;
void printmap(int seed, int keys)
{
int i, j, k;
printf("// Map difficulty %d, seed %d, %d keys\n", mapdifficulty, seed, keys);
for (i = 0; ... | ALGO | 0.988664 | 3.927933 |
23b9738f-c113-4345-a7d2-9432ca274275 | lwgboy/Device-Testing | No65-68_Password Management (firmware-mod-kit)/src/others/squashfs-3.3-lzma/CPP/7zip/UI/Common/SortUtils.cpp | // SortUtils.cpp
#include "StdAfx.h"
#include "SortUtils.h"
#include "Common/Wildcard.h"
static int CompareStrings(const int *p1, const int *p2, void *param)
{
const UStringVector &strings = *(const UStringVector *)param;
return CompareFileNames(strings[*p1], strings[*p2]);
}
void SortFileNames(const UStringVec... | TOOL | 0.899756 | 6.469475 |
9b975428-030d-41c0-a012-5b783ae0ff42 | LouisNguyen25/NGCP_Software_2021_2022 | opencv-master/samples/cpp/videocapture_gphoto2_autofocus.cpp | #include <cstdlib>
#include <cstdio>
#include <iostream>
#include <algorithm>
#include <opencv2/core.hpp>
#include <opencv2/imgproc.hpp>
#include <opencv2/highgui.hpp>
using namespace std;
using namespace cv;
const char * windowOriginal = "Captured preview";
const int FOCUS_STEP = 1024;
const int MAX_FOCUS_STEP = 327... | TOOL | 0.995765 | 5.907455 |
6dcf8ec2-fd96-42e6-86c0-7a729f7acc45 | arpan-eee/Algorithm | Feroz Vai/Graph- Practice/Labyrinth.cpp | #include<bits/stdc++.h>
using namespace std;
typedef pair<int,int> pii;
const int N = 1e3+10;
vector<string> g;
int visited[N][N];
int level[N][N];
pii parent[N][N];
int n,m;
vector<pii> direc = {{0,-1},{0,1},{-1,0},{1,0}};
bool isValid(int i, int j)
{
return (i>=0 && i<n && j>=0 && j<m);
}
void bfs(int si, int sj)... | ALGO | 0.99999 | 3.788376 |
be3255e7-a90c-4b78-ae2e-cfbefc9a6b4c | ishandutta2007/codeforces | 18michael/normal/643/G.cpp | #include<bits/stdc++.h>
using namespace std;
int n,m,p;
int a[150002];
typedef pair<int,int> P;
inline int lson(int x)
{
return (x<<1);
}
inline int rson(int x)
{
return ((x<<1)|1);
}
struct SegTree
{
int laz[600002],len[600002];
vector<P> vec[600002];
inline vector<P> merge(vector<P> a,vector<P> b)
{
int t;
... | ALGO | 0.999976 | 3.743393 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.