uuid string | repo_name string | relative_path string | content string | category string | algo_rel_score float64 | quality_score float64 |
|---|---|---|---|---|---|---|
4eaa2c6c-0097-4d7a-8893-c2ddf9d99178 | Erdem-Aygunes/calculator | src/CalcManager/CEngine/scioper.cpp | #include "Header Files/CalcEngine.h"
using namespace CalcEngine;
using namespace CalcEngine::RationalMath;
// Routines to perform standard operations &|^~<<>>+-/*% and pwr.
CalcEngine::Rational CCalcEngine::DoOperation(int operation, CalcEngine::Rational const& lhs, CalcEngine::Rational const& rhs)
{
// Remove an... | TOOL | 0.992056 | 7.014946 |
25fcb919-ad1d-4b32-9cbd-31da14466f90 | suraj-aayush/Leetcode-Solutions | Easy Questions/2363. Merge Similar Items.cpp | class Solution {
public:
vector<vector<int>> mergeSimilarItems(vector<vector<int>>& items1, vector<vector<int>>& items2) {
map<int,int> m;
for(int i=0;i<items1.size();i++)
{
m[items1[i][0]] = items1[i][1];
}
for(int i=0;i<items2.size();i++)
{
... | ALGO | 0.999935 | 5.663926 |
20cef5e1-225c-48d8-8446-72fe4af947fe | lakshits11/LeetCode | 0567-permutation-in-string/0567-permutation-in-string.cpp | class Solution {
bool areVectorsEqual(vector<int> a, vector<int> b){
for(int i=0; i<26; i++){
if(a[i]!=b[i]) return false;
}
return true;
}
public:
bool checkInclusion(string s1, string s2) {
if(s2.size()<s1.size()) return false;
vector<int> freqS1(26, 0);... | ALGO | 0.999973 | 6.325734 |
c54271b5-2cc9-4d08-9afe-fd95425604bb | bigyanic/Hacktoberfest-Simple-Practice-Programmes | Cpp/Imakshat47_binary2DecimalUsingInBuildFun.cpp | /*
# Program for Binary To Decimal Conversion
Given a binary number as input, we need to write a program to convert the given binary number into an equivalent decimal number.
Examples :
Input : 111
Output : 7
Input : 1010
Output : 10
Input: 100001
Output: 33... | ALGO | 0.998456 | 6.268778 |
92c4e8c4-5eb9-4cea-bbb7-91de430e18c0 | vrangr1/competitive-programming | contests/codechef/other_rounds/ecpc1.0/tree_trimming.cpp | /***************************************************
* AUTHOR : Anav Prasad
* Nick : Vrangr
****************************************************/
#include <bits/stdc++.h>
using namespace std;
typedef long long int lli;
class Graph
{
int V; // No. of vertices
// Pointer to an array containing
//... | ALGO | 0.999869 | 5.238561 |
dbbdb642-f9c1-4061-af60-da3e0ef28fe2 | joao-borrego/advanced-cpp | 4.STL/Lists/src/Lists.cpp | #include <iostream>
#include <list>
using namespace std;
void printList(list<int> &numbers) {
for (const auto& elem : numbers) {
cout << elem << " ";
}
cout << endl;
}
int main() {
list<int> numbers;
numbers.push_back(1);
numbers.push_back(2);
numbers.push_back(3);
number... | ALGO | 0.990851 | 5.089151 |
1f6424ae-4043-40fe-b28a-8d9a05346267 | miguelsndc/competitive-programming-lib | Solutions/Weekly/29-03-2025/B.cpp | #include <bits/stdc++.h>
using namespace std;
using i64 = long long;
using u32 = unsigned;
using u64 = unsigned long long;
constexpr i64 inf = 1E18;
constexpr int maxn = 1e5 + 5;
int n; string s;
int dp[maxn][4];
int main()
{
ios_base::sync_with_stdio(0);
cin.tie(0);
cin >> n; cin >> s;
memset(dp, 0... | ALGO | 0.999971 | 4.17972 |
5797a5fa-3d1a-4654-97fa-aec15fba6042 | kartikx/DSA | Graphs/ShortestPaths/test.cpp | #include <iostream>
#include <bits/stdc++.h>
using namespace std;
int fooUtil(string& s1, string& s2, string& s, int i1, int i2, int i) {
if (i == 0) {
return 1;
}
if (i1 < 0 || i2 < 0) {
return 0;
}
int ans = 0;
if (s1[i1] == s[i]) {
ans += fooUtil(s1, s2, s, i1-1, i... | ALGO | 0.999918 | 4.283047 |
be96b9d3-c8ce-454b-821c-7ad81a69dd24 | novak-99/MLPP | MLPP/GaussianNB/GaussianNB.cpp | //
// GaussianNB.cpp
//
// Created by Marc Melikyan on 1/17/21.
//
#include "GaussianNB.hpp"
#include "Stat/Stat.hpp"
#include "LinAlg/LinAlg.hpp"
#include "Utilities/Utilities.hpp"
#include <iostream>
#include <algorithm>
#include <random>
namespace MLPP{
GaussianNB::GaussianNB(std::vector<std::vector<double>... | ALGO | 0.997953 | 6.266599 |
cff4e0e1-f230-4d0b-b954-676c888a5951 | Akash20x/Hackerblocks | Hashing & Tries/MikeandHashTrick.cpp | #include <bits/stdc++.h>
using namespace std;
#define loop(x,n) for(ll x=0; x<n; ++x);
#define ll long long
unordered_map<ll,ll> map1;
void prllVector(vector<ll> v){
for(ll i=0; i<v.size(); i++){
cout<<v[i]<<" ";
}
cout<<endl;
}
bool compare(ll a, ll b) {
return map1[a]<map1[b];
}
int main(){... | ALGO | 0.999993 | 4.097833 |
8df6d069-c1f6-438e-bd9b-22893e404050 | Rikon07/XPSC | Week 2/Day 2/C_Cypher.cpp | #include<bits/stdc++.h>
using namespace std;
void cypher(int n)
{
int wheel[n], i;
for(i=0; i<n; i++)
{
cin >> wheel[i];
}
for(i=0; i<n; i++)
{
int m;
string moves;
cin >> m >> moves;
for(int k=0; k<moves.size(); k++)
{
if(moves[k] ... | ALGO | 0.999649 | 6.114366 |
89a87379-f680-4856-9747-43f75436ad47 | leonardoAnjos16/Competitive-Programming | Other/kingdom_of_cats.cpp | #include <bits/stdc++.h>
using namespace std;
#define long long long int
long cross(complex<long> &u, complex<long> &v) {
return u.real() * v.imag() - u.imag() * v.real();
}
int main() {
ios_base::sync_with_stdio(false);
cin.tie(NULL);
int n;
while (cin >> n, n) {
vector<complex<long>> ... | ALGO | 0.999822 | 4.362931 |
5122d41d-1b2b-43c1-916d-ccf9ef2ac3c5 | jansonh/Artic | src/crypto.cpp | #include <stdio.h>
#include <string>
#include "generate.h"
#include "utility.h"
#define square(X) (X)*(X)
using namespace std;
int bigmod(int b, int p, int m) {
if (p == 0) return 1;
else if (p%2 == 0) return square(bigmod(b, p/2, m)) % m;
else return ((b % m) * bigmod(b, p-1, m)) % m;
}
int encrypt(string f... | ALGO | 0.998917 | 3.793332 |
33460bc7-6da7-41ab-86e5-6f4ce54811a7 | ishandutta2007/codeforces | meijer/normal/1201/A.cpp | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<int, int> ii;
typedef vector<int> vi;
typedef vector<ii> vii;
#define INF 1e9
#define REP(a,b,c) for(int a=int(b); a<int(c); a++)
const int MX=1000;
int n, m;
int CNT[MX][5];
int main() {
ios_base::sync_with_stdio(false);
cin... | ALGO | 0.999978 | 3.778548 |
e3dd90fc-28bd-472e-b1c1-f75855cc7bb8 | impresora3ditsp/Impresora-3D-CubeX-Trio-ITSP | ubl_motion.cpp | #include "MarlinConfig.h"
#if ENABLED(AUTO_BED_LEVELING_UBL)
#include "Marlin.h"
#include "ubl.h"
#include "planner.h"
#include "stepper.h"
#include <avr/io.h>
#include <math.h>
#if AVR_AT90USB1286_FAMILY // Teensyduino & Printrboard IDE extensions have compile errors without this
inline void set_... | TOOL | 0.936378 | 7.666007 |
99c8b1df-105a-4d9d-9693-bf81a8ac85fb | Siyao-Lu/Leetcode | c++/array/944_delete_columns_to_make_sorted.cpp | // array: leetcode easy
/*
Return the number of columns that you will delete.
*/
#include <vector>
#include <algorithm>
#include <set>
#include <string>
#include <stack>
using namespace std;
class Solution
{
public:
int minDeletionSize(vector<string> &strs)
{
int len = strs[0].size();
int del =... | ALGO | 0.999861 | 6.429841 |
7d095b64-f521-4bbb-a308-48593287ae34 | Shishank93774/LeetCode-Solutions | 1498-number-of-subsequences-that-satisfy-the-given-sum-condition/1498-number-of-subsequences-that-satisfy-the-given-sum-condition.cpp | const int MOD = 1e9+7;
class Solution {
public:
int numSubseq(vector<int>& arr, int target) {
int ans = 0, n = arr.size();
sort(arr.begin(), arr.end());
int l = 0, r = n-1;
int pwr[n+1];
pwr[0] = 1;
for(int i = 1; i<=n; i++){
pwr[i] = (1ll*pwr[i-1]*2)%MOD;... | ALGO | 0.999995 | 5.669917 |
c8e15f81-c22a-466b-b84c-2f6f48670711 | Pulakesh5/_DSA_ | December 22/01 Dec/1704. Determine if String Halves Are Alike LC.cpp | class Solution {
public:
bool halvesAreAlike(string s) {
set<char> st={'a','e','i','o','u','A','E','I','O','U'};
int count=0, n = s.size();
for(int i=0;i<(n/2);i++)
{
if(st.count(s[i])>0)
{
count++;
}
}
for(int i=... | ALGO | 0.999478 | 6.020858 |
af56640d-9deb-4c08-9dd6-817d30413d1d | TusharGBhut/My-Programs | combined.cpp | /*
ॐ श्री गणेशाय नम:
ॐ नमः शिवाय
જય ભૂત દાદા
Name : Bhut Tushar
*/
#include <bits/stdc++.h>
#include <ext/pb_ds/tree_policy.hpp>
#include <ext/pb_ds/assoc_container.hpp>
#define ll long long
#define ull unsigned long long
#define sz size()
#define vll vector<ll>
#define mp make_pair
#define pb push_back
#define ... | ALGO | 0.999808 | 5.359128 |
9bfba207-de4f-4260-bf6a-b4f0fe72b95e | iamsayantan1/Programming-And-Personal-Development | CPP/recursiveLengthOfLinkedList.cpp | #include<iostream>
using namespace std;
class Node {
public:
int data;
Node* next;
Node(int data) : data(data), next(NULL) {}
};
void print(Node* head) {
Node* temp = head;
while(temp != NULL) {
cout<<temp->data<<" -> ";
temp = temp->next;
}
cout<<"NULL"<<endl;
}
Node* ... | ALGO | 0.999871 | 4.482035 |
e4140309-3b84-447e-a355-6009ba5c9e63 | goyalshreyansh21/advent-of-code | 2023/Day18/p2.cpp | #include <iostream>
#include <fstream>
using namespace std;
int main()
{
ifstream inputFile("text.txt");
string line;
vector<vector<int>> dir = {{0,1},{1,0},{0,-1},{-1,0}};
long long cx = 0, cy = 0, px = -1, py = -1;
long long area = 0, perimeter = 0;
while(getline(inputFile, line))
... | ALGO | 0.999031 | 3.947234 |
de3bc3be-1b89-4510-a184-fb5ceffd3e51 | shubham-1903/Algorithm | Backtracking/n-Queen.cpp | #include <bits/stdc++.h>
#include <iostream>
using namespace std;
// int x[100];
bool f = true;
int s = 0;
void write(int n,int x[])
{
for (int i = 1; i <= n; i++)
{
for (int j = 1; j <= n; j++)
{
if (j == x[i])
cout << "Q ";
else
cout << "_ ";
}
cout<<endl;
}
}
bool p... | ALGO | 0.999908 | 4.11533 |
678603eb-2a9b-4064-b5ae-cdd8894821d4 | Vanshika2063/Leetcode-Questions | Hard/Merge_k_sorted_list.cpp | /**
* Definition for singly-linked list.
* struct ListNode {
* int val;
* ListNode *next;
* ListNode() : val(0), next(nullptr) {}
* ListNode(int x) : val(x), next(nullptr) {}
* ListNode(int x, ListNode *next) : val(x), next(next) {}
* };
*/
class Solution {
public:
ListNode* mergeKLists... | ALGO | 0.999941 | 5.802457 |
16cf5f90-6563-4d36-836d-c9444b7e76b0 | BayKeremm/thesis-benchmark | src/yolo.cpp | #include "yolo.hpp"
YOLOV7::YOLOV7(const Net_config config) {
this->confThreshold = config.confThreshold;
this->nmsThreshold = config.nmsThreshold;
try {
yolo = torch::jit::load(config.modelpath);
std::cout << "success loading yolo model\n";
}
catch (const c10::Error& e) {
s... | TOOL | 0.857904 | 4.347052 |
682155af-cb83-4a40-b240-8b5e4dbd2e60 | umakantdubey/Competitive-Programming | caps lock.cpp | #include<bits/stdc++.h>
using namespace std;
int main()
{
string s,s1;
cin>>s;
int count =0;
int l=0;
l=s.size();
for(int i=0;i<l;i++)
{
if(s[i]==toupper(s[i]))
{
count++;
}
}
// cout<<count;
if(count==l)
{
for(int i=0;i<l;i++)
{
s... | ALGO | 0.999753 | 4.314714 |
33a9ca2d-5ffe-4c4b-ab17-993eef4f99f1 | ex-surreal/contest-programming | light-oj/1290.cpp | #include <iostream>
#include <cstdio>
#include <bitset>
#include <vector>
#include <numeric>
#include <string>
#include <algorithm>
#include <map>
#include <cmath>
#include <set>
#include <queue>
#include <stack>
#include <cstring>
#include <ctime>
#include <cstdlib>
#include <cassert>
using namespace std;
#define me... | ALGO | 0.999895 | 4.049811 |
83824821-a358-430c-9d07-49b198ce6cbf | hack-parthsharma/LeetCode | 1114-print-in-order/1114-print-in-order.cpp | class Foo {
public:
Foo() {
}
void first(function<void()> printFirst) {
// printFirst() outputs "first". Do not change or remove this line.
printFirst();
p1_.set_value();
}
void second(function<void()> printSecond) {
p1_.get_future().wait();
// printSecond()... | ALGO | 0.937349 | 6.033904 |
650b54ad-d774-469f-b39d-d0112b39124a | bananadroid/android_frameworks_native | libs/input/KeyLayoutMap.cpp | #define LOG_TAG "KeyLayoutMap"
#include <android-base/logging.h>
#include <android/keycodes.h>
#include <ftl/enum.h>
#include <input/InputEventLabels.h>
#include <input/KeyLayoutMap.h>
#include <input/Keyboard.h>
#include <log/log.h>
#include <utils/Errors.h>
#include <utils/Timers.h>
#include <utils/Tokenizer.h>
#if ... | TOOL | 0.910781 | 7.165453 |
07c5a6b4-f09b-4ba6-abb9-e36665bf040d | ehhsen/OOP-Spring-2025 | LabTAsk_copy_cnst_book.cpp | // copy constructor LAb task: 11/04/25 09:29
/* Task 2: Class with Copy Constructor
Create a C++ class Book to represent a book’s page count.
• Data Member: int pages (public for simplicity).
• Requirements:
1. Default constructor: Sets pages to 100.
2. Parameterized constructor: Takes an integer to initialize pages
... | TOOL | 0.861229 | 6.05524 |
7c71f46f-1a3b-4117-9093-d8644dea3251 | rovinbhandari/Programming_Scripting | ProgrammingCompetitions/ACM-ICPC/ACM-ICPC_12/Amritapuri/online contest/ACM-ICPC Amritapuri 2012 Online Competition Accepted Solutions/A/cpp/00003148_A_PAIRSOCKS_amicpc120561.cpp | /** author -- Ayush Sharma **/
#include<iostream>
#include<cstdio>
#include<cstring>
#include<vector>
#include<cstdlib>
#include<cassert>
#include<algorithm>
#define FOR(i,a,b) for(int i=a;i<b;i++)
#define min3(a,b,c) (a<b?(a<c?a:c):(b<c?b:c))
#define max3(a,b,c) (a>b?(a>c?a:c):(b>c?b:c))
#define min(a,b) (a<b?a:b)
#de... | ALGO | 0.999228 | 3.941106 |
325d7788-4880-4e0c-8af5-1ab0d2dd14ed | JinYoung-Shin/Algorithm-Challenge-2017 | hg/algospot/01_festival/src/sum_ver.cpp | #include <stdio.h>
#include <stdlib.h>
void dump_arr(int* arr, int len) {
for (int i=0; i < len; i++) {
printf("%d ", arr[i]);
}
printf("\n");
}
int main() {
int case_num, total_num, least_len, i, j, k, start, len, sum;
int* arr, *summation;
double min, current;
scanf("%d", &case_num);
for (i=0; i< case... | ALGO | 0.996545 | 3.142906 |
d77ab4c3-a3d9-4f84-8803-cd9409afb533 | rajagceian/gfg-POTD | gfg_17_Mar_2025.cpp | class Solution {
public:
bool subsetSumHelper(vector<int>& arr, int idx, int sum, vector<vector<int>>& dp) {
if (sum == 0) return true;
if (idx == 0) return arr[0] == sum;
if (dp[idx][sum] != -1) return dp[idx][sum];
bool notTake = subsetSumHelper(arr, idx - 1, sum, dp);
boo... | ALGO | 0.999976 | 6.093725 |
369b1c3b-e1ae-49ba-923a-f5dc364f8029 | Parthmudgal15105/CP | B_Collecting_Game.cpp | #include <bits/stdc++.h>
using namespace std;
#ifdef SAWALHY
#include "debug.hpp"
#else
#define debug(...) 0
#define debug_itr(...) 0
#define debug_bits(...) 0
#endif
#define ll long long
#define int long long
#define all(v) v.begin(), v.end()
#define rall(v) v.rbegin(), v.rend()
#define minit(v, x) v = min(v, x)
#de... | ALGO | 0.999915 | 5.13545 |
8d6512a2-7298-4350-9cd8-df10ce6819cc | wuqiongjin/Algorithm | 单调队列/面试题59 - II. 队列的最大值.cpp | class MaxQueue {
public:
MaxQueue() {
}
int max_value() {
if(q.empty()) return -1;
return dq.front();
}
void push_back(int value) {
q.push(value);
//维护单调队列, 判断是否应该将value插入, 如果value比队尾元素小, 可以插入, 否则pop直到小于队尾元素为止或队列为空
while(!dq.empty() && dq.back() <... | ALGO | 0.999954 | 5.731375 |
d20582f6-a374-47d5-847a-4fb7482f2088 | SDRSK/CPP | para/rivnyannya.cpp | #include <iostream>
#include <cmath>
using namespace std;
int main() {
double a, b, c;
cin>> a >> b >> c;
double d;
double x1, x2;
d = b*b - 4*a*c;
if (a == 0)
{
if (b==0 && c !=0)
{
cout <<"no roots" << endl;
return 0;
}
else
{
cout << "x Є R" << endl;
}
}
if (d<0)
{
cout << "no ro... | ALGO | 0.999731 | 3.983498 |
25c44437-1653-43e5-aa8e-71ca591346ff | librastar1985/Episcale_CrossSectionalView | src/main/discMain.cpp | #include <iostream>
#include "MeshGen.h"
#include "commonData.h"
#include "CellInitHelper.h"
#include <vector>
#include "SimulationDomainGPU.h"
using namespace std;
GlobalConfigVars globalConfigVars;
#define gpuErrchk(ans) { gpuAssert((ans), __FILE__, __LINE__); }
inline void gpuAssert(cudaError_t code, const char ... | DATA | 0.922467 | 3.772048 |
105f9bb7-ac53-46ac-a014-7c36c32fdd21 | prifio/prepare_vseros_tolya_ash | dfs.cpp | #include <bits/stdc++.h>
#define mp make_pair
using namespace std;
typedef pair<int, int> pii;
const int N = 100000;
vector<int> g[N];
int us[N];
void dfs(int v)
{
us[v] = 1;
for (int i : g[v])
if (!us[i])
dfs(i);
}
void get_ans(int n)
{
for (int i = 0; i < n; ++i)
g[i].res... | ALGO | 0.999755 | 4.202292 |
baf2831e-472f-4d4d-92f4-72c89ecf3e21 | yangfengzzz/Arche-webgpu | vox.geometry/implicit_surface3.cpp | #include "vox.geometry/implicit_surface3.h"
#include "vox.geometry/level_set_utils.h"
using namespace vox;
ImplicitSurface3::ImplicitSurface3(const Transform3D &transform_, bool isNormalFlipped_)
: Surface3(transform_, isNormalFlipped_) {}
ImplicitSurface3::ImplicitSurface3(const ImplicitSurface3 &other) = defa... | ALGO | 0.997858 | 5.936188 |
7e3907e0-adf6-4072-be83-4b8086475cd7 | CunZy/codetree-TILs | 231118/숫자 피라미드 3/number-pyramid-3.cpp | #include <iostream>
using namespace std;
int main() {
// 여기에 코드를 작성해주세요.
int n;
cin >> n;
for(int i = 1; i <= n; ++i) {
for(int j = 1; j <= i; ++j) {
cout << i * j << " ";
}
cout << endl;
}
return 0;
} | ALGO | 0.999942 | 5.040375 |
ae4b1ef8-b71d-4986-a722-0fd35dc75cd4 | syalabi-seet/CPP_EDX | Fundamentals of C++/Arrays & Strings/SSNNumberValidation.cpp | #include <iostream>
#include <string>
using namespace std;
int main()
{
string input_str;
cout << "Enter the SSN number:" << endl;
cin >> input_str;
int str_length = input_str.length();
// Check length
if (str_length != 10)
{
cout << "Invalid SSN number" << endl;
return 0... | TOOL | 0.876721 | 6.4656 |
d5174c0a-368a-4f3b-b276-e0877421768d | RJrachit/programs | compi coding/chocoMonger (2).cpp | #include <bits/stdc++.h>
using namespace std;
void fill(int * bits, int num){
for(int i =31;i>=0;i--){
if(num & 1){
bits[i]++;
}
num = num>>1;
}
return;
}
long long dec(int * bits){
int pow = 1;
long long ans = 0;
int x = 1;
for(int i=31;i>=0;i--){
... | ALGO | 0.999296 | 3.857455 |
51fa3970-72bf-4197-b822-44011a59a0cc | aboellil0/codeforces | week (3)/A. Count numbers.cpp | #include <iostream>
#include <iomanip>
#include <cmath>
#include <algorithm>
#include <vector>
using namespace std;
void fast(){
ios_base::sync_with_stdio(false);
#ifndef ONLINE_JUDGE
freopen("input.txt","r",stdin);
freopen("output.txt","w",stdout);
#endif
}
int main() {
fast();
int n,q; ci... | ALGO | 0.999638 | 3.994659 |
63877ed5-7330-4cfe-96df-13ccd1237cf4 | Github904868699/livelybot_robot | livelybot_serial/include/eigen/unsupported/doc/examples/PolynomialSolver1.cpp | #include <unsupported/Eigen/Polynomials>
#include <vector>
#include <iostream>
using namespace Eigen;
using namespace std;
int main() {
typedef Matrix<double, 5, 1> Vector5d;
Vector5d roots = Vector5d::Random();
cout << "Roots: " << roots.transpose() << endl;
Eigen::Matrix<double, 6, 1> polynomial;
roots_t... | TEST | 0.99936 | 4.65196 |
a8964130-b694-44e1-a998-d046d2b4cb83 | seyoon1213/Algorithm | 3/L_1987.cpp | #include <stdio.h>
#include <iostream>
#include <queue>
using namespace std;
int R, C;
char V[20][20];
int visited[20][20];
int eng[26];
const int dx[] = {-1, 1, 0, 0};
const int dy[] = {0, 0, -1, 1};
int answer = 0;
void DFS(int y, int x){
answer = max(answer, visited[y][x]);
for(int i = 0; i < 4; i++){
... | ALGO | 0.999326 | 4.453167 |
d8e5cd53-bcc4-4a72-bacf-41c40391bf9b | gansach/AOC2021 | 15/B.cpp | #include <bits/stdc++.h>
using namespace std;
bool isSafe(int i, int j, int n, int m)
{
return (i >= 0 && i < n && j >= 0 && j < m);
}
int main(void)
{
fstream fin("input.txt");
vector<vector<int>> matrix;
while (fin.good())
{
string line;
getline(fin, line);
matrix.pus... | ALGO | 0.999902 | 3.941326 |
f11d1c7e-0722-4866-853e-271a20dcff3c | nczhang88pan/KlotskiSGX | klotski/llvmProgram/clang-tools-extra/clang-tidy/tool/ClangTidyMain.cpp | #include "../ClangTidy.h"
#include "clang/Tooling/CommonOptionsParser.h"
#include "llvm/Support/Process.h"
using namespace clang::ast_matchers;
using namespace clang::driver;
using namespace clang::tooling;
using namespace llvm;
static cl::OptionCategory ClangTidyCategory("clang-tidy options");
static cl::extrahelp ... | TOOL | 0.952447 | 6.380903 |
1cebf8ee-f764-4510-8394-df7d80e245f1 | ishandutta2007/codeforces | sidneyearth/normal/1037/B.cpp | #include <stdio.h>
#include <algorithm>
#include <cmath>
using namespace std;
const int maxn = 200100;
int a[maxn];
int main(){
int n, s; scanf("%d%d", &n, &s);
int m = (n + 1) / 2;
for(int i = 1; i <= n; i++)
scanf("%d", &a[i]);
sort(a + 1, a + 1 + n);
long long ans = 0;
for(int i = 1; i < m; i++)
if(a[i] > ... | ALGO | 0.999868 | 3.107028 |
37a2f01d-3f85-4654-a2da-5f6b7499f337 | rudxkush/leetcode-practice | 2808-painting-the-walls/painting-the-walls.cpp | class Solution {
public:
vector<vector<int>> dp;
int solve(int i, int wallsLeft, vector<int>& cost, vector<int>& time) {
// no walls left to paint
if (wallsLeft <= 0) return 0;
// out of walls, not valid
if (i >= cost.size()) return 1e9;
// if already computed
i... | ALGO | 0.999951 | 6.15963 |
59004fcb-0b91-429f-8f0e-233c82b3bac6 | ishandutta2007/codeforces | pctprobability/normal/1516/B.cpp | #include <bits/stdc++.h>
using namespace std;
#if __has_include(<atcoder/all>)
#include <atcoder/all>
using namespace atcoder;
#endif
using ll = long long;
using ld = long double;
using ull = long long;
#define REP3(i, m, n) for (int i = (m); (i) < int(n); ++ (i))
#define ALL(x) begin(x), end(x)
#define all(s) (s).begi... | ALGO | 0.999932 | 4.949697 |
567caffb-d473-42b2-a769-d4d674627e94 | QuachTinh68/LessonCode | C++/Trash/C++ CopyCode/DemBoBa.cpp | # include <stdio.h>
int main()
{
int s,t,i,j,h,soKetQua=0;
scanf("%d %d",&s,&t);
for (i=0;i<=s;i++)
for (j=0;j<=s;j++)
for (h=0;h<=s;h++)
if (i+j+h<=s && i*j*h<=t) soKetQua++;
printf("%d",soKetQua);
return 0;
}
| ALGO | 0.999808 | 3.960636 |
a96911b2-305d-4c0f-9c2d-8a2246d7c2b5 | AlgoHacker3112/CP | CPP1/Coins Combination II.cpp | // Problem: Coin Combinations I
// Contest: CSES - CSES Problem Set
// URL: https://cses.fi/problemset/task/1635
// Memory Limit: 512 MB
// Time Limit: 1000 ms
//
// Powered by CP Editor (https://cpeditor.org)
// Powered by AlgoHacker
#include<bits/stdc++.h>
//#define int long long
#define ld long double
#define m_p... | ALGO | 0.999965 | 4.600834 |
ab0277d2-e18e-42b8-ac21-3010aab2c639 | negibouzu/negisan | ABC150C.cpp | #include <bits/stdc++.h>
using namespace std;
int main(){
int N;
cin >> N;
vector <int> a(N);
vector <int> b(N);
vector <int> c(N);
int A,B;
for (int i=0;i<N;i++){
cin>>a[i];
}
for (int i=0;i<N;i++){
cin>>b[i];
}
for (int i=0;i<N;i++){
c[i]=i+1;
}
int count=0;
do{
if... | ALGO | 0.999971 | 3.500594 |
5cf67437-f530-4a4d-9c81-44ae4c411e52 | Rajatj17/dsa-pseudo-code | 01 Arrays & Vectors/pairs 03.cpp | #include<iostream>
#include<vector>
#include<unordered_set>
using namespace std;
vector<int> pairSum(vector<int> arr,int Sum){
//Logic
unordered_set<int> s;
vector<int> result;
for(int i=0;i<arr.size();i++){
int x = Sum - arr[i];
if(s.find(x)!=s.end()){
result.push_back(x);
result.push_back(arr[i]);
... | ALGO | 0.999988 | 4.724313 |
845b64c5-e688-4987-ab94-4677f9e66425 | Wilchelm/Informatyka | DPPR/Zadania ppr/Monolit.cpp | #include <iostream>
using namespace std;
int main() {
unsigned int a, b, c;
cin >> a >> b >>c;
unsigned int pole = 2*a*b+2*a*c+2*b*c;
cout << pole;
return 0;
}
| ALGO | 0.999614 | 3.777444 |
f3423155-5a9b-40fc-a212-2b8e7c233de4 | shpp-ekondratyev/cs-b-fractals | Mandelbrot/lib/StanfordCPPLib/filelib.cpp | /*
* File: filelib.cpp
* -----------------
* This file implements the filelib.h interface. All platform dependencies
* are managed through the platform interface.
*
* @version 2014/10/19
* - alphabetized function declarations
* - converted many funcs to take const string& rather than string for efficiency
* ... | TOOL | 0.963104 | 6.439215 |
49695c15-e5eb-4b9b-96e1-24fc6d6f0c40 | aromal-02/fasionstore | 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 |
332af4be-b60c-4fe1-8750-bbcc71c81160 | hynaruto/fighting | data_structure/NK_6/main.cpp |
//https://ac.nowcoder.com/acm/problem/16422
//链接:https://ac.nowcoder.com/acm/problem/16422
//来源:牛客网
//
//图书馆中每本书都有一个图书编码,可以用于快速检索图书,这个图书编码是一个正整数。
//
//每位借书的读者手中有一个需求码,这个需求码也是一个正整数。如果一本书的图书编码恰好以读者的需求码结尾,那么这本书就是这位读者所需要的。
//
//小 D 刚刚当上图书馆的管理员,她知道图书馆里所有书的图书编码,她请你帮她写一个程序,对于每一位读者,求出他所需要的书中图书编码最小的那本书,如果没有他需要的书,请输出-1。
#inc... | ALGO | 0.999573 | 4.365448 |
d1198af7-107a-42d8-8dc9-06fec04a0f30 | Shaz999/DSA-GFG-Solutions | Medium/Sort an array according to the other/sort-an-array-according-to-the-other.cpp | //{ Driver Code Starts
//Initial template for C++
#include <bits/stdc++.h>
using namespace std;
// } Driver Code Ends
//User function template in C++
class Solution{
public:
// A1[] : the input array-1
// N : size of the array A1[]
// A2[] : the input array-2
// M : size of the array A2[]
... | ALGO | 0.999987 | 5.205936 |
f4dce57d-2242-40f0-a42a-a8f80be00ad8 | GXDE-OS/boost1.67 | libs/math/example/arcsine_example.cpp | // arcsine_example.cpp
// Example for the arcsine Distribution.
// Note: Contains Quickbook snippets in comments.
//[arcsine_snip_1
#include <boost/math/distributions/arcsine.hpp> // For arcsine_distribution.
//] [/arcsine_snip_1]
#include <iostream>
#include <exception>
int main()
{
std::cout << "Examples of Ar... | ALGO | 0.933066 | 6.575267 |
284c53d1-45a1-4180-8de2-105073689b54 | neuropara/neural-mixture-guiding | src/backend/src/ext/assimp/code/PostProcessing/ImproveCacheLocality.cpp | /** @file Implementation of the post processing step to improve the cache locality of a mesh.
* <br>
* The algorithm is roughly basing on this paper:
* http://www.cs.princeton.edu/gfx/pubs/Sander_2007_%3ETR/tipsy.pdf
* .. although overdraw reduction isn't implemented yet ...
*/
// internal headers
#include "Pos... | ALGO | 0.993782 | 6.29477 |
53708555-6108-40fc-a5dc-1448462f9478 | randolf/simple-viewer-gl | src/common/config.cpp | /**********************************************\
*
* Simple Viewer GL edition
* by Andrey A. Ugolnik
* http://www.ugolnik.info
* <EMAIL>
*
\**********************************************/
#include "config.h"
#include "viewer.h"
#include <string>
#include <cstdio>
#include <cstdlib>
#include <strings.h>
namespace... | TOOL | 0.89908 | 6.106676 |
8dabee50-0aed-48ec-943c-8bb9f1a8d75d | HYZ-0514/Obstacle-avoidance-maze | game/maze.cpp | #include "maze.h"
#include<queue>
#include <QMessageBox>
#include<QTimer>
#include <algorithm> // for std::shuffle
#include <random> // for std::default_random_engine
//生成基础地图(单元格)
void maze::base() {
for (int i = 0; i < level * 2 + 1; i++) {
for (int j = 0; j < level * 2 + 1; j++) {
if (i... | ALGO | 0.991681 | 3.577387 |
af2a68da-a508-4646-8183-fe62af3e2dc6 | AMIRIOX/MyLuoguRepo | contest/CF#993-div4/D.cpp | #include <bits/stdc++.h>
using namespace std;
using ll = long long;
#define pii pair<int, int>
#define pll pair<long long, long long>
#define mii map<int, int>
void solve() {
int n; cin >> n;
vector<ll> ans(n + 1);
map<ll, ll> cnt, cnt2;
vector<ll> a(n + 1);
for(int i = 1; i <= n; i++) cin >> a[i]... | ALGO | 0.999952 | 4.803935 |
3371485b-97e8-403a-91ed-5fe16d3e95e8 | zju3dv/hybrid3d | csrc/eigen/unsupported/doc/examples/MatrixSine.cpp | #include <unsupported/Eigen/MatrixFunctions>
#include <iostream>
using namespace Eigen;
int main()
{
MatrixXd A = MatrixXd::Random(3,3);
std::cout << "A = \n" << A << "\n\n";
MatrixXd sinA = A.sin();
std::cout << "sin(A) = \n" << sinA << "\n\n";
MatrixXd cosA = A.cos();
std::cout << "cos(A) = \n" << cos... | ALGO | 0.980128 | 5.919294 |
33d944df-564d-4107-af1f-43f344f3e3c2 | priyanka8625/DSA-Daily-Problems-2024 | 01_January_Daily_Problems/06_GFG_POTD_Techfest and the Queue.cpp | class Solution {
public:
int sumOfPowers(int a, int b){
int res = 0;
for(int i=a;i<=b;i++)
{
int curr=i;
while(curr%2==0)
{
res++;
curr/=2;
}
for(int j=3;j*j<=curr;j+=2)
{
whi... | ALGO | 0.999768 | 5.570399 |
8d1264cf-14d2-4739-90d2-4b5b6ac51604 | BehroozZare/Schwarz | eigen-3.4.1/doc/examples/tut_arithmetic_redux_basic.cpp | #include <iostream>
#include <Eigen/Dense>
using namespace std;
int main()
{
Eigen::Matrix2d mat;
mat << 1, 2,
3, 4;
cout << "Here is mat.sum(): " << mat.sum() << endl;
cout << "Here is mat.prod(): " << mat.prod() << endl;
cout << "Here is mat.mean(): " << mat.mean() ... | ALGO | 0.99858 | 3.870119 |
5d255192-900f-4a41-92e1-0e3a29b03fd3 | oceanstar777/2021-2_hufs_computer_programming_and_practice | practice/triangle.cpp | #include<iostream>
#include<string>
#include<cmath>
using namespace std;
class Triangle {
private:
double a;
double b;
double c;
public:
void setA(double a);
void setB(double b);
void setC(double c);
double size();
};
void Triangle::setA(double a) {
this->a = a;
}
void Triangle::setB(double b) {
this->b = b;... | ALGO | 0.999761 | 4.477312 |
326ab02f-8bdf-483e-b7b9-6869fef75ef1 | vectar31/Spoj-solutions-and-other-c-codes | checkbipartite/main.cpp | #include <iostream>
#include <cmath>
#include <algorithm>
#include <ctime>
#include <vector>
#include <list>
#include <queue>
using namespace std;
int main()
{
int bug,inter;int f=1;
cin>>bug>>inter;
vector < list<int> > a(bug);
int color[bug];
for(int i=0;i<bug;i++)
color[i]=-1;
for(... | ALGO | 0.999869 | 4.511027 |
3f6da8b5-33ee-493c-8916-15453687f049 | MustSave/PS | Programmers/C++/시저 암호.cpp | #include <string>
#include <vector>
using namespace std;
string solution(string s, int n) {
string answer = "";
char lowerCase[] = "abcdefghijklmnopqrstuvwxyz";
char upperCase[] = "ABCDEFGHIJKLMNOPQRSTUVWXYZ";
for (int i = 0; i < s.length(); i++)
{
if(islower(s[i]))
{
... | ALGO | 0.999819 | 5.729163 |
39885ef1-eea8-4543-9eca-344ea61ed8fa | wellvolks/Problemas | Uri/Geral/uri1317_1.cpp | #include <set>
#include <list>
#include <stack>
#include <cmath>
#include <queue>
#include <ctime>
#include <cfloat>
#include <vector>
#include <string>
#include <cstdio>
#include <bitset>
#include <climits>
#include <cstdlib>
#include <cstring>
#include <cassert>
#include <iomanip>
#include <sstream>
#include <utility... | ALGO | 0.999323 | 3.492786 |
0e4665c3-ca18-491b-97e9-45730a224e8e | yipu3/algorithm-practice | POJ/2559.cpp | #include<iostream>
#include<cstdio>
#include<cstring>
#include<cstdlib>
#include<climits>
#include<algorithm>
#include<vector>
#include<stack>
#include<set>
#include<queue>
#include<map>
#include<cmath>
#include<sstream>
#include<string>
#define MAXN 100005
#define INF 1e15+5
typedef long long ll;
using namespace std;... | ALGO | 0.999801 | 3.613171 |
b6507351-5f37-41ee-9b82-ccf82bd93d3d | ebisenttt/atcoder | abc006/c/main.cpp | #include <iostream>
#include <vector>
#include <cmath>
#include <algorithm>
#include <numeric>
#include <iomanip>
using namespace std;
#define REP(i, n) for(int i = 0; i <= n; i++)
#define FOR(i, m, n) for(int i = m; i < n; i++)
#define ALL(x) (x).begin(),(x).end() //sortなどの引数を省略したい
#define SIZE(x) ((ll)(x).size()) //s... | ALGO | 0.999992 | 3.211133 |
404bd1cb-6fb9-4b26-b35f-9996db238b7e | wkhattak/Path-Planning | src/Eigen-3.3/bench/sparse_dense_product.cpp |
//g++ -O3 -g0 -DNDEBUG sparse_product.cpp -I.. -I/home/gael/Coding/LinearAlgebra/mtl4/ -DDENSITY=0.005 -DSIZE=10000 && ./a.out
//g++ -O3 -g0 -DNDEBUG sparse_product.cpp -I.. -I/home/gael/Coding/LinearAlgebra/mtl4/ -DDENSITY=0.05 -DSIZE=2000 && ./a.out
// -DNOGMM -DNOMTL -DCSPARSE
// -I /home/gael/Coding/LinearAlgebr... | ALGO | 0.99348 | 4.386344 |
d11490fd-9da9-44a7-b842-44bc5d339641 | NIKHILSINGH1510/Apna_college_cpp_placement | stackchar.cpp | #include<iostream>
#include<string>
using namespace std;
#define max 10
int top = -1;
void push(char array[max],char ch)
{
if(top>=max){
cout<<"overflow"<<endl;
}
else{
top++;
array[top]=ch;
}
}
void pop(char array[max]){
if(top<0){
cout<<"underflow"<<endl;
}
... | ALGO | 0.99156 | 3.648325 |
8a13b48c-6064-4ba6-b3c7-cfca3d9e6c1f | ishandutta2007/codeforces | kdvinit/normal/1426/A.cpp | /*
K.D. Vinit |,,|
*/
#include <iostream>
#include <cmath>
#include<bits/stdc++.h>
using namespace std;
#define int long long
void solve()
{
int n,x;
cin>>n>>x;
if(n<=2) cout<<1<<endl;
else
{
n-=2;
n=(n+x-1)/x;
n++;
cout<<n<<endl;
}
}
int32_t main()
{
ios... | ALGO | 0.999646 | 4.073625 |
24b3e942-4bc4-408f-b6d3-14439a3a1503 | dmachlanski/neural-network-cpp | RobotNN/robot_main.cpp | #include "aria.h"
#include <algorithm>
#include <iostream>
#include <Eigen/Dense>
#include <fstream>
#include <math.h>
using namespace std;
using namespace Eigen;
double kp = 0.6;
double desiredDistance = 400;
double e = 0.0;
double ei = 0.0;
double ed = 0.0;
double ePrev = 0.0;
double baseVel = 100;
MatrixXd Sigmo... | ALGO | 0.9915 | 5.23661 |
578d8b8b-7c92-43eb-b9ae-2feacd18132f | FirstCinnamon/baekjoon-solutions | CLASS 4/floyd-warshall/[14938] 서강그라운드.cpp | // 14938 서강그라운드
#include <iostream>
#include <vector>
#define INF 1e9
using namespace std;
int main() {
ios_base::sync_with_stdio(false);
cin.tie(nullptr);
cout.tie(nullptr);
int n, m, r;
cin >> n >> m >> r;
// i부터 j까지의 거리를 저장하는 2차원 배열 : dist[i][j]
vector<vector<int>> dist(n + 1, vector... | ALGO | 0.99991 | 4.720601 |
6928c3e2-bacc-48bb-9e85-e2a0f1ea5855 | charuchauhan/NDN_Caching_Policies | NFD/tools/nfdc/command-parser.cpp | /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
#include "command-parser.hpp"
#include "format-helpers.hpp"
#include <ndn-cxx/util/logger.hpp>
namespace nfd {
namespace tools {
namespace nfdc {
NDN_LOG_INIT(nfdc.CommandParser);
static_assert(std::is_same<std::underlying_type<AvailableIn>::type,
... | TOOL | 0.942361 | 7.716208 |
486beed0-68cc-44c5-bd3d-9e9d79bad620 | aditya-agr/-6Companies30days | 299. Bulls and Cows.cpp | class Solution {
public:
string getHint(string secret, string guess) {
unordered_map<char, int> mp;
for(char c : secret)
mp[c]++;
int n = guess.size();
int a=0, b=0;
for(int i=0; i<n; i++){
if(secret[i] == guess[i]){
a++;
... | ALGO | 0.999985 | 6.220783 |
3d686423-69cc-4951-aaf7-7dcce9f93106 | priyansh2120/leetcodeSubmissions | 1442-number-of-operations-to-make-network-connected/number-of-operations-to-make-network-connected.cpp | class DisjointSet{
public:
vector<int>rank, parent, size;
DisjointSet(int n){
rank.resize(n+1, 0);
parent.resize(n+1);
size.resize(n+1, 1);
for(int i=0; i<=n; i++){
parent[i]=i;
}
}
int findUPar(int node){
if(parent[node]==node){
return node;
}
return parent[node]= findUPar(parent[nod... | ALGO | 0.999903 | 5.354167 |
321a8d0f-cef2-46ec-98bd-1294ef4276c7 | yaqwsx/DrLCD | fw/Marlin/src/module/delta.cpp | /**
* delta.cpp
*/
#include "../inc/MarlinConfig.h"
#if ENABLED(DELTA)
#include "delta.h"
#include "motion.h"
// For homing:
#include "planner.h"
#include "endstops.h"
#include "../lcd/marlinui.h"
#include "../MarlinCore.h"
#if HAS_BED_PROBE
#include "probe.h"
#endif
#if ENABLED(SENSORLESS_HOMING)
#include ... | ALGO | 0.964026 | 7.061513 |
85f40b90-52fe-4ca8-8923-dad647e205b9 | smart-make/boost | libs/numeric/ublas/doc/samples/vector_slice.cpp | #include <boost/numeric/ublas/vector.hpp>
#include <boost/numeric/ublas/vector_proxy.hpp>
#include <boost/numeric/ublas/io.hpp>
int main () {
using namespace boost::numeric::ublas;
vector<double> v (3);
vector_slice<vector<double> > vs (v, slice (0, 1, 3));
for (unsigned i = 0; i < vs.size (); ++ i)
... | ALGO | 0.967337 | 3.157066 |
f7dac743-5b91-4960-b63b-bfe18468ded3 | Quoc-Chung/KIENTRUC | QUYHOACH/DayConTong.cpp | #include<bits/stdc++.h>
using namespace std;
int main(){
int n,s;
cin >> n >> s;
int a[n];
for(int i=0;i<n;i++){
cin >> a[i];
}
int dp[s+1];
for (int i=0;i<=s;i++){
dp[i] = 0;
}
dp[0] = 1;
for(int i = 0;i<n;i++){
for(int j = s;j>=a[i];j--){
if... | ALGO | 0.999908 | 3.200759 |
84016568-f623-406c-a55d-056cc87b9e58 | alexandraback/datacollection | solutions_2464487_0/C++/lccycc/A.cpp | #include <iostream>
#include <algorithm>
#include <cstdlib>
#include <cmath>
#include <cstring>
#include <string>
#include <cstdio>
using namespace std;
typedef long long LL;
int main(){
freopen("A-small.in","r",stdin);
freopen("A.out","w", stdout);
int T;
int cas = 0;
for (cin>>T;T--;){
LL t, s;
cin>>s>>t;
... | ALGO | 0.999535 | 3.775889 |
9ac1ab14-d38f-49bb-aabe-457043609c93 | yefengdanqing/my_leetcode_algorithm | 104.二叉树的最大深度.cpp | /*
* @lc app=leetcode.cn id=104 lang=cpp
*
* [104] 二叉树的最大深度
*/
// @lc code=start
/**
* Definition for a binary tree node.
* struct TreeNode {
* int val;
* TreeNode *left;
* TreeNode *right;
* TreeNode() : val(0), left(nullptr), right(nullptr) {}
* TreeNode(int x) : val(x), left(nullptr),... | ALGO | 0.999739 | 6.731727 |
3dd7ca28-07ec-4e85-95c1-78e120b700c4 | tommyle27/Leet-Code | MergeSortedLists.cpp | /**
* Definition for singly-linked list.
* struct ListNode {
* int val;
* ListNode *next;
* ListNode() : val(0), next(nullptr) {}
* ListNode(int x) : val(x), next(nullptr) {}
* ListNode(int x, ListNode *next) : val(x), next(next) {}
* };
*/
class Solution {
public:
ListNode* mergeTwoLis... | ALGO | 0.999972 | 5.984299 |
d4eeaf9e-bb2e-4628-a4e7-a983748802ca | NotOneWest/Problem-Solving | 프로그래머스/2/76502. 괄호 회전하기/괄호 회전하기.cpp | #include <string>
#include <vector>
#include <stack>
using namespace std;
int solution(string s) {
int answer = 0;
for(int t=0; t<s.length(); t++){
stack<char> st;
for(int i=0; i<s.length(); i++){
if(s[i] == '{' || s[i] == '(' || s[i] == '[') st.push(s[i]);
else{
... | ALGO | 0.998293 | 4.716202 |
4fb456d1-d174-41b8-8864-eef0c8d21e75 | aaakshit/Leetcode-solutions | 0240-search-a-2d-matrix-ii/0240-search-a-2d-matrix-ii.cpp | class Solution {
public:
bool searchMatrix(vector<vector<int>>& matrix, int target) {
int l=0,h=matrix[0].size()-1;
while(l<matrix.size() && h<matrix[0].size()){
if(matrix[l][h]==target)
return 1;
else if(matrix[l][h]>target)
h--;
e... | ALGO | 0.999945 | 6.010075 |
2d5fe5e3-3a8f-4c82-a124-f49df7db6744 | Kurosage/C-Modules | Module08/ex01/Span.cpp | /* ************************************************************************** */
/* */
/* ::: :::::::: */
/* Span.cpp :+: :+: :+: ... | TOOL | 0.930976 | 4.428685 |
3378054b-2a0b-4c5b-926c-76d9531e420f | 6851-2021/fractional-cascading | CatalogGraphTest.cpp | #include <iostream>
#include "CatalogGraph.h"
int main () {
map<int, list<float> > nodes;
list<float> node0;
node0.push_back(1);
node0.push_back(3);
node0.push_back(4);
node0.push_back(5);
node0.push_back(6);
node0.push_back(7);
node0.push_back(8);
node0.push_back(9);
node0.... | ALGO | 0.896829 | 4.155879 |
e6a72e2a-7d9e-4f25-ace8-7d5bf2b21310 | nandu-sam/DSA-COURSE | sortedRecursion.cpp | #include <iostream>
using namespace std;
void print(int arr[], int size)
{
cout << "The size of the array is: " << endl;
for (int i = 0; i < size; i++)
{
cout << arr[i] << " "<<endl;
}
// cout << endl;
}
bool isSorted(int *arr, int size)
{
print(arr, size);
if (size == 0 || size == ... | ALGO | 0.997943 | 5.154116 |
2a3861c5-e2c4-497b-84f9-84e3b29b5c81 | helloobaby/llvm_msvc | llvm/lib/CodeGen/MachineDominanceFrontier.cpp | #include "llvm/CodeGen/MachineDominanceFrontier.h"
#include "llvm/CodeGen/MachineDominators.h"
#include "llvm/CodeGen/Passes.h"
#include "llvm/InitializePasses.h"
#include "llvm/Pass.h"
#include "llvm/PassRegistry.h"
using namespace llvm;
namespace llvm {
template class DominanceFrontierBase<MachineBasicBlock, false>... | ALGO | 0.994071 | 7.460413 |
84758132-a209-4daf-a941-c02f39f99b9b | NafiAsib/competitive-programming | codeforces/1227B.cpp | #include <bits/stdc++.h>
using namespace std;
#define watch(x) cerr << #x << " = " << x << "\n"
typedef pair<int, int> pii;
typedef long long ll;
const double eps = 1e-9;
const int inf = 0x3f3f3f3f;
int main()
{
#ifndef ONLINE_JUDGE
freopen("../io/in.txt", "r", stdin);
//freopen("../io/out.txt", "w", stdout);
... | ALGO | 0.9998 | 3.699154 |
ec46a3ac-f70c-4439-9f7a-fbb6755e1705 | dicu-catalin/pa-an2-sem2 | Tema1/stocks.cpp | #include <bits/stdc++.h>
using namespace std;
class Stock {
public:
int currValue;
int minValue;
int maxValue;
Stock(int _currValue, int _minValue, int _maxValue)
: currValue(_currValue)
, minValue(_minValue)
, maxValue(_maxValue) { }
};
class Task {
public:
int n, b, l;
vector<... | ALGO | 0.999466 | 4.602838 |
e48027cc-41b4-46c6-a574-417d4062a5ab | RayleighsJeans/ProgTestLibrary | assessment/microsoft/chessBoardOptimize.cpp | #include "../include/header.hpp"
constexpr int N = 10000; // 100000;
constexpr int limit = std::numeric_limits<int>::max() / 2; // 10000;
constexpr bool debug = false;
using namespace helper;
int solution(std::vector<std::vector<int>>& A)
{
if (A.empty() || A[0].empty() || A.size... | ALGO | 0.999884 | 5.196937 |
6f6d492e-31ef-42f7-b882-5daafdc50303 | Coding-Club-NIT-Silchar/ByteSource | Jo3kerR/Persistent Segment Tree.cpp | // https://www.spoj.com/files/src/29970922/
// https://www.spoj.com/files/src/29970298/
// Declaration : PST<int> P(size) ;
// Building the Segment Tree - P.build(a),
// a must be a vector and 1-indexed
// Update : P.update(k, index, val), update the value
// at index to val in the kth version
// Query : P.quer... | ALGO | 0.9988 | 4.469298 |
a6b88245-0a37-411b-ad9a-d1bf804f20ee | AsmaArooj441/AsmaArooj_Lab2_DSA | Lab2_Task3.cpp | #include <iostream>
using namespace std;
int main() {
int arr[]={5, 10, 15, 20, 25};
int *ptr=arr;
cout<<"Initial Pointer Value: "<<*ptr<<endl;
ptr++;
cout<<"Pointer value after Increment: " <<*ptr<<endl;
ptr--;
cout<<"Pointer value after Decrement: " <<*ptr<<endl;
ptr +=2;
cout<<"... | ALGO | 0.998632 | 4.030593 |
89b7d3a3-b881-4869-ac4d-6101c8fda9fa | BhreKheley/Variegata_Project | 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.998859 | 6.785645 |
1a984f3a-351e-441a-9b4f-94a661ba4a80 | phuongthanhcute/TTUD | Ôn thi cuối kì/Dem_nghiem_nguyen_Duong.cpp | #include <bits/stdc++.h>
using namespace std;
int main(){
int n, m;
cin>>n>>m;
vector<int> a(n);
for(int i=0; i<n; i++){
cin>>a[i];
}
//dp[i][j] số cách biểu diễn tổng j sử dụng i phần thử
vector<vector<int>> dp(n+1, vector<int>(m+1, 0));
dp[0][0] = 1;
for(int i=1; i<=n; i+... | ALGO | 0.999987 | 3.663918 |
d8c9f83f-3eb0-41ee-86d9-f42f780a166a | enkerewpo/__Hyperx_Algorithms_Templates | __Hyperx_Point_Biconnected_Component.cpp | #include <iostream>
#include <cstdio>
#include <algorithm>
#include <cstring>
#include <string>
#include <cmath>
#include <vector>
#include <stack>
using namespace std;
const int maxn = 1000;
struct Edge {// structure of the side of the stack
int u, v;
Edge(int uu, int vv) {
u = uu;
v = vv;
}
};
stack <Edge> s... | ALGO | 0.999924 | 5.121846 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.