uuid string | repo_name string | relative_path string | content string | category string | algo_rel_score float64 | quality_score float64 |
|---|---|---|---|---|---|---|
09f39576-4ab3-4a35-a3ce-d249b947c7ce | diyasoor/GFG-POTD | 2023/Jan2023/Minimum times A has to be repeated such that B is a substring of it.cpp | Given two strings A and B. Find minimum number of times A has to be repeated such that
B is a Substring of it. If B can never be a substring then return -1.
Example 1:
Input:
A = "abcd"
B = "cdabcdab"
Output: 3
Explanation:
Repeating A three times (abcdabcdabcd),
B is a substring of it. B is not a substring
of A when... | ALGO | 0.999948 | 5.851568 |
d9aace34-0275-415b-9109-5ec16fcc9b37 | helmutbuhler/milana_robot | robot/imu/sensor_fusion.cpp | // This code is responsible for taking the raw sensor values of the accelerometer and gyroscope
// (both in the IMU) and calculating an estimate for the vector of gravity (or in other words
// the rotation of the robot).
// Especially the jumping and the sidebalancing stuff require very precise and low latency values, ... | ALGO | 0.944256 | 5.089415 |
57f247a5-6424-475a-abec-28165d74c455 | SimulationEverywhere-Models/NEWSPAPER | p_journalist.cpp | /*******************************************************************
*
* DESCRIPTION: Atomic Model p_journalist (use a distributin)
*******************************************************************/
/** include files **/
#include <math.h> // fabs( ... )
#include "p_journalist.h" // base header
#inc... | TOOL | 0.97213 | 6.497159 |
0876ade7-587f-48ba-bac6-a9478d8453fc | ishandutta2007/codeforces | alan233/normal/1672/C.cpp | // Author: wlzhouzhuan
#include<bits/stdc++.h>
using namespace std;
#define rep(i,l,r) for(int i=(l);i<=(r);i++)
#define per(i,l,r) for(int i=(l);i>=(r);i--)
#define ll long long
#define ull unsigned long long
#define pii pair<int,int>
#define mset(s,t) memset(s,t,sizeof(s))
#define mcpy(s,t) memcpy(s,t,sizeof(t))
#de... | ALGO | 0.999945 | 4.187253 |
4d0d5102-a393-48b9-b72c-b5771ebf6b47 | 1604078-MEHEDI/Codeforces | codeforces/987/A.cpp | #include<bits/stdc++.h>
using namespace std;
#define IO ios_base::sync_with_stdio(false),cin.tie(0);
#define ll long long
int main()
{
IO
int n;
map<string, string>m;
m["purple"] = "Power";
m["green"] = "Time";
m["blue"] = "Space";
m["orange"] = "Soul";
m["red"] = "Reality";
m["yel... | ALGO | 0.995611 | 3.556079 |
2ef8db6a-dbe0-466d-8045-5d2a118997ed | LxGeo/lxProximityAlign | app/src/gdal_algs/polygons_to_proximity_map.cpp | #include "gdal_algs/polygons_to_proximity_map.h"
namespace LxGeo
{
namespace lxProximityAlign
{
using namespace LxGeo::GeometryFactoryShared;
void polygons2proximity(IO_DATA::PolygonsShapfileIO& input_shapefile, std::string& out_proximity_map_path, OGREnvelope* out_extents,
double raster_px_size... | TOOL | 0.923341 | 6.51083 |
51ecfc34-b768-45a0-a7ed-04ec24157bd0 | AtomHeartCoder/CSP-CCF | 2017-09/1.cpp | #include <iostream>
using namespace std;
int main(void)
{
int N;
cin >> N;
int total = 0;
if (N >= 10 * 5) {
int count = N / (10 * 5);
total += count * (5 + 2);
N -= count * (10 * 5);
}
if (N >= 10 * 3) {
int count = N / (10 * 3);
total += count * (3 + 1);
N -= count * (10 * 3);
}
total += N / 10... | ALGO | 0.997636 | 3.655222 |
cb9481e8-f9a4-4db8-b220-48ea948ef321 | Prekaso/CECS-275 | Lab 3/help.cpp | //including the header files
#include<iostream>
#include<fstream>
#include<string.h>
#include<bits/stdc++.h>
using namespace std;
//implementing the parseString method to convert the line to vector<int>
vector<int> parseString(string line){
//getting the size of the line, and declaring the variables
int n = line... | ALGO | 0.997904 | 4.14503 |
32e203e5-5c52-41e0-a225-1872f11b8c49 | daviesian/psyche | lib/3rdParty/Eigen/doc/examples/Tutorial_BlockOperations_corner.cpp | #include <Eigen/Dense>
#include <iostream>
using namespace std;
int main()
{
Eigen::Matrix4f m;
m << 1, 2, 3, 4,
5, 6, 7, 8,
9, 10,11,12,
13,14,15,16;
cout << "m.leftCols(2) =" << endl << m.leftCols(2) << endl << endl;
cout << "m.bottomRows<2>() =" << endl << m.bottomRows<2>() << endl << ... | ALGO | 0.997808 | 4.103137 |
0c0d4642-abd9-4110-b78c-8a40635b05ac | AdarshGaur/Competitive-Programming | Codeforces/Codeforces Round #796 (Div. 2)/E - Railway System.cpp | // Author : @AdarshGaur
#include <bits/stdc++.h>
using namespace std;
#ifdef cicada
#include "debug.h"
#else
#define debug(...) "Yume o akiramete shinde kure."
#endif
#define int int64_t
// #define endl "\n"
typedef pair<int,int> pii;
int const INF = 2e18;
int const mod = 1e9 +7;
int ask(string& s){
cout << "? " ... | ALGO | 0.99985 | 3.579291 |
02015563-8f40-403e-bf63-359514ab05b1 | kelvindk/Video-Stabilization | boost_1_42_0/libs/graph/example/topo-sort-with-leda.cpp | int
main()
{
using namespace boost;
typedef GRAPH < std::string, char >graph_t;
graph_t leda_g;
typedef graph_traits < graph_t >::vertex_descriptor vertex_t;
std::vector < vertex_t > vert(7);
vert[0] = add_vertex(std::string("pick up kids from school"), leda_g);
vert[1] = add_vertex(std::string("buy groce... | ALGO | 0.998692 | 4.5626 |
4450f0c6-9157-414a-a4d4-ee32c2f49af3 | parallel101/course | 05/04_deadlock/08/main.cpp | #include <iostream>
#include <mutex>
std::recursive_mutex mtx1;
void other() {
mtx1.lock();
// do something
mtx1.unlock();
}
void func() {
mtx1.lock();
other();
mtx1.unlock();
}
int main() {
func();
return 0;
}
| ALGO | 0.971868 | 5.508561 |
15059b7f-2d98-42fc-a896-fadb794a70b9 | Sansh2356/ADA_NEW | ADA/Min_max.cpp | #include <iostream>
#include <vector>
using namespace std;
pair<int, int> findMinMax(vector<int>& arr, int low, int high) {
if (low == high) {
return {arr[low], arr[low]};
} else {
int mid = low + (high - low) / 2;
auto left = findMinMax(arr, low, mid);
auto right = findMinMax(... | ALGO | 0.999979 | 5.798411 |
276b8bea-dc2d-4ad1-bb0d-fa9471dbfabd | pakuland3/CP | contests/BOJ/2024 Gahue Coding Test/B.cpp | #include <bits/stdc++.h>
typedef long long ll;
using namespace std;
int main(){
ios_base::sync_with_stdio(false); cin.tie(NULL);
int s,f,ma,mb;
cin >> s >> ma >> f >> mb;
cout << (s<=ma+f+mb || s<241?"high speed rail":"flight");
return 0;
} | ALGO | 0.999702 | 3.972766 |
2dc92bc6-9a72-4f21-ab2d-c9b034b781d0 | kaveman909/aoc-cpp | src/2022/1.cpp | #include "aoc_includes.h"
static auto local_process_input(char *fpath) {
std::vector<std::vector<int>> weights(1);
std::ifstream in(fpath);
char buf[MAX_LEN];
while (in.getline(buf, MAX_LEN)) {
if (const auto [result, weight] = scn::scan_tuple<int>(buf, "{}"); result) {
weights.back().emplace_back(w... | ALGO | 0.949678 | 4.260904 |
f2e48f17-a854-41cc-9a89-8e62b8c1e165 | Siddeshwar002/DSA-again | Dynamin Programming/All Ways/Knight_Prob_in_ChessBoard.cpp | #include <bits/stdc++.h>
using namespace std;
// ! Recursive CODE
class Solution
{
public:
double safeProb(int n, int k, int l, int row, int col)
{
if (k == l)
return 1 / pow(8, l);
int dx[] = {-1, +1, +2, +2, +1, -1, -2, -2};
int dy[] = {-2, -2, -1, +1, +2, +2, +1, -1};
... | ALGO | 0.999942 | 3.232992 |
201a249c-350e-443f-bc70-6db382c8a642 | zee-bit/FINAL450 | Trie/Unique rows in boolean matrix.cpp | struct Node {
Node *link[2];
};
Node *root = new Node();
bool insert(int M[MAX][MAX], int r, int col) {
bool diff = false;
Node *dummy = root;
for(int i = 0; i < col; i++) {
if(dummy -> link[M[r][i]] == NULL) {
dummy -> link[M[r][i]] = new Node();
diff = true;
}... | ALGO | 0.999933 | 4.224794 |
9996bb37-a445-43f0-bd5a-7ea0268fe6bc | curro/mesa | src/glsl/opt_if_simplification.cpp | /**
* \file opt_if_simplification.cpp
*
* Moves constant branches of if statements out to the surrounding
* instruction stream.
*/
#include "ir.h"
class ir_if_simplification_visitor : public ir_hierarchical_visitor {
public:
ir_if_simplification_visitor()
{
this->made_progress = false;
}
ir_vi... | ALGO | 0.987172 | 7.242038 |
4dcddf49-c395-4ae0-babd-024d3e2f6b21 | NitinSundar/Comp | discrete/8.cpp | #include <stdio.h>
int main()
{
int n,i,j,k;
scanf("%d",&n);
int a[n],b[n];
for(i=0;i<n;i++){
a[i]=i;
scanf("%d",&b[i]);
}
int ans=0;
for(k=0;k<n;k++)
{
int c=0;
j=(k+b[k])%n;
while(j!=k && c<100)
{
c++;
j=(j+b[j])%n... | ALGO | 0.999522 | 3.077863 |
d4fa7c14-cbbc-413d-ab1b-4c0076a00a74 | sahilgrewal8072/Leetcode | 0141-linked-list-cycle/0141-linked-list-cycle.cpp | /**
* Definition for singly-linked list.
* struct ListNode {
* int val;
* ListNode *next;
* ListNode(int x) : val(x), next(NULL) {}
* };
*/
class Solution {
public:
bool hasCycle(ListNode *head) {
ListNode* fast = head;
ListNode* slow = head;
while(fast && fast->next)... | ALGO | 0.999693 | 5.313643 |
e321c8c2-7694-447c-b641-60bf46632068 | Beng-Cccat/LeetCode_solution | 239.滑动窗口最大值.cpp | /*
* @lc app=leetcode.cn id=239 lang=cpp
*
* [239] 滑动窗口最大值
*/
// @lc code=start
class Solution
{
public:
vector<int> maxSlidingWindow(vector<int> &nums, int k)
{
/*
分组:每k个元素为一组
用两个数组分别存储左边界和右边界到自己的最大值
每次push的值为左右边界的最大值
*/
vector<int> res;
vector<int> ... | ALGO | 0.999952 | 6.554811 |
fb772747-47b9-4051-941d-3276ccce142b | IamWilson1209/leetcode | Priority Queue/973. K Closest Points to Origin.cpp | class Solution {
public:
vector<vector<int>> kClosest(vector<vector<int>>& points, int k) {
// 使用最小堆,存儲 {距離平方, 索引}
priority_queue<pair<int, int>, vector<pair<int, int>>, less<pair<int, int>>> minHeap;
// 將所有點的距離和索引加入堆
for (int i = 0; i < points.size(); i++) {
... | ALGO | 0.999994 | 5.571265 |
ad24118b-938d-4adf-b969-009fa8c1621d | CodeWilliamT/MyAlgorithms | C++_Algorithm/LeetCodeDemo/LeetCodeDemo/1650.cpp | using namespace std;
#include <iostream>
#include <vector>
#include <string>
#include <unordered_map>
//哈希
class Node {
public:
int val;
Node* left;
Node* right;
Node* parent;
};
class Solution {
public:
Node* lowestCommonAncestor(Node* p, Node* q) {
unordered_map<int, Node*> parents;
... | ALGO | 0.999995 | 5.495552 |
6ffc15c1-0137-469f-b95d-153d3d17be22 | nicolas-lcn/superpixel-compression | CODE/palet.cpp | #include "image_ppm.h"
#include <math.h>
#include <vector>
#include <float.h>
#include <random>
struct RGB
{
unsigned char r,g,b;
int centroid = -1;
};
float distance(RGB c1, RGB c2)
{
float rsquare, gsquare, bsquare;
rsquare = pow((c1.r - c2.r), 2);
gsquare = pow((c1.g - c2.g), 2);
bsquare = pow((c1.b - c2.b),... | ALGO | 0.967301 | 3.236949 |
5f4a5c52-c95e-491d-83df-81cdbd03b8df | kennethhu418/Beauty_of_coding | 1.7 LightAndShadow/1.7 LightAndShadow.cpp | // 1.7 LightAndShadow.cpp : ̨Ӧóڵ㡣
//
#include "stdafx.h"
#include <vector>
#include <algorithm>
using namespace std;
#define SAME_THRESHOLD 0.00000001
class Point
{
public:
double x;
double y;
bool allPointsOnLine;
Point(double x = 0, double y = 0)
{
this->x = x;
this->y = y;
... | ALGO | 0.999178 | 4.78609 |
aa6fd137-a665-418e-b41f-fae1c060cfae | mongodb/mongo | src/mongo/db/query/index_tag.cpp | #include "mongo/db/query/index_tag.h"
#include <absl/container/node_hash_map.h>
#include <absl/meta/type_traits.h>
#include <boost/container/small_vector.hpp>
// IWYU pragma: no_include "ext/alloc_traits.h"
#include <algorithm>
#include <limits>
// IWYU pragma: no_include "boost/intrusive/detail/iterator.hpp"
#includ... | ALGO | 0.998736 | 7.874907 |
9b983090-f43e-4cda-9576-6e9db900e7f8 | equaringer/Leetcode | Medium/Binary Tree Preorder Traversal_Recursively.cpp | /**
* Definition for a binary tree node.
* struct TreeNode {
* int val;
* TreeNode *left;
* TreeNode *right;
* TreeNode(int x) : val(x), left(NULL), right(NULL) {}
* };
*/
class Solution {
public:
vector<int> preorderTraversal(TreeNode* root) {
vector<int> v;
if(root == NULL)... | ALGO | 0.999949 | 5.988947 |
dddfecf9-1d8b-437e-a82d-dc00dd3f8e6d | Stellaurium/codeforces_cpp_solution | contest/cf_971_div4/C/C.cpp | //
// Created by Stellaura on 2024/9/4.
//
#include <bits/stdc++.h>
using namespace std;
int main() {
int t;
cin >> t;
int x, y, k;
while (t--) {
cin >> x >> y >> k;
int x_jump = (int)ceil((double)x / k) * 2 - 1;
int y_jump = (int)ceil((double)y / k) * 2;
cout << max(x_jump, y_jump) << endl;
}
return ... | ALGO | 0.999536 | 4.53336 |
abbbd859-6ee9-4f5c-acce-d3963062cff2 | avinashkkumar/cdsa | cpppractice/loops.cpp | #include <bits/stdc++.h>
int main(){
for(size_t i = 0 ; i < 10 ; i++ ){
std::cout << "avinash" << std::endl;
}
} | ALGO | 0.897673 | 3.130294 |
7242eca3-ea7a-4443-87cd-b7c27f7c3d4a | AnuragPatel1/Codeforces-Problem | A_You_Are_Given_Two_Binary_Strings.cpp | #include <bits/stdc++.h>
using namespace std;
#define int long long int
void solve() {
string a,b; cin >> a >> b;
int index = 0;
for(int i = b.length()-1; i>=0;i--){
if(b[i] == '0'){
index++;
}
else break;
}
// cout << index <<" ";
if(index == b.length... | ALGO | 0.999916 | 5.415467 |
6fb754c0-9cb7-453d-b8c1-2f732c34b971 | kcatt/OpenGL-Raytracer | src/Affine.cpp | #include "Affine.h"
/* Affine4 methods start here. */
Affine4::Affine4() {
setIdentityMatrix();
}
void Affine4::setIdentityMatrix() {
for (int i = 0; i < 16; i++) {
if (i % 5 == 0)
matrix[i] = 1;
else
matrix[i] = 0;
}
}
void Affine4::set(Affine4 a) {
for (int ... | ALGO | 0.901426 | 6.042388 |
b287b958-fb59-483f-bbff-b2120bc7f3e3 | its-mayankanand/Practiceee | Arrays/reverse.cpp | #include<iostream>
using namespace std;
int reverseNum(int N)
{
int ans = 0 , rem ;
while(N)
{
rem = N % 10;
N /= 10;
ans = ans * 10 + rem;
}
return ans;
}
int main()
{
int n;
cout<<"Enter number to reverse: "<<endl;
cin>>n;
int output = reverseNum(n);
c... | ALGO | 0.99929 | 4.363541 |
bbadebea-82d3-4fe5-9b85-5398532ad0ea | blcksec/v8 | deps/icu-small/source/i18n/stsearch.cpp | #include "unicode/utypes.h"
#if !UCONFIG_NO_COLLATION && !UCONFIG_NO_BREAK_ITERATION
#include "unicode/stsearch.h"
#include "usrchimp.h"
#include "cmemory.h"
U_NAMESPACE_BEGIN
UOBJECT_DEFINE_RTTI_IMPLEMENTATION(StringSearch)
// public constructors and destructors -----------------------------------
StringSearch::... | TOOL | 0.938327 | 5.993089 |
2da2c168-02f9-46e5-b9ac-c44448e90f36 | Ishaan-11/Launchpad | lecture20(Bst)/classcodes.cpp | #include<iostream>
#include<queue>
#include<climits>
using namespace std;
struct node
{
int data;
node*left;
node*right;
node(int data)
{
this->data=data;
left=NULL;
right=NULL;
}
};
void addelement(node** root,int data)
{
if(*root==NULL)
{
*root=new node(... | ALGO | 0.999929 | 4.274745 |
26ceb5d7-0fcd-40c3-9d92-6cead1622a6e | IslamAmr155/Problem-Solving | LeetCode/Medium/2149. Rearrange Array Elements by Sign.cpp | class Solution {
public:
vector<int> rearrangeArray(vector<int>& nums) {
queue<int> p,n;
vector<int> ans;
for (int x : nums)
if (x >= 0) p.push(x);
else n.push(x);
while (!p.empty())
{
ans.push_back(p.front());
ans.push_back(n.f... | ALGO | 0.999993 | 5.505585 |
ad52bbb0-8a1f-4c78-a8a9-045e2c2bc583 | LouisNguyen25/NGCP_Software_2021_2022 | opencv-master/modules/calib3d/src/quadsubpix.cpp | #include "precomp.hpp"
#include <limits>
#include <utility>
#include <algorithm>
#include <math.h>
namespace cv {
inline bool is_smaller(const std::pair<int, float>& p1, const std::pair<int, float>& p2)
{
return p1.second < p2.second;
}
static void orderContours(const std::vector<std::vector<Point> >& contours... | ALGO | 0.999877 | 6.562594 |
d3c1c1f9-76a0-408a-9160-a897690d471c | 3142akay/leetcode- | 3171-minimum-equal-sum-of-two-arrays-after-replacing-zeros/minimum-equal-sum-of-two-arrays-after-replacing-zeros.cpp | class Solution {
public:
long long minSum(vector<int>& nums1, vector<int>& nums2) {
long long sum1 = 0;
long long sum2 = 0;
long long zero1 = 0;
long long zero2 = 0;
for(int &num : nums1) {
sum1 += num;
if(num == 0) { //to get minimum sum, add smalle... | ALGO | 0.999967 | 5.284993 |
81ad9622-4589-4b69-b14a-fa7909c7e41e | capchitts/Coding | Graphs/isConnected.cpp | #include <iostream>
using namespace std;
void isConnected(int **edge, int n, int sv,bool* visited){
visited[sv]=true;
for(int i=0;i<n;i++){
if(i==sv)
continue;
if(edge[sv][i] && !visited[i]){
visited[i]=true;
isConnected(edge,n,i,visited);
}
... | ALGO | 0.999986 | 4.239659 |
42f869b1-2891-47e9-bd43-da574212b5f6 | madhu9613/cses | graph algorithm/graph/invastigation.cpp | #include <bits/stdc++.h>
#define ll long long
#define INF LLONG_MAX
using namespace std;
const int MOD= 1e9 + 7;
int n, m;
vector<vector<pair<ll, ll>>> adj;
vector<ll> dist;
vector<ll> ways;
vector<ll> minFlights;
vector<ll> maxFlights;
// dist[i]: minimum cost to reach city
// ways[i]=number of minimum cost path :[pat... | ALGO | 0.999952 | 4.151162 |
70bb14b8-ed04-4d81-9639-2c7affcc9dd1 | AkramHossein/Competitive-Programming | Arrival_of_the_General.cpp | #include<iostream>
using namespace std ;
int main () {
int n , max = 0 , min = 0 ;
cin >> n ;
int arr[n] ;
for(int i=0 ; i<n ;i++){
cin >> arr[i] ;
}
int big=arr[0] , smal=arr[0] ;
for(int i=0 ; i<n ;i++){
if(big<arr[i]){
big=arr[i] ;
max = i+1 ;
... | ALGO | 0.999972 | 3.766074 |
affa39be-bb24-4c0f-ab66-6d5d1d769160 | ayushkr1999/Competitive-Programming | CodeForces/1209C.cpp | #include<bits/stdc++.h>
using namespace std;
#define fastIO ios_base::sync_with_stdio(false);cin.tie(0);cout.tie(0);
#define N 1000005
#define ll long long
#define ld long double
#define lli long long int
#define pb push_back
#define INF 10000000000
#define mod 1000000007
#define MOD 1000000007
//#define mp make_pair... | ALGO | 0.999912 | 3.395008 |
3bcc1aa8-6af5-4dcf-aa09-ddd62fe63c3b | minco3/adventofcode | 2024/day16/day16.cpp | #include <algorithm>
#include <chrono>
#include <fstream>
#include <iostream>
#include <print>
#include <queue>
#include <unordered_map>
#include <unordered_set>
#include <vector>
struct point
{
int64_t x, y;
point operator+(point r) const { return {x + r.x, y + r.y}; }
point operator-() const { return {-x... | ALGO | 0.999798 | 5.231655 |
c6ed0856-c352-406d-8870-c501f47b7ce1 | dwip-nandi/STL | STL/set/set.cpp | #include<bits/stdc++.h>
using namespace std;
int main(){
set<int>s;
set<int>::iterator it;
s.insert(34);
s.insert(3);
s.insert(4);
s.insert(4);
s.insert(-654);
s.insert(476);
s.insert(24);
for(it=s.begin();it!=s.end();it++){
printf("%d ",*it);
}
for ( it = s.begin... | ALGO | 0.98967 | 3.330504 |
a9ad1393-4c15-4fd5-b374-643f74e4dda7 | Tachone/autoAC | Auto AC/main.cpp | #include "Htmlparse.h"
#include "Socket.h"
#include "SQLink.h"
vector <string> blogUrl;
string allHtml;
string CodeHtml;
string ResCode;
SOCKET sock;
char host[200];
char othPath[300];
char buf[1024];
int ProblemID;
char s[200];
string StateAns;
string StateSapce;
string StateTime;
int main()
{
SQLinkInit(); //连... | WEB | 0.892458 | 3.127764 |
f37df39a-fa15-4c02-b46a-9a3abbf416dc | NSYABITOV/ZadachnikAbramyana | begin6.cpp | #include <iostream>
using namespace std;
/*
Даны длины ребер a, b, c прямоугольного параллелепипеда. Найти
его объем V = a·b·c и площадь поверхности S = 2·(a·b + b·c + a·c).
*/
int main(){
int a,b,c,V,S;
cout << "Введите размеры рёбер прямоугольного параллелепипеда a, b и c: ";
cin >> a >> b >> c;
V = a * b * c... | TOOL | 0.988488 | 3.818091 |
646f67e5-9826-4d64-94be-475ff84a47ce | echoCodeScript/Data-Structures-And-Algorithms | Recursion and BackTracking/Recursion_and_backtracking_level4.cpp | #include<bits/stdC++.h>
#include<cstdlib>
using namespace std;
#define ll long long int
#define vi vector<int>
#define vil vector<ll>
#define vc vector<char>
#define vf vector<float>
#define vul vector<ull>
#define vb vector<bool>
#define vii vector<vector<int>>
#define vvcc vector<vector<char>>
#define vpii vector<pai... | ALGO | 0.99993 | 3.294192 |
5539e6e0-43d0-4abd-9061-a48099d3f276 | li-ming-jiang/MyOpenSees | SRC/reliability/domain/distributions/WeibullRV.cpp | // $Revision: 1.11 $
// $Date: 2008-05-08 15:32:54 $
// $Source: /usr/local/cvs/OpenSees/SRC/reliability/domain/distributions/WeibullRV.cpp,v $
//
// Written by Terje Haukaas (<EMAIL>)
//
#include <WeibullRV.h>
#include <Vector.h>
#include <cmath>
WeibullRV::WeibullRV(int passedTag,
double passedMean, double... | ALGO | 0.997962 | 5.999593 |
b3063226-1cb9-4e18-9c47-aae2c9e5b2a6 | cloudQuant/cpp_little_project | 026_cpp_level_up_16_questions/ch4_bitonic.cpp | // C++ Code Challenges, LinkedIn Learning
// Challenge #4: Checking for Bitonic Sequences
// Write a function to check if a vector of integers is bitonic or not.
// Bitonic sequences have an ascending segment followed by a descending segment (sort of).
// Circular shifts of these sequences are also bitonic.
// Formal... | ALGO | 0.999833 | 6.831296 |
1b400013-348f-4740-b9e7-1e37d93203ec | Wesley0071/atividade-C-lista | questão 5.cpp | #include <stdio.h>
int main(void) {
int num1, num2, num3;
printf("Digite um número: ");
scanf("%d", &num1);
printf("Digite outro número: ");
scanf("%d", &num2);
printf("Digite maiis um número: ");
scanf("%d", &num3);
if(num1 > num2 && num1 > num3){
printf("maior numero é %d", num1);
}else{
... | ALGO | 0.999184 | 3.389732 |
f9e6c3a0-0bc6-476c-957a-bb3c4b347695 | benaspuckus/5-Programa | main.cpp | #include <iostream>
#include <fstream>
#include <sstream>
#include <iomanip>
#include <map>
using std::ifstream;
using std::string;
using std::cout;
using std::pair;
using std::multimap;
using std::iterator;
int main() {
ifstream fd("duom.txt");
string line;
multimap<string, int> zodis;
int eilute=1;
... | ALGO | 0.855081 | 3.673249 |
c35327be-5aaa-4f8f-9ebc-06d9cbe164c4 | jvbeliziario/ATP-I | Arrays_Struct_Ponteiros/array0.cpp | #include <iostream>
using namespace std;
int main()
{
int inteiros[10];
inteiros[0] = -100;
int maior_neg = 0;
for (int i = 1; i <= size(inteiros); i++)
{
inteiros[i] = inteiros[i - 1] * 3;
}
for (int i = 0; i <= size(inteiros); i++)
{
cout << inteiros[i] << " ";
... | ALGO | 0.999707 | 3.840787 |
8cb62921-2581-4414-a964-bcc7113f0cdf | mohityadav7/CP-Code | CodeShala/Linked List/Insert Node - incomplete.cpp | void insertNode(struct node *head, int x, int n){
if(x==1){
struct node *temp = newNode(x);
temp->next = head;
head = temp;
}
if(x==n){
while(head->next)
head = head->next;
head->next = newNode(x);
}
else{
}
}
| ALGO | 0.999704 | 3.630451 |
ffac24ae-1ae3-4688-bc82-c15676b548aa | DeltaZXAdvent/leetcode-like | yankao/2.2.3.6.cpp | #include <iostream>
#include <vector>
#include <numeric>
#include <chrono>
#include <string>
using namespace std;
typedef vector<long double> vec;
typedef vec::value_type val;
void reverse (vec::iterator begin, vec::iterator end);
void swap_multiple (vec::iterator begin, vec::iterator mid, vec::iterator end)
{
revers... | ALGO | 0.999941 | 3.859347 |
969c85e6-5bee-4b4c-bfa5-751443e1a4fe | ashueep/CSES-Problems | Intro/I10.cpp | /*
Problem : https://cses.fi/problemset/task/1618
*/
#include<bits/stdc++.h>
using namespace std;
#define ll long long int
#define gof for(long long int i = 0 ; i < n ; i++)
#define for1(i,s,e) for(long long int i = s ; i < e ; i++)
#define forr(i,e,s) for(long long int i = e ; i >... | ALGO | 0.999858 | 4.193913 |
02e84301-5943-4b01-92a4-62775f9864fd | jcllanu/Doble-Grado-Informatica-Matematicas | 1º Carrera/Fundamentos de la programación/Ejercicios/Tema 3/tema3ej15.cpp | #include <iostream>
#include<fstream>
using namespace std;
double leer(ifstream& file);
double comparar(double a, double b);
//Maximo numero de un fichero
int main()
{
ifstream archivo;
double max, num;
archivo.open("datos.txt");
if (archivo.is_open()) {
num = leer(archivo);
max = num;
while (num != 0) {
... | ALGO | 0.867145 | 3.597062 |
f1be9a52-6d9f-4b55-a471-3ab12d5f495e | rupak-20/Problem-Solving | merge-sorted-array/merge-sorted-array.cpp | class Solution {
public:
void merge(vector<int>& nums1, int m, vector<int>& nums2, int n) {
int i=m-1,j=n-1,k=n+m-1; //access array from last to avoid unnecessary changes
while(j>=0)
{
if(i>=0 && nums1[i]>=nums2[j])
nums1[k--]=nums1[i--];
... | ALGO | 0.999977 | 5.336042 |
8088d131-da83-4b27-bec9-bd0998be44ef | afrozchakure/Competitive-Programming-Solutions | CodeForces/bit++.cpp | #include<iostream>
#include<string>
using namespace std;
int main()
{
int n, x = 0;
cin>>n;
for(int i=0; i<n;i++)
{
string stmt;
cin>>stmt;
if(stmt == "++X")
++x;
else if(stmt == "X++")
x++;
else if(stmt == "--X")
--x;
else if(stmt == "X--")
x--;
... | ALGO | 0.999614 | 3.742187 |
b9306e5f-c0fc-4443-8e22-5b819ecdd270 | vrmn3/cpp | number 7 ( for )/stars shape.cpp | //This program to print stars in a pyramid shape.
#include <iostream>
using namespace std;
int main()
{
for ( int line = 1 ; line <= 10 ; line++)
{
for ( int star = 1 ; star <= line ; star++)
{
cout<<"*";
}
cout<<" \n ";
}
return 0;
} | ALGO | 0.976787 | 3.579608 |
5198d29f-f86f-4039-848a-4ec7218edf5b | shobhit-glitch/gfg | Easy/Pairwise swap elements of a linked list/pairwise-swap-elements-of-a-linked-list.cpp | //{ Driver Code Starts
#include <bits/stdc++.h>
using namespace std;
struct Node
{
int data;
struct Node* next;
Node(int x){
data = x;
next = NULL;
}
};
// } Driver Code Ends
/*
Pairwise swap a linked list
The input list will have at least one element
node is defined as
s... | ALGO | 0.999953 | 5.413856 |
897f8c0a-9bd9-4077-9c6a-567995f7b4d5 | guipleite/super-computing | busca_exaustiva.cpp | #include <iostream>
#include <cmath>
#include <iomanip>
#include <vector>
#include <chrono>
#include <tuple>
#include <sstream>
#include <string>
#include <omp.h>
std::tuple<std::vector<int>,int> escolhe_alunos(std::vector<std::vector<int>>& prefs, std::vector<int>& aluno_projeto, std::vector<int>& vagas, std::... | ALGO | 0.999967 | 4.336607 |
141e85fa-24b3-437b-8dd0-d8f6a53bf0d7 | teeraiser1/Practice-CPP | Pb/2/02-2-1.cpp | #include<iostream>
int main(void)
{
const int num = 12;
const int *ptr = #
const int* &pref = ptr;
std::cout<<num<<std::endl;
std::cout<<*ptr<<std::endl;
std::cout<<*pref<<std::endl;
} | TOOL | 0.912372 | 3.317636 |
758d7482-0179-45b4-90b0-4dfc0eac1329 | gilbertoalexsantos/judgesolutions | Solved/UVA/@UVA 12003 - Array Transformer/12003 - Array Transformer.cpp | //Author: Gilberto A. dos Santos
//Website: http://uva.onlinejudge.org/index.php?option=com_onlinejudge&Itemid=8&page=show_problem&problem=3154
#include <iostream>
#include <cstdio>
#include <cstdlib>
#include <vector>
#include <cmath>
#include <algorithm>
using namespace std;
typedef pair<int, int> ii;
const int MA... | ALGO | 0.999949 | 4.574027 |
545a880a-ff7e-4acd-8a6f-82414eaa4900 | chatwater/chatmelon-cpp-course | 第5章:数组/例5-8.cpp | #include <iostream>
using namespace std;
// 彩票摇奖
// 一维数组的应用
int main() {
int n, a[10], num[10] = {0};
cin >> n; // 输入彩票的数量
for (int i = 1; i <= 7; i++) {
cin >> a[i]; // 创建一个数组,存储彩票的号码
}
while (n--) {
int ans = 0;
for (int i = 1; i <= 7; i++) {
int x;
... | ALGO | 0.999823 | 3.818262 |
bf27fdb9-7523-4253-98ba-b5aaf3dc3747 | 113bommy/deepmind_codecontests_refine | cpp_gold_filter_file/cpp_train_7655_17.cpp | #include <bits/stdc++.h>
using namespace std;
int depth[200005];
int up[200005][25];
int father[200005];
int lca(int x, int y) {
if (depth[x] < depth[y]) swap(x, y);
int t = depth[x] - depth[y];
int i;
for (i = 0; i < 20; i++) {
if ((1 << i) & t) x = up[x][i];
}
for (i = 19; i >= 0; i--) {
if (up[x]... | ALGO | 0.999983 | 3.803514 |
d7f352bb-7a15-446b-bde5-9c9a46cffead | JangIn-40/Programmers | LV1/Number9_AdjacentCompartment/Number9_AdjacentCompartment.cpp | #include <string>
#include <vector>
using namespace std;
int solution(vector<vector<string>> board, int h, int w)
{
int answer = 0;
vector<pair<int, int>> directions = { {-1, 0}, {1, 0}, {0, -1}, {0, 1} };
string color = board[h][w];
for (auto dir : directions)
{
int dh = h + dir.first;... | ALGO | 0.999257 | 5.848605 |
c4f98693-39cf-417e-b196-e551c66a93f0 | s-m-arafat/online-judge-problems | AUSTPIC_Contest_01/I.cpp | //Auth:Shakil Mahmud Arafat -arft666, AUST, Dept. of EEE
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef vector<ll>vll;
typedef vector<int>vi;
typedef vector<vll>vvl;
typedef vector<vi>vvi;
// #define OJ
#define nl '\n'
#define get cin>>
#define imn INT_MIN
#define imx INT_MAX
//vectors
#de... | ALGO | 0.999924 | 4.069231 |
b3932f1b-0e59-4426-99ea-f7a0a26670a0 | npkhang99/Competitive-Programming | School/Sum.cpp | #include <stdio.h>
using namespace std;
const int N=10009;
int n, a[N]={}, k, b, c[2*N]={};
int main(){
// freopen("Sum.inp","r",stdin);
// freopen("Sum.out","w",stdout);
scanf("%d%d%d",&n,&k,&b);
for(int i=0; i<n; i++)
scanf("%d",&a[i]);
b = (b-1)%n;
long long ans = 0;
if(k<=n){
... | ALGO | 0.999975 | 3.218094 |
dd3cc935-5ca9-4db1-a34d-c0b85e4a0f71 | blatantBabbage/DsaCpp | arrayProblems/easy/reverseArray.cpp | //
// Created by Singh, Nitesh on 11/12/24.
//
#include<iostream>
using namespace std;
void reverseArray(int n, int a[])
{
int i = 0;
int j = n-1;
int temp = 0;
while(i<j)
{
temp = a[i];
a[i] = a[j];
a[j] = temp;
i++;
j--;
}
} | ALGO | 0.993807 | 4.126793 |
0dbe49c0-18f6-44ce-b733-8015d455c5c2 | langyanashish/Competitive-Programming | GTH.CPP | #include<bits/stdc++.h>
using namespace std;
int hash[30];
void zero()
{
for(int i=0;i<30;i++)
hash[i]=0;
}
int main()
{
//std::ios::sync_with_stdio(false);
int t;
cin>>t;
while(t--)
{
zero();
string a,b;
cin>>a>>b;
int count=0;
for(int i=0;i<b.length();i++)
hash[b[i]-'a']++;
int pos;
for(in... | ALGO | 0.999963 | 4.075614 |
07fa889f-888f-4960-8ffb-b0794a18c050 | Descanden/mobile | 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 |
3070896c-b190-43f8-806d-ed599bfd3064 | sahadat-11/CSES | Apple_Division.cpp | //In The Name of ALLAH
#include <bits/stdc++.h>
using namespace std;
#define int long long
vector<vector<int>> subsets(vector<int>& nums) {
int n = nums.size();
int sub_cnt = (1 << n); // (2^n);
vector < vector < int >> all_subsets;
for (int mask = 0; mask < sub_cnt - 1; mask++) {
vector < int > subset;
... | ALGO | 0.999959 | 4.165741 |
368e5717-e8b7-42a2-a095-4e201072bb26 | joeyjhg/AiV_VisionSW | opencv/sources/modules/stitching/src/stitcher.cpp | #include "precomp.hpp"
namespace cv {
#if __cplusplus >= 201103L || (defined(_MSC_VER) && _MSC_VER >= 1900/*MSVS 2015*/)
// Stitcher::ORIG_RESOL is initialized in stitching.hpp.
#else
const double Stitcher::ORIG_RESOL = -1.0;
#endif
Ptr<Stitcher> Stitcher::create(Mode mode)
{
Ptr<Stitcher> stitcher = makePtr<Sti... | TOOL | 0.855189 | 6.368211 |
cdc16022-87f8-4e45-83ec-302f2ae23c32 | arnabs542/LeetCode-26 | C++/0236-lowest-common-ancestor-of-a-binary-tree.cpp | // Tags: Tree Amazon
// Time: O(n)
// Space: O(h)
// Postorder traversal
class Solution {
public:
TreeNode* lowestCommonAncestor(TreeNode* root, TreeNode* p, TreeNode* q) {
if (!root || root == p || root == q)
return root;
TreeNode* left = lowestCommonAncestor(root->left, p, q);... | ALGO | 0.999981 | 6.676325 |
c41d797f-bd5e-45d0-b9ce-e0c32f24f12d | andrewaarestad/ode-system-fitting-with-boost-and-nlopt | boost_1_77_0/libs/sort/example/wstringsample.cpp | // See http://www.boost.org/libs/sort for library home page.
#include <boost/sort/spreadsort/string_sort.hpp>
#include <time.h>
#include <stdio.h>
#include <stdlib.h>
#include <algorithm>
#include <vector>
#include <iostream>
#include <fstream>
#include <string>
using std::wstring;
using namespace boost::sort::spread... | ALGO | 0.998253 | 4.635352 |
21f90cb2-07da-42d6-8e93-01cc4cf4a7bc | RazerRom/frameworks_av | media/libstagefright/codecs/amrnb/common/src/div_s.cpp | /*
Pathname: ./gsm-amr/c/src/div_s.c
------------------------------------------------------------------------------
REVISION HISTORY
Description: Created separate file for the div_s function. Sync'ed up
with the current template and fixed tabs.
Description: Making changes based on review meeting.
Des... | ALGO | 0.999753 | 5.700507 |
090b9f3f-16d7-4f11-82b5-24d487379e2b | KhushiKSalian/Hackeranks | ret.cpp | #include <cmath>
#include <cstdio>
#include <vector>
#include <iostream>
#include <algorithm>
using namespace std;
int main() {
int month,rent, days;
cin>>month;
cin>>rent;
cin>>days;
if(month>=1 && month<=12)
{
if((month>=4 && month<=6) || (month>=11 && month<=12))
cout<<(rent ... | ALGO | 0.999331 | 3.78932 |
840e8000-50fe-41fa-a2f4-e237521335af | luqmanarifin/cp | 0-unclassified/24.cpp | #include <bits/stdc++.h>
typedef long long LL;
typedef double DB;
#define sf scanf
#define pf printf
#define mp make_pair
#define nl printf("\n")
#define FOR(i,a,b) for(i = a; i <= b; ++i)
#define FORD(i,a,b) for(i = a; i >= b; --i)
#define FORS(i,n) for(i = 0; i < n; ++i)
#define FORM(i,n) for(i = n - 1; i >= 0; --... | ALGO | 0.999866 | 3.210797 |
e122e36f-15ac-4ac2-a21c-7960debbc00d | ishandutta2007/codeforces | khuepr123/normal/1433/E.cpp | #include<bits/stdc++.h>
using namespace std;
#define int long long
#define pb push_back
#define fi first
#define se second
#define fir fi.fi
#define sec fi.se
#define endl "\n"
#define PI 3.141592653589793238462643383279502884
#define ll long long
const ll mod = 1e9 + 7;
const int maxN = 100005;
const ll oo = 1e18 + 7... | ALGO | 0.999985 | 4.589403 |
79541bcc-2309-4852-98af-008e8db768fa | manykits/PHOENIXEngine | PHOENIX/PX2Engine/Mathematics/PX2ContSphere3.cpp | // PX2ContSphere3.cpp
#include "PX2ContSphere3.hpp"
namespace PX2
{
//----------------------------------------------------------------------------
template <typename Real>
Sphere3<Real> ContSphereOfAABB (int numPoints, const Vector3<Real>* points)
{
Vector3<Real> minExtreme, maxExtreme;
Vector3<Real>::Comput... | ALGO | 0.998454 | 7.086693 |
9beb4b67-f6ec-44fb-9e9c-185d2f336c4d | haunt98/HCMUS-Lectures | 1_NMLT/ThucHanh-T6/MangSoThuc/MangSoThuc.cpp | #include "MangSoThuc.h"
void nhap_mang(float arr[], int &len_mang) // Bai 129
{
int i;
do {
printf("Nhap do dai mang: ");
scanf("%d", &len_mang);
} while (len_mang < 1);
for (i = 0; i < len_mang; ++i) {
printf("Nhap gia tri mang tai vi tri thu %d: ", i);
scanf("%f", &arr[i]);
}
}
void xuat_mang(float ar... | ALGO | 0.999391 | 3.096715 |
24721b53-4ac6-4de8-b421-ffb84e0335b0 | Hsue66/Algo | BOJ/n1707.cpp | #include<cstdio>
#include<queue>
#include<vector>
//#include<iostream>
#define MAX 20001
using namespace std;
int V;
vector<int> G[MAX];
queue<pair<int,int> > Q;
int check[MAX];
int flag;
void bfs(){
while(!Q.empty()){
int now = Q.front().first;
int before = Q.front().second;
Q.pop();
for(auto i=0; i<G[now]... | ALGO | 0.999966 | 4.113972 |
f9579f0e-f697-44d2-8b5b-47bd32f295e0 | HandianYang/marslite_simulation_ws | src/Libraries/eigen/doc/examples/Tutorial_ReductionsVisitorsBroadcasting_visitors.cpp | #include <iostream>
#include <Eigen/Dense>
using namespace std;
using namespace Eigen;
int main()
{
Eigen::MatrixXf m(2,2);
m << 1, 2,
3, 4;
//get location of maximum
MatrixXf::Index maxRow, maxCol;
float max = m.maxCoeff(&maxRow, &maxCol);
//get location of minimum
MatrixXf::Index minRow, m... | ALGO | 0.999609 | 4.008351 |
34b4733a-15df-4f2d-9601-4ec7e0127b45 | vinayak78/DSA-with-Cpp | array/array question/q8.cpp | // Duplicate is presence
#include <iostream>
using namespace std;
int main()
{
int arr[5] = {1, 2, 2, 2, 3};
int occ = 0;
int checcking_element;
cout << "Value : ";
cin >> checcking_element;
for (int i = 0; i < 5; i++)
{
if (arr[i] == checcking_element)
{
occ++;
... | ALGO | 0.999379 | 3.550259 |
9890a876-7f63-4a46-ae8e-11550d8cbcb9 | ayerhssb/DSA-PREP | Max Consecutive Ones III.cpp | #include<bits/stdc++.h>
using namespace std;
class solution{
public:
int findMaxOnes(vector<int>& arr, int k) {
int l=0,r=0, zero=0;
int n=arr.size(), maxLen=0;
while(r<n){
if(arr[r]==0){
zero++;
}
while(zero>k){
if(arr... | ALGO | 0.999875 | 5.329448 |
01f8e616-6240-4565-8e8b-346a5983d5f9 | avisekpatra/DSA | 1.DSA Abdul Bari Sir/22 GRAPH/2_DFS.cpp | #include<iostream>
using namespace std;
//glaobally declaring the graph
//n=7 ,no of the vertex
int A[8][8];
//globally declaring the visited array as we will be using a recursive function so if we declare it inside then it will reasig every time on each function call
int visited[8]={0}; //initially marked with 0 as... | ALGO | 0.999899 | 4.908433 |
ef04f3ce-5a8a-4938-80a0-27706b27a77a | Eteroclia/Project_paths_most_walked_UE | Source/Paths_most_walked/Calibration.cpp | #include "Calibration.h"
#include "opencv2/opencv.hpp"
#include <opencv2/highgui/highgui.hpp>
#include "iostream"
#include <string>
#include <opencv2/calib3d/calib3d.hpp>
#include <opencv2/imgproc/imgproc.hpp>
#include <stdio.h>
#include "opencv2/imgcodecs.hpp"
#include <iomanip>
#include "CVImage.h"
#include <stdexcep... | TOOL | 0.913109 | 6.056961 |
a9db0b63-6c2c-493e-9a18-812047cbfb5d | sinian666/code_102_8 | cpp_副本42/chapter_searching/linear_search.cpp | /**
* File: linear_search.cpp
* Created Time: 2022-11-25
* Author: Krahets (<EMAIL>)
*/
#include "../utils/common.hpp"
/* 线性查找(数组) */
int linearSearchArray(vector<int> &nums, int target) {
// 遍历数组
for (int i = 0; i < nums.size(); i++) {
// 找到目标元素,返回其索引
if (nums[i] == target)
re... | ALGO | 0.999634 | 5.586348 |
9ba9b5e7-a19f-4d08-a301-49655bcb6f9a | Sumendra2906/DS-ALGO | 31-40/34 Trees Challenges/is_Balanced.cpp | #include <iostream>
#include <queue>
using namespace std;
class node
{
public:
int data;
node *left;
node *right;
node(int d)
{
data = d;
left = NULL;
right = NULL;
}
};
node *buildTree()
{
int d;
bool ex;
cin >> d;
cin >> ex;
if (!ex)
{
... | ALGO | 0.999975 | 4.036743 |
53f78440-9908-476b-8117-68f1665a63e8 | Ahhzsthl/RetestCode | unit7/7.3.cpp | #include <iostream>
#include <cstdio>
#include <algorithm>
using namespace std;
const int MAXN = 1e5 + 10;
int length[MAXN];
int main() {
//物品放入箱子问题,每个箱子最多放两个物品,每个箱子最多可放长度为l的物品
int n, l;
scanf("%d %d", &n, &l);
for (int i = 0; i < n; ++i) {
scanf("%d", &length[i]);
}
sort(length, len... | ALGO | 0.999993 | 3.605203 |
cfb8edf9-e1b1-4cd7-9059-057891f7510c | Stachu72/Cpp_Primer-Solutions | Chapter 1-Getting Started/ex 11/main.cpp | #include <iostream>
int main()
{
std::cout << "Enter two integers: " << std::endl;
int num1 = 0 , num2 = 0;
std::cin >> num1 >> num2;
while(num1 < num2-1)
std::cout << ++num1 << std::endl;
return 0;
}
| TOOL | 0.98933 | 3.915323 |
86599f41-aee0-4f86-b4c2-f61850e99987 | goyalyash82/Leetcode | 1752-check-if-array-is-sorted-and-rotated/1752-check-if-array-is-sorted-and-rotated.cpp | class Solution {
public:
bool check(vector<int>& nums) {
int n= nums.size();
int count=0;
for(int i=0;i<n;i++){
if(nums[i]> nums[(i+1)%n]){
count++;
}
if(count>1){
return false;
}
}
return true;... | ALGO | 0.99999 | 5.307711 |
ad326e73-bc25-45fa-a2ab-ff7ba89ed1b9 | AmrARaouf/algorithm-detection | graph-source-code/369-C/5301257.cpp | //Language: GNU C++
#include <iostream>
#include <vector>
#include <map>
#include <set>
#include <algorithm>
#include <string>
#include <stdio.h>
#include <functional>
#include <cstdlib>
#include <stack>
#include <cmath>
#include <queue>
#include <cstdio>
#include <stdlib.h>
#include <cstdlib>
#include <cstring>
#incl... | ALGO | 0.999991 | 3.93063 |
decd9c5e-a572-4f87-ba36-f4a81bf2f90c | 113bommy/deepmind_codecontests_refine | cpp_source_filter_file/cpp_train_254_21.cpp | #include <bits/stdc++.h>
using namespace std;
template <typename S, typename T>
ostream& operator<<(ostream& out, pair<S, T> const& p) {
out << '(' << p.first << ", " << p.second << ')';
return out;
}
template <typename T>
ostream& operator<<(ostream& out, vector<T> const& v) {
long long l = v.size();
for (long... | ALGO | 0.999973 | 3.714863 |
d0716e58-12ea-410c-9877-676ba344efb7 | 113bommy/deepmind_codecontests_refine | cpp_source_filter_file/cpp_train_8650_48.cpp | #include <bits/stdc++.h>
#pragma GCC optimize("O3")
using namespace std;
template <class c>
struct rge {
c h, n;
};
template <class c>
rge<c> range(c h, c n) {
return rge<c>{h, n};
}
template <class c, class F>
struct rgm {
c h, n;
F f;
};
template <class c, class F>
rgm<c, F> map_range(c b, c e, F f) {
retur... | ALGO | 0.99979 | 3.741876 |
31be2be2-7a9d-4475-8cdf-58a25e8fd8a3 | AshharImam/Pedesterian-Counter | dlib-19.20/tools/python/src/rectangles.cpp | #include <dlib/python.h>
#include <dlib/geometry.h>
#include <pybind11/stl_bind.h>
#include "indexing.h"
#include "opaque_types.h"
#include <dlib/filtering.h>
using namespace dlib;
using namespace std;
namespace py = pybind11;
// ---------------------------------------------------------------------------------------... | TOOL | 0.938877 | 6.01633 |
0651c038-0efd-43d5-9b9d-9e6325d14f27 | WizCoderr/Codes | Recursion/recursion.cpp | #include <iostream>
void fact(int num) {
if (num == 1) {
std::cout << num << std::endl;
return;
}
std::cout << num << std::endl;
fact(num - 1);
}
int main() {
fact(5);
return 0;
}
| ALGO | 0.999886 | 6.006421 |
bb53aa02-653f-49f7-b5cf-6cb2964d3bea | thumun/WireSculpt | libigl/include/igl/cotmatrix_entries.cpp | #include "verbose.h"
template <typename DerivedV, typename DerivedF, typename DerivedC>
IGL_INLINE void igl::cotmatrix_entries(
const Eigen::MatrixBase<DerivedV>& V,
const Eigen::MatrixBase<DerivedF>& F,
Eigen::PlainObjectBase<DerivedC>& C)
{
using namespace std;
using namespace Eigen;
// simplex size (3: ... | ALGO | 0.999263 | 5.748174 |
6cd888cb-3c14-4d39-ade2-659e2b7c0528 | tarunagarwal99/sde-sheet | occuranceOfString.cpp | #include<iostream>
using namespace std;
int main() {
string str1,str2;
cin>>str1>>str2;
int n=str1.length();
int m=str2.length();
int count=0;
for (int i = 0; i < n; i++)
{
if(str1.substr(i,m)==str2){
count++;
}
}
cout<<count;
// return 0;
} | ALGO | 0.999847 | 3.724719 |
3225023e-44ae-4ca2-8879-7586c5499ab9 | Sumant3086/LeetCode-Solution | 557. Reverse Words in a String III.cpp | // 557. Reverse Words in a String III
// Solved
// Easy
// Topics
// Companies
// Given a string s, reverse the order of characters in each word within a sentence while still preserving whitespace and initial word order.
// Example 1:
// Input: s = "Let's take LeetCode contest"
// Output: "s'teL ekat edoCteeL tsetnoc... | ALGO | 0.999959 | 6.14397 |
fc9f00f1-661b-4359-8d46-0fc5fcd3bb5a | sethtroisi/cado-nfs | sieve/strategies/utils_st/tab_fm.cpp | #include "cado.h"
#include "portability.h"
#include "utils.h"
#include "tab_fm.h"
#include <float.h>
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
#include <stdbool.h>
#include "facul.hpp"
static const double EPSILON_DBL = 0.000001;
tabular_fm_t *tabular_fm_create(void)
{
tabular_fm_t *t = (tabular_f... | ALGO | 0.959627 | 4.399402 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.