uuid string | repo_name string | relative_path string | content string | category string | algo_rel_score float64 | quality_score float64 |
|---|---|---|---|---|---|---|
c88a7ae1-8413-4ac9-b83f-73ab4ac3fe10 | ymkzpx/Algorithm | leetcode/677.cpp | #include <bits/stdc++.h>
using namespace std;
class MapSum {
public:
int trie[2507][30];
int sum[2507];
int root, idx;
MapSum() {
root = idx = 1;
}
void insert(string key, int val) {
int cur = root;
for (int i = 0; i < key.size(); i++) {
int c = key[i] - 'a... | ALGO | 0.99982 | 5.954851 |
30f771b7-b54f-47a3-8f9f-4b2278991e98 | dhairyapandya05/Data-Structures-and-Algorithms | Graphs/gfg_cycledetectionusing_undirected_graph_bfs.cpp | //{ Driver Code Starts
#include <bits/stdc++.h>
using namespace std;
// } Driver Code Ends
class Solution {
public:
// Function to detect cycle in an undirected graph.
bool iscycleBFS(int u,vector<int> adj[],vector<bool>& visited){
queue<pair<int, int>> q; // pair<child,parent>
q.push({u, -1}... | ALGO | 0.999987 | 6.374667 |
e8fccb12-9257-4fc5-a99e-e9a8ff7a67f6 | silence-tang/xducs | ds/第六次机考练习/快速排序.cpp | #include<stdio.h>
#include<stdlib.h>
int main()
{
int i,n,low,high,temp,pivotkey,a[100];
scanf("%d",&n);
for(i=0;i<n;i++)
scanf("%d",&a[i]);
pivotkey = a[0]; //ѡ¼ؼΪһԪ
low = 0; high = n-1; //ʼlow,high־ֱָһһԪ
while(low!=high) //ѭlow==high
{
while(low != high && a[high] >= pivotkey)
high--; ... | ALGO | 0.999994 | 3.320477 |
7a5d0c68-86ef-45c9-9623-fd51666fd13b | sarwar-hossain/leetcode-problems-solved | 496. Next Greater Element I.cpp | class Solution {
public:
vector<int> nextGreaterElement(vector<int>& nums1, vector<int>& nums2) {
unordered_map<int, int>um;
stack<int>s;
for(int num : nums2){
while(!s.empty() && num>s.top()){
um[s.top()]=num;
s.pop();
}
s.push(num)... | ALGO | 0.999981 | 5.796739 |
b0d3f234-3c33-4714-94b3-707a6e76d131 | CAIsr/niftyreg | reg-test/reg_test_fullNonlinear.cpp | #include "_reg_ReadWriteImage.h"
#include "_reg_ReadWriteMatrix.h"
#include "_reg_f3d.h"
#include "_reg_tools.h"
#define EPS 0.000001
int main(int argc, char **argv)
{
if(argc!=5)
{
fprintf(stderr, "Usage: %s <refImage> <floImage> <affineMatrix> <expectedControlPointGrid>\n", argv[0]);
return EXIT_... | TEST | 0.857404 | 5.686028 |
1361f1c3-4ec9-4a4f-8a56-61f07a725cb2 | nikitadhona/450-DSA | Array/1.cpp | #include<iostream>
#include<climits>
using namespace std;
int main(){
int n;
cin>>n;
int array[n];
for(int i=0;i<n;i++){
cin>>array[i];
}
for(int i=0;i<n;i++){
cout<<array[i]<<" ";
}
int min=INT_MAX;
int max=INT_MIN;
for(int i=0;i<n;i++){
if(array[i]>max){... | ALGO | 0.999895 | 3.792174 |
89b0c48b-a5a8-4d8e-8823-a1cffb409650 | ishandutta2007/codeforces | maripium/normal/1192/C.cpp | #pragma optimize("-O3")
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
const int mod = 998244353;
const ll mod2 = (ll) mod * mod;
int toId(char c) {
if ('a' <= c && c <= 'z') {
return c - 'a';
} else if ('A' <= c && c <= 'Z') {
return 26 + c - 'A';
} else {
return 52 + c - '0';
}
}
... | ALGO | 0.999814 | 5.131178 |
2c23d79a-6c15-4cc5-9405-71dacce33adb | sukenori/Competitive_Programming-Solved_Code | Competitive_Programming_Typical 90 Questions/024 - Select +/- One.cpp | #include<bits/stdc++.h>
using namespace std;
int64_t N,K;
int64_t A[1000],B[1000];
int main(){
cin>>N>>K;
int64_t a=0;
for(int i=0;i<N;i++)cin>>A[i];
for(int i=0;i<N;i++){cin>>B[i]; a+=abs(B[i]-A[i]);}
cout<<((a<=K&&(K-a)%2==0)?"Yes":"No")<<endl;
} | ALGO | 0.99999 | 3.563938 |
d0a40078-1a1a-4b3d-95fd-b0dd57e155e4 | wangjianpeng200/Study | 数据结构/2.Stack/1.SeqStack/1.cpp | #include"1.h"
void Seqstack::Init(Seqstack &seq)
{
base=new Elemtype[STACK_INIT_SIZE];//创建容积个数的该数据类型 new Elemtype[n]
assert(base!=NULL);
top=0;
capcaity=STACK_INIT_SIZE;
}
bool Seqstack::IsFull(Seqstack &seq)
{
return top>=STACK_INIT_SIZE;
}
bool Seqstack::IsEmpty(Seqstack &seq)
{
retu... | ALGO | 0.877474 | 3.671917 |
d57b41ee-ce86-4154-bb33-73e572d095cb | Rabbi-hasan0/Algorithm-course-241-242 | Lab 01: Binary search 02.cpp | /** Don't Copy Code from anywhere
** Author: Rabbi Hasan
** Bangladesh University of Business and Technology,
** Dept. of CSE.
***/
#include<bits/stdc++.h>
#define nn "\n"
using namespace std;
int binarysearch(int a[],int l,int r,int num)
{
if (r>=l)
{
int mid=(l+r)/2;
if(a[mid]==... | ALGO | 0.999961 | 4.366632 |
5fd6a202-a917-45a1-9324-9b0cb7bd6396 | Tkundlas/leetcode | 0054-spiral-matrix/0054-spiral-matrix.cpp | class Solution {
public:
vector<int> spiralOrder(vector<vector<int>>& matrix) {
vector<int> sol;
int m = matrix.size() , n = matrix[0].size();
int l = 0, r = n-1, t = 0, b = m-1;
while(l <= r && t <= b)
{
for(int i=l; i<=r; i++)
sol.... | ALGO | 0.999997 | 6.309927 |
dc123e18-2448-456a-9d53-8cfcd9b220c9 | HKPolyU-UAV/FLVIS | 3rdPartLib/g2o/g2o/examples/tutorial_slam2d/tutorial_slam2d.cpp | #include <iostream>
#include <cmath>
#include "simulator.h"
#include "vertex_se2.h"
#include "vertex_point_xy.h"
#include "edge_se2.h"
#include "edge_se2_pointxy.h"
#include "types_tutorial_slam2d.h"
#include "g2o/core/sparse_optimizer.h"
#include "g2o/core/block_solver.h"
#include "g2o/core/factory.h"
#include "g2o... | ALGO | 0.998839 | 6.191607 |
bb2fdc94-6450-487a-8924-defbe50e4536 | taatzz/LeetCode | 69.x-的平方根.cpp | // @before-stub-for-debug-begin
// @before-stub-for-debug-end
/*
* @lc app=leetcode.cn id=69 lang=cpp
*
* [69] x 的平方根
*/
// @lc code=start
class Solution {
public:
int mySqrt(int x) {
int l = 0, r = x;
while(l < r)
{
int mid = (long long)(l + r + 1 * 1ll) >> 1;
... | ALGO | 0.999794 | 5.650497 |
944f0333-1d9e-4a69-973a-d6bd28ad26ed | 15999shivam/MastringDataStructuresAndAlgorithms | Array ADT/Demo.cpp | #include <iostream>
#include <stdlib.h>
using namespace std;
struct Array
{
int A[10];
int size;
int length;
};
void display(struct Array arr)
{
cout << endl;
int i;
cout << "Elements are:\n";
for (i = 0; i < arr.length; i++)
{
cout << arr.A[i] << " ";
}
cout << endl;
}... | ALGO | 0.999889 | 4.145606 |
0a34f06b-984b-4094-b6c1-75cd84abd87e | andrewaarestad/ode-system-fitting-with-boost-and-nlopt | boost_1_77_0/libs/mpi/example/random_gather.cpp | // An example using Boost.MPI's gather(): [main]
#include <boost/mpi.hpp>
#include <iostream>
#include <cstdlib>
namespace mpi = boost::mpi;
int main(int argc, char* argv[])
{
mpi::environment env(argc, argv);
mpi::communicator world;
std::srand(time(0) + world.rank());
int my_number = std::rand();
if (wor... | ALGO | 0.988631 | 4.578093 |
69faa42d-fe7f-4e26-a7d4-fa599bb58199 | whyando/competitive_programming | 1200D/source.cpp | #include <bits/stdc++.h>
using namespace std;
int main(){
ios::sync_with_stdio(false);
cin.tie(0);
int N, K;
cin >> N >> K;
vector<string> A(N);
for(int i=0;i<N;i++)
cin >> A[i];
vector<int> row_black(N, 0); // counts
vector<int> col_black(N, 0);
int num_empty = 0;
fo... | ALGO | 0.999257 | 4.205662 |
52ed7a3c-b93e-4954-b878-47c19fb01b74 | flyflypeng/Algorithms-Book-Code | Union-Find/quick_union.cpp | /*
* @Author: woshijpf
* @Date: 2017-01-08 15:37:10
* @Last Modified by: woshijpf
* @Last Modified time: 2017-01-08 15:46:47
*/
#include "quick_union.h"
#include <iostream>
Quick_Union::Quick_Union(int N): UF(N)
{
}
//find the root node id of the current node p
int Quick_Union::UF_find(int p)
{
while (p != id[... | ALGO | 0.998705 | 4.77766 |
836c07be-73ed-4763-ba28-c8a8a341ac27 | ashraf452b/Competitive-programming | Learning Phase/Data structure/week 1/Binary_Search.cpp | #include<bits/stdc++.h>
using namespace std;
int main()
{
int n;
cin>>n;
int a[n];
for(int i=0;i<n;i++)
{
cin>>a[i];
}
int find;
cin>>find;
sort(a,a+n);
return 0;
} | ALGO | 0.999894 | 3.24352 |
60e6804f-4f48-42d0-9ba6-59a184f013c0 | pstap21/OOPSEM125 | main-2-2.cpp | #include <iostream>
int max_element( int array[], int n);
int main() {
int array1[6] = {1, 3, 5, 7, 9, 10};
std::cout << "The max element in array1 is: " << max_element (array1, 6) << std::endl;
return 0;
} | ALGO | 0.996192 | 4.903952 |
97055e88-061d-4621-980b-e2422138c218 | N-911/cpp_yellow | w4/demographic_class.cpp | #include <iostream>
#include <algorithm>
#include <vector>
using namespace std;
enum class Gender {
FEMALE,
MALE
};
struct Person {
int age; // возраст
Gender gender; // пол
bool is_employed; // имеет ли работу
};
// Это пример функции, его не нужно отправлять вместе с функцией PrintStats
tem... | ALGO | 0.998872 | 5.292261 |
516c4b84-23ea-457f-8581-d0c2eb48343c | TeamTwisted/ndk | sources/cxx-stl/llvm-libc++/libcxx/test/containers/associative/multiset/lower_bound.pass.cpp | // <set>
// class multiset
// iterator lower_bound(const key_type& k);
// const_iterator lower_bound(const key_type& k) const;
#include <set>
#include <cassert>
#include "min_allocator.h"
#include "private_constructor.hpp"
int main()
{
{
typedef int V;
typedef std::multiset<int> M;
... | TEST | 0.970466 | 4.678225 |
6298f7ae-4b83-4653-adb6-356723a6be5a | moinulislamsajid/CodeForces_Group_Contest | GroubContest/Arrays/Q.cpp | #include<bits/stdc++.h>
#define ll long long int
using namespace std;
int main()
{
ll t;
cin>>t;
while(t--)
{
ll n;
cin>>n;
vector<ll> v(n);
for(int i=0; i<n; i++)
{
cin>>v[i];
}
if(n==1)
{
cout<<1<<endl;
... | ALGO | 0.999406 | 3.936633 |
56aaf361-aac0-4496-a772-fce44ef1c792 | YongshuaiZ/covins_ws | covins_backend/src/dense_matcher/DenseMatcher.cpp | /**
* @file DenseMatcher.cpp
* @brief Source file for the DenseMatcher class.
* @author Simon Lynen
* @author Stefan Leutenegger
* @author Marco Karrer (Modified 9.6.2017)
*/
#include "covins/dense_matcher/DenseMatcher.hpp"
/// \brief estd2 Main namespace of this package.
namespace estd2 {
// Initialize the de... | ALGO | 0.984412 | 6.680679 |
49401d53-f705-414d-9605-1acc57513de5 | haydendaly/CPE-593-Team | midterm/4.cpp | // I pledge my honor I have abided the Stevens Honor System. - Hayden C. Daly
#include <iostream>
using namespace std;
uint64_t powermod(int base, int exp, int mod) {
if (mod == 1) return 0;
unsigned long long prod = 1;
base = base % mod;
while (exp > 0) {
if (exp % 2 != 1) prod = (prod * base... | ALGO | 0.999183 | 4.659857 |
a40d6500-8d53-4828-8bc1-f71cd89bf8d0 | adamzhen/Team-Vestigo | GUI/QtDev/Eigen/doc/examples/tut_arithmetic_dot_cross.cpp | #include <iostream>
#include <Eigen/Dense>
using namespace Eigen;
using namespace std;
int main()
{
Vector3d v(1,2,3);
Vector3d w(0,1,2);
cout << "Dot product: " << v.dot(w) << endl;
double dp = v.adjoint()*w; // automatic conversion of the inner product to a scalar
cout << "Dot product via a matrix product... | ALGO | 0.998892 | 4.042919 |
2329b598-b9fd-4243-8dae-a46fda17a66c | Pavan-B-N/DSA-with-C_plus_plus | Neetcode 150/Stack/EvaluateReversePolishNotation.cpp | // https://leetcode.com/problems/evaluate-reverse-polish-notation/
#include <vector>
#include <string>
#include <stack>
using namespace std;
class Solution
{
public:
int evalRPN(vector<string> &tokens)
{
stack<int> s;
for (auto op : tokens)
{
if (op != "+" && op != "-" && op... | ALGO | 0.999862 | 6.751075 |
8fb7aef6-c88a-4103-8a64-f1178986b1f6 | Kawser-nerd/CLCDSA | Source Codes/CodeJamData/13/03/12.cpp | #include <stdio.h>
#include <string.h>
struct BigInt {
int len;
int dig[210];
BigInt() {
len = 1;
memset(dig, 0, sizeof(dig));
}
BigInt(int x) {
len = 1;
memset(dig, 0, sizeof(dig));
dig[0] = x;
}
BigInt& operator++() {
dig[0] ++;
fo... | ALGO | 0.999107 | 4.117996 |
45806217-2401-4fd1-b69e-719bfd42d9f3 | bheem2510/Cracking_The_Coding_Interview | Ch 3. Stacks-and-Queues/C++14/3.4-QueueViaStacks.cpp | // Queue via Stacks: Implement a MyQueue class which implements a queue using two stacks.
#include <iostream>
#include "stack.hpp"
template <typename T>
class MyQueue
{
public:
template <typename U>
void add(U &&value)
{
newValues.push(std::forward<U>(value));
}
T peek()
{
if ... | ALGO | 0.877982 | 5.462224 |
d5e0c306-87b7-4ad2-995b-8d43ef4b84f3 | mehreen019/IUT_Academics | 2-2/lab/CSE 4404/lab 1/210041219_L1T1.cpp | #include<bits/stdc++.h>
#include <fstream>
#include <windows.h>
using namespace std;
void bubbleSort( vector<int>& v){
for(int i=0;i<v.size();i++){
for(int j=0; j<v.size()-i;j++){
if(v[j]>v[j+1]) swap(v[j], v[j+1]);
}
}
//return v;
}
void selectionSort(vector<int>& v){
for(... | ALGO | 0.999939 | 4.016637 |
11e68095-4be0-4703-b872-f0ee79d03a94 | qianming-bioinfo/scNucMap | src/cal_SD_and_frag_count_standard.cpp | #include "myoperation.h"
#include <filesystem>
#include <getopt.h>
#include <future>
#include <iostream>
#include <fstream>
#include <chrono>
#include <vector>
#include <string>
#include <map>
#include <iomanip>
#include <algorithm>
#include <atomic>
#include <mutex>
#include <cstdlib>
#include <cerrno>
#include <sys/s... | DATA | 0.996887 | 4.475151 |
85491447-96bb-4f00-9e22-d15dbbb00ece | wajehafatima/todoApp | 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 |
e10acdd5-74ac-4c54-89e1-3be16c724aa5 | raincross7/code-similarity | codes/train_code/problem083/problem083_443.cpp | #include <bits/stdc++.h>
using namespace std;
/* typedef */
typedef long long ll;
typedef pair<int, int> pii;
/* constant */
const int INF = 1e+9 + 5;
const int MAX = 205;
/* global variables */
vector<vector<ll> > d(MAX, vector<ll>(MAX, INF));
/* function */
void floyd() {
for (int k = 0; k < MAX; k++) {
f... | ALGO | 0.999971 | 4.19078 |
5c8a2f6f-aea8-4eb8-8524-e0dd7b035409 | prnv28/LeetCode-Practice | 2042-maximum-product-difference-between-two-pairs/maximum-product-difference-between-two-pairs.cpp | class Solution {
public:
Solution(){
ios_base::sync_with_stdio(false);
cin.tie(NULL);
}
int maxProductDifference(vector<int>& nums) {
int n = nums.size();
int smallest = INT_MAX,secondSmallest = INT_MAX;
int biggest = 0,secondBiggest = 0;
for(int i=... | ALGO | 0.999968 | 5.226143 |
d8cf5c0e-2876-457a-a3c4-60bf94ee7b62 | shivajaysaxena/LeetCode | 2415-count-the-number-of-ideal-arrays/count-the-number-of-ideal-arrays.cpp | class Solution {
public:
long long dp[15][10001], pr[15][10001], tot[15], mod = 1e9 + 7, mx, n;
void get(int la, int cn) {
tot[cn]++;
for (int p = 2 * la; p <= mx; p += la)
get(p, cn + 1);
}
int idealArrays(int nn, int mmx) {
n = nn;
mx = mmx;
for (int... | ALGO | 0.999978 | 4.862045 |
69e8cd2c-5b4c-45db-960b-a68d586546bb | SafeTorpedo/DSA-roadmap | 1) Basics/1.1) Basic Math/3_palindrome_number.cpp | #include <bits/stdc++.h>
using namespace std;
class Solution
{
public:
bool isPalindrome(int x)
{
if (x < 0)
return false;
int divisor = pow(10, to_string(x).size() - 1);
int left, right;
while (x)
{
left = x / divisor;
right = x % 1... | ALGO | 0.999826 | 5.709082 |
efe5bbe7-7263-42a1-9894-7c49eb039ec4 | sidjha57/Coding | Non_Comprime_Neighbours.cpp | //Siddharth Jha
#include<bits/stdc++.h>
//#include<ext/pb_ds/assoc_container.hpp>
//#include<ext/pb_ds/tree_policy.hpp>
//#include <ext/pb_ds/trie_policy.hpp>
//using namespace __gnu_pbds;
using namespace std;
//typedef tree<ll, null_type, less<ll>, rb_tree_tag, tree_order_statistics_node_update> pbds;
//typedef trie<... | ALGO | 0.999971 | 3.380018 |
a9f95183-eb93-42b1-918f-5ceacc35da44 | Sahil624/Cpp-Programs | transpose of matrix.cpp | #include<iostream>
using namespace std;
class matrix
{
int m[3][3];
public:
void read()
{
cout<<"Enter elements of matrix";
int i,j;
for(i=0; i<3; i++)
{
for(j=0; j<3; j++)
{
//cout<<i<<j<<" \n";
cin>>m[i][j];
... | ALGO | 0.998968 | 3.397756 |
c68de66a-ced9-4f7e-a72c-5ba548d37379 | sammon848/http-tracydeanmccallum.com- | Dem13-6a.cpp | //dem13-6.cpp
//This program illustrates the use a virtual function
//in a class hierarchy
#include <iostream>
using namespace std;
class Test_Class
{
protected:
int n;
public:
Test_Class(int i = 0); //One-argument constructor
Test_Class(Test_Class &); //Copy constructor
~Test_Class();
virtual int ... | TOOL | 0.852558 | 6.490987 |
984dfc77-b947-4b3a-9e10-efc04fdeacb6 | cfd-dev/2D_Euler_Solver | src/Time_Integral.cpp | //////////////////////////////////////////////////////////
// //
// 2D Euler Solver on Structured Grid //
// by Wang Nianhua //
// Email: <EMAIL> //
// 2021.6.7 //
//////////////////////////////////////////////////////////
#include "2D_Euler_Solver.h"
#include "Spatial_Deriv... | ALGO | 0.999943 | 3.849391 |
710d5c05-cd72-40f9-9478-51b5f30e1b10 | wucangji/Algorithm | Construct Binary Tree from Inorder and Postorder Traversal.cpp | /**
* Definition for binary tree
* struct TreeNode {
* int val;
* TreeNode *left;
* TreeNode *right;
* TreeNode(int x) : val(x), left(NULL), right(NULL) {}
* };
*/
class Solution {
public:
TreeNode *buildTree(vector<int> &inorder, vector<int> &postorder) {
return helper(inorder,0,ino... | ALGO | 0.999984 | 5.75684 |
bf809f2a-607e-4924-a10e-e0e5b27e23a6 | josefgraus/self_similarity | src/shape_signatures/hks.cpp | #include "hks.h"
#include <igl/eigs.h>
#include <iostream>
template <typename DerivedVal, typename DerivedVec, typename DerivedHKS>
inline bool hks(
const Eigen::MatrixBase<DerivedVal> & eVecs,
const Eigen::MatrixBase<DerivedVec> & eVals,
double tmin,
double tmax,
unsigned int steps,
Eigen::MatrixBase<Derived... | ALGO | 0.993857 | 4.044266 |
6d4a9d23-973f-4907-9beb-dc7ceed0e753 | Abhay-Kumar-Dubey/Quiz-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.998733 | 6.76775 |
4ac3defc-de19-492a-a3a2-f8af95420b10 | hoon0303/Cording_test | Baekjoon_Algorithm/[14888] 연산자 끼워넣기.cpp | #include<iostream>
#include<vector>
#include<algorithm>
using namespace std;
int n;
vector<int> result;
void dfs(vector<int> num, int x, int y, int z, int k, int index, int rst)
{
if (n == index)
{
result.push_back(rst);
return;
}
if (x > 0)
{
dfs(num, x - 1, y, z, k, index + 1, rst + num[index]);
}
if (y... | ALGO | 0.999996 | 3.323538 |
3bfb9815-cacc-4521-9742-1ea141193ed6 | Strongorange/BOJ | 0x0F Sort/15688.cpp | #include <bits/stdc++.h>
using namespace std;
int N;
int arr[2000001];
int modify = 1000000;
// dogs
int freq[2000001];
int main()
{
ios::sync_with_stdio(0);
cin.tie(0);
cin >> N;
for (int i = 0; i < N; i++)
{
int cur = 0;
cin >> cur;
arr[cur + modify]++;
}
for (... | ALGO | 0.999948 | 3.972454 |
57728acc-54f3-4ac0-9db8-d82b1007d3e3 | BeaverBelly/Programas-en-C-plus-plus | 3- Condicionales/Condicional8.cpp | /*8.Escribe un programa que lea de la entrada estndar tres nmeros. Despusdebe leer
un cuarto numeroe indicar si el nmero coincide con alguno de los introducidos
con anterioridad*/
#include<iostream>
using namespace std;
int main(){
int n1,n2,n3,n4;
cout<<"Digite 3 numeros: ";
cin>>n1>>n2>>n3;
cout<<"Digite un 4 ... | ALGO | 0.975272 | 3.310512 |
b80a74b3-7a4e-4127-b4f7-a788e1b705b8 | ishefalichopra/CPP | 257_PaintingFenceAlgo.cpp | #include<bits/stdc++.h>
using namespace std;
#define mod 1000000007
int add(int a, int b){
return (a%mod + b%mod)%mod;
}
int mul(int a, int b){
return (a%mod * 1LL * b%mod)%mod;
}
int solveMem(int n, int k, vector<int>&dp){
if(n==1)
return k;
if(n==2)
return add(k, mul(k, k-1));
if(dp[n... | ALGO | 0.999955 | 4.103157 |
1c9e747f-087e-48c9-951b-7b5161d8bd5c | sanyamdtu/cpp_practice_codes | sorting and divide conquer/codes/insertion sort.cpp | #include<iostream>
using namespace std;
void swap(int &a,int &b){
int temp=a;
a=b;
b=temp;
}
int main() {
int n,key;
cin>>n;
int arr[n];
for(int i=0;i<n;i++)
cin>>arr[i];
key=arr[0];
for(int i=1;i<n;i++){
if(arr[i]<key)
{
int j=i;
while(j>=0 && arr[j]<arr[j-1]){
swap... | ALGO | 0.999998 | 3.60063 |
28835e58-7026-4631-bd93-863d98877683 | vaibhavnsut7/cppnew | Strings/String_Tokeniser.cpp | #include <iostream>
#include <string>
#include <vector>
using namespace std;
vector <string> tokeniser(string str){
stringstream ss(str);
string token;
vector <string> tokens;
while(getline(ss,token,' ')){
tokens.push_back(token);
}
for (auto token: tokens){
cout<<token<<",";
... | TOOL | 0.992756 | 4.064703 |
99bf0e3c-ced3-4ff4-b746-508f4aad1c3c | ishandutta2007/codeforces | melnik/normal/835/A.cpp | #include <iostream>
#include <fstream>
#include <list>
#include <stack>
#include <deque>
#include <utility>
#include <queue>
#include <set>
#include <map>
#include <bitset>
#include <vector>
#include <cmath>
#include <string>
#include <algorithm>
#include <iomanip>
#include <ctime>
#include <iterator>
#include <cstdio>... | ALGO | 0.999913 | 3.352258 |
56daacb7-364a-4aa0-9e0b-4dd4aa863816 | binhdk/mobile-ffmpeg | src/tesseract/dict/trie.cpp | /*----------------------------------------------------------------------
I n c l u d e s
----------------------------------------------------------------------*/
#ifdef _MSC_VER
#pragma warning(disable:4244) // Conversion warnings
#pragma warning(disable:4800) // int/bool warnings
#endif
#include "trie.... | ALGO | 0.990829 | 7.1823 |
7b1feac2-bab3-4fd6-a437-990385c94729 | raincross7/code-similarity | codes/train_code/problem377/problem377_84.cpp | #include <bits/stdc++.h>
using namespace std;
#define ll long long
#define mod 1000000007
int main()
{
ios::sync_with_stdio(0);
cin.tie(0);
cout.tie(0);
int n, k;
cin >> n >> k;
int a[n];
for (int i = 0; i < n; i++) {
cin >> a[i];
}
int dp[n + 1][k + 1];
memset(dp, 0, sizeof(dp));
int curr = 0;
for (int... | ALGO | 0.999989 | 4.264377 |
a6362b54-6d3a-46b3-a3ad-17fc822b41ad | rabelhmd/LeetCode | 1569-number-of-ways-to-reorder-array-to-get-same-bst/1569-number-of-ways-to-reorder-array-to-get-same-bst.cpp | class Solution {
public:
int mod = 1000000007;
long dp[1001][1001] = { 0 };
bool flag = false;
long combination(int n, int r) {
if (flag) return dp[n][r];
dp[0][0] = 1;
for (int i = 1; i < 1001; i++) {
dp[i][0] = 1;
for (int j = 1; j < i + 1; j++) {
... | ALGO | 0.99999 | 5.433743 |
74813d02-5c80-4c01-831f-b466a3ba93d0 | axxonite/algorithms | EPI/Solutions/6_Arrays/6.19_pascal_triangle_solution.cpp | #include "stdafx.h"
namespace Solutions
{
vector<vector<int>> GeneratePascalTriangle(int rows)
{
vector<vector<int>> result;
for (int i = 0; i < rows; ++i)
{
vector<int> row;
for (int j = 0; j <= i; ++j)
// Sets this entry to the sum of the two above adjacent entries if exist.
row.emplace_back(... | ALGO | 0.995997 | 6.869517 |
f1453879-f6dc-4a12-aa04-e9d2379bdc61 | Aryan22g/Data-Structures-and-Algorithms | 2darray/searchMatrix.cpp | #include<iostream>
using namespace std;
int main(){
int n, m;
cin>>n>>m;
int arr[n][m];
for(int i=0; i<n; i++){
for(int j=0; j<n; j++){
cin>>arr[i][j];
}
}
int key;
cin>>key;
int flag=false;
for(int i=0; i<n; i++){
for(int j=0; j<m; j++){
... | ALGO | 0.999914 | 4.650397 |
6d537504-8bc3-42fa-b8b6-e0e3d256e796 | manikanta2901/ubuntu | .history/SRM/elab/DataStructures/IOStreams/IOST13_20201030145044.cpp | #include<bits/stdc++.h>
#include<iostream>
using namespace std;
int main(){
string a,b;
cin >> a >> b;
cout.width(20) << setfill('*') << a << endl;
cout.width(20) << setfill('-') << b << endl;
return 0;
} | ALGO | 0.999826 | 3.119856 |
8c0670d1-ee8b-4785-bbe3-97eb434e8dbc | camil0palacios/Competitive-programming | solutions/codeforce/Codeforces Round #828 (Div. 3)/c.cpp | #include <bits/stdc++.h>
#define endl '\n'
#define ll long long
#define fori(i,a,b) for(int i = a; i < b; i++)
#define forr(i,a,b) for(int i = a; i >= b; i--)
#define fore(i,a,b) for(int i = a; i <= b; i++)
#define ft first
#define sd second
#define all(v) v.begin(), v.end()
#define sz(v) (int) v.size()
#define mp make... | ALGO | 0.998713 | 3.719507 |
2de91486-3044-409b-a519-35eaa27737cd | dvaitam/codeforces | 0-999/100-199/120-129/126/solE.cpp | #include<cstdio>
#include<cstring>
#include<set>
#include<algorithm>
using namespace std;
const int le=20,ri=21;char z[]="BRWY";
set<int> U;int a[7][8],P[4][4],L[10],R[10],A[10],B[10],T=-1,p[22][22];bool v[7][8],w[10][10],r2[7][8],d2[7][8],u[22];char s[13][15],S[13][15];
void add(int x,int y)
{
static int t=0;
... | ALGO | 0.999938 | 3.026726 |
f47d2fce-fc70-4d20-b4ac-fb39735132a0 | Henrik-Yao/NEUQ-ACM-Solution | week7/冉钊/week7-3.cpp | #include<bits/stdc++.h>
using namespace std;
typedef unsigned long long ull;
bool vst[100010]={0};
string tex,pat;
ull flag=0;
int main(){
while(getline(cin,tex)){
//if(flag!=0) cout<<"\n";
memset(vst,0,100010);
getline(cin,pat);
for(ull i=0;i<pat.size();i++){
vst[(int)pa... | ALGO | 0.999827 | 3.524484 |
797b4ed6-8358-44c2-8480-44f6c5cfdc44 | Shriman1527/dsa-by-love-babber | 8. Switch Statements and Functions/function5_primeNo.cpp | #include<iostream>
using namespace std;
bool isprime(int n){
for (int i=2;i<n;i++){
// divide ho gya ,not a prime no
if(n%i==0){
return 0;
}
}
return 1;
}
int main(){
int n;
cout<<" Enter the No :";
cin>>n;
if(isprime(n)){
cout<<n<<" is a prime no"<<endl;
}
else... | ALGO | 0.999615 | 3.135248 |
706eb110-66ab-485c-9f95-f7d7cff98cd6 | vinayak-7/DSA | Difficulty: Medium/Vertical Width of a Binary Tree/vertical-width-of-a-binary-tree.cpp | //{ Driver Code Starts
#include <bits/stdc++.h>
using namespace std;
struct Node {
int data;
struct Node *left;
struct Node *right;
Node(int x) {
data = x;
left = right = NULL;
}
};
// Function to Build Tree
Node *buildTree(string str) {
// Corner Case
if (str.length() == ... | ALGO | 0.999571 | 6.832343 |
87deb4bd-4838-4eed-b818-eae1210a89fc | TensorCodeGen/tensor-codegen | libcxx/test/std/algorithms/alg.sorting/alg.sort/sort/sort.pass.cpp | // <algorithm>
// template<RandomAccessIterator Iter>
// requires ShuffleIterator<Iter>
// && LessThanComparable<Iter::value_type>
// void
// sort(Iter first, Iter last);
#include <algorithm>
#include <iterator>
#include <random>
#include <cassert>
#include "test_macros.h"
std::mt19937 randomness;
te... | TEST | 0.991059 | 7.386009 |
60e379f8-af76-4e69-8929-47e7a49eaf10 | ishandutta2007/codeforces | kpw29/normal/804/B.cpp | #include <bits/stdc++.h>
#include <unistd.h>
using namespace std;
#define e1 first
#define e2 second
#define pb push_back
#define mp make_pair
#define boost {ios_base::sync_with_stdio(false);}
#define eb emplace_back
#define OUT(x) {cout << x; exit(0); }
#define FOR(i, a, b) for(int i=(a); i<=(b); ++i)
#define scanf(..... | ALGO | 0.999956 | 3.985352 |
9d3b776c-029f-480c-9bbb-1b87fa2fa609 | santi3223/PreseleccionIOI | Codeforces/Problemas/Otros/K-divisible_Sum.cpp | #include <bits/stdc++.h>
using namespace std;
#define ll long long
#define vl vector<ll>
#define vs vector<string>
#define vb vector<bool>
#define vc vector<char>
#define ull unsigned long long
#define pll pair<ll, ll>
#define pb push_back
#define fi first
#define se second
#define ff(i, p, x) for (ll i = p; i < x; i++... | ALGO | 0.999937 | 3.755845 |
b219cd0b-564c-45cb-ac83-4863f6224438 | Root007x/DSA-and-problem | nonfractional_knapsack.cpp | #include <bits/stdc++.h>
using namespace std;
int max(int a, int b)
{
if (a > b)
return a;
return b;
}
int main()
{
int weight[] = {0, 3, 4, 5, 6}; // sorted
int profit[] = {0, 2, 3, 4, 1};
int i = 4;
int w = 8; // capacity
int arr[i + 1][w + 1];
for (int row = 0; row <= i; r... | ALGO | 0.999983 | 4.28331 |
1900a3ae-071e-4a87-823c-0e7445f78327 | StevenKim1994/Interview | linked_list_problems/listDemo.cpp |
#include <iostream>
#include "list.h"
using namespace algo;
void print( const List<int>& lst ) {
for (List<int>::const_iterator it = lst.begin() ; it != lst.end(); it++) {
std::cout << *it << " ";
}
std::cout << std::endl;
}
int main( )
{
const int N = 20;
List<int> lst;
for( int... | TOOL | 0.966265 | 3.397881 |
3056c223-6723-4dcf-8717-1ac4e630ae88 | anushkaa-ambuj/LeetCode | 1014-k-closest-points-to-origin/1014-k-closest-points-to-origin.cpp | class Solution {
public:
vector<vector<int>> kClosest(vector<vector<int>>& points, int k) {
priority_queue<pair<int, vector<int>>> pq;
for(auto point: points){
int dist = point[0]*point[0] + point[1]*point[1];
pq.push({dist, point});
if (pq.size() > k){
... | ALGO | 0.999998 | 6.128308 |
a2e38e3b-db71-42a4-ab5e-b015075a71ef | ishandutta2007/codeforces | heart_blue/normal/192/A.cpp | #include <cstdlib>
#include <cctype>
#include <cstring>
#include <cstdio>
#include <cmath>
#include <algorithm>
#include <vector>
#include <string>
#include <iostream>
#include <sstream>
#include <map>
#include <set>
#include <queue>
#include <stack>
#include <fstream>
#include <numeric>
#include <iomanip>
#include <bi... | ALGO | 0.999956 | 3.793706 |
c7bb819d-8ffc-4114-93c3-2bea7fc1f292 | soolabettu/cp | code_forces/deltix_2021/b.cpp | #include "bits/stdc++.h"
using namespace std;
using ll = long long;
using vs = vector<string>;
using vi = vector<int>;
using vl = vector<ll>;
using vb = vector<bool>;
using pi = pair<int, int>;
using pl = pair<ll, ll>;
using vpi = vector<pair<int, int>>;
using vpl = vector<p... | ALGO | 0.99901 | 4.508894 |
0c75986b-188c-44c5-9b00-76445bc0f0ec | mycamphortree/contracts | contracts/libc++/upstream/test/std/algorithms/alg.sorting/alg.heap.operations/make.heap/make_heap.pass.cpp | // <algorithm>
// template<RandomAccessIterator Iter>
// requires ShuffleIterator<Iter> && LessThanComparable<Iter::value_type>
// void
// make_heap(Iter first, Iter last);
#include <algorithm>
#include <random>
#include <cassert>
std::mt19937 randomness;
void test(int N)
{
int* ia = new int [N];
for ... | TEST | 0.995305 | 5.411539 |
e023267b-141b-4f77-af25-040df1e3c778 | komalshinde-dev/DataStructures_Lab_SEM3 | sparse_matrices/sparse_matrix_ops.cpp | #include <iostream>
using namespace std;
#define MAX 20
class sparse_matrix {
private:
int mat1[MAX][3];
int mat2[MAX][3];
int p[MAX][3]; //Temporary arrays used for transpositions.
int f[MAX][3];
int m, n, t;
int t1, t2; //Total non-zero elements in mat1 and mat2
public:
void read()... | ALGO | 0.998962 | 4.704999 |
10fb948c-8531-4653-bd07-796ee391a72c | Mamun-NSU/Problem-Solving-2025 | codeforces/Problemset/405A - Gravity Flip.cpp | // Link: https://codeforces.com/contest/405/problem/A
#include <iostream>
#include <vector>
#include <algorithm>
using namespace std;
int main()
{
int n;
cin >> n;
vector<int> cubes(n);
for (int i = 0; i < n; i++)
{
cin >> cubes[i];
}
sort(cubes.begin(), cubes.end());
for (... | ALGO | 0.999879 | 4.697645 |
ba405ac3-cc79-4a66-8019-7b8e2aa90725 | rahul17081998/Data-Structure | code_cpp/String/L6_Leftmost_Repeating_Character.cpp | #include<bits/stdc++.h>
using namespace std;
// Naive
// Time=O(n^2)
int leftmostoc(string &str)
{
for (int i = 0; i < str.length(); i++)
{
for (int j = i+1; j < str.length(); j++)
{
if(str[i]==str[j])
return i;
}
}
return -1;
}
// Better Appr... | ALGO | 0.999671 | 4.450866 |
03c55e3c-a3fa-4c3d-99cd-e9fa460404ca | Xpccccc/CPP_Primary | day_07/demo_35/main.cpp | #include <iostream>
using namespace std;
//对于非模板函数和同名函数模板,如果其他条件都相同,在调动时会优先调用非模板函数而不会从该模板产生出一个实例。如果模板可以产生一个具有更好匹配的函数, 那么将选择模板
// 专门处理int的加法函数
int Add(int left, int right) {
return left + right;
}
// 通用加法函数
template<class T1, class T2>
T1 Add(T1 left, T2 right) {
return left + right;
}
int main() {
Add(1... | TOOL | 0.879095 | 5.96243 |
1cb44a0a-90b3-4815-83f3-d63d28559acb | tehrengruber/reactive-transport-cuda | ext/eigen/doc/examples/TutorialLinAlgExComputeSolveError.cpp | #include <iostream>
#include <Eigen/Dense>
using namespace std;
using namespace Eigen;
int main()
{
MatrixXd A = MatrixXd::Random(100,100);
MatrixXd b = MatrixXd::Random(100,50);
MatrixXd x = A.fullPivLu().solve(b);
double relative_error = (A*x - b).norm() / b.norm(); // norm() is L2 norm
cout << "The ... | ALGO | 0.999744 | 3.625966 |
eaf454b2-60da-47a5-8574-78e8e202e210 | SammaelA/grade | diff_reconstruction/building_generator_2.cpp | #include "building_generator_2.h"
#include "diff_geometry_generation.h"
#include "common_utils/interpolation.h"
#include <cppad/cppad.hpp>
namespace dgen
{
#define vec2 g_vec2<real>
#define vec3 g_vec3<real>
#define vec4 g_vec4<real>
#define mat43 g_mat43<real>
template <typename real>
PartOffsets create_... | ALGO | 0.930725 | 5.249031 |
05bc3b44-6ab5-4801-9933-9bae0ef1fb95 | kmjak/AtCoderStudy | tessoku/A63.cpp | #include <bits/stdc++.h>
#define all(x) x.begin(), x.end()
#define rall(x) x.rbegin(), x.rend()
#define mp make_pair
#define mt make_tuple
#define eb emplace_back
#define g(i,t) get<i>(t)
#define tos(n) to_string(n)
#define toc(n) '0' + n
#define toll(s) stoll(s)
#define btoi(b) static_cast<ll>(b.to_ulong())
using ... | ALGO | 0.999996 | 4.425553 |
dede41b5-f926-476e-85f2-590d59dea696 | Harshitv21/TCS-NQT-Coding-Sheet | String/27.cpp | #include <iostream>
#include <string>
using namespace std;
int naive(string s1, string s2) {
int n = s1.length();
int m = s2.length();
for(int i = 0; i < n; i++) {
int temp = i;
int j = 0;
for(j = 0; j < m; j++) {
if(s1[temp] != s2[j]) break;
temp++;
... | ALGO | 0.999913 | 5.591455 |
9c9a3d16-bea1-4af6-9e7c-5c7c080bdb90 | ishandutta2007/codeforces | froggyzhang/normal/1470/E.cpp | #include<bits/stdc++.h>
using namespace std;
#define N 30030
typedef long long ll;
inline ll read(){
ll x=0,f=1;
char c=getchar();
while(c<'0'||c>'9'){
if(c=='-')f=-1;
c=getchar();
}
while(c>='0'&&c<='9'){
x=(x<<1)+(x<<3)+c-'0';
c=getchar();
}
return x*f;
}
int n,C,Q,a[N];
ll dp[N][5],sm[N][5];
void Solv... | ALGO | 0.999928 | 3.351947 |
77be1a6a-4a89-43d5-8f54-22c38670b66d | WayneWei228/Algorithm | functions/find_first_of.cpp | #include <bits/stdc++.h>
using namespace std;
bool comp_case_insensitive(char c1, char c2) {
return tolower(c1) == tolower(c2);
}
int main() {
int mychars[] = {'a', 'b', 'c', 'A', 'B', 'C'};
vector<char> haystack (mychars, mychars + 6);
vector<char>::iterator it;
int needle[] = {'A', 'B', 'C'};
... | ALGO | 0.999642 | 4.175156 |
8fa86a90-5027-4b6a-9fd6-ed734ca39e33 | levi77/FDTD-CATS | Loop tiling/Naive Tiling/Execution time experiments/untiled.cpp | #include <iostream>
#include <vector>
#include <algorithm>
#include <chrono>
//TEST FDTD time skewing
//L1 wall - 32768 bytes
//g++ -g -Wall -std=c++11 untiled.cpp -o untiled
int main() {
std::vector<float> E1 = { 0, 0, 0, 0, 10, 0, 0, 0, 0 };
std::vector<float> H1 = { 0, 0, 0, 0, 0, 0, 0, 0, 0 };
co... | ALGO | 0.99146 | 3.878483 |
29192255-223f-4b45-93d3-10a61a58184b | youbeen2798/Code-Tree-Problems | 토스트 계란틀.cpp | #include <iostream>
#include <queue>
#include <cstring>
#include <vector>
using namespace std;
int n; // ĭ ũ
int l; // ̵ ּڰ
int r; // ̵ ִ
int map[51][51];
bool visited[51][51];
bool flag = false;
int dx[4] = { 1,-1,0,0 };
int dy[4] = { 0,0,1,-1 };
bool inrange(int x, int y) {
if (1 <= x && x <= n && 1 <= y && y ... | ALGO | 0.999666 | 3.542395 |
443d2b32-a575-42e2-b64c-f49490b19fc3 | katherineam97/TareaPolimorfismo | Kmeans.cpp | #include "Kmeans.h"
#include "Lista.h"
/**Metodo constructor por omision de la clase*/
Kmeans::Kmeans(){
tamanoL=0;
}
/**Metodo que recorre la lista para saber su tamano
@param lista
@return tamano
*/
int Kmeans::tamanoLista(Lista * lista){
int tamano=0;
for(Lista::Iterator i = lista->begin(); i != lista->end()... | ALGO | 0.999173 | 4.725882 |
cb426c81-bd45-4ad0-8bca-2fe0b5dc7089 | zhongchong7/opencalib | online_calib/radar2carcenter/eigen3/bench/vdw_new.cpp | #include <iostream>
#include <Eigen/Core>
using namespace Eigen;
#ifndef SCALAR
#define SCALAR float
#endif
#ifndef SIZE
#define SIZE 10000
#endif
#ifndef REPEAT
#define REPEAT 10000
#endif
typedef Matrix<SCALAR, Eigen::Dynamic, 1> Vec;
using namespace std;
SCALAR E_VDW(const Vec &interactions1, const Vec &inter... | ALGO | 0.9998 | 3.509 |
93b7b70b-ec58-4151-8f68-adafe4ab6897 | shplok/CS410 | exam1_practice/question9.cpp | #include <iostream>
#include <string>
using namespace std;
/*
Question Requirements:
Write a C++ program that inputs one number consisting of five digits from the user, then
separates the number into its individual digits and displays the digits separated from one another
by three spaces each.
For example, if th... | ALGO | 0.999227 | 5.773989 |
be0b09ad-2892-486b-9b90-74d195a7ccca | prashkrans/DSA | 10. Graphs/5.4.1. If the given undirected graph is cyclic (UFA - U by Height).cpp | /* Graph Problem #8.4.1. - Given an undirected graph, find whether it has a cycle. [Verify once although seems correct]
This problem could be solved using three methods
1. DFS + parent variable
2. BFS + parent array
3. Union-find algorithm (Avoid using find() and union() instead use findSet() and ... | ALGO | 0.999951 | 6.309233 |
1b82421c-330c-4094-8f46-55362bb6ff49 | sarvex/leetcode-umka | solution/2100-2199/2103.Rings and Rods/Solution.cpp | class Solution {
public:
int countPoints(string rings) {
unordered_map<int, unordered_set<char>> mp;
for (int i = 1; i < rings.size(); i += 2) {
int c = rings[i] - '0';
mp[c].insert(rings[i - 1]);
}
int ans = 0;
for (int i = 0; i < 10; ++i)
... | ALGO | 0.999774 | 5.436157 |
e6190491-b330-4fcc-94a8-7308394d3786 | TJUUAVLaboratory/ethz_asl_UAV_autonomous | src/dependents/mav_trajectory_generation/mav_trajectory_generation/src/vertex.cpp | #include <random>
#include "mav_trajectory_generation/vertex.h"
namespace mav_trajectory_generation {
Vertex::Vector createRandomVertices(int maximum_derivative, size_t n_segments,
const Eigen::VectorXd& pos_min,
const Eigen::VectorXd& pos_max,
... | ALGO | 0.998033 | 7.141968 |
c7f4f67f-7c57-4360-88fa-1982025fcc23 | 99hgz/Algorithms | Problems/luogu/1341.cpp | #include <cstdio>
#include <cstdlib>
#include <vector>
#include <cstring>
using namespace std;
int ANS[10000];
struct Node
{
int v, id;
};
int vec[60][60], indu[60];
bool vis[10000], hasson[60];
int n, anstot, tot;
char A[10];
int calc(char ch)
{
return (ch >= 'A' && ch <= 'Z') ? ch - 'A' + 1 : ch - 'a' + 27;... | ALGO | 0.999981 | 3.597971 |
2199093e-9f0a-4460-8c86-8b938c1854bd | ludan0414/TankTrouble | game.cpp | #include "tanktrouble.hpp"
#include <ctime>
#include <cstdio>
//#define debug
Game::Game(){
op1=new Tank(0.5,0.5,1,0,0,'A','D','W','S',13);//WASD Enter
op2=new Tank(1.5,0.5,1,0,1,37,39,38,40,' ');//上下左右 Space
int gridx=8,gridy=8;
for (int i=0;i<gridx;i++){
walls.emplace_back(new Wall(i,0,i+1,0))... | ALGO | 0.958541 | 3.467601 |
71a14993-0db9-4df2-99d7-7192a855cda9 | ishandutta2007/codeforces | shadowlight/normal/960/C.cpp | #include <bits/stdc++.h>
#define ll long long
#define TASKNAME ""
using namespace std;
const ll INF = 1e9 + 7;
const int MAXN = 1e6 + 7;
const double EPS = 1e-8;
const ll LOGN = 30;
int main() {
#ifdef MY
freopen("input.txt", "r", stdin);
//freopen("output.txt", "w", stdout);
#else
/... | ALGO | 0.99996 | 3.254209 |
c715ad8e-a226-4290-a755-21cf92262b22 | Narasimha200/C-Practice-Problems | candyproblem.cpp | #include<iostream>
#include<string>
using namespace std;
const int N=1e3;
int mat[N][N];
int main(){
int t;
cin >> t;
while(t--){
int n;
cin >> n;
string str;
cin>>str;
for(int i = 0;i < N;i++){
for(int j =0; j <N;j++){
for(int k=0;k<n;k++)... | ALGO | 0.999832 | 3.51435 |
356d54bc-ed9d-444d-91e6-66ccf2cc279d | moxit121/git | C++ PROGRAMMING/Assignments/c++ assignments/q3.cpp | // 3 Write a program to find the multiplication values and the cubic values usinginline function
#include<iostream>
using namespace std;
class line
{
public:
inline float mul(float x, float y)//initialize inline function
{
return (x*y);
}
inline float cube(float x)
{
return (x*x*x);
}
};
int main()
... | TOOL | 0.991327 | 4.449687 |
60965950-d8d4-4271-9263-8049fcb0d53f | iwiwi/programming-contests | other/jag/2010_summer_camp/day3/D.cpp | #include <iostream>
#include <sstream>
#include <string>
#include <vector>
#include <stack>
#include <queue>
#include <set>
#include <map>
#include <algorithm>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <cctype>
#include <cmath>
#include <cassert>
using namespace std;
#define all(c) (c).begin(), ... | ALGO | 0.99998 | 4.068584 |
6bceedd3-07e6-4de3-9f24-d745fea280a7 | XeLader/AlgTrainings | 3rd_train/13.cpp | #include <string>
#include <iostream>
#include <stack>
#include <vector>
using namespace std;
int main()
{
string input;
vector<char> postfix = {};
stack<char> prepPostfix;
char ch;
string normal;
getline(cin, normal);
for (unsigned int i = 0; i < normal.length(); i++)
{
ch = normal[i];
i... | ALGO | 0.99982 | 4.368007 |
4c4690de-876a-44c5-aea3-88ec5997e163 | johnpzh/parallel_ANNS | include/utils.cpp | //
// Created by Zhen Peng on 11/5/2021.
//
#include "utils.h"
namespace PANNS {
double get_dist_variation(const std::vector<distf> &distances)
{
double mean = std::accumulate(distances.begin(), distances.end(), 0.0) / distances.size();
double variation = 0;
for (distf dist : distances) {
variat... | ALGO | 0.997543 | 5.422126 |
a3d37b95-5c1f-4e9a-b94d-63c625524599 | Rangaharini/Datastructures | SortingAlgorithms/BubbleSort.cpp | #include<iostream>
using namespace std;
#define Max 50
int array[Max],i,j,n;
void swap(int& a, int& b)
{
int temp = a;
a = b;
b = temp;
}
void BubbleSort()
{
for ( i = 0; i < n - 1; i++)
{
int flag = 0;
for ( j = 0; j < n - 1 - i; j++)
{
if (array[j] > array[j + 1... | ALGO | 0.999887 | 4.120772 |
1af888e6-7c0a-433e-b416-2607499b5822 | jinsuo1o7/LeetCode | daily_problem/2023.01/minimum_number_arrow_burst_ballons.cpp | #include <bits/stdc++.h>
using namespace std;
class Solution {
public:
int findMinArrowShots(vector<vector<int>>& points) {
sort(points.begin(), points.end(), [](vector<int>& a, vector<int>& b){
return a[1] < b[1];
});
int ans = 0, arrow = 0;
for(int i = 0; i < points.si... | ALGO | 0.999935 | 5.836414 |
2af324ac-b512-4fed-8cd8-24154e707082 | NomuraYuu23/CG2 | externals/DirectXTex/DirectXTexMisc.cpp | #include "DirectXTexP.h"
using namespace DirectX;
using namespace DirectX::Internal;
#ifdef __GNUC__
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wignored-attributes"
#endif
namespace
{
const XMVECTORF32 g_Gamma22 = { { { 2.2f, 2.2f, 2.2f, 1.f } } };
//---------------------------------------... | TOOL | 0.962399 | 6.882344 |
1e83fb43-32a8-40d4-b66e-f064c56f7296 | DawnteaStudio/TIL | coding-test/Baekjoon/2000/2512.cpp | #include <iostream>
#define fast ios::sync_with_stdio(false), cin.tie(NULL), cout.tie(NULL);
using namespace std;
int find_h(int left, int right, int city[], int N, int M)
{
int mid, total;
while (left <= right)
{
mid = (left + right) / 2;
total = 0;
for (int i = 0; i < N; i++)
{
if (city[... | ALGO | 0.999984 | 5.004701 |
3d8c0c52-b85b-479b-b339-5ea4267e033a | hacch141/Coding-Practice | LeetCode/0501.Find-Mode-in-Binary Search-Tree.cpp | // 501. Find Mode in Binary Search Tree
class Solution {
public:
void solve(TreeNode* root, int& prev, int& freq, int& maxFreq, vector<int>& ans) {
if(!root) return;
solve(root->left,prev,freq,maxFreq,ans);
if(prev == root->val) {
freq++;
}
else {
f... | ALGO | 0.999998 | 6.092672 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.