uuid string | repo_name string | relative_path string | content string | category string | algo_rel_score float64 | quality_score float64 |
|---|---|---|---|---|---|---|
6ccba39c-190f-4e4b-8e10-24e1201ffa84 | albee/rattle-iros-2022 | rattle_rrt/bullet3/src/BulletCollision/CollisionDispatch/btBoxBoxDetector.cpp | ///ODE box-box collision detection is adapted to work with Bullet
#include "btBoxBoxDetector.h"
#include "BulletCollision/CollisionShapes/btBoxShape.h"
#include <float.h>
#include <string.h>
btBoxBoxDetector::btBoxBoxDetector(const btBoxShape* box1, const btBoxShape* box2)
: m_box1(box1),
m_box2(box2)
{
}
// gi... | ALGO | 0.999674 | 6.694864 |
4b42c997-b2b0-4b5e-b106-29a099e51f5a | xodn0802/codetree-TILs | 241230/재귀함수를 이용한 별 출력/star-output-with-recursive-function.cpp | #include <iostream>
using namespace std;
void PrintStar(int n){
if(n == 0)
return;
PrintStar(n-1);
for(int i = 0; i < n; i++){
cout << "*";
}
cout << endl;
}
int main() {
int N;
cin >> N;
PrintStar(N);
// 여기에 코드를 작성해주세요.
return 0;
} | ALGO | 0.999921 | 4.51743 |
fc1dbf03-e647-4d00-a457-1245892281d0 | arlechann/atcoder | AtCoder/ABC212/A.cpp | #include <algorithm>
#include <climits>
#include <cmath>
#include <cstdio>
#include <cstring>
#include <functional>
#include <iomanip>
#include <iostream>
#include <limits>
#include <list>
#include <map>
#include <numeric>
#include <queue>
#include <set>
#include <sstream>
#include <string>
#include <tuple>
#include <t... | ALGO | 0.973112 | 3.936637 |
6e5d962d-c44a-48b8-84d6-99cb40a4b77f | retrodump/Opcode | Ice/IceMatrix4x4.cpp | ///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
/**
* Contains code for 4x4 matrices.
* \file IceMatrix4x4.cpp
* \author Pierre Terdiman
* \date April, 4, 2000
... | ALGO | 0.999925 | 6.360821 |
66ae2d38-8244-4b9e-8cf5-ce418690f42f | datpq/competitive-programming | usaco/CycleCorrespondence_2023Silver.cpp | #include <bits/stdc++.h>
using namespace std;
signed main() {
ios::sync_with_stdio(0);
cin.tie(0);
int n, k; cin >> n >> k;
vector<int> a(k), b(k);
for(auto &x: a) cin >> x, x--;
for(auto &x: b) cin >> x, x--;
map<int, int> mpa, mp;
vector<bool> vis(n, false);
for(int i=0; i<k; i++... | ALGO | 0.99997 | 3.55284 |
881d9e52-c7d4-472e-bf6d-b9056b827ca5 | itzprincephutela/Daily_CPP | ADDITIONOFROW.CPP | #include<iostream>
using namespace std;
void printsum(int array[][3],int row ,int col){
for(int row=0;row<3;row++){
int sum=0;
for(int col=0;col<3;col++){
sum+=array[col][row];
}
cout<<sum<<" ";
}
}
int main (){
int array[3][3];
int sum=0;
for(int row=0;ro... | ALGO | 0.9997 | 3.757293 |
b2fac6a9-979b-42d4-b452-c94ff784c60a | aalghooneh/codility_cpp | min_avg_slices.cpp | #include <vector>
#include <limits>
int solution(std::vector<int> &A) {
int N = A.size();
if (N < 2) return 0; // Edge case, should not happen per problem statement
// Step 1: Calculate prefix sums
std::vector<int> prefix(N + 1, 0);
for (int i = 1; i <= N; ++i) {
prefix[i] = prefix[i - 1] ... | ALGO | 0.999959 | 6.844007 |
ade18075-e00a-4539-ba91-88b04c03b243 | kcalbCube/PVC-16 | include/boost_1_78_0/libs/graph_parallel/test/distributed_graph_coloring_test.cpp | // Authors: Douglas Gregor
// Andrew Lumsdaine
#define PBGL_ACCOUNTING
#include <boost/graph/use_mpi.hpp>
#include <boost/config.hpp>
#include <boost/throw_exception.hpp>
#include <boost/serialization/vector.hpp>
#include <boost/graph/distributed/boman_et_al_graph_coloring.hpp>
#include <boost/graph/distrib... | ALGO | 0.920561 | 6.84115 |
388dc691-3759-4391-941e-99b5454355e7 | abufarhad/Codeforces-Problems-Solution | 1324C.cpp | //! Bismillahi-Rahamanirahim.
/** ========================================**
** @Author: Md. Abu Farhad ( RUET, CSE'15)
** @Category:
/** ========================================**/
#include<bits/stdc++.h>
#include<stdio.h>
using namespace std;
#define ll long long
#define scl(n) cin>>... | ALGO | 0.999692 | 3.290865 |
f3e38345-4ebb-40ae-aaa4-4cf0103669bd | cuhk-seclab/SPatch | main/DSE_juxta/llvm/lib/CodeGen/MachineBasicBlock.cpp | #include "llvm/CodeGen/MachineBasicBlock.h"
#include "llvm/ADT/SmallPtrSet.h"
#include "llvm/ADT/SmallString.h"
#include "llvm/CodeGen/LiveIntervalAnalysis.h"
#include "llvm/CodeGen/LiveVariables.h"
#include "llvm/CodeGen/MachineDominators.h"
#include "llvm/CodeGen/MachineFunction.h"
#include "llvm/CodeGen/MachineInstr... | TOOL | 0.875205 | 7.420127 |
39f736e7-123e-42f1-b5dd-445dcbc5ecf0 | thepluck/CP-Training | Onlinejudges/oj.uz/IOI20_plants/public/cpp/grader.cpp | #include "plants.h"
#include <cstdio>
#include <cassert>
#include <vector>
static int n, k, q;
static std::vector<int> r;
static std:: vector<int> x;
static std:: vector<int> y;
static std:: vector<int> answer;
int main() {
assert(scanf("%d%d%d", &n, &k, &q) == 3);
r.resize(n);
answer.resize(q);
for (int i = 0; i ... | ALGO | 0.999897 | 3.866461 |
96c13c4a-8886-40d4-9b9c-eb66f253fcec | koba-e964/contest | hackerrank/tsg-live-4-programming-contest/d.cpp | #include <algorithm>
#include <cassert>
#include <cctype>
#include <cmath>
#include <cstdio>
#include <cstdlib>
#include <ctime>
#include <deque>
#include <functional>
#include <iomanip>
#include <iostream>
#include <list>
#include <map>
#include <queue>
#include <random>
#include <set>
#include <sstream>
#include <str... | ALGO | 0.99969 | 3.665293 |
b50b0773-6b46-4bd7-b18a-e0804214236b | AweShantanu/LeetCode | 0076-minimum-window-substring/0076-minimum-window-substring.cpp | #include <string>
#include <unordered_map>
#include <climits>
using namespace std;
class Solution {
public:
string minWindow(string s, string t) {
unordered_map<char, int> mp;
for (char c : t) {
mp[c]++;
}
int i = 0, j = 0;
int count = t.size();
... | ALGO | 0.999976 | 6.581989 |
1250100c-7ca5-4018-a383-4728f08d0b35 | usavk/DS | enqueue dequeue.cpp | #include <stdio.h>
#include <stdlib.h>
#include <limits.h>
#define CAPACITY 100
int queue[CAPACITY];
unsigned int size = 0;
unsigned int rear = CAPACITY - 1;
unsigned int front = 0;
int enqueue(int data);
int dequeue();
int isFull();
int isEmpty();
int getRear();
int getFront();
int main()
{
int ch, data;
... | ALGO | 0.995071 | 4.352428 |
dcf1b9a1-f313-4c8a-9134-0f31550bfa0b | BartoszewskiA/2021-Podstawy-Programowania-NST-L1 | lab02p05.cpp | #include<iostream>
using namespace std;
int main()
{
int n;
cout<<"n=";
cin>>n;
for (int i=n ; i>=0 ; i--)
cout<<i<<" ";
return 0;
}
| ALGO | 0.999825 | 3.461087 |
aeb8c9e6-c546-4f14-8062-1108c3bd8a6f | redpanda-cpp/qtbase-xp | src/3rdparty/angle/src/common/system_utils_mac.cpp | // system_utils_osx.cpp: Implementation of OS-specific functions for OSX
#include "system_utils.h"
#include <unistd.h>
#include <cstdlib>
#include <mach-o/dyld.h>
#include <vector>
#include <array>
namespace angle
{
namespace
{
std::string GetExecutablePathImpl()
{
std::string result;
uint32_t size = 0;... | TOOL | 0.89616 | 6.848198 |
7be084f9-ee0c-41ed-b6e7-1b8798ea67be | andrielefa/matrizes-1-ao-20 | 17.cpp | #include <iostream>
#include <vector>
int main() {
std::vector<std::vector<int>> A = {{1, 0, 2}, {4, -1, 3}, {1, 0, 1}};
std::vector<std::vector<int>> B = {{4, 3, 5}, {1, 0, 0}};
std::vector<std::vector<int>> C = {{2, 1, 1}, {0, -1, 1}};
std::vector<std::vector<int>> AC(3, std::vector<int>(3, 0));... | ALGO | 0.999891 | 5.684514 |
d1938c4b-f022-46df-9aed-65758b668fff | its-Hitesh/Codeforeces-questions | Planets_Queries_I.cpp | #include <bits/stdc++.h>
#include <bits/extc++.h>//
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
using namespace __gnu_pbds;
using namespace std;
using ll = long long ;
#define pb push_back
#define ld long double
#define sz size()
#define foo(i,a,b) f... | ALGO | 0.99997 | 4.622701 |
fa8a3c81-1233-4d5d-a6ec-d65defcac470 | itsanamulhassan/data_structure | Week 03 Doubly Linked List/10.5. Week 03 Practice Day 01/problem_3.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 insert_at_tail(Node *&head, Node *&tail, int value)
{
Node *new_node = new Nod... | ALGO | 0.999934 | 5.319738 |
54b0e146-077d-4c49-8e7a-e0cece7789c1 | 299299/urho | Source/ThirdParty/Bullet/src/BulletCollision/BroadphaseCollision/btDbvtBroadphase.cpp | ///btDbvtBroadphase implementation by Nathanael Presson
#include "btDbvtBroadphase.h"
#include "LinearMath/btThreads.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... | ALGO | 0.98801 | 7.36502 |
346800ab-22c8-449b-941b-ddc7b7e8ce3d | GouravSingh2580/leetcode | 2235-add-two-integers/2235-add-two-integers.cpp | class Solution {
public:
int sum(int num1, int num2) {
return num1+num2;
}
}; | ALGO | 0.996414 | 5.542423 |
f62e2679-49d1-47c5-a839-1989ba4b0f5c | anindyaspaul/competitive-programming | google/apac-17/test.cpp | #include <iostream>
#include <vector>
#include <algorithm>
#include <bits/stdc++.h>
using namespace std;
int main(){
freopen("in.txt", "r", stdin);
freopen("out.txt", "w", stdout);
long long int t,n,prod,temp,q,k,sumsub,l,r,sume;
cin>>t;
int arr[200001];
vector<long long int> sum;
temp=t;
while(t... | ALGO | 0.999233 | 3.628519 |
7f096686-fd70-4864-ac69-4dec3369db8e | yusifaliyevpro/Competitive-Programming | LeetCode/Medium/394. Decode String.cpp | // 394. Decode String
// https://leetcode.com/problems/decode-string/
#include <iostream>
using namespace std;
class Solution {
public:
string decodeString(string s) {
}
}; | ALGO | 0.999075 | 6.419057 |
3b5acca3-6f73-43d0-af0a-18dbe066ab01 | kidcher1412/giai-thuat | RotNuocF.cpp | #include <iostream>
using namespace std;
int a, b;
int gcd(int a, int b){
if (b == 0) return a;
return gcd(b, a % b);
}
void show(int a, int b){
cout << a << "\t" << b<<endl;
}
void TimKiem(int n){
int xq = 0, yq = 0; // mực nước hiện tại của a và b
show(xq,yq);
int t;
while (xq != n && yq!= n ) {
... | ALGO | 0.999687 | 3.852531 |
b01782c0-c513-4075-9af2-7727db2e9a57 | sammiiT/leetcode | stack/946. Validate Stack Sequences.cpp | //===類似題===
947. Most Stones Removed with Same Row or Column
1034. Coloring A Border
803. Bricks Falling When Hit
982. Triples with Bitwise AND Equal To Zero
//===思路===
(*)用stack計算
(*)宣告一stack, 用來模擬pushed和popped的動作
1. 遍歷pushed數列, 每次都將pushed[i]推入stack中
2. 推入stack的top()同時用來跟popped做比對
-如果stack.top()==popped[j] => 則stack.... | ALGO | 0.999831 | 6.197599 |
db1f334e-9fa3-4035-bc21-6463370d0261 | AlfengYuan/leetcode-cplusplus-offline | nowcoder/hwod/p1052.cpp | #include <iostream>
#include <vector>
#include <cmath>
using namespace std;
int main(int argc, char* argv[]) {
int m, n, x;
cin >> m >> n >> x;
int input;
vector<int> make;
vector<int> risk;
vector<int> money;
for (int i = 0; i < m; i++) {
cin >> input;
make.push_back(input)... | ALGO | 0.999957 | 3.873745 |
89504216-0664-4d19-a91f-efd15f2cbb89 | ankitmohapatra966/LeetCode_Daily_solution | 1346. Check If N and Its Double Exist.cpp | class Solution {
public:
bool checkIfExist(vector<int>& arr) {
bitset<1001> seen[2]={0};
for(int x: arr){
int z=abs(x);
if ((z<=500 && seen[x<0][2*z])|| (z%2==0 && seen[x<0][z/2]))
return 1;
seen[x<0][z]=1;
}
return 0;
}
};
| ALGO | 0.999568 | 5.315796 |
35aade6a-b64e-4d7e-9730-c9123d9c2494 | Abhinav-Vijay-Walunj/GeeksforGeeks | DP/0-1 knapsack.cpp | #include <iostream>
using namespace std;
int maximum(int a,int b)
{
if(a>b)
return a;
return b;
}
int kp(int val[],int wt[],int n,int W)
{
int t[n+1][W+1];
for(int i=0;i<=n;i++)
{
for(int j=0;j<=W;j++)
{
if(i == 0||j == 0)
{
t[i][j]=0;... | ALGO | 0.999986 | 4.235065 |
d93cea44-6778-4c1d-8ee2-a337d5964733 | stepanskyvlad/learningcpp | cpp_course/if_statements_and_loops/while_loop/main.cpp | #include <iostream>
#include <cstdint>
#include <vector>
using namespace std;
int main() {
uint16_t num {};
cout << "Enter a positive integer to count up to: ";
cin >> num;
int i {1};
while (num >= i) {
cout << i << endl;
i++;
}
cout << "========================" << en... | ALGO | 0.960675 | 3.061418 |
86a78889-64da-4442-9423-817ab948cd37 | yyysolhhh/Cpp_algo_study | Baekjoon/BJ_25177.cpp | #include <bits/stdc++.h>
using namespace std;
int now[1001];
int before[1001];
int main(void) {
ios::sync_with_stdio(0);
cin.tie(0);
int N, M;
cin >> N >> M;
for (int i = 0; i < N; i++) {
cin >> now[i];
}
for (int i = 0; i < M; i++) {
cin >> before[i];
}
int ans = 0;
for (int i = 0; i < M; i... | ALGO | 0.999982 | 3.987259 |
8d9b0416-a9eb-43bd-a6d1-ba15b78b5190 | jatin9909/data_structures | listsearch.cpp | #include<iostream> //linear search complexity O(n)
#include<list> // binary search complexity O(logn)
#include<iterator>
using namespace std;
template <class T>
int linearsearch(list <int> l, int num){
list <int> ::iterator it;
for(it =l.begin(); it!=l.end() ; it++)
if(*it==num)
return 1;
retu... | ALGO | 0.999549 | 4.057182 |
ada39cc3-5a15-4bed-90dd-ed6fc0b43447 | shreydevep/DSA | 1367-linked-list-in-binary-tree/1367-linked-list-in-binary-tree.cpp | /**
* Definition for singly-linked list.
* struct ListNode {
* int val;
* ListNode *next;
* ListNode() : val(0), next(nullptr) {}
* ListNode(int x) : val(x), next(nullptr) {}
* ListNode(int x, ListNode *next) : val(x), next(next) {}
* };
*/
/**
* Definition for a binary tree node.
* struc... | ALGO | 0.9999 | 4.869128 |
47f9d3f3-4540-4096-92f8-359903355df3 | lbisaro/Ender-3-Pro-SKR-Mini-E3-V2 | Marlin/src/lcd/menu/menu_bed_tramming.cpp | //
// Bed Tramming menu
//
#include "../../inc/MarlinConfigPre.h"
#if ALL(HAS_MARLINUI_MENU, LCD_BED_TRAMMING)
#include "menu_item.h"
#include "../../module/motion.h"
#include "../../module/planner.h"
#if HAS_LEVELING
#include "../../feature/bedlevel/bedlevel.h"
#endif
#ifndef BED_TRAMMING_Z_HOP
#define BED_TR... | TOOL | 0.93839 | 4.536239 |
fce89f7b-d22b-486f-ad8d-d6413a281a1f | TTP1128/wangjunrui-s-code | 第二轮刷题/2.kmp/klavir.cpp | #include<cstdio>
#define re register
#define Mod(x) (((x)%mod+mod)%mod)
using namespace std;
template<typename T>
inline void read(T&x)
{
x=0;
char s=(char)getchar();
bool f=false;
while(!(s>='0'&&s<='9'))
{
if(s=='-')
f=true;
s=(char)getchar();
}
while(s>='0'&&s<='9')
{
x=(x<<1)+(x<<3)+s-'0';
s=(cha... | ALGO | 0.999988 | 3.623424 |
747554d0-4ca8-4ff3-acb2-6e648a1b3e28 | sarvex/leetcode-pharo | solution/2600-2699/2645.Minimum Additions to Make Valid String/Solution.cpp | class Solution {
public:
int addMinimum(string word) {
string s = "abc";
int ans = 0, n = word.size();
for (int i = 0, j = 0; j < n; i = (i + 1) % 3) {
if (word[j] != s[i]) {
++ans;
} else {
++j;
}
}
if (word... | ALGO | 0.999967 | 5.709619 |
149fd876-4e03-40fe-8622-7d195aaee7cc | yogeesp/love-babbar | recursion/print_number_in_reverse.cpp | #include<iostream>
using namespace std;
void print(int n){
if (n ==0){
return;
}
cout<<n<<" ";
print(n-1);
}
int main()
{
int n;
cin>>n;
print(n);
return 0;
} | ALGO | 0.99997 | 4.700401 |
4e9eaa2c-dedc-4b0c-9651-198fb5629af3 | mohansirvi/CodeChef-DSA-Learning-Series-Week-2 | CompilerAndParser.cpp | //Author MOHAN SIRVI
#include<bits/stdc++.h>
using namespace std;
#define fast ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL);
#define ll long long int
void solve()
{
ll ans = -1;
ll sum = 0;
string s;
cin >> s;
for(ll i = 0; i < s.size(); i++) {
if(s[... | ALGO | 0.999259 | 3.334707 |
822afe6c-81b7-434d-89d0-a7bef0b31486 | shinhong-gyu/AlgorithmTheory | 5.MergeSort/Main.cpp | #include <iostream>
// ҵ 迭 ٽ ĥ ϴ Լ.
void Merge(const char* array[], int arrayLength, const char* leftArray[], int leftArrayLength, const char* rightArray[], int rightArrayLength)
{
// ε .
int leftIndex = 0;
int rightIndex = 0;
int mergedIndex = 0;
// / 迭 Ҹ 迭 Ҹ 迭 array .
while (leftIndex < leftArrayLength ... | ALGO | 0.999924 | 5.173025 |
fdce0435-694f-4d23-8863-507d51cd3d3b | a6cenna/osninfor | random/dp/lcs.cpp | #include <bits/stdc++.h>
using namespace std;
int longestCommonSubsequence(string text1, string text2) {
int m=text1.length();
int n=text2.length();
vector<vector<int>> dp(m, vector<int>(n, 0));
for (int i = 0; i < m; i++)
{
if(text1[i]==text2[0]) dp[i][0]=1;
... | ALGO | 0.999983 | 4.892109 |
064a6889-d55e-4069-8769-044aef6d906c | Aldebaran638/luogu | shortest path/bellman ford/P4779(template_BellmanFord).cpp | // BellmanFord算法的模板(本代码是过不去模板题的)
// 时间复杂度O(n*m)n为点数,m为边数
// 可以处理无环的负权图,有环但非负权图
// 比Dijkstra适用性更广,但效率更低
#include <bits/stdc++.h>
#define ll long long
using namespace std;
int n, m, s;
const int M = 2e5 + 20;
// 由于BellmanFord只关心边而不强调边必须起点是什么,所以只需要一维数组存储
struct node
{
int start;
int end;
ll w;
node() = default;
... | ALGO | 0.999856 | 3.923075 |
476505cb-30c3-4563-b73e-b8dbc5d9469f | sourabh59-coder/StriverA-Z_Sheet | Step 8 : Bit Manipulation [Concepts & Problems]/Lec 2: Interview Problems/04. Find xor from l to r/Approach1.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 xoring(int x)
{
if(x % 4 == 1)return 1;
else if(x % 4 == 2)return x+1;
else if(x % 4 == 3)return 0;
... | ALGO | 0.999963 | 5.569232 |
65e51431-b93b-42d0-890a-04fd56f4fd1a | iArpitVerma/Coding_Ninjas_Data_Structures | Linked List 2/mergeTwoSortedLL.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 != -1){
node* newNode = new node(d... | ALGO | 0.999774 | 4.84418 |
4a058702-1ebb-46b9-ad40-a0c4c9ada6b0 | Geeky-Utkarsh/Complete-CPP | DSA-with-c++/CH-1(Output-and-variable)/06_Short_hand_property.cpp | //! short hand property of incrementing and decrementing the variable
#include<iostream>
#include<bits/stdc++.h>
using namespace std;
int main(){
int x=4;
cout<<x<<endl;
x+=5;
cout<<x<<endl;
x=x+5;
cout<<x<<endl;
x+=10;
cout<<x<<endl;
return 0;
} | ALGO | 0.989581 | 3.269407 |
f6eff27f-eb0c-45ea-a3a1-a6fee2e8e838 | rimabenticha/intelligent_bus | 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 |
c78187c1-36a2-48c6-a4e6-32bc72aeabef | Dup4/competitive-programming | luogu/3805/a.cpp | #include <bits/stdc++.h>
using namespace std;
const int N = 1.1e7 + 5;
char s[N];
struct Manacher {
int len, l;
char Ma[N << 1];
int Mp[N << 1];
// 0-index
void work(char *s) {
len = strlen(s);
l = 0;
Ma[l++] = '$';
Ma[l++] = '#';
for (int i = 0; i < len; ++i... | ALGO | 0.999971 | 4.614615 |
3a911427-7933-48d7-a07e-2134bf80732c | Santosh-DShinde/DataStructures | SpecificQueue.cpp | // LIFO
#include<iostream>
using namespace std;
typedef struct node
{
int data;
struct node *next;
}NODE, *PNODE;
class Queue
{
private:
PNODE first;
int size;
public:
Queue();
void InQueue(int);
void DeQueue();
void Display();
int Count();
};
Queue :: Queue()
{
first = NULL;
size = 0;
}
... | ALGO | 0.998631 | 4.081493 |
b28973eb-7c0c-4f61-ab5f-ade9448625df | denis-gubar/Leetcode | String/0981. Time Based Key-Value Store.cpp | class TimeMap {
public:
/** Initialize your data structure here. */
TimeMap() {
M.clear();
}
void set(string const& key, string const& value, int timestamp) {
M[key].push_back({ timestamp, value });
}
string get(string const& key, int timestamp) {
if (M.find(key) == M.end())
return "";
auto it = lowe... | ALGO | 0.993151 | 7.040318 |
407fb182-46f4-42a3-af97-c2f92e27da9a | SetsunaChyan/OI_source_code | USST/UF1/B.cpp | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
ll ans=0;
int n,a[100005];
int main()
{
scanf("%d",&n);
for(int i=0;i<n;i++)
scanf("%d",&a[i]);
ll tot=1;
ans++;
for(int i=1;i<n;i++)
{
if(a[i]==a[i-1]) tot++;
else tot=1;
ans+=tot;
}
pr... | ALGO | 0.999926 | 3.499634 |
0fc86420-db22-495e-bf76-2cab82e0f8eb | iyungui/TIL-PS | 프로그래머스/0/120831. 짝수의 합/짝수의 합.cpp | #include <string>
#include <vector>
using namespace std;
int solution(int n) {
int answer = 0;
for(int i = 0; i <= n; i++) {
if(i % 2 == 0) answer += i;
}
return answer;
} | ALGO | 0.999193 | 4.619781 |
4f1a12ee-0944-47d3-ac19-223d3370f7d5 | Amarjeet113/100daysofcode | 100 days of code/day10.cpp | // TO Lower Case
class Solution {
public:
string toLowerCase(string s) {
transform(s.begin(),s.end(),s.begin(), ::tolower);
return s;
}
};
| ALGO | 0.984918 | 5.271203 |
598e0775-6c82-4e63-8a63-62afb4011cd3 | cotrat/UBUNTU-FILES | SVN INSIDE/a1647264/newsvn/a1647264/2014/s1/adds/assignment4/main.cpp | // Design began: 05 04 14
// Coding began: 07 04 14
#include <iostream>
#include <string>
#include <sstream>
#include <vector>
#include <cstdlib>
#include "EfficientFibonacci.h"
#include "Palindrome.h"
using namespace std;
int main()
{
vector<string> inputs(5);
string reversed,isPal;
int fibbed=0;
int ctr=0;... | ALGO | 0.998609 | 4.75606 |
ae8cd269-7484-4555-8d38-49503acf72bd | linuxdeepin/seetaface-tennis | src/kernels/cpu/arm/conv2d_3x3.cpp | //
// Created by yang on 2019/10/11.
//
#include "kernels/cpu/arm/conv2d_3x3.h"
#include "kernels/cpu/pad2d_algorithm.h"
#include "kernels/common/simd.h"
#include "kernels/common/function.h"
#ifdef TS_USE_OPENMP
#include "kernels/common/openmp.h"
#endif
#include <array>
namespace ts{
namespace cpu{
namespace arm {
... | ALGO | 0.93444 | 5.396554 |
ba824f7e-14c9-4f1e-b411-16224a670fd9 | galorecoin/galore | src/pubkey.cpp | #include "pubkey.h"
#include <secp256k1.h>
#include <secp256k1_recovery.h>
namespace
{
/* Global secp256k1_context object used for verification. */
secp256k1_context* secp256k1_context_verify = NULL;
}
/** This function is taken from the libsecp256k1 distribution and implements
* DER parsing for ECDSA signatures, ... | TOOL | 0.946592 | 7.462384 |
b7c9231e-e0a2-4f9c-a245-29c6d16f1743 | kmyobin/baekjoon | 녹색 옷 입은 애가 젤다지 4485/녹색 옷 입은 애가 젤다지 4485/녹색 옷 입은 애가 젤다지 4485.cpp | #include <iostream>
#include <vector>
#include <queue>
#include <cmath>
#include <limits.h>
using namespace std;
int N;
int A[126][126];
int D[126][126];
int dr[4] = { 1,0,-1,0 };
int dc[4] = { 0,1,0,-1 };
bool safe(int r, int c) {
return 1 <= r && r <= N && 1 <= c && c <= N;
}
struct cmp {
bool operator()(pair<p... | ALGO | 0.999542 | 4.605603 |
5153d423-50a4-43e1-9b9b-eb84c1d9028a | Will-Z/algorithm-practice | leetcode OJ/Array/31-Next Permutation.cpp | //
// Created by Will on 2/14/16.
//
#include <iostream>
#include <vector>
using namespace std;
/*
class Solution {
public:
void nextPermutation(vector<int>& nums) {
next_permutation(nums.begin(), nums.end());
}
};
*/
class Solution {
public:
void nextPermutation(vector<int>& nums) {
int ... | ALGO | 0.999979 | 4.946511 |
8bf14b73-fc58-4bde-859b-ed656a545802 | ayushsharman/DSA-Practice | odd_even.cpp | #include <bits/stdc++.h>
using namespace std;
int main()
{
int n;
cin >> n;
if (n & 1)
{
cout << "Odd";
}
else
{
cout << "Even";
}
return 0;
} | ALGO | 0.999746 | 4.824822 |
f3bcf280-2fb3-4ad3-8b32-32863639342e | daniellecox/oneapi-samples | Libraries/oneDPL/gamma-correction/src/main.cpp | // oneDPL headers should be included before standard headers
#include <oneapi/dpl/algorithm>
#include <oneapi/dpl/execution>
#include <oneapi/dpl/iterator>
#include <iomanip>
#include <iostream>
#include <CL/sycl.hpp>
#include "utils.hpp"
using namespace sycl;
using namespace std;
int main() {
// Image size is w... | ALGO | 0.896444 | 6.994872 |
226df984-e143-4196-84f7-ba6131dc2d2f | Subhraneel77/Leetcodes-Solutions | 1680-concatenation-of-consecutive-binary-numbers/1680-concatenation-of-consecutive-binary-numbers.cpp | class Solution {
public:
int numberOfBits(int n) {
return log2(n) + 1;
}
int concatenatedBinary(int n) {
long ans = 0, MOD = 1e9 + 7;
for (int i = 1; i <= n; ++i) {
int len = numberOfBits(i);
ans = ((ans << len) % MOD + i) % MOD;
}
... | ALGO | 0.999994 | 6.300893 |
cbe5595e-63ca-4bf9-8317-1175c3b9283c | ishandutta2007/codeforces | coderanshu/normal/917/B.cpp | #include<bits/stdc++.h>
using namespace std ;
#define ll long long
#define pb push_back
#define all(v) v.begin(),v.end()
#define sz(a) (ll)a.size()
#define F first
#define S second
#define INF 2000000000000000000
#define popcount(x) ... | ALGO | 0.999979 | 4.720288 |
01cb2bfd-26cf-425e-bf43-950ae212f125 | redsimmba/Intern-Preparation-Material-Shared | Binary Search/Search Insert Position.cpp | class Solution {
public:
int searchInsert(vector<int>& v, int key) {
if(key<v[0]){
return 0;
}
int s=0;
int n=v.size();
int ans;
int e=n-1;
while(s<=e){
int mid=(s+e)/2;
if(v[mid]==key){
ans=mid;
... | ALGO | 0.999991 | 5.983418 |
ba18b88a-ac13-4d25-a5bb-3a4dbef9cf1f | jk-jung/problem-solving | codeforces/Codeforces Round 81x/R816_div2_C.cpp | #include <cstring>
#include <cstdio>
#include <cmath>
#include <cassert>
#include <set>
#include <map>
#include <array>
#include <stack>
#include <queue>
#include <vector>
#include <numeric>
#include <iostream>
#include <algorithm>
using namespace std;
typedef long long ll;
typedef pair<int, int> pi;
typedef vector<i... | ALGO | 0.999751 | 3.944244 |
8ca74c35-3ff5-4eb4-ac80-47a34cc8f866 | Akshat-07-ux/Gfg-Questions-2 | Difficulty: Medium/Next element with greater frequency/next-element-with-greater-frequency.cpp | #include <vector>
#include <unordered_map>
#include <stack>
using namespace std;
class Solution {
public:
vector<int> findGreater(vector<int>& arr) {
int n = arr.size();
vector<int> res(n, -1);
// Step 1: Calculate frequencies
unordered_map<int, int> freq;
for (int num : ... | ALGO | 0.99999 | 6.23378 |
a4ad8bf2-3dee-473c-a0c3-2993f7243c3d | raincross7/code-similarity | codes/train_code/problem437/problem437_423.cpp | #include <iostream>
#include <cstring>
#include <vector>
using namespace std;
const int INF = 1e9+7;
int n, m;
int dp[50001];
int c[50001];
int solve(int n) {
if (dp[n] != INF) return dp[n];
int res = INF;
if (n == 0) res = 0;
for (int i = 0; i < m; ++i) {
if (n-c[i] >= 0) res = min(res, solv... | ALGO | 0.999992 | 4.202395 |
8a0590ed-9720-4297-9bac-4837287323bc | musnit/castle-client | ghost-extensions/tove2d/src/cpp/gpux/curve_data.cpp | #include "../common.h"
#include "curve_data.h"
#include <algorithm>
BEGIN_TOVE_NAMESPACE
void CurveData::storeRoots(gpu_float_t *out) const {
for (int i = 0; i < 4; i++) {
float t = bounds.sroots[i];
store_gpu_float(out[i], t);
}
}
void CurveBounds::update(const float *curve, float *bx, float *by) {
// adapte... | ALGO | 0.989758 | 6.92624 |
dc0e1366-d45d-4b0b-9846-80163307e1a5 | heweimin77/shoran_cpp | session4000/problem3300/p3233.nonSpecialCount.cpp | #include <gtest/gtest.h>
#include <cmath>
#include "Math.h"
using namespace std;
namespace {
static auto autorun = []() {
ios::sync_with_stdio(false);
cin.tie(nullptr);
cout.tie(nullptr);
return 0;
} ();
class Solution {
public:
int nonSpecialCount(int l, int r) {
auto primes = Math::get_p... | ALGO | 0.998604 | 5.562201 |
173390d4-d4a3-4be0-8477-ae764f3e4a60 | sarvex/leetcode-rockstar | lcof2/剑指 Offer II 005. 单词长度的最大乘积/Solution.cpp | class Solution {
public:
int maxProduct(vector<string>& words) {
int n = words.size();
vector<int> mask(n);
for (int i = 0; i < n; ++i)
for (char ch : words[i])
mask[i] |= 1 << (ch - 'a');
int ans = 0;
for (int i = 0; i < n - 1; ++i)
fo... | ALGO | 0.999653 | 5.746455 |
67af2c88-bf5d-4fb0-b866-f0af947895c1 | yusifaliyevpro/Competitive-Programming | LeetCode/Easy/2383. Minimum Hours of Training to Win a Competition.cpp | // 2383. Minimum Hours of Training to Win a Competition
// https://leetcode.com/problems/minimum-hours-of-training-to-win-a-competition/
#include <iostream>
#include <vector>
using namespace std;
class Solution {
public:
int minNumberOfHours(int initialEnergy, int initialExperience, vector<int>& energy, vector<in... | ALGO | 0.999566 | 5.295319 |
10c242d6-85c9-43c2-a6b5-cf164d3bda8a | TSRCHARAN/Strivers-SDE-Sheet-Challenge | TREES/vertical_order_traversal_of_a_binary_tree.cpp | #include <bits/stdc++.h>
/************************************************************
Following is the Binary Tree node class
template <typename T = int>
class TreeNode
{
public:
T data;
TreeNode<T> *left;
TreeNode<T> *right;
TreeNode(T val)
{
this->data = val;
left = NULL;
... | ALGO | 0.999996 | 5.336036 |
93b74bfd-501e-48bd-83f9-63ea2c5dde56 | Sachinchhatani/flutter | Hello_World/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.997854 | 6.76775 |
79136d71-81a6-4480-ba28-16b93f10bf0c | OmarAlex24/ejercicosEscuela | Matrices/Tarea/ejercicio3.cpp | // Intercambiar filas (Yo puse que se intercambien todas, no solo primera y ultima)
#include <iostream>
using namespace std;
void imprimiArr(int arr[][3], int fila, int col)
{
for (int i = 0; i < fila; i++)
{
for (int j = 0; j < col; j++)
{
cout << arr[i][j] << " ";
}
cout << endl;
}
}
vo... | ALGO | 0.991391 | 3.84861 |
02c10ee5-6443-4057-bc5c-b8398900d274 | IanRibeiroDev/POP-2023.2 | exercicios_resolvidos/slides/c++_basico_I/desafio2.cpp | /*
O professor Leônidas estava entediado e decidiu fazer a seguinte brincadeira na sala de aula.
Ele aleatoriamente irá atribuir um coeficiente K (0 <= K <= 100) e de acordo com o coeficiente recebido o aluno é classificado das seguintes formas:
- K de 0 a 30 é considerado filão iniciante;
- K de 31 a 59 é considerado ... | ALGO | 0.999481 | 4.043092 |
18b891fe-c9dd-4132-89f8-1db2b3ce3a3a | devSteb2002/info2_lab | practica_1/problem14.cpp | #include <algorithm>
#include <iostream>
#include "problems.h"
using namespace std;
bool isPalindrome(unsigned int palind);
void problem14(){
// Problema 14. Un número palíndromo es igual de derecha a izquierda y de izquierda a derecha,
// Ej: 969. escriba un programa que calcule el número palíndromo más gra... | ALGO | 0.998998 | 3.828611 |
800d75af-1cb6-4154-8ebf-91d06c4e8d18 | ishandutta2007/codeforces | suika_predator/normal/1023/A.cpp | #include<bits/stdc++.h>
using namespace std;
int main()
{
ios_base::sync_with_stdio(false);
int n,m;
string s,t;
cin>>n>>m>>s>>t;
if(s.length()-1>t.length())
{
cout<<"NO"<<endl;
return 0;
}
string pre,suf;
int ok=0;
for(auto ch:s)
{
if(ch=='*')ok=1;
else
{
if(ok)suf.push_back(ch);
else pre.pu... | ALGO | 0.999963 | 3.395948 |
2d27a1d9-d680-4743-a2aa-b7923239d630 | akashb2003/dsa-questions | stl/stacks.cpp | #include <bits/stdc++.h>
using namespace std;
int main()
{
cout<<"Stack\n\n";
stack<int>s;
s.push(4); //{4}
s.push(3); //{4,3}
s.push(2); //{4,3,2}
s.push(1); //{4,3,2,1}
s.pop(); //{4,3,2}
cout<<s.top()<<endl;// 2
cout<<s.size()<<endl;// 3
cout<<s.empty... | ALGO | 0.99797 | 4.273726 |
dea2f7d5-a18b-46f6-bc47-313a50e07457 | alexandraback/datacollection | solutions_5658282861527040_0/C++/ICastro/B_New_Lottery_Game.cpp | #include <iostream>
#include <vector>
#include <algorithm>
using namespace std;
bool compara (const int c1, const int c2) {
return c1<c2;
}
int main(void){
int T;
cin >> T;
for (int k = 0; k < T; ++k){
int A, B, K;
cin >> B >> A >> K;
int cont = 0;
/*if (A <= K || B <= K){
cout << "Case #" << k+1 << "... | ALGO | 0.999067 | 3.754277 |
8a23ba11-1199-4b82-a960-a142963ff736 | SHREYASH-KUMAR1601/CODE-COLLECTION---DSA | Hacker Blocks Assignments/Pattern questions/pattern_triangle.cpp | #include <iostream>
using namespace std;
int main()
{
int rowno = 1, trows;
cin >> trows;
while(rowno<=trows){
int sp=0;
while(sp<trows-rowno){
cout<<" "<<" ";
sp++;
}
int p=rowno;
int st=0;
while(st<(2*(rowno)-1)/2 + 1){
... | ALGO | 0.999703 | 3.229618 |
bfbc5938-7c73-4a7b-b0d0-8756eccd9d5b | bharatk5003/Competitive-Coding | 25-07-2021/1551_B2.cpp | #include<bits/stdc++.h>
using namespace std;
typedef long long int ll;
bool compare(pair<int, int> A, pair<int, int> B)
{
if (A.first = B.first)
return A.second < B.second;
return A.first < B.first;
}
int solve(int location[], int n)
{
pair<int, int> range[n];
for (int i = 0; i < n; i++)
{
int id =... | ALGO | 0.999916 | 4.218971 |
424fdfca-6f66-4398-af60-dbd1e36e2a6b | arman-mahy/CodeForces-Solve | dataTyper_R.cpp | #include <iostream>
using namespace std;
int main(){
double x;
int year,month,day;
cin>>x;
year = x / 365;
month = (x - (year*365))/30;
day = x - ((year*365)+(month*30));
cout<<year<<" years"<<endl;
cout<<month<<" months"<<endl;
cout<<day<<" days"<<endl;
}
| ALGO | 0.960508 | 3.385369 |
4f70dde9-b64b-4a36-b215-700fc13ca735 | MihaiMilitaru/POO_QUIZZ | Seminar6/9/main.cpp | #include<iostream>
struct Integer {
int x;
Integer(const int val = 0) : x(val){}
Integer operator+ (Integer& i) {
return Integer(x + i.x);
}
friend std::ostream& operator<<(std::ostream& o, Integer i) {
o << i.x; return o;
}
};
int main () {
Integer i(25), j(5), k(2020);
... | TOOL | 0.942378 | 4.059205 |
5c608001-29bc-4eb0-a452-4749b9179d3f | saojiprasad/DSA | Graphs/Dijkshtra Striver using Priority Queue.cpp | #include<bits/stdc++.h>
using namespace std;
class Solution{
public:
vector<int> dijkstra(int V,vector<vector<int>>adj[],int S){
priority_queue<pair<int,int>,vector<pair<int,int>>,greater<pair<int,int>>>pq;
vector<int>Dist(V,INT16_MAX);
Dist[S]=0;
pq.push({0,S});
while(... | ALGO | 0.99991 | 4.788856 |
b6b5145c-7037-48d9-91fd-3ecd6ee7b0fc | Saber-f/code | c_cpp/dev/ALGO-184/contest_9_D.cpp | #include<iostream>
using namespace std;
int main(void)
{
int n,*a,j = 0,k;
cin >> n;
a = new int[n];
k = n-1;
for(int t,i = 0; i < n; i++)//jDZ꣬kżDZ
{
cin >> t;
if(t % 2 == 0)//ż
{
a[k] = t;
for(int x = k; x < n-1; x++)
{
if(a[x] < a[x+1])
a[x] += a[x+1], a[x+1] = a[x] - a[x+1], a[x] -= ... | ALGO | 0.999978 | 3.341241 |
fa715116-83c7-4d6a-8d94-be838d12d446 | zardosht/Path_Planning_SDCP7 | src/Eigen-3.3/lapack/lu.cpp | #include "common.h"
#include <Eigen/LU>
// computes an LU factorization of a general M-by-N matrix A using partial pivoting with row interchanges
EIGEN_LAPACK_FUNC(getrf,(int *m, int *n, RealScalar *pa, int *lda, int *ipiv, int *info))
{
*info = 0;
if(*m<0) *info = -1;
else if(*n<0) ... | ALGO | 0.998061 | 5.816968 |
6767bc9f-0374-4205-8e76-0aa29974a146 | ShreyasNarlawar/Cpp-Codes | Shreyas C++/03-09-2024/03-09-2024/code05.cpp | #include<iostream>
using namespace std;
#include<string.h>
int main() {
char arr[10];
string sirname;
cout << "Enter Name :";
cin >> arr;
cout << "Enter Sirname :";
cin >> sirname;
cout << strlen(arr)<<endl;
cout << sizeof(arr)<<endl;
cout << sizeof(sirname);
} | ALGO | 0.892853 | 3.020759 |
b22be9a4-99c8-4015-8267-a84295bf5fd3 | WaqasShafi001/api_with_getx | 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 |
58d8027f-1da0-4d09-a9cc-104f3d3d1e38 | btdun2002/lttt | Bai2b.cpp | #include <stdio.h>
#include <string.h>
#include <ctype.h>
#include <stdlib.h>
// 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... | ALGO | 0.999985 | 4.473313 |
43f77a29-21c7-480d-a150-a70916614cdd | ishandutta2007/codeforces | yukihana0416/normal/1343/F.cpp | #include <bits/stdc++.h>
using namespace std;
#define LL long long
typedef pair<int, int> pii;
template< typename T > inline void read(T &x)
{
static char _c;
static bool _f;
x = 0;
_f = 0;
_c = getchar();
while(_c < '0' || '9' < _c) {if(_c == '-') _f = true; _c = getchar();}
while('0' <... | ALGO | 0.99999 | 4.052985 |
7cb452a1-9ddf-4693-b8aa-ee53ba8388f1 | eeheueklf/BOJ | 2301/3009.cpp | #include <iostream>
using namespace std;
int main(){
ios::sync_with_stdio(0);
cin.tie(0);
int a[3], b[3];
for(int i=0;i<3;i++){
cin >> a[i] >> b[i];
}
if(a[0]==a[1]) cout << a[2] << " ";
else if(a[0]==a[2]) cout << a[1] << " ";
else cout << a[0] << " ";
if(b[0]==... | ALGO | 0.999926 | 3.653406 |
fdd0cd4b-25d7-4adf-8828-88564a4672bf | ishandutta2007/codeforces | rednextcentury/normal/1077/E.cpp | #include<bits/stdc++.h>
using namespace std;
int n;
map<int,int> mp;
vector<int> vec;
int main()
{
ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);
cin>>n;
for (int i=0;i<n;i++)
{
int x;
cin>>x;
mp[x]++;
}
for (auto it:mp)
vec.push_back(it.second);
sort(ve... | ALGO | 0.999869 | 3.887433 |
d8eee2e0-fc0e-41cd-98ae-f5dd13d41944 | SOFTK2765/PS | BOJ/16019.cpp | #include <bits/stdc++.h>
using namespace std;
int a[5];
int main()
{
for(int i=0;i<4;i++)
scanf(" %d", &a[i]);
for(int i=0;i<5;i++)
{
for(int j=0;j<5;j++)
{
if(i==j) printf("0 ");
else
{
int sum = 0, s = min(i, j), e = max(i, j);... | ALGO | 0.999935 | 3.139448 |
9cccd8d3-d713-4cee-829c-ac18ce15921b | vassbar/Codeforces | 222B.cpp | #include <cstdio>
#include <vector>
int main(){
long n(0), m(0), k(0); scanf("%ld %ld %ld", &n, &m, &k);
std::vector<std::vector<long>> data(n,std::vector<long>(m,0));
for(long row = 0; row < n; row++){
for(long col = 0; col < m; col++){
long temp(0); scanf("%ld", &temp);
... | ALGO | 0.998538 | 3.528591 |
54797679-3ddf-4bd5-9589-89f9d52515a8 | Atharv-09/OLD_DSA | PascalTraingle.cpp | #include<bits/stdc++.h>
using namespace std;
vector<vector<int>> pascalT(int size){
if(size==0) return {};
vector<vector<int>> ans;
vector<int> temp;
ans.push_back({1});
int m = 2;
int k = 1;
while(k<size){
temp.clear();
temp.push_back(1);
for(int i=1;i<m-1;... | ALGO | 0.999923 | 4.801381 |
6adfb358-baba-469b-88bd-f224a7aaccf6 | zhangsj96/athena_phase_transition | src/utils/matrix_mult.cpp | // C++ headers
#include <sstream>
#include <stdexcept>
// Athena headers
#include "../athena.hpp"
#include "./utils.hpp"
//======================================================================================
//! \file matrixmult.cpp
//=================================================================================... | ALGO | 0.999288 | 4.135527 |
7bf707c9-4971-4c55-83a2-c344d7f35eac | felipesdias/Extractor-URI-Online-Judge | URI-ES/PRINCIPIANTE/2534 - General Exam.cpp | // Autor: Felipe Souza Dias <<EMAIL>>
// Nome: General Exam
// Nível: %d
// Categoria: PRINCIPIANTE
// URL: https://www.urionlinejudge.com.br/judge/es/problems/view/2534
#include <bits/stdc++.h>
using namespace std;
typedef vector<int> vi;
int main()
{
ios::sync_with_stdio(false);
cin.tie(0);
int ... | ALGO | 0.9999 | 3.72578 |
eb0cdac4-e9e9-497e-a0a6-aadb4f421cde | simonpcook/or1k-llvm-project | llvm/lib/Analysis/MemorySSAUpdater.cpp | #define DEBUG_TYPE "memoryssa"
using namespace llvm;
// This is the marker algorithm from "Simple and Efficient Construction of
// Static Single Assignment Form"
// The simple, non-marker algorithm places phi nodes at any join
// Here, we place markers, and only place phi nodes if they end up necessary.
// They are on... | ALGO | 0.998902 | 7.409169 |
58168b44-2dbb-4077-88b2-5f89a3e19dc6 | LiangYue1981816/CrossEngine-CrossEngineVK | Dependencies/eastl/source/red_black_tree.cpp | #include <EASTL/internal/config.h>
#include <EASTL/internal/red_black_tree.h>
#include <stddef.h>
namespace eastl
{
// Forward declarations
rbtree_node_base* RBTreeRotateLeft(rbtree_node_base* pNode, rbtree_node_base* pNodeRoot);
rbtree_node_base* RBTreeRotateRight(rbtree_node_base* pNode, rbtree_node_base* pNodeRo... | ALGO | 0.997683 | 5.786501 |
9f37a3dc-192c-4d96-8fd6-5f097e8c71c3 | architjain2002/DSA-Notes | Trees/33.1.Populating_next_right_pointers_in_each_node_II_approach1.cpp | /*
// Definition for a Node.
class Node {
public:
int val;
Node* left;
Node* right;
Node* next;
Node() : val(0), left(NULL), right(NULL), next(NULL) {}
Node(int _val) : val(_val), left(NULL), right(NULL), next(NULL) {}
Node(int _val, Node* _left, Node* _right, Node* _next)
: val(_... | ALGO | 0.999908 | 5.851511 |
9d0ef364-38eb-4f9b-9202-801b6207467a | AlsoKnownAsZira/cekindong | 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.9988 | 6.76073 |
c98b0311-e2be-45c0-9717-f861321b7966 | koroshkv2000/ddnet | src/base/hash_libtomcrypt.cpp | // SHA-256. Adapted from https://github.com/kalven/sha-2, which was adapted
// from LibTomCrypt. This code is Public Domain.
#if !defined(CONF_OPENSSL)
#include "hash_ctxt.h"
#include <stddef.h>
#include <stdint.h>
#include <string.h>
typedef uint32_t u32;
typedef uint64_t u64;
typedef SHA256_CTX sha256_state;
sta... | ALGO | 0.972493 | 7.099618 |
69a1a273-2cf8-4dab-93b2-0fdcd6de3d89 | siddhantkhandelwal/competitiveprog-submissions | codechef/bcpcq1.cpp | #include<bits/stdc++.h>
using namespace std;
int calc (long long int k, long long int s=0, long long int j=1)
{
s=(j*(j+1))/2;
if(s<k)
{
j++;
return calc(k, s, j);
}
return j;
}
int main()
{
long long int t, w, k, i;
cin>>t;
for(i=0;i<t;++i)
{
cin>>w>>k;
int ... | ALGO | 0.999979 | 4.044781 |
aaee0b5e-bb45-4c68-ad1a-9f4558e2a609 | Kenshin2438/CP-Code-Collection | OJ/ATCODER/ABC234_G.cpp | /*******************************
| Author: Kenshin2438
| Problem: G - Divide a Sequence
| Contest: AtCoder - AtCoder Beginner Contest 234
| URL: https://atcoder.jp/contests/abc234/tasks/abc234_g
| When: 2022-03-11 19:35:28
|
| Memory: 1024 MB
| Time: 2000 ms
*******************************/
#include <bits/... | ALGO | 0.999971 | 4.429561 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.