uuid string | repo_name string | relative_path string | content string | category string | algo_rel_score float64 | quality_score float64 |
|---|---|---|---|---|---|---|
24a5659f-94b1-4a8c-b5d2-eb789baaadf3 | ragibKhandoker/University-CSE-Coding-Assignments- | CSE-221/Lab-assignment_new1/train2.cpp | #include <bits/stdc++.h>
using namespace std;
class Train{
public:
string name;
string destination;
string time;
int priority;
Train(string name,string destination,string time,int priority){
this->name = name;
this->destination = destination;
this->time = time;
th... | ALGO | 0.999958 | 4.984813 |
53f3aeb4-1610-4934-854e-25dbc38efa56 | mgtera200/Cpp_Programming | 05- Multiplication Table/table.cpp | #include <iostream>
void printMultiplicationTable(int number) {
for (int i = 1; i <= 12; ++i) {
std::cout << number << "x" << i << "=" << number * i << std::endl;
}
}
int main() {
int tableNumber;
std::cout << "Enter the number for the multiplication table you want: ";
std::cin >> tableNum... | ALGO | 0.998271 | 5.253984 |
236d097a-2910-4c67-b8a1-a18ad5da4bda | EslSuwen/Feat | BookSystem/BFindDlg.cpp | // BFindDlg.cpp : implementation file
//
#include "stdafx.h"
#include "BookSystem.h"
#include "BFindDlg.h"
#include "BDispDlg.h"
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
/////////////////////////////////////////////////////////////////////////////
// CBFindDlg d... | TOOL | 0.892071 | 6.507585 |
7abf0008-9f2f-4f6e-886e-8143388ebae9 | NgNhatThanh/SPOJ-Tournament | P152SUMI.cpp | #include <bits/stdc++.h>
#define ll long long
using namespace std;
string s;
int res[100005];
void process(){
for(int i=1;i<s.size();i++){
res[i]=res[i-1]+(s[i]==s[i-1]);
}
}
int main() {
cin>>s;
process();
int n;
cin>>n;
while(n--){
int l, r;
cin>>l>>r;
cout<<res[r-1]-res[l-1]<<'\n';
}
} | ALGO | 0.999582 | 4.616213 |
510d3e03-5f97-4a08-8b92-76bea34c7336 | ming197/leetcode | 392.is-subsequence.cpp | /*
* @lc app=leetcode id=392 lang=cpp
*
* [392] Is Subsequence
*/
// @lc code=start
#include "bits/stdc++.h"
using namespace std;
class Solution {
public:
bool isSubsequence(string s, string t) {
int n = s.size(), m = t.size();
int s_pos = 0, t_pos = 0;
while (s_pos < n && t_pos < m)
... | ALGO | 0.999875 | 6.616724 |
89fefbaf-1481-4400-be14-edb5a703510d | shashwat329/DSA | udemy/recursion.cpp/sumofdigits.cpp | #include<iostream>
using namespace std;
int sumdigits(int n){
int sum =0;
if(n==0){
return sum;
}
int remainder = n%10;
sum = sum*10 + remainder;
return sum+ sumdigits(n/10);
}
int main(){
int n;
cin>>n;
int ans=sumdigits(n);
cout<<"sum of digits are : "<<ans<<endl;
... | ALGO | 0.999682 | 5.242449 |
c21cabaf-1e72-4a71-995f-2fce785344e5 | zzArchive-if-03-22-D-fall-2018/assignment-17-lottery-Samuel-Kowatschek | assignment/lottery.cpp | /*-----------------------------------------------------------------------------
* HTBLA-Leonding / Class: 2DHIF
*-----------------------------------------------------------------------------
* Exercise Number: 17
* File: lottery.c
* Author(s): Samuel Kowatschek
* Due Date:
*------------------------------... | ALGO | 0.976399 | 4.544986 |
3b0f8204-3e20-4071-9cc6-7412c60fe04d | sed-inf-u-szeged/OpenStaticAnalyzer | lib/csharp/src/algorithms/AlgorithmDeepCopy.cpp | #include "csharp/inc/csharp.h"
#include <set>
#include <map>
using namespace std;
namespace columbus { namespace csharp { namespace asg {
AlgorithmDeepCopy::AlgorithmDeepCopy(NodeId what, Factory& srcFact, Factory& targetFact, std::map<const base::Base*,base::Base*>& mapped_nodes) :
srcFact(srcFact), targetFact(ta... | ALGO | 0.940084 | 5.718659 |
9166f106-357a-4165-b056-fadc44a7e9ff | VLazorykOOP/oplab1-DemchenkoVladyslav | Lab1/Lab1Task5/Lab1Task5.cpp | #include <iostream>
#include <fstream>
#include <vector>
#include <cmath>
#include <stdexcept>
#include <string>
#include <sstream>
using namespace std;
namespace exceptions
{
class recount {
};
class toalg2 {
public:
double zValue;
toalg2(double z)
{
zValue = z;
}
};
class toalg3 {
};
class toalg... | ALGO | 0.997483 | 3.406074 |
c6d571c1-b314-4b1b-af58-405b33fd522b | micheal0919/theia-sfm-windows | 3rdParties/eigen-3.2.9/unsupported/doc/examples/MatrixSinh.cpp | #include <unsupported/Eigen/MatrixFunctions>
#include <iostream>
using namespace Eigen;
int main()
{
MatrixXf A = MatrixXf::Random(3,3);
std::cout << "A = \n" << A << "\n\n";
MatrixXf sinhA = A.sinh();
std::cout << "sinh(A) = \n" << sinhA << "\n\n";
MatrixXf coshA = A.cosh();
std::cout << "cosh(A) = \n"... | ALGO | 0.975773 | 5.894121 |
175b0204-dc0e-4200-935a-4cdead4edf23 | kmjp/procon | atcoder/abc301-350/abc324/a.cpp | #include <bits/stdc++.h>
using namespace std;
typedef signed long long ll;
#define _P(...) (void)printf(__VA_ARGS__)
#define FOR(x,to) for(x=0;x<(to);x++)
#define FORR(x,arr) for(auto& x:arr)
#define FORR2(x,y,arr) for(auto& [x,y]:arr)
#define ALL(a) (a.begin()),(a.end())
#define ZERO(a) memset(a,0,sizeof(a))
#define ... | ALGO | 0.999961 | 3.51799 |
481f3a4d-e122-4490-96de-c60ba7de86b3 | sarvex/leetcode-s | solution/0300-0399/0338.Counting Bits/Solution.cpp | class Solution {
public:
vector<int> countBits(int n) {
vector<int> ans(n + 1);
for (int i = 1; i <= n; ++i) ans[i] = ans[i & (i - 1)] + 1;
return ans;
}
}; | ALGO | 0.999994 | 6.370059 |
274bc7fc-9972-4056-86fe-fb82852c3bdf | akiiishiii/oi_exercises | code/1201.cpp | // 1201.cpp
#include <iostream>
#include <string>
int const Maxn = 100005;
struct segment_tree {
int a, b;
int sum;
} tree[4 * Maxn + 5];
int ans = 0;
void build(int v, int l, int r);
void insert(int v, int l, int r);
void ask(int v, int x);
int main(int argc, const char * argv[]) {
std::ios_base::sync... | ALGO | 0.999977 | 4.449714 |
7e161c81-e8ab-4752-86a9-d2cb605b1600 | Aerma7309/LeetCode | 168.excel-sheet-column-title.cpp | /*
* @lc app=leetcode id=168 lang=cpp
*
* [168] Excel Sheet Column Title
*/
#include <bits/stdc++.h>
using namespace std;
// @lc code=start
class Solution {
public:
string convertToTitle(int columnNumber) {
string ans="";
int n = columnNumber;
while (n)
{
ans.push_bac... | ALGO | 0.999737 | 6.243221 |
fd6e4da7-9290-4156-a478-b6a1addb5121 | pratikroy311/DS-and-Algo-codes | recurssion/3_oneSubseqwithSumK.cpp | #include <bits/stdc++.h>
using namespace std;
bool printSubsequenceK(vector<int>& arr,int idx,vector<int>&list,int n,int sum,int k){
if(sum == k){
for(auto i:list)
cout << i << " ";
return true;
}
if(idx == n){
return false;
}
list.push_back(arr[idx]);
if(prin... | ALGO | 0.999681 | 4.355412 |
7afe1699-b63b-41a3-a647-e3b13d460873 | Djokovic0311/LeetCode | problems/min_stack/solution.cpp | class MinStack {
public:
vector< pair<int,int> > s;
MinStack() { }
void push(int val) {
if(s.empty())
s.push_back({val,val});
else
s.push_back({val,min(s.back().second,val)});
}
void pop() { s.pop_back(); }
int top() { return s.back().... | ALGO | 0.999802 | 6.348049 |
44cc41ce-9153-4df8-b319-6f4c94577a5e | mccormeg/CS-161 | labs/lab5/roman.cpp | #include<cmath>
#include<iostream>
#include<string>
using namespace std;
void numrom(int num)
{
string out;
while(num >0)
{
if(num>=1000)
{
out.append("M");
num-=1000;
}
else if (num>=500)
{
out.append("D");
num-=500;
}
else if (num>=900)
{
out.append... | ALGO | 0.999224 | 4.15427 |
d31ebc2d-8fbe-47ad-abe0-73117436313f | Sohini-Purkait/DSA-Supreme-3.0 | Arrays/singleNumber.cpp | #include<iostream>
using namespace std;
int findUniqueNumber(int arr[], int n){
int ans = 0;
for(int i = 0; i < n; i++){
ans = ans ^ arr[i];
}
return ans;
}
int main(){
int arr[] = {2,4,1,4,1};
int size = 5;
int ans = findUniqueNumber(arr,size);
cout<<ans<<endl;
return 0;
... | ALGO | 0.999815 | 4.894462 |
eeeb18cc-c5ad-40fa-8b9a-c8df6edee1d3 | Prathameshk11/C---DSA | Arrays/Medium/Largest_subarray_sumK/better.cpp | int lenOfLongSubarr(int A[], int N, int K)
{
map<long long , int> presum;
int maxLen= 0 ;
int sum=0;
long long rem=0;
for(int i =0 ; i<N ; i++){
sum+=A[i];
if(sum==K){
maxLen =max(maxLen,i+1) ;
}
... | ALGO | 0.999723 | 4.527453 |
e8c62634-0dca-4efa-a1ef-5ea83f14a6d0 | justinfrankel/licecap | WDL/lice/lice_texgen.cpp | #ifndef WDL_NO_DEFINE_MINMAX
#define WDL_NO_DEFINE_MINMAX
#endif
#include "lice.h"
#include <math.h>
void LICE_TexGen_Marble(LICE_IBitmap *dest, const RECT *rect, float rv, float gv, float bv, float intensity)
{
int span=dest->getRowSpan();
int w = dest->getWidth();
int h = dest->getHeight();
int x = 0;
int ... | ALGO | 0.964832 | 4.14475 |
1b6d6ac4-82b6-481e-a3ae-85d70bcd0f49 | MagnusEvenstuen/Megaprosjekt-AIS2105 | src/moveit2/moveit_planners/pilz_industrial_motion_planner/src/trajectory_blender_transition_window.cpp | #include <pilz_industrial_motion_planner/trajectory_blender_transition_window.hpp>
#include <algorithm>
#include <memory>
#include <math.h>
#include <tf2_eigen/tf2_eigen.hpp>
#include <moveit/planning_interface/planning_interface.hpp>
#include <moveit/utils/logger.hpp>
namespace
{
rclcpp::Logger getLogger()
{
retur... | TOOL | 0.962839 | 5.124452 |
bf1497c9-cc18-44a0-9e73-6961c1e77f98 | Raghu128/AlldsaProblem | Difficulty: Medium/Ceil in BST/ceil-in-bst.cpp | //{ Driver Code Starts
#include <bits/stdc++.h>
using namespace std;
struct Node {
int data;
struct Node* left;
struct Node* right;
};
// Utility function to create a new Tree Node
Node* newNode(int val) {
Node* temp = new Node;
temp->data = val;
temp->left = NULL;
temp->right = NULL;
... | ALGO | 0.999867 | 6.44579 |
bf6d670c-17fc-497b-857a-fb5a5e13c2c3 | F0RE1GNERS/ACMSteps | HDU/6373.cpp | // [Auto Archived]
// Submit: 2018-08-08 12:23:25
// Time: 0MS
// Memory: 1452K
#include <bits/stdc++.h>
//#undef zerol
using namespace std;
using LL = long long;
using ULL = unsigned long long;
#define FOR(i, x, y) for (decay<decltype(y)>::type i = (x), _##i = (y); i < _##i; ++i)
#ifdef zerol
#define dbg(args...) ... | ALGO | 0.999725 | 3.421583 |
c23bb19b-bb4e-445a-9fbf-6dcdeee4b47e | danyaKlmov/programming | 20 03 22/13 03 22/13 03 22/if14.cpp | #include <iostream>
using namespace std;
int main14() {
int a, b, c, min, max;
cin >> a >> b >> c;
min = a;
max = b;
if ((b < a) && (b < c)) {
min = b;
}
if ((c < a) && (c < b)) {
min = c;
}
if ((a > b) && (a > c)) {
max = a;
}
if ((c > a) && (c > b)) {
max = c;
}
cout << min << ' ' << max;
retur... | ALGO | 0.999787 | 3.317899 |
61d5dd9b-1247-48e8-a854-8c713f597694 | Vision-99/Competitive-Programming | CF/educational div2/175/C_Limited_Repainting.cpp | #include <bits/stdc++.h>
using namespace std;
using ll = long long;
#define fl(i,a,b) for(ll i=a;i<b;i++)
#define fle(i,a,b) for(ll i=a;i<=b;i++)
#define nl endl
#define pb push_back
#define MOD 1000000007
#define all(a) a.begin(),a.end()
#define rall(a) a.rbegin(),a.rend()
#define God_Speed ios_base::sync_with_stdio(... | ALGO | 0.99993 | 4.977819 |
e99fe129-7c20-4e29-a68d-51c4a9faeb13 | ukeSJTU/CS2602 | src/homework/14151/main.cpp | #include <iostream>
#include "LinkStack.h"
#include "SeqQueue.h"
using namespace datastructures;
int main()
{
int T;
std::cin >> T;
while (T--) {
int n;
std::cin >> n;
int value;
bool flag = true;
LinkStack<int> s;
SeqQueue<int> q = SeqQueue<int>(n + 1);
... | ALGO | 0.999925 | 4.703476 |
ebec5878-8313-4b03-9d7e-eb70701cc8db | ztongfighton/Leetcode-Answers | Add Binary.cpp | class Solution {
public:
string addBinary(string a, string b) {
int carry = 0;
const int m = a.size();
const int n = b.size();
if (m > n) b.insert(0, m - n, '0');
if (m < n) a.insert(0, n - m, '0');
string result;
for (int i = max(m, n) - 1; i >= 0; --i){
... | ALGO | 0.999933 | 6.537625 |
d0f905e3-1bd3-4696-8846-9f844457cb60 | samuel-cavalcanti/parallel_programming_ufrn | swaptions/src/block_range/block_range.cpp | #include "block_range.h"
BlockRange find_blocked_range(int thread_index, int input_size, int threads)
{
BlockRange r;
int division = input_size / threads;
int rest = input_size % threads;
if (thread_index < rest)
{
r.begin = thread_index * (division + 1);
r.end = r.begin + divisio... | ALGO | 0.977734 | 4.024857 |
1aad1567-1543-4b58-b3da-5780ec9eb20f | tridibsamanta/GeeksforGeeks_Solutions | Practice/Binary_Tree_to_DLL.cpp | /**
* Title : Binary Tree to DLL
* Author : Tridib Samanta
* Link : https://practice.geeksforgeeks.org/problems/binary-tree-to-dll/1
**/
// { Driver Code Starts
#include <bits/stdc++.h>
using namespace std;
// Tree Node
struct Node
{
int data;
Node* left;
Node* right;
};
// Utility function to ... | ALGO | 0.99983 | 7.023376 |
320a11b3-383d-44c0-8f8e-ea2f1f51024d | Guminsung/Algorithm | BOJ/1541.cpp | #include <iostream>
using namespace std;
int main()
{
ios_base::sync_with_stdio(false);
cin.tie(NULL);
cout.tie(NULL);
bool b = true;
int num, sum = 0, c = 0;
int v[50];
string s;
cin >> s;
for (int i = 0; i <= s.size(); i++)
{
if (s[i] == '+' || i == s.size())
{... | ALGO | 0.999994 | 4.29476 |
871a3d26-1a55-4ce2-87ec-532d25adec81 | tofuwen/leetcode | Medium/69 Sqrt(x)/code.cpp | #include <cmath>
class Solution {
public:
int mySqrt(int x) {
return floor(sqrt(x+0.5));
}
}; | ALGO | 0.999475 | 4.685325 |
aa19fdbd-9fec-40b7-98c2-14fe22b04e86 | OneBitPython/Codeforces | A_MEXanized_Array.cpp | #include <bits/stdc++.h>
using namespace std;
#define int long long
#define pb push_back
#define all(c) c.begin(), c.end()
#define endl "\n"
const double PI=3.141592653589;
void __print(int x) {cerr << x;}
void __print(long x) {cerr << x;}
void __print(unsigned x) {cerr << x;}
void __print(unsigned long x) {cerr << ... | ALGO | 0.999775 | 4.161438 |
fe069cec-d5e9-4954-adf4-f94923d8292d | themonstersd13/CP | C_Beautiful_Sequence.cpp | #include <bits/stdc++.h>
using namespace std;
#define theMonster main
#define Saurabh ios_base::sync_with_stdio(false);
#define Doiphode cin.tie(NULL);
#define ll long long
#define v vector<long long>
#define vs vector<string>
#define mp unordered_map<long long,long long>
#define mpp map<long long,long long>
#define m... | ALGO | 0.999842 | 4.665989 |
4dd4715f-c972-4e23-8733-1aeb464297b0 | ishandutta2007/codeforces | aarr/normal/1294/A.cpp | #include <iostream>
using namespace std;
int main() {
int t;
cin >> t;
for (int i = 0; i < t; i++) {
int a, b, c, n;
cin >> a >> b >> c >> n;
int y = max(max(a, b), c);
int x = 3 * y - a - b - c;
if ((a + b + c + n) % 3 == 0 && x <= n) {
cout << "YES" << endl;
}
else {
cout << "NO" << endl;
}
... | ALGO | 0.999855 | 3.92384 |
1e2e6906-2612-4a2e-8f82-eb2abd23c245 | bluemoon/crayons | ext/aggdraw/agg2.5/src/agg_bezier_arc.cpp | #include <math.h>
#include "agg_bezier_arc.h"
namespace agg
{
// This epsilon is used to prevent us from adding degenerate curves
// (converging to a single point).
// The value isn't very critical. Function arc_to_bezier() has a limit
// of the sweep_angle. If fabs(sweep_angle) exceeds pi/2 the cur... | ALGO | 0.985085 | 7.369898 |
77f23ef4-8f35-469b-8bee-0b60b7169884 | najmus-shakib01/Introduction-to-C-for-DSA | WEEK-1/Module 1/Switch_Case.cpp | #include<bits/stdc++.h>
using namespace std;
int main(){
int n=3;
switch(n){
case 1:
cout<<"One"<<endl;
break;
case 2:
cout<<"Two"<<endl;
break;
case 3:
cout<<"Three"<<endl;
break;
default:
cout<... | ALGO | 0.995316 | 3.616269 |
c8d7bcce-b724-46c5-a262-f89afc65750b | AlokGiri01/note_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 |
5825f59b-c1dc-4215-9ee0-f84f3a33ff45 | DSC-SCOE/DSC_Practice | BE/hemant.cpp | #include<bits/stdc++.h>
using namespace std;
int solve(string s) {
string s1 = "";
int cnt = 0;
for(int i=0; i<s.length()-1; i++) {
map<char, int> s1_map;
map<char, int> s2_map;
s1 += s[i];
for(char x: s1)
s1_map[x]++;
string s2 = "";
f... | ALGO | 0.999927 | 4.932848 |
88a8d931-b550-47c0-8888-15237f0c0a81 | godot-extended-libraries/godot-fire | thirdparty/oidn/mkl-dnn/src/cpu/jit_uni_lrn.cpp | #include "c_types_map.hpp"
#include "type_helpers.hpp"
#include "utils.hpp"
#include "jit_uni_lrn_kernel_f32.hpp"
#include "jit_uni_lrn.hpp"
namespace mkldnn {
namespace impl {
namespace cpu {
using namespace mkldnn::impl::format_tag;
using namespace mkldnn::impl::status;
using namespace mkldnn::impl::utils;
templa... | ALGO | 0.873582 | 7.417541 |
28964424-79eb-4f3b-a5ef-0ca2d10bd535 | ramandpkaur/dsa-using-cpp | 07_BinarySearch/PainterAllocation.cpp | #include<iostream>
using namespace std;
int main() {
int k=2; //Number of workers
int N=4; //number of boards to be painted
int A[]={12,34,67,90}; //Array of board sizes
if(k<N)
return -1;
int start=0, end=0, mid, ans;
for(int i=0; i<N; i++) {
start = max(A[i], start)... | ALGO | 0.999947 | 4.333755 |
c92e71c6-e432-42a6-a88e-54eb449f0e8f | arxitekt0r/LeetCode | 83/task.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* deleteDuplicates(ListNode* head)
{... | ALGO | 0.999874 | 5.688779 |
a8508c2b-784b-45e3-9e6c-ba8a8709cab4 | ishandutta2007/codeforces | feecie6418/normal/1442/C.cpp | #include<bits/stdc++.h>
using namespace std;
const int mod=998244353;
int rd(){
int x=0,ch=getchar();
while(!isdigit(ch))ch=getchar();
while(isdigit(ch))x=x*10+ch-'0',ch=getchar();
return x;
}
struct Node{
int tm,dis;
};
struct Qnode{
int id,isz,tm,dis;
};
int n,m,v[300005][25][2];
bool operator <(Nod... | ALGO | 0.99965 | 4.38562 |
75e51151-f121-4967-80fd-5c866dab2266 | Bharat2044/365-days-coding-challanges | Day_291/02_findDuplicateSubtrees.cpp | // Question Link: https://leetcode.com/problems/find-duplicate-subtrees/description/
/*
652. Find Duplicate Subtrees
Given the root of a binary tree, return all duplicate subtrees.
For each kind of duplicate subtrees, you only need to return the root node of any one of them.
Two trees are duplicate if they have the s... | ALGO | 0.999869 | 6.975862 |
25da35b1-7ddc-4d9b-a2a5-0430875f86d3 | avi112bala/pattern-coding-ninja | characterpattern.cpp | #include<iostream>
using namespace std;
int main(){
/* Read input as specified in the question.
* Print output as specified in the question.
*/
int n;
cin>>n;
int i=1;
while(i<=n){
int j=1;
int start='A' +i -1;
while(j<=i){
char ch =start +j -1;
... | ALGO | 0.999414 | 3.723819 |
5ed71c22-2198-457d-93d5-78efecfff531 | lydrainbowcat/tedukuri | 配套光盘/例题/0x50 动态规划/0x5A 斜率优化/Cats Transport/solutions/std.cpp | #include<iostream>
#include<cstdio>
#include<cstring>
#include<algorithm>
using namespace std;
__int64 f[110][100010],s[100010],a[100010],d[100010],q[100010],g[100010];
int n,m,p,i,j,k,l,r;
int main()
{
cin>>n>>m>>p;
for(i=2;i<=n;i++)
{
cin>>j;
d[i]=d[i-1]+j;
}
for(i=1;i<=m;i++)
{
cin>>j>>k;
a[i]=k-d[j];
... | ALGO | 0.999953 | 3.240099 |
75f104d9-85e7-425f-aac4-92d90523c630 | raincross7/code-similarity | codes/train_code/problem361/problem361_427.cpp | #include <bits/stdc++.h>
using namespace std;
#define ll long long
#define rep(i, n) for (ll i = 0; i < n; ++i)
#define P pair<ll, ll>
#define Graph vector<vector<ll>>
#define fi first
#define se second
constexpr ll mod = 1000000007;
constexpr ll INF = (1ll << 60);
constexpr double pi = 3.14159265358979323846;
template... | ALGO | 0.999898 | 3.692349 |
4a11730b-ef97-4163-8cff-5a8505b7ff16 | jisonchakma/problem-solving | Week_7/Day6/suny_day.cpp | #include <iostream>
using namespace std;
void solve()
{
int x;cin>>x;
if(x>24)
cout<<"YES"<<endl;
else
cout<<"NO"<<endl;
}
int main() {
// your code goes here
int t;
cin>>t;
while(t--)
solve();
return 0;
}
| ALGO | 0.999345 | 3.640226 |
88c7c57e-b986-4e94-a79b-347a7d60bcc2 | ishandutta2007/codeforces | humbertoyusta/normal/1557/C.cpp | /** Created by: Humberto Yusta
Codeforces User: humbertoyusta
Country: Cuba */
#include<bits/stdc++.h>
using namespace std;
/// Pragmas
#pragma GCC optimize("Ofast","unroll-loops","omit-frame-pointer","inline","03") // Optimization flags
//#pragma GCC option("arch=native","t... | ALGO | 0.999785 | 4.155877 |
a92da288-13f8-4a02-9f47-1376c296e1fb | Winterleaf/OmniEngine.Net | Engine/source/platformWin32/cardProfile.cpp | #include "core/strings/stringFunctions.h"
#include "console/console.h"
#include "console/engineAPI.h"
#include "platformWin32/platformWin32.h"
void initDisplayDeviceInfo()
{
Con::printf( "Reading Display Device information..." );
U8 i = 0;
DISPLAY_DEVICEA ddData;
ddData.cb = sizeof( DISPLAY_DEVICEA );
... | CONFIG | 0.874679 | 4.502838 |
63c9dd0e-1a98-4e8f-a805-1625c78bd6a6 | The1one1/code | B_Patchouli_s_Magical_Talisman.cpp | #include<bits/stdc++.h>
using namespace std;
#define int long long
signed main(){
int t; cin >> t;
while(t--)
{
int n; cin >> n;
vector<int> v(n);
for(int i = 0; i < n; i++){
int x; cin >> x;
while(x % 2 == 0){
v[i]++;
x = x / ... | ALGO | 0.999848 | 4.519132 |
e422ef94-45d9-4e0b-a604-08fdb63973ba | bossxu/acm | 计算思维实训/第4组/c.cpp | #include<iostream>
using namespace std;
#include<cstdio>
#include<cstring>
#include<cstdlib>
int n,m;
int main()
{
cin>>n>>m;
memset(tree,0,sizeof(tree));
int a,b,c;
for(int i = 1;i<=m;i++)
{
cin>>a>>b>>c;
for(int i = a;i<=b;i++)
{
tree[i]+=c;
}
}
for(int i ... | ALGO | 0.999975 | 3.227812 |
59617b48-8033-493d-a058-1db1fd61a2e4 | qinRight/skr | baseLibrary/enginesdk/src/main/cpp/one/score_processor/f0_cal/PYin/MonoPitch.cpp | /* -*- c-basic-offset: 4 indent-tabs-mode: nil -*- vi:set ts=8 sts=4 sw=4: */
#include "MonoPitch.h"
#include "MonoPitchHMM.h"
#include <vector>
#include <cstdio>
#include <cmath>
#include <complex>
#include "autorap_logger.hpp"
using std::vector;
using std::pair;
MonoPitch::MonoPitch() :
hmm()
{
}
MonoPitch::... | ALGO | 0.996312 | 6.23718 |
db1eeb8b-07cc-434e-9c23-40035141e98c | uniqss/leetcodecpp | 0429/429_N-aryTreeLevelOrderTraversal1.cpp | #include "../inc.h"
/*
BFS 经典算法:(JAVA)
List<Integer> values = new ArrayList<>();
Queue<Node> queue = new LinkedList<>();
queue.add(root);
while (!queue.isEmpty()) {
Node nextNode = queue.remove();
values.add(nextNode.val);
for (Node child : nextNode.children) {
queue.add(child);
}
}
BFS 经典算法:(C... | ALGO | 0.999855 | 5.499619 |
8407ab09-14af-44c3-becd-b1317eb13b89 | yogg17/CompetitiveProgramming | KreversalQueue.cpp | /*Reversing Elements Of Queue
Problem Description
Given an array of integers A and an integer B.We need to reverse the order of the first B elements of the array,
leaving the other elements in the same relative order.
NOTE : You are required to first insert elements into an auxiliary queue then pe... | ALGO | 0.999923 | 3.829872 |
4b3cdd54-c1fa-4a35-acf9-9f65de2e13b6 | Rocky-6/atcoder_cpp | abc279/d.cpp | #include <bits/stdc++.h>
using namespace std;
int main() {
long long a, b;
cin >> a >> b;
auto f = [&](long long n) -> double {
return (double)a / sqrt(n + 1) + (double)b * n;
};
long long l = 0, r = a / b;
while (r - l > 2) {
long long m1 = (l * 2 + r) / 3;
long long m... | ALGO | 0.999398 | 3.784064 |
4a674553-8683-40f4-bbde-7b927a5b06cf | humanwhoexplores/CodeChef-codes- | chef_PLZLYKME.cpp | #include<iostream>
using namespace std;
int main() {
int T;
long long l,s,c;
int d,i;
cin>>T;
while(T--)
{
cin>>l>>d>>s>>c;
for(i=1;i<d;i++)
{
s=(1+c)*s;
if(s>=l)
break;
}
if(s<l)
cout<<"DEAD AND ROTTING"<<endl;
else
cout<<"ALIVE AND KICKING"<<endl;
}
return 0;
}
| ALGO | 0.999539 | 3.498675 |
f7dfcaaf-8bb5-42ed-b323-f39d3cb98e07 | kumar-gautam24/codes | python3/tree.cpp | #include <iostream>
#include <vector>
#include <queue>
#include <climits>
using namespace std;
vector<vector<int>> adj;
vector<int> A;
vector<int> P;
vector<bool> visited;
void bfs(int start, int &componentSize, int &maxStrength, bool &isGood)
{
queue<int> q;
q.push(start);
visited[start] = true;
com... | ALGO | 0.999781 | 4.788874 |
40986325-d9f8-4d18-a50e-183a9e77b021 | nadim28/Competative_coding | A. Game 23.cpp | #include<bits/stdc++.h>
using namespace std;
typedef long long l;
int main(){
l n,m;
int count=0;
cin>>n>>m;
if(m%n!=0) {
cout<<-1<<endl;
return 0;
}
l div=m/n;
while(div%2==0){
count++;
div/=2;
}
while(div%3==0){
count++;
div/=3;
}
if(div==1) cout<< count<<endl;
else cout<<-1<<endl;
return 0... | ALGO | 0.999993 | 3.789218 |
ccf28112-64e2-4a3d-96a1-5ff0cdbf40bc | limyingjie/50.017-Assignments | a3/vecmath/src/Matrix3f.cpp | #include "Matrix3f.h"
#include <cassert>
#include <cmath>
#include <cstdio>
#include <cstring>
#include "Matrix2f.h"
#include "Quat4f.h"
#include "Vector3f.h"
Matrix3f::Matrix3f( float fill )
{
for( int i = 0; i < 9; ++i )
{
m_elements[ i ] = fill;
}
}
Matrix3f::Matrix3f( float m00, float m01, float m02,
... | TOOL | 0.914763 | 7.075181 |
72d2927f-a416-4ef8-b776-5e7380f602c3 | chidvi123/GFG-POTD | 2025/july/14_CuttingBinaryString.cpp | /*You are given a binary string s consisting only of characters '0' and '1'. Your task is to split this string into the minimum number of non-empty substrings such that:
Each substring represents a power of 5 in decimal (e.g., 1, 5, 25, 125, ...).
No substring should have leading zeros.
Return the minimum number of su... | ALGO | 0.999881 | 6.304794 |
5d752cd6-91ec-48a9-b182-d2ef0b5b7bf4 | injiiiiil/654 | torch/csrc/jit/passes/integer_value_refinement.cpp | #include <ATen/core/jit_type.h>
#include <torch/csrc/jit/ir/ir.h>
#include <torch/csrc/jit/jit_log.h>
#include <torch/csrc/jit/passes/integer_value_refinement.h>
#include <torch/csrc/jit/passes/value_refinement_utils.h>
#include <utility>
namespace torch::jit {
using IntegerRefinement = std::unordered_map<Value*, in... | TOOL | 0.934296 | 7.773278 |
ef497462-40e3-4502-bac6-7e5a1c01c3ba | akirago/at_coder | method/quick_sort.cpp | #include <stdio.h>
#define SIZE_OF_ARRAY(array) (sizeof(array)/sizeof(array[0]))
#define SWAP(type,a,b) { type work = a; a = b; b = work; }
static void quick_sort(int* array, size_t size);
static void quick_sort_rec(int* array, int begin, int end);
static int select_pivot(int* array, int begin, int end);
static vo... | ALGO | 0.999978 | 5.105916 |
522aaf40-a4ac-4650-9f8a-c80493dc4653 | piechoor/PAMSI-2 | src/graph_list.cpp | #include "graph_list.hh"
Graph_List::Graph_List(const char *file_name) {
std::ifstream txt_file;
txt_file.open(file_name);
//giving an error if the file couldnt be opened
if(!txt_file) {
std::cerr << "File error - file could not be opened";
exit(1);
}
int temp_from, temp_to, te... | ALGO | 0.938933 | 3.88739 |
ebd8373a-0457-47f4-8d61-739897506309 | SamyakJain2002/Coding-Solutions | Nearly sorted - GFG/nearly-sorted.cpp | // { Driver Code Starts
#include<bits/stdc++.h>
using namespace std;
// } Driver Code Ends
class Solution
{
public:
//Function to return the sorted array.
vector <int> nearlySorted(int arr[], int num, int K){
priority_queue<int,vector<int>,greater<int>> q;
vector<int>ans;
K++;
... | ALGO | 0.999946 | 5.677728 |
8b581d69-a89d-4473-9723-8bf4b61edf44 | KushagraSinha2002/CodingNinja_DSA_CPP | Linked List 1/Print_ith_node/Print_ith_node.cpp | #include <iostream>
using namespace std;
#include "solution.cpp"
class Node
{
public:
int data;
Node *next;
Node(int data)
{
this->data = data;
this->next = NULL;
}
};
Node *takeinput()
{
int data;
cin >> data;
Node *head = NULL, *tail = NULL;
while (data != -1)
{
Node *newNode = new Node(data);
if ... | ALGO | 0.998863 | 4.09742 |
70ecafd2-5d98-4486-aed8-c7fefab801ac | fanyuxuan198315/Informatics-Olympiad-CPP-Answers-to-Questions | 09递推算法/1196_踩方格.cpp | #include <iostream>
using namespace std;
int dp[25];
int main(){
dp[0]=1;
dp[1]=3;
int n;
cin>>n;
for(int i=2;i<=n;i++){
dp[i]=2*dp[i-1]+dp[i-2];
}
cout<<dp[n];
return 0;
}
| ALGO | 0.999964 | 3.547052 |
11ed9126-aead-451f-aea7-ec186c8a9fb8 | hegdemanu/Leetcode | 53-maximum-subarray/maximum-subarray.cpp | class Solution {
public:
int maxSubArray(vector<int>& a) {
int sum = 0, maxi = a[0]; // Initialize maxi to first element instead of INT_MIN
for (int i = 0; i < a.size(); i++) {
sum += a[i];
if (sum > maxi) { // Avoid using max() function
maxi = sum;
... | ALGO | 0.99995 | 6.451361 |
2d4841f2-2a12-43e4-b816-62946186b421 | hzl1230/mcc | ThirdParty/Eigen3.3.7/doc/examples/matrixfree_cg.cpp | #include <iostream>
#include <Eigen/Core>
#include <Eigen/Dense>
#include <Eigen/IterativeLinearSolvers>
#include <unsupported/Eigen/IterativeSolvers>
class MatrixReplacement;
using Eigen::SparseMatrix;
namespace Eigen {
namespace internal {
// MatrixReplacement looks-like a SparseMatrix, so let's inherits its trai... | ALGO | 0.999221 | 6.060634 |
8997aa7f-9cdb-4e1c-b572-3deca0b6151b | arnab812/LeetCode | 08_01_String_to_Integer_(atoi).cpp | class Solution {
public:
int myAtoi(string s) {
// helper variables
int res=0;
int i=0;
int sign=1;
while(i<s.size()&&s[i]==' ')i++; //ignore leading white space
if(s[i]=='-'||s[i]=='+') //check if number positve or negative
{
... | ALGO | 0.999482 | 5.115187 |
951ddcd0-655e-4cf7-a69f-09e0a9bdccb1 | swag-lang/swag | llvm/clang-tools-extra/clangd/support/Trace.cpp | #include "support/Trace.h"
#include "support/Context.h"
#include "llvm/ADT/DenseSet.h"
#include "llvm/ADT/ScopeExit.h"
#include "llvm/ADT/StringRef.h"
#include "llvm/Support/Chrono.h"
#include "llvm/Support/FormatVariadic.h"
#include "llvm/Support/Threading.h"
#include <atomic>
#include <chrono>
#include <memory>
#incl... | TOOL | 0.926527 | 7.733384 |
0691d03a-5843-45ce-b231-8f9745b7cb51 | ifradK/Competitive-Programming-Solutions | C++ Programs/MIST selection/3/Problem D.cpp | #include<iostream>
#include <bits/stdc++.h>
#define fastio ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL)
using namespace std;
main()
{
fastio;
long long t,n,k,i,j,z,cnt,remain,min,remain2;
cin>>t;
while(t--)
{
cin>>n>>k;
remain=k;
cnt=0;
long a[n];
... | ALGO | 0.999947 | 3.364374 |
c02b31a7-d24a-4320-90c7-404eefc49822 | shailjasoni2005/Cpp-Programs | project17.cpp | #include <iostream>
using namespace std;
int factorial(int n)
{
if(n<=1)
{
return 1;
}
else
{
return n*factorial(n-1);
}
}
int main()
{
int a;
//factorial of a number:
cout<<"enter a no.";
cin>>a;
cout<<"\n The factorial of "<<a<<" is "<<factorial(a)<<e... | ALGO | 0.981801 | 3.402667 |
638aeecc-88f4-4eb4-b1bd-9b9e1662dbb9 | Animesh-roy100/Leetcode-Solutions | 0338-counting-bits/0338-counting-bits.cpp | class Solution {
public:
vector<int> countBits(int n) {
vector<int> ans(n+1, 0);
for(int i=1; i<=n; i++) {
// int count=0;
// int num=i;
// while(num>0) {
// count += (num&1);
// num = num>>1;
// }
// ans[i]=... | ALGO | 0.999997 | 6.035449 |
82abc83f-8308-4e51-96bf-980468ed1367 | CodderPrince/DSA-2-1 | CODEFORCES/PRACTICE/replacement.cpp | /**************************************************
* Name: MD. AN NAHIAN PRINCE *
* Codeforces: Hacker_3.0 *
* University: BEGUM ROKEYA UNIVERSITY, RANGPUR *
* Department: COMPUTER SCIENCE AND ENGINEERING *
* Email: <EMAIL> *
********************... | ALGO | 0.999855 | 4.502524 |
0f9e5688-1419-419b-98a3-c3338b86cd8e | volTRan71080V/cpp_odevler | yagiz_ege/odev_1/odev.cpp | #include <unistd.h>
#include <iostream>
void ft_putchar(char c)
{
write(1, &c, 1);
}
void print_alphabet()
{
int i = 65;
while (i < 91)
{
write(1, &i, 1);
i++;
}
}
void print_exam(int note)
{
if(note >= 90)
{
write(1, &"A", 1);
}
else if(note >= 80)
{
... | TOOL | 0.947444 | 3.839658 |
aad9cb5c-015c-40b2-87b0-ca51da98d960 | Conniekay/CS310 | Ch04Exercise16.cpp |
//This program calculates how much an author will be paid for their book under three different payment plans and chooses the best one.
#include <iostream>
#include <iomanip>
using namespace std;
int main()
{
const double OPTION1_FIXED_PAYMENT = 25000.0; //$25,000
const double OPTION2_ROYALTY_RATE... | ALGO | 0.999618 | 5.903977 |
fc0d06a0-c015-44ce-9efa-047051730429 | YZH-bot/SLAM_NOTED | open_vins/ov_msckf/src/core/VioManager.cpp | #include "VioManager.h"
#include "feat/Feature.h"
#include "feat/FeatureDatabase.h"
#include "feat/FeatureInitializer.h"
#include "track/TrackAruco.h"
#include "track/TrackDescriptor.h"
#include "track/TrackKLT.h"
#include "track/TrackSIM.h"
#include "types/Landmark.h"
#include "types/LandmarkRepresentation.h"
#includ... | TOOL | 0.853886 | 7.24834 |
98a77b75-37f9-4d73-9f35-69f466a3eb9c | mono-1729/AtCoder_cpp | AGC/014/d.cpp | #include <bits/stdc++.h>
#include <unordered_map>
#include <stdlib.h>
#include <boost/multiprecision/cpp_int.hpp>
#include <atcoder/all>
using namespace atcoder;
using namespace boost::multiprecision;
using namespace std;
#define rep(i, a, n) for(ll i = a; i < n; i++)
#define rrep(i, a, n) for(ll i = a; i >= n; i--)
#d... | ALGO | 0.999983 | 4.781315 |
e01b8978-a194-4dc6-b056-d681c8d6d9b1 | himanshupsharma/reverserproxyservercpp | src/reverse-proxy-server.cpp | #include <map>
#include <string>
#include <fstream>
#include <string.h>
#include <getopt.h>
#include <mongoose.h>
#include <json.h>
#include <curl/curl.h>
class ReverseProxyServer {
public:
ReverseProxyServer(const char* f_MappingFile);
~ReverseProxyServer();
const std::map<std::string, std::string>& getM... | WEB | 0.874594 | 4.192178 |
65aa63a7-6a0e-4215-9e98-06c1290afbf3 | le4onardo/Competitive-Programming | Project Euler/0067 - Maximum path sum II.cpp | #include <bits/stdc++.h>
using namespace std;
list<string> split(string cad, string separator){
list<string> splitted;
while(true){
int pos = cad.find(separator);
if(pos == string::npos){
break;
}
splitted.push_back(cad.substr(0,pos));
cad.erase(0,pos+1);
}
return splitted;
}
int main() {
ifstrea... | ALGO | 0.999213 | 4.605576 |
cb2458db-63cc-4efc-b39f-efde5fee9384 | VitamintK/AlgorithmProblems | codeforces/round801/c.cpp | // g++ -std=c++17 x.cpp && ./a.out
#include <iostream>
#include <string>
#include <set>
#include <map>
#include <stack>
#include <queue>
#include <vector>
#include <utility>
#include <iomanip>
#include <sstream>
#include <bitset>
#include <cstdlib>
#include <iterator>
#include <algorithm>
#include <cmath>... | ALGO | 0.999889 | 3.49692 |
492a74ee-dbce-4a52-85e1-6009fbd31798 | ChettriBishal/CP | LeetCode/Arrays/Make_Two_Arrays_Equal_Reversing.cpp | class Solution {
public:
bool canBeEqual(vector<int>& target, vector<int>& arr) {
if(target.size() != arr.size())
return false;
vector<int> ok(1003,0);
for(int i=0;i<arr.size();i++)
ok[arr[i]]++;
for(int i=0;i<target.size();i++)
ok[target[i]]--;
... | ALGO | 0.999842 | 5.538695 |
69bf81ee-d7b8-4978-8ee9-91463ae2ead2 | script-beast/DSA_CPP | PlatformQuestions/LeetCode/1501 to 1550/1519. Number of Nodes in the Sub-Tree With the Same Label.cpp | #include <bits/stdc++.h>
using namespace std;
vector<int> utl(unordered_map<int, vector<int>> &adj, int cur, int prev, string &labels, vector<int> &result)
{
vector<int> ans(26, 0);
for (int i{0}; i < adj[cur].size(); i++)
{
if (!result[adj[cur][i]])
{
vector<int> temp = utl(ad... | ALGO | 0.999954 | 5.492241 |
b3a7fb07-b89c-425f-b318-dab3b27a31d7 | IbrahimYasserM/Template | Algorithms/FFT.cpp | typedef std::complex<long double> cd;
const long double PI = acos(-1);
void fft(std::vector<cd> &a, bool invert){
int n = a.size();
for(int i=1, j=0; i<n; ++i){
int bit = n>>1;
for(; j&bit; bit>>=1)
j ^= bit;
j ^= bit;
if(i < j)
std::swap(a[i], a[j]);
... | ALGO | 0.999922 | 3.76442 |
4e4f1050-13bb-447d-ab13-c4eb20a69575 | lzh12139/MySolutions | training/20191020-cf/K_true.cpp | #include<bits/stdc++.h>
using namespace std;
using ll=long long;
const int MatrixN=4;
const ll mod=1e9+7;
struct matrix{
ll arr[MatrixN][MatrixN];
static int n;
matrix(){memset(arr,0,sizeof(arr));}
static matrix unit(){
matrix tmp;
for (int i=0;i<MatrixN;++i)
tmp.arr[i][i]=1;... | ALGO | 0.999983 | 4.720398 |
6c930be9-82e2-4ab9-85c9-9acefa021f5a | harshkg2001/cses_solutions_cpp | 2_Sorting and Searching/14_towers.cpp | #include<bits/stdc++.h>
using namespace std;
#define int long long
vector<int> input(int n)
{
vector<int> v(n);
for(int i=0; i<n; i++)
cin>>v[i];
return v;
}
int32_t main()
{
int n;
cin>>n;
vector<int> v=input(n);
vector<int> ans;
for(int i=0; i<n; i++)
{
int l=-1... | ALGO | 0.999926 | 4.312963 |
45ee6b71-2f30-431c-9769-f8eec14dfe81 | GuessEver/ACMICPCSolutions | CodeForces/463/C(Hasn't done yet)/C.cpp | #include <cstdio>
const int N = 2000 + 10;
int n;
long long sum1[N*2], sum2[N*2];
long long a[N][N];
int main()
{
scanf("%d", &n);
for(int i = 1; i <= n; i++)
for(int j = 1; j <= n; j++)
{
scanf("%lld", &a[i][j]);
sum1[i+j] += a[i][j];
sum2[i-j+N] += a[i][j];
}
// sum1[ 2 ... 2 * n]
// sum2[ 1-n+N... | ALGO | 0.999926 | 3.069409 |
20de416e-b0cf-4b3c-8cee-6a9e408e4f50 | manikanta2901/ubuntu | .history/practice/cpp/Leetcode/Cpp/MedianOfTwoSortedArrays_20210322193650.cpp | #include<bits/stdc++.h>
using namespace std;
double findMedianSortedArrays(vector<int>& nums1, vector<int>& nums2) {
double answer;
for()
return answer;
}
int main(){
int size1,size2;
cin >> size1 >> size2;
vector<int>a,b;
for(int i = 0; i < size1; i++){
int c;
cin >> c;
... | ALGO | 0.999991 | 4.425505 |
e8d65315-226d-4e21-a7d9-57f929754f22 | JaeHyoNi/BackJoon | 4386.cpp | #include <bits/stdc++.h>
using namespace std;
struct star{double from; double to;};
struct road{double val;int from; int to;};
vector<star> stars;
vector<road> roads;
double distance(star &a , star &b){return sqrt(pow(a.from-b.from,2)+pow(a.to-b.to,2));}
int arr[101];
int find_mother(int num){
if(arr[num] == num... | ALGO | 0.999649 | 3.689633 |
901f262a-ec67-40d2-86af-bb660e7ccea7 | deeksha04-alt/DSA | BST/Pairs_of_2_BST_witha_given_sum.cpp | /*
Logic:
(1) Store the inorder traversal of both BST's
(2) set the start index to 0 for BST1, end index to last index of inorder_BST2 , countert to zero
(3) Run a loop, till start index is lesser than inorder_BST1.size() end index is greater than -1;
(4) As per the following condition check, proceed
(a) Case 1... | ALGO | 0.999995 | 5.827102 |
356d3990-a80a-4d9a-b22e-38db5cc44453 | khichinho/COL380-Parallel-Assignments | A1/a1_openmp.cpp | #include <iostream>
#include <string>
#include <vector>
#include <fstream>
#include <random>
#include <cstdlib>
using namespace std;
int n; // Size of matrix
int t; // Number of threads
void print_matrix(double **a){
for(int i =0 ; i < n ; i +=1){
for(int j = 0 ; j < n ; j +=1){
cout << a[i]... | ALGO | 0.999534 | 3.418339 |
b4944233-a8f2-48ad-ba87-91202d212471 | FulanXisen/previous_repo | topological_sort/topological-sort.cpp | #include <string>
#include <iostream>
#include <cstdlib>
#include <cstdio>
using namespace std;
typedef struct vertex vertex;
struct node
{
vertex* head;
node* next;
};
struct vertex
{
char letter;
node* next;
};
int index(char c)
{
return (c-97);
}
class toposort
{
public:
int orders[26];
vertex* LinkList;... | ALGO | 0.999957 | 3.740404 |
df5a1f7d-f2e0-41a0-984b-320cc3ac9c98 | siof/hellground-wowemu | dep/g3dlite/source/MeshAlgAdjacency.cpp | #include "G3D/Table.h"
#include "G3D/MeshAlg.h"
#include "G3D/Set.h"
#include "G3D/Stopwatch.h"
#include "G3D/SmallArray.h"
#include "G3D/AreaMemoryManager.h"
namespace G3D {
/** Two-level table mapping index 0 -> index 1 -> list of face indices */
class MeshEdgeTable {
public:
/** We expect 2 faces per edge. *... | ALGO | 0.999393 | 7.159208 |
aa3144b8-c3a2-42ce-bf4c-c4ec3b52ae6e | va-beliaew/Multythreads | Project2/Project2/main.cpp | #include <iostream>
#include <vector>
#include <chrono>
#include <thread>
void num_CPU() {
std::cout << " - " << std::thread::hardware_concurrency() << std::endl;
}
void sum(std::vector<int>::iterator it_begin1, std::vector<int>::iterator it_end1, std::vector<int>::iterator it_begin2, std::vector<int>::iterator ... | ALGO | 0.988315 | 4.432345 |
27eac9b7-e1c7-4c3e-b5ed-5bccb441d4cb | fp024/programmers-c-coding-test-study | lv00/Exam014_250126_test.cpp | #include <gmock/gmock-matchers.h>
#include <gtest/gtest.h>
#include <string>
#include <vector>
using namespace std;
using namespace testing;
// 테스트할 함수 선언
string solution(const vector<string> &storage, const vector<int> &num);
class Exam014_250126_Tests : public Test {
protected:
void SetUp() override {}
void... | TEST | 0.997494 | 6.658567 |
78fa5831-fe7d-42be-b050-063d1962603d | shobhit312/spoj-problems | COINS.cpp | #include <stdio.h>
#include <iostream>
#include <stdlib.h>
#include <algorithm>
#include <string>
#define rep(i,a,n) for(i=a; i<n; i++)
#define in(x) scanf("%d",&x)
#define out(y) printf("%d ",y)
using namespace std;
long long int calculate(int n , int *arr){
if(n>=1 && n<=10)
return n;
else
return calculate... | ALGO | 0.999819 | 4.278426 |
65b02ee1-7d89-40c2-b2cb-ec92ac8c934e | Eydou/107transfer | main.cpp | /*
** EPITECH PROJECT, 2019
** main.c
** File description:
** the brain.
*/
#include "my_lib.h"
double math::horner(char *calc, double step)
{
math po(calc);
transfer = 0;
for (po.i; po.i >= 0; po.i -= 2) {
while (po.i >= 0 && calc[po.i] != '*') {
po.i = po.i - 1;
}
po... | ALGO | 0.998696 | 3.231935 |
5e4ffdca-d5de-4c06-b48b-b4370da355ad | A-moment096/Phase-Field-Tutorial | PF_T3-Cpp_and_Example/src/4_pointer_reference.cpp | /*
Pointers can be the most distinct feature of C/C++ from other languages.
Some one find that pointer is the most difficult part for C/C++,
and yes, this could be right, but only when you try to do kernel-level
programming and need to manage many resources with raw pointers by hand.
That would be awful if you are not ... | TOOL | 0.902649 | 3.836734 |
220a75bc-5ef3-4eb0-9d43-80094159a600 | wangbo-thu/AOJ | DPL_1_A-TLE.cpp | // DPL_1_A.cpp
// Combinatorial - Coin Changing Problem
// TLE - 通过8个测试用例
#include <iostream>
#include <vector>
#include <algorithm>
using namespace std;
const int MAXM = 20;
const int INF = 50000;
int res;
vector<int> nums(MAXM);
int dfs(int sum, int pos) {
if (sum < 0 || pos < 0) return INF;
if (sum == 0) {
... | ALGO | 0.999987 | 4.49514 |
7d2ec1a6-1d64-4894-88d8-e3e06962bfb9 | mcneel/boost_1_55_0 | libs/numeric/odeint/examples/stochastic_euler.cpp | #include <vector>
#include <iostream>
#include <boost/random.hpp>
#include <boost/array.hpp>
#include <boost/numeric/odeint.hpp>
/*
//[ stochastic_euler_class_definition
template< size_t N > class stochastic_euler
{
public:
typedef boost::array< double , N > state_type;
typedef boost::array< double , N > der... | ALGO | 0.999541 | 5.723111 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.