uuid string | repo_name string | relative_path string | content string | category string | algo_rel_score float64 | quality_score float64 |
|---|---|---|---|---|---|---|
4e677006-1485-4a9b-ac6c-771423be2926 | kaustav812004/Data-Structure-and-Algorithms | rec5.cpp | #include<bits/stdc++.h>
using namespace std;
int fact(int n){
if(n == 0){
return 1;
}
int mul = 1;
for(int i = 1; i <= n; i++) {
mul = mul*i;
}
return mul;
}
int main(){
cout<<fact(5);
return 0;
} | ALGO | 0.999856 | 4.784409 |
e3957a23-808f-40c3-9b83-2462381955ca | aloyanani/linux-homeworks | IPC-2/prime-calculator.cpp | #include <iostream>
#include <string.h>
#include <errno.h>
#include <unistd.h>
#include <sys/types.h>
// Function to check if a number is prime
bool is_prime(int num)
{
if(num <= 1)
{
return false;
}
for(int i = 2; i <= num / 2; ++i)
{
if(num % i == 0)
{
return ... | ALGO | 0.999777 | 4.725361 |
cd8ec892-d571-471b-b172-19dd46438a94 | Shivam2501/MSI-GEM5 | src/systemc/tests/systemc/misc/stars/star109218-2/star109218-2.cpp | /*****************************************************************************
star109218-2.cpp --
Original Author: Martin Janssen, Synopsys, Inc., 2002-02-15
*****************************************************************************/
/***********************************************************************... | TEST | 0.851079 | 4.267624 |
27b57d15-1e47-4580-9a25-dbfb9fb67499 | nakuldevmv/Calculator-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 |
87dd2e01-ab2e-4cdb-af43-2df213a5d5c1 | BaofengZan/my_trt_pro | pipeline/bytetrack/src/STrack.cpp | #include "../include/STrack.h"
STrack::STrack(vector<float> tlwh_, float score)
{
_tlwh.resize(4);
_tlwh.assign(tlwh_.begin(), tlwh_.end());
is_activated = false;
track_id = 0;
state = TrackState::New;
tlwh.resize(4);
tlbr.resize(4);
static_tlwh();
static_tlbr();
frame_id = 0;
tracklet_len = 0;
this->s... | TOOL | 0.859038 | 5.148541 |
304b38d2-49bb-4b8f-a487-4dfe16a2e888 | Aryan522-png/DSA | 1062-partition-array-into-three-parts-with-equal-sum/partition-array-into-three-parts-with-equal-sum.cpp | class Solution {
public:
bool canThreePartsEqualSum(vector<int>& arr) {
int sum=0;
for(int i=0;i<arr.size();i++){
sum=sum+arr[i];
}
if(sum%3!=0) return false;
int target=sum/3;
int count=0;
int targetsum=0;
for(int i=0;i<arr.size();i++){... | ALGO | 0.999834 | 5.907929 |
356f14b7-bd1e-4a48-8a09-416750568a5a | mzeeshanzafar28/Practice | primes bw a and b.cpp | #include<iostream>
using namespace std;
#include<conio.h>
#include<string.h>
#include<iomanip>
int main()
{
int a,b;
cout<<"Enter a and b: ";
cin>>a>>b;
if (a<=2)
{
cout<<"starting must be greater than 2"<<endl;
return 1;
}
for (int i=a; i<=b; i++)
{
int j;
for (j=2; j<i; j++)
{
if (i%j == 0)
{
cout<<i<<... | ALGO | 0.992979 | 3.12119 |
af83965a-23ff-4068-ae69-6799c9e32693 | ishandutta2007/codeforces | orzdevinwang/normal/587/F.cpp | #include<bits/stdc++.h>
#define L(i, j, k) for(int i = j, i##E = k; i <= i##E; i++)
#define R(i, j, k) for(int i = j, i##E = k; i >= i##E; i--)
#define ll long long
#define db double
#define pii pair<int, int>
#define mkp make_pair
using namespace std;
const int N = 1e5 + 7;
const int B = 300;
int n, m, len[N], q[N], l... | ALGO | 0.999945 | 3.960439 |
e35a92b0-de84-4d97-9abc-407f00498e74 | fegennari/3DWorld | dependencies/openal-soft/common/alcomplex.cpp |
#include "config.h"
#include "alcomplex.h"
#include <algorithm>
#include <cmath>
#include <cstddef>
#include <utility>
#include "albit.h"
#include "alnumeric.h"
#include "math_defs.h"
void complex_fft(const al::span<std::complex<double>> buffer, const double sign)
{
const size_t fftsize{buffer.size()};
/* ... | ALGO | 0.998745 | 6.593467 |
a63f07c0-ea16-4471-84fb-f1656fc22f5b | RushiVachhani/codeforces-solutions | 1183A.cpp | /*
* Author: Rushi Vachhani
* Platform: Codeforces
* Problem_ID: 1183A
* Language: C++
*/
#include<bits/stdc++.h>
using namespace std;
int sumOfDigits(int n) {
int sum = 0;
while(n) {
int temp = n%10;
sum += temp;
n = n/10;
}
return sum;
}
void solve() {
int n;
... | ALGO | 0.999971 | 4.374642 |
a2bfeab7-888a-4f98-8fce-f314bc2ba80f | oosquare/OI-Codes | Storage/YbtOJ/574-「二分图匹配」孤立点集.cpp | #include <iostream>
#include <vector>
using namespace std;
constexpr int MAX_N = 100 + 10;
int n, m;
bool closure[MAX_N][MAX_N];
vector<int> graph[MAX_N];
int match[MAX_N];
bool vis[MAX_N], exist[MAX_N];
int ans, col[MAX_N];
bool valid[MAX_N], sol[MAX_N];
void link(int x, int y) {
graph[x].push_back(y);
}
boo... | ALGO | 0.999968 | 4.225819 |
4a0f6a44-b673-49fc-8058-af78369cb104 | Fan-Zhixuan/DL-learning | leecode/1211二叉树/二叉树的遍历/main.cpp | #include <iostream>
#include <vector>
#include <stack>
#include <queue>
using namespace std;
struct TreeNode {
int val;
TreeNode* left;
TreeNode* right;
TreeNode() : val(0), left(nullptr), right(nullptr) {}
TreeNode(int x) : val(x), left(nullptr), right(nullptr) {}
TreeNode(int x, TreeNode* left, TreeNode* rig... | ALGO | 0.999885 | 5.364519 |
b9f41b02-59b5-460a-ba8c-51b327fab0f3 | lychees/ACM-Training | Note/集训队作业/2015/ydc/我的集训队作业/codeforces/280E.cpp | #include<iostream>
#include<cstdio>
#include<cstdlib>
#include<cstring>
#include<cmath>
#include<algorithm>
#include<ctime>
#define maxn 700010
#define eps 1e-6
using namespace std;
typedef long long LL;
inline void Read(int &digit)
{
digit=0;
char c;
for(c=getchar();c<'0'||c>'9';c=getchar());
for(;c>='0'&&c<='9';d... | ALGO | 0.99978 | 3.227139 |
d5bbcf70-f363-429c-8889-0050e11f3751 | adityabhise1111/cpp | 44_linked/ll_deletion.cpp | #include <bits/stdc++.h>
using namespace std;
class node{
public:
int data;
node* next;
node(int data){
this -> data= data;
this -> next = nullptr;
}
};
void insertathead(node* &head,int d){
node* temp=new node(d);
temp->next= head;
head = temp;
}
void ... | ALGO | 0.999471 | 4.274889 |
ebb604d5-2cfa-4c14-a7ef-c1e32fa3f666 | NimishToshniwal/Codeforces-Solved | 1-499/136A.cpp | #include <bits/stdc++.h>
using namespace std;
#define ll long long
#define rep(i, n) for (ll i = 0; i < n; i++)
#define rep1(i, n) for (ll i = 1; i <= n; i++)
int main()
{
ios::sync_with_stdio(false);
int n, k;
cin >> n;
vector<int> a(n+1);
for (int i = 1; i <= n; i++)
{
cin >> k;
... | ALGO | 0.999913 | 3.364513 |
6d647133-24e8-4c61-b475-4e696fee3e24 | HKUST-KnowComp/MNE | C++/LINE/linux/line.cpp | /*
This is the tool ....
Contact Author: Jian Tang, Microsoft Research, <EMAIL>, <EMAIL>
Publication: Jian Tang, Meng Qu, Mingzhe Wang, Ming Zhang, Jun Yan, Qiaozhu Mei. "LINE: Large-scale Information Network Embedding". In WWW 2015.
*/
// Format of the training file:
//
// The training file contains serveral lines, ... | DATA | 0.998837 | 4.182095 |
6aabc193-18d7-4b20-87d2-20cdc5b11aa5 | Glitch-OS/android_frameworks_native | libs/gui/Surface.cpp | #define LOG_TAG "Surface"
#define ATRACE_TAG ATRACE_TAG_GRAPHICS
//#define LOG_NDEBUG 0
#include <gui/Surface.h>
#include <condition_variable>
#include <deque>
#include <mutex>
#include <thread>
#include <inttypes.h>
#include <android/gui/DisplayStatInfo.h>
#include <android/native_window.h>
#include <gui/FenceMon... | TOOL | 0.873484 | 7.004176 |
f3c532c6-fa51-411f-9e53-82b8c1d7e904 | winmo95/ELF-Lizzie | ELF/third_party/tbb/examples/task/tree_sum/OptimizedParallelSumTree.cpp | #include "common.h"
#include "tbb/task.h"
class OptimizedSumTask: public tbb::task {
Value* const sum;
TreeNode* root;
bool is_continuation;
Value x, y;
public:
OptimizedSumTask( TreeNode* root_, Value* sum_ ) : root(root_), sum(sum_), is_continuation(false) {
}
tbb::task* execute() /*overr... | ALGO | 0.999706 | 6.004917 |
1ecb5b71-4a8d-447b-a342-b090ad0afd30 | ghibli613/cp-coding | coding/big_o/lv4/lect7/number_of_sequences.cpp | #include<bits/stdc++.h>
using namespace std;
typedef long long ll;
const int mod = 1e9 + 7;
int main()
{
ios::sync_with_stdio(false);
cin.tie(NULL);
int n; cin >> n;
vector<int> a(n + 1, 0), f(n + 1, 0);
for(int i = 1; i <= n; i++) cin >> a[i];
for(int i = 1; i <= n; i++)
{
for(... | ALGO | 0.999979 | 4.198494 |
c5bd7704-a35a-4464-8110-731f0373f96f | CytoComp/ethereum-ObjectiveC | LocalPods/boost/1.55.0/libs/math/example/root_finding_example.cpp | // root_finding_example.cpp
// Example of finding roots using Newton-Raphson, Halley
// Note that this file contains Quickbook mark-up as well as code
// and comments, don't change any of the special comment mark-ups!
//#ifdef _MSC_VER
//# pragma warning(disable: 4180) // qualifier has no effect (in Fusion).
//#en... | ALGO | 0.999918 | 5.083551 |
63b9e1d7-d65d-4aef-b2e1-0da1ae068eb7 | gill0602/DSA | output/Linked List/MergeSort.cpp | class Solution {
public:
Node* findMid(Node* head){
if(head==NULL){
return head;
}
Node* slow=head;
Node* fast=head;
while(fast->next){
fast=fast->next;
if(fast->next){
fast=fast->next;
slow=slow->next;
... | ALGO | 0.999999 | 5.731265 |
6425e932-117c-49de-a0bf-846b8e43a9ed | HenriMalahieude/UndergraduateCode | CS10C_DataStructures/Lab3/main.cpp | #include<iostream>
#include <vector>
#include <stdexcept>
using namespace std;
template<typename T>
unsigned min_index(const vector<T> &vals, unsigned index){
T small = vals.at(index);
unsigned smallI = index;
for (unsigned i = index+1; i < vals.size(); i++){
if (small > vals.at(i)){
... | ALGO | 0.98378 | 4.641746 |
37cec7b4-f880-4cd0-beee-e2f911610ee1 | minskiter/leetcode | codecpp/82.cpp | #include "header.h"
class Solution
{
public:
ListNode *deleteDuplicates(ListNode *head)
{
ListNode *dummy = new ListNode(0, head), *p = dummy;
int temp = -101;
while (head != nullptr)
{
if (head->next != nullptr && head->next->val == head->val)
{
... | ALGO | 0.999942 | 5.338375 |
d9c8f255-d242-4ca3-b107-f16f593fac08 | alvinpiter/competitive-programming | SPOJ/GRAFFDEF.cpp | #include<bits/stdc++.h>
using namespace std;
#define MAXN 100000
#define LL long long int
int N, M;
set<int> adj[MAXN + 3], btAdj[MAXN + 3]; //adj -> original adjacency list, btAdj -> bridge tree adjacency list
int currentDfsTime, dfsTime[MAXN + 3], minDfsTime[MAXN + 3];
bool visited[MAXN + 3];
vector<int> sizes; //Si... | ALGO | 0.999275 | 4.285455 |
46755882-4c91-4efb-9fcd-4b6e2d5817e7 | yuancf1024/algorithm-go | 笔试/NetEase0904/T4.cpp | /**
* @file T4.cpp
* @author your name (<EMAIL>)
* @brief
* @version 0.1
* @date 2022-09-04
*
* @copyright Copyright (c) 2022
* 小红的子树权值和 35分
*
* 小红拿到了一棵有根树,根节点为1号节点。
* 已知i节点的权值为ai。
* 小红定义每个节点为根的子树权值
* 为该子树所有节点权值乘积的因子数量。
* 小红想知道,所有子树权值之和是多少?
*
* 答案请对10^9+7取模
* (请注意是权值取模,而不是乘积取模后求因子数量!)
*
输入描述:
第一行... | ALGO | 0.999895 | 5.356688 |
12172c60-a056-4e88-8d57-c0d0ed44c05b | ngzqqb/sstd_cgal | sstd/Stream_lines_2/test/Stream_lines_2/Stream_line.cpp | #include <CGAL/Exact_predicates_inexact_constructions_kernel.h>
#include <CGAL/Stream_lines_2.h>
#include <CGAL/Euler_integrator_2.h>
#include <CGAL/Runge_kutta_integrator_2.h>
#include <CGAL/Regular_grid_2.h>
#include <CGAL/Triangular_field_2.h>
#include <fstream>
#include <sstream>
typedef double coord_type;
typede... | ALGO | 0.907451 | 3.900418 |
889aa1ea-e5b0-4330-8cd3-b41bb085f54b | raincross7/code-similarity | codes/train_code/problem307/problem307_183.cpp | #include<bits/stdc++.h>
using namespace std;
#define rep(i, n) for(int i=0; i<n; i++)
#define rrep(i, n) for(int i=n-1; i>=0; i--)
#define FOR(i, a, b) for(int i=a; i<b; i++)
#define ALL(v) v.begin(),v.end()
typedef long long ll;
typedef pair<int, int> pii;
typedef pair<int, ll> pil;
typedef pair<ll, int> pli;
typedef ... | ALGO | 0.999987 | 4.367918 |
2bb5d788-464b-4dc3-bf75-1e2433964986 | Tahsin-Zaman-Jilan/Codeforce-Solutions-By-ZIlanJaman | A - Very Very Primitive Game .cpp | #include<bits/stdc++.h>
using namespace std;
int main()
{
int A,B,C;
cin>>A>>B>>C;
if(C==0){
if (A>B){
cout<<"Takahashi";}
else {
cout<<"Aoki";
}
}
else{
if (A<B){
cout<<"Aoki";
}
else {
cout<<"Takahashi";
}
}
}
| ALGO | 0.999803 | 4.386008 |
85a4413c-a6de-4112-960b-e2324a4dfeb6 | Parul240/C_plus_plus-Programming | PROBLEMS/area_of_circle.cpp | STATEMENT
/*
If we want to introduce decimal values we use the double keyword before declaring the variable.
Write a program which does the following:
* Find the area of a circle whose radius is 8.9 cm. Take pi = 3.14
* Declare variables radius, pi and area and assign the relevant values to them
* Note: Area of a ci... | ALGO | 0.995539 | 5.882034 |
aed25f6e-c6c5-4234-9e53-b309d26a6a2f | ShrikantJadhav/CPlusPlus-repository | SqaureScoreDiv2.cpp | #include<iostream>
#include<set>
using namespace std;
class SqaureScoreDiv2
{
public:
int getscore(string s)
{
int c = 0;
for(int i = 0; i < s.size();++i)
{
for(int j = i; j < s.size(); ++j)
{
set<char> st;
for(int k = i; k <= j; ++k)
{
st.insert(s[k]);
}
if(st.siz... | ALGO | 0.99299 | 3.743852 |
454d4bd0-ac2e-4d1e-a69c-918a832900fd | kosovo0275/llvm-project | llvm/lib/Transforms/Utils/BasicBlockUtils.cpp | #include "llvm/Transforms/Utils/BasicBlockUtils.h"
#include "llvm/ADT/ArrayRef.h"
#include "llvm/ADT/SmallPtrSet.h"
#include "llvm/ADT/SmallVector.h"
#include "llvm/ADT/Twine.h"
#include "llvm/Analysis/CFG.h"
#include "llvm/Analysis/DomTreeUpdater.h"
#include "llvm/Analysis/LoopInfo.h"
#include "llvm/Analysis/MemoryDep... | ALGO | 0.9878 | 7.959071 |
967876e9-c262-4aea-a942-884d2d4497e4 | Lydxn/Competitive-Programming | Codeforces/1409/C.cpp | #include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
using namespace std;
using namespace __gnu_pbds;
typedef long long ll;
typedef unsigned long long ull;
typedef long double ld;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;
typedef pair<ll, int> plli;
typedef pair<int, ll> pill;
typedef pair<pa... | ALGO | 0.999591 | 3.544411 |
747f3909-746e-4328-b5e8-b988edcc9895 | iznilul/leetcode- | editor/tree.cpp | //
// Created by Administrator on 2021/1/26.
//
#include <iostream>
#include <vector>
using namespace std;
struct TreeNode {
int val;
TreeNode *left;
TreeNode *right;
TreeNode() : val(NULL), left(nullptr), right(nullptr) {}
TreeNode(int x) : val(x), left(nullptr), right(nullptr) {}
TreeNode(... | ALGO | 0.999836 | 5.771024 |
605be05f-d468-41c7-b7a8-322c3d586665 | ssasied/my-leetcode-solutions | 83-remove-duplicates-from-sorted-list/remove-duplicates-from-sorted-list.cpp | /**
* Definition for singly-linked list.
* struct ListNode {
* int val;
* ListNode *next;
* ListNode() : val(0), next(nullptr) {}
* ListNode(int x) : val(x), next(nullptr) {}
* ListNode(int x, ListNode *next) : val(x), next(next) {}
* };
*/
class Solution {
public:
ListNode* deleteDupli... | ALGO | 0.999981 | 5.675558 |
61433957-8ea7-470e-9a06-1badf19c3b2b | Ali-Mahmoud98/Modern_Cpp | 0x01-Lvalue_and_rvalue/0x00-Intro_lvalue_rvalue.cpp | #include <iostream>
int main() {
// Lvalues: Variables with identifiable memory locations
int x = 5; // x is an lvalue
int* ptr = &x; // Address of x is taken, making it an lvalue
// Rvalues: Temporary values without identifiable memory locations
int result = 2 + 3; // 2 + 3 is an rvalue
//... | TOOL | 0.961001 | 5.32196 |
b4ab4750-e3a0-4455-bbbc-9549745f5f15 | 0point1Zishan/CP | Random_Practice/A_Segment_Tree_for_the_Sum.cpp | #include<bits/stdc++.h>
#define int long long int
#define fast ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL);
using namespace std;
const int N = 1e5 + 5;
int v[N], tr[4 * N];
void build(int node, int l, int r){
if(l == r){
tr[node] = v[l];
return;
}
int mid = (l + r) / 2;... | ALGO | 0.99962 | 5.323219 |
7b262b59-368e-447e-b88b-163b2388bdcf | abdullah-mobin/LightOJ-ProblemSolving | Factorial.cpp | #include <iostream>
#include <iomanip>
using namespace std;
long long int fact(long long int a)
{
long long int s = 1;
for (long long int i = a; i >=1; i--)
{
s *= i;
}
return s;
}
int main()
{
long long int t;
cin >> t;
while (t--)
{
long long int a;
cin >>... | ALGO | 0.999883 | 4.882372 |
95b08dc9-a26d-4652-bc0e-ed0f29beddf2 | ishandutta2007/codeforces | kal013/normal/1203/C.cpp | /*/ Author: kal013 /*/
//#pragma GCC optimize ("O3")
#include "bits/stdc++.h"
#include <cstdio>
using namespace std;
#define int long long
typedef vector<int> vi;
typedef pair<int,int> pii;
typedef pair<pii,int> ppi;
typedef vector<pii> vpi;
typedef priority_queue<ppi> max_heap_ppi;
#define For(i,n) for(int i=0;i<(int)... | ALGO | 0.999861 | 3.894277 |
1366047e-e677-4dec-b215-bb2b327b3720 | ishandutta2007/codeforces | derekfeng/normal/825/E.cpp | #include <bits/stdc++.h>
using namespace std;
void read(int &x){
char ch=getchar();x=0;
for (;ch==' '||ch=='\n';ch=getchar());
for (;ch!=' '&&ch!='\n';x=x*10+ch-'0',ch=getchar());
}
void write(int x){
if (x>9) write(x/10);
putchar(x%10+'0');
}
int n,m,I[100004],p[100004];
vector<int>g[100004];
priority_queue<int>p... | ALGO | 0.999998 | 4.738761 |
b8c2c5b5-1144-47b1-ac48-1986457f96b6 | kundyzbekov/lab4 | task1.cpp | #include <iostream>
using namespace std;
int main()
{
int a;
cin>>a;
if (a%4==0 || a%400==0 && a%100!=0)
{ cout<<"yes"<<endl;}
else { cout<<"no"<<endl;}
system("pause>nul");
return 0;
} | ALGO | 0.999864 | 4.381742 |
2ce5c1ab-cd30-4a30-82da-4d3132f43b2c | H-Shen/MyCodeCollection | Leetcode/2197/2197.cpp | using ll = long long;
ll bingcd(ll a, ll b) {
if (a < 0 || b < 0) return bingcd(abs(a), abs(b));
if (!a || !b) return a | b;
unsigned shift = __builtin_ctz(a | b);
a >>= __builtin_ctz(a);
do {
b >>= __builtin_ctz(b);
if (a > b) swap(a, b);
b -= a;
} while (b);
return... | ALGO | 0.999997 | 5.120414 |
33cd3fac-fda2-43bf-a9b4-6e4f67635123 | sVyu/Algorithm | BAEKJOON/all_problems/23K/23830.cpp | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
void solve(){
int n; cin >> n;
vector<int> zs(n); for(auto &z:zs) cin >> z;
ll p,q,r,s; cin >> p >> q >> r >> s;
ll ans =-1;
ll lo = 1, hi = int(2e5);
while(lo <= hi){
ll k = (lo+hi)/2; // mid
ll sum = 0;
... | ALGO | 0.999901 | 3.811155 |
2d5c8641-e7ca-4d11-af7e-185cdef2b409 | Danish-Git/universal_flutter_utils-1 | example/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.998808 | 6.772262 |
2ac0a0a1-3125-48b8-9202-40e7838fe146 | PavitraMahakulkar/cp- | code/drinksB.cpp | #include<iostream>
#include<bits/stdc++.h>
using namespace std;
int main()
{
int n;
cin>>n;
vector<int> v(n);
long double sum=0;
for(int i=0;i<n;i++){
cin>>v[i];
sum+=v[i];
}
long double frac=sum/(n);
cout<<frac;
} | ALGO | 0.999327 | 3.450082 |
2cb31ce6-ee0e-45d3-a66f-46449f1b8f9a | Faisii786/Data-Structure-and-Algorithm | Circular link list/Circular Link list.cpp | #include <iostream>
#include<conio.h>
using namespace std;
class CNode
{
public:
int info;
CNode*next;
};
class list : public CNode
{
CNode *first,*last;
public:
linklist()
{
first=NULL;
last=NULL;
}
void create()
{
int numnode;
cout<<"enter number of nodes"<<endl;
cin>>numnode;
CNode... | ALGO | 0.962509 | 3.427066 |
fc20c74a-e26c-4c94-90d8-ec4a93a62d86 | raincross7/code-similarity | codes/train_code/problem381/problem381_414.cpp | #include <bits/stdc++.h>
using namespace std;
#define rep(i,n) for(int i=0;i<n;i++)
#define ll long long int
#define INF 1000000007
// cin.eof() 入力個数の問題
int main(){
int a,b,c;
cin>>a>>b>>c;
for(int i=0;i<a*b+1;i++){
if((i*a+b*a)%b==c){
cout<<"YES"<<endl;
return 0;
}
}
cout<<"NO";
return 0;
... | ALGO | 0.999957 | 3.509838 |
90b172db-ab24-495a-98a9-279c8aaed0af | joshua-dgeang/Thesis_code | thirdYear/Feburary_18/tranCos/asCash/oneSide/T1LT2H/DP.cpp | //DP.cpp
#include "DP.hpp"
#include "Hermite.cpp"
#include "sim.cpp"
#include <float.h>
DP :: DP () : maxC_value(100), maxA_value(300), discrete(1.0), smallNum(0.0001), c_mean(-5.0), c_std(5.0), discR(1.0/1.02), action_step_size(1), returnRate(0.05){
maxC = maxC_value/discrete;
maxA = maxA_value/discrete;
OldV = ne... | ALGO | 0.999802 | 4.084559 |
9b273ae5-fe53-4e65-bf9d-6f983b2030f2 | Saswat7101/110-CPP-Practie-Questions | Abstraction.cpp | // 97. Demonstrate abstraction using pure virtual functions.
#include <iostream>
using namespace std;
class Shape {
public:
virtual double calculateArea() = 0;
};
class Circle : public Shape {
private:
double radius;
public:
Circle(double r) : radius(r) {}
double calculateArea() override {
... | TOOL | 0.935434 | 6.696345 |
190df59b-21b4-4bfb-8c88-439995398930 | hyongok2/roadmap | 01. Programming Languages/Cplusplus/code_nuri_class/STL/3040/category9.cpp | #include <algorithm>
using namespace std;
template<typename InputIt, typename T>
InputIt
efind(InputIt first, InputIt last, T value)
{
while (first != last && *first != value)
++first;
return first;
}
int main()
{
int x[3] = { 1,2,3 };
int* p = efind(x, x + 3, 2);
//reverse();
//sort()
} | ALGO | 0.999376 | 4.331618 |
49dd951e-f0a7-40e9-ba2e-3d935c10a1ac | ishandutta2007/codeforces | aloneknight/normal/1188/C.cpp | #include<bits/stdc++.h>
using namespace std;
#define ll long long
const int N=1005,P=998244353;
int n,k,m,ans,a[N],f[N][N];
int main()
{
scanf("%d%d",&n,&k);m=100000;
for(int i=1;i<=n;++i)scanf("%d",&a[i]);
sort(a+1,a+n+1);
for(int w=1;w<=m/(k-1)+1;++w)
{
f[0][0]=1;
for(int i=1,r=0;i<=n;++i)
{
while(a[r+1... | ALGO | 0.999928 | 4.033177 |
47367771-c4a9-4862-a8e0-308dac8edfd3 | sefaerkan/CPP-programming-language-projects | C++/Veri Yapıları/Linked List/find().cpp | #include <iostream>
using namespace std;
class Node{
public:
Node(const int& data= 0,Node* next =NULL) : data(data),next(next){ }
int data;
Node* next; //areti
};
class list{
Node* root; //Liste kk
Node* tail; //Son eleman
int lenght;
Node* findPrev(Node* pos){ //Pozisyon verip ncesini bulma
Node* tmp= r... | TOOL | 0.926631 | 3.858366 |
69a14592-1f85-4d8a-b36e-cfe6cefbd1be | bitcoinmono/bitcoinmono_monerobase | src/common/i18n.cpp | #include <stdlib.h>
#include <string.h>
#include <ctype.h>
#include <string>
#include <map>
#include "include_base_utils.h"
#include "file_io_utils.h"
#include "common/util.h"
#include "common/i18n.h"
#include "translation_files.h"
#undef MONERO_DEFAULT_LOG_CATEGORY
#define MONERO_DEFAULT_LOG_CATEGORY "i18n"
static c... | TOOL | 0.866452 | 6.175295 |
09c11a82-866c-4c30-8b16-520869636ecb | RONGTAO-WU/SZTU_data-structure | 数据结构9-二叉树和哈夫曼/数据结构9-二叉树和哈夫曼/25_04_25.cpp | //#include<iostream>
//using namespace std;
//#include<vector>
//#include<queue>
//
//struct TreeNode
//{
// int val;
// TreeNode* left;
// TreeNode* right;
//
// TreeNode(const int& x)
// :val(x)
// ,left(nullptr)
// ,right(nullptr)
// { }
//};
//
//TreeNode* SeqBuildTree(const vector<int>& v1) //
//{
// i... | ALGO | 0.999942 | 4.183801 |
7e8400de-292f-4bf1-91d6-dc552b853d9e | WilliamHGray/AdventOfCode2024 | AOC24_19/Source.cpp | #include "Elves.h"
#include <map>
#include <algorithm>
using namespace std;
vector<vector<int>> moves = { {0,-1},{1,0},{0,1},{-1,0} };
int maxSize = 1;
int64_t getNumTowels(string towels, map<string, int64_t>& numTowels, vector<string> patterns)
{
if (numTowels.count(towels)==1)
{
return numTowels[towels];
}
el... | ALGO | 0.997689 | 5.126275 |
737dfc10-c82b-431d-b5da-ce3087ab11d5 | Pasindu599/CS2023_DSA_210574A | Lab6/Stack_LinkedList.cpp | #include <iostream>
#include <chrono>
#include <iomanip>
#include <cstdlib>
using namespace std;
struct Node{
int data;
struct Node *next;
};
struct Stack{
Node* head = NULL;
Node* top = NULL;
bool isEmpty(){
if (top == NULL) {
return true;
}
return false;
}
... | ALGO | 0.981631 | 4.600211 |
5a1f2f9c-0cec-4002-8c02-ef93e17e190b | thisis-arman/cse-funda | DSA/Linked List/module-03/Y_Range_sum_query.cpp | #include <bits/stdc++.h>
using namespace std;
int main()
{
int n, q;
cin >> n >> q;
vector<long long int> v(n + 1);
for (int i = 1; i <= n; i++)
{
cin >> v[i];
}
vector<long long int> pre(n + 1);
pre[1] = v[1];
for (int i = 2; i <= n; i++)
{
pre[i] = pre[i - 1] ... | ALGO | 0.999847 | 4.238449 |
eb1f1485-8de2-4f0b-a4a1-42deda44590d | Igalia/mesa | src/compiler/glsl/lower_discard.cpp | /**
* \file lower_discard.cpp
*
* This pass moves discards out of if-statements.
*
* Case 1: The "then" branch contains a conditional discard:
* ---------------------------------------------------------
*
* if (cond1) {
* s1;
* discard cond2;
* s2;
* } else {
* s3;
* }
*
* becomes:
*
* ... | ALGO | 0.868473 | 7.731054 |
932ed4c2-1cb9-4a77-836a-0a03f715529f | mahamfathy/problem-solving | pointers/arithmetic-array-pointer.cpp | #include <iostream>
using namespace std;
int main()
{
int nums[] = {10, 20, 30, 40, 50};
cout << nums << endl;
cout << &nums << endl;
cout << nums[0] << endl;
cout << *nums << endl;
cout << nums[1] << endl;
cout << *(nums + 1) << endl;
cout << &nums + 1 << endl;
cout << &nums + 2 <<... | ALGO | 0.995264 | 3.087272 |
04e7e59f-971f-4d09-92c5-8914055fd801 | adi-tyasingh/CP | 96A.cpp | #include<bits/stdc++.h>
using namespace std;
int main()
{
string str;
cin>>str;
int count=0;
int county=0;
for(int i=0;i<str.length();i++)
{
if(count==0 && str[i]=='1')
count++;
else if(count>0 && str[i]=='1')
count++;
else if(count>0 && str[i]=='0')
count = 0;
if(county==... | ALGO | 0.999958 | 3.422734 |
8f474d18-e0ee-4924-9a6f-df5f33a616dd | ihays/LeetCode | C++/ValidAnagram.cpp | //Ian Hays
//02-11-2021
//https://leetcode.com/problems/valid-anagram/
//SC: O(1) TC: O(1)
class Solution {
public:
bool isAnagram(string s, string t) {
int chars[26] = {0};
for(auto ch : s) ++chars[ch-'a'];
for(auto ch : t) if(--chars[ch-'a'] < 0) return false;
return s.length() ==... | ALGO | 0.999972 | 6.62625 |
e5aff4ad-c500-43e9-96d6-2e0cf1d3993f | xsellart/term3_path_planning | src/Eigen-3.3/doc/snippets/JacobiSVD_basic.cpp | MatrixXf m = MatrixXf::Random(3,2);
cout << "Here is the matrix m:" << endl << m << endl;
JacobiSVD<MatrixXf> svd(m, ComputeThinU | ComputeThinV);
cout << "Its singular values are:" << endl << svd.singularValues() << endl;
cout << "Its left singular vectors are the columns of the thin U matrix:" << endl << svd.matrixU(... | ALGO | 0.999619 | 3.463409 |
08d92776-e71f-44d3-8375-e466bb9b1de5 | Ankit-baghel431/Leetcode | 0073-set-matrix-zeroes/0073-set-matrix-zeroes.cpp | class Solution {
public:
void setZeroes(vector<vector<int>>& matrix) {
int row = matrix.size();
int col = matrix[0].size();
vector<int> temp1(row, 1);
vector<int> temp2(col, 1);
for(int i =0; i<row; i++){
for(int j=0; j<col; j++){
if(mat... | ALGO | 0.999142 | 6.08275 |
58846112-6706-4e6b-9016-54b229adcbda | gaia-platform/GaiaPlatform | third_party/production/TranslationEngineLLVM/llvm/lib/CodeGen/LoopTraversal.cpp | #include "llvm/CodeGen/LoopTraversal.h"
#include "llvm/ADT/PostOrderIterator.h"
#include "llvm/CodeGen/MachineFunction.h"
using namespace llvm;
bool LoopTraversal::isBlockDone(MachineBasicBlock *MBB) {
unsigned MBBNumber = MBB->getNumber();
assert(MBBNumber < MBBInfos.size() && "Unexpected basic block number.");
... | ALGO | 0.999035 | 7.627181 |
2cdd9063-44a4-4bcb-b344-ef352a41622e | lzztt/cpp | leetcode/336_Palindrome_Pairs.cpp | class Solution {
public:
vector<vector<int>> palindromePairs(vector<string>& words) {
const int N = words.size();
vector<vector<int>> ret;
if (N < 2) return ret;
vector<string> rwords = words;
for (auto& w : rwords) reverse(w.begin(), w.end());
unordered_map<string... | ALGO | 0.999959 | 6.431313 |
c7179c7e-4ef2-41fd-b92c-aee31451ab5d | jeha0714/Algorithm | Implement/Silver 2/20231112_1541/solution.cpp | #include <iostream>
#include <string>
using namespace std;
/* Main */
int main(void)
{
std::ios_base::sync_with_stdio(false);
std::cout.tie(NULL);
std::cin.tie(NULL);
string formula;
int32_t temp;
int32_t index;
int32_t result;
/* Set initial input */
cin >> formula;
index = 0;
// set result to first nu... | ALGO | 0.999987 | 4.483224 |
861672dc-a2e7-46bf-9781-63e693124e21 | Shreesh90/CP | Codechef/Challenges/21July/Long/EITA.CPP | #include<bits/stdc++.h>
using namespace std;
#define int long long
int32_t main()
{
int t;
cin>>t;
while(t--){
int d,x,y,z;
cin>>d>>x>>y>>z;
int a = 7*x;
int b = d*y + (7-d)*z;
cout<<max(a,b)<<endl;
}
} | ALGO | 0.999484 | 3.516045 |
701b7657-74f2-4d19-aad0-7440bca228c4 | aerosayan/solution | src/ADANUM-TLE.cpp | /*
O((N + Q) * sqrt(N) * log(N)) solution using MO's algoritm
Gets time limit exceeded verdict...
MAX test may run in ~5 seconds. Probably, this solution can not be fastened further.
*/
#include <iostream>
#include <cstdio>
#include <algorithm>
#include <vector>
using namespace std;
const int MAX = 200005;
const... | ALGO | 0.999575 | 4.497009 |
98c76c1f-d807-41bb-8827-c2d8791c55ff | vishusharmaX/100DaysofCodeChallenge | Difficulty: Medium/Missing And Repeating/missing-and-repeating.cpp | //{ Driver Code Starts
#include <bits/stdc++.h>
using namespace std;
// } Driver Code Ends
class Solution {
public:
vector<int> findTwoElement(vector<int>& arr) {
// code here
int n = arr.size();
vector<int>ans(n+1,0);
for(int i = 0; i < n; i++){
ans[arr[i]]+... | ALGO | 0.999691 | 5.670062 |
fba99f02-fd5d-4093-9167-a67082e4d861 | smhemel/Codeforces-Online-Judge | Codeforces Round #393 (Div. 2) - B. Frodo and pillows/Codeforces Round #393 (Div. 2) (8VC Venture Cup 2017 - Final Round Div. 2 Edition), problem: (B) Frodo and pillows/main.cpp | #include <iostream>
using namespace std;
int main()
{
int n,m,k,cont=1,add=1;
scanf("%d%d%d",&n,&m,&k);
m=m-n;
int pil =k+1;
int bed =k-1;
while(m-add>=0)
{
m = m-add;
cont++;
if(pil<n+1) {
add++;
pil++;
}
if(bed>0) {
... | ALGO | 0.999983 | 3.268768 |
f0aefeaa-0e68-4220-a633-68d00d72f1a3 | Hasan1485/competitive-coding | codeforces/1324A.cpp | /*
author-sesky_crocdile
once a crocodile
always a CROCODILE
*/
#include <bits/stdc++.h>
#define ll long long int
using namespace std;
int start_up() {
ios_base::sync_with_stdio(false);
cin.tie(NULL);
return 0;
}
int static r = start_up();
int main() {
int t;
cin >> t;
while (t--) {
int ... | ALGO | 0.99956 | 4.834564 |
31feafb3-3602-4b3b-a43a-79e679d2dda0 | praveenmunukutla/leetcode | 906-walking-robot-simulation/walking-robot-simulation.cpp | #define edist(x, y) (((x) * (x)) + ((y) * (y)))
class Solution {
public:
int robotSim(vector<int>& commands, vector<vector<int>>& obstacles) {
int max_distance = 0; // Maximum Euclidean distance squared
unordered_map<int, unordered_set<int>> obstacle_map; // Stores obstacles by x-coordinate
... | ALGO | 0.99991 | 5.961461 |
2f427e9b-4e71-4ddf-9ee5-faa528da0544 | AravindHegde/Zoppy | zoppyfrontend/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.998564 | 6.763549 |
47392f8a-9dc4-4e4f-807f-c203f033dedc | Madhumidha-S/DSA | Curious Freaks/Basics/Even or Odd.cpp | /*Even or Odd*/
class Solution {
public:
string oddEven(int n) {
if(n%2 == 0)
{
return "even";;
}
else
{
return "odd";
}
}
}; | ALGO | 0.999947 | 4.946121 |
158ff310-ad60-4691-89c5-f03c2a5fef29 | amankbps/Competititve-Programming | K_Max_Number.cpp | #include <bits/stdc++.h>
using namespace std;
#define REP(i,x,y) for(long long i=x;i<y;i++)
#define F first
#define S second
#define pb push_back
#define eb emplace_back
#define MOD 1000000007
#define int long long
typedef long long ll;
typedef vector<int> vi;
typedef vector<vi> vvi;
typedef vector<ll> vll;
typedef ... | ALGO | 0.999987 | 4.246096 |
0a6172b0-ab92-4e12-b554-b484a7de8a44 | Gharbaoui/algorithms-and-data-structures | xor-linex-list/xor-linked-list.cpp | #include <iostream>
#include "xor-linked-list.hpp"
#include <vector>
struct Gen
{
Gen() {srand(time(nullptr));}
int operator()(){return rand() % 100 - rand() % 100;}
};
int main()
{
XorLinkedListCont<int> ls;
std::vector<int> arr(20);
std::generate(arr.begin(), arr.end(), Gen());
for (auto v : arr)
std::co... | TOOL | 0.996702 | 4.094293 |
61f20be5-4e64-4ce3-a70b-0cbe06d71053 | Ansore/LeetcodeSolutions | 72.re-space-lcci/ReSpaceLcci.cpp | #include <iostream>
#include <string>
#include <vector>
using namespace std;
class Trie {
public:
Trie* next[26] = {nullptr};
bool isEnd;
Trie() {
isEnd = false;
}
void insert(string s) {
Trie* curPos = this;
for(int i=s.length()-1; i >= 0; i --) {
int t = s[i] - 'a';
if(curPos->next[t] ... | ALGO | 0.999926 | 5.016421 |
3a57ba6a-34d0-4539-9279-1cd3b596a66e | ggauthie/stage_swimmerDetection | Code/src/splitMerge.cpp | #include <string.h>
#include <stdlib.h>
#include "splitMerge.h"
void splitGray(int nbSlice, int width, int height, unsigned char *src, unsigned char *dest){
int i;
int sliceSize = width*height/nbSlice;
// Fill first and last line with 0
memset(dest,0,width);
// First Slice
memcpy(dest+width, ... | ALGO | 0.937347 | 4.439938 |
d11175fc-e3ac-4051-ab60-5e7db1460421 | hong19891207/carto_release | src/eigen3/demos/mandelbrot/mandelbrot.cpp | #include "mandelbrot.h"
#include <iostream>
#include<QtGui/QPainter>
#include<QtGui/QImage>
#include<QtGui/QMouseEvent>
#include<QtCore/QTime>
void MandelbrotWidget::resizeEvent(QResizeEvent *)
{
if(size < width() * height())
{
std::cout << "reallocate buffer" << std::endl;
size = width() * height();
i... | ALGO | 0.921369 | 5.79494 |
911f1556-5ea6-4577-9fc1-f199d300b2e7 | infitake/pcp | takeuforward-problems/day25/cutrod.cpp | #include <bits/stdc++.h>
using namespace std;
int cutrod(int arr[],int n){
if(n<=0) return 0;
int maxval=INT_MIN;
for(int i=0;i<n;i++)
maxval = max(maxval,arr[i]+cutrod(arr,n-1-i));
return maxval;
}
int cutrod(int arr[],int n){
int val[n+1];
val[0]=0;
int maxval;
for(int i=1;i<=n;i++){
maxval = INT_M... | ALGO | 0.999756 | 4.748087 |
729e9338-130b-4dc1-9c0a-125b782aea82 | ishandutta2007/codeforces | miraclefafa/normal/575/F.cpp | #include <cstdio>
#include <cstring>
#include <cmath>
#include <algorithm>
#include <vector>
#include <string>
#include <map>
#include <set>
#include <cassert>
using namespace std;
#define rep(i,a,n) for (int i=a;i<n;i++)
#define per(i,a,n) for (int i=n-1;i>=a;i--)
#define pb push_back
#define mp make_pair
#define all(... | ALGO | 0.999887 | 3.629486 |
05f0b5fa-adac-43f9-91f0-be47b8f7efd3 | MuhammadDanish01/bookworm1 | windows/runner/utils.cpp | #include "utils.h"
#include <flutter_windows.h>
#include <io.h>
#include <stdio.h>
#include <windows.h>
#include <iostream>
void CreateAndAttachConsole() {
if (::AllocConsole()) {
FILE *unused;
if (freopen_s(&unused, "CONOUT$", "w", stdout)) {
_dup2(_fileno(stdout), 1);
}
if (freopen_s(&unuse... | TOOL | 0.9988 | 6.76073 |
4dae5fb9-d12c-473b-9b9f-bb4fc27556f6 | 101magikarp101/USACO | 2025-open-plat/2025-open-plat-2.cpp | #include <bits/stdc++.h>
using namespace std;
using ll = long long;
#define MOD 998244353
#define MOD2 1000000007
#define vt vector
#define endl '\n'
#define pb push_back
#define pf push_front
#define all(x) x.begin(),x.end()
#define sz(x) (int)((x).size())
#define uset unordered_set
#define umap unordered_map
#define ... | ALGO | 0.999817 | 3.766682 |
7669e5a1-a4a7-43b9-8288-fe2797b69615 | jlonic/oop | vjezba_11/zd5main.cpp | #include <iostream>
#include "zd5.h"
int main()
{
vekt v;
Trokut t1(1,2,3);
Trokut t2(4,5,6);
Trokut t3(1,5,6);
v.unos(t1);
v.unos(t2);
v.unos(t3);
int a=v.najveci_opseg(); //a=mjesto trokuta s najduzim opseg u vektoru
Trokut t=v.getTrokut(a);
std::cout<<"stranice najduz... | ALGO | 0.986488 | 4.341089 |
3bdfedc6-eb5b-4a1a-994c-48b813cdbbcd | aditi2802/LeetCode | 1288-remove-covered-intervals/1288-remove-covered-intervals.cpp | class Solution {
public:
static bool mysort(vector<int>&v1, vector<int>&v2){
if(v1[0]==v2[0]){
return v1[1]>v2[1];
}
else{
return v1[0]<v2[0];
}
}
int removeCoveredIntervals(vector<vector<int>>& intervals) {
int n = interval... | ALGO | 0.999956 | 5.824316 |
eee56134-bca0-4c33-925b-d78a4beb71bb | kusl007/Kumar-k-Sir-DSA | Hashing/prefix and suffix /atlassian/first/code.cpp | #include <iostream>
#include <vector>
#include <unordered_map>
int main() {
int n;
std::cin >> n; // Read the value of n
std::vector<int> b(n); // Initialize a vector b of size n
for (int i = 0; i < n; i++) {
std::cin >> b[i];
}
int tot_sum = 0;
int c = 0;
// Calculate the ... | ALGO | 0.999973 | 5.109 |
c803b48f-d91b-4ea1-8eef-a34c9529e56b | sarvex/leetcode-rect | solution/0200-0299/0234.Palindrome Linked List/Solution.cpp | /**
* Definition for singly-linked list.
* struct ListNode {
* int val;
* ListNode *next;
* ListNode() : val(0), next(nullptr) {}
* ListNode(int x) : val(x), next(nullptr) {}
* ListNode(int x, ListNode *next) : val(x), next(next) {}
* };
*/
class Solution {
public:
bool isPalindrome(Lis... | ALGO | 0.999881 | 6.048282 |
a3609dd9-b817-4696-8c5d-52551e15ad14 | Sing-How/DataStructExperiments | ex10_1.cpp | #include "bits/stdc++.h"
template <class T>
class minHeap
{
T *heap;
int heapSize, arrayLength;
public:
minHeap()
{
heapSize = 0;
arrayLength = 10000;
heap = new T[arrayLength];
}
minHeap(T *theHeap, int theSize)
{
arrayLength = 10000;
heap = new T[... | ALGO | 0.99964 | 3.988954 |
5b99914d-c37b-4c6d-ba86-a7d556c2a53b | TrQ-Hoan/C-Curriculum-GenII | End-term/ABC189/B/sol.cpp | #include <bits/stdc++.h>
using namespace std;
int main() {
ios_base::sync_with_stdio(false); cin.tie(nullptr);
//freopen("task.in", "r", stdin);
//freopen("task.out", "w", stdout);
int n, x, s = 0, ans = -1;
cin >> n >> x;
x *= 100;
bool drunk = false;
for (int i = 0; i < n; ++i) {
... | ALGO | 0.999731 | 4.330954 |
38128250-1d1d-4600-90ec-7904be991a06 | scheninsp/Cpp_Reps | algorithms/DAG_topological_sort_2.cpp | //toposort
// topoSort_dfs output:
//4 5 0 2 3 1
// topoSortAll output:
//4 5 0 2 3 1
//4 5 2 0 3 1
//...
//5 4 2 3 0 1
//5 4 2 3 1 0
#include<iostream>
#include<list>
#include<vector>
using namespace std;
class Graph {
private:
int nv;
list<int> *adj;
public:
Graph(int n) :nv(n) {
adj = new list<int>[nv];... | ALGO | 0.999989 | 5.293052 |
52e57077-6a02-44b8-adc0-5b0cb4d921c5 | getState/Algorithm | 코드플러스중급2/브루트포스/연구소3.cpp | #include <iostream>
#include <vector>
#include <queue>
#include <algorithm>
#include <math.h>
#define INF 987654321
using namespace std;
int board[50][50];
int arr[10][50][50];
int N, M;
int K = 0;
int dnX[] = {0, 0, -1, 1};
int dnY[] = {1, -1, 0, 0};
vector<pair<int, int>> viruses;
int answer = INF;
bool check(vecto... | ALGO | 0.999843 | 4.14795 |
8011cd99-4eae-48f1-a301-9b870f5ced63 | TheSkyFucker/acm-icpc | contest/codeforces_normal/round_4/C.cpp | #include<bits/stdc++.h>
using namespace std;
typedef double db;
typedef long long ll;
typedef vector<int> vi;
typedef pair<int, int> pii;
#define fi first
#define se second
#define mp make_pair
#define pb push_back
#define sz(x) ((int)(x).size())
#define all(x) (x).begin(),(x).end()
#define rep(i,l,r) for(int i=(l);i<(... | ALGO | 0.992317 | 4.417427 |
8894870a-5522-453b-ab56-098f1e39f5d3 | roy4801/107_Gernic_Programming | cppstdlib-code/algo/inplacemerge1.cpp | #include "algostuff.hpp"
using namespace std;
int main()
{
list<int> coll;
// insert two sorted sequences
INSERT_ELEMENTS(coll,1,7);
INSERT_ELEMENTS(coll,1,8);
PRINT_ELEMENTS(coll);
// find beginning of second part (element after 7)
list<int>::iterator pos;
pos = find (coll.begin(), c... | ALGO | 0.998427 | 4.181284 |
fdc40a22-7989-43ad-8d11-c70919cbdbeb | devanshtyagi26/TheoryOfComputation | startAendB.cpp | #include <iostream>
#include <string>
#include <vector>
#include <algorithm>
using namespace std;
string returnNextState(string State, string input, vector<string> &States, string &inputAlphabets, vector<vector<string>> &TransitionTable){
auto it = find(States.begin(), States.end(), State);
return TransitionT... | ALGO | 0.99996 | 5.564524 |
a1839b27-f3d4-4a39-a6f1-f8dd52782240 | Dynasty-Chain/Core | src/rpc/mining.cpp | #include <amount.h>
#include <chain.h>
#include <chainparams.h>
#include <consensus/consensus.h>
#include <consensus/params.h>
#include <consensus/validation.h>
#include <core_io.h>
#include <key_io.h>
#include <miner.h>
#include <net.h>
#include <node/context.h>
#include <policy/fees.h>
#include <pow.h>
#include <rpc/... | WEB | 0.98454 | 6.536365 |
d42a7f43-1b85-4551-ae8d-29cddd3205f6 | Johniel/contests | atcoder/abc248/E/main.cpp | // atcoder/abc248/E/main.cpp
// author: @___Johniel
// github: https://github.com/johniel/
#include <bits/stdc++.h>
#define each(i, c) for (auto& i : c)
#define unless(cond) if (!(cond))
// #define endl "\n"
using namespace std;
template<typename P, typename Q> ostream& operator << (ostream& os, pair<P, Q> p) { os ... | ALGO | 0.999927 | 5.082388 |
0b1e9461-cc8c-4f12-abde-4fc0b2725bd0 | manshisharma1372/POTD_Streak | Floor in a Sorted Array - GFG/floor-in-a-sorted-array.cpp | //{ Driver Code Starts
#include <bits/stdc++.h>
using namespace std;
// } Driver Code Ends
class Solution{
public:
// Function to find floor of x
// n: size of vector
// x: element whose floor is to find
int findFloor(vector<long long> arr, long long n, long long x){
// Your code her... | ALGO | 0.999957 | 6.03222 |
3cbc0e8e-8fa8-4719-9c76-1bc0c72946a8 | proxmox/ceph | ceph/src/boost/libs/icl/example/man_power_/man_power.cpp | /** Example man_power.cpp \file man_power.cpp
\brief Using set style operators to compute with interval sets and maps.
Interval sets and maps can be filled and manipulated using
set style operation like union (+=), difference (-=) and intersection
(&=).
In this example 'man_power' a number of thos... | ALGO | 0.910699 | 5.001825 |
e4568270-cd71-4fbd-9b6a-f21560dbe594 | TyeolRik/CodingProblems_CPP | BaekJoon Online Judge/단계별로 풀어보기/13) 정렬/10989.cpp | // https://www.acmicpc.net/problem/10989
#include <iostream>
#include <vector>
#include <algorithm>
int counter[10001] = {0,};
int main() {
std::cin.tie(NULL);
std::cin.sync_with_stdio(false);
int N;
std::cin >> N;
int eachInput;
for(int i = 0; i < N; i++) {
std::cin >> eachInput;
... | ALGO | 0.999807 | 4.647453 |
e44f732a-1744-47b8-a2dc-ba63cfa6c395 | igor-pavkov/honours-2024 | Code Examples/DiverseVul Filtered/Secure/dbcc7d57bffc0c8cac9dac11bec548597d59a6a5-45.cpp | int btrfs_find_next_key(struct btrfs_root *root, struct btrfs_path *path,
struct btrfs_key *key, int level, u64 min_trans)
{
int slot;
struct extent_buffer *c;
WARN_ON(!path->keep_locks && !path->skip_locking);
while (level < BTRFS_MAX_LEVEL) {
if (!path->nodes[level])
return 1;
slot = path->slots[level... | ALGO | 0.995679 | 4.063099 |
3063d2c4-3f7c-44cd-9037-dc7b8dec165b | RakibRahman/Cpp-Codes | More-CPP/Extra/Foor Loop Ex/Foor Loop Ex/Source.cpp | #include <iostream>
using std::cin;
using std::cout;
using std::endl;
int main() {
int arr[] = { 10,21,32,43,54,65 };
cout << "Showing array elements using for loop: " << endl;
for (int a = 0; a < 6; a++) {
cout << arr[a] << endl;
}
//Positive integers 1, 2, 3, 4... are known as natural numbers.
//Finding out... | ALGO | 0.915948 | 3.324462 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.