uuid string | repo_name string | relative_path string | content string | category string | algo_rel_score float64 | quality_score float64 |
|---|---|---|---|---|---|---|
79108ea2-a4e0-4e14-9a6c-308e2525733e | yymin1022/Algorithm_Study | BOJ/1863.cpp | #include <bits/stdc++.h>
using namespace std;
int main(){
cin.tie(NULL);
cout.tie(NULL);
ios_base::sync_with_stdio(false);
int N;
cin >> N;
int result = 0;
stack<int> building;
for(int i = 0; i < N; i++){
int height, temp;
cin >> temp >> height;
while(!buildi... | ALGO | 0.999943 | 4.723169 |
d261de4a-5ce0-49bd-bd4b-fc8c8b667d91 | wynagito/algorithmzuo-recording | algorithmzuo_recording/156/t02_cunning_merchant.cpp | // 狡猾的商人,带权并查集模版题2
// 有n个月的收入,下标1 ~ n,但是并不知道每个月收入是多少
// 操作 l r v,代表从第l个月到第r个月,总收入为v
// 一共给你m个操作,请判断给定的数据是自洽还是自相矛盾
// 自洽打印true,自相矛盾打印false
// 1 <= n <= 100 1 <= m <= 1000
// 总收入不会超过int类型范围
// 测试链接 : https://www.luogu.com.cn/problem/P2294
#include <iostream>
const int MAXN = 102;
int t, n, m;
bool ans;
int father... | ALGO | 0.998996 | 4.85234 |
5c0c077a-c1fc-4009-b321-15a97055900d | lujiazho/LeetCode-Record | LeetCode/2095-delete-the-middle-node-of-a-linked-list.cpp | ///////////////////////////////////////////////////////////////////////////////////////////////
// easy fast and slow
////////////////
// Time Complexity: O(n)
// Space Complexity: O(1)
///////////////////////////////////////////////////////////////////////////////////////////////
class Solution {
public:
ListNode*... | ALGO | 0.999955 | 5.989531 |
36ffe93f-3395-447f-826e-8c5a37f84d03 | gaochq/CV_MVG | module/Epipolar_Geometry/src/Solve_Homography.cpp | //
// Created by buyi on 17-10-6.
//
#include "Solve_Homography.h"
using namespace std;
namespace CV_MVG
{
Solve_H_Matrix::Solve_H_Matrix():
Probe(0.99), Outlier_thld(1.25), Max_Iteration(100)
{
}
Solve_H_Matrix::~Solve_H_Matrix()
{
}
// Solve the homography using DLT
/*
... | ALGO | 0.999433 | 5.756345 |
5ebb99a2-1360-4a26-90ac-8e82d12d1765 | hajimeIppo-cmd/cp-codes | Baekjoon OJ/09000-09999/9610.cpp | #include <iostream>
using namespace std;
int main() {
int t;
scanf("%d", &t);
int Q1 = 0, Q2 = 0, Q3 = 0, Q4 = 0, AXIS = 0;
for (int test = 0; test < t; test++) {
int x, y;
scanf("%d %d", &x, &y);
if (x > 0 && y > 0) Q1++;
else if (x < 0 && y > 0) Q2++;
else if (x < 0 && y < 0) Q3++;
else if (x > 0 ... | ALGO | 0.995251 | 3.466607 |
33ec372c-3c43-4af4-8b7c-e2dfce0892c3 | Ien001/Point-DSRG | CRF/src/pairwise.cpp | #include "pairwise.h"
#include <iostream>
Kernel::~Kernel() {
}
class DenseKernel: public Kernel {
protected:
MatrixXf f_;
KernelType ktype_;
NormalizationType ntype_;
Permutohedral lattice_;
VectorXf norm_;
MatrixXf parameters_;
void initLattice( const MatrixXf & f ) {
const int N = f.cols();
lattice_.init... | ALGO | 0.997335 | 6.946054 |
3accdfe3-208e-4f3c-b2c3-4353fea3eab9 | 925146701/RescuePrincess. | cocos2d/cocos/storage/local-storage/LocalStorageAndroid.cpp | /*
Local Storage support for the JS Bindings for iOS.
Works on cocos2d-iphone and cocos2d-x.
*/
#include "LocalStorage.h"
#include "base/CCPlatformMacros.h"
#if (CC_TARGET_PLATFORM == CC_PLATFORM_ANDROID)
#include <stdio.h>
#include <stdlib.h>
#include <assert.h>
#include "jni.h"
#include "jni/JniHelper.h"
USING... | TOOL | 0.923593 | 6.266181 |
3f139c4f-6a05-4592-b0b4-e31e7fef04d5 | Alok-Khansali/Lets-LeetCode | Easy/Count_of_Matches_in_Tournament.cpp | class Solution
{
public:
int numberOfMatches(int n)
{
int ans = 0;
while (n != 1)
{
ans += n / 2;
n = (n + 1) / 2;
}
return ans;
}
}; | ALGO | 0.999873 | 5.329708 |
b4b7c205-ccba-48a7-8b42-8cbc60b4f224 | opensource-hisense/SmartTV-SeriesVidaaU7_NT | oss/part1/boost/boost_1_73_0/libs/graph/example/edge-function.cpp | using namespace boost;
template < typename Graph, typename VertexNamePropertyMap >
void read_graph_file(std::istream& graph_in, std::istream& name_in, Graph& g,
VertexNamePropertyMap name_map)
{
typedef typename graph_traits< Graph >::vertices_size_type size_type;
size_type n_vertices;
typename graph_t... | ALGO | 0.859878 | 5.635228 |
0861567b-f8a4-4d9c-9c9f-d8fa82abecb8 | Thanhnh214/cpp_beginning | basic2.cpp | #include<iostream>
using namespace std;
int main(){
int a,b;
int sum;
cin>>a>>b;
sum = a + b;
cout<<a+b;
} | ALGO | 0.971239 | 3.263624 |
2a503b03-a350-4e27-93e8-51a7ee3dcc2c | sumarbrandir/atcoder | practice/全探索/ABC144B.cpp | #include <bits/stdc++.h>
using namespace std;
int main() {
int n;
cin >> n;
bool flag = false;
for (int i=1; i<=9; i++) {
for (int j=1; j<=9; j++) {
if (n == i*j) {
flag = true;
break;
}
}
if(flag){break;}
}
if (flag) {
cout << "Yes" << endl;
} else {
cout... | ALGO | 0.999858 | 4.764519 |
4ee27518-7c22-43c0-a377-5d7c915960c6 | samuelchen2004/cpp | sieve.cpp | vi sieve(int N) {
bool prime[N+1]; fill(prime,prime+N+1,1);
for (int p = 2; p*p <= N; p++) if (prime[p]) {
for (int i = p*p; i <= N; i += p) prime[i] = 0;
}
vi v; forr(p,2,N+1) if (prime[p]) v.pb(p);
return v;
}
| ALGO | 0.999388 | 4.19374 |
225ee326-12a2-45ac-afa8-98fe7834ee97 | kurtukova/src_asm_dataset | data/SRC/_a_anjalbinayak/01KnapsackDP.cpp | // 0_1_Knapsack
// Input :
// 4
// 7
// 1 4 5 7
// 1 3 4 5
// Output :
// 9
#include<bits/stdc++.h>
#include<cmath>
using namespace std;
int KnapsackDp(int fw, int values[], int weight[], int n)
{
int dp[n+1][fw+1];
for(int i=0; i<=n; i++)
dp[i][0] = 0;
for(int i=0; i<=fw; i++)
dp[0][i] = ... | ALGO | 0.999995 | 3.806319 |
8fce250d-ecaa-4dc0-8db7-c3e3d3adce58 | AXP-OS/android_frameworks_av | media/codecs/amrnb/enc/src/c1035pf.cpp | /*
------------------------------------------------------------------------------
Pathname: ./audio/gsm-amr/c/src/c1035pf.c
Functions: q_p
build_code
code_10i40_35bits
Date: 09/28/2000
------------------------------------------------------------------------------
REVISION HISTORY
De... | ALGO | 0.999908 | 5.906797 |
79dac2a6-30d4-427c-bbb6-e6739e15206b | lewisKit/txt_torcs | vtorcs-RL-color/src/drivers/bt/opponent.cpp | #include "opponent.h"
// class variables and constants.
tTrack* Opponent::track;
const float Opponent::FRONTCOLLDIST = 200.0f; // [m] distance on the track to check other cars.
const float Opponent::BACKCOLLDIST = 70.0f; // [m] distance on the track to check other cars.
const float Opponent::LENGTH_MARGIN = 3.0f;... | ALGO | 0.985285 | 5.14423 |
f8834b6c-bb7b-4de0-937d-e23e338558eb | tomektiger/CPP-STUDIA | Semestr 2/Test/lokata.cpp | #include <iostream>
using namespace std;
int main()
{
double odsetki = 0.0;
double suma = 0.0;
double wyplata = 1000;
double procent = 0.05 / 12;
int miesiac = 0;
do
{
suma += wyplata;
odsetki = (suma * procent);
suma += suma + odsetki;
miesiac++;
} while... | ALGO | 0.999685 | 3.825182 |
2f9595b3-4aff-48ab-938f-21dab9fcfc14 | rahul-yagik/meal_app_flutter | 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 |
90191673-cc39-42b6-a7f6-22a3a83be6f6 | Sartech-B/Competitive-Programming | Hacker Rank/p53.cpp | #include <bits/stdc++.h>
using namespace std;
int main()
{
int n, k;
cin>>n>>k;
int a[n];
for(int i=0; i<n; i++) cin>>a[i];
long int ans = 0;
sort(a, a+n);
int i = n-1, t = 1;
while(i>=0)
{
for(int j=0; j<k && i>=0; j++)
{
ans += t*a[i];
i--;
}
t++;
}
cout<<ans<<endl;
} | ALGO | 0.999949 | 3.384651 |
4a2d4fad-7088-4ed6-8ad3-7f4627fdb13f | shoupon/fail-safe-bdcast | site.cpp | #include "site.h"
int Site::num_sites_;
Site::Site(Lookup* msg, Lookup* mac, int id)
: StateMachine(msg, mac), site_id_(id),
commit_phases_(WRAP_MULTIPLIER * num_sites_, 0), counter_(0) {
stringstream ss;
ss << SITE_NAME << "(" << id << ")";
setId(machineToInt(ss.str()));
machine_name_ = ss.str();
... | TOOL | 0.898086 | 5.168005 |
6d156889-26e8-44d4-9bb3-ddc63dfac20c | mehaljain/cpp | BinaryTree/TreeTraversal/PostOrder.cpp | #include <iostream>
using namespace std;
struct Node {
int data;
Node* left;
Node* right;
Node(int x) {
data = x;
left = right = nullptr;
}
};
// Function to perform postorder traversal
void postorderTraversal(Node* node) {
// Base case
if (node == nullptr)
return;... | ALGO | 0.999851 | 5.729116 |
7a97b34f-1e52-45a7-aa24-db664431d78a | Fedex59/Lic_sistemas | 1_Primer_año/Fu_prom/Guia_1/Ejercicio_3.cpp | #include <iostream>
using namespace std;
int main(int argc, char const *argv[])
{
int Hora, Hora2, Minutos, Minutos2, Segundos, Segundos2;
string Patente;
float Velocidad, Tiempo;
cout<< "Ingrese la patente ";
cin>> Patente;
cout<<"ingrese la hora, minutos, seguntos del puesto 1"<< endl;
cin>> Hora;
cin>>Min... | ALGO | 0.961216 | 4.004042 |
352caa7a-e27c-434d-bd51-d9ddb941ccac | mengjiaoliwang/window-file-copy | 01 STL三大组件/03 vector容器/03 vector容器.cpp | #define _CRT_SECURE_NO_WARNINGS
#include<iostream>
using namespace std;
#include <vector>
#include <list>
void test01()
{
vector<int> v;
for (int i = 0; i < 10; i++){
v.push_back(i);
cout << v.capacity() << endl; // v.capacity()
}
//2ĴСչ
}
/*
<IP_ADDRESS> vector캯
vector<T> v; //ģʵʵ֣ĬϹ캯
vector(v.begin(), v.en... | TOOL | 0.894401 | 3.339414 |
3e3b24f0-102b-4eb4-bb74-d4e212e5c02f | sarvex/leetcode-g-forth | solution/1100-1199/1192.Critical Connections in a Network/Solution.cpp | class Solution {
public:
int count = 0;
vector<int> dfn, low;
vector<vector<int>> graph;
vector<vector<int>> res;
void tarjan(int u, int fa) {
dfn[u] = low[u] = ++count;
for (auto& v : graph[u]) {
if (v == fa)
continue;
if (!dfn[v]) {
... | ALGO | 0.999948 | 5.772354 |
b455497a-f9f7-47eb-a3af-984e99eb769f | rahulkamble2026rk/Leetcode | 0560-subarray-sum-equals-k/0560-subarray-sum-equals-k.cpp | // class Solution {
// public:
// int subarraySum(vector<int>& nums, int k)
// {
// set<int>st;
// int sum=0;
// int count=0;
// for(int i=0;i<nums.size();i++)
// {
// sum+=nums[i];
// if(st.find(sum-k)!=st.end())
// {
// ... | ALGO | 0.999932 | 6.260141 |
2423a32c-beec-48e3-8328-7ca56cb80fcc | ishandutta2007/codeforces | sokokaleb/normal/611/D.cpp | #include <bits/stdc++.h>
#define __INIT_CC__ ios::sync_with_stdio(false); \
cin.tie(0);
#ifdef __WIN32__
char getchar_unlocked() {return getchar();}
#endif
#define FOR(_i,_n,_m) for(int (_i)=(_n),_t=(_m);_i<(_t);++(_i))
#define FORN(_i,_n,_m) for(int (_i)=(_n),_t=(_m);_i<=(_t);++(_i))
#define FORD(_i,_n,_m) for(in... | ALGO | 0.999983 | 4.004863 |
1675683b-2654-4f74-a399-52866d2741f5 | sumanmalakar/DSA_Material | DSA_In_Cpp/Lecture064 Tree Interview Questions Day2/boundaryTraversal.cpp | #include <bits/stdc++.h>
using namespace std;
#define MAX_HEIGHT 100000
// Tree Node
struct Node
{
int data;
Node* left;
Node* right;
};
// Utility function to create a new Tree Node
Node* newNode(int val)
{
Node* temp = new Node;
temp->data = val;
temp->left = NULL;
temp->right = NULL;
... | ALGO | 0.999802 | 6.305248 |
020e7a56-364a-455d-81ce-956e1d7c8a7f | RandomBuggy/HarryCPP | lec16/callByValue_callByReference.cpp | #include <iostream>
using namespace std;
int sum(int x, int y) {
return x + y;
}
void swap(int a, int b) {
int temp = a;
a = b;
b = temp;
}
void swapPointer(int* a, int* b) {
int temp = *a;
*a = *b;
*b = temp;
}
// call by reference with reference variable and return reference implement... | ALGO | 0.989407 | 6.268065 |
23335fde-22ce-4fb8-b962-9614b2692c19 | CaptainHarryChen/OIerCode | Virtual Judge/HDU1686_Oulipo.cpp | #include<cstdio>
#include<cstring>
const int MAXN=1000005;
int n,m;
char A[MAXN],B[MAXN];
int fail[MAXN];
int main()
{
int T;
scanf("%d",&T);
while(T--)
{
scanf("%s%s",B+1,A+1);
n=strlen(A+1);
m=strlen(B+1);
fail[0]=-1;
for(int i=1;i<=m;i++)
{
int u=fail[i-1];
while(u!=-1&&B[u+1]!=B[i])
u=fa... | ALGO | 0.999854 | 4.014153 |
c4a04629-db3b-401e-a713-6ff35c229a95 | Anup050/DSA | 0041-first-missing-positive/0041-first-missing-positive.cpp | class Solution {
public:
int firstMissingPositive(vector<int>& nums) {
unordered_set<int> s;
int n = nums.size();
for(int i=0; i<n; i++){
s.insert(nums[i]);
}
for(int i=0; i<nums.size();i++){
if(s.find(i+1) == s.end()){
return i+1;
... | ALGO | 0.999922 | 5.008453 |
3f5a4651-58a1-4c9e-af5d-e5f4c377152e | yuerbujin/data-structure | 实验/161940219-阴俊晖-第五次实验/161940219-阴俊晖-上机代码/1.二叉树基本操作20个.cpp | #include <iostream>
#include "binaryTree.h"
int main()
{
BiTree<char> bt;
BiNode<char>* root = bt.GetRoot();
//1.
cout << bt.Depth(root) << endl << endl ;
//2.ΪR
SetValue(root, 'R');
bt.LevelOrder();
cout << endl << endl ;
//3.EĸΪR
SetValue(Parent(bt, root->right->left), 'R');
bt.LevelOrder();
co... | ALGO | 0.997721 | 3.921449 |
03f604c9-2017-4d05-8671-473897d36ef8 | HRithIkGowDA/Placement_Preperation | leetcode/floodFillPixel.cpp | /*
An image is represented by a 2-D array of integers, each integer representing the pixel value of the image (from 0 to 65535).
Given a coordinate (sr, sc) representing the starting pixel (row and column) of the flood fill, and a pixel value newColor, "flood fill" the image.
To perform a "flood fill", consider the s... | ALGO | 0.999208 | 6.549747 |
4ff738ef-875d-4431-946f-8afd874389ec | ishandutta2007/codeforces | 4et_llpuyhbljl/normal/1359/A.cpp | #include<iostream>
#include<algorithm>
#include<vector>
#include<cmath>
#include<set>
#include<string>
#include<map>
#include<stack>
#include<queue>
#include<random>
#include<bitset>
using namespace std;
typedef long double ld;
#define double long double
inline int getint() {
int val = 0;
char c;
while ((c = getchar... | ALGO | 0.999962 | 4.231841 |
b68ff853-70b8-4367-8a21-2748e0a710ed | CaiHuicheng/Project | leetcode/leetcode/02两数相加.cpp | /*
给出两个 非空 的链表用来表示两个非负的整数。其中,它们各自的位数是按照 逆序 的方式存储的,并且它们的每个节点只能存储 一位 数字。
如果,我们将这两个数相加起来,则会返回一个新的链表来表示它们的和。
您可以假设除了数字 0 之外,这两个数都不会以 0 开头。
示例:
输入:(2 -> 4 -> 3) + (5 -> 6 -> 4)
输出:7 -> 0 -> 8
原因:342 + 465 = 807
*/
#include<iostream>
#include<list>
using namespace std;
//Definition for singly-linked list.
struct ListN... | ALGO | 0.999861 | 5.506994 |
7bfb06d5-48e6-44c6-ae95-1a186f3d1bdd | nnminh-sam/Problem-List | CodePTIT/CPP0213/solution.cpp | #include <iostream>
#include <string.h>
#include <vector>
#include <map>
#include <algorithm>
#include <math.h>
#define FASTIO ios_base::sync_with_stdio(false); cin.tie(NULL);
#define REP(i, n) for (int i = 0; i < n; ++i)
#define REV(i, r, l) for (int i = r; i >= l; --i)
#define FI first
#define SE second
typedef lon... | ALGO | 0.999954 | 4.541617 |
e0978639-51ef-4adb-b003-a08366d46681 | stymsingh/Codes | GeeksForGeeks/Linked List/sort a link list.cpp | #include<bits/stdc++.h>
using namespace std;
#define nodeptr Node*
/*********************************************************/
//Program to sort a link list
/*********************************************************/
struct Node
{
int data;
nodeptr next;
};
/**********************************************... | ALGO | 0.999995 | 4.678314 |
16850073-7be0-4200-b017-bdff84763546 | TomTom4/GeoLoc | georouter/WorkingRouterAndParser/router.cpp | #ifdef __APPLE__
#include <Python/Python.h>
#else
#include <Python.h>
#endif
#include <iostream>
#include <cstdio>
#include <cstdlib>
#include <vector>
#include <stdlib.h>
#include "router.hpp"
using namespace std;
//int main()
/*
int main(int argc,char *argv[])
{
std::vector<char*> ipath;
char point... | TOOL | 0.88925 | 3.407438 |
b0ac8809-4617-44ed-883a-ce38091cd050 | mgaillard/CS635 | Assignment1/CameraCalibration/HomographyProblem.cpp | #include "HomographyProblem.h"
#include <dlib/optimization.h>
#include "Utils.h"
using namespace dlib;
HomographyProblem::HomographyProblem(
const std::vector<cv::Vec3f>& objectPoints,
const std::vector<cv::Vec2f>& imagePoints) :
m_objectPoints(objectPoints),
m_imagePoints(imagePoints)
{
}
double HomographyP... | ALGO | 0.998294 | 6.189013 |
5c0a685d-0204-4283-8929-c91ccb4b0038 | GiuseppeOrlando878776/Samurai_Codes | Euler_MR/Euler_MR.cpp | #include <nlohmann/json.hpp>
#include "include/Euler_MR.hpp"
// Main function to run the program
//
int main(int argc, char* argv[]) {
using json = nlohmann::json;
auto& app = samurai::initialize("Explicit finite volume solver for the Euler equations", argc, argv);
std::ifstream ifs("input.json"); // Read a J... | ALGO | 0.983915 | 4.920281 |
9e22ec33-c7ff-486e-a19f-304bbc3fc633 | deepkakadiya7/Solution_-75dayofcoding_challenge | DAY 73 : binary-tree-level-order-traversal in Leetcode.cpp |
class Solution {
public:
vector<vector<int>> levelOrder(TreeNode* root) {
vector<vector<int>> ans;
if (root == NULL)
return ans;
queue<TreeNode*> q;
q.push(root);
while (!q.empty()) {
int k = q.size();
vector<int> level;
for (int ... | ALGO | 0.999991 | 5.861081 |
e43434f7-60d9-4e92-a7b0-914344f22947 | jwood000/RcppAlgos | src/ThreadSafeComb.cpp | #include "Combinations/ComboManager.h"
#include "NthResult.h"
#include <gmpxx.h>
#include <thread>
template <typename T>
void ThreadSafeCombinations(T* mat, const std::vector<T> &v, int n, int m,
bool Parallel, bool IsRep, bool IsMult, bool IsGmp,
const std::vect... | ALGO | 0.99854 | 6.696864 |
e4678cfb-c037-4f8b-8591-133599f45113 | sonal1201/Problem-Patterns | Dp_Problems/2D_Dp/longest_Arith_subSeq.cpp | // ProblemLink =https://leetcode.com/problems/longest-arithmetic-subsequence/
class Solution
{
public:
int dp[1004][1004];
int solve(int i, int diff, vector<int> &nums)
{
if (i < 0)
return 0;
// added 501 because we dont want to go neg
if (dp[i][diff + 501] != -1)
... | ALGO | 0.999978 | 5.286678 |
2d3349b0-f3e1-4ab5-897a-55384c7498f1 | leokang123/Algorithm | 1.9.백트래킹/NandM_5.cpp | #include <bits/stdc++.h>
using namespace std;
#define MAX 9
int arr1[MAX];
int arr2[MAX];
int ischeck[MAX];
int N,M;
void func(int k) {
if( k == M ){
for ( int i = 0 ; i < M ; i++ ){
cout << arr2[i] <<' ';
}
cout << '\n';
return;
}
for ( int i = 0 ; i < N ; i++ ... | ALGO | 0.999972 | 4.039361 |
92868ece-e890-4f3c-b586-56b031d33997 | rysh25/atcoder | abc130/b.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++)
#define rep1(i, n) for (int i = 1; i < (int)(n); i++)
int main()
{
int N, X;
cin >> N >> X;
int count = 1;
int D = 0;
rep(i, N)
{
in... | ALGO | 0.999965 | 3.864655 |
fd4844ce-9532-4d90-a337-eaa1998790b3 | samad-yar-khan/Competetive-Programming | Deltix/q1.cpp | #include <bits/stdc++.h>
using namespace std;
#define modVal 1000000007
#define ll long long
int main()
{
ios_base::sync_with_stdio(false);
cin.tie(NULL);
int T{0};
cin>>T;
while(T--){
ll n{0} , m{0};
cin>>n>>m;
string s;
cin>>s;
int arr[1001] = {0};
... | ALGO | 0.999993 | 4.937252 |
183a3f8c-8dbf-4f1d-9abc-e2ec9b25113e | Khanomjeens/Lab01 | 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 |
9aa40056-7b04-476e-8e4d-f6ff5d04ff92 | mozaic-jp/atcoder_tenkei90 | 030_K Factors.cpp |
/*
https://atcoder.jp/contests/typical90/tasks/typical90_ad
030 - K Factors(★5)
*/
#include <iostream>
#include <fstream>
#include <vector>
#include <cstring>
#include <complex>
#include <queue>
#include <map>
#include <algorithm>
#include <cmath>
#include <string>
#define ll long long
const ll MOD = 1000000007;
usi... | ALGO | 0.999916 | 4.622708 |
3dcc7cea-b792-4e2f-8c21-52963b22062e | HuseyinK0r0glu/LeetCode | 0234-palindrome-linked-list/0234-palindrome-linked-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:
bool isPalindrome(Lis... | ALGO | 0.99988 | 6.203893 |
895f0abe-0bb7-4b13-b975-17837f9cb940 | Feodor2006/2024-autumn | 2024.09.24-homework/Project7/Source.cpp | #include<iostream>
int main(int argc, char* argv[])
{
int v = 0;
int t = 0;
int s = 0;
int a = 0;
scanf_s("%d", &v);
scanf_s("%d", &t);
s = v * t % 109;
a = (s + 109) % 109 + 1;
printf("%d", a);
return EXIT_SUCCESS;
} | ALGO | 0.999544 | 3.586537 |
6ada77d9-7d74-4016-a8d9-9fa1641febcb | priyamsaxena20/LINKLISTT | DELETENODE_WITHOUTHEAD.cpp | /**
* Definition for singly-linked list.
* struct ListNode {
* int val;
* ListNode *next;
* ListNode(int x) : val(x), next(NULL) {}
* };
*/
class Solution {
public:
void deleteNode(ListNode* node) {
if(node->next==NULL){
delete node;
}
swap(node->val,node->next... | ALGO | 0.999973 | 5.502767 |
8fc4e3bc-0223-43c1-aae3-16d48126f49f | LDlornd/OI-Memory | 洛谷/P1000~P1999/P1500~P1599/P1536 村村通/P1536 村村通.cpp | #include<cstdio>
#include<iostream>
using namespace std;
const int MAXN1=1001;
int fa[MAXN1],size[MAXN1];
inline int getfa(int x)
{
if(fa[x]==x) return x;
else return fa[x]=getfa(fa[x]);
}
inline void Merge(int x,int y)
{
int nx=getfa(x),ny=getfa(y);
if(size[nx]<size[ny]) swap(nx,ny);
fa[ny]=nx;size[nx]+=size[ny];... | ALGO | 0.999783 | 3.983549 |
778da89a-a962-4957-a06a-fe2bb26934eb | CalebMason/FirstGame | Engine/Plugins/Experimental/MeshModelingToolsetExp/Source/MeshModelingToolsExp/Private/Sculpting/MeshSculptUtil.cpp | #include "Sculpting/MeshSculptUtil.h"
#include "Async/ParallelFor.h"
#include "Async/Async.h"
using namespace UE::Geometry;
void UE::SculptUtil::RecalculateNormals_Overlay(
FDynamicMesh3* Mesh,
const TSet<int32>& ModifiedTris,
TSet<int32>& VertexSetBuffer,
TArray<int32>& NormalsBuffer)
{
FDynamicMeshNormalOve... | TOOL | 0.957675 | 6.879086 |
81b68df2-d32a-49f7-952f-da479743cce3 | Saifu0/Competitive-Programming | CP/1500/perfect_pth_power.cpp | // ----- In the name of ALLAH, the Most Gracious, the Most Merciful -----
#include<bits/stdc++.h>
using namespace std;
#define NINJA ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0)
#define fo(i,n) for(int i=0;i<n;i++)
#define Fo(i,k,n) for(int i=k;i<n;i++)
#define for1(i,n) for(int i=1;i<=n;i++)
#define dloop(i... | ALGO | 0.999961 | 3.857572 |
ed93e7d6-a232-4ee6-a996-3ee425fbd232 | icoty/LeetCode | Algorithms/538.Convert_BST_to_Greater_Tree.cpp | #include "AllInclude.h"
class Solution {
public:
void reverse(TreeNode*& cur, int& plus)
{
if(!cur)
return;
reverse(cur->right, plus);
cur->val += plus;
plus = cur->val;
reverse(cur->left, plus);
}
TreeNode... | ALGO | 0.999979 | 6.265497 |
0c7b56d5-7361-40a1-91f4-9ee3feec93fc | perchuts/CompetitiveProgramming | AtCoder/abc100/c.cpp | #include <bits/stdc++.h>
#define all(x) x.begin(), x.end()
#define sz(x) (int) x.size()
#define endl '\n'
#define pb push_back
#define _ ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL);
#define int ll
using namespace std;
using ll = long long;
using ull = unsigned long long;
using ii = pair<int,int>;
us... | ALGO | 0.999865 | 4.95013 |
596affa7-9fb1-4e64-9e0b-8d8416b67187 | 642755747/ocfi | ocfi/llvm/lib/XRay/Profile.cpp | #include "llvm/Support/DataExtractor.h"
#include "llvm/Support/Error.h"
#include "llvm/Support/FileSystem.h"
#include "llvm/XRay/Trace.h"
#include <deque>
#include <memory>
namespace llvm {
namespace xray {
Profile::Profile(const Profile &O) {
// We need to re-create all the tries from the original (O), into the cu... | TOOL | 0.886641 | 6.773438 |
b2f1c05a-0b28-4e71-80db-8f3040d381ce | ishandutta2007/codeforces | akim/normal/538/F.cpp | #include <algorithm>
#include <iostream>
#include <sstream>
#include <utility>
#include <cstdlib>
#include <cstring>
#include <cassert>
#include <fstream>
#include <cstdio>
#include <string>
#include <vector>
#include <queue>
#include <cmath>
#include <ctime>
#include <stack>
#include <map>
#include <set>
using namesp... | ALGO | 0.99999 | 3.48384 |
1f43a112-0182-4718-b8cd-57e37160d9fd | ishandutta2007/codeforces | risujiroh/normal/1207/F.cpp | #include <bits/stdc++.h>
using namespace std;
using lint = long long;
template<class T = int> using V = vector<T>;
template<class T = int> using VV = V< V<T> >;
int main() {
cin.tie(nullptr); ios::sync_with_stdio(false);
constexpr int n = 5e5, B = 512;
V<> a(n);
VV<> b(B);
for (int k = 1; k < B; ++k) {
b... | ALGO | 0.999682 | 4.508456 |
487e8071-199b-46be-b838-30ce66eba6c9 | Baixiaochi9449/Python_algorithm | 王道/第3章:排序查找/成绩排序.cpp | #include <iostream>
#include <cstdio>
#include <algorithm>
#include <vector>
using namespace std;
struct student{
int num;
int score;
};
bool compare(const student& a,const student& b){
if (a.score==b.score){
return a.num<b.num;
}
else{
return a.score<b.score;
}
}
int main(){
... | ALGO | 0.999792 | 3.491924 |
94af9ac8-5d21-4b6b-8236-949be31203bd | bouffalolab/bouffalo_sdk | components/wireless/thread/openthread/src/core/utils/parse_cmdline.cpp | /**
* @file
* This file implements the command line parser.
*/
#include "parse_cmdline.hpp"
#include <string.h>
#include "common/code_utils.hpp"
#include "common/numeric_limits.hpp"
#include "common/string.hpp"
#include "net/ip6_address.hpp"
namespace ot {
namespace Utils {
namespace CmdLineParser {
static bo... | TOOL | 0.990575 | 6.975284 |
bc9c3846-52e6-490e-954a-58e47b1fcd93 | Hirochon/CompetitiveProgramming | alds/ALDS1_3/B/a.cpp | #include <iostream>
#include <queue>
using namespace std;
int main() {
int n, q, cost=0;
cin >> n >> q;
queue<int> Q;
queue<string> S;
for (int i = 0; i < n; i++) {
string name;
int time;
cin >> name >> time;
Q.push(time);
S.push(name);
}
while (!Q.em... | ALGO | 0.999931 | 3.798948 |
88cfd420-eab5-4313-b122-f9dfaf3a7fc2 | pharick/cpp | 1-year/4-if/pos-sum.cpp | #include <iostream>
using namespace std;
int main() {
int a, b, c, res = 0;
cin >> a >> b >> c;
if (a > 0) res += a;
if (b > 0) res += b;
if (c > 0) res += c;
cout << res << endl;
return 0;
}
| ALGO | 0.999676 | 4.458379 |
f7d6ae11-34a9-4a62-8f6d-37f09a63e0a8 | Sharknevercries/Online-Judge | UVA/Volume VI/670 The dog task.cpp | /* 9575065 670 The dog task Accepted C++ 0.012 2011-12-19 14:26:20 */
#include<stdio.h>
#include<string.h>
#include<math.h>
typedef struct dot MAKE;
struct dot{
int x,y;
};
MAKE xx[201],yy[201];
bool con[200][200];
bool visit[200];
int mx[200],my[200];
int n,m;
void initial(){
memset(con,false,sizeof(con));
for(int ... | ALGO | 0.999916 | 3.540866 |
34d6f9a1-f893-4dfa-a5b1-9eaf382467d9 | AHMED-JMD/oil_Pump_front | 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 |
6b0c4407-428c-4d66-8b06-03f642d40adc | smrfeld/d-Cubic | examples/test_deriv_p_boundary_2d/test_deriv_p_boundary_2d.cpp | #include <dcubic>
#include <iostream>
#include <random>
#include <ctime>
using namespace std;
using namespace dcu;
double fRand(double fMin, double fMax)
{
double f = (double)rand() / RAND_MAX;
return fMin + f * (fMax - fMin);
}
int main() {
// Seed
srand( time( NULL ) );
// Make dim
Dimension1D dim_... | ALGO | 0.963539 | 6.335259 |
5e3e4347-409b-466c-9ebd-61ab5c73610b | utk1725/My-code | reverseknodegrps.cpp | #include<iostream>
using namespace std;
class node{
public:
int data;
node* next;
node(){
this->data = 0;
this->next = NULL;
}
node(int data){
this->data = data;
this->next = NULL;
}
};
void print(node* &head){
node* temp = head;
while(temp != NU... | ALGO | 0.99989 | 4.255828 |
d9e79440-8906-4eef-8f0f-4a0a0722c43e | MoonLightJG/BaekJoon_Answer | 9316/9316.cpp | #define _CRT_SECURE_NO_WARNINGS
#include <stdio.h>
int main() {
//ڵ ۼ
int num;
scanf("%d", &num);
for (int i = 1; i <= num; i++)
printf("Hello World, Judge %d!\n", i);
return 0;
} | ALGO | 0.968792 | 3.096639 |
3c3b92c0-a1bb-469b-9dbd-c33769436157 | sarvex/leetcode-r | solution/0000-0099/0057.Insert Interval/Solution.cpp | class Solution {
public:
vector<vector<int>> insert(vector<vector<int>>& intervals, vector<int>& newInterval) {
vector<vector<int>> ans;
int st = newInterval[0], ed = newInterval[1];
bool insert = false;
for (auto& interval : intervals) {
int s = interval[0], e = interval... | ALGO | 0.999993 | 6.31803 |
bd0dfb96-7745-4cd5-8938-9235897deb86 | jishaNair1989/flutter_fire_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.998859 | 6.785645 |
1b4f9f93-e65a-4575-ad56-0d7e83a79fb7 | zeyadAlbadawy/Dynamic-Programming-Course | LeetCode Top 150/155-Min-Stack.cpp | class MinStack {
public:
vector<pair<int, int>> res;
MinStack() {
}
void push(int val) {
if(res.empty()) res.push_back({val, val});
else res.push_back({val, min(val, res[res.size() - 1].second)});
}
void pop() {
res.pop_back();
}
int top() {
... | ALGO | 0.999808 | 6.694318 |
91a39d0b-5532-4310-ac32-f4e8a4796342 | luscaBr2/CPP-IFSP-TADS | CPP/CAP04/C04EX03_Extra2 (execute ate que).cpp | // C04EX01.cpp
#include <iostream>
using namespace std;
int main(void)
{
// u vem de unsigned, ou seja, sem sinal, todos os numeros positivos
uint16_t n, i = 1;
uint16_t fat (1); // fat ja inicia com 1, ento tem como atribuir assim
cout << "Programa fatorial" << endl << endl;
cout << "Fatorial d... | ALGO | 0.999534 | 4.740935 |
0fa96a60-92f9-4e16-8375-2339be0cc9e3 | Straple/web-disain-old | OlimpiadProgramming/DATA/ConvexHullTrick/CHT.cpp | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
struct line
{
long double k , b;
line(ll _k , ll _b)
{
k = _k;
b = _b;
}
ll getVal(ll x)
{
return k * x + b; /// y
}
};
struct ConvexHullTrick
{
vector<line> H; ///
bool bad(line &a ,... | ALGO | 0.99978 | 3.5713 |
eb9f4999-c039-4a8e-96c8-3b0d078ba3f9 | esophagus-now/compressor | compressor.cpp | #include "compressor.h"
#include <hls_stream.h>
using namespace hls;
void compressor(
stream<float> &in,
stream<float> &out,
float thresh,
float slope
) {
#pragma HLS INTERFACE ap_ctrl_none port=return
#pragma HLS INTERFACE s_axilite port=slope bundle=CTRL_BUS
#pragma HLS INTERFACE s_axilite port=thresh bundl... | ALGO | 0.975818 | 4.866714 |
85c63055-5c03-4b5d-9f43-fdd42cfc7873 | pannawit12/shinlab25 | lab25_1.cpp | #include<iostream>
using namespace std;
class Node{
public:
int data;
Node *next;
~Node();
};
class List{
public:
Node *root;
int size;
void show();
void append(int);
void insert(int,int);
void remove(int);
};
Node::~Node(){
cout << data << " was deleted.\n";
}
void List::insert(... | ALGO | 0.999352 | 4.246498 |
21dbc74c-40f0-4991-9ba4-07859562bd3e | ISOLDE-Project/riscv-llvm | llvm/lib/CodeGen/CallBrPrepare.cpp | #include "llvm/CodeGen/CallBrPrepare.h"
#include "llvm/ADT/ArrayRef.h"
#include "llvm/ADT/SmallPtrSet.h"
#include "llvm/ADT/SmallVector.h"
#include "llvm/ADT/iterator.h"
#include "llvm/Analysis/CFG.h"
#include "llvm/CodeGen/Passes.h"
#include "llvm/IR/BasicBlock.h"
#include "llvm/IR/Dominators.h"
#include "llvm/IR/Func... | TOOL | 0.992155 | 7.913793 |
fbb6ec2d-b810-4d2d-a77b-f9febc1b31cd | AyushAgnihotri2025/CP-Solutions | GeeksforGeeks/C++/Medium/Aggressive Cows/aggressive-cows.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 {
private:
bool isValid(int n, int k, vector<int>& stalls, int distance){
int curr = stalls[0];
int cnt = 1;
for(int i=1; ... | ALGO | 0.999982 | 6.127764 |
1dcd33d4-121a-4a1b-a3fc-86dcea1298f1 | Jazzzrc/POO-1 | TRABAJO 2 POO/GUIA 1/calificacion40.cpp | #include <iostream>
#include <cstdlib>
using namespace std;
// El siguiente codigo sirve para encontrar la calificación más baja y la media
int main() {
int cantidadestu, i, nota;
int calificacion, menor, media, suma;
suma = 0;
cout << "\nIngresar cantidad: ";
cin >> cantidadestu;
i = 0;
... | ALGO | 0.993321 | 3.309986 |
e2de2c71-32e2-4a8a-b878-35b181a02ffc | PhQuangMinh/PTIT | Kì 2/SPOJ PTIT/NTSEQS2.cpp | #include<bits/stdc++.h>
using namespace std;
#define faster() ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL);
const int mod=1e9+7;
int main(){
faster();
int n, m;
cin >> n >> m;
int a[n+5];
for (int i=1;i<=n;i++) cin >> a[i];
int d[40005];
d[0]=1;
for (int i=1;i<=n;i++)
... | ALGO | 0.999998 | 3.873905 |
2e158522-7ee8-4b75-ad9e-4685ee16fdc4 | LazyPlanet/MX-Architecture | ThirdParty/boost_1_63_0/libs/math/example/students_t_example2.cpp | // students_t_example2.cpp
// Example 2 of using Student's t
// A general guide to Student's t is at
// http://en.wikipedia.org/wiki/Student's_t-test
// (and many other elementary and advanced statistics texts).
// It says:
// The t statistic was invented by William Sealy Gosset
// for cheaply monitoring the quality ... | ALGO | 0.995921 | 6.805 |
8d3ab4bc-7487-452c-b6a4-db1c6f8256e0 | bhartiomee/dailyCodes | graph/prims.cpp | #include <bits/stdc++.h>
using namespace std;
int spanningTree(int n, vector<vector<int>> adj[])
{
// code here
int key[n];
int mst[n];
int par[n];
for (int i = 0; i < n; i++)
{
key[i] = INT_MAX;
mst[i] = 0;
}
key[0] = 0;//min distance from 0 to itself
par[0] = -1;//as 0 is the src so its par... | ALGO | 0.999948 | 4.960049 |
5e6975d8-5444-4b0b-a679-40e875511bd1 | alifele/C-and-CPP | Cpp/Libraries/eigen-3.4.0/bench/eig33.cpp | #include <iostream>
#include <Eigen/Core>
#include <Eigen/Eigenvalues>
#include <Eigen/Geometry>
#include <bench/BenchTimer.h>
using namespace Eigen;
using namespace std;
template<typename Matrix, typename Roots>
inline void computeRoots(const Matrix& m, Roots& roots)
{
typedef typename Matrix::Scalar Scalar;
con... | ALGO | 0.999737 | 5.666831 |
27b8b2db-feda-4d35-a2c9-d08f3d80dd3d | HyeonDKIM/AlgorithmStudy | BOJ/10156.cpp | #include <iostream>
using namespace std;
int main(void) {
int K, N, M;
int money = 0;
cin >> K >> N >> M;;
int price = K * N;
if (price > M) {
money = price - M;
}
else if (price < M) {
money = 0;
}
cout << money << endl;
}
| ALGO | 0.998463 | 3.310374 |
e67fdab6-8b7d-4c07-a60a-0609e0512730 | jhuliagraziella/Summer-School-2020 | final-brasileira-2019/e.cpp | // Link pro contest: https://codeforces.com/gym/102428
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
ll soma(ll n) { // retorna 1 + 2 + 3 + ... + n
return (n * (n+1)) / 2;
}
int main() {
cin.tie(0); ios::sync_with_stdio(false);
string s;
ll b;
cin >> s >> b;
// se so tem 1 frut... | ALGO | 0.999906 | 4.003027 |
47dbc0e4-1200-4a15-b724-0982a549bf31 | 22922511/DSA-FOR-PROBLEM-SOLVING | TREE/BinaryTree/Easy/Sum of k smallest elements in BST.cpp | vector<int>ans;
void rec(Node*root){
if(root==NULL) return;
if(root->left) rec(root->left);
ans.push_back(root->data);
if(root->right) rec(root->right);
}
int sum(Node* root, int k)
{
ans.clear();
rec(root);
int n=ans.size();
int sum=0;
for(in... | ALGO | 0.999965 | 4.717752 |
d830e6f5-cc4f-4978-a9ba-f003d055f35f | gauravpundir14/Leetcode-Soluctions | 2966-divide-array-into-arrays-with-max-difference/2966-divide-array-into-arrays-with-max-difference.cpp | class Solution {
public:
vector<vector<int>> divideArray(vector<int>& nums, int k) {
vector<vector<int>> result;
sort(nums.begin(),nums.end());
for(int i=0;i<nums.size();i+=3)
{
if(nums[i+2]-nums[i]>k)
{
return {};
}
... | ALGO | 0.999941 | 5.486351 |
886090c2-764c-4425-bed4-3fb09eadadb8 | nihar8262/Leetcode | 1020-number-of-enclaves/1020-number-of-enclaves.cpp | class Solution {
private:
void dfs(int row,int col,vector<vector<int>>& grid,vector<vector<int>>& vis,
int delrow[],int delcol[]){
vis[row][col]=1;
int n=grid.size();
int m=grid[0].size();
for(int i=0;i<4;i++){
int nrow = row + delrow[i];
... | ALGO | 0.999975 | 6.339523 |
e35240e9-035d-4888-af2b-f4eff445c13c | zvxvx/cpp | lab7/DoublyLinkedList.cpp | /**
* Author: Greg Pappas
* Compiler: g++
*/
#include "Node.h"
void createDoublyLinkedList();
int main() {
createDoublyLinkedList();
return 0;
}
void createDoublyLinkedList() {
shared_ptr<Node<double>> start;
weak_ptr<Node<double>> end;
shared_ptr<Node<double>> nd(new Node<double>(2.567));
start = n... | TOOL | 0.895071 | 5.439038 |
5de6548a-4231-4ae2-988c-ab66191b6518 | fyrsta7/LLM_on_ASAC | result_api_backup/en_without_annotation_mzn/deepseek-coder_loop10/Borrow_Classrooms-5.cpp | #include <iostream>
#include <vector>
#include <algorithm>
using namespace std;
int main() {
int n, m;
cin >> n >> m;
vector<int> r(n);
for (int i = 0; i < n; ++i) cin >> r[i];
vector<int> d(m), s(m), t(m);
for (int i = 0; i < m; ++i) cin >> d[i] >> s[i] >> t[i];
vector<int> prefix_sum(n ... | ALGO | 0.999993 | 4.132586 |
2164ad93-a8eb-4eab-8378-f1257dc83b7a | prakhar7080/LeetCode_GeeksforGeeks | LinkedList/GFG_segregate_0s_1s_2s_linked_list(Using Vector).cpp | /*
Node is defined as
struct Node {
int data;
struct Node *next;
Node(int x) {
data = x;
next = NULL;
}
};
*/
class Solution {
public:
// Function to sort a linked list of 0s, 1s and 2s.
Node* segregate(Node* head) {
vector<int>arr;
Node *temp = head;
... | ALGO | 0.999959 | 5.486334 |
fcbfb636-5006-4055-92f6-1547018445e3 | Mindjolt2406/Competitive-Programming | SPOJ/ALLIZWEL.cpp | // This problem can be solved by a single dfs. The issue was that in the string 'ALLIZZWELL', there are multiple L's
// so, it's not possible to just simply mark all the nodes and move on
// so, t counter that, I marked the nodes with the index value in the string, and all other useless nodes as -1.
// But I never rea... | ALGO | 0.999455 | 4.22421 |
72ff0de7-073c-4247-a877-b3ddda991870 | dta12/Moodify | moodify_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.998709 | 6.783439 |
c3dc7afc-5853-4606-9229-635a3d644e80 | denis-gubar/Leetcode | Counting/1854. Maximum Population Year.cpp | class Solution {
public:
int maximumPopulation(vector<vector<int>>& logs) {
int result = 0;
int count = 0;
int best = 0;
vector<int> M(2100);
for (int i = 0; i < logs.size(); ++i)
++M[logs[i][0]], --M[logs[i][1]];
for(int i = 1900; i < 2100; ++i)
{
count += M[i];
if (best < count)
best = cou... | ALGO | 0.99982 | 5.660226 |
f25882bc-b74b-4668-bae0-c5a9254387a6 | nikup-collab/Nikup_leetcode | 215-kth-largest-element-in-an-array/215-kth-largest-element-in-an-array.cpp | class Solution {
public:
int findKthLargest(vector<int>& nums, int k) {
//heap
priority_queue<int, vector<int> , greater<int>> minh;
for(int i=0;i<nums.size();i++){
minh.push(nums[i]);
if(minh.size()>k){
minh.pop();
}
... | ALGO | 0.99994 | 5.024517 |
7667f68d-8cad-4b2e-ba62-4221520212b3 | IamAKX/sudarshan_saur_customer | 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 |
aab3eeec-16d7-4c0e-9c48-65ddca3a959e | grraghav120/Algorithms | Graph/calculateComponentsInGraph.cpp | #include <bits/stdc++.h>
using namespace std;
void printAdjacencyList(int vertices,vector<int> adj[]){
cout<<"Printing Adjacency list of Undirected Graph "<<'\n';
for(int i=0;i<vertices;i++){
cout<<"vertex "<<i<<" -> ";
for(auto it:adj[i]) cout<<it<<" ";
cout<<'\n';
}
}
void dfs(in... | ALGO | 0.999919 | 5.603989 |
18be39b2-377a-430d-8a21-e19ebd994faa | routb68/Leetcode-pratice | 2506-count-pairs-of-similar-strings/2506-count-pairs-of-similar-strings.cpp | class Solution {
public:
int similarPairs(vector<string>& ws) {
vector<set<char>>v(ws.size());
for(int i=0;i<ws.size();++i){
for(char &x:ws[i]) v[i].insert(x);
}
int ans=0;
for(int i=0;i<ws.size();++i){
for(int j=i+1;j<ws.size();++j){
i... | ALGO | 0.999943 | 5.679112 |
3a652053-268c-4b06-9e1d-9f3603652756 | FABhishek/CodeforcesContests | sticklength.cpp | #include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
using namespace std;
using namespace __gnu_pbds;
// Policy based data structure
template<class T> using oset=tree<T, null_type, less<T>, rb_tree_tag, tree_order_statistics_node_update>;
#define ll long long int
#define pii pair<ll,ll>
#define rep(i,s... | ALGO | 0.999969 | 4.456157 |
fc966288-8390-4672-b1ad-862019cd622c | Nishant-k-sagar/pre-cp-journey | ParallelProcessing.cpp | #include <bits/stdc++.h>
using namespace std;
#define ll long long
#define ld long double
#define fast ios::sync_with_stdio(false), cin.tie(0);
void nottryingenouf()
{
// try it harder
ll n;
cin>>n;
vector<ll> arr(n);
ll sum = 0;
for(ll i=0; i<n; i++){
cin>>arr[i];
sum+=a... | ALGO | 0.999846 | 4.935995 |
dcb20778-7d29-4e11-bf88-198386d90f2e | BangKartavya/GFG | Reorganize The Array/main.cpp | //{ Driver Code Starts
#include <bits/stdc++.h>
#include <iostream>
using namespace std;
// } Driver Code Ends
class Solution {
public:
vector<int> rearrange(const vector<int>& arr) {
int maxi = *max_element(arr.begin(), arr.end());
int n = arr.size();
vector<int> ans(maxi > n ? ... | ALGO | 0.999597 | 5.899702 |
5e8822c4-ea89-4756-979c-fd1dcaf248eb | SetsunaChyan/OI_source_code | 2012-2013 Northwestern European Regional Contest (NWERC 2012)/I.cpp | #include<iostream>
#include<stack>
#include<algorithm>
#include<queue>
#include<cstring>
#include<cstdio>
using namespace std;
typedef long long lt;
int read()
{
int f=1,x=0;
char ss=getchar();
while(ss<'0'||ss>'9'){if(ss=='-')f=-1;ss=getchar();}
while(ss>='0'&&ss<='9'){x=x*10+ss-'0';ss=getchar();}
... | ALGO | 0.999986 | 3.887645 |
51c5901b-8445-4649-9c6f-8075c3bf24ce | seventhsense07/Geeks-for-Geeks-POTD-Solved | February 2023/POTD 15-02-2023.cpp | class Solution{
public:
void dfs(vector<vector<int>> &mat, vector<vector<bool>> &vis, int i, int j, int n, int m){
if(i<0 || j<0 || i>=n || j>=m || vis[i][j]) return;
vis[i][j] = true;
if(i>0 && !vis[i-1][j] && mat[i-1][j] >= mat[i][j]){
dfs(mat, vis, i-1, j, n, m);
... | ALGO | 0.999992 | 6.473015 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.