uuid string | repo_name string | relative_path string | content string | category string | algo_rel_score float64 | quality_score float64 |
|---|---|---|---|---|---|---|
11ffdf23-1a5e-4418-aeb6-5a7ed11bc5d4 | unl-nimbus-lab/phys | data/steering_behaviors_controller/src/Seek.cpp | /**
* Project SteeringBehaviorsController
* @author JOSE Nahuel
* @version 1.0.0
*/
#include "Seek.h"
void Seek::odomCallback(const nav_msgs::Odometry::ConstPtr& odom)
{
x = odom->pose.pose.position.x;
y = odom->pose.pose.position.y;
tf::Pose pose;
tf::poseMsgToTF(odom->pose.pose, pose);
tita = tf::getYaw(po... | TOOL | 0.992842 | 4.126511 |
21ad728c-db58-4c9c-96e6-4fe7f222688a | Macw07/Macw07 | Algorithm/BinaryIndexedTree/T210444-0-1反转.cpp | #include <iostream>
using namespace std;
// 差分思想
int n, m;
int arr[100005];
int lowbit(int k){
return k & (-k);
}
void add(int pos, int k){
while(pos <= n){
arr[pos] += k;
pos += lowbit(pos);
}
return ;
}
int query(int pos){
int sum = 0;
while(pos){
sum += arr[pos];
... | ALGO | 0.999993 | 4.571849 |
eb9b36c0-eb57-4870-80a3-7ea985d5e98d | aanu2021/Leetcode-Solutions | 1110-delete-nodes-and-return-forest/1110-delete-nodes-and-return-forest.cpp | class Solution {
public:
unordered_set<int>S;
vector<TreeNode*>result;
void func(TreeNode* &root){
if(!root) return;
func(root->left);
func(root->right);
if(S.find(root->val) != S.end()){
if(root->left) result.push_back(root->left);
if(root->... | ALGO | 0.999799 | 6.272357 |
920d079f-9eae-4f84-9b81-f4db7be961fc | RegrowthStudios/Vorb-Deps | include/bullet/BulletCollision/BroadphaseCollision/btDbvtBroadphase.cpp | ///btDbvtBroadphase implementation by Nathanael Presson
#include "btDbvtBroadphase.h"
//
// Profiling
//
#if DBVT_BP_PROFILE||DBVT_BP_ENABLE_BENCHMARK
#include <stdio.h>
#endif
#if DBVT_BP_PROFILE
struct ProfileScope
{
__forceinline ProfileScope(btClock& clock,unsigned long& value) :
m_clock(&clock),m_value(&valu... | ALGO | 0.98931 | 7.084104 |
7171a378-4c3b-461f-ba98-cebb7be872b0 | Yash-Thakare22/DSA_Uplift_Project | Assignments/Solutions/Manika Joshi/Assignment2/Q3.cpp | #include <iostream>
using namespace std;
int main()
{
int n,temp;
cout<<"Enter number of elements";
cin>>n;
int a[n],arr[n];
for(int i=0;i<n;i++)
{
cin>>arr[i];
}
for (int i = 0; i < n-1; i++)
{
a[i+1]=arr[i];
}
a[0]=arr[n-1];
for (int i = 0; i < n ; i++... | ALGO | 0.99993 | 3.210441 |
f9a1060c-9c4b-404c-82eb-afb7cad414b1 | hajra40/Graph | graph.cpp | // #include<iostream>
// using namespace std;
#include<bits/stdc++.h>
using namespace std;
void addEdge(vector<int> G[],int u,int v)
{
G[u].push_back(v);
G[v].push_back(u);
}
void printGraph(vector<int> adj[], int V)
{
for(int v=0;v<V;++v)
{
cout<<"\nAdjacency of vertex "<<v<<" head\n";
... | ALGO | 0.999815 | 4.853858 |
0c1e35fe-6bca-4f7f-9d52-9ed06bfb8eac | bluewhitesheen/Leetcode | maximum-count-of-positive-integer-and-negative-integer/Accepted/1-8-2023, 10_33_06 AM/Solution.cpp | // https://leetcode.com/problems/maximum-count-of-positive-integer-and-negative-integer
class Solution {
public:
int maximumCount(vector<int>& nums) {
int a, b;
a = b = 0;
for(auto i: nums){
if(i < 0) a++;
if(i > 0) b++;
}
return max(a, b);
}
}; | ALGO | 0.999963 | 5.55709 |
33914b17-bb89-4ae3-b9d5-827c70995c30 | AnumoyMurmu/ds.algo.practice | Recursion/SumOfN.cpp | //Backtracking
#include<iostream>
using namespace std;
long long sum(int N)
{
if(N<1) return 1;
return (N*N*N + sum(N-1));
}
int main()
{
int N;
cin>>N;
sum(N);
return 0;
} | ALGO | 0.999957 | 3.703731 |
c9e2dec5-43f4-4b85-8a98-73d480d8e7c1 | ZhZhuang/demo_cpp_basic | LeetCode-Hot-100/dp/rob.cpp |
// 198. 打家劫舍
//dp[i]的含义:到第i间房间为止(考虑第i个房间),所偷的最大价值
#include <vector>
#include <iostream>
using namespace std;
class Solution {
public:
int rob(vector<int>& nums) {
int len = nums.size();
if(len==1)
return nums[0];
vector<int> dp(len, 0);
dp[0]=nums[0];
dp[1]= ... | ALGO | 0.999898 | 4.846755 |
5d0ab85d-ad54-4c03-a930-e83f67d7c85a | Cyprus-hy/PAT_Basic-level | 1054.cpp | #include<iostream>
using namespace std;
bool IsLeagal(char *c)//жַǷϷ
{
int flag = 1, point=0,count = 0,i=0;
if (c[0] == '-')//ʱֱһַ
i++;
for (; c[i] != '\0'; i++)
{
if ((c[i]<'0' || c[i]>'9') && c[i] != '.')//ַдֺСΪַ
{
flag = 0;
break;
}
else
{
if (point)//ͳСλ
count++;
if (c[i] == '... | ALGO | 0.996911 | 3.72757 |
8bf27062-3f69-44f7-800c-eb18306aedda | Nebula-Coin/nebula-project-coin | src/base58.cpp | #include "base58.h"
#include "hash.h"
#include "util/string.h"
#include "uint256.h"
#include <algorithm>
#include <assert.h>
#include <sstream>
#include <vector>
#include <limits>
/** All alphanumeric characters except for "0", "I", "O", and "l" */
static const char* pszBase58 = "123456789ABCDEFGHJKLMNPQRSTUVWXYZa... | TOOL | 0.923412 | 7.012411 |
d56b2fbd-29a0-4c06-9f07-99cac80f7272 | ruhul000/Competitive-Programming | 3. ACM.HDU.EDU.CN/1001_SUM_problem.cpp | #include <stdio.h>
int main()
{
long long SUM;
int num,i,T;
while((scanf("%d",&T))!=EOF)
{
//for(i=1; i<=T; i++)
{
scanf("%d",&num);
SUM = num * (num + 1)/2;
printf("%lld\n\n",SUM);
}
}
return 0;
}
/*#include<stdio.h>
long long n, sum... | ALGO | 0.998755 | 4.243401 |
82de217e-7ab4-42cd-83ad-26522a8efdc6 | ayushreeshende/MKPITS_DotNet_July_2023_Ayushree_Shende | c++/classrectangle.cpp | #include<iostream>
using namespace std;
class rectangle
{
public:
int length,breadth;
area()
{
float a=length*breadth;
return a;
}
float perimeter()
{
float perimeter=2*(length+breadth);
return perimeter;
}
};
int main()
{
float result;
rectangle r1;
cout<<"enter length and breadth";
cin>>r1.length>>r1.bread... | TOOL | 0.975466 | 3.643301 |
0742123a-e432-4ac0-8cb1-f8d5a154a71a | jjb5442/problemSolve | graph/1260.DFS_BFS.cpp | #include <iostream>
#include <deque>
#include <vector>
#include <algorithm>
using namespace std;
/*
problem website
https://www.acmicpc.net/problem/1260
*/
class Graph
{
private:
int size;
vector<deque<int>> adj;
public:
Graph(int size)
{
this->size = size;
adj.resize(size ... | ALGO | 0.999992 | 4.465659 |
b04440f2-c058-4be5-beb8-9300cf256189 | thaind/Android | Demos/Andengine/GLES2 /AndEnginePhysicsBox2DExtension-GLES2/jni/Box2D/Collision/b2Collision.cpp | #include "Box2D/Collision/b2Collision.h"
#include "Box2D/Collision/b2Distance.h"
void b2WorldManifold::Initialize(const b2Manifold* manifold,
const b2Transform& xfA, float32 radiusA,
const b2Transform& xfB, float32 radiusB)
{
if (manifold->pointCount == 0)
{
return;
}
switch (manifold->type)
{
... | ALGO | 0.999443 | 7.787594 |
1e7570c3-f0ca-4173-aef8-6b0f987f6fc7 | ToniusRetonius/AlgoIII | Prácticas/Práctica 1/14/sumaselectiva.cpp | #include <bits/stdc++.h>
using namespace std;
bool descendente(int a, int b){
return a > b;
}
int main(){
vector<int> conjunto = {2, 14, 5, 13, 9, 21, 25, 22, 7, 41, 1, 12, 31, 48, 4};
// k < #conjunto ==> k < 15
int k;
printf("Ingrese un valor para k, debe ser menor a 15: ");
scanf("%i"... | ALGO | 0.999863 | 3.689206 |
efc8f63f-f252-4cf1-9767-071ae0128229 | morsalin80/algo_DS | lightoj solve/lightoj 1048 - Conquering Keokradong.cpp | /// Bismillahir Rahmanir Rahim
/* Mohammad Morsalin
Dept of ICE, NSTU
*/
#include<bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
using namespace __gnu_pbds;
#define ll long long
#define pb push_back
#define mp make_pair
//#define endl "\n"
#define int long long
#define f... | ALGO | 0.999578 | 3.1047 |
30ac2b72-83f7-43b1-a732-d72bd7939991 | ashokabairwaideology/Leet-code-problem | solution/3200-3299/3205.Maximum Array Hopping Score I/Solution.cpp | class Solution {
public:
int maxScore(vector<int>& nums) {
int n = nums.size();
vector<int> f(n);
auto dfs = [&](auto&& dfs, int i) -> int {
if (f[i]) {
return f[i];
}
for (int j = i + 1; j < n; ++j) {
f[i] = max(f[i], (j - ... | ALGO | 0.999984 | 5.78806 |
e62753aa-daba-4da5-a1ea-24f6a2a953ac | Rajankumar9955/CPP-Programming | function/stringFuntion/StaticstringFunction/char_string/strng question/spacein@.cpp | #include<iostream>
#include<cstring>
using namespace std;
int main()
{
char str[]="all the best";
int l= strlen(str);
for(int i=0; i<l; ++i)
{
if(str[i]==' ')
{
str[i]='@';
}
}
cout<<str;
}
| ALGO | 0.990311 | 3.455402 |
0c68dfc9-9239-4456-8ed3-1de6a38385ba | baofuhann/FISCO_BCOS_FL | deps/src/boost/libs/numeric/ublas/doc/samples/matrix_column_project.cpp | #include <boost/numeric/ublas/matrix.hpp>
#include <boost/numeric/ublas/matrix_proxy.hpp>
#include <boost/numeric/ublas/io.hpp>
int main () {
using namespace boost::numeric::ublas;
matrix<double> m (3, 3);
for (unsigned j = 0; j < m.size2 (); ++ j) {
for (unsigned i = 0; i < m.size1 (); ++ i)
... | ALGO | 0.974613 | 3.302267 |
5cc299ef-c87c-4dc5-b141-ba17aff5fa21 | NameLessJedi/framework_base | media/libstagefright/codecs/m4v_h263/dec/src/pp_semaphore_chroma_inter.cpp | /*
------------------------------------------------------------------------------
INPUT AND OUTPUT DEFINITIONS
Inputs:
xpred = x-axis coordinate of the block used for prediction (int)
ypred = y-axis coordinate of the block used for prediction (int)
pp_dec_u = pointer to the post processing semaphore for ... | ALGO | 0.999391 | 6.569502 |
1ded092e-a312-4e63-92a1-400bb1e31ba9 | Storkycold/BOJ | 1013.cpp | #include <iostream>
#include <regex>
#include <string>
using namespace std;
void func(void)
{
string str;
cin >> str;
regex pattern("(100+1+|01)+");
cout << (regex_match(str, pattern) ? "YES" : "NO") << "\n";
}
int main()
{
cin.tie(NULL);
int tc;
cin >> tc;
for (int i = 0; i < tc; i+... | ALGO | 0.994774 | 4.637795 |
f4143668-b3a0-4abb-96e9-f3e91279a18d | kth4540/cpp_study | Ch_3/3-8/3-8/3-8.cpp | #include <iostream>
#include <bitset>
using namespace std;
int main()
{
// << left shift
// >> right shift
// ~(not), &(and), |(or), ^(xor)
unsigned int a = 3;
cout << bitset<4>(a) << endl;
unsigned int b = a << 4;
cout << bitset<4>(b) << endl;
cout << b << endl;
unsigned int x = 0b1100;
unsigned int y = 0... | ALGO | 0.990721 | 3.94955 |
7961e355-bf97-412d-89a8-8f13a96c28c9 | vasav-prashar/DSA-Leetcode | 1679-max-number-of-k-sum-pairs/1679-max-number-of-k-sum-pairs.cpp | class Solution {
public:
int maxOperations(vector<int>& nums, int k) {
int n=nums.size();
sort(nums.begin(),nums.end());
int i=0,j=n-1;
int count=0;
while(i<j){
if(nums[i]+nums[j]==k){
count++;
i++;
j--;
... | ALGO | 0.99996 | 6.110127 |
b392717c-9cfc-4a65-9bc4-5ca63a4c8fc6 | KhoiBui16/Fullhouse_Code_Online | C++/Source code/Buoi_28/Bai_03/SapXepDaySo.cpp | /*
C++ Buổi 28_Bài 03.Sắp xếp dãy số.
Cho bạn 1 file text có tên "inputNumber.txt" chứa không quá 100000 số nguyên không biết trước số lượng phần tử.Bạn hãy đọc mọi số trong File ra và ghi vào File có tên "outputNumber.txt" theo thứ tự tăng dần nhé.
Input Format:
Là 1 dãy số gồm các số nguyên có thể nằ... | ALGO | 0.999434 | 5.123337 |
74967d6a-189c-4365-9318-979155c0b955 | cledybs/Bio-Molecular_Computing | Nussinov/main.cpp | #include "nussinov.h"
int main() {
//string r = "GGAAAUCC";
string r = "ACUCGAUUCCGAG";
//vector<pair<char, char>> pairs = {{'G', 'C'}, {'A', 'U'}};
//vector<int> scores = {-1, -1};
vector<pair<char, char>> pairs = {{'G', 'C'}, {'A', 'U'}, {'G', 'U'}};
vector<int> scores = {-5, -4, -1};
Nu... | ALGO | 0.999736 | 4.372468 |
2befaa0c-e30f-4826-a339-1a6355e100d3 | km-parvez/CompetitiveProgramming | BFS_DFS/LightOj/riders.cpp | // Created by KHALED MOSHARRAF PARVEZ
#include <bits/stdc++.h>
#define db1(x) cout<<#x<<"="<<x<<'\n'
#define db2(x,y) cout<<#x<<"="<<x<<","<<#y<<"="<<y<<'\n'
#define db3(x,y,z) cout<<#x<<"="<<x<<","<<#y<<"="<<y<<","<<#z<<"="<<z<<'\n'
#define MAXX 12
using namespace std;
using ll = long long;
//(x+1, y+2), (x+1, y-2),... | ALGO | 0.999606 | 4.017159 |
f0860b18-d714-408b-a76d-860105408d40 | durgirajesh/Leetcode | Minimum Depth of Binary 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.999939 | 6.727697 |
d7992992-6189-461c-9e8d-8cc1a4994519 | jameskkk/UVCCamera | opencv_2.4.13.2/sources/modules/legacy/src/segment.cpp | #include "precomp.hpp"
typedef struct Seg
{
ushort y;
ushort l;
ushort r;
ushort Prevl;
ushort Prevr;
short fl;
}
Seg;
#define UP 1
#define DOWN -1
#define PUSH(Y,IL,IR,IPL,IPR,FL) { stack[StIn].y=(ushort)(Y); \
stack[StIn].l=(ushort)(IL); \
... | ALGO | 0.999324 | 4.534156 |
6b5d3faf-790c-442b-b142-487c145fd02c | whoiskhairul/c-plus-plus | smallest multiple.cpp | #include<bits/stdc++.h>
using namespace std;
int main()
{
int t,n;
cin>>t;
for(int j=0;j<t;j++)
{
cin>>n;
for(int i=2;i<=n;i++)
{
long long int sum=1,count=0;
sum=sum*i;
for(int k=1;k<n;k++)
{
if(sum%k!=0)
... | ALGO | 0.99993 | 4.380623 |
cb21cc23-fcfe-472c-a7fd-a47a4d69e024 | Eshan05/SemIII-Lab-SPPU | DSL/C/C19Old.cpp | // * Eshan Nahar
// 19. Department of Computer Engineering has student's club named 'Pinnacle
// Club'. Students of second, third and final year of department can be granted
// membership on request. Similarly one may cancel the membership of club. First
// node is reserved for president of club and last node is reserv... | ALGO | 0.999206 | 3.936242 |
1f547697-3fca-43a0-811f-00d9f04d5784 | carsprague/CUDA-CNN | Project/project/third_party/eigen/doc/examples/Tutorial_BlockOperations_block_assignment.cpp | #include <Eigen/Dense>
#include <iostream>
using namespace std;
using namespace Eigen;
int main()
{
Array22f m;
m << 1,2,
3,4;
Array44f a = Array44f::Constant(0.6);
cout << "Here is the array a:" << endl << a << endl << endl;
a.block<2,2>(1,1) = m;
cout << "Here is now a with m copied into its cent... | ALGO | 0.955182 | 3.331377 |
83ceb9e9-58db-4a84-8692-c42947343228 | MMSS9402/algorithm | ProblemSolving/mincode/level31/31-5.cpp | #include <iostream>
#include <vector>
#include <string>
using namespace std;
int n;
string tgt = "HITSMUSIC";
int cnt = 0;
int main(){
cin >> n;
string str[n];
for(int i=0;i<n;i++){
cin >> str[i];
}
for(int i=0;i<n-1;i++){
for(int j=i+1;j<n;j++){
string temp = str[i] + st... | ALGO | 0.999976 | 3.955197 |
b7a3303c-62df-41ba-b35a-1ada2a62584e | ishandutta2007/codeforces | ylwang/normal/1591/D.cpp | #include<bits/stdc++.h>
#define ll long long
#define pb push_back
#define mkp make_pair
#define vi vector<int>
#define pii pair<int,int>
#define SZ(x) ((int)x.size())
#define FI(n) FastIO::read(n)
#define FO(n) FastIO::write(n)
#define ull unsigned long long
#define mst(a,b) memset(a,b,sizeof(a))
#define foR(i,k,j) for... | ALGO | 0.999978 | 3.640509 |
d2547c68-bd53-4754-8f5d-984a4293bac9 | Yejin-Moon/algorithm | C++/Baekjoon/Problem17419.cpp | #include <iostream>
#include <string>
using namespace std;
int main()
{
int n;
cin>>n;
string s;
cin>>s;
int len = s.length();
int cnt=0;
for(int i=0; i<len; i++)
{
if(s[i]=='1') cnt++;
}
cout<<cnt;
} | ALGO | 0.99992 | 4.277468 |
a16697af-79bb-41a9-95d5-066ffc918d4b | raincross7/code-similarity | codes/train_code/problem026/problem026_118.cpp | #include <iostream>
using namespace std;
int main() {
int A, B;
cin >> A >> B;
int card[] = {13, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12};
if (card[A-1] == card[B-1]) {
cout << "Draw" << endl;
}
else if (card[A-1] > card[B-1]) {
cout << "Alice" << endl;
}
else {
cout << "Bob" << endl;
}
}... | ALGO | 0.999982 | 4.26056 |
ab6f84d4-0b8d-4fc5-aaf8-e9547cb29534 | 2023PHOENIX/100_day_of_DSA | Practise/fractionalKnapsack.cpp | #include <bits/stdc++.h>
using namespace std;
typedef long long int ll;
#define inf 1e9
#define INF 1e18
#define mod 10000007
#define MOD 1000000000
int *price;
int *weight;
int n;
int target;
double F(int tar, int i)
{
if(i>= n){
return 0;
}
if(target == 0){
return 0;
}
double i... | ALGO | 0.999945 | 4.732236 |
d27ec905-8458-457c-bddd-88be2995cb55 | Wsh7Ash/LEETCODE | cpp/c0-500/201-250/237.cpp |
// Definition for singly-linked list.
struct ListNode {
int val;
ListNode *next;
ListNode(int x) : val(x), next(nullptr) {}
};
class LinkedListSolution {
public:
void deleteNode(ListNode* node) {
if (node == nullptr || node->next == nullptr) return;
node->val = node->next->val;
... | ALGO | 0.999837 | 5.615242 |
4cdb1ba0-bcf1-4ba8-98a3-ab3cd261a8c0 | suhaas02/Data-structures-and-algorithms | Medium/Paths from root with a specified sum/paths-from-root-with-a-specified-sum.cpp | //{ Driver Code Starts
//Initial Template for C++
#include<bits/stdc++.h>
using namespace std;
// A Tree node
struct Node
{
int key;
struct Node *left, *right;
};
// Utility function to create a new node
Node* newNode(int key)
{
Node* temp = new Node;
temp->key = key;
temp->left = temp->right = NULL;
return (t... | ALGO | 0.999761 | 6.284723 |
52645548-7e26-417b-af5c-5d6b24a7ed58 | tashif-hoda/APS-2020 | fibonacci_sum_squares.cpp | #include <iostream>
int fibonacci_sum_squares_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 =... | ALGO | 0.999928 | 4.632852 |
cd2a2a24-da5e-43cd-b915-a131affe56af | 113bommy/deepmind_codecontests_refine | cpp_gold_filter_file/cpp_train_2237_5.cpp | #include <bits/stdc++.h>
using namespace std;
char s[21][21];
pair<string, int> c[10005];
vector<string> v;
int n, m, x, y, k = 0;
void f(int x1, int y1, int x2, int y2) {
string r = "", d = "";
for (int i = x1; i < x2; i++)
for (int j = y1; j < y2; j++) r += s[i][j];
for (int i = x2 - 1; i >= x1; i--)
fo... | ALGO | 0.99986 | 3.167443 |
d2acfeba-13b6-4a0d-a6cf-255e0b3952e0 | Legends-of-Azeroth/legion-Nordrassil-core | src/server/scripts/Pandaria/SiegeofOrgrimmar/boss_siegecrafter_blackfuse.cpp | #include "siege_of_orgrimmar.h"
#include "PlayerDefines.h"
enum eSpells
{
//Blackfuse
SPELL_ELECTROSTATIC_CHARGE = 143385,
SPELL_AUTOMATIC_REPAIR_BEAM_AT = 144212,
SPELL_AUTOMATIC_REPAIR_BEAM = 144213,
SPELL_LAUNCH_SAWBLADE = 143265,
SPELL_LAUNCH_SAWBLADE_AT = 143329,... | TOOL | 0.858665 | 3.321815 |
122960b2-1307-41c5-a2bf-b2d2f1e902a7 | DefinitelyBak/Algorithms | Algorithm/Sort/Source/MergeSort.cpp | #include "Sort/Include/MergeSort.h"
namespace Algorithm::Sort
{
void MergeSort(std::span<int> arr, std::vector<int>& buffer)
{
if (arr.size() <= 1)
return;
size_t med = arr.size() / 2;
auto left = arr.subspan(0, med);
auto right = arr.subspan(med);
... | ALGO | 0.999957 | 6.106522 |
1213c6c3-5187-4959-b737-f5ec55a70ca7 | donmasha/pra-gemastik-14-itb | d-jumlah-digit/solution.cpp | #include <bits/stdc++.h>
using namespace std;
const long long M = 1e9 + 7;
const int N = 22;
const int K = 10;
long long dp[N][(1 << K)][2];
long long dps[N][(1 << K)][2];
long long solve(const string& val, int p, int q) {
int len = val.size();
for (int i = 0; i <= len; i++) {
for (int mask = 0; mas... | ALGO | 0.999922 | 4.881053 |
3dc5f4cb-8493-4ae6-a107-6a06b19b24c4 | oilover/ACM-Template | DataStructure/堆.cpp | #include <bits/stdc++.h>
using namespace std;
#define prt(k) cerr<<#k" = "<<k<<endl
const int N = 2333;
int len; // array
int size; //heap
int A[N];
#define lson (i<<1)
#define rson (i<<1|1)
void sink(int i) // da gen dui
{
int id = i;
if (lson<=size && A[lson]>A[id]) id = lson;
if (rson<=siz... | ALGO | 0.999812 | 4.05617 |
7502c26b-ef38-434b-8d8d-7f2173a0cc51 | deepam20050/competitive-programming | solutions/CF813B.cpp | // AC
#include "bits/stdc++.h"
using namespace std;
#define sz(x) int((x).size())
#define all(x) begin(x), end(x)
#define pb push_back
#define eb emplace_back
#define mp make_pair
#define F first
#define S second
#define FOR(i, a, b) for (int i = (a); i < (b); ++i)
using lli = long long;
using pii = pair < int, int >... | ALGO | 0.999967 | 3.824472 |
6d33d892-3e1b-47a0-bbb5-162c535e227b | Ujjval-dargar/Leetcode_Logs | 0120-triangle/0120-triangle.cpp | class Solution {
public:
int minimumTotal(vector<vector<int>>& triangle) {
int m = triangle.size();
vector<vector<int>> dp = triangle;
for (int i = 1; i < m; ++i) {
int n = triangle[i].size();
dp[i][0] = dp[i][0] + dp[i - 1][0];
dp[i][n - 1] = dp[i][n - 1... | ALGO | 0.999943 | 6.219442 |
ed114806-e1dc-4651-8b75-d2158d8c8a9c | Pritanjan/LeetCode-2.0 | Binary Modulo - GFG/binary-modulo.cpp | //{ Driver Code Starts
//Initial Template for C++
#include<bits/stdc++.h>
using namespace std;
// } Driver Code Ends
//User function Template for C++
class Solution{
public:
int modulo(string s,int m)
{
int x = 0;
for(int i=0;i<s.length();i++)
{
... | ALGO | 0.999753 | 5.997377 |
588cfe4d-8e19-41e7-943e-b2ed9cedb3bd | aGatovski/Introduction-To-Programming- | UP_Homework_1/01. Number of Devisors.cpp | #include <iostream>
using namespace std;
int specialPair = 0;
int numberOfDevisors(int n) {
int countDevisors = 0;
for (int i = 1; i <= n/2; i++)
{
if (n % i == 0) countDevisors++;
}
return countDevisors+1;
}
bool isSpecialPair(int k, int divisorsX, int divisorsY, int x, int y) {
if (k * divisorsX * divisors... | ALGO | 0.999731 | 4.331051 |
4f967459-bb7c-4dc0-bb22-295b576c69db | ishandutta2007/codeforces | kmjp/normal/1110/A.cpp | #include <bits/stdc++.h>
using namespace std;
typedef signed long long ll;
#undef _P
#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 ITR(x,c) for(__typeof(c.begin()) x=c.begin();x!=c.end();x++)
#define ALL(a) (a.begin()),(a.end())
#define ZER... | ALGO | 0.999969 | 3.903829 |
2a6f292a-170a-4544-934b-e028ee71ecaf | markoelez/leetcode_ml | ds/groups-of-strings.cpp | // Time: O(26 * n)
// Space: O(26 * n)
// bitmasks, union find
class Solution {
public:
vector<int> groupStrings(vector<string>& words) {
UnionFind uf(size(words));
unordered_map<int, int> lookup;
for (int i = 0; i < size(words); ++i) {
const int mask = accumulate(cbegin(words[... | ALGO | 0.999529 | 6.144305 |
75dab8b2-7eca-460e-a691-8ba495bb2ca1 | zonca/potential_fitting_stale | fitting/3B/h2oh2ox/src/electrostatics.cpp | #include <cmath>
#include <cassert>
#include <algorithm>
#include <stdexcept>
#include "constants.h"
#include "electrostatics.h"
#define DEBUG yes
#ifdef DEBUG
# include <iomanip>
# include <iostream>
#endif // DEBUG
#define CHOLESKY yes
const double DEBYE = constants::DEBYE;
const double CHARGECON = constants:... | ALGO | 0.998467 | 5.124098 |
b2b87199-6935-42ca-a46a-ef264c061fe3 | kashish0201/ShapeAI_DSA | Q2.cpp | // Q2. Write a program to find the largest number among three numbers entered by the user.
#include <iostream>
using namespace std;
int main() {
float n1, n2, n3;
cout << "Enter three numbers: ";
cin >> n1 >> n2 >> n3;
if((n1 >= n2) && (n1 >= n3))
cout << "Largest number: " << n1;
else i... | ALGO | 0.999323 | 3.84006 |
3a87279a-be4f-4115-991c-d56b5adfd5c8 | StyleList94/problem-solving | baekjoon/1181.cpp | #include<iostream>
#include<algorithm>
#include<string>
#include<vector>
using namespace std;
bool compare(const string &s1, const string &s2)
{
if (s1.size() == s2.size())
return s1 < s2;
return s1.size() < s2.size();
}
int main(void)
{
vector<string> data;
int N;
string str;
cin >> N;
for (int i = 0; i < ... | ALGO | 0.999873 | 4.605489 |
69766360-e8ca-478c-ac06-ae5cfe4fe70d | raincross7/code-similarity | codes/train_code/problem091/problem091_60.cpp | #include <bits/stdc++.h>
using namespace std;
int main() {
const int INF = 1e9;
int K;
cin >> K;
vector<int> d(K, INF);
d[1] = 0;
deque<int> que;
que.push_front(1);
while (!que.empty()) {
int from = que.front();
que.pop_front();
int to1 = (from + 1) % K;
int to10 = (from * 10) % K;
if (d[to1] >... | ALGO | 0.99988 | 3.820788 |
3e18acba-d6b1-4567-a35e-0e1285f88044 | NikitaUssyukin/PP1_2024_Summer | Practices/G3/Week2/P2/Lab3/e.cpp | #include <iostream>
using namespace std;
int main() {
int n;
cin >> n;
int a[n];
for(int i = 0; i < n; i += 1) {
cin >> a[i];
}
long long sum = 0;
for(int i = 0; i < n; i += 1) {
sum += a[i];
}
cout << sum << endl;
return 0;
}
| ALGO | 0.999724 | 4.166102 |
e06abf66-94e8-4b8a-b2dc-2900c3608822 | p-podsiadly/llvm-stm8 | libcxx/test/std/algorithms/alg.sorting/alg.set.operations/set.difference/set_difference_comp.pass.cpp | // <algorithm>
// template<InputIterator InIter1, InputIterator InIter2, typename OutIter,
// CopyConstructible Compare>
// requires OutputIterator<OutIter, InIter1::reference>
// && OutputIterator<OutIter, InIter2::reference>
// && Predicate<Compare, InIter1::value_type, InIter2::value_type... | TEST | 0.913756 | 6.845963 |
52e5bb6a-377e-4eeb-93cc-dbe19b0e03b0 | thuantran2704/leetcode_grind | 402.cpp | #include <iostream>
#include <string>
using namespace std;
class Solution {
public:
string removeKdigits(string num, int k) {
string result;
int keep = num.size() - k; // The final length of the number
for (char digit : num) {
// Maintain a monotonically increasing se... | ALGO | 0.999882 | 7.224917 |
96fb908c-e135-4cbc-941f-ce0d612dcdaa | nikita-1910/DSA-450 | find_min_and_max_value_in_a_bst.cpp | #include<bits/stdc++.h>
using namespace std;
struct node{
int data;
node *left, *right;
node(int x){
data=x;
left=right=NULL;
}
};
node* insert(node* root, int x){
if (root==NULL){
return new node(x);
}
if (root->data>x){
root->left=insert(root->left,x);
... | ALGO | 0.999947 | 4.346359 |
b2db866c-5527-4a47-98ba-f37bdbcfbbdf | ObeWan99/SkillBoxCplus | module17/main1.cpp | #include <iostream>
using namespace std;
void swap(int* pa, int* pb){
int temp = *pa;
*pa = *pb;
*pb = temp;
}
int main(){
int a{10};
int b{20};
swap(&a, &b);
cout << a << " " << b << endl;
} | ALGO | 0.999235 | 4.318758 |
16005985-eceb-49ae-8c0d-4fae836f6eea | Ark2307/LeetHub | 279-perfect-squares/279-perfect-squares.cpp | class Solution {
public:
int numSquares(int n) {
vector<int> coins ;
int c = 1 ;
while(c <= 100){
coins.push_back(c * c) ;
c++ ;
}
int dp[n + 1] ;
dp[0] = 0 ;
for(int i = 1 ; i <= n ; i++)
dp[i] = i ;
... | ALGO | 0.999955 | 5.404478 |
96ef67ef-e53e-4abf-abc7-809faf7b5379 | wuxinrantj/Coding | LeetCode/119.杨辉三角-ii/test.cpp |
#include <iostream>
#include <vector>
using namespace std;
class Solution {
public:
vector<int> getRow(int rowIndex) {
vector<int> res(rowIndex + 1, 1);
for(int i = 0; i <= rowIndex; ++i) {
for(int j = i; j > 1; --j) {
res[j - 1] = res[j - 2] + res[j - 1];
... | ALGO | 0.999788 | 5.0172 |
c75f9805-4290-4e7b-9e41-ca64e2fc4e72 | amit77t/CPP-Problems | basic_maths/armstrong.cpp | #include<iostream>
using namespace std;
int main()
{
int n,n1, sum=0;
cout<< "enter the number"<<endl;
cin>>n;
n1=n;
while(n!=0)
{
int r=n%10;
sum=sum+r*r*r;
n=n/10;
}
if(n1==sum)
{
cout<<"Yes it is an armstrong number";
... | ALGO | 0.999885 | 3.915135 |
4a1938dd-a08e-4064-bf86-a38cd11fdbc8 | rishabh27goel/DSA-Extra-Questions | Leetcode/Redundant Connection.cpp | #include <vector>
#include <iostream>
using namespace std;
class Solution {
public:
int findParent(int node, vector<int> &parent) {
if(parent[node] == node)
return parent[node];
return parent[node] = findParent(parent[node], parent);
}
vector<int> findRedundantConnection(vecto... | ALGO | 0.999823 | 5.129011 |
ee233454-1578-45b3-9828-ab9a82040343 | Squ1z-dev/LibraromeWork | SortArrDown.cpp | #include "ArrayFunc.h"
#include <iostream>
void sortArrDown(int mass[], int size) {
for (int i = 0; i < size - 1; i++) {
for (int j = 0; j < size - i - 1; j++) {
if (mass[j+1] > mass[j]) {
int temp = mass[j];
mass[j] = mass[j + 1];
mass[j + 1] = temp;
}
}
}
std::cout << "Sorted array Falling... | ALGO | 0.998993 | 4.276055 |
4ba92179-ba4d-4ac7-b534-b880183f6f50 | Arnarkari93/AFLV | PROBLEM SET 04/Natjecanje/natjecanje.cpp | #include <iostream>
#include <cstdlib>
#include <vector>
#include <algorithm>
using namespace std;
int main()
{
cin.sync_with_stdio(false);
cout.sync_with_stdio(false);
int N, S, R;
cin >> N >> S >> R;
bool d[N]; // who has damaged boat
bool e[N]; // who has extra boad
for (int i = 0; i < N; ++i) {
d[i]... | ALGO | 0.999627 | 3.378329 |
9ed66f45-163f-4335-b3f5-54b302aa84a2 | mvg01/ps | baekjoon cpp/01043(union_find).cpp | #include <iostream>
#include <vector>
using namespace std;
int n, m, s;
int parent[51];
vector<int>p[51];
int getParent(int x) {
if (x == parent[x])
return x;
else
return parent[x] = getParent(parent[x]); // 효율적인 경로 압축
}
void set_union(int x, int y) {
int r1 = getParent(x);
int r2 = ... | ALGO | 0.999693 | 4.180964 |
4d196a9c-8d1c-4235-8202-2049c4e71e97 | AnshRiteshSavadatti/-DSA-with-cpp | Graphs/GraphRepresentationList.cpp | #include <iostream>
#include <vector>
using namespace std;
int main(){
int n, m;
cin >> n >> m;
vector<vector<int>> adj(n+1);
for(int i =0; i < m; i++){
int u, v;
cin >>u >> v;
// for non directed graph
adj[u].push_back(v);
adj[v].push_back(u);
}
retu... | ALGO | 0.999902 | 4.512387 |
877e1dda-1046-4ddb-98b2-2bd9389efe62 | Leanbow1708/Competetive-Programming | Arrays/Three Way Partitioning.cpp | #include<bits/stdc++.h>
using namespace std;
vector<int> fun(vector<int> arr,int a,int b)
{
int pos_a=0;
int pos_b=0;
int n = arr.size();
int i =0;
int j = 0;
while(j < n)
{
if(arr[j] < a)
{
pos_a++;
swap(arr[i],arr[j]);
i++;
}
... | ALGO | 0.999977 | 3.123333 |
28a89361-64c6-4abf-b3e5-6aba26829c40 | lukasp-dev/DSA | 0344-reverse-string/0344-reverse-string.cpp | class Solution {
public:
void reverseString(vector<char>& s) {
int l=0, r=s.size()-1;
while(l<=r){
swap(s[l], s[r]);
l++; r--;
}
}
}; | ALGO | 0.999472 | 6.257545 |
ffec3751-995b-4b3b-889f-62dc7b48ee95 | Arshjeet-Singh/Strivers-SDE-Sheet-Challenge | Implement Trie.cpp | /*
Your Trie object will be instantiated and called as such:
Trie* obj = new Trie();
obj->insert(word);
bool check2 = obj->search(word);
bool check3 = obj->startsWith(prefix);
*/
class TrieNode{
public:
char data;
TrieNode *children[26];
bool isTerminal;
TrieNode(char ch)
{... | ALGO | 0.999881 | 6.017039 |
15022f61-f714-4740-a903-3aa3bdb688de | geez6572/leetcode | cpp/easy/IslandPerimeter.cpp | #include <vector>
using namespace std;
int count_len(vector<vector<int>> &grid, int x, int y) {
int rs = 4;
if (x - 1 >= 0 && grid[x - 1][y]) {
rs--;
}
if (x + 1 < grid[0].size() && grid[x + 1][y]) {
rs--;
}
if (y - 1 >= 0 && grid[x][y - 1]) {
rs--;
}
if (y + 1 < grid.size() && grid[x][y + ... | ALGO | 0.999669 | 5.8228 |
817e057a-00e2-4510-a7f9-5f7736f0ac20 | ishandutta2007/codeforces | sfiction/normal/702/E.cpp | #include <cstdio>
#include <algorithm>
#include <utility>
#define st first
#define nd second
using namespace std;
typedef long long ll;
typedef pair<int, int> PII;
typedef pair<ll, PII> PLP;
const int MAXN = 1E5 + 10;
PLP dp[2][MAXN], ans[MAXN];
PLP merge(const PLP &a, const PLP &b){
return PLP(a.st + b.st, PII(... | ALGO | 0.999828 | 3.156447 |
d2f25c26-9573-4518-be59-4a57b9acb615 | ChrisBove/RBE2001 | archive_2001/main_brain/drive_train.cpp | /**
********************************************************************************************************
* @file drive_train.cpp
* @brief drive train control methods
* @details Used to control the drivetrain, turn, etc.
**************************************************************************************... | TOOL | 0.948097 | 5.511726 |
2244e002-749c-41b1-b427-e525972b6f83 | zhumj/Android_Native_Surface | my_android_opencv/3rdparty/carotene/src/bitwise.cpp | #include "common.hpp"
#include "vtransform.hpp"
namespace CAROTENE_NS {
#ifdef CAROTENE_NEON
struct BitwiseAnd
{
typedef u8 type;
void operator() (const uint8x16_t & v_src0, const uint8x16_t & v_src1,
uint8x16_t & v_dst) const
{
v_dst = vandq_u8(v_src0, v_src1);
}
v... | TOOL | 0.980331 | 6.675715 |
74f69bb0-48d6-4ded-9804-5fd6876067df | pro-vider/SdeSheetChallenge | Linkedlist & Array/cloneRandomList.cpp | #Link-https://www.codingninjas.com/codestudio/problems/873376?topList=striver-sde-sheet-problems&utm_source=striver&utm_medium=website&leftPanelTab=0
#include <bits/stdc++.h>
/*************************************************************
Following is the LinkedListNode class structure
template <typename T> ... | ALGO | 0.992313 | 4.890269 |
2731d8e3-ceeb-4c16-abef-43a3585c1ec1 | dhirajpatil2346/compitative | STL Course/STL4.cpp | #include<bits/stdc++.h>
using namespace std;
int main(){
vector<int> v = {2,3,5,6,7};
for (int i = 0; i < v.size(); i++)
{
cout<<v[i]<<" ";
}
cout<<endl;
// vector<int> ::iterator it = v.begin();
// for (it = v.begin(); it != v.end(); ++it)
// {
// /* code */
// ... | ALGO | 0.972259 | 3.319887 |
b0b96982-4823-4cd2-94f0-46dac84f4b01 | Khairul-Anam-Mubin/Codeforces-Solutions | Contest/Codeforces Round #479 (Div. 3)/C - Less or Equal.cpp | /***
** Author: Khairul Anam Mubin
** Bangladesh University of Business and Technology,
** Dept. of CSE.
***/
#include <bits/stdc++.h>
using namespace std;
#define F first
#define S second
#define PB push_back
#define MP make_pair
#define Fin freopen(... | ALGO | 0.999989 | 3.82444 |
5f8c7309-0a0a-472a-ba6a-4d6af465870c | vishnujayvel/practicecodes | spoj/hackingrandomnumber.cpp | #include<iostream>
#include<algorithm>
using namespace std;
int main(){
int n,k;
cin>>n;
int arr[n];
for(int i=0;i<n;i++)
cin>>arr[i];
sort(arr,arr+n);
int count=0;
for(int i=0;i<n;i++)
if(binary_search(arr,arr+n,arr[i]+k))
count++;
cout<<count;
}
| ALGO | 0.999762 | 3.902618 |
d19342ca-83f0-4d8c-a533-05a1bcfb8eda | rudraxx/CarND-Capstone_TeamFlintstones | CarND-Capstone/ros/src/waypoint_follower/src/pure_pursuit_core.cpp | #include "ros/ros.h"
#include "pure_pursuit_core.h"
namespace waypoint_follower
{
void PurePursuit::callbackFromCurrentPose(const geometry_msgs::PoseStampedConstPtr &msg)
{
current_pose_.header = msg->header;
current_pose_.pose = msg->pose;
pose_set_ = true;
}//processing frequency
void PurePursuit::callbackFr... | ALGO | 0.995306 | 4.64271 |
3ef43063-e734-47a8-a09d-f7d39cd09044 | Protocol-Nine/csc212-lab6 | gcd_finder.cpp | #include <iostream>
int gcd_finder(int a, int b);
int main(int argc, char*argv[]) {
int a, b;
// Set a as the larger of the two operands
if (std::stoi(argv[1]) >= std::stoi(argv[2])) {
a = std::stoi(argv[1]);
b = std::stoi(argv[2]);
} else {
a = std::stoi(argv[2]);
b =... | ALGO | 0.997248 | 5.838923 |
9ed4f53a-62c3-4adb-893c-76b636ad1b11 | nenuon/CompetitiveProgramming | Atcoder/ARC019/A.cpp | #include <algorithm>
#include <cstdio>
#include <iostream>
#include <map>
#include <cmath>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <string>
#include <vector>
#include <stdlib.h>
#include <stdio.h>
#include <bitset>
#include <cstring>
using namespace std;
#define FOR(I,A,B) for(int I... | ALGO | 0.993173 | 3.63224 |
ba218663-85d5-402d-93d6-c0ecbfc50b29 | mdmohidulislammi/Learning | Data structure/Module_9 doubly linked list/doubly_linked_list.cpp | #include<bits/stdc++.h>
using namespace std;
class Node
{
public:
int value;
Node* next;
Node * prev;
Node(int value)
{
this->value=value;
this->next=NULL;
this->prev=NULL;
}
};
void print(Node*head, Node*b)
{
Node*tmp=head;
Node* tmp1=b;
while(tmp!=NULL)... | ALGO | 0.998178 | 3.522808 |
528e0d55-b869-4950-ba2b-cc4733a2fea5 | SockSock/codeforces-solutions | coin_games_1972B.cpp | #include <cmath>
#include <iostream>
using namespace std;
int main() {
int t;
cin >> t;
while (t--) {
int n;
string s;
cin >> n;
cin >> s;
int count = 0;
for (int i = 0; i < n; ++i) {
if (s[i] == 'U') {
count++;
}
... | ALGO | 0.999927 | 5.807709 |
868d4dc9-207a-4818-a13f-198320f969c5 | manmandh/BTDatra | ex28.cpp | #include<bits/stdc++.h>
using namespace std;
int main(){
int a[100];
int n; cin >> n;
for(int i=0;i<n;i++){
cin >> a[i];
}
for(int i=0; i<n;i++){
cout << a[i] << endl;
}
} | ALGO | 0.994782 | 3.038517 |
12ce7c6b-79b7-434e-957e-0be7dcb5147a | das-ankur/Daily-Problem-Solving | Check whether K-th bit is set or not - GFG/check-whether-kth-bit-is-set-or-not.cpp | //{ Driver Code Starts
//Initial Template for C++
#include <bits/stdc++.h>
using namespace std;
// } Driver Code Ends
//User function Template for C++
class Solution
{
public:
// Function to check if Kth bit is set or not.
bool checkKthBit(int n, int k)
{
// Your code here
// It can b... | ALGO | 0.99892 | 5.957004 |
25607eac-5351-4b34-89ce-dccb2ea1bf59 | nishchyapratapsingh/leetcode-problems | 0142-linked-list-cycle-ii/0142-linked-list-cycle-ii.cpp | /**
* Definition for singly-linked list.
* struct ListNode {
* int val;
* ListNode *next;
* ListNode(int x) : val(x), next(NULL) {}
* };
*/
class Solution {
public:
ListNode *detectCycle(ListNode *head) {
ListNode* slow = head;
ListNode* fast = head;
while (fast && fast->... | ALGO | 0.999964 | 5.591073 |
431a1651-eb0d-4b09-a144-8e851f07b544 | GridOPTICS/GridPACK | src/applications/examples/powerflow/pf_app.cpp | // -------------------------------------------------------------
/**
* @file pf_app.cpp
* @author Bruce Palmer
* @date 2014-01-28 11:39:16 d3g096
*
* @brief
*
*
*/
// -------------------------------------------------------------
#include "gridpack/include/gridpack.hpp"
#include "pf_app.hpp"
#include "... | ALGO | 0.960211 | 5.953628 |
22e4f228-9074-4aed-aea4-f8131f09fc54 | ishandutta2007/codeforces | fateice/normal/1292/D.cpp | #include<bits/stdc++.h>
#define L long long
#define vi vector<int>
#define pb push_back
using namespace std;
int n,m,w[10010],a[5010],x[5010],s,f[10010],h[10010],p;
vi b[10010];
L ans;
inline void dp(int i)
{
for(auto j:b[i])
{
dp(j);
w[i]+=w[j];
}
}
int main()
{
//freopen(".in","r",stdin... | ALGO | 0.999986 | 3.332772 |
9c827305-9dbf-4a68-82da-2399d2e6bf60 | ishandutta2007/codeforces | tropical_maid/normal/1242/C.cpp | #include <bits/stdc++.h>
#define fs first
#define se second
#define y0 qwertyuiop
#define y1 asdfghjkl
/*
Author : Tropical_maid
Created : 2019/11/07, 00:22:09
*/
using namespace std;
typedef long long llong;
typedef long double ld;
typedef pair<int, int> pii;
typedef pair<llong, llong> pll;
int k;
vector<int> A[20]... | ALGO | 0.999997 | 3.515782 |
4eb39a65-e8da-4110-bf93-745ebca49a60 | immortalmin/ZOJ | 2104.cpp | #include<iostream>
#include<vector>
#include<string>
#include<algorithm>
using namespace std;
struct Info
{
string aa;
int bb;
}info;
bool myComp(const Info&info1,const Info&info2)
{
return info1.bb>info2.bb;
}
vector<Info>v;
int main()
{
int n;
string s;
while(cin>>n)
{
v.clear();
info.aa="abc";
info.bb... | ALGO | 0.999446 | 3.659231 |
f3fe4dfc-4606-4514-b31d-8e9418e9f965 | zhumingxuan2013/learning | 题库/2023年7月月赛(1).cpp | #include<iostream>
#include<cstring>
#include<algorithm>
#include<map>
using namespace std;
string multi(string a1, string b1){
char s1[a1.size()],s2[b1.size()];
int a[a1.size()],b[b1.size()],c[a1.size()+b1.size()+1];
int lena,lenb,lenc,w,jinWei;
memset(a, 0, sizeof(a));
memset(b, 0, sizeof(b));
memset(c, 0, siz... | ALGO | 0.99995 | 4.161824 |
ad506118-b8a5-4781-b1e0-6a5de688bd53 | boom8866/WOTLK | src/server/scripts/Outland/TempestKeep/arcatraz/boss_wrath_scryer_soccothrates.cpp | /*
REWRITTEN BY XINEF
*/
#include "ScriptMgr.h"
#include "ScriptedCreature.h"
#include "arcatraz.h"
enum Say
{
// Wrath-Scryer Soccothrates
SAY_AGGRO = 1,
SAY_SLAY = 2,
SAY_KNOCK_AWAY = 3,
SAY_DEATH = 4,
SAY_DA... | TOOL | 0.923352 | 5.919293 |
ca987d68-ab04-4bce-aebe-43ba01c8f9b0 | pnisarg/snooker | ballDetect.cpp | #include "ballDetect.h"
#include <string>
using namespace std;
using namespace cv;
String ballTag[] = {"Red","White","Black","Blue","Yellow","Pink", "Brown", "Green"};
ballDetect :: ballDetect(){
minval = new Scalar[8];
maxval = new Scalar[8];
//minimum threshold values
//red
minval[0] = Scalar(0,... | TOOL | 0.987471 | 4.992056 |
fc5884c2-165a-4d55-bf43-6f2538087113 | manankhaldwa/Leetcode_Questions | 263-ugly-number/ugly-number.cpp | class Solution {
public:
bool isUgly(int n) {
while(n>1){
if(n%2==0)
n/=2;
else if(n%3==0)
n/=3;
else if(n%5==0)
n/=5;
else
break;
}
return n == 1;
}
}; | ALGO | 0.99993 | 5.887097 |
89d67e0c-4330-4563-b6d0-be6e84700ce9 | sambhav228/Data_Structure_Algorithm | CodeChef/CHEFNUM.cpp | #include <cstdio>
#include <cstring>
using namespace std;
#define MOD 1000000007
int memo[10][1 << 16][2][1 << 4],val[1 << 16];
int nd,d[10];
void conv(int x){
if(x == 0){
nd = 1;
d[0] = 0;
}else{
nd = 0;
while(x > 0){
d[nd++] = x % 10;
x /= 10;
... | ALGO | 0.999899 | 3.965343 |
d4d59182-e005-4467-b9b1-363ad1d70173 | luyaohan1001/LeetCode | 83-remove-duplicates-from-sorted-list/src/main.cpp | #include <iostream>
/**
* 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:... | ALGO | 0.99947 | 5.932168 |
87cda2ec-0331-484f-963f-24b6266ea6fe | LeoHsuProgrammingLab/CodeForces | 1535c_complete.cpp | #include<iostream>
#include<string>
#include<vector>
using namespace std;
// void print_v(vector< vector<int> > fg){
// int size = fg.size();
// for(int i = 0; i<size; i++){
// for(int j = 0; j<fg[i].size(); j++){
// cout<<fg[i][j]<<' ';
// }
// cout<<'\n';
// }
// }
in... | ALGO | 0.999775 | 3.526845 |
14e63aa9-c4d3-428e-9366-c60d7b4d332f | SravaniSolasa/Existing | snippets/cpp/VS_Snippets_CLR_System/system.Collections.Specialized.BitVector32_Sections/CPP/bitvector32_sections.cpp | // The following code example uses a BitVector32 as a collection of sections.
// <snippet1>
#using <system.dll>
using namespace System;
using namespace System::Collections::Specialized;
int main()
{
// Creates and initializes a BitVector32.
BitVector32 myBV(0);
// Creates four sections in the BitVector32 wi... | TOOL | 0.884278 | 3.491501 |
355a89f8-9848-40c3-b4cf-fbbdb6e6628e | AsrarTamim/CPP | cses/Dice_Combinations.cpp | #include<bits/stdc++.h>
using namespace std;
const int N = 1e6 + 9, mod = 1e9 + 7;
int ways[N];
int n;
int count(int n) {
if (n == 0) return 1;
if(n < 0) return 0;
if (ways[n] != -1) return ways[n];
int ans = 0;
for (int i = 1; i <= 6; i++) {
ans += count(n - i);
ans %= mod;
}
return ways[n] = a... | ALGO | 0.999981 | 4.929881 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.