uuid string | repo_name string | relative_path string | content string | category string | algo_rel_score float64 | quality_score float64 |
|---|---|---|---|---|---|---|
069b5f32-72c4-4190-889e-55fce8b0f4ac | riscv-spectre-mitigations/llvm_retpoline | libcxx/test/libcxx/ranges/range.adaptors/range.copy.wrap/assign.copy.pass.cpp | // UNSUPPORTED: c++03, c++11, c++14, c++17
// UNSUPPORTED: libcpp-no-concepts
// UNSUPPORTED: libcpp-has-no-incomplete-ranges
// <copyable-box>& operator=(<copyable-box> const&)
// ADDITIONAL_COMPILE_FLAGS: -Wno-self-assign-overloaded
#include <ranges>
#include <cassert>
#include <type_traits>
#include <utility> //... | TEST | 0.902299 | 7.254267 |
cab9b6a4-6869-458c-9ae1-257a83497a87 | audreypa/Finance-lib | libs/eigen-3.4.0/doc/examples/Tutorial_ReductionsVisitorsBroadcasting_broadcast_simple_rowwise.cpp | #include <iostream>
#include <Eigen/Dense>
using namespace std;
int main()
{
Eigen::MatrixXf mat(2,4);
Eigen::VectorXf v(4);
mat << 1, 2, 6, 9,
3, 1, 7, 2;
v << 0,1,2,3;
//add v to each row of m
mat.rowwise() += v.transpose();
std::cout << "Broadcasting result: " << std::... | ALGO | 0.996508 | 4.26067 |
04403acd-366d-4b81-8934-ed4e0f92a6fe | WesleyCheng4996/LeetCode | 985-sum-of-even-numbers-after-queries/985-sum-of-even-numbers-after-queries.cpp | class Solution {
public:
vector<int> sumEvenAfterQueries(vector<int>& nums, vector<vector<int>>& queries) {
vector<int>ret;
int s = accumulate(nums.begin(), nums.end(), 0, [](int x, int y) {return ((y & 1) == 0? x + y: x);});
ret.reserve(queries.size());
for(vector<int> &vec: queries... | ALGO | 0.99997 | 6.264404 |
9a54effd-a840-4ee2-9fdc-6d2d50545db7 | FernandoGLima/Competitive-Programming | Setembro/Div4-971_Upsolving/D.cpp | #include <bits/stdc++.h>
using namespace std;
#define ll long long
#define vll vector<ll>
#define pb push_back
#define bc back
#define all(x) x.begin(),x.end()
#define NO {cout << "NO" << "\n";}
#define YES {cout << "YES" << "\n";}
int main(){
ios_base::sync_with_stdio(false);
cin.tie(NULL);
int t;
... | ALGO | 0.999008 | 3.900282 |
91101696-b74b-4b57-9060-48d99a7298ec | OriLiMu/leetCodeOri | cppVersion/141_LinkedListCycle.cpp | #include <algorithm>
#include <climits>
#include <cmath>
#include <cstddef>
#include <iostream>
#include <vector>
using namespace std;
struct ListNode {
int val;
ListNode *next;
ListNode(int x) : val(x), next(NULL) {}
};
class Solution {
public:
bool hasCycle(ListNode *head) {
ListNode *p1 = head;
Lis... | ALGO | 0.999573 | 4.355265 |
03bb4f8e-11a1-4ba5-bc4a-4a06fa380aba | teepunkt-esspunkt/finf28cpp | Tag9_A1/Tag9_A1/Tag9_A1.cpp | /*
* Tag9_A1.cpp
* Aufgabe 1
Erstellen Sie eine Funktion summe() mit vier Parametern, die die
Summe der Argumente berechnet und zurckgibt.
Parameter: Vier Variablen vom Typ int
Return-Wert: Die Summe vom Typ long int
Deklarieren Sie die beiden letzten Parameter der Funktion summe()
mit dem Default-Argument 0. Testen ... | TOOL | 0.866095 | 3.867766 |
6051ee4b-5231-4ba8-8baa-5222ce2eec3c | pm306/procon | ABC/172/E.cpp | #include <bits/stdc++.h>
using namespace std;
using ll = long long;
using pll = pair<long long, long long>;
constexpr char ln = '\n';
constexpr long long MOD = 1000000007;
//constexpr long long MOD = 998244353;
constexpr long long INF = 1000000000 + 100;
constexpr long long LINF = 1000000000000000000 + 100;
#define wh... | ALGO | 0.999998 | 5.353826 |
4a83f50d-80ea-473c-afea-f2bf5f76eb12 | Cpelaez5/Flutter-test-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.998733 | 6.76775 |
07d46862-75a0-4291-9a42-7b7fb542f897 | Swapnil67/dsa | Stack/02-medium/07-daily-temperatures.cpp | /*
* Leetcode - 739
* Daily Temperatures
* Given an array of integers temperatures represents the daily temperatures, return an array answer
* such that answer[i] is the number of days you have to wait after the ith day to get a warmer temperature.
* If there is no future day for which this is possible, keep ans... | ALGO | 0.999883 | 6.657845 |
c1222a01-e1ad-4dd0-8fc7-3b3af497db61 | raquibul-islam/Competitive_Programming | Codeforces/abcstring.cpp |
#include<bits/stdc++.h>
using namespace std;
void solve()
{
int n,i=0,j,c=0;
cin>>n;
j=n-1;
string s;
cin>>s;
while(i!=j and i<=j)
{
if((s[i]-48==0 and s[j]-48==1) or (s[i]-48==1 and s[j]-48==0))
{
c=c+2;
j--;i++;
}
else
break;
}
cout<<n-c<<endl;... | ALGO | 0.999718 | 3.647076 |
d079943d-f73c-4eed-bfd9-90ad67c0cc3d | anaswara1000/learning | C++/striver_patterns1.cpp | #include <iostream>
using namespace std
;
int main()
{
int i,j,n;
cin>>n;
for(i=0;i<n;i++){
for(j=0;j<n;j++){
cout<<"*";
}
cout<<endl;
}
return 0;
}
| ALGO | 0.999824 | 3.440037 |
f89d3a85-7597-419c-801f-1d5421da5221 | Mozwin/Vizsga | pinpong.cpp | #include <iostream>
#include <map>
#include <set>
#include <vector>
//ujtag
//megtortent egy meccs - utana nincs uj tag
//main csak teszt
//
using namespace std;
struct Bajnoksag
{
set<pair<string,string>> kikivelnem;
vector<string> nevek;
public:
void uj_versenyzo(string nev) //vectorba pakoljuk a nevet... | ALGO | 0.996663 | 3.966325 |
8449f0ab-615e-4498-b7eb-6fe4801523e0 | ZJCARTER/C-5th | ch10/ex10_25.cpp | //
// ex10_25.cpp
// Exercise 10.25
//
// Created by pezy on 12/11/14.
// Copyright (c) 2014 pezy. All rights reserved.
//
// @Brief In the exercises for 10.3.2 (p.392) you wrote a version of biggies
// that uses partition.
// Rewrite that function to use check_size and bind.
#include <iostream>
#inclu... | ALGO | 0.998208 | 6.774672 |
516d6359-ce81-42ea-9962-77f16f1dd6bd | alexff2b/CG-RD | tests/iaVectorTest/Test_iaVector_Double.cpp | #include <iostream>
#include <fstream>
#include <iomanip> // Для управления точностью вывода
#include <filesystem>
#include "../../iaMath/iaLinearAlgebra/iaVector/iaVector.hpp" // Подключаем iaVector
// Функция для вывода в консоль и в файл
void logResult(std::ofstream& out, const std::string& message) {
std::co... | TEST | 0.884683 | 6.797484 |
6215869f-b059-4b5a-a516-f934b2826f05 | razimantv/leetcode-solutions | Solutions/G/gray-code/Solution.cpp | // https://leetcode.com/problems/gray-code
class Solution {
public:
vector<int> grayCode(int n) {
int M = 1 << n;
vector<int> ret(M);
for (int i = 0; i < M; ++i) ret[i] = i ^ (i >> 1);
return ret;
}
};
| ALGO | 0.999954 | 6.639147 |
79883b05-d476-432c-9ae5-4ae0c0ffd4a5 | ferez96/Road2BlackRed | 2018/Codeforces/Codeforces Round 440/D.cpp | /*D.cpp
* Created on: Nov 12, 2017
* Author: thaiminh
*/
#include <bits/stdc++.h>
using namespace std;
const int maxn = 5e3 + 7;
int n;
int p0[maxn];
int b0[maxn];
int d[maxn][maxn];
int main() {
// ios_base::sync_with_stdio(false);
// cin.tie(NULL);
cin >> n;
for (int i = 0; i < n; i++) {
printf("? %d ... | ALGO | 0.999982 | 3.302903 |
76f1fb3e-973e-4b74-80c7-78d8bb0f8433 | InvalidNamee/OJ-AC-Repository-for-UPC | AC_code/跟随唐克练编程基础系列/3889_字符串/86_CI_【基础】字符串连接.cpp | #include <iostream>
using namespace std;
bool t[26];
int main() {
ios::sync_with_stdio(0);
cin.tie(0), cout.tie(0);
string s;
cin >> s;
for (int i = 0; i < s.length(); ++i) {
if (!(t[s[i] - 'a'])) t[s[i] - 'a'] = true, cout << s[i];
}
cin >> s;
for (int i = 0; i < s.length(); ... | ALGO | 0.999893 | 3.172098 |
e04b9946-17c7-4e26-a042-0d2a9336ef67 | Aas11223/Leet_Code | 144-binary-tree-preorder-traversal/binary-tree-preorder-traversal.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.999954 | 6.312078 |
ce638a0e-ce7e-45ca-8346-92cf0b3fd50a | meet-github-1/programming | diameterofbinarytree.cpp | #include <bits/stdc++.h>
using namespace std;
/* A binary tree node has data, pointer to left child
and a pointer to right child */
struct Node {
int data;
struct Node* left;
struct Node* right;
};
Node* newNode(int val) {
Node* temp = new Node;
temp->data = val;
temp->left = NULL;
temp-... | ALGO | 0.999381 | 6.921838 |
14883ef1-0c3f-413f-a626-b700cfdc34b1 | Garzzza7/zadania | CodeForces/TODO/Miscellaneous/Mortal_Kombat_Tower.cpp | #pragma GCC optimize("Ofast")
#include <algorithm>
#include <cstdint>
#include <iostream>
#include <map>
#include <queue>
#include <set>
#include <string>
#include <vector>
#define sz(vec) (static_cast<int>((vec).size()))
using ll = long long;
using u128 = __uint128_t;
int
main() {
std::ios_base::sync_with_stdio... | ALGO | 0.999876 | 4.847579 |
040b318e-46c3-47ea-93f4-3ef7e0adeb00 | scwang98/cuSEAL | SIGMA/src/modulus.cpp | #include "modulus.h"
#include "util/common.h"
#include "util/numth.h"
#include "util/uintarith.h"
#include "util/uintarithsmallmod.h"
#include <numeric>
#include <stdexcept>
#include <unordered_map>
using namespace std;
using namespace sigma::util;
namespace sigma
{
void Modulus::save_members(ostream &stream) con... | TOOL | 0.974688 | 7.278645 |
f6c9d26f-3495-4e17-b60a-1c56cc2a2f87 | movaid7/flutter_challenges | todo_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.998423 | 6.76775 |
725c2355-135c-43b9-8875-f6ebfdcad01d | subhm2004/Leetcode_Solutions | 2170-count-number-of-maximum-bitwise-or-subsets/count-number-of-maximum-bitwise-or-subsets.cpp | class Solution {
public:
int max_OR = 0, count = 0;
void solveRE(vector<int>& nums, int i, int curr_OR) {
if (i == nums.size()) {
if (curr_OR == max_OR)
count++; // agar current subset ka OR == max_OR hai to count badhao
return;
}
// INCLUDE curr... | ALGO | 0.999985 | 6.304422 |
eb752ae6-4fc3-4458-8f4c-ad77816602d3 | StanleyJo-37/competitive-programming-chatbots-comprasion | submissions/chatgpt/sub17.cpp | #include <iostream>
using namespace std;
int main() {
ios::sync_with_stdio(false);
cin.tie(nullptr);
int q;
cin >> q;
while (q--) {
long long n;
cin >> n;
// The smallest composite number is 4.
// If n < 4, it's impossible to split.
if (n < 4) {
... | ALGO | 0.999918 | 5.436392 |
640f6ad9-a0f0-4696-8913-fa70b7c94b86 | AnnisaHimatulChasanah/dasprocpp | tugas/tugas 7/contoh.cpp | //judul
//Membuat 5 bilangan dan mencari mana terbesar lalu urutkan
//annisa himatul chasanah
//03 sept 2022
#include <iostream>
using namespace std;
//kamus
int jmlh, sorting;
main()
{
cout << "Mencari Bilangan terbesar dan terkecil lalu diurutkan" << endl;
cout << "Masukkan Jumlah Angka : " ; cin >> jmlh;
... | ALGO | 0.999384 | 3.566915 |
8f487c40-a103-4cb5-8dc7-7c9d89339c84 | YashiBindal/100-C-C-programs | largest&smallest array.cpp | #include<bits/stdc++.h>
using namespace std;
int main()
{
int n;
cin>>n;
int arr[n];
for(int i=0;i<n;i++)
cin>>arr[i];
int large=arr[0],small=arr[0];
for(int j=0;j<n;j++)
{
if(large<arr[j])
{
large=arr[j];
}
if(small>arr[j])
small=arr[j];
}
cout<<"largest element is: "... | ALGO | 0.999881 | 3.061908 |
81ef532c-5cb8-4220-a3b0-6d664764be08 | nirdesh17/codechef | Non-Negative-Product.cpp | #include<bits/stdc++.h>
using namespace std;
#define ll long long int
int main()
{
ios_base::sync_with_stdio(false);
cin.tie(NULL);
ll t;
cin>>t;
while(t--)
{
ll n;
cin>>n;
ll a[n];
ll zero=0,minus=0;
for(ll i=0;i<n;i++)
{
cin>>a[i];... | ALGO | 0.999934 | 4.498482 |
ad07a973-da4f-4062-83c2-c02c449d2d14 | mimic-asy/LLVM_RISCV_ISA | llvm/lib/Support/SuffixTree.cpp | #include "llvm/Support/SuffixTree.h"
#include "llvm/Support/Allocator.h"
#include <vector>
using namespace llvm;
SuffixTree::SuffixTree(const std::vector<unsigned> &Str) : Str(Str) {
Root = insertInternalNode(nullptr, EmptyIdx, EmptyIdx, 0);
Active.Node = Root;
// Keep track of the number of suffixes we have t... | ALGO | 0.995234 | 7.178166 |
1d2e6319-0605-4607-a6ff-143ac7ffb0a7 | 20171193/Algorithm | CodingTestCPP/프로그래머스(L4)_지형 편집.cpp | #include<vector>
#include<algorithm>
using namespace std;
// ּ , ִ
typedef long long ll;
int high = -1, low = 1000'000'001;
// n ̷ źȭ
ll Flatten(int n, const vector<vector<int>>& land, int P, int Q)
{
ll ret = 0;
ll diff = 0;
for (const vector<int>& l : land)
{
for (int h : l)
{
... | ALGO | 0.999662 | 4.31828 |
ad2f2f46-2124-42cb-90e4-e60fe0efe0cd | thegamer1907/Code_Analysis | CodesNew/4726.cpp | #include<cstdio>
#include<cstring>
#include<vector>
#include<queue>
#include<set>
#include<map>
#include<cstdlib>
#include<iostream>
#include<algorithm>
#define fi first
#define se second
#define L(i,u) for (int i=head[u]; i!=0; i=nxt[i])
#define rep(i,a,b) for (register int i=a; i<=b; i++)
#define per(i,a... | ALGO | 0.999478 | 3.397894 |
48e22e6c-29c8-43c7-8e54-07407203e61c | binsearch/code | team/nwerc13/c.cpp | #include <vector>
#include <list>
#include <map>
#include <set>
#include <deque>
#include <stack>
#include <bitset>
#include <algorithm>
#include <functional>
#include <numeric>
#include <utility>
#include <sstream>
#include <iostream>
#include <iomanip>
#include <cstdio>
#include <cmath>
#include <cstdlib>
#include <c... | ALGO | 0.992644 | 3.797988 |
b87a1030-a79d-4932-add5-bf12c5f5acb7 | Nispeter/Competitive_programming_Udec | 2022-1/L2/p1_11402.cpp | // Jair Said Hernandez Reyes.
// Segment Tree + Lazy Propagation.
// In General we have f(x) = a where a is the answer for every sub segment on tree, in this case f(x) = st[x].
// We also need a G(x) = R where G is a function that takes any n E Nodes and indicates what to do next, in this particular case G = lazy.
// G... | ALGO | 0.999413 | 4.055309 |
a8599fab-d572-4a1a-b41d-5102b99f0c33 | Rajkumar992199/C-Plus-Plus | codeforces/800/1676A_Lucky.cpp | #include<bits/stdc++.h>
using namespace std;
int main() {
int t;
long long n;
cin >> t;
for(int i=0;i<t;i++){
int a=0,b=0;
cin >> n;
for(int j=0;j<3;j++){
a += n%10;
n = n/10;
}
for(int j=0;j<3;j++){
b += n%10;
n = ... | ALGO | 0.999579 | 4.280872 |
41406f55-3fb8-44e3-bcc4-4412562c7dca | Izackyy/LeetCode | Cpp/9-palindrome-number/palindrome-number.cpp | class Solution {
public:
bool isPalindrome(int x) {
if (x < 0)
return false;
long result = 0;
int original = x;
while (x != 0) {
int digit = x % 10;
result = result * 10 + digit;
x /= 10;
}
return (result == o... | ALGO | 0.999924 | 6.100186 |
7d8497bd-6b0f-4254-9cc3-12002951b904 | compilepeace/DS_AND_ALGORITHMS | DS_with_C++/fundamental_challenges/pythagoras_triplet.cpp | #include<iostream>
#include <cmath>
using namespace std;
/*
* Derived using the fact that with 2 numbers given say a & b.
* where (a > b), then
* (a^2 + b^2), 2ab, (a^2 - b^2)
* form a pythagorean tipplet.
*/
void printTriplets(long n)
{
long long h = 0, leg = 0;
if (n & 1){
leg = (( n*n - 1) / 2);
... | ALGO | 0.99993 | 4.03332 |
7f69a77c-62a4-4866-b480-272aba1d63f2 | gorodilina/cvrp | main.cpp | #include "head.h"
using namespace std;
int main()
{
int N, V, c;
cin >> N >> V >> c;
vector <item> points (N);
double mean=0;
//считываем данные
for (int i=0; i<N; i++)
{
cin >> points[i].weight >> points[i].x >> points[i].y;
points[i].value=points[i].weight;
points... | ALGO | 0.999776 | 3.993237 |
72c23dea-7d21-4077-b47c-2f4b9838d560 | AnirudhTiwari/Codes | codes/leetcode/compareVersionNumbers.cpp | #include<stdio.h>
#include<stdlib.h>
#include<string>
#include<iostream>
using namespace std;
int version_number(string version, int level){
int level_counter=0,i=0, answer;
string temp_1 = "";
while(level_counter!=level-1){
if(version[i]=='.')
level_counter+=1;
i+=1;
... | ALGO | 0.999169 | 3.167394 |
6e6c9bfa-2001-4252-802b-ecd28d6cd00c | dhruv-g04/All-My-Codes | CodeForces/C_Best_Binary_String.cpp | #include <bits/stdc++.h>
#include <climits> //INT_MAX and INT_MIN
#include <cmath> //
#include <map> //
#include <string>
#include <array>
#include <cstring>
#include <vector>
#include <set>
#include <tuple>
#include <cstdio>
#include <complex>
using namespace std;
#define int long long
#define pb push_back
#de... | ALGO | 0.999784 | 3.853245 |
03bf1be3-8a7f-4e20-ab25-6b30221027e9 | durjoybarua5327/Basic_Programming_Concept | Data Structures using structure/doubly_linkedlist.cpp | #include<bits/stdc++.h>
using namespace std;
struct node{
int data;
node* next;
node* prev;
};
node *root=NULL,*tail;
void append(int data){
if(root==NULL){
root = new node();
root->data= data;
root->next= NULL;
tail= root;
}
else{
node* newnode = new node... | ALGO | 0.998955 | 3.777914 |
5285bccf-9a77-4617-a1bc-c800c52c152f | sarat-ravi/old-intersect | intersect/util/opencv/modules/contrib/src/basicretinafilter.cpp | /*#******************************************************************************
** IMPORTANT: READ BEFORE DOWNLOADING, COPYING, INSTALLING OR USING.
**
** By downloading, copying, installing or using the software you agree to this license.
** If you do not agree to this license, do not download, install,
** copy or ... | TOOL | 0.947262 | 3.944515 |
d1da74b2-51ec-46bb-91e5-29ceea712c6e | zql296560587/LeetCode | Linked_List_Random_Node_382.cpp | //******************LeetCode**************************************/
//*********382. Linked List Random Node***************************/
//Given a singly linked list, return a random node's value from
//the linked list. Each node must have the same probability of
//being chosen.
//
// Follow up:
//What if the linked li... | ALGO | 0.998307 | 3.931943 |
81ecb6c0-a4c4-488d-85da-564491ca7b57 | kalloldaskushol/Kallol-Algorithm | Class/6_Fractional_Knapsac.cpp | // ⭐⭐⭐⭐⭐ LAB FINAL
// https://ideone.com/X2Qhgv
#include <bits/stdc++.h>
using namespace std;
struct knap { // to make a custom structure, So that we can store the product by weight with the fixed object
int object; // obj number
double p_by_w; // product by weight -> double cz it can be a decimal number.
}... | ALGO | 0.99999 | 4.304479 |
49096fdf-46f3-4386-be03-b77a8b99da9c | ZelenkoPavel/Lesson43 | Project01/test05.cpp | //#include <iostream>
//
//using namespace std;
//
//void swap(int* a, int* b) {
// int t = *a;
// *a = *b;
// *b = t;
//}
//
//int main() {
//
// int x = 24;
// int y = 34;
//
//
// cout << "Before x = " << x << " y = " << y << endl;
//
// swap(&x, &y);
//
// cout << "After x = " << x << " y = " << y << endl;
//
// re... | ALGO | 0.99758 | 4.228865 |
d59bd66b-f5ff-48fb-8075-56a50fdae980 | goel-aadhaar/Competitive-Coding | Grouping.cpp | #include<bits/stdc++.h>
using namespace std;
#define int int64_t
void solve(){
int n , m , k;
cin >> n >> m >> k;
vector<int> v(n);
for(int i = 0 ; i < n; i++) cin >> v[i];
sort(v.begin() , v.end());
int cnt = 1;
int i = 0 , j = 1;
while(i < n && j < n){
if(j - i < k && v[j] - v[... | ALGO | 0.999992 | 3.977571 |
b75c700c-0559-478c-bf3a-0d22f7620bbe | yuvrajkumar12/DSA_JOURNY | 02Linkedlist/02_Circular linked list/Add_at_beginning.cpp | #include<iostream>
using namespace std;
struct Node{
int data;
Node* next;
Node(int x)
{
data=x;
next=NULL;
}
};
//print circular linked list
void printlistf(Node *head)
{
cout<<"Print original linked list"<<endl;
Node *temp=head;
while(temp!=NULL && temp->next!=head)
{
... | ALGO | 0.999936 | 4.384689 |
b4619a44-cdda-4d7a-b465-bf4d70002d35 | Reload8686/rebit | env/lib/node-18.4.0/deps/icu-small/source/common/filteredbrk.cpp | #include "unicode/utypes.h"
#if !UCONFIG_NO_BREAK_ITERATION && !UCONFIG_NO_FILTERED_BREAK_ITERATION
#include "cmemory.h"
#include "unicode/filteredbrk.h"
#include "unicode/ucharstriebuilder.h"
#include "unicode/ures.h"
#include "uresimp.h" // ures_getByKeyWithFallback
#include "ubrkimpl.h" // U_ICUDATA_BRKITR
#inclu... | TOOL | 0.950049 | 5.698259 |
10381f70-9847-4882-8d43-13da336c8d93 | dhirajms/frameworks_av | media/libstagefright/codecs/amrnb/enc/src/q_gain_c.cpp | /*
------------------------------------------------------------------------------
Pathname: ./audio/gsm-amr/c/src/q_gain_c.c
Functions: q_gain_code
Date: 02/05/2002
------------------------------------------------------------------------------
REVISION HISTORY
Description: Updated template used to PV codin... | ALGO | 0.999575 | 5.243058 |
906674d9-a4ed-4f3f-b82c-8de25bcd2da7 | Jyoti-bujethiya/practice-dsa | Ishaan Loves Chocolates - GFG/ishaan-loves-chocolates.cpp | // { Driver Code Starts
#include<bits/stdc++.h>
using namespace std;
int chocolates(int arr[], int n);
int main()
{
int t;cin>> t;
while(t--)
{
int n;
cin >> n;
int arr[n];
for(int i=0;i<n;i++)
cin>>arr[i];
cout << chocolates(arr, n);
... | ALGO | 0.999713 | 6.053136 |
e8652c96-2bf5-4698-9a18-f9bb63ec9681 | ptay12/NMLT | UIT_23521408/BAI105/BAI105.cpp | #include <iostream>
#include <cmath>
using namespace std;
float Tong();
int main()
{
cout << "Tong la: " << Tong();
return 0;
}
float Tong()
{
float S = 0;
int m = 0;
float e = 1;
int i = 1;
while (e > pow(10, -6))
{
m = m + i;
e = (float)1 / m;
S = S + e;
i = i + 1;
}
return S;
} | ALGO | 0.998955 | 3.656803 |
fa9c5e81-d4bc-449a-81a9-747bba7d06d4 | 113bommy/deepmind_codecontests_refine | cpp_gold_filter_file/cpp_train_7960_16.cpp | #include <bits/stdc++.h>
using namespace std;
long long fact(int a) {
if ((a == 0) || (a == 1))
return (1);
else
return (a * fact(a - 1));
}
int main() {
vector<int> t;
vector<int> t1;
long long int k = 0, a, j, i, n;
cin >> n;
cin >> a;
t.resize(n);
for (i = 0; i < n; i++) {
t[i] = a % 10... | ALGO | 0.999943 | 4.345834 |
f239a810-4f92-401b-b287-718e2fa60316 | gotogoal/usage_example_cpp | usage_access_ifstream.cpp | #include <unistd.h>
#include <iostream>
#include <string.h>
#include <fstream>
#include <boost/algorithm/string/trim.hpp>
#include <boost/algorithm/string.hpp>
#include<unordered_map>
using namespace std;
int main(void)
{
unordered_map<string, string> params;
string strConfPath = "config.ini";
//或者:access(strConfP... | TOOL | 0.862262 | 3.464131 |
0ab94f0f-ed8f-4043-9062-cfec8481d12d | greenshilling/greenshilling | src/addrman.cpp | #include "addrman.h"
using namespace std;
int CAddrInfo::GetTriedBucket(const std::vector<unsigned char> &nKey) const
{
CDataStream ss1(SER_GETHASH, 0);
std::vector<unsigned char> vchKey = GetKey();
ss1 << nKey << vchKey;
uint64 hash1 = Hash(ss1.begin(), ss1.end()).Get64();
CDataStream ss2(SER_GE... | ALGO | 0.959023 | 6.044544 |
5949a6ac-18ec-401b-8da5-12255cf6028a | hwankim123/BaekJoon_Algorithm_Codes | Index Tree/10868 - 최솟값.cpp | #include<iostream>
using namespace std;
#define MAXN 17
#define MAXM 100000
#define INF 9876543210
int N, M, B;
long long adj[1 << (MAXN + 1)];
int cal(int lo, int hi){
lo = lo + B - 1;
hi = hi + B - 1;
long long minNum = INF;
while(lo <= hi){
if(lo % 2 == 1){
minNum = (minNum < a... | ALGO | 0.999947 | 4.251759 |
037f648d-7166-4305-a803-eeb852de72f5 | tbhova/Interview-Practice | Cpp/leetcode_problems.cpp | #include "leetcode_problems.h"
std::vector<int> twoSum(std::vector<int>& nums, int target) {
for (int i = 0; i < nums.size(); ++i) {
for (int j = i + 1; j < nums.size(); ++j) {
if (nums[i] + nums[j] == target) {
return std::vector<int>{i, j};
}
}
}
return std::vector<int>();
}
bool I... | TEST | 0.949055 | 5.292826 |
e72b6f4d-6a38-4c0a-a0f4-e91f75f57153 | ishandutta2007/codeforces | majk/normal/1146/F.cpp | #include <bits/stdc++.h>
#define int long long
#define f first
#define s second
using namespace std;
template<typename T> using vc = vector<T>;
using pii=pair<int, int>;
vc <vc <int > > adi;
vc <int> vis;
int mod=998244353;
int plu(int a, int b){
return (a+b)%mod;
}
int mal(int a, int b){
return (a*b)%mod;
... | ALGO | 0.999889 | 4.18082 |
0a493131-72d4-49cd-b45f-8f80ed7afc55 | Ph0en1xGSeek/ACM | POJ & HDU/二分匹配_过山车.cpp | #include <iostream>
#include <stdio.h>
#include <string.h>
using namespace std;
int arr[505][505];
int used[505], linker[505];
int m, n;
int ans;
bool match(int i)
{
for(int j = 1; j <= n; j++)
{
if(arr[i][j] == 1 && !used[j])
{
used[j] = 1;
if(linker[j] == -1 || match... | ALGO | 0.999745 | 3.828506 |
d101e17f-66ac-4804-8578-7af6293e5ef2 | ck2w/baruch-mfe-lab | quant-lib/reusable/time_dependent_parameters.cpp | #include <time_dependent_parameters.h>
#include <romberg_integrator.h>
Time_dependent_parameters::Time_dependent_parameters( double (*func)(double) )
: d_func(func)
{}
Parameters* Time_dependent_parameters::clone() const
{
return new Time_dependent_parameters(*t... | ALGO | 0.989287 | 6.090479 |
f3fb5742-93e0-4175-b76c-041a8e0f96e2 | Hafiz-Sakib/InterviewPrep | Solutions/DeepCopyLL.cpp | #include<bits/stdc++.h>
using namespace std;
class Node{
public:
int data;
Node* next;
Node* random;
Node(int data) : data(data), next(NULL), random(NULL) {}
};
Node* clone(Node* head){
if(head == NULL) return NULL;
Node* travellingPtr = head;
// Insert clone node of n-th node betw... | ALGO | 0.999164 | 3.893131 |
34a19722-cc60-4270-b457-dd3a8899de35 | tixidi/ros_stent_graft | iiwa_vs_core/src/iiwaControl/iiwa/Eigen-3.3.3/doc/examples/class_CwiseBinaryOp.cpp | #include <Eigen/Core>
#include <iostream>
using namespace Eigen;
using namespace std;
// define a custom template binary functor
template<typename Scalar> struct MakeComplexOp {
EIGEN_EMPTY_STRUCT_CTOR(MakeComplexOp)
typedef complex<Scalar> result_type;
complex<Scalar> operator()(const Scalar& a, const Scalar& b... | ALGO | 0.971072 | 6.700232 |
0ce9c0b8-7c4c-4271-8567-a756ae9937aa | AlexSpinu/P.D.A | EvenOddSort/EvenOddSort/Main.cpp | #include<stdio.h>
#include<time.h>
#include<stdlib.h>
#include<conio.h>
#include<cuda.h>
#include <device_launch_parameters.h>
#include <cuda_runtime_api.h>
__global__ void even(int *darr, int n) {
int k = threadIdx.x;
int t;
k = k * 2;
if (k <= n - 2) {
if (darr[k] > darr[k + 1]) {
t = darr[k];
darr[k] = ... | ALGO | 0.999914 | 4.559075 |
824bbada-a8a4-4772-bcce-b71528d5a860 | ishandutta2007/codeforces | he_ren/normal/1511/B.cpp | #include<bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<int,int> pii;
inline int get_l(ll x)
{
int res = 0;
while(x) ++res, x/=10;
return res;
}
int pw2[15], pw3[15], pw10[15];
void solve(void)
{
int a,b,c;
scanf("%d%d%d",&a,&b,&c);
printf("%d %d\n",pw2[a-c+1] * pw10[c], pw3[b-c+1] * pw... | ALGO | 0.999546 | 3.84628 |
b67729a2-dd3b-4210-bf55-051a5500ab8e | Vijay-CPP/Pattern-Printing-in-CPP | pattern_14.cpp | //#include <bits/stdc++.h>
#include <iostream>
#include <stdio.h>
using namespace std;
void printPattern(int n);
int main()
{
int n;
cout << "\nEnter the number of rows : ";
cin >> n;
printPattern(n);
return 0;
}
void printPattern(int n)
{
int nst = 1; // nst - no. of stars
int nsp = ... | ALGO | 0.997728 | 3.899648 |
0e7ad9b6-dd41-4ef6-98d6-3e0e5fc3e72c | Aman-Bhadani/Striver-SDE-SHEET-Challenge | Day-4/Two Sum.cpp | class Solution {
public:
vector<int> twoSum(vector<int>& nums, int target)
{
unordered_map<int,int>mp;
vector<int>ans;
int n=nums.size();
for(int i=0;i<n;i++)
{
if(mp.find(target-nums[i])!=mp.end()){
ans.push_back(mp[target-nums[i]]);
... | ALGO | 0.999932 | 6.248443 |
dc3c3b8d-002e-4d62-92f2-5cc8b77ce442 | Nirob-Barman/Problem-Solving-In-Programming | beecrowd/1007.cpp | #include<iostream>
using namespace std;
int main()
{
int a,b,c,d;
cin>>a>>b>>c>>d;
cout<<"DIFERENCA = "<<(a*b)-(c*d)<<endl;
}
| ALGO | 0.999888 | 4.0156 |
85f652dc-7be0-4223-9dfb-e8cfe9fff269 | watashi/AlgoSolution | leetcode/weekly-425/3365.cpp | class Solution {
public:
vector<string> split(const string& s, int k) {
const int n = s.size();
const int m = n / k;
vector<string> ret;
for (int i = 0; i < n; i += m) {
ret.push_back(s.substr(i, m));
}
return ret;
}
bool isPossibleToRearrange(string s, string t, int k) {
auto a... | ALGO | 0.9999 | 6.156303 |
5548fb59-8b1a-4f93-9586-f765e778afd5 | guanzhongliu/C-Programming_Homework | homework/Part1/practice_2.cpp | /**
* 2、输入长度为 n 的整形数组,分别使用选择和冒泡排序进行排序。
**/
#include <bits/stdc++.h>
using namespace std;
// 选择排序
void selection_sort(int *arr, int n) {
for (int i = 0; i < n - 1; i++) {
int min = i;
for (int j = i + 1; j < n; j++)
if (arr[j] < arr[min])
min = j;
swap(arr[i], ... | ALGO | 0.999543 | 4.033854 |
e360ba4c-77db-467e-a091-19062190ff9a | qpwoeirut/competitive-programming | Codeforces/Contest/Educational/1511/1511b.cpp | //1511b.cpp created at 04/12/21 07:38:24
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
#include <bits/stdc++.h>
using namespace __gnu_pbds;
using namespace std;
#ifdef LOCAL
#include "qpwoeirut/debug.h"
#else
#define debug
#define debug1
#define debug2
#define debug3
#endif
#define p... | ALGO | 0.999741 | 4.391296 |
03f39719-d6fc-4dbd-97ee-5467a18fb242 | Kim-jeongmin/algorithm_problem_solved | 구현/10797.cpp | #include <iostream>
using namespace std;
int main() {
int a; cin >> a;
int cnt = 0;
for (int i = 0; i < 5; i++) {
int k; cin >> k;
if (k == a) cnt++;
}
cout << cnt;
} | ALGO | 0.999232 | 3.654207 |
c6b0ca6f-c3cd-4902-a28d-2491a46eb79e | sarvex/leetcode-bhai | solution/0300-0399/0380.Insert Delete GetRandom O(1)/Solution.cpp | class RandomizedSet {
public:
RandomizedSet() {
}
bool insert(int val) {
if (d.count(val)) {
return false;
}
d[val] = q.size();
q.push_back(val);
return true;
}
bool remove(int val) {
if (!d.count(val)) {
return false... | ALGO | 0.997809 | 6.110086 |
609a29ee-2a45-447e-9ffd-f340d9c69d60 | c3eru/android_device_xiaomi_chime | hals/display/sdm/libs/utils/rect.cpp | #include <math.h>
#include <utils/rect.h>
#include <utils/constants.h>
#include <algorithm>
#define __CLASS__ "RectUtils"
namespace sdm {
bool IsValid(const LayerRect &rect) {
return ((rect.bottom > rect.top) && (rect.right > rect.left));
}
bool IsCongruent(const LayerRect &rect1, const LayerRect &rect2) {
retu... | TOOL | 0.963997 | 6.410635 |
05e3e2b6-9ae1-4ae6-91d6-bf2ea281e877 | heet2306/SE | C Assignment/module 3/Basic Logic Program/module-3 Q.10.cpp | //find the area of a rectangular prism formula : A=2(wl+hl+hw)
#include<stdio.h>
float area,width,lenght,height;
int main()
{
//Input: lenght of a rectangular prism
printf("Enter the lenght of a rectangular prism: ");
// Read the input from the user
scanf("%f",&lenght);
//Input: height of a rectangular prism
... | ALGO | 0.984209 | 3.712135 |
687ea5c3-76b0-4826-85c8-f99d8b676819 | LYoGA/LeetCode | liyuanjie/200.cpp | class Solution {
public:
void dfs(int x, int y, vector<vector<char> > &grid, vector<vector<int> > &vis) {
if (x < 0 || x >= grid.size() || y < 0 || y >= gird[0].size() || vis[x][y] || grid[x][y] == '0') return;
vis[x][y] = 1;
dfs(x-1, y, grid, vis);
dfs(x+1, ... | ALGO | 0.999924 | 6.611032 |
450a9b52-11f4-4034-aed6-f1e9db4faf27 | Spiraline/Autoware-LKAS | autoware.ai/src/autoware/utilities/map_tools/nodes/pcd_grid_divider/pcd_grid_divider.cpp | #include <iostream>
#include <pcl/io/pcd_io.h>
#include <pcl/point_types.h>
#include <sstream>
#include <string>
#include <vector>
struct pcd_xyz_grid {
std::string filename;
int grid_id;
int grid_id_x;
int grid_id_y;
int lower_bound_x;
int lower_bound_y;
int upper_bound_x;
int upper_bound_y;
pcl::Po... | DATA | 0.89419 | 5.881911 |
c37e37dd-4578-49b5-9bf3-e1c2b118776f | ZhanserikKalmukhambet/ALGORITHM_DATA_STRUCTURES | Week_9/rabin_karp_2.cpp | #include <iostream>
#include <vector>
using namespace std;
const int p = 31;
using ll = long long;
ll MOD = 1e9 + 7;
ll my_hash(string s){
ll h = 0;
for(int i=0; i<s.size(); i++)
h = h * p + s[i];
return h;
}
vector<ll> rk(string s, string w){
vector <ll> res;
int n = s.size();
int... | ALGO | 0.999893 | 4.261851 |
2e259677-238c-4c8a-90c8-c704434c2feb | cmake-wheel/pin3-slam | examples/kinematics-derivatives.cpp | #include "pinocchio/parsers/urdf.hpp"
#include "pinocchio/algorithm/joint-configuration.hpp"
#include "pinocchio/algorithm/kinematics-derivatives.hpp"
#include <iostream>
// PINOCCHIO_MODEL_DIR is defined by the CMake but you can define your own directory here.
#ifndef PINOCCHIO_MODEL_DIR
#define PINOCCHIO_MODEL_D... | TOOL | 0.868885 | 6.22954 |
c3ac56d7-f86e-4830-a514-30ea84bf1d82 | hku-mars/GS-SDF | include/data_loader/data_parsers/base_parser.cpp | #include "base_parser.h"
#include <dirent.h>
#include <filesystem>
#include "utils/ply_utils/ply_utils_torch.h"
#include <opencv2/opencv.hpp>
#include <pcl/io/pcd_io.h>
namespace dataparser {
DataConfig read_params(const std::filesystem::path &_dataset_path,
const std::filesystem::path &_conf... | DATA | 0.948647 | 6.355704 |
71f8a9a6-52a9-4d44-8623-7bb2049dc763 | BenjaminQuiedeville/AmpModeler | libs/JUCE/modules/juce_graphics/geometry/juce_Path.cpp | namespace juce
{
// tests that some coordinates aren't NaNs
#define JUCE_CHECK_COORDS_ARE_VALID(x, y) \
jassert (! std::isnan (x) && ! std::isnan (y));
//==============================================================================
namespace PathHelpers
{
const float ellipseAngularIncrement = 0.05f;
sta... | TOOL | 0.938552 | 6.321333 |
449bd18e-762d-489a-bf78-545adba748d4 | realvaibhav/competitive_programming | kick start/2022/Round B 2022/Palindromic Factors.cpp | #include<bits/stdc++.h>
using namespace std ;
typedef long long ll ;
#define endl "\n"
ll checkpalin(ll n)
{
int r=0 , check=n , res=0 , ans=0 ;
while (n!=0)
{
r=n%10 ;
res=res*10+r ;
n/=10 ;
}
if (check==res)
{
return 1 ;
}
else
{
return -1 ;
... | ALGO | 0.998944 | 5.047026 |
c7029ee5-02fa-4f1e-a561-0414aff56b05 | Mustafa-Hassan2001/365DaysofLeetcode | D19-Array.cpp | //152. Maximum Product Subarray
class Solution {
public:
int maxProduct(vector<int>& nums) {
int n = nums.size();
int Max = nums[0], a = 1, b = 1;
for(int i = 0; i < n; i++){
a = (a == 0 ? 1 : a) * nums[i];
b = (b == 0 ? 1 : b) * nums[n - 1 - i];
... | ALGO | 0.999524 | 5.605896 |
c7ea934e-337b-4782-9c12-6fbe91a8d9e2 | nerd-sourav/x | GFG POTD/24_sept.cpp | //{ Driver Code Starts
#include <bits/stdc++.h>
using namespace std;
// } Driver Code Ends
class Solution{
public:
vector<int> duplicates(int arr[], int n) {
// code here
vector<int>ans;
int i=0;
while(i<n){
if(arr[i]==-1 || arr[i]==i)
i++;
... | ALGO | 0.999752 | 6.098 |
60cff14f-c201-432f-b178-2dcc56ddbcaf | bobser223/learning_c_cpp | University/Labs/lab007/l007.cpp | //
// Created by Volodymyr Avvakumov on 20.09.2024.
//
//
// Created by Volodymyr Avvakumov on 20.09.2024.
//
#include <iostream>
#include <bitset>
using namespace std;
int main(){
uint8_t x = 0b00111000;
// x - 1 = 0b0011011
// x & (x - 1) = 0b001100000 // прибирає наймолодший біт
// (x & (x - 1)) > ... | ALGO | 0.997804 | 4.942187 |
d45e198b-2828-4ef1-853c-999dfc305fab | shash04/General_Coding | Companies/Microsoft/OA_questions/Max_chuncks_to_sort_array.cpp | // We are given an array A consisting of N distinct integers. We would like to sort array A into ascending order using a simple algorithm.
// First, we divide it into one or more slices (a slice is a contiguous subarray). Then we sort each slice.
// After that, we join the sorted slices in the same order.
// Write a fu... | ALGO | 0.999897 | 5.733269 |
e1ddda07-3e2a-4c5f-bd1f-363d5b59c4a3 | llynv/CP-files | DP_Bài_11_Xâu_con_chung_dài_nhất_của_3_xâu_2.cpp | /*
Code by: linvg
Created: 19.01.2025 16:46:53
*/
#include <bits/stdc++.h>
using namespace std;
#define int long long
#define all(x) (x).begin(), (x).end()
#define sz(x) ((int)(x).size())
string to_upper(string a) { for (int i = 0;i < (int)a.size();++i) if (a[i] >= 'a' && a[i] <= 'z') a[i] -= 'a' - 'A'; return a;... | ALGO | 0.99997 | 5.174989 |
16dc8f69-a8fc-4c8d-88cf-3bbf40d92943 | nhatminh2947/LightOj | 1307 - Counting Triangles/1307 - Counting Triangles.cpp | //******************************************************************
// Author: Huynh Nhat Minh
// Problem Name: 1307 - Counting Triangles
// Verdict: Accepted
//******************************************************************
#include <iostream>
#include <iomanip>
#include <cstdio>
#include <algorithm>
#include <cst... | ALGO | 0.999424 | 4.686914 |
cd59a91e-d0b1-48d7-9355-809106c59de7 | Jinming-Su/caffe-source-code-analysis | caffe-src/src/caffe/solvers/rmsprop_solver.cpp | #include <vector>
#include "caffe/sgd_solvers.hpp"
namespace caffe {
#ifndef CPU_ONLY
template <typename Dtype>
void rmsprop_update_gpu(int N, Dtype* g, Dtype* h, Dtype rms_decay,
Dtype delta, Dtype local_rate);
#endif
template <typename Dtype>
void RMSPropSolver<Dtype>::ComputeUpdateValue(int param_id, Dtype r... | ALGO | 0.98559 | 7.295526 |
ca734f88-e10a-42f8-90c2-2c43f06ad212 | Michaelzhouisnotwhite/CXX20-PlayGround | include/eigen/doc/examples/Tutorial_BlockOperations_print_block.cpp | #include <Eigen/Dense>
#include <iostream>
using namespace std;
int main()
{
Eigen::MatrixXf m(4,4);
m << 1, 2, 3, 4,
5, 6, 7, 8,
9,10,11,12,
13,14,15,16;
cout << "Block in the middle" << endl;
cout << m.block<2,2>(1,1) << endl << endl;
for (int i = 1; i <= 3; ++i)
{
cout << "B... | ALGO | 0.993721 | 3.6853 |
6418fba9-70d2-47e8-b8a4-2796fc97b81f | otavioon/COLA-2022-Tools | datasets/src/optz/codenet/1/p02970_s220882104.cpp | #include <bits/stdc++.h>
#define REP(i, n) for(int i = 0; i < n; i++)
#define REPR(i, n) for(int i = n; i >= 0; i--)
#define FOR(i, m, n) for(int i = m; i < n; i++)
#define INF 2e9
#define ALL(v) v.begin(), v.end()
using namespace std;
typedef long long ll;
int main()
{
int n,d,human=1;
cin >> n >> d;
int x = 2*d... | ALGO | 0.998382 | 3.081998 |
06219df0-81a7-4d68-adcf-ca9da5804415 | sarvex/leetcode-haskell | solution/2000-2099/2039.The Time When the Network Becomes Idle/Solution.cpp | class Solution {
public:
int networkBecomesIdle(vector<vector<int>>& edges, vector<int>& patience) {
int n = patience.size();
vector<vector<int>> g(n);
vector<bool> vis(n);
for (auto& e : edges) {
int u = e[0], v = e[1];
g[u].push_back(v);
g[v].pus... | ALGO | 0.999972 | 5.731624 |
9bac7e77-09f2-480e-8658-79fadeb8217b | sumit-raghukant-soni/Leetcode_Solutions | 1615-range-sum-of-sorted-subarray-sums/range-sum-of-sorted-subarray-sums.cpp | class Solution {
public:
int rangeSum(vector<int>& nums, int n, int left, int right) {
int sz = nums.size(), k=0;
vector<long long> tmp((sz*(sz+1))/2, 0);
long long val = 0, MOD = 1e9 + 7;
for(int i=0; i<sz; i++){
val = 0;
for(int j=i; j<sz; j++){
... | ALGO | 0.999989 | 5.84666 |
c65f6ada-5c2d-4b01-8a59-26d918df683f | skavy359/Algorithmic-Huddle | GeeksForGeeks-Problems/CPP/Operators/Last Digit of a Number.cpp | void utility(int n)
{
// just complete below statement
int ans = abs(n % 10);
// print the result
cout << ans << endl;
} | ALGO | 0.999492 | 3.781505 |
7e90f794-691d-48ba-9054-138c6abf2da0 | Gaurav-20/LeetCode-Solutions | 0150-evaluate-reverse-polish-notation/0150-evaluate-reverse-polish-notation.cpp | class Solution {
public:
int evalRPN(vector<string>& tokens) {
stack<int>st;
for (auto &t: tokens) {
if (t == "+" || t == "-" || t == "*" || t == "/") {
long long operator1 = st.top(); st.pop();
long long operator2 = st.top(); st.pop();
if ... | ALGO | 0.999933 | 6.279181 |
7439e21e-6322-480f-a930-f20733b16399 | wangxich17/-anal-c- | f_canshu.cpp | /*f_canshu()ڴļdatԲϵIJ */
#include<iostream>
#include<opencv2/opencv.hpp>
#include<Eigen/Dense>
using namespace std;
using namespace Eigen;
using namespace cv;
const int len_row = 128; //ݶļͼĿ
const int len_col = 61;
const int file_size = 7808;
const int threshold_value_rain = 25; //ý˵ֵ
const int threshold_value_... | DATA | 0.986314 | 3.303933 |
65c1ec8f-c1d4-4d34-bb2f-1c6670070f71 | rpuntaie/c-examples | cpp/numeric_special_functions_beta.cpp | /*
g++ --std=c++20 -pthread -o ../_build/cpp/numeric_special_functions_beta.exe ./cpp/numeric_special_functions_beta.cpp && (cd ../_build/cpp/;./numeric_special_functions_beta.exe)
https://en.cppreference.com/w/cpp/numeric/special_functions/beta
*/
#include <cmath>
#include <string>
#include <iostream>
#include <iomani... | ALGO | 0.991711 | 6.41448 |
554496cb-0e56-48c8-b52d-bcc27dd3873d | iwtwiioi/OnlineJudge | wikioi/Run_290582_Score_40_Date_2013-10-17.cpp | #include <iostream>
#include <queue>
#include <string>
#include <map>
using namespace std;
string A, B;
struct rule
{
string a, b;
}rules[7];
int n = 1, i, pos;
struct mpair
{
string str;
int n; //次数
mpair& operator= (const mpair& c){str = c.str; n = c.n; return *this;}
}t, t1;
queue<mpair> q;
map<string, bool> ... | ALGO | 0.99996 | 3.765444 |
e0606b1c-fc14-4c66-bcbc-6e5db6998a81 | raj2k00/LeetCode | 0055-jump-game/0055-jump-game.cpp | class Solution {
public:
bool canJump(vector<int>& nums) {
int minJump = 0;
for(int i = nums.size() - 2; i >= 0; i--){
minJump++;
if( nums[i] >= minJump){
minJump = 0;
}
}
return minJ... | ALGO | 0.999991 | 6.321338 |
7fb5a046-b950-4c41-b652-c96737f66598 | krasimir-p/ConditionalStatements | BonusScore/BonusScore.cpp | #include <iostream>
using namespace std;
int main()
{
int points;
cin >> points;
double bonus = 0.0;
if (points <= 100) {
bonus = 5;
}
else if (points > 1000) {
bonus = points * 0.1;
}
else {
bonus = points * 0.2;
}
if (points % 2 == 0) {
bonus += 1;
}
else if (points % 10 == 5) {
bonus += 2;
... | ALGO | 0.998852 | 3.067326 |
dcc1cea3-fe1b-4cc0-94f6-6cb08c140064 | ishandutta2007/codeforces | nebuchadnezzar/normal/1037/E.cpp | #ifdef LOCAL
# define _GLIBCXX_DEBUG
# define _GLIBCXX_DEBUG_PEDANTIC
#endif
#include "bits/stdc++.h"
#define ff first
#define ss second
#define szof(_x) ((int) (_x).size())
#define TASK_NAME ""
using namespace std;
typedef long long ll;
typedef pair<int, int> pii;
const int INF = 1e9 + 7;
const ll INFL = 1e18 + 12... | ALGO | 0.999996 | 3.935982 |
5c126b16-3080-484e-9ae1-33fc59266c56 | Liash66/ASD | sem_3/lab_11/lab_11.cpp | #include <iostream>
#include <vector>
void quick_sort(std::vector<int>& arr, unsigned int left, unsigned int right)
{
if (left >= right)
return;
int pivot = arr[(left + right) / 2];
int i = left;
int j = right;
while (i <= j)
{
while (arr[i] < pivot)
i++;
... | ALGO | 0.999945 | 5.932213 |
73099664-af6a-4246-b5bc-61224a335966 | gandhy98/tareas-c- | problema 10/problema9.cpp | #include<string>
#include<iostream>
#define _USE_MATH_DEFINES
#include <math.h>
using namespace std;
int main()
{
float radio, area, longitud;
cout<<"INGRESE EL RADIO DEL CIRCULO"<<endl;
cin>>radio;
area = M_PI*radio*radio;
longitud = M_PI*2*radio;
cout<<"El area del circulo es: "<<area<<e... | ALGO | 0.953571 | 3.607455 |
52dd5860-e3a3-48a2-83bc-3e41162a6a0d | Parasbankoti/leetCode-DSA | 64. Minimum Path Sum.cpp | class Solution {
public:
int minPathSum(vector<vector<int>>& grid) {
queue<vector<int>> q;
int sum = 0, res = INT_MAX;
int row = grid.size(), col = grid[0].size();
bool vis[201][201];
memset(vis, false, sizeof(vis));
vector<vector<int>> dist(row, vector<int>(col, INT... | ALGO | 0.999954 | 5.618664 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.