uuid stringlengths 36 36 | repo_name stringlengths 5 123 | relative_path stringlengths 5 4k | content stringlengths 33 2.85M | category stringclasses 6
values | algo_rel_score float64 0.85 1 | quality_score float64 3 8.76 |
|---|---|---|---|---|---|---|
c4076577-1613-47f5-ac48-9b9959343bba | AlNomanCSE/learn-C- | STL/vector.cpp | #include <iostream>
#include <vector>
using namespace std;
int main()
{
vector<int> vec = {1,3,4,5,6,10};
vector<int>::iterator it;
for (it = vec.begin(); it != vec.end(); it++)
{
cout << *it << endl;
}
for (auto it = vec.rbegin(); it != vec.rend(); it++)
{
cout << *it << en... | TOOL | 0.877183 | 3.253244 |
28e0175a-1395-46eb-948f-83cf3505751c | UlisesMontenegro/Algoritmos-y-Programacion-II | TP1/Codigo/preParse.cpp | #include <iostream>
#include <string>
#include <string.h>
#include <cctype>
#include "constantes.h"
using namespace std;
bool preParse(string);
int main(){
string fun;
cin>>fun;
if(preParse(fun))
cout<<"La sentencia es correcta"<<endl;
else
cout<<"La sentencia es incorrecta"<<endl;
... | ALGO | 0.99284 | 3.578052 |
58f27a8a-d414-4788-afd5-b6804201d385 | jyotsnatiwary/Data-structures-algo | coding-ninjas/Graph -2/Prim's Algorithm.cpp | /*Code : Prim's Algorithm
Send Feedback
ID: 1724
Given an undirected, connected and weighted graph G(V, E) with V number of vertices (which are numbered from 0 to V-1) and E number of edges.
Find and print the Minimum Spanning Tree (MST) using Prim's algorithm.
For printing MST follow the steps -
1. In one line, print... | ALGO | 0.99999 | 4.530585 |
863991e5-86ab-42f5-ade9-ab185f8240f5 | karush17/DSAA-practice | Part-9/CreateHeap/createheap.cpp | #include <iostream>
#include <stdio.h>
using namespace std;
void Insert(int *A, int n)
{
int temp, i=n;
temp = A[n];
while(i>0 && temp>A[i/2])
{
A[i] = A[i/2];
i = i/2;
}
A[i] = temp;
}
void display(int *A, int n)
{
for(int i=0;i<n+1;i++)
{
printf("%d ", A[i]);... | ALGO | 0.999934 | 3.998384 |
f7fa816c-495c-414a-bb4a-6c80ea5ba2fc | dlwogns/data_structure | prob11-1.cpp | #include <iostream>;
using namespace std;
class Node {
private:
int data;
int checked = 0;
Node* par;
Node* left;
Node* right;
public:
Node(int);
void setLeft(Node*);
void setRight(Node*);
friend class BST;
};
Node::Node(int data) {
this->data = data;
this->par = NULL;
this->left = NULL;
this->right = ... | ALGO | 0.99999 | 4.227893 |
1aec12cf-64a7-4bcf-9a56-b8043ac4d651 | avalero/curso-cpp | ejemplos/graph/simple/main.cpp | #include "Node.h"
#include <memory>
#include <vector>
#include <iostream>
#include <limits>
using namespace std;
bool removeNode(vector<shared_ptr<Node>> &nodes, shared_ptr<Node> node)
{
for (auto it = nodes.begin(); it != nodes.end(); ++it)
{
if (*it == node)
{
nodes.erase(it);
for (auto &n : ... | ALGO | 0.999909 | 5.218213 |
62860f2e-6745-4d46-ba83-733b55212b72 | ze-zonr/software_lab | 1_2/additional_exercise/main.cpp | #include <iostream>
#include <fstream>
#include <cmath>
using namespace std;
class waveHeader {
public:
waveHeader() {};
int chunkID, chunkSize, Format, subChunkID, subChunk1size;
short audioFormat, numChannels;
int sampleRate, byteRate;
short blockAlign, bitsPerSample;
int subChunk2ID, subChun... | ALGO | 0.957758 | 3.50361 |
68e021aa-8d94-4a39-9f38-5b685d1a1d55 | AruzhanBazarbai/pp1 | labs/lab3/E.cpp | //Given an array consisting of integers.
// Write a program, which finds sum of all elements
#include <iostream>
using namespace std;
int main(){
int n;
cin >> n;
int a[n];
long long sum=0;
for(int i=0; i<n; i++){
cin >> a[i];
}
for(int i=0; i<n; i++){
sum+=a[i];
}
c... | ALGO | 0.998767 | 4.764319 |
c73dde3a-fb79-4be2-89d3-2fa4006ef82a | brownfox2k6/UET_code_submissions | INT1008 - Nhập môn lập trình/Tuần 06 - Mảng và các thao tác trên mảng/Ngân hàng bài tập - Mảng Hai chiều (Tuần 6)/InsertRow.cpp | #include <iostream>
using namespace std;
signed main() {
int n, m;
cin >> n >> m;
int a[n][m];
for (int i = 0; i < n; ++i) {
for (int j = 0; j < m; ++j) {
cin >> a[i][j];
}
}
int id, x;
cin >> id >> x;
for (int i = 0; i < n; ++i) {
if (i == id - 1) {
id = -1;
--i;
fo... | ALGO | 0.998859 | 3.476205 |
e87d8b8b-e5e2-438f-b479-c968a29b673e | yeonjae11/PDP | pytorch/aten/src/ATen/native/cuda/TensorModeKernel.cpp | #define TORCH_ASSERT_ONLY_METHOD_OPERATORS
#include <ATen/native/cuda/TensorModeKernel.h>
#include <ATen/cuda/CUDAConfig.h>
#include <ATen/native/CanUse32BitIndexMath.h>
#include <ATen/native/ReduceOpsUtils.h>
#include <ATen/native/Resize.h>
#include <ATen/native/TensorCompare.h>
constexpr int64_t MAX_BLOCK_SIZE = AT_... | TOOL | 0.901571 | 7.788859 |
d1674683-52f3-46cc-8da8-ab5ec1b0db2d | cuongct220020/IT3170-Application-Algorithm-Exercises | Self_Study/PrefixSum/bt5_CumuArr.cpp | #include <iostream>
#include <vector>
using namespace std;
int main() {
ios_base::sync_with_stdio(false);
cin.tie(0);
cout.tie(0);
int n;
cin >> n;
vector<int> A(n + 1), C(n + 1);
C[0] = 0;
for (int i = 1; i <= n; i++) {
cin >> A[i];
C[i] = C[i - 1] + A[i];
}
... | ALGO | 0.999904 | 4.403734 |
cc8b8a4c-328d-425f-a8f7-1a1d05b71a32 | Kevin-Napoleone/luamake | luadedebug/luamake/bee.lua/bootstrap/main.cpp | #if defined(_WIN32) && !defined(_CRT_SECURE_NO_WARNINGS)
# define _CRT_SECURE_NO_WARNINGS
#endif
#include <bee/nonstd/filesystem.h>
#include <bee/nonstd/unreachable.h>
#include <bee/utility/path_helper.h>
#include <binding/binding.h>
#include <signal.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#i... | TOOL | 0.909847 | 6.365603 |
baf31d8a-33db-4038-8023-dc135398ef75 | Muhsin95952/app_development | provider_practice/provider_practice/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.997528 | 6.76073 |
195f4ccc-099c-4da2-b2a6-c3571c4eee89 | minhkhuong2404/codeForce | codeForce/66B/main.cpp | #include <bits/stdc++.h>
using namespace std;
int main()
{
int n;
cin>>n;
int arr[n],mx=0;
for(int i=0;i<n;i++)cin>>arr[i];
for(int i=0;i<n;i++){
int end = i;
for(int j=i+1;j<n;j++)
if(arr[j] >= arr[j-1])
end = j;
else break;
for(int j=end+1;j<n;j++)
if(arr[j] <= arr[j-1])
end = j;
else ... | ALGO | 0.999749 | 4.087157 |
1b73968b-10c5-4d31-825b-026dbdb6e1fc | HashimHB/cpp-programs | Basic Programs/prime.cpp | #include <iostream>
using namespace std;
int main(){
int n;
cin>>n;
int i;
for(i=2;i<n;i++){
if(n%i==0){
cout<<"Not-prime"<<endl;
break;
}
}
if(n==i){
cout<<"Prime"<<endl;
}
return 0;
} | ALGO | 0.999582 | 3.683009 |
f8141d09-c5a6-4519-8ff9-5e53d81094d1 | itzMatze/slang | source/core/slang-string-util.cpp | #include "slang-string-util.h"
#include "slang-blob.h"
#include "slang-char-util.h"
#include "slang-text-io.h"
namespace Slang {
// !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! StringUtil !!!!!!!!!!!!!!!!!!!!!!!!!!!
/* static */bool StringUtil::areAllEqual(const List<UnownedStringSlice>& a, const List<UnownedStringSli... | TOOL | 0.955469 | 7.509612 |
9ccd938a-c42b-4cb7-a397-e05d1e88b610 | Sudhu2004/Variety_DSA_Questions | Trees/treeDiamters.cpp | // https://cses.fi/problemset/task/1132/
#include<bits/stdc++.h>
using namespace std;
vector<int> depth(200001);
vector<int> ans(200001);
vector<int> adj[200001];
// This function will calculate the max depth leaf away from the node
void eval_depth(int node, int parent) {
int curr_depth = 0;
for(auto i... | ALGO | 0.999929 | 4.667329 |
05c9e1dc-3322-4454-8295-31af33146e4f | gexiannan2/testwebsocket | include/boost_1_85_0/libs/python/example/numpy/gaussian.cpp | #include <boost/python/numpy.hpp>
#include <cmath>
#include <memory>
#ifndef M_PI
#include <boost/math/constants/constants.hpp>
const double M_PI = boost::math::constants::pi<double>();
#endif
namespace bp = boost::python;
namespace bn = boost::python::numpy;
/**
* A 2x2 matrix class, purely for demonstration pur... | TOOL | 0.890374 | 7.689909 |
314ae388-b5d6-4019-a414-21b34f360bdd | ishandutta2007/codeforces | aghatizi/normal/1043/A.cpp | #include<bits/stdc++.h>
using namespace std;
#define ll long long
#define pb push_back
#define int ll
const int maxn = 1e2 + 20;
int a[maxn];
int32_t main()
{
ios_base::sync_with_stdio(false);
cin.tie(0);
cout.tie(0);
int n;
cin >> n;
int s = 0 , mx = 0;
for(int i = 0; i < n; i++)
{
cin >> a[i];
s += ... | ALGO | 0.999977 | 3.650798 |
9b1f4b17-85b8-465a-99bb-0806af8050f1 | GermanPescador/Seminario-IAA | Bot/Bot.cpp | #include "Bot.h"
Bot::Bot():
net_(nullptr)
{
}
Bot::Bot(const std::string& net_path):
net_(nullptr)
{
LoadNet(net_path);
}
Bot::~Bot()
{
if (net_)
DeleteNet_bn(net_);
}
void Bot::LoadNet(const std::string& net_path)
{
if (net_)
DeleteNet_bn(net_);
net_ = ReadNet_bn(NewFileStream_ns(net_path.c_str(), env,... | ALGO | 0.95774 | 3.604255 |
0da85252-28fa-4a10-8132-89f47c61bdf7 | ishandutta2007/codeforces | heltion/normal/1234/B2.cpp | #include<bits/stdc++.h>
using namespace std;
using LL = long long;
constexpr int maxn = 240000;
int q[maxn], qh, qt;
int main(){
ios::sync_with_stdio(false);
int n, k;
cin >> n >> k;
set<int> s;
for(int i = 0, id; i < n; i += 1){
cin >> id;
if(not s.count(id)){
if(qt - qh == k){
s.erase(q[qh]);
qh +... | ALGO | 0.999996 | 3.40643 |
acb59174-64c4-4f03-8118-1ea1cb8d132e | AndreasFMueller/AstroPhotography | control/lib/image/HotPixelBase.cpp | /*
* HotPixelBase.cpp
*
* (c) 2020 Prof Dr Andreas Müller Hochschule Rapperswil
*/
#include <AstroAdapter.h>
#include <cmath>
namespace astro {
namespace adapter {
/**
* \brief Compute mean and stddev and decide whether a pixel is hot
*
* \param x x coordinate of the pixel to inspect
* \param y y coordinate o... | ALGO | 0.852905 | 6.09611 |
19e43dfa-3752-4a0d-9d14-3a4d0a574780 | miavgu/gem5-nvmain-tfg | gem5/ext/systemc/src/sysc/communication/sc_signal_resolved.cpp | /*****************************************************************************
sc_signal_resolved.cpp -- The resolved signal class.
Original Author: Martin Janssen, Synopsys, Inc., 2001-05-21
CHANGE LOG IS AT THE END OF THE FILE
*****************************************************************************/
#... | TOOL | 0.984844 | 6.889937 |
73b195cb-5133-48f7-803c-f66c6b64fd22 | Autoratch/submissions | Codeforces/1327A.cpp | #include <bits/stdc++.h>
using namespace std;
int t;
long long n,k;
int main()
{
ios_base::sync_with_stdio(0); cin.tie(0);
cin >> t;
while(t--)
{
cin >> n >> k;
if(n%2 != k%2 or n<k*k) cout << "NO\n";
else cout << "YES\n";
}
}
| ALGO | 0.999695 | 4.644425 |
124830c7-983b-4667-8687-18c115af08b3 | pazamelin/ILP_algorithms | src/eisenbrand_weismantel.cpp | #include "ilp/eisenbrand_weismantel.hpp"
#include "ilp/detail/debug.hpp"
#include "ilp/detail/bellman_ford.hpp"
#include <iostream>
#include <stack>
#include <algorithm>
#include <boost/graph/properties.hpp>
#include <boost/property_map/property_map.hpp>
#include <boost/graph/named_function_params.hpp>
// original b... | ALGO | 0.999946 | 6.295139 |
011688db-6ceb-4007-b593-16c884eef6ce | ishandutta2007/codeforces | zayin/normal/1608/A.cpp | #include<bits/stdc++.h>
using namespace std;
#define mp make_pair
#define mt make_tuple
#define rep(i,begin,end) for (__typeof(begin) i=(begin),_end=(end),_step=1-2*((begin)>(end));i!=_end;i+=_step)
// OUTPUT
template<class a, class b>
ostream& operator << (ostream& os, const pair<a,b>& p) {
os<<"("<<p.first<<",... | ALGO | 0.999399 | 3.848774 |
0f3eec0d-c413-4966-8da8-512fd6a72d15 | CMacSwam/project10-4 | project10-4/project10-4.cpp | #include <iostream>
using namespace std;
int doubleOdd(int array[], int size);
int reversesum(int array[], int size);
int main() {
while (true) {
int creditcard = 0;
cout << "Enter 8-digit credit card # or Q to quit: ";
cin >> creditcard;
if (cin.fail()) {
break;
}
int array[8];
for (int i = 7; i... | ALGO | 0.938513 | 4.729657 |
bb267708-a3c0-439c-b342-497e5e2f2bec | Rishabh-020/C-PlusPlus | OOPS_CPP/constant/code.cpp | /*
* Complete the function below.
* Please store the size of the int array to be returned in result_size pointer. For example,
* int a[3] = {1, 2, 3};
* *result_size = 3;
* return a;
*
*/
#include<iostream>
using namespace std;
int find(int arr[],int len){
int val=arr[0];
for(int i=1;i<len;i++){
... | ALGO | 0.999944 | 4.115841 |
3f37ff41-3352-4fae-a887-2f36c6ffb552 | badmuffin/DSA | LC-Easy/217ContainsDuplicate.cpp | /*
217. Contains Duplicate - Easy
------------------------------
Given an integer array nums, return true if any value appears at
least twice in the array, and return false if every element is distinct.
*/
#include <iostream>
#include <unordered_set>
#include <vector>
using namespace std;
class Solution {
public:
... | ALGO | 0.997809 | 6.044035 |
1b75ed5f-2434-4895-a01e-81285bdf0f8a | madhavdasm/Ds-lab | DS lab/test123.cpp | #include<stdio.h>
#include<ctype.h>
#include<string.h>
int i,j,k=0,s,re[50],result,val1,val2,flag,num,top=-1;
char a[50],b[50],str[50];
int precedence(char Operator){
switch(Operator){
case '+':
case '-':
return 1;
break;
case '*':
case '/':
return 2;
break;
case '^':
return 3;
break;
de... | ALGO | 0.999926 | 3.552982 |
e6ccea10-a271-4adf-9518-49320514bb4a | soleh23/Codeforces | A. Результат игры.cpp | #include <iostream>
#include<stdio.h>
#include<math.h>
#include<algorithm>
using namespace std;
const int INF=1000000000;
int j,i,n,m,k=0,c=0,v=0,a[101][101];
main()
{
//freopen("input.txt", "r", stdin);
//freopen("output.txt", "w", stdout);
scanf ("%d",&n);
for (i=1;i<=n;i++)
for (j=1;j<=n;j++)
... | ALGO | 0.999845 | 3.072468 |
63ecaee4-787a-40bb-afdf-743fe24681d0 | IITH-Compilers/LLVM-Loop-Profiler | lib/CodeGen/IfConversion.cpp | #include "BranchFolding.h"
#include "llvm/ADT/STLExtras.h"
#include "llvm/ADT/ScopeExit.h"
#include "llvm/ADT/SmallSet.h"
#include "llvm/ADT/SmallVector.h"
#include "llvm/ADT/SparseSet.h"
#include "llvm/ADT/Statistic.h"
#include "llvm/ADT/iterator_range.h"
#include "llvm/CodeGen/LivePhysRegs.h"
#include "llvm/CodeGen/M... | ALGO | 0.978459 | 7.047746 |
d0b34547-8119-4a65-88dd-4bfb538be2e8 | sinian666/code_102_7 | 1cpp_副本3/chapter_searching/hashing_search.cpp | /**
* File: hashing_search.cpp
* Created Time: 2022-11-25
* Author: Krahets (<EMAIL>)
*/
#include "../utils/common.hpp"
/* 哈希查找(数组) */
int hashingSearchArray(unordered_map<int, int> map, int target) {
// 哈希表的 key: 目标元素,value: 索引
// 若哈希表中无此 key ,返回 -1
if (map.find(target) == map.end())
return -... | ALGO | 0.999794 | 5.437144 |
b08b5d07-177a-4923-b3d9-600cf78e49a7 | avishkaindunil/dsa_using_cpp | stack.cpp | #include <iostream>
using namespace std;
class Stack {
private:
static const int MAX = 100;
int arr[MAX];
int top;
public:
Stack() : top(-1) {}
void push(int x) {
if (top >= MAX - 1) {
cout << "Stack overflow" << endl;
} else {
arr[++top] = x;
... | ALGO | 0.99652 | 5.549551 |
98b9c9a9-21d9-48b0-ae7a-915d6010dd32 | MathiasBelmont/Atividades-UEG | Verificador_de_multiplo_em_funcao.cpp | #include<stdlib.h>
#include<stdio.h>
int multiplo(int Num1, int Num2)
{
if(Num1%Num2==0)
{
return 1;
}
else
{
return 0;
}
}
int main()
{
int num1, num2;
scanf("%i", &num1);
scanf("%i", &num2);
if(multiplo(num1, num2)==0)
{
printf("O numero %i nao e multiplo de %i", num1 , num2);
}
else
{
prin... | ALGO | 0.999873 | 3.710766 |
2a199d45-d9df-4428-b995-74bb97ca89e5 | Syed-Bakhtawar-Fahim/DSA_Algorithm_Code | assignments/recursion.cpp | #include <stdio.h>
int binarysearch(int *num, int l, int r, int search_num)
{
int flag = 0;
if (l <= r)
{
int mp = (l + r) / 2;
if (search_num == num[mp])
{
flag = 1;
return mp;
}
else if (search_num > num[mp])
{
return bin... | ALGO | 0.999812 | 4.699288 |
67da4ecc-75b0-4387-b20d-ade5eca98ba2 | ankitladva11/Leetcode-GeeksforGeeks | 0073-set-matrix-zeroes/0073-set-matrix-zeroes.cpp | class Solution {
public:
void setZeroes(vector<vector<int>>& matrix) {
int n = matrix.size();
int m = matrix[0].size();
vector<vector<int>> indexes;
for(int i=0; i<n; i++) {
for(int j=0; j<m; j++) {
if(matrix[i][j] == 0) indexes.push_back({i,j});
... | ALGO | 0.999172 | 6.567609 |
df30b0f9-6466-4a37-b232-acb5d15fb477 | 8bit-nyk/HSLAM | Thirdparty/opencv-3.4.6/opencv_contrib-3.4.6/modules/tracking/src/onlineMIL.cpp | #include "precomp.hpp"
#include "opencv2/tracking/onlineMIL.hpp"
#define sign(s) ((s > 0 ) ? 1 : ((s<0) ? -1 : 0))
template<class T> class SortableElementRev
{
public:
T _val;
int _ind;
SortableElementRev() :
_ind( 0 )
{
}
SortableElementRev( T val, int ind )
{
_val = val;
_ind = ind;
... | ALGO | 0.998754 | 5.899459 |
97385dff-d02b-4d38-a949-7129bf5fec1b | Abhirai1/Leetcode | 0125-valid-palindrome/0125-valid-palindrome.cpp | class Solution {
public:
bool isPalindrome(string s) {
for(int i=0;i<s.size();i++){
if((s[i]>=65&&s[i]<=90)||(s[i]>=97&&s[i]<=122)||(s[i]>=48&&s[i]<=57)){
char c = tolower(s[i]);
s[i]=c;
continue;
}
else{
s... | ALGO | 0.999772 | 5.954465 |
49e76a06-a818-4a7b-8a56-889152b0a480 | ishandutta2007/codeforces | froggyzhang/normal/1446/A.cpp | #include<iostream>
#include<cstdio>
#include<cstring>
#include<vector>
#include<algorithm>
using namespace std;
#define N 200020
typedef long long ll;
inline ll read(){
ll x=0,f=1;
char c=getchar();
while(c<'0'||c>'9'){
if(c=='-')f=-1;
c=getchar();
}
while(c>='0'&&c<='9'){
x=(x<<1)+(x<<3)+c-'0';
c=getchar(... | ALGO | 0.999984 | 3.493787 |
52aefc20-5418-4396-8ec8-1e72e3e262ae | AjajAlam1399/data-structure_and_algorithms | Stack/converting_prefixTo_postfix.cpp | #include <bits/stdc++.h>
using namespace std;
bool isOperator(char c)
{
if (c == '+' || c == '-' || c == '/' || c == '*' || c == '^')
{
return true;
}
else
{
return false;
}
}
string prefixTopostfix(string prefix)
{
stack<string> s;
for (int i = prefix.size()-1; i>=0;... | ALGO | 0.999879 | 4.690212 |
c75e45ed-d789-436d-87b4-cdd9384cf3be | kunidesuyo/competitive-programming | src/atcoder/abc/abc285/d/abc285_d.cpp | #include <bits/stdc++.h>
using namespace std;
#include <atcoder/all>
using namespace atcoder;
#include <cmath>
#define all(x) (x).begin(), (x).end()
using ll = long long;
const ll INF = 1LL << 60;
const int inf = INT_MAX / 2;
bool dfs(map<string, vector<string>> &g, string start,
map<string, bool> &seen, ma... | ALGO | 0.999983 | 5.164561 |
b139cb49-6638-4c8d-9b80-3f756c1c6cfc | wonjiee/2024_1_Object_Oriented_Programming | assignment2/prob8.cpp | #include <iostream>
#include <vector>
#include <string>
using namespace std;
int main() {
int N;
cin >> N;
string word, spell;
vector<string>words;
int count = 0;
int n = 1;
for (int i = 0; i < N; i++) {
cin >> word;
words.push_back(word);
}
while (true) {
word = words[0];
count = 0;
spell = word.su... | ALGO | 0.998802 | 3.558484 |
fba11a40-454d-4e20-87c4-4d01662b7e63 | stepheneliazer18/365DaysChallenge | 300.longest-increasing-subsequence.cpp | /*
* @lc app=leetcode id=300 lang=cpp
*
* [300] Longest Increasing Subsequence
*/
// @lc code=start
class Solution {
public:
int lengthOfLIS(vector<int>& nums) {
vector<int> res;
res.push_back(nums[0]);
for(int i=1;i<nums.size();i++){
if(res.back()<nums[i]) res.push_back(n... | ALGO | 0.999975 | 6.357215 |
7fcfb302-3ad9-4531-802c-a8e941cfd491 | DionysiosB/CodeForces | 0600-0699/625B-WarOfTheCorporations.cpp | #include <iostream>
#include <string>
int main(){
std::string s, t; std::cin >> s >> t;
size_t count(0);
size_t found(-t.size());
while(true){
found = s.find(t, found + t.size());
if(found == std::string::npos){break;}
else{++count;}
}
std::cout << count << std::endl;
... | ALGO | 0.999646 | 4.876845 |
cdab2c08-9f09-4cdb-b789-e36f496fcba7 | ishandutta2007/codeforces | danya090699/normal/935/F.cpp | #include <bits/stdc++.h>
#define int long long
using namespace std;
const int sz=1e5+10, inf=1e18;
int n, q, su=0, ar[sz], dot[sz*4];
int p, va, lg, rg;
set <int> hi, lo;
void cha(int nu, int l, int r)
{
if(l==r) dot[nu]=va;
else
{
int mid=(l+r)>>1;
if(p<=mid) cha(nu*2, l, mid);
else... | ALGO | 0.999652 | 3.801485 |
2ac00826-c9b4-4f71-ab36-5ce05bc2aa08 | 823077723/robot | kaanh-test/src/plan.cpp | #include <algorithm>
#include <array>
#include <stdlib.h>
#include <string>
#include <bitset>
#include "kaanh.h"
#include "robot.h"
#include"plan.h"
#include<cmath>
#include<iostream>
//#include"kinematics.h"
using namespace std;
/********************************************梯形曲线***************************************... | ALGO | 0.99757 | 3.297999 |
15a3470a-aadf-429c-8ad6-f343a0cf089f | krhnqll/PARALLEL-PROGRAMMING | DiningPhilosophersProblem.cpp | #include <icb_gui.h>
#include <icbytes.h>
#include <windows.h>
#include <math.h>
#include <stdbool.h>
#include <stdio.h>
//Ortak çalışma ile proje geliştirilmiştir.
#ifndef M_PI
#define M_PI 3.14159265358979323846
#endif
#define NUM_PHILOSOPHERS 5
#define TIMER_ID 1
HWND hwndStartDeadlock, hwndStartNoDeadlock;
HAN... | ALGO | 0.998173 | 4.939486 |
262e6772-2695-4971-b781-5dc61264d7c1 | thaituanUIT/UIT_23521706_function | Bai041/Bai041.cpp | #include <iostream>
#include <iomanip>
using namespace std;
int Tong(int);
int main()
{
int n;
cout << "Nhap so nguyen duong n: ";
cin >> n;
cout << "tong S(" << n << ") la: ";
cout << Tong(n);
return 1;
}
int Tong(int nn)
{
float s = 0;
int i = 1;
while (i <= nn)
{
s = s + (i * (i + 1) * (i + 2));
i+... | ALGO | 0.999286 | 3.629726 |
e772b328-beb3-4c46-b4f7-97320e9dd878 | fxianglong/leetcode | newcode-分苹果.cpp | //#include<iostream>
//#include<vector>
//using namespace std;
//int main(){
// int n;
// cin >> n;
// vector<int> ans(n, 0);
// int sum = 0;
// for (int i = 0; i < n; i++)
// {
// cin >> ans[i];
// sum += ans[i];
// }
// if (sum%n)
// return -1;
// int avg = sum / n;
// int count = 0;
// for (auto it : ans){
// if... | ALGO | 0.999965 | 3.736758 |
ec877890-e991-4e64-af65-b7998a001d55 | meetdoshi90/CP-Algorithms | Math/Algebra/Extended-Euclidean.cpp | #include<bits/stdc++.h>
using namespace std;
int gcd(int a,int b, int& x, int& y){
if(b==0){
x = 1;
y = 0;
return a;
}
int x1, y1;
int d = gcd(b, a%b, x1, y1);
x = y1;
y = x1-y1*(a/b);
return d;
}
int main(){
cout << "Enter a b" << endl;
int a,b;
cin >> a >> b;
int x,y;
int temp = gcd(a,b,x,y);
cout... | ALGO | 0.99992 | 4.431095 |
f40a3bc2-fc86-4809-8373-35c59d6fac37 | Bibs24/Leetcode-GFG-Progress | Finding Profession - GFG/finding-profession.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:
char profession(int level, int pos){
if(pos == 1){
return 'e' ;
}else{
char parent = professi... | ALGO | 0.999133 | 5.087014 |
e676ccee-732c-4d15-9349-b9e760bc1e26 | thiagofigcosta/URI | 2288.cpp | #include <iostream>
using namespace std;
int offset(int value,int maxPlusOne){
while(value>=maxPlusOne)
value-=maxPlusOne;
while(value<0)
value+=maxPlusOne;
return value;
}
int main(){
int n,m;
int count=0;
do{
count++;
cin>>n>>m;
if(n==0||m==0)
break;
int matrix[n][m];
int bkp[n][m];
for(in... | ALGO | 0.972432 | 3.535698 |
652a0ca4-2646-4666-b285-6515abbb1ac3 | Mxdhushri/PICT_COURSEWORK_2ndYEAR | ADSL/assign1b.cpp | #include <iostream>
#include<bits/stdc++.h>
using namespace std;
class Node{
int data;
Node*left;
Node*right;
public:
Node(){
left=NULL;
right=NULL;
}
Node(int d){
data=d;
left=NULL;
right=NULL;
}
friend class BST;
};
class BST{
Node*root;
... | ALGO | 0.99991 | 4.703355 |
6a81b345-2bc0-4f73-a472-f4e35c6b153e | intel/quantum-intrinsics | clang/lib/StaticAnalyzer/Core/RangedConstraintManager.cpp | #include "clang/StaticAnalyzer/Core/PathSensitive/ProgramState.h"
#include "clang/StaticAnalyzer/Core/PathSensitive/RangedConstraintManager.h"
namespace clang {
namespace ento {
RangedConstraintManager::~RangedConstraintManager() {}
ProgramStateRef RangedConstraintManager::assumeSym(ProgramStateRef State,
... | TOOL | 0.90672 | 7.748986 |
f53bf5ff-5c8b-49e3-b765-0b1d26dc76b3 | prakhar7080/LeetCode_GeeksforGeeks | Previous_Smaller_Element.cpp | #include<iostream>
#include<vector>
#include<stack>
using namespace std;
int main(){
int n;
cin>>n;
vector<int>arr(n);
for(int i=0;i<n;i++){
cin>>arr[i];
}
stack<int>st;
vector<int>ans;
for(int i=0;i<n;i++){
while(!st.empty() && st.top() >= arr[i]){
st.pop();
... | ALGO | 0.999995 | 4.437137 |
86b92c8f-d453-410d-92c6-c6b6c95af68d | Dev12092003/C-with-DSA | string char array/retuurn_maximum_occuring_char_in_string.cpp | // test -> t
//heeeee -> e
// time bif o (n)
// space big o(1)
#include<iostream>
#include<string>
using namespace std;
char getmaxoccuringchar(string s){
int arr[26]={0};
//creat an array of nuber count of character
for(int i=0;i<s.length();i++){
char ch=s[i];
int number=0;
//... | ALGO | 0.999833 | 4.249868 |
f4c4de38-930c-49b5-adf1-d6c9f8014d77 | kunalbandooni/InterviewBit | Maximum level sum.cpp | /**
* Definition for binary tree
* struct TreeNode {
* int val;
* TreeNode *left;
* TreeNode *right;
* TreeNode(int x) : val(x), left(NULL), right(NULL) {}
* };
*/
int bfs(TreeNode* root){
int max_sum=-1;
int sum=0;
queue<TreeNode*> q;
q.push(root);
int size=1;
while(!q.e... | ALGO | 0.999972 | 6.068813 |
02554f3c-db43-47f3-9bbc-720d1c55b8eb | ba-ys/knu_cpp | C++ Chapter10/Chapter10_9.cpp | #include <iostream>
#include <vector>
using namespace std;
int main() {
vector<int> v;
int n = 1, cnt = 0;
double sum = 0;
for (;;) {
cout << " Էϼ(0 Էϸ )>>";
cin >> n;
if (n == 0)break;
v.push_back(n);
for (int i = 0; i < v.size(); i++) {
cout << v[i] << " ";
}
sum += v[cnt];
cnt++;
cout << "... | ALGO | 0.996395 | 3.466627 |
7b1fc4d0-a468-4c0a-9f6b-1aaaeb7f3280 | NikitaUssyukin/PP1_2024_Summer | Practices/G3/Week4/P1/c_2.cpp | #include <iostream>
using namespace std;
int main() {
int n, m;
cin >> n >> m;
int a1 = 0, a2 = 1;
int result;
if(m == 1 || m == 2) {
cout << m - 1 << endl;
return 0;
}
for(int i = 3; i <= m; ++i) {
result = a2 + n * a1;
a1 = a2;
a2 = result;
... | ALGO | 0.999986 | 3.78439 |
7e2db7d7-b2fe-488d-9507-2385f4bd9927 | BlastX-Core/BlastX-Old | src/crypter.cpp | #include "crypter.h"
#include "script/script.h"
#include "script/standard.h"
#include "util.h"
#include <boost/foreach.hpp>
#include <openssl/aes.h>
#include <openssl/evp.h>
#include <string>
#include <vector>
bool CCrypter::SetKeyFromPassphrase(const SecureString& strKeyData, const std::vector<unsigned char>& chSal... | TOOL | 0.918772 | 7.540994 |
c02efe73-f2c7-4430-b4d1-e0c9445b4ef6 | AlekseyChaus/Compiller | OPZ.cpp | #include "OPZ.h"
#include <iostream>
#include <string.h>
#include <stdlib.h>
#include <stack>
using namespace std;
int OPZ::priority(char oper)
{
switch (oper)
{
case '+': return 1;
case '-': return 1;
case '*': return 2;
case '/': return 2;
case '^': return 3;
default: return 0;
}
}... | ALGO | 0.999241 | 3.402028 |
4a1f3103-1163-475f-acb7-03b1ce3eae19 | leeweihanwickham/Sharp-PQ | range_proof/tests/test_rangeproof_arbitrary.cpp | /**@file
*****************************************************************************
Range proofs for arbitrary ranges in the conjecture setting
This file is part of "A Succinct and Efficient Range Proof with More Functionalities based on Interactive Oracle Proof"
****************************************************... | ALGO | 0.99102 | 6.053299 |
96e8dab4-5e26-4d48-95b2-63c421111dfb | Colloportus0/MLIRSmith11 | libcxx/test/std/algorithms/alg.sorting/alg.binary.search/upper.bound/upper_bound.pass.cpp | // <algorithm>
// template<ForwardIterator Iter, class T>
// constexpr Iter // constexpr after c++17
// upper_bound(Iter first, Iter last, const T& value);
#include <algorithm>
#include <vector>
#include <cassert>
#include <cstddef>
#include "test_macros.h"
#include "test_iterators.h"
#if TEST_STD_VER > 17
T... | TEST | 0.993109 | 7.253215 |
ff64f72b-d1ad-4c2a-b2d0-c3c89317c9ec | ishandutta2007/codeforces | danya090699/normal/1237/C2.cpp | #include <bits/stdc++.h>
using namespace std;
struct el
{
int x, y, z, i;
};
bool comp(el a, el b)
{
if(a.x!=b.x) return a.x<b.x;
else
{
if(a.y!=b.y) return a.y<b.y;
else return a.z<b.z;
}
}
main()
{
//freopen("input.txt", "r", stdin);
int n;
cin>>n;
vector <el> sp, s... | ALGO | 0.999977 | 3.801043 |
4b2ea62f-fcd7-4068-b2dd-c47ff8eb6d41 | denis-gubar/Leetcode | Depth-first Search/2265. Count Nodes Equal to Average of Subtree.cpp | /**
* Definition for a binary tree node.
* 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 *right) : val(x), l... | ALGO | 0.999833 | 6.591074 |
90ef692e-6459-4c64-a954-1b82f104caf1 | AjajAlam1399/Leetcode-Aj | 2339-k-divisible-elements-subarrays/k-divisible-elements-subarrays.cpp | class Solution {
public:
int countDistinct(vector<int>& nums, int k, int p) {
int n=nums.size(),ans=0;
unordered_set<string>set;
for(int i=0;i<n;i++){
int cnt=0;
string str="";
for(int j=i;j<n;j++){
str+=to_string(nums[j])+"#";
... | ALGO | 0.999808 | 5.038855 |
ded0f14e-e417-48ff-93d5-7dc2ffe2d2a2 | javafxports/openjdk-mobile | src/hotspot/share/opto/block.cpp | #include "precompiled.hpp"
#include "libadt/vectset.hpp"
#include "memory/allocation.inline.hpp"
#include "memory/resourceArea.hpp"
#include "compiler/compilerDirectives.hpp"
#include "opto/block.hpp"
#include "opto/cfgnode.hpp"
#include "opto/chaitin.hpp"
#include "opto/loopnode.hpp"
#include "opto/machnode.hpp"
#incl... | TOOL | 0.968054 | 5.449113 |
24e89d3c-c62a-472d-891f-266855b8b305 | IsOneHeart/Study-Git | C&C++ Project/数据结构实验4:排序与查找/Sort/main.cpp | #include <stdio.h>
#include <stdlib.h>
#include <time.h>
#include "sort.h"
void getRandomNum0To1000(int array[], int n) {
for (int i = 0; i < n; i++) {
array[i] = rand() % 1000;
}
}
void copyArray(int src[], int dest[], int n) { // 复制数组
for (int i = 0; i < n; i++) {
dest[i] = src[i];
}... | ALGO | 0.999542 | 4.008486 |
ea7584cd-3782-45fc-9e17-8d9ef5234608 | jhonnferrerosa/CmasMas | PECL2/pecl2.cpp | #include <iostream>
#include <string>
#include <stdlib.h>
#include "pecl2.h"
using namespace std;
/////////////////
//METODOS LISTA//
/////////////////
void Lista::insertar(Atraccion atr)
{
NodoL *nuevo = new NodoL(atr);
//nuevo->dato = atr;
if (primero == NULL)
{
primero = nuevo;
}
els... | TOOL | 0.915042 | 4.155318 |
c81bb42a-c8fa-468b-877b-74c0710142c2 | GuacheSuede/MSSubmission1234567890 | submission/rsi/boost_1_69_0/libs/compute/perf/perf_prev_permutation.cpp | #include <algorithm>
#include <iostream>
#include <numeric>
#include <vector>
#include <boost/compute/system.hpp>
#include <boost/compute/algorithm/next_permutation.hpp>
#include <boost/compute/algorithm/prev_permutation.hpp>
#include <boost/compute/container/vector.hpp>
#include "perf.hpp"
int rand_int()
{
retu... | ALGO | 0.996162 | 5.289071 |
305c8171-fa4d-4b35-91be-c546ad23ee8e | PlayerCoach/Studies | SEMESTER II/Algorithms and Data Structures/Jak_dojade/djikstra_t.cpp | #include "djikstra_t.h"
bool djikstra_t::operator<(const djikstra_t& other) const
{
return distance > other.distance;//on purpose
}
bool djikstra_t::operator>(const djikstra_t& other) const
{
return distance < other.distance;//on purpose,so i dont have to change priority queue
}
bool djikstra_t::operator<=(const dji... | ALGO | 0.99736 | 3.711373 |
d23dd1a8-e9a9-4b9c-9af3-b40517787834 | pc4covid19/virion2replication | src/BioFVM/BioFVM_vector.cpp | #include "BioFVM_vector.h"
/* some global BioFVM strings */
namespace BioFVM{
/* faster operator overloading. multiplication and division are element-wise (Hadamard) */
std::vector<double> operator-( const std::vector<double>& v1 , const std::vector<double>& v2 )
{
std::vector<double> v = v1;
for( unsigned int... | TOOL | 0.907752 | 5.464715 |
4dae1b19-b165-4a5e-b020-f4d6fbcc9a68 | ivanutaandreea/Licenta | libraries/Filter/examples/LowPassFilter2p/LowPassFilter2p.cpp | /*
* Example sketch to demonstrate use of LowPassFilter2p library.
* Code by Randy Mackay and Andrew Tridgell
*/
#include <AP_HAL/AP_HAL.h>
#include <Filter/Filter.h> // Filter library
#include <Filter/LowPassFilter2p.h>
void loop();
const AP_HAL::HAL& hal = AP_HAL::get_HAL();
// ... | TOOL | 0.853838 | 5.239731 |
a499e479-7a2e-4bab-8e82-e7893c968f49 | timniederhausen/boost | libs/compute/example/threefry_engine.cpp | #include <boost/compute/random/threefry_engine.hpp>
#include <boost/compute/container/vector.hpp>
#include <boost/compute/command_queue.hpp>
#include <boost/compute/context.hpp>
#include <boost/compute/device.hpp>
#include <boost/compute/system.hpp>
#include <iostream>
int main()
{
using boost::compute::uint_;
... | TOOL | 0.98975 | 3.940955 |
bf36ffcb-8615-4258-bc0f-90a4aa46f582 | anshikayadav29/Dsa-solution | DutchNationalFlagProblem/All0sFirstthan1s.cpp | #include<bits/stdc++.h>
using namespace std;
int main() {
vector<int> a = {1,0,2,1,0,2};
vector<int> result;
for(int x : {0,1,2})
for(int i = 0; i < a.size(); i++)
if(a[i]==x) result.push_back(x);
for(int x : result) cout << x << " ";
} | ALGO | 0.999917 | 3.155096 |
c083ddd5-cfbf-4466-a8f7-7ccb078f922e | Nirraaav/CS101 | Previous Year Lab Quiz/LabQuiz1/5.cpp | #include <simplecpp>
long double nCr(long long int n, long long int r){
long double ans = 1;
for(long long int i = 0; i < n - r; i++){
ans *= ((long double) (n - i))/((long double) (n - r - i));
}
return ans;
}
main_program{
long long int N, R;
cin >> N >> R;
long double answer = nCr(N, R);
// cout << fixed... | ALGO | 0.999061 | 3.294149 |
a362ecb2-74fa-4ff1-9bfd-f5936c705a06 | carrtesy/Problem-Solvings | bkj/11659/11659.cpp | #include <iostream>
using namespace std;
int main(void){
ios_base::sync_with_stdio(false);
cin.tie(NULL);
int N, M;
cin >> N >> M;
int *arr = new int[N+1];
arr[0] = 0;
for(int n = 1; n <= N; n++) {
int tmp;
cin >> tmp;
arr[n] = arr[n-1] + tmp;
}
while(M--)... | ALGO | 0.999939 | 4.342146 |
3ec19b87-ad9d-46a0-bb86-561235099ea2 | KraitOPP/Codeforces | C_Yarik_and_Array.cpp | #include <bits/stdc++.h>
using namespace std;
#define int long long
#define loop(i, a, b) for(int i=a;i<b;i++)
signed main(){
ios::sync_with_stdio(false);
cin.tie(NULL);
cout.tie(NULL);
int t;
cin>>t;
while(t--){
auto begin = chrono::high_resolution_clock::now();
int n;
... | ALGO | 0.999414 | 4.712687 |
bcc8929d-375c-4cb0-a066-0a327e289f94 | Resses/data-structures | NodesAndLinkedLists/nodes1/node_demo.cpp | #include <iostream>
#include "Node.h"
#include "Node_utils.h"
using namespace std;
int main() {
Node *head = new Node(10);
cout << *head << endl;
cout<< "_______INSERT______" << endl;
for(int i = 0; i < 50; i+=5){
insert(head, i);
print(cout, head);
cout<<endl;
}
... | ALGO | 0.98129 | 4.605007 |
fc2bce20-2e48-4a07-aea9-363840412a35 | leslieyip02/kattis | completed/cutthenegativity.cpp | #include <iostream>
#include <vector>
using namespace std;
int main()
{
int n, c;
cin >> n;
vector<vector<int>> r;
for (int u = 1; u <= n; u++)
{
for (int v = 1; v <= n; v++)
{
cin >> c;
if (c != -1)
{
r.push_back({ u, v, c });
... | ALGO | 0.99689 | 3.421965 |
ab202468-fea2-46a6-90d6-ecd5908d39b7 | Taohid0/C-and-C-Plus-Plus | permutation generatoin using function/main.cpp | #include <bits/stdc++.h>
using namespace std;
int main()
{
string s = "abcd";
do{
for(int i = 0;i<4;i++)
{
cout<<s[i];
}
cout<<endl;
}while(next_permutation(s.begin(),s.end()));
return 0;
}
| ALGO | 0.999873 | 3.431972 |
a35d3600-e13c-452c-b194-d3c905c29d44 | taemt94/Udacity_Self-Driving_Car_Engineer_Project | 4_Motion_Planning_and_Decision_Making_for_Autonomous_Vehicles/project/starter_files/eigen-3.3.7/test/permutationmatrices.cpp | #define TEST_ENABLE_TEMPORARY_TRACKING
#include "main.h"
using namespace std;
template<typename MatrixType> void permutationmatrices(const MatrixType& m)
{
typedef typename MatrixType::Scalar Scalar;
enum { Rows = MatrixType::RowsAtCompileTime, Cols = MatrixType::ColsAtCompileTime,
Options = MatrixType... | TEST | 0.858993 | 6.856556 |
6389b5a6-8e8b-4aa4-89ec-a589afcdb39d | Seljuga/LeetCodeCpp | 2658 Maximum Number of Fish in a Grid.cpp | class Solution {
private:
int dfs(vector<vector<int>> & grid, int i, int j, int row, int col) {
if (i<0 || j<0 || i>=row || j>=col || grid[i][j]==0) return 0;
int cnt = grid[i][j];
grid[i][j] = 0;
cnt += dfs(grid, i-1, j, row, col);
cnt += dfs(grid, i, j-1, row, col);
... | ALGO | 0.999761 | 6.326746 |
46f1e826-2638-4a38-a1e1-ef8b4fccac8a | adoptium/alpine-jdk8u | hotspot/src/share/vm/opto/lcm.cpp | #include "precompiled.hpp"
#include "memory/allocation.inline.hpp"
#include "opto/block.hpp"
#include "opto/c2compiler.hpp"
#include "opto/callnode.hpp"
#include "opto/cfgnode.hpp"
#include "opto/machnode.hpp"
#include "opto/runtime.hpp"
#if defined AD_MD_HPP
# include AD_MD_HPP
#elif defined TARGET_ARCH_MODEL_x86_32
#... | ALGO | 0.954834 | 7.648772 |
e15b9694-de28-485d-9ef7-2075f379bc9e | rgl-za/Algorithm-Study | Second-Half of 2021/0903.cpp |
//키패드 누르기
//내가 생각한 풀이... 왜 아무도 스택으로 안풀죠?
#include <iostream>
#include <string>
#include <vector>
#include <stack>
using namespace std;
string solution(vector<int> numbers, string hand){
string answer="";
stack<int> left;
stack<int> right;
vector<int>l={1,4,7};
vector<int>r={3,6,9};
for(in... | ALGO | 0.999989 | 5.136632 |
df5ac907-567f-474e-aa6e-b51f4d0dbf58 | Shafiahuma/Algorithms | practice/pp/main.cpp | #include <bits/stdc++.h>
#define ll long long int
using namespace std;
int main() {
ll t, i, j, n;
cin >> t;
for (i = 0; i < t; i++) {
ll l, r, lb;
cin >> l >> r;
ll la = l % 10;
if (l < 10 && r < 10) {
cout << r - l << endl;
continue;
} else... | ALGO | 0.999707 | 3.806083 |
3d0ae6a8-3889-4300-a5ea-48841cc6868b | nmr0079/Leetcode | 19-remove-nth-node-from-end-of-list/19-remove-nth-node-from-end-of-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* removeNthFr... | ALGO | 0.999971 | 5.954038 |
b5b4130b-35c1-44db-a4f6-3a88660574af | alexandraback/datacollection | solutions_5695413893988352_0/C++/avv/main.cpp | #include "vector"
#include "string"
#include "set"
#include "map"
#include "sstream"
#include "algorithm"
#include "cmath"
#include "cassert"
#include "iostream"
#include "numeric"
#include "fstream"
#include "queue"
#include <functional>
#include <climits>
#include <cstring>
#include <list>
#include <iomanip>
using n... | ALGO | 0.999842 | 3.541435 |
ac97e96a-c47a-40a8-90c0-7c18f93c07c9 | ishandutta2007/codeforces | popovicirobert/normal/1218/I.cpp | #include <bits/stdc++.h>
#define ll long long
#define ull unsigned long long
#define lsb(x) (x & (-x))
using namespace std;
const int MAXN = 2000;
bitset <MAXN> c;
int main() {
//ifstream cin("A.in");
//ofstream cout("A.out");
int i, j, n;
ios::sync_with_stdio(false);
cin.tie(0), ... | ALGO | 0.99991 | 3.391202 |
57f31a9b-1b3f-4ae9-8448-5233874a18f3 | Sebarl/gaia | AEFramework/src/Sigmoid.cpp | #include "Sigmoid.h"
#include <math.h>
#include <stdio.h>
Sigmoid::Sigmoid(Random* rng){
this->k = 2.0*rng->nextFloat() - 1.0;
this->minusK = -k;
}
Sigmoid::Sigmoid(){
this->k = 1.0;
this->minusK = -1.0;
}
Sigmoid::Sigmoid(float k){
this->k = k;
this->minusK = -k;
}
Sigmoid::~Sigmoid(){}
fl... | ALGO | 0.975254 | 5.675746 |
cae4bb3c-a646-4845-8568-cd96c5befa5b | raincross7/code-similarity | codes/train_code/problem182/problem182_312.cpp | #include <bits/stdc++.h>
using namespace std;
int main() {
int a,b,c,d;
cin >> a >> b >> c >> d;
int L=a+b;
int R=c+d;
if(L>R){
cout << "Left" << endl;
}
if(L<R){
cout << "Right" << endl;
}
if(L==R){
cout << "Balanced" << endl;
}
}
| ALGO | 0.999963 | 3.330366 |
df02de07-6f82-468d-933b-a00de1a5d7fa | dineshkumar071/geeks-for-geeks | diagonalsumintree.cpp | #include<bits/stdc++.h>
using namespace std;
struct Node
{
int data;
struct Node *left;
struct Node *right;
Node(int x){
data = x;
left = NULL;
right = NULL;
}
};
void insert(Node *root,int a1,int a2,char lr){
if(root==NULL){
return;
}
if(root->data==a1){
switch(lr){
case 'L':root->left=... | ALGO | 0.999891 | 3.593169 |
ae7baa7b-861e-4091-9745-10c9b44c521a | theodormoroianu/mateinfoUB-2024 | a-ori-b/sol_nsquared.cpp | #include <bits/stdc++.h>
using namespace std;
vector<int> ReadNr()
{
string s;
cin >> s;
vector<int> v;
for (int i = 0; i < s.size(); i++)
v.push_back(s[i] - '0');
reverse(v.begin(), v.end());
return v;
}
void PrintNr(vector<int> v)
{
while (!v.empty() && v.back() == 0)
v.p... | ALGO | 0.999975 | 4.107851 |
8da5fe9e-8299-466e-82c3-1b7508fb93f5 | yanawishnya/yaabarbashina-acs-tasks | hw-1/text_cyclic_shift.cpp | //------------------------------------------------------------------------------
// text_cyclic_shift.cpp - содержит функции обработки текста.
//------------------------------------------------------------------------------
#include "text_cyclic_shift.h"
#include "string.h"
//-----------------------------------------... | ALGO | 0.990689 | 3.788476 |
25046c7c-d2d3-4d0b-a967-6f7c67990156 | fangchuan/Open3D | src/pybind/odometry/odometry.cpp | #include "Open3D/Odometry/Odometry.h"
#include "Open3D/Geometry/Image.h"
#include "Open3D/Geometry/RGBDImage.h"
#include "Open3D/Odometry/OdometryOption.h"
#include "Open3D/Odometry/RGBDOdometryJacobian.h"
#include "pybind/docstring.h"
#include "pybind/odometry/odometry.h"
namespace open3d {
template <class RGBDOdom... | ALGO | 0.89087 | 7.769673 |
66a83ed5-9a21-4e53-9a52-9aa43014c120 | kpratyush12345/Codeforces | Codeforces Ladder B/230B_T_primes.cpp | //230B - T-primes
//https://codeforces.com/problemset/problem/230/B
#include<bits/stdc++.h>
using namespace std;
const int MOD = 1000000007;
const int MAX = 1000001;
bool prime[MAX];
void sieve ()
{
int i,j;
prime[0] = prime[1] = true;
for (i=4; i<MAX; i+=2)
prime[i] = true;
for (i=3; i*i<=M... | ALGO | 0.999095 | 5.054301 |
6133e7c6-670f-40cb-8404-c9a745bbb8a0 | sammagnet7/cs773_CompArch-Perf-Security | Final_Project/Workspace/mygem5_v24.1.0.2_GhostMinion/src/systemc/tests/systemc/misc/synth/add_chain_FUNC/add_chain.cpp | /*****************************************************************************
add_chain.cpp --
Original Author: Martin Janssen, Synopsys, Inc., 2002-02-15
*****************************************************************************/
/**************************************************************************... | TOOL | 0.998984 | 5.907879 |
5dd4a117-07aa-4008-acb1-b31bd4ac4e62 | Lee-Jungyu/algorithm | baekjoon/11022.cpp | #include <iostream>
using namespace std;
int main()
{
int T;
scanf("%d", &T);
for (int t = 0; t < T; t++)
{
int a, b;
scanf("%d %d", &a, &b);
printf("Case #%d: %d + %d = %d\n", t + 1, a, b, a + b);
}
}
| ALGO | 0.988235 | 5.022098 |
a2de0f6e-9884-44da-87f8-c83c01b7fc45 | ZhdankovAlex/AdressBook | comparenamemin.cpp | #include "comparenamemin.h"
bool CompareNameMin::operator () (Contact &c1, Contact &c2)const
{
return (c1.GetName()<c2.GetName());
}
| TOOL | 0.880401 | 3.008513 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.