uuid string | repo_name string | relative_path string | content string | category string | algo_rel_score float64 | quality_score float64 |
|---|---|---|---|---|---|---|
6cd93b11-385b-4966-9b93-a48f2c2e5133 | Nanored4498/Texture-Synthesis | src/filter.cpp | #include "filter.hpp"
#include <cmath>
#define uchar unsigned char
#define Complex std::complex<double>
#define VC std::vector<Complex>
#define VVC std::vector<VC>
void average(uchar* in, uchar* out, int size, int W, int H) {
for(int i = 0; i < W; i++) {
for(int j = 0; j < H; j++) {
int miX = std::max(0, i - si... | ALGO | 0.994966 | 5.020931 |
16c68afc-c834-4c6f-9ed2-d4d0ee51ecc5 | chetanmajithiya/ardupilot2 | libraries/AP_Landing/AP_Landing_Slope.cpp | /*
* AP_Landing_Slope.cpp - Landing logic handler for ArduPlane for STANDARD_GLIDE_SLOPE
*/
#include "AP_Landing.h"
#include <GCS_MAVLink/GCS.h>
#include <AP_HAL/AP_HAL.h>
#include <AP_LandingGear/AP_LandingGear.h>
#include <AP_AHRS/AP_AHRS.h>
#include <AP_GPS/AP_GPS.h>
#include <AP_Logger/AP_Logger.h>
#if define... | TOOL | 0.976159 | 3.352671 |
c3931b50-f791-4e35-82e2-c84faff8c4bd | nutboltu/programming-problem-solutions | uva.online.judge/10696 - f91.cpp | #include<stdio.h>
int main()
{
long int N;
while(true)
{
scanf("%ld",&N);
if(N==0) break;
if(N<=100) printf("f91(%ld) = 91\n",N);
else printf("f91(%ld) = %ld\n",N,N-10);
}
}
| ALGO | 0.998764 | 3.110222 |
9e944304-6787-4b60-bef8-fecbdd480102 | tail95/CPP_FromScratch | Chapter11/Chap11_ex06.cpp | #include<iostream>
#include<cmath>
using namespace std;
int main() {
cout.setf(ios::left);
cout.width(15);
cout << "Number";
cout.width(15);
cout << "Square";
cout.width(15);
cout << "Square Root" << endl;
for (int i = 0; i < 10; i++) {
int number = i * 5;
cout.fill('_');
cout.width(15);
cout << number... | ALGO | 0.99802 | 3.403027 |
c2a41540-090f-4d7f-bf9b-c49613791dc4 | phuocvinh143/Data-Structure | CTDL_LIST_ARRAY.cpp | #include<bits/stdc++.h>
#define MaxLength 107
#define oo 1000000007
using namespace std;
typedef int ElementType;
typedef int Position;
typedef struct{
ElementType Elements[MaxLength];
int Last = 0;
} List;
void INSERT_LIST(ElementType x, Position p, List &L) {
if (L.Last == MaxLength) cout << "Danh s... | ALGO | 0.999912 | 3.678128 |
bbd1eeb1-1fb2-43ee-8479-a5ee53bc3d0c | fr3ak2402/GalaxySlicer | src/libigl/igl/copyleft/cgal/submesh_aabb_tree.cpp | template<
typename DerivedV,
typename DerivedF,
typename DerivedI,
typename Kernel>
IGL_INLINE void igl::copyleft::cgal::submesh_aabb_tree(
const Eigen::PlainObjectBase<DerivedV>& V,
const Eigen::PlainObjectBase<DerivedF>& F,
const Eigen::PlainObjectBase<DerivedI>& I,
CGAL::AABB_tree<
CGAL::AABB_tra... | ALGO | 0.981683 | 7.851127 |
048a022a-d77a-427e-9c4b-d663269eb1ed | jesica-lgr/Heat-Equation-Solver | CGSolver.cpp | #include <cmath>
#include <fstream>
#include <iostream>
#include <iomanip>
#include <vector>
#include <sstream>
#include "CGSolver.hpp"
#include "matvecops.hpp"
/* Solve Ax = b using the Conjugate Gradient method. */
int CGSolver(std::vector<double> &val,
std::vector<int> &row_ptr,
std::v... | ALGO | 0.999413 | 3.945717 |
162f2675-6e9a-4100-85cb-4ceac1303444 | kwang-12/ros_basalt | thirdparty/eigen-3.4.0/bench/benchVecAdd.cpp |
#include <iostream>
#include <Eigen/Core>
#include <bench/BenchTimer.h>
using namespace Eigen;
#ifndef SIZE
#define SIZE 50
#endif
#ifndef REPEAT
#define REPEAT 10000
#endif
typedef float Scalar;
__attribute__ ((noinline)) void benchVec(Scalar* a, Scalar* b, Scalar* c, int size);
__attribute__ ((noinline)) void be... | TOOL | 0.889785 | 5.111393 |
37542ef8-955b-4764-b4f6-4fc9b873a05d | todorokishotoua15/CP-Library | ch.cpp | #include<bits/stdc++.h>
using namespace std;
#ifndef ONLINE_JUDGE
#include "debug.h"
#else
#define debug(x...)
#endif
#define int int64_t
#define ll long long
#define nl "\n"
#define FOR(i,b,c) for (int i = b; i < c; i++)
const int32_t MAXN = 4e6+1;
const int32_t eps = 1e-6;
const int N = 2e5+5;
const int M = 27*3+... | ALGO | 0.99972 | 5.306909 |
5e2413d0-9e7c-4b69-8903-de8e5118bb0e | EshaThakur88/DSA_Practice_Cpp | vec_of_pairs.cpp | #include <bits/stdc++.h>
using namespace std;
int main(){
//each vector element consists of a pair.
int n;
cout<<"Number of elements in vector: ";
cin>>n;
cout<<endl;
int x; string y;
vector<pair<int, string> > vp;
//Input loop
for(int i=0; i<n; i++){
cout<<"Enter element a... | TOOL | 0.920211 | 4.188918 |
17b938d3-6c32-4019-8b9c-97aef337638e | amity874/DsaInteviewPrep | BasicDsa/Recursion/Lecture3/printLexico.cpp | #include<bits/stdc++.h>
//#include<ext/pb_ds/assoc_container.hpp>
//using namespace __gnu_pbds;
using namespace std;
#define ll long long int
#define ld long double
#define mod 1000000007
#define inf 1e18
#define endl "\n"
#define pb emplace_back
#define vi vector<ll>
#... | ALGO | 0.999915 | 4.854146 |
b04565e9-c7be-46c3-9be4-5e95f265d512 | raincross7/code-similarity | codes/train_code/problem276/problem276_367.cpp | #include<bits/stdc++.h>
using namespace std;
int main(){
int A, B, M;
cin >> A >> B >> M;
int Mina=1000000, Minb=1000000;
vector<int> a(A), b(B), x(M), y(M), c(M);
for(int i=0; i<A; i++){
cin >> a.at(i);
Mina=min(Mina, a.at(i));
}
for(int i=0; i<B; i++){
cin >> b.at(i);
Minb=min(Minb, b.a... | ALGO | 0.999935 | 3.887379 |
5870db43-811e-4b4c-af18-2d2d8b16fe64 | NMokshithReddy/Data-Structures-Lab | Data Structures Lab/Lab 4/singly2 (2).cpp | #include <cstdio>
#include <cstdlib>
using namespace std;
// Node structure
struct Node {
int data;
Node* next;
};
// List class
class List {
private:
Node* head;
Node* tail;
public:
List();
void insertBeginning(int value);
void insertEnd(int value);
void insertPosition(int value, int ... | ALGO | 0.997428 | 4.806966 |
c7a2a5c4-a712-4b34-902a-ccfab36b62c6 | sasank-chindirala/COS568-LI-SP25-Final | competitors/finedex/masstree_benchmark.cpp | #include <iostream>
#include "include/function.h"
#include "learnedindex/masstree.h"
#include "learnedindex/masstree_impl.h"
struct alignas(CACHELINE_SIZE) ThreadParam;
typedef ThreadParam thread_param_t;
typedef FINEdex::Masstree<key_type, val_type> masstree_type;
volatile bool running = false;
std::atomic<size_t> ... | TOOL | 0.932153 | 4.478072 |
13c91b7a-fa17-4a78-ba1b-edf607bd9337 | ctrlabhi/Deribit-Using-CPP | src/utils.cpp | #include <iostream>
#include <sstream>
#include <iomanip>
#include "utils.h"
#include <chrono>
#include <time.h>
#include <openssl/hmac.h>
#include <openssl/evp.h>
#include "json.hpp"
#ifdef _WIN32
#include <conio.h>
#else
#include <termios.h>
#include <unistd.h>
#endif
using json = nlohmann::json;
void utils::pri... | TOOL | 0.908786 | 4.729764 |
997a0b62-cdf1-4454-b144-91f6c21bb35e | Jendosek/02.11 | task1/MapExamples.cpp | #include <iostream>
#include <string>
#include <map>
#include <sstream>
#include <cctype>
using namespace std;
class WordCounter {
private:
map<string, int> wordFrequency;
string cleanWord(const string& word) {
size_t start = 0;
while (start < word.length() && ispunct(word[start])) {
... | TOOL | 0.940037 | 6.209113 |
bd8aa265-a7ba-4e73-923f-fc00d3852ef6 | oceanbase/oceanbase | src/sql/rewrite/ob_transform_decorrelate.cpp | #define USING_LOG_PREFIX SQL_REWRITE
#include "sql/rewrite/ob_transform_decorrelate.h"
#include "sql/rewrite/ob_transform_utils.h"
#include "sql/optimizer/ob_optimizer_util.h"
namespace oceanbase {
namespace sql {
/**
* @brief decorrelate lateral derived table
*
* 1. decorrelate normal lateral derived table or can c... | ALGO | 0.946107 | 5.982952 |
787ad38a-7839-418f-a464-05449ad3ec4e | mquang279/DSA | 01. Array/mangdoixung.cpp | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
int main(){
ios_base::sync_with_stdio(false);
cin.tie(NULL);cout.tie(NULL);
int n;
cin >> n;
int a[n];
for (int i = 0; i < n; i++){
cin >> a[i];
}
for (int i = 0; i < n / 2; i++){
if (a[i] != a[n - i -... | ALGO | 0.999987 | 4.240183 |
1764f728-75b5-4069-a491-86c7a2d2de08 | ToshihideMatsuda/atcoder | programs/other/鉄則本/A/A30.cpp | #include <bits/stdc++.h>
#include <unordered_map>
using namespace std;
typedef long long ll;
#define rep(i,n) for(ll i = 0; i < n; i++ )
#define reps(i,m,n) for(ll i = m; i < n; i++ )
#define rev(i,n) for(ll i = n; i > -1; i--)
#define revs(i,m,n) for(ll i = m; i > n; i--)
#define MAX(a,b) (a>b?a:b)
... | ALGO | 0.999974 | 5.690126 |
7cfbc03e-eccf-4333-aff1-4be81c72145f | priyankjairaj100/Codeforces-Solutions | contest/1091/a/47740587_wrong_answer_3.cpp | #include <bits/stdc++.h>
using namespace std;
typedef long long LL;
typedef long double LD;
const int MAX = 1e5 + 5;
const int MOD = 1e9 + 7;
const LD EPS = 1e-10;
const LD PI = acos(-1.0);
#define fastio ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL);
#define rep(i,a,b,d) for(LL i = a; i<=b; i+=d... | ALGO | 0.999443 | 3.504892 |
c7f3e926-7f4f-47fb-9b3a-4ca37fc4a732 | ChampInMyThought/Leagues_of_Code_TH | 1 - Arithmetic (C++)/L.cpp | #include <bits/stdc++.h>
using namespace std;
int main()
{
int M;
cin >> M;
cout << M/60 << "\n" << M%60;
}
/*
Digital Clock
107
1
47
*/ | ALGO | 0.959401 | 4.63074 |
ffc4a44f-1cc9-44be-93e6-1f69de810ecb | aoles/EBImage | src/thresh.cpp | #include "thresh.h"
#include "tools.h"
#include <R_ext/Error.h>
#define BG 0
#define FG 1
template <class T> void _thresh(T *, int *, int, int, int, int, double);
/*----------------------------------------------------------------------- */
SEXP
thresh (SEXP x, SEXP param) {
int nx, ny, nz, dx, dy, i, sizexy, sh... | ALGO | 0.995706 | 6.786038 |
4821ff01-04f7-4125-b250-aac52cafd79b | qap2102/DSA-PTIT | DSA02006 DAY CON CO TONG BANG K.cpp | #include <bits/stdc++.h>
using namespace std;
#define faster \
ios::sync_with_stdio(false); \
cin.tie(0); \
cout.tie(0);
#define ll long long
#define fi first
#define se second
const int MOD = 1e9+7;
const int N=1e6+5;
vector<int> v;
vector<vector<int>> vv;
int a[1005];
i... | ALGO | 0.999713 | 4.418153 |
030baa8d-0d03-47b7-ba37-eada093f9c66 | raincross7/code-similarity | codes/train_code/problem497/problem497_52.cpp | #define DEBUG
// #define FASTIO
#include <cassert>
#include <utility>
#include <iostream>
#include <cstdio>
#include <iomanip>
#include <bitset>
#include <chrono>
#include <cstdlib>
#include <functional>
#include <tuple>
#include <climits>
#include <limits>
#include <deque>
#include <list>
#include <array>
#include <s... | ALGO | 0.999945 | 3.448232 |
9c1565ff-ee53-4519-9d1d-438f4e2e91db | a-pinch/andrewtroyan | C++/Exam/Deals/Deals/main.cpp | #include "Corporation.h"
#include <iostream>
#include <algorithm>
#include <stdexcept>
using std::cout;
using std::cin;
using std::endl;
using std::for_each;
using std::invalid_argument;
int main() {
try {
Corporation fruit_company("Fruit Inc.", 1999);
cout << "Name: " << fruit_company.get_name() << endl << "Fo... | TOOL | 0.925539 | 6.673603 |
2935a38b-2f19-41d1-b8f8-fe33c5658ac1 | godnoTA/acm.bsu.by | 4. Алгоритмы на графах/66.2. Канонический вид (по матрице смежности) #3564/[OK]160990.cpp | #include <iostream>
#include <fstream>
using namespace std;
int main()
{
ifstream fin("input.txt");
ofstream fout("output.txt");
if (fin.is_open())
{
int N = 0;
fin >> N;
int* P = new int[N];
for (int i = 0; i < N; i++)
P[i] = 0;
for (int i = 0; i < N; i++)
for (int j = 0; j < N; j++)
{
in... | ALGO | 0.999121 | 3.090206 |
ed5e88fc-ff84-44d3-bbc4-897299ea807f | aBBassam/CP-Solutions | CodeForces/GNU C++20 (64)/1669B | Triple/154601218.cpp | // Problem: B. Triple
// Contest: Codeforces - Codeforces Round #784 (Div. 4)
// URL: https://codeforces.com/contest/1669/problem/B
// Memory Limit: 256 MB
// Time Limit: 1000 ms
//
// Powered by CP Editor (https://cpeditor.org)
#include <bits/stdc++.h>
#define ll long long
#define all(x) x.begin(),x.end()
#define a... | ALGO | 0.999943 | 4.063063 |
4602a5b9-5202-4c07-8f61-21ce96da4a33 | ankitc248/Spoj-Solutions | AE00.cpp | /*
AE00 - RECTANGLES
SOLUTION BY RAMAN SHARMA
*/
#include <bits/stdc++.h>
using namespace std;
int main() {
int n;
scanf("%d",&n);
int ans=0;
int x=sqrt(n);
for(int i=1; i<=x; i++){
ans+=n/i-(i-1);
}
printf("%d",ans);
return 0;
}
| ALGO | 0.999726 | 3.78747 |
929a4a1d-5d83-4584-aa37-e4a00ded3126 | leeseojune53/TIL | C_Learn/BOJ/BOJ.2798/main.cpp | #include <iostream>
using namespace std;
int main()
{
int n,max=0,M;
cin >> n >> M;
int *arr=new int[n];
for(int i=0;i<n;i++)
cin >> arr[i];
for(int i=0;i<n-2;i++){
for(int j=i+1;j<n-1;j++){
for(int k=j+1;k<n;k++){
if(max<arr[i]+arr[j]+arr[k]&&arr[i]+arr... | ALGO | 0.999978 | 3.796724 |
a0ec224a-84dc-40f2-a27b-5f5acad51847 | deepak-s-git/STRIVE-x-LEETCODE | Maximum-Subarray.cpp | // Problem: Find the contiguous subarray (with at least one number) that has the largest sum.
// Best Approach: Kadane's Algorithm — keep track of current subarray sum, and update the max seen so far.
// If current sum becomes negative, reset it to 0 (because a negative sum can't help future subarrays).
class Solutio... | ALGO | 0.999972 | 7.183805 |
3a365b49-894a-440a-a5fa-87cbc495aa20 | xufuq/CppBase | myString/151.cpp | #include "../utils.h"
string reverseWords(string s) {
while (s.back() == ' ') {
s.pop_back();
}
int n = s.size(), start = 0;
for (int i = n - 1; i > 0; --i) {
if (s[i] == ' ' && s[i - 1] == ' ') {
s.replace(i, 1, "");
}
}
n = s.size();
if (n > 0 && s[0] == ' ') {
s.replace(0, 1, "");... | ALGO | 0.999849 | 4.997125 |
5c42c420-493c-4cbd-8bf8-2ccad96ebb3d | Ricxel/PROGRAMMAZIONE_1 | SIMULAZIONI/soluzioni-20230619/es1/esercizio1.cpp | #include<iostream>
#include<fstream>
#include<cstring>
#include<cmath>
using namespace std;
// è possibile definire funzioni di supporto
void shift_string(char *, char *, int);
int conta_occorrenze(char *, char *);
const int DIM = 256;
int main(int argc, char * argv []) {
if(argc != 2){
cout << "Parametri non ... | ALGO | 0.980158 | 4.246113 |
35422e8e-f938-4195-b438-1e859dfae960 | ehnryx/acm | asc12-cf100215/e.cpp | //#pragma GCC optimize("O3")
//#pragma GCC target("sse4,avx2,abm,fma,tune=native")
#include <bits/stdc++.h>
using namespace std;
#define _USE_MATH_DEFINES
#define FILENAME "fool"
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
using namespace __gnu_pbds;
template <typename T>
using order... | ALGO | 0.998842 | 5.745619 |
dfa68129-e72c-4fcc-90d3-eebe3c87427b | suu3/Algorithm | 2022/programmers/해시/unfinished_player.cpp | #include <string>
#include <vector>
#include <set>
using namespace std;
string s_answer(multiset<string> pc, multiset<string> cp){
string answer = "";
for(auto iter = cp.begin(); iter!=cp.end(); iter++){
multiset<string>::iterator it = pc.find(*iter);
pc.erase(it);
}
return *pc.begin();
}
st... | ALGO | 0.999679 | 5.388729 |
bb3cdd7c-65df-406b-bd9f-0e99b6001552 | sxu39/TP-RPMD | lammps-stable_2Aug2023_update2/src/pair_coul_long.cpp | /* ----------------------------------------------------------------------
Contributing author: Paul Crozier (SNL)
------------------------------------------------------------------------- */
#include "pair_coul_long.h"
#include "atom.h"
#include "comm.h"
#include "error.h"
#include "force.h"
#include "kspace.h"
#i... | ALGO | 0.964631 | 5.172718 |
1573b9be-c57e-47ab-ac84-ad9abe7a0202 | ishandutta2007/codeforces | tdpencil/normal/1174/C.cpp | #include <bits/stdc++.h>
//#include <ext/pb_ds/assoc_container.hpp>
//#include <ext/pb_ds/tree_policy.hpp>
//#include <iterator>
#pragma GCC optimize("Ofast") // optimizes doubles + vectors
//using namespace __gnu_pbds;
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
const int MAXN = 1e5, M ... | ALGO | 0.999886 | 3.580795 |
01f1ee60-ac5c-4018-8399-2443d05daa88 | rsrahulsalunkhe/DAA-Practical | union.cpp | #include <iostream>
#include <vector>
using namespace std;
const int MaxSize = 100;
vector<int> parent(MaxSize, -1);
int FIND(int i) {
int j = i;
while (parent[j] > 0) {
j = parent[j];
}
int k, t;
while (i != j) {
k = i;
t = parent[k];
parent[k] = j;
i = t;... | ALGO | 0.997325 | 5.136272 |
8c08d293-e280-4a01-920e-6f2970d1631e | wjing6/fargraph-rdma | client/gridgraph-client-2/examples/pagerank.cpp | #include "core/graph.hpp"
int main(int argc, char ** argv) {
if (argc<3) {
fprintf(stderr, "usage: pagerank [path] [iterations] [memory budget in GB]\n");
exit(-1);
}
std::string path = argv[1];
int iterations = atoi(argv[2]);
long memory_bytes = (argc>=4)?atol(argv[3])*1024l*1024l*1024l:1024l*1024l;//8l*1024... | ALGO | 0.999316 | 4.651389 |
0213550d-89b7-42ea-9375-880f72f25821 | rwightman/boost | libs/graph/example/edge-function.cpp | using namespace boost;
template < typename Graph, typename VertexNamePropertyMap > void
read_graph_file(std::istream & graph_in, std::istream & name_in,
Graph & g, VertexNamePropertyMap name_map)
{
typedef typename graph_traits < Graph >::vertices_size_type size_type;
size_type n_vertices;
typena... | ALGO | 0.963453 | 5.35629 |
4dac51ae-7f92-45a6-b3d6-85976665d6a5 | MoOo2mini/SSUalgo | 한서윤/알고리즘 기초 1/자료구조 1/10828_stack.cpp | #include <iostream>
#include <string>
#include <vector>
#include <algorithm>
#include <stack>
using namespace std;
int main(void) {
cin.tie(NULL);
ios_base::sync_with_stdio(0);
stack<int> s;
int n;
cin >> n;
for (int i = 0; i < n; i++) {
string input;
cin >> input;
if (!input.compare("push")) {
int x;
... | ALGO | 0.998574 | 4.453644 |
fe973698-19c6-4447-bc0e-8ea29137f600 | ishandutta2007/codeforces | lych_cys/normal/718/E.cpp | #include<bits/stdc++.h>
#define inf 1000000000
#define N 100009
#define M 309
using namespace std;
int n,cnt,mx,fst[9],nxt[N],a[N],b[M],c[9][M],h[N],d[N][9],f[9][9];
long long res; bool vis[N]; char ch[N];
void bfs(int c){
int head=0,tail=0,i,x,y;
for (i=1; i<=n; i++) if (a[i]==c){
d[i][c]=0; h[++tail]=i;
}
mems... | ALGO | 0.999978 | 3.449955 |
85725b61-d0b7-416a-a9f6-de48bc26a961 | guidumasperes/MC521 | placar2/parking/main.cpp | #include <iostream>
#include <vector>
#include <algorithm>
using namespace std;
int main() {
int i, j, n1, n2, min, max, dif, result;
vector<int> v;
cin >> n1;
for(i = 0; i < n1; i++) {
cin >> n2;
v.resize(n2);
for(j = 0; j < n2; j++) {
cin >> v[j];
}
... | ALGO | 0.998396 | 3.364706 |
94616f0e-2532-4374-8bd3-a22d6e503a69 | QUESTION-CODE-SOLUTION/DSA-IN-C-plusplus | ARRAY/EASY/GFG/Peak Element.cpp | // https://practice.geeksforgeeks.org/problems/peak-element/1/?category[]=Arrays&category[]=Arrays&difficulty[]=0&page=2&query=category[]Arraysdifficulty[]0page2category[]Arrays
// A peak element in an array is the one that is not smaller than its neighbours.
// Given an array arr[] of size N, find the index of any one... | ALGO | 0.999829 | 4.653789 |
28d06295-aa5f-4953-bd17-bd9ec1d8bbc1 | rajeevroy21/gfg160 | Day22.cpp | int hIndex(vector<int>& citations) {
// code here
sort(citations.rbegin(),citations.rend());
int i=0;
while(i<citations.size() && citations[i]>i)
i++;
return i;
}
| ALGO | 0.999917 | 5.512784 |
99f83315-506d-41ee-ad73-d5b813b9cccc | fast050/Problem_Solving | problem solving level 4/#4,1 Number to Text/#4,14 is two dates equals/#4,14 is two dates equals/#4,14 is two dates equals.cpp | #include <iostream>
using namespace std;
struct stDate {
short year;
short month;
short day;
};
int readNumber(string message) {
int number;
cout << message;
cin >> number;
return number;
}
stDate readDate() {
stDate date;
date.day = readNumber("Please enter a Day? ");;
dat... | ALGO | 0.999399 | 3.517433 |
e1703a61-4a78-4a6b-830e-46d74f8eaf82 | nausheen-ali/CPP | find_functions/find.cpp | #include <iostream>
#include <algorithm>
#include <vector>
using namespace std;
class Number
{
public:
int n;
Number(int n) : n(n) {}
bool operator==(const Number &num)
{
return (this->n == num.n);
}
};
int main()
{
vector<int> data = {9,8,7,5,4,3,2};
auto itfound = find(data.begin(), data.end()... | ALGO | 0.995512 | 4.202272 |
7aceb544-d4f4-41bd-ba72-731190cfce08 | MATEOMILNE/LABORATORIO_DEOBJETOS_MILNE | laboratorio obj/act 13-03-23/act 4.cpp | #include <stdio.h>
int num1, num2, i;
main()
{
printf("Ingrese el primer numero: ");
scanf("%d", &num1);
printf("Ingrese el segundo numero: ");
scanf("%d", &num2);
printf("Los numeros pares entre %d y %d son:\n", num1, num2);
for (i = num1; i <= num2; i++)
{
if (i % 2 =... | ALGO | 0.991522 | 3.484862 |
0ca21253-b2a9-45eb-b33a-857e13eede5f | Alex-Beng/ojs | FuckDataStructure/ZjuMooc/7-7 六度空间_dfs_te.cpp | #include <map>
#include <iostream>
using namespace std;
map<int, int> mmp;
bool used_node[2333];
int n, e;
int ans;
void dfs(int node, int layer);
void set_node(bool status);
int main(int argc, char const *argv[]) {
cin>>n>>e;
for (int i=0; i<e; i++) {
int node_1, node_2;
cin>>node_1>>node_2;... | ALGO | 0.999545 | 3.839751 |
93900791-8f90-46d6-a2df-a0ea21fc35c4 | Dev-RubinJo/AlgorithmCpp | AlgorithmC++/Algorithm/ProblemSolving/BaekJoon/Sort/2751-1.cpp | #include <iostream>
using namespace std;
void merge(int arr[], int sorted[], int m, int middle, int n) {
int i = m;
int j = middle + 1;
int k = m;
while (i <= middle && j <= n) {
if (arr[i] < arr[j]) {
sorted[k] = arr[i];
i += 1;
} else {
sorted... | ALGO | 0.999995 | 5.043375 |
d6a0e06d-9c3a-4c24-98de-5cc88b5f8a91 | NaoHTWK/HTWKVision | ellifit.cpp | #include "ellifit.h"
#include <algorithm>
using namespace std;
namespace htwk {
static float S[7][7];
static float L[7][7];
static float C[7];
static float invL[7][7];
void elli_init() {
for(int j=0;j<7;j++){
for(int i=0;i<7;i++){
S[j][i]=0;
L[j][i]=0;
invL[j][i]=0;... | ALGO | 0.99982 | 4.916863 |
267d8b1b-d592-4c5c-b848-a1dca178cd58 | microsoft/openjdk-jdk21u | src/hotspot/share/gc/g1/g1CodeRootSet.cpp | #include "precompiled.hpp"
#include "code/codeCache.hpp"
#include "code/nmethod.hpp"
#include "gc/g1/g1CodeRootSet.hpp"
#include "gc/g1/heapRegion.hpp"
#include "memory/allocation.hpp"
#include "oops/oop.inline.hpp"
#include "runtime/atomic.hpp"
#include "utilities/concurrentHashTable.inline.hpp"
#include "utilities/c... | TOOL | 0.85005 | 7.67897 |
47f1f409-0390-4759-aa93-bbf22c2c344d | piyush1way/Leetcode | 1421-find-numbers-with-even-number-of-digits/find-numbers-with-even-number-of-digits.cpp | class Solution {
public:
int findNumbers(vector<int>& nums) {
int count =0;
for(int num : nums){
int n = num;
int digit=0;
while(num!=0){
num/=10;
digit++;
}
if(digit%2==0){
count++;
... | ALGO | 0.99995 | 5.775864 |
5e26526b-4624-4368-bab7-66ac0d96e0ee | Bungmint/competitiveprogramming | contest/projectEuler/51.cpp | using namespace std;
using ll = long long;
using vi = vector<int>;
using pii = pair<int, int>;
using vpi = vector<pii>;
using pll = pair<ll, ll>;
using vl = vector<ll>;
using vpl = vector<pll>;
using ld = long double;
template <typename T, size_t SZ>
using ar = array<T, SZ>;
template <typename T>
using pqg = priority_... | ALGO | 0.998953 | 5.01338 |
b5093d01-0f86-4af1-9e21-c98d41dc9bb9 | ShabbirHasan1/samples-sandbox | DirectProgramming/DPC++/Jupyter/oneapi-essentials-training/04_DPCPP_Sub_Groups/lab/sub_group_votes.cpp | using namespace sycl;
static constexpr size_t N = 32; // global size
static constexpr size_t B = 16; // work-group size
int main() {
queue q;
std::cout << "Device : " << q.get_device().get_info<info::device::name>() << "\n";
//# initialize input and output array using usm
auto input = malloc_shared<int>(N, q... | ALGO | 0.986893 | 4.965453 |
87027921-f2be-4aff-94ff-9d01827f0cb4 | iRath96/focal-guiding | mitsuba/src/libcore/math.cpp | #include <mitsuba/mitsuba.h>
MTS_NAMESPACE_BEGIN
namespace math {
Float erfinv(Float x) {
// Based on "Approximating the erfinv function" by Mark Giles
Float w = -math::fastlog(((Float) 1 - x)*((Float) 1 + x));
Float p;
if (w < (Float) 5) {
w = w - (Float) 2.5;
p = (Float) 2.81022636e... | ALGO | 0.997267 | 6.783259 |
7a4de1fc-a4c7-4f24-8f41-4e3cd561c9b3 | kdurant/leetcode | cpp/!0055_canJump.cpp | #include <algorithm>
#include <iostream>
#include <vector>
using namespace std;
class Solution
{
public:
bool canJump(vector<int> &nums)
{
int len = nums.size();
vector<bool> dp(len, false);
dp[0] = true;
int i, j;
for(i = 1; i < len; i++)
{
... | ALGO | 0.999937 | 5.46652 |
e3ecd906-4cf5-498b-bc22-ed7de2b34587 | ADACS-Australia/RSienaTest | src/model/tables/TwoPathTable.cpp | /******************************************************************************
* SIENA: Simulation Investigation for Empirical Network Analysis
*
* Web: http://www.stats.ox.ac.uk/~snijders/siena/
*
* File: TwoPathTable.cpp
*
* Description: This file contains the implementation of the TwoPathTable
* class.
***... | ALGO | 0.925339 | 5.450663 |
5f47fa06-fa37-4fb8-9e47-22decb376b29 | Khetesh-Deore/DSA | Questions/05_String/01_Basics/_06Remove_All_Occurrences.cpp | // leetcode 1910
#include <bits/stdc++.h>
using namespace std;
string removeAllOccurance(string s,string part)
{
while(s.length()>0 && s.find(part)<s.length()){
s.erase(s.find(part),part.length());
}
return s;
}
int main()
{
string str,part;
cout << "Inter the string:" << endl;
getline(cin, str);
cout << "Int... | ALGO | 0.999099 | 4.808434 |
c4436d44-0863-4225-9780-3c02001a7a0b | ishandutta2007/codeforces | -is-this-fft-/normal/1320/B.cpp | #include <iostream>
#include <vector>
#include <queue>
using namespace std;
const int MAX_N = 2e5 + 5;
vector<int> adj [MAX_N];
int dist [MAX_N];
int sdist [MAX_N];
int nxt [MAX_N];
int main () {
ios::sync_with_stdio(false);
int n, m;
cin >> n >> m;
for (int i = 0; i < m; i++) {
int u, v;
cin >>... | ALGO | 0.999923 | 4.392716 |
91dbb2c1-cfd0-4373-90b0-c670eab66def | Vijaymalav/LeetCode-solution | Merge K sorted linked lists - GFG/merge-k-sorted-linked-lists.cpp | // { Driver Code Starts
// C++ program to merge k sorted arrays of size n each
#include <bits/stdc++.h>
using namespace std;
// A Linked List node
struct Node
{
int data;
Node* next;
Node(int x){
data = x;
next = NULL;
}
};
/* Function to print nodes in a given linked list */
void printList(Node* no... | ALGO | 0.999899 | 5.481777 |
8ad64cc8-d7fc-4829-bc09-68259efd89a0 | mewhz/OJ_problem | pta/到底买不买.cpp | //https://pintia.cn/problem-sets/994805260223102976/problems/994805283241443328
#include<bits/stdc++.h>
using namespace std;
int main(){
string a,b;
int c[300] = {0};
cin>>a>>b;
for(int i=0;i<a.length();i++){
c[a[i]]++;
}
int num = 0;
for(int i=0;i<b.length();i++){
if(c[b[i]]>0){
c[b[i]]--;
}
else{
... | ALGO | 0.999989 | 3.647283 |
af442b18-1f3a-4bf1-bb83-a650be588569 | h-atsu/roadtomizuiro | src/problem24.cpp | #include <iostream>
#include <algorithm>
#include <string>
#include <vector>
#include <set>
#include <cmath>
#include <stdio.h>
#include <list>
#include <numeric>
#include <stack>
#include <queue>
#include <tuple>
#include <bitset>
#include <map>
#include <math.h>
//ceil(a/b) (a + (b - 1))/ b
using namespace std;
#de... | ALGO | 0.99966 | 3.882399 |
19dba0b4-81a9-4553-b73b-51b58d59afc0 | 2019331099-Rabbi/Algorithms | Graphics/Lab5_CohenSutherland_RotatedWindow/main.cpp | #include<windows.h>
#ifdef __APPLE__
#include <GLUT/glut.h>
#else
#include <GL/glut.h>
#endif
#include <stdlib.h>
#include <bits/stdc++.h>
#define ld long double
#define f first
#define s second
#define limit 1e-6
using namespace std;
struct Point {
float x, y;
Point(float _x = 0, float _y = 0) : x(_x), y(_y)... | ALGO | 0.998832 | 5.190216 |
d814d510-4855-49f6-817d-583f1da0d7d5 | devahub/leetcode_problems | 0876-middle-of-the-linked-list/0876-middle-of-the-linked-list.cpp |
class Solution {
public:
ListNode* middleNode(ListNode* head) {
ListNode *slow=head;
ListNode *fast=head;
while(fast!=NULL && fast->next!=NULL)
{
slow=slow->next;
fast=fast->next->next;
}
return slow;
}
}; | ALGO | 0.999875 | 5.582479 |
3399972b-fb71-41a4-b381-1f6163309d97 | diohabara/competitive_programming | ac/prev/abc136_a.cpp | #include <bits/stdc++.h>
using namespace std;
#define ll long long
#define rep(i, n) for (ll i = 0; i < n; ++i)
#define ALL(a) a.begin(), a.end()
ll dx[4] = { 0, 1, 0, -1 };
ll dy[4] = { 1, 0, -1, 0 };
const ll INF = 1e14;
const ll MOD = 1e9 + 7;
int main()
{
ios_base::sync_with_stdio(false);
cin.tie(0);
//... | ALGO | 0.999813 | 3.978032 |
c2857c79-d57d-467c-b4b8-abac18a89640 | DimitraM/Game-Development | Library/PackageCache/com.unity.ide.visualstudio@2.0.22/Editor/COMIntegration/COMIntegration~/COMIntegration.cpp | #include <iostream>
#include <sstream>
#include <string>
#include <filesystem>
#include <windows.h>
#include <shlwapi.h>
#include <fcntl.h>
#include <io.h>
#include "BStrHolder.h"
#include "ComPtr.h"
#include "dte80a.tlh"
constexpr int RETRY_INTERVAL_MS = 150;
constexpr int TIMEOUT_MS = 10000;
// Often a DTE call m... | TOOL | 0.94874 | 6.933585 |
88ffc1e7-a76e-4f8e-ae3b-d5e185bcf74a | Tapesh-Vashisth/Leetcode_Solutions | 198_house_robber.cpp | #include <iostream>
#include <vector>
using namespace std;
// Idea: we maintain a dp array that contains the maximum loot till each index. At every index i, we make a choice
// whether loot till (i - 1)th house is greater or the loot of (i - 2)th house + current hosue i (since we can't take consecutive
// houses, we ... | ALGO | 0.999911 | 5.171486 |
22f83627-cdaf-4d6a-a32f-28dae55c9a49 | zhangty019/S3_DeformFDM | ThirdPartyDependence/eigen3/doc/examples/TutorialLinAlgExSolveColPivHouseholderQR.cpp | #include <iostream>
#include <Eigen/Dense>
using namespace std;
using namespace Eigen;
int main()
{
Matrix3f A;
Vector3f b;
A << 1,2,3, 4,5,6, 7,8,10;
b << 3, 3, 4;
cout << "Here is the matrix A:\n" << A << endl;
cout << "Here is the vector b:\n" << b << endl;
Vector3f x = A.colPivHouseholderQr... | ALGO | 0.999946 | 3.356631 |
eeeaafc9-43d1-4315-bb69-61d94ea871f6 | Time1ess/MyCodes | LeetCodeR3/700-Search in a Binary Search Tree/solution.cpp | /**
* Definition for a binary tree node.
* struct TreeNode {
* int val;
* TreeNode *left;
* TreeNode *right;
* TreeNode(int x) : val(x), left(NULL), right(NULL) {}
* };
*/
class Solution {
public:
TreeNode* searchBST(TreeNode* root, int val) {
if (root == nullptr || root->val == val)... | ALGO | 0.999993 | 6.343631 |
2a17b92d-9654-494d-a4d5-d639185c5497 | MatteoBouvier/aoc | 2024/src/day7/part1.cpp | #include <cmath>
#include <cstddef>
#include <cstdint>
#include <generator>
#include <iostream>
#include <string>
#include <vector>
void load_values(std::vector<uint64_t> &test_values,
std::vector<std::vector<uint64_t>> &numbers) {
for (std::string line; getline(std::cin, line);) {
uint c... | ALGO | 0.997501 | 5.784671 |
25fb2c14-5c04-42a3-ac7b-eb43b8820215 | sarvex/leetcode-odin | solution/1200-1299/1232.Check If It Is a Straight Line/Solution.cpp | class Solution {
public:
bool checkStraightLine(vector<vector<int>>& coordinates) {
int x1 = coordinates[0][0], y1 = coordinates[0][1];
int x2 = coordinates[1][0], y2 = coordinates[1][1];
for (int i = 2; i < coordinates.size(); ++i) {
int x = coordinates[i][0], y = coordinates[i]... | ALGO | 0.999938 | 5.68738 |
b78420ba-c9da-4564-b071-a583b1a01c34 | HttoHu/cpp_acm_practice | lab.cpp | #include <stdio.h>
template<int N,typename T>
int acount(const T (&arr)[N])
{
return sizeof(arr)/sizeof(T);
}
int main()
{
int arr[45];
printf("%d",acount(arr));
return 0;
} | ALGO | 0.872836 | 3.641769 |
7ef7480c-4315-4af1-a7b2-e948df63b485 | Trfgt/20.04auto | src/tracking_lib/samples/tracking_node.cpp | #include <pcl_conversions/pcl_conversions.h>
#include <ros/ros.h>
#include <tf/transform_listener.h>
#include <memory>
#include <sensor_msgs/JointState.h>
#include "common/msgs/autosense_msgs/PointCloud2Array.h"
#include "common/msgs/autosense_msgs/TrackingFixedTrajectoryArray.h"
#include "tracking_msg/TrackingObjectA... | DATA | 0.920071 | 6.588283 |
bfae553a-2669-4344-ab54-d8328112ad5f | atoughman/cp_solutions | Leetcode/longest_palindromic_substring.cpp | #include <bits/stdc++.h>
using namespace std;
class Solution
{
public:
pair<int, int> pal_check(string &s, int l, int r)
{
pair<int, int> p = {-1, -1};
while (l >= 0 and r < s.size() and s[l] == s[r])
{
p = {l, r};
--l;
++r;
}
return ... | ALGO | 0.999983 | 6.081822 |
60f1d5d8-69dc-461c-9762-4983654a4503 | nick1au/assignments-ensc351 | A5-SAT/draft1.cpp | #include <iostream>
#include <stdlib.h>
#include <fstream>
#include <vector>
#include <string>
#include "BinaryTree.h"
using namespace std;
void input_reader();
void read_into_vector(vector<int> vect);
void delete_temp_vector(vector<int>& vect);
void flush_compResult_vector();
void compare_result(vector<int> solution)... | ALGO | 0.998771 | 4.183761 |
2b6e1406-c370-4985-bbcf-b7da3543a765 | omnibor/llvm-omnibor | llvm-project/libcxx/test/std/algorithms/alg.sorting/alg.sort/sort/sort_constexpr.pass.cpp | // <algorithm>
// template<RandomAccessIterator Iter>
// requires ShuffleIterator<Iter>
// && LessThanComparable<Iter::value_type>
// void
// sort(Iter first, Iter last);
#include <algorithm>
#include <cassert>
#include "test_macros.h"
#include "test_iterators.h"
#include "MoveOnly.h"
template<int N, ... | TEST | 0.976514 | 7.300749 |
6bc0f9e0-22d0-4031-a39c-90e71a2fcab5 | boj-dgsw/ps | hekaline/boj/cpp/longest_bitonic_subarray-11054.cpp | // DP
// 가장 긴 증가하는 부분수열 길이 + 가장 긴 감소하는 부분수열 길이
// Gold IV
#include <iostream>
#include <vector>
using namespace std;
int n;
vector<int> arr;
void input();
int getBitonicArrayLength();
int main()
{
input();
cout << getBitonicArrayLength();
}
int getBitonicArrayLength()
{
vector<int> memo(n);
vector... | ALGO | 0.999964 | 4.905357 |
f0118ce2-1b2d-4a3d-abd5-7e4f66b3456c | Tukekehaohaonuli/algorithm | HDUOj/20173.cpp | #include<cstdio>
const int maxn=101;
char G[maxn][maxn];
char temp[maxn][maxn];
char g[maxn][maxn];
int m,n,s,t;
int ans;
bool isEqual(char G[maxn][maxn],int x,int y){
for(int i=0;i<s;i++){
for(int j=0;j<t;j++){
if(G[x+i][y+j]!=g[i][j])
return false;
}
}
return true;
}
void getTemp(char G[maxn][maxn],int ... | ALGO | 0.998965 | 3.645964 |
15fcff92-cf87-47c9-9c25-cfca45372fb4 | Gauri8889/DataStructure | selectionSort.cpp | #include<iostream>
using namespace std;
void selection(int arr[],int len)
{
int j;
for(int i=0;i<len;i++)
{
int chotu=i;
for(int j=i;j<len-1;j++)
{
if(arr[chotu]>arr[j+1])
{
chotu=j+1;
}
}
if(chotu!=i)
{
... | ALGO | 0.999983 | 4.089621 |
2d3fdd5e-ce8f-4ec1-a3b3-d66267335b04 | ishandutta2007/codeforces | receed/normal/1045/C.cpp | #include <cstdio>
#include <vector>
#include <string>
#include <iostream>
#include <algorithm>
#include <map>
#include <unordered_map>
#include <set>
#include <random>
#include <ctime>
#include <iomanip>
#include <deque>
#include <queue>
#include <cmath>
#include <cstring>
#include <cassert>
#include <bitset>
#incl... | ALGO | 0.999935 | 4.566627 |
7cf337f9-a5ff-4e3f-a2a0-8ab38415743d | an-sla/hse-algorithms-and-data-structures | Lecture 2_07.04.2022/HW 2/J.cpp | #include <iostream>
using namespace std;
const unsigned int MOD = 1e9 + 9;
int64_t gcd(int64_t a, int64_t b, int64_t &x, int64_t &y){
if (b == 0){
x = 1;
y = 0;
return a;
}
int64_t g = gcd(b, a % b, x, y);
x = x - (a / b) * y;
swap(x, y);
return g;
}
void solve(int64_t ... | ALGO | 0.999933 | 4.739378 |
92d522ba-b727-4824-8736-ad77ed0d0d5c | zeropool/Vigoth | C#/Research/QuantLib-1.8/ql/experimental/finitedifferences/bsmrndcalculator.cpp | /* -*- mode: c++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*! \file bsmrndcalculator.hpp
\brief risk neutral terminal density calculator for the
Black-Scholes-Merton model with constant volatility
*/
#include <ql/processes/blackscholesprocess.hpp>
#include <ql/math/distributions/n... | ALGO | 0.999632 | 7.907314 |
0038b597-4396-4ed6-9d80-affac7a33673 | ChooSeoyeon/ps-history | 프로그래머스/lv1/82612. 부족한 금액 계산하기/부족한 금액 계산하기.cpp | using namespace std;
/*
[문제 설명]
- 처음 이용료 : price원
- N번째 이용료 : price * N원
- count번 탔을 때 현재 갖고 있는 금액에서 얼마가 모자라는지 return
- 금액 안모자라면 0 return
[문제 접근]
- 반복문 혹은 가우스 공식 사용
- 조건연산자 사용 -> (조건식) ? 표현식1 : 표현식2;
*/
long long solution(int price, int money, int count)
{
long long sum=1LL*price*(count+1)*count/2;
return (mo... | ALGO | 0.999784 | 4.171155 |
cca99df4-60ad-4ae9-a2f1-88ee51946815 | ccw2010/lc | 65. Valid Number.cpp | /*65. Valid Number
Validate if a given string is numeric.
Some examples:
"0" => true
" 0.1 " => true
"abc" => false
"1 a" => false
"2e10" => true
string s1 = "0"; // True
string s2 = " 0.1 "; // True
string s3 = "abc"; // False
string s4 = "1 a"; // False
string s5 = "2e10"; // True
string s6 = "-e10"; // False
str... | ALGO | 0.996276 | 4.910173 |
389bdec4-bd0c-4c1d-99f2-068d8aa15523 | HH-LFY/HH | CPP/HDU 4394.cpp | #include <iostream>
#include <cstdio>
#include <algorithm>
#include <cstring>
#include <sstream>
#include <vector>
#include <ostream>
#include <string>
#include <cstdlib>
#include <cmath>
#include <set>
#define PI 3.141592653
using namespace std;
const __int64 inf = 1e9;
__int64 t;
__int64 n;
__int64 kmax;
__int64 knn... | ALGO | 0.999909 | 4.296843 |
c56f7c37-0d6c-4422-98e2-c273b95a58ed | MarioGuerra21008/Lab2Paralela | Lab2Paralelo2.cpp | #include <iostream>
#include <fstream>
#include <cstdlib>
#include <ctime>
#include <vector>
#include <omp.h> // Para OpenMP
// Función de QuickSort paralela
void quickSort(int* data, int lo, int hi) {
if (lo >= hi) return;
int l = lo;
int h = hi;
int p = data[(hi + lo) / 2]; // Pivote
while (l <=... | ALGO | 0.999825 | 5.97434 |
70c55e01-fe4f-4424-8c2d-7b0119dc1ca2 | algorithm006-class02/algorithm006-class02 | Week_03/G20200343030400/LeetCode_200_400.cpp | //200
//https://leetcode-cn.com/problems/number-of-islands/
class Solution {
public:
int numIslands(vector<vector<char>>& grid) {
int count = 0;
for (int i = 0; i < grid.size(); i++) {
for (int k = 0; k < grid[0].size(); k++) {
if ('1' == grid[i][k]) {
... | ALGO | 0.999736 | 6.125473 |
3bc998ec-43c0-4dce-a27d-d49b6a0611d8 | memelordmaddy/Plagiarism-Checker | plagiarism_checker/autograder/phase2/phase1_submissions/23b1040.cpp | #include <array>
#include <iostream>
#include <span>
#include <vector>
#include <algorithm>
#include <numeric>
#include <cmath>
#include <set>
// function for matching patternd of length 10-20 tokens
int find_exact_matches(const std::vector<int>& s1, const std::vector<int>& s2, int min_len, int max_len, std::set<std::p... | ALGO | 0.993191 | 5.710077 |
ca1806b6-1197-4530-a955-576322e7cdff | ElihuTM/problems-solved | CodeForces/CaptainFlintAndCrewRecruitment.cpp | #include <bits/stdc++.h>
#define ff first
#define ss second
#define mod 1000000007
#define maxn 100005
#define md(x) (((x%mod) + mod) % mod)
#define p_b(a) push_back(a)
#define all(x) x.begin(),x.end()
#define sz(a) s.size()
#define endl '\n'
using namespace std;
typedef long long ll;
typedef long double ld;
typedef v... | ALGO | 0.999081 | 3.403163 |
2c8e9a0e-6df5-4aff-b42e-fa7fb02e118b | Khushal-ag/Leetcode | 0068-text-justification/0068-text-justification.cpp | class Solution {
public:
vector<string> fullJustify(vector<string>& words, int maxWidth) {
vector<string> res;
const int n = words.size();
int begin = 0, len = 0;
for (int i = 0; i < n; ++i) {
if (len + words[i].size() + (i - begin) > maxWidth) {
res.empla... | ALGO | 0.999971 | 6.473979 |
582a1a2c-5825-43f5-92ee-6e333facc338 | Jinshuyue98/SC19083 | SC19083/src/Metropolis.cpp | #include <Rcpp.h>
using namespace Rcpp;
//' @title A random walk Metropolis sampler
//' @description A random walk Metropolis sampler for generating the standard Laplace distribution
//' @param x0: the initial point(double)
//' @param sigma: the standard deviation in the normal distribution(double)
//' @param N: the l... | ALGO | 0.999805 | 5.520622 |
d02df7f7-c77a-420f-b7e9-c36c184bc096 | SalmaFarghaly/Algorithmic-Toolbox | Algorithm Toolbox/Algorithmic Warmup/FibLastDigit.cpp | #include <iostream>
using namespace std;
int get_fibonacci_last_digit_fast(long long n,int m) {
if (n <= 1)
return n;
int previous = 0;
int current = 1;
for (int i = 0; i < n - 1; ++i) {
int tmp_previous = previous % m;
previous = current % m;
current = (tmp_previous +... | ALGO | 0.999937 | 4.957088 |
3584ba26-1891-4b65-bb76-1f99121c1357 | SEH00N/InformationArchive | 2023자료구조/23.06.02/cpp/quick.cpp | #include <iostream>
int a[100];
int Split(int* arr, int start, int end)
{
int pivot = start; //Ǻ Ǻ , ū
int left = start + 1;
int right = end;
int temp;
while (left <= right) // (ȴ => Ǻ ã)
{
while (arr[left] <= arr[pivot] && left < end) // Ǻ left (迭 Ѿ ʵ left < end )
left++;
while (arr[right] ... | ALGO | 0.999956 | 4.824649 |
a93ab09b-8ad4-40bf-a65e-fdfaf6d60366 | satakratu6/DSA-Practice | Leetcode and GFG problems/100SameTree.cpp | class Solution
{
public:
bool isSameTree(TreeNode *p, TreeNode *q)
{
if (p == nullptr && q == nullptr)
{
return true;
}
if (p == nullptr || q == nullptr)
{
return false;
}
if (p->val != q->val)
{
return false;
... | ALGO | 0.99992 | 6.627412 |
c81e69e3-19f5-40ed-9532-cfec54ee794e | altamash-k/DSA | 7.Tree/treeFromPreInOrder.cpp | #include<bits/stdc++.h>
using namespace std;\
struct node {
int data;
struct node *left;
struct node *right;
node(int val)
{
data = val;
left = NULL;
right = NULL;
}
};
int search(int inorder[], int start, int end, int curr)
{
for(int i = start; i<=end; i++)
{
... | ALGO | 0.999997 | 5.15455 |
3d6128ee-89f0-45e0-ac3d-ecc57d041198 | kiko-serra/PROG_FEUP | Test2/ex3.cpp | #include <vector>
#include <iostream>
using namespace std;
//! Print vector with elements of type T.
template <typename T>
void print(const vector<T>& v) {
cout << "[ ";
for (size_t i = 0; i < v.size(); i++) {
cout << v[i] << ' ';
}
cout << "]\n";
}
template <typename T>
void normalise(vector<T>& v, cons... | TOOL | 0.955257 | 4.574111 |
39b07f52-1a1d-476b-afa1-2fba6f323fd4 | meenunat/kidnapped_vehicle | src/particle_filter.cpp | /*
* particle_filter.cpp
*
* Created on: Dec 12, 2016
* Author: Tiffany Huang
*/
#include <random>
#include <algorithm>
#include <iostream>
#include <numeric>
#include <math.h>
#include <iostream>
#include <sstream>
#include <string>
#include <iterator>
#include "particle_filter.h"
using namespace std;
... | ALGO | 0.993803 | 4.56125 |
c99a2829-5ecd-4367-a8e9-81a6d21b4ad0 | khadija-imran24/pfweek7pd | task1.cpp | #include <iostream>
using namespace std;
void star(int rows);
main()
{
int rows;
cout<<"enter rows:";
cin>>rows;
star(rows);
}
void star(int rows)
{
for(int i=1;i<=rows;i++)
{
for(int j=1;j<=i;j++)
{
cout<<"*";
}
cout<<endl;
}
} | ALGO | 0.986139 | 3.680868 |
0546c102-5116-4c4c-82f2-e39a943b56ec | Tomas7025/code_wars_repo | duplicated_encoder/duplicated_encoder.cpp | #include <bits/stdc++.h>
using namespace std;
string duplicate_encoder(const string& word){
unordered_map<string, bool> hash_table;
string result = "";
string word_input = word;
transform(word_input.begin(), word_input.end(), word_input.begin(), [](unsigned char c){ return tolower(c); });
for (size_t letter = ... | ALGO | 0.99981 | 5.148012 |
5e42b4bf-ca01-4414-9859-189f43ad4683 | BlitWizbok/FSD-Template | Plugins/Modio/Source/ThirdParty/NativeSDK/ext/json/test/thirdparty/Fuzzer/FuzzerSHA1.cpp | #include "FuzzerSHA1.h"
#include "FuzzerDefs.h"
/* This code is public-domain - it is based on libcrypt
* placed in the public domain by Wei Dai and other contributors.
*/
#include <iomanip>
#include <sstream>
#include <stdint.h>
#include <string.h>
namespace { // Added for LibFuzzer
#ifdef __BIG_ENDIAN__
# defi... | ALGO | 0.911045 | 7.45007 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.