uuid
string
repo_name
string
relative_path
string
content
string
category
string
algo_rel_score
float64
quality_score
float64
f841810e-2ea0-4506-8739-55cd6421f9e2
wenwenzju/visual_tracker_benchmark
tracker_benchmark_cpp_interface/pf_tracking_v6/acf_feature_extractor - 副本.cpp
#include "acf_feature_extractor.h" #define SHRINK 1 #define START_THREAD_LOCK {boost::mutex::scoped_lock scop(boost::mutex()); #define END_THREAD_LOCK } void AcfFeatureExtractor::feature_extract(cv::Mat& img) { CV_Assert(img.channels() == 3); cv::Mat rgb_img; img.copyTo(rgb_img); {//convert bgr to rgb std::ve...
ALGO
0.9545
5.318798
89b9c0d2-d95a-47e0-a421-68e37c746684
LIUHUANUCAS/next_journey
leetcode/stack/20-valid-parentheses.cpp
#include <cstdio> #include <iostream> #include <map> #include <random> #include <set> #include <stack> #include <unordered_map> #include <vector> #include "../header/data_type.h" using namespace std; class Solution { public: bool isValid(string s) { stack<char> st; for (auto c : s) { ...
ALGO
0.99958
5.650148
370f5125-cf49-44e9-a2b2-8f282f906c93
ProjectBlaze-Reborn/bionic
linker/linker.cpp
#include <android/api-level.h> #include <assert.h> #include <errno.h> #include <fcntl.h> #include <inttypes.h> #include <pthread.h> #include <stdio.h> #include <stdlib.h> #include <string.h> #include <sys/auxv.h> #include <sys/mman.h> #include <sys/param.h> #include <sys/vfs.h> #include <unistd.h> #include <iterator> ...
TOOL
0.91167
7.547002
f4fa7671-8b59-447a-a81c-eadb622c6d09
Ajaya1000/codeforces
practice/D_Traveling_Graph.cpp
// @itsAj #include <bits/stdc++.h> // #include<boost/multiprecision/cpp_int.hpp> #define fastio ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0) #define test int t; cin >> t; while (t--) #define pb push_back #define endl '\n' #define rep(i, x, y) for (auto i = x; i <= y; i++) #define repi(i, x, y) for (auto i = x;...
ALGO
0.999934
4.260852
c238360d-25fe-40fb-9731-688de7dd1270
Rakibul1411/Operating_System_Lab
Directory/rock_climbing.cpp
#include<bits/stdc++.h> #define size 100 using namespace std; int a[size][size]; int c[size][size]; int row,column; int minimum(int a,int b,int c); void print_path(int m,int n); int main() { cout<<"Enter row and column of the rock: "; cin>>row>>column; int i,j; for(i=1;i<=row;i++) { for(j=1;...
ALGO
0.999955
3.19734
d75670ab-e8c6-40c3-ab3f-0d53917d579a
teamlite/litecash
utility/helpers.cpp
#include "helpers.h" #include <chrono> #include <iostream> #include <stdio.h> #include <time.h> #include <atomic> #include "wallet/secstring.h" #if defined __linux__ #include <unistd.h> #include <termios.h> #include <sys/types.h> #include <sys/syscall.h> #include <sys/signal.h> #include <errno....
TOOL
0.891929
6.086104
276a6469-0cd9-4311-99ee-4879dfa99d5d
andersonjwan/readings
stroustrup2018tour/ch02/sec02/main.cpp
#include <iostream> using std::cin; using std::cout; /* structures */ struct Vector { int size; double *elems; }; void vector_init(Vector& v, int size) { v.elems = new double[size]; v.size = size; } double vector_sum(const Vector& v) { int sum = 0; for(int i = 0; i < v.size; ++i) { sum += v.elems[i...
ALGO
0.928062
5.188964
7f5ee243-cd07-4b6c-abc1-5ec1c58fca58
Muhammad-Tayyab-Bhutto/CPP-Code-With-Commented-Concepts
HackerRank09.cpp
#include <cmath> #include <cstdio> #include <vector> #include <iostream> #include <algorithm> using namespace std; int main() { /* Enter your code here. Read input from STDIN. Print output to STDOUT */ int len; cin>>len; vector <int> v1(len); for (int i = 0; i < len; i++) { cin>>v1[...
ALGO
0.999794
3.617704
b2df6546-30d8-43b6-b560-be1eee497217
ishandutta2007/codeforces
swistakk/normal/1329/A.cpp
#include <bits/stdc++.h> #define MP make_pair #define PB push_back #define int long long #define st first #define nd second #define rd third #define FOR(i, a, b) for(int i =(a); i <=(b); ++i) #define RE(i, n) FOR(i, 1, n) #define FORD(i, a, b) for(int i = (a); i >= (b); --i) #define REP(i, n) for(int i = 0;i <(n); ++i)...
ALGO
0.999972
3.259693
e62d9a01-ef10-4424-9a74-35ce77c386b4
ravikjha7/Competitive-Programming
Data Structures/Prime Numbers/PrimeFactorizationSieve.cpp
#include <bits/stdc++.h> using namespace std; typedef long long int ll; #define mod 1000000007 void file() { #ifndef ONLINE_JUDGE freopen("input.txt", "r", stdin); freopen("output.txt", "w", stdout); #endif } int arr[100001] = {0}; void seive() { int n = 100000; for(ll i = 2; i <= n; i++) { int p = i; ...
ALGO
0.9999
5.159351
8a2a76f8-4547-4bde-96a3-7a132152bd26
neerajcodes888/GFG
School/Find Index/find-index.cpp
//{ Driver Code Starts #include <iostream> #include <bits/stdc++.h> #include <vector> using namespace std; // } Driver Code Ends class Solution { public: vector<int> findIndex(int a[], int n, int key) { vector<int> v; for(int i=0; i<n; i++){ if(a[i]==key){ v.push_ba...
ALGO
0.999857
6.060857
3e17eaee-a071-495f-acbb-2a14e0780db7
prithvijitbasak/LeetCode-Solutions
2160. Minimum Sum of Four Digit Number After Splitting Digits.cpp
//Editorial: https://leetcode.com/problems/minimum-sum-of-four-digit-number-after-splitting-digits/discuss/1747526/C++-oror-easy-solution-oror-0-ms/1253769 class Solution { public: int minimumSum(int num) { string s=to_string(num); sort(s.begin(),s.end()); return stoi(s.substr(0,1)+s.substr(2,...
ALGO
0.999907
6.243403
41c9b088-86cd-4ac2-ab96-4a4d2f00753e
archit2604/RRT
boost_1_61_0/libs/math/example/neg_binom_confidence_limits.cpp
// neg_binomial_confidence_limits.cpp // Caution: this file contains quickbook markup as well as code // and comments, don't change any of the special comment markups! //[neg_binomial_confidence_limits /*` First we need some includes to access the negative binomial distribution (and some basic std output of course)...
ALGO
0.999114
7.201398
cab5dca8-9dbf-44cf-9733-45a9e9f29136
mqjinwon/ComputerVision
Homeworks_CV/eigen-3.3.8/bench/sparse_lu.cpp
// g++ -I.. sparse_lu.cpp -O3 -g0 -I /usr/include/superlu/ -lsuperlu -lgfortran -DSIZE=1000 -DDENSITY=.05 && ./a.out #define EIGEN_SUPERLU_SUPPORT #define EIGEN_UMFPACK_SUPPORT #include <Eigen/Sparse> #define NOGMM #define NOMTL #ifndef SIZE #define SIZE 10 #endif #ifndef DENSITY #define DENSITY 0.01 #endif #ifnd...
ALGO
0.996905
4.187482
ba448387-070f-4875-931b-6c4637d28f41
Fang0105/APCSanswer
2020-7/zoj-f579.cpp
#include<bits/stdc++.h> #define int long long #define endl '\n' #define ull unsigned long long using namespace std; int MAX = LONG_MAX; int MIN = LONG_MIN; signed main(){ ios::sync_with_stdio(0);cin.tie(0);cout.tie(0); int a,b; cin>>a>>b; int n; cin>>n; int tot = 0; while(n--){ int f; int ca=0,cb=0; while...
ALGO
0.999774
3.92691
f72094a5-b0e0-4182-8457-ff364ed06f3a
Samsung/Vyond
chipyard-1.11.0/sims/firesim/platforms/f1/aws-fpga/Vitis/examples/xilinx_2020.2/host/p2p_simple/src/host.cpp
// OpenCL utility layer include #include "cmdlineparser.h" #include "xcl2.hpp" #include <fcntl.h> #include <fstream> #include <iomanip> #include <iosfwd> #include <iostream> #include <unistd.h> #include <vector> #define DATA_SIZE 4096 #define INCR_VALUE 10 void p2p_host_to_ssd(int &nvmeFd, cl::Context context, cl::Co...
ALGO
0.922323
5.299042
0b58030d-3eea-4769-85e8-d1c7ff33a2b9
radwanCS/CPlusPlusHowToProgram11e-Solutions
chapter5/ex14.cpp
#include <iostream> #include <iomanip> int fahrenheit_to_celsius(int f) { return ((f - 32) * 5 / 9); } int celsius_to_fahrenheit(int c) { return ((9 / 5 * c) + 32); } int main() { std::cout << std::left << std::setw(11) << "Celsius" << std::setw(11) << "Fahrenheit" << '\n'; for (int i = 0; i <= 100...
TOOL
0.864123
4.717305
54f0a49d-bb44-485b-a6db-eefff1e130a8
RajatMantri/TLE-Sheet
1000/C_Move_Brackets.cpp
#include<bits/stdc++.h> using namespace std; #define endi "\n" typedef long long ll; typedef pair<ll, ll> pll; typedef vector<ll> vll; const ll mod = 1e9 + 7; const static auto initialize = [] { std::ios::sync_with_stdio(false); std::cin.tie(nullptr); std::cout.tie(nullptr); return nullptr; }(); //rbegin() int main()...
ALGO
0.999162
4.110161
6a9d6b12-ea44-44d0-a14f-60d3fec25c91
chuspita/fix_ninja_slow
third_party/icu/source/tools/toolutil/toolutil.cpp
#include "unicode/platform.h" #if U_PLATFORM == U_PF_MINGW // *cough* - for struct stat #ifdef __STRICT_ANSI__ #undef __STRICT_ANSI__ #endif #endif #include <stdio.h> #include <sys/stat.h> #include <fstream> #include <time.h> #include "unicode/utypes.h" #ifndef U_TOOLUTIL_IMPLEMENTATION #error U_TOOLUTIL_IMPLEMENTATI...
TOOL
0.913791
6.622471
01d68d4f-6eee-4067-a6ea-931f38fc9086
JeewanAidi/C-codes
day6code4centerpyramid.cpp
#include<iostream> using namespace std; int main(){ int n,b,i,j; cout<<"Enter the no. of rows : "; cin>>n; /*for printing * *** ***** ******* and so on*/ for(i=1;i<=n;i++){ for(b=1;b<=n-i;b++){ cout<<" "; } for(j=1;j<=(2*i-1);j++){ ...
ALGO
0.999355
3.663031
d2a48712-218e-443f-8c8d-a727567d619a
elianecd/exerciciosCPP
refazendo os exercicios/ex2_c.cpp
/* O programa pede uma data como input e printa com os sufixos st, nd, rd, th e com o nome do mes. Ele verifica se os dias correspondem ao mes e ao ano caso seja bisexto. */ #include <iostream> //#include <cmath> using std::cin; using std::cout; using std::endl; int main() { int d, m, y; bool is_leap = false...
ALGO
0.996795
4.159579
bc264fe3-0e7a-4148-ad83-85518c0ff2b9
clip968/algorithm
previous/빵집.cpp
#include<bits/stdc++.h> using namespace std; int answer; int dx[] = {-1, 0, 1}; // 위쪽 대각선, 오른쪽, 아래쪽 대각선 int dy[] = {1, 1, 1}; bool dfs(int x, int y, vector<vector<char>> &v) { if(y == v[0].size() - 1) { answer++; return true; } for(int i{};i<3;++i) { int nx = x + dx[i]; ...
ALGO
0.999895
4.09447
8bba67e3-bd01-48e4-bbd5-18eebd42056f
boj-dgsw/ps
wlals1126/boj/cpp/21760_야구 시즌.cpp
#include <iostream> using namespace std; long long solve(long long n, long long m, long long k, long long d) { long long p = (k * n * m * (m - 1) + n * m * m * (n - 1)) / 2; long long a = d / p * p; return a ? a : -1; } int main() { ios::sync_with_stdio(false); cin.tie(nullptr); int t; ci...
ALGO
0.999828
5.88996
44998969-1160-4af7-a292-10182053bac2
vrat28/21DaysOfLeetcode
CPP/bitwise_compliment.cpp
#include <iostream> #include <math.h> using namespace std; class CalculateComplement { public: static int bitwiseComplement(int n) { // TODO: Write your code here int bitN = n; int noOfBits = 0; while (bitN > 0){ noOfBits++; bitN = bitN >> 1 ; } ...
ALGO
0.999564
5.941888
63466867-6006-4471-b0bd-0ec5116e0471
shelltdf/osgall
prebuild/boost_1_71_0/libs/math/src/tr1/fminf.cpp
extern "C" float BOOST_MATH_TR1_DECL boost_fminf BOOST_PREVENT_MACRO_SUBSTITUTION(float x, float y) BOOST_MATH_C99_THROW_SPEC { if((boost::math::isnan)(x)) return y; if((boost::math::isnan)(y)) return x; return (std::min)(x, y); }
ALGO
0.975206
4.864094
3b2563f6-616f-49d1-b3e7-7ea0f17c49fe
Living-Hell/LeetCode
Binary Search/#1631-Path With Minimum Effort.cpp
//M1 //Using Binary Search + BFS //Faster than 7.93% (268ms) class Solution { public: vector<pair<int, int>> dir = {{0, 1}, {0, -1}, {1, 0}, {-1, 0}}; bool solve(vector<vector<int>>& grid, int maxm) { int m = grid.size(), n = grid[0].size(); vector<vector<bool>> vis(m, vector<bool>(n, 0)); ...
ALGO
0.999985
6.074906
818cbed0-871d-4d10-85cf-629e164ab947
TuYe05/PT4_CPP_helper
Tree42.cpp
#include "pt4.h" using namespace std; void ReleaseSubtree(PNode node) { if (node==nullptr) return; ReleaseSubtree(node->Left); ReleaseSubtree(node->Right); DeleteNode(node); } PNode delete_node(PNode node, int num) { if (!node) return nullptr; node->Left = delete_node(node->Left, num); nod...
ALGO
0.999957
3.778527
197862b0-0e73-4de7-aaff-050cddefc562
ohpauleez/soymacchiato
src/jdk/src/share/native/sun/font/layout/CanonShaping.cpp
#include "LETypes.h" #include "LEGlyphStorage.h" #include "CanonShaping.h" #include "GlyphDefinitionTables.h" #include "ClassDefinitionTables.h" U_NAMESPACE_BEGIN void CanonShaping::sortMarks(le_int32 *indices, const le_int32 *combiningClasses, le_int32 index, le_int32 limit) { for (le_int32 j = index + 1; j < li...
TOOL
0.961656
6.828549
b1ca40cc-41f4-4b73-ba84-14976c9bc7f0
dalihub/dali-adaptor
dali/internal/text/text-abstraction/bidirectional-support-impl.cpp
// CLASS HEADER #include <dali/internal/text/text-abstraction/bidirectional-support-impl.h> // EXTERNAL INCLUDES #include <dali/devel-api/common/singleton-service.h> #include <dali/integration-api/debug.h> #include <fribidi/fribidi.h> #include <memory.h> namespace Dali { namespace TextAbstraction { namespace Interna...
TOOL
0.979244
7.429233
d4074f86-13df-45ef-9db5-edcd957e1eac
hyee0715/Algorithm
LeetCode/cpp/453_Minimum_Moves_to_Equal_Array_Elements.cpp
class Solution { public: int minMoves(vector<int>& nums) { int answer = 0; sort(nums.begin(), nums.end()); for (int i = 1; i < nums.size(); i++) { answer += (nums[i] - nums[0]); } return answer; } };
ALGO
0.999969
5.79114
47d1085e-4d7e-4fb8-be6c-8c03a4e7c67f
ishandutta2007/codeforces
ivan100sic/normal/1405/B.cpp
// Retired? #include <bits/stdc++.h> using namespace std; typedef long long ll; typedef long unsigned long ull; typedef double long ld; int main() { ios::sync_with_stdio(!cin.tie(0)); int t; cin >> t; while (t--) { int n; cin >> n; vector<ll> a(n); for (ll& x : a) cin >> x; ll dzabe = 0, cena = 0; fo...
ALGO
0.999964
4.711349
e74c7da3-9b12-439a-aa10-b1a3581d672a
hack-parthsharma/LeetCode
0119-pascals-triangle-ii/0119-pascals-triangle-ii.cpp
class Solution { public: vector<int> getRow(int rowIndex) { vector<int> ans(rowIndex + 1, 1); for (int i = 2; i < rowIndex + 1; ++i) for (int j = 1; j < i; ++j) ans[i - j] += ans[i - j - 1]; return ans; } };
ALGO
0.999755
5.987225
9ca656e6-dec1-4f04-9704-8a4dd508cb3b
xanderpolitis/algo_bowl
src/bruteforce.cpp
#include <iostream> using namespace std; #include <map> #include <vector> #include "evaluate.h" #include <unordered_map> #pragma once void add_tent_brute(Board *board, int row, int col, int* changes,std::unordered_map<int, int> *h_per_row, unordered_map<int, int> *h_per_col){ if(board->board[row][col].type == 'H'){ ...
ALGO
0.999382
3.655171
51eb7aa5-f276-4c07-98ac-ba41740e959b
JosePK0/Jose_Pool_Flutter
src/cookbook/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.996885
6.76775
df27af44-8b8a-4c73-818d-ce5b3a3acb90
YingGwan/collisionAwareSOROSimulator
QMeshLib/PQPLib/TriDist.cpp
//-------------------------------------------------------------------------- // File: TriDist.cpp // Author: Eric Larsen // Description: // contains SegPoints() for finding closest points on a pair of line // segments and TriDist() for finding closest points on a pair of triangles //----------------------------------...
ALGO
0.99994
6.640511
6f2be8f3-db78-4983-b89e-e3761326f719
Simplet1me/learn
C++/c.cpp
#include<iostream> using namespace std; int main(){ int a = 10; cout<<a<<endl; cout<<a++<<endl; a = 10; cout<<a<<endl; cout<<++a<<endl; }
TOOL
0.992721
3.059561
52f19c81-bdbf-4283-8a97-d22e6287b6ca
GH0STP1R4T3/university-labs
C++_Projects/1 term/Lab2/Lab_2_Main.cpp
#include <iostream> #include <cmath> #include <windows.h> using namespace std; int intPow(int num, int i) { int x = num; for (int count = 1; count < i; count++) { num *= x; } return num; } int countDigits(int num) { int n = 1; while ((num /= 10) > 0) n++; return n; } void ...
ALGO
0.997273
3.704539
77641c32-caad-4ae1-b06c-f38f74036aa9
RichardGPCPRO/Beecrowd
Bee 1013 - O Maior.c.cpp
#include<stdio.h> main(){ int a,b,c,maior; scanf("%d %d %d",&a,&b,&c); maior=(a+b+abs(a-b))/2; maior=(maior+c+abs(maior-c))/2; printf("%d eh o maior\n",maior); return 0; }
ALGO
0.999937
3.61717
d64588fe-1e20-4262-983a-ee7b775bc0a6
lukasmonk/lucaschess
Engines/Windows/honey/src/thread.cpp
#include <cassert> #include <algorithm> // For std::count #include "movegen.h" #include "search.h" #include "thread.h" #include "uci.h" #include "syzygy/tbprobe.h" #include "tt.h" ThreadPool Threads; // Global object /// Thread constructor launches the thread and waits until it goes to sleep /// in idle_loop(). Note...
ALGO
0.993652
5.85113
56f58cc2-8645-4d7c-a46b-e5e3f5e5394d
speedydk/leetcode-questions
combination-sum-ii/combination-sum-ii.cpp
class Solution { public: void cal(vector<int>&cand, vector<vector<int>>&ans, vector<int>&contri, int& target, int i, int sum, int& size) { //base condition if(sum == target) { ans.push_back(contri); return; } if(i == size || sum>targe...
ALGO
0.999988
5.570611
7c05780d-01d6-42c8-bd07-834e689dd1fb
fletcherist/algorithms-ds-practise
719/0.cpp
#include <iostream> #include <vector> using namespace std; int main () { int n = 0; cin >> n; vector<int> arr(n); for (int i = 0; i < n; i++) { cin >> arr[i]; } int k = n - 1; int diff = arr[k] - arr[k - 1]; if (n == 1 && arr[k] == 0) { cout << "UP" << endl; return 0; } if (n == 1 && arr[k] != 15) { ...
ALGO
0.999971
3.899902
32fde725-f623-4588-9987-0fa4b121e012
rcslab/aurora-12.3
contrib/llvm-project/llvm/lib/CodeGen/MachineBranchProbabilityInfo.cpp
#include "llvm/CodeGen/MachineBranchProbabilityInfo.h" #include "llvm/CodeGen/MachineBasicBlock.h" #include "llvm/IR/Instructions.h" #include "llvm/InitializePasses.h" #include "llvm/Support/CommandLine.h" #include "llvm/Support/Debug.h" #include "llvm/Support/raw_ostream.h" using namespace llvm; INITIALIZE_PASS_BEGI...
TOOL
0.870466
7.848974
3c9fa0cc-e3ef-4807-a7b0-2c687436862f
w41ter/LeetCodePractice
86-Partition-List.cpp
/** * Definition for singly-linked list. * struct ListNode { * int val; * ListNode *next; * ListNode(int x) : val(x), next(NULL) {} * }; */ class Solution { public: ListNode* partition(ListNode* head, int x) { ListNode first(0), *p = &first, header(0); header.next = head; ...
ALGO
0.999997
5.375343
5fa0c717-d1a9-45c3-b122-1a504c47afcb
GowthamR1011/LeetCode
Hard/Minimum Cost Walk in Weighted Graph/Solution.cpp
class UnionFind{ public: vector<int> parent; vector<long long> size; UnionFind(int n){ for(int i=0;i<n;i++){ parent.push_back(i); size.push_back(1); } } int find(int x){ if(parent[x]!=x) ...
ALGO
0.999988
5.544226
df047cd3-eb5a-45e7-bbe9-584ddf45b3f8
JuliaVicentini/Algoritmos3Exercicios
ArvoreBinariaBusca/RemoverNos.cpp
#include <iostream> using namespace std; struct Node { int value; Node* left; Node* right; Node(int val) : value(val), left(nullptr), right(nullptr) {} }; Node* insert(Node* root, int value) { if (!root) return new Node(value); if (value < root->value) root->left = insert(root->l...
ALGO
0.999976
6.020304
b5545822-ad0d-45fa-ade9-4dd2308fb942
aUscCoder/TronWallet
cryptopp/polynomi.cpp
// polynomi.cpp - written and placed in the public domain by Wei Dai // Part of the code for polynomial evaluation and interpolation // originally came from Hal Finney's public domain secsplit.c. #include "pch.h" #include "polynomi.h" #include "secblock.h" #include <sstream> #include <iostream> NAMESPACE_BEGIN(Cryp...
ALGO
0.998139
6.210737
1a86e6e1-c666-41d4-a416-d939f9568c69
dvosahlik/RC_Car
CurrentMeasurement.cpp
// // // #include "CurrentMeasurement.h" #include "RingBuffer.h" #include "signal_path_serial.h" #include "Transfer_function.h" #include <string.h> #if defined(ARDUINO) && ARDUINO >= 100 #include "arduino.h" #else #include "WProgram.h" #endif uint8_t MOTOR_HYSTERESIS_OFFSET_VOLTS = 15; //mV uint8_t MOTOR_HYSTERE...
TOOL
0.943125
4.111872
578a2253-0cd8-4abf-a1e6-077540b990d1
rishabh27goel/Daily-Coding-Practice
DSA_Sheet/Queue/Implement_Stack_using_Queue.cpp
#include <iostream> using namespace std; class Node { public: int data; Node* next; Node(int data){ this->data = data; this->next = NULL; } }; class Queue { public: int size; Node* rear; Node* front; Queue(){ this->size = 0; ...
ALGO
0.998238
4.491938
c4d996a6-21e2-44d1-b6d7-619b1cb019a7
plabonislam/codes
grap/vector_edge_node.cpp
#include<cstdio> #include <iostream> #include<vector> using namespace std; #define MAX 10000 vector <int>edge[MAX]; int main() { int N,E,i,j,x,y; scanf("%d%d",&N,&E); for(i=0;i<E;i++) { scanf("%d%d",&x,&y); edge[x].push_back(y); edge[y].push_back(x); } for(j=1; j<=N; j++) { ...
ALGO
0.998832
3.288707
24220c75-25cc-413d-906d-9a099a57560f
siddharth-kumar182002/DSA
A_Elephant.cpp
#include<iostream> using namespace std; int main() { int x; cin >> x; if(x<=5){ cout<<"1"<<endl; } else{ if(x%5==0){ cout<<x/5<<endl; } else{ cout<<x/5+1<<endl; } } return 0; }
ALGO
0.999857
3.45908
11d485b2-c5da-4665-823b-51a84ff55381
vaibhavnirmal2001/DSA-problems
rotate-array/rotate-array.cpp
class Solution { public: void rotate(vector<int>& nums, int k) { if(k>nums.size()) k = k % nums.size(); reverse(nums.begin(),nums.begin()+(nums.size()-k)); reverse(nums.begin()+(nums.size()-k),nums.end()); reverse(nums.begin(),nums.end()); }...
ALGO
0.999983
5.991986
158f6206-ba25-44ef-8eba-5d9ec7c6c025
PedroAngeli/Competitive-Programming
Solutions/Atcoder/Contests/AtCoder Beginner Contest 171/c.cpp
#include <bits/stdc++.h> using namespace std; #define endl '\n' int main(){ ios_base :: sync_with_stdio(false); cin.tie(NULL); long long n; cin >> n; string ans = ""; while(n){ n--; int dig = n%26; n /= 26; ans += (dig + 'a'); } reverse(ans.begin(),ans.end()); cout << ans <<...
ALGO
0.999985
4.689783
c45bd81e-eb26-4754-a27a-569fab02110c
dhruv3980/DSA-bootcamp
Basics/Day22/returnindexofmax.cpp
#include<iostream> #include<vector> using namespace std; int findidx(vector<int>arr, int n, int maxidx=0){ if(n==0){ return maxidx; } if(arr[n-1]>arr[maxidx]){ maxidx=n-1; } return findidx(arr,n-1,maxidx); } int main(){ vector<int>v{5,4,8,9,2,3}; int a=v.size(); int ans ...
ALGO
0.999962
4.752995
1eee5f10-bfd8-43c2-a761-167ced8e7f16
mehadi214100/DUET
Mathematical Analysis/numerical_integration.cpp
#include<bits/stdc++.h> using namespace std; double co[100],po[100]; double f(int n,double x){ double sum =0; for(int i=1; i<=n; i++){ sum+=co[i]*pow(x,po[i]); } return sum; } int main(){ int n,u,l; cout<<"Enter number of term: "; //freopen("in.txt", "r", stdin); cin>>n; cou...
ALGO
0.999811
4.373973
84e776d9-1ab5-4579-9441-5d1198a9a428
apple/llvm-project-v5
lldb/tools/lldb-server/lldb-gdbserver.cpp
#include <errno.h> #include <stdint.h> #include <stdio.h> #include <stdlib.h> #include <string.h> #ifndef _WIN32 #include <signal.h> #include <unistd.h> #endif #include "Acceptor.h" #include "LLDBServerUtilities.h" #include "Plugins/Process/gdb-remote/GDBRemoteCommunicationServerLLGS.h" #include "Plugins/Process/gdb-...
TOOL
0.892522
6.964322
8cbfaad6-c884-4801-b948-44f7cd38b6e6
CS1103/unidad-4-standard-library-exercises-alonso1311
Assosiative/Hardwood_Species.cpp
#include<iostream> #include<iomanip> #include<string> #include<map> using namespace std; void Hardwood_Species() { size_t number_cases; cin >> number_cases; cin.ignore(); cout << endl; for(; number_cases > 0;) { map<string, int> m_trees; int total = 0; string trees; wh...
ALGO
0.993695
5.229997
aedb7172-1afe-42cc-b474-4c00eeded102
Mjp777/C-
Filling Bookcase Shelves.cpp
class Solution { public: int minHeightShelves(vector<vector<int>>& books, int shelfWidth) { // dp[i] := the minimum height to place the first i books vector<int> dp(books.size() + 1, INT_MAX); dp[0] = 0; for (int i = 0; i < books.size(); ++i) { int sumThickness = 0; int maxHeight = 0; ...
ALGO
0.999957
6.872434
95990369-e2e1-4720-ae17-19c8b460af83
TheKingAAV7/leetcode
2048-build-array-from-permutation/build-array-from-permutation.cpp
class Solution { public: vector<int> buildArray(vector<int>& nums) { int n=nums.size(); vector<int>ans(n,0); for(int i=0;i<n;i++) ans[i]=nums[nums[i]]; return ans; } };
ALGO
0.999994
5.825414
8fd06aa8-2a9b-4d10-b913-51733ec5ef53
kshitij-vk/frameworks_av
media/libeffects/loudness/dsp/core/dynamic_range_compression.cpp
//#define LOG_NDEBUG 0 #include <cmath> #include "common/core/math.h" #include "common/core/types.h" #include "dsp/core/basic.h" #include "dsp/core/interpolation.h" #include "dsp/core/dynamic_range_compression.h" #include <android/log.h> namespace le_fx { // Definitions for static const class members declared in /...
ALGO
0.996097
6.419666
6c4bbf74-332d-4f71-923e-fc5eb7444da8
Algorithms-and-Data-Structures-2022/search-algorithms-assignment-enzzzhe
src/linear_search_iterative.cpp
#include "assignment/linear_search_iterative.hpp" namespace assignment { std::optional<int> LinearSearchIterative::Search(const std::vector<int>& data, int search_element) const { // Tips: итеративно пройдитесь по элементам массива return std::nullopt; } } // namespace assignment
ALGO
0.999066
4.669712
b7b58871-f353-41e7-9bf3-12338c9fcf8e
WatchPigs/AIPractice
src/PathfindingOpenList.cpp
#include "PathfindingOpenList.h" #include "ofLog.h" NodeRecord* PathfindingOpenList::SmallestElement() { return node_record_priority_queue_.top(); } bool PathfindingOpenList::Contains(Node* node) { if (node_record_map_.count(node)) return true; else return false; } NodeRecord* PathfindingOpenList::Find(Node* node...
ALGO
0.994575
5.231643
cdb2181e-ffff-42e8-86e3-772d73a149db
LuvKobe/CPP-Programming
01-C++-StudyCode/test_10_25/Test9.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.982162
4.470598
bf43e937-891d-4958-9aa0-1ba485ced682
s-full/CS301_Bootcamp_S23
Day 1/Types and Casting/debugger_example.cpp
#include <iostream> using namespace std; int main() { int exam1Score; int exam2Score; int averageScore; cout << "Enter your Exam 1 score: "; cin >> exam1Score; cout << "Enter your Exam 2 score: "; cin >> exam2Score; averageScore = (exam1Score + exam2Score) / 2; cout << "Your ave...
TOOL
0.9812
4.293468
f5ca996a-2947-4082-a576-f04b6d03eb30
dinox0r/comp-prog
cf/rounds/round-528/b.cpp
#include <bits/stdc++.h> using namespace std; typedef long double ld; int main() { std::ios_base::sync_with_stdio(false); std::cin.tie(nullptr); int n; cin >> n; int k; cin >> k; vector<pair<int, int>> pairs; for (int i = 1; i * i <= n; i++) { if (n % i == 0) { pairs.push_back(make_pair(i, n / i...
ALGO
0.999943
4.109015
1be4b80a-dabb-49db-b707-dbf7b9702516
mehedi8gb/cpp_projects
pro4/9.cpp
#include <iostream> using namespace std; int main() { char line[100]; int vowels, consonants, digits, spaces; vowels = consonants = digits = spaces = 0; cout << "Enter line: "; cin.getline(line, 100); for (int i = 0; line[i] != '\0'; ++i) { if (line[i] == 'a' || line[i] == 'e' || ...
ALGO
0.977253
4.077793
69228141-5b91-4c58-a2ab-f8e90823990d
fahadahbd/CSE207
Code/Array/menu.cpp
#include <bits/stdc++.h> using namespace std; int main() { int n; while (1) { cout << "1. First Option\n"; cout << "2. Second Option\n"; cout << "3. Third Option\n"; cout << "0. Exit\n"; cout << "Enter you option: "; cin >> n; if (n == 0) { ...
TOOL
0.956967
3.592613
d33fb28b-23db-43de-96a7-79598ac3633c
tlxucheng/mylinux
App/leetcode/leetcode/defangIPaddr/defangIPaddr.cpp
#include <iostream> #include <string> class Solution { public: std::string defangIPaddr(std::string address) { std::string res; for(int i = 0; i < address.size(); i++) { if(address[i] == '.') { res += "[.]"; } else { res += address[i]; } } return res; } }; int...
ALGO
0.982642
5.713461
d428bb0c-55a0-4906-a8ad-ef0d791a94b2
L0rd-AK/Miscellaneous_code
Even-or-odd.cpp
#include <iostream> #include <bits/stdc++.h> using namespace std; int main() { int n; cin>>n; int a[n]; for(int i=0;i<n;i++){ cin>>a[i]; } for(int i=0;i<n;i++){ if(a[i]%2==0&&a[i]<0){ cout<<"EVEN NEGATIVE"<<endl; } else if(a[i]%2==0&&a[i]>0){ ...
ALGO
0.999301
3.876405
79597e3e-51fd-4b87-b0c7-db202a9e1d34
VatsalS31/DSA
contests/starters_95D-MOONSOON.cpp
#include <bits/stdc++.h> using namespace std; int main() { // your code goes here long long int turn; cin >> turn; while (turn--) { long long int N, M, h; cin >> N >> M >> h; long long int c[N], o[M]; for (long long int i = 0; i < N; i++) cin >> c[i]; ...
ALGO
0.999985
3.652577
36325dd3-69d8-401b-a62d-f8f29aa1ad89
sarvex/leetcode-java
solution/0300-0399/0325.Maximum Size Subarray Sum Equals k/Solution.cpp
class Solution { public: int maxSubArrayLen(vector<int>& nums, int k) { unordered_map<int, int> mp; mp[0] = -1; int s = 0, ans = 0; for (int i = 0; i < nums.size(); ++i) { s += nums[i]; if (mp.count(s - k)) ans = max(ans, i - mp[s - k]); if (!mp.co...
ALGO
0.999927
6.079773
be6d18c5-8275-420d-891e-79bf7e396431
hoanganh-2k5/DSA
sobuocitnhat.cpp
#include <bits/stdc++.h> using namespace std; vector<int> dp; void sol() { int n; cin >> n; vector<int> v(n); dp.assign(n + 1, 1); for (int i = 0; i < n; i++) { cin >> v[i]; } int ans = 0; for (int i = 1; i < n; i++) { for (int j = 0; j < i; j++) { ...
ALGO
0.999889
5.177942
8954c668-242b-4b18-9479-ce4e084e6f92
Anubhav-bot/nm-lab-code
NM LAB 6.cpp
#include <stdio.h> #include <math.h> int main() { printf("Let's divide (x^4 -3x+5) by (X-4) \n\n"); int a[30], b[30]; int i, n, c, remainder; printf("Enter degree of polynomial: "); scanf("%d", &n); printf("Enter coefficients of the dividend polynomial: "); for (i = n; i >= 0; i--) { ...
ALGO
0.999672
3.305446
a04d1f94-9498-4138-bf1b-a6cbed6ac2f3
jaypandey7421/DSA
PATTERNS/patterns.cpp
#include <iostream> using namespace std; void simplePyramid(int n); void flipperSimplePyramid(int n); void invertedPyramid(int n); void flippedInvertedPyramid(int n); void Triangle(int n); int main(){ cout<<" SIMPLE PYRAMID"<<endl; simplePyramid(8); cout<<" FLIPPED SIMPLE PYRAMID"<<endl; f...
ALGO
0.999411
4.05306
a7059953-5397-4042-905d-855d2416eb8d
RashakDude/codeforces
CPP solutions/61A.cpp
#include <iostream> #include <string> using namespace std; int main(){ string s1,s2; cin >> s1 >> s2; int num = s1.size(); for(int i=0;i<num;i++){ if(s1[i]==s2[i]) cout << "0"; else cout << "1"; } }
ALGO
0.999977
3.582783
17836631-a41b-4c72-b67f-bdd49cd70d4f
prabhjotschugh/DSA-Solutions
2684-maximum-number-of-moves-in-a-grid/2684-maximum-number-of-moves-in-a-grid.cpp
class Solution { public: int dp[1001][1001]; int solve(vector<vector<int>>& grid, int prevr, int c){ int n = grid.size(); int m = grid[0].size(); if(c == m-1){ return 0; } if(dp[prevr][c]!=-1) return dp[prevr][c]; int maxi = 0; for(int i=-1; i<...
ALGO
0.999997
6.074683
6e68c868-5c6a-4d66-8b0b-26958fa1f02c
Manan0802/Test
c++course/rough/rainwater.cpp
#include<iostream> using namespace std; int main(){ int n; cin>>n; int heights[1000]; for(int i=0;i<n;i++){ cin>>heights[i]; } int leftmax[1000]; leftmax[0]=0; int mx=heights[0]; for(int i=1;i<n;++i){ leftmax[i]=mx; mx=max(heights[i],mx); } for (int ...
ALGO
0.999979
3.476618
e92f0ec6-8954-4e60-83cd-2299ea75574b
stevekenney318/Mingda-X-Max-Pro
buildroot/share/PlatformIO/variants/LERDGE/variant.cpp
#include "pins_arduino.h" #ifdef __cplusplus extern "C" { #endif const PinName digitalPin[] = { PB_12, PB_13, PB_14, PB_15, PD_8, PD_9, PD_10, PD_11, PD_12, PD_13, PD_14, PD_15, PG_2, PG_3, PG_4, PG_5, PG_6, PG_7, PG_8, PC_6, PC_7, PC_8, PC_9, PA_8, PA_9, PA_10, PA_11, PA_12, PA_13, PA_1...
CONFIG
0.938876
5.010884
4acd5971-701e-4d1d-a158-60990e9f1de8
sarvex/leetcode-clisp
solution/2200-2299/2267.Check if There Is a Valid Parentheses String Path/Solution.cpp
bool vis[100][100][200]; int dirs[3] = {1, 0, 1}; class Solution { public: bool hasValidPath(vector<vector<char>>& grid) { memset(vis, 0, sizeof(vis)); return dfs(0, 0, 0, grid); } bool dfs(int i, int j, int t, vector<vector<char>>& grid) { if (vis[i][j][t]) return false; v...
ALGO
0.999942
5.446515
92be6ba8-2b86-4ca9-bbd8-7403e39a36ba
NSKNASIR/LDSACPP
25_Advance_binary_search_algo.cpp
//spoj eko #include <bits/stdc++.h> using namespace std; const long long N = 1e6+10; int n; long long m; long long arr[N]; //predicate function = F F F F T T T T T T bool isS(long long h){ long long wood=0; for(int i=0;i<n;++i) if(arr[i] >=h) wood+=arr[i]-h; return wood >=m; } int main(){ cin>>n>>m...
ALGO
0.999994
4.329331
929833f0-0164-413b-b36d-05141b8331ab
zdev128/CIS-5
Hmwk/Assignment 7/Gaddis_9thEd_Chap8_Prob4_ProgrammingChallenges/main.cpp
/* * File: main.cpp * Author: Zachary Romero * Created on December 3, 2018, 4:57 PM * Purpose: HW 7 */ #include <iostream> #include <string> #include <iomanip> using namespace std; struct data { string name; double amt; }; void getdata(data[], int); void displayreport(data[], int); void selectionsort...
TOOL
0.998995
4.383472
e08b713b-8329-425f-b910-f8efe1a7fb63
nguyenquyen1910/CPlusPlusPTIT
C++ PTIT/cpp0626.cpp
#include<bits/stdc++.h> using namespace std; class GiangVien{ public: string id,name,sub,mon,ln; GiangVien(){ id=name=sub=""; } friend istream& operator >> (istream&,GiangVien&); friend ostream& operator << (ostream&,GiangVien); friend bool check(GiangVi...
ALGO
0.999029
4.417733
dfa82815-dafd-4568-8126-c6c11ac77f25
Mohamed-Elsogher/Problem-solving
acmASCIS Level 1 Training '19/Week 4 Practice/D - Game.cpp
#include <bits/stdc++.h> using namespace std; #define all(v) v.begin(), v.end() #define pb push_back #define endl "\n" #define yes cout << "YES" #define no cout << "NO" #define sz(x) (x).size() #define ll long long void solve(){ int n , q ; cin >> n >> q ; vector<int> v(n); for(int i = 0 ; i < n ;++ i){ ...
ALGO
0.999982
4.917415
6996af76-9663-4601-8b39-ba7176f48bf5
Rafi-Shariar/XPSC
CLASS/binary search/upper_bound.cpp
#include<bits/stdc++.h> using namespace std; #define ll long long int //finding 1st occurrance of an element int main(){ int n; cin>>n; vector<int>a(n); for(int i=0; i<n; i++) cin>>a[i]; int x ; cin>>x; auto it = upper_bound(a.begin(), a.end(), x); int idx = it - a.begin(); // will return the inde...
ALGO
0.999669
5.387289
a4f380bd-fc20-449e-ac20-9a0a8fa14986
jubaerhosain/data-structures-and-algorithms
Graph Theory/Dijkstra Algorithm/Dijsktra's Algorithm(SSSP).cpp
/* 1. Works only if all edge weight is positive */ /* Dijkstra assumes monotonicity. Monotonicity means a function is either non-decreasing or non-increasing. ie: All positive edge or all negative edge. Graph must not contain negative weight cycle. cses: Longest Flight Route */ #include<bits/stdc+...
ALGO
0.999994
4.413836
240de1b6-9f3b-49b2-972b-746366581948
ishandutta2007/codeforces
rfpermen/normal/1208/D.cpp
#include<bits/stdc++.h> #pragma GCC optimize("O3") #pragma GCC target("tune=native") #pragma GCC optimize("unroll-loops") using namespace std; template<class A, class B> ostream& operator<<(ostream& os, const pair<A, B> &p) { os << '(' << p.first << ',' << p.second << ')'; return os; } template<class T> ostream...
ALGO
0.999997
3.572729
f94d296d-0a64-41ad-b24b-ec7e7a959e6f
Cambricon/catch
torch_mlu/csrc/aten/operators/cnnl/softmax.cpp
#include "aten/operators/cnnl/cnnl_kernel.h" #include "aten/operators/cnnl/internal/cnnl_internal.h" namespace torch_mlu { namespace cnnl { namespace ops { at::Tensor cnnl_softmax_common(const at::Tensor& input, int64_t dim, bool half_to_float, cnnlSoftmaxAlgorithm_t algo) { auto input_cont...
TOOL
0.931566
7.034663
4307744f-c149-44c8-9383-552155ccbe90
rishabhjain9196/Competitive-Programming
Code Flux/1.cpp
#include<bits/stdc++.h> using namespace std; int main() { long long int tt,n;char s[550]; char s2[550]; cin>>tt; while(tt--) { cin>>s; cin>>s2; for(int i=0;i<strlen(s);i++) { s[i]=tolower(s[i]); } for(int i=0;i<strlen(s2);i++) { ...
ALGO
0.999985
3.700181
48f9a492-fe77-4a6a-b122-2ae033e1041b
taejung2183/Algorithms
Programmers.co.kr/2021 Summer Coding/1_after_test.cpp
#include <iostream> #include <vector> #include <string> #include <map> using namespace std; vector<int> solution(string code, string day, vector<string> data) { vector<int> ans; map<string, string> timeAndPrice; string time, price; for (int i = 0; i < data.size(); ++i) { int codeIdx = data[i].find("code") + ...
ALGO
0.99325
4.552668
1d376334-8280-4d63-9b21-590b8ce8939d
Akshat0404/-100daysofcode
day83 burstballons.cpp
class Solution { public: int maxCoins(std::vector<int>& nums) { int n = nums.size(); nums.insert(nums.begin(), 1); nums.push_back(1); std::vector<std::vector<int>> dp(n + 2, std::vector<int>(n + 2, 0)); for (int len = 1; len <= n; ++len) { for (int i = 1; i <= n...
ALGO
0.99999
5.834795
e4cf33a1-390e-4c3a-b444-00167d47ed37
EliasFallah/object-oriented-programming
Prac_1/Task1_4.cpp
#include <iostream> #include <string> using namespace std; int main() { for(int i=1; i <= 10; i++){ for(int j=1; j <= 10; j++){ int result = j*i; cout << result; cout << " "; } cout << "\n"; } return 0; }
ALGO
0.998369
4.35696
8eb21866-f6ba-4a51-bd59-790114b3e7fa
hash1m0t0/atcoder
apg4b/chap01/abc048a.cpp
// https://atcoder.jp/contests/abc048/tasks/abc048_a #include <iostream> using namespace std; int main() { string A, B, C; cin >> A >> B >> C; cout << A[0] << B[0] << C[0] << endl; }
ALGO
0.9996
4.145488
2e7b3b81-5d41-453c-89cb-53912cb6a0a6
holequotin/Dynamic-Programing
move_the_pawn.cpp
//bài toán di chuyển quân tốt #include<bits/stdc++.h> using namespace std; void printTable(int n,int arr[][100]){ for(int i=1;i<=n;i++){ for(int j=1;j<=n;j++){ cout<<arr[i][j]<<" "; } cout<<endl; } } int main() { int n,m,arr[100][100]; //memset(arr,1,sizeof(arr)); for(int i=...
ALGO
0.999964
3.049646
dfe2d56a-7edf-4d69-b99d-6ece95f0557b
alstjd0921/Baekjoon
src/3078/3078.cpp14.cpp
#include <cstdio> #include <cstring> #include <queue> using namespace std; int main(int argc, const char *argv[]) { int N, K; long long result = 0; scanf("%d %d", &N, &K); queue<int> Q[21]; for (int i = 0; i < N; i++) { char name[21]; scanf("%s", name); int L = strlen(name); while (!Q[L].empt...
ALGO
0.994702
3.634454
a4f974ee-1ed2-47ed-b380-b68c90048001
guihunkun/LeetCode
669.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: TreeNode* trimBST(TreeNode* root, int L, int R) { if(root == NULL) re...
ALGO
0.999977
6.445542
d88689c3-e557-424c-b390-bef0f38787d9
SHY-Corp/LeetCode-Solutions
C++/13. Roman_To_Integer.cpp
/* program name:- Roman_To_Integer.cpp This program converts the entered roman number to integer . We have used the hash map to ease the input for the desired roman representation of an integer. */ int romanToInt(string s) { map<char, int> m = {{'I', 1}, {'V', 5},{'X', 10},{'L', 50}, {'C', 100...
ALGO
0.998962
5.600826
f34da8d2-041e-4e2e-9e1d-4a2b46a8a437
tuituji/6.837-MIT-CG
zero/vecmath/Matrix3f.cpp
#include "Matrix3f.h" #include <cassert> #include <cmath> #include <cstdio> #include <cstring> #include "Matrix2f.h" #include "Quat4f.h" #include "Vector3f.h" Matrix3f::Matrix3f( float fill ) { for( int i = 0; i < 9; ++i ) { m_elements[ i ] = fill; } } Matrix3f::Matrix3f( float m00, float m01, float m02, ...
TOOL
0.920992
7.075181
d259e64c-17d2-43a7-ac5f-f2a1edb65583
ashokabairwaideology/Leet-code-problem
solution/0600-0699/0686.Repeated String Match/Solution.cpp
class Solution { public: int repeatedStringMatch(string a, string b) { int m = a.size(), n = b.size(); int ans = (n + m - 1) / m; string t = ""; for (int i = 0; i < ans; ++i) t += a; for (int i = 0; i < 3; ++i) { if (t.find(b) != -1) return ans; ++ans;...
ALGO
0.999981
5.505599
1ac4bad0-7275-4bfd-87cc-a080675bb12b
lanbeilyj/Accerlerated-C-plus-plus
chapter08/8-2/Testify_the _templates_fun/remove_copy/remove_copy.cpp
#include <iostream> #include <vector> using namespace std; template <class In,class Out,class X> Out remove_copy(In begin,In end,Out dest,const X& x) { while(begin!=end) { if(*begin!=x) *dest++=*begin; ++begin; } return dest; } int main() { vector<int> v,v2; int n; ...
ALGO
0.999636
3.386298
3db60e66-b3c0-4292-a2ab-44172e0d4ba9
raincross7/code-similarity
codes/train_code/problem360/problem360_360.cpp
#include <bits/stdc++.h> using namespace std; template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return true; } return false; } template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return true; } return false; } int n; struct xydata { int x, y; }; bool cmp1 (const xydata &left, c...
ALGO
0.999548
4.68503
9952606b-f2de-492d-bd72-7bde5c8b63be
lemonofham/AUV
Coding/Codeforces/C++/first.cpp
#include <iostream> using namespace std; int main() { int n; cin>>n; bool valid = true; int lucky = 0; while(n > 0) { if(n % 10 == 4 || n % 10 == 7) lucky += 1; n /= 10; } while(lucky > 0) { if(lucky % 10 != 4 || lucky % 10 != 7) valid = false; lucky /= 10; } if(valid) cout<<"YES"; else co...
ALGO
0.999372
4.713834