uuid string | repo_name string | relative_path string | content string | category string | algo_rel_score float64 | quality_score float64 |
|---|---|---|---|---|---|---|
7196312f-c5f6-4915-9961-5fd92cca8c3b | actium/codeforces | 1100/10/1119a.cpp | #include <iostream>
#include <vector>
template <typename T>
std::istream& operator >>(std::istream& input, std::vector<T>& v)
{
for (T& a : v)
input >> a;
return input;
}
void answer(unsigned v)
{
std::cout << v << '\n';
}
void solve(const std::vector<unsigned>& c)
{
const size_t n = c.size(... | ALGO | 0.999792 | 4.644033 |
d384013e-7f0d-44d6-bfd0-cbdaf0c10b49 | smartzcy/My_vscode | C_learn/2023_7/2023_7_4/E.cpp | // #include <iostream>
// #include <algorithm>
// #include <vector>
// using namespace std;
// const int INF = 1e9;
// const int N = 1e5 + 10;
// int n, m, ans, pre[N];
// vector<pair<int, int>> vec[N];
// void dfs(int u, int fa, int sum, int deal) {
// for (auto &[v, w] : vec[u]) {
// if (v == fa) continue... | ALGO | 0.99988 | 5.072891 |
4380372d-9a46-450f-85b3-1e9e0636edb0 | AkshayRamakrishnann/oneAPI_With_SYCL | DirectProgramming/C++SYCL/Jupyter/sycl-performance-portability-training/lab/mm_dpcpp_ndrange_var.cpp | #include <sycl/sycl.hpp>
using namespace sycl;
void mm_kernel(queue &q, std::vector<float> &matrix_a, std::vector<float> &matrix_b, std::vector<float> &matrix_c, size_t N, size_t M) {
std::cout << "Configuration : MATRIX_SIZE= " << N << "x" << N << " | WORK_GROUP_SIZE= " << M << "x" << M << "\n";
//#... | ALGO | 0.998152 | 4.512353 |
077595db-8967-4bc5-bd63-ec4eb380301a | menaehab/Codeforces-Solutions | 1001 - 2000 problems/C_SHAWRMA.cpp | #include <bits/stdc++.h>
#define ll long long
#define el '\n'
#define all(arr) arr.begin(), arr.end()
#define allr(arr) arr.rbegin(), arr.rend()
#define pi 3.14159265358979323846
using namespace std;
void setup()
{
ios_base::sync_with_stdio(0);
cin.tie(0);
cout.tie(0);
#ifndef ONLINE_JUDGE
freopen("input.txt", ... | ALGO | 0.999985 | 4.786769 |
b43e4773-623c-461e-85fa-d821fb5f9254 | AerialSpy4/DMOJSolutions | othscc1p3.cpp | #include <bits/stdc++.h>
using namespace std;
#define endl "\n"
#define int long long
const int MM = 1e6+5;
int arr[MM];
int32_t main() {
cin.sync_with_stdio(0);
cin.tie(0);
int n, d;
cin >> n >> d;
int streak = 1, maxstreak = 1;
int ans = 1;
cin >> arr[0];
for (int i=1; i<n; i++) ... | ALGO | 0.999947 | 4.116645 |
29de1691-33d4-46ef-80f6-162b82b9129e | tic40/atcoder | daily_training/20240319_3/h/main.cpp | #include <bits/stdc++.h>
using namespace std;
#define REP(i,n) for(int i=0;i<n;i++)
#define endl '\n'
using ll = long long;
int main() {
int n,k; cin >> n >> k;
vector<int> a(n);
REP(i,n) cin >> a[i];
set<ll> st = {0};
REP(i,k) {
ll x = *st.begin();
st.erase(x);
REP(i,n) st.insert(x+a[i]);
}
... | ALGO | 0.999964 | 3.285586 |
d340601e-115f-42a9-8609-26d1f43e86f4 | 113bommy/deepmind_codecontests_refine | cpp_gold_filter_file/cpp_train_5586_350.cpp | #include <bits/stdc++.h>
using namespace std;
int main() { cout << "Odd"; }
| ALGO | 0.998709 | 3.299085 |
edfc1ba9-4299-40ca-90e0-cc8418444c86 | sarvex/leetcode-c-sharp | solution/0200-0299/0251.Flatten 2D Vector/Solution.cpp | class Vector2D {
public:
Vector2D(vector<vector<int>>& vec) {
this->vec = move(vec);
}
int next() {
forward();
return vec[i][j++];
}
bool hasNext() {
forward();
return i < vec.size();
}
private:
int i = 0;
int j = 0;
vector<vector<in... | ALGO | 0.998284 | 6.641093 |
bd304c12-71cd-4953-b2de-f07dc26eb8ab | CrackerCat/Qingyue | module/jni/libcxx/test/std/containers/sequences/list/list.ops/merge_comp.pass.cpp | // <list>
// template <class Compare> void merge(list& x, Compare comp);
// If (addressof(x) == this) does nothing; otherwise ...
#include <list>
#include <functional>
#include <cassert>
#include "test_macros.h"
#include "min_allocator.h"
int main(int, char**)
{
{
int a1[] = {10, 9, 7, 3, 1};
int a2[] =... | TEST | 0.850385 | 4.613356 |
13ec4601-cd8b-46c9-b128-b9e9ae3bc6da | k2font/atcoder | virtualcontest/20200818/C.cpp | #include <bits/stdc++.h>
using namespace std;
#define REP(i,n) for(int i=0, i##_len=(n); i<i##_len; ++i)
#define all(x) (x).begin(),(x).end()
using ll = long long;
using P = pair<ll, ll>;
string char_to_string(char val) {
return string(1, val);
}
int char_to_int(char val) {
return val - '0';
}
template<class T> in... | ALGO | 0.99996 | 4.100975 |
8ce3fb65-c810-4fb7-97f1-31d91c7f95ab | Mahak491/Dsa-problems | 0062-unique-paths/0062-unique-paths.cpp | class Solution {
public:
int getuniquePaths(vector<vector<int>>& dp,int m,int n){
if(m == 0 && n == 0)
return 1;
if(m < 0 || n < 0)
return 0;
if(dp[m][n] != -1) return dp[m][n];
int up = getuniquePaths(dp,m-1,n);
int left = getuniqueP... | ALGO | 0.999954 | 6.383649 |
30d6ae87-0e60-44b2-8f3a-e30b5915f854 | nmosier/tpt-llvm | clang-tools-extra/pp-trace/PPTrace.cpp | #include "PPCallbacksTracker.h"
#include "clang/AST/ASTConsumer.h"
#include "clang/AST/ASTContext.h"
#include "clang/Basic/SourceManager.h"
#include "clang/Driver/Options.h"
#include "clang/Frontend/CompilerInstance.h"
#include "clang/Frontend/FrontendAction.h"
#include "clang/Frontend/FrontendActions.h"
#include "clan... | TOOL | 0.871395 | 7.613509 |
290c01b4-9f91-43a3-af48-db7910f2a98b | priyavrat-misra/leetcode-solutions | solutions/string-compression.cpp | class Solution {
public:
int compress(vector<char>& chars) {
int n = chars.size();
if (n < 2)
return n;
int i = 0, j = 0;
while (i < n) {
chars[j] = chars[i];
int count = 0;
while (i < n && chars[i] == chars[j])
++count, ++i;
if (count == 1)
++j;
else {
string s = ... | ALGO | 0.999977 | 6.198773 |
4491f8ca-4574-491c-9640-c400f2153ed0 | StyxProject/development | vndk/tools/header-checker/src/utils/string_utils.cpp | #include "utils/string_utils.h"
#include <llvm/ADT/Optional.h>
#include <algorithm>
#include <cctype>
#include <cstdlib>
#include <string>
#include <utility>
namespace header_checker {
namespace utils {
std::string_view Trim(std::string_view s) {
std::string::size_type start = s.find_first_not_of(" \t\r\n");
if... | TOOL | 0.94245 | 6.972022 |
4a73c8f4-b163-4052-8623-91e66a6d463f | qpwoeirut/competitive-programming | ojuz/ioi/2020/Day1/plants_sol/solution/plants-yanhao-many_permutations.cpp | #include <bits/stdc++.h>
#define low(i) (i<<(__builtin_clz(i)-31+n_bits))-(1<<n_bits)
#define high(i) ((i+1)<<(__builtin_clz(i)-31+n_bits))-(1<<n_bits)-1
#define lt_dist(x,y) (y-x+n)%n
using namespace std;
int n;
const int n_max = 10100;
int permutation[n_max][n_max];
int k_global;
void init(int k, std::vector<int> r)... | ALGO | 0.999977 | 3.576797 |
9ba8983f-fc47-43b5-8b5d-7e6ef4fd76e5 | evertheylen/ArcadeGame | src/lib/boost/libs/math/example/policy_ref_snip6.cpp | // Note that this file contains quickbook mark-up as well as code
// and comments, don't change any of the special comment mark-ups!
//[policy_ref_snip6
#include <boost/math/distributions/negative_binomial.hpp>
using boost::math::negative_binomial;
// Use the default rounding policy integer_round_outwards.
// Lower ... | ALGO | 0.998025 | 4.85992 |
e94a7c90-8f18-42b9-8257-dd473e00e8b2 | GandyA23/solutions-to-problems-different-platforms | DailyCodingProblem/Easy/Two_numbers_sum_k/main.cpp | #include<bits/stdc++.h>
using namespace std;
bool binarySearch (int arr[], int n, int x) {
int l = 0;
int r = n-1;
int mid;
while (l+1 < r) {
mid = (l+r)/2;
if (arr[mid] == x) {
return true;
} else if (arr[mid] < x) {
r = mid;
} else {
l = mid;
}
}
return arr[l] == x || arr[r] == x ;
}
b... | ALGO | 0.999406 | 4.495649 |
ad524d0e-0df9-4562-9dc9-a415ee5112c6 | Macw07/Macw07 | Algorithm/StringType/Practices/P1603-ๆฏ่ฏบ็ป็ๅฏ็ .cpp | #include <iostream>
#include <algorithm>
using namespace std;
string str, ans;
string nums[] = {"zero", "one", "two", "three", "four", "five", "six", "seven", "eight", "nine", "ten", "eleven", "twelve", "thirteen", "fourteen", "fifteen", "sixteen", "seventeen", "eighteen", "nineteen", "twenty","a","both","another","fi... | ALGO | 0.999534 | 3.722017 |
962d33be-40eb-4013-905e-b9734ed36004 | silverlnng/DatastructureStudy | Stack_Project_LinkedList/Stack_Project_LinkedList/Stack_Project_LinkedList.cpp | // Stack_Project_LinkedList.cpp : ์ด ํ์ผ์๋ 'main' ํจ์๊ฐ ํฌํจ๋ฉ๋๋ค. ๊ฑฐ๊ธฐ์ ํ๋ก๊ทธ๋จ ์คํ์ด ์์๋๊ณ ์ข
๋ฃ๋ฉ๋๋ค.
//
#include <iostream>
#include "Stack_Project_LinkedList.h"
int main()
{
std::cout << "Hello World!\n";
}
// ๋จผ์ ์คํ์ ์์ ์ ์ฅ์ ์ ์์ฑ -> ๋
ธ๋๋ฅผ ์์ ์ ์ฅ์์ ์์ฑ
void LLS_CreateStack(LinkedListStack** Stack) //LinkedListStack ์ ํ๋ฆฌ์คํ ์ด์ ์์ฑ
{
... | ALGO | 0.914019 | 5.3637 |
6d25f32d-ea06-4901-a6a6-2999d1926748 | fwilliams/geogram-pcu | src/lib/geogram/mesh/mesh_intersection.cpp | #include <geogram/mesh/mesh_intersection.h>
#include <geogram/mesh/mesh.h>
#include <geogram/mesh/mesh_AABB.h>
#include <geogram/mesh/mesh_repair.h>
#include <geogram/mesh/mesh_geometry.h>
#include <geogram/mesh/mesh_reorder.h>
#include <geogram/mesh/mesh_fill_holes.h>
#include <geogram/mesh/mesh_geometry.h>
#include <... | ALGO | 0.978002 | 7.601888 |
50ef152e-d747-4672-a700-42ae59ac6c01 | thecoducer/Problem-Solving-Vault | Misc/Kaprekar_Number.cpp | #include<iostream>
#include<cmath>
using namespace std;
bool check_kaprekar(long k);
int main(void){
long n;
cout<<"Enter a no.: ";
cin>>n;
if(check_kaprekar(n)){
cout<<n<<" is a Kaprekar Number."<<endl;
}else{
cout<<n<<" is not a Kaprekar Number.\n";
}
return 0;
}
bool ch... | ALGO | 0.9982 | 4.213777 |
2e7c9c0b-a803-4f42-a75e-3eea6e412fea | Bibs24/Leetcode-GFG-Progress | 1335-minimum-difficulty-of-a-job-schedule/1335-minimum-difficulty-of-a-job-schedule.cpp | class Solution {
public:
int dp[305][15];
int helper(vector<int>& arr, int i, int n, int k)
{
// base case
if(i == n && k == 0)
return 0;
// if exactly k partition is not possible
if(k <= 0)
return INT_MAX;
... | ALGO | 0.999931 | 5.813614 |
2985948f-7177-4618-a9c6-4d76f2299d41 | tangtnp/2110328-Data-structures-and-Algorithms | Algorithm/code/ShortestPathWithNegativeEdge/ex06e2_shortest.cpp | #include <iostream>
#include <vector>
#include <limits.h>
using namespace std;
//shortest path with negative edge
int main() {
int N,e,s;
cin >> N >> e >> s;
vector<vector<pair<int,int>>> edge(N);
vector<int> D(N,INT_MAX/2);
while (e--) {
int a,b,c;
cin >> a >> b >> c;
edge[a].push_back(make_pair... | ALGO | 0.999988 | 3.908056 |
d32a1314-32cf-4838-9355-a290571ec61e | syedukkashah/DSA-Fall-24 | Lab/07/Q1.cpp | #include <iostream>
struct Node {
int data;
Node* next;
Node(int val) : data(val), next(nullptr) {}
};
void swap(Node* a, Node* b) {
int temp = a->data;
a->data = b->data;
b->data = temp;
}
Node* partition(Node* head, Node* end, Node** newHead, Node** newEnd) {
Node* pivot = end;
... | ALGO | 0.999996 | 6.05275 |
ae074aa5-91e1-4379-aa5f-f27d453bc486 | Paul-Darius/ipol-matlab | srcmire_2/MIRE.cpp | /**
* @file MIRE.cpp
* @brief Routines using MIRE
*
* @author Yohann Tendero <<EMAIL>>
*/
#ifdef _OPENMP
#include <omp.h>
#endif
#include <stdio.h>
#include <list>
#include <vector>
#include <algorithm>
#include <cmath>
#include "MIRE.h"
#define ABS(x) (((x) > 0) ? (x) : (-(x)))
#ifndef M_PI
using namespace std;
... | ALGO | 0.999602 | 5.098994 |
dc0d1af9-7ac7-49e3-8ef7-e16ba44fad7f | Dipeshmaurya1/quick_starter | 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 |
5acf8db0-b8c4-4cdd-b8c4-db1b2ea2ce18 | Singh007sarvesh/Algorithms | BinaryTreeInsertion.cpp | #include <bits/stdc++.h>
using namespace std;
struct node
{
int data;
struct node *left;
struct node *right;
};
struct node *insert(struct node *root,int data)
{
struct node *ptr;
if(root==NULL)
{
ptr=new struct node;
ptr->data=data;
ptr->left=NULL;
ptr->right=NU... | ALGO | 0.999994 | 4.494898 |
82440f0d-6639-4483-b6c1-716e75973590 | bhavinmoriya/Learning-C- | polyAdd.cpp | #include <iostream>
#include <vector>
#include <cmath>
#include <string>
using namespace std;
// Function to add two polynomials
std::vector<int> addingPolynomials(const std::vector<int> &A, const std::vector<int> &B)
{
int m = A.size();
int n = B.size();
int M = ((m <= n) ? n : m);
std::vector<int> re... | ALGO | 0.999948 | 4.827344 |
675a2ba6-9569-49a4-9da0-53870b4ad29d | dew987/100Days-of-GFG-POTD | Day-85/Day-85_Non_Repeating_Number.cpp | //{ Driver Code Starts
#include<bits/stdc++.h>
using namespace std;
// } Driver Code Ends
class Solution
{
public:
vector<int> singleNumber(vector<int> nums)
{
// Code here.
int n= nums.size();
int xorNums= 0;
for(int i= 0; i<n; i++)
{
xorNums^= nums[i];
... | ALGO | 0.999961 | 4.781164 |
c57ded5e-c4f5-40a5-a62e-665c49eba686 | withhaotian/LeetCode | src/2025/03/0315/334.cpp | /*
็ปไฝ ไธไธชๆดๆฐๆฐ็ป nums ๏ผๅคๆญ่ฟไธชๆฐ็ปไธญๆฏๅฆๅญๅจ้ฟๅบฆไธบ 3 ็้ๅขๅญๅบๅใ
ๅฆๆๅญๅจ่ฟๆ ท็ไธๅ
็ปไธๆ (i, j, k) ไธๆปก่ถณ i < j < k ๏ผไฝฟๅพ nums[i] < nums[j] < nums[k] ๏ผ่ฟๅ true ๏ผๅฆๅ๏ผ่ฟๅ false ใ
็คบไพ 1๏ผ
่พๅ
ฅ๏ผnums = [1,2,3,4,5]
่พๅบ๏ผtrue
่งฃ้๏ผไปปไฝ i < j < k ็ไธๅ
็ป้ฝๆปก่ถณ้ขๆ
็คบไพ 2๏ผ
่พๅ
ฅ๏ผnums = [5,4,3,2,1]
่พๅบ๏ผfalse
่งฃ้๏ผไธๅญๅจๆปก่ถณ้ขๆ็ไธๅ
็ป
็คบไพ 3๏ผ
่พๅ
ฅ๏ผnums = [2,1,5,0,4,6]
่พๅบ๏ผtrue
่งฃ้๏ผไธๅ
็ป (3, 4, 5) ๆปก่ถณ้ขๆ๏ผๅ ไธบ nu... | ALGO | 0.999961 | 5.847446 |
7877c22e-32fc-4a3e-91a1-cf9ba9bf42ae | SarbajitPbappy/DIU | ADVANCE CAMP/contest 4/A.cpp | #include <iostream>
#include <vector>
using namespace std;
vector<bool> primes;
bool isPrime(int num) {
if (num < 2)
return false;
if (num == 2)
return true;
if (num % 2 == 0)
return false;
return primes[num] == false;
}
void sieve(int num) {
primes.assign(num + 1, false)... | ALGO | 0.999966 | 4.573663 |
f48a96a7-6dd3-44e1-b4fb-8f333d8fa49b | irromano/SSE_MatrixMult | SSE_MatrixMult.cpp | // SSE_MatrixMult.cpp : This program calculates a matrix multiplication using standard instructions and SSE instructions seperatly and then compares their timing results. It first makes this calculation normally through serial instructions and then again using SSE instructions. Both functions compute the matrix equatio... | ALGO | 0.968552 | 5.053268 |
602e58c4-0f2e-47e6-8cff-15f2dd1625e7 | geoffrey-anto/leetcode-solutions | problems/element_appearing_more_than_25%_in_sorted_array/solution.cpp | class Solution {
public:
int findSpecialInteger(vector<int>& arr) {
int n = arr.size();
int qtr = n / 4;
int curr = 0;
int currEle = arr[curr];
curr++;
for (int i=1; i<n; i++) {
if (currEle == arr[i]) {
curr++;
} else {
... | ALGO | 0.999707 | 5.449695 |
46675bd5-0b9e-429d-9261-ed5b406c6995 | siddhi-244/Pattern_programs | Star_patterns/4.cpp | /*Pattern
* * * * *
* * * *
* * *
* *
*
*/
#include <iostream>
using namespace std;
int main(){
int n;
cin >> n;
//write your code here
int stars=n;
int spaces=0;
for(int i=1;i<=n;i++){
for (int j=1;j<=spaces;... | ALGO | 0.999961 | 4.250279 |
8ebe734c-aeee-4274-a669-71587f5ee122 | Isaac-Graham/AlgorithmExercise | leetcode/editor/cn/[้ข่ฏ้ข 08.02]robot-in-a-grid-lcci.cpp | //่ฎพๆณๆไธชๆบๅจไบบๅๅจไธไธช็ฝๆ ผ็ๅทฆไธ่ง๏ผ็ฝๆ ผ r ่ก c ๅใๆบๅจไบบๅช่ฝๅไธๆๅๅณ็งปๅจ๏ผไฝไธ่ฝ่ตฐๅฐไธไบ่ขซ็ฆๆญข็็ฝๆ ผ๏ผๆ้็ข็ฉ๏ผใ่ฎพ่ฎกไธ็ง็ฎๆณ๏ผๅฏปๆพๆบๅจไบบไปๅทฆไธ่ง
//็งปๅจๅฐๅณไธ่ง็่ทฏๅพใ
//
//
//
// ็ฝๆ ผไธญ็้็ข็ฉๅ็ฉบไฝ็ฝฎๅๅซ็จ 1 ๅ 0 ๆฅ่กจ็คบใ
//
// ่ฟๅไธๆกๅฏ่ก็่ทฏๅพ๏ผ่ทฏๅพ็ฑ็ป่ฟ็็ฝๆ ผ็่กๅทๅๅๅท็ปๆใๅทฆไธ่งไธบ 0 ่ก 0 ๅใๅฆๆๆฒกๆๅฏ่ก็่ทฏๅพ๏ผ่ฟๅ็ฉบๆฐ็ปใ
//
// ็คบไพ 1:
//
// ่พๅ
ฅ:
//[
// [0,0,0],
// [0,1,0],
// [0,0,0]
//]
//่พๅบ: [[0,0],[0,1],[0,2],[1,2],[2,2]]
//่งฃ้:
//่พๅ
ฅไธญๆ ็ฒ... | ALGO | 0.999961 | 5.533071 |
69d7ba33-2566-4e04-b17e-658a0b9f233a | imulan/procon | atcoder/tkppc/a.cpp | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define rep(i,n) for(int (i)=0;(i)<(int)(n);++(i))
#define each(itr,c) for(__typeof(c.begin()) itr=c.begin(); itr!=c.end(); ++itr)
#define all(x) (x).begin(),(x).end()
#define mp make_pair
#define pb push_back
#define fi first
#define se second
int m... | ALGO | 0.999476 | 3.595981 |
a47c4550-e138-4a10-b4be-96e219a7adee | Sean95164/CP | Competitive_Programming_Udemy/Ch4_STL/Ex002_kthLargestElement.cpp | #include <bits/stdc++.h>
using namespace std;
int findKthLargest(vector<int> nums, int k) {
sort(nums.begin(), nums.end(), greater<int>());
for(const int &num:nums){
if(k == 1) return num;
k--;
}
return -1;
}
int main(){
#ifndef ONLINE_JUDGE
freopen("input.txt", "r", stdin);
freopen("output.txt", "w... | ALGO | 0.999904 | 4.497566 |
b0a3c05a-bf94-4c2d-9971-1490aa51a36f | milksake/AED | sparseMatrix.cpp | #include <iostream>
#include <vector>
#include <list>
#include <algorithm>
class sparseMatrix
{
private:
struct sparseNode
{
size_t x;
size_t y;
int v;
};
std::vector<std::list<sparseNode>> matrix[2];
public:
sparseMatrix(size_t r, size_t c);
~sparseMatrix();
vo... | TOOL | 0.919064 | 4.473677 |
e518380c-6f71-4584-ae5b-e96f6e99d5be | LucasGabriel-CP/Competitive_Prog | Codes/Graph/Articulation_Points.cpp | /*
(ห ฺก ห)yum!
*/
int n, m, timer;
std::vector<bool> vis;
std::vector<bool> AdjList[10050], tin, low;
std::set<int> Cut;
void DFS(int u, int p = -1){
vis[u] = true;
tin[u] = low[u] = timer++;
int children = 0;
for (int v : AdjList[u]){
if (v == p)
continue;
if (vis[v])
low[u] = min(low[u], ti... | ALGO | 0.999339 | 4.367639 |
6a9ea83a-efde-4cd9-a3fe-2efdb6b1c0cd | 2025-ct-study/homework | week02/์ ์๋ฏผ/BOJ_9663_NQueen.cpp | #include <bits/stdc++.h>
using namespace std;
int n;
int ans;
bool isused1[20]; // ์๋๋ก
bool isused2[20]; // ์ผ์ชฝ์ผ๋ก
bool isused3[20]; // ์ค๋ฅธ์ชฝ์ผ๋ก
void calc(int cur){
if(cur == n){
ans++;
return;
}
for(int i=0; i<n; i++){
if(isused1[i] || isused2[i+cur] || isused3[cur-i+n-1]) continue;... | ALGO | 0.999982 | 3.613192 |
fa781e7e-d962-4969-98e2-35c55503e688 | jkjan/Baekjoon | 12851.cpp | #include <iostream>
#include <vector>
#include <queue>
#include <fstream>
#define MAX_SIZE 100001 * 2
using namespace std;
void bfs(int N, int K);
int main() {
int N, K;
scanf(" %d %d", &N, &K);
bfs(N, K);
return 0;
}
void bfs(int N, int K) {
queue<pair<int, int>> willVisit;
bool visited[MAX_S... | ALGO | 0.999863 | 4.078405 |
bad04506-cbea-41e9-95a7-0f4725914dd0 | tranbahuy123456/thanhdoluutru | src/a.cpp | #include<bits/stdc++.h>
#include<map>
using namespace std;
map<int,bool>visited(int n,map<int,bool>visit){
return visit;
}
int main(){
map<int,vector<int> >nums;
map<int,bool>visit;
int n ,x,y; cin>>n;
for(int i = 0 ;i<n;i++ ){
cin>>x>>y;
nums[x].push_back(y);
nums... | ALGO | 0.999176 | 3.256364 |
dbcc1c65-f695-44a2-a5d8-c3f1a7059ee8 | abhishekgupta1906/D.S.A | Dynamic programming/balancedbt.cpp | #include <iostream>
#include <string>
#include <vector>
using namespace std;
typedef long long int ll;
const ll m = 1e9 + 7;
int multiply(ll a, ll b)
{
return (int)(((a % m) * (b % m)) % m);
}
int modAdd(ll a, ll b) { return (int)((a % m + b % m) % m); }
int balancedBTs(int h)
{
if (h == 0)
{
return... | ALGO | 0.999987 | 4.839682 |
25ef32e1-7350-43e6-9c2a-deb0e4799163 | shubhamm-06/DSA-learning | Array DSA/reverse.cpp | //Q Reverse the array A.
#include <bits/stdc++.h>
using namespace std;
int reverse(int arr[], int n){
int i,j;
for(int i=0, j=n-1; i<n/2; i++, j--){
int temp = arr[i];
arr[i] = arr[j];
arr[j] = temp;
}
for(int i=0; i<n; i++){
cout << arr[i] << " ";
}
}
int main()
{... | ALGO | 0.999865 | 5.133417 |
5afb6903-1041-470c-aa6b-29dcabd9f633 | neverac/2020summer | ไธชไบบ่ต2/C/26413285_wondove_C.cpp | #include<cstdio>
#include<cstring>
#include<queue>
#include<algorithm>
using namespace std;
typedef int int_;
#define int long long
#define maxn 1000010
const int inf=1e9+7;
inline int read(){
int ret=0,ff=1;
char ch=getchar();
while(ch<'0'||ch>'9'){
if(ch=='-') ff=-ff;
ch=getchar();
}
while(ch>='0'&&ch<='9'){... | ALGO | 0.999134 | 3.448263 |
0a8efa0a-fc1d-4982-afc7-cc978dfc572e | ananthanandanan/academics | CPP/YATI.cpp | // CPP program to demonstrate the
// set::lower_bound() function
#include <bits/stdc++.h>
using namespace std;
int main()
{
vector<int> s;
// Function to insert elements
// in the set container
s.push_back(1);
s.push_back(2);
s.push_back(3);
s.push_back(3);
s.push_back(5);
s.push_back(6);
... | ALGO | 0.99958 | 3.597825 |
f60a7e37-c77c-427c-b377-cfa1f9e37a63 | jubayertalha/Data-Structure | C++/DS Lab/Lab Mid Assessment/problem1.cpp | #include<iostream>
using namespace std;
void fun(string s){
int len = 0;
int c = 0;
int v = 0;
for(;s[len]!='\0';len++){
if(s[len]=='a'||s[len]=='e'||s[len]=='i'||s[len]=='o'||s[len]=='u'||s[len]=='A'||s[len]=='E'||s[len]=='I'||s[len]=='O'||s[len]=='U') v++;
else if((s[len]>='a'&&s[len]... | ALGO | 0.997184 | 4.731731 |
2efbec1f-9bdd-4193-a3dc-edd60e70b295 | NingShuZhu/lung_processing | Project2/Project2/tree.cpp | #include <iostream>
#include <opencv2/opencv.hpp>
#include <cmath>
//#include "functions.h"
using namespace cv;
using namespace std;
Mat add_root2(Mat tree_seed1, Mat tree_seed1_down)//าปะกฤตอผ
{
int row = tree_seed1.rows;
int col = tree_seed1.cols;
Mat add_root(row, col, CV_8UC1, Scalar(0));
for (int i = 0; i < ... | DATA | 0.98002 | 3.001084 |
5604a680-285d-4ab5-a658-047fc028dc77 | zerokill/llvm-rvex | lib/CodeGen/BranchFolding.cpp | #define DEBUG_TYPE "branchfolding"
#include "BranchFolding.h"
#include "llvm/Function.h"
#include "llvm/CodeGen/Passes.h"
#include "llvm/CodeGen/MachineModuleInfo.h"
#include "llvm/CodeGen/MachineFunctionPass.h"
#include "llvm/CodeGen/MachineJumpTableInfo.h"
#include "llvm/CodeGen/MachineRegisterInfo.h"
#include "llvm/... | ALGO | 0.996664 | 7.413716 |
b238140d-0a5f-4b20-a60f-a6c01e838eca | ACyming/OI | c++/DFS/DFS/็ฎญๅคด่ฐๅบฆ.cpp | #include <bits/stdc++.h>
using namespace std;
int main() {
int a, b;
cin >> a >> b;
cout << a + b;
return 0;
} | ALGO | 0.990062 | 3.632854 |
844686b0-3627-4daf-82d5-4e3f0bc38737 | ravimathur23/DataStructureAndAlgorithms | Tree/LeastCommonAncestor.cpp | #include <iostream>
#include <limits>
#include <queue>
using namespace std;
class Tree{
int data;
public:
Tree(int d){
data = d;
left = NULL;
right = NULL;
random = NULL;
}
int getData(){return data;}
void setData(int d){data=d;}
Tree *left, *right, *random;
};
... | ALGO | 0.999977 | 4.558062 |
b2e484e9-a674-44b2-8abb-e2244b6ad741 | ntcho/Sunrin2017 | Software/Game Programming/Codes/ConsoleApplication3/ConsoleApplication3/DataTypeBool.cpp | #include <iostream>
using namespace std;
bool IsPositive(int num) {
if (num < 0) {
return false;
}
else {
return true;
}
}
int main(void) {
bool isPositive;
int num;
cout << "Input number : ";
cin >> num;
isPositive = IsPositive(num);
if (isPositive) {
cout << "Positive number" << endl;
}
else {
... | ALGO | 0.997699 | 3.787123 |
4baa7af0-eddb-4329-b108-1b0d9e473ff7 | spin-spin-ryo/contest-practice | library/max_flow.cpp | #include <iostream>
#include <vector>
#include <tuple>
#include <string>
#include <algorithm>
#include <stack>
#include <utility>
#include <queue>
#include <map>
#include <iomanip>
#include <cmath>
#include <set>
#include <list>
#include <deque>
using namespace std;
using ll = long long;
#define mod 998244353
#define ... | ALGO | 0.99966 | 5.173888 |
fdec9d03-e492-4bcb-9ece-4673b6c107c5 | Kartik-Mathur/CPP-31AugBatch | Lecture-6-Arrays/3_LinearSearch.cpp | #include <iostream>
using namespace std;
int main() {
int a[100];
int n = 15, key, i;
for (int i = 0; i < n; ++i)
{
a[i] = i + 1;
}
for (int i = 0; i < n; ++i)
{
cout << a[i] << " ";
}
cout << endl;
cout << "Enter key: ";
cin >> key;
for (i = 0; i < n; ++i)
{
if (a[i] == key) {
cout << "K... | ALGO | 0.98845 | 3.765054 |
03ad765d-9f31-408e-874a-1fa2b4938631 | raincross7/code-similarity | codes/train_code/problem142/problem142_139.cpp | #include <bits/stdc++.h>
using namespace std;
string s;
int n,win,lose,match;
int main(){
cin>>s;
n = s.length();
for(int i = 0;i < n;i++){
if (s[i] == 'o'){
win++;
}else{
lose++;
}
match++;
}
if((8 - win) <= (15 - match)){
cout<<"YES"<<endl;
}else{
cout<<"NO"<<endl;
}
}
| ALGO | 0.999793 | 3.698467 |
4915d3fe-dfb1-426b-b9f9-03bda3cac529 | bzip2-cuda/bzip2-serial | src/old/huffman.cpp | //Modified by Anirudh R and Anushree S, with thanks to the above
#include <vector>
#include <map>
#include <queue>
#include <iostream>
#include <ostream>
#include <algorithm>
#include <iterator>
#include <string>
template<typename DataType, typename Frequency> class Hufftree
{
public:
template<typename InputIterat... | ALGO | 0.999467 | 4.46162 |
82cf7152-af61-4d29-aadb-51fe9bfee404 | Fed707/attempts | coolcal.cpp | #include <iostream>
#include <vector>
using namespace std;
int main(){
vector<double> numbers;
vector<char> operations;
double num;
char op;
cout<< "Enter the first number: ";
cin>>num;
numbers.push_back(num);
operations.push_back(op);
while(true){
cout<< "enter your oper... | ALGO | 0.933407 | 3.543319 |
ab20bf39-94a7-41db-8ad8-13e835f877b1 | Nayumi1910/Algoritmia-y-estructura-de-Datos | L4 - ARBOLES/2023-1 L4/P2-2023-1 L4/funcionesCola.cpp | /*
* File: funcionesCola.cpp
* Author: ANA RONCAL
* Created on 7 de abril de 2024, 06:07 PM
*/
#include <iostream>
#include <iomanip>
#include "Cola.h"
using namespace std;
#include "funcionesLista.h"
#include "funcionesCola.h"
/*Construye la Cola*/
void construir(struct Cola & cola){
construir(cola.lista... | ALGO | 0.986203 | 4.672113 |
60afe4c7-13b2-4732-a465-f3ccb60c0d08 | Chandan07-lab/LEETCODE_PROBLEMS | 632-smallest-range-covering-elements-from-k-lists/smallest-range-covering-elements-from-k-lists.cpp | class Solution {
public:
vector<int> smallestRange(vector<vector<int>>& nums) {
int k= nums.size();
priority_queue<vector<int>,vector<vector<int>>,greater<vector<int>>>pq;
int maxe1=INT_MIN;
for(int i=0;i<k;i++){
pq.push({nums[i][0],i,0});
maxe1=max(maxe1,nums... | ALGO | 0.999995 | 5.512339 |
da0f3d22-08a4-46e6-a030-8b0e0e006845 | sivacharan174/c-programming | amstrong.cpp | #include <stdio.h>
int main()
{
int num;
printf("Enter a number: ");
scanf("%d", &num);
if (num > 0)
printf("%d is positive.", num);
else if (num < 0)
printf("%d is negative.", num);
else
printf("The number is zero.");
return 0;
}
| ALGO | 0.975554 | 3.689437 |
14dc3095-3d86-4fbc-8f1d-4332ef974695 | i-pu/riscv-llvm-target | llvm-project/libcxx/test/std/algorithms/alg.sorting/alg.binary.search/binary.search/binary_search_comp.pass.cpp | // <algorithm>
// template<ForwardIterator Iter, class T, CopyConstructible Compare>
// constexpr bool // constexpr after C++17
// binary_search(Iter first, Iter last, const T& value, Compare comp);
#include <algorithm>
#include <vector>
#include <functional>
#include <cassert>
#include <cstddef>
#include "... | TEST | 0.99907 | 7.314066 |
d26a703a-106c-4c23-9d3e-9ae85634cd95 | koreait24/Cotesolve | 1920_์์ฐพ๊ธฐ.cpp | #pragma warning(disable:4996)
#include <stdio.h>
#include <unordered_set>
using namespace std;
int main()
{
int N, M, input;
unordered_set<int> A;
scanf("%d", &N);
for (int i = 0; i < N; i++) {
scanf("%d", &input);
A.insert(input);
}
scanf("%d", &M);
for (int j = 0; j < M; j++) {
scanf("%d", &input);
... | ALGO | 0.999902 | 3.963931 |
67c5f5cd-d979-49a8-8c6a-ebc2fef12b3f | Shah1901/C-Repository | Program c/use of sprintf and sscanf.cpp | #include<stdio.h>
#include<math.h>
int main ()
{
// int a=2, b=a, c=b+1;
//
// printf("%d%d%d", a,b,c);
int area;
int length, breadth;
printf("enter length\n");
scanf("%d", &length);
printf("enter breadth\n");
scanf("%d", &breadth);
area= length*breadth;
printf("the area is :%d\n", area);
return 0;... | ALGO | 0.992527 | 3.189155 |
fc81df25-12ba-428c-809c-1af0f8e1b878 | deepakmani2027/DSA | ARRAY/alternate_swap.cpp | #include<iostream>
using namespace std;
int main(){
int a[100],n;
cout<<"enter size:";
cin>>n;
for(int i=0;i<n;i++){
cin>>a[i];
}
for(int i=0;i<n;i+=2){
if((i+1)<n){
swap(a[i],a[i+1]);
}
}
for(int i=0;i<n;i++){
cout<<a[i]<<" ";
}
} | ALGO | 0.999845 | 3.263352 |
a76174d7-3fa4-4c1c-901a-20b077492ef4 | Bit-Net/VpnCoin | src/zerocoin/Accumulator.cpp | /**
* @file Accumulator.cpp
*
* @brief Accumulator and AccumulatorWitness classes for the Zerocoin library.
*
* @author Ian Miers, Christina Garman and Matthew Green
* @date June 2013
*
* @copyright Copyright 2013 Ian Miers, Christina Garman and Matthew Green
* @license This project is... | TOOL | 0.91686 | 6.519381 |
8eded09b-aa59-403d-9ad9-9f7c5fdb2a10 | whquddn55/Algorithm_BojSolves | 11000/11049.cpp | #include <cstdio>
#include <vector>
#include <algorithm>
#define INF 987654321
using namespace std;
vector<pair<int, int> > matrix;
vector<vector<int> > dp;
int get(int from, int to){
int& ret = dp[from][to - 1];
if (from == to - 1) {
return ret;
}
if (from == to - 2) {
return matrix[... | ALGO | 0.999772 | 3.599404 |
8dd6de7f-bc7f-4817-9c47-03348895480c | palcu/algo | HomeworkNov2009/1.CPP | #include <iostream.h>
void main()
{
int n,i,p=1;
cin>>n;
for (i=1;i<=n;i++)
p*=i*2;
cout<<p<<endl;
} | ALGO | 0.999889 | 3.493711 |
90a54732-1e31-40e5-be74-551d47265fa9 | CongJyu/CCF-CSP-Problemset-Solutions | 202303-2/main.cpp | // ccf csp 02
#include <iostream>
#include <algorithm>
using namespace std;
struct Field {
int t;
int c;
} f[100001];
int day[100001];
bool cmp(Field a, Field b) {
if (a.t != b.t) {
return a.t < b.t;
} else {
return a.c < b.c;
}
}
int main() {
ios::sync_with_stdio(false);
... | ALGO | 0.999959 | 4.528348 |
df33f726-5901-49dc-baf8-2951adc91331 | pradeep891/LeetCode-and-Gfg-Practice | Partition Equal Subset Sum - GFG/partition-equal-subset-sum.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:
// bool solve(int ar[], int n , int sum, vector<vector<int>>&dp){
// if(sum == 0) return true;
// if(sum < 0) return fa... | ALGO | 0.999779 | 6.007375 |
fc3fd416-e6b1-40b2-a109-2a3dc6cdb1b0 | takashin9/AtCoder | ABC/abc291/b.cpp | #include <bits/stdc++.h>
using namespace std;
#if __has_include(<atcoder/all>)
#include <atcoder/all>
using namespace atcoder;
#endif
using ll = long long;
int main() {
ll n;
cin >> n;
vector<double> x(5*n);
for(auto &y : x) cin >> y;
sort(x.begin(), x.end());
double ans = 0;
f... | ALGO | 0.999629 | 4.259574 |
2e7a489a-2410-4a70-8114-31b769e6c708 | aashdown2001/ashdown_srsran_slicing | lib/scheduler/support/pdcch/pdcch_type0_helpers.cpp | #include "pdcch_type0_helpers.h"
using namespace srsran;
unsigned srsran::type0_pdcch_css_n0_is_even_frame(double table_13_11_and_13_12_O,
double table_13_11_and_13_12_M,
uint8_t numerology_mu,
... | ALGO | 0.981825 | 7.389754 |
4abdffe8-3eab-48e5-bd5c-f0f97ef39191 | randomunrandom/aad_3_lab04_1 | main.cpp | //
// created by Danil Kireev, PFUR NFI-201, 20.09.18, 09:00
//
#include <iostream>
#include <cstdlib>
#include <ctime>
#include <fstream>
#include "Q.h"
using namespace std;
/*
* โ 22
* ะะฐะฝ ะผะฐััะธะฒ ัะฐะทะผะตัะฐ N ะธ ัะตะปัะต ัะธัะปะฐ K ะธ L ( 1 < K < L < N ).
* ะะฐะนัะธ ััะตะดะฝะตะต ะฐัะธัะผะตัะธัะตัะบะพะต ัะปะตะผะตะฝัะพะฒ ะผะฐััะธะฒะฐ ั ะฝะพะผะตัะฐะผะธ ะพั K ะดะพ ... | ALGO | 0.993138 | 3.160835 |
5d820d60-e1d3-4c48-bdc1-f60673077670 | tommy5198/acm | uva/uva299.cpp | /*AC 0.008ms 2012/9/22*/
#include<iostream>
using namespace std;
int main(){
int N;
while(cin >> N){
while(N--){
int L,tl,ans=0;
int tmp[50]={0},num[50];
cin>>tl;
L=tl;
while(tl--)
cin >> num[L-tl-1];
for(int i=1; i<=L ;++i)
for(int j=0;j<L;++j)
if(num[j]==i){
... | ALGO | 0.999859 | 3.479037 |
6e49a203-50e1-4385-ab4c-6dfa89996215 | bcooperstl/advent-of-code-2024 | src/solutions/aoc_day_14.cpp | #include <string>
#include <vector>
#include <iostream>
#include <sstream>
#include <cstdlib>
#include "aoc_day_14.h"
#include "file_utils.h"
#define DEFAULT_WIDTH 101
#define DEFAULT_HEIGHT 103
#define PART_1_MOVES 100
using namespace std;
using namespace Day14;
namespace Day14
{
World::World(int width, int h... | ALGO | 0.998441 | 5.380745 |
58abfe6a-5850-4c02-8907-620689ff6124 | ImQQiaoO/MyLeetCodeAnswers | cpp/LeetCode1921/main.cpp | #include <iostream>
#include <vector>
#include <algorithm>
using namespace std;
/* LeetCode 1921 */
class Solution {
public:
int eliminateMaximum(vector<int> &dist, vector<int> &speed) {
int killed_num = 0;
vector<double> residue_time;
residue_time.reserve(dist.size());
for (vecto... | ALGO | 0.999635 | 5.731351 |
14ff483e-3d82-4960-a1b3-8431576600cf | ZaicevDima/HW-144.math.spbu | 1 semester/hw8/8.3/hashtable.cpp | #include <iostream>
#include <fstream>
#include "hashtable.h"
#include "mystring.h"
#include "list.h"
using namespace std;
struct HashTable
{
int size;
int amountWords;
List **cells;
};
HashTable *createTable()
{
HashTable *newTable = new HashTable;
newTable->size = hashSize;
newTable->amount... | ALGO | 0.945274 | 4.402781 |
ca55f089-45df-471e-9bcd-baf8093ee43f | sneha502/movies-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.998809 | 6.763549 |
ac8059e6-6c15-4737-97ba-4e1562888197 | prameetu/Problem_Solving_practice | unordered_set/distinct_ele.cpp | #include<iostream>
#include<vector>
#include<unordered_set>
using namespace std;
void print_distinct_ele(vector <int> v)
{
unordered_set<int> distinct;
for(int i=0;i<v.size();i++)
{
if(distinct.find(v[i]) == distinct.end())
{
cout << v[i] << " ";
distinct.insert(v[i... | ALGO | 0.99986 | 3.99958 |
d55e8814-dd32-4f63-ad25-98751589d2c5 | chaerrad/baekjoon_algorithm | BF/14501(BF).cpp | #include <iostream>
using namespace std;
int ans = 0;
int T[16];
int P[16];
int day;
void go(int d, int sum)
{
if (d - 1 == day)
{
if (sum > ans)
ans = sum;
return;
}
if (d - 1 > day)
{
return;
}
go(d + 1, sum);
go(d + T[d], sum + P[d]);
}
int main()
{
cin >> day;
for (int i = 1; i <= day; i++)
... | ALGO | 0.999928 | 3.330906 |
121ab454-f9ac-437a-9964-8db5260b1cae | Rohan-90/GFG_Solutions | Difficulty: Medium/Minimal Cost/minimal-cost.cpp | //{ Driver Code Starts
#include <bits/stdc++.h>
using namespace std;
// } Driver Code Ends
class Solution {
public:
int solve(int i, vector<int>& arr, int k) {
int n = arr.size();
vector<int> dp(n, INT_MAX);
dp[n-1] = 0;
for (int i = n - 2; i >= 0; --i)
for (int j =... | ALGO | 0.999641 | 6.057603 |
f08dc4a7-7893-430b-847e-fd841d546ef5 | robertwyb/Computer-graphic-assignments | computer-graphics-kinematics/libigl/include/igl/pinv.cpp | #include "pinv.h"
#include <limits>
#include <cmath>
template <typename DerivedA, typename DerivedX>
void igl::pinv(
const Eigen::MatrixBase<DerivedA> & A,
typename DerivedA::Scalar tol,
Eigen::PlainObjectBase<DerivedX> & X)
{
Eigen::JacobiSVD<DerivedA> svd(A, Eigen::ComputeFullU | Eigen::ComputeFullV );
typ... | ALGO | 0.999607 | 4.81321 |
23d57181-0eef-4625-8e95-99394305b9a6 | 113bommy/deepmind_codecontests_refine | cpp_gold_filter_file/cpp_train_6287_49.cpp | #include <bits/stdc++.h>
using namespace std;
const int MAXN = 1605;
int a[MAXN][MAXN];
int n, m;
bool u[MAXN][MAXN];
int partn = 0;
int part[MAXN][MAXN];
int s[MAXN][MAXN];
int d[MAXN * MAXN];
int f[MAXN][MAXN];
int T = 25;
void dfs(int x, int y) {
if (x <= 0 || x > n || y <= 0 || y > m || u[x][y] || a[x][y] == 0) r... | ALGO | 0.999975 | 3.065238 |
35ae3a04-313d-46e8-a649-d950bcab3abf | MOHAMMED-ZAHED-KHAN/DSA-in-C-language | BINARY-SEARCH-USING-NON-RECURSIVE-FUNCTION.cpp | #include<stdio.h>
int bs(int a[] , int low , int high , int ele )
{
while(low<=high)
{
int mid=(high+low)/2;
if(a[mid]==ele)
return mid;
if(a[mid]>ele)
high=mid-1;
if(a[mid]<ele)
low=mid+1;
}
return -1;
}
int main()
{
int a[]={10,12,20,32,50,55,65,80,99},n=9,ele=99;
int index=bs(a,0,n-1,ele);
if... | ALGO | 0.999931 | 3.744457 |
8dcbe589-ad41-47cc-8285-6bc70e8e9a9d | shzfrnia/TSU-faculty-of-Informatics | Computational Mathematics/ะะตัะพะด ะัััะพะฝะฐ/mainย โ ะบะพะฟะธั.cpp | #include <iostream>
#include <cmath>
#include <utility>
#include <math.h>
//#inclide <iomanip>
using namespace std;
double func1(double x1, double x2) {
return x2 - 2*x1 - log10(x1) - 0.5;
}
double func2(double x1, double x2) {
return x2 - (2 - x1) + exp(x1);
}
double func11(double x1, double x2) {
return -2 - (1... | ALGO | 0.999959 | 3.452389 |
bba67294-9bbb-4ac8-8753-44d86535d183 | ri20045/30-days-of-coding-HackerRank | Day 4: Class vs. Instance/code.cpp | using namespace std;
#include <iostream>
class Person{
public:
int age;
Person(int initialAge);
void amIOld();
void yearPasses();
};
Person::Person(int initialAge){
// Add some more code to run some checks on initialAge
if(initialAge >= 0){
age =... | ALGO | 0.993831 | 5.070955 |
d42b3b90-fecd-4402-933d-cb3514d88bcc | kmyobin/Algorithm_Study | 3week DFS, BFS/1759/Jonggeon/1759.cpp |
#include <vector>
#include <algorithm>
#include <iostream>
#include <queue>
using namespace std;
vector<char> v;
int l,c;
//๋ง๋ค์ด์ง ๋ฌธ์ฅ, ์ฃผ์ด์ง ๋ฌธ์ฅ์ ์ธ๋ฑ์ค, ๋ง๋ค์ด์ง ๋ฌธ์ฅ์ ๊ธธ์ด, ๋ง๋ค์ด์ง ๋ฌธ์ฅ์์ ๋ชจ์ ์, ์์์
void dp(string str, int index, int len, int vowel, int consonant){
//์ฃผ์ด์ง ๋ฌธ์ฅ v์ ์ธ๋ฑ์ค๋ฅผ ๊ฐ์ ธ์ ๋น๊ตํ๋ค.
// index๋ ์ฃผ์ด์ง ๋ฌธ์ฅ์ ๋๊ธธ ์ ์๋ค.
// ๋ง๋ค์ด... | ALGO | 0.999946 | 3.452522 |
30c7407e-5415-428d-8e6a-84bd3369ed2d | Ubaid-Manzoor/HakerRank-Problems | Easy/ElectronicShop.cpp | int getMoneySpent(vector<int> keyboards, vector<int> drives, int b) {
int max_till=-1;
for(int i = 0 ; i < keyboards.size() ; i++ ){
for(int j = 0 ; j < drives.size() ; j ++){
if ( ((keyboards[i] + drives[j]) <= b) && (keyboards[i] + drives[j]) > max_till) {
max_till = (keyboards[i... | ALGO | 0.998014 | 4.063713 |
dbe951a0-6b96-4448-a87b-e7346f16c0bd | deepin-community/chromium | third_party/pdfium/core/fpdftext/cpdf_linkextract.cpp | #include "core/fpdftext/cpdf_linkextract.h"
#include <vector>
#include "core/fpdftext/cpdf_textpage.h"
#include "core/fxcrt/fx_extension.h"
#include "core/fxcrt/fx_string.h"
#include "core/fxcrt/fx_system.h"
namespace {
// Find the end of a web link starting from offset |start| and ending at offset
// |end|. The pu... | TOOL | 0.853639 | 6.943782 |
3997131b-af49-4da3-9883-3d0353e1e518 | jan-horvath/PB161 | mini06/zoo.cpp | //
// Created by Jan Horvath on 06-Oct-16.
//
#include "zoo.h"
#include <cassert>
bool Zoo::addPerson(const Person &person) {
if (hasPerson(person.email))
return false;
adopters.push_back(person);
return true;
}
bool Zoo::addAnimal(const Animal &animal) {
if (hasAnimal(animal.name))
return false;
a... | TOOL | 0.865182 | 5.343869 |
b7cc091a-38b5-4c7f-b5e5-9e85bbe77c28 | alphayellow1/AlphaYellowWidescreenFixes | source/fixes/TeenageMutantNinjaTurtles2BattleNexusFOVFix/dllmain.cpp | // Include necessary headers
#include "stdafx.h"
#include "helper.hpp"
#include <spdlog/spdlog.h>
#include <spdlog/sinks/basic_file_sink.h>
#include <inipp/inipp.h>
#include <safetyhook.hpp>
#include <vector>
#include <map>
#include <windows.h>
#include <psapi.h> // For GetModuleInformation
#include <fstream>
#include... | TOOL | 0.874729 | 6.76287 |
de6f1e67-11a0-4fcd-b631-3e0c08b87c30 | AlonsoCerpa/AlgoritmosParalelos | Pthread_linked_list_Lock_node/main.cpp | #include <iostream>
#include <random>
#include <pthread.h>
#include <chrono>
struct list_node_s
{
list_node_s()
{
pthread_mutex_init(&mutex, NULL);
}
~list_node_s()
{
pthread_mutex_destroy(&mutex);
}
int data;
struct list_node_s* next;
pthread_mutex_t mutex;
};
int... | ALGO | 0.991076 | 4.627873 |
2124a2c5-9f9d-44c0-9fac-8fddd1321859 | yoori/vanga | gears/src/Gears/Basic/AppUtils.cpp | #include <cstring>
#include "AppUtils.hpp"
namespace Gears
{
namespace AppUtils
{
OptionCont
OptionCont::operator ||(const OptionCont& right) noexcept
{
OptionCont ret(*this);
ret.eq_options.insert(ret.eq_options.end(),
right.eq_options.begin(), right.eq_options.end());
ret.... | TOOL | 0.891364 | 5.980772 |
f3c73bbd-e9e1-45ed-9682-d742bb53b338 | PatelManav/Codeforces_Backup | 1220B.cpp | /*May The Force Be With Me*/
#include <bits/stdc++.h>
#include <stdio.h>
#include <ctype.h>
#define ll long long
#define MOD 1000000007
#define endl "\n"
#define vll vector<long long>
#define pll pair<long long, long long>
#define all(c) c.begin(),c.end()
#define pb push_back
#define f first
#define s second
#define in... | ALGO | 0.99977 | 3.175423 |
78918477-1720-4a00-a7c1-e9ef94388b1b | HuntCode/Android_AirPlay | third_party/fdk-aac/libFDK/src/autocorr2nd.cpp | /* -----------------------------------------------------------------------------
Software License for The Fraunhofer FDK AAC Codec Library for Android
ยฉ Copyright 1995 - 2018 Fraunhofer-Gesellschaft zur Fรถrderung der angewandten
Forschung e.V. All rights reserved.
1. INTRODUCTION
The Fraunhofer FDK AAC Codec Lib... | ALGO | 0.997743 | 5.317157 |
dcfe65e0-2d2d-4fbb-a81a-f98cd402d361 | yashsoni501/Competitive-Programming | ICPC/Gwalior Pune 19/d.cpp | #include<bits/stdc++.h>
using namespace std;
#define ll long long
#define ff first
#define ss second
#define pb push_back
#define pf push_front
#define mp make_pair
#define pu push
#define pp pop_back
#define in insert
#define MOD 1000000007
#define endl "\n"
#define sz(a) (int)((a).size())
#define all(x) (x).begin()... | ALGO | 0.99916 | 4.420549 |
3af83120-c591-468a-849e-f3e9133b3ee8 | abhibuddy/Complete-Programing-Concepts_C_PLUS_PLUS | LOVE DSA 450 sheet/kadanealgo.cpp | #include <iostream>
#include <vector>
#include <climits>
// maximum subarray sum
// {-1,-2,-3,-4} => -1
// {1,2,3,-2,5} => 9
int maxsubsum(std::vector<int> arr)
{
int maxsum = INT_MIN;
int cursum =0;
for(auto i : arr)
{
cursum +=i;
if(maxsum<cursum)
{
maxsum = cursum;
}
if(cursum < 0)... | ALGO | 0.999391 | 5.022631 |
5ba43a2a-73d7-4bc8-b337-0789d2f21a99 | PhantomCracker/Code-Fights | Code-Arcade/Intro/Level_1/add.cpp | #include <iostream>
int add(int param1, int param2)
{
return param1 + param2;
}
int main()
{
int param1, param2;
std::cin >> param1 >> param2;
std::cout << add(param1, param2);
std::cout << std::endl;
return 0;
} | ALGO | 0.955874 | 5.189772 |
30e2aa37-e706-424d-b8cb-d1ac3f527c20 | Simba256/Competitive-Programming | Codeforces/1867/1867C.cpp | using namespace std;
#include<bits/stdc++.h>
typedef long long int ll;
typedef double dd;
typedef long double ldd;
#define forn(a,b) for (int ii=a;ii<b;ii++)
#define hhh cout<<"here"<<endl;
#define nl cout<<'\n'
#define ve vector
#define vi vector<int>
#define vll vector<ll>
#define vb vector<bool>
#define vc vecto... | ALGO | 0.999765 | 3.412891 |
d30e9343-4565-400c-84ba-4f638368f2ce | Wankupi/cpp | ๅจๆ่งๅDP/ๅณ็ญๅ่ฐๆง/ๆ็ไผๅ/CF311B Cats Transport.cpp | #include <cstdio>
#include <iostream>
#include <algorithm>
using namespace std;
typedef long long ll;
int n = 0, m = 0, p = 0;
ll t[100001], s[100001];
ll f[101][100001];
int per = 0;
ll x[100001];
int l = 0, r = 0;
inline ll y(int a) { return f[per - 1][a] + s[a]; }
inline ll min(ll a, ll b) { return a < b ? a : b; }
... | ALGO | 0.999956 | 3.356467 |
9dbf150b-cc3f-40af-be97-1f142b33c154 | ellinaleshina/mceliece-cryptosystem | bch_decode/peterson.cpp | #include "peterson.h"
namespace galois::decode {
GFPoly peterson(const galois::GFPoly &word,
galois::EInt d,
const Eigen::MatrixXi &G,
const Eigen::MatrixXi &H) {
return {};
}
} | ALGO | 0.999332 | 3.118323 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.