uuid string | repo_name string | relative_path string | content string | category string | algo_rel_score float64 | quality_score float64 |
|---|---|---|---|---|---|---|
6a2221ac-8695-4e37-88dc-2ed99b517f2d | rbuerki/reference-code-python-programming | algorithms/1_algorithmic_toolbox/z_orig_material/week2_algorithmic_warmup/6_last_digit_of_the_sum_of_fibonacci_numbers/fibonacci_sum_last_digit.cpp | #include <iostream>
int fibonacci_sum_naive(long long n) {
if (n <= 1)
return n;
long long previous = 0;
long long current = 1;
long long sum = 1;
for (long long i = 0; i < n - 1; ++i) {
long long tmp_previous = previous;
previous = current;
current = tmp_pre... | ALGO | 0.999955 | 5.007132 |
3a2618ea-b327-4db5-b384-87fc343a241c | harsh0603/DSA_C- | POST/Linked_list/merge_sorted.cpp | #include<iostream>
using namespace std;
class Node{
public :
int data;
Node* next;
Node (int data){
this->data = data;
next =NULL;
}
};
Node* TakeInput(){
int data;
cin>>data;
Node* head = NULL;
Node* tail = NULL;
while(data !... | ALGO | 0.999798 | 4.476298 |
f3bbfeba-f363-4385-a08a-b175ed250686 | Ryzeon/cp-programing | Contests/VirtualJudgeKattis/ProvincesandGold.cpp | // time-limit: 1000
// problem-url: https://vjudge.net/problem/Kattis-provincesandgold
#include <bits/stdc++.h>
using namespace std;
#define OS \
ios_base::sync_with_stdio(false); \
cin.tie(nullptr);
#de... | ALGO | 0.997249 | 5.172126 |
71c77bb5-b276-4109-965f-c0c315ab2026 | SONGYOUNGWOO/nwgp | Server/EntityMovement.cpp | #include "pch.h"
#include "EntityMovement.h"
#include "AStar.h"
#include "MCWorld.h"
#include "MCTilemap.h"
#include "Object.h"
void EntityMovement::Update(const float DT)
{
// ӵ (߷ ʱȭ)
m_vAccelation = glm::vec3(0.0f, -40.0f, 0.0f);
// ÷̾
//dest = FindTarget();
float mul_vel = 0.f;
const auto prev_vel = ... | ALGO | 0.940189 | 4.606161 |
e6e89b99-4c05-443c-8da3-708400a7c602 | Gaurav31U/LEETCODE | 0386-lexicographical-numbers/0386-lexicographical-numbers.cpp | static const int _ = [](){
ios::sync_with_stdio(false);
cin.tie(nullptr);
cout.tie(nullptr);
return 0;
}();
class Solution {
public:
vector<int> lexicalOrder(int n) {
vector<int> ans;
auto dfs=[&](auto&& dfs,string s)->void{
int num=stoi(s);
if(num>n)return;
... | ALGO | 0.999885 | 7.125863 |
f3d513fd-c7f9-4235-983f-ca84dcf5ed1c | lightning830/cpp | Vcontest/12/4.cpp | #pragma region Macros
#include<bits/stdc++.h>
using namespace std;
using ll = long long;
const int INF = 1001001001;
const ll LINF = 1e18;
const int MOD = 1e9+7;
#define rep(i,n) for(ll i = 0; i < (n); i++)
#define repd(i,n) for(ll i = n-1; i >= 0; i--)
#define FOR(i,a,b) for(ll i = a; i <= ll(b); i++)
#define FORD(i... | ALGO | 0.999969 | 4.240556 |
70488852-c446-4442-8011-ff76a572390e | vandreas19/POJ_sol | 1564/2230622_AC_0MS_116K.cpp | #include<iostream>
#include<map>
//#include<algorithm>
using namespace std;
typedef map<int,int,greater<int> > MII;
typedef MII::iterator MIT;
MII miiList;
MIT mitList[12];
int iUse[12],iCount;
void Try(int iCur,int iRemain)
{
int i,j,iNum,iValue;bool bFirst;
if(iCur==miiList.size())
{
if(iRemain==0)
{
bFi... | ALGO | 0.999486 | 3.721452 |
9ed8abb7-3b24-42be-a3aa-50359c2c0425 | RajThak-998/Cpp | 07_Recursion.cpp/Ques1.cpp | // find the maximum sum of the non adjacent elements in an array.
#include<bits/stdc++.h>
using namespace std;
int rob(vector<int>& nums) {
int size = nums.size();
if(size<=1) return 0;
// making the vector 1;
vector<int>v1;
for(int i=2;i<size-1;i++){
v1.push_back(nums[i]);
}
... | ALGO | 0.999932 | 4.902925 |
f66ca24e-2e5e-4cb3-8dab-94ecdaedc084 | HinaPE/Kasumi-legacy | reference/pathtracer.cpp | #include "../rays/pathtracer.h"
#include "../rays/samplers.h"
#include "../util/rand.h"
#include "debug.h"
#include <iostream>
namespace PT
{
Spectrum Pathtracer::trace_pixel(size_t x, size_t y)
{
// TODO (PathTracer): Task 1
// Generate a ray that uniformly samples pixel (x,y) and return the incoming light... | ALGO | 0.99749 | 6.564474 |
25fb5008-5a71-42d6-9886-e7d3bb7fc243 | Sagrn/Flutter-Projects | weatherapp/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.998153 | 6.76073 |
7b0bbe61-ffe9-4451-b9b9-fe13bfed7de9 | shelltdf/osgall | prebuild/opencv-4.x/modules/gapi/src/executor/gtbbexecutor.cpp | #include "gtbbexecutor.hpp"
#if defined(HAVE_TBB) && (TBB_INTERFACE_VERSION < 12000)
// TODO: TBB task API has been deprecated and removed in 12000
#include "utils/itt.hpp"
#include <opencv2/gapi/own/assert.hpp>
#include <opencv2/gapi/util/copy_through_move.hpp>
#include "logger.hpp" // GAPI_LOG
#include <tbb/task.... | TOOL | 0.899698 | 7.379873 |
49e641c3-4ee1-4eb1-a31d-b8f4355e916e | Yangjaehong/Algorithm | algorithm/알고리즘설계/kmp.cpp | #include <iostream>
#include <vector>
#include <string>
using namespace std;
vector<int> initNext(string Pattern) {
vector<int> next(Pattern.length());
for(int i=1, j=0; i<Pattern.length(); i++) {
while(j>0 && Pattern[i] != Pattern[j]) j = next[j-1];
if(Pattern[i] == Pattern[j]) next[i] = ++j... | ALGO | 0.999593 | 4.955666 |
d14a0978-f24c-4bbe-a76a-cc6775baef14 | iagann/CalculatedRealms | CalculatedRealms/Predictor.cpp | #include "Predictor.h"
#include "ItemParser.h"
#include "Util.h"
#include "CardReroller.h"
#include <sstream>
#include <iomanip> // Include this header for setprecision and fixed
#include <algorithm> // For std::sort
std::map<std::string, int> Predictor::parsedCards = std::map<std::string, int>();
const std::vecto... | ALGO | 0.913309 | 4.552906 |
cc6fb322-a63c-43d5-b553-d35f8f784188 | Soumya44/GraphAlgorithms | DinicAlgo.cpp | // C++ implementation of Dinic's Algorithm
#include<bits/stdc++.h>
using namespace std;
// A structure to represent a edge between
// two vertex
struct Edge
{
int v ; // Vertex v (or "to" vertex)
// of a directed edge u-v. "From"
// vertex u can be obtained using
// index in adjacent array.
int ... | ALGO | 0.999684 | 5.697755 |
0123f4ce-1f79-4611-8bd7-c2fa5e03c9e5 | phuoctranvn/mvcprogram | src/Algorithm/ABTree.cpp | #include "ABTree.h"
ABTreeNode::ABTreeNode(int t1, bool leaf1)
{
// Copy the given minimum degree and leaf property
t = t1;
leaf = leaf1;
// Allocate memory for maximum number of possible keys
// and child pointers
keys = new LONG_INT1[2*t-1];
C = new ABTreeNode *[2*t];
// Initialize the number of keys as 0
... | ALGO | 0.99982 | 3.856742 |
a9b98a7a-7020-43ac-8529-afdc39418044 | sunphoenix1707/leetcode | 1662-check-if-two-string-arrays-are-equivalent/1662-check-if-two-string-arrays-are-equivalent.cpp | class Solution {
public:
bool arrayStringsAreEqual(vector<string>& word1, vector<string>& word2) {
string c1="",c2="";
for(int i=0;i<word1.size();i++)
c1+=word1[i];
for(int i=0;i<word2.size();i++)
c2+=word2[i];
if(c1.length()!=c2.length()) return false;
... | ALGO | 0.998544 | 6.143472 |
a70d2154-7706-4e6e-b3dd-281117e1e208 | NgesBrian/saferewrite_for_test | src/helib_longtobitvector/ref/longtobitvector.cpp | #include <cstdlib>
#include <cstdio>
#include <stdint.h>
#include <vector>
using namespace std;
// Return a number as a vector of bits with little endian-ness
uint32_t longtobitvector(unsigned long num, unsigned long bitsize)
{
std::vector<long> result;
for (unsigned long i = 0; i < bitsize; num >>= 1, ++i)
... | ALGO | 0.907858 | 3.175858 |
2c498390-4276-4932-8fc1-5a0b3077efbe | hjg0629/Algorithm | 백준/BOJ 2309.cpp | #include <iostream>
#include <list>
using namespace std;
int main() {
int num;
list<int> lt;
list<int>::iterator iter;
list<int>::iterator subiter;
int cnt, cnt1;
int sum = 0;
int check = 0;
for (cnt = 0; cnt < 9; cnt++) {
cin >> num;
lt.push_back(num);
sum += lt.back();
}
lt.sort();
iter = lt.begin... | ALGO | 0.999871 | 3.045232 |
7917258a-1633-4da0-a519-7a1e1ed96b0f | Bliss-alioth/frameworks_av | media/module/codecs/amrnb/common/src/extract_h.cpp | /*
Pathname: ./gsm-amr/c/src/extract_h.c
------------------------------------------------------------------------------
REVISION HISTORY
Description: Created separate file for the extract_h function. Sync'ed up
with the current template and fixed tabs.
Description: Removed conditional code that update... | TOOL | 0.947554 | 5.901973 |
777989b5-1ac6-40a7-8eec-cf9dc05177d7 | rosekc/cpp | acm/hdu/1128.cpp | //hdu 1128 Self Numbers
#include <stdio.h>
#include <string.h>
using namespace std;
int dn( int in )
{
int sum = in;
while( in >= 10 )
{
sum += in % 10;
in /= 10;
}
return sum + in;
}
bool re[ 1000005 ];
int main()
{
memset( re, 0, sizeof( re ) );
for( int i = 1; i <= 1... | ALGO | 0.998698 | 4.696355 |
0299cee7-52d9-44d7-bda1-e90fb4f8726e | yonghaekim/AOS-gem5 | src/systemc/tests/systemc/misc/unit/aproc_halt/disaproc3/disaproc3.cpp | /*****************************************************************************
disaproc3.cpp --
Original Author: Martin Janssen, Synopsys, Inc., 2002-02-15
*****************************************************************************/
/**************************************************************************... | TOOL | 0.938557 | 5.509825 |
cfc63aa8-67ba-4ac8-b79b-2ba6cec1cc83 | tempshadow/EMRTS | TravelingPoliticianV1.1/src/TravelingPoliticianV1.1.cpp | using namespace std;
long double toRadians(const long double degree)
{
long double one_deg = (M_PI) / 180;
return (one_deg * degree);
}
long double distance(long double lat1, long double long1,
long double lat2, long double long2)
{
lat1 = toRadians(lat1);
long1 = toRadians(long1);
lat2 = toRadians(lat2);
lon... | ALGO | 0.992324 | 3.881965 |
57a82ca6-e406-4693-919d-ce1c56d8f3e8 | denis-gubar/Leetcode | all/1419. Minimum Number of Frogs Croaking.cpp | class Solution {
public:
int minNumberOfFrogs(string croakOfFrogs) {
int c = 0, r = 0, o = 0, a = 0, k = 0;
int result = 0;
for (char ch : croakOfFrogs)
{
switch (ch)
{
case 'c':
++c;
result = max(result, c);
break;
case 'r':
++r;
if (r > c) return -1;
break;
case 'o':
... | ALGO | 0.999082 | 4.584214 |
bfae0166-f98a-450b-8d1c-df85c85d41e5 | Koweiyi/oi_problems | leetcode/daily/lc2178.cpp | /*
* @lc app=leetcode.cn id=2178 lang=cpp
* @lcpr version=21909
*
* [2178] 拆分成最多数目的正偶数之和
*
* https://leetcode.cn/problems/maximum-split-of-positive-even-integers/description/
*
* algorithms
* Medium (63.69%)
* Likes: 76
* Dislikes: 0
* Total Accepted: 24K
* Total Submissions: 37.6K
* Testcase Exampl... | ALGO | 0.999942 | 5.243442 |
755aa459-1e9e-4c36-9ed3-34f8f7f6c81a | af-silva/path_detector_v2 | lsd_slam/lsd_slam_core/src/Tracking/Sim3Tracker.cpp | #include "Sim3Tracker.h"
#include <opencv2/highgui/highgui.hpp>
#include "DataStructures/Frame.h"
#include "Tracking/TrackingReference.h"
#include "util/globalFuncs.h"
#include "IOWrapper/ImageDisplay.h"
#include "Tracking/least_squares.h"
namespace lsd_slam
{
#if defined(ENABLE_NEON)
#define callOptimized(function,... | ALGO | 0.99902 | 6.493853 |
c6108f53-fb19-40b5-8fc0-6319cae698e6 | tanasinp/2110211-INTRO-DATA-STRUCT | exercise/ds02_is_reverse/ds02_is_reverse.cpp | #include <stdexcept>
#include <iostream>
namespace CP {
template <typename T>
class vector
{
public:
typedef T* iterator;
protected:
T *mData;
size_t mCap;
size_t mSize;
void rangeCheck(int n) {
if (n < 0 || (size_t)n >= mSize) {
throw std::out_of_range("index of out range") ;
... | ALGO | 0.999914 | 4.771669 |
0f7e5571-17ce-4f87-9043-d4496d5a8654 | Randl/GambitFruit | tmo/hill_climbing.cpp | //
// Created by Evgenii on 27.10.2015.
//
#include <cstdint>
#include <chrono>
#include <algorithm>
#include <functional>
#include <map>
#include <iostream>
#include "hill_climbing.h"
struct CompareSecond {
bool operator()(const std::pair<std::vector<S16>, double> &left,
const std::pair<std::... | ALGO | 0.999995 | 6.098189 |
8dc3add8-b917-4ecf-8830-717d8c28c2e8 | samyakjain07/DSA | Recursion - by love babbar/increassing_no.cpp | #include<iostream>
using namespace std;
void inc(int n ){
if(n == 0){
return;
}
inc(n-1);
cout<< n;
}
int main(){
int n;
cin>>n;
inc(n);
return 0;
} | ALGO | 0.999965 | 4.216049 |
a7b89246-4e70-4062-b802-99bff9621d7f | MdShah-alam/Dynamic_Programming | LCS.cpp | #include<bits/stdc++.h>
using namespace std;
char lcs(char *x,char *y,int n,int m,vector<vector<char>>&dp)
{
if(m==0 || n==0) return '\0';
if(x[n-1]==y[m-1])
return dp[n][m]=x[n-1]+lcs(x,y,n-1,m-1,dp);
if(dp[n][m]!=-1) return dp[n][m];
return dp[n][m]=max(lcs(x,y,n,m-1,dp),lcs(x,y,m-1,n,dp));
}... | ALGO | 0.999992 | 4.731573 |
6e944f89-1dbb-45fb-a2c2-ccd70bd95697 | busebd12/InterviewPreparation | LeetCode/C++/General/Easy/PalindromeLinkedList/main.cpp | #include "../ListNode.h"
#include <iostream>
#include <stack>
using namespace std;
/*
* Approaches, from top-to-bottom:
*
* 1) Loop through the list and push each element onto a stack. The elements are now reversed.
* Loop through the list again and compare each element with the current element popped off the stac... | ALGO | 0.999935 | 5.945003 |
5c57d8fb-3b9f-4b9e-93ee-61ad5a159adc | carpediem804/algorithm | 백준/백준-9207-페그솔리테어.cpp | #include <iostream>
#include <stdio.h>
#include <algorithm>
using namespace std;
char map[6][10]; //5*9
int pin[10][2]; //max 8
int max_pin_num;
int ans_pin=10;
int ans_go_num[10];
int dir[4][2] = { {-1,0},{1,0},{0,1},{0,-1} };
void dfs(int rest_pin, int go_num) {
int flag = 0;
for (int i = 1; i <= max_pin_num; i++)... | ALGO | 0.999477 | 3.366712 |
e1bdd28f-e10f-4078-944a-2542eb7a4320 | LeAlmond/Programming-1 | Lab 3/ex7.cpp | #include <stdio.h>
int main()
{
int ws;
printf("%s", "Enter an Wind Speed " );
scanf("%i",&ws);
if (ws >= 20) {
if (ws <= 67) {
printf("Category 1 Hurricane");
}
else if(ws <= 87) {
printf(... | TOOL | 0.979273 | 4.906479 |
33321b5c-6798-4ad0-9df6-e20bf368f7bc | Utchash007/Leetcode_Solution | 0414-third-maximum-number/0414-third-maximum-number.cpp | class Solution {
public:
int thirdMax(vector<int>& nums) {
sort(nums.begin(),nums.end());
nums.resize(unique(nums.begin(),nums.end())-nums.begin());
if(nums.size()<3)return nums[nums.size()-1];
return nums[nums.size()-3];
}
}; | ALGO | 0.999968 | 5.457112 |
76662dd8-30f4-4346-a1cd-30d51ab7911f | caoleiwuhan/LeetCode | Tree/PathSum/PathSum.cpp | //============================================================================
// Path Sum
// Given a binary tree and a sum, determine if the tree has a root-to-leaf path
// such that adding up all the values along the path equals the given sum.
//
// For example:
// Given the below binary tree and sum = 22,
// ... | ALGO | 0.999951 | 6.655896 |
e9c322ce-4d88-4039-a679-e23daf9ddf98 | pkuxxy/LeetCode | leetcode_forthtime/Partition List.cpp | /**
* Definition for singly-linked list.
* struct ListNode {
* int val;
* ListNode *next;
* ListNode(int x) : val(x), next(NULL) {}
* };
*/
class Solution {
public:
ListNode *partition(ListNode *head, int x) {
// Start typing your C/C++ solution below
// DO NOT write int main() fu... | ALGO | 0.999994 | 5.239088 |
fb5bfa36-4401-4d3b-a9e3-1b9236d281a9 | Anushaa700/ACC45DAYSOFCODE-2023 | Day18_AIRHOCKEY.cpp | #include <iostream>
using namespace std;
int main() {
// your code goes here
int T;
cin>>T;
while(T--){
int A,B;
cin>>A>>B;
if(A==B || A>B){
cout<<7-A<<endl;
}
else if(B>A){
cout<<7-B<<endl;
}
}
return 0;
}
| ALGO | 0.999376 | 4.068818 |
388d0180-74a6-4caa-b09f-b3decf84b6b5 | aifa21/uva-online-judge | Tourist Guide.cpp |
#include <bits/stdc++.h>
using namespace std;
int dis[1000];int low[1000];
int visit[1000];int parent[10000];
vector <int> node[1000];vector<int> ap;
int arti[1000];
int timer;
void dfs(int u){
dis[u] = low[u] = ++timer;
// printf("DIS[%d]= %d LOW[%d]=%d\n",u,timer,u,timer);
visit[u] = true;
int v; ... | ALGO | 0.999945 | 4.193892 |
ea8ce9d9-7d92-4107-b622-0b7bf044d63a | yexis/OI | nowcoder/牛客周赛57/e.cpp | #include <iostream>
#include <vector>
#include <string.h>
#include <algorithm>
#include <numeric>
#include <set>
#include <array>
#include <cassert>
#include <cstdio>
#include <cstring>
#include <iostream>
#include <iomanip>
#include <string>
#include <sstream>
#include <vector>
#include <queue>
#include <stack>
#inclu... | ALGO | 0.999645 | 4.443128 |
5c616d1e-a4c7-4f56-a242-3c324d12a8b9 | xin-lover/leetcode-explore | main984.cpp | //984. 不含 AAA 或 BBB 的字符串
#include <cstdio>
#include <vector>
#include <string>
using namespace std;
string strWithout3a3b(int A, int B) {
//思路:其实就是间隔放置即可
//方案:假设A>B,则令m=A/B,每m个‘A'放一个’B‘
char Achar = 'a';
char Bchar = 'b';
if(A < B)
{
swap(A,B);
swap(Achar,Bchar);
}
i... | ALGO | 0.999764 | 4.111899 |
9269f831-bb60-4959-928e-70e4e1d1e945 | Alg-y-Estructura-de-Datos/programacion-iii-2024-tosetti-u8-hashmap-codigoBaseV6.0 | Arbol/main.cpp | #include <iostream>
#include <fstream>
#include <sstream>
#include <string.h>
#include <ctime>
#include <stdlib.h>
#include "ArbolBinarioAVL.h"
#include "ArbolBinario.h"
using namespace std;
int main(int argc, char **argv)
{
string archivoInput = "./arr.txt";
bool verbose = false;
for (int i = 1; i < ar... | ALGO | 0.998379 | 4.299749 |
ce392d52-4e72-48f8-bfff-767db0db12fb | devaliraza1/C- | sum of even odd number using recursion.cpp | #include<iostream>
using namespace std;
int sumOfNumbers(int n){
if(n == 0){
return 0;
}
else if(n == 1){
return 1;
}
int sum = n + sumOfNumbers(n-2);
return sum;
}
int main(){
int n;
cout << "Enter n : ";
cin >> n;
if (n % 2 ==0)
{
cout << "Sum of first ... | ALGO | 0.999765 | 5.241618 |
c102fe50-72db-4b95-95b3-0b3277730015 | floweryada/laba_4 | laba3/main.cpp | #include <iostream>
#include "laba3.h"
using namespace std;
int main()
{
Tree tree1;
tree1.ShowTree();
tree1.InsertEl(20);
tree1.InsertEl(11);
tree1.InsertEl(8);
tree1.InsertEl(14);
tree1.InsertEl(6);
tree1.InsertEl(12);
tree1.InsertEl(18);
tree1.ShowTree();
tree1.DeleteEl... | ALGO | 0.979543 | 4.271622 |
cf4481fb-32be-4c4a-936e-c97c916ef8be | NikkittaP/osg_pack | sources/proj/src/projections/urm5.cpp | #define PJ_LIB__
#include <errno.h>
#include <math.h>
#include "proj.h"
#include "proj_internal.h"
PROJ_HEAD(urm5, "Urmaev V") "\n\tPCyl, Sph, no inv\n\tn= q= alpha=";
namespace { // anonymous namespace
struct pj_opaque {
double m, rmn, q3, n;
};
} // anonymous namespace
static PJ_XY urm5_s_forward (PJ_LP lp, ... | ALGO | 0.985986 | 5.799845 |
8ec10395-4907-43d9-a509-f929a5cfeee2 | MartinaAshraf/ICPC | sheet1/C - Simple Calculator.cpp | #include<iostream>
using namespace std;
int main(){
long long x,y,a,c, b;
cin>> x>>y;
a=x+y;
b=x*y;
c=x-y;
cout << x<<" + "<<y << " = "<<a<< endl;
cout << x<<" * "<<y << " = "<<b<< endl;
cout << x<<" - "<<y << " = "<<c<<endl;
return 0;
}
| ALGO | 0.999806 | 3.803485 |
3c258753-d799-4531-8bf4-7f6cb70f7243 | Kawser-nerd/CLCDSA | Source Codes/AtCoder/agc020/B/1984066.cpp | #include<algorithm>
#include<cmath>
#include<iomanip>
#include<iostream>
#include<map>
#include<numeric>
#include<queue>
#include<set>
#include<sstream>
#include<unordered_map>
#include<unordered_set>
#include<vector>
using uint = unsigned int;
using ll = long long;
enum : int { M = (int)1e9 + 7 };
enum : ll { MLL = (l... | ALGO | 0.999981 | 3.783735 |
6bd6571a-0f42-4675-b315-c3221334be9a | parque27/LlistaOrdenadaDinamica | LlistaOrdenadaDinamica/LlistaOrdenada.cpp | #include "LlistaOrdenada.h"
#include <iostream>
using namespace std;
// CONSTRUCTORS
// CONSTRUCTOR PER DEFECTE
LlistaOrdenada::LlistaOrdenada()
{
a_inici = NULL;
}
// CONSTRUCTOR COPIA
LlistaOrdenada::LlistaOrdenada(const LlistaOrdenada& o)
{
a_inici = NULL;
copia(o);
}
// DESTRUCTOR
LlistaOrdenada::~LlistaOrdenad... | TOOL | 0.86598 | 4.748595 |
7fae860d-f3f0-483f-b224-6220674b4cb8 | SaharSallam3/Data_Structure | Day3/main_Q3.cpp | #include <iostream>
using namespace std;
///--------------------------------3. Bubble Sort for a Doubly Linked List (swap Data) -----------------------------///
///-------------------------------------------- Class Node ----------------------------------------///
class Node {
public:
int Data;
Node *Prev, *... | ALGO | 0.999983 | 5.631367 |
96ca3b51-361b-43ea-a63a-e9172517f4cd | MhJunaid1/CS | DSA/Linked Lists/Singly.cpp | #include <iostream>
class Node {
public:
int data;
Node* next;
Node(int value) {
data = value;
next = nullptr;
}
};
class LinkedList {
private:
Node* head;
public:
LinkedList() {
head = nullptr;
}
void insert(int value) {
Node* newNode = new Node(valu... | ALGO | 0.982825 | 6.206588 |
84098c5a-b824-4bd9-9e27-67cb9e6f8052 | a-parida12/ParallelProgamming | WarAndPeace_cpp/unit_test.cpp | #include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include <sys/stat.h>
#include <fstream>
#include <iostream>
#include <memory>
#include <cstring>
#include "histogram.h"
#include "histogram_ref.h"
int main(int argc, char **argv)
{
int failed = 0;
histogram_t histogram_ref = {0};
char const *filename = "w... | TEST | 0.850334 | 4.156587 |
2a891536-0648-4242-9601-8a407a8f1e7f | raincross7/code-similarity | codes/train_code/problem238/problem238_128.cpp | #include<bits/stdc++.h>
using namespace std;
typedef long long ll;
const int MAX_N = 200000;
int N,D[MAX_N] = {};vector<int> v[MAX_N];
bool Visit[MAX_N] = {};
void dfs(int s){
Visit[s] = 1;
for(int i=0;i<v[s].size();i++){
if(!Visit[v[s][i]]){
D[v[s][i]] += D[s];
dfs(v[s][i]);
}
}
}
int main(){... | ALGO | 0.99993 | 4.216636 |
bc22b1ac-ff11-49da-ace3-7867e8ebc35d | panzg123/leetcode | N-Queues.cpp | class Solution
{
public:
/*N-QueensNʺ⣬DFS + ֦
ʱ临Ӷ O(n!)ռ临Ӷ O(n)*/
vector<vector<string>> solveNQueens(int n)
{
vector<vector<string>> result;
vector<int> path;
sloveNQueues_help(result, path, 0, n);
return result;
}
void sloveNQueues_help(vector<vector<string>> &result,vector<int> &path,int start,int n... | ALGO | 0.999259 | 5.275163 |
50ac0866-0830-48ef-a808-32501d0847e2 | lixinsu/primary_code | hdu2054.cpp | #include<iostream>
#include<string>
#include<cmath>
#include<ctype.h>
using namespace std;
int main(){
string n,m;
while(cin>>n>>m){
bool test;
test=true;
for(int i=0;i<n.size();i++){
if(isdigit(n[i])&&n[i]!='0') {
test=false;
break;
... | ALGO | 0.99965 | 3.689937 |
298d86b8-f702-433c-a6e1-ee37069a96d1 | FirstCinnamon/baekjoon-solutions | CLASS 4/BFS:DFS/[2638] 치즈.cpp | // 2638 치즈
#include <iostream>
#include <vector>
#include <queue>
using namespace std;
using pii = pair<int, int>;
const int dx[4] = {1, -1, 0, 0}; // 상하좌우 이동을 위한 배열
const int dy[4] = {0, 0, 1, -1};
int main() {
ios_base::sync_with_stdio(false);
cin.tie(nullptr);
cout.tie(nullptr);
int N, M, cnt = 0... | ALGO | 0.999989 | 5.926223 |
f4642fd3-e2d6-43de-b5b8-d32879f5374f | Doda94/SS-Kodovi | 2020_2021_kodovi/20210103_speedforces/E.cpp | #include <iostream>
#include <string>
#include <cmath>
#include <algorithm>
#include <vector>
#include <queue>
#include <set>
#include <map>
#define pb push_back
#define fr(j,n,s) for (int i = j; i<n;i+=s)
#define repeat(n) for (int i = 0; i<n;i++)
typedef long long ll;
using namespace std;
vector <ll> v,rj;
int main... | ALGO | 0.999883 | 3.245954 |
a3a3274d-cbc2-437e-b2b4-5094b328fbc6 | anoshaali1/2D-ARRAYS | sum of all elements.cpp | #include <stdio.h>
int row, column;
void inputArray(int arr[][column])
{
for (int i = 0; i < row; i++)
{
printf("Enter the elements of %d row: \n", i + 1);
for (int j = 0; j < column; j++)
{
printf("Enter the elements of %d column: ", j + 1);
scanf("%d", &arr[i][... | ALGO | 0.996327 | 4.142169 |
ba7d6973-d864-46a6-aae8-e2e4cbcd2a51 | mariality/Coffee_Shop | 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 |
b292e95d-126f-4573-ace1-342ec5fd90f2 | tamil-vishnu-24/C-DSA | Linkedlistsegregate.cpp | #include<iostream>
using namespace std ;
struct Node
{
int data ;
Node *next ;
Node(int x)
{
data = x;
next = NULL ;
}
};
Node *segregateLoop(Node *head)
{
Node *OS = NULL;
Node *OE = NULL;
Node *ES = NULL;
Node *EE = NULL;
for(Node *curr = head ; curr!=NULL;cur... | ALGO | 0.999958 | 4.021891 |
3a4f7fe0-aa21-4ca3-9dfb-282e503b562c | ChrisDong-THU/GaussianToken | gstk/modules/gsplat/gsplat/cuda/csrc/third_party/glm/test/gtx/gtx_pca.cpp | #define GLM_ENABLE_EXPERIMENTAL
#include <glm/glm.hpp>
#include <glm/gtx/pca.hpp>
#include <glm/gtc/epsilon.hpp>
#include <glm/gtx/string_cast.hpp>
#include <cstdio>
#include <vector>
#if GLM_HAS_CXX11_STL == 1
#include <random>
#endif
template<typename T>
T myEpsilon();
template<>
GLM_INLINE GLM_CONSTEXPR float myEp... | TEST | 0.986363 | 6.705521 |
946210f9-e591-4382-a2a6-ec874a1f5344 | boys01/sample | prac1_vector_add.cpp | #include <stdlib.h>
#include <stdio.h>
#include <iostream>
#include <omp.h>
#include <time.h>
#include <vector>
#include <chrono>
using namespace std::chrono;
using namespace std;
int main()
{
// vector<int> a = {20, 24, 24, 15, 25, 14, 14, 67, 54, 3, 7, 33, 7, 4, 59, 6, 77, 65, 23, 57, 135, 167, 34, 56, 443, 76, 8... | ALGO | 0.997187 | 3.536761 |
fddf57ef-747f-4588-ab4a-91c25a607961 | neharao-342/Applied_Problems_in_CP | 23b1801_week4/kth_missingPositiveNumber.cpp | #include <iostream>
#include <vector>
using namespace std;
int findKthPositive(vector<int>& arr, int k) {
int missingCount = 0;
int current = 1;
int i = 0;
while (missingCount < k) {
if (i < arr.size() && arr[i] == current) {
i++;
} else {
missingCount++;
... | ALGO | 0.99993 | 4.935749 |
baf5d287-1eab-4b79-a85f-c3f1b2a08481 | Aniket0304/aniket | rat_in_a_maze.cpp | #include<bits/stdc++.h>
using namespace std;
bool issafe(vector<vector<int>> &visit , vector<vector<int>> &m , int ix , int iy ,int n ){
if((ix< n && ix >=0) && (iy< n && iy>=0) && visit[ix][iy]==0 && m[ix][iy]==1){
return true;
}
else{
return false;
}
}
... | ALGO | 0.99999 | 4.04285 |
420074a0-d8c0-4874-b642-5c3944417bc6 | earthPerson-001/opengl_cpp | src/lab5.cpp |
#include <inttypes.h>
#include <utility>
#include <vector>
#include <glad/glad.h>
#include "lab5.hpp"
#include "globals.hpp"
// defining bits for four regions
// TBRL: TOP BOTTOM RIGHT LEFT
constexpr uint8_t LEFT = 1 << 0; // 0000 0001
constexpr uint8_t RIGHT = 1 << 1; // 0000 0010
constexpr uint8_t BOTTOM = 1 <... | ALGO | 0.999645 | 4.919516 |
ff615ebf-0d32-4274-ada0-62ac120222d5 | GIT-heyok/PS | CF/ProblemSet/unsolved/1536C - Diluc and Kaeya.cpp | #include <iostream>
#include <vector>
#include <stack>
#include <queue>
#include<sstream>
#include <string>
#include <algorithm>
#include <iomanip>
#include <set>
#include <map>
#include <cmath>
#include <numeric>
#define FAST ios::sync_with_stdio(false);\
cin.tie(nullptr);\
cout.tie(nullptr);
#define endl '\n'
#defi... | ALGO | 0.999771 | 3.794312 |
cb994be6-d343-4353-9fc6-8b4458682d1b | ricky2129/LeetCode_New | 0100-same-tree/0100-same-tree.cpp | class Solution {
public:
bool isSameTree(TreeNode* p, TreeNode* q) {
// Check if both nodes are null, then they are identical at this level
if (p == nullptr && q == nullptr) {
return true;
}
// If one of the nodes is null, and the other is not, they are not ident... | ALGO | 0.999966 | 7.327451 |
b0a2d470-3110-4e6f-918b-4d00304370b4 | warabico/AtCoder | typical90/048/main.cpp | /* includes *******************************************************************/
#include <algorithm>
#include <cmath>
#include <iomanip>
#include <iostream>
#include <list>
#include <map>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <string>
#include <utility>
#include <vector>
/* name... | ALGO | 0.999947 | 3.520792 |
fe1ed774-a0e3-44e5-b7f7-da0ca6e23482 | LIUQyou/MyHIP-CPU | examples/matrix_transpose/MatrixTranspose.cpp | #include <iostream>
// hip header file
#include "hip/hip_runtime.h"
#define WIDTH 1024
#define NUM (WIDTH * WIDTH)
#define THREADS_PER_BLOCK_X 4
#define THREADS_PER_BLOCK_Y 4
#define THREADS_PER_BLOCK_Z 1
// Device (Kernel) function, it must be void
__global__ void matrixTranspose(float* out, float* in, const int ... | ALGO | 0.999233 | 6.012366 |
a0917b80-63f0-4709-a9e4-17f6caa523f3 | myc0603/CodingTestStudy | week2/M1436V2.cpp | #include <bits/stdc++.h>
using namespace std;
int main() {
int n; cin >> n; n--;
set<int> st;
string s666 = "666";
string str[5];
for (int i = 0; i < 10000; i ++) {
string s = ("0000" + to_string(i));
s = s.substr(s.size() - 4, 4);
// cout << "s: " << s << '\n';
st... | ALGO | 0.998695 | 3.410069 |
ffa4b869-b7db-4c94-abf7-96ff5d0665c0 | DaCasBe/Multiple-Quadratic-Knapsack-Problem-using-Random-Search | src/MQKPSolGenerator.cpp | /*
* MQKPSolGenerator.cpp
*
* Fichero que define los métodos de la clase MQKPInstance. Forma parte del código esqueleto para el problema de las múltiples mochilas cuadráticas, ofrecido para las prácticas de la asignatura Metaheurísticas del Grado de Ingeniería Informática de la Universidad de Córdoba
*
* @author C... | ALGO | 0.958613 | 3.919364 |
5e2fc0e5-0e4a-4cf1-99b6-a57bc6289074 | snillah/class-c_cplus | cpplanguage/lect-15/DSA/Algorithm/LinearSearchalgorithm.cpp | #include <iostream>
using namespace std;
int linearSearch(int arr[], int n, int key) {
for (int i = 0; i < n; i++) {
if (arr[i] == key)
return i; // Found at index i
}
return -1; // Not found
}
int main() {
int arr[] = {10, 20, 30, 40, 50};
int n = 5, key = 30;
int result ... | ALGO | 0.999763 | 5.404402 |
0cea4115-59ba-416f-8c11-a5564be7a6c0 | fsjhhh/acm_title | cpp/模板/特别数的和_模拟.cpp | #include <iostream>
#include <cstdio>
#include <cstring>
#include <algorithm>
#include <cmath>
#include <vector>
#include <map>
#include <unordered_map>
#include <set>
#include <unordered_set>
#include <queue>
#include <deque>
#define IOS ios::sync_with_stdio(false); \
cin.tie(0); \
... | ALGO | 0.999172 | 4.127478 |
2b554773-c6c1-4a4a-8f6c-67e432290a55 | pratiksaha/practice | mathematical/maxDiffRowSum.cpp | //to find maximum difference of sum of elements of any two rows
#include<bits/stdc++.h>
#define MAX 100
using namespace std;
int maxDiffRowSum(int mat[][MAX], int m, int n) {
int rowSum[m];
for (int i=0; i<m; i++) {
int sum = 0;
for (int j=0; j<n; j++)
sum += mat[i][j];
rowS... | ALGO | 0.999987 | 4.624805 |
31e8d13e-9969-4836-bc73-37023890774a | heyhooman/0xDSA | leetcode/Hard/502leetcode/solution.cpp | class Solution {
public:
int findMaximizedCapital(int k, int w, vector<int>& profits, vector<int>& capital) {
int n=profits.size();
vector<pair<int,int>>a;
for(int i=0;i<n;i++){
a.push_back({capital[i],profits[i]});
}
sort(a.begin(),a.end());
int i=0;
... | ALGO | 0.999995 | 5.202378 |
8418b76a-4ca8-4886-8aa4-59ce5379054c | LiKe-rm/Human-and-ChatGPT-Code-Dataset | Codes Generated From ChatGPT/cpp_gpt3.5_功能重现/authors10_acejr1337_TerryDavisCoin_src_crypto_aes.cpp | #include <iostream>
#include <string>
#include <cryptopp/aes.h>
#include <cryptopp/modes.h>
#include <cryptopp/filters.h>
using namespace std;
using namespace CryptoPP;
// AES128
void AES128Encrypt(byte *key, byte *iv, byte *plaintext, size_t plaintextLength, byte *ciphertext)
{
// TODO: ʵAES128
}
// AES128
void... | TOOL | 0.950172 | 4.383596 |
c8bd644a-caca-4b9b-9e97-762341029780 | BonexGoo/Boss2D | Boss2D/addon/openalpr-2.3.0_for_boss/src/openalpr/ocr/segmentation/charactersegmenter.cpp | #include BOSS_OPENCV_V_opencv2__core__core_hpp //original-code:<opencv2/core/core.hpp>
#include "charactersegmenter.h"
using namespace cv;
using namespace std;
namespace alpr
{
CharacterSegmenter::CharacterSegmenter(PipelineData* pipeline_data)
{
this->pipeline_data = pipeline_data;
this->config = pipel... | ALGO | 0.946946 | 4.07725 |
d04f451b-a6c1-48b3-ae7a-5072ce90f269 | zabhishekz/LeetCode_DSA | 0017. Letter Combinations of a Phone Number.cpp | class Solution {
public:
string keypad[10] = {"","","abc","def","ghi","jkl","mno","pqrs","tuv","wxyz"};
vector<string> res;
void rec(string digits, string out,int i, int n){
if(i == n){
res.push_back(out);
return;
}
int dig = digits[i]-'0';
if(dig == ... | ALGO | 0.999913 | 6.836843 |
e06cd8e3-9f0f-4e91-af48-955ed1e718f5 | mohammed-g77/OOP_C-Java_project | hw2.cpp | #include <iostream>
#include <cstring>
using namespace std;
class String {
private:
char* s;
public:
String() : s(nullptr) {}
String(const char* t) : s(nullptr) {
sets(t);
}
String(char t) : s(nullptr) {
char r[2] = { t, '\0' };
sets(r);
}
String(int t) : s(nul... | ALGO | 0.998508 | 4.831657 |
c89a219b-ae21-4eac-a565-ecccb4bb53df | rizkirak/apa | Latihan 2/Pecahan_CB/Pecahan.cpp | #include "Pecahan.h"
#include <iostream>
using namespace std;
Pecahan::Pecahan()
{
n=1;
a=0;
b=1;
}
Pecahan::Pecahan(int n, int a, int b)
{
if ((b==0) || (a<0))
{
}
else
if (a>=b)
{
n+=(a%b);
//cout<<"1. "<<n<<endl;
a-=(a%b)*b;
//cout<<"2. "<<a<<en... | TOOL | 0.970414 | 3.737899 |
0b3155c8-bf6a-48c3-bb06-570f986f138e | AV2409/DSA | 442-find-all-duplicates-in-an-array/find-all-duplicates-in-an-array.cpp | class Solution {
public:
vector<int> findDuplicates(vector<int>& nums) {
vector<int> ans;
// map<int,int> mp;
// unordered_set<int> s;
int check[100000]={0};
int index;
for(int i=0;i<nums.size();i++){
index=nums[i]-1;
check[index]++;
... | ALGO | 0.999971 | 5.360021 |
3ec4d543-7d28-4176-a9aa-d8ce23cfb254 | Kilo-5723/Codeforces-Solution | Div.2/822/E.cpp | #include <cstdio>
#include <iostream>
using namespace std;
const int maxn = 360;
int a[maxn];
int main() {
int n;
scanf("%d", &n);
for (int i = 0; i < n; i++) scanf("%d", &a[i]);
for (int i = 0; i < n; i++) {
for (int j = 0; j < n; j++)
printf("%lld ", ((a[i] - 1LL * i * i + 1LL * i * j) % n + n) % n)... | ALGO | 0.999185 | 3.27283 |
2009bbb3-0e58-4636-90a5-011e0b870d06 | Yaoye1120/Autoware | localization/yabloc/yabloc_image_processing/src/line_segment_detector/line_segment_detector_core.cpp | #include "yabloc_image_processing/line_segment_detector/line_segment_detector.hpp"
#include <opencv4/opencv2/imgproc.hpp>
#include <tier4_autoware_utils/system/stop_watch.hpp>
#include <yabloc_common/cv_decompress.hpp>
#include <yabloc_common/pub_sub.hpp>
#include <pcl_conversions/pcl_conversions.h>
namespace yabloc... | TOOL | 0.920157 | 5.94268 |
973d0084-5f5d-4809-b1e8-300a2031be30 | satyam3128/DSA-code | 3_1D_ARRAY AND VECTOR/10_character_alphbet_sorting.cpp | #include<iostream>
using namespace std;
void swap(char *a , char *b){
char temp = *a;
*a = *b ;
*b = temp;
}
void selection_sort_Ascending(char arr[] , int size){
for(int i = 0;i<size-1 ;i++){ // Number of rounds
int index = i;
for(int j =i +1 ;j<size ;j++){
if(arr[j] < ar... | ALGO | 0.999845 | 4.004831 |
9c073aaf-2f22-44bd-b951-bb9e0f58f35a | debarkac/LeetCode | 3379-score-of-a-string/score-of-a-string.cpp | class Solution {
public:
int scoreOfString(string s) {
int sum=0;
for(int i=0;i<s.length()-1;i++){
sum=sum+abs((int)s[i]-(int)s[i+1]);
}
return sum;
}
}; | ALGO | 0.999914 | 5.383993 |
e078e7bf-3664-4279-bbac-cdfb2f6f67e3 | Shakibul-Islam/Codeforces | Code_Before_Git-Hub_Account/Bowling Figure.cpp | #include<bits/stdc++.h>
using namespace std;
int main()
{
int t;
cin>>t;
while(t--)
{
string shakib,W,R;
cin>>shakib;
int ball=0, over=0,run=0,wicket=0;
ball = shakib.size();
over = ball/6;
ball = abs((over *6)-ball);
for(char c:shakib)
{
... | ALGO | 0.996906 | 3.633276 |
2fd41cf4-c555-4dcc-8131-db885834f5a7 | Coach-Academy/Fall-1-2024 | Level 2/CPU - Standard - L2 - C104/Practice G1/Week 01/Practice G1 complexity analysis and recursion/O.cpp |
#include <iostream>
#include <vector>
#include <string>
#include <cstring>
#include <cctype>
#include <sstream>
#include <cmath>
#include <algorithm>
#include <deque>
#include <queue>
#include <stack>
#include <set>
#include <sstream>
#include <iterator>
#include <map>
#include <unordered_set>
#include <bitset>
#inclu... | ALGO | 0.999972 | 3.736345 |
d83a5cb8-f1ee-403e-8668-032618306106 | pedrohp-machado/MaratonaProgramacao | aula11/fence/main.cpp | #include <bits/stdc++.h>
using namespace std;
int main(){
int n, k;
cin >> n >> k;
int heights[n];
for (int i = 0; i < n; i++) cin >> heights[i];
int j = -1, sumHeights = 0, r = INT_MAX;
for (int i = 0; i < n; i++){
for (int j = i; j < i + k - 1; j++) sumHeights += heights[j];
... | ALGO | 0.999957 | 4.34618 |
a83a763e-6ba8-4c04-8aac-bb938247d15a | Harendracode13/codefourse | P121Strange_Partition.cpp | #include<bits/stdc++.h>
using namespace std;
int main()
{
long long t;
cin>>t;
while(t--)
{
long long n,x;
cin>>n>>x;
vector<long long> v(n);
for(long long i=0;i<n;i++)
{
cin>>v[i];
}
long long min_sum=0,max_sum=0;
for(long l... | ALGO | 0.999354 | 3.739009 |
ab24ca4d-4a20-41af-9a93-a8d806598802 | JoydeepMallick/DSA_PRACTICE | recursion/kthpermutation.cpp | #include <bits/stdc++.h>
using namespace std;
string getPermutation(int n, int k){
int fact = 1;
vector<int> num;
for(int i =1; i < n; i++){
fact *= i;
num.push_back(i);
}
num.push_back(n);
string ans = "";
k--;// oth indexing
while(1){
ans += to_string(num[k/f... | ALGO | 0.999984 | 5.16437 |
44aaec1b-b629-46b6-a573-f01ec1c968f2 | Karelito00/problems | SPOJ/ARRAYSUB.cpp | #include <bits/stdc++.h>
#define mx(a, b) (a > b ? a : b)
using namespace std;
int const MAXn = 1e5 + 2, loga = log2(MAXn) + 2;
int RMQ[MAXn][loga];
int main()
{
ios_base::sync_with_stdio(0);
cin.tie(0);
cout.tie(0);
int n;
cin>>n;
for(int i = 1; i <= n; i++)
cin>>RMQ[i][0];
for(... | ALGO | 0.999973 | 3.659243 |
5ef4eb02-6922-485f-a3a0-5fce0683a59e | sashagorbatyuk/Homework | CPP/CPP_26_2024.11.10/Homework26/Homework26/Homework26.cpp | #include <iostream>
#include <stack>
#include <string>
using namespace std;
bool isCorrect(const string& input) {
stack<char> st; //
for (int i = 0; i < input.size(); ++i) {
char ch = input[i];
//
if (ch == '(' || ch == '[' || ch == '{') {
st.push(ch);
}
... | ALGO | 0.995201 | 5.518907 |
3a29c30e-2b7f-42f5-99fa-c3841d369c9e | gsm-pro/acm | algo/algo-solutions/4566.CPP | #include<iostream>
#include<algorithm>
#include<cmath>
using namespace std;
#define LD long double
const LD EPS = 1e-9;
const int ITERS = 10000;
const LD PI = acos((LD)(-1.0));
LD phi, p[4];
int x[2], y[2], r;
LD dist(LD phi, LD x, LD y) {
return sqrt((x - r * cos(phi)) * (x - r * cos(phi)) + (y - r * sin(phi)) * (y ... | ALGO | 0.999961 | 3.611203 |
413645d1-5d76-4d47-893e-2d1f7fc52d40 | ashikurrahmanbhuiyan/codeforces | edu-160/B.cpp | #include <bits/stdc++.h>
using namespace std;
#define el "\n"
#define in(a) int a=1; cin >> a;
#define int long long int
#define vi vector<int>
#define gcd(a,b) __gcd(a,b)
#define lcm(a,b) (a*b)/__gcd(a,b)
#define lb(arr,n,t) lower_bound(... | ALGO | 0.999916 | 4.522038 |
3003a49c-a2a6-4741-a530-0035a54c57c0 | Nagato-Yukii/Cpp-Prime-Plus | Chaper3/3.12.cpp | #include<iostream>
int main()
{
using namespace std;
const int Lbs_per_stn = 14;
int lbs;
cout << "Enter your weight in pounds:";
cin >> lbs;
int stone = lbs / Lbs_per_stn;
int pounds = lbs % Lbs_per_stn;
cout << lbs << "pounds are" << stone << "stone," << pounds << "pound(s).\n";
return 0;
} | TOOL | 0.864419 | 3.296618 |
dd2989cd-fa6d-460f-b8ff-7bc30e1ea5b0 | nays111/algorithm | BOJ/_1431_시리얼번호.cpp | #include <iostream>
#include <vector>
#include <algorithm>
#include <cmath>
#include <cstring>
#include <cstdio>
#include <stack>
#include <queue>
#include <map>
#include <functional>
using namespace std;
bool compare(string str1,string str2){
if(str1.size() < str2.size()){
return true;
}else if(str1.s... | ALGO | 0.999848 | 5.10089 |
85ad691d-62b1-4aeb-b742-4c71198de230 | anuragshirolkar/OS-labs | lab07/src/process.cpp | #include <iostream>
#include <vector>
#include <set>
#include <map>
#include <algorithm>
#include <stdio.h>
#include <iomanip>
#include <string>
#include <fstream>
#include <thread>
#include <time.h>
#include <sstream>
#include "pageTable.cpp"
using namespace std;
#define SPEC_FILE_BASE "s"
struct process {
int id;... | TOOL | 0.966156 | 3.410565 |
ca2ab64b-6564-44b7-b81f-0327a34ba79e | Lydxn/Competitive-Programming | DMOJ/Another_Contest/acc4p9.cpp | vector<int> f(int n)
{
vector<int> res;
const int MOD = 998244353;
long long prod = 1;
for (int i = 1; i <= n; i++)
{
prod = (prod * i) % MOD;
res.push_back(prod);
}
return res;
}
| ALGO | 0.999678 | 4.833523 |
20099df7-4083-4dad-801d-3c0ee5cae8c2 | nmrichards/latest_ardupilot | libraries/Filter/examples/LowPassFilter/LowPassFilter.cpp | /*
* Example sketch to demonstrate use of LowPassFilter library.
* Code by Randy Mackay. DIYDrones.com
*/
#include <AP_HAL/AP_HAL.h>
#include <Filter/Filter.h> // Filter library
#include <Filter/LowPassFilter.h> // LowPassFilter class (inherits from Filter class)
void setup();
... | TOOL | 0.878475 | 5.377032 |
4be667d6-60e1-42fe-83aa-2209a375f63c | safdar-bindcover/openCV | modules/calib3d/src/usac/homography_solver.cpp | #include "../precomp.hpp"
#include "../usac.hpp"
#ifdef HAVE_EIGEN
#include <Eigen/Eigen>
#endif
namespace cv { namespace usac {
class HomographyMinimalSolver4ptsGEMImpl : public HomographyMinimalSolver4ptsGEM {
private:
const Mat * points_mat;
const float * const points;
public:
explicit HomographyMinimal... | ALGO | 0.999971 | 5.123017 |
f1f1c0af-4f7d-4c5a-b3f3-4efb3efc06be | RatmuX/android_frameworks_av | media/libaudioprocessing/AudioResamplerCubic.cpp | #define LOG_TAG "AudioResamplerCubic"
#include <stdint.h>
#include <string.h>
#include <sys/types.h>
#include <log/log.h>
#include "AudioResamplerCubic.h"
namespace android {
// ----------------------------------------------------------------------------
void AudioResamplerCubic::init() {
memset(&left, 0, size... | ALGO | 0.926321 | 6.907433 |
1c96ce4c-1e16-4ae3-a7fe-4ec0557fc04b | Noobaseem/Competitive-Programing | dataStructures_module1/3_stacks.cpp | /*
* @author: Aseem Rastogi
* alumini: National Institute of Technology, Hamirpur
* Batch of 2014
* mail_id: <EMAIL>
*/
#include<iostream>
#include<cstdio>
#include<cstdlib>
using namespace std;
struct Stack{
int capacity;
int top;
int *array;
};
Stack *createStack(int size){
Stack *s = new Stack();
s-... | ALGO | 0.993669 | 4.020916 |
13f4a092-80b1-4748-9894-96a4f576070b | architjindalcs/Leetcode-Solutions | 1764-form-array-by-concatenating-subarrays-of-another-array/1764-form-array-by-concatenating-subarrays-of-another-array.cpp | class Solution {
public:
bool canChoose(vector<vector<int>>& groups, vector<int>& nums) {
int i=0;
int gidx=0;
while(gidx<groups.size()){
if(i==nums.size()) return false;
if(nums[i]!=groups[gidx][0]) {
i++;
continue;
}
... | ALGO | 0.999916 | 6.047668 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.