uuid string | repo_name string | relative_path string | content string | category string | algo_rel_score float64 | quality_score float64 |
|---|---|---|---|---|---|---|
02f62383-10f8-4e8d-9fb0-bc8f21e08181 | jjh946/codetree-TILs | 250123/숫자 2개 출력/print-two-numbers.cpp | #include <iostream>
using namespace std;
int main() {
// Please write your code here.
cout << 3 << ' ' << 5;
return 0;
} | ALGO | 0.994726 | 3.701235 |
b8a6b052-a548-4a01-9107-0194daa575e5 | LineVall/linevall_packages_inputmethods_LatinIME | native/jni/src/suggest/core/dictionary/dictionary_utils.cpp | #include "suggest/core/dictionary/dictionary_utils.h"
#include "dictionary/interface/dictionary_structure_with_buffer_policy.h"
#include "dictionary/property/ngram_context.h"
#include "suggest/core/dicnode/dic_node.h"
#include "suggest/core/dicnode/dic_node_priority_queue.h"
#include "suggest/core/dicnode/dic_node_vec... | ALGO | 0.994189 | 7.557642 |
161a4500-cbbc-4e27-862b-f5531acce796 | Anemois/ZeroJudge | c464.cpp | #include <bits/stdc++.h>
#define Anemoi ios_base::sync_with_stdio(false);cin.tie(0);
#define int long long
using namespace std;
struct box{
int w, f;
};
signed main(){
Anemoi
int n;
cin >> n;
vector<box> v(n);
for(int i=0; i<n; i++)
cin >> v[i].w;
for(int i=0; i<n; i++)
ci... | ALGO | 0.999882 | 3.562717 |
a9ce28ec-7e05-4f39-a9b3-585a5da38ed3 | devangi2000/Data-Structures-Algorithms-Handbook | Trees/RangeSumOfBST938.cpp | // Given the root node of a binary search tree and two integers low and high, return the sum of values of all nodes with a value in the inclusive range [low, high].
// Example 1:
// Input: root = [10,5,15,3,7,null,18], low = 7, high = 15
// Output: 32
// Explanation: Nodes 7, 10, and 15 are in the range [7, 15]. 7 + ... | ALGO | 0.999984 | 7.110193 |
ea50aced-cfed-46c7-97a9-c1c329d76f36 | FarhanaIslamSaima/Leetcode_solution | array/easy/PartitionArrayInThreeParts.cpp | #include<iostream>
using namespace std;
int main(){
int a;
cin>>a;
int arr[a];
int sum=0;
for(int i=0;i<a;i++){
cin>>arr[i];
sum+=arr[i];
}
int divSum=sum/3;
int count=0;
int sum2=0;
for(int i=0;i<a;i++){
sum2+=arr[i];
if(sum2==divSum... | ALGO | 0.999816 | 3.493965 |
b5728f3d-9305-4835-aaca-c6dcdae2baed | uasys/openmp-split | llvm/lib/CodeGen/BranchRelaxation.cpp | #include "llvm/CodeGen/Passes.h"
#include "llvm/ADT/SmallVector.h"
#include "llvm/ADT/Statistic.h"
#include "llvm/CodeGen/LivePhysRegs.h"
#include "llvm/CodeGen/MachineFunctionPass.h"
#include "llvm/CodeGen/RegisterScavenging.h"
#include "llvm/Target/TargetInstrInfo.h"
#include "llvm/Target/TargetSubtargetInfo.h"
#incl... | ALGO | 0.954533 | 7.436332 |
3ddaead9-8764-40cd-8ddc-34050893b9aa | kaustubh0201/Data-Structures-and-Algorithms | Algorithms/CPP/Data_Structure/Binary_Tree/01LevelOrderTraversal.cpp | #include<iostream>
#include<queue>
using namespace std;
struct Node
{
int data;
Node* left;
Node* right;
Node(int data)
{
this->data = data;
left = NULL;
right = NULL;
}
};
// for printing the curent level
void currentLevel(Node* root, int level);
// height of the tree from that particular... | ALGO | 0.999939 | 4.79409 |
fa9d92d3-a936-4e34-b7b9-e01ba82d0ffa | keijak/comp-pub | atcoder/typical90/055/main3.cpp | #include <bits/stdc++.h>
#define REP_(i, a_, b_, a, b, ...) \
for (int i = (a), END_##i = (b); i < END_##i; ++i)
#define REP(i, ...) REP_(i, __VA_ARGS__, __VA_ARGS__, 0, __VA_ARGS__)
#define ALL(x) std::begin(x), std::end(x)
using i64 = long long;
using u64 = unsigned long long;
#include <atcoder/modint>
using Mint =... | ALGO | 0.999819 | 4.086792 |
95ac248d-2808-4e5a-8019-1e6b555a026d | KyleinLong/Calculator | lib/Node.cpp | #include "../include/node/Node.h"
#include <cmath>
#include <iostream>
using namespace std;
double NumberNode::Calc() const
{
return number_;
}
double AddNode::Calc() const
{
return left_->Calc() + right_->Calc();
}
double SubNode::Calc() const
{
return left_->Calc() - right_->Calc();
}
double MultipleN... | TOOL | 0.94171 | 3.361921 |
295cff69-961d-4dc4-932a-8b12f47156ff | ishandutta2007/codeforces | intothenight/normal/1119/C.cpp | #include <bits/stdc++.h>
using namespace std;
int main(){
cin.tie(0)->sync_with_stdio(0);
cin.exceptions(ios::badbit | ios::failbit);
int n, m;
cin >> n >> m;
vector<int> r(n), c(m);
for(auto rep = 0; rep < 2; ++ rep){
for(auto i = 0; i < n; ++ i){
for(auto j = 0; j < m; ++ j){
int x;
cin >> x;
... | ALGO | 0.999989 | 3.703022 |
fad1c25e-f4ee-4f30-8c96-8d7b004d98d8 | akgarhwal/Sports-Programming | SPOJ/AGGRCOW.cpp | /* akgarhwal */
#include<bits/stdc++.h>
using namespace std;
// typedef
typedef long long ll;
typedef vector<int> vi;
typedef vector<vi> vvi;
typedef pair<int,int> ii;
//define
#define sz(a) int((a).size())
#define pb push_back
#define all(c) (c).begin(),(c).end()
#define tr(c,i) for(typeof((c).begin() i = (c).begin();... | ALGO | 0.99999 | 3.538868 |
a1c8a87e-1192-4909-bad0-412eb20296cc | ShuhanXie/Exercise | C++/lesson/prob05/main.cpp | #include <iostream>
#include <iomanip>
#include "vector.h"
using namespace std;
int main() {
int a1[] = {0,1,2,3,4,5,6,7,8,9};
int s1=sizeof(a1)/sizeof(int);
vector v1(a1,s1);
cout<<setw(12)<<"v1:";
v1.dump();
vector v2(v1);
v2.set(13,88);
cout<<setw(12)<<"v2 set:";
v2.dump();
vector v3(v1);
v3.resize(... | TOOL | 0.898735 | 3.393461 |
8021df38-432f-4eed-b11f-9bff6f6da2e6 | sndp0816/amazon_clone | 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 |
7b94dca2-6a75-4e1e-a469-ea608feb3bd1 | Surajsuthar01/DSA | suraj93.cpp | #include<iostream>
#include"bits/stdc++.h"
using namespace std;
struct node {
int data;
struct node * left;
struct node * right;
node (int val){
data =val ;
left =NULL;
right =NULL;
}
};
int search ( int inorder [], int start , int end , int val){
for(int i=start;i<=end; ... | ALGO | 0.999997 | 5.468051 |
7ac3343a-69f8-4df7-b12f-ad53c6d28859 | otaviopereira10/http-corrigido | 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 |
569cf5d9-5f97-4e90-996c-73e03518fe2f | imyourm8/arena.io | server/box2c/Box2C/Box2D_v2.1.2/Box2D/Box2D/Dynamics/Joints/b2PulleyJoint.cpp | #include <Box2D/Dynamics/Joints/b2PulleyJoint.h>
#include <Box2D/Dynamics/b2Body.h>
#include <Box2D/Dynamics/b2TimeStep.h>
// Pulley:
// length1 = norm(p1 - s1)
// length2 = norm(p2 - s2)
// C0 = (length1 + ratio * length2)_initial
// C = C0 - (length1 + ratio * length2) >= 0
// u1 = (p1 - s1) / norm(p1 - s1)
// u2 = ... | ALGO | 0.973615 | 6.981268 |
564efc0b-ffc4-40be-b1fa-56a0066c34e7 | Ultichain/Ultichain | src/crypto/chacha20.cpp | // Based on the public domain implementation 'merged' by D. J. Bernstein
// See https://cr.yp.to/chacha.html.
#include <crypto/common.h>
#include <crypto/chacha20.h>
#include <string.h>
constexpr static inline uint32_t rotl32(uint32_t v, int c) { return (v << c) | (v >> (32 - c)); }
#define QUARTERROUND(a,b,c,d) \
... | ALGO | 0.999152 | 7.167084 |
b2b18508-9f2a-4f60-8f4d-719788fd5200 | hki2345/DirectX11_FrameWork | Core/KCollision.cpp | #include "KCollision.h"
#include "KMath.h"
bool(*KCollision::ColFunc[CT_MAX][CT_MAX])(const Figure_Col* _Left, const Figure_Col* _Right);
void KCollision::ColInit() {
for (size_t y = 0; y < CT_MAX; ++y)
{
for (size_t x = 0; x < CT_MAX; ++x)
{
ColFunc[y][x] = nullptr;
}
}
ColFunc[CT_RECT2D][CT_RECT2D] =... | TOOL | 0.988804 | 4.675459 |
9e13f9b5-1ba7-43e7-bd17-9479627d32ad | HuaiMengXing/The-test-code | c++和数据结构/c++/c++/水仙花数.cpp | #include"swap.h"
void shuixianhua()
{
int a,b,c,num=100;
do
{
a = num % 10;
b = num / 10 % 10;
c = num / 100;
if ((a*a*a+b*b*b+c*c*c)==num)
{
cout << num << endl;
}
num++;
} while (num<1000);
} | ALGO | 0.999766 | 3.068661 |
e604faab-3b73-4ac7-82aa-ce08ddda826d | YashMishra1408/SdeSheetChallenge | K-th largest Number BST.cpp | /************************************************************
Following is the Binary Search Tree node structure
template <typename T>
class TreeNode {
public :
T data;
TreeNode<T> *left;
TreeNode<T> *right;
TreeNode(T data) {
this -> data = data;
... | ALGO | 0.999986 | 4.998563 |
571ca627-bde2-4a89-8d7b-4683b5e778a1 | Tanzimbn/Competitive-programming | Three_Caballeros/source/Geometry/operation.cpp | //distance between two points
double dist(point a, point b) {
return hypot(a.x - b.x, a.y - b.y);
}
//rotate the point CCW
point rotate(point p, double theta) {
double rad = theta * PI / 180; //degree to rad
return point(p.x * cos(rad) - p.y * sin(rad),
p.x * sin(rad) + p.y * cos(rad));
}
point rotate(point p... | ALGO | 0.999751 | 4.02221 |
bd88719e-eaf1-42db-8173-ea7f9432ae49 | mushfiqbh/codeforces-solution | C_Infinity_Table.cpp | // Author: Mushfiq R.
#include <bits/stdc++.h>
#define endl "\n"
#define ll long long
#define ld long double
#define ull unsigned long long
#define vsort(v) sort(v.begin(), v.end())
#define rsort(v) sort(v.begin(), v.end(), greater<int>())
#define fastIO (ios_base::sync_with_stdio(false), cin.tie(NULL));
using namespac... | ALGO | 0.999936 | 4.017411 |
03f1349d-218c-40f2-9cb5-103d2daab985 | NervanaSystems/eigen | doc/examples/TutorialLinAlgExSolveColPivHouseholderQR.cpp | #include <iostream>
#include <Eigen/Dense>
using namespace std;
using namespace Eigen;
int main()
{
Matrix3f A;
Vector3f b;
A << 1,2,3, 4,5,6, 7,8,10;
b << 3, 3, 4;
cout << "Here is the matrix A:\n" << A << endl;
cout << "Here is the vector b:\n" << b << endl;
Vector3f x = A.colPivHouseholderQr... | ALGO | 0.999969 | 3.356631 |
c6fc03a1-12b9-4fbf-a215-245195b5b04d | pedrotorreao/DSA | Problems/Leetcode/findMiddleIndexInArray.cpp | /***
Problem: LC 1991. Find the Middle Index in Array
(https://leetcode.com/problems/132-pattern/description/)
--Problem statement:
Given a 0-indexed integer array 'nums', find the leftmost 'middleIndex' (i.e., the smallest amongst all the possible ones).
A 'middleIndex' is an index where:
nums[0] + nums[1] + ...... | ALGO | 0.999949 | 7.066813 |
2798448f-6839-457e-ad64-a862b132187d | luam0oliveira/competitive_programming | topicos-especiais/lista-04/D.cpp | #include <bits/stdc++.h>
using namespace std;
double get(double x, int p,int q,int r,int s,int t,int u)
{
return p*exp(-x) + q * sin(x) + r * cos(x) + s * tan(x) + t*x*x + u;
}
int main()
{
int p,q,r,s,t,u;
while (cin >> p)
{
cin >>q>>r>>s>>t>>u;
double left= 0,right=1;
... | ALGO | 0.999894 | 3.575093 |
298e3492-4dc4-4c1d-8146-18555c455f02 | llvm/clangir | llvm/utils/FileCheck/FileCheck.cpp | #include "llvm/FileCheck/FileCheck.h"
#include "llvm/Support/CommandLine.h"
#include "llvm/Support/InitLLVM.h"
#include "llvm/Support/MemoryBuffer.h"
#include "llvm/Support/Process.h"
#include "llvm/Support/SourceMgr.h"
#include "llvm/Support/WithColor.h"
#include "llvm/Support/raw_ostream.h"
#include <cmath>
#include ... | TOOL | 0.876127 | 7.11143 |
df3ac805-77f4-4836-b5aa-dee6f1eeab46 | monkey666-cr/cpp-study | src/advanced/7.func_stack.cpp | #include <iostream>
using namespace std;
void func_2(int &x, int y, int z)
{
x += y + z;
}
int func_1(int a, int b)
{
int result{};
result = a + b;
func_2(result, a, b);
return result;
}
int main(int argc, char const *argv[])
{
/* code */
int x{20};
int y{30};
int z{};
z = ... | TOOL | 0.943186 | 4.926392 |
c72ab360-71eb-4a6f-90c9-703aaccf0db9 | krotrn/CPP | Recursion/LeetCode/leet38.cpp | #include <bits/stdc++.h>
using namespace std;
string countAndSay(int n)
{
if (n == 1)
return "1";
string str = countAndSay(n - 1);
string s = "";
char ch = str[0];
int frq = 0;
for (int i = 0; i < str.length(); i++)
{
if (ch == str[i])
frq++;
else
... | ALGO | 0.999993 | 6.006333 |
2e1c92a8-2549-4e1e-923d-784eb161ae49 | mizutoki79/AOJ | ALDS_InttroductionToAlgorithmsAndDataStructures/ALDS1_4_C_Dictionary.cpp | #include <iostream>
#include <string>
#include <algorithm>
#include <set>
#define REP(i, n) for(i = 0; i < n; i++)
using namespace std;
int main()
{
set<string> D;
int n, i;
string str1, str2;
cin >> n;
REP(i, n)
{
cin >> str1 >> str2;
if(str1 == "insert") D.insert(str2);
... | ALGO | 0.999811 | 4.825254 |
0f8fafb4-4b61-4d54-90d3-6a7f0269ebd6 | namansancheti/code-collection | DS/LinkedList.cpp | #include<bits/stdc++.h>
using namespace std;
class Node
{
public:
int data;
Node *next;
Node(int data)
{
this->data = data;
this->next = NULL;
}
};
void printNode(Node *head)
{
while(head!=NULL)
{
cout<<head->data<<" ";
head = head->next;
}
}
void removeDups(Node *head)
{
Node *node = head;
... | ALGO | 0.999487 | 4.767456 |
ea57f063-273f-46f9-a120-afdab803a8b1 | ritishBhatoye/dsa | DAY 11/MoveZeroToAnEnd.cpp | #include<iostream>
using namespace std;
void user_input(vector<int> &arr,int size){
cout << "ENTER THE ELEMENTS IN AN ARRAY YOU WANT TO INSERT : " << endl;
int a;
for (int i = 0; i < size; i++)
{
cin >> a;
arr.push_back(a);
}
}
void print(vector<int> &arr, int size)
{
for (int i ... | ALGO | 0.999077 | 4.371218 |
a64ae65c-73d2-44e0-aeca-1f0b929ae1a5 | naoki-vn634/algorithm_study | nibunntansaku/hairetsu.cpp | #include <bits/stdc++.h>
using namespace std;
int binary_search(int key, vector<long long> &a)
{
int left = 0;
int right = a.size() - 1;
int mid = left + (right - left) / 2;
while (right >= left)
{
if (key == a[mid])
return mid;
else if (key > a[mid])
{
... | ALGO | 0.999961 | 5.285571 |
7e4a0a01-988f-404d-aacd-dbfc8895e3b8 | jieqiboh/questions | cses/Playlist/main.cpp | #include <iostream>
#include <vector>
#include <queue>
#include <stack>
#include <set>
#include <unordered_set>
#include <unordered_map>
#include <map>
#include <algorithm>
#include <cmath>
#include <string>
#include <sstream>
#include <bitset>
#include <utility>
#include <numeric>
#define ll long long
using namespace... | ALGO | 0.999958 | 4.275255 |
e7545d6d-e17e-4ffe-8959-df2dd804e906 | MzMahmud/problem-solving | Leetcode/0653 Two Sum IV - Input is a BST.cpp | /**
* Definition for a binary tree node.
* struct TreeNode {
* int val;
* TreeNode *left;
* TreeNode *right;
* TreeNode(int x) : val(x), left(NULL), right(NULL) {}
* };
*/
class Solution {
public:
bool findTarget(TreeNode* root, int k) {
vector<int> nums;
insert_elem(nums,roo... | ALGO | 0.999995 | 6.011522 |
0ac747d5-661a-4626-a481-d4c770eb3bbc | ishandutta2007/codeforces | kdh9949/normal/1081/E.cpp | #include <bits/stdc++.h>
using namespace std;
using ll = long long;
const int N = 100005, K = 4000005;
int n;
ll a[N], sq[K];
int main(){
for(int i = 1; i < K; i++) sq[i] = 1LL*i*i;
scanf("%d", &n);
for(int i = 2, j = 1, jj = 1; i <= n; i += 2){
scanf("%lld", a+i);
int k = jj;
fo... | ALGO | 0.99998 | 3.407456 |
f603db8a-d4a1-4869-95eb-589ec5bbb14f | ishandutta2007/codeforces | antontrygubo_o/normal/1673/D.cpp | #include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
#include <bits/stdc++.h>
#pragma GCC target ("avx2")
#pragma GCC optimization ("O3")
#pragma GCC optimization ("unroll-loops")
using namespace __gnu_pbds;
using namespace std;
using ll = long long;
using ld = long double;
typedef tree<
... | ALGO | 0.999821 | 4.119214 |
f0fcfbe3-a916-45f8-b3cf-83f048414927 | rohithmsr/lab-materials-btech | Data Structures/trie-1-leetcode.cpp | struct Node {
Node* links[26];
bool isWord = false;
bool containsKey(char ch){
return links[ch - 'a'] != NULL;
}
void put(char ch, Node* node){
links[ch - 'a'] = node;
}
Node* get(char ch){
return links[ch - 'a'];
}
void setEnd(bool val){
... | ALGO | 0.999752 | 6.022203 |
f405045c-144b-4b66-8761-d517c61fb396 | cheolwanpark/PS | boj/1017.cpp | #include <stdio.h>
#include <vector>
#include <algorithm>
using namespace std;
vector<bool> isPrime, visited;
vector<int> S, E, edges[50], inv;
bool dfs(int node) {
if(visited[node]) return false;
visited[node] = true;
for(auto next : edges[node]) {
if(inv[next] == -1 || dfs(inv[next])) {
... | ALGO | 0.999947 | 3.568252 |
3ed0d9ef-7f6b-4807-9fb7-4fba3d8a73b9 | tushar158gupta/100_DAYS_CODE | _100_DAYS_OF_CODE_CPP/Array's/Add Nwo Numbers Represented By Two Arrays.cpp |
//https://practice.geeksforgeeks.org/problems/add-two-numbers-represented-by-two-arrays2408/1
class Solution{
public:
string calc_Sum(int *nums1,int n,int *nums2,int m){
string ans="";
int carry=0,i=n-1,j=m-1;
while(i>=0 && j>=0){
int sum=nums1[i]+nums2[j]+carry;
... | ALGO | 0.999958 | 5.825649 |
872b2c55-8b10-4769-b4b1-83bb61de5046 | atul-5242/DSADailyPractice2 | Sorting/Sort-an-Array-with-two-types-of-elements.cpp | // Hoare partition
// In this Algo all the element greater than pivot is on the right side and smaller on the left side and the position of pivot is not defined as like Lomuto Partition.
#include<iostream>
using namespace std;
// ---------------------------------- For geting the even and odds at the same place in so... | ALGO | 0.999917 | 5.28403 |
e7ec1011-c9d4-4c23-a820-2677e2b97e3c | PedroVSD/Maratona | Maratona-online/I.cpp | #include <bits/stdc++.h>
using namespace std;
void solve() {
int n;
cin >> n;
if (n == 2 || n == 3) {
cout << "NO SOLUTION" << endl;
return;
}
// Imprime os pares do maior para o menor
for (int i = n; i >= 2; i -= 2)
cout << i << " ";
// Imprime os ímpares do meno... | ALGO | 0.999976 | 4.861412 |
89984aec-5ecd-4932-bd4d-4f83a41e88e8 | mihaimoga/XMLSitemap | boost/libs/numeric/ublas/doc/samples/matrix_binary.cpp | #include <boost/numeric/ublas/matrix.hpp>
#include <boost/numeric/ublas/io.hpp>
int main () {
using namespace boost::numeric::ublas;
matrix<double> m1 (3, 3), m2 (3, 3);
for (unsigned i = 0; i < (std::min) (m1.size1 (), m2.size1 ()); ++ i)
for (unsigned j = 0; j < (std::min) (m1.size2 (), m2.size2 ... | ALGO | 0.995508 | 4.054733 |
cd314d9c-ce8c-40ac-b56b-4a8e2509f571 | ngoquanghuy99/C-CPP-problems-and-solutions | hcn_hang_tang_dan.cpp | #include<iostream>
using namespace std;
int main(){
int a, b;
cin>>a>>b;
int x = 1;
for(int i=0; i<a; i++){
for(int j=0; j<b; j++){
cout<<x;
}
cout<<endl;
x++;
}
}
| ALGO | 0.999067 | 3.047923 |
2afe06d8-70e6-4a9d-93ad-e9a584288fa5 | mahdihasnat/Marshal-s-Code- | ICPC DHAKA REGIONAL 2017/A.cpp | #include<bits/stdc++.h>
using namespace std;
#define int long long
signed main() {
ios_base::sync_with_stdio(false);
cin.tie(NULL);
cout.tie(NULL);
int a, b, c, d;
while(1) {
cin >> a >> b >> c >> d;
if(a == 0 and b == 0 and c == 0 and d == 0) break;
int row_diff = abs(a - ... | ALGO | 0.999895 | 3.853358 |
7db96d8a-2968-4814-bf4d-f60f7a4bc695 | StepkaPopka12345/AIP-2-semestr | week5-6/zadanie2/main.cpp | #include <iostream>
#include <cmath>
/*y = (2+x)2 + 7, если x > -8
y = 5, если x = -8
y = |2 * x-1| - 1, если x < -8
*/
using namespace std;
int main()
{
float x,y;
cin>>x;
if (x>-8){
y=(2+x)*2+7;
}
if (x<-8){
y=fabs(2*x-1)-1;
}
if (x==-8) {
y=5;
}
cout << "y= "<< y << ... | ALGO | 0.999727 | 4.147245 |
3e138290-72a7-4687-ac1f-603ee7a8c9a8 | AndryDeveloper/mipt_edu | 2sem/cpp_labs/polska/main.cpp | #include <iostream>
#include <string>
#include <vector>
#include <map>
#include "structures.h"
using namespace std;
map<string, int> priority{
{"*", 3},
{"/", 3},
{"+", 2},
{"-", 2},
{"(", 1},
{")", 0}};
bool isnum(char symb)
{
return ((symb >= '0' && symb <= '9') || symb == '.');
}
bool is... | ALGO | 0.999664 | 4.474468 |
d6457fc9-1527-4316-a80b-03a3f960acde | J9214/Baekjoon | c++/구간_자르기.cpp | #include <bits/stdc++.h>
using namespace std;
#define FASTIO ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL);
typedef long long ll;
typedef pair<int, int> pi;
typedef pair<ll, ll> pl;
typedef vector<int> vi;
typedef vector<ll> vll;
typedef vector<vector<int>> vvi;
typedef vector<vector<ll>> vvll;
typede... | ALGO | 0.999995 | 4.065055 |
c5544ff3-28a3-46d1-acee-64a1ba3383d6 | p-w-rs/Intro-C-CPP-CS2040 | Code/chapter_9/listing_9_18.cpp | #include <cstdint>
#include <cstdio>
int main() {
char to_count{ 's' };
auto s_counter = [to_count](const char* str) {
size_t index{}, result{};
while(str[index]) {
if(str[index] == to_count)
result++;
index++;
}
return result;
};
auto sally = s_counter("Sally sells seashell... | ALGO | 0.924854 | 5.828194 |
32e5a6b7-273f-4280-911d-ad614adca87e | liuq901/code | SPOJ/sp_4197.cpp | #include <cstdio>
#include <cstdlib>
const int inf=1<<30;
struct tree
{
int l,r,x,y;
};
struct tree a[1000000];
int n,l[100001],r[100001],x[100001],h[100001];
int main()
{
void sort(int,int),build(),make(int,int,int),insert(int,int,int),work(int,int,int,int);
int min(int,int),find(int,int,int),count(int,int);
... | ALGO | 0.999867 | 3.425873 |
f7137eba-4174-4071-8d43-6233f31451ec | shuimuyangsha/CppAdvancedProgram | c21_code/01_StreamIterators/02_InputStreamIterators.cpp | #include <numeric>
#include <iostream>
#include <iterator>
using namespace std;
int main()
{
// Calculate the sum of integers read from the console until the end-of-stream is reached.
// Note:
// On Windows, the end-of-stream is reached when pressing Ctrl+Z followed by Enter.
// On Linux, the end-of-stream is rea... | ALGO | 0.944699 | 5.949847 |
34bfb43c-99b5-4064-84f1-622c01a79b83 | mstrippolidev/cpp-practice-exercise | Valerri/main2.cpp | #include <bits/stdc++.h>
using namespace std;
void valeriiArray();
int main()
{
freopen("input.txt", "r", stdin);
freopen("output.txt", "w", stdout);
int t;
cin >> t;
for (int i = 0; i < t; i++)
{
int n;
unordered_map <int, int> a;
bool ans = false;
cin >> n;
... | ALGO | 0.999918 | 4.157485 |
712ff978-048f-4925-bac7-d9fc3fdbba83 | s402xggy/C- | stl/5.cpp | #include <iostream>
#include <list>
using namespace std;
/*
list 构造函数
*/
void PrintList(const list<int> &lst) {
for (const auto &ls : lst)
cout << ls << " ";
cout << endl;
}
bool compare(int v1, int v2) {
return v1 > v2;
}
/*
自定义数据排序
按照年龄进行排序,如果年龄相同,则按升高降序排序
*/
class Person{
publi... | ALGO | 0.996793 | 4.432594 |
6d144759-e624-43de-9753-ee93c2ef3df1 | bishal63/C_plus_plus_programming | exercise_function_template.cpp | #include<iostream>
#include<conio.h>
using namespace std;
template<class bishal>
bishal mahabub(bishal a,bishal b)
{
return a+b;
}
int main()
{
cout<<mahabub(20,30)<<endl;
cout<<mahabub(20.50,20.50);
getch;
} | ALGO | 0.969729 | 3.862686 |
3ec9f091-6bfa-4011-92af-5635d7854f56 | GiorgioBrux/prog1 | esercizi_prog1/prove_itinere/25_09_2018/es1.cpp | #include <iostream>
using namespace std;
bool calcola(int*** A, int n, int m) {
for (int i = 0; i < n; i++) {
for (int j = 0; j < m; j++) {
for (int k = i; k < n; k++) {
for (int l = (k == i ? j + 1 : 0); l < m; l++) {
if (*A[i][j] == *A[k][l]) return true;
... | ALGO | 0.999 | 3.17363 |
9f263ef0-25a2-4869-bcdb-296781d90eba | themuuln/spoj7 | RGB7010.cpp | #include <iostream>
using namespace std;
int main() {
int a, b, c, d;
cin >> a;
b = a % 10; // 3
c = a / 10 % 10; // 2.3
d = a / 100; // 1.23
cout << b + c + d << endl;
}
| ALGO | 0.995838 | 3.53443 |
c8de2159-c6f7-43f8-97a1-a8a0d736f977 | luisarteagadev/Kattis-Solutions | different.cpp | #include <bits/stdc++.h>
using namespace std;
int main(){
long long int a,b,diff;
while(cin>>a>>b){
diff=a-b;
printf("%lld \n",abs(diff));
}
return 0;
}
| ALGO | 0.99992 | 3.624571 |
8f980014-f600-4c2a-b6fc-f020b176a38a | Hunterdii/Leetcode-POTD | December 2024 Leetcode Solution/December-09.cpp | class Solution {
public:
vector<bool> isArraySpecial(vector<int>& nums, vector<vector<int>>& queries) {
int n = nums.size();
vector<int> d(n);
iota(d.begin(), d.end(), 0);
for (int i = 1; i < n; ++i) {
if (nums[i] % 2 != nums[i - 1] % 2) {
d[i] = d[i - 1];... | ALGO | 0.999797 | 5.807034 |
8d70d10e-1647-4ed6-bad2-730f24d26718 | Guddu8677/allc-code | numsum.cpp | #include<iostream>
using namespace std;
int main(){
int n , i ;
int sum =0;
cout <<" Enter the n number ";
cin >> n;
for(int i=1; i<=n; i++){
sum = sum+i;
}
cout <<" sum of the total number is : "<< sum;
return 0;
} | ALGO | 0.991568 | 3.245982 |
0aaadda9-256c-4540-8785-819cf2e992f2 | NikitaUssyukin/PP1_2023_Fall | Lecture/G1/Week14/sstream.cpp | #include <iostream>
#include <string>
#include <sstream> // header for istringstream
#include <vector>
using namespace std;
int main() {
string s;
getline(cin, s, '-');
// http://ejudge.kz/reference/en/cpp/io/basic_istringstream.html
istringstream iss(s);
vector<int> v;
int x;
// "1 2 ... | TOOL | 0.997833 | 3.493481 |
25daab1e-437a-468c-b951-37bf14ff073f | SnehaKumari3/codeforces_practice_problems | B_Trouble_Sort.cpp | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef long double ld;
typedef double db;
typedef vector<int> vi;
typedef vector<vi> vvi;
typedef vector<ll> vl;
typedef vector<vl> vvl;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;
typedef vector<pii> vpii;
typedef vector<pll> vpll;
typedef... | ALGO | 0.999918 | 3.499095 |
87373c6d-b363-4f3f-82ad-802da3e714d0 | theoden42/code-store | cses/CSES Problem Set/Elevator_Rides.cpp |
/* @uthor: (g)theoden42 */
#include <bits/stdc++.h>
using namespace std;
#ifdef ON_PC
#include <debug.h>
#else
#define debug(x...)
#endif
#define ll long long
#define ld long double
#define int long long
#define all(a) (a).begin(), (a).end()
const int MAX_N = 1e6 + 5;
const ll MOD = 1e9 + 7;
const ll INF =... | ALGO | 0.999968 | 5.143506 |
d1f6f6c5-5f8f-46c4-a31b-4689c08915e7 | niksanElements/Homeworks | AdvanceProgramming/To10System/f78397_1a.cpp | #include <iostream>
#include <string>
#include <cmath>
using namespace std;
//F78397 Nikolay Nikolov 1a
int getValueFrom16Base(char c){
switch(c){
case '1':{
return 1;
break;
}
case '2':{
return 2;
break;
}
case '3':{
return 3;
break;
}
case '4':{
return 4;
break;
}
case '5'... | ALGO | 0.948103 | 3.671786 |
740f8d06-bb55-482e-93ce-7f5ba0bd37a7 | bdqnghi/bi-tbcnn | code/quicksort/cpp/2141.cpp | #include<iostream>
#include<cstdio>
#define N 10
#define swap(a,b) a^=b^=a^=b
using namespace std;
int partition(int a[],int p,int r)
{
int x = a[r],i = p,temp;
for(int j=p;j<r;j++)
{
if(a[j]<=x)
{
temp = a[i]; a[i] = a[j]; a[j] = temp;
i++;
... | ALGO | 0.999982 | 3.661682 |
bd14457e-4814-4981-a49c-85ea4793ade6 | Sakura-12/PyLammps | src/USER-SMD/compute_smd_internal_energy.cpp | #include <cstring>
#include "compute_smd_internal_energy.h"
#include "atom.h"
#include "update.h"
#include "modify.h"
#include "comm.h"
#include "memory.h"
#include "error.h"
using namespace LAMMPS_NS;
/* ---------------------------------------------------------------------- */
ComputeSMDInternalEnergy::ComputeSMDIn... | ALGO | 0.997377 | 5.259134 |
f94c7d1c-4fea-43d4-9863-ea00108bf4ed | Shuvo-mandol/My_acm_code_library | Sorting/QuickSort.cpp | #include<bits/stdc++.h>
using namespace std;
int PartitionIndex(long int ar[], int start, int end)
{
int pivot= ar[end];
int pindex= start;
for(int i=start; i<end; i++)
{
if(ar[i]<pivot)
{
swap(ar[i], ar[pindex]);
pindex++;
}
}
swap(ar[pindex], ar... | ALGO | 0.999975 | 4.304757 |
b5ad11bc-ce42-4fa9-8e73-376d27d48003 | LuvKobe/CPP-Programming | 01-C++-StudyCode/test_11_25/Test13.cpp | #define _CRT_SECURE_NO_WARNINGS 1
#include <iostream>
#include <assert.h>
using namespace std;
//class Date
//{
//public:
// //캯
// Date()
// {
//
// }
// //ʼ
// void Init(int year, int month, int day) {
// _year = year;
// _month = month;
// _day = day;
// }
// //ӡ
// void Print() {
// cout << _year << "-" << _m... | ALGO | 0.970715 | 4.470598 |
d11e6d08-2a25-4d39-b403-7efc077dd578 | Frozen1023/leetcode | 982.cpp | class Solution {
public:
int countTriplets(vector<int>& A) {
int res = 0;
int l = A.size();
vector<int> bitmap(65537,-1);
for(int i = 0;i < l;i ++)
for(int j = 0;j < l;j ++)
{
int x = A[i]&A[j];
if(bitmap[x] < 0)
... | ALGO | 0.999902 | 5.163149 |
1f3d88c9-fe07-4e78-9930-e384cbeb9df3 | ishandutta2007/codeforces | dottle/normal/1004/D.cpp | #include<bits/stdc++.h>
//#define int long long
const int N=1.1e6;
using namespace std;
int n,m,c[N],d[N],mx,x,y,t;
void chk(){
memset(d,0,sizeof(d));
for(int i=1;i<=n;i++)for(int j=1;j<=m;j++)d[abs(i-x)+abs(j-y)]++;
for(int i=1;i<=t;i++)if(c[i]!=d[i])return;
cout<<n<<' '<<m<<endl<<x<<' '<<y<<endl;
exit(0);
}
i... | ALGO | 0.999393 | 3.141417 |
2fa3a045-5b13-45e6-a889-ec7ee1dace78 | kksahay/cses | Sorting and Searching/coll_num1.cpp | #include<bits/stdc++.h>
using namespace std;
int main() {
ios_base::sync_with_stdio(false);
cin.tie(0);
int n;
cin >> n;
vector<int> a(n), o(n);
for(int i = 0; i < n; ++i) {
cin >> a[i];
}
iota(o.begin(), o.end(), 0);
sort(o.begin(), o.end(), [&](int x, int y) {
return a[x] < a[y];
});
int ans = 0;
fo... | ALGO | 0.999911 | 3.967086 |
613f20be-cf03-4c91-a79c-267f272cd9cb | prantiknoor/CP | contest-2122/a.cpp | #include <bits/stdc++.h>
using namespace std;
int main() {
int T;
cin >> T;
while(T--) {
int n, m;
cin >> n >> m;
if((n >= 2 && m > 2) || (n > 2 && m >= 2)) {
cout << "YES" << endl;
} else {
cout << "NO" << endl;
}
}
} | ALGO | 0.999677 | 4.72779 |
03a4e09e-b541-4715-b856-adfc939d7981 | sristis0202/-CrackYourPlacement | Day2/20. Valid Parentheses.cpp | class Solution {
public:
bool isValid(string s) {
stack<char> st;
for(int i=0; i<s.size();i++){
if(s[i]=='(' || s[i]=='{' ||s[i]=='[' ) st.push(s[i]);
else{
if(s[i]==')' && st.size()>0 && st.top()=='(' ){
st.pop();
}else if... | ALGO | 0.999472 | 6.353243 |
aa6d74be-c11f-4095-a077-0c4d5ce126df | kimdongjooon/KDT_SF2_CAMP | study_test_cpp/20230402_test.cpp | #include <iostream>
#include <vector>
#include <sstream>
using namespace std;
// 이름쌓기 프로그램.
class stackname{
public:
static int stack_num;
};
int stackname::stack_num=0;
int main(){
vector <string> stack_name;
while(1){
vector <string> stack_name_tmp;
int break_count=0... | ALGO | 0.990347 | 4.549197 |
f271b059-2cee-4680-8d83-4925ca4207d6 | boostorg/multiprecision | example/constexpr_float_arithmetic_examples.cpp | // Contains Quickbook snippets used by boost/libs/multiprecision/doc/multiprecision.qbk,
// section Literal Types and constexpr Support.
#include <iostream>
#include <boost/config.hpp>
#ifdef BOOST_HAS_FLOAT128
#include <boost/multiprecision/float128.hpp>
#endif
//[constexpr_circle
#include <boost/math/constants/con... | TOOL | 0.935017 | 7.631323 |
10c690dd-5959-41ff-b282-f36a8e697db2 | Ishita1604/DSA-Supreme | LeetCode/2487_RemoveNodesLinkedList.cpp | #include <bits/stdc++.h>
using namespace std;
// Time: O(N) as reversing the linked list and traversing it to remove nodes.
// Space: O(1)
// Definition for singly-linked list.
struct ListNode
{
int val;
ListNode *next;
ListNode() : val(0), next(nullptr) {}
ListNode(int x) : val(x), next(nullptr) {}
... | ALGO | 0.999996 | 6.533091 |
0c44444a-881c-4a5f-a283-82a51aec2fdd | zhengzhu14/Aceptaelreto | 777_Compensando_Excesos/main.cpp | #include <iostream>
#include <bits/stdc++.h>
using namespace std;
/* int gcd (int n1, int n2){
while(n1 != n2) {
if(n1 > n2)
n1 -= n2;
else
n2 -= n1;
}
return n1;
} */
void resolver(){
int a, b;
cin >> a >> b;
int mcd = __gcd(a, b);
a = a/mcd;
b = b/mc... | ALGO | 0.999886 | 5.271195 |
2633d1dc-b036-427f-bbc1-ffe2436ffab8 | Kuba-Wi/PAMSI | proj2/experiment.cpp | #include "experiment.hpp"
#include <chrono>
#include <fstream>
#include <random>
experiment::~experiment() {
delete graph_list_;
delete graph_matrix_;
}
void experiment::build_full_graph_file(const char* filename, size_t node_count) const {
std::ofstream strm{filename};
std::random_device rd;
std:... | TOOL | 0.89211 | 3.851383 |
4eb8cdc8-3d81-42bd-95bf-f1f023010ceb | Howllo/Well-Simulation | ProgramAssignment1/FOLLOWLINK_IFGREATER.cpp | /****************************************
*
* File: FOLLOWLINK_IFGREATER.cpp
* Author: Tony A. Hardiman Jr.
* Purpose: To do stuff.
* Assignment: Programming Assignment 2
* Declaration: This program is entirely my own work.
*
****************************************/
#include "FOLLOWLINK_IFGREATER.h"
#include "WellSen... | ALGO | 0.998343 | 4.480276 |
543921f6-75b2-43bf-96c8-9561bed0bbfc | Revaiowo/Algorithms | 9-queue.cpp | #include <iostream>
using namespace std;
const int size = 10;
class Queue{
private:
int rear, front;
int arr[size];
public:
Queue(){
rear = front = -1;
}
bool isEmpty(){
if (rear == - 1 && front == -1){
return true;
}
return false;
}
bool isFul... | ALGO | 0.995142 | 4.032867 |
6436e6ed-3db1-4733-bfdb-ae310a8b3241 | Kal103/coding | Vinova/b.cpp | #include<bits/stdc++.h>
using namespace std;
int maxSubarraySum(int arr[], int size)
{
// 5
// 1 2 -4 3 9
// 1<=0+1 =mx=mx+1=1
//2<=1=mx=2
//-4<=2-4=2-4=-2
//3<=-2+3=mx=3
//9<=3+9=12
int tmp= 0,ans= INT_MIN; //INT_MIN=-2147483648
for (int i = 0; i < size; i++) {
... | ALGO | 0.99999 | 4.109964 |
a7a8e842-dcc2-4265-9f74-fc0f8e504d0a | RoysamLab/Farsight-toolkit | Tracing/Preprocessing/CurveletFiltering/fdct_wrapping_cpp/src/ifdct_wrapping.cpp | #include "fdct_wrapping.hpp"
#include "fdct_wrapping_inline.hpp"
FDCT_WRAPPING_NS_BEGIN_NAMESPACE
int fdct_wrapping_invsepangle(double XL1, double XL2, int nbangle, vector<CpxNumMat>& csc, CpxOffMat& Xhgh);
int fdct_wrapping_invwavelet(vector<CpxNumMat>& csc, CpxOffMat& Xhgh);
//-------------------------------------... | ALGO | 0.999486 | 5.489051 |
da0d0523-885e-47c8-9012-101a9e8dd143 | sarvex/leetcode-solidity | solution/0400-0499/0496.Next Greater Element I/Solution.cpp | class Solution {
public:
vector<int> nextGreaterElement(vector<int>& nums1, vector<int>& nums2) {
stack<int> stk;
unordered_map<int, int> m;
for (int& v : nums2) {
while (!stk.empty() && stk.top() < v) {
m[stk.top()] = v;
stk.pop();
}
... | ALGO | 0.999986 | 6.0363 |
318c7bd9-1157-4c99-afba-f4a699a90237 | Kapoor-0905/TLE-HackSquad | c++/prefixSum.cpp | // Given an array arr[] of size n, its prefix sum array is another array prefixSum[] of the same size, such that the value of prefixSum[i] is arr[0] + arr[1] + arr[2] … arr[i].
#include <bits/stdc++.h>
using namespace std;
// Fills prefix sum array
void fillPrefixSum(int arr[], int n, int prefixSum[])
{
prefixSum... | ALGO | 0.999956 | 6.078163 |
151f2c1e-2863-4468-b3a3-c18d9f5174be | ishandutta2007/codeforces | enjapma/normal/1672/E.cpp | #include <bits/stdc++.h>
#include <sys/time.h>
using namespace std;
typedef string::const_iterator State;
class ParseError {};
// using mint = ll;
// using mint = atcoder::modint998244353;
// using mint = atcoder::modint1000000007;
typedef long long ll;
typedef long double ld;
typedef pair<ll, ll> P;
typedef pair<l... | ALGO | 0.999949 | 3.869379 |
2eb95760-770e-4a79-a0bf-1e62fa2fd32f | cloudcalvin/Algorithms-CPP | C++ program to implement Direct Access File using the hashing technique..cpp | /***********************************************************************
Program for implementing Direct Access File using the hashing technique.
Collision handling is performed using linear probing and
chaining without replacement.
[hash function=(record_id mod 10)]
************************************************... | ALGO | 0.999373 | 4.338512 |
ea3ce952-05c5-4975-a6c4-361fec74331b | alexandraback/datacollection | solutions_5756407898963968_0/C++/Vars/InputFileReader.cpp | #include "StdAfx.h"
#include "InputFileReader.h"
using namespace std;
InputFileReader::InputFileReader(string fileName)
: m_fileName(fileName)
, fileOut ("C:\\jam.out")
{
}
InputFileReader::~InputFileReader(void)
{
fileOut.close();
}
// memory opt
void InputFileReader::readFile()
{
ifstream file (m_fileName.c_s... | TOOL | 0.875879 | 4.043385 |
ef58e7f4-7398-4dad-933a-b23902a74cd7 | noochila/-DSA- | Difficulty: Medium/Container With Most Water/container-with-most-water.cpp | //{ Driver Code Starts
#include <bits/stdc++.h>
using namespace std;
// } Driver Code Ends
class Solution {
public:
int maxWater(vector<int> &arr) {
// code here
int n=arr.size();
int i=0;
int j=n-1;
int ans=0;
while(i<j)
{
ans=m... | ALGO | 0.99937 | 6.505103 |
2e742427-75a5-4c5e-b06d-fc53e5482c8a | ishandutta2007/codeforces | zdolny_kaczor/normal/1331/D.cpp | //Konrad Paluszek,University of Warsaw(former XIV LO Staszic)
#ifndef LOCAL
#pragma GCC optimize("O3")
#endif
#define TIME (chrono::steady_clock::now().time_since_epoch().count())
#include<bits/stdc++.h>
#include<ext/pb_ds/assoc_container.hpp>
#include<ext/pb_ds/tree_policy.hpp>
#define xfm(a,b)a##b
#define xwb(a,b)xfm... | ALGO | 0.998978 | 3.015305 |
163f0b1b-b30e-41f7-8769-a58edd919a20 | nicsinha/Trie-Series | BitXor.cpp | #include<bits/stdc++.h>
using namespace std;
struct Node {
Node* links[2];
bool containkey(int bit)
{
return links[bit]!=NULL;
}
Node* next(int bit)
{
return links[bit];
}
void put(int bit,Node* node)
{
links[bit] = node;
}
};
class Trie {
Node*... | ALGO | 0.999687 | 4.603369 |
8cbd6e39-2fa9-4c0d-b4b8-6d4e011cd5ed | Yashuppal-15/Leetcode | 83-remove-duplicates-from-sorted-list/remove-duplicates-from-sorted-list.cpp | /**
* Definition for singly-linked list.
* struct ListNode {
* int val;
* ListNode *next;
* ListNode() : val(0), next(nullptr) {}
* ListNode(int x) : val(x), next(nullptr) {}
* ListNode(int x, ListNode *next) : val(x), next(next) {}
* };
*/
class Solution {
public:
ListNode* deleteDupli... | ALGO | 0.999892 | 5.864326 |
56fe9a06-41b3-441d-b997-a18d32db3de2 | DrSwad/CP | Submissions/Codeforces/1859/1859F.cpp | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
const int P2 = 20;
const ll INF = 1e18;
void test_case() {
int n, T;
cin >> n >> T;
vector<vector<pair<int, int>>> adj(n);
for (int i = 0; i < n - 1; i++) {
int u, v, w;
cin >> u >> v >> w;
u--, v--;
adj[u].emplace_back(v, w)... | ALGO | 0.99985 | 4.810318 |
ca87e58e-949a-4074-a28e-d7613e86ff23 | fsy-juruo/noip-2021-js-answer | t2021/JS-0476/sequence/sequence.cpp | #include<bits/stdc++.h>
using namespace std;
inline int read()
{
int s=0;
char c=getchar();
while(c<'0'||c>'9')
{
c=getchar();
}
while(c>='0'&&c<='9')
{
s=(s<<3)+(s<<1)+(c^48);
c=getchar();
}
return s;
}
int n,m,k,S;
int ss=0;
int f[105];
int cnt[105];
long long cnt2[105];
long long cnt3[105];
long long ... | ALGO | 0.999976 | 3.848194 |
d84c0922-1aaf-4137-99ad-203ce13963db | AnmolSinghNegi/GOD_Level_CPP | Arrays/Questions/13.Number of Excellent Pairs.cpp | class Solution {
public:
long countExcellentPairs(vector<int>&nums,int k) {
long res =0;
unordered_set<int>set;
for(auto it:nums){
set.insert(it);
}
vector<int>v;
for(auto it:set){
v.push_back(__builtin_popcount(it));
}
sort(v.begin(),v.end());
int i=0,j=v.size... | ALGO | 0.999848 | 5.429931 |
6132df4f-606e-4461-8406-7aa1e0337824 | Ishtiaq-Hossen/University-Courses | CSC101 Some Prac/05 Practise Problem/07/main.cpp | #include <iostream>
using namespace std;
int main()
{
int origNum, num, rem, sum = 0;
cout << "Enter a positive integer: ";
cin >> origNum;
num = origNum;
while(num != 0)
{
rem = num % 10;
sum += rem * rem * rem;
num /= 10;
}
... | ALGO | 0.999694 | 4.471923 |
d36e61d5-0443-4858-a4f5-887b51a409c0 | nathankim0/algorithm-ps | BOJ/10828/10828.cpp14.cpp | #include <iostream>
#include <stack>
#include <string>
using namespace std;
stack<int> a;
string b;
int main() {
int N,num;
cin >> N;
while (N--) {
cin >> b;
if (b == "push") {
cin >> num;
a.push(num);
}
else if (b == "pop") {
if (a.empty() == true) {
cout << -1<<endl;
}
else {
cout... | ALGO | 0.999251 | 4.232161 |
31837bf6-2433-4938-a172-b81c11922555 | Angellopp/CodeForces-Problems | Virtual_Judge_Combinatorics_basic_counting/A.cpp | #include <bits/stdc++.h>
#define fastio ios_base::sync_with_stdio(false); cin.tie (NULL)
#define dbg(x) cerr << " [ " << #x << " = " << x << " ]\n"
#define endl "\n"
#define F first
#define S second
#define mk make_pair
#define rep(ini, n) for (int i = ini; i < n; i++)
#define ll long long
#define all(x) x.begin(), x.e... | ALGO | 0.999795 | 3.99859 |
b2bfba4e-8051-49b0-9ad2-ae97f896e342 | ishandutta2007/codeforces | hitman623/normal/659/B.cpp | #include <iostream>
#include<bits/stdc++.h>
using namespace std;
long n,m,a[10001][801]={0},ii,jj,d[100001]={0},f[100001]={0},i1=0,i2=0,q;
char s[100001][11];
void swa(long &a,long &b)
{
long temp=a;
a=b;
b=temp;
}
void sw(char a[],char b[])
{
char t[20];
strcpy(t,a);
strcpy(a,b);
strcpy(b,t... | ALGO | 0.999999 | 3.327454 |
8fc79f4f-b5be-45e8-9ec5-19b556bce1e1 | wsmoses/Tapir-MLIR | libcxx/test/std/utilities/function.objects/func.search/func.search.bm/pred.pass.cpp | // UNSUPPORTED: c++98, c++03, c++11, c++14
// XFAIL: c++17, c++2a
// <functional>
// boyer_moore searcher
// template<class RandomAccessIterator1,
// class Hash = hash<typename iterator_traits<RandomAccessIterator1>::value_type>,
// class BinaryPredicate = equal_to<>>
// class boyer_moore_searcher {... | TEST | 0.940674 | 6.89008 |
e01575db-1a0a-472d-a8bf-9ed791a9dbb0 | marcosscruz/cplusplus | Métodos de Ordenação/quicksort.cpp | // Algoritmo de ordneçao interna usa a memória principal durante a ordenação.
// Segue o paradigma da divisão e conquista.
// Comlpxidade: Melhor caso = Caso médio: O(n log n) Pior caso: O(n^2)
#include <iostream>
#include <stdio.h>
#include <stdlib.h>
#define TMN 10
using namespace std;
void quicksort(int vet[], ... | ALGO | 0.999949 | 5.39561 |
83811f10-c93e-4fa6-8d85-33110ca5eac1 | lumiZGorlic/leetcode | solutions/DominoAndTrominoTiling/solution.cpp | // https://leetcode.com/problems/domino-and-tromino-tiling/discuss/116581/Detail-and-explanation-of-O(n)-solution-why-dpn2*dn 1%2Bdpn-3
class Solution {
public:
int numTilings(int N) {
int md=1e9;
md+=7;
vector<long long> v(1001,0);
v[1]=1;
v[2]=2;
v[3]=5;
if... | ALGO | 0.999978 | 5.994756 |
ac5d9312-4b69-4d69-8ea3-4ee823891a8e | pamellaccar/gromacs_with_packmol | install/gromacs-2022.1/src/gromacs/gmxlib/conformation_utilities.cpp | /* This file is completely threadsafe - keep it that way! */
#include "gmxpre.h"
#include "conformation_utilities.h"
#include <cmath>
#include <algorithm>
#include "gromacs/math/functions.h"
#include "gromacs/math/vec.h"
#include "gromacs/pbcutil/pbc.h"
static void low_rotate_conf(int natom, rvec* x, real alfa, re... | ALGO | 0.998397 | 7.69348 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.