uuid string | repo_name string | relative_path string | content string | category string | algo_rel_score float64 | quality_score float64 |
|---|---|---|---|---|---|---|
d47bbd3e-dc9e-491d-939f-1222d2b4ce42 | rrkarim/neerc | leet/data-stream-disjoint-set.cpp | #include <bits/stdc++.h>
#define MAX_CHAR 256
#define MAXN 1000005
#define INF 1000000
#define pi 3.14159265358979323846
using namespace std;
typedef long long ll;
struct Interval {
int start;
int end;
Interval() : start(0), end(0) {}
Interval(int s, int e) : start(s), end(e) {}
};
class SummaryRange... | ALGO | 0.999897 | 4.294297 |
7861a546-1f97-4f12-991c-83fa07d58956 | bhaavya215/DAA | kruskal.cpp | #include <iostream>
#include <vector>
#include <algorithm>
using namespace std;
struct Edge {
int u, v, weight;
bool operator<(Edge const& other) const {
return weight < other.weight;
}
};
int find(int u, vector<int> &parent) {
if (u != parent[u])
parent[u] = find(parent[u], parent); /... | ALGO | 0.999992 | 5.148621 |
568edd3e-8d13-41e1-a329-58435f969fda | samposp/ICP | src/codec.cpp |
#include "codec.h"
double getPSNR(const cv::Mat& I1, const cv::Mat& I2)
{
cv::Mat s1;
absdiff(I1, I2, s1); // |I1 - I2|
s1.convertTo(s1, CV_32F); // cannot make a square on 8 bits
s1 = s1.mul(s1); // |I1 - I2|^2
cv::Scalar s = sum(s1); // sum elements per channel
do... | TOOL | 0.974289 | 5.282764 |
93d58c53-0bfd-454d-b228-5bcf4968a83d | Ahhzsthl/RetestCode | unit8/8.4.cpp | #include <iostream>
#include <cstdio>
#include <algorithm>
#include <string>
using namespace std;
bool GetNextPermutation(string& str){
int n = str.size();
int index = n - 2; //找到一个下降的局部
while(index >= 0 && str[index] >= str[index + 1]){
index--; //找到最长的降序的局部
}
if(index < 0){
r... | ALGO | 0.999961 | 4.273105 |
d7412209-34b6-41f2-a5ad-c294e5e01d68 | butterfling/Codeforces | MaxSubArraySum.cpp | #pragma GCC optimize("O3,unroll-loops")
#include<bits/stdc++.h>
#include<ext/pb_ds/assoc_container.hpp>
#include<ext/pb_ds/tree_policy.hpp>
#include <numeric>
using namespace std;
using namespace chrono;
using namespace __gnu_pbds;
#define fastio() ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL)
#defin... | ALGO | 0.999625 | 4.26299 |
023c24b2-0301-4a4a-87f8-b6ebd4a01337 | nefrttPrabhu/leetstore | 2262-solving-questions-with-brainpower/solving-questions-with-brainpower.cpp | class Solution {
public:
long long mostPoints(vector<vector<int>>& questions) {
int n = questions.size();
vector<long long> dp(n + 1, 0);
for (int i = n - 1; i >= 0; i--) {
int points = questions[i][0];
int brainpower = questions[i][1];
... | ALGO | 0.999951 | 6.103178 |
d85118fb-365b-426b-9a18-e59dab246df3 | krishna-gavas/Competitive-Coding | GeeksForGeeks/Arrays/4-MissingNumberInArray.cpp | // Missing number in array
// Question:
// Given an array C of size N-1 and given that there are numbers from 1 to N with one element missing,
// the missing number is to be found.
// Input:
// The first line of input contains an integer T denoting the number of test cases. For each test case
// first line contains... | ALGO | 0.999664 | 5.657794 |
8f62bc96-06c3-4c61-8ecd-23882d0df459 | NullShock78/GameEngine | Middleware/glm/test/core/core_func_integer_bit_count.cpp | ///////////////////////////////////////////////////////////////////////////////////
/// OpenGL Mathematics (glm.g-truc.net)
///
/// Copyright (c) 2005 - 2015 G-Truc Creation (www.g-truc.net)
/// Permission is hereby granted, free of charge, to any person obtaining a copy
/// of this software and associated documentatio... | ALGO | 0.996298 | 4.925858 |
83a59a60-e028-4c08-b350-fe84e3070c37 | Peacefull-beast/PeaceCode1 | 0513-find-bottom-left-tree-value/0513-find-bottom-left-tree-value.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.999991 | 6.426309 |
1c99c716-006e-4f95-8c0d-be1704938d20 | makoteq/Techniki-programowania-3 | matplotplusplus/examples/graphs/graph/graph_4.cpp | #include <cmath>
#include <matplot/matplot.h>
int main() {
using namespace matplot;
std::vector<std::pair<size_t, size_t>> edges = {
{0, 1}, {0, 2}, {0, 3}, {0, 4}, {1, 2}, {1, 5},
{2, 5}, {3, 4}, {3, 6}, {4, 6}, {5, 6}};
std::vector<double> weights = {50, 10, 20, 80, 90, 90, 30, 20, 100, 4... | ALGO | 0.979604 | 4.858367 |
0a2da625-4b5d-4c8a-b45f-19ca61da4c78 | yuforest/contests | dowango_6/d/main.cpp | // ここは競プロではサボりがちです
#include <bits/stdc++.h>
using namespace std;
// デバッグ用マクロです。詳しくは https://naskya.net/post/0002/
#ifdef LOCAL
#include <debug_print.hpp>
#define debug(...) debug_print::multi_print(#__VA_ARGS__, __VA_ARGS__)
#else
#define debug(...) (static_cast<void>(0))
#endif
// 節操ないですが、競プロでは便利です。
using ll = long ... | ALGO | 0.999155 | 3.889373 |
60ae8d0f-3e29-407e-9e0a-bc274ef22b95 | williamrshen/dmoj-solutions | submissions/4361257.cpp | #include <iostream>
#include <vector>
#include <queue>
using namespace std;
typedef long long ll;
#define ok "\n"
#define pb push_back
const int MN = 100005;
int n, dp[MN][3], act[MN][3];
int main() {
cin.tie(0); cin.sync_with_stdio(0);
cin >> n;
for (int i = 1; i <= n; i++) {
cin >> act[i][0];
cin >> act[i... | ALGO | 0.999846 | 4.190645 |
738af526-38c1-4767-a7de-0ad055bc0a69 | Prabhat2002/Data_Structure_and_Algorithm | Max Chunks To Make Sorted.cpp | class Solution
{
public:
int maxChunksToSorted(vector<int>& nums)
{
int res=0,chunk=0;
for(int i=0;i<nums.size();i++)
{
res=max(res,nums[i]);
if(i==res)
chunk++;
}
return chunk;
}
};
| ALGO | 0.999918 | 5.415824 |
582c24c7-3429-4296-a5a3-59625631a307 | kazukiikeda/tut_cc_rpg | EnemyTask.cpp | #include "EnemyTask.h"
#include "KeyDownChecker.h"
#include <vector>
#include <fstream>
#include <string>
std::shared_ptr<GameTask> CreateEnemyTask(int x, int y, std::string ID, std::string movepattern, int Object_num)
{
return std::make_shared<EnemyTask>(x, y, ID, Object_num, movepattern);
}
EnemyTask::EnemyTask(int... | TOOL | 0.92301 | 3.426391 |
362e3075-8f6a-456a-96e7-96358f128233 | jiangsn/vaa3d | common_lib/include/eigen_3_3_4/unsupported/doc/examples/EulerAngles.cpp | #include <unsupported/Eigen/EulerAngles>
#include <iostream>
using namespace Eigen;
int main()
{
// A common Euler system by many armies around the world,
// where the first one is the azimuth(the angle from the north -
// the same angle that is show in compass)
// and the second one is elevation(the angl... | ALGO | 0.986525 | 5.144393 |
1a80df7a-3c54-457e-a3c9-d6c195b56832 | adam-alan/ubuntubak | vscodeCppWorkingspace/test.cpp | #include <iostream>
#include <algorithm>
using namespace std;
void heap_sort(int array[],int lenth,bool (*compare)(int,int));
void build_heap(int array[],int length,bool (*compare)(int,int));
static void heapify(int array[],int i,int length,bool (*compare)(int,int));
template<typename Type>
bool my_less(Type key1,Ty... | ALGO | 0.999929 | 4.10534 |
7d62311c-228a-4cae-8289-6aa62548c2de | ishandutta2007/codeforces | quang/normal/383/C.cpp | #include <bits/stdc++.h>
#define Task "C"
#define fi freopen(Task".inp", "r", stdin)
#define fo freopen(Task".out", "w", stdout)
using namespace std;
const int N = 200100;
struct BIT {
int tree[N * 2];
void Set(int x, int val) {
while(x < N * 2) {
tree[x] += val;
x += (x & -x)... | ALGO | 0.999985 | 4.627327 |
aa2895e4-efd6-496e-8317-2b4c4d5c397d | 0xm4yo/compro | atcoder/ABC/ABC326/C.cpp | #include <bits/stdc++.h>
#include <atcoder/all>
using namespace std;
using namespace atcoder;
using ll = long long;
using ull = unsigned long long;
#define rep(i, a, b) for(ll i=a; i<b; i++)
#define rrep(i, a, b) for(ll i=a; i>=b; i--)
#define all(a) (a).begin(), (a).end()
#define YesNo(bool) if(bool){cout<<"Yes"<<en... | ALGO | 0.999985 | 4.467591 |
f193974e-7c5a-433d-b75b-a950f16df6c6 | cosmo8724/Algorithm | BackJoon/Solved/2623 O.cpp | /* 23. 09. 22 */
#include <bits/stdc++.h>
using namespace std;
int N, M;
vector<int> Entry;
vector<vector<int>> After;
vector<int> bfs()
{
queue<int> q;
for (int i{ 1 }; i <= N; ++i) {
if (Entry[i] == 0) { q.push(i); }
}
vector<int> ret;
while (!q.empty()) {
int here{ q.front() };
q.pop();
ret.push_bac... | ALGO | 0.99999 | 4.729396 |
b1c26e45-7618-4933-b854-79484e39f260 | malathy3112/CSA1236-Computer-Architecture | binary to octal.cpp | #include <stdio.h>
int main()
{
int num, binary_num, octal_num = 0, base = 1, rem;
printf (" Enter a binary number\n");
scanf (" %d", &num);
binary_num = num;
while ( num > 0)
{
rem = num % 10;
octal_num = octal_num + rem * base;
num = num / 10;
... | ALGO | 0.954856 | 4.619466 |
18d7e45d-f73e-4b4f-8006-0aa7aea13cf2 | emircankaradeniz/AI_Game | 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 |
265dc73d-cd2f-47e4-bacf-13256ebfa753 | devvrat2311/Algor-lib | 01-Foundations/src/heap.cpp | #include "heap.hpp"
#include <cmath>
#include <iostream>
#include <ostream>
#include <utility>
Heap::Heap(std::vector<int>& A) {
this->array = A;
this->array_size = A.size();
this->heap_size = this->array_size;
this->build_max_heap();
}
int Heap::left(int i) {
return ((i << 1) + 1); // returns 2*i + 1
}
int... | ALGO | 0.974275 | 4.931942 |
184304c1-d7d8-4f0e-89e7-d163cf821595 | EraEKV/PP1_LABS | 6/P.cpp | #include <iostream>
using namespace std;
int convert(int n) {
return abs(n);
}
int main() {
int n; cin >> n;
cout << convert(n);
return 0;
} | ALGO | 0.996471 | 4.530592 |
2a89e3fc-8917-41e7-80dd-68f50590d934 | ishandutta2007/codeforces | lawrenceli/normal/379/D.cpp | #include <cstdio>
#include <iostream>
#include <algorithm>
#include <ios>
using namespace std;
const int MAXK = 55;
int k, x, n, m;
int dp[MAXK];
void process(int a, int b, int b1, int b2, int b3, int b4) {
if (2*a+b1+b2 > n) return;
if (2*b+b3+b4 > m) return;
int xy = b2 && b3, yx = b1 && b4, yy = b3 ... | ALGO | 0.999752 | 3.615229 |
ab636395-b558-44ee-943d-872f1fb45c5b | TeamOrion/frameworks_av | media/libstagefright/codecs/amrnb/enc/src/c1035pf.cpp | /*
------------------------------------------------------------------------------
Pathname: ./audio/gsm-amr/c/src/c1035pf.c
Functions: q_p
build_code
code_10i40_35bits
Date: 09/28/2000
------------------------------------------------------------------------------
REVISION HISTORY
De... | ALGO | 0.999917 | 5.906797 |
05f9bf44-e28e-41b3-907a-95c3346702cb | 113bommy/deepmind_codecontests_refine | cpp_gold_filter_file/cpp_train_5056_13.cpp | #include <bits/stdc++.h>
using namespace std;
inline void read(long long &x) {
long long f = 1;
x = 0;
char c = getchar();
while (c < '0' || c > '9') {
if (c == '-') f = -1;
c = getchar();
}
while (c >= '0' && c <= '9') {
x = x * 10 + c - '0';
c = getchar();
}
x *= f;
}
long long fa[2000... | ALGO | 0.999983 | 3.84923 |
bda67b57-b643-4e6e-9710-545140545fdc | Sk-Shubhasheesh/LearnYard-DSA | Math For DSA/FindAllFactor.cpp | #include<bits/stdc++.h>
using namespace std;
int main(){
int n;
cout<<"Enter the Number"<<endl;
cin>>n;
// first method - Time complexity is high
// for(int i=1; i<=n; i++){
// if(n%i == 0){
// cout<<i<<endl;
// }
// }
// second method
for(int i=1; i*i<=n; ... | ALGO | 0.99991 | 4.193649 |
ebf94e99-cd83-4f7a-8e9c-b7a1e5d5f29b | ishandutta2007/codeforces | meijer/normal/1374/B.cpp | #include <bits/stdc++.h>
using namespace std;
//macros
typedef long long ll;
typedef pair<int, int> ii;
typedef tuple<int, int, int> iii;
typedef vector<int> vi;
typedef vector<ii> vii;
typedef vector<iii> viii;
typedef vector<ll> vll;
#define REP(a,b,c) for(int a=int(b); a<int(c); a++)
#define RE(a,c) REP(a,0,c)
#def... | ALGO | 0.99996 | 4.596087 |
c5434358-c733-47f0-bd8d-3608408974c0 | mikegwyn17/Connect_R | Connect_R/Connect_R/Connect_R_AI.cpp | #include "Connect_R_AI.h"
#include <time.h>
// simple method used to make reading in int values from user easier
int read_int ()
{
string input = "";
getline(cin, input);
int value = atoi(input.c_str());
return value;
}
// method used to move around the board which is vector of chars
int move_ai (int index, const ... | ALGO | 0.972904 | 4.225505 |
09c9df46-ee36-405d-b075-333303d3ac7a | Nikitiwe/Leetcode | 0501-find-mode-in-binary-search-tree/0501-find-mode-in-binary-search-tree.cpp | /**
* Definition for a binary tree node.
* struct TreeNode {
* int val;
* TreeNode *left;
* TreeNode *right;
* TreeNode() : val(0), left(nullptr), right(nullptr) {}
* TreeNode(int x) : val(x), left(nullptr), right(nullptr) {}
* TreeNode(int x, TreeNode *left, TreeNode *right) : val(x), l... | ALGO | 0.999968 | 6.183465 |
9230f248-c45f-4db7-810d-ce5e08611960 | javics2002/MotorEngine | Dependencies/Bullet/Src/Extras/ConvexDecomposition/fitsphere.cpp | #include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <assert.h>
#include <math.h>
#include "fitsphere.h"
// http://codesuppository.blogspot.com
//
// mailto: <EMAIL>
//
// http://www.amillionpixels.us
//
/*
An Efficient Bounding Sphere
by Jack Ritter
from "Graphics Gems", Academic Press, 1990
*/
/* Ro... | ALGO | 0.999958 | 6.990395 |
5627f241-7ec2-40f5-ba6d-cd5338c3d973 | snichols/boost_1_61_0 | libs/numeric/odeint/examples/integrate_times.cpp | #include <iostream>
#include <boost/numeric/odeint.hpp>
using namespace std;
using namespace boost::numeric::odeint;
/*
* simple 1D ODE
*/
void rhs( const double x , double &dxdt , const double t )
{
dxdt = 3.0/(2.0*t*t) + x/(2.0*t);
}
void write_cout( const double &x , const double t )
{
cout << t << '\t... | ALGO | 0.999763 | 7.28636 |
ed97fe45-4332-4a35-a0cd-bea18c51e7ff | Adrya/CrystalShard | dep/g3dlite/source/AABox.cpp | /**
@file AABox.cpp
@maintainer Morgan McGuire, http://graphics.cs.williams.edu
@created 2004-01-10
@edited 2006-01-11
*/
#include "G3D/platform.h"
#include "G3D/AABox.h"
#include "G3D/Box.h"
#include "G3D/Plane.h"
#include "G3D/Sphere.h"
#include "G3D/BinaryInput.h"
#include "G3D/BinaryOutput.h"
namespace... | TOOL | 0.922056 | 7.868921 |
ba78bf82-ffc4-46b8-9b82-1cdf7f9f9f9f | cmyang1218/Leetcode | 215-kth-largest-element-in-an-array/kth-largest-element-in-an-array.cpp | class Solution {
public:
int findKthLargest(vector<int>& nums, int k) {
priority_queue<int> pq(nums.begin(), nums.end());
int ans = 0, i = 0;
while (i < k) {
if (i == k-1) {
ans = pq.top();
}
pq.pop();
i++;
}
ret... | ALGO | 0.999945 | 5.435644 |
e22fbe4a-c645-43cf-b1ed-ad1e44e565f7 | Vesion/Misirlou | leetcode/145-BinaryTreePostorderTraversal.cpp | #include <iostream>
#include <algorithm>
#include <vector>
#include <string>
#include <stack>
using namespace std;
struct TreeNode {
int val;
TreeNode *left, *right;
TreeNode(int val) : val(val), left(NULL), right(NULL) {}
};
// Solution 1 : recursive
class Solution {
public:
vector<int> postorderTra... | ALGO | 0.999996 | 6.084394 |
936fbc42-68ec-4046-9a49-8ddb72d2f41a | yinhaijing123/offer | ListNode/RotateRight/RotateRight.cpp | /*******************************************************************************************
问题描述:右旋K次链表
思路分析:1.找到倒数第K个节点(快慢指针)
2.将链表分为两部分,一个为倒数K个节点,另一个为原始头部
3.让原始链表的尾节点指向NULL;再将倒数的K个链表的尾节点指向原始的链表头部
*******************************************************************************************/
#includ... | ALGO | 0.999974 | 4.857491 |
b5c5d9d4-a205-4162-8ce5-bd9eb4f768d2 | SagarPrajapati1/gfg_potd2024 | November2024/move_all_zeros_to_end.cpp | class Solution {
public:
void pushZerosToEnd(vector<int>& arr) {
int e = 0;
int n = arr.size();
for(int s = 0; s < n; s++) {
if(arr[s] != 0){
swap(arr[s], arr[e]);
e++;
}
}
}
};
| ALGO | 0.99972 | 5.405854 |
19cb9b8c-eb68-4790-a49c-db86897f8b64 | arpiku/codeSnippets | leetcode/codeSnips/listToVec.cpp |
#include <vector>
template<typename T>
std::vector<T> convertToListNodeToVector(ListNode* head) {
std::vector<T> vec;
ListNode* current = head;
while (current != nullptr) {
vec.push_back(current->val);
current = current->next;
}
return vec;
}
| ALGO | 0.980175 | 5.090601 |
c38c21da-fca0-40e8-a21a-ace33dd6634d | deepaksinghbisht786/sample | reverseaword.cpp | #include <bits/stdc++.h>
using namespace std;
// Function to reverse the characters in a substring of 's'
// between the indices 'st' (start) and 'e' (end), inclusive.
string reverseSubstring(string s, int st, int e) {
// Swap characters from both ends until the pointers meet.
while (st < e) {
swap(s[s... | ALGO | 0.999987 | 6.650003 |
de6df812-5479-4c53-b750-8978f1cfd3b7 | Sudhanwaa/LeetCode-Solutions | 1005-maximize-sum-of-array-after-k-negations/1005-maximize-sum-of-array-after-k-negations.cpp | class Solution {
public:
int largestSumAfterKNegations(vector<int>& nums, int k) {
int sum = 0,i=0,length=nums.size();
sort(nums.begin(), nums.end());
while(nums[i]<0 && i<length){
if(k<=0)
break;
nums[i] *= -1;
i++;
k--;
}... | ALGO | 0.999978 | 5.299241 |
bfdf8de1-b37f-4971-92f6-5295782b75e6 | JasonLin1230/PAT-PTA | PAT甲级/1011.cpp | #include <iostream>
#include <iomanip>
using namespace std;
int main()
{
double maxProfit = 1.0;
char bet[3] = { 'W','T','L' };
for (int i = 0; i < 3; ++i)
{
double line_max = 0;
int index = 0;
for (int j = 0; j < 3; ++j)
{
double temp;
cin >> temp;
if (temp >= line_max)
{
line_max = temp;
... | ALGO | 0.999945 | 3.195528 |
ec16077a-e38f-471d-bd1a-cb0957b2135a | Hunnysunaria/LeetCode | Leetcode_April30 days Challenge/Perform String shifts.cpp | class Solution {
public:
string stringShift(string s, vector<vector<int>>& shift) {
int val = 0;
for(int i=0;i<shift.size();++i)
val += shift[i][0]==0?-shift[i][1]:shift[i][1];
int len = s.length();
val %= len;
string result = "";
... | ALGO | 0.999984 | 6.283711 |
b7d803d4-c712-4041-b23e-4709a12c0208 | JakeTheSillySnake/SimpleNavigator | src/graph/s21_graph.cpp | #include "s21_graph.h"
using namespace std;
void Graph::Clear() {
for (int i = 0; i < size; i++) delete[] matrix[i];
if (size) delete[] matrix;
size = 0;
}
void Graph::Init(int n) {
matrix = new int *[n];
for (int i = 0; i < n; i++) matrix[i] = new int[n];
size = n;
}
int Graph::LoadGraphFromFile(string... | ALGO | 0.982018 | 4.459125 |
1fdfae38-2ccc-4fe7-853c-756c9616e105 | ishandutta2007/codeforces | neal/normal/1207/G.cpp | #include <algorithm>
#include <cassert>
#include <iostream>
#include <map>
#include <string>
#include <vector>
using namespace std;
const int INF = 1e9 + 5;
template<typename T>
struct fenwick_tree {
int tree_n = 0;
vector<T> tree;
fenwick_tree(int n = 0) {
if (n > 0)
init(n);
}
... | ALGO | 0.999974 | 4.729208 |
d1aad66f-9364-4ece-b9b5-806fe5699c83 | april211/Data_Structure_Learning | PTA202009/作业/栈与队列/7-4_表达式转换.cpp | #include <cmath>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <iostream>
#include <algorithm>
using namespace std;
#define OK 1
#define TRUE 1
#define FALSE 0
#define ERROR 0
#define OVERFLOW -2
#define INFEASIBLE -1
#define STACKINCREASEMENT 10
#define STACK_INIT_CAPACITY 100
typedef char SElemT... | ALGO | 0.99998 | 3.606152 |
bb2043bf-537a-4bc0-b634-f6c4090aec20 | shivam-369/practice | CSES/introductory problems/increasing_array.cpp | #include <iostream>
using namespace std;
int main()
{
int n;
long turns = 0;
cin >> n;
int *array = new int[n];
for(int i = 0; i < n; i++)
{
cin >> array[i];
}
for(int i = 1; i < n; i++)
{
if(array[i] >= array[i - 1]){
continue;
}
turns += ... | ALGO | 0.999818 | 3.896542 |
4ae27d33-2889-4ec3-bc14-bd97e7781ce3 | becadev/Algoritmos | Algoritmos/Forca_bruta/Lista2/Qtd_div.cpp | /*
Escreva um programa leia um número natural positivo n (1 ≤ n ≤ 109)
e mostre a quantidade de divisores de n.
• Determine o tipo da variável que deve armaenar n.
• Escreva uma função que receba n e retorne a quantidade de divisores.
• Faça testes e verifique se seu programa funciona corretamente.
*/
# include <iostr... | ALGO | 0.999312 | 5.786483 |
8bb17cbf-3408-4120-bd36-6fc65e38a1aa | nsk6282/cp-algorithms | Binary Trees/Traversals/IterativeInorderTraversal.cpp | #include <bits/stdc++.h>
using namespace std;
/**
* 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,... | ALGO | 0.999982 | 5.884744 |
474c7ed6-aea1-4202-805d-beefdf6f814d | aman3107/Revision_DSA_CPP | Basics_CPP/Operators_forLoop/square_root.cpp | #include <iostream>
using namespace std;
int main(){
int n;
cout << "Enter value of num " << endl;
cin >> n;
int i = 0;
int sq = 1;
while(sq <= n){
i++;
sq = i * i;
}
cout << i - 1;
} | ALGO | 0.999675 | 3.972609 |
9d30596f-f996-41fe-9531-a0a160e5e8b2 | dh-harald-ace/android_external_llvm | lib/CodeGen/EdgeBundles.cpp | #include "llvm/CodeGen/EdgeBundles.h"
#include "llvm/CodeGen/MachineBasicBlock.h"
#include "llvm/CodeGen/MachineFunction.h"
#include "llvm/CodeGen/Passes.h"
#include "llvm/Support/CommandLine.h"
#include "llvm/Support/GraphWriter.h"
using namespace llvm;
static cl::opt<bool>
ViewEdgeBundles("view-edge-bundles", cl::H... | TOOL | 0.921275 | 7.486927 |
aa840633-343e-482c-9dfa-1b08569a71b9 | Jack1eNgBaro/JustCp | CodeForces/C++20 (GCC 11-64)/919D | Substring/188662308.cpp | #include<bits/stdc++.h>
using namespace std;
#define ll long long
#define pii pair<int,int>
const int mod = 1e9 + 7;
const int maxn = 3e5;
void file()
{
ios_base::sync_with_stdio(0);
cin.tie(0); cout.tie(0);
// freopen("input.txt", "r", stdin);
// freopen("output.txt", "w", stdout);
}
string s;
int n, m, in[max... | ALGO | 0.999838 | 3.784527 |
3a56df52-7fbc-4751-aa13-7fff257faa8c | ccuwxy/algorithm_practice | Selection_Sort/test3.4.cpp | #include<iostream>
using namespace std;
int selectionSort(int A[], int N);
int main()
{
int a[105] = { 0 };
int n, sw = 0;
cin >> n;
for (int i = 0; i < n; i++)
{
cin >> a[i];
}
sw = selectionSort(a, n);
for (int i = 0; i < n; i++)
{
if (i) cout << " ";
cout << a[i];
}
cout << endl;
cout << sw;
retu... | ALGO | 0.999957 | 3.754562 |
d5ed68c3-cf59-4295-b196-f9216978e1aa | meteoritenhagel/conways_game_of_life | src/main_auxiliary.cpp | #include "main_auxiliary.h"
bool events() {
bool quit = false;
SDL_Event event;
while(SDL_PollEvent(&event))
{
if(event.type == SDL_QUIT) // window is closed
{
quit = true;
}
}
return quit;
}
void loop(GameOfLife &gameOfLife)
{
gameOfLife.nextGeneration(... | TOOL | 0.877226 | 4.396905 |
50bad550-0b58-4907-883c-c20b4ef2072b | ssk4988/Coding | UCFPT/250614/g.cpp | #include <bits/stdc++.h>
using namespace std;
using ll = long long;
using vi = vector<int>;
using vvi = vector<vi>;
using pii = pair<int, int>;
using vii = vector<pii>;
using vl = vector<ll>;
#define rep(i, a, b) for(int i = a; i < (b); i++)
#define all(x) begin(x), end(x)
#define sz(x) (int)x.size()
struct UF {
... | ALGO | 0.999537 | 5.075456 |
da712bcf-b211-4f87-b776-8a81747bd16c | qiyang0221/leetcode | Binary Tree Inorder Traversal.cpp | //
//description:
//ҪO(1)ռ䣬O(n)ʱ
//
//solution:
//õmorris
//ǰΪգô
//ΪգҵǰҶڵ㣬ǰڵǰ
//Ҷڵrchildӵǰڵ
//Ȼ
//һڵǰʱָԼ˵ǰѾˣǰָԼָΪNULL
//ͬʱ
//
//һO(n)ʱ:
//ǰḶ́ʵ൱ڷȻݸǰʵԼʱٲһǰ
//ܹΣʱΪ2n,ӶΪO(n)
#include<iostream>
#include<cstdio>
#include<cstdlib>
#include<vector>
using namespace std;
struct TreeNode {
int val;
TreeNode *left;
TreeN... | ALGO | 0.999996 | 5.508126 |
1f57a414-46f0-481f-a0a2-604a250fc39a | anagorko/zpk2014 | home/ekwiatowska/z2/sto.cpp | #include <iostream>
using namespace std;
int main() {
int A, B, K;
int l=0;
cin >> A >> B >> K;
if (A>=K && B>=K){
if (A>=2*K && B>=2*K)
l=(A/K*2+B/K*2)-4;
else if (A>=2*K && B<2*K)
l=A/K;
else
l=B/K;
}
else
l=0;
cout <... | ALGO | 0.999573 | 3.473686 |
8eb8f36c-dcdd-4153-8d3a-9d2516fdfb25 | Prontent11/CP | A_Binary_Decimal.cpp | #include<bits/stdc++.h>
using namespace std;
int main(){
int t;cin>>t;int a,mx=0;
while(t--){
vector<int>arr;
int n;cin>>n;
while(n>0){
a=n%10;
n=n/10;
arr.push_back(a);
}
cout<<*max_element(arr.begin(),arr.end())<<"\n";
}
return 0;
} | ALGO | 0.999767 | 4.421808 |
ec9bc532-c870-4c74-b75f-324a40c7566a | rainboyOJ/problems | other_oj/noiopenjudge/ch0201/1749/solutions/rainboy.cpp | #include <bits/stdc++.h>
using namespace std;
int n;
int main(){
scanf("%d",&n);
int i,j,k;
int ans=0;
for (i=0;i<=n;i++){
for (j=0;j<=n;j++){
for (k=0;k<=n;k++){
if( (i+j) % 2== 0&&
(j+k) % 3 == 0 &&
(i+j+k) % 5 == 0)... | ALGO | 0.999954 | 3.817384 |
34868eea-bcab-4c7e-8cae-48c3c79ffc0e | Ari122003/Leetcode-GFG | String/String_Multiplication.cpp | #include <bits/stdc++.h>
using namespace std;
std::string multiply(string num1, string num2)
{
int s1 = num1.size();
int s2 = num2.size();
vector<int> n1(s1, 0), n2(s2, 0);
for (int i = 0; i < s1; i++)
{
int num = num1[i] - '0';
n1[i] = num;
}
for (int i = 0; i < s2; i++)... | ALGO | 0.999923 | 5.350083 |
38c63f29-be1d-4c5e-8a86-6b83cefc857b | mohamedalakhras/Hotel_App | hotelproject/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.998114 | 6.786404 |
0d781679-e2e9-4f50-9738-41fd38682845 | Macesuted/Code | Codeforces/1594B.cpp | /**
* @author Macesuted (<EMAIL>)
* @copyright Copyright (c) 2021
*/
#include <bits/stdc++.h>
using namespace std;
#define int long long
#define mod 1000000007
typedef pair<int, int> pii;
void work(void) {
int n, k;
cin >> n >> k;
int ans = 0;
for (int i = 0, pow = 1; i < 32; i++, pow = pow * n %... | ALGO | 0.999937 | 4.383506 |
033f8b0f-c58c-4092-b361-120d236b0df2 | namtrungit/BigO | blue/lecture_2/lesson_2/lesson_2.cpp | #include <iostream>
#include <vector>
using namespace std;
int main() {
int n, m;
cin >> n >> m;
int a[n], b[m];
for(int i=0; i<n; i++) {
cin >> a[i];
}
for(int i=0; i<m; i++) {
cin >> b[i];
}
int count = 0;
for(int i=0, j=0; i<n && j<m; j++) {
if(b[j] >= a[i]) {
count++;
i++... | ALGO | 0.999832 | 3.708283 |
9de8d8a5-fe04-4c6d-8a7f-cf4b44ea51e8 | Zert0X/UniversityProgramming | 901, 902 group/1 year/2 sem/LR4/LR4.cpp | #include <iostream>
#include <string>
#include <windows.h>
const int m = 6;
const int n = 6;
const int bigest = (n>m) ? n : m;
using namespace std;
void text();
void text(string);
void text(int[], int arr[m][n],boolean);
void initialize(int arr[m][n]);
void menu(int arr[m][n]);
void count_all(int arr[m][n], void out(s... | ALGO | 0.990242 | 4.098421 |
ef19ff53-e5e8-4eb9-96da-19bd9f422808 | choeyul04/flutter_application_meal | 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.998784 | 6.761023 |
9f8de5c3-ce49-47a8-a42b-d56be563b2d9 | Aryaman3007/CP-DSA | removeduplicatesList.cpp | #include<bits/stdc++.h>
using namespace std;
//Sorted List
node* removeduplicates(node* head){
if(head==NULL || head->next==NULL){
return head;
}
node* curr=head;
while(curr!=NULL && curr->next!=NULL){
if(curr->val==curr->next->val){
node* temp=curr->next->next;
... | ALGO | 0.999603 | 5.119841 |
489b1e69-c4e7-4070-bca0-de06912a45f1 | yuzhench/update_the_class_index | modules/quality/samples/brisque_eval_tid2008.cpp | #include <fstream>
#include "opencv2/quality.hpp"
#include "opencv2/imgproc.hpp"
#include "opencv2/imgcodecs.hpp"
#include "opencv2/ml.hpp"
/*
BRISQUE evaluator using TID2008
TID2008:
http://www.ponomarenko.info/tid2008.htm
[1] N. Ponomarenko, V. Lukin, A. Zelensky, K. Egiazarian, M. Carli,
F. Battisti, "TID2008 - ... | ALGO | 0.997015 | 7.058199 |
71d96bae-f9d7-4b12-ae74-f09e326d0253 | gavinband/bgen | 3rd_party/boost_1_55_0/libs/locale/src/icu/collator.cpp | #include "cdata.hpp"
#include "all_generator.hpp"
#include "uconv.hpp"
#include "../shared/mo_hash.hpp"
#include <unicode/coll.h>
#if U_ICU_VERSION_MAJOR_NUM*100 + U_ICU_VERSION_MINOR_NUM >= 402
# include <unicode/stringpiece.h>
#endif
namespace boost {
namespace locale {
namespace impl_icu {
... | TOOL | 0.941548 | 7.206666 |
b975c9bc-2e85-430f-8bcf-3dfeefb48658 | Shintaro0105/Competitive-programming | atcoder/abc/223/e.cpp | #include <iostream>
#include <vector>
#include <set>
#include <array>
#include <cmath>
#include <string>
#include <algorithm>
#include <functional>
#include <map>
#include <tuple>
#include <queue>
#include <stack>
#include <bitset>
#include <deque>
#include <iomanip>
#define rep(i,n) for(int i = 0;i < (n);i++)
using na... | ALGO | 0.999971 | 3.548795 |
84888246-9e7c-4d04-9213-8b43508bdf4d | bhawesh2002/Cpp-Primer-Plus- | Ch5 primer+/Q6/question.cpp | /*Do Programming Exercise 5 but use a two-dimensional array to store input for 3
years of monthly sales. Report the total sales for each individual year and for the
combined years.*/
#include <iostream>
#include <string>
using namespace std;
const int no_of_months = 12;
const int no_of_years = 3;
int main()
{
c... | ALGO | 0.996174 | 4.007993 |
b53f784c-c7fa-443a-8930-ad13ca743bff | vpalladi/MP7 | cactusupgrades/projects/calol2/software/calol2/calol2/src/common/Utilities.cpp | #include "calol2/Utilities.hpp"
// C++ Headers
#include <cmath>
#include <fstream>
// Boost Headers
#include <boost/unordered_map.hpp>
#include <boost/tokenizer.hpp>
// MP7 Headers
#include "mp7/Logger.hpp"
namespace calol2 {
namespace utils {
// --------------------------------------------------------------------... | TOOL | 0.867285 | 6.188551 |
fbd3c627-9e2d-4a78-81f1-c91d40dfed22 | J0shhT/Kattis | OLD/C++/ANewAlphabet.cpp | #include <iostream>
#include <map>
#include <string>
#include <algorithm>
std::map<char, std::string> translations = {
{ 'a', "@" },{ 'b', "8" },{ 'c', "(" },{ 'd', "|)" },{ 'e', "3" },{ 'f', "#" },{ 'g', "6" },{ 'h', "[-]" },{ 'i', "|" },{ 'j', "_|" },
{ 'k', "|<" },{ 'l', "1" },{ 'm', "[]\\/[]" },{ 'n', "[]\\[]" }... | ALGO | 0.997569 | 5.266177 |
d1f5cb92-0a40-4ca4-a4ff-34b83d1630ee | Khoaph1709/Oasis-OOP-Solution | c++_template/Assignment_2_BasicDataStructres.cpp | #include <bits/stdc++.h>
#include "LinkedList.h"
#include "sorting.h"
#include "queues-stack.h"
using namespace std;
void Solve1() {
int n;
cin >> n;
vector<int> a(n);
for (int i = 0; i < n; i++) {
cin >> a[i];
}
if (n < 2) {
cout << 0 << endl;
return;
}
int c... | ALGO | 0.99994 | 4.685482 |
daaa9644-a68c-40a1-af29-e8a7b59169c1 | ashikapl/DSA | Week2(patterns and function)/tut6/practice/count.cpp | // Counting from 1 to N //
#include <iostream>
using namespace std;
void printNum(int n)
{
for (int i = 1; i <= n; i++)
{
cout << i << " ";
}
}
int main()
{
int n;
cout << "Enter the value ";
cin >> n;
printNum(n);
return 0;
} | ALGO | 0.998317 | 4.193248 |
f2a3de4e-46a1-47e3-92c1-f90aa431aff3 | himanshumahajan138/Leetcode | 1916-find-center-of-star-graph/find-center-of-star-graph.cpp | class Solution {
public:
int findCenter(vector<vector<int>>& e) {
return e[0][0] == e[1][0] || e[0][0] == e[1][1] ? e[0][0] : e[0][1];
}
}; | ALGO | 0.999937 | 5.758162 |
28288278-b04f-4d66-a66e-f377c8deeebd | laimouren/study | leetcode/0128.cpp | #include <vector>
#include <algorithm>
using std::vector;
class Solution {
public:
int longestConsecutive(vector<int>& nums) {
if (nums.size() == 0) {
return 0;
}
int res = 0;
std::sort(nums.begin(), nums.end());
int num = 0;
for (int i = 0; i < nums.size... | ALGO | 0.999946 | 5.478117 |
046c26a9-98d6-4b0d-affa-bbf68aef8379 | DexTver/OS_lab04 | reader.cpp | #include <windows.h>
#include <mmsystem.h>
#include <iostream>
#include <fstream>
#include <string>
#include <cstdlib>
const char* MAPPING_NAME = "MySharedMemory";
const char* MUTEX_NAME = "RW_Mutex";
int main() {
SYSTEM_INFO si;
GetSystemInfo(&si);
DWORD pageSize = si.dwPageSize;
const int numP... | TOOL | 0.856178 | 3.648823 |
11720115-ed96-4342-bd8a-a6ecfa1f4538 | Memorywx/Code_Cpp_Algorithm | Algorithm/sort/selectSort.cpp | // 代码清单7-3 直接选择排序
// 样例输入:
// 请输入待排序数组的元素个数: 4
// 请依次输入待排序数组元素(按照key,other的形式):
// 1 1
// 4 4
// 7 2
// 3 6
// 样例输出:
// 选择排序后的数组元素为:
// 1 1
// 3 6
// 4 4
// 7 2
#include "../dynamicSearchTable/set.h"
#include <iostream>
using namespace std;
template <class KEY, class OTHER>
void selectSort(SET<KEY, OTHER> a[], int si... | ALGO | 0.999955 | 3.898335 |
acd5c227-c6c3-4c0a-b8cf-6887c4f8c90a | gourobdas0103/Telegram-Analysis-Bot | c++ problems asked in interview/112. Path Sum.cpp | Given the root of a binary tree and an integer targetSum, return true if the tree has a root-to-leaf path such that adding up all the values along the path equals targetSum.
A leaf is a node with no children.
Example 1:
Input: root = [5,4,8,11,null,13,4,7,2,null,null,null,1], targetSum = 22
Output: true
Example 2:
... | ALGO | 0.999986 | 6.499956 |
316da2f0-1972-4a98-be74-cb15328729cb | Arpitpandey992/cpp-vscode | Contests and Practice/CodeChef/Practice/HP18.cpp | #include <vector>
#include <string>
#include <map>
#include <set>
#include <algorithm>
#include <cmath>
#include <iostream>
#include <cstring>
#define nl cout << '\n'
#define us unsigned short
#define ull unsigned long long
#define ui unsigned int
#define ll long long
#define ul unsigned long
#define endl '\n'
ll i, j,... | ALGO | 0.999979 | 3.555608 |
c423966a-77c3-4799-a0df-d3ae61e47ea6 | rutgers-apl/Atomicity-Violation-Detector | tdebug-llvm/llvm/lib/Bitcode/Writer/ValueEnumerator.cpp | #include "ValueEnumerator.h"
#include "llvm/ADT/STLExtras.h"
#include "llvm/ADT/SmallPtrSet.h"
#include "llvm/IR/Constants.h"
#include "llvm/IR/DebugInfoMetadata.h"
#include "llvm/IR/DerivedTypes.h"
#include "llvm/IR/Instructions.h"
#include "llvm/IR/Module.h"
#include "llvm/IR/UseListOrder.h"
#include "llvm/IR/ValueSy... | TOOL | 0.951923 | 7.868625 |
f6af1a06-39b5-4185-b3b8-a0f1a339c2c2 | flyflypeng/Algorithms-Book-Code | Analysis_of_Algorithms/threeSumBruteforce.cpp | /*
* @Author: woshijpf
* @Date: 2017-01-09 16:22:55
* @Last Modified by: woshijpf
* @Last Modified time: 2017-01-09 20:18:32
*/
#include <iostream>
#include <fstream>
#include <vector>
#include <string>
#include "timeClock.h"
int threeSumCount(std::vector<int>& v)
{
int N = v.size();
int cnt = 0;
for (int i = ... | ALGO | 0.994837 | 5.496802 |
82dd18a4-e9be-408b-8649-21934433b974 | WgHost-git/Task-solution_in_Cpp | Task-solution_5/Task 5.cpp | #include <iostream>
#include <ctime>
using namespace std;
typedef unsigned int uint; // переименование типа данных
uint sumBet(uint& a, uint& b);
int main()
{
setlocale(LC_ALL, "ru");
cout << endl; cout << endl;
uint a;
uint b;
cout << "\t\tСумма чисел между введеными" << endl << endl;
cout << "\tВведите пер... | ALGO | 0.995939 | 3.77334 |
b9f74f0c-9914-479e-861a-09f1a82b4389 | CalebMason/FirstGame | Engine/Source/ThirdParty/FreeImage/FreeImage-3.18.0/Source/OpenEXR/Imath/ImathVec.cpp | //----------------------------------------------------------------------------
//
// Specializations of the Vec2<T> and Vec3<T> templates.
//
//----------------------------------------------------------------------------
#include "ImathVec.h"
#include "ImathExport.h"
#if (defined _WIN32 || defined _WIN64) && def... | TOOL | 0.911457 | 7.542552 |
6f837d41-2457-4c5d-b5ac-2c0b7ced0e3a | liuzhongze7/Data_Structures_Course_Design | 课设参考/南京航空航天大学数据结构课设、实验/The-eight-experiment/yay0ya/第二次上机/第三题/找折点 链表结构.cpp | #include<iostream>
#include<stdlib.h>
using namespace std;
typedef struct LNode{
int data;
struct LNode *next;
}LNode,*Linklist;
bool InitList_L(Linklist &l,int i){
LNode *p; int j=0;
l=NULL;
for(j=0;j<i+1;j++){
p=(LNode*)malloc(sizeof(LNode));
p->next=l;
l=p;
}
}//һ
int main(){
cout<<"һnֵ\n";
int n;
int... | ALGO | 0.999861 | 3.085038 |
5f9f2e76-e1c0-42be-a992-f5f76a2743b4 | tamigore/ft_vox | srcs/math/math.cpp | #include "math/math.hpp"
using namespace math;
#define PRECISION 0.000000001
double math::fade(double t)
{
return t * t * t * (t * (t * 6 - 15) + 10);
}
double math::lerp(double t, double a, double b)
{
return a + t * (b - a);
}
double math::grad(int hash, double x, double y, double z)
{
int h = hash & 15;
doub... | ALGO | 0.995834 | 5.616375 |
24e4183a-9f40-454a-8ec0-f8d68659f8e3 | Kshitij722/Dsa-journey | comparingstring.cpp | #include <bits/stdc++.h>
using namespace std;
int main()
{
string a;
string b;
cin>>a;
cin>>b;
int n = a.length();
int m = b.length();
// if(m==n){
// map<char,int> d;
// map<char,int> c;
// for(int i=0;i<n;i++){
// d[a[i]]++;
// }
// for(int i=0;i<m;i++){
// ... | ALGO | 0.999995 | 3.916911 |
d0db19e2-c995-4b8b-82b4-8422e152fb80 | ishandutta2007/codeforces | 4fecta/normal/1213/G.cpp | #include <bits/stdc++.h>
using namespace std;
#define ll long long
#define pii pair<int, int>
#define f first
#define s second
#define readl(_s) getline(cin, (_s));
#define boost() cin.tie(0); cin.sync_with_stdio(0)
const int MN = 200005;
int n, q, u, v, w;
pair<int, ll> par[MN];
vector<pair<int, pii>> a;
ll num[... | ALGO | 0.999994 | 4.378122 |
e96a909b-3bc7-4fba-9f5a-2d8e0951d14a | ishandutta2007/codeforces | rniya/normal/1216/A.cpp | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define all(v) (v).begin(),(v).end()
#define debug(x) cout << #x << '=' << x << '\n'
const long long MOD=1e9+7;
//const long long MOD=998244353;
const int INF=1e9;
const long long IINF=1e18;
const int dx[4]={1,0,-1,0};
const int dy[4]={0,1,0,-1};
const... | ALGO | 0.999992 | 4.618978 |
e44e802c-b0bd-43de-a579-0f5b9ed9e14a | Wybxc/OpenJudge-Notes | Super-Star.cpp | #include <cmath>
#include <cstdio>
#include <iostream>
#include <random>
using namespace std;
class Vec {
public:
double x, y, z;
Vec() { x = y = z = 0; }
Vec(double x, double y, double z) : x(x), y(y), z(z) {}
Vec operator+(const Vec &v) const { return Vec(x + v.x, y + v.y, z + v.z); }
Vec opera... | ALGO | 0.999967 | 4.272116 |
971d7b6c-6200-4954-a8d2-5df992e61b65 | mehak0108/Programming | SPOJ/MARCHA1.cpp | #include<iostream>
using namespace std;
int main(){
int t,n,m,sum;
cin>>t;
while(t--){
cin>>n>>m;
int a[n];
for(int i=0;i<n;i++){
cin>>a[i];
}
for(int i=0;i<(1<<n);i++){
sum=0;
for(int j=0; j<n;j++){
if(i&(1<<j))
... | ALGO | 0.999978 | 3.958804 |
9448e46c-7862-4786-babd-31793fe37472 | andrew-crabb/recon | e7_tools_HRRT/libconvert/matrix.cpp | /*! \class Matrix matrix.h "matrix.h"
\brief This template implements a 2d matrix type with several algebraic
operations.
\author Frank Kehren (<EMAIL>)
\date 2003/11/17 initial version
\date 2004/03/18 added Doxygen style comments
\date 2004/05/18 improved documentation
This templat... | TOOL | 0.940349 | 6.589462 |
0c705178-9cfc-42f3-9b7c-04ad13564981 | RoxeNet/RoxeChain | roxe.cdt/roxe_llvm/lib/Analysis/BlockFrequencyInfoImpl.cpp | #include "llvm/Analysis/BlockFrequencyInfoImpl.h"
#include "llvm/ADT/APInt.h"
#include "llvm/ADT/DenseMap.h"
#include "llvm/ADT/GraphTraits.h"
#include "llvm/ADT/None.h"
#include "llvm/ADT/SCCIterator.h"
#include "llvm/Config/llvm-config.h"
#include "llvm/IR/Function.h"
#include "llvm/Support/BlockFrequency.h"
#include... | TOOL | 0.94095 | 7.806088 |
fc0f2933-87fc-4829-a769-ab07136044f4 | lwher/Algorithm-exercise | C++/POJ/POJ 1279.cpp | #include<iostream>
#include<cstdio>
#include<cstdlib>
#include<cmath>
#include<algorithm>
#include<cstring>
#define eps 1e-8
#define bj 1e5
using namespace std;
struct sth
{
double x,y,xx,yy;
double jijiao;
}bpm[1510];
struct kkk
{
double x,y;
}d[1510];
int n,sz,t,tou,wei;
int ans[1510];double jx[1... | ALGO | 0.999787 | 3.844808 |
01eb9fdf-ba06-402e-b22d-3ad741224bc6 | SongmiLim/Algorithm | 프로그래머스/2/12945. 피보나치 수/피보나치 수.cpp | #include <string>
#include <vector>
using namespace std;
vector <long long> memo;
int fibo(long long num) {
/*if (num <= 1)
return num;
if (memo[num] != -1)
return memo[num];
memo[num] = fibo(num - 1) + fibo(num - 2) ;
return memo[num];*/
memo[0] = 0;
memo[1] = 1;
for (i... | ALGO | 0.999946 | 4.790417 |
03d2436a-a3b0-4b6a-b6b7-46fa3f13c9d7 | 113bommy/deepmind_codecontests_refine | cpp_source_filter_file/cpp_train_8703_4.cpp | #include <bits/stdc++.h>
using namespace std;
int main() {
double l, r, x, y, k, ans;
cin >> l >> r >> x >> y >> k;
while (x <= y) {
ans = x * k;
if (ans <= l && ans <= r) {
cout << "YES";
return 0;
}
x++;
}
cout << "NO";
return 0;
}
| ALGO | 0.999949 | 3.34707 |
a81d85ad-c68c-4607-a54b-3ab4c8e21fbf | MohamedIrfanAM/cp | codeforces/Round_197_Div.2/B.XeniaandRingroad.cpp | // time-limit: 2000
// problem-url: https://codeforces.com/problemset/problem/339/B
#include<bits/stdc++.h>
#include<cstdio>
using namespace std;
int main()
{
ios::sync_with_stdio(0);
cin.tie(0);
int n;
int m;
cin >> n >> m;
long long int ans = 0;
int h,t = 1;
for ( int i = 0; i < m; i++ )
{
cin >> h;
if( h >= ... | ALGO | 0.999873 | 3.499686 |
986c099f-ef7d-457f-8557-c35c994bb6da | alexandraback/datacollection | solutions_5652388522229760_1/C++/joneschung/codejam.cpp | #include <iostream>
using namespace std;
int arr[12];
int main(){
int t, n;
cin >> t;
for (int i = 1; i <= t; i++){
cin >> n;
if (n == 0) {
cout << "Case #" << i << ": INSOMNIA" << endl;
continue;
}
int temp;
for(int j = 1; j <= 2000; j++){
temp = n * j;
while(temp != 0){
arr[temp%... | ALGO | 0.999722 | 4.679495 |
417949ca-1439-4718-9cd1-b3a6b69667e8 | rover12421/ShakaAapt | system/core/libutils/VectorImpl.cpp | #define LOG_TAG "Vector"
#include <string.h>
#include <stdlib.h>
#include <stdio.h>
#include <cutils/log.h>
#include <safe_iop.h>
#include <utils/Errors.h>
#include <utils/VectorImpl.h>
#include "SharedBuffer.h"
/*****************************************************************************/
namespace android {
/... | TOOL | 0.962561 | 7.423038 |
3fab79d7-d1c6-4595-a970-e237a06ee874 | gauravbhirud123/_Logic_Building_ | Assignment45_3.cpp | #include<iostream>
using namespace std;
template<class T>
int SearchFirst(T *arr,int iSize,T iNo)
{
int i = 0;
int iPos = 0;
for(int i = 0;i<iSize;i++)
{
if(arr[i] == iNo)
{
break;
}
iPos++;
}
return iPos+1;
}
int main()
{
int arr[] = {10,20,3... | ALGO | 0.999622 | 4.031387 |
94077dd9-f140-4da4-abb9-8440887bcfd7 | prathampithalia/CP | Codeforces/C_Assembly_via_Remainders.cpp | #include<bits/stdc++.h>
using namespace std;
void solve() {
int n; cin >> n;
vector<int> v(n - 1);
for (int i = 0;i < n - 1; i++) {
cin >> v[i];
}
vector<int> a;
int m = 1e8;
a.push_back(m);
for (int i = n - 2;i >= 0; i--) {
a.push_back(a.back() + v[n - i - 2]);
}
... | ALGO | 0.999916 | 4.701337 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.