uuid string | repo_name string | relative_path string | content string | category string | algo_rel_score float64 | quality_score float64 |
|---|---|---|---|---|---|---|
3f229d02-8355-4ae4-b632-4d2ef39f2162 | SongKyun/Coding-Test | 프로그래머스/0/120871. 저주의 숫자 3/저주의 숫자 3.cpp | #include <string>
#include <vector>
using namespace std;
int solution(int n) {
int answer = 0;
int count = 0;
for(int i = 1; count < n ; i++)
{
if(i % 3 == 0 || to_string(i).find('3') != string::npos)
{
continue;
}
count++;
answer = i;
}
... | ALGO | 0.999767 | 5.239492 |
b9ca14da-7ed8-47fd-afd2-21beb05fc9f8 | asthajindal23/PurpleSlate | knapsack.cpp | #include<iostream>
using namespace std;
int maximum(int ,int );
int knapsack(int nbrOfElements,int weightAllowed,int *value,int *weight)
{
int item,currWeight=0;
int optimumTable[nbrOfElements+1][weightAllowed+1];
for(int item=0;item<=nbrOfElements;item++)
{
for(int currWeight=0;currWeight<=weig... | ALGO | 0.999957 | 3.947749 |
c9dd2c9f-90b2-4925-9d07-3bd421af5f79 | flutter/demos | federated_plugin/federated_plugin/example/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.998164 | 6.797273 |
2852087e-84eb-43d6-9491-9a1374eb527a | pateash/cp | src/main/my_codes/UVA_online/uva_sols/11926.cpp | #include <iostream>
#include <cstring>
using namespace std;
#define REP(i, b, n) for (int i = b; i < n; i++)
#define rep(i, n) REP(i, 0, n)
#define MAXN 1000005
bool calendar[MAXN];
int main(void) {
int n, m, a, b, rep, s, e;
while (cin >> n >> m) {
if (n == 0 && m == 0)
break;
... | ALGO | 0.999537 | 3.690646 |
209838dc-3cd7-4ee4-bae8-0cbd4e2caaae | rahiaag/abcd | LeetCode/350-Intersection-of-Two-Arrays-II.cpp | class Solution {
public:
vector<int> intersect(vector<int>& nums1, vector<int>& nums2) {
vector<int>ans;
unordered_map<int,int>st;
for (auto i:nums1){
st[i]++;
}
for (int i=0;i<nums2.size();i++){
if (st.find(nums2[i])!=st.end() && st[... | ALGO | 0.999978 | 5.667179 |
699283e6-f4f0-4961-b9d2-44f237f8bae9 | Kamlesh-Mahar/LeetCode-Problems | 606. Construct String from Binary Tree.cpp | /**
* Definition for a binary tree node.
* struct TreeNode {
* int val;
* TreeNode *left;
* TreeNode *right;
* TreeNode() : val(0), left(nullptr), right(nullptr) {}
* TreeNode(int x) : val(x), left(nullptr), right(nullptr) {}
* TreeNode(int x, TreeNode *left, TreeNode *right) : val(x), l... | ALGO | 0.999763 | 6.674312 |
5a2bc222-cde1-4f27-aefd-d7e962b92949 | ecostadelle/lista_pilhas_filas | include/inverteF1P.cpp | #include <stack>
#include <queue>
#include "inverteF1P.hpp"
void inverteF1P(std::queue<char>* f) {
// somente essa pilha e mais espaço auxiliar constante
std::stack<char> p;
while (!f->empty()) {
p.push(f->front());
f->pop();
}
while (!p.empty()) {
f->push(p.top());
... | ALGO | 0.998415 | 4.284551 |
3ea4eac3-1ace-45ab-a36c-987cbf520722 | hao14293/2021-Postgraduate-408 | PAT/PAT-B/CPP/1030.完美数列.cpp | #include <iostream>
#include <algorithm>
#include <vector>
using namespace std;
int main(){
int n;
long long p;
cin >> n >> p;
vector<int> v(n);
for(int i = 0; i < n; i++)
cin >> v[i];
sort(v.begin(), v.end());
int result = 0, temp = 0;
for(int i = 0; i < n; i++){
for(int j = i + result; j < n; j++){
if(... | ALGO | 0.999937 | 3.449427 |
b69f0c8c-2196-4877-8847-a0d7db490d37 | 05sachin/DSAwithCpp | 8.linked list 2/6reverseLL3.cpp | #include<bits/stdc++.h>
#include "node.cpp"
using namespace std;
Node* reverse(Node* head){
if(head==NULL || head->next==NULL){
return head;
}
Node* ans=reverse(head->next);
Node* tail=head->next;
tail->next=head;
head->next=NULL;
return ans;
}
Node* input(){
int data;
cin>>d... | ALGO | 0.99994 | 5.040139 |
c2871d73-0d09-4412-94b1-c3c07af9ece8 | Samiksha0321/DSL | Proj11/src/Proj11.cpp | #include <iostream>
using namespace std;
class search{
public:
int n,data[50],sortdata[50],s;
void data_input(){
cout<<"Enter No. of Elements:"<<endl;
cin>>n;
cout<<"Enter Elements:"<<endl;
for(int i=1;i<=n;i++){
cin>>data[i];
}
}
void linearSearch(int item){
s=0;
for(int i=1;i<=n;i++){
if(data... | ALGO | 0.999503 | 3.44654 |
9829f49d-e3b8-4d26-9889-778404a9fb99 | ishandutta2007/codeforces | feecie6418/normal/1332/B.cpp | #include<iostream>
#include<cstdio>
#include<algorithm>
#include<cstring>
using namespace std;
int p[25]={0,2,3,5,7,11,13,17,19,23,29,31},a[1005],col[1005],n;
int main(){
int T;
cin>>T;
while(T--){
int c[1005]={0};
cin>>n;
for(int i=1;i<=n;i++)cin>>a[i];
for(int i=1;i<=n;i++){
for(int j=1;j<=11;j++){
... | ALGO | 0.999792 | 3.334199 |
49615a3d-57d9-42e4-8e93-a08ab006ce10 | avinashyadav16/Data-Structure-and-Algorithm | 16_RECURSION/Printing_All_Subsequences.cpp | /**
* @file: Printing_All_Subsequences.cpp
* @author: Avinash Yadav
* @brief: Printing all subsequences of a string using recursion.
*/
#include <bits/stdc++.h>
using namespace std;
// Function to print all subsequences of a given array using recursion
void printingSubsequences(vector<int> &arr, vector<int> &r... | ALGO | 0.999776 | 6.902896 |
40695b12-88ad-4489-a5f2-7553c769c1dc | piyush1146115/Competitive-Programming | Code forces/Educational Round 38/C.cpp | /*
* FILE: C.cpp
*
* @author: Piyush Kanti Das <piyush123kantidas[at]gmail[dot]com>
*
* LINK:
*
* DATE CREATED: 16.02.2018 22:01:48 +06
*
* DESCRIPTION:
*
* DEVELOPMENT HISTORY:
* Date Version Description
* --------------------------------------------------------------
* 16-02-2018 1.0 ... | ALGO | 0.99982 | 4.367852 |
cd6323a8-c990-4863-8661-c6e92c19d9c3 | Soniyaraghuvanshi/Algolution_Set2 | equilibriumIndex.cpp | #include <iostream>
using namespace std;
int equilibriumIndex(int arr[], int n) {
for (int i = 0; i < n; i++) {
int leftSum = 0, rightSum = 0;
for (int j = 0; j < i; j++) {
leftSum += arr[j];
}
for (int j = i + 1; j < n; j++) {
rightSum += arr[j];
}... | ALGO | 0.999992 | 6.103196 |
983d8b95-be5b-4881-a9b6-13c9e165990c | ishandutta2007/codeforces | alishahali1382/normal/1672/F1.cpp | #include <bits/stdc++.h>
#pragma GCC optimize ("O2,unroll-loops")
//#pragma GCC optimize("no-stack-protector,fast-math")
//#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native")
using namespace std;
typedef long long ll;
typedef long double ld;
typedef pair<int, int> pii;
typedef pair<pii, int> ... | ALGO | 0.99999 | 3.978879 |
69771d40-0c5c-491d-a3aa-6e1a5f28ff9a | rushking-1/ImageProcessing100Wen | Question_11_20/answers_cpp/answer_15.cpp | #include <opencv2/core.hpp>
#include <opencv2/highgui.hpp>
#include <iostream>
#include <math.h>
// BGR -> Gray
cv::Mat BGR2GRAY(cv::Mat img){
// get height and width
int width = img.cols;
int height = img.rows;
// prepare output
cv::Mat out = cv::Mat::zeros(height, width, CV_8UC1);
// each y, x
for (i... | ALGO | 0.992841 | 5.010207 |
1fd8b927-b2a2-4eac-8d6e-a3b17ce91af2 | SaniyaParveenCode/My-Code | 0046-permutations/0046-permutations.cpp | class Solution {
private:
void solve(vector<int> nums , vector<vector<int>>& ans , int index) {
if(index >= nums.size()) {
ans.push_back(nums);
return;
}
for(int j = index ; j<nums.size();j++) {
swap(nums[index] , nums[j]);
solve(nums,ans,index+1);
swap(nums[index] , ... | ALGO | 0.999999 | 6.163967 |
54f751df-1e0a-4f8d-8af9-2aa53b9ec9bb | ryichando/shiokaze | src/octreeliquid/macoctreeproject2.cpp | //
#include "macoctreeproject2.h"
#include <shiokaze/math/RCMatrix_utility.h>
#include <pcgsolver/pcg_solver.h>
#include <numeric>
#include <cassert>
//
SHKZ_USING_NAMESPACE
using namespace macotreeliquid2_namespace;
//
void macoctreeproject2::configure( configuration &config ) {
//
configuration::auto_group group(co... | ALGO | 0.998733 | 5.717938 |
4c38d2d7-c4e5-47e7-a380-581a04d651f3 | liaolushen/sicily | 1000/1027/main.cpp | #include <string>
#include <iostream>
using namespace std;
int sort(string* skey, string* svalue, int size) {
for (int i = 0; i < size; i++) {
for (int j = 0; j < size-1; j++) {
if (skey[j] < skey[j+1]) {
string tmp = skey[j];
skey[j] = skey[j+1];
s... | ALGO | 0.999238 | 4.293587 |
b46191b2-cc56-4054-b49f-c6288b678d53 | virujthakur/LeetCode-Daily-Challenges | 09_Oct_2023_34_Find_First_And_Last_Position_Of_Element_In_Sorted_Array.cpp | class Solution {
public:
//TC: O(LOGN) SC: O(1)
vector<int> searchRange(vector<int>& nums, int target) {
int f= lower_bound(nums.begin(), nums.end(), target)- nums.begin();
int l= upper_bound(nums.begin(), nums.end(), target)- nums.begin();
if(f==l)
return {... | ALGO | 0.99995 | 6.439409 |
e976cd2c-8be5-4c77-ba37-a6098ae0bcb2 | Gaurav-Samaria/CP_Solutions | 991B Getting an A.cpp | #include <iostream>
using namespace std;
int main() {
int n, temp, i, j, counter=0;
float sum=0;
cin>>n;
int a[n];
for(i=0;i<n;i++)
{
cin>>a[i];
sum=sum+a[i];
}
for(i=0;i<n;i++)
{
for(j=i;j<n;j++)
{
if(a[j]<a[i])
{
... | ALGO | 0.99999 | 3.357413 |
c1a70994-d482-4684-bc1f-07f7fae55b1c | allanlaal/firefox | gfx/angle/checkout/src/compiler/translator/tree_ops/d3d/ExpandIntegerPowExpressions.cpp | #include "compiler/translator/tree_ops/d3d/ExpandIntegerPowExpressions.h"
#include <cmath>
#include <cstdlib>
#include "compiler/translator/tree_util/IntermNode_util.h"
#include "compiler/translator/tree_util/IntermTraverse.h"
namespace sh
{
namespace
{
class Traverser : public TIntermTraverser
{
public:
[[n... | TOOL | 0.931351 | 7.682981 |
afb0c779-deda-4aff-95c0-4dec5d56c5c4 | AdamIvanPeic/2D-polja | drg/13.cpp | #include<iostream>
#include<cstring>
#include<cctype>
#include<vector>
#include<algorithm>
#include<limits>
using namespace std;
int main(void)
{
int n, br = 1;
vector<string> words, w;
string mo[26] = {".-","-...","-.-.","-..",".","..-.","--.","....","..",".---","-.-",".-..","--","-.","---",".--.","--.-","... | ALGO | 0.999824 | 3.924607 |
d59b18b3-cfa5-43be-ae68-b0bfaf953408 | pengxiaoxing0906/C_plus_plus_Primer_Plus | ch7 函数-C++的编程模块/rect_to_polar/main.cpp | //功能:用结构体的方式表示直角坐标和极坐标,并实现直角坐标到极坐标的转换
#include <iostream>
#include <cmath>
//结构体申明
struct polar{
double distance;
double angle;
};
struct rect{
double x;
double y;
};
//函数申明
polar rect_to_polar(rect xypos);
void show_polar(polar dapos);
int main() {
using namespace std;
rect rplace;
polar p... | ALGO | 0.953942 | 3.869358 |
d2e5e040-363f-486d-8ee6-4422dc539888 | vasha54/CSES | CSES Problem Set/Mathematics/CSES - Counting Grids.cpp | /**
* CSES - Counting Grids
* Tematica : Teoria de grafos: Cantidad de caminos entre dos nodos+ exponenciacion matricial
* Idea: Dado un grafo dirigido determinar la cantidad de caminos de longitud k
* entre dos nodos del grafo
*/
#include <iostream>
#include <bits/stdc++.h>
#define ENDL '\n'
#define OPTIMIZAR_IO ios... | ALGO | 0.999992 | 4.144092 |
151fd396-b570-4c5e-9840-9bf3e2a5ffc8 | PPsteven/algorithm | solve/0009.palindrome-number/0009.palindrome-number.cpp | /**
* @index 9
* @title 回文数
* @difficulty 简单
* @tags math
* @draft false
* @link https://leetcode.cn/problems/palindrome-number/description/
* @frontendId 9
* @solved true
*/
#include <cstdio>
#include <map>
#include <vector>
#include <iostream>
using namespace std;
class Solution {
public:
bool isPalindr... | ALGO | 0.99999 | 5.941901 |
2e53a15c-bfd8-40ea-92d9-697e8918cc87 | algoboy101/note_blog_leetcode | delete/source/cpp/[1342]将数字变成 0 的操作次数.cpp | //给你一个非负整数 num ,请你返回将它变成 0 所需要的步数。 如果当前数字是偶数,你需要把它除以 2 ;否则,减去 1 。
//
//
//
// 示例 1:
//
// 输入:num = 14
//输出:6
//解释:
//步骤 1) 14 是偶数,除以 2 得到 7 。
//步骤 2) 7 是奇数,减 1 得到 6 。
//步骤 3) 6 是偶数,除以 2 得到 3 。
//步骤 4) 3 是奇数,减 1 得到 2 。
//步骤 5) 2 是偶数,除以 2 得到 1 。
//步骤 6) 1 是奇数,减 1 得到 0 。
//
//
// 示例 2:
//
// 输入:num = 8
//输出:4
//解释:
/... | ALGO | 0.999959 | 6.130241 |
63af745d-a45e-44e2-8915-a56c5233ba8d | thien926/Thien | UPCoder/BMI.cpp | #include<stdio.h>
int main(){
double a,b,res;
scanf("%lf%lf",&a,&b);
res=b/(a*a);
if(res<18.5){
printf("Chi so BMI: %0.2lf\nKet qua: gay",res);
}
else{
if(res>=25) printf("Chi so BMI: %0.2lf\nKet qua: thua can",res);
else printf("Chi so BMI: %0.2lf\nKet qua: binh thuong"... | ALGO | 0.990699 | 3.400485 |
f547a49a-68ac-41d8-a949-deecf3d085cf | raincross7/code-similarity | codes/train_code/problem470/problem470_138.cpp | #include <iostream>
#include <string>
#include <vector>
using namespace std;
int main(){
string s;
while(getline(cin, s), s != "."){
vector<int> a;
for(int i = 0; i < s.size(); i++){
switch(s[i]){
case '(':
a.push_back(0);
break;
case '[':
a.push_back(1);
break;
case ')':
if(a.emp... | ALGO | 0.999896 | 4.192924 |
cd74ca5f-15d2-40ad-adf8-f9e00cc190cd | YarlinWare/Programacion-Basica-UD | Ejercicios Trabajo Autonomo/63. Media_posiciones_par-impar.cpp | #include <iostream>
#include <string>
#include<stdlib.h>
using namespace std;
int main(){
int arreglo[20],posicion_impar=0,posicion_par=0;
for(int i=1;i<=20;i++){
cout<<"\n\tIngrese "<<i<<" numero: \t";
cin>>arreglo[i];
if(i%2==1)
posicion_impar=posicion_impar+arreglo[i];
else
posicion_par=posicio... | ALGO | 0.992253 | 3.327674 |
a63ad47d-bd5a-4113-86e8-ff1e50c01369 | RafaelWei/CP | UVa/UVa11348Exhibition.cpp | #include<bits/stdc++.h>
using namespace std;
int main(){
int k,n, qtd, aux;
scanf("%d", &k);
for(int i=1; i<=k; ++i){
int total=0;
map<int, int> m[55];
double friends[55] = {0};
scanf("%d", &n);
for(int j=1; j<=n; ++j){
scanf("%d", &qtd);
for(int k=0; k<qtd; ++k){
scanf("%d", &aux);
m[0][au... | ALGO | 0.998728 | 3.874461 |
f6fe264e-87d4-449c-a64e-4d6282c32fb1 | rainbow-auto/rainbow-codes | Luogu/CF778C.cpp | #include <iostream>
#include <algorithm>
#include <string>
#include <vector>
#include <bitset>
#include <stack>
#include <unordered_map>
#include <unordered_set>
#include <cstdio>
#include <cstring>
#include <cmath>
#include <queue>
#pragma GCC Optimize(2)
using i64 = long long;
#define fastread std::ios::sync_with_... | ALGO | 0.999242 | 3.637542 |
adf990fa-cc46-4dc6-b4bf-1e768291a89e | sureshpodeti/codechef-problems | spoj/segment_tree/upper_lowerbound.cpp | #include<iostream>
#include<vector>
using namespace std;
int main(){
int A[] = {5, 8, 7, 7, 8, 5, 5, 8};
int n = sizeof(A)/sizeof(A[0]);
vector<int> v(A, A+n);
sort(v.begin(), v.end());
// sorte list: 5, 5, 5, 6, 6, 6, 7, 7
vector<int>::iterator low_itr, upper_itr;
low_itr = lower_bound(v.begin(), v.e... | ALGO | 0.999747 | 4.415598 |
959ae9fd-f3f8-43cd-83bc-1d691b4d175b | CooperCX/TheCooper | OperationSystem/mutex-vs-atomic.cpp | #include <iostream>
#include <atomic>
#include <thread>
#include <mutex>
int a;
std::atomic<int> b;
std::mutex mutex;
void* SumByMutex(void*) {
for (volatile int i = 0; i < 10000000; i++) {
std::lock_guard<std::mutex> locker(mutex);
a++;
}
}
void* SumByAtomic(void*) {
for (volatile int i ... | TEST | 0.94424 | 6.095208 |
e56d70ce-9b10-4b14-ac5e-7b4a8726e840 | Silvanosky/ardupilot_test | libraries/AP_Proximity/AP_Proximity_RangeFinder.cpp | #include <AP_HAL/AP_HAL.h>
#include "AP_Proximity_RangeFinder.h"
#include <AP_SerialManager/AP_SerialManager.h>
#include <ctype.h>
#include <stdio.h>
#include <AP_RangeFinder/RangeFinder_Backend.h>
extern const AP_HAL::HAL& hal;
AP_Proximity_RangeFinder::AP_Proximity_RangeFinder(AP_Proximity &_frontend,
... | TOOL | 0.906786 | 6.019383 |
ac96d8cd-87f2-4c8e-b122-95a1854e086c | pluralism/advent-of-code-2018 | day1/part2.cpp | #include <iostream>
#include <algorithm>
#include <numeric>
#include <vector>
#include <unordered_set>
#include <fstream>
using namespace std;
int main()
{
ifstream fin("input1");
auto sum = 0;
std::unordered_set<int> seen_sums{sum};
std::vector<int> nums;
std::copy(std::istream_iterator<int>(fin)... | ALGO | 0.999925 | 5.264877 |
9ff9e33a-e54d-4c8a-a786-4fe044a95a70 | spranjal3301/Coding | Competitive Programming/Data Structure & Algorithmes/Ques/BinaryTree/lowestCommonAncestor.cpp | #include<bits/stdc++.h>
#include"1BinaryTree.cpp"
using namespace std;
TreeNode* lowestCommonAncestor(TreeNode* root, TreeNode* p, TreeNode* q) {
if (!root) return nullptr;
// If either p or q is found, return the current node as a potential LCA.
if (root == p || root == q) return root;
// Recursi... | ALGO | 0.999981 | 6.231772 |
df2a4a76-89de-4dec-964d-3f071a33ee5c | Adrian-Aiken/aoc-2021 | days/8/eight-b.cpp | #include <iostream>
#include <fstream>
#include <string>
#include <vector>
#include <algorithm>
#define ssort(x) std::sort(x.begin(), x.end())
using namespace std;
bool matchCount (string unknown, string known, int goal) {
int match = 0;
for (int i = 0; i < known.size(); i++)
if (unknown.find(known[i... | ALGO | 0.999348 | 5.61485 |
d63f7632-d0e9-4389-8d35-7b50c5e45446 | OzzieIsaacs/winmerge-qt | ext/boost_1_70_0/libs/math/example/find_root_example.cpp | // find_root_example.cpp
// Example of using root finding.
// Note that this file contains Quickbook mark-up as well as code
// and comments, don't change any of the special comment mark-ups!
//[root_find1
/*`
First we need some includes to access the normal distribution
(and some std output of course).
*/
#include... | ALGO | 0.999972 | 4.805835 |
7eb7afb9-37ee-45a6-89f4-561a9fec4b7e | AkashSingh3031/Striver-SDE-Sheet-Challenge | 24]. Day-24 (Graph)/CodeStudio/2]. Dijkstra’s Algorithm.cpp | #include<bits/stdc++.h>
vector<int> dijkstra(vector<vector<int>> &vec, int vertices, int edges, int source) {
unordered_map<int,list<pair<int,int>>> adj;
for(int i=0;i<edges;i++)
{
int u=vec[i][0];
int v=vec[i][1];
int w=vec[i][2];
adj[u].push_back({v,w});
adj[v]... | ALGO | 0.999802 | 4.857624 |
1356f4ff-b23a-444a-8047-0e1e7f5b6161 | Saisriram01/LeetCode-et-al | Leetcode/Week 2/InvertTree.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.999947 | 6.341393 |
be835ad1-d90d-4b01-932f-9343f3758b9d | Redolid/LeetCode-Problems-solved | 0146-lru-cache/0146-lru-cache.cpp | class LRUCache {
public:
class node
{
public:
int key;
int val;
node* next;
node* prev;
node(int _key,int _val)
{
key = _key;
val = _val;
}
};
node* head = new node(-1,-1);
node* tail = new node(-1,-1);
int size;
unordered_map<int,node*>mpp;
LRUCache(int capacity) {
size = capacity; ... | ALGO | 0.999602 | 6.218676 |
1900fa49-07cc-46c4-93b9-6e066b2bdd25 | sos0911/PS_Cpluslplus | Algorithm/codeforces/656_div3/A.cpp | // string Ϲ Ǯ̿ ø
#include <bits/stdc++.h>
using namespace std;
int main() {
cin.tie(NULL);
ios_base::sync_with_stdio(false);
int noft;
cin >> noft;
for (int i = 0; i < noft; i++) {
int x, y, z;
cin >> x >> y >> z;
int maxd = max({ x,y,z });
if ((x == y && y > z) || (y == z && z > x) || (z == x && x > y)) ... | ALGO | 0.999933 | 3.976064 |
a6516394-2e42-4124-b3e6-15ad40880a3c | Sudiptagupta217/Flutter-Tutorial | stream/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.998864 | 6.76073 |
a6c8791d-51d5-413c-ade0-639103fb00f9 | XiaohanYE99/kernel-based-navigation | extern/eigen/unsupported/doc/examples/PolynomialUtils1.cpp | #include <unsupported/Eigen/Polynomials>
#include <iostream>
using namespace Eigen;
using namespace std;
int main()
{
Vector4d roots = Vector4d::Random();
cout << "Roots: " << roots.transpose() << endl;
Eigen::Matrix<double,5,1> polynomial;
roots_to_monicPolynomial( roots, polynomial );
cout << "Polynomial:... | ALGO | 0.997552 | 3.999627 |
6d7e68cb-5006-4696-84b3-f2acbd5b07a3 | YZQ66666/c- | Chapter04/T4_13.cpp | /*
*FileName: T4_13.cpp
*Author: Ziqi Yang
*E-mail: <EMAIL>
*Date: Mar 12th,2022
*College: Henu University
*Function:
*/
#include<iostream>
using namespace std;
#include<iomanip>
int main()
{
int n;
cin >> n;
int i = 0;
double mile;
double fuel;
double sum1=0, sum2=0;
while (i <= n)
{
cin >>... | ALGO | 0.995534 | 3.833469 |
d2c698b8-f7a5-4a13-ae2d-f0fd93e0c982 | chirag24j/Codeforces | Question/A_Divan_and_a_Store.cpp | #include <bits/stdc++.h>
using namespace std;
int main()
{
int t;
cin >> t;
while (t--)
{
long long int n, l, r, k;
cin >> n >> l >> r >> k;
vector<long long> v;
for (int i = 0; i < n; i++)
{
long long a;
cin >> a;
if (a <= r &&... | ALGO | 0.999834 | 3.066564 |
1a84fe0e-2072-433e-a4c2-3a8975731781 | samarsrivastav/DSA_learning-Resource | Sorting/insertionSorting.cpp | #include <bits/stdc++.h>
using namespace std;
void insertionSort(vector <int> v){
for(int i=1;i<=v.size()-1;i++){
int current=v[i];
int prev=i-1;
while(prev>=0 and current < v[prev]){
v[prev+1]=v[prev];
prev=prev-1;
}
v[prev+1]=current;
}
}
int main(){
vector<int>v ={1,2,1,-1,4}... | ALGO | 0.999959 | 4.762848 |
f300db94-2e6d-4a45-bcb5-1af6317092ee | bowenyi-pierre/Cracking-the-Coding-Interview | CtCI-6th-Edition-cpp-master/chapter-8-recursion-and-Dynamic-Programming/8-1-Triple-Step.cpp | #include <vector>
#include <iostream>
using namespace std;
int countWays(int n , vector<int> v){
if (n==0){
return 1;
}
int sum = 0;
for (int i = 0; i < v.size(); ++i)
{
if(n>=v[i]){
sum = sum + countWays((n-v[i]),v);
}
}
return sum;
}
int main(int argc, char const *argv[])
{
vector<int> v; ... | ALGO | 0.999953 | 4.402069 |
2011487d-731f-474f-b08c-5cdb2c4667cc | rohitg1010/Coding-Questions | k-diff-pairs-in-an-array/k-diff-pairs-in-an-array.cpp | class Solution {
public:
int findPairs(vector<int>& nums, int k) {
unordered_map<int,int> mp;
for(auto it:nums) mp[it]++;
int ans=0;
for(auto it:mp){
if(k==0){
if(it.second>=2) ans++;
}
else{
if(mp.count(it.first+k)>... | ALGO | 0.999933 | 5.97658 |
b9d21367-a1e5-49c4-b226-3617dc99164c | shinchan367/interview_DS | OA/product based/string/count the char without space.cpp | #include <iostream>
#include <string>
// Function to count non-space characters in a string
int countCharacters(const std::string &str) {
int count = 0;
for (char ch : str) {
if (ch != ' ') { // Check if character is not a space
count++;
}
}
return count;
}
int m... | ALGO | 0.988966 | 6.34245 |
0f485d90-8b1f-4eac-8ab7-f7660ec7f733 | F74036263/lab1 | bgg.cpp | #include<iostream>
using namespace std;
int main()
{
int n;
cin>>n;
while(1)
{
cout<<n;
cout<<"\n";
if(n==1)
break;
else if(n%2!=0)
n=3*n+1;
else
n=n/2;
}
return 0;
}
| ALGO | 0.999978 | 3.935902 |
29a70bbf-d040-4aa9-b5a4-f2a12653f12c | vineethviswan/HackerRankSolutions | EqualizeStack.cpp |
/*
You have three stacks of cylinders where each cylinder has the same diameter, but they may vary in height.
You can change the height of a stack by removing and discarding its topmost cylinder any number of times.
Find the maximum possible height of the stacks such that all of the stacks are exactly the same heigh... | ALGO | 0.999974 | 6.071844 |
ff2958eb-f5b8-48c6-b4e7-6e22e2573adf | Severus25/100-Days-Of-Code-Challenge | Day 31 Code - Generate Parentheses.cpp | class Solution {
public:
vector<string> generateParenthesis(int n) {
vector<string> res;
addingpar(res, "", n, 0);
return res;
}
void addingpar(vector<string> &v, string str, int n, int m){
if(n==0 && m==0) {
v.push_back(str);
return;
}
... | ALGO | 0.999941 | 6.30442 |
7c465fd1-244d-4689-baf4-ad85d63eedd3 | 113bommy/deepmind_codecontests_refine | cpp_source_filter_file/cpp_train_9282_2.cpp | #include <bits/stdc++.h>
using namespace std;
int main() {
int n, m, k;
cin >> n >> m >> k;
if (n >= m && n >= k) {
cout << "YES";
} else
cout << "NO";
return 0;
}
| ALGO | 0.999937 | 3.53882 |
c0e96d83-f88e-4f0d-9b69-6514e0e99d7a | syahn/Problem-solving | acmicpc.net/hive.cpp | // # Reflection
// I calculatated the sequence of number with arithmetic progression notation. But,
// I didn't need to do like that. I should have thought more simply.
// # Problem
// 시간 제한 메모리 제한 제출 정답 맞은 사람 정답 비율
// 2 초 128 MB 2554 1288 1093 51.242%
//
// 문제
// 위의 그림과 같이 육각형으로 이루어진 벌집이 있다.
// 그림에서 보는 바와 같이 중앙의 방 ... | ALGO | 0.999871 | 4.49713 |
73299a18-5ae9-4b45-8672-26f18bcac8dd | pritmanvar/DSA-with-CPP | Arrays/Find All Numbers Disappeared in an Array.cpp | // Problem Link : https://leetcode.com/problems/find-all-numbers-disappeared-in-an-array/submissions/
vector<int> findDisappearedNumbers(vector<int>& nums) {
for(int i = 0; i < nums.size(); i++){
if(nums[abs(nums[i])-1] > 0) // we will go to the position at nums[i] and make that negativ... | ALGO | 0.999773 | 5.515372 |
aee5f0ec-ffeb-4841-9b84-7edc2b2105b2 | kauanINFO/Rob-tica- | 18.cpp | // Example program
#include <iostream>
#include <string>
using namespace std;
void incremento(int *num1, int *inc){
*num1 = *num1 + *inc;
cout << "O numero com incremento fica: " << *num1 << endl;
}
int main()
{
int val;
int incre;
cout << "Digite o valor do numero e do incremento a ser colocado nele... | ALGO | 0.998306 | 3.410377 |
c03944f6-b70e-4273-99b8-54cfe31302dd | ishandutta2007/codeforces | deemo/normal/367/B.cpp | #include<cstdio>
#include<vector>
#include<algorithm>
#include<utility>
#include<map>
using namespace std;
int n, m, p;
vector<int> a, b, ans;
map<int, int> mp, f;
int main(){
scanf("%d%d%d", &n, &m, &p);
a.resize(n);
for (int i = 0; i < n; i++)
scanf("%d", &a[i]);
b.resize(m);
for (int i = 0; i < m; i++){
... | ALGO | 0.999994 | 3.127898 |
e85649c4-1198-46cb-b479-3c1e601a555c | sarvex/leetcode-cobol | solution/2000-2099/2093.Minimum Cost to Reach City With Discounts/Solution.cpp | class Solution {
public:
int minimumCost(int n, vector<vector<int>>& highways, int discounts) {
vector<vector<pair<int, int>>> g(n);
for (auto& e : highways) {
int a = e[0], b = e[1], c = e[2];
g[a].push_back({b, c});
g[b].push_back({a, c});
}
prio... | ALGO | 0.999611 | 5.449436 |
88a28813-3e20-4470-9c9b-133af88764a2 | msgeden/llvm-project | llvm/lib/CodeGen/MachineOutliner.cpp | #define DEBUG_TYPE "machine-outliner"
using namespace llvm;
using namespace ore;
using namespace outliner;
STATISTIC(NumOutlined, "Number of candidates outlined");
STATISTIC(FunctionsCreated, "Number of functions created");
// Set to true if the user wants the outliner to run on linkonceodr linkage
// functions. Thi... | TOOL | 0.965072 | 6.596485 |
7ec4e395-8d14-4c5f-a280-f50687da24f6 | amorphid/cplusplus | TSP_DP/Costs_class.cpp | class Costs {
private:
int destination;
set<int> intermediate_set;
int cost; // minimal cost
int parent;
public:
bool equals(Costs k)
{
if (docelowy == k.docelowy && zbior == k.zbior)
return true;
else
return false;
}
int get_destination() { return destination; }
set<int> get... | ALGO | 0.980544 | 4.393042 |
68189c68-9cac-4166-bb77-ad695ee7f700 | kamal-stark-dev/Learning | LeetCode/98. Intersection of Two Sorted Arrays.cpp | #include <bits/stdc++.h>
using namespace std;
vector<int> findIntersection(vector<int> a, vector<int> b) {
int n = a.size(), m = b.size();
int i = 0, j = 0;
vector<int> common;
while (i < n && j < m) {
if (a[i] == b[j]) {
common.push_back(a[i]);
i++; j++;
}
... | ALGO | 0.999871 | 5.14847 |
3dde9b8a-389a-473c-8ffa-f0d460240be7 | Code-OS/frameworks_base | tools/aapt2/DominatorTree.cpp | #include "DominatorTree.h"
#include <algorithm>
#include "android-base/logging.h"
#include "ConfigDescription.h"
namespace aapt {
DominatorTree::DominatorTree(
const std::vector<std::unique_ptr<ResourceConfigValue>>& configs) {
for (const auto& config : configs) {
product_roots_[config->product].TryAddCh... | ALGO | 0.94635 | 7.590319 |
7c7b380e-24f5-4fc5-980c-331bb3441da4 | apai05/repo | maxprofit/maxprofit.cpp | /*
* Program to find max difference between 2 elements;
* Max profit problem: buy n sell stock for max profit.
*/
#include <iostream>
using namespace std;
int maxProfit(int prices[], int n)
{
// initially, max profit is set to 0
int maxprofit = 0;
// begin with last 2 elements
int hi = n-1;
in... | ALGO | 0.999962 | 6.26247 |
dc857799-55f8-4146-b8e9-b894bb51327d | physicsmatt/spm_correction | Eigen/test/denseLM.cpp | #include <iostream>
#include <fstream>
#include <iomanip>
#include "main.h"
#include <Eigen/LevenbergMarquardt>
using namespace std;
using namespace Eigen;
template<typename Scalar>
struct DenseLM : DenseFunctor<Scalar>
{
typedef DenseFunctor<Scalar> Base;
typedef typename Base::JacobianType JacobianType;
typed... | TEST | 0.962763 | 5.862647 |
08da80bf-1d98-4b27-be87-ce70d928451e | lychees/ACM-Training | Note/集训队作业/2015/作业1/htahta_黄涛岸/我的代码/CF277D.cpp | #include <iostream>
#include <cstdio>
#include <cstdlib>
#include <algorithm>
#include <cmath>
#include <cstring>
using namespace std;
typedef long double LD;
int get()
{
int f=0,v=0;char ch;
while(!isdigit(ch=getchar()))if(ch=='-')break;
if(ch=='-')f=1;else v=ch-'0';
while(isdigit(ch=getchar()))v=v*10+ch-'0';
if(... | ALGO | 0.999969 | 3.489541 |
ae4fd816-94d4-4bd3-8766-557360000dde | JzHuai0108/FAST_LIO | src/dist_checkup.cpp | #include "dist_checkup.h"
size_t load_states(const std::string &path_to_traj, Trajectory &traj) {
std::ifstream stream(path_to_traj);
if (!stream.is_open()) {
std::cerr << "Failed to open file: " << path_to_traj << std::endl;
return 0;
}
traj.reserve(10000);
std::string line;
wh... | ALGO | 0.992457 | 5.965507 |
1541b101-e2ed-4d3b-a57c-641f3a49ed41 | KelvinMarcondes/course-algorithms | cpp/notas.cpp | #include <iostream>
#include <iomanip>
using namespace std;
int main(){
double nota1, nota2, notafinal;
cout << "Digite a primeira nota: ";
cin >> nota1;
cout << "Digite a segunda nota: ";
cin >> nota2;
notafinal = nota1 + nota2;
cout << fixed << setprecision(1);
cout << "NOTA FINA... | TOOL | 0.906055 | 4.622253 |
cf8c917e-148b-45f0-96e4-c820d83b119e | Cyril-Mathew/BscpSemVCsCore | LinearQueueUsingArrays.cpp | //Queue using arrays//
#include <iostream>
using namespace std;
int queue[100], n = 100, front = -1, rear = -1;
void Insert()
{
int val;
if (rear == n - 1)
cout << "Queue Overflow" << endl;
else
{
if (front == -1)
front = 0;
cout << "Insert the element in queue : " <<... | ALGO | 0.99743 | 4.150919 |
fa35a35d-c7d5-4175-ae7f-3d48eb2bc98c | JODA-Explore/JODA | libs/joda/core/modules/queryexecution/src/executor/AdaptiveIndexExecutor.cpp | #include "AdaptiveIndexExecutor.h"
#include <joda/indexing/AdaptiveIndexQueryTreeVisitor.h>
#include <joda/indexing/AdaptiveQueryExecutorVisitor.h>
#include <iostream>
#include "../../../indexing/src/adaptive/visitors/NextPredicateVisitor.h"
#include "../../../indexing/src/adaptive/visitors/SetPredicateVisitor.h"
A... | ALGO | 0.958564 | 7.436075 |
464ab1bd-4c0e-4438-975c-975d56e7ef07 | md-musa/problem-solving | DSA with C++/bstTest.cpp | #include <bits/stdc++.h>
using namespace std;
void insert(int data);
typedef struct Node {
int data;
struct Node* left;
struct Node* right;
} Node;
Node* root = NULL;
void traverseInorder(Node* root);
Node* search(int query);
int main() {
insert(30);
insert(20);
insert(40);
insert(45);
insert(55);
... | ALGO | 0.999645 | 4.485138 |
52d1d496-40df-4feb-8960-1df12cee4012 | lhbuaa2009/IMR_NMI_Tracking | experiment/test_GrayCentroid.cpp | /*
* compute respective gray centroid of selected pixels,
* using a 7*7 pathch
*/
#include <common.h>
#include <Frame.h>
#include <FrameReader.h>
#include <globalFuncs.h>
#include <CameraIntrinsic.h>
#include <PixelSelector.h>
#include <sstream>
using namespace DSLAM;
int main(int argc, char** argv)
{
Paramete... | ALGO | 0.998612 | 4.132128 |
2c23b410-6404-4efb-bc84-2ae7a1a8cb10 | Girl-Code-It/Recursion-and-BackTracking-Live-Sessions | Recursion Session 2/AssignmentSolutions.cpp | #include<bits/stdc++.h>
using namespace std;
// 1==============================================
class Solution{
public:
void juggler(vector<int>& ans, long long N){
ans.push_back(N);
if(N==1){
return;
}
if(N%2==0){
juggler(ans,sqrt(N));
... | ALGO | 0.999961 | 4.236531 |
bb0383c8-a841-4226-8997-a823552d01ae | muskan184/DSA_problem | Maximum Nesting Depth of the Parentheses.cpp | class Solution {
public:
int maxDepth(string s) {
int count = 0;
int max_num = 0;
for (char c : s) {
if (c == '(') {
count++;
if (max_num < count)
max_num = count;
} else if (c == ')') {
count--;
... | ALGO | 0.999493 | 5.706731 |
ab2d11b8-822e-4348-a3e1-2c2727d17457 | lalala-zjr/practice | learn_c++/template/SelectionSort.cpp | #include<iostream>
template<typename T>
void SelectionSort(T a[],int n){
for(int i = 0;i<n-1;i++){
int index = i;
T min = a[i];
for(int j = i+1;j<n;j++){
if(min > a[j]){
min = a[j];
index = j;
}
}
if(index != i){
T temp = a[index];
a[index] = a[i];
a[i] = temp;
}
}
}
int main(){
in... | ALGO | 0.999609 | 4.01037 |
6de6071e-a2ee-46cd-a748-c5a3f170c17c | Omdahake/project1 | Translater/demo.cpp | #include <iostream>
#include <cstdint>
using namespace std;
auto fact (uint32_t k ) -> uint32_t { uint32_t output=0;
uint32_t m = 1;
output = 1;
while (m<k) {
m = m + 1;
output=output * m;
}
return output; }
int main(){
cout<<"ans is :"<<fact(5)<<endl;
return 0;
}
| ALGO | 0.999891 | 4.96507 |
7e44dd8f-021a-4f7b-9393-8644d6763c43 | Masila-Isaac/Androids | socialite/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.99825 | 6.776823 |
dbfd5dfb-6b1b-49a6-a7f8-1be85bdf78ae | ishandutta2007/codeforces | gmusya/normal/208/E.cpp | #include <iostream>
#include <vector>
#include <algorithm>
using namespace std;
int timer = 0;
void dfs (int v, vector <int> &p, vector <int> &d, vector <int> &tin, vector <int> &tout, vector <vector <int>> &g) {
tin[v] = timer++;
for (int u : g[v]) {
p[u] = v;
d[u] = d[v] + 1;
dfs(u, p, d, tin, tout... | ALGO | 0.999966 | 4.463765 |
be128444-ad86-4cf6-be24-b7da843071a7 | KomiMoe/Arkari | bolt/test/Inputs/jump_table_icp.cpp | #include "stub.h"
int total = 0;
int inc(int x) {
switch (x) {
case 0: total += 1 + 0; return 1;
case 1: total += 1 + 1; return 2;
case 2: total += 1 + 2; return 3;
case 3: total += 1 + 3; return 4;
case 4: total += 1 + 4; return 5;
case 5: total += 1 + 5; return 6;
default: return x + 1... | TEST | 0.968207 | 3.557467 |
a3f9068e-a602-40a1-a204-6ff72b04c8c8 | LuBly/Daily_Coding | Study/day3.cpp | //[백준 c++] 10757 큰 수 A+B.
#include <iostream>
#include <string>
#include <vector>
#include <algorithm>
using namespace std;
int main() {
string inputA, inputB;
int tmp, cur=0;
vector<int> a;
vector<int> b;
vector<int> result;
int max_Size;
cin >> inputA >> inputB;
max_Size = inputA.size()>inputB.size() ? i... | ALGO | 0.999986 | 5.269024 |
d5187ccf-186f-4760-bb66-8c9fdb0de374 | Anuj3412/DS-Algo | Data Structure and Algorithms/01 Patterns/P1.cpp | #include<bits/stdc++.h>
using namespace std;
int main(){
int n;
cin>>n;
for(int i = 0; i<n; i++){
for(int j = 0 ; j<n ; j++){
cout<<"*";
}
cout<<endl;
}
return 0;
} | ALGO | 0.999714 | 3.117587 |
ce313dfc-3dac-425c-bb9e-7e40203e0a23 | nehcoah/algorithm-template | codeforces/1927(div3)/f.cpp | #include "bits/stdc++.h"
using namespace std;
using ll = long long;
struct UnionFind {
vector<int> parent, size;
int cnt;
UnionFind(int n) {
parent.resize(n);
size.resize(n, 1);
cnt = n;
iota(parent.begin(), parent.end(), 0);
}
int find(int x){
if (parent[... | ALGO | 0.999976 | 5.577594 |
e699202b-247f-4a83-a1f5-36ce271ec5b1 | ishandutta2007/codeforces | zeliboba/normal/1178/F2.cpp | #include <stdio.h>
#include <cstdlib>
#include <cassert>
#include <iostream>
#include <set>
#include <vector>
#include <cstring>
#include <string>
#include <algorithm>
#include <numeric>
#include <cmath>
#include <complex>
#include <map>
#include <unordered_map>
#include <queue>
#include <array>
#include <bitset>
#incl... | ALGO | 0.999989 | 4.065339 |
9f91421e-6d49-4a32-a9af-dd7062344295 | KrishnaSharma004/Codeforces_Problems_Solution | CP_Sheet(1100)Rated_Codes/APerfectlyBalancedString.cpp | //#include <bits/stdc++.h>
#include <iostream>
#include <vector>
#include <string>
#include <cmath>
#include <map>
#include <cstring>
#include <unordered_map>
#include <deque>
#include <numeric>
#include <algorithm>
#include <queue>
#include <set>
using namespace std;
#define ll long long
#define vint vector<int>
#def... | ALGO | 0.999933 | 4.550873 |
12261fc7-b5b6-441c-8c2f-24b14ebb4958 | BRITROC/britroc-1-sig-analysis | code/models_archival_relapse/tmb_RE/tmb_correlated_multinom_2_allFE_b.cpp | // https://figshare.com/articles/C_code_needed_for_running_R_code/4836503
// Simple multinomial fitting.
#include <TMB.hpp>
template<class Type>
Type objective_function<Type>::operator() ()
{
Type nll; // Define variable that holds the return value (neg. log. lik)
nll = Type(0.0); // Assign value 1.2... | ALGO | 0.999483 | 6.260537 |
8ea90fa9-d17f-4067-abc4-e109015af2b6 | AnantKumawat22/Problem_Solving | leetcode/Easy/83. Remove Duplicates from Sorted List.cpp | // Logic :-
// The logic is, prev will point the 1st node of the list and curr will point the 2nd node of list. We will move curr pointer and whenever we get the different value of prev and curr, we will link prev's node to curr's node else we will increase curr. And prev pointer stay there until we get different value... | ALGO | 0.999965 | 6.089191 |
db99eb56-ee46-4dd1-93d9-6b915f6269ea | michimani/atcoder | abc/001-100/079/cpp/c.cpp | #include <iostream>
#include <vector>
using namespace std;
using ui = unsigned int;
int main()
{
vector<int> n(4, 0);
for (auto &nn : n)
{
char c;
cin >> c;
nn = c - '0';
}
vector<int> op = {1, -1};
for (auto &op1 : op)
{
for (auto &op2 : op)
{
for (auto &op3 : op)
{
... | ALGO | 0.999682 | 3.568644 |
31225a74-9911-4c8a-a2d6-db0ffd805488 | MaximePremont/R-Type_Epitech | libs/boost/libs/describe/example/console.cpp | #if defined(_MSC_VER)
# pragma warning(disable: 4702) // unreachable code
#endif
#include <boost/describe.hpp>
#include <boost/mp11.hpp>
#include <boost/json.hpp>
#include <boost/utility/string_view.hpp>
#include <string>
#include <stdexcept>
#include <vector>
#include <map>
#include <iostream>
// get variable
templ... | TOOL | 0.907346 | 7.803553 |
d9158b58-524f-4e28-8e56-109f457e6fa7 | ttvonline2/01.Learning | 02.Pratices/A.cpp | #if 1
#define ON_DEBUG 0
#include<bits/stdc++.h>
using namespace std;
#if ON_DEBUG
//*** debug(x) ***//
#define debug(x) cout << "[" << #x << "]" << " : " << (x) << endl
#else
#define debug(x) //*** debug ***//
#endif
template <class Ch, class Tr, class Container>
basic_ostream <Ch, Tr> & operator << (basic_ostream <... | ALGO | 0.999877 | 4.211514 |
00106517-5890-4fc9-8051-afd282581456 | feelpp/feelpp | doc/manual/stokes/stokes_pressurelm.cpp | // -*- coding: utf-8; mode: c++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- vim:fenc=utf-8:ft=cpp:et:sw=4:ts=4:sts=4
#include <feel/feel.hpp>
#include <feel/feelalg/vectorblock.hpp>
#include <feel/feelvf/print.hpp>
#include <feel/feeldiscr/pch.hpp>
namespace Feel
{
template <uint16_type Dim,uint16_typ... | ALGO | 0.987477 | 4.409813 |
340d471a-991c-4d4e-ad74-b482ebaf566c | mvg01/ps | baekjoon cpp/16112(prefix_sum).cpp | #include <iostream>
#include <algorithm>
using namespace std;
#define ll long long
int n, k;
ll a[300001], res = 0;
ll sum[300001] = { 0 };
void input() {
cin >> n >> k;
}
void solve() {
for (int i = 0; i < n; i++)
cin >> a[i];
sort(a, a + n);
int cnt = 0;
sum[0] = a[0];
for (int i = 1; i < n; i++)
sum[... | ALGO | 0.999943 | 3.829787 |
fd880865-9774-45fe-91db-e39e442097da | mpue/Synthlab | JUCE/modules/juce_box2d/box2d/Dynamics/b2ContactManager.cpp | #include "b2ContactManager.h"
#include "b2Body.h"
#include "b2Fixture.h"
#include "b2WorldCallbacks.h"
#include "Contacts/b2Contact.h"
b2ContactFilter b2_defaultFilter;
b2ContactListener b2_defaultListener;
b2ContactManager::b2ContactManager()
{
m_contactList = NULL;
m_contactCount = 0;
m_contactFilter = &b2_defau... | ALGO | 0.956312 | 6.771621 |
27e62e6e-90d3-4362-a972-60fd85577fc2 | LeTeutz/Stanford | Algorithmics/Modular_Inverse.cpp | #include <bits/stdc++.h>
using namespace std;
ifstream f("inversmodular.in");
ofstream g("inversmodular.out");
long long n,m,mod;
bool isPrime(long long x)
{
for(int i=2;i*i<=x;++i)
if(x%i==0)
return 0;
return 1;
}
long long getPhi(long long x)
{
long long result=x;
for(long ... | ALGO | 0.99999 | 5.093921 |
9e11b955-a39b-4249-b76a-c74238d3eb70 | Md-Noman-Biswas/Codeforces_problems | C_Wet_Shark_and_Odd_and_Even.cpp | #include<bits/stdc++.h>
#define ll long long
using namespace std;
int main()
{
ll n;
cin >> n;
ll sum = 0;
vector<ll> arr(n);
for(ll i=0; i<n; i++){
cin >> arr[i];
sum += arr[i];
}
sort(arr.begin(), arr.end());
if(sum % 2 == 0)
... | ALGO | 0.999964 | 3.866681 |
b3670bfc-84d0-42e7-8943-e50a57c6032e | sourabhbarala/Info_security_practicals | 1_error_corr.cpp | #include<iostream>
#include<stdio.h>
using namespace std;
int main()
{
int data[10];
int dataatrec[10],c,c1,c2,c3,i;
cout<<"Enter 4 bits of data one by one\n";
cin>>data[0];
cin>>data[1];
cin>>data[2];
cin>>data[4];
//Calculation of even parity
data[6]=data[0]^data[2]^... | ALGO | 0.999951 | 4.234604 |
635c7d18-50ac-4048-84c7-5a2986796af8 | Shahbaz898414/Codeforces | Practice Question/800-2000/A/A. Avoid Trygub.cpp | #include <bits/stdc++.h>
using namespace std;
// #define int long long
#define intl long long int
#define mod 1000000007
#define Time cerr << "time taken : " << (float)clock() / CLOCKS_PER_SEC << " secs" << endl;
#define pb push_back
#define mp make_pair
#define line cout << endl;
#define ff first
#define ss second
#... | ALGO | 0.999772 | 4.621028 |
cf0843b2-cb33-45d2-aa81-03503f7974d6 | TranAnhQuoc23521313/UIT_HomeWork_Recursion | UIT_23521651_DeQui/Bai021/Bai021.cpp | #include <iostream>
#include <iomanip>
using namespace std;
float Tinh(float, int);
int main()
{
int n;
cout << "Nhap n: ";
cin >> n;
float x;
cout << "Nhap x: ";
cin >> x;
float kq = Tinh(x, n);
cout << "Ket qua: " << kq;
return 0;
}
float Tinh(float x, int n)
{
if (n == 0) return x; float s = Tinh(x, n -... | ALGO | 0.999705 | 3.719418 |
eb8d9d94-75fd-4965-8baf-a4cdeed8a1e8 | firiexp/contest_log | atcoder/AGC/023A.cpp | #include <iostream>
#include <algorithm>
#include <vector>
#include <iomanip>
#include <map>
#include <queue>
static const int INF = 1000000007;
using ll = long long;
using u32 = unsigned;
using namespace std;
int main() {
int n;
cin >> n;
map<ll, ll> v;
ll sum = 0;
for (int i = 0; i < n; ++i) {
... | ALGO | 0.999905 | 4.095473 |
6df40058-87da-4c12-b4bf-f3fc1376613c | Zethyst/Object-Oriented-Programming | friendly/eg1.cpp | #include <iostream>
using namespace std;
class abc
{
private:
int i,j;
public:
void get(){
cout<<"Enter the values of i & j: ";
cin>>i>>j;
}
void display()
{
cout<<"Value of i is "<<i<<" and j is "<<j<<endl;}
friend void compute(abc &a11){
a11.i=a11.i+5;
... | ALGO | 0.908673 | 3.75883 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.