uuid string | repo_name string | relative_path string | content string | category string | algo_rel_score float64 | quality_score float64 |
|---|---|---|---|---|---|---|
8e7b4370-34a3-474c-b4b6-fe4d7f2f8ea5 | intel/pti-gpu | tools/unitrace/test/grf/grf.cpp | #include <CL/sycl.hpp>
#include <iostream>
#ifdef __linux__
#include <unistd.h>
#endif
using namespace sycl;
int main(){
int GLOBAL_SIZE = 64 * 512;
queue q{gpu_selector(), {property::queue::in_order()}};
float *a = (float *)malloc_shared(sizeof(float)*GLOBAL_SIZE,q);
float *b = (float *)mall... | ALGO | 0.854005 | 3.215081 |
8ba3aff0-1e3e-4a8d-8fb3-f985fd1a9e7f | willy15662/leetcode-c- | Array_String/68. Text Justification_hard.cpp | //68. Text Justification (hard) 題目敘述在底下
class Solution {
public:
vector<string> fullJustify(vector<string>& words, int maxWidth) {
vector<string> result;
string word;
int width=0, cnt=0, num=0;
//如果只有一個字串時
if(words.size() == 1){
//放進去
word = words[0];... | ALGO | 0.999937 | 5.743127 |
bfbcd813-7213-437a-a937-877187878c04 | Edujesseyang/CIS_D022A | practice/bitwise/bitwise_operator.cpp | #include <iostream>
using namespace std;
int main() {
int x = 5; // binary 101
int y = 1; // binary 1
cout << x << " and " << y << " is " << (x & y) << endl;
/*
101
001
----- (only when 1 occur on both num at same digit. That digit return 1)
0 0 1 (都是1, and是1)
= 1
*/
cout << x << " or " ... | ALGO | 0.976903 | 4.162038 |
f4847a48-1e7e-40e5-80b0-8dd17127954d | SrujanMuralidhar/DSA | Algorithms/NQueens.cpp | #include<iostream>
#include<vector>
#include<string>
using namespace std;
bool isValidPosition(vector<string>& board,int row_index,int col_index,int n){
for (int i =0;i<n;i++){
if (board[row_index][i] == 'Q'){
return false;
}
}
int i = row_index;
int j = col_index;
wh... | ALGO | 0.999915 | 4.30368 |
bb425753-a64e-4874-868a-f60a4ea3d6fd | SaruarChy/Codeforces-Solution | 1368 A. C+=.cpp | //Bismillahir Rahmanir Rahim
#include<bits/stdc++.h>
#define ll long long
#define ull unsigned long long
#define fastread() (ios_base:: sync_with_stdio(false),cin.tie(NULL));
using namespace std;
int main()
{
fastread();
int t;
ll a,b,n;
cin>>t;
while(t--)
{
... | ALGO | 0.999885 | 3.306445 |
0fb87e12-1403-4828-860d-b25d632e8097 | Algo-Study-2409/algo-study-2409 | problems/week03/김민선/BOJ21939_문제 추천 시스템 Version1.cpp | #include<bits/stdc++.h>
using namespace std;
/*
- 68ms
- 구현
- map, set을 이용하여 난이도에 따라 문제를 정렬
- 문제를 추가, 추천, 푼 문제를 처리
*/
#define PII pair<int, int>
int N, M;
map<int, set<int>> mp; // L(난이도), P(문제 번호) 배열
unordered_map<int, int> problem_to_level; // 문제 번호 -> 난이도
int main() {
ios_base::sync_with_stdi... | ALGO | 0.999273 | 5.279446 |
4a7d594c-62aa-4f28-9454-980fe2db8751 | Lyd1995/Leetcode | C++/1260. 二维网格迁移.cpp | #include<iostream>
#include<vector>
#include<string>
#include<algorithm>
#include<set>
#include<map>
#include<queue>
#include<stack>
#include<math.h>
#include<sstream>
using namespace std;
class Solution {
public:
vector<vector<int>> shiftGrid(vector<vector<int>>& grid, int k) {
int n = grid.size(), m = gr... | ALGO | 0.999963 | 4.702635 |
bb15bd9d-ea88-4972-8d5c-baf7be1f8cde | DawsonBruce/Kadenze-Audio-Plugin | JuceModules/juce_box2d/box2d/Collision/b2CollideCircle.cpp | #include "b2Collision.h"
#include "Shapes/b2CircleShape.h"
#include "Shapes/b2PolygonShape.h"
void b2CollideCircles(
b2Manifold* manifold,
const b2CircleShape* circleA, const b2Transform& xfA,
const b2CircleShape* circleB, const b2Transform& xfB)
{
manifold->pointCount = 0;
b2Vec2 pA = b2Mul(xfA, circleA->m_p);
... | ALGO | 0.99943 | 7.679677 |
2f8b1da6-8925-487c-8bdc-970cac37570b | tanisha1244/DSA | Dynamic Programming/Palindromic Substrings.cpp | class Solution {
public:
int countSubstrings(string s) {
int n = size(s), cnt = n; // cnt = n, since each single letter is palindrome in itself.
// For odd length palindromes
for(int i = 1, l = 0, r = 2; i < n; i++, l = i - 1, r = i + 1)
while(l >= 0 && r < n && s[l] == s[r]) l--, r++, cnt++; ... | ALGO | 0.999951 | 6.42652 |
a2623179-2014-47f5-9c36-426c3b3dbf09 | EraserLark/Month-of-Code | C++PrinciplesAndPractice/Ch5_Errors/try2_temperatures.cpp | #include <iostream>
#include <vector>
using namespace std;
int main()
{
vector<double> temps;
for(double temp; cin >> temp;)
{
temps.push_back(temp);
}
double highTemp = 200;
double lowTemp = -200;
int tempNum = 0;
double sum = 0;
for (double x : temps)
{
tem... | ALGO | 0.982778 | 5.263403 |
2934e44b-9ac2-4384-9fd3-a39f779b22bf | pontus/psifdnotify | third-party/qca/qca/src/botantools/botan/mp_asm.cpp | namespace QCA { // WRAPNS_LINE
/*************************************************
* Lowest Level MPI Algorithms Source File *
* (C) 1999-2007 The Botan Project *
*************************************************/
} // WRAPNS_LINE
#include <botan/mp_asm.h>
namespace QCA { // WRAPNS_LINE
} // WRAPN... | ALGO | 0.996829 | 5.186111 |
1e608094-4dc1-4565-a5fa-9fc346c4f3a6 | MrRun2020/UE426 | Engine/Source/Programs/UnrealLightmass/Private/LightmassCore/Math/LMMath.cpp | #include "LMMath.h"
#include "LMCore.h"
namespace Lightmass
{
/** Converts a linear space XYZ color to linear space RGB. */
FLinearColor FLinearColorUtils::XYZToLinearRGB(const FLinearColor& InColor)
{
FLinearColor SourceXYZ(InColor);
// Inverse of the transform in FLinearColor::LinearRGBToXYZ()
const FMatrix XYZT... | ALGO | 0.859926 | 6.731143 |
577928b6-4580-4891-ab63-06c00b476dd2 | ShujiaHuang/gatk_pipeline | bamtools/src/toolkit/bamtools_sort.cpp | // ***************************************************************************
// bamtools_sort.cpp (c) 2010 Derek Barnett, Erik Garrison
// Marth Lab, Department of Biology, Boston College
// ---------------------------------------------------------------------------
// Last modified: 27 March 2012 (DB)
// -----------... | ALGO | 0.98345 | 6.672779 |
cfc89e5d-674e-4a09-80a7-8f54d04aec92 | shaikhaqsaa/c-ass | mult.cpp | #include<iostream>
using namespace std;
class mult
{
public:
int multiplication;
mult()
{
multiplication=0;
}
mult(int a,int b)
{
multiplication=a*b;
}
void display()
{
cout<<"ans :"<<multiplication;
}
};
main()
{
mult m;
mult m1(23,4);
m.display();
m1.display();
}
| ALGO | 0.970715 | 3.655418 |
da480545-0813-4d1f-a3b0-405fb7192ed4 | sungjoonyoung/SCPC | 2025_pre1/2.cpp | #include<iostream>
using namespace std;
void solve(void){
long long N,L;
cin>>N>>L;
long long answer=0;
long long tmp=0;
long long maxnum=-1;
while(N--){
long long in;
cin>>in;
answer+=min(in,L-in)*2;
tmp+=in*2;
maxnum=max(maxnum,min(in,L-in)*2);
}
... | ALGO | 0.999793 | 3.082593 |
7798d427-a292-41d6-88a4-d167d84782c2 | MIT-SPARK/Hydra | src/frontend/place_2d_segmenter.cpp | #include "hydra/frontend/place_2d_segmenter.h"
#include <config_utilities/config.h>
#include <config_utilities/types/conversions.h>
#include <config_utilities/types/enum.h>
#include <glog/logging.h>
#include <kimera_pgmo/mesh_delta.h>
#include <memory>
#define PCL_NO_PRECOMPILE
#include <pcl/segmentation/extract_clus... | ALGO | 0.991998 | 3.756726 |
ee3abae2-880a-4c15-b459-f65cdd9d4484 | minhle02/algorithm | helper/DSU.cpp | #include <bits/stdc++.h>
using namespace std;
using ll = long long;
class DSU {
public:
DSU(int n) : parent(n, -1), size(n, 0), count(n) {}
void make_set(ll v) {
parent[v] = v;
size[v] = 1;
}
int find_set(int v) {
if (parent[v] == -1) {
make_set(v);
re... | ALGO | 0.996164 | 3.972666 |
09d8283b-3bc3-4031-a2f3-8a2f9ff11359 | ek1903/informationtechnologies | 8.migraine_minimization/main.cpp | #include <iostream>
#include <cmath>
using namespace std;
void migraine_minimization(int n){
int square, number = 0;
while (n > 0){
square = (int)sqrt(n);
n-=square*square;
number++;
}
cout << number * 4;
}
int main(){
int n;
cin >> n;
Migraine_minimization(n);
return 0;
... | ALGO | 0.999589 | 3.685315 |
bdde1664-e3d3-4fed-b500-9843df7e095b | sick-py/CC189Cpp | solutions/Ch 1.Arrays And Strings/10.Ouicksort.cpp | #include <iostream>
using namespace std;
int partition(int *arr,int low,int high);
void quick(int *arr,int low,int high){
if(high>low){
int cnst=partition(arr,low,high);
quick(arr,low,cnst-1);
quick(arr,cnst+1,high);
}
}
int partition(int *arr,int low,int high){
int pivot=arr[low];
int i=low,j=high+1;
while(i<j){
... | ALGO | 0.999963 | 4.529699 |
d34319bb-72b3-47e5-9502-699c9100646d | LVKinyanjui/Languages | Cpp/3/linked_lists.cpp | #include <cstdio>
struct Element {
Element* next{};
Element* previous{};
void insert_after(Element* new_element) {
// The this pointer is sometimes useful for clarity
// though is not strictly necessary here
new_element->next = this->next;
this->next = new_element;
}
... | ALGO | 0.873046 | 4.634285 |
889fe62d-6249-4c13-b534-7643b5164bdf | prashantjagtap2909/LeetCode-POTD_2024 | 10 October/25 Oct: 1233. Remove Sub-Folders from the Filesystem.cpp | class Solution {
public:
vector<string> removeSubfolders(vector<string>& folder) {
int n=folder.size();
sort(folder.begin(), folder.end());
vector<string> ans={folder[0]};
string prev=folder[0];
for(int i=1; i<n; i++){
string s=folder[i];
if (s.find(pr... | ALGO | 0.990366 | 5.339604 |
9212f6cf-ccb2-4c76-a0c7-022998ee047b | Prashantpx-17237/Leetcode-Solutions | 0560-subarray-sum-equals-k/0560-subarray-sum-equals-k.cpp | class Solution {
public:
int subarraySum(vector<int>& nums, int k) {
int n = nums.size(), ans = 0;
unordered_map<int, int> lookup;
int pre = 0;
lookup[0] = 1;
for(int i = 0 ; i < n ; i++){
pre += nums[i];
if(lookup.find(pre - k) != lo... | ALGO | 0.999915 | 6.290082 |
fe0e5987-548e-4804-a270-35aa8472836d | Thugday/BOJ | 11021.cpp | #include <iostream>
using namespace std;
int main() {
ios_base::sync_with_stdio(false);
cin.tie(nullptr);
int t;
cin >> t;
int a, b;
while (t--) {
for (int i = 1; i <= t + 1; i++) {
cin >> a >> b;
int sum = a + b;
cout << "Case #" << i << ": " << sum << '\n';
}
break;
}
return 0;
} | ALGO | 0.977109 | 5.227424 |
187ac927-ef4e-4e7f-a43e-a9acec1080db | ishandutta2007/codeforces | eecs/normal/623/D.cpp | #include <bits/stdc++.h>
using namespace std;
const int maxn = 110;
int n;
double ans, prob = 1, cur[maxn], p[maxn];
int main() {
scanf("%d", &n);
if (n == 1) puts("1"), exit(0);
double prob = 1;
for (int i = 1, x; i <= n; i++) {
scanf("%d", &x);
p[i] = cur[i] = (100 - x) / 100.0, prob... | ALGO | 0.999863 | 3.383345 |
31084c26-e9fb-4694-b821-3db06f62164f | yushi-hosokawa/AtcoderPractice | ABC/ABC163/QD.cpp | #include <bits/stdc++.h>
#define rep(i,n) for (int i= 0;i<(n);++i)
using namespace std;
typedef long long ll;
typedef pair<int,int> P;
// modint: mod 計算を int を扱うように扱える構造体
template<int MOD> struct Fp {
long long val;
constexpr Fp(long long v = 0) noexcept : val(v % MOD) {
if (val < 0) val += MOD;
}
... | ALGO | 0.999906 | 3.831825 |
b3c3edee-3e68-41c6-b6b7-37017157c12a | itsabhijeetid/gfg-practice | Easy/Check if strings are rotations of each other or not/check-if-strings-are-rotations-of-each-other-or-not.cpp | //{ Driver Code Starts
#include <bits/stdc++.h>
using namespace std;
// } Driver Code Ends
class Solution
{
public:
//Function to check if two strings are rotations of each other or not.
bool areRotations(string s1,string s2)
{
// Your code here
if (s1.length() != s2.length())
... | ALGO | 0.999852 | 5.595568 |
b1e1947a-ff31-4a3a-80cd-13f3f5bc14b0 | Smrity01/Data-Structures-Algorithms | Algorithms/matrix chain multiplication complexity.cpp | /*
Complexity Order of matrix multiplication using Dynamic Programming
written By : Smrity Chaudhary
Dated : 28/10/2018
*/
#include<iostream>
#include<vector>
#include<cstdlib>
#include<ctime>
#include<fstream>
using namespace std;
void fill_dimensions(int);
void matrix_multiplication(vector<int>);
void write_in_... | ALGO | 0.99831 | 3.527992 |
eb713a7a-bf4c-40ae-aee0-841a16492b19 | DWWC-22BCSKPIT-901/day-3-assignment-CholleBhature | A1.cpp | #include <iostream>
#include <vector>
#include <algorithm>
using namespace std;
int candy(vector<int> &ratings)
{
int n = ratings.size();
vector<int> candies(n, 1);
// Left to right pass
for (int i = 1; i < n; ++i)
{
if (ratings[i] > ratings[i - 1])
{
candies[i] = candi... | ALGO | 0.999998 | 6.417636 |
da590eb7-7f19-404b-af1d-1f6e46fcd40e | Longerhaha/Leetcode_Cpp | 406_(根据身高重建队列)Queue Reconstruction by Height/406_(根据身高重建队列)Queue Reconstruction by Height.cpp | class Solution {
public:
//函数中涉及到的c++知识
//pair<int, int> 可以理解为包含两个元素的结构体
//vector<pair<int, int>> 是个长度可变的结构体数组,c++里面称为容器
//ret_func_type func(vector<pair<int, int>>& name) 中的name是vector<pair<int, int>>容器的引用,可以理解为传入一个指针
//sort(g.begin(), g.end(), cmp) 对容器g的结构体按照cmp的排序规则排序,容器的起始数据的指针是 g.begin(),容器的末尾数... | ALGO | 0.99999 | 5.431155 |
c4b83b63-9421-483e-b10d-fb700d64ac87 | lazar2222/Algorithms-Data-Structures-Homework | Trie Text Prediction/main.cpp | #include <iostream>
#include <fstream>
#include <filesystem>
#include <chrono>
#include "Predictor.h"
using namespace std;
const bool info = false;
struct core
{
Predictor P;
};
void PrintInfo();
void PrintMenu(core& C);
void HandleMenu(core& C, bool&);
void initFromFile(core& C);
void initFromDir(core& C);
void ... | TOOL | 0.911898 | 4.49559 |
17b7b6b0-86f8-42b0-893c-c48c253596ad | wookim0719/codingTest-practices | class4,5/1541.cpp | #include<bits/stdc++.h>
using namespace std;
string s;
vector<char> oper;
vector<int> v;
int ret=987654321;
int go(int y, int x){
int sum=v[y];
int sum2=0;
for(int i=y; i<x; i++){
if(oper[y]=='+'){
sum+=v[i+1];
}
else{
sum-=v[i+1];
}
}
if(y>0){
if(oper[y-1]=='-'){
sum= -sum;
... | ALGO | 0.999998 | 3.98745 |
2c96a307-54ca-46f4-8f11-a6ccc8949851 | ssevR/cses | Range_Queries/Range_Queries_and_Copies/main.cpp | #pragma GCC optimize("O3")
#include <bits/stdc++.h>
using namespace std;
#define IOS ios::sync_with_stdio(false); cin.tie(0)
#define ll long long
#define ld long double
#define mp(a, b) make_pair(a, b)
#define pii pair<int, int>
#define pll pair<ll, ll>
#define pil pair<int, ll>
#define pli pair<ll, int>
#define ... | ALGO | 0.999576 | 4.906986 |
1f0ab478-6350-42f7-b32c-487964939cbe | Praveen240503/gfg_practice_programs | Medium/Largest prime factor/largest-prime-factor.cpp | //{ Driver Code Starts
#include<bits/stdc++.h>
using namespace std;
// } Driver Code Ends
class Solution{
public:
long long int largestPrimeFactor(int N){
// code here
long long i=2;
while(i<=(int)sqrt(N)){
if(N%i==0)N/=i;
else i++;
}
return (long l... | ALGO | 0.999903 | 5.782174 |
022d09f7-07c2-4d27-93b9-a33d44699e49 | piyush1146115/Competitive-Programming | Code forces/round 400/B.cpp | #include<bits/stdc++.h>
using namespace std;
#define mxx 1000005
int chk[mxx];
void sieve( int n)
{
for(int i = 4; i <= n; i += 2)
chk[i] = 1;
for(int i = 3; i * i <= n; i += 2){
if(chk[i] == 0){
for(int j = i * i; j <= n; j += (i * 2))
chk[j] = 1;
}
}
}
int main()
{
int n;
cin >> n;
sieve(n +... | ALGO | 0.999912 | 3.86123 |
2122aa41-2d9d-4194-a576-ce0112c2148b | 113bommy/deepmind_codecontests_refine | cpp_gold_filter_file/cpp_train_8297_3.cpp | #include <bits/stdc++.h>
using namespace std;
const long long mod = 998244353;
const long long mod2 = 1e9 + 9;
const int N = 1e6;
long long fpow(long long base, long long expo) {
long long res = 1;
base %= mod;
while (expo > 0) {
if (expo & 1) res = (res * base) % mod;
base = (base * base) % mod;
expo... | ALGO | 0.999932 | 4.440606 |
7f242be2-2c41-4933-bd85-a240e044ff23 | wangzjpku/StitchingVideo | stitching/OpenCV2.4.11-Stitching-64bit/OpenCV2.4.11-Stitching/src/blenders.cpp | #include "precomp.hpp"
using namespace std;
namespace cv {
namespace detail {
static const float WEIGHT_EPS = 1e-5f;
Ptr<Blender> Blender::createDefault(int type, bool try_gpu)
{
if (type == NO)
return new Blender();
if (type == FEATHER)
return new FeatherBlender();
if (type == MULTI_BAN... | TOOL | 0.886059 | 6.122855 |
682e4aeb-4701-4137-af7d-306662206d17 | Arthurb101/cougarcoin | src/script/interpreter.cpp | #include "interpreter.h"
#include "primitives/transaction.h"
#include "crypto/ripemd160.h"
#include "crypto/sha1.h"
#include "crypto/sha256.h"
#include "pubkey.h"
#include "script/script.h"
#include "uint256.h"
typedef std::vector<unsigned char> valtype;
namespace {
inline bool set_success(ScriptError* ret)
{
i... | ALGO | 0.880242 | 6.029539 |
bb811d37-70bf-4bd2-8341-9dfb53e105c3 | Taejin1221/Problem-Solving | Baekjoon/Baekjoon01303.cpp | // Baekjoon01303.cpp
// https://www.acmicpc.net/problem/1303
#include <iostream>
using namespace std;
const int moves[4][2] = { { -1, 0 }, { 0, 1 }, { 1, 0 }, { 0, -1 } };
int n, m;
char colorMap[100][101];
bool visited[100][100];
int dfs(int row, int col) {
int result = 0;
for (int i = 0; i < 4; i++) {
int new... | ALGO | 0.999903 | 4.745395 |
8a0ace7c-50a2-4985-ac5b-b56172a216d0 | pankajbhatt150/LeetCode-Question-DSA-14-days- | 75-sort-colors/75-sort-colors.cpp | class Solution {
public:
void sortColors(vector<int>& nums) {
int low = 0, mid = 0, high = nums.size() - 1;
// logic:
while(mid <= high)
{
switch(nums[mid])
{
case 0: swap(nums[low++], nums[mid++]); break;
... | ALGO | 0.99998 | 6.299651 |
36b18985-0aa6-42e9-9788-2029b82e7561 | wlrnfyd0329/algorithm | BaekJoon/13 시뮬레이션/15683 감시 v2.cpp | #include <iostream>
#include <vector>
#include <algorithm>
using namespace std;
int vis[10][10][10];
int check[10][10];
vector<pair<int, int>> cctv;
int dx[4] = {1, 0, -1, 0};
int dy[4] = {0, 1, 0, -1};
int min_value = 100;
int n, m;
void check_and_reset() {
int cnt = 0;
for (int i = 0; i < n; i++) {
... | ALGO | 0.99975 | 5.12465 |
3e942ed5-ff9d-4de6-9813-2984e5019038 | Hobby-Dev-0/SpeedoBACKUP | AndroidClient/Box2D/Collision/Shapes/b2EdgeShape.cpp | #include <Box2D/Collision/Shapes/b2EdgeShape.h>
#include <new>
#include "Box2D/Collision/Shapes/b2Shape.h"
#include "Box2D/Collision/b2Collision.h"
#include "Box2D/Common/b2BlockAllocator.h"
using namespace std;
void b2EdgeShape::Set(const b2Vec2& v1, const b2Vec2& v2)
{
m_vertex1 = v1;
m_vertex2 = v2;
m_hasVerte... | ALGO | 0.895843 | 7.732557 |
9afc82f5-1832-4de5-a673-249d8b6ea9d1 | shriramkv/SYCLwithIDC | Publications/GPU-Opt-Guide/OpenMP/11_device_alloc/test_target_alloc.cpp | #include <math.h>
#include <omp.h>
#define P 16
#define BLOCKS 8
#define SIZE (BLOCKS * P * P * P)
#define MAX 100
#define scaled_rand() ((rand() % MAX) / (1.0 * MAX))
#define IDX2(i, j) (i * P + j)
#define IDX4(b, i, j, k) (b * P * P * P + i * P * P + j * P + k)
int main(void) {
double w[SIZE]; /* out... | ALGO | 0.999631 | 4.378749 |
a9392ff6-4ab9-44cf-9cfb-0918df165076 | DarshanGhorpade/GFG-POTD | 2024/July/12_07_2024_RootToLeafPathSum.cpp | /*
Problem Link ---> https://www.geeksforgeeks.org/problems/root-to-leaf-path-sum/1
Difficulty ---> Easy
Given a binary tree and an integer target, check whether there is a root-to-leaf path with its sum as target.
Examples :
Input: tree = 1, target = 2
/ \
2 3
Output: false
Explanation... | ALGO | 0.999696 | 6.998686 |
205c60f3-7e51-4a42-9ba6-4a747dbf6419 | UllasDas004/DSA-WITH-CPP-Learning- | 26 DYNAMIC PROGRAMMING/01Knapsack.cpp | #include<bits/stdc++.h>
using namespace std;
int helper(int c, vector<int> &val, vector<int> &wt,int idx,int w,vector<vector<int>>& dp)
{
if(idx == val.size()) return 0;
if(dp[idx][w] != -1) return dp[idx][w];
if(w + wt[idx] > c) return dp[idx][w] = helper(c,val,wt,idx+1,w,dp);
int take = val[idx] + he... | ALGO | 0.999995 | 4.6845 |
2ec826ca-5db1-4bb4-b765-8407f9030eb2 | Akshay0263/Codeforces | CF871/QC.cpp | #include <bits/stdc++.h>
using namespace std;
int main(){
int t;
cin >> t;//testcaser
for(int p=0;p<t;p++){
int n;cin>>n;
int time[n],matrix[n];
unsigned int bothtimekeeper =999999999;
for(int i=0;i<n;i++){
cin>>time[i]>>matrix[i];
bothtimekeeper = matrix[i] =... | ALGO | 0.999509 | 3.98475 |
780e7f70-3820-4b62-97c2-b998a21cc6d7 | okpiyush/LearningCPP | CodeChef/DSA Problems/Easy Starters/findme.cpp | #include <iostream>
using namespace std;
int findme(int a,int b){
int arr[a],k;
for (int i = 0; i < a; i++)
{
cin>>k;
arr[i]=k;
}
for (int i = 0; i < a; i++)
{
if(b==arr[i]){
cout<<i;
return i;
break;
}
}
cout<<-1;
};
... | ALGO | 0.999816 | 3.979468 |
ae882ca9-ec2f-43ed-93ee-5dac2d56038b | mahdinaghikhanii/WhatsApp_ui | 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.998762 | 6.786404 |
a80c33c8-9a94-48fb-85d2-7797977cda14 | ishandutta2007/codeforces | sdya/normal/591/A.cpp | #include <iostream>
#include <set>
using namespace std;
int main() {
// your code goes here
double l, p, q;
cin >> l >> p >> q;
double t = l / (p + q);
cout << t * p << endl;
return 0;
} | ALGO | 0.999874 | 3.822306 |
7c1a691b-915e-4b78-9742-92609112cb27 | Vaibhav-Goti/ImageEnhancer | ImageEnhancer/opencv1/sources/3rdparty/carotene/src/mul.cpp | #include "common.hpp"
#include "vtransform.hpp"
#include <cstring>
#include <cfloat>
#include <cmath>
#include <limits>
namespace CAROTENE_NS {
#ifdef CAROTENE_NEON
namespace {
bool isIntegerScale(f32 scale)
{
return std::fabs(scale - static_cast<s32>(scale)) < FLT_EPSILON;
}
template <s32 shift>
void mulu8(c... | TOOL | 0.929228 | 6.135259 |
c5e6275e-d785-41e9-b8ac-514e57b2b620 | Kushal-2002/DSA | Searching/FirstOccurenceOfAnElement.cpp | //1 2 3 4 5
//O(log n) solution better than Naive O(n)
#include <bits/stdc++.h>
using namespace std;
int firstOcc(int arr[],int n,int x)
{
int low=0,high=n-1;
while(low<=high)
{
int mid=(low+high)/2;
if(arr[mid]>x)
high=mid-1;
else if(arr[mid]<x)
low=... | ALGO | 0.999969 | 5.709743 |
7e8df30d-6912-4037-8e31-ef306c66fcd8 | fushime2/competitive | atcoder/abc/c_ume/abc020.cpp | #include <bits/stdc++.h>
using namespace std;
#define FOR(i,a,b) for(int i=(a);i<(int)(b);i++)
#define rep(i,n) FOR(i,0,n)
#define mset(a,x) memset(a,x,sizeof(a))
int h,w,t;
int s,g;
vector<string> f;
int dx[]={1,0,-1,0}, dy[]={0,1,0,-1};
bool is_out(int x, int y){
return x<0 or y<0 or x>=w or y>=h;
}
long ... | ALGO | 0.999901 | 4.320323 |
2c1cbc2a-4a94-4f4b-b0c9-f5e3bea918cb | daybreaker42/2025-algorithm-study | 이어진/2주차/자료구조2/11286-절댓값힙.cpp | #include <iostream>
#include <queue>
#include <cmath>
#include <vector>
int main() {
int n;
std::cin >> n;
std::priority_queue<std::pair<int, int>, std::vector<std::pair<int, int>>, std::greater<std::pair<int, int>>> abs_heap;
for (int i = 0; i < n; ++i) {
int command;
std::cin >> comma... | ALGO | 0.999985 | 4.622215 |
a2b3a117-009b-4df4-bb82-08a5c017dae0 | arkcimi/learngit | Fraction.cpp | #include "Fraction.h"
#include <stdexcept>
Fraction::Fraction() : up(0), down(1) {}
Fraction::Fraction(int u, int d) : up(u), down(d) {
reduce();
}
const Fraction One(1, 1);
const Fraction Zero(0, 1);
void Fraction::reduce() {
if (down < 0) {
up = -up;
down = -down;
}
if (up == 0) do... | TOOL | 0.959343 | 5.740926 |
e37919e2-25c9-4586-9004-e68b399a30d6 | LDlornd/OI-Memory | 洛谷/P3000~P3999/P3376 【模板】网络最大流/P3376 【模板】网络最大流.cpp | #include<cstdio>
#include<cstring>
#include<cstdlib>
#include<iostream>
using namespace std;
const int MAXN=10001;
long long int ans=0;
int n,m,s,t,u,v,k;
int depth[MAXN];
int Queue[MAXN],head,tail;
struct edge{
int v,remain;
edge *Next,*rev;
edge() {v=remain=0;Next=rev=NULL;}
}*con[MAXN],*now[MAXN];
inline void ins... | ALGO | 0.999837 | 3.911463 |
3e69c9d5-7794-4ac0-83d9-188315b41d50 | sdpkjc/training | S_tra/19-08-31/b.cpp | #include <algorithm>
#include <cmath>
#include <iostream>
using namespace std;
int main() {
long long n, p;
cin >> n >> p;
long long sum = 0;
for (int i = 0; i < n; i++) {
long long t;
cin >> t;
sum += abs(t - p);
}
cout << sum << endl;
return 0;
} | ALGO | 0.999944 | 3.879436 |
7bd642bd-e5bd-4d9e-9a89-48bfc9bb0221 | sohids/ps | docs/DevSkill_CP/Intermediate/Batch 5/Class 1/code.cpp | #include <bits/stdc++.h>
using namespace std;
int main()
{
while(1)
{
}
int n;
scanf("%d", &n);
if(n > 2 && n % 2 == 0) puts("YES");
else puts("NO");
return 0;
}
| ALGO | 0.996336 | 3.537756 |
ffdb037d-7287-487f-bd69-702155f0a8d9 | lushij/kaoyan | 循环队列/队列_链表版/main.cpp |
#define _CRT_SECURE_NO_WARNINGS 1
//˽⼴ɿгѭ
#include<stdio.h>
#include<stdlib.h>
typedef int ElemType;
typedef struct node {
ElemType data;
struct node* next;
}Linklist,*LNode;
typedef struct{
LNode rear;//ͷ
LNode front;//β
}LinkeQue;
void init_link_que(LinkeQue& q)
{
q.front = q.rear = (LNode)malloc(sizeof(Lin... | ALGO | 0.999424 | 3.640558 |
a7a5e359-cb47-4d75-9c0b-27525ae14b08 | ViktorMilanov05/FMI_IntroInPrograming | Tasks/UP-Exam Prep/isPrime.cpp | #include <iostream>
using namespace std;
void isPrime() {
int n;
cin >> n;
if (n <= 1) {
cout << "Not prime";
}
int sqrtN = sqrt(n);
bool isPrime = true;
for (size_t i = 0; i <= sqrtN; i++)
{
if (n % i == 0)
isPrime = false;
}
if (isPrime)
std::cout << "Prime";
else {
std::cout << "Not Prime";
}... | ALGO | 0.997742 | 4.581575 |
e24706cb-b07a-463a-ba96-09bbb94a701c | PradyumnaThakare/FDS-LAB-SEM-3 | 7_parathese.cpp | /*
In any language program mostly syntax error occurs due to unbalancing delimiter such as (),{},[].
Write C++ program using stack to check whether given expression is well parenthesized or not
*/
#include<iostream>
#include<stack>
using namespace std;
bool valid(string s)
{
int n=s.length();
stack<char>st;
bool ... | ALGO | 0.998513 | 6.445104 |
8513e04d-40c6-45dd-aeb5-44b9a5407f9d | Koyingtw/CP | NTHU-CP/0/A.cpp | #include <bits/stdc++.h>
#define Weakoying ios::sync_with_stdio(0), cin.tie(0), cout.tie(0);
#define int long long
#define ll long long
#define pii pair<int, int>
#define vi vector<int>
#define vii vector<pair<int, int>>
#define pqueue priority_queue
#define pb push_back
#define F first
#define S second
#define max(a, ... | ALGO | 0.999919 | 4.077969 |
0dedcaee-6919-4167-9948-263b4736c7e0 | shariarf39/Code-Forces | 443A.cpp | #include<iostream>
using namespace std;
int main(){
string s;
getline(cin, s);
int a[26] = {0};
for(int i=0; i<s.length(); i++){
if(s[i] >= 'a' && s[i] <= 'z'){
a[s[i]-'a'] = 1;
}
}
int ans = 0;
for(int i=0; i<26; i++){
ans += a[i];
}
cout<<ans<<en... | ALGO | 0.999441 | 3.709355 |
50041ed8-6682-47e1-b403-d8ef0706a4a2 | sourabh59-coder/StriverA-Z_Sheet | Step 16: Dynamic Programming/Lec 07: DP in LIS/05. Longest String Chain/Approach1.cpp | bool comp(string &a,string &b)
{
return (a.size() < b.size());
}
class Solution {
public:
bool isAccept(string s1,string s2)
{
if(s1.size() != s2.size() + 1) return false;
int i = 0;
int j = 0;
while(i < s1.size())
{
if(s1[i] == s2[j])... | ALGO | 0.999995 | 5.530198 |
0476e22f-fda8-4187-9a5c-885ff20b0e0f | champola9/AED | POO/lista4_3.cpp | #include <iostream>
#include <vector>
using namespace std;
int pesqseq(const vector<int>& vetor, int val) {
for (int i = 0; i < vetor.size(); ++i) {
if (vetor[i] == val) {
return i;
}
}
return -1;
}
int main() {
vector<int> vetor = {1, 2, 3, 4, 5, 6, 7, 8};
int Busca... | ALGO | 0.998982 | 5.614052 |
75a4dfb8-1760-4081-a45a-166fefbd9044 | Peacefull-beast/PeaceCode1 | 0081-search-in-rotated-sorted-array-ii/0081-search-in-rotated-sorted-array-ii.cpp | class Solution {
public:
bool search(vector<int>& arr, int target) {
int low = 0;
int high = arr.size()-1;
while(low <= high)
{
int mid = (low + high) / 2;
if(arr[mid] == target)
return true;
if(a... | ALGO | 0.999981 | 5.996045 |
6e14b61d-c9b7-48ae-8935-009ed594b447 | sailfishos-mirror/llvm-project | libc/src/math/generic/f16fma.cpp | #include "src/math/f16fma.h"
#include "src/__support/FPUtil/FMA.h"
#include "src/__support/common.h"
#include "src/__support/macros/config.h"
namespace LIBC_NAMESPACE_DECL {
LLVM_LIBC_FUNCTION(float16, f16fma, (double x, double y, double z)) {
return fputil::fma<float16>(x, y, z);
}
} // namespace LIBC_NAMESPACE_D... | ALGO | 0.902207 | 6.794887 |
2568d75b-9046-4785-a0ee-4bea96a5052a | julius-alexander/fractal_generator | hilbert-driver.cpp | #include <iostream>
#include <unordered_map>
#include <cstring>
using namespace std;
#include "hilbert.h"
const int HILBERT_LEVEL = 3;
const int IMAGE_SIZE = 5000;
const string OUTPUT_FILE = "hilbert.bmp";
int main() {
HilbertCurve curve(HILBERT_LEVEL, IMAGE_SIZE);
curve.writeToFile(OUTPUT_FILE);
cout <<... | ALGO | 0.998471 | 5.324113 |
aeaab248-03f3-40f0-bc78-9f0c5123c9ca | Dongubak/DataStructureAndAlgorithm | 복습/수학/기하/033.cpp | #include <iostream>
#include <cmath>
using namespace std;
struct pos {
int x;
int y;
pos(int X = 0, int Y = 0) : x(X), y(Y) {}
int operator*(pos B) {
return x * B.x + y * B.y;
}
int cross(pos B) {
return x * B.y - y * B.x;
}
double getLength() {
return sqrt(pow(x, 2) + pow(... | ALGO | 0.999503 | 4.088825 |
e8685759-6413-426a-97e8-e31586ab6b27 | andzh1/Codeforces | Round #901/F.cpp | #include <bits/stdc++.h>
using namespace std;
#define int int64_t
#define vi vector<int>
#define get(a) int a; cin >> a;
#define repeat(n) for(int i = 0; i < n; ++i)
#define loop(j, n) for(int j = 0; j < n; ++j)
#define iloop(n) loop(i, n)
#define jloop(n) loop(j, n)
#define kloop(n) loop(j, n)
#define all(v) v.begin... | ALGO | 0.999816 | 4.836001 |
b7679a3f-f007-4462-991a-6c34c1288210 | TopAcademy/WorkWithArray | WorkWithArray.cpp | #include <iostream>
using std::cout;
// Print all array elements
// and nothing else
void show_array(int* m, int s)
{
int i;
for (i = 0; i < s; i++) {
cout << m[i] << ", ";
}
cout << (char)8 << (char)8<< "\n";
}
// Fill array function
void fill_array(int* m, int sz)
{
for (int i = 0; i < ... | ALGO | 0.998193 | 3.971158 |
37f5e268-a83e-4a8f-b58c-29c13e5d2869 | SandeepSinghSethi/DS-and-Algo-CPP | Sorting_algorithms/bucket_sort.cpp | #include <bits/stdc++.h>
#include "bucket_sort.h"
using namespace CLRS::CH8_3;
int main(int argc, char const *argv[])
{
BKT<float> arr = {73,45,23,11,05,454,14,56,4};
arr.init();
printarray(arr);
bucket_sort(arr);
printarray(arr);
return 0;
} | ALGO | 0.999373 | 4.175039 |
511590ff-85fe-4bc7-b102-7ccb3adfe432 | aegelfand/GBP | GeneralizedBeliefPropagation/src/Partition.cpp | /*
* Partition.cpp
*
* Created on: Feb 6, 2013
* Author: root
*/
#include "Partition.h"
int Cluster::s_count = 0;
int ClusterEdge::s_count = 0;
string Cluster::toString() {
stringstream ss;
ss << m_ID << ":(" << varsToString(m_variables) << "):";
for (int i = 0; i < (int)m_edges.size(); i++) {
if (i ... | ALGO | 0.972748 | 5.567592 |
c2dacaf3-0e03-464d-80b1-be71efd1a1f2 | ca2/app | acme/filesystem/filesystem/file_dialog.cpp | // Created by camilo on 2023-02-21 04:00 BRT <3ThomasBorregaardSorensen!!
#include "framework.h"
#include "file_dialog.h"
#include "acme/user/user/element.h"
#include "acme/platform/node.h"
//#include "path.h"
////#include "acme/prototype/prototype/payload.h"
////#include "acme/prototype/collection/numeric_array.h"
//
... | TOOL | 0.861795 | 5.731141 |
05de4bed-1285-4272-ad66-0406e90b26f3 | ainayeem/Phitron_programming_course | 4.Introduction to Algorithms/Module 25/1_unbound_knapsack.cpp | #include <bits/stdc++.h>
using namespace std;
int dp[1005][1005];
int unbound_knapsack(int n, int s, int v[], int w[])
{
if (n == 0 || s == 0)
return 0;
if (dp[n][s] != -1)
return dp[n][s];
if (w[n - 1] <= s)
{
int ch1 = v[n - 1] + unbound_knapsack(n, s - w[n - 1], v, w);
... | ALGO | 0.999989 | 4.00416 |
844bddfa-127d-4d90-962b-1f67091889c5 | backjoao88/Introduction-to-Algorithms | Chapter11/11.3-3.cpp | /****
*
* 11.3-3
* Consider a version of the division method in which h(k) = k mod m, where
* m = 2^p - 1 (a prime number) and k is a character string interpreted in radix 2p. Show that if string x
* can be converted to string y by permuting its characters, then x and y hash to the
* same value. Give an example o... | ALGO | 0.998933 | 5.144885 |
43c50b8a-c46d-4a73-902d-d7efa376283e | jonbaer/online-planning-rts-agents | StarCraft v6.2/jmetalcpp/src/metaheuristics/de/DE.cpp | #include <DE.h>
/*
* This class implements a differential evolution algorithm.
*/
/**
* Constructor
* @param problem Problem to solve
*/
DE::DE(Problem *problem) : Algorithm(problem) {
} // DE
/*
* Runs of the DE algorithm.
* @return a <code>SolutionSet</code> that is a set of non dominated solutions
* as a ... | ALGO | 0.999996 | 6.112828 |
d48c6491-e7e2-4297-afec-7e0b1f6b4743 | BharaTSarkar7/Dsa-Question | Binary Tree/sum_of_tree.cpp | #include <bits/stdc++.h>
using namespace std;
class TreeNode
{
public:
int data;
TreeNode *left;
TreeNode *right;
// Constructor
TreeNode()
{
this->data = 0;
this->left = NULL;
this->right = NULL;
}
TreeNode(int new_data)
{
this->data = new_data;
... | ALGO | 0.999918 | 5.366842 |
50d217a0-8eac-4562-a8e1-30274578756b | divyang9575/CP | implementation/E_Look_Back.cpp | #include<bits/stdc++.h>
using namespace std;
#ifndef ONLINE_JUDGE
#define db(x) cerr << #x <<" "; _print(x); cerr << endl;
#else
#define db(x)
#endif
void _print(int t) {cerr << t;}
void _print(long long int t) {cerr << t;}
void _print(string t) {cerr << t;}
void _print(char t) {cerr << t;}
void _print(double t) {cerr... | ALGO | 0.999257 | 4.459381 |
6db504fb-6eef-48d4-b0a8-718b65ac9002 | TonyTangYu/llvm-project | libc/src/stdlib/rand.cpp | #include "src/stdlib/rand.h"
#include "src/__support/common.h"
#include "src/stdlib/rand_util.h"
namespace __llvm_libc {
// This rand function is the example implementation from the C standard. It is
// not cryptographically secure.
LLVM_LIBC_FUNCTION(int, rand, (void)) { // RAND_MAX is assumed to be 32767
rand_nex... | TOOL | 0.945049 | 6.543195 |
fe142aa9-1eb3-4de4-8c88-78775a0f453a | KirtiSharma0/DSA | array3/ques1.cpp | //move all negative numbers to beginning and positive nos. to end with constant extra space
#include <iostream>
#include <vector>
using namespace std;
void movenum(vector<int>& v){
int n = v.size();
int i = 0;
int j = n-1;
while(i!=j){
if(i>0) i++;
if(j<0) j--;
if(i<0 && j>0){
... | ALGO | 0.999843 | 4.61048 |
68d3c40b-16f1-4388-b426-eb54007c56bc | ishandutta2007/codeforces | elegia/normal/827/B.cpp | #include <cstdio>
#include <cmath>
#include <ctime>
#include <cstring>
#include <cstdlib>
#include <algorithm>
#include <iostream>
#include <numeric>
#include <limits>
#include <functional>
#include <stack>
#include <vector>
#include <set>
#include <map>
#include <queue>
#define LOG(FMT...) fprintf(stderr, FMT)
usin... | ALGO | 0.999926 | 3.355488 |
69b5bc95-a2ba-4d9b-b8e3-7a9b975671f2 | ishandutta2007/codeforces | rush_d_cat/normal/1499/E.cpp | #include <bits/stdc++.h>
using namespace std;
typedef long long LL;
const int N = 1000 + 10;
const LL MOD = 998244353;
char x[N], y[N];
LL dp[N][N][2];
void add(LL &x, LL y) {
x += y;
if (x >= MOD) x -= MOD;
}
int main() {
scanf("%s%s", x+1, y+1);
int n = strlen(x + 1), m = strlen(y + 1);
int px[N] = {0}, py[N]... | ALGO | 0.999975 | 4.146194 |
b3461802-3041-49c4-ab66-30da841202de | reethulanka09/GFG | Difficulty: Medium/Remove the balls/remove-the-balls.cpp | class Solution {
public:
int findLength(vector<int> &color, vector<int> &radius) {
// code here
stack<int>st1;
stack<int>st2;
st1.push(color[0]);
st2.push(radius[0]);
for(int i=1;i<color.size();i++){
if(!st1.empty() and !st2.empty() and st1.top()==color[... | ALGO | 0.998297 | 5.370349 |
b4ae2284-38a6-40bc-a3f4-59a881189a9f | y4Ssine13/PlantSaverApp | plant_saver_app/windows/runner/utils.cpp | #include "utils.h"
#include <flutter_windows.h>
#include <io.h>
#include <stdio.h>
#include <windows.h>
#include <iostream>
void CreateAndAttachConsole() {
if (::AllocConsole()) {
FILE *unused;
if (freopen_s(&unused, "CONOUT$", "w", stdout)) {
_dup2(_fileno(stdout), 1);
}
if (freopen_s(&unuse... | TOOL | 0.998458 | 6.76775 |
0181f2b8-2e1d-439f-b0ac-f31ca0d08aad | algoplutus1708/Competitive-Programming-Solutions | Codeforces/1385 - Round #656 (Div. 3)/D. a-Good String.cpp | /*** KNOWLEDGE IS POWER ***/
// Problem Link: https://codeforces.com/contest/1385/problem/D
// Solution Link: https://codeforces.com/contest/1385/submission/131066495
#include<bits/stdc++.h>
typedef long long ll ;
#define int ll
#define pb push_back
#define all(v) v.begin(),v.end()
#define mod 1000000007
#define in... | ALGO | 0.999832 | 4.844737 |
ea871b1d-62a2-4882-a776-f72ca1cf503a | LAM-GROUP/LammpsWithPLIP | lib/atc/ATC_TransferPartitionOfUnity.cpp | // ATC headers
#include "ATC_TransferPartitionOfUnity.h"
#include "ATC_Error.h"
#include "FE_Engine.h"
#include "LammpsInterface.h"
#include "Quadrature.h"
#include "PerPairQuantity.h"
#ifdef HAS_DXA
#include "DislocationExtractor.h"
#endif
// Other Headers
#include <vector>
#include <map>
#include <set>
#include <ut... | ALGO | 0.99103 | 4.313367 |
b69674d0-c677-4d12-bbb8-1e49a0f585f1 | Evgzek/Salary | ConsoleApplication4/ConsoleApplication4.cpp | // ConsoleApplication4.cpp : Этот файл содержит функцию "main". Здесь начинается и заканчивается выполнение программы.
//
#include <iostream>
using namespace std;
int main() {
int age[5];
int youngest_age = INT_MAX; // начальное значение максимально возможного целочисленного значения
double discount = 0.0... | ALGO | 0.985809 | 5.402831 |
6b05c4f2-f857-4fbc-bd16-1a547c6b6434 | martijnmartijnmartijnmartijn/Quantum-advantage-k-SAT-with-structure | solvers/SBVA/eigen-3.4.0/bench/dense_solvers.cpp | #include <iostream>
#include "BenchTimer.h"
#include <Eigen/Dense>
#include <map>
#include <vector>
#include <string>
#include <sstream>
using namespace Eigen;
std::map<std::string,Array<float,1,8,DontAlign|RowMajor> > results;
std::vector<std::string> labels;
std::vector<Array2i> sizes;
template<typename Solver,type... | TOOL | 0.998339 | 6.326138 |
78d23f9f-8e7e-4761-a886-2cd2eedda21a | danmartinez78/AoC_2021 | day_12/cpp/src/solution.cpp | #include <iostream>
#include <fstream>
#include <sstream>
#include <vector>
using namespace std;
int read_data(string filename, vector<int>& data){
ifstream input_file(filename);
if (!input_file.is_open()) {
cerr << "Could not open the file - '"
<< filename << "'" << endl;
return ... | ALGO | 0.997493 | 3.708344 |
3a69c0b5-65f4-46f6-bb0f-2ad97a0ac539 | ArshadAbhas/ML-music-recommendation-system | venv/lib/python3.12/site-packages/sklearn/utils/src/MurmurHash3.cpp | // Note - The x86 and x64 versions do _not_ produce the same results, as the
// algorithms are optimized for their respective platforms. You can still
// compile and run any of them on any platform, but your performance with the
// non-native version will be less than optimal.
#include "MurmurHash3.h"
//-------------... | ALGO | 0.998317 | 7.214447 |
c9745b7e-a02d-43db-b335-8320742157bb | raincross7/code-similarity | codes/train_code/problem260/problem260_275.cpp | /*
* Problem Description: Heaps - Priority Queue
* Category:
* Author: Khan
* Date: 17th October, 2017
*/
#include <string>
#include <algorithm>
#include <iostream>
using namespace std;
#define MAXN 2000000
#define INF (1 << 30)
int H, A[MAXN + 1];
void maxHeapify(int i)
{
int l, r, largest;
l = 2 * i;
... | ALGO | 0.999435 | 4.257104 |
7ec6b0cf-54bd-414a-870e-cc7c3f642a2d | vpk-11/IPMP | DSA Prep/Round 1/Arrays/Arr_08.cpp | #include <iostream>
using namespace std;
void sumPair(int arr[], int n, int sum)
{
bool flag = false;
for (int i = 0; i < n; i++)
{
for (int j = 0; j < n; j++)
{
if (((arr[i] + arr[j]) == sum)&& i!=j)
{
cout << "Sum of " << arr[i] << " & " << arr[j] <... | ALGO | 0.999831 | 5.371128 |
a70afcff-36bc-4601-bb6a-d2b9fc69e2f0 | zexianchoo/DataStructures-CTCI-CPP-Solutions | CTCI/DataStructures/MergeSort/MergeSort.cpp |
//mergesort testing
#include "mergesort.h"
int main() {
int arr[] = {1,5,6,2,3,4,8,9,5,2,0};
merge_sort(arr, (unsigned int)11);
print_arr(arr);
return 0;
}
| ALGO | 0.989946 | 4.705087 |
78a756de-1ad0-4c5b-95e6-6a8764054088 | OverRancid/CS203 | week2.cpp | //OverRancid#0590
#include <bits/stdc++.h> //Parental Advisory
using namespace std; //Explicit Content
#define ever ;;
int log_2(int x){
return 31 - __builtin_clz(x);
}
bitset<32> dec2bin(unsigned n){
//passing unsigned doesn't make a difference because of 'circular' nature of binary notation.
bi... | ALGO | 0.981322 | 4.689082 |
edf09391-4049-4abf-89b0-7064904a8174 | fabian121/ucr-algorithms-5Graph | MyQueue.cpp | /*
* File: MyQueue.cpp
* Author: user
*
* Created on January 29, 2014, 9:22 AM
*/
#include <stddef.h>
#include <stdlib.h>
#include <stdio.h>
#include "MyQueue.h"
MyQueue::MyQueue() {
headPtr = NULL;
tailPtr = NULL;
}
MyQueue::MyQueue(const MyQueue& orig) {
}
MyQueue::~MyQueue() {
}
/*enqueues a n... | TOOL | 0.886545 | 4.369672 |
81868d25-137a-4e61-b7db-d9bd21028dd1 | yongwhan/atcoder | abc144_b.cpp | #include<bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<int,int> ii;
int main() {
cin.tie(0); cout.tie(0); ios_base::sync_with_stdio(0);
int n; cin>>n;
for (int i=1; i<=9; i++)
for (int j=1; j<=9; j++)
if(i*j==n) {
cout<<"Yes\n";
return 0;
}
cout<<"No\n";
return 0;
}
| ALGO | 0.999821 | 4.345295 |
854bef45-45ed-43d0-89b5-2a3e1dc75577 | dhirajms/frameworks_av | media/libstagefright/codecs/amrwb/src/agc2_amr_wb.cpp | /*
------------------------------------------------------------------------------
Filename: agc2_amr_wb.cpp
Date: 05/08/2007
------------------------------------------------------------------------------
REVISION HISTORY
Description:
-------------------------------------------------------------------------... | ALGO | 0.999954 | 5.915693 |
ad46ffce-b26c-402c-8df8-4cca85d8adcc | cms-externals/blackhat | src/trees_eval/A0_2q3g2l_eval_R_2.cpp |
#include "A0_2q3g2l_eval_2.hpp"
namespace BH {
template complex<double> A2q3g2l_qmmpmqbplmlbp_eval<4,5,6,0,1,2,3,double>(const eval_param<double>& ep, const mass_param_coll& masses);
template complex<double> A2q3g2l_qmmpmqbplmlbp_eval<5,6,0,1,2,3,4,double>(const eval_param<double>& ep, const mass_param_coll& masses... | ALGO | 0.972816 | 4.562525 |
c85e772b-611e-4331-a57a-808413fca4d8 | JacobPa25/COP4520_Group_Project | Rain Example/Combined/main.cpp | // This is a combined example of both single and multi rain programs
#include <raylib.h>
#include <vector>
#include <thread>
#include <mutex>
#include <cstdlib>
#define SCREEN_WIDTH 800
#define SCREEN_HEIGHT 600
#define RAIN_COUNT 25000
// Single raindrop position and speed
struct Raindrop {
Vector2 position;
... | TOOL | 0.979633 | 6.943869 |
8acaa48b-2fe4-4c7a-8ed7-0954d5d5b7d8 | acassis/emlinux-ssd1935 | libs/oss/others/MPL/mpeg4ip-1.2/common/video/mpeg4-2000/sys/rrv.cpp | #include <stdlib.h>
#include <stdio.h>
#include <math.h>
#include <fstream.h>
#include <iostream.h>
#include "mpeg4ip.h"
#include "typeapi.h"
#include "codehead.h"
#include "global.hpp"
#include "mode.hpp"
#include "sesenc.hpp"
#include "entropy/bitstrm.hpp"
#include "vopses.hpp"
#include "vopseenc.hpp"
#include "vopse... | ALGO | 0.952821 | 3.307497 |
22ca79ab-7c13-42d0-bcd6-02b725d4781d | ivanagui2/hermesmail-code | Eudora71/OT501/Src/image/JPEG/JIDCTINT.CPP | #define JPEG_INTERNALS
#include "stdafx.h"
#include "secjpeg.h"
#include "jdct.h" /* Private declarations for DCT subsystem */
#ifdef DCT_ISLOW_SUPPORTED
/*
* This module is specialized to the case DCTSIZE = 8.
*/
#if DCTSIZE != 8
Sorry, this code only copes with 8x8 DCTs. /* deliberate syntax err */
#endif
/*... | ALGO | 0.996457 | 5.430109 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.