uuid string | repo_name string | relative_path string | content string | category string | algo_rel_score float64 | quality_score float64 |
|---|---|---|---|---|---|---|
96a3a9af-218d-4944-ab02-7354aca28bc5 | sarvex/leetcode-chai | solution/1400-1499/1485.Clone Binary Tree With Random Pointer/Solution.cpp | /**
* Definition for a Node.
* struct Node {
* int val;
* Node *left;
* Node *right;
* Node *random;
* Node() : val(0), left(nullptr), right(nullptr), random(nullptr) {}
* Node(int x) : val(x), left(nullptr), right(nullptr), random(nullptr) {}
* Node(int x, Node *left, Node *right, ... | ALGO | 0.999299 | 5.442505 |
8ece700b-01a7-4aba-89a2-bfb88a7f1840 | ChoiOnion/Baekjoon | Project1/18258.cpp | #include <iostream>
#include <queue>
#include <string>
using namespace std;
int main() {
std::cin.tie(nullptr)->sync_with_stdio(false);
queue<int> q;
int n;
cin >> n;
for (int i = 0; i < n; i++) {
string s;
cin >> s;
if (s == "push") {
int num;
c... | ALGO | 0.998873 | 4.727742 |
d3a002c0-89dd-4f1f-b182-f41d8934581e | Kaleidio/SFML-Joust-Public | Source/Component/Mob/HunterController.cpp | #include "Component/Mob/HunterController.h"
void HunterEnemyControllerComponent::ai()
{
if (player_bird == nullptr) player_bird = game_object->scene->find_game_object_with_tag(Tag::PLAYER).lock().get();
if (bird == nullptr) return;
bird->walking_speed = 100.0f + std::max(wave_manager->current_wave_number * 10.0f, ... | TOOL | 0.889192 | 4.984492 |
67d75dc1-c0da-40e5-9415-9604a8064419 | anshumanmishhra1/DSA | Sorting/QuickSort/quickSort.cpp | #include<iostream>
#include<vector>
using namespace std;
int partition(int arr[],int si, int ei){
//find pivot element and place it at its place
int pivotElement = arr[(si+ei)/2];
int count = 0;
for(int i= si;i<=ei;i++){
if(i==(si+ei)/2) continue;
if(arr[i]<=pivotElement){
co... | ALGO | 0.999995 | 5.068747 |
be31a8d1-8a85-480d-a000-7c52401de815 | bowang007/Leetcode | 251-300/problem300.cpp | //
// Created by brayden on 2020-05-18.
//
#include "problem300.h"
#include <map>
using std::vector;
using std::map;
// O(n^2), time: 10%, space: 100%
int lengthOfLIS2(vector<int>& nums) {
if (nums.empty()) return 0;
vector<int> cur_longest(nums.size(), 1);
for (int i = 1; i < nums.size(); ++i) {
... | ALGO | 0.999968 | 6.2914 |
d34fb50c-380d-4af4-9480-4862d7131506 | sarvex/leetcode-vala | solution/0800-0899/0884.Uncommon Words from Two Sentences/Solution.cpp | class Solution {
public:
vector<string> uncommonFromSentences(string s1, string s2) {
unordered_map<string, int> cnt;
auto add = [&](string& s) {
stringstream ss(s);
string w;
while (ss >> w) ++cnt[move(w)];
};
add(s1);
add(s2);
vec... | ALGO | 0.999777 | 5.642371 |
c25d9155-e5f8-4110-bbf6-92686f05e305 | Niharika-valacha/leetcode | 0645-set-mismatch/0645-set-mismatch.cpp | class Solution {
public:
vector<int> findErrorNums(vector<int>& nums) {
unordered_map<int,int> freq;
vector<int> ans(2);
for(int i =0;i<nums.size();i++) // value enter ho gyi
{
freq[nums[i]]++;
}
for(auto &num:freq)
{
if(2 == num.se... | ALGO | 0.999648 | 5.416636 |
8c3107c0-7f28-4704-ab69-403f43fec9ab | wuxiao356/LeetCodeProblem | Min_Stack/Solution.cpp | #include <stack>
class MinStack {
public:
void push(int x) {
element.push(x);
if (minElement.empty()) minElement.push(x);
else if (minElement.top() >= x) minElement.push(x);
}
void pop() {
if (minElement.top() == element.top()) minElement.pop();
element.pop();
}
int top() {
return element.top();
}
... | ALGO | 0.999815 | 6.263503 |
7431178e-7a73-4ee3-8e97-ee854ab44dc8 | rt-kill/CompetitiveProgramming | LeetCode/Hard/robot-collisions/main.cpp | #include <bits/stdc++.h>
using namespace std;
/* Macros {{{ */
/* A lot of this is from some of Benq's submissions
[https://codeforces.com/profile/Benq]
Ugly af to the eyes, but with vim fold its barable
Hopefully c++20 concepts can make all this stuff must cleaner */
/* Basics {{{ */
using ll = long lon... | ALGO | 0.999979 | 5.194314 |
ef06b42b-8c7f-467f-a231-d5d93588a82e | FadeDemo/cpp_demo | cpp-primer-plus/sample/chapter-7/fun_ptr.cpp | //
// Created by fade on 2023/4/24.
//
#include <iostream>
double betsy(int);
double pam(int);
void estimate(int, double (*)(int));
int main()
{
using namespace std;
int code;
cout << "How many lines of code do you need? ";
cin >> code;
cout << "Here's Betsy's estimate:\n";
estimate(code, betsy)... | ALGO | 0.976849 | 6.058803 |
b1e09c23-c645-43a3-92c2-0e2ad1a5b4ba | Sandbird/GuessPro | Brazil/libs/Box2D/Dynamics/Joints/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.998931 | 7.709363 |
46f15e1e-4ebc-4e77-bd6e-6378d15845ca | jocagos/competitive | tcs/round1/B.cpp | #include <bits/stdc++.h>
#include <ext/pb_ds/tree_policy.hpp>
#include <ext/pb_ds/trie_policy.hpp>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/priority_queue.hpp>
using namespace std;
using namespace __gnu_pbds;
typedef long long ll;
typedef unsigned long long i64;
typedef long double ld;
typedef pai... | ALGO | 0.999773 | 3.240296 |
aad9c577-63ca-4462-827a-99086c41054c | luciocf/CP-Problems | IZhO/IZhO 2018/treearray.cpp | // IZhO 2018 - TreeArray
// Lúcio Cardoso
// Solution: Same as https://github.com/thecodingwizard/competitive-programming/blob/master/IZhO/IZhO%2018-treearray.cpp
#include <bits/stdc++.h>
using namespace std;
const int maxn = 2e5+10;
int n, m, q;
int a[maxn];
set<int> st1[maxn], st2[maxn];
int nivel[maxn];
int ... | ALGO | 0.9999 | 4.337427 |
2bb5ac68-1250-457a-8629-f894d8deed7b | zbrogz/MACAttack | sha1.cpp | /*
sha1.cpp - source code of
============
SHA-1 in C++
============
100% Public Domain.
Original C Code
-- Steve Reid <<EMAIL>>
Small changes to fit into bglibs
-- Bruce Guenter <<EMAIL>>
Translation to simpler C++ Code
-- Volker Grabsch <<EMAIL>>
Safety fixes
-- Eugene Hopkinson <slowriot at voxelstorm do... | ALGO | 0.949199 | 6.981328 |
c72bd5fe-3a00-4031-8918-9eed41577fc0 | tridibsamanta/Data-Structures-and-Algorithms | DS/BinarySearchTree_Delete_a_Node.cpp | #include<iostream>
using namespace std;
struct Node {
int data;
Node* left;
Node* right;
};
Node* FindMin(Node* root) {
while(root->left != NULL)
root = root->left;
return root;
}
Node* Delete(Node* root, int data) {
if(root == NULL)
return root;
//Node to be deleted is le... | ALGO | 0.999925 | 5.021871 |
ca7c1a28-f60c-4923-95ca-eecea9254ead | JustAG7/Competitive_Programming | Atcoder/ABC/336/E.cpp | #include<bits/stdc++.h>
using namespace std;
#define fast ios_base::sync_with_stdio(false);cout.tie(NULL);cin.tie(NULL);
#define ll long long
#define pb push_back
#define pf push_front
#define db double
#define X first
#define Y second
#define all(x) (x).begin(),(x).end()
#define rall(x) (x).rbegin(),(x).rend()
#define... | ALGO | 0.999868 | 4.176795 |
5588cf41-9184-4330-9468-c7d5221f64f2 | OnCampus-Community/Daily-DSA-Quest | Beginner/Day_29/Solution.cpp | #include <bits/stdc++.h>
bool isPossibleToSurvive(int n, int x, int d){
// Write your code here
if(n < x){
return false;
}
else{
int total = 0;
total += n*d;
total -= n*(d/7);
if(total >= x*d){
return true;
}
return false;
}
}
| ALGO | 0.999883 | 4.056599 |
9e853a1c-20b6-4e2c-91a3-62ce57ef877b | Rishab30Gupta/CppCodes21-22 | Level1/3)Dynamic Programming & Time Complexity Analysis/2)SortingAlgos&TimeComplexity/Count_Sort.cpp | #include<bits/stdc++.h>
using namespace std;
void print_array(vector<int>& arr) {
for (auto ele : arr) {
cout << ele << " ";
}
}
void count_sort(vector<int> &arr, int max, int min) {
int size_range = max - min + 1;
vector<int>freq(size_range, 0);
vector<int>fans(arr.size(), 0);
for (int i = 0; i < arr.size(); i... | ALGO | 0.999996 | 5.337073 |
81dbd621-7fd9-4221-9f7d-f2cf433154eb | vaibhavnirmal2001/DSA-problems | Counts Zeros Xor Pairs - GFG/counts-zeros-xor-pairs.cpp | // { Driver Code Starts
// C++ program to find number
// of pairs in an array such
// that their XOR is 0
#include <bits/stdc++.h>
using namespace std;
// Function to calculate the
// count
long long int calculate(int a[], int n);
// Driver Code
int main()
{
int t;
cin>>t;
while(t--)
{
int n;
cin>>n;
i... | ALGO | 0.999866 | 5.621221 |
ad1b9060-258b-4fbf-ba91-96a3306ac694 | CodeBySushant/SolvedLeetcode | leetcode-main/leetcode-main/solution/2200-2299/2263.Make Array Non-decreasing or Non-increasing/Solution.cpp | class Solution {
public:
int convertArray(vector<int>& nums) {
int a = solve(nums);
reverse(nums.begin(), nums.end());
int b = solve(nums);
return min(a, b);
}
int solve(vector<int>& nums) {
int n = nums.size();
int f[n + 1][1001];
memset(f, 0, sizeof... | ALGO | 0.999986 | 5.667111 |
3c3327a7-d6eb-47bb-ae36-3d7365af442b | machaulay/DSRPT21_VidanaAgua-GameJam | DSRPT21_VidanaAgua-GameJam/Library/PackageCache/com.unity.ide.visualstudio@2.0.12/Editor/COMIntegration/COMIntegration~/COMIntegration.cpp | #include <iostream>
#include <sstream>
#include <string>
#include <filesystem>
#include <windows.h>
#include <shlwapi.h>
#include "BStrHolder.h"
#include "ComPtr.h"
#include "dte80a.tlh"
constexpr int RETRY_INTERVAL_MS = 150;
constexpr int TIMEOUT_MS = 10000;
// Often a DTE call made to Visual Studio can fail after ... | TOOL | 0.973112 | 6.969462 |
9eaf316f-f6b8-40af-b9e1-18c2891f77e2 | Modding-Zaibatsu/Pre-Unreal-4.14 | Engine/Source/ThirdParty/PhysX/PhysX_3.4/Source/GeomUtils/src/mesh/GuMidphaseBV4.cpp | #include "GuBV4.h"
using namespace physx;
using namespace Gu;
#include "PsVecMath.h"
using namespace physx::shdfnd::aos;
#include "GuSweepMesh.h"
#include "GuBV4Build.h"
#include "GuBV4_Common.h"
#include "GuSphere.h"
#include "GuCapsule.h"
#include "GuBoxConversion.h"
#include "GuConvexUtilsInternal.h"
#include "GuV... | ALGO | 0.994641 | 7.817488 |
c9514898-b405-437a-a65e-964220b2e0f4 | parmance/llvm-project | libcxx/test/std/algorithms/alg.sorting/alg.binary.search/upper.bound/upper_bound.pass.cpp | // <algorithm>
// template<ForwardIterator Iter, class T>
// constexpr Iter // constexpr after c++17
// upper_bound(Iter first, Iter last, const T& value);
#include <algorithm>
#include <vector>
#include <cassert>
#include <cstddef>
#include "test_macros.h"
#include "test_iterators.h"
#if TEST_STD_VER > 17
T... | TEST | 0.993109 | 7.253215 |
df5cf26d-2717-43ee-83fc-844eb32a6cb9 | dothiloan1994/T2011E_LBEP_DoThiLoan | assignment2c.cpp | #include <stdio.h>
int main(){
int a,b;
printf("Nhap a = ");
scanf("%d",&a);
printf("Nhap b = ");
scanf("%d",&b);
int ngayThang = 1;
if(b>0){
if(a==1||a==3||a==5||a==7||a==8||a==10||a==12){
if(b>31){
ngayThang = 0;
}else{
ngayThang = 1;
}
}else{
if(a==4||a==6||a==9||a==11){
if(b>... | ALGO | 0.999155 | 3.231899 |
14f8f687-fb59-4747-90aa-1d6f6ef543bd | kai1230/2021cce2 | week03/week03-1.cpp | #include<stdio.h>
#include<string.h>
char line[2000];
int palindrome()
{
int n=strlen(line);
for(int i=0;i<n;i++){
if(line[i]!=line[n-1-i])return 0;
}
return 1;
}
int main()
{
while(scanf("%s",line)==1){
int p=palindrome();
if(p==1)printf("%s -- is a regular palindrome.\n\n",line);
if(p==0... | ALGO | 0.993375 | 3.071749 |
885f1e4f-25d9-41d2-b184-54fa37dc10d1 | bhargav157/codesGit | strings/stringstreamclass.cpp | #include<bits/stdc++.h>
using namespace std;
int main(){
string s;
getline(cin,s);
stringstream ss(s);
string temp;
while(ss>>temp){
cout<<temp<<endl;
}
return 0;
} | TOOL | 0.968358 | 3.595746 |
00dd4bf1-1dd8-490b-913d-bde9990c7329 | ishandutta2007/codeforces | qingyu/normal/582/A.cpp | #include <bits/stdc++.h>
const int N = 1e5 + 50;
std::multiset<int, std::greater<int>> ms;
inline char nc()
{
static char buf[1000000], *p1 = buf, *p2 = buf;
return p1 == p2 && (p2 = (p1 = buf) + fread(buf, 1, 1000000, stdin), p1 == p2) ? EOF : *p1++;
}
inline int read()
{
int res = 0;
char ch;
do ch = nc(); wh... | ALGO | 0.999968 | 3.707325 |
20d39d07-17fc-4591-972a-ec62a6a4ff90 | blackgeorge-boom/tbbs | parallel_reduce.cpp | //
// Created by blackgeorge on 7/3/19.
//
#include <vector>
#include <chrono>
#include "foo.h"
#include "random_data.h"
#include <tbb/blocked_range.h>
#include <tbb/parallel_reduce.h>
class SumFoo {
std::vector<int>* my_a;
public:
long int sum;
explicit SumFoo(std::vector<int>* a): my_a{a}, sum{0} {};... | ALGO | 0.986114 | 5.89832 |
e4f5fd7f-f828-464c-8181-bd48bf40f485 | wxWidgets/debian | src/gtk1/menu.cpp | // For compilers that support precompilation, includes "wx.h".
#include "wx/wxprec.h"
#include "wx/menu.h"
#include "wx/stockitem.h"
#ifndef WX_PRECOMP
#include "wx/intl.h"
#include "wx/log.h"
#include "wx/app.h"
#include "wx/bitmap.h"
#endif
#if wxUSE_ACCEL
#include "wx/accel.h"
#endif // wxUSE_... | TOOL | 0.91384 | 5.960956 |
ffbfb9d2-44d0-400c-b61e-95bcf9154444 | kseniadobrovolskaia/Square_Matrix | Matrix/main.cpp | #include "Matrix.hpp"
int main()
{
try
{
int n;
char space;
std::cin >> std::noskipws;
std::cin >> n;
std::cin >> space;
if (!std::isspace(space) || std::cin.fail())
{
throw std::logic_error("Invalid input");
}
Matrix<double> m(n);
std::cin >> m;
std::cout << "Determinant: " << m.det()... | TOOL | 0.994899 | 5.502068 |
df9f4525-6149-44d9-9cc2-80ee96bcea73 | Tacuma/Sorts | (3)Insertion-Sort/InsertionSort.cpp | //Tacuma Solomon
//Computer Science 3
//You are asked to create a vector of 1,000 random integers (all < 10,000) and to save them in an output file.
//Use vectors and iteractors thoughout your code. Your program can use the following code to generate a random number between 1 and 10,000.
//The resulting file of rand... | ALGO | 0.999291 | 4.573637 |
28923fde-98b7-46bf-b6e8-7a22c0ecdf64 | puqin2333/lintCode | 旋转字符串/旋转字符串/main.cpp | /* 算法描述:
* 给定一个字符串和一个偏移量,根据偏移量旋转字符串(从左向右旋转)
*/
/* 样例
对于字符串 "abcdefg".
offset=0 => "abcdefg"
offset=1 => "gabcdef"
offset=2 => "fgabcde"
offset=3 => "efgabcd"
*/
#include <iostream>
#include <vector>
using namespace std;
class Solution {
public:
/*
* @param str: An array of char
* @param offs... | ALGO | 0.999859 | 5.394889 |
aace72a7-c7d8-47ff-9291-30ba65b7cff8 | WenqiJiang/SIGMOD-2022-submission-Fanns | PE_optimization/cluster_distance_computation/distance_computation_PE_systolic_unoptimized/src/host.cpp | #include "host.hpp"
#define BANK_NAME(n) n | XCL_MEM_TOPOLOGY
/* for U280 specifically */
const int bank[40] = {
/* 0 ~ 31 HBM */
BANK_NAME(0), BANK_NAME(1), BANK_NAME(2), BANK_NAME(3), BANK_NAME(4),
BANK_NAME(5), BANK_NAME(6), BANK_NAME(7), BANK_NAME(8), BANK_NAME(9),
BANK_NAME(10), BANK_NAME(... | ALGO | 0.965819 | 4.571334 |
7d26b76f-3011-46a0-8396-1aafb946e096 | ln53491/Projekt | libs/ecf/examples/APSymbReg/main.cpp | #include <ECF/ECF.h>
#include "SymbRegEvalOp.h"
int main(int argc, char **argv)
{
StateP state (new State);
// set the evaluation operator
state->setEvalOp(new SymbRegEvalOp);
state->initialize(argc, argv);
state->run();
// after the evolution: show best solution in Tree form
std::vector<IndividualP> hof = s... | ALGO | 0.998048 | 5.104132 |
075d32f1-e714-45ac-a996-6d8bfa1dc640 | Yash-Thakare22/DSA_Uplift_Project | Assignments/Solutions/Siddhi Bhanushali/Assignment 5/Q2.cpp | #include <bits/stdc++.h>
using namespace std;
int kthSmallest(int arr[], int n, int k)
{
// Sort the given array
sort(arr, arr + n);
// Return k'th element in the sorted array
return arr[k - 1];
}
int main()
{
int arr[100],n,k;
cin>>n;
for(int i=0;i<n;i++){
cin>>arr[i];
}
... | ALGO | 0.999967 | 4.767632 |
bb89b42e-0186-4523-a865-6c6a40fdc855 | RostyslavKashpurenko/NG_2024_Rostislav_Kashpurenko | Lesson_1/Task_6/main.cpp | #include <iostream>
using namespace std;
int main()
{
int height = 0;
cout << "Enter size: ";
cin >> height;
cout << endl;
for (int branch = 1; branch <= height; branch++)
{
int stars = (branch * 2) - 1;
int space = height - branch + 1;
for (int snow = 0; snow < sp... | ALGO | 0.997238 | 4.621078 |
6664f046-2988-42be-bd09-8f6ee64ff6a4 | palilo815/ps | baekjoon/14000/14927.cpp | #include <bits/stdc++.h>
#define LOOP(i,n) for(int i=1;i<=n;++i)
using namespace std;
const int mxN = 20;
int ans = INT_MAX;
bool mat[mxN][mxN], tmp[mxN][mxN];
int main() {
cin.tie(0), cout.tie(0);
ios::sync_with_stdio(0);
int N; cin >> N;
LOOP(i, N) LOOP(j, N) cin >> mat[i][j];
function<void(i... | ALGO | 0.999944 | 4.591006 |
b81168ec-62c2-45a7-9e20-ad684554a26b | fkshohag/spoj-problem-solution | Arbitrage.cpp | # include <iostream>
# include <cstdio>
# include <map>
using namespace std;
int main(){
#ifndef ONLINE_JUDGE
freopen("in","r",stdin);
#endif // ONLINE_JUDGE
int n,test=0;
while(cin>>n){
if(n == 0)
break;
map<string , int> mp;
string a;
for(int i=0;i<n;i++)... | ALGO | 0.999721 | 3.595113 |
a6879c97-0bb9-441f-b96e-4ec580f10c8e | ag-wnl/usaco | bronze/speeding_ticket.cpp | #include <bits/stdc++.h>
using namespace std;
#define ff first
#define ss second
#define ll long long
#define zerobits(x) __builtin_ctzll(x)
#define setbits(x) __builtin_popcountll(x)
#define invectr(x) \
for (auto &i : x) \
cin >> i;
const int MAXN = 200200;
int main(){
int n, m, pos = 1, res = 0;
... | ALGO | 0.999966 | 3.918687 |
2193219e-7601-4359-8853-c38094cb82b5 | Balpreet1003/LeetCode | 0080-remove-duplicates-from-sorted-array-ii/0080-remove-duplicates-from-sorted-array-ii.cpp | class Solution {
public:
int removeDuplicates(vector<int>& nums) {
int k=nums.size(),n=nums.size(),cnt=1,num=nums[0];
for(int i=1;i<n;i++){
if(nums[i]==num){
cnt++;
if(cnt>2){
k--;
nums[i]=INT_MIN;
}
... | ALGO | 0.999889 | 6.209341 |
b9ff2425-0f0e-45ab-8845-25fe1d29b7aa | SehoonKwon/Study_Baekjoon | BJ_21940.cpp | #include <iostream>
#include <vector>
#include <algorithm>
using namespace std;
#define INF (int)1e9
int N, M, K;
int Array[201][201];
int dist[201][201];
int home[201];
vector<int> ans;
void input()
{
cin >> N >> M;
int a, b, c;
for (int i = 0; i < M; i++)
{
cin >> a >> b >> c;
Array[a][b] = c;
}
cin >> ... | ALGO | 0.999981 | 4.14038 |
48ec2b87-4c9c-42ec-ab7d-6f061992e5f6 | justBeHonest/fluttermvvmtemplate | 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.998693 | 6.797273 |
3c2c64b8-38f1-4627-9cd9-f8eead4ade47 | sarvex/leetcode-kotlin | solution/0300-0399/0325.Maximum Size Subarray Sum Equals k/Solution.cpp | class Solution {
public:
int maxSubArrayLen(vector<int>& nums, int k) {
unordered_map<int, int> mp;
mp[0] = -1;
int s = 0, ans = 0;
for (int i = 0; i < nums.size(); ++i) {
s += nums[i];
if (mp.count(s - k)) ans = max(ans, i - mp[s - k]);
if (!mp.co... | ALGO | 0.999927 | 6.079773 |
4c091602-fd3a-45a0-b368-85c3eb77008a | ishandutta2007/codeforces | pavel.savchenkov/normal/131/E.cpp | //HACK ME, PLEASE! ^_^
#include <cstdio>
#include <iostream>
#include <algorithm>
#include <cstring>
#include <string>
#include <vector>
#include <set>
#include <utility>
#include <math.h>
#include <cstdlib>
#include <memory.h>
#include <queue>
#include <assert.h>
#define pb push_back
#define i64 long long
#define mp ... | ALGO | 0.999908 | 3.019338 |
79d44a1b-8e27-43cb-9d48-c603b46c610d | Smiljanic/Espresso-Code | src/core/polymer.cpp | /** \file polymer.cpp
This file contains everything needed to create a start-up configuration
of (partially charged) polymer chains with counterions and salt molecules,
assigning velocities to the particles and crosslinking the polymers if necessary.
The corresponding header file is polymer.hpp.
... | TOOL | 0.992299 | 3.642543 |
138b7497-c768-42b3-a17f-56e19684ffc9 | sri-soumya/leetcode-questions | 673-number-of-longest-increasing-subsequence/673-number-of-longest-increasing-subsequence.cpp | class Solution {
public:
int findNumberOfLIS(vector<int>& a) {
int n=a.size();
vector<int> f(n,1),w(n,1);
int m=1,in=0;
for(int i=1;i<n;i++)
{
int c=0;
for(int j=0;j<i;j++)
{
if(a[j]<a[i]&&f[j]+1>f[i])
{
... | ALGO | 0.999991 | 5.494568 |
29ef5a41-3e65-40a6-b747-ca5e9b18da31 | adiiityaaa/CS-XI | Question Bank/ReverseArray.cpp | #include <iostream>
using namespace std;
int main() {
int size;
cout<<"Enter the size of the array [Max 30]:\n";
cin>>size;
if(size>30) { cout<<"Size greater than 30!"; exit(0); }
int arr[size];
cout<<"Enter "<<size<<" elements for the array:\n";
for(int i=0; i<size; i++) {
cin>>arr[i];
}
for(int i=0; i<si... | ALGO | 0.929282 | 3.298983 |
8358e021-206f-4f27-872c-48cd08d9ee39 | faizan346/Ds-Algo-Cplusplus | binary-Tree/38bottomView.cpp | #include<bits/stdc++.h>
using namespace std;
class TreeNode
{
public:
int val = 0;
TreeNode *left = nullptr;
TreeNode *right = nullptr;
TreeNode(int val)
{
this->val = val;
}
};
vector<int> BottomView(TreeNode *root)
{
queue<pair<TreeNode*, int>> q;
q.push({root, 0});
int ... | ALGO | 0.999989 | 5.38265 |
1b0be98a-cd4a-4a74-bd10-c572aeb09652 | jahanzaib-ahsan/cppLearning | ass2k.cpp | #include <iostream>
using namespace std;
int main()
{
int withdrawl_Amount;
cout << "Enter amount you want to withdraw greater than 0 : ";
do
{
cin >> withdrawl_Amount;
} while (withdrawl_Amount < 0);
int note1 = withdrawl_Amount / 100;
int remainder = withdrawl_Amount % 100;
co... | TOOL | 0.971253 | 4.005421 |
049d6a9d-2022-4f62-a1a9-17d5a901e5d1 | VSB14/CPP | Leetcode/SolvedProblems.cpp/Sum of SubArr Range.cpp | #include <iostream>
#include <vector>
#include <stack>
using namespace std;
int mod = 1e9+7;
vector<int> findNSE(vector<int> &nums, int n)
{
// vector<int> res(n);
stack<int> st;
vector<int> res(n);
for (int i = n - 1; i >= 0; i--)
{
while (!st.empty() && nums[st.top()] >= nums[i])
... | ALGO | 0.999987 | 4.604061 |
12cc8c56-bbf0-4971-ac52-37d9ff4c9dce | thebesttv/00.ACM | 02.LuoGu/4127.cpp | // Tag: 数位DP
#include<iostream>
#include<cstdio>
#include<cstdlib>
#include<cstring>
#include<climits>
#include<cmath>
#include<ctime>
#include<vector>
#include<queue>
#include<stack>
#include<list>
#include<set>
#include<map>
#include<utility>
#include<algorithm>
using namespace std;
#define FOR(i,a,b) for(register i... | ALGO | 0.999686 | 3.878253 |
8b5aafbf-878a-4c4b-bf36-c6ca18b3ceb9 | alexandraback/datacollection | solutions_2755486_0/C++/hjc112358/C.cpp | #include <stdio.h>
#include <queue>
using namespace std;
#define MM 676060
int T,N;
struct nomadic
{
int d;
int n;
int w,e;
int s;
int d_d;
int d_p;
int d_s;
};
bool operator < (struct nomadic a, struct nomadic b)
{
return a.d > b.d;
}
typedef struct nomadic s_nomadic;
struct defense
{
int height;
int w,e... | ALGO | 0.999088 | 3.560738 |
778dab4b-c6d4-4f79-a99d-44651f7cb989 | Dipankar2020-ai/Coding-ninjas-Ds-with-c- | Binary tree assignment/print level order traversal in binary tree.cpp | #include <iostream>
#include<bits/stdc++.h>
#include<queue>
using namespace std;
template<typename T>
class Binarynode
{
public:
T data;
Binarynode* left;
Binarynode* right;
Binarynode(T data)
{
this->data=data;
left=NULL;
right=NULL;
}
~Binarynode()
{
... | ALGO | 0.999972 | 5.092155 |
5af9c5e2-a7d7-45b2-bfa4-f13c5954fea3 | sidhantchadha/LEETCODE | LEETCODE-7.ReverseInteger.cpp | class Solution {
public:
int reverse(int x) {
long long res = 0;
int a=0;
while(x) {
a=x%10;
res = res*10 + a;
x /= 10;
}
return (res<INT_MIN || res>INT_MAX) ? 0 : res;
}
};
| ALGO | 0.999987 | 5.712228 |
88d2cc68-e30e-488b-b643-d88d5733925e | ishandutta2007/codeforces | um_nik/normal/1071/C.cpp | #include <iostream>
#include <cstdio>
#include <cstdlib>
#include <algorithm>
#include <cmath>
#include <vector>
#include <set>
#include <map>
#include <unordered_set>
#include <unordered_map>
#include <queue>
#include <ctime>
#include <cassert>
#include <complex>
#include <string>
#include <cstring>
#include <chrono>
... | ALGO | 0.999985 | 3.365393 |
1f64892d-ba58-4780-9120-5fdef422d6ec | jonatas57/maratona | cf/gym/102501/a/a.cpp | #include <bits/stdc++.h>
using namespace std;
#define pb push_back
#define eb emplace_back
#define mk make_pair
#define fi first
#define se second
#define endl '\n'
typedef long long ll;
typedef pair<ll,ll> ii;
typedef tuple<ll,ll,ll> ti;
typedef vector<ii> vii;
typedef vector<ti> vti;
const ll INF = 0x3f3f3f3f3f3f3f... | ALGO | 0.999897 | 3.827902 |
ea64e82d-fcb4-44c8-bb46-c53d0b35053b | guplakshya/Codeforces | Dubstep.cpp | #include <bits/stdc++.h>
using namespace std;
// Dubstep
int main(){
string s;
int flag=1;
cin>>s;
for(int i=0;i<s.size();i++){
if(s[i]=='W'&& s[i+1]=='U' && s[i+2]=='B'){
i+=2;
if(!flag){
cout<<" ";
}
continue;
}else {
flag=0;
cout<<s[i... | ALGO | 0.999871 | 3.393914 |
19256fe8-6cc4-4531-8b34-3dd5f50b9f33 | AbhinavAbhishek77/Graph-DSA | G-17-BipartiteGraph.cpp | // <---------------BFS Approach--------------------->
// My Code
// TC: O(V+E)
// SC: O(V)
bool bfs(int src, vector<int> adj[], vector<int> &col)
{
col[src] = 0;
queue<pair<int, int>> q;
q.push({src, 0});
while (!q.empty())
{
int node = q.front().first;
int color = q.front().second... | ALGO | 0.999968 | 6.233071 |
fd986fc5-21e3-4e2e-801b-afd7fb34c725 | csfahad/DSA-PRACTICE | Linked List/addTwoNumbersAsLL.cpp | // Add two numbers represented as Linked Lists
// PROBLEM LINKS:
// LEETCODE: https://leetcode.com/problems/add-two-numbers/
// CODE STUDIO: https://leetcode.com/problems/add-two-numbers/
// APPROACH : ELEMENTARY MATH
// Intuition: Keep track of the carry using a variable and simulate digits-by-digits sum starting f... | ALGO | 0.999966 | 6.701558 |
ce8c1880-fee8-44b1-86c2-0d266ea1c345 | alexandraback/datacollection | solutions_5640146288377856_1/C++/MatusH/main.cpp | #include <iostream>
#include <fstream>
#include <stdlib.h>
#include <sstream>
#include <string>
using namespace std;
unsigned long long int howMany(unsigned long long int C, unsigned long long int W){
if (W == 1)
return C;
if (C % W == 0)
return C/W+1+W-2;
else
return C/W+1+W-1;
}
... | ALGO | 0.999242 | 3.949053 |
45306805-34d1-4657-bc49-054072a1b133 | akashydv311/180-Days-Of-Code | Coder Army/Day-29/sorting/InsertionSort.cpp |
#include <iostream>
using namespace std;
int main()
{
int arr[1000];
int n;
cout << "Enter the size of array: ";
cin >> n;
// values in an array
cout << "Enter values in an array: " << endl;
for (int i = 0; i < n; i++)
cin >> arr[i];
// implimenting insertion sort
for (int ... | ALGO | 0.999941 | 4.89041 |
f80a972b-6b9b-4365-9e77-f4c201899795 | sunrize0714/AtCoder | ABC/101-200/ABC143/c.cpp | #include<bits/stdc++.h>
using namespace std;
using ll = long long int;
typedef vector<ll> vll;
typedef vector<vll> vvll;
typedef vector<vvll> vvvll;
typedef vector<bool> vb;
typedef vector<string> vs;
typedef vector<pair<ll,ll>> vp;
#define rep(i,a,n) for(ll i=a;i<n;i++)
#define revrep(i,a,n) for(ll i=n-1;i>=a;i--)
#de... | ALGO | 0.999938 | 4.705125 |
0e252a33-bab3-42e8-9c47-6fa0bf4ac780 | codewithowais/flutter-custom-widgets-listTile-navigation | 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 |
c658a5cc-8614-46dc-9cfb-3a8246ecbe0c | quanqixian/cpp_learn | 33_c++中的字符串类/33_1.cpp | /**
*字符串排序和拼接
*/
#include <iostream>
#include <string>
using namespace std;
void string_sort(string a[],int len)
{
for(int i = 0;i < len ;i++)
{
for(int j = i;j < len ;j++)
{
if(a[i] >a[j])
{
swap(a[i],a[j]);
}
}
}
}
string string_add(string a[],int len)
{
string ret = "";
for(int i = 0;i<len;... | ALGO | 0.998233 | 3.899682 |
e69e7c23-7487-4c85-b48d-ff78b1d9bf1e | thangitus/LeetCode-Solution | C++/Binary Search/Find K Closest Elements.cpp | #include <bits/stdc++.h>
using namespace std;
/**
* https://leetcode.com/problems/find-k-closest-elements/
* */
class Solution {
public:
vector<int> findClosestElements(vector<int> &arr, int k, int x) {
int left = 0, right = arr.size() - k;
while (left < right) {
int mid = left + (r... | ALGO | 0.999985 | 5.512325 |
3006ce11-946a-4727-a49f-306e3b00cf0c | raincross7/code-similarity | codes/train_code/problem085/problem085_452.cpp | #include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for(int i = 0; i < n; ++i)
#define ALL(v) v.begin(), v.end()
typedef long long ll;
const int MOD = 1000000007;
const int INF = 1000000000;
ll fac[201];
ll dp[201][176];//dp[i][j]iまでの素数の積でj個の約数をもつ積の数・。・?
int main()
{
int n;
cin >> n;
if(n<10){co... | ALGO | 0.999963 | 4.542662 |
6153f000-161b-4f24-89a1-7c9d4fbf2820 | shenghuanjie/poj | problems/3254_约瑟夫问题No.2.cpp | /*
3254: 约瑟夫问题No.2
http://bailian.openjudge.cn/practice/3254/
描述
n 个小孩围坐成一圈,并按顺时针编号为1,2,…,n,从编号为 p 的小孩顺时针依次报数,由1报到m ,当报到 m 时,该小孩从圈中出去,然后下一个再从1报数,当报到 m 时再出去。如此反复,直至所有的小孩都从圈中出去。请按出去的先后顺序输出小孩的编号。
输入
每行是用空格分开的三个整数,第一个是n,第二个是p,第三个是m (0 < m,n < 300)。最后一行是:0 0 0
输出
按出圈的顺序输出编号,编号之间以逗号间隔。
样例输入
8 3 4
0 0 0
样例输出
6,2,7,4,3,5,1,8
... | ALGO | 0.999669 | 3.501629 |
c590b663-4f48-4137-861d-28aced6e8741 | Meet118/LeetCode | 1每日一题/LeetCode1342.cpp | class Solution {
public:
int numberOfSteps(int num) {
int ans = 0;
while (num) {
ans ++ ;
if (num % 2)
num -- ;
else
num /= 2;
}
return ans;
}
};
| ALGO | 0.99983 | 5.954751 |
9848029e-51ab-4ee1-962e-2f1e39b4ab53 | imrigzz/DSA_ALGO | hashing/problems/test.cpp | // you can use includes, for example:
#include "bits/stdc++.h"
using namespace std;
// you can write to stdout for debugging purposes, e.g.
// cout << "this is a debug message" << endl;
// https://algo.monster/problems/particle_velocity
int solution(vector<int> &A)
{
// write your code in C++14 (g++ 6.2.0)
in... | ALGO | 0.99985 | 4.556592 |
aceb8be2-7870-45a1-b2ba-4db9a0b5d3af | Qcsteeven/exam | NOP.cpp | #include <iostream>
template <typename T>
T Min(const T& x, const T& y) {
return x > y ? y : x;
}
template <typename T>
T Max(const T& x, const T& y) {
return x > y ? x : y;
}
struct PrevState {
size_t i;
size_t j;
};
int main() {
size_t n, m;
std::cin >> n;
auto* first_seq = new int[n];
for (size_... | ALGO | 0.999996 | 3.868466 |
54d4f646-cf1a-427d-9b08-1a07aabcc041 | xiaoshen320924/c-learning | test10-18/test10-18/Bc57.cpp | #define _CRT_SECURE_NO_WARNINGS 1
#include<stdio.h>
//涨YYYYXXʽ룬YYYYݣXX·ݣӦ
int main() {
int year = 0, month = 0;
scanf("%4d%2d", &year, &month);
if (month >= 3 && month <= 5) {
printf("spring");
}
else if (month >= 6 && month <= 8) {
printf("summer");
}
else if ((month >= 9 &&... | ALGO | 0.999751 | 3.857259 |
48ea7ee9-6a49-4025-b740-a127e94b0240 | mkowalik/ImageSaver_Mudita | lib/CImg-2.9.3_pre101320/examples/use_nlmeans.cpp | #define cimg_plugin "plugins/nlmeans.h"
#include "CImg.h"
using namespace cimg_library;
#ifndef cimg_imagepath
#define cimg_imagepath "img/"
#endif
// Main procedure
//----------------
int main(int argc,char **argv) {
// Read command line argument s
//-----------------------------
cimg_usage("Non-local means de... | ALGO | 0.998403 | 5.254416 |
566db7ee-efb3-440b-abd5-155a71a78cbe | NmBoyd/UdacityMPC | src/Eigen-3.3/doc/examples/Tutorial_ReductionsVisitorsBroadcasting_reductions_bool.cpp | #include <Eigen/Dense>
#include <iostream>
using namespace std;
using namespace Eigen;
int main()
{
ArrayXXf a(2,2);
a << 1,2,
3,4;
cout << "(a > 0).all() = " << (a > 0).all() << endl;
cout << "(a > 0).any() = " << (a > 0).any() << endl;
cout << "(a > 0).count() = " << (a > 0).count() << endl... | ALGO | 0.925182 | 3.835741 |
78bd4dee-5a6e-4bfd-9959-8d2705c50074 | JMajowka/xmrig-4-xdag | src/backend/opencl/runners/tools/OclCnR.cpp | #include "backend/opencl/runners/tools/OclCnR.h"
#include "backend/opencl/cl/cn/cryptonight_r_cl.h"
#include "backend/opencl/interfaces/IOclRunner.h"
#include "backend/opencl/OclCache.h"
#include "backend/opencl/OclLaunchData.h"
#include "backend/opencl/OclThread.h"
#include "backend/opencl/wrappers/OclError.h"
#includ... | TOOL | 0.955229 | 5.12486 |
9119f844-3f56-4b24-8a16-318024b5112f | kisigami/test | GameTemplate/toolsProj/nvmExporter/nvmExporter/math/Vector.cpp | /*!
* @brief xNgNXB
*/
#include "Vector.h"
#include "Matrix.h"
const Vector4 Vector4::White = { 1.0f, 1.0f, 1.0f, 1.0f };
const Vector4 Vector4::Black = { 0.0f, 0.0f, 0.0f, 1.0f };
const Vector4 Vector4::Yellow = { 1.0f, 1.0f, 0.0f, 1.0f };
const Vector4 Vector4::Gray = { 0.5f, 0.5f, 0.5f, 1.0f };
const Vector2 Ve... | TOOL | 0.914593 | 4.663091 |
789ce4b5-1384-491a-a5c1-1c9827b274d4 | 113bommy/deepmind_codecontests_refine | cpp_source_filter_file/cpp_train_4936_7.cpp | #include <bits/stdc++.h>
using namespace std;
int main() {
const int MAX = 1e6;
int n, k;
cin >> n >> k;
vector<int> cnt(MAX + 1);
while (n--) {
int a;
cin >> a;
cnt[a + 1]++;
}
for (int i = 0; i < MAX; i++) cnt[i + 1] += cnt[i];
auto check = [&](int g) {
for (int i = 0; i <= MAX; i += g... | ALGO | 0.999978 | 3.762354 |
0df0eec3-fe9b-4035-bdb4-7db4cbbd2e48 | leyo2001/codetree-TILs | 231227/총합 구하기/find-the-total.cpp | #include <iostream>
using namespace std;
int main() {
int a,b;
cin>>a>>b;
int sum=0;
for(int i=a; i<=b;i++)
{
if(i%6==0 && i%8!=0)
{
sum+=i;
}
}
cout<<sum;
// 여기에 코드를 작성해주세요.
return 0;
} | ALGO | 0.999428 | 3.689957 |
71b5d415-b9c9-4f13-b0af-45a284833efa | fedul0x/PrincipalComponentMethod | alglib/specialfunctions.cpp | #include "stdafx.h"
#include "specialfunctions.h"
// disable some irrelevant warnings
#if (AE_COMPILER==AE_MSVC)
#pragma warning(disable:4100)
#pragma warning(disable:4127)
#pragma warning(disable:4702)
#pragma warning(disable:4996)
#endif
using namespace std;
/////////////////////////////////////////////////////////... | ALGO | 0.998208 | 6.237375 |
4370c718-b837-45e7-9caf-3d14f4c2ed6a | Valerion052/codeforces | training/Codeforces_Round/Графы/1829E/main.cpp | #include <iostream>
#include <vector>
using namespace std;
void DFS(vector<vector<int>> &adj, int x, int y, int &ans) {
ans+=adj[x][y];
adj[x][y]=0;
if (x>0) {if (adj[x-1][y]>0) {DFS(adj, x-1, y, ans);}}
if (x<adj.size()-1) {if (adj[x+1][y]>0) {DFS(adj, x+1, y, ans);}}
if (y>0) {if (adj[x][y-1]>0... | ALGO | 0.999918 | 5.160225 |
0bf0db56-e854-43a6-abcb-0d3e87055963 | gokart23/Competitive-Programming | SPOJ/gss1.cpp | #include <bits/stdc++.h>
#define _ ios_base::sync_with_stdio(0);cin.tie(0);
using namespace std;
#define ulint unsigned long long int
#define lint long long int
#define VI vector<int>
#define VLL vector<lint>
#define VB vector<bool>
#define VVLL vector< VLL >
#define ci(i) cin>>i
#define co(i) cout<<i<<endl
#define FO... | ALGO | 0.999954 | 3.790556 |
14b04fd8-a1c0-4a3d-9331-5190a1ea4810 | AsthaNegi/placement | basic math/HCF_GCD.cpp | #include<bits/stdc++.h>
using namespace std;
// GCD (Greatest Common Divisor) or HCF (Highest Common Factor) of two numbers is the largest number that divides both of them.
//simpler approach
int GCD(int a,int b){
int GCD;
int mini=min(a,b);
for(int i=1;i<=mini;i++){
if(a%i==0 && b%i==0){
... | ALGO | 0.999911 | 5.029296 |
b45d8e48-35c4-4cc8-8e39-eaf29a09dea7 | LincolnArantes/All-of-C | par ou impar.cpp | #include <stdio.h>
int main()
{
int numero_001;
printf("Digite um numero: ");
scanf("%d", &numero_001);
if(numero_001 % 2 == 0)
{
printf("O numero %d = par\n", numero_001);
}
else
{
printf("O numero %d = impar\n", numero_001);
}
return 0... | ALGO | 0.994337 | 3.155828 |
e30c37e1-3a32-440e-8e27-a1898e4cfef8 | NilFoundation/zkllvm-circifier | llvm/lib/Support/Process.cpp | #include "llvm/Support/Process.h"
#include "llvm/ADT/STLExtras.h"
#include "llvm/ADT/StringExtras.h"
#include "llvm/Config/config.h"
#include "llvm/Config/llvm-config.h"
#include "llvm/Support/CrashRecoveryContext.h"
#include "llvm/Support/FileSystem.h"
#include "llvm/Support/Path.h"
#include "llvm/Support/Program.h"
... | TOOL | 0.972812 | 7.731808 |
e19129a4-d4af-4000-b794-20fa988eb461 | okaditya84/LeetCode-Streak | 100084LCweeklySmalllestLexicographicallyBeautiful.cpp | #include <bits/stdc++.h>
using namespace std;
class Solution {
public:
string shortestBeautifulSubstring(string s, int k) {
int n =s.size();
int left=0,right=0;
int count=0;
int min_length=INT_MAX;
string res="";
while(right<n){
count=updateCount(s[right],count);
... | ALGO | 0.999996 | 5.955685 |
8f1f16c3-217b-42db-9735-ffc5c9f77f50 | ani3321r/some-dsa-in-cpp | array problems/pro/reverse_pairs.cpp | #include<bits/stdc++.h>
using namespace std;
void merge(vector<int> &arr, int low, int mid, int high){
vector<int> temp;
int left = low;
int right = mid + 1;
while(left<=mid && right<=high){
if(arr[left]<=arr[right]){
temp.push_back(arr[left]);
left++;
}
... | ALGO | 0.999925 | 4.734972 |
95a169fd-87f2-45d4-b68f-8def839f4032 | FaqodAqomaddin/FaseOne_062 | 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 |
aa370fe4-36d8-4274-8c86-d93f1f08f796 | zjsxzy/binarysearch | Word Machine/main.cpp | #include <bits/stdc++.h>
using namespace std;
#define PB push_back
#define SZ(v) ((int)(v).size())
#define abs(x) ((x) > 0 ? (x) : -(x))
typedef long long LL;
int solve(vector<string>& ops) {
vector<int> stk;
for (auto& op: ops) {
if (op == "POP") {
if (stk.empty()) return -1;
s... | ALGO | 0.99865 | 4.967021 |
47c2969b-f3c0-47b7-a045-5cc26a3d5715 | zzunne/BOJ | 2741.cpp | #include <cstdio>
int main() {
int n;
scanf_s("%d", &n);
for (int i = 0; i < n; i++)
printf("%d\n", i + 1);
return 0;
} | ALGO | 0.959299 | 3.069046 |
2ed1a330-ec3f-4f4d-8778-5ee1abc83127 | iremtekinn/provider3 | 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 |
18c106c3-cadd-41a9-bb38-009558b56646 | ryo-manba/AtCoder | ABC/ABC139/d/main.cpp | #include <bits/stdc++.h>
#define rep(i,n) for (int i = 0; i < (n); ++i)
using namespace std;
using ll = long long;
using P = pair<int, int>;
const int INF = (int)1e9;
const ll INFL = (ll)1e15;
const int MOD = 1e9 + 7;
int dx[]={0, 0, -1, 1};
int dy[]={1, -1, 0, 0};
template<class T> inline bool chmax(T& a, T b) { if (a... | ALGO | 0.999921 | 4.210475 |
c6f5f049-951f-4682-b53d-0a5fb5b34398 | jesuferanmi-0620/Xylophone | 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 |
4ac0d924-b0cc-439e-bf1f-33848e91b9b6 | Sibirajla/flutter_app_snake | 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.998809 | 6.763549 |
9a23d467-a207-4698-9438-dc14dcb8b035 | Mohamed-Hashem/LeetCode | 0063-unique-paths-ii/0063-unique-paths-ii.cpp | class Solution {
int solve(int i, int j, vector<vector<int>> &dp, vector<vector<int>>& grid)
{
if(grid[i][j]==1) return 0;
if(i==0 and j==0) return 1;
if(i==0) return dp[i][j-1];
if(j==0) return dp[i-1][j];
return dp[i-1][j] + dp[i][j-1];
}
... | ALGO | 0.999853 | 6.094727 |
3bf81436-346c-4b11-a9f5-638d30616120 | ddangu525/AlgorithmStudy | study_algo_gangnam/CNK/codePlus_middle_1/day08/01_1654_main.cpp | /*
* 동전 자르기
* https://www.acmicpc.net/problem/1654
* */
#include<iostream>
#include<vector>
#include<algorithm>
using namespace std;
int maxLen = 0;
void solution(long long left, long long right, int &K, vector<int> &lan) {
/* 제약 조건 */
if(left > right) {
return;
}
/* 중간 위치의 길이를 구해 몇개로 나눌수 있는지 구한다. ... | ALGO | 0.999898 | 4.794014 |
2ca6fa03-2abc-40a8-807a-f7efc78dc131 | Haricodesmagic/WEEK2cslab | 2q1cp.cpp | #include <stdio.h>
#include <math.h>
int main()
{
float n1, n2, n3;
printf("Enter three different numbers \n");
scanf("%f%f%f", &n1, &n2, &n3);
if (n1 >= n2 && n1 >= n3)
{
printf("%f is the larger number", n1);}
else if (n2 >= n1 && n2 >= n3)
{
printf("%f is the larger number", n2);}
else if (n3 >= n... | ALGO | 0.99963 | 3.240933 |
82fde795-adf7-42a2-bce1-e84780ca566c | XianheJiao/Sharp-feature-detection-in-point-cloud- | MSLNet/code/first/kdtree/kdtree_ball_query.cpp | // this is actually just a single query
#include "KDTree.h"
#include "mex.h"
void retrieve_tree( const mxArray* matptr, KDTree* & tree){
// retrieve pointer from the MX form
double* pointer0 = mxGetPr(matptr);
// check that I actually received something
if( pointer0 == NULL )
mexErrMsgTxt("var... | ALGO | 0.994836 | 5.981519 |
815ff207-f4d1-4962-ba31-5af5f448cd49 | M45UDrana/DS-Algo-Problem-Solving | codeforces/467B.cpp | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<int, int> pii;
typedef pair<string, int> psi;
#define ff first
#define ss second
#define pb(a) push_back(a)
#define mp(a,b) make_pair(a,b)
#define input freopen("input.txt","r",stdin)
#define output freopen("output.txt","w",stdout)
#def... | ALGO | 0.999941 | 4.219992 |
e57b4da0-3ee2-4523-a383-8812ac719eb9 | raincross7/code-similarity | codes/train_code/problem238/problem238_488.cpp | #include <bits/stdc++.h>
using namespace std;
typedef long long lint;
typedef vector<lint> vlint;
typedef vector<vlint> vvlint;
typedef vector<bool> vbool;
typedef vector<int> vint;
#define inf 1e+9
#define endl "\n"
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define rep1(i, n) for (int i = 1; i < (int)(n); ... | ALGO | 0.999954 | 4.091008 |
968ce18d-144b-4753-937e-6b6ed49b2181 | ashrafulislampro/Basic_Data_Structure_with_phitron | Module_23/Custom_Compare_Class.cpp | #include <bits/stdc++.h>
using namespace std;
class Student
{
public:
string name;
int roll;
int marks;
Student(string name, int roll, int marks)
{
this->name = name;
this->roll = roll;
this->marks = marks;
}
};
class cmp
{
public:
bool operator()(Student l, Student r... | ALGO | 0.999903 | 4.646934 |
04c69e4b-ae8c-4f1c-ab7c-ee870075d3ab | Rylynnn/Arithmetic | Competition/Code Forces/#432/a.cpp | /*************************************************************************
> File Name: a.cpp
> Author: Rylynnn
> Mail: <EMAIL>
> Created Time: 一 9/ 4 22:15:47 2017
************************************************************************/
#include <iostream>
#include <fstream>
#include <cmath>
#inclu... | ALGO | 0.999982 | 3.419264 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.