uuid string | repo_name string | relative_path string | content string | category string | algo_rel_score float64 | quality_score float64 |
|---|---|---|---|---|---|---|
cc7527f2-133f-4a52-af94-2c38ff58f1c3 | Meet-Chauhan-1755/C-Projects | MEET-H1-PPS/p3.cpp | #include<stdio.h>
int main()
{
int a,b,add,sub,mul,div;
printf("enter two numbers:-");
scanf("%d %d", &a,&b);
add=a+b;
sub=a-b;
mul=a*b;
div=a/b;
printf("\n addition=%d",add);
printf("\n subtraction=%d",sub);
printf("\n multiplication=%d",mul);
printf("\n division=%d",div);
... | ALGO | 0.994917 | 3.09901 |
ab114d95-93a3-4e4c-b1dc-3250afde712c | VishnuBhaarath/Leetcode | 198-house-robber/house-robber.cpp | class Solution {
public:
int rob(vector<int>& nums) {
int n=nums.size();
vector<int> dp(n,0);
dp[0]=nums[0];
if(n==1){
return nums[0];
}
dp[1]=nums[1];
if(n==2){
return max(nums[0],nums[1]);
}
dp[2]=nums[2]+dp[0];
... | ALGO | 0.999869 | 5.566886 |
092aac8d-6a88-4184-8482-bd6e2ff9e93e | samar-gupta/DSA_POTD | GFG/Count the elements.cpp | class Solution {
public:
vector<int> countElements(vector<int> &a, vector<int> &b, int n, vector<int> &query,
int q) {
// Your code goes here;
vector<int>ans;
sort(b.begin(),b.end());
for(int i=0;i<q;i++) {
int val = query[i];
i... | ALGO | 0.999868 | 5.4558 |
e47a18d8-c95f-43de-970e-5e2f6d09231a | mvg01/ps | baekjoon cpp/02589(BFS).cpp | #include <iostream>
#include <queue>
using namespace std;
int n, m;
int dx[4] = { 0,1,-1,0 };
int dy[4] = { 1,0,0,-1 };
int bfs(int y, int x, int* dis[], char* mat[]) {
queue<pair<int, int>>q;
q.push({ y,x });
dis[y][x] = 0;
int d = 0;
while (!q.empty()) {
int yy = q.front().first;
int xx = q.front().second;
... | ALGO | 0.999863 | 3.654583 |
32ca801e-0d92-4d53-834a-56bb5fb698cb | npateras/exercises-in-c-plusplus | Exercise-2.cpp | #include <iostream>
#include <string>
#include <stdio.h>
#include <ctype.h>
#include <algorithm>
using namespace std;
int main() {
int j=0,i=0,count=0; string str,conv,table[1000]; char temp,s[256];
cout << "Enter a sentence: "; cin >> str;
if (str.length()==1) {
temp=str[i];
temp=toupper(temp);
tabl... | ALGO | 0.998845 | 4.423095 |
0ce02f7c-3e55-4b07-b8ce-13ae8ea3134f | mssm-ds-f17/graphical-algorithms-ethankelley | vec2d.cpp | #define _USE_MATH_DEFINES
#include "vec2d.h"
#include <cmath>
#include <algorithm>
#include <limits>
#include <iostream>
using namespace std;
Vec2d::Vec2d()
{
x = 0;
y = 0;
}
Vec2d::Vec2d(double xvalue, double yvalue)
{
x = xvalue;
y = yvalue;
}
double Vec2d::magnitude()
{
return sqrt(x*x + y*y)... | ALGO | 0.999171 | 5.671119 |
bb53f586-8ded-41e0-9bdd-ac84d5b61724 | raincross7/code-similarity | codes/train_code/problem440/problem440_408.cpp | #include<bits/stdc++.h>
using namespace std;
int N;
string S[111];
int main(){
while(cin >> N && N ){
int l,r;
l = r = 0;
for(int i=0;i<N;i++){
cin >> S[i];
}
int cnt = 0;
for(int i=0;i<N;i++){
if( l == r && l == 0 ){
if( i < N -1 ){
if( (S[i] == "lu" && S[i+1] == "ru") ||
... | ALGO | 0.999657 | 3.652963 |
35126604-7795-4bfd-a2aa-6f80cacb98ef | IamAnkit19/Codes | C++ Programs/Function/ForLoop/CheckEvilNumber.cpp | #include<iostream>
using namespace std;
int countOnesInBinary(int num){
int count=0;
for(; num>0; num/=2){
if(num%2==1){
count++;
}
}
return count;
}
bool isEvil(int num){
int onesCount = countOnesInBinary(num);
return (onesCount%2==0);
}
int main(){
int num;
... | ALGO | 0.998993 | 4.236174 |
65458b50-1a51-4ac2-8bef-6d7b6d7d3b76 | abhishekgupta1906/D.S.A | Dynamic programming/mintermforsq.cpp | #include <iostream>
#include <string>
#include <cstring>
#include <vector>
using namespace std;
// brute force
int minimumcount(int n)
{
if (n <= 3)
{
return n;
}
int c = n;
for (int i = 1; i * i <= n; i++)
{
int a = minimumcount(n - (i * i));
c = min(a, c);
/*... | ALGO | 0.999949 | 4.983536 |
49fe2583-f404-4a36-94a9-c0c1107b9363 | kishanrajput23/UHG-Training | Day_07/01.cpp | #include <iostream>
using namespace std;
bool isPrime(int n) {
if (n<=1) {
return false;
}
for(int i=2; i<n; i++) {
if (n%i==0) {
return false;
}
}
return true;
}
int FibonacciSeries(int n) {
int term1 = 1;
int term2 = 1;
int arr[n];
arr[0] = 1... | ALGO | 0.999957 | 4.741474 |
c0017723-2d24-454c-b941-cfefa8dd9b97 | dsh2dsh/xray-oxygen | code/3rd-party/FreeImage/FreeImage/Source/LibRawLite/internal/dht_demosaic.cpp | /*
* функция вычисляет яркостную дистанцию.
* если две яркости отличаются в два раза, например 10 и 20, то они имеют такой же вес
* при принятии решения об интерполировании, как и 100 и 200 -- фотографическая яркость между ними 1 стоп.
* дистанция всегда >=1
*/
static inline float calc_dist(float c1, float c2) {
... | ALGO | 0.99709 | 4.822273 |
f78b5892-250b-4ede-acb1-9ef0579ef2d9 | CodingBash/it279-sorting-assignment | adt-tester/LinkedList.cpp | #include "LinkedList.h"
#include <stdexcept>
InsertionSortNS::LinkedList::LinkedList() {
this->head = NULL;
this->tail = NULL;
this->length = 0;
}
// TODO: Does this properly destroy? Just added the tail pointer
InsertionSortNS::LinkedList::~LinkedList() {
if (this->head) {
InsertionSortNS::Node* current = head... | ALGO | 0.995764 | 4.602546 |
13902e12-907e-44d5-8f4d-85986b8061e1 | Sumu154/Algorithms | C_Graph Algorithm/F_Dijkstra/SSSP for directed.cpp | /*
https://docs.google.com/document/d/1rMQqq63aZ4zevRmPhfQkLmeEB3Ti8gtPLTmZjp0msz4/edit
directed
6 8
1 2 10
1 3 15
2 4 12
2 6 15
3 5 10
4 6 1
4 5 2
6 5 5
0 10 15 22 24 23
*/
#include<bits/stdc++.h>
using namespace std;
#define ll long long
const long long INF = 1e18;
const int N = 1e5+5;
bool visited[N];
vector<ll... | ALGO | 0.999991 | 4.550254 |
a1b196fb-4649-466c-8a82-ebcf49d65e56 | xenowits/cp | practice/littleGirlAndMaxSUM.cpp | #include<bits/stdc++.h>
using namespace std;
#define fori(i,a,b) for (long long int i = a; i <= b ; ++i)
#define ford(i,a,b) for(long long int i = a;i >= b ; --i)
#define mk make_pair
#define mod 998244353
#define pb push_back
#define ll long long
#define MAXN 300001
#define rnd mt19937_64 rng(chrono::high_resolution_... | ALGO | 0.999981 | 4.202547 |
23d91647-ea18-44bf-a0c2-65c833abacc1 | sagpant/LucenePlusPlus | src/core/index/TermVectorEntryFreqSortedComparator.cpp | #include "LuceneInc.h"
#include "TermVectorEntryFreqSortedComparator.h"
#include "TermVectorEntry.h"
namespace Lucene {
TermVectorEntryFreqSortedComparator::~TermVectorEntryFreqSortedComparator() {
}
bool TermVectorEntryFreqSortedComparator::compare(const TermVectorEntryPtr& first, const TermVectorEntryPtr& second) ... | ALGO | 0.930379 | 5.465134 |
90db0360-d1d2-4da2-aa48-8cecdfc9f8e8 | eshan1809/LeetCode-Daily-Challenge | September 2022/September_05.cpp | /*
// Definition for a Node.
class Node {
public:
int val;
vector<Node*> children;
Node() {}
Node(int _val) {
val = _val;
}
Node(int _val, vector<Node*> _children) {
val = _val;
children = _children;
}
};
*/
class Solution {
public:
vector<vector<int>> levelOr... | ALGO | 0.999984 | 6.025167 |
b15722b9-91e2-43b3-ad28-df1adf02ea74 | DrhF/ACM | Timus/T1297.cpp | #include <iostream>
#include <string>
#include <vector>
#include <cmath>
#include <queue>
#include <stack>
#include <algorithm>
#include <map>
#include <set>
using namespace std;
int ans=-1, len;
string s;
bool ispal (int i, int j)
{
if (i>=j)
return true;
if (s[i]==s[j])
return ispal(i+1, j-1);
else
return ... | ALGO | 0.999858 | 3.431817 |
46cc5b83-6b9b-4875-8883-bbbd537e1b58 | Johniel/contests | codeforces/559div2/A/main.cpp | // codeforces/559div2/A/main.cpp
// author: @___Johniel
// github: https://github.com/johniel/
#include <bits/stdc++.h>
#define each(i, c) for (auto& i : c)
#define unless(cond) if (!(cond))
using namespace std;
typedef long long int lli;
typedef unsigned long long ull;
typedef complex<double> point;
template<type... | ALGO | 0.999627 | 3.988082 |
4625ac74-55a7-465d-bb69-26f4cf0ed41d | tayma-06/Basic_code | Contest/Binary_Search/Books.cpp | #include <bits/stdc++.h>
using namespace std;
#define int long long
#define double long double
#define vll vector<int>
#define vpll vector<pair<int, int>>
#define vld vector<double>
signed main() {
int n, t;
cin>>n>>t;
vll a(n);
for(int i=0; i<n; i++){
cin>>a[i];
}
int l=0, r=0, currSum... | ALGO | 0.999976 | 4.741158 |
0cc7a5e7-70b1-4969-b368-e7ffcbd24473 | garbear/xbmc-retroplayer | tools/depends/native/TexturePacker/src/TexturePacker.cpp | #ifdef TARGET_WINDOWS
#include <sys/types.h>
#include <sys/stat.h>
#define __STDC_FORMAT_MACROS
#include <inttypes.h>
#define platform_stricmp _stricmp
#else
#define platform_stricmp stricmp
#endif
#include <cerrno>
#include <dirent.h>
#include <map>
#include "guilib/XBTF.h"
#include "DecoderManager.h"
#include "XBT... | TOOL | 0.940777 | 6.372508 |
d3c4380b-1170-4b72-a26d-bebbac513dbc | MaxSprog/infa | first_semester11/122joseph.cpp | #include <iostream>
using namespace std;
class List{
private:
typedef struct lst{
int data = 0;
struct lst* prev = NULL;
struct lst* next = NULL;
bool is_end = true;
}list;
list* head;
list* create(int data, list* next=NULL, list* prev... | ALGO | 0.999938 | 3.325136 |
6486bc35-1610-4b9c-90da-67f9f8be2007 | raincross7/code-similarity | codes/train_code/problem091/problem091_435.cpp | #include<cstdio>
#include<cstring>
#include<iostream>
#include<cmath>
#include<algorithm>
#include<queue>
#include<stack>
using namespace std;
const int MR=100010;
deque<int> q;
int d_min[MR];
int parent[MR];
int type[MR];
int main(){
memset(d_min,-1,sizeof(d_min));
d_min[1]=1;
int K;
cin>>K;
q.push_back(1);
whi... | ALGO | 0.999946 | 3.241291 |
3e30a454-2255-4985-a266-81ef1de81985 | jsupancic/deep_hand_pose | src/caffe/util/im2col.cpp | #include <cmath>
#include <cstdlib>
#include <cstring>
#include <vector>
#include "caffe/util/im2col.hpp"
#include "caffe/util/math_functions.hpp"
namespace caffe {
template <typename Dtype>
void im2col_cpu(const Dtype* data_im, const int channels,
const int height, const int width, const int kernel_h, const int... | TOOL | 0.902156 | 7.557462 |
88e90fc6-64fa-4f0b-a740-61a290838cde | sarvex/leetcode-pascal | solution/1400-1499/1437.Check If All 1's Are at Least Length K Places Away/Solution.cpp | class Solution {
public:
bool kLengthApart(vector<int>& nums, int k) {
int j = -1;
for (int i = 0; i < nums.size(); ++i) {
if (nums[i] == 1) {
if (j != -1 && i - j - 1 < k) {
return false;
}
j = i;
}
... | ALGO | 0.999987 | 5.743949 |
29ce56bb-d38b-474e-addb-fd98a32becbd | securesystemslab/llvm-project | clang-tools-extra/clangd/ConfigYAML.cpp | namespace clang {
namespace clangd {
namespace config {
namespace {
using llvm::yaml::BlockScalarNode;
using llvm::yaml::MappingNode;
using llvm::yaml::Node;
using llvm::yaml::ScalarNode;
using llvm::yaml::SequenceNode;
llvm::Optional<llvm::StringRef>
bestGuess(llvm::StringRef Search,
llvm::ArrayRef<llvm::St... | TOOL | 0.963862 | 7.613695 |
c203a6c9-b84f-49ee-a3c4-31493d143848 | pearlrathour/StriverSheetChallenge2023 | Day 02- Arrays - II/3 Merge sorted array/Merge sorted array.cpp | class Solution {
public:
void merge(vector<int>& nums1, int m, vector<int>& nums2, int n) {
int i = m - 1;
int j = n - 1;
int k = m + n - 1;
while (j >= 0) {
if (i >= 0 && nums1[i] > nums2[j])
nums1[k--] = nums1[i--];
else
... | ALGO | 0.999947 | 5.457467 |
bbd7b3c4-1e18-4259-a356-23e7ad5956d5 | Himanshukaushik8266/ModeenCPP | AfterMaths/ThreadsPractise/Prac1.cpp | #include <iostream>
#include <queue>
#include <functional>
class EkAurClass
{
private:
/* data */
int _price;
std::string _name;
public:
EkAurClass() = default;
EkAurClass(const EkAurClass &) = delete;
EkAurClass(EkAurClass &&) = delete;
EkAurClass &operator=(const EkAurClass &) = delete;
... | ALGO | 0.95645 | 5.183235 |
55609893-03af-4cd3-a0b0-3830113a10ca | Gamer64ytb/Dolphin-Enhanced | Source/Core/Common/Config/Layer.cpp | #include <algorithm>
#include <cstring>
#include <map>
#include "Common/Config/Config.h"
#include "Common/Config/Layer.h"
namespace Config
{
ConfigLayerLoader::ConfigLayerLoader(LayerType layer) : m_layer(layer)
{
}
ConfigLayerLoader::~ConfigLayerLoader() = default;
LayerType ConfigLayerLoader::GetLayer() const
{
... | TOOL | 0.878643 | 7.337987 |
b2a44f90-4f99-4599-8994-87eaa5d727c4 | sthr630-sirius/Atcoder_ABC_cpp | ABC140/c.cpp | #include<iostream>
#include<vector>
using namespace std;
int main(){
int n;
cin >> n;
vector<int> a(n), b(n-1);
int ans;
ans = 0;
for (int i=0; i<n-1; i++) cin >> b[i];
a[0] = b[0];
a[n-1] = b[n-2];
for (int i=1; i<n-1; i++){
a[i] = min(b[i-1], b[i]);
}
for (a... | ALGO | 0.999948 | 3.430009 |
bbdc0a31-2e4b-46f3-baf5-5b19d0e4d619 | Anushas5/FOC-PRACTICALS- | FOC(Experiment 44).cpp | #include <stdio.h>
int main() {
int sales[10][7];
int totalSalesWeek = 0;
int avgSalesPerson[10] = {0};
int totalSalesDay[7] = {0};
for (int i = 0; i < 10; i++) {
printf("Enter sales data for Salesperson %d:\n", i + 1);
for (int j = 0; j < 7; j++) {
printf("Day %d: ... | ALGO | 0.992718 | 3.677754 |
8f632e9d-c15e-4ade-a3d2-49e5ad57c708 | MedoN11/CompetitiveProgramming | CodeForces/CFGYM-101726-B.cpp | #include <bits/stdc++.h>
#include <tr1/unordered_map>
typedef long long ll;
typedef unsigned long long ull;
#define clr(ma) memset(ma,-1,sizeof ma)
#define INF 10000000000000001ll
#define vi vector<int>
#define pi pair<int ,ll >
#define T pair<pi,double>
#define mk make_pair
#define getBit(m,i) ((m&(1ll<<i))==(1ll<<i))... | ALGO | 0.998859 | 3.662968 |
b9e979d6-5349-47d6-9916-7a015bedce3c | ArseniAnishchanka/leetcode | 1710. Maximum Units on a Truck.cpp | class Solution
{
public:
int maximumUnits(vector<vector<int>>& boxTypes, int truckSize)
{
sort(boxTypes.begin(), boxTypes.end(), [](vector<int> a, vector<int> b){
return a[1] > b[1];
});
int ans = 0;
int ind = 0;
while (truckSize > 0 and ind ... | ALGO | 0.999966 | 6.575306 |
2c81310a-159b-478e-bbc5-536190bfa6aa | maryam97/ACM | UVa problems/489 - Hangman Judge.cpp | //#define Q489
#ifdef Q489
#include <iostream>
#include <string>
#include <vector>
#include <algorithm>
using namespace std;
int main() {
ios::sync_with_stdio(false);
string word;
string guess;
vector<bool>founds;
char * pch;
int round;
int lose;
bool win;
while (cin >> round && round != -1) {
cout << "Rou... | ALGO | 0.999524 | 3.380669 |
4f875537-43d9-49f7-8556-242946e2e704 | lorenzo2beretta/Competitive-Programming | lesson_3/inversion_count.cpp | /* This algorithm is defined recursively. It is like a merge
* sort that taking how many elements belonging to
* the upper half of the array are overcome by elements belonging
* to the lower half into account while merging.
*/
#include<bits/stdc++.h>
using namespace std;
long inversions(vector<long>& v){
long n=... | ALGO | 0.999726 | 4.273802 |
5f005fe2-c5af-469f-9127-8f8d37f8fbe5 | Eirawen/329m | dataset/57.cpp | auto _ = []() {
ios::sync_with_stdio(false);
cout.tie(nullptr);
cin.tie(nullptr);
return 0;
}();
class Solution {
public:
int minNumberOperations(vector<int>& target) {
int size = target.size();
stack<int> s;
s.push(0);
vector<int> smallerLeft(size, 0);
for ... | ALGO | 0.999966 | 5.94255 |
6528b774-6778-4367-a5fb-b57b24782d17 | daizhenyang/OJs | Leetcode/generateParenthesis.cpp | #include <vector>
#include <cstring>
#include <algorithm>
using namespace std;
class Solution {
public:
void generate(int l, int r, int dep, char* buf, vector<string>& res) {
if(l == 0 && r == 0) {
buf[dep] = 0;
res.push_back(buf);
return;
}
if(l != 0) {
buf[dep] = '(';
generate(l - 1, r, dep + 1,... | ALGO | 0.99976 | 5.166849 |
d9580754-902f-47ff-9d78-7911277ac6dc | nabil16497/Operating-System-Process-Scheduling-Algorithms | Banker's Algorithm.cpp | #include<iostream>
using namespace std;
int p[10][16], a[5], pn, an, totala[5], first = -1, working[5], workingc[5], cw = 0, tw = 0;
bool checktotal() {
for (int i = 0;i < an;i++)
{
if (totala[i] != a[i])
{
return true;
}
}
return false;
}
bool iscapable(int i) {
... | ALGO | 0.999814 | 3.070782 |
df9ba01c-86d5-47b1-bede-06460f220436 | ishandutta2007/codeforces | wxhtzdy/normal/713/A.cpp | #include <bits/stdc++.h>
using namespace std;
int get(long long x) {
int res = 0;
for (int i = 0; i < 20; i++) {
res = 2 * res + (x & 1);
x /= 10;
}
return res;
}
int main() {
ios::sync_with_stdio(false);
cin.tie(0);
int tt;
cin >> tt;
map<int, int> cnt;
while ... | ALGO | 0.999204 | 4.230798 |
bfe0ba14-3414-41ff-9988-90c89a66fd6f | ryanregal/XMU_OJ | 小学期oj/第三周/boss2 英杰们的蛋糕塔.cpp | /*
* @Author: ryanregal <EMAIL>
* @Date: 2022-07-04 09:18:54
* @LastEditors: ryanregal <EMAIL>
* @LastEditTime: 2022-07-04 09:19:01
* @FilePath: \xmuoj\第三周\boss2 英杰们的蛋糕塔.cpp
* @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
*/
#i... | ALGO | 0.999955 | 4.698132 |
8152dbdf-f1a7-4d87-a83b-075cd5cfa4ba | bazelment/boost | smart_ptr/extras/src/sp_collector.cpp | #if defined(BOOST_SP_ENABLE_DEBUG_HOOKS)
#include <boost/assert.hpp>
#include <boost/shared_ptr.hpp>
#include <boost/detail/lightweight_mutex.hpp>
#include <cstdlib>
#include <map>
#include <deque>
#include <iostream>
typedef std::map< void const *, std::pair<void *, size_t> > map_type;
static map_type & get_map()
{... | TOOL | 0.875803 | 5.412834 |
eb33bce5-4eb6-4655-8818-c43f66ce1d28 | bu-icsg/Hardware_Performance_Counters_Can_Detect_Malware_Myth_or_Fact | Malicious Notepad++/src/WinControls/FileBrowser/fileBrowser.cpp | #include "fileBrowser.h"
#include "resource.h"
#include "tinyxml.h"
#include "FileDialog.h"
#include "localization.h"
#include "Parameters.h"
#include "RunDlg.h"
#include "ReadDirectoryChanges.h"
#include "menuCmdID.h"
#define CX_BITMAP 16
#define CY_BITMAP 16
#define INDEX_OPEN_ROOT 0
#define IN... | TOOL | 0.882155 | 4.372785 |
36877a0c-c2fd-4602-b76b-6e39d9fd5e91 | imprakarsh/Codeforces-Contests | 732_X/3.cpp | #include <bits/stdc++.h>
#define int long long
using namespace std;
void solve() {
int n; cin >> n;
vector<int> giv(n), v(n);
for (auto &i : giv) cin >> i;
v = giv;
sort(v.begin(), v.end());
map<int, pair<int, int>> mp;
map<int, pair<int, int>> diff;
for (int i = 0; i < ... | ALGO | 0.999765 | 4.574653 |
add449aa-d65a-4a96-9f4b-c5bca83a17ca | Shrayash-hub/Array-related-problems | 0283-move-zeroes/0283-move-zeroes.cpp | class Solution {
public:
void moveZeroes(vector<int>& nums) {
int zeros=0,n=nums.size();
if(nums[0]==0){
nums.erase(nums.begin());
}
for(int i=0;i<nums.size();i++){
if(nums[i]==0){
nums.erase(nums.begin()+i);
i--;
}
}
... | ALGO | 0.999929 | 6.65542 |
f88aeae2-fdf7-4363-8ee4-b9ae0eb540b4 | pratham022/LeetCode-Practice | 700-search-in-a-binary-search-tree/700-search-in-a-binary-search-tree.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.999995 | 6.402859 |
539e7f3b-6f49-48da-8a57-3e6ab5c8ea36 | vinitpatil2812/CP | CodeForces/contests/1931/1931C.cpp | #include <bits/stdc++.h>
using namespace std;
#define ll long long
#define pll pair<ll, ll>
#define pv(v) { for(auto &x : v) cout << x << " "; cout << endl; } // printVector
#define iv(v) { for(auto &x : v) cin >> x; } // inputVector
#define all(v) v.begin(), v.end() // first and last iterator
const int mod = 1e9 + ... | ALGO | 0.999981 | 5.307755 |
2ae098ff-43ce-4c0d-8e58-d5bb44e8c7b3 | Error323/BitChess | src/asearch/test/asearchtest.cpp | #include "asearchtest.h"
#include "../asearch.h"
extern uint64_t Rand64();
#include <iostream>
#include <sstream>
using namespace asearch;
CPPUNIT_TEST_SUITE_REGISTRATION(ASearchTest);
ASearchTest::ASearchTest()
: CppUnit::TestFixture()
{
}
ASearchTest::~ASearchTest()
{
}
const static unsigned short win_positi... | TEST | 0.876869 | 5.966588 |
4efbe9e8-3508-48f2-9571-d2b7bba5c124 | preethamd98/My-Solutions | add-two-numbers-ii/add-two-numbers-ii.cpp | while(size1 > 0 and size2 > 0) {
int val = 0;
if(size1 >= size2) {
val += l1->val;
l1 = l1->next;
size1--;
}
if(size2 > size1) {
val += l2->val;
l2 = l2->next;
size2--;... | ALGO | 0.999525 | 3.653927 |
c10fd659-e9eb-4439-a1b9-3f1ef3b97075 | ryzingTitan/C101 | Lab7b.cpp | //Kyle Stoltzfus
#include <iostream>
using namespace std;
void FindLargestNumber(int &X, int Y, int Z);
void main()
{
int Integer1, Integer2, Integer3;
char Response;
do
{
cout << "Enter an integer. ";
cin >> Integer1;
cout << "Enter another integer. ";
cin >> Integer2;
cout << "Enter an third intege... | ALGO | 0.980904 | 3.589037 |
8b48bad3-0b3e-4572-9be2-cd501ab7d7ef | itsvishy321/DSA-Questions-Searching | firstOcc_lastOcc.cpp | // First and last position of an element in a sorted array
#include <iostream>
#include <vector>
using namespace std;
int firstOcc(vector<int> arr, int n, int key)
{
int s = 0;
int e = n - 1;
int mid = s + (e - s) / 2;
int ans;
while (s <= e)
{
if (arr[mid] == key)
{
... | ALGO | 0.999921 | 5.696436 |
f42c5b34-334f-4e8b-88ef-7a60376c496e | watashi/AlgoSolution | leetcode/weekly-322/2491.cpp | class Solution {
public:
long long dividePlayers(vector<int>& skill) {
auto v = skill;
sort(v.begin(), v.end());
int s = v.front() + v.back();
long long ret = 0;
for (int i = 0, j = (int)v.size() - 1; i < j; ++i, --j) {
if (v[i] + v[j] != s) {
return -1;
}
ret += (long lo... | ALGO | 0.999935 | 5.570818 |
b1e63b1c-16e8-49f1-9e2b-08c1bdb11aab | naringcode/algorithm-training | BaekjoonOnlineJudge/_basic/4641.cpp | #include <bits/stdc++.h>
using namespace std;
int n;
vector<int> vec;
bool arr[204];
int res;
int main()
{
ios_base::sync_with_stdio(false);
cin.tie(nullptr);
cout.tie(nullptr);
while (true)
{
cin >> n;
if (-1 == n)
break;
vec.clear();
fill(arr, ar... | ALGO | 0.998406 | 3.642644 |
b0f608e1-f3c7-45c5-b539-3ab033bcf5f8 | Gavei-z/algorithm_problems_solution | 1068FindMoreCoins.cpp | //
// Created by Gavei on 2022/7/10.
//
#include "iostream"
#include "algorithm"
using namespace std;
const int N = 10010, M = 110;
int n, m, dp[N][M], v[N], c[N][M];
int main() {
cin >> n >> m;
for (int i = 1; i <= n; ++i) {
cin >> v[i];
}
sort(v + 1, v + 1 + n, greater<int>());
for (in... | ALGO | 1 | 4.538018 |
0ae01295-8703-4259-9e04-11107d864c13 | akunkunkun/Artificial-Impostors | attackmodel/source/ContextAnalysisOperations.cpp | //!
//! \file
//!
#include "../include/ContextAnalysisOperations.h"
#include "../include/MetricOperation.h"
#include "../include/Context.h"
#include "../include/File.h"
namespace lpm {
PredictabilityAnalysisOperation::PredictabilityAnalysisOperation(string name, MetricDistance* distance, bool normalize) : ContextAna... | ALGO | 0.994823 | 5.570644 |
ca6d377c-e647-4e34-bd6c-1efe0b5bc0b5 | TCGBench/TCGBench | data/human_performance_code/human_performance_code_canonical/P5180/ac_0.cpp | #include<bits/stdc++.h>
using namespace std;
vector<int> ljb[200005];
vector<int> G[200005];
vector<int> tree[200005];
int n,m;
int dfn[200005];
int rnk[200005];
int fa[200005];
int cnt;
void dfs(int cur){
dfn[cur]=++cnt;
rnk[cnt]=cur;
for(int v:ljb[cur]){
if(!dfn[v]){
fa[v]=cur;
... | ALGO | 0.999969 | 4.706977 |
8dce9817-5612-45d9-bdaf-5fbfb6e8f723 | ThanakritW/ocom2021 | 82_oct15_light/tempCodeRunnerFile.cpp | #include<bits/stdc++.h>
using namespace std;
int n,k,ta,tb,total=0;
vector<pair<int,int>> sx,sy;
int main(){
cin >> n >> k;
for(int i=0;i<n;i++){
cin >> ta >> tb;
sx.push_back({ta,tb});
sy.push_back({tb,ta});
}
sort(sx.begin(),sx.end());
sort(sy.begin(),sy.end());
for(int... | ALGO | 0.999868 | 3.493762 |
fff39712-dda4-4712-b38f-4da42c42fd6f | Radhesh-Sarma/Competitive-Coding | codeforces/839/C.cpp | #include<bits/stdc++.h>
using namespace std;
#define IOS ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);
#define endl "\n"
#define int long long
#define all(v) v.begin(),v.end()
#define f first
#define s second
#define PB push_back
#define MP make_pair
#define db long double
#define trace1(x) ... | ALGO | 0.999313 | 4.252669 |
3bf9cd7e-2a5a-4eff-8d7a-666c88504438 | JustAG7/Competitive_Programming | VKU/2024/VKU Fenwick.LIS.LCS/dplis2.cpp | #include<bits/stdc++.h>
using namespace std;
#define fast ios_base::sync_with_stdio(false);cout.tie(NULL);cin.tie(NULL);
#define ll long long
#define pb push_back
#define pf push_front
#define db double
#define X first
#define Y second
#define fi first
#define se second
#define all(x) (x).begin(),(x).end()
#define rall... | ALGO | 0.999975 | 4.524644 |
369b5521-1a5e-40f3-95a8-28c9605cf3de | priyanka8625/DSA-Daily-Problems-2024 | 04_April_Daily_Problems/10_GFG_Party of Couples_MySoln.cpp | class Solution{
public:
int findSingle(int n, int arr[]){
// code here
int ans=0;
for(int i=0; i<n; i++)
ans ^= arr[i];
return ans;
}
}; | ALGO | 0.999911 | 5.260439 |
cc1b0752-ebae-4a8a-b416-d4489e6bebb8 | mehreen019/IUT_Academics | 2-2/lab/CSE 4404/lab 3/210041219_L3T2.cpp | #include<bits/stdc++.h>
using namespace std;
const int sz=1005;
char r[sz][sz];
bool vis[sz][sz]={{0}};
vector<pair<int,int>> pos;
int srcx, srcy ,arrn, arrm;
int dx[]={1,-1,0,0};
int dy[]={0,0,1,-1};
bool checker(int u,int v){
if(u>=0 && u<arrn && v>=0 && v<arrm && !vis[u][v] && r[u][v]!='#') return true;
els... | ALGO | 0.999716 | 4.508486 |
0cb26fb6-9e59-4937-b3e2-b84c63c84087 | giapt2k29/Algorythms_C- | tinh3.cpp | #include<bits/stdc++.h>
using namespace std;
long long n,i,t;
int main()
{
freopen("tinh3.inp","r",stdin);
freopen("tinh3.out","w",stdout);
cin>>n;
for(i=1;i<=n;i++)
t=t+i*i;
cout<<t;
}
| ALGO | 0.999716 | 3.35916 |
174b3ae2-10f2-40a0-9c79-0d3df0ace3a5 | nyakagawan/MetalCocos | cocos/3d/CCObjLoader.cpp | //
// version 0.9.6: Support Ni(index of refraction) mtl parameter.
// Parse transmittance material parameter correctly.
// version 0.9.5: Parse multiple group name.
// Add support of specifying the base path to load material file.
// version 0.9.4: Initial suupport of group tag(g)
// vers... | TOOL | 0.873562 | 3.284203 |
2ca0ff8d-4173-436f-8888-7eb55dcc32ea | MehrajShakil/Solving-problem-in-different-OJ | CSES/Dynamic Programming/Coin Combinations I.cpp | /// BISMILLAHIR RAHMANIR RAHEEM
/// ALLAH IS WATCHING ME
/// Every soul shall taste death.
#include<bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
#include <ext/pb_ds/detail/standard_policies.hpp>
/// order_of_key return number of elements less than x.
/// find_... | ALGO | 0.999965 | 4.207862 |
5798c756-ac5e-49ad-ae14-eb9bada4f177 | jakariahossinsv/Algorithms-all-code | Algo- DFS.cpp | #include <iostream>
#include <vector>
#include <stack>
using namespace std;
void dfs_iterative(int start, vector<vector<int>> &adj, int n) {
vector<bool> visited(n, false);
stack<int> s;
s.push(start);
cout << "DFS Iterative Traversal: ";
while (!s.empty()) {
int node = s.top();
... | ALGO | 0.999926 | 6.896808 |
3d2dd079-ff56-4d25-bfd3-630f5cf3db73 | qiaozishun4/CSP2024_BJ | BJ-Junior/answers/BJ-J01003/sticks/sticks.cpp | #include <iostream>
using namespace std;
int main() {
freopen("sticks.in", "r", stdin);
freopen("sticks.out", "w", stdout);
int s[10] = {6, 2, 5, 5, 4, 5, 6, 3, 7, 6};
int t, n, ans[100] = {}, ai = 0, ta[100001] = {};
cin >> t;
for (int i = 0; i < t; i++) {
cin >> n;
if (n == 1) {
ans[ai+... | ALGO | 0.999689 | 3.460569 |
2d8e3af8-73f6-4a0f-bfb5-fce99fc96bdd | ZtoYtoQ/NCNN-PoseEstimation | src/layer/yolov3detectionoutput.cpp | #include "yolov3detectionoutput.h"
#include <algorithm>
#include <limits>
#include <math.h>
#include "layer_type.h"
namespace ncnn {
DEFINE_LAYER_CREATOR(Yolov3DetectionOutput)
Yolov3DetectionOutput::Yolov3DetectionOutput()
{
one_blob_only = false;
support_inplace = false;
//softmax = ncnn::create_l... | ALGO | 0.978068 | 6.182289 |
5db4c816-725d-4ab2-a209-898c5bf424c2 | fmckenna/OpenSeesBORIS | SRC/element/forceBeamColumn/DistHingeIntegration.cpp | // $Revision: 1.3 $
// $Date: 2007-10-26 04:50:14 $
// $Source: /usr/local/cvs/OpenSees/SRC/element/forceBeamColumn/DistHingeIntegration.cpp,v $
#include <DistHingeIntegration.h>
#include <ElementalLoad.h>
#include <Matrix.h>
#include <Vector.h>
#include <Channel.h>
#include <FEM_ObjectBroker.h>
#include <Information... | ALGO | 0.959907 | 6.268769 |
ff497da3-e02a-4d3a-86c3-1fe623418a68 | aryanshroff/LeetCode | Dynamic_Programing/Unbounded Knapsack/coin_change_ways.cpp | #include <iostream>
#include <bits/stdc++.h>
using namespace std;
void display(vector<vector<int>> &v)
{
for (int i = 0; i < v.size(); i++)
{
for (int j = 0; j < v[0].size(); j++)
{
cout << v[i][j] << " ";
}
cout << endl;
}
}
// given an infinte supply of each c... | ALGO | 0.99981 | 4.999962 |
9fd9353d-4db8-42fd-867b-f407486cf112 | yanhuanwang/codekata | wikioi/3062.cpp | ///*
// * A.cpp
// *
// * Created on: Apr 26, 2014
// * Author: ecaiyan
// */
//
//#include <cstdio>
//#include <cstdlib>
//#include <memory.h>
//#include <algorithm>
//#include <string>
//#include <map>
////#include <unordered_map>
////#include <unordered_set>
//#include <set>
//#include <vector>
//#include <cma... | ALGO | 0.999977 | 3.663427 |
e37e6c1b-0520-4452-bc43-482f6b7fc422 | SJMA11723/Problem-solving | codeforces/Codeforces Round 842 (Div. 2)/A.cpp | /**
* Author: Jorge Raul Tzab Lopez
* Github: https://github.com/SJMA11723
*/
#include <bits/stdc++.h>
using namespace std;
int main(){
ios_base::sync_with_stdio(0);
cin.tie(0);
cout.tie(0);
int t; cin >> t;
while(t--){
int k; cin >> k;
cout << k - 1 << '\n';
}
}
| ALGO | 0.999511 | 4.182132 |
0bb474c9-81d9-4c91-9adb-dadcef580f90 | snahaya/HackerNewsFlutter | 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.998859 | 6.785645 |
4b9435f6-98d6-43c5-832c-5c6d8ae9809c | WinampDesktop-restore/winamp | Src/external_dependencies/openmpt-trunk/include/soundtouch/source/SoundTouch/sse_optimized.cpp | #include "cpu_detect.h"
#include "STTypes.h"
using namespace soundtouch;
#ifdef SOUNDTOUCH_ALLOW_SSE
// SSE routines available only with float sample type
//////////////////////////////////////////////////////////////////////////////
//
// implementation of SSE optimized functions of class 'TDStretchSSE'
//
///... | TOOL | 0.958681 | 6.092807 |
f96658de-dadc-47f7-9495-cf21dbc68876 | shubhampakale/Leetcode_solutions | Palindromic Array - GFG/palindromic-array.cpp | //{ Driver Code Starts
#include<iostream>
#include<string.h>
using namespace std;
// } Driver Code Ends
/*Complete the function below*/
class Solution {
public:
int PalinArray(int a[], int n)
{
for(int i=0;i<n;i++)
{
int ans=0;
int temp=a[i];
... | ALGO | 0.997396 | 5.885418 |
60eea49f-3ab3-4203-8b5a-18d97714652d | ishandutta2007/codeforces | strawberryc/normal/1464/D.cpp | #include <bits/stdc++.h>
template <class T>
inline void read(T &res) {
res = 0; bool bo = 0; char c;
while (((c = getchar()) < '0' || c > '9') && c != '-');
if (c == '-') bo = 1; else res = c - 48;
while ((c = getchar()) >= '0' && c <= '9')
res = (res << 3) + (res << 1) + (c - 48);
if (bo) res = ~res + 1... | ALGO | 0.999955 | 3.675985 |
f8e8d26a-b230-4a80-82cf-69c1fb52f573 | rodamber/msc-thesis | code/setwise/z3/src/tactic/smtlogics/qfnra_tactic.cpp | #include "tactic/tactical.h"
#include "tactic/core/simplify_tactic.h"
#include "tactic/core/propagate_values_tactic.h"
#include "tactic/arith/nla2bv_tactic.h"
#include "smt/tactic/smt_tactic.h"
#include "nlsat/tactic/qfnra_nlsat_tactic.h"
static tactic * mk_qfnra_sat_solver(ast_manager& m, params_ref const& p, unsigne... | ALGO | 0.99944 | 6.603733 |
dcb95d68-790a-462c-9ceb-9c570b409745 | sonuyadav4/HACKTOBERFEST_2K22 | CODE/huffmancodeV2.cpp | // C++(STL) program for Huffman Coding with STL
#include <bits/stdc++.h>
using namespace std;
// A Huffman tree node
struct MinHeapNode {
// One of the input characters
char data;
// Frequency of the character
unsigned freq;
// Left and right child
MinHeapNode *left, *right;
MinHeapNode(char data, unsigned ... | ALGO | 0.999964 | 5.605272 |
b22f2800-9c84-4fe5-9ab4-bc4483f42f0d | alexmijo/EoPI | BinarySearchTrees/BinarySearchTrees.cpp | #include <iostream>
#include <memory>
using namespace std;
template <typename T>
struct BSTNode {
T data;
unique_ptr<BSTNode<T>> left, right;
};
// 15.1
// Stupidly had the wrong idea at first so I took too long, otherwise fine.
// Edit: Nvm, had another stupidly wrong idea, so that wasted more time.
// Edit... | ALGO | 0.998528 | 7.049556 |
a2b14917-e2f7-4584-8bbf-1979f057c80e | thucdx/algorithm-solution | OTHER/OLD_UNCLASS/PreToPostOrder.cpp | #include <iostream>
#include <cstdio>
#include <cstdlib>
#include <map>
#include <set>
#include <vector>
#include <cmath>
#include <cstring>
#include <queue>
#include <stack>
#include <string>
#include <algorithm>
using namespace std;
#define REP(i,a,b) for(int i=a;i<=b;++i)
#define DOWN(i,a,b) for(int i=a;i>=b;--i)
... | ALGO | 0.998059 | 3.131908 |
d651ef56-713a-4154-ac11-908f2cb9170e | Air-bagz/PAT-and-nowcoder | HJ107.cpp | #include<stdio.h>
const double eps=1e-5;
double f(double x)
{
return x*x*x;
}
int main()
{
double x;
scanf("%lf",&x);
double left=-20,right=20,mid;
while ((right-left)>eps)
{
mid=(left+right)/2.0;
if (f(mid)>x) right=mid;
else left=mid;
}
printf("%.1f",mid);
... | ALGO | 0.999965 | 3.556447 |
9554d957-469b-4051-960d-04d07007250d | VipulDub-Cdr/DSA | LearnYard_Sheet/Stack/Monotonic Stack/Sum_of_subarray_minimums.cpp | #include <bits/stdc++.h>
using namespace std;
int m = 1e9+7;
//Brute force
int sumSubarrayMins(vector<int>& arr) {
long long sum = 0;
for(int i=0;i<arr.size();i++){
for(int j = i;j<arr.size();j++){
int minval = INT_MAX;
for(int k = i;k<=j;k++){
minval = min(minval... | ALGO | 0.999976 | 5.078552 |
77568c96-1906-42d6-aae1-b9c39915a481 | peter4549/problems | Baekjoon Online Judge/13458.cpp | #include <stdio.h>
int N, B, C;
int A[1000000];
int main() {
int i;
long long count(0);
scanf("%d", &N);
for (i = 0; i < N; ++i)
scanf("%d", &A[i]);
scanf("%d %d", &B, &C);
for (i = 0; i < N; ++i) {
A[i] -= B;
++count;
if (A[i] > 0) {
count += A[i] / C;
if (A[i] % C)
++count;
}
}
p... | ALGO | 0.999775 | 3.12871 |
31eaf333-99e0-40a1-b068-5dad9ab00d9c | Xrvitd/RFEPS | MAIN/nanoflann/benchmarkTool/realTests/benchmark_fastann_real.cpp | #include <cstdlib>
#include <ctime>
#include <fastann.hpp>
#include <fstream>
#include <iostream>
#include <string>
#include <vector>
using namespace std;
using namespace fastann;
// Scan all points from file
template <class T> T *scanPointCloud(unsigned int &N, string file) {
ifstream read(file.c_str());
string... | ALGO | 0.954672 | 6.215636 |
7165b54a-f39d-4e17-95ee-238723b3eaa0 | Distrotech/opencore-amr | opencore/codecs_v2/audio/gsm_amr/amr_nb/common/src/shr_r.cpp | /*
Filename: shr_r.cpp
------------------------------------------------------------------------------
INPUT AND OUTPUT DEFINITIONS
Inputs:
var1 = 16 bit short signed integer (Word16) whose value falls in
the range : 0xffff 8000 <= var1 <= 0x0000 7fff.
var2 = 16 bit short signed integer (Word16)... | ALGO | 0.999343 | 6.31642 |
664f140d-078b-4559-875a-e87976aec4a7 | ujjwalagrawal-1/CP_Problems | B_Turtle_and_an_Infinite_Sequence.cpp | // 2024-06-18 14:12:26
// Author Ujjwal_Agrawal
// Linkedin: https://www.linkedin.com/in/uj7b1253/
// Codeforces: https://codeforces.com/profile/n_________er
// Codechef: https://www.codechef.com/users/kgr
#include <bits/stdc++.h>
using namespace std;
//Speed
#define bullet() ios_base::sync_with_stdio(false), cin.ti... | ALGO | 0.999901 | 4.803652 |
c269bf7d-ab39-465e-9631-0725097b1623 | Sarwar05/MyCodes | 12003 Array Transformer.cpp | #include<bits/stdc++.h>
using namespace std;
#define mx 300002
#define ll long long
vector<ll> block[550];
ll arr[mx];
int Size;
int getBlockNo(int pos)
{
return (pos/Size);
}
int getMIN(int l, int r, int v)
{
int lid = getBlockNo(l);
int rid = getBlockNo(r);
int ret = 0;
if(lid==rid){
for(i... | ALGO | 0.999974 | 4.87216 |
091305b0-38e6-46d3-a7fc-274406f95bb4 | jeounpar/codingtest-with-cpp | basic-algo-lecture/dikstra/17835.cpp | #include <bits/stdc++.h>
typedef long long ll;
using namespace std;
const int MX = 100'002;
const ll INF = 0x7f7f7f7f7f7f;
int n, m, k;
ll d[MX];
vector<pair<ll, int>> adj[MX];
priority_queue<pair<ll, int>, vector<pair<ll, int>>, greater<pair<ll, int>>> pq;
void solve() {
while (!pq.empty()) {
int u, v;
ll... | ALGO | 0.999982 | 4.135906 |
f7d15961-69ea-4958-aebb-43650dcb8946 | maithili31/cpp-codes | facto.cpp | #include <iostream>
using namespace std;
int main() {
int t;
cin>>t;
while (t--) {
int n;
cin>>n;
int count=0;
int ans=1;
for(int i=1;i<=n;i++) {
ans=ans*i;
}
while (ans%10==0) {
count++;
ans=ans/10;
}
cout<<count<<endl;
}
return 0;
}
| ALGO | 0.999733 | 4.480273 |
cf31fdef-3cb0-4498-b90d-6f916738f543 | CarlosLF/P5-MPC | src/Eigen-3.3/bench/sparse_cholesky.cpp | // #define EIGEN_TAUCS_SUPPORT
// #define EIGEN_CHOLMOD_SUPPORT
#include <iostream>
#include <Eigen/Sparse>
// g++ -DSIZE=10000 -DDENSITY=0.001 sparse_cholesky.cpp -I.. -DDENSEMATRI -O3 -g0 -DNDEBUG -DNBTRIES=1 -I /home/gael/Coding/LinearAlgebra/taucs_full/src/ -I/home/gael/Coding/LinearAlgebra/taucs_full/build/lin... | ALGO | 0.992059 | 4.147974 |
84102e89-9a49-4499-9618-bb46a39414e3 | lutfiandri/hackerrank | algorithms/10-time-conversion.cpp | #include <bits/stdc++.h>
using namespace std;
int main() {
string s;
cin >> s;
// cout << s << endl;
string s1 = s.substr(0, 2);
string s2 = s.substr(2, 6);
string s3 = s.substr(8, 2);
int hour = stoi(s1);
if (hour >= 12) {
hour -= 12;
}
if (s3 == "PM") {
hour ... | ALGO | 0.9976 | 4.162763 |
d1cbbc60-eeff-43b0-b625-c4116a759b66 | acornjello/TIL | Algorithm/Baekjoon/Divide and Conquer/1992_쿼드트리.cpp | #include<iostream>
#include<set>
#include<vector>
#include<algorithm>
#include<string>
using namespace std;
int N;
char v[64][64];
int dx[4] = { 0, 1, 0, 1}, dy[4] = { 0, 0, 1, 1 };
vector<char> quad;
void go(int x, int y, int sz) {
bool isEqual = true;
for (int i = y; i < y+sz; i++) {
for (int j = x; j < x+sz; j... | ALGO | 0.999916 | 3.216053 |
ea7efb18-050c-4235-88ad-0b699b9aa5fd | Prikshit-anthal/45_DAY_DSA_QUESTIONS | binary_tree/13.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.999948 | 6.594463 |
f404f3f6-c803-4d87-9ae4-f6b1ffb3f02d | CadenChou/CompArchFinal | src/systemc/tests/systemc/examples/trie/trie.cpp | #include <stdio.h>
#include "systemc.h"
SC_MODULE(lc)
{
sc_out<bool> DIN_rdy;
sc_in<bool> DIN_vld;
#define LOAD_ADDR 0
#define LOAD_DATA 1
#define LOOKUP 2 // really op(1) == 1 and op(0) - don't care
sc_in<sc_uint<2> > DIN_op;
sc_in<sc_uint<32> > DIN_data_in;
sc_in<bool> DOUT_rdy;
sc_out<bool> DOUT_vld;
... | ALGO | 0.999626 | 4.281518 |
fcbe7f1c-ae40-4237-8eea-d5901d2b379c | Yang-Youngster/ROS | test_path/src/ego-planner-swarm/src/uav_simulator/so3_quadrotor_simulator/include/ode/libs/numeric/odeint/examples/harmonic_oscillator.cpp | #include <iostream>
#include <vector>
#include <boost/numeric/odeint.hpp>
//[ rhs_function
/* The type of container used to hold the state vector */
typedef std::vector< double > state_type;
const double gam = 0.15;
/* The rhs of x' = f(x) */
void harmonic_oscillator( const state_type &x , state_type &dxdt , const ... | ALGO | 0.999011 | 7.292909 |
b58545c2-e9ca-41d8-a3c5-cd96622b4465 | TheJacksonLab/ECG_LAMMPS | GPUSolver.cpp | #include "atom.h"
#include "comm.h"
#include "text_file_reader.h"
#include "error.h"
#include "domain.h"
#include "math_eigen_impl.h"
using namespace LAMMPS_NS;
#include "GPUSolver.h"
#include <cusolverDn.h>
#include <cuda_runtime.h>
#include <cusolver_common.h>
GPUSolver::GPUSolver()
{
fmt::print(stdout, "\n{}\... | ALGO | 0.999581 | 4.845819 |
5679cbe0-8354-47fb-b452-124c24b9baf3 | domwst/lol2019_solutions | day3.team_contest_1/A.turbulence/solution.cpp | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef long double ld;
#define int ll
#define pb push_back
#define kek pop_back
#define mp make_pair
#define pii pair<int, int>
#define all(v) v.begin(), v.end()
#define len(v) ((int)(v).size())
mt19937 rnd(chrono::high_resolution_clock::now().tim... | ALGO | 0.999992 | 3.687614 |
30508d7c-4cf6-4e57-9346-b673bc98858e | le-incroyable1-dev/dsa_archive | sar_phod_lo_apna_idhar/lc/biweekly89/6210.cpp | #include<bits/stdc++.h>
using namespace std;
#define mod 1000000007
#define pb push_back
#define mp make_pair
#define fi first
#define sec second
typedef long long ll;
typedef long double ld;
#define pii pair<ll,ll>
#define vi vector< ll >
#define vvi vector< vi >
#define vpi vector< pii >
#define vvpi vector< vpi >
#... | ALGO | 0.999858 | 4.529369 |
a358bbbb-58e7-4b00-89a3-00a6c8669681 | vitthalnamdev/icpc | A_Disjoint_Sets_Union.cpp | // Don't look the rank , if you want a good rank
#include<bits/stdc++.h>
using namespace std;
#define ll long long
#pragma GCC optimize("O3")
#pragma GCC target("avx,avx2,sse,sse2,sse3,sse4,popcnt,fma")
#pragma GCC optimize("unroll-loops")
////--------- DEBUG START---------////
#define debug(x) cerr << #x <<" "; _pr... | ALGO | 0.999933 | 5.540908 |
96a25eea-3d32-428c-82ff-31296847c6f4 | MarshallVielmetti/rob530-final-project | opencv/modules/features2d/src/blobdetector.cpp | #include "precomp.hpp"
#include <iterator>
#include <limits>
// Requires CMake flag: DEBUG_opencv_features2d=ON
//#define DEBUG_BLOB_DETECTOR
#ifdef DEBUG_BLOB_DETECTOR
#include "opencv2/highgui.hpp"
#endif
namespace cv
{
class CV_EXPORTS_W SimpleBlobDetectorImpl : public SimpleBlobDetector
{
public:
explicit Si... | TOOL | 0.954221 | 6.943884 |
80af9e71-9192-47eb-bb82-b0d402ecd9b7 | manhhung2111/LeetcodeGrind | Day 053/Problem 673. Number of Longest Increasing Subsequence.cpp | class Solution {
public:
int findNumberOfLIS(vector<int>& nums) {
vector<int> dp(nums.size(), 1);
vector<int> count(nums.size(), 0);
int lenLIS = 0, result = 0;
for (int i = nums.size() - 1; i >= 0; i--) {
int maxLen = 1, maxCnt = 1;
for (int j = i + 1; j < ... | ALGO | 0.999997 | 6.531524 |
df944f3b-92f7-49bf-9a4a-e08184979506 | Sarthak1322/DSA_Codes | Last_Occurance.cpp | /* a array is given and a element is given find out the last
occurance of the element in the array*/
#include <iostream>
using namespace std;
int lastOcc(int arr[], int n, int key){
int start =0;
int end=n-1;
int mid = start + (end-start)/2;
int ans =-1;
while(start<=end){
if(arr[mid] == k... | ALGO | 0.999853 | 5.290049 |
1e9a404a-a657-437f-8849-4b997a168938 | ImranMir32/Data_Structures_and_Algorithms | Tree Data Structures/All About Tree/BST/BST.cpp | #include <bits/stdc++.h>
using namespace std;
// Definition for a binary tree node.
struct TreeNode
{
int val;
int height;
TreeNode *left;
TreeNode *right;
TreeNode() : val(0), left(nullptr), right(nullptr) {}
TreeNode(int x) : val(x), left(nullptr), right(nullptr) {}
TreeNode(int x, TreeNo... | ALGO | 0.999988 | 6.291567 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.