uuid string | repo_name string | relative_path string | content string | category string | algo_rel_score float64 | quality_score float64 |
|---|---|---|---|---|---|---|
91361761-71d7-4026-bc2e-008723940d08 | jpdotcom/comp_prog-archive | Auto_Upload_Codeforces/CodeTON_Round_1_Div_1_Div_2_Rated_Prizes/E_Equal_Tree_Sums.cpp | #include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
#define pb push_back
#define FOR(a) for (int i=0;i<a;i++)
#define mp(a,b) make_pair(a,b)
typedef std::vector<int> vi;
typedef std::pair<long long,long long> pi;
typedef long long ll;
#define F first
#define S second ... | ALGO | 0.999638 | 5.364959 |
0aadc229-9abe-4fe0-8ca6-9abc82ebaaa2 | alexandraback/datacollection | solutions_5648941810974720_1/C++/ulna/1.cpp | #include <iostream>
#include <iomanip>
#include <sstream>
#include <fstream>
#include <cstdio>
#include <algorithm>
#include <deque>
#include <vector>
#include <map>
#include <cmath>
#include <cstdlib>
#include <set>
#include <queue>
#include <stack>
#include <string>
#include <cstring>
#include <climits>
#include <cct... | ALGO | 0.99979 | 5.271366 |
558d88d0-09bf-4d13-a940-fd3f873af5dc | SAYAN-DEV-NATH/Code-Chef | Spell_Splice.cpp | // Creator: SAYAN-DEV-NATH
// Created: 2024-06-05 22:12:50
#include <bits/stdc++.h>
using namespace std;
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
using namespace __gnu_pbds;
template <typename T>
using pbds = tree<T, null_type, less<T>, rb_tree_tag, tree_order_statistics_node_update... | ALGO | 0.999957 | 5.660606 |
6974ce51-368c-47f1-93d1-4e1ecfd6414d | Chasokaru/Universiteto-Projektai-University-Projects | 3.cpp | /* 1.7. Sesija
#include <bits/stdc++.h>
using namespace std;
class stud
{
private:
double a, b, c, d, e;
double vid;
public:
void ivedimas()
{
cin >> a >> b >> c >> d >> e;
}
void vidur()
{
vid = ((a+b+c+d+e)*1.0/5);
}
double get_plot()
{
return vid;
}
};
i... | ALGO | 0.995878 | 3.251089 |
ab45ff81-4aaa-42f4-9869-06a5560e816c | SKT33/arducopter-34_precland_SKT | libraries/AP_AHRS/AP_AHRS_DCM.cpp | /// -*- tab-width: 4; Mode: C++; c-basic-offset: 4; indent-tabs-mode: nil -*-
#include "AP_AHRS.h"
#include <AP_HAL/AP_HAL.h>
extern const AP_HAL::HAL& hal;
// this is the speed in m/s above which we first get a yaw lock with
// the GPS
#define GPS_SPEED_MIN 3
// the limit (in degrees/second) beyond which we stop i... | TOOL | 0.914327 | 5.231747 |
a4d37c5a-acec-418a-94bb-8ed1eca85132 | Raunak-Bhuyan/Leetcode | Binary_Search.cpp | class Solution{
public:
int search(vector<int>& nums,int target){
int n=nums.size();
int low = 0, high = n-1;
while(low <= high){
int mid = low + (high - low)/2;
if(nums[mid] == target){
return i;
}else if(target > nums[... | ALGO | 0.999898 | 6.044338 |
8e4e95fa-2970-4a94-8fde-0b05a5605857 | mattemario1/cplus | Labb/datastructures.cpp | #include <iostream>
#include <vector>
#include <ctime>
using namespace std;
struct Participant
{
string firstName;
string lastName;
string clubName;
};
void printStartList(const vector<Participant> participants)
{
cout << "\n";
cout << "Startlista:" << endl;
cout << "Startnummer Förnamn Efter... | TOOL | 0.85994 | 5.236884 |
95cce540-9f18-4193-a07f-c16bbc351acf | malasiot/maplite | src/3rdparty/vcglib/apps/sample/aabb_binary_tree/aabb_binary_tree.cpp | #include <stdio.h>
#include<vcg/complex/complex.h>
#include<vcg/simplex/face/distance.h>
#include<vcg/simplex/face/component_ep.h>
#include <vcg/complex/algorithms/create/platonic.h>
#include <vcg/complex/algorithms/update/normal.h>
#include <vcg/complex/algorithms/update/component_ep.h>
#include <vcg/complex/algorith... | TEST | 0.986059 | 5.911983 |
1ad28fff-e946-42a9-b1aa-a7b8711becb1 | ankit13022/codeforces | 1006A.cpp | #include <bits/stdc++.h>
#include <vector>
#include <iostream>
#include <cmath>
#include <string>
#include <bitset>
#include <cstring>
#include <algorithm>
#include <numeric>
#include <unordered_set>
#include <map>
#include <unordered_map>
using namespace std;
#define ll long long
#define mp make_pair
#define um unor... | ALGO | 0.999418 | 3.764308 |
459ac654-8561-4048-8532-ec04f240aedd | yckoincgu/C_Programming | 112/0927/0927_7.cpp | #include<stdio.h>
int main(){
int qty,money;
printf("Input qty:");
scanf("%d",&qty);
if(qty<=230){
money=qty*3.2; }
else if(qty<=450){
money=qty*4.8;}
else{
money=qty*6; }
printf("%d",money);
return 0;
}
| ALGO | 0.995913 | 3.528216 |
48997197-bacb-4e50-b371-735612d5e39e | ishandutta2007/codeforces | radewoosh/normal/1290/C.cpp | //~ while (clock()<=69*CLOCKS_PER_SEC)
//~ #pragma comment(linker, "/stack:200000000")
#pragma GCC optimize("O3")
//~ #pragma GCC target ("avx2")
//~ #pragma GCC optimize("Ofast")
//~ #pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native")
//~ #pragma GCC optimize("unroll-loops")
#include <bits/st... | ALGO | 0.999945 | 4.034161 |
b29cf473-f053-49bf-ae8b-917d2ff21cb9 | janani23-3/CSA0260-C-Programming-for-Online-PDF-Editor | Area of triangle.cpp | #include<stdio.h>
#include<conio.h>
int main()
{
float h,b,area;
h= 2;
b= 2;
area = (h*b)/2;
printf("Area of Triangle is: %f",area);
return 0;
}
| ALGO | 0.989272 | 3.238032 |
8750d670-31f3-4460-838e-051672ee0653 | suppertails66/wdtools | src/vaydecmp.cpp | #include <iostream>
#include <fstream>
#include <string>
#include <cstring>
// maximum size of decompressed data
const static int decompressionBufferSize = 0x20000;
using namespace std;
namespace SignednessTypes {
enum SignednessType {
nosign = 0,
sign = 1
};
};
namespace EndiannessTypes {
enum Endian... | TOOL | 0.929782 | 4.786338 |
7b7ed5a6-7379-454a-95f4-82b19f2bf076 | dslab-epfl/asap | lib/CodeGen/ShrinkWrap.cpp | #define DEBUG_TYPE "shrink-wrap"
using namespace llvm;
STATISTIC(NumFunc, "Number of functions");
STATISTIC(NumCandidates, "Number of shrink-wrapping candidates");
STATISTIC(NumCandidatesDropped,
"Number of shrink-wrapping candidates dropped because of frequency");
namespace {
/// \brief Class to determine... | ALGO | 0.985251 | 7.769324 |
7f8942b9-3780-42c4-83f4-1b4fadba5235 | KohitaR/workspace | SentenceClassifier/src/utils.cpp | /*
* utils.cpp
*
* Created on: 2016/09/03
* Author: ryosuke-k
*/
#include <fstream>
#include <iostream>
#include <string>
#include <sstream>
#include <vector>
#include <algorithm>
#include <map>
#include <regex>
#include "utils.h"
using namespace std;
vector<string> split(string &str, char sep) {
ve... | TOOL | 0.945877 | 5.280941 |
cf4b3802-628d-45db-aee1-a3614db4919d | aanandrautt/OpenSees-for-fire | SRC/analysis/fe_ele/penalty/PenaltySP_FE.cpp | // $Revision: 1.8 $
// $Date: 2009-10-13 21:13:01 $
// $Source: /usr/local/cvs/OpenSees/SRC/analysis/fe_ele/penalty/PenaltySP_FE.cpp,v $
// File: ~/analysis/fe_ele/penalty/PenaltySP_FE.C
//
// Written: fmk
// Created: 11/96
// Revision: A
//
// Purpose: This file contains the code for implementing the methods
// of t... | ALGO | 0.994933 | 6.140725 |
b95ca3f0-de3c-46b9-b726-c912fb8af4d3 | samtupy/nvgt | ASAddon/src/scriptstdstring_utils.cpp | #include <assert.h>
#include "scriptstdstring.h"
#include "scriptarray.h"
#include <stdio.h>
#include <string.h>
#include <algorithm>
using namespace std;
BEGIN_AS_NAMESPACE
static asITypeInfo *StringArrayType = NULL;
// This function takes an input string and splits it into parts by looking
// for a specified delimi... | TOOL | 0.88096 | 5.83013 |
bd288b4d-0ec9-4988-8187-fb56006e4e7f | CryptoGerm/competitive-programming | codechef/compete/august-lunchtime-2021/MXEVNSUB.cpp | #include <iostream>
using namespace std;
int main() {
int t, i;
cin >> t;
while (t--) {
int n;
cin >> n;
int sum = (n*(n+1))/2;
if (sum%2==0) {
cout << n << endl;
} else {
cout << n-1 << endl;
}
}
return 0;
} | ALGO | 0.999747 | 5.195048 |
b6442883-f053-47a4-8f21-0a70f11118df | Santosh276124/LeetCode-Solutions | Floyd Warshall - GFG/floyd-warshall.cpp | //{ Driver Code Starts
//Initial template for C++
#include<bits/stdc++.h>
using namespace std;
// } Driver Code Ends
//User function template for C++
class Solution {
public:
void shortest_distance(vector<vector<int>>&mat){
// Code here
int n = mat.size();
for(int i = 0; i < n; i++)
... | ALGO | 0.999868 | 5.913193 |
d29857f6-40b1-4dd1-85aa-8be65f61be9f | kamrulhasanrony/UVA-Online-Judge-Solutions | 10793.cpp | /*
10793 - The Orc Attack
*/
#include<bits/stdc++.h>
using namespace std;
int main()
{
int t,l,d,tc=0;
cin>>t;
while(t--)
{
cin>>l>>d;
vector<vector<int>>graph(l,vector<int>(l,INT_MAX));
for(int i=0; i<l; i++)
{
graph[i][i]=0;
}
for(int i=0; ... | ALGO | 0.999882 | 4.245255 |
f491a272-e2eb-4b4a-95c2-767be926cfb9 | AndHager/SysCallStubber | llvm-project/libcxx/test/std/containers/sequences/vector/vector.modifiers/insert_iter_size_value.pass.cpp | // <vector>
// iterator insert(const_iterator position, size_type n, const value_type& x);
#include <vector>
#include <cassert>
#include <cstddef>
#include "test_macros.h"
#include "test_allocator.h"
#include "min_allocator.h"
#include "asan_testing.h"
int main(int, char**)
{
{
std::vector<int> v(100);
... | TEST | 0.904393 | 4.674482 |
91334b02-4cda-4c5a-9455-5295a5469287 | junewaves/contests | Codeforces/2020/Global_8/pD.cpp | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
int main() {
ios::sync_with_stdio(false);
cin.tie(0);
int n;
cin >> n;
vector<int> b(20, 0);
for (int i = 0, t; i < n; i++) {
cin >> t;
int x = 0;
while (t) {
b[x++] += (t & 1);
t ... | ALGO | 0.999929 | 4.642881 |
dd6b9c32-3134-4f76-9ccb-92230478ab92 | Szecsiadam1/hazi-part-2 | hazi_6/main.cpp | #include <iostream>
#include <string>
using namespace std;
int main()
{
cout << "Egy szo=";
string str1;
cin >> str1;
int length=str1.length(), k;
string forgatottszo;
cout << "Hanyszor akarjuk jobbra forditani a szot=";
cin >> k;
if(k<=5){
k=k%length;
forgatottszo = str1.subs... | ALGO | 0.997335 | 3.742866 |
df927f92-77cd-420a-8b18-a573783f2c76 | QuhiQuhihi/algorithm_test | solutiion/12/2.cpp | #include <bits/stdc++.h>
using namespace std;
string str;
vector<char> result;
int value = 0;
int main(void) {
cin >> str;
// 문자를 하나씩 확인하며
for (int i = 0; i < str.size(); i++) {
// 알파벳인 경우 결과 리스트에 삽입
if (isalpha(str[i])) {
result.push_back(str[i]);
}
// 숫자는 따로... | ALGO | 0.999326 | 5.88359 |
88bb5cb1-242a-4585-889d-c7f849c1ebcb | W41T3D3V1L/META-HACKER-CUP-2023 | Round-1/sum_41_ch2/sum_41_ch2.cpp | #include <iostream>
#include <numeric>
#include <vector>
using namespace std;
int curr_sum, best_len;
vector<int> divisors, curr, best_ans;
int maxsteps = 0;
int steps = 0;
void rec(int P) {
steps++;
if (P == 1) {
int len = curr.size() + (41 - curr_sum);
if (len < best_len) {
best_len = len;
... | ALGO | 0.999786 | 4.62994 |
dcf2cde5-fdb1-4987-b51a-9e8f02fd5b8d | petemus/BAEKJOON | Project1/CircularLinkedList.cpp | // ḮƮ
// head end θ Ŵ
#include<iostream>
using namespace std;
template <typename E>
struct node
{
node(E d) : data(d) {}
node() {}
E data;
node<E>* next;
node<E>* prev;
};
template <typename E>
class CLinkedList {
private:
public:
int size;
node<E>* endnode;
node<E>* headnode;
//
CLinkedList() {
he... | ALGO | 0.999562 | 3.668072 |
56da39b7-252c-480e-ae2e-ec3709774bb7 | Xilinx/Vitis_Libraries | data_compression/L1/tests/gzipc/gzip_compress_test.cpp | #include <ap_int.h>
#include <assert.h>
#include <stdint.h>
#include <stdio.h>
#include <stdlib.h>
#include <fstream>
#include <iostream>
#include <string>
#include "cmdlineparser.h"
#include "kernel_stream_utils.hpp"
#include "ap_axi_sdata.h"
#include "hls_stream.h"
#include "zlib_compress.hpp"
#define GMEM_DWIDTH 64... | ALGO | 0.875512 | 4.86844 |
683282ca-6af5-4551-9d8c-06277e68eb72 | ishandutta2007/codeforces | neoorgano/normal/1416/A.cpp | #include <bits/stdc++.h>
using namespace std;
const int MAXN = 4e5;
int arr[MAXN], last[MAXN], len[MAXN];
bool cmp(int a, int b) {
return len[a] < len[b];
}
main() {
int t;
cin >> t;
while (t--) {
int n;
cin >> n;
fill(last, last + n, -1);
fill(len, len + n, -1);
... | ALGO | 0.999903 | 4.484066 |
8dbd7379-fc77-4f5b-858a-d329eb38d756 | pdeitel/CPlusPlusHowToProgram11e | ch03/ex03_12.cpp | // ex03_12.cpp
#include <iostream>
using namespace std;
int main() {
int row{10};
while (row >= 1) {
int column{1};
while (column <= 10) {
cout << (row % 2 == 1 ? "<" : ">");
++column;
}
--row;
cout << "\n";
}
}
| ALGO | 0.987714 | 3.585532 |
f836dac6-92d0-43ac-beb0-15481286a042 | Rohxn16/CP | Old/Contests/Hackerearth/jiyas_sequence.cpp | #include <bits/stdc++.h>
using namespace std;
int main(int argc, char const *argv[])
{
int t;
cin >> t;
while(t--){
int n;
cin >> n;
long long prod = 1;
while(n--){
int num;
cin >> num;
prod = prod * num;
}
int lsd = prod % 10;
if(lsd == 2 || lsd == 3 || lsd == 5){
cout << "YES\n";
}else... | ALGO | 0.999718 | 4.521636 |
f5b17585-54cd-4899-a70e-f9978da352a1 | umar24nov/Decode-DSA-in-CPP | LinkedList/LinkedList_Class.cpp | #include <iostream>
using namespace std;
class Node{
public:
int val;
Node* next;
Node(int val){
this->val = val;
this->next = NULL;
}
};
class LinkedList{
public:
Node* head;
Node* tail;
int size;
LinkedList(){
head = tail = NULL;
size = 0;
}
voi... | ALGO | 0.997871 | 4.50089 |
cc5415a1-c242-4654-9509-cb4e4d0628ac | 1998factorial/comp4128 | problems/wk3/F.cpp | #include <iostream>
#include <vector>
#include <queue>
#include <algorithm>
using namespace std;
typedef long long ll;
const int maxn = 1e5 + 10;
const ll inf = 1ll << 50;
int N , Q , s;
int cnt;
bool seen[maxn * 8];
struct edge{
int to;
ll w;
edge(int tt , ll ww){
to = tt;
w = ww;
}
};
vector<edge>... | ALGO | 0.999769 | 4.048872 |
1b4f7115-fd1c-41f0-870c-46e4ee07c31a | imharsh94/ALGO-DS | cows.cpp | #include<bits/stdc++.h>
using namespace std;
int N,C;
int arr[100010];
int F(int x)
{
int cows=1, idx=0,i=1;
while(i<N)
{
if(arr[i] - arr[idx] >= x)
{
cows++;
idx = i;
if(cows == C)return 1;
}
i++;
}
return 0;
}
int bs(int lo,int hi)
{
int mid,max=-1;
while(lo < hi)... | ALGO | 0.999996 | 3.948277 |
3c51fb9b-b9f2-40a6-90cb-3f3c75eabbb4 | harsh123-baba/DSA | code in c/127_evaluate the postfix expression.cpp | #include<stdio.h>
#include<iostream>
#include<strings.h>
using namespace std;
struct Node{
int data;
struct Node *next;
}*top=NULL;
void push(int x){
struct Node *t;
t = new Node;
if(t== NULL){
cout<<"Stack overflow";
}
else{
t->data = x;
t->next = top;
top = t;
}
}
char pop(){
struct Node *t;
in... | ALGO | 0.999934 | 3.983022 |
228271fe-d382-4baf-bbfe-9a7480edf963 | sweethoneybee/AlgorithmStudy | AlgorithmStudy/개인/월코테2문제2.cpp | //
// 월코테2문제2.cpp
// AlgorithmStudy
//
// Created by 정성훈 on 2021/05/13.
//
#include <string>
#include <vector>
#include <cmath>
using namespace std;
int countRightBit(long long n) {
int cnt = 0;
while(n) {
if (n & 1 == 1) cnt += 1;
else break;
n = n >> 1;
}
return cnt;
}
v... | ALGO | 0.999977 | 5.146195 |
70603ba4-d762-42f9-9603-92c524e8d944 | ishandutta2007/codeforces | wygzgyw/normal/1499/A.cpp | #include <bits/stdc++.h>
using namespace std;
template <typename T> void read(T &t) {
t=0; char ch=getchar(); int f=1;
while (ch<'0'||ch>'9') { if (ch=='-') f=-1; ch=getchar(); }
do { (t*=10)+=ch-'0'; ch=getchar(); } while ('0'<=ch&&ch<='9'); t*=f;
}
int T,n,k1,k2,w,b;
bool check(int x,int y,int a) {
for (int i=0;i... | ALGO | 0.998738 | 3.367449 |
825946cf-67ec-4124-94d2-a8b60c33dbfb | gab-borges/atcoder | problems/ABC241D.cpp | #include <bits/stdc++.h>
using namespace std;
typedef vector<int> vi;
typedef long long ll;
int main() {
ios_base::sync_with_stdio(0);
cin.tie(0);
int q;
cin >> q;
multiset<ll> A;
while (q--) {
int n;
cin >> n;
ll x;
cin >> x;
if (n == 1) {
A.insert(x);
}
else if (n == 2) {
int k;
ci... | ALGO | 0.999777 | 4.126355 |
c71e8693-9767-4167-9fdf-d28c8a5340ed | TomFrank/LeetCode | 90.cpp | #include "./lttools.cpp"
class Solution {
public:
vector<vector<int>> subsetsWithDup(const vector<int>& nums) {
int n=nums.size();
vector<vector<int>> res;
for (int i=0; i<(1<<n); ++i) {
vector<int> t;
for (int j=0; j<n; ++j) if ((i>>j)&1)
t.push_back(nums[j]);
sort(t.begin(), t.end());
res.push... | ALGO | 0.999956 | 5.546063 |
725c65f1-8a04-46c3-a943-a4ccf00b6993 | jki14/competitive-programming | 2013/Codeforces/div1/176/gueB.cpp | #include<iostream>
#include<sstream>
#include<cstdio>
#include<cstdlib>
#include<cstring>
#include<cmath>
#include<ctime>
#include<climits>
#include<algorithm>
#include<vector>
#include<string>
#include<queue>
#include<list>
#include<bitset>
#include<set>
#include<map>
#include<functional>
#include<numeric>
#include<ut... | ALGO | 0.999842 | 3.593743 |
c0cb39a2-721b-4683-b9bb-381b7cce0cf4 | JuliusIsPerfect/leetcode | linkedlist/82.cpp | #include <iostream>
struct ListNode {
int val;
ListNode *next;
ListNode() : val(0), next(nullptr) {}
ListNode(int x) : val(x), next(nullptr) {}
ListNode(int x, ListNode *next) : val(x), next(next) {}
};
class Solution {
public:
ListNode* deleteDuplicates(ListNode* head) {
if (!head || ... | ALGO | 0.999909 | 5.923338 |
70e942bc-1bbd-4bec-9808-65da898d062a | Randowlh/Project_ACM_2021 | code/competition/Educational Codeforces Round 93/2.cpp | #include <bits/stdc++.h>
#pragma GCC optimize(2)
using namespace std;
const int inf = 0x7FFFFFFF;
typedef long long ll;
typedef double db;
typedef long double ld;
template<class T>inline void MAX(T &x,T y){if(y>x)x=y;}
template<class T>inline void MIN(T &x,T y){if(y<x)x=y;}
template<class T>inline void rd(T &x){
x=... | ALGO | 0.999982 | 4.250008 |
74ead16c-7f2b-4f39-ac47-9b11a5e298c7 | GirishT25/leetcode_Problems | Vectors.cpp | #include<iostream>
#include<vector>
using namespace std ;
int main(){
vector<int> a;
a.push_back(10);
a.emplace_back(20);
cout<<a[0]<<" "<<a[1];
cout<<endl;
vector<int> v(5 ,20);
for(int i = 0 ; i < 5 ; i++){
cout<<v[i]<<" ";
}
cout<<endl;
// v.pop_back();
cout<<endl;
// for(int i = 0 ; i < 5 ;... | TOOL | 0.941094 | 3.117924 |
bf0c2be7-1309-4e5d-b604-4992f677c941 | UnendingGlory/daily_leetcode | [1] 合集/剑指offer_C++/28-对称的二叉树.cpp | #include "header.h"
// 判断一个二叉树是否和其镜像相同
// Solution1: 层序遍历然后判断每一层是否对称
// 注意,这里层序遍历需要考虑空结点
class Solution {
public:
bool isSymmetric(TreeNode* root) {
if (root == nullptr) return true;
queue<TreeNode *> q;
auto emptyNode = new TreeNode(INT_MAX);
q.push(root);
while(!q.empty())... | ALGO | 0.999939 | 5.68002 |
2c2554ce-fba6-4fc8-9e29-280cb4a6e64a | rumdien113/Algorithm | CODEFORCES/Div4_928/A.cpp | #include<bits/stdc++.h>
using namespace std;
#define ll long long
#define pb push_back
#define pf push_front
#define db long double
#define st first
#define nd second
#define fast ios_base::sync_with_stdio(false);cout.tie(NULL);cin.tie(NULL);
#define all(x) (x).begin(),(x).end()
#define rall(x) (x).rbegin(),(x).rend()
... | ALGO | 0.999938 | 5.024902 |
5b06f4ab-e7f5-4021-a68b-716275023888 | GuacheSuede/MSSubmission1234567890 | submission/sma/boost_1_69_0/libs/graph/example/dfs.cpp | #include <vector>
#include <algorithm>
#include <utility>
#include <boost/graph/adjacency_list.hpp>
#include <boost/graph/depth_first_search.hpp>
#include <boost/graph/visitors.hpp>
/*
This calculates the discover finishing time.
Sample Output
Tree edge: 0 --> 2
Tree edge: 2 --> 1
Back edge: 1 --> 1
Fin... | ALGO | 0.999756 | 4.883489 |
224fe0ac-b77a-4fcc-b0c6-284a9d6571c9 | ashita-agarwal/DSA-Practice-Cpp | DSA 450/ARRAYS/6_Find the Union and Intersection of the two sorted arrays..cpp | #include <iostream>
using namespace std;
void unionArray( int n,int a[],int m,int b[] ){
int i=0,j=0;
while(i<n and j<m){
while(i<n and a[i]==a[i+1]){
i++;
}
while(j<m and b[j]==b[j+1]){
j++;
}
if(a[i]<b[j]){
cout<<a[i]<<" ";
... | ALGO | 0.999983 | 3.177227 |
d821e465-0fa1-43cf-83b5-e5417e694476 | daviddoria/PCLMirror | tools/ndt3d.cpp | #include <pcl/console/parse.h>
#include <pcl/io/pcd_io.h>
#include <pcl/point_types.h>
#include <pcl/registration/ndt.h>
#include <pcl/filters/approximate_voxel_grid.h>
#include <string>
#include <iostream>
#include <fstream>
#include <vector>
typedef pcl::PointXYZ PointType;
typedef pcl::PointCloud<PointType> Cloud;... | DATA | 0.978987 | 6.0116 |
30c0b1a7-e5b8-4232-adce-25f4b7da87da | Ahnaf-41M/Codeforces_AtCoder | codeforces/520/B.cpp | #include<bits/stdc++.h>
#include <ext/rope>
#define min3(a,b,c) min(a,min(b,c))
#define max3(a,b,c) max(a,max(b,c))
#define min4(a,b,c,d) min(min(a,b),min(c,d))
#define max4(a,b,c,d) max(max(a,b),max(c,d))
#define count_one(a) __builtin_popcount(a) // Returns the number of set bits(1) in a number(a). In long lon... | ALGO | 0.999996 | 3.579993 |
1fc3b538-a332-48c3-b2dc-7f59171d2f7d | jaedla/soccervision | src/BallLocalizer.cpp | #include "BallLocalizer.h"
#include "Config.h"
#include "Util.h"
#include <iostream>
#include <vector>
#include <algorithm>
BallLocalizer::BallLocalizer() {
}
BallLocalizer::~BallLocalizer() {
}
int BallLocalizer::Ball::instances = 0;
BallLocalizer::Ball::Ball(float px, float py) {
id = instances++;
createdT... | ALGO | 0.994126 | 5.87297 |
1df1e037-5687-448f-b51c-989b4e75cac1 | ajaykmr8684/DSA-LEVEL-1 | 38. SpanOfAnArray.cpp | /*
Span of an array.
Span = max - min in the array.
*/
#include <bits/stdc++.h>
using namespace std;
int main() {
int n;
cin >> n;
int arr[n];
for (int i = 0; i < n; ++i) {
cin >> arr[i];
}
int max = arr[0];
int min = arr[0];
for (int i = 0; i < n; ++i ) {
if (arr... | ALGO | 0.999788 | 4.825167 |
97e69917-6217-47b3-9063-669524bba904 | Joaco-gavernet/competitive-programming | rounds/round-963/B.cpp | #include <bits/stdc++.h>
using namespace std;
//freopen("input.txt", "r", stdin);
//freopen("output.txt", "w", stdout);
// neal Debugger
template<typename A, typename B> ostream& operator<<(ostream &os, const pair<A, B> &p) { return os << '(' << p.first << ", " << p.second << ')'; }
template<typename T_container, type... | ALGO | 0.999588 | 4.41483 |
17884e80-cb4f-4f9c-bf22-2108b4fdf7f1 | HANJEONGWOO/Softech | mh1621.cpp | #include <stdio.h>
#define MIN(ADD, DELETE) (ADD > DELETE ? DELETE : ADD)
char string[2010];
int cost[2010][2010];
//cost[i][j] Է¹ ڿ i° ܾ j° ܾ
//Ӹ ǰ ϱ ̴.
int L, K;
int ADD, DELETE;
int min[26];
int len, i, j;
int main(void)
{
int test_case;
int T;
setbuf(stdout, NULL);
scanf("%d", &T);
for (test_case = 1; ... | ALGO | 0.999887 | 3.51939 |
14187cc6-e060-4c5a-a714-6e0fd475154e | LordOfDragons/dragengine | src/modules/physics/bullet/Bullet/BulletCollision/NarrowPhaseCollision/btPolyhedralContactClipping.cpp | ///This file was written by Erwin Coumans
///Separating axis rest based on work from Pierre Terdiman, see
///And contact clipping based on work from Simon Hobbs
#include "btPolyhedralContactClipping.h"
#include "BulletCollision/CollisionShapes/btConvexPolyhedron.h"
#include <float.h> //for FLT_MAX
int gExpectedNbTe... | ALGO | 0.99854 | 6.180176 |
a4b1b853-af0c-4674-a902-4401c22dfb49 | drshn-k/LeetCode-Problems | 2370-longest-ideal-subsequence/2370-longest-ideal-subsequence.cpp | class Solution {
public:
int longestIdealString(string s, int k) {
int n = s.length();
vector<vector<int>> dp(n + 1, vector<int>(27, 0));
int maxi = 1;
for (int i = (n - 1); i >= 0; i--)
{
for (int j = 0; j <= 26; j++)
{
int take = 0, notTake = 0;
... | ALGO | 0.999942 | 5.886914 |
18dd5a01-076a-4915-93a3-91bfbdaa6501 | AdamEdgett/optimization-methods | Project 3/program.cpp | #include <string>
#include <vector>
#include "wordlist.h"
#include "grid.h"
#include <cmath>
using namespace std;
int min_length=5;
int max_size;
vector<string> words;
//A mod function that actually works the way math should using negative numbers
int mod(int number, int modulus) {
int result = number % modulus... | ALGO | 0.969794 | 3.939976 |
fdf8ab9c-5e6a-4f22-84a7-7cd530b9cf13 | Puppet2714/cgal-5.6 | Spatial_sorting/examples/Spatial_sorting/parallel_spatial_sort_3.cpp | #include <CGAL/Exact_predicates_inexact_constructions_kernel.h>
#include <CGAL/point_generators_3.h>
#include <CGAL/Random.h>
#include <CGAL/spatial_sort.h>
#include <iostream>
#include <vector>
typedef CGAL::Exact_predicates_inexact_constructions_kernel K;
typedef K::Point_3 ... | ALGO | 0.99967 | 5.793064 |
a79800ad-d36f-41f8-969b-587e6408e869 | ayushikhandelwal99/C_basic_to_adv | face_practice question/stage3/Perfect_number_inRange.cpp | #include<iostream>
using namespace std;
int main()
{
int a,b;
cout<<"Enter range";
cin>>a>>b;
for(int i=a;i<b;i++)
{
int comp=0;
for(int j=1;j<i;j++)
{
if(i%j==0)
comp+=j;
}
if(comp==i)
cout<<i<<" ";
}
return 0;
}
| ALGO | 0.999626 | 3.646065 |
dc838768-9342-4f4e-8f3b-1f29ed5a6aa5 | mohamedelhaouil/ProblemsSolutions | Codeforces/A. Oath of the Night's Watch.cpp | /**
*
* author: MEL05
*
**/
#include<bits/stdc++.h>
using namespace std;
int main () {
int n, ans = 0;
cin >> n;
int a[n];
for (int i = 0; i < n; i++) {
cin >> a[i];
}
sort(a,a+n);
for (int i = 0; i < n; i++) {
if (a[i] == a[0] || a[i] == a[n-1])
ans++;
}
cout << n - ans;
return 0;
}
| ALGO | 0.999858 | 3.874027 |
fa2fd01e-259a-49df-be9d-84a5d5409c48 | GAOV13/UVA | Grafos/BFS/762 We Ship Cheap.cpp | #include <iostream>
#include <map>
#include <vector>
#include <queue>
#define vs vector<string>
#define msvs map<string, vector<string> >
#define msi map<string, int>
#define mss map<string, string>
#define qs queue<string>
#define endl "\n"
using namespace std;
int main(){
int n;
bool ver = false;
while(cin >> n... | ALGO | 0.999918 | 4.160931 |
78794be1-0bc7-4bd8-8e1a-410384ef8ace | aymanshalaby55/leetcode-dailyQuestion | 1137-N-th-Tribonacci-Number.cpp | class Solution {
public:
const int si = 38;
int tribonacci(int n) {
int arr[38] = {0 , 1 , 1};
for(int i = 3;i <= n;i++){
arr[i] = arr[i - 1] + arr[i - 2] + arr[i - 3];
}
return arr[n];
}
}; | ALGO | 0.999972 | 5.702878 |
3d8cbcc4-6c7a-46dc-9c88-475d75f76aed | KagariET01/Algorithm | Tree/LCA.cpp | // [最近共同祖先.cpp]
#include<bits/stdc++.h>
using namespace std;
#define INT long long int
const INT mxn=1e5+5;
INT deep[mxn];//距離根節點的距離(根節點距離為0)
INT p[mxn][35];
vector<INT> v[mxn];
void dfs(INT n,INT lst){
for(INT i:v[n]){
if(i==lst)continue;
p[i][0]=n;
deep[i]=deep[n]+1;
dfs(i,n);
}
}
void build(INT n){
fo... | ALGO | 0.999723 | 3.798481 |
52b9b3c6-44c5-453a-b0c9-df39cbb701de | Sharknevercries/Online-Judge | CodeForce/474B Worms.cpp | /* 8124491 2014-10-07 05:37:18 Shark 474B - Worms GNU C++ Accepted 62 ms 800 KB */
// C++
#include<iostream>
#include<stack>
#include<vector>
#include<queue>
#include<map>
#include<set>
#include<bitset>
#include<algorithm>
#include<functional>
#include<deque>
// C
#include<cstdio>
#include<cstring>
#include<ctime>
#inc... | ALGO | 0.999919 | 3.798522 |
3c77520e-1dd2-4cd1-af77-4c55fa90d940 | crystax/android-vendor-boost | libs/graph_parallel/test/distributed_rmat_cc.cpp | // Authors: Brian Barrett
// Nick Edmonds
// Andrew Lumsdaine
#include <boost/graph/use_mpi.hpp>
#include <boost/config.hpp>
#include <boost/throw_exception.hpp>
#include <boost/graph/distributed/adjacency_list.hpp>
#include <boost/property_map/parallel/distributed_property_map.hpp>
#include <boos... | ALGO | 0.911657 | 6.303998 |
7e3c2fb1-dde9-4722-9dbc-23df1d43a634 | wpiczak/kattis_solutions | deathstar.cpp | #include <iostream>
#include <vector>
int main() {
std::ios_base::sync_with_stdio(false);
std::cin.tie(nullptr);
int n;
std::cin >> n;
std::vector<std::vector<int>> matrix(n, std::vector<int>(n));
for (int i = 0; i < n; ++i)
for (int j = 0; j < n; ++j)
std::cin >> matrix[i... | ALGO | 0.999937 | 5.257558 |
f36136e7-9b10-40fe-961f-c790269b3304 | m-eraf/DSApractice | Assignment 12/node_insertion_at_begining.cpp | SinglyLinkedListNode* insertNodeAtHead(SinglyLinkedListNode* llist, int data) {
SinglyLinkedListNode* ptr = new SinglyLinkedListNode(data);
ptr->data= data;
ptr ->next = llist;
return ptr;
}
| ALGO | 0.9481 | 3.048639 |
b46c72d5-75dc-4d96-8b70-c806a80ad139 | jigsaw5071/algorithms | dynammic_programming/wildcard_pattern_matching.cpp | /*
@Shubham Sharma
Date:28/02/2017
ref: Tushar Roy DP
*/
/*--------------------------------WildCard Pattern Matching-------------------------------------------------------
1. This is a very important question asked in various interviews
2. The time complexity is O(row*col)
3. The space complexity is O(row*col)
**/
#in... | ALGO | 0.99985 | 3.976619 |
d20d5e3a-88f3-4d7f-a068-4a03126b3e21 | faijurrahman/pSolving | 9. CodeUnix/Graph2.cpp | #include <iostream.h>
#include <fstream.h>
#include <limits.h>
#ifdef unix
#include <strstream.h>
#else
#include <strstrea.h> // <strstream.h> on UNIX machines
#endif
#include "mystring.h"
#include "SeparateChaining.h"
#include "LinkedList.h"
#include "QueueAr.h"
int INFINITY = INT_MAX;
struct Vertex
{
... | ALGO | 0.998037 | 4.607057 |
0bee601a-cc48-4a1b-b777-fc21af432b6c | eshf/NPSI | source/headers/boost/libs/numeric/ublas/doc/samples/matrix_vector_range.cpp | #include <boost/numeric/ublas/matrix.hpp>
#include <boost/numeric/ublas/matrix_proxy.hpp>
#include <boost/numeric/ublas/io.hpp>
int main () {
using namespace boost::numeric::ublas;
matrix<double> m (3, 3);
for (unsigned i = 0; i < m.size1 (); ++ i)
for (unsigned j = 0; j < m.size2 (); ++ j)
... | ALGO | 0.975413 | 3.376192 |
9fc5c086-a49c-4f63-bf1f-286c15b7a931 | motaher13/Solved-OJ-problems | Others/jubaer/c files/dsfidfuh.cpp | #include <stdio.h>
#include <iostream>
#include <vector>
#include <map>
#include <string.h>
#include <string>
using namespace std;
vector<int>vc[250];
vector<int>ty[250];
int visited[250];
int visit[250];
int ara[250];
int tt[220],tt1[220];
map<string,int>name;
int para[250][200];
string str[250],fg,gf;
int count,nu... | ALGO | 0.999945 | 3.820863 |
b6eb07ba-3ea3-46ee-8ef3-512237b4d3e6 | qiuqiuqiu1010/lzq2023 | RawDataset/Cplus_src/kurtosis.cpp | #include <iostream>
double kurtosis(double data[], int n) {
double sum = 0;
double sumPD = 0;
double sumSq = 0;
for (int i = 0; i < n; i++) {
sum += data[i];
sumSq += data[i] * data[i];
}
double mean = sum / n;
double standardDeviation = sqrt((sumSq - mean * sum) / n);
f... | ALGO | 0.999513 | 5.850041 |
12c2e6d9-bea0-418e-8fc5-9c894b83cbf0 | tanvirtareq/programming | uva/suduku.cpp | #include<bits/stdc++.h>
using namespace std;
int a[5][5], row[5][5], col[5][5], p[5][5];
int wp(int i, int j)
{
if((i==1 or i==2) and (j==1 or j==2)) return 1;
if((i==1 or i==2) and (j==3 or j==4)) return 2;
if((i==3 or i==4) and (j==1 or j==2)) return 3;
if((i==3 or i==4) and (j==3 or j==4) ) ret... | ALGO | 0.999869 | 4.068577 |
363f899f-9f57-4751-aa17-37a29bc94f53 | duckdb/duckdb-odbc | src/duckdb/extension/icu/third_party/icu/common/umath.cpp | #include "putilimp.h"
U_CAPI int32_t U_EXPORT2
uprv_max(int32_t x, int32_t y)
{
return (x > y ? x : y);
}
U_CAPI int32_t U_EXPORT2
uprv_min(int32_t x, int32_t y)
{
return (x > y ? y : x);
}
| TOOL | 0.99012 | 5.309443 |
e5dd7f78-b08c-429c-964c-65e1a4e9d916 | truthspy/LeetCode | Session1/046_Permutations.cpp | class Solution {
public:
vector<vector<int>> permute(vector<int>& nums) {
int size = nums.size();
vector<vector<int>> myresult;
for(int i = 0; i < size; i ++) {
vector<int> result;
result.push_back(nums[i]);
vector<bool> flag(size, false);
flag... | ALGO | 0.999998 | 5.989296 |
62fc02dd-c17a-4b2d-9b40-7b86968c4313 | Amuri-Bonface/programming-practice-lessons | cplus-lessons/addfunction.cpp | #include <iostream>
using namespace std;
float calcArea(float height, float base)
{
const float half=0.5;
float area;
area=half*base*height;
return area;
}
int main()
{
float h,b;
float result;
float calcArea(float, float);
cout<<"Enter Height"<<endl;
cin>>h;
cout<<"enter Base"<<e... | TOOL | 0.974835 | 5.186717 |
c2cef1ea-fbb9-4ef0-92ea-ea53e4cd1d88 | dysuby/Learn-ds | 刷题/csp/201709-5.cpp | #include <cstdio>
using namespace std;
int main() {
long long n, m;
scanf("%lld%lld", &n, &m);
long long arr[101024];
for (int i = 1; i <= n; ++i) {
scanf("%lld", &arr[i]);
}
int cm, l, r, v;
for (int i = 0; i < m; ++i) {
scanf("%d", &cm);
if (cm == 1) {
scanf("%d%d%d", &l, &r, &v);
... | ALGO | 0.999861 | 3.664062 |
dca3f4e5-6f22-4821-8238-c869375b5867 | geekyanurag/Coding-Interview-Preparation | Arrays/Element_with_left_side_smaller_right_side_greater.cpp | #include<bits/stdc++.h>
#define ll long long
using namespace std;
// Find the first element such that all the elements towards its left is smaller than it and all elements after it is greater than it.
// Solution is take two array left , right. left will store the maximum till ith position ad right will store the mini... | ALGO | 0.999859 | 4.784312 |
59c64477-270e-4b66-97c0-382f2b1398f4 | DetrembleurArthur/game-engine | src/ge/tween/tween_functions.cpp | #include "ge/tween/tween_functions.hpp"
#include <glm/glm.hpp>
#define PI 3.14159265358979323846264338327950288
float ge::tweenf::linear(float x)
{
return x;
}
float ge::tweenf::ease_in_sine(float x)
{
return 1.0 - cos(x * PI / 2.0);
}
float ge::tweenf::ease_ousine(float x)
{
return sin(x * PI / 2);
}
f... | TOOL | 0.934954 | 7.537767 |
64a94c6c-045c-40b8-a11b-f246ac1c25df | waiwai444/oj | uva/10029 - Edit Step Ladders/10029.cpp |
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#define HASH_SIZE 60013
#define MAX_LEN 16
struct HashMapNode
{
char word[20];
size_t word_len;
size_t step;
struct HashMapNode* next;
};
struct HashMapHead
{
size_t size;
struct HashMapNode* list;
};
struct HashMap
{
struct HashMapHead vec[HASH_SIZ... | ALGO | 0.999862 | 3.347507 |
2a9f82ae-ac76-4d1e-9bcd-1b4aa310c029 | jaysriv1121/CodesCpp | Prg9While/Prg9While.cpp | #include<iostream>
using namespace std;
int main() {
int n;
cout << "Enter the range" << endl;
cin >> n;
int i =1;
while (i <= n){
cout << i ;
i = i + 1;
}
}
| ALGO | 0.990842 | 3.624016 |
98b16997-7ad3-4473-8eee-428330d63abb | Nithya-tech-arch/codechef | Strings/PALL01.cpp | #include<bits/stdc++.h>
#include <iostream>
using namespace std;
int main() {
// your code goes here
int t;
cin>>t;
int no;
while(t--){
cin>>no;
int rev=0;
int n=no;
while(n!=0){
int temp=n%10;
rev=(rev*10) + temp;
n=n/10;
}
if(rev==no) cout<<"wins"<<endl;
... | ALGO | 0.999952 | 4.193825 |
1fe5cfda-f868-454a-b730-0936d1fb2735 | vfolunin/archives-solutions | CSES/1649.cpp | #include <iostream>
#include <algorithm>
#include <vector>
#include <set>
#include <map>
#include <string>
using namespace std;
class SegmentTree {
vector<int> t;
int size;
void build(int v, int vl, int vr, const vector<int> &a) {
if (vl == vr) {
t[v] = a[vl];
return;
... | ALGO | 0.999934 | 5.375333 |
7dde8105-a0d2-4050-886c-d056b6f9b85c | mahadi097/Competitive-Programming | Leetcode/Hash Table/846. Hand of Straights.cpp | class Solution {
public:
bool isNStraightHand(vector<int>& hand, int groupSize) {
int n = hand.size();
if(n%groupSize) return false;
unordered_map<int, int> f;
for(auto v: hand) f[v]++;
sort(hand.begin(), hand.end());
for(auto v: hand) {
... | ALGO | 0.999988 | 5.984047 |
a5301496-b656-40e1-a16e-75cbf9d028ad | NCTU-PCCA/NCTU_TaNoShiI | codebook/code/Flow/KM.cpp | struct KM{
// Maximum Bipartite Weighted Matching (Perfect Match)
static const int MXN = 650;
const int INF = 2147483647; //LL
int px[MAXN],py[MAXN],match[MAXN],par[MAXN],n;
int g[MAXN][MAXN],lx[MAXN],ly[MAXN],slack_y[MAXN];
// ^^^^ long long
void init(int _n){
n = _n;
for (i... | ALGO | 0.99968 | 3.672427 |
87b24c35-d12e-46ad-8954-382211db601c | JYKai/Cpp | Theory01/01_about_c++/problems/1-1/P6.cpp | #include <iostream>
using namespace std;
int BoxVolume(int num1, int num2, int num3);
int BoxVolume(int num1, int num2);
int BoxVolume(int num1);
int main(void)
{
cout << "[3, 3, 3] : " << BoxVolume(3, 3, 3) << endl;
cout << "[5, 5, D] : " << BoxVolume(5, 5) << endl;
cout << "[7, D, D] : " << BoxVolume(7)... | TOOL | 0.988104 | 4.774738 |
f15f4f39-92ba-4dd1-ab56-48834aaa78eb | Duaard/ProgrammingProblems | CodeForces/ThreePairwiseMax/solution.cpp | #include <bits/stdc++.h>
using namespace std;
void solve()
{
int x, y, z;
cin >> x >> y >> z;
if (x == max(y, z) || y == max(x, z) || z == max(x, y))
{
cout << "YES\n";
cout << min(x, y) << " " << min(x, z) << " " << min(y, z) << "\n";
}
else
{
cout << "NO\n";
... | ALGO | 0.999924 | 4.884573 |
1a0ca5cb-2b9d-4951-9676-89c368ba74c4 | architjindalcs/Leetcode-Solutions | Remove loop in Linked List - GFG/remove-loop-in-linked-list.cpp | // { Driver Code Starts
// driver code
#include <iostream>
using namespace std;
struct Node
{
int data;
Node* next;
Node(int val)
{
data = val;
next = NULL;
}
};
void loopHere(Node* head, Node* tail, int position)
{
if(position==0) return;
Node* walk = head;
... | ALGO | 0.999967 | 3.967263 |
31b817e1-8b45-4eb8-bcc1-d411e8f2dc82 | vusec/typesan | llvm/lib/CodeGen/InterferenceCache.cpp | #include "InterferenceCache.h"
#include "llvm/CodeGen/LiveIntervalAnalysis.h"
#include "llvm/Support/ErrorHandling.h"
#include "llvm/Target/TargetRegisterInfo.h"
using namespace llvm;
#define DEBUG_TYPE "regalloc"
// Static member used for null interference cursors.
const InterferenceCache::BlockInterference
Int... | ALGO | 0.971759 | 7.758625 |
7361a28b-eecd-4fd8-99a4-575cacadcf56 | Mokuroh54/Comp_Prog | Hackerrank/K-Inversion_Permutations.cpp | /*
___
(o,o)
< . >
--"-"---
Rowlet is orz
*/
#include <bits/stdc++.h>
using namespace std;
#define FF first
#define SS second
#define pb push_back
#define ll long long
#define ld long double
#define INF 1000000000ull
#define MOD 1000000007ull
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;
const int MAXN ... | ALGO | 0.999945 | 4.150543 |
43ad1e46-9ecf-4fa4-a290-bcb8651cdcc3 | Jin-s-work/SDS_Algorithm | Day 4/BOJ 2960 에라토스테네스의 체.cpp | #include <iostream> // stdio.h 와 같은 것
#include <vector>
#include <string>
#include <algorithm>
#include <stack>
#include <queue>
#include <cstring>
#include <cmath>
#include <functional>
#include <map>
#include <unordered_map>
#include <set>
// control i
#define MAX 987654321
#define mod 1000000007
#define pii pair<i... | ALGO | 0.999968 | 4.144852 |
64324c38-5b76-4935-9318-781d0d509fd1 | landa44/usaco_guide | bronze/Getting Started/Simulation/lost_cow.cpp | #include<bits/stdc++.h>
using namespace std;
typedef long long ll;
const int mod = 1e9+7;
int main(){
ios_base::sync_with_stdio(0);
cin.tie(0);
freopen("lostcow.in", "r", stdin);
freopen("lostcow.out", "w", stdout);
int x, y;
cin >> x >> y;
int sol = 0;
for(int i = 0; i <= 10; i++){
if(i%2==1){
... | ALGO | 0.999852 | 3.757029 |
1e4801ac-fef1-4158-96e2-1bb7ab525688 | MacTechIN/opencv | samples/cpp/tutorial_code/ShapeDescriptors/hull_demo.cpp | /**
* @function hull_demo.cpp
* @brief Demo code to find contours in an image
* @author OpenCV team
*/
#include "opencv2/imgcodecs.hpp"
#include "opencv2/highgui.hpp"
#include "opencv2/imgproc.hpp"
#include <iostream>
using namespace cv;
using namespace std;
Mat src_gray;
int thresh = 100;
RNG rng(12345);
/// F... | ALGO | 0.960143 | 7.49916 |
ec8f6780-246f-4d1e-ad4b-32ae894557e2 | mc-cat-tty/llvm-17.0.6-compilers | libc/src/math/generic/remainderl.cpp | #include "src/math/remainderl.h"
#include "src/__support/FPUtil/DivisionAndRemainderOperations.h"
#include "src/__support/common.h"
namespace __llvm_libc {
LLVM_LIBC_FUNCTION(long double, remainderl, (long double x, long double y)) {
int quotient;
return fputil::remquo(x, y, quotient);
}
} // namespace __llvm_li... | TOOL | 0.979359 | 5.661 |
19d9f670-7dd3-435f-932d-1de3960de54a | Awadesh365/Random_Problem_solving | 146-lru-cache/lru-cache.cpp | // #include <bits/stdc++.h>
// using namespace std;
// NM- > POD
// Design problem
// Linked List -> implementation and Hashtable problem
class LRUCache
{
public:
class Node
{
public:
int key;
int val;
Node *prev;
Node *next;
Node(int key, int val)
{
... | ALGO | 0.999331 | 6.05598 |
940b22f3-47f7-44e1-8004-3a6dda10c3e9 | ki7348/Algorithm | cpp/queue/20301.cpp | #include <iostream>
#include <deque>
#include <vector>
using namespace std;
int main(){
int n,k,m;
cin >> n >> k >> m;
deque<int> dq;
vector<int> v;
for(int i=0;i<n;i++){
dq.push_back(i+1);
}
int cnt = 0;
bool state = false;
while(!dq.empty()){
if(!state){
... | ALGO | 0.999974 | 3.243779 |
a0d2f119-18db-41a7-bb40-06600c5f4f17 | CrkJohn/TGRF | ARENA1/G - A Bug’s Life.cpp | #include<bits/stdc++.h>
#define FOR(i,b) for(int i =0 ; i< b;i++)
#define loop(i,a,b) for(int i =a ; i< b;i++)
#define fi first
#define se second
#define len(a) ((int)a.size())
#define pb push_back
#define NEXT(a,b) ((a)%b)
using namespace std;
typedef pair<int,int> ii;
typedef pair<ii,int> iii;
typedef vector<ii> vi... | ALGO | 0.999484 | 3.969015 |
340f6f15-aad2-4fb1-9d08-0430ec17febe | tietbaothoa/PTIT | CTDL-GT/DSA06022_SoNhoNhatVaNhoThuHai.cpp | #include <bits/stdc++.h>
using namespace std;
#define faster ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0)
int main() {
faster;
int test;
cin >> test;
while (test--) {
int n;
cin >> n;
int a[n+5];
int check = 0;
for(int i=0;i<n; i++){
cin >> a... | ALGO | 0.99985 | 3.478527 |
985208e5-b9cf-4e21-b006-80516ea61320 | webserg/cpp | algorithmsInPractice/boostUsing/main.cpp | #include <boost/lambda/lambda.hpp>
#include <boost/regex.hpp>
#include <iostream>
#include <iterator>
#include <algorithm>
#include <string>
using namespace std;
int main()
{
using namespace boost;
typedef std::istream_iterator<int> in;
//for_each(in(cin), in(), cout << (_1 * 3) << " ");
string line;
regex pat("... | TOOL | 0.900772 | 3.468324 |
a8a30ea0-e377-4f5a-a122-f18b0967c5b8 | codetalker7/cp-res | Codeforces/CF1573C.cpp |
/*
template by: codetalker7
editor: sublime text 3
file name: CF1573C.cpp
date created: 2021-09-22 22:06:40
problem link:
*/
#include<iostream>
#include<vector>
#include<string>
#include<algorithm>
#include<stack>
#include<unordered_set>
#include<cmath>
#include<numeric>
#include<iterator>
#include<set>
#in... | ALGO | 0.999015 | 3.839828 |
888172e1-2eab-4cd3-a20d-0f240439de3e | DavDag/RayTracing_Exercices | RayTracerWithUI/deps/glm-0.9.9.8/test/core/core_func_integer_bit_count.cpp | // This has the programs for computing the number of 1-bits
// in a word, or byte, etc.
// Max line length is 57, to fit in hacker.book.
#include <cstdio>
#include <cstdlib> //To define "exit", req'd by XLC.
#include <ctime>
unsigned rotatel(unsigned x, int n)
{
if (static_cast<unsigned>(n) > 63) { std::printf("r... | ALGO | 0.998341 | 4.846448 |
30782502-3491-4ad1-9bfa-ac7525b9e382 | LiamHua/VSCode | practise-P300/LCS-01.cpp | #include <iostream>
#include <string.h>
#include <vector>
#include <string>
using namespace std;
#define max(x, y) ((x) > (y) ? (x) : (y))
#define MAX 51
int m, n;
string a, b;
int dp[MAX][MAX];
vector<char> subs;
void LCSlength()
{
int i, j;
for (i = 0; i <= m; i++)
dp[i][0] = 0;
for (j = 0; j <=... | ALGO | 0.999949 | 4.05154 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.