uuid string | repo_name string | relative_path string | content string | category string | algo_rel_score float64 | quality_score float64 |
|---|---|---|---|---|---|---|
1cc5cc7a-bc7a-4cc6-b42c-d13b641b8e7d | veda-cpp-coding-test/JungHyunGu | 3week/1406.cpp | #include<iostream>
#include<string>
#include<stack>
using namespace std;
int main()
{
ios::sync_with_stdio(0);
cin.tie(0);
int n;
string input;
//Ŀ
stack<char> left, right;
cin>>input;
for(int i=0;i<int(input.size());i++) left.push(input[i]);
cin>>n;
for(int i = 0;i<n;i... | ALGO | 0.999947 | 4.327857 |
34db44a2-b088-4ba4-987c-7007464532d9 | ReyVega/C--course | Functions/Ejercicio3.cpp | #include<iostream>
#include<stdlib.h>
using namespace std;
int numero,
potencia;
void funpot(int numero, int potencia);
void pedirDatos();
void funpot(int numero, int potencia) {
long resultado = 1;
for(int i = 0; i < potencia; i++) {
resultado *= numero;
}
cout << "El resultado es: " <<... | ALGO | 0.982019 | 4.038226 |
ff32164b-96e6-4a10-9f53-c37afb9bec1e | psomers3/advent_of_code | 2024/src/day_6.cpp | #include "file_loading.h"
#include <string>
#include <vector>
#include <regex>
#include <map>
#include <set>
int main(int argc, char *argv[])
{
std::string file_path = get_file(argc, argv);
std::string file_contents = get_file_as_string(file_path);
int total_part_1 = 0;
int total_part_2 = 0;
int nu... | ALGO | 0.995531 | 4.512956 |
542e2225-f035-4fb0-a485-7d3d8f0a4ecb | HJW-storage/CodingTest_Cplusplus | Big_stone/2week_BSF와 DFS/1012.cpp | // https://www.acmicpc.net/problem/1012
#include <iostream>
#include <algorithm>
#include <vector>
using namespace std;
int m, n, k, test_case;
void solve_dfs(int row, int col, vector<vector<int>>& grid, vector<vector<int>>& visited) {
visited[row][col] = 1; // 湮ó
int dr[4] = { -1, 0, 1, 0 };
int dc[4] = { 0, 1,... | ALGO | 0.999956 | 4.582332 |
c879efa1-c0c1-4a1d-af75-e8595905d013 | sanghyeon0114/solve-algorithm | boj/1753.cpp | #include <iostream>
#include <algorithm>
#include <vector>
#include <stack>
#include <queue>
#include <cmath>
#include <deque>
using namespace std;
struct Position {
int node;
int distance;
};
struct cmp{
bool operator()(Position& p1, Position& p2) {
if(p1.distance == p2.distance) {
r... | ALGO | 0.999924 | 4.350652 |
93f67e51-ac36-4dfd-8f1c-e54b1264819f | ishandutta2007/codeforces | arterm/normal/809/A.cpp | #include <bits/stdc++.h>
using namespace std;
#define all(x) (x).begin(), (x).end()
typedef long double ld;
typedef long long ll;
const int mod = 1e9 + 7;
int add(int x) {
return x;
}
template<typename... T>
int add(int x, T... y) {
x += add(y...);
if (x >= mod)
x -= mod;
return x;
}
template<... | ALGO | 0.999983 | 4.028002 |
01296e21-b24a-47b9-ad1f-5a6bb5cd0dbf | PhoengZ/DataStructure | Reverse_Vector_1.cpp | #include <iostream>
#include <vector>
using namespace std;
void reverse(vector<int> &v,int a,int b) {
int bet = b-a;
if (bet %2 == 1){
bet++;
}
bet/=2;
int ind = 0;
for (int i =a;i<(a+bet);i++){
int temp = v[i];
v[i] = v[b-ind];
v[b-ind] = temp;
ind++;
... | ALGO | 0.999864 | 3.54036 |
bba9a83a-4fa3-4fd4-aed7-75a40178dc6b | saicooldude/DSA-CPP-Codes | Cpp_dsa_codes/Linked_List/twostacks.cpp | #include<iostream>
using namespace std;
#include<stack>
stack<int> st1;
stack<int> st2;
void enqueue()
{
int x;
cout<<"enter element";
cin>>x;
st1.push(x);
}
void dequue()
{
int a;
if(st2.empty())
{
while(!st1.empty())
{
a=st1.top();
st1.pop();
... | ALGO | 0.984366 | 3.773937 |
6740c449-4b7a-401c-bb3e-95c7037ea0d6 | SuperPowered-Cat/DSA-Sheet-Updates | DailyQuestions/Oct2024/MinAddToMakeBracketValid.cpp | //leetcode 921
class Solution {
public:
int minAddToMakeValid(string s) {
// variable tracking approach, O(n) time O(1) space
int close = 0, left = 0;
for (char c : s) {
if (c == '(') close++;
else {
if (close>0) close--;
else left++;... | ALGO | 0.999707 | 6.406177 |
c524113d-374f-404a-9a90-4a8930c1bbaf | PrathmeshRS/Data-Structures-and-Algorithms | Sorting/inversions.cpp | /* A program to calculate number of inversions in an array
Inversion if i < j and arr[i] > arr[j]
*/
#include<iostream>
using namespace std;
// A naive solution
int countInversions(int arr[], int n) {
int res = 0;
for(int i = 0; i < n; i++) {
for(int j = i+1; j < n; j++) {
if(arr[i] > ... | ALGO | 0.999962 | 4.367976 |
96fb5e34-05c4-40e4-8af6-4160e319915b | Sudeepsd/LeetCode-Solutions | 2001-2500/2413.cpp | class Solution {
public:
// If n is even, return n itself. Otherwise, return 2 * n to make it even.
int smallestEvenMultiple(int n) {
return n % 2 ? 2 * n : n;
}
};
// Time Complexity: O(1) - Single condition check and multiplication.
// Space Complexity: O(1) - Uses only a single integer parameter... | ALGO | 0.999831 | 7.454078 |
f038cb46-479d-40ff-bfaf-5eabaf36352c | derangedhk417/MGSC | old/src/sweep.cpp | #include <iostream>
#include <mathimf.h>
#include <chrono>
#include "gaussian.cpp"
#include <gsl/gsl_min.h>
using namespace std;
int main(int argc, char ** argv) {
float min = 1.0;
float max = 1e7;
int N = 10;
float increment = (max - min) / N;
cout << "Scale, Error, Expectation" << endl;
for (int i = ... | TEST | 0.949883 | 4.849032 |
d1969ab6-7d65-4465-9743-4e3d91a2c8c7 | zenmh/phitron2.0 | semester-02/basic-data-structures/module-08-assignment-02/search.cpp | #include <bits/stdc++.h>
using namespace std;
class Node
{
public:
int val;
Node *next;
Node(int val)
{
this->val = val;
this->next = NULL;
}
};
void insert_at_tail(Node *&head, Node *&tail, int val)
{
Node *new_node = new Node(val);
if (head)
{
tail->next = new_node;
tail = new_nod... | ALGO | 0.999696 | 4.70347 |
cfaec7c3-e9fd-46e3-878f-53ec1b9a2d8b | devcoin/core | src/test/fuzz/timedata.cpp | #include <test/fuzz/FuzzedDataProvider.h>
#include <test/fuzz/fuzz.h>
#include <test/fuzz/util.h>
#include <timedata.h>
#include <cstdint>
#include <string>
#include <vector>
FUZZ_TARGET(timedata)
{
FuzzedDataProvider fuzzed_data_provider(buffer.data(), buffer.size());
const unsigned int max_size = fuzzed_dat... | TEST | 0.876336 | 6.06597 |
01d95879-e412-476c-b49d-4ea6d48023c1 | ryeji270/tugas_01 | Mobile 2 Malvin/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.998262 | 6.763549 |
9be1f0cd-13d9-4a2b-8511-4b3e58d4c495 | NVIDIA/libcudacxx | libcxx/test/std/algorithms/alg.modifying.operations/alg.unique/unique_pred.pass.cpp | // <algorithm>
// template<ForwardIterator Iter, EquivalenceRelation<auto, Iter::value_type> Pred>
// requires OutputIterator<Iter, RvalueOf<Iter::reference>::type>
// && CopyConstructible<Pred>
// constexpr Iter // constexpr after C++17
// unique(Iter first, Iter last, Pred pred);
#include <algo... | TEST | 0.965553 | 6.540398 |
7448a87f-5195-43e9-834f-4954e1e58753 | Umbokc/lets | modules/math/math.cpp | #include <iostream>
#define _USE_MATH_DEFINES
#include <cmath>
#include <math.h>
#include <limits>
#include "math.hpp"
#include "../../include/lib/number_value.hpp"
#include "../../include/lib/string_value.hpp"
#include "../../include/lib/functions.hpp"
#include "../../include/lib/variables.hpp"
#include "../../inclu... | TOOL | 0.861258 | 4.697206 |
6e7ace03-8dcb-4a1e-b94c-38719991b3d0 | nikhilthakur72/Data-Structures | lab/selectmerge_exp10/main.cpp | #include <iostream>
using namespace std;
class msort
{
private:
int num;
public:
void selection(int arr[],int n)
{
for(int i=0;i<n-1;i++)
{
int min_idx = i;
for(int j=i+1;j<n;j++)
{
if(arr[j] < arr[min_idx])
swapped(&arr... | ALGO | 0.999977 | 4.654876 |
1a30d7d1-4a54-4305-a417-7ea4decad216 | Semisol/foundationdb | documentation/tutorial/dining_philosophers.actor.cpp | #include "fmt/format.h"
#include "flow/flow.h"
#include "flow/Platform.h"
#include "flow/DeterministicRandom.h"
#include "fdbclient/NativeAPI.actor.h"
#include "fdbclient/ReadYourWrites.h"
#include "flow/TLSConfig.actor.h"
#include <functional>
#include <unordered_map>
#include <memory>
#include <iostream>
#include "fl... | ALGO | 0.996906 | 5.866994 |
3f3ae3ef-2afe-4a32-a261-673fbb2d1488 | AdrianLopezGue/UNIVERSITY | IP/Practica3/ej6.cpp | #include <cstdio>
#include <cstdlib>
#include <iostream>
using namespace std;
int main(){
int x,j=0;
cin>>x;
for(int i=1; i<=x; i++){
if((x%i)==0){
j++;
}
}
if(j==2){
cout<<"Primo"<<endl;
}
else{
cout<<"No primo"<<endl;
}
system("pause");
}
| ALGO | 0.999956 | 4.091653 |
fc14cfb5-824d-476c-9301-c8d0d6160c0b | Shahbaz898414/Codeforces | C/C. Two Arrays.cpp | #include<bits/stdc++.h>
using namespace std;
int T,n,a[110],b[110];
int main(){
cin>>T;
while(T--){
cin>>n;
for(int i=1;i<=n;i++)cin>>a[i];
sort(a+1,a+n+1);
for(int i=1;i<=n;i++)cin>>b[i];
sort(b+1,b+n+1);bool fl=1;
for(int i=1;i<=n;i++)fl&=(a[i]==b[i]||a[i]+1==b[i]);
puts(fl?"YES":"NO");
}
return 0;
... | ALGO | 0.99993 | 3.785514 |
eab5e218-2178-4d9f-b941-7942dea496bc | testtest58/Build | Engine/Source/Programs/UnrealLightmass/Private/Lighting/FinalGather.cpp | #include "CoreMinimal.h"
#include "Exporter.h"
#include "LightmassSwarm.h"
#include "CPUSolver.h"
#include "LightingSystem.h"
#include "MonteCarlo.h"
#include "HAL/ExceptionHandling.h"
#if PLATFORM_WINDOWS
#include "Windows/WindowsHWrapper.h"
#include "Windows/AllowWindowsPlatformTypes.h"
#include <psapi.h>
#include ... | ALGO | 0.985169 | 6.864896 |
589104f1-5f43-460a-b69a-34bf792bf635 | shivang-negi/DSA-Templates | Data structure/BST/4_deletion.cpp | #include <iostream>
using namespace std;
class node
{
public:
int data;
node *left, *right;
};
node *newNode(int item)
{
node *temp = new node();
temp->data = item;
temp->left = temp->right = NULL;
return temp;
}
void preorder(struct node *root)
{
if (root != NULL)
{
... | ALGO | 0.999936 | 4.657651 |
d8ee54c3-5d15-4ded-bdcc-9a22fdafc261 | shurcooL/eX0 | eX0/src/Mgc/MgcMath.cpp | #include "MgcMath.h"
using namespace Mgc;
#ifdef MGC_USE_DOUBLE
const Real Math::MAX_REAL = DBL_MAX;
#else
const Real Math::MAX_REAL = FLT_MAX;
#endif
const Real Math::PI = 4.0f*Math::ATan(1.0f);
const Real Math::TWO_PI = 2.0f*PI;
const Real Math::HALF_PI = 0.5f*PI;
const Real Math::INV_TWO_PI = 1.0f/TWO_PI;
const Re... | TOOL | 0.874678 | 4.370091 |
40a1f7bc-e3a0-426f-b21e-af8c1451f031 | enginestein/Virus-Collection | Others/phatbot-SkYKr3w/phatbot-SkYKr3w/phatbot-SkYKr3w/cstring.cpp |
#include "main.h"
#include "cstring.h"
#include "mainctrl.h"
#include "cthread.h"
#include <vector>
// Token cache
token_data g_tData[128];
CMutex g_mMutex;
bool g_bInited=false;
CString::CString() {
if(!g_bInited) {
for(int i=0;i<128; i++) {
token_data *pData=&g_tData[i]; pData->szDelim=NULL; pData->sz... | TOOL | 0.885384 | 4.004517 |
503dc18d-73e5-4d22-aa9f-fade0ca2a8a6 | KarolOrszulik/AoC-2023 | 1_trebuchet/main.cpp | // https://adventofcode.com/2023/day/1
#include <iostream>
#include <fstream>
int line_value(const std::string& line)
{
int first = -1, last = 0;
for (char c : line)
{
if (c >= '0' && c <= '9')
{
int digit = c - '0';
last = digit;
if (first == -1)
... | ALGO | 0.992087 | 6.548914 |
9cf3f13e-dcd5-42db-85b5-9b9f00394f76 | amit24ve/CPP | recursion/practice.cpp | // #include<iostream>
// using namespace std;
// int fun(int a)
// {
// if(a==0)
// {
// return 0;
// }
// // cout<<a<<" ";
// // fun(a-1);
// // cout<<a<<" ";
// // fun(a/2);
// // cout<<a%2<<"";
// else{
// return a+fun(a-1);
// }
// }
// int main()
// {
// i... | ALGO | 0.999938 | 3.732074 |
8ed7af05-9eb1-42c3-b326-e1970a9fa5ba | MZawnings/psychic-octo-train | libyul/optimiser/ReasoningBasedSimplifier.cpp | #include <libyul/optimiser/ReasoningBasedSimplifier.h>
#include <libyul/optimiser/SMTSolver.h>
#include <libyul/optimiser/SSAValueTracker.h>
#include <libyul/optimiser/Semantics.h>
#include <libyul/AST.h>
#include <libyul/Dialect.h>
#include <libsmtutil/SMTPortfolio.h>
#include <libsmtutil/Helpers.h>
#include <libso... | ALGO | 0.985269 | 7.794683 |
597d7a26-966e-48fd-a269-c0f578aaf73a | ZhouZiyuIan/OI-Code | OI Documents/Public Code/2025.5sx/七年级4班张曌鑫/sleep.cpp | #include<bits/stdc++.h>
using namespace std;
long long n,t,a[100000001];
int main()
{
freopen("sleep.in","r",stdin);
freopen("sleep.out","w",stdout);
cin>>n>>t;
for(long long i=0;i<n;i++){
cin>>a[i];
}
for(long long i=0;i<n;i++){
if(t-a[i]<=0){
cout<<i+1<<endl;
cout<<a[i]-t;
return 0;
}
t-=a[i];
... | ALGO | 0.999992 | 3.108938 |
ef8f9ab2-210c-4719-8694-fe543849dcb1 | DIGAIL/course_5 | codes/course_5_3.cpp | /*
Problem #3
Solution Source Code :
objectivec;
Code Overview
Library Inclusions and Namespace: The code starts by including the necessary libraries for input/output and string handling, then uses the standard namespace.
User Input Function:
The ReadPositiveNumber function ensures that the program receives a valid pos... | ALGO | 0.99713 | 5.418036 |
bb5b7e8d-3d62-41cf-b4cc-0c4c0337d1e9 | antoniak/PRI | lib/boost_1_67_0/libs/contract/example/features/ifdef_macro.cpp | #include <vector>
#include <limits>
#include <cassert>
//[ifdef_macro_function
// Use macro interface to completely disable contract code compilation.
#include <boost/contract_macro.hpp>
int inc(int& x) {
int result;
BOOST_CONTRACT_OLD_PTR(int)(old_x, x);
BOOST_CONTRACT_FUNCTION()
BOOST_CONTRACT_P... | TOOL | 0.866296 | 5.621743 |
dcb754e4-879d-4963-9216-0a5443f0f483 | prakharrai1609/Data-structure-and-algorithm | Binary search/min_pair.cpp | /* Author : Prakhar Rai */
#include<bits/stdc++.h>
#define ll long long
#define ld long double
#define LB(x,num) lower_bound(x.begin(),x.end(),num) - x.begin()
#define UB(x,num) upper_bound(x.begin(),x.end(),num) - x.begin()
#define BS(x,num) binary_search(x.begin(),x.end(),num)
#define pb push_back
#define mp ma... | ALGO | 0.999984 | 3.410872 |
1d9df2ed-83fc-4d0b-93fc-c9373b5cf728 | akordas/CPlusPlus | sorting_algorithms/insertion.cpp | #include <iostream>
using namespace std;
void insertionSort(int* vals, int length)
{
int i, j, temp;
for(j=1; j<length; j++)
{
i=j;
while(i>0 && vals[i-1]>vals[i])
{
temp = vals[i];
vals[i] = vals[i-1];
vals[i-1] = temp;
i--;
}
}
}
int main()
{
int mynums[10] = {1, 7, 7, 5, 2, 3, 6, 9, 10, 0}... | ALGO | 0.99995 | 4.590775 |
06703c8d-f7b2-427b-b659-04486d419d02 | saktheeswaranswan/leetcode-monk-version-big-examples | subarrays-with-k-different-integers/subarrays-with-k-different-integers.cpp | class Solution {
public:
int solve(vector<int>& A, int K){
unordered_map<int,int> m;
int i=0;
int ans=0;
for(int j=0;j<A.size();j++){
if (!m[A[j]]++)
K--;
while (K<0) {
if (!--m[A[i]])
K++;
... | ALGO | 0.999965 | 6.062798 |
65b58570-a068-4a8f-b011-1f724d7a3b7b | PulkitG0/Codeforces-Questions | Miscellaneous/Edu Round 115 B.cpp | #include<bits/stdc++.h>
using namespace std;
vector<vector<int>> inp(int n){
vector<vector<int>>v(n);
for (int i = 0; i < n; i++){
v[i].resize(5);
}
for(int i=0;i<n;i++){
for(int j=0;j<5;j++){
cin>>v[i][j];
}
}
return v;
}
bool is_possible(int a,int b,int n,... | ALGO | 0.999932 | 5.30614 |
4b0558ab-cea2-455d-b31a-8528e2d14fd3 | wassimalharaki/Codeforces | 800/PolycarpandCoins.cpp | #include <bits/stdc++.h>
using namespace std;
#define fast ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0)
#define int long long
#define all(v) v.begin(), v.end()
#define nl << '\n'
#define v vector
#define vi vector<int>
#define pii pair<int, int>
#define mp make_pair
#define pb push_back
#define INF LONG_LONG... | ALGO | 0.999807 | 3.91067 |
59951cef-0783-43be-8c09-eb0815dc351f | kparam91/VideoAnalytics | assignment5_part2/Raw_moments.cpp | #include "opencv2/imgproc/imgproc.hpp"
#include "opencv2/highgui/highgui.hpp"
#include <stdlib.h>
#include <stdio.h>
#include <iostream>
#include <fstream>
#include <ctime>
using namespace cv;
using namespace std;
int main(int argc, char **argv)
{
ofstream myfile;
time_t now = time(0);
string timeStamp=ctime(&now);
... | TOOL | 0.903539 | 3.716773 |
6c83e16e-cbad-44a2-b632-8c945319b477 | rafasdc/UVIC-CSC205 | A4/C/laplace.cpp | /* image_processor_bw.cpp
CSC 205 - Spring 2016
Template for a grayscale PNG image processor.
B. Bird - 03/02/2016
*/
#include <string>
#include <iostream>
#include <array>
#include <math.h>
#include "lodepng.h"
#include "png_canvas.h"
using namespace std;
double w = 1.0;
int* compute_histogram(PNG... | ALGO | 0.993175 | 4.552547 |
76b263f8-ab15-483b-9e9f-088df9bb9910 | Ikhyeon-Cho/dwa_planner | dwa_planner_ros/test/collision_check_test_node.cpp | #include <ros/ros.h>
#include <visualization_msgs/Marker.h>
#include <geometry_msgs/PoseStamped.h>
#include <Eigen/Dense>
#include <ros_node_utils/Core.h>
int main(int argc, char** argv)
{
ros::init(argc, argv, "collision_check_test_node");
ros::NodeHandle nh("~");
double v = -1.0;
double w = 0.12;
double ... | TOOL | 0.955552 | 4.715848 |
ca33c139-7037-4db4-8dd8-19557c0eb4bf | thayeral/titanic_analyzer | src/HashTable.cpp | #include "HashTable.h"
/********************** Start Hash Table Setup Functions ********************/
Hash_Table::Hash_Table()
{
//cout << "CONSTRUCTED";
}
Hash_Table::~Hash_Table()
{
//cout << "DE-CONSTRUCTED";
}
// Explanation of the hash table system:
/*****************************************************... | ALGO | 0.94986 | 4.123439 |
4365d25c-e477-45c4-a10a-d36f099a98d8 | SOFTK2765/PS | BOJ/15729.cpp | #include <bits/stdc++.h>
using namespace std;
int a[1000001], b[1000001];
int main()
{
int n;
scanf("%d", &n);
for(int i=0;i<n;i++)
scanf(" %d", &a[i]);
int cnt = 0;
for(int i=0;i<n;i++)
if(a[i]!=b[i])
{
b[i] = b[i]==0?1:0;
if(i+1<n) b[i+1] = b[i+1]... | ALGO | 0.999908 | 3.488163 |
0ff152ef-b386-47d9-bb58-9c9b4d793363 | Sharafabdullah/CompetitiveProgramming | contests/928 div4/D.cpp | #include <bits/stdc++.h>
#include<bitset>
using namespace std;
#define all(v) ((v).begin()), ((v).end())
#define repv(i, v) for(int i=0;i<(v).size();++i)
#define rep(i, j, n) for(int i=(j);i<(int)(n);++i)
#define dow(i, j, n) for(int i=(j);i>=(int)(n);--i)
#define pb push_back
#define mp make_pair
#define... | ALGO | 0.999897 | 4.433329 |
f2612306-19c5-4617-83ee-46f15f22c033 | Shueiz/AppPizza | pizza_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.998423 | 6.76775 |
c8a1a096-1407-477f-bd60-d576f8504dd0 | Iltwats/Competitive-Programming-SolvedProblems | CodeForces/Is-your-horseshoe-on-the-otherhoof.cpp | // Problem Statement:https://codeforces.com/contest/228/problem/A
#include <bits/stdc++.h>
using namespace std;
#define ll long long
#define fastio ios_base::sync_with_stdio(0);cin.tie(0), cout.tie(0)
const ll mod = 10e9 + 7;
int main()
{
fastio;
int a[4];
set<int> s;
for (int i = 0; i <4; i++)
{
... | ALGO | 0.992524 | 3.788202 |
8dd02ff4-8bbe-4030-83e0-f6a65972d5af | vishalpolley/Competitive-Programming | Other/test.cpp | #include <bits/stdc++.h>
using namespace std;
struct point
{
double x;
double y;
double r;
};
inline double euclideanDistance(point p1, point p2)
{
double x = p1.x - p2.x;
double y = p1.y - p2.y;
double d = sqrt(x*x + y*y);
return d;
}
int main()
{
freopen("in.in", "r", stdin);
io... | ALGO | 0.999845 | 4.003401 |
ef8984a1-1f10-4749-bf31-c127977cbd65 | ori5r2/algorithm-archive | BOJ/13913.cpp | #include <bits/stdc++.h>
using namespace std;
#define MX 100002
int N, K;
int visited[MX];
int parent[MX];
int dx[] = {-1, 1, 2};
int ans = 0;
void BFS()
{
queue<int> q;
q.push(N), visited[N] = 1, parent[N] = -1;
while (!q.empty())
{
int front = q.front();
int sec = visited[front];
... | ALGO | 0.999985 | 4.005576 |
87548e8c-c849-4c9f-b21c-d7dc8c94c24e | ryudo87/CPP | githubCPP/Standard Template Library (STL)/Algorithm/replace replace_if replace_copy.cpp | namespace {
template <typename InputIterator, typename T>
void replace(InputIterator first, InputIterator last, const T& old_value, const T& new_value){
for (;first!=last;++first){
if (*first == old_value) *first = new_value;
}
}
template <typename InputIterator, typenam... | TOOL | 0.99896 | 5.374925 |
38201130-71d5-495b-83fb-bd5b15f49c82 | gratus907/Gratus_PS | Contests/ICPC/Regionals/[NA] North America/[MCRPC] Mid-Central Regional Programming Contest/MCRPC 2018/E_Coprime Integers.cpp | #include <bits/stdc++.h>
using namespace std;
using namespace std::chrono;
#define ll long long
#pragma GCC optimize("O3")
#pragma GCC optimize("Ofast")
#pragma GCC target("avx,avx2,fma")
#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native")
#define usecppio ios::sync_with_stdio(0);cin.tie(0);co... | ALGO | 0.999925 | 4.878963 |
e9d9f2ed-f082-43e0-b00f-d7995415858c | Dftlg/LargeScaleForest-old | libraries/basicAlgorithms/disjointSet.cpp | #include <stdio.h>
#include <stdlib.h>
#include <iostream>
#include <cassert>
#include "disjointSet.h"
using namespace::std;
void DisjointSet::makeSet(void)
{
for(size_t i = 0; i < parent.size(); i++)
{
parent[i] = NO_SUCCESSOR; // each object is initially a root of a tree
depth[i] = 0;
}
}
void Disjoi... | ALGO | 0.987191 | 4.580037 |
803465d7-6dc6-402c-b442-c1febd99c5c4 | Vaibhav388120/Cpp-Course-CWH | 63.Vector.cpp | // vector<data_type> vector_name;
#include<iostream>
#include<vector>
using namespace std;
// int main(){
// vector<int> vec1;
// return 0;
// }
void display(vector<int> &v){
for(int i=0;i<v.size();i++){
cout<<v[i]<<" ";
}
cout<<endl;
}
int main(){
vector<int> vec1;
int element,s... | ALGO | 0.909582 | 3.714422 |
28e0318a-9736-4183-8916-9008c3ec7b6e | YohannaWANG/LPR | LPR/perspective.cpp | #include "opencv2/core.hpp"
#include "opencv2/core/utility.hpp"
#include "opencv2/imgproc.hpp"
#include "opencv2/imgcodecs.hpp"
#include "opencv2/highgui.hpp"
#include <iostream>
#include <stdio.h>
#include <math.h>
#include <string.h>
using namespace cv;
using namespace std;
int main(int /*argc*/, char** /*argv*/)... | ALGO | 0.999285 | 4.399303 |
9cd631df-a116-4f8e-b47a-9cfd4feb9b35 | samarthcode1/450-sheet | Palindrome String.cpp | //User function template for C++
class Solution{
public:
int isPalindrome(string S)
{
// Your code goes here
stack<char>s;
string st="";
for(int i=0;i<S.length();i++){
s.push(S[i]);
}
while(!s.empty()){
st+=s.top();
s.pop();
}
if(st==S){
ret... | ALGO | 0.999946 | 5.854294 |
42ac7124-638f-4f4a-aa67-45eff9686b68 | lxdlam/CP-Answers | ACM-ICPC Official/Qualification/Beijing-2018/B.cpp | #include <bits/stdc++.h>
using namespace std;
#define TemplateVersion "3.4.1"
// Useful Marcos
//====================START=====================
// Compile use C++11 and above
#ifdef LOCAL
#define debug(args...) \
{ \
string _s = #args; ... | ALGO | 0.999992 | 5.15857 |
d51e7b3b-56fb-4314-a06d-9a519f273d23 | Andy210904/LeetCode | 0079-word-search/0079-word-search.cpp | class Solution {
public:
bool backtrack(vector<vector<char>>& board, string& word, int ind, int i, int j) {
if (ind == word.size()) return true;
int n = board.size();
int m = board[0].size();
if (i < 0 || j < 0 || i >= n || j >= m || board[i][j] != word[ind]) return false;
ch... | ALGO | 0.999738 | 6.307141 |
ec6cc5cb-a6bf-4895-8c34-c3f8f6d9f33d | ddadaal/algorithm-solutions | leetcode/63.cpp | #include <vector>
#include <map>
#include <algorithm>
#include <iostream>
using namespace std;
class Solution {
typedef map<pair<int, int>, int> Cache;
public:
int uniquePathsWithObstacles(vector<vector<int>>& obstacleGrid) {
Cache cache;
int n = obstacleGrid.size();
int m = obstacleGrid[0].size();
cache[... | ALGO | 0.999856 | 5.785582 |
542d3337-f57a-42c7-afe9-d3a8417540da | PolygonTek/BlueshiftEngine | Source/ThirdParty/Bullet/src/BulletSoftBody/btDeformableBodySolver.cpp | #include <stdio.h>
#include <limits>
#include "btDeformableBodySolver.h"
#include "btSoftBodyInternals.h"
#include "LinearMath/btQuickprof.h"
static const int kMaxConjugateGradientIterations = 50;
btDeformableBodySolver::btDeformableBodySolver()
: m_numNodes(0)
, m_cg(kMaxConjugateGradientIterations)
, m_maxNewtonIter... | ALGO | 0.999822 | 4.99529 |
053f96fd-1f7c-494e-ae36-0abe16241b0b | kuheli31/DSA | Stack/Evaluation of Postfix.cpp | #include <stdio.h>
#include <stdlib.h>
#include<strings.h>
struct Node
{
int data;
struct Node *next;
}*top=NULL;
void push(int x)
{
struct Node *t;
t=(struct Node*)malloc(sizeof(struct Node));
if(t==NULL)
printf("stack is full\n");
else
{
t->data=x;
t->next=top;
top=t;
}
}
int pop()
{
struct Node *t;
... | ALGO | 0.999967 | 3.824088 |
73aab96a-c1c5-43cd-a039-7e63c0e71f68 | lmtonay/programming_ps | AC setsstl_hr.cpp | #include <bits/stdc++.h>
using namespace std;
int main()
{
#ifndef ONLINE_JUDGE
freopen("input.txt", "r", stdin);
freopen("output.txt", "w", stdout);
#endif
int q;
cin >> q;
unordered_set<int> store;
while (q--)
{
int ac, n; cin >> ac >> n;
if (ac == 1) {
store.insert(n);
} else i... | ALGO | 0.999767 | 4.716518 |
da9684dd-a8ad-4fe4-9678-320d1c22b9c4 | vectar31/Spoj-solutions-and-other-c-codes | loopexp/main.cpp | #include <iostream>
#include <iomanip>
#define N 1000001
using namespace std;
double ans[N];
int main()
{
ans[0]=0;ans[1]=1;
for(int i=2;i<N;i++)
ans[i]=ans[i-1]+(1.0/i);
int t;
cin>>t;
while(t--)
{
int n;
cin>>n;
cout<<fixed<<setprecision(6)<<ans[n]<<endl;
}
... | ALGO | 0.99913 | 3.76925 |
80917ebe-c2f7-4aa6-af43-955dfc9c0221 | skanda99/AtCoder | ABC145-C.cpp |
// problem: "https://atcoder.jp/contests/abc145/tasks/abc145_c"
#include<bits/stdc++.h>
#define ll long long
#define Pair pair<ll,ll>
using namespace std;
int main()
{
ll n,i;
cin>>n;
ll x,y;
vector<Pair>V;
for(i=0;i!=n;i++)
{
cin>>x>>y;
V.push_back(Pair(x,y));
}
... | ALGO | 0.999329 | 4.108722 |
a6c29060-2427-49b3-90f0-efe301f9c4c7 | jungin0507/problem-solving | Codeforces/#785/C.cpp | #include <bits/stdc++.h>
// #define int long long
#define sq(x) ((x) * (x))
#define all(x) x.begin(), x.end()
#define rep(from, to, stride) for (auto i = (from); i < (to); i += (stride))
#define rrep(from, to, stride) for (auto i = (from)-1; i >= (to); i -= (stride))
#define fastio \
{ ... | ALGO | 0.999865 | 5.363701 |
918322c7-8963-42e2-9ee9-a877fdd19812 | vaishnaviprakash12/100-days-of-code-challange | Day-70/replace-all-digits-with-character.cpp | //1844. Replace All Digits with Characters
class Solution {
public:
string replaceDigits(string s) {
for(auto i=1;i<s.size();i+=2){
s[i]+=s[i-1]-'0';
}
return s;
}
}; | ALGO | 0.99991 | 6.291177 |
ba328ed9-7a61-49c0-97e6-db5cf003af6a | emanueljuliano/Competitive_Programming | topics/matemagica/abelian.cpp | #include <bits/stdc++.h>
using namespace std;
#define _ ios_base::sync_with_stdio(0);cin.tie(0);
#define endl '\n'
#define f first
#define s second
#define pb push_back
typedef long long ll;
typedef pair<int, int> ii;
const int INF = 0x3f3f3f3f;
// pentagon numbers = n(3n - 1)/2
const int MAX = 2e5;
const int MOD ... | ALGO | 0.999994 | 4.825253 |
656fbc32-1665-4e7c-9eb4-95c43fb6cd78 | Mjp777/C- | All Elements in Two Binary Search Trees.cpp | class BSTIterator {
public:
BSTIterator(TreeNode* root) {
pushLeftsUntilNull(root);
}
int peek() {
return stack.top()->val;
}
void next() {
TreeNode* node = stack.top();
stack.pop();
pushLeftsUntilNull(node->right);
}
bool hasNext() {
return !stack.empty();
}
private:
sta... | ALGO | 0.999996 | 6.035212 |
e571411f-8ad9-4b2c-9333-ce7a2fa7f78c | sherryshare/blaze-2.0 | blazemark/src/boost/TVec3TMat3Mult.cpp | //=================================================================================================
//=================================================================================================
//*************************************************************************************************
// Includes
//****... | ALGO | 0.998911 | 5.256036 |
c89b44b8-0597-4c65-b91c-8652cb27914c | Zhanggen-sysu/iOS-Note | 算法/LeetCode/LeetCode/Slove41_60/hot100_47.cpp | //
// hot100_47.cpp
// LeetCode
//
// Created by GenZhang on 2024/1/3.
//
#include "hot100_47.hpp"
TreeNode *builATree(vector<int>& preorder, int pl, int pr, vector<int>& inorder, int il, int ir)
{
if (pl < 0 || pl >= preorder.size() || pr < 0 || pr >= preorder.size() || pl > pr) {
return nullptr;
... | ALGO | 0.999938 | 6.626909 |
16443804-d049-4666-afde-cde856c0d784 | artigues/ULSC-schedule | src/ESA/a_i.cpp | #include "../../include/ESA/a_i.h"
AntennaPrioritySV::AntennaPrioritySV()
{
this->elmtId = -1;
this->CD = -1;
this->GCD = -1;
}
AntennaPrioritySV::AntennaPrioritySV(int elmtId, int CD, double GCD) // int DD,
{
this->elmtId = elmtId;
this->CD = CD;
this->GCD = GCD;
}
void AntennaPrioritySV::di... | ALGO | 0.998701 | 4.19451 |
81dd03e8-25cb-47b1-89b4-c02157675693 | deepdarshan21/leetcode-solutions | 868. Binary Gap/Bit Manipulation.cpp | #include <bits/stdc++.h>
using namespace std;
/*
Approach: Bit manipulation
Edge Cases:
Time Complexity: O(1) Space: O(1)
Status: Accepted
Runtime: 3 ms faster than: 42.83%
Memory Usage: 5.9 MB less than: 40.72%
Remarks:
*/
class Solution {
public:
int binaryGap(int n) {
int res ... | ALGO | 0.999851 | 5.846124 |
31ccb9ba-f273-4487-90a1-8340d2e52d40 | JOUNHO/BaekjoonOJ | IO/2445.cpp | #include<iostream>
using namespace std;
int main(void){
int n;
int num;
cin>>n;
for(int i=1;i<=2*n-1;i++){
if(i>n){
num=(2*n)%i;
}else {
num=i;
}
for(int j=0;j<num;j++){
cout<<"*";
}
for(int j=0;j<2*(n-num);j++){
cout<<" ";
}
for(int j=0;j<num;j++){
... | ALGO | 0.999957 | 3.066292 |
77171549-1205-4725-ba36-ed6e530b5bca | Pragna235/LeetCode_Problems | Find the Index of the First Occurrence.cpp | class Solution {
public:
void computeLPSArray(string &pattern, int m, vector<int> &lps){
int len=0;
lps[0]=0;
int i=1;
while(i<m){
if(pattern[i]==pattern[len]){
len++;
lps[i]=len;
i++;
}
else{
... | ALGO | 0.999966 | 6.542875 |
d5a44535-85e0-4b7f-9f71-db1c100062c8 | nguyenvanhaiduy/ui-test-using-sliver | 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 |
c8c70178-00c5-49de-80f0-67694ad2fb36 | im-ayushi/Codes_for_competitive_programming | Replace every element by multiplication of previous and next elements.cpp | #include<iostream>
using namespace std;
void update(int a[], int n)
{
int previous = a[0];
arr[0] = a[0] * a[1];
for (int i = 1; i < n - 1; i++)
{
int current = a[i];
a[i] = previous * a[i + 1];
previous = current;
}
a[n-1] = previous * a[n-1];
}
int ma... | ALGO | 0.999985 | 3.477665 |
110c0319-a252-4096-aa92-bf3ee03e7e8f | vintiladragos/HoughTransform | HoughLines.cpp | #include "HoughLines.h"
// multi-threaded hough lines
#include <thread>
#include <thread>
#include <mutex>
#include <atomic>
#include <algorithm>
std::mutex accumulatorMutex;
void houghLinesParallel(cv::Mat& image, std::vector<cv::Vec2f>& lines, int threshold, double theta, int nrThreads) {
cv::Mat edges = image... | ALGO | 0.998716 | 5.411252 |
2f956610-c0bc-4f6d-baaf-6cb7f126c9df | a2677331/My-Solutions-CS232-HW | cs232_Lab4_Proj1_2020/proj1_driver.cpp | /**************************************************************************
* File name: proj1_driver.cpp
* ---------------------------
* This file contains codes for a console based simulation of a lock
* in which you can enter a 4-letter combination to trigger related action.
* The code involves variables and fu... | TOOL | 0.922275 | 6.400501 |
261f2b76-3dd9-456e-901b-ee0e53167539 | schwa-lab/zpar | src/common/deplabeler/implementations/naive/deplabeler.cpp | /****************************************************************
* *
* deplabeler.cpp - the naive labeler implementation *
* *
* Author: Yue Zhang ... | DATA | 0.988474 | 5.703617 |
b6305dbe-a7cc-46d5-927e-bfebf3c162f3 | ishandutta2007/codeforces | zhangzy/normal/839/E.cpp | #include<bits/stdc++.h>
#define db double
using namespace std;
int n,k,f[44][44],num[44],st[44],tot,mx;
db ans;
int main(){
scanf("%d%d",&n,&k);
for (int i=1;i<=n;i++){
num[i]=i;
for (int j=1;j<=n;j++){
scanf("%d",&f[i][j]);
}
}
for (int fl;clock()<=1988;){
random_shuffle(num+1,num+n+1);
st[tot=1]=num... | ALGO | 0.999686 | 3.028156 |
548ff642-7577-4e54-bd08-10bc9fac279c | PiyushKumarSingh-90/43_piyush_23_27_101c-program | 101_Cpp_Codes-main/Q.63.cpp | #include <iostream>
// Function to partition the array and return the index of the pivot
int partition(int arr[], int left, int right) {
int pivot = arr[right]; // Choosing the last element as the pivot
int i = left - 1; // Index of smaller element
for (int j = left; j < right; ++j) {
/... | ALGO | 0.999993 | 6.285378 |
748e9b0f-aa59-462a-8b44-391b32dfaca7 | ititorit/SPOJ | PTIT121L.cpp | // Contest: http://www.spoj.com/PTIT/problems/PTIT121L/
#include <bits/stdc++.h>
#define _for(i,a,b) for(int i=(a),_b_=(b),_d_=(a<b?1:-1);i<=_b_;i+=_d_)
#define FOR(i,a,b) for(int i = a; i <= b; i++)
#define _it(i,v) for (typeof((v).begin()) i = (v).begin(); i != (v).end(); ++i)
#define _all(v) v.begin(), v.end()
... | ALGO | 0.999952 | 3.84206 |
fcffa2af-a5da-4841-8150-4cf8bccb4cfa | kino-3/private_atcoder | atcoder/abc/237/d.cpp | #include <bits/stdc++.h>
#define REP(var, n) for (decltype(n) var = 0; var < (n); var++)
#define REP_R(var, n) \
for (auto var = (n)-1; var != static_cast<decltype(var)>(-1); var--)
#define FOR(var, a, b) for (auto var = (a); var < (b); var++)
#define FOR_R(var, a, b) for (auto var = (b - 1); var > (a - 1); var--)
... | ALGO | 0.999981 | 4.425253 |
eea70b5b-c3b1-400e-814e-7efc0e2eeef0 | sonukuldeep/Flutter-firebase-auth | 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 |
23682f91-9a7b-427a-8ac0-e49cae898e10 | RakiNvaya/Rated-cf-codes | 1675A.cpp | #include <bits/stdc++.h>
using namespace std;
int main()
{
int n;
cin >> n;
while (n--)
{
int a, b, c, x, y;
cin >> a >> b >> c >> x >> y;
int sum1 = a - x;
int sum2 = b - y;
if (sum1 < 0)
c += sum1;
if (sum2 < 0)
c += sum2;
... | ALGO | 0.998988 | 3.583302 |
791a3708-7f1b-4b30-bd20-4ebaefe69985 | CppWorks/Functional-Programming-Cpp | chapter-02/move-selected/main.cpp |
#include <algorithm>
#include <iostream>
#include <string>
#include <vector>
#include "../../common/person.h"
typedef std::pair<std::string, bool> list_item;
std::string title(const list_item& item)
{
return item.first + std::string(item.second, '*');
}
bool is_selected(const list_item& item)
{
return item.sec... | TOOL | 0.99625 | 5.4186 |
a3f6e330-3dd3-4e02-ba59-ed80b6db9015 | KagonKhan/RepoLection | unfinished-games/SFML Blueprints/Blueprints_Gravitris/packages/Box2D.2.3.0/src/native/Box2D/Dynamics/Joints/b2WheelJoint.cpp | #include <Box2D/Dynamics/Joints/b2WheelJoint.h>
#include <Box2D/Dynamics/b2Body.h>
#include <Box2D/Dynamics/b2TimeStep.h>
// Linear constraint (point-to-line)
// d = pB - pA = xB + rB - xA - rA
// C = dot(ay, d)
// Cdot = dot(d, cross(wA, ay)) + dot(ay, vB + cross(wB, rB) - vA - cross(wA, rA))
// = -dot(ay, vA) -... | ALGO | 0.946182 | 6.924846 |
da4dc3dd-09c3-4f48-bcb9-3c09c65aeadd | kimziou77/algorithm | boj/N과 M4.cpp | #include <iostream>
#include <cstdio>
#include <vector>
using namespace std;
int N, M;
int check[10];
vector<int> v;
void NM(int index,int cnt) {
if (v.size() == M) {
for (int i = 0; i < M; i++)
printf("%d ", v[i]);
printf("\n");
return;
}
for (int i = index; i < N; i++) {
//if (check[i]) continue;
v.... | ALGO | 0.999927 | 3.583638 |
3a6fbedf-d7a6-40bd-930e-48e5f32c3993 | bhutoriaumang/competitvecoding | magicship.cpp | #include <bits/stdc++.h>
using namespace std;
long long int x1,x2,yy1,y2;
pair < long long int , long long int > count(string s,long long int i){
pair <long long int , long long int> v;
v.first = 0;
v.second = 0;
while(i>=0){
if(s[i]=='U')
v.second++;
else if(s[i]=='R')
... | ALGO | 0.99988 | 3.711027 |
986a815b-b52d-4cec-ba86-694347f7aff3 | lyd0223/Programers | 탐욕법/최소신장트리(MST)/섬 연결하기(크루스칼알고리즘).cpp | #include <string>
#include <vector>
#include <algorithm>
using namespace std;
class UnionFind
{
public:
static int GetParent(vector<int>& _ParentList, int _NodeNum)
{
if (_ParentList[_NodeNum] == _NodeNum)
return _NodeNum;
return GetParent(_ParentList, _ParentList[_NodeNum]);
}... | ALGO | 0.999957 | 5.068792 |
8860256b-49b8-4a7a-a65c-ec1705fef63c | Sakupinera/LeetCode | common/99. Recover Binary Search Tree.cpp | #include <iostream>
#include <vector>
#include <algorithm>
using std::vector;
/*
You are given the root of a binary search tree (BST),
where the values of exactly two nodes of the tree were swapped by mistake.
Recover the tree without changing its structure.
*/
// Definition for a binary tree node.
struct TreeNode {
... | ALGO | 0.999999 | 5.964859 |
2441a02c-a703-48da-8583-2a2ee1096390 | rishi058/CP-DSA | CSES/08_String Algorithms/11_Pattern Positions.cpp | #include <bits/stdc++.h>
using namespace std;
#define int long long
#define all(v) v.begin(), v.end()
#define F(a,b,i) for (int i = a; i < b; i++)
#define Rev(a,b,i) for (int i = a; i >= b; i--)
#define RISHI ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);
template <typename dStruct>
void print(dStruct& vName)... | ALGO | 0.999762 | 4.708748 |
e2bc7dec-6cad-412d-ad2e-595963460edb | Anushkakumari123/youtube | cpp/recursion.cpp/countdistinc.cpp |
#include<iostream>
using namespace std;
int countdistinctwaytoclimbstairs(long long nstairs){
// Base cases
if(nstairs < 0){
return 0;
}
if(nstairs == 0){
return 1;
}
// Recursive case
int ans = countdistinctwaytoclimbstairs(nstairs - 1) + countdistinctwaytoclimbstairs(nsta... | ALGO | 0.999938 | 4.6903 |
ec2ee5d9-fb35-4004-8309-068e7fab3e86 | MarcosFelipeBC/competitive-programming | Codeforces/1207F - Remainder Problem (SQRT Decomposition).cpp | //https://codeforces.com/contest/1207/problem/F
#include <bits/stdc++.h>
using namespace std;
const int M = 707;
const int N = 500005;
long long vet[N];
long long memo[M+5][M+5];
int main(){
int q;
scanf("%d", &q);
while (q-- > 0){
int t, x;
long long y;
scanf("%d %d %lld", &t, &x, &y);
if(t == 1){
fo... | ALGO | 0.99942 | 3.710581 |
77599093-392d-407b-994d-85590aea3e89 | PlasmaControl/FreeMHD | OpenFOAM-v2206/ThirdParty/sources/boost/boost_1_74_0/libs/graph/example/cc-internet.cpp | /*
IMPORTANT!!!
~~~~~~~~~~~~
This example uses interfaces that have been deprecated and removed from
Boost.Grpah. Someone needs to update it, as it does NOT compile.
*/
#include <boost/config.hpp>
#include <fstream>
#include <vector>
#include <string>
#include <boost/graph/connected_components.hpp>
#includ... | ALGO | 0.87885 | 7.334918 |
546bdfd0-ff01-42f7-9db5-971b9648969c | itsoulos/OPTIMUS | src/Optimus/kmeans.cpp | #include <iostream>
#include <vector>
#include <cmath>
#include <fstream>
#include <algorithm>
#include "kmeans.h"
KMeans::KMeans(int K, int iterations, int minK)
{
this->K = K;
this->iters = iterations;
this->minK = minK;
this->means.resize(K);
this->PMeans.resize(K);
}
int KMeans::getNearestClu... | ALGO | 0.996103 | 4.645992 |
f3ac431f-cf65-4dfc-8558-7de9847d1d82 | raincross7/code-similarity | codes/train_code/problem484/problem484_109.cpp | #include <bits/stdc++.h>
using namespace std;
int main(){
string S,T;
cin >> S >> T;
bool flg = true;
if (S.size()+1 == T.size()){
for(int i=0;i<S.size();i++)
if (S[i] != T[i]){
flg = false;
break;
}
}
else
flg = false;
if (flg)
cout << "Yes\n";
else
cou... | ALGO | 0.999997 | 4.237527 |
9a10b152-828d-4d6b-b7c8-c02137928c4b | MaulanaFatullah/AlgoritmaPemrogramandanStrukturData | CallByReference3.cpp | #include <iostream>
using namespace std;
int main () {
int ilham, *amir, raka;
ilham = 75;
amir = &ilham;
raka = *amir;
cout << "Nilai ILHAM " << ilham << endl;
cout << "Nilai AMIR " << amir << endl;
cout << "Nilai RAKA " << raka << endl;
getchar();
return 0;
}
| ALGO | 0.990082 | 3.091049 |
37bb9a45-5116-4178-ab49-ef2b8fbd1dc8 | ArisenEngine/DirectXShaderCompiler | tools/clang/lib/Tooling/FileMatchTrie.cpp | #include "clang/Tooling/FileMatchTrie.h"
#include "llvm/ADT/StringMap.h"
#include "llvm/Support/FileSystem.h"
#include "llvm/Support/Path.h"
#include "llvm/Support/raw_ostream.h"
#include <sstream>
using namespace clang;
using namespace tooling;
namespace {
/// \brief Default \c PathComparator using \c llvm::sys::fs::... | TOOL | 0.974356 | 7.637262 |
8c2eaf2a-e834-4614-88eb-544aac200077 | riku546/cpp-tutorial | atcoder_problems/ABC324/A.cpp | #include <bits/stdc++.h>
#define rep(i, n) for (int i = 0; i < n; i++)
using namespace std;
int main()
{
int N;
cin >> N;
set<int> ans;
rep(i, N)
{
int temp;
cin >> temp;
ans.insert(temp);
}
if (ans.size() == 1)
cout << "Yes" << endl;
else
cout << "No" << endl;
} | ALGO | 0.999789 | 3.763486 |
dc6f9409-df13-444d-bf2e-00b0d80ebed5 | vinikruger12/cpp | codeforce/d.cpp | #include <bits/stdc++.h>
using namespace std;
#define int long long
signed main(){
int n,q;
cin >> n >> q;
vector<int>vec(n);
for(int i = 0; i < n; i++){
cin >> vec[i];
}
sort(vec.begin(), vec.end());
reverse(vec.begin(), vec.end());
vector<long long> pref(n);
pref[0] =... | ALGO | 0.999883 | 4.430512 |
550ae7d3-db8f-4083-9b4b-a3e88e358c17 | mdipierro/fermiqcd | Examples/application3.cpp | // Program: application3.cpp
#include "mdp.h"
// /////////////////////////////////////////////////////
class scalar_field: public mdp_field<float> {
public:
int ndim,nc;
scalar_field(mdp_lattice &a) {
allocate_field(a, 1);
ndim=a.ndim;
};
float &operator() (mdp_site x) {
return *(address(x));
};... | ALGO | 0.999769 | 4.91971 |
36b65fa4-2975-471a-ab24-6dae54b29b1c | FDU-VTS/LOL | src/fast_gicp/thirdparty/Eigen/doc/examples/class_FixedVectorBlock.cpp | #include <Eigen/Core>
#include <iostream>
using namespace Eigen;
using namespace std;
template<typename Derived>
Eigen::VectorBlock<Derived, 2>
firstTwo(MatrixBase<Derived>& v)
{
return Eigen::VectorBlock<Derived, 2>(v.derived(), 0);
}
template<typename Derived>
const Eigen::VectorBlock<const Derived, 2>
firstTwo(c... | TOOL | 0.920532 | 5.200637 |
fbeffdf8-b009-4db1-b1bf-4560ec71b200 | Naveenmamuduru1234/CSA0649-DAA | DAA 16.cpp | #include <stdio.h>
void merge(int arr[], int left, int mid, int right) {
int i, j, k;
int n1 = mid - left + 1;
int n2 = right - mid;
int L[n1], R[n2];
for (i = 0; i < n1; i++)
L[i] = arr[left + i];
for (j = 0; j < n2; j++)
R[j] = arr[mid + 1 + j];
i = 0;
j = 0;
k ... | ALGO | 0.999987 | 5.80432 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.