uuid string | repo_name string | relative_path string | content string | category string | algo_rel_score float64 | quality_score float64 |
|---|---|---|---|---|---|---|
ca24773b-ba42-4362-bffe-ae749946b319 | thanhtrnnn/dsa-pshit | data_structures/binarytree_traversal2.cpp | #include <bits/stdc++.h>
using namespace std;
using ll = long long;
//DSA11005
#define forup(i, a, b) for (int i = (a); i < (b); i++)
#define fordown(i, l, r) for (int i = l; i >= r; i--)
#define print(a, x, y) forup(i, x, y) cout << a[i] << " "
#define all(M) M.begin(), M.end()
#define tests... | ALGO | 0.999993 | 3.733246 |
f8d9436d-013f-4bf5-b19c-65196cfbc03f | ma1sky/c-c-labs | lab 2_1/lab 2_1.cpp | #include <cstdlib>
#include <iostream>
#include <clocale>
#include <ctime>
using namespace std;
int main()
{
setlocale(LC_ALL, "Rus");
cout << "Вывести сумму + чисел 1 части массива и сумму - чисел 2 части массива" << '\n';
time_t k;
srand(time(&k));
const int N = 10;
float X[N];
float s1 = 0.0;
float s2 = 0... | ALGO | 0.994144 | 3.596789 |
de54ec70-eca8-4600-9049-59f3ccac9324 | MaicolGomez/ACM | 2920.cpp | #include<bits/stdc++.h>
using namespace std;
#define pi (2.0*acos(0.0))
#define eps 1e-6
#define ll long long
#define inf (1<<29)
#define vi vector<int>
#define vll vector<ll>
#define sc(x) scanf("%d",&x)
#define scl(x) scanf("%lld",&x)
#define all(v) v.begin() , v.end()
#define me(a,val) memset( a , val ,sizeof(a) )
#... | ALGO | 0.999757 | 3.862426 |
5799804e-dde2-465f-a801-ff3e5d79adcf | TridentifyIshaan/C_CPP | 3rd Sem CPP/02 Patterns/30.cpp | /*
> Date Created: June 17, 2024
> Author: Ishaan Rastogi
> Purpose: To print ...
Eg- For n = 4,
4 5 6 7
3 4 5
2 3
1
> Operating System: This is only for Windows OS, it may or may not work on other OS
> Program Status: Working
*/
#include <iostream>
using namespace std;
int main () {
int n;
cout << "Enter ... | ALGO | 0.999962 | 5.142524 |
1f8d8d5f-7368-457a-900d-28beae6c9ee8 | leesuuuuumm/algorithm-study | 14주차/조서영/1072.cpp | #include <iostream>
using namespace std;
const int MAX = 1000000000;
int main(void)
{
ios_base::sync_with_stdio(0);
cin.tie(0);
long long X, Y;
cin >> X >> Y;
int Z = (Y * 100) / X; //확률이 바뀔 수 없는 경우
if (Z >= 99)
{
cout << -1 << "\n";
return 0;
}
... | ALGO | 0.999928 | 3.798268 |
6d456f75-a8d2-46b2-98a0-2af0ff410039 | sarvex/leetcode-g-forth | solution/1300-1399/1370.Increasing Decreasing String/Solution.cpp | class Solution {
public:
string sortString(string s) {
vector<int> counter(26);
for (char c : s) ++counter[c - 'a'];
string ans = "";
while (ans.size() < s.size()) {
for (int i = 0; i < 26; ++i) {
if (counter[i]) {
ans += (i + 'a');
... | ALGO | 0.999991 | 6.234902 |
5021bb60-42ac-4db9-9112-e00d899ef06e | StanleyDing/OnlineJudge | UVA/612_DNA_Sorting.cpp | #include<cstdio>
#include<algorithm>
#include<string>
#include<iostream>
using namespace std;
struct DNA{
int ith;
char s[55];
int sortedness;
bool operator<(const DNA &t) const{
if(sortedness == t.sortedness)
return ith < t.ith;
return sortedness < t.sortedness;
}
}dna[... | ALGO | 0.999905 | 3.99162 |
3e7dc014-9de8-4b52-bcab-f6ce79703d9a | arlafelda/Praktikum-Layout | windows/runner/utils.cpp | #include "utils.h"
#include <flutter_windows.h>
#include <io.h>
#include <stdio.h>
#include <windows.h>
#include <iostream>
void CreateAndAttachConsole() {
if (::AllocConsole()) {
FILE *unused;
if (freopen_s(&unused, "CONOUT$", "w", stdout)) {
_dup2(_fileno(stdout), 1);
}
if (freopen_s(&unuse... | TOOL | 0.998733 | 6.76775 |
b6c190cc-8809-4d6b-81ba-d6b86f76306f | johanvdw/SAGA-gis-git-mirror | saga-gis/src/tools/grid/grid_analysis/Soil_Texture.cpp | //---------------------------------------------------------
#include "Soil_Texture.h"
///////////////////////////////////////////////////////////
// //
// //
// //
///////////////////////////////////////////////////////////
//--------------------------------------------------... | TOOL | 0.939338 | 5.386119 |
51a21a2a-19b7-492c-9930-cfce30e45384 | msdesai1499/Cpp-Placement-Programs | smallest_positive_missing_number.cpp | #include <bits/stdc++.h>
using namespace std;
int main()
{
int n;
cin >> n;
int a[n];
for (int i = 0; i < n; i++)
{
cin >> a[i];
}
int temp;
for (int i = 0; i < n; i++)
{
while ((1 <= a[i] <= n) && (a[a[i] - 1] != a[i]))
{
temp = a[i];
a[i] = a[a[i] - 1];
a[a[i] - 1] = a[i];
}
}
int ans =... | ALGO | 0.999949 | 3.634773 |
9979ca25-ad25-4437-ae50-5e0433029138 | DNATUNA/Algorithm | BackJoon/C&C++/2455_지능형 기차.cpp | #include<cstdio>
int main() {
int a[2] = { 0, }, b[2] = { 0, }, c[2] = { 0, }, d[2] = { 0, };
int tmp=0, max = 0;
scanf("%d%d%d%d%d%d%d%d", &a[0], &a[1], &b[0], &b[1], &c[0], &c[1], &d[0], &d[1]);
tmp += a[1];
if (max < tmp) max = tmp;
tmp = tmp - b[0] + b[1];
if (max < tmp) max = tmp;
tmp = tmp - c[0] + c[1... | ALGO | 0.999804 | 3.451038 |
c9ec511f-dd65-4fc4-9682-586c96796c95 | shishirRsiam/My-Solve | V_Comparison.cpp | #include<bits/stdc++.h>
#define str string
#define ll long long
#define vec vector<ll>
#define py cout<<"Right\n"
#define pn cout<<"Wrong\n"
#define pb(x) push_back(x)
#define bee(x) x.begin(), x.end()
#define loop(s,i,n) for(int i=s;i<n;i++)
using namespace std;
bool fun()
{
int a, c; str b;
cin>>a>>b>>c;... | ALGO | 0.999801 | 3.732608 |
c20c1224-6a67-4e9d-b37a-68e0cc38b54c | delsiiin/leetcode | 链表/234.回文链表.cpp | /*
* @lc app=leetcode.cn id=234 lang=cpp
*
* [234] 回文链表
*/
// @lc code=start
/**
* 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) : ... | ALGO | 0.999826 | 6.339654 |
aad1e111-11d5-4c34-8d71-5dc64305a0a8 | HONGJICAI/LeetCode | cpp/590.cpp | // recursion.cpp
class Node {
public:
int val;
vector<Node*> children;
Node() {}
Node(int _val, vector<Node*> _children) {
val = _val;
children = _children;
}
};
class Solution {
void postOrderVisit(vector<int> &res, Node *root) {
if (!root)
return;
for (auto &node ... | ALGO | 0.999969 | 5.964763 |
ea95dbc7-947c-4a5b-888c-9c8badb3fd8e | JesusRojo1/rick_and_morty_wiki | 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 |
bc53cac7-f671-4a8a-a22a-d229012f7dc4 | Nihta/learn-cpp | Codesignal/The Core/Lab of Transformations/decipher.cpp | /**
* Hãy xem xét thuật toán mã hóa sau:
* Đối với mỗi ký tự thay thế nó bằng mã ASCII thập phân của nó.
* Nối tất cả các số thu được.
* Cho một chuỗi được mã hóa, trả về chuỗi ban đầu nếu biết rằng nó chỉ bao gồm
* các chữ cái viết thường.
*/
#include <iostream>
using namespace std;
string decipher(stri... | ALGO | 0.99832 | 4.175544 |
b22adade-ed07-42af-a58c-8dd0b9af1f0b | intlabSeJun/c-plus-coding-test | 11. 정렬/나이순 정렬 (10814).cpp | #include<iostream>
#include<string>
using namespace std;
int N;
struct P {
int age;
string name;
};
P person_info[100005];
P tmp[100005];
void merge_sort(int st, int en) {
if (st + 1 == en) return;
int mid = (st + en) / 2;
merge_sort(st, mid);
merge_sort(mid, en);
int L = st;
int R = mid;
for (int i = ... | ALGO | 0.999805 | 4.877747 |
6621cbc4-bafb-40ab-8d6e-6e658b7b2da1 | MarcoVitoC/compnest | Codeforces/2022/September/ChipsMoving.cpp | #include <bits/stdc++.h>
using namespace std;
int main(){
int n;
cin >> n;
vector<int> arr(n);
for (int i=0; i<n; i++){
cin >> arr[i];
arr.push_back(arr[i]);
}
int count = 0;
for (int i=0; i<n; i++){
if (arr[i] % 2 != 0){
count++;
}
}
cout << min(count, n - count) << endl;
return 0;
}
| ALGO | 0.999885 | 4.134126 |
ecc4805f-5c00-4f58-aad6-ded473865e14 | priyanshu639/CPPcodes | bubbleSort.cpp | #include <iostream>
using namespace std;
void bubleshort(int *arr,int n){
for(int i=0;i<n-1;i++){
for(int j=0;j<n-i-1;j++){
if(arr[j]>arr[j+1]){
swap(arr[j],arr[j+1]);
}
}
}
for(int i=0;i<n;i++){
cout<<arr[i]<<" , ";
}
}
int main(){
i... | ALGO | 0.999855 | 4.210145 |
d01cf676-c7eb-45df-b010-6fcad9212d5d | ibayashi-hikaru/allegro-legato | lammps/src/EXTRA-FIX/fix_numdiff.cpp | // clang-format off
/* ----------------------------------------------------------------------
Contributing author: Charles Sievers (UC Davis)
------------------------------------------------------------------------- */
#include "fix_numdiff.h"
#include <cstring>
#include "atom.h"
#include "domain.h"
#include "upd... | ALGO | 0.980652 | 6.189889 |
652e73b1-aba0-4980-9247-e9eac00ab058 | XueSongTap/cpp_track_3 | 16.1mongodb_cluster/mongo-src/mongo-src/mongo-driver/mongo-cxx-driver/src/mongocxx/collection.cpp | #include <mongocxx/collection.hpp>
#include <chrono>
#include <cstdint>
#include <limits>
#include <utility>
#include <bsoncxx/builder/basic/document.hpp>
#include <bsoncxx/builder/basic/kvp.hpp>
#include <bsoncxx/builder/basic/sub_array.hpp>
#include <bsoncxx/builder/basic/sub_document.hpp>
#include <bsoncxx/builder... | TOOL | 0.877899 | 4.748016 |
cf4c3c3f-31cc-4d92-90e0-95a93e277355 | phongtapcode/DSA_PTIT-2023 | DSA03008.cpp | #include<bits/stdc++.h>
using namespace std;
bool sx(pair<int,int> a, pair<int,int> b) {
return a.second<b.second;
}
int main() {
int t;
cin>>t;
while(t--) {
int n;
cin>>n;
vector<pair<int,int>> a;
int b,c;
int d[n+1];
int e[n+1];
for(int i=1; i<=n; i++) {
cin>>d[i];
}
for(int i=1; i<=n; i++) {... | ALGO | 0.999897 | 3.561253 |
852e5bdc-03d8-461f-81eb-6d235fab1d7c | thanh2811/Data-Structure-and-Algorithms---PTIT | Tham khao CTDLGT/Tree/Bai9.cpp | #include<bits/stdc++.h>
using namespace std;
struct Node{
int data;
Node *left, *right;
Node(int x){
data = x;
left = right = NULL;
}
};
int height(struct Node *root){
if(!root) return 0;
return(1+max(height(root->left),height(root->right)));
}
bool check(Node *root,int level... | ALGO | 0.999793 | 3.600738 |
31dd34d4-045a-4f4b-8f6b-580a645e7dd7 | mvancompernolle/ai_project | data/ospf-example.cpp | namespace boost {
enum graph_color_t { graph_color = 5556 };
BOOST_INSTALL_PROPERTY(graph, color);
}
int
main()
{
using namespace boost;
typedef
adjacency_list<vecS, vecS, directedS,
property<vertex_name_t, std::string>,
property<edge_color_t, std::string,
... | ALGO | 0.986585 | 4.367079 |
a7bf74d1-b69d-49d7-b29f-28abacd353a4 | DaniloHatz/beecrowd-cpp-solutions | Iniciante/2334-Patinhos.cpp | #include <iostream>
int main() {
unsigned long long p;
std::cin >> p;
while (p != -1) {
if (p != 0) --p;
std::cout << p << '\n';
std::cin >> p;
}
return 0;
} | ALGO | 0.999687 | 4.179044 |
fd7ad264-2da2-43b4-b2ee-35c95e01e1a2 | ankit3339/Pyhtonprojects | opencv-master/samples/cpp/camshiftdemo.cpp | #include "opencv2/core/utility.hpp"
#include "opencv2/video/tracking.hpp"
#include "opencv2/imgproc.hpp"
#include "opencv2/videoio.hpp"
#include "opencv2/highgui.hpp"
#include <iostream>
#include <ctype.h>
using namespace cv;
using namespace std;
Mat image;
bool backprojMode = false;
bool selectObject = false;
int ... | ALGO | 0.983357 | 6.418211 |
57347fd0-9615-410b-a37a-ba5166486fe3 | NiekBuwalda/ResearchProject | src/structures/ClausePointers.cpp | //
// Created by pim on 16-1-18.
//
#include <iostream>
#include <assert.h>
extern "C"{
#include "sylvan.h"
#include "lace.h"
}
#include "structures/Clause.h"
using std::vector;
using std::runtime_error;
using std::cout;
using std::endl;
using namespace sylvan;
Clause::~Clause() = default;
bool Clause::findBu... | ALGO | 0.998599 | 5.009028 |
927a0eac-feeb-430e-968b-df925331aea7 | WiLLStenico/TestesEOutrasBrincadeiras | C/borlandc/crtl/clib/vapp.cpp | /*-----------------------------------------------------------------------*
* filename - vapp.cpp
* C++ VECTOR APPLY
* This is called internally by the compiler to copy arrays of classes
* having assignment operators or reference constructors
*-----------------------------------------------------------------------*... | ALGO | 0.974091 | 6.269974 |
63f3eae2-a889-4482-be60-acb4730e8cbf | Wybxc/OpenJudge-Notes | String-Insert.cpp | #include <iostream>
using namespace std;
int main() {
string str, substr;
while (cin >> str >> substr) {
size_t midx = 0;
for (size_t i = 0; i < str.size(); ++i) {
if (str[i] > str[midx]) midx = i;
}
str.insert(midx + 1, substr);
cout << str << endl;
}
... | ALGO | 0.999565 | 4.228893 |
5e8278dd-b8f6-4a9d-86fd-aedd4e6c7336 | Jveras0924/NYU-Bridge-HWs | jv1558_Hw14.cpp |
#include <iostream>
#include <vector>
using namespace std;
void print(vector<int> const &input)
{
cout << "Min value in array: ";
cout << input.at(0) << endl;
cout << "Max value in array: ";
cout << input.at(1) << endl;
}
void findMinMax(vector<int> &v, vector<int> &temp, int startInd, int endInd);
vo... | ALGO | 0.999827 | 4.935056 |
72423e8c-e5ef-4838-a0c0-581115f8d89f | taehun0933/soma-PS | 1463/kth.cpp | #include <iostream>
#include <algorithm>
using namespace std;
int N;
int arr[1000001];
int main(void)
{
ios::sync_with_stdio(false);
cin.tie(NULL);
cin >> N;
arr[2] = 1;
arr[3] = 1;
for (int i{4}; i <= N; i++)
{
if (i % 2 == 0 && i % 3 == 0)
arr[i] = min({arr[i / 2], ... | ALGO | 0.999957 | 4.811901 |
b92f40da-51d8-49ac-85d5-b5317cf3486f | apelegrin/IP | G3.2.Martes/p6/p6_01_ejemplo1_01.cpp | #include <iostream>
using namespace std;
int main() {
/* Léxico*/
const char MF = '#';
const int DIFERENCIA = int('a') - int('A'); // 97 - 65 = 32
char EA_S;
char EA_R;
cin >> EA_S; //Comenzar;
//{ Inicialización del tratamiento }*
while (EA_S != MF){ //MIENTRAS EA ≠ MarcaFin HACER
... | ALGO | 0.971 | 3.177536 |
5a15001d-5c87-4e78-9906-4361ceb0c4c0 | piyushmishra12/codeforces-practice | insomnia_cure.cpp | #include<iostream>
using namespace std;
int main()
{
int k, l, m, n, d, count = 0;
cin>> k>> l>> m>> n>> d;
int i, a[d];
for(i = 0; i < d; i++)
a[i] = 1;
for(i = k - 1; i < d; i = i + k)
a[i] = 0;
for(i = l - 1; i < d; i = i + l)
a[i] = 0;
for(i = m - 1; i < d; i = i + m)
a[i] = 0;
for(i = n - 1; i < d;... | ALGO | 0.999728 | 3.03068 |
cc81c01d-503f-42e7-b789-b5befe1a5f78 | vaishnavideshmukh26/DSA | searching_sorting.cpp | #include<iostream>
using namespace std;
struct seit
{ string name;
int roll;
float sgpa;
};
class student{
public:
int n=3;
struct seit stude[3];
void input(){
for(int i=0;i<n;i++){
cout<<"name :";
cin>>stude[i].name;
cout<<"\n roll :";
cin>>stude... | ALGO | 0.999503 | 3.392991 |
9645b372-5e77-4f1a-b35d-c2c14adc3c4c | raphobt/SU2_OR | Common/src/toolboxes/CSymmetricMatrix.cpp | #include "../../include/toolboxes/CSymmetricMatrix.hpp"
#include "../../include/parallelization/mpi_structure.hpp"
#include "../../include/linear_algebra/blas_structure.hpp"
using namespace std;
#if defined(HAVE_MKL)
#include "mkl.h"
#ifndef HAVE_LAPACK
#define HAVE_LAPACK
#endif
#elif defined(HAVE_LAPACK)
/*--- Lapa... | ALGO | 0.999041 | 5.718272 |
77b2b785-e364-479f-8760-e5f02f973a7e | arxitekt0r/LeetCode | 35/task.cpp | #include <vector>
class Solution {
public:
int searchInsert(std::vector<int>& nums, int target)
{
return binarySearch(nums, 0, nums.size() - 1,target);
}
int binarySearch(const std::vector<int>& arr, int low, int high, int target)
{
if (low > high)
{
r... | ALGO | 0.999962 | 6.459652 |
85d372f4-b613-4791-87bf-d5b43091f5ca | tanishq6818/DSA | POTD APR 20TH/GFG POTD.cpp | Given two sorted arrays of size n and m respectively, find their union. The Union of two arrays can be defined as the common and distinct elements in the two arrays.
Example 1:
Input:
n = 5, arr1[] = {1, 2, 3, 4, 5}
m = 5, arr2 [] = {1, 2, 3, 6, 7}
Output:
1 2 3 4 5 6 7
Explanation:
Distinct elements including ... | ALGO | 0.999929 | 6.271942 |
f651ce5a-0324-485e-90a0-6af1e1db552d | henniekim/dip_filters | min_filter.cpp |
#include <opencv2/core.hpp>
#include <opencv2/imgcodecs.hpp>
#include <opencv2/highgui.hpp>
#include <stdio.h>
#include <opencv2/opencv.hpp>
#include <iostream>
#include <string>
#define _USE_MATH_DEFINES
#include <math.h>
#include "function_list.h"
static int pm_arr[9] = { 0,0,0,0,0,0,0,0,0 };
IplImage* min_filter(... | TOOL | 0.973696 | 3.845741 |
5449dcfc-6f4e-42dd-a436-ceec74042dba | yuchenle/ppc-bsc-llvm-taskgraph | compiler-rt/lib/gwp_asan/stack_trace_compressor.cpp | #include "gwp_asan/stack_trace_compressor.h"
namespace gwp_asan {
namespace compression {
namespace {
// Encodes `Value` as a variable-length integer to `Out`. Returns zero if there
// was not enough space in the output buffer to write the complete varInt.
// Otherwise returns the length of the encoded integer.
size_t... | ALGO | 0.886788 | 7.818335 |
ba73610e-fb3d-4173-9f10-8addacd220b6 | shubhamgyd/mission_TCS | Chegg/275_bst_to_complete_bst.cpp | #include <iostream>
#include <vector>
#include <queue>
using namespace std;
struct TreeNode
{
char data;
TreeNode *left;
TreeNode *right;
TreeNode(char ch)
{
data = ch;
left = NULL;
right = NULL;
}
};
TreeNode *insertNodes(TreeNode *root, char ch)
{
TreeNode *newNod... | ALGO | 0.999987 | 4.744689 |
6c429145-5b2c-44f2-9d40-585cc2e3270e | Eileen-Yu/cheatsheet | binary-search/minimize-the-maximum-difference-of-pairs.cpp | // https://leetcode.com/problems/minimize-the-maximum-difference-of-pairs/description/
// binary search to try on each ans +
// sort & greedy to make local optimum --> global optimuim
class Solution {
public:
// check if there is enough pairs with the difference <= diff
bool canFormPair(vector<int> &nums, int p, in... | ALGO | 0.999991 | 5.993285 |
c28bb2d8-34da-44b8-8463-44a2e2f338fe | muskan89/LeetCode | 560-subarray-sum-equals-k/560-subarray-sum-equals-k.cpp | class Solution {
public:
int subarraySum(vector<int>& nums, int k) {
int n=nums.size(),cnt=0;
map<int,int>mp;
//mp[nums[0]]++;
for(int i=1;i<n;i++){
nums[i]+=nums[i-1];
//mp[nums[i]]++;
}
for(int i=0;i<n;i++){
if(nums[i]==k){
... | ALGO | 0.999972 | 5.811131 |
56fca488-8d6a-4030-8310-2f9160142868 | millaker/MiGPU-llvm-project | libcxx/test/std/algorithms/alg.modifying.operations/alg.move/ranges.move.pass.cpp | // <algorithm>
// UNSUPPORTED: c++03, c++11, c++14, c++17
// UNSUPPORTED: GCC-ALWAYS_INLINE-FIXME
// template<input_iterator I, sentinel_for<I> S, weakly_incrementable O>
// requires indirectly_movable<I, O>
// constexpr ranges::move_result<I, O>
// ranges::move(I first, S last, O result);
// template<input_r... | TEST | 0.933797 | 5.518602 |
43f4046e-60c3-43b4-9353-8cb71225b807 | naymur92/CompetitiveProgramming_or_DSA_CPP | codeforces/1000_1859_B_Olya_and_Game_with_Arrays.cpp | /*
https://codeforces.com/problemset/problem/1859/B
*/
#include <bits/stdc++.h>
using namespace std;
typedef unsigned long long ull;
int main(){
int t;
cin >> t;
while(t--)
{
int n;
cin >> n;
vector<unsigned long> firstElems(n);
vector<unsigned long> secondElems(n);
for (int i = 0; i < n; ++i)
{
... | ALGO | 0.999801 | 3.99454 |
a0734cf3-0e79-4ac9-afb5-3b217084d5d1 | iamrajee/drone_swarm | code/EGO-Planner-v2/swarm-playground/interlaced_flight_ws/src/uav_simulator/so3_quadrotor_simulator/include/ode/libs/numeric/odeint/examples/chaotic_system.cpp | #include <iostream>
#include <boost/array.hpp>
#include <boost/numeric/odeint.hpp>
#include "gram_schmidt.hpp"
using namespace std;
using namespace boost::numeric::odeint;
const double sigma = 10.0;
const double R = 28.0;
const double b = 8.0 / 3.0;
//[ system_function_without_perturbations
struct lorenz
{
tem... | ALGO | 0.999916 | 6.172281 |
97a8e9e7-3998-4a38-a7e9-6e1152b4d087 | vkaast24/GAME | main.cpp | #include <iostream>
#include <stdio.h>
#include <stdlib.h>
#include <ctype.h>
#include <time.h>
char board [3][3];
const char PLAYER = '@';
const char COMPUTER = 'X';
void resetBoard();
void printBoard ();
int checkFreeSpaces();
void playerMove();
void computerMove();
char checkWinner();
void printWinner(char);
int ... | ALGO | 0.997714 | 4.868483 |
1faff7e7-a925-4cc3-adc8-dcfff2b77eed | salahashraf253/ProblemSolving | LeetCode/Easy/283. Move Zeroes/solution.cpp | class Solution {
public:
void moveZeroes(vector<int>& nums) {
int index=-1,sz=nums.size();
for(int i=0;i<sz;i++){
if(nums[i]==0){
index=i;
while (index < sz -1 && nums[index]==0)index++;
swap(nums[i],nums[index]);
}
}
... | ALGO | 0.999973 | 6.712295 |
02269f82-854d-417d-bff2-7d331d94f238 | witmaos6/LeetCode | 1058-lexicographically-smallest-equivalent-string/1058-lexicographically-smallest-equivalent-string.cpp | class DSU
{
vector<int> parent;
vector<int> rank;
public:
DSU(int n){
parent.resize(n);
rank.resize(n);
for(int i = 0; i < n; i++){
parent[i] = i;
}
}
int findPar(int u){
if(parent[u] != u){
parent[u] = findPar(parent[u]);
... | ALGO | 0.999993 | 6.417361 |
aa45e68c-668c-43f1-bfb2-4c68dcf60366 | Divyadarshan007/cppLearnings | cpp lecture-17(2D-Array Exercise)/average.cpp | #include <iostream>
using namespace std;
int main()
{
int row, col, sum = 0;
cout << "Enter number of Rows : ";
cin >> row;
cout << "Enter number of Cols : ";
cin >> col;
int arr[row][col];
for (int i = 0; i < row; i++)
{
for (int j = 0; j < col; j++)
{
cou... | ALGO | 0.979391 | 3.610535 |
95d6ee7a-0f19-49be-8c38-1724b2ad6ada | tsusu0409/atcoder | APG4b/ex20.cpp | #include <bits/stdc++.h>
using namespace std;
#include <atcoder/all>
using namespace atcoder;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
using ll = long long;
using P = pair<int,int>;
// x番の組織が親組織に提出する枚数を返す
// childrenは組織の関係を表す2次元配列(参照渡し)
int count_report_num(vector<vector<int>> &children, int x) {
// (ここに... | ALGO | 0.99992 | 4.836655 |
c2e3903e-f97a-408b-bd8f-98935074b949 | viniciushfr/Uri | Uri_1155.cpp | #include <iostream>
#include <iomanip>
using namespace std;
int main(){
double S=0;
for(int i = 1;i<=100;i++)S+=1.0/i;
cout<<fixed<<setprecision(2)<<S<<endl;
}
| ALGO | 0.99891 | 3.769764 |
9ba3dd96-493a-4801-bacb-1e925457ca18 | sxu39/TP-RPMD | lammps-stable_2Aug2023_update2/src/EXTRA-COMPUTE/compute_gyration_shape.cpp | // clang-format off
/* ----------------------------------------------------------------------
* Contributing author: Evangelos Voyiatzis (Royal DSM)
* ------------------------------------------------------------------------- */
#include "compute_gyration_shape.h"
#include "error.h"
#include "math_eigen.h"
#inc... | ALGO | 0.996488 | 7.501672 |
a603cf86-3a06-4a5e-abd7-c9cf37613b1b | legendPerceptor/ns3-raft | examples/raftcore/src/raft_node.cpp | //
// Created by Hython on 2020/3/16.
//
#include "raft_node.h"
#include "ns3/core-module.h"
#include "ns3/network-module.h"
#include "ns3/csma-module.h"
#include "ns3/internet-module.h"
#include "ns3/applications-module.h"
#include "ns3/ipv4-global-routing-helper.h"
#include "example_common.h"
#include <sstream>
NS_... | ALGO | 0.924418 | 5.922997 |
58df2318-44ba-49e6-a6b6-a2b4cff2a5ca | ttamx/Competitive-Programming | atcoder/agc023/F_01_on_Tree.cpp | #include<bits/stdc++.h>
#include<ext/pb_ds/assoc_container.hpp>
#include<ext/pb_ds/tree_policy.hpp>
using namespace std;
using namespace __gnu_pbds;
using ll = long long;
using db = long double;
using vi = vector<int>;
using vl = vector<ll>;
using vd = vector<db>;
using pii = pair<int,int>;
using pll = pair<ll,ll>;
u... | ALGO | 0.999956 | 3.808118 |
318e3c9f-9ef5-4fe6-b1a8-2f8e3b45c4db | peterhyun1234/Algorithm_team_BOJ | YJ/20200904/BinSearch/입국심사.cpp | #include <string>
#include <vector>
#include <algorithm>
using namespace std;
bool is_possible(long long mid, int n, vector<int> times) {
long long sum = 0;
for (int i = 0; i < times.size(); i ++) {
sum += mid / times[i];
}
if(sum >= n) return true;
else return false;
}
long long solution... | ALGO | 0.999981 | 5.957895 |
10b06f4f-1fdc-4cd0-956a-aa74a279df84 | Seifalla/C-Boolean-Satisfiability-Problem-Solver | DPLL.cpp | #include <iostream>
#include <string>
#include <vector>
#include <cmath>
#include <algorithm>
#include <cstdlib>
#include <time.h>
#include <fstream>
using namespace std;
vector<int> read_file(ifstream &file, vector< vector<int> >& phi);
bool DPLL(vector< vector<int> > phi, vector<int>& variables);
void simplify(ve... | ALGO | 0.999545 | 3.821546 |
a1e6de24-3131-461e-939a-5f8db49b65c0 | DEEPLERZERA/Projects-in-C- | PORCOGAL.CPP | #include<stdio.h>
#include<conio.h>
#include<iostream.h>
#include<ctype.h>
#include<iomanip.h>
#include<dos.h>
void main() {
textbackground(BLUE);
clrscr();
gotoxy(1,3);textcolor(7);cprintf("================================================================================");
gotoxy(1,4);textcolor(4);cprintf(" ... | ALGO | 0.971846 | 3.563511 |
2e62b72d-69e3-4bbc-aa0f-626a9d9ef3c6 | cgtests/daa | assignment4/PART-A.cpp | //Implement Merge Sort using divide and conquer strategy. Note the time required
//for best and worst case situations on large number of values.
#include <iostream>
#include <vector>
#include <chrono> // For timing
// Function to merge two subarrays
void merge(std::vector<int>& arr, int left, int mid, int right) {
... | ALGO | 0.999841 | 6.966663 |
2d9f6b56-6056-42a3-bcc8-2858791e3f20 | rforcen/Mandelbrot_metal_python | Mandelbrot/cpp/ColorScale.cpp | // PURPOSE: Color scaling and RGB-HSL conversion functions
#include "ColorScale.h"
/******************************************************************************
FUNCTION: ColorScaleRGB
PURPOSE: Returns the RGB linear interpolated color between 2 colors
If Ratio=0, you get Col1,
If Ratio=1, you get Col2
IN: C... | ALGO | 0.850473 | 5.817151 |
d4799e49-c0b8-4471-9c89-50331037a472 | giovaneneves7/ecocoleta | 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 |
ac5b1622-d6d8-44e5-8e5f-c4b68a32d6a7 | proRamLOGO/Competitive_Programming | CodeForces/546_C.cpp | #include <bits/stdc++.h>
#define pb push_back
#define mp make_pair
#define fr first
#define sc second
#define MOD 1000000007
#define len(x) x.size()
#define min3(a, b, c) min(a, min(b, c))
#define max3(a, b, c) max(a, max(b, c))
#define all(v) v.begin(), v.end()
#define alla(a,n) a, a + n
using namespace std;
ty... | ALGO | 0.999759 | 3.586875 |
8a32a955-f1ec-4a96-9698-7bbea746b318 | fanventory/skylineProject | pre_process/Table.cpp | #include "SPSkyline.cpp"
class Table
{
private:
vector<tripleRow> row; // 倒排索引组
map<int, int> tableIndex; // 倒排索引组索引
public:
~Table()
{
for (vector<tripleRow>::iterator it = this->row.begin(); it < this->row.end(); it++) {
(*it).triples.~vector();
}
this->row.~vector();
}
// 获取内部对象row
vector<tripleRow>... | ALGO | 0.998184 | 3.520657 |
3f35e057-f424-4a91-87db-610116396e25 | hgoetzTHU/NAMI_WS20_21 | Modules/TumorInvasionAnalysis/MiniApps/MriNormalization.cpp | #include "itkImageRegionIterator.h"
#include "mitkCommandLineParser.h"
#include "mitkIOUtil.h"
#include "mitkImageCast.h"
#include <mitkITKImageImport.h>
using namespace std;
typedef itk::Image<unsigned char, 3> SeedImage;
typedef itk::Image<mitk::ScalarType, 3> FeatureImage;
typedef itk::ImageRegionIterator<SeedIma... | TOOL | 0.852759 | 4.751053 |
dc385045-7959-423a-bb61-9171422417fb | DAVID-NGUYEN-S16/Competition-programming_ | Atcoder 276/A.cpp | #include<bits/stdc++.h>
using namespace std;
#define ll long long
const long long MAX = 1e6 + 7;
const long long INF = 1e18 + 7;
const long long MOD = 1e9 + 7;
void solve()
{
string s; cin>>s;
int id = -1;
for(int i = 0; i< s.size(); i++){
if(s[i] == 'a') id = i+1;
}
cout<<id;
}
int main()
... | ALGO | 0.995859 | 3.062096 |
53047045-12d7-4ede-83d7-2e859bdeec7b | alkayesrifat/Contests | 23 . Codeforces Round 1035 (Div. 2)/A_Add_or_XOR.cpp | /**
* All Praise to Allah
* ---------------------
* Author: Al Kayes Rifat
* Portfolio : alkayesrifat.netlify.app
* Date : 05/07/2025 (Saturday)
* Time : 20:37
* ---------------------
*/
#include <bits/stdc++.h>
using namespace std;
int main()
{
ios::sync_with_stdio(false);
cin.tie(nullp... | ALGO | 0.999523 | 4.694792 |
cb5c62a2-fc28-42f5-9af1-30d1d52318a0 | kfullington/TestPricing | ql/experimental/finitedifferences/gbsmrndcalculator.cpp | /* -*- mode: c++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*! \file gbsmrndcalculator.hpp
\brief risk neutral terminal density calculator for the
Black-Scholes-Merton model with skew dependent volatility
*/
#include <ql/math/functional.hpp>
#include <ql/math/solvers1d/brent.hpp>
#... | ALGO | 0.999793 | 7.82774 |
defbe740-41a1-4f96-86db-603e3b24df3b | Apress/learn-cocos2d-game-dev-w-ios-5 | CH05_code/ScenesAndLayers08/libs/Box2d/Dynamics/Contacts/b2Contact.cpp | #include <Box2D/Dynamics/Contacts/b2Contact.h>
#include <Box2D/Dynamics/Contacts/b2CircleContact.h>
#include <Box2D/Dynamics/Contacts/b2PolygonAndCircleContact.h>
#include <Box2D/Dynamics/Contacts/b2PolygonContact.h>
#include <Box2D/Dynamics/Contacts/b2ContactSolver.h>
#include <Box2D/Collision/b2Collision.h>
#include... | ALGO | 0.996209 | 7.727654 |
13db122b-6e31-40bb-ae0a-7e8961d05a9a | siddhantb99/LeetCode-Solutions | 30DaysLeetcodeChallenge_April/1046. Last Stone Weight.cpp | /*
Last Stone Weight
Solution
We have a collection of stones, each stone has a positive integer weight.
Each turn, we choose the two heaviest stones and smash them together. Suppose the stones have weights x and y with x <= y. The result of this smash is:
If x == y, both stones are totally destroyed;
If x != y, the... | ALGO | 0.999973 | 5.577675 |
4c0df2de-9d0b-4104-b0fe-ee58a3bf0859 | INTr0py/BAA | Test/src/box2D/b2PrismaticJoint.cpp | #include <Box2D/Dynamics/Joints/b2PrismaticJoint.h>
#include <Box2D/Dynamics/b2Body.h>
#include <Box2D/Dynamics/b2TimeStep.h>
// Linear constraint (point-to-line)
// d = p2 - p1 = x2 + r2 - x1 - r1
// C = dot(perp, d)
// Cdot = dot(d, cross(w1, perp)) + dot(perp, v2 + cross(w2, r2) - v1 - cross(w1, r1))
// = -dot... | ALGO | 0.99883 | 5.967193 |
f31e8c9c-bddc-4c61-9f10-cccf244e2a09 | avesloguzova/spbau_homework | algorithms/contest_150223_aum/task_b.cpp | #include <vector>
#include <deque>
#include <algorithm>
#include <iostream>
#include <fstream>
using std::vector;
using std::deque;
using std::min;
const int INF = INT32_MAX/2 -1001;
void floid(vector<vector<int> > &d, int n) {
for (int k = 0; k < n; ++k)
for (int i = 0; i < n; ++i)
for (int ... | ALGO | 0.999869 | 3.718069 |
c56f5d0a-a037-4a06-ae94-3e26a980f203 | ramtung/apnotes | 13_OperOver/02_ComplexAddInc.cpp | #include <iostream>
using namespace std;
class Complex {
public:
Complex(double r, double i) : real(r), imag(i) {}
Complex(double r) : real(r), imag(0) {}
void print() const;
// Complex add(const Complex& c) const;
Complex operator+(const Complex& c) const;
// void inc(const Complex& c);
Comple... | ALGO | 0.864922 | 5.114033 |
cca3cbc4-1b4c-463e-b2ff-49254ddcc3ec | raincross7/code-similarity | codes/train_code/problem033/problem033_65.cpp | #include <iostream>
#include <algorithm>
#include <cstdio>
#include <cmath>
#include <math.h>
#include <string>
#include <string.h>
#include <stack>
#include <queue>
#include <vector>
#include <utility>
#include <set>
#include <map>
#include <stdlib.h>
using namespace std;
#define ll long long
#define ld long double
... | ALGO | 0.999671 | 3.397791 |
2dcfc0bb-50a3-4031-afbc-d45ca7414925 | Rohansarna/DSA-Practice-Questions | Subset Sum Problem - GFG/subset-sum-problem.cpp | // { Driver Code Starts
//Initial template for C++
#include<bits/stdc++.h>
using namespace std;
// } Driver Code Ends
//User function template for C++
class Solution{
public:
bool isSubsetSum(vector<int>arr, int sum){
bool dp[arr.size() + 1 ][sum + 1];
memset(dp , 0 , sizeof(dp));
... | ALGO | 0.999673 | 5.698466 |
c3b4de75-01cb-403c-a2c5-739dc94e3173 | Michaelmilk/leetcode | lt/Binary Tree Maximum Path Sum.cpp | #include <iostream>
#include <windows.h>
using namespace std;
struct TreeNode {
int val;
TreeNode *left;
TreeNode *right;
TreeNode(int x) : val(x), left(NULL), right(NULL) {}
};
int ans = INT_MIN;
int maxPathSumSolve(TreeNode *root)
{
if (NULL == root)
{
return 0;
}
int rtVal = root->val;
int lMax = 0... | ALGO | 0.999969 | 4.616148 |
c6863c54-3010-46cc-a996-d3e72399827a | matheuuspalma/class-project-cpp | main.cpp | /*Trabalho Avaliativo 01 - Desempenho das Turmas em Disciplinas
Arquivo: Programa Principal
Gustavo Rocha de Barros
DRE: 119050063*/
#include <string>
#include "Turma.h"
#include <unistd.h>
#define MAX_ALUNOS 10
#define NUM_PERIODO 8 //Numero de periodos escolhidos
void printMapStringFloat(map <string, float> p){
... | ALGO | 0.904126 | 4.108859 |
d2332b5a-0521-4335-aeda-34eb5a4913c0 | vivek-panchal/Dynamic-Programming | Leetcode 312. Burst Balloons.cpp | // Memoiozation
class Solution {
public:
int solve(int i,int j,vector<int>&nums,vector<vector<int>> &dp){
if(i>j){
return 0;
}
if(dp[i][j]!=-1){
return dp[i][j];
}
int maxi=INT_MIN;
for(int k=i;k<=j;k++){
int coins=nums[i-1]*nums[k... | ALGO | 0.99999 | 5.833113 |
cdf34f3b-f970-45f1-9591-8bb1dfc2e8f7 | Rajkumar992199/C-Plus-Plus | codeforces/800/344A_Magnets.cpp | #include<bits/stdc++.h>
using namespace std;
int main() {
int n,k=0;
cin >> n;
int p[n];
for(int i=0; i<n;i++){
cin >> p[i] ;
if(p[i] == p[i-1]) continue;
k++;
}
cout << k ;
} | ALGO | 0.999853 | 3.442088 |
99fb31a9-00f7-4e28-8539-983b1290632c | Oein/PS | acmicpc/2___/27__/275_/2753/2753.cpp | #include <iostream>
using namespace std;
int main() {
int year = 0;
cin >> year;
if ((year % 4 == 0 && year % 100 != 0) || year % 400 == 0) cout << "1";
else cout << "0";
}
| ALGO | 0.999981 | 4.81683 |
9878edd9-1791-4fbb-a38b-5b92af622f60 | IAS-Astrophysics/athenak | src/mhd/mhd_fofc.cpp | #include "athena.hpp"
#include "mesh/mesh.hpp"
#include "driver/driver.hpp"
#include "coordinates/coordinates.hpp"
#include "coordinates/cartesian_ks.hpp"
#include "coordinates/cell_locations.hpp"
#include "eos/eos.hpp"
#include "mhd/rsolvers/llf_mhd_singlestate.hpp"
#include "mhd.hpp"
namespace mhd {
//--------------... | ALGO | 0.998775 | 5.284339 |
f98ccca2-84bc-452c-bfac-0e61283e659f | ddupg/ACM_Code | kuangbin/简单搜索/H.cpp | #include <iostream>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <queue>
#include <algorithm>
#define mem(a, val) memset((a), (val), sizeof(a))
using namespace std;
const int maxn=110;
int vis[maxn][maxn], A, B, C, E;
struct Node
{
int a, b, fa;
char op[15];
Node(int a=0, int b=0):a(a), ... | ALGO | 0.999955 | 3.974326 |
74431848-e9ca-4bd2-b095-20c1ef4961ab | Saikiran-git/Cpp | Math/Swapping 2 number without using 3rd variable.cpp | #include <bits/stdc++.h>
using namespace std;
int main(){
ios_base::sync_with_stdio(false);
cin.tie(NULL);
int a, b;
cin >> a >> b;
a ^= b ^= a ^= b;
cout << a << " " << b << endl;
return 0;
} | ALGO | 0.999985 | 3.270865 |
92773d6c-2ad7-4207-92b1-d4cbccc2ff29 | Azharul-Raj/xcpc | week14/day1/G.cpp | /**
* author: raj_001
* created: 2024-06-29 21:50:08
**/
#include <bits/stdc++.h>
#define nl '\n'
#define int long long int
using namespace std;
#define MOD 1000000007
#define INF 1e18
#define pb push_back
#define ppb pop_back
#define mp make_pair
#define ff first
#define ss second
#define PI 3.14159265358979... | ALGO | 0.999907 | 4.777902 |
8f7cf875-de71-4d31-9f5b-a175d1b2a03f | Mindjolt2406/Competitive-Programming | Codeforces/GYM/2021_22_Brazil_Regional/E.cpp | // clang-format off
#include<bits/stdc++.h>
// g++ -std=c++17 -Wl,-stack_size -Wl,0x10000000 main.cpp
#define mp make_pair
#define pu push_back
#define INF 1000000001
#define MOD 1000000007
#define EPS 1e-6
#define ll long long int
#define ld long double
#define fi first
#define se second
#define t1(x) c... | ALGO | 0.999791 | 5.047362 |
cdb16d8f-86e2-4fe1-9fb7-7d2d6ad7ae84 | Spirit599/algorithm | lintcode/1001_1.cpp | //1001 · 小行星的碰撞
class Solution {
public:
/**
* @param asteroids: a list of integers
* @return: return a list of integers
*/
vector<int> asteroidCollision(vector<int> &asteroids) {
vector<int> ans;
stack<int> to_right;
for(int num : asteroids)
{
if(nu... | ALGO | 0.99998 | 5.295284 |
7607fc65-1456-46ff-9e96-ff9da5c48521 | Singhthakuri/cpp-program | cpp-program/Function/overlaoding.cpp | #include<iostream>
using namespace std;
int area( int l,int b){
return l*b;
}
int area(int l){
return (l*l);
}
int main()
{
int l,b;
cout<<"Enter length and breadth";
cin>>l>>b;
int square=area(l);
int rectangle=area(l,b);
cout<<"Area is rectangle :"<<rectangle<<endl;
cout<<"Area of ... | TOOL | 0.963656 | 3.706677 |
f860081a-1113-484f-8ec5-c23c15a15d42 | ishandutta2007/codeforces | wxhtzdy/normal/409/H.cpp | #include <bits/stdc++.h>
using namespace std;
int main() {
ios::sync_with_stdio(false);
cin.tie(0);
int a, b;
cin >> a >> b;
cout << a + b;
return 0;
} | ALGO | 0.995422 | 3.619095 |
2f528f5f-dda7-436c-a994-a498a8352184 | xidianlina/cppprimer | chapter_11_07.cpp | #include <iostream>
#include <string>
#include <map>
#include <vector>
int main()
{
using namespace std;
map<string, vector<string>> family;
string first_name, child_name;
while ([&]()->bool {cout << "ͥ:"; return cin >> first_name&&first_name != "end"; }())
{
cout << "뺢ӵ:";
while (cin >> child_name&&child_n... | TOOL | 0.897322 | 4.359853 |
a2a1c4d5-970f-46cc-ba17-edeb12eca778 | aniketvs/string | rearrange.cpp | #include<bits/stdc++.h>
using namespace std;
bool rearange(string s){
map<char,int> m;
for(int i=0;i<s.length();i++){
m[s[i]]++;
}int n=s.length();
char a[n];
for(int k=0;k<n;k++){
a[k]='0';
}
int i=0;
map<char,int> ::iterator it;
for(it=m.begin();it!=m.end();it++){
int j=i;
... | ALGO | 0.999992 | 3.882012 |
80eedca4-7084-4566-8406-967bda1eb62c | G0m0r0/Small-Projects | School projects/DEV C++/zadachi/78l10 chisla ot m do n da se delqt na 5.cpp | #include <iostream>
using namespace std;
int main ()
{
int m,n;
do{
cout<<"m<n"<<endl;
cout<<"vavedi m=";
cin>>m;
cout<<"vavedi n=";
cin>>n;
}
while (m>n);
while (m<=n)
{
if(m%5==0) cout<<" chisloto se deli "<<m<<endl;
m++;
}
return 0;
}
| ALGO | 0.997492 | 3.3463 |
e9837a46-e96e-4c04-be3b-c02781e23037 | pehamTom/polyfy | apps/main.cpp | #include "../include/Ideal.hpp"
#include "../include/Parse.hpp"
#include "../include/Utils.hpp"
#include <chrono>
#include <cstdlib>
#include <iostream>
#include <stdlib.h>
auto helper_string = "usage: polyfy [path_to_aig]";
Ideal from_circuit(const Circuit &c) {
Ideal I;
for (auto &var : c.get_vars()) {
I.a... | TOOL | 0.920915 | 5.253808 |
23f7e9de-9e8d-4e55-9b82-93c03ff57d99 | Vineet2511SRM/CPP | Loops/program2.cpp | #include <iostream>
int main() {
int n;
int sum = 0;
int count = 0;
int num;
// Input the number of integers (n)
std::cout << "Enter the number of integers (n): ";
std::cin >> n;
// Ensure n is a positive integer
if (n <= 0) {
std::cout << "Invalid input for n. It must be ... | ALGO | 0.986482 | 5.33217 |
25e8cf3d-15c0-43c0-a5ee-c41cfe56f412 | clover-forever/AG-practice | CodingHW/hw10/cut_point.cpp | #include <iostream>
#include <vector>
#include <algorithm>
using namespace std;
vector<vector<int>> graph;
vector<int> dfn, low;
vector<pair<int, int>> result;
int dep;
void dfs(int cur, int par)
{
int child = 0;
dfn[cur] = low[cur] = ++dep;
for (auto &i : graph[cur])
{
if (!dfn[i])
{... | ALGO | 0.999977 | 4.829175 |
e4afe362-53e7-4212-9dde-a778aff45da6 | ishandutta2007/codeforces | xlk/normal/205/E.cpp | #include<stdio.h>
#include<iostream>
#include<string.h>
#include<stdlib.h>
#include<algorithm>
#include<vector>
using namespace std;
#define fr(i,n) for(int i=0;i<n;i++)
#define fo(i,n) for(int i=1;i<=n;i++)
#define fe(i,n) for(__typeof(n.begin()) i=n.begin();i!=n.end();i++)
char a[200020];
char b[200020];
int d[30];
i... | ALGO | 0.99935 | 3.352195 |
5e6bf661-b071-478d-9069-78767cb0fb37 | Ashutosh-Routray/CSES-Answer-Set | Introductory Problems/Permutations.cpp | #include <bits/stdc++.h>
#define ll long long int
using namespace std;
int main()
{
ll n;
cin>>n;
if(n==1)
{
cout<<"1";
return 0;
}
if(n<4)
{
cout<<"NO SOLUTION";
return 0;
}
for(ll i=2;i<=n;i+=2)
cout<<i<<" ";
for(ll i=1;i<=n;i+=2)
cout<... | ALGO | 0.999974 | 3.847809 |
18868f5c-dc0d-4fe2-a8d4-2c17399c5f2b | JeffersonCarvalh0/uri-problems | maratonas/sbc-2012/concurso-de-contos/main.cpp | // WA
# include <iostream>
# include <string>
using namespace std;
int main() {
ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);
int n, l, c, c_total, l_total;
string s;
while (cin >> n >> l >> c) {
l_total = c_total = 0;
for (int i = 0; i < n; ++i) {
cin >> s;
... | ALGO | 0.999671 | 3.70475 |
b083e9c6-74b5-41e6-bf2f-c31e762a3094 | bruce1114/temporalgraphcube | src2/baseline.cpp | #include"TempGCube.hpp"
#include<iostream>
using namespace std;
vector<int> TempGCube::logTable=vector<int>();
bool vertexEqual(const vector<string>& a,const vector<string>& b){
if(a.size()!=b.size()) return false;
for(int i=0;i<a.size();++i){
if(a[i]!=b[i]) return false;
}
return true;
}
bo... | DATA | 0.921967 | 3.503095 |
0607eea6-d812-4b10-b0cc-3bd7b434a4eb | ShapeShift3D/cgal | Surface_mesh_shortest_path/test/Surface_mesh_shortest_path/Surface_mesh_shortest_path_test_2.cpp | #include <cstdlib>
#include <iomanip>
#include <iostream>
#include <fstream>
#include <utility>
#include <cmath>
#include <CGAL/Random.h>
#include <CGAL/Exact_predicates_inexact_constructions_kernel.h>
#include <CGAL/Polyhedron_3.h>
#include <CGAL/Polyhedron_items_with_id_3.h>
#include <CGAL/boost/graph/iterator.h>... | TEST | 0.93616 | 6.57144 |
257c1fa9-01c5-4587-bb3d-4e58e8bb3139 | mridul0509/Daily_Practice | CEC_GEU/Day1_solution1/Day1_solution1.cpp | #include<iostream>
#include<vector>
#include<algorithm>
using namespace std;
int main()
{
vector<int> arr1{ 7,2,5,3,5 };
vector<int> arr2{ 7,2,5,4,6,3,5,3 };
sort(arr1.begin(), arr1.end());
sort(arr2.begin(), arr2.end());
for (auto i : arr1)
{
cout << i << " ";
}
cout << endl... | ALGO | 0.999864 | 4.683798 |
e1afed2e-8e0f-4d70-9db2-85c2c61faa0e | StarLord13c/Lab-5 | point7.cpp | #include <iostream>
#include <cctype>
#include <Windows.h>
using namespace std;
// 7. Реалізуйте набір особистих функцій tolowerR(ch), toupperR(ch), isalphaR(ch), islowerR(ch), isupperR(ch), isalnumR(ch) для роботи із символами російського алфавіту.
char tolowerR(char ch) // переведення символу в нижній регістр росій... | TOOL | 0.922085 | 3.285455 |
2423aa3d-11e2-4615-8642-3421c5c4522d | yogeshk39/DSA | 3 Arrays/3.3 Arrays/print_row_wise.cpp | #include <iostream>
using namespace std;
void printRowArray(int arr[][3], int row, int col)
{
for (int i = 0; i < row; i++)
{
for (int j = 0; j < col; j++)
{
cout << arr[i][j];
}
cout << endl;
}
}
int main()
{
int arr[3][3];
int row = 3;
int col = 3;
... | ALGO | 0.986992 | 3.837084 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.