uuid string | repo_name string | relative_path string | content string | category string | algo_rel_score float64 | quality_score float64 |
|---|---|---|---|---|---|---|
62709daf-54d7-4215-abdd-2f7922d77905 | pnthuc/C | 3-24120228/practice3.13/main.cpp | #include <iostream>
#include <string>
#include <algorithm>
#include <sstream>
bool isDescending(int n) {
std::string str = std::to_string(n);
for (size_t i = 1; i < str.size(); ++i)
if (str[i] > str[i - 1])
return false;
return true;
}
bool isSymmetric(int n) {
std::string str = std... | ALGO | 0.998165 | 5.435601 |
2a3a6e41-9512-4c8e-b913-9ecd75fc1d2d | amd48/Programacion-y-Estructuras-de-Datos | PED/p/p1/AYUDA/PRACTICAS 2017 (Tcomplejo)/PED 3/PRACTICA 2 jorge/lib/tabbcom.cpp | #include "tabbcom.h"
#include <queue>
TABBCom::TABBCom()
{
nodo = NULL;
}
TABBCom::TABBCom(const TABBCom &c)
{
if(c.nodo != NULL)
nodo = new TNodoABB(*c.nodo);
else
nodo = NULL;
}
TABBCom::~TABBCom()
{
if(nodo!=NULL)
{
delete nodo;
nodo=NULL;
}
}
TABBCom &TABBCom::operator=(const TABBCom &c)
{
if(thi... | ALGO | 0.984547 | 4.09522 |
402c1f84-db5e-4082-8318-cdea87fe6f5a | okuraofvegetable/AtCoder | atcoder.jp/abc045/abc045_b/Main.cpp | #include <bits/stdc++.h>
using namespace std;
typedef pair<int,int> P;
typedef long long ll;
typedef vector<int> vi;
typedef vector<ll> vll;
// #define int long long
#define pb push_back
#define mp make_pair
#define eps 1e-9
#define INF 2000000000 //2e9
#define LLINF 1000000000000000ll // 1e15
#define fi first
#defin... | ALGO | 0.999954 | 3.996961 |
3e289e26-6110-47c8-b874-1261a7ea2726 | OliverWayne007/CPP_Codes | olliePS-405.cpp | #include<bits/stdc++.h>
using namespace std;
typedef long long ll;
#define ull unsigned long long
#define flash() ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL);
const long long int MOD = 1e9 + 7;
const long long int INF = 1e18;
const long long int MAX = 1e9;
void Solution(ll T)
{
ll n , k;
cin... | ALGO | 0.99965 | 3.848835 |
e4372357-449c-4e36-8afe-90d58afc1db8 | ViceroyFaust/AdventOfCode2020 | Day5/BinaryBoardingP2.cpp | #include <algorithm>
#include <iostream>
#include <string>
#include <vector>
int main() {
std::vector<int> seats;
std::string input;
std::getline(std::cin, input);
do {
// All input is always 10 characters long
// First 7 characters are for rows; 3 are for cols
// 128 rows & 8 c... | ALGO | 0.99987 | 4.765924 |
e1e6e037-d5a9-4127-8f47-94bd7a34124b | nure-yevhentukubaiev/blackbox_flutter | windows/runner/utils.cpp | #include "utils.h"
#include <flutter_windows.h>
#include <io.h>
#include <stdio.h>
#include <windows.h>
#include <iostream>
void CreateAndAttachConsole() {
if (::AllocConsole()) {
FILE *unused;
if (freopen_s(&unused, "CONOUT$", "w", stdout)) {
_dup2(_fileno(stdout), 1);
}
if (freopen_s(&unuse... | TOOL | 0.9988 | 6.76073 |
57f01fae-3a0f-4aad-9a94-2c5289951d7b | hjiang13/LLMs-in-IR | POJ-104/55/399.cpp | #include <iostream>
using namespace std;
int main()
{
long int a,b,c,s,i,j,n,d[1000];
char t[10000];
cin >> "%d%s%d",&a,&t,&b);
s=0; c=1;
n=strlen(t);
for(i=n-1; i>=0; i--)
{
if (t[i]>='a'&&t[i]<='z') s=s+c*(t[i]-87);
if (t[i]>='A'&&t[i]<='Z') s=s+c*(t[i]-55);
if (t[i]>='0'&&t[i]<='9') s=s+c*(t[i]-'0');
c=c*a;
}
i=0;
i... | ALGO | 0.99986 | 3.041165 |
193ce41a-ebad-46a0-9a52-97d75e71531f | KaiTang2/LeetCode | LeetCodeProject/Question0001-1000/Question201-300/Question215/Question.cpp | #include"Question.h"
#include<algorithm>
int findKthLargest(vector<int>& nums, int k) {
sort(nums.begin(), nums.end(), [](int a, int b) {return a > b; });
return nums[k - 1];
}
int main()
{
vector<int> nums = { 3, 2, 3, 1, 2, 4, 5, 5, 6 };
cout << findKthLargest(nums, 4) << endl;
cout << "Press any ... | ALGO | 0.999908 | 4.145051 |
6269bea5-2f08-4c71-95d0-192a6e83add4 | sergiqz/Estructura-de-Datos | grafos/10004.cpp | #include <iostream>
#include <cstdio>
#include <vector>
using namespace std;
vector<vector<int> > G;
vector<int> color;
bool recolor(int u) {
for(auto v:G[u]) {
if(color[v] != 0 and color[v] == color[u]) {
return false;
}
if(color[v] == 0) {
if(color[u] == 1){
... | ALGO | 0.999404 | 4.544201 |
71ad0d84-cc8a-4f1f-88b7-d6a06b13ac5f | kai336/atcoder | practice/bootcampforbeginners/easy100/21.cpp | #include <bits/stdc++.h>
using namespace std;
int main(){
int x;
cin >> x;
int ans = x;
while(true){
bool isprime = true;
for(int i=2; i<ans; i++){
if(ans % i == 0){
isprime = false;
break;
}
}
if(isprime) brea... | ALGO | 0.999897 | 4.224134 |
a0ec4db3-0df9-473c-8876-a3a524b662db | carlosgalvezp/Udacity-Self-Driving-Car-Nanodegree | term3/projects/p1-path-planning/3rdparty/Eigen-3.3/unsupported/doc/examples/BVH_Example.cpp | #include <Eigen/StdVector>
#include <unsupported/Eigen/BVH>
#include <iostream>
using namespace Eigen;
typedef AlignedBox<double, 2> Box2d;
namespace Eigen {
Box2d bounding_box(const Vector2d &v) { return Box2d(v, v); } //compute the bounding box of a single point
}
struct PointPointMinimizer //how to compute squa... | ALGO | 0.999876 | 6.502348 |
d20e96ed-9041-4095-8ae8-69ef02593548 | SAURABH200301/MyCppCodes | QHEAP(hackerrank).cpp | #include<bits/stdc++.h>
using namespace std;
void deletee(priority_queue<int,vector<int>,greater<int>> p,priority_queue<int,vector<int>,greater<int>> q,int m){
while(!p.empty()){
if(p.top()!=m){
q.push(p.top());
p.pop();
}
}
p=q;
while(!q.empty()){
q.pop();
}
}
int main(){
int t;
cin>>t;
... | ALGO | 0.99983 | 4.10115 |
37802d6a-fabe-4930-9ba5-4415c1ba7eb7 | adityaverma0864/Mission-DSA | hackerrank/Samandsubstrings.cpp | #include <bits/stdc++.h>
const int mod = 1000000007;
using namespace std;
// Complete the substrings function below.
long substrings(string s) {
long n = s.length();
long sod[n];
sod[0] = s[0]-'0';
long res = sod[0];
for(long i=1; i<n; i++)
{
sod[i] = ((i+1) * (s[i]-'0') + ... | ALGO | 0.999884 | 5.29154 |
639a1332-d7d0-4f21-8f3d-16430798c925 | JaeKyungHeo/algorithm_practice_cpp | 2812.cpp | #include <iostream>
#include <vector>
using namespace std;
int main() {
int N, K, i = 0;
string num;
vector<char>v;
cin >> N >> K;
cin >> num;
while (i != num.size()) {
while (K != 0 && !v.empty() && v.back() < num[i]) {
v.pop_back();
K--;
}
v.push_back(num[i]);
i++;
}
// ذ ִٸ
while (K--)
... | ALGO | 0.99996 | 4.058448 |
82b37137-0dc5-4702-ae95-61b7001f6c86 | shubhampanchmukh/DSA_450_ARRAYS | 22_ARRAYS.cpp | #include<iostream>
using namespace std;
int main(){
int n,x=1;
cin>>n;
for (int i = 1; i < n; i++)
{
// n=n*(n-i);
x=x*(i+1);
}
cout<<x;
} | ALGO | 0.999868 | 3.831747 |
3b4f63db-e155-486a-b5ae-1f83001b3767 | DushyantBhardwaj07/CodeForces-DSA | C_Kefa_and_Park.cpp | #include<bits/stdc++.h>
using namespace std;
#define yes "YES"
#define no "NO"
#define ll long long
#define mod 1000000007
void display(vector<bool>v){ for(ll i=0;i<v.size();i++) cout<<v[i]<<' ';cout<<endl;}
void display(vector<ll>v){ for(ll i=0;i<v.size();i++) cout<<v[i]<<' ';cout<<endl;}
void display2d(vector<vector<... | ALGO | 0.999907 | 4.473653 |
f6b78d22-ef0e-4fe1-87af-191a71d30192 | Diegonava150/app_moviles | windows/runner/utils.cpp | #include "utils.h"
#include <flutter_windows.h>
#include <io.h>
#include <stdio.h>
#include <windows.h>
#include <iostream>
void CreateAndAttachConsole() {
if (::AllocConsole()) {
FILE *unused;
if (freopen_s(&unused, "CONOUT$", "w", stdout)) {
_dup2(_fileno(stdout), 1);
}
if (freopen_s(&unuse... | TOOL | 0.9988 | 6.76073 |
bd59ef51-dffc-40b0-b8bf-5ce1d268a492 | ishandutta2007/codeforces | fruwajacybyk/normal/776/E.cpp | #include <bits/stdc++.h>
#define FOR(i,a,b) for(int i=(a);i<(b);++i)
#define FORD(i, a, b) for(int i = (a); i >= (b); --i)
#define VAR(v, i) __typeof(i) v=(i)
#define FORE(i, c) for(VAR(i, (c).begin()); i != (c).end(); ++i)
#define all(v) (v).begin(),(v).end()
#define PII pair<int,int>
#define mp make_pair
#define ... | ALGO | 0.999987 | 3.899273 |
aa13c27a-d4fe-4fce-8b74-f5aaf15b40fb | abdulrayyan/Cryptography | Playfair(9).cpp | #include <stdio.h>
#include <string.h>
#include <ctype.h>
#define SIZE 5
// The Playfair Cipher Key matrix (for decryption)
char keyMatrix[SIZE][SIZE] = {
{'M', 'F', 'H', 'I', 'K'},
{'U', 'N', 'O', 'P', 'Q'},
{'Z', 'V', 'W', 'X', 'Y'},
{'E', 'L', 'A', 'R', 'G'},
{'D', 'S', 'T', 'B', 'C'}
};
// Fu... | ALGO | 0.999858 | 4.215702 |
02e5cbf8-6a1e-49e3-8c6b-abc87fd4c940 | Chambeador/Pollos-Primo | grafos/multliavabfs.cpp | #include <bits/stdc++.h>
using namespace std;
#define int long long
int n, m;
vector<pair<int, int>> monstruos;
vector<vector<int>> lava(1000 + 10, vector<int>(1000 + 10, INT_MAX));
pair<int, int> inicio, fin;
// 0 = U 1 = D 2 = R 3 = L
// Estos indices se usan para calc
vector<pair<int, int>> mov = { { -1, 0 }... | ALGO | 0.999975 | 5.03502 |
41f85b4b-8efa-4e2c-b0f0-d32ec9b244e7 | gim-largerepo/including-investment-59GB | web/professional.cpp | National lawyer teach that themselves upon.
Travel play foreign time federal purpose.
Involve organization modern follow while event upon.
West commercial mouth more wide away vote. | ALGO | 0.971461 | 7.447346 |
5882943a-8b83-4989-aef6-0b71d3b2e00a | pongsaphol/submission | Codeforces/577/B.cpp | #include <bits/stdc++.h>
#define long long long
#define P pair<int, int>
#define x first
#define y second
#define all(x) (x).begin(), (x).end()
#define input() (*istream_iterator<int>(cin))
using namespace std;
void red() {
#ifdef INPUT
freopen("r", "r", stdin);
#endif
cin.sync_with_stdio(false);
}
bool chk[2][1... | ALGO | 0.999996 | 4.131872 |
431248c5-7071-4331-99dd-19442fc2d2c9 | sarvex/leetcode-elvish | solution/0200-0299/0217.Contains Duplicate/Solution.cpp | class Solution {
public:
bool containsDuplicate(vector<int>& nums) {
unordered_set<int> s(nums.begin(), nums.end());
return s.size() < nums.size();
}
}; | ALGO | 0.999695 | 6.144969 |
ec5e031c-ca52-4da8-b179-5c0a0dbde6c9 | walkccc/LeetCode | solutions/3043. Find the Length of the Longest Common Prefix/3043.cpp | struct TrieNode {
vector<shared_ptr<TrieNode>> children;
TrieNode() : children(10) {}
};
class Trie {
public:
void insert(const string& word) {
shared_ptr<TrieNode> node = root;
for (const char c : word) {
const int i = c - '0';
if (node->children[i] == nullptr)
node->children[i] = m... | ALGO | 0.999932 | 6.288014 |
6ea0ac67-dafb-4f42-b154-9b22492e00fe | jnulzl/caffe_plus | src/caffe/layers/softmax_layer.cpp | #include <algorithm>
#include <vector>
#include "caffe/layers/softmax_layer.hpp"
#include "caffe/util/math_functions.hpp"
namespace caffe {
template <typename Dtype>
void SoftmaxLayer<Dtype>::Reshape(const vector<Blob<Dtype>*>& bottom,
const vector<Blob<Dtype>*>& top) {
softmax_axis_ =
bottom[0]->Canon... | DATA | 0.931807 | 7.647714 |
d7165c95-0c4b-498c-8e1c-3638f8335607 | zubayer-47/cs-fundamentals | Doubly_linkedlist/doubly_linkedlist_insert_at_any_position.cpp | #include <bits/stdc++.h>
using namespace std;
class Node
{
public:
int val;
Node *next;
Node *prev;
Node(int val)
{
this->val = val;
this->next = NULL;
this->prev = NULL;
}
};
void print_linkedlist(Node *head)
{
Node *temp = head;
while (temp != NULL)
{
... | ALGO | 0.999868 | 4.543133 |
e8e0cbce-7910-49d6-8a0b-164ad8484714 | shaikhikram04/DSA-with-Cpp | Array/alternative_swaping.cpp | #include <iostream>
using namespace std;
void printarray(int arr[], int size)
{
for (int i = 0; i < size; i++)
{
cout << arr[i] << " ";
}
cout << endl;
}
void swap_alternate(int arr[], int size)
{
for (int i = 0; i<size || (i + 1) < size - 1; i += 2)
{
swap(arr[i], arr[i + 1]);
}
}
int main()
{
int num[... | ALGO | 0.99983 | 4.328594 |
2364d39c-93f6-404f-a08e-e6126d084e18 | gancerlory/LeetCode | Medium/Successful_Pairs_of_spells_and_potions.cpp | /*
2300. Successful Pairs of Spells and Potions
Medium
You are given two positive integer arrays spells and potions, of length n and m respectively, where spells[i] represents the strength of the ith spell and potions[j] represents the strength of the jth potion.
You are also given an integer success. A spell and pot... | ALGO | 0.999904 | 6.164287 |
772cf871-b7a6-4cda-9d9d-92a96c3c5aa3 | shishirRsiam/My-Solve | All Solve/B_Drinks.cpp | #include<bits/stdc++.h>
#define str string
#define ll long long
#define pi pair<ll,ll>
#define vec vector<ll>
#define py cout<<"YES\n"
#define pn cout<<"NO\n"
#define pb(x) push_back(x)
#define bee(x) x.begin(), x.end()
#define loop(s,i,n) for(int i=s;i<n;i++)
using namespace std;
int main()
{
ios::sync_with_stdi... | ALGO | 0.997459 | 3.912548 |
0835a031-c201-4060-9bf3-58dbb87cd8b2 | golaced/RL_Boy | 下位机代码/Linux/control_task2/math_src/ankle.cpp | /*=========== ***doc description @ yyp*** ===========
踝关节中心为原点,z指向膝,先左后右
=====================================================*/
#include"ankle.h"
// #define AnkTest
#ifdef AnkTest
#include"iopack.h"
#else
#include<iostream>
using namespace std;
#define For2 for(int i(0);i!=2;++i)
#define For(x) for(int i(0);i!=x;++i... | ALGO | 0.875565 | 3.03466 |
174a853c-7a77-48fb-b645-55fff0135cc7 | Bastler1971/Artillery-Sidewinder-X1 | Marlin Firmware/official_marlin/Marlin 2.1.1/Marlin-2.1.1/Marlin/src/feature/meatpack.cpp | /**
* MeatPack G-code Compression
*
* Algorithm & Implementation: Scott Mudge - <EMAIL>
* Date: Dec. 2020
*
* Character Frequencies from ~30 MB of comment-stripped G-code:
* '1' -> 4451136 '4' -> 1353273 '\n' -> 1087683 '-' -> 90242
* '0' -> 4253577 '9' -> 1352147 'G' -> 1075806 'Z' -> 34... | TOOL | 0.974926 | 5.899114 |
cbf8db9f-aee8-435b-b089-b3b8aaf51947 | Linglingyu/practice_C- | practice_octal/practice_octal/源.cpp | #include <iostream>
using namespace std;
int main(){
int num;
while (cin >> num){
cout << oct << num << endl;
};
system("pause");
return 0;
} | TOOL | 0.951129 | 4.342092 |
7b285dbf-bbc2-4e90-ba81-7f5d46104cc7 | KDABLabs/qt-flutter-embedder | examples/default_counter_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);
}
... | TOOL | 0.998887 | 6.694125 |
997266c9-355a-4b2e-996a-ad745884c6c3 | SungHunYoon/Advent_of_Code_2024 | day15/puzzle2.cpp | #include <iostream>
#include <vector>
#include <algorithm>
using namespace std;
using ii = pair<int, int>;
vector<vector<char>> A;
ii R;
char dc[] = {'^', 'v', '<', '>'};
int dx[] = {-1, 1, 0, 0};
int dy[] = {0, 0, -1, 1};
int findDir(char c) {
int ret = -1;
for (int i = 0; i < 4; i++)
if (c == dc[i])
ret = i... | ALGO | 0.993509 | 4.242959 |
2fb565a3-85d9-4c38-a563-b22f6908aa69 | dizzy2003/MuckyFoot-UrbanChaos | fallen/Editor/Source/EdUtils.cpp | // EdUtils.cpp
// Guy Simmons, 5th April 1997
#include "Editor.hpp"
#include "c:\fallen\headers\animtmap.h"
#include "c:\fallen\headers\memory.h"
extern SLONG key_frame_count,current_element;
extern SLONG x_centre,
y_centre,
z_centre;
extern struct KeyFrameChunk *test_chunk;
//---------------... | TOOL | 0.851966 | 3.518361 |
abcf6b25-6d05-4596-a47b-6c667822528e | hjue/flutter_markdown | example/windows/runner/utils.cpp | #include "utils.h"
#include <flutter_windows.h>
#include <io.h>
#include <stdio.h>
#include <windows.h>
#include <iostream>
void CreateAndAttachConsole() {
if (::AllocConsole()) {
FILE* unused;
if (freopen_s(&unused, "CONOUT$", "w", stdout)) {
_dup2(_fileno(stdout), 1);
}
if (freopen_s(&unuse... | TOOL | 0.998751 | 6.805244 |
2011fc77-0118-47fc-bc03-e9010ad634f6 | Ayman-Sedik/CPP.EDU | C++ Programs/Tic Tac Toe Game/main.cpp | #include <iostream>
#include<stdlib.h>
using namespace std;
char Matrix[3][3] = { '1','2','3','4','5','6','7','8','9' };
char Player = 'X';
void Print()
{
system("cls");
for (int i = 0; i < 3; i++)
{
for (int j = 0; j < 3; j++)
{
cout << "\t" << Matrix[i][j] << "|" << " ";
}
cout << endl;
cout << "\t" <... | ALGO | 0.99033 | 3.314183 |
f8d239b9-078c-447f-b125-2f842bf198b3 | oxygen-hunter/Flashboom | data/big-vul-100/add_attention_code/MixtralExpert/top0-100/create-binary-tree-from-descriptions-Solution.createBinaryTree/177874_Exec_Code_Overflow.cpp | void aes_crypt_ecb( aes_context *ctx,
int mode,
const unsigned char input[16],
unsigned char output[16] )
{
int i;
unsigned long *RK, X0, X1, X2, X3, Y0, Y1, Y2, Y3;
#if defined(XYSSL_PADLOCK_C) && defined(XYSSL_HAVE_X86)
if( padlock_supports( PAD... | ALGO | 0.998714 | 6.817576 |
996326e0-598c-4483-9c06-1c8ac5b06998 | hmpalmeida/cluster-eval | matrix.cpp | #include <iostream>
#include <fstream>
#include <string.h>
#include <vector>
/**********************************************************************
* TYPEDEFS
**********************************************************************/
typedef unsigned int uint;
/**Make a N x N matrix.
*
* Care must be taken free'in... | TOOL | 0.917745 | 4.209729 |
efdf217d-e6b9-48f9-84bd-d2ced5aac8d5 | artiam99/GeeksforGeeks | 10 Dynamic Programming/2 Intermediate Problems/19 Tile Stacking Problem.cpp | #include<bits/stdc++.h>
using namespace std;
int NoofWays(int n,int m,int k)
{
int dp[m+1][n+1] , pref[m+1][n+1];
for(int i=0;i<=m;i++)
{
for(int j=0;j<=n;j++)
{
if(j==0) dp[i][j] = pref[i][j] = 1;
else if(i==0) dp[i][j] = pref[i][j] = 0;
else
{
dp[i][j] = pref[i-1][j];
if(j>... | ALGO | 0.999988 | 4.018508 |
6f45d139-36a1-4eee-a16c-630a7a91d7e4 | codeninja404/LeetCode_CPP | 227. Basic Calculator II.cpp | // Lambda
class Solution {
private:
unordered_map<char, function<int(int,int)>>m {{'+', [](int a, int b){ return a + b ;}},
{'-', [](int a, int b){ return a - b ;}},
{'*', [](int a, int b){ return a * b ;}},
... | ALGO | 0.99998 | 5.37404 |
180c12df-dd4e-4089-91bb-16c17cc9c879 | KayG2310/learning-cpp | DSA sheet/DP/MCM or Partition/burst balloons.cpp | // recursive tc = exponential
class Solution {
private:
int f(int i, int j, vector<int>&nums){
if(i>j) return 0; // no subproblem
int maxi = INT_MIN;
for(int ind=i; ind<=j; ind++){
int coins = nums[i-1]*nums[ind]*nums[j+1] + f(i, ind-1, nums)+f(ind+1, j, nums);
maxi =... | ALGO | 0.999997 | 5.874752 |
d7ec20c4-f68d-449a-8845-03583506d550 | 2021-dev/8888888 | contrib/citext/citext.cpp | /*
* contrib/citext/citext.c
*/
#include "postgres.h"
#include "knl/knl_variable.h"
#include "access/hash.h"
#include "catalog/pg_collation.h"
#include "utils/builtins.h"
#include "utils/formatting.h"
#ifdef PG_MODULE_MAGIC
PG_MODULE_MAGIC;
#endif
/*
* ====================
* FORWARD DECLARATIONS
* ==========... | TOOL | 0.954647 | 6.241279 |
6af744f2-40b7-4bc3-b5d0-0453af246a4f | muhammadhasan01/cp | Online Judge/Kokocoder/practice-dp-classical/I2.cpp | #include <bits/stdc++.h>
using namespace std;
int main() {
ios_base::sync_with_stdio(0);
cin.tie(0);
cout.tie(0);
int n, x;
cin >> n >> x;
vector<int> h(n);
for (int i = 0; i < n; i++) {
cin >> h[i];
}
vector<int> s(n);
for (int i = 0; i < n; i++) {
cin >> ... | ALGO | 0.999952 | 4.0415 |
79655653-b225-45d3-a2ea-e11fc501d31a | JayexDesigns/code-training | jutge/bases/P19564.cpp | #include <iostream>
using namespace std;
int valencia(int n) {
int oddSum = 0;
int evenSum = 0;
int current = 1;
while (n > 0) {
if (current % 2 == 0) evenSum += n%10;
else if (current % 2 != 0) oddSum += n%10;
n /= 10;
++current;
}
int substraction = oddSum - e... | ALGO | 0.999823 | 5.584012 |
74ffbad6-9c91-4b40-837f-623aebe371f5 | actium/codeforces | 0000/90/96b.cpp | #include <algorithm>
#include <iostream>
#include <string>
using integer = unsigned long long;
void answer(const integer v)
{
std::cout << v << '\n';
}
void solve(unsigned n)
{
for (std::string t = "47"; ; t = '4'+t+'7') {
do {
const integer z = std::stoull(t);
if (z >= n)
... | ALGO | 0.998329 | 4.667336 |
ac830b33-136e-457d-bfb8-6d20202be7ae | jun-pac/PS | 240430/2set/E.cpp |
#include <bits/stdc++.h>
using namespace std;
#define fi first
#define se second
#define cediv(a,b) ((a)%(b)==0?((a)/(b)):((a)/(b))+1)
#define rng(i,a,b) for(int i=int(a);i<=int(b);i++)
#define rep(i,b) rng(i,0,b-1)
#define gnr(i,b,a) for(int i=int(b);i>=int(a);i--)
#define per(i,b) gnr(i,b-1,0)
#define pb push_back... | ALGO | 0.999963 | 5.509446 |
08e84d92-8632-4d6b-910b-6a1b5bf9bc57 | Shitaibin/leetcode-2016 | 62.UniquePaths.cpp | class Solution {
public:
int uniquePaths(int m, int n) {
vector<int> v(n,1);
vector<vector<int>> grid(m, v);
for (int i = 1; i < m; i++) {
for (int j = 1; j < n; j++) {
grid[i][j] = grid[i-1][j] + grid[i][j-1];
}
}
return g... | ALGO | 0.999945 | 6.623559 |
10047fbe-f3be-4c9d-a276-b9e17306910c | nikolastulovic/PracticumOOP-ETF-Spreadsheet-program | C++/Formula.cpp | #include "Formula.h"
#include <stack>
#include "Table.h"
//checking if char in operator
bool Formula::isOperator(char c) {
return (c == '+' || c == '-' || c == '*' || c == '/');
}
//operation execution
double Formula::performOperation(char operation, double operand1, double operand2) {
switch (operation) {
... | ALGO | 0.999073 | 4.377633 |
595fbbfb-f238-450b-bc1f-44229173d48f | MaitreChen/PAT-Practice | Basic_level/1099性感素数.cpp | #include<iostream>
#include<cmath>
using namespace std;
bool isPrime(int n) {
if (n < 2) return false;
else if (n == 2) return true;
else if (n % 2 == 0) return false;
for (int i = 3; i<int(sqrt(n)) + 1; i++) {
if (n % i == 0) return false;
}
return true;
}
bool issex(int n) {
if (isPrime(n) && (isPrime(n - ... | ALGO | 0.99995 | 3.556818 |
359c08fb-a3b7-4659-9216-27b3fb3c6f43 | raincross7/code-similarity | codes/train_code/problem414/problem414_100.cpp | //%std
#include<iostream>
#include<cstdio>
#include<cstdlib>
#include<cstring>
#include<string>
#include<algorithm>
#include<cmath>
#include<vector>
#include<queue>
#include<stack>
#include<set>
#include<map>
using namespace std;
#define lovelive long long
#define lc son[x][0]
#define rc son[x][1]
#define lowbit(x) (x&... | ALGO | 0.999991 | 3.954768 |
a4956d5d-f98b-4d15-bdb8-486ffa15c6e9 | esl-epfl/xheep_matrix_spec | llvm-project/libc/test/src/stdlib/qsort_r_test.cpp | #include "src/stdlib/qsort_r.h"
#include "test/UnitTest/Test.h"
#include <stdlib.h>
static int int_compare_count(const void *l, const void *r, void *count_arg) {
int li = *reinterpret_cast<const int *>(l);
int ri = *reinterpret_cast<const int *>(r);
size_t *count = reinterpret_cast<size_t *>(count_arg);
*cou... | TEST | 0.874833 | 7.422245 |
c373d5ae-19e9-4f3b-a501-f6fee039930e | branyang02/Panda_Robot_AprilTag | catkin_ws/src/apriltag_ros/apriltag_ros/src/common_functions.cpp | #include "apriltag_ros/common_functions.h"
#include "image_geometry/pinhole_camera_model.h"
#include "common/homography.h"
#include "tagStandard52h13.h"
#include "tagStandard41h12.h"
#include "tag36h11.h"
#include "tag25h9.h"
#include "tag16h5.h"
#include "tagCustom48h12.h"
#include "tagCircle21h7.h"
#include "tagCirc... | TOOL | 0.920352 | 7.188064 |
0cdd2cd1-101c-404f-b3c9-d12e93285e9e | Oris482/BaekJoon | 2588/2588_2.cpp | #include <iostream>
#include <string>
#include <math.h>
using namespace std;
int main(void) {
int first;
string second;
int result = 0;
cin >> first;
cin >> second;
for(string::size_type i = 0; i < second.length(); ++i) {
const char c = second[second.length() - i - 1];
int mid... | ALGO | 0.999304 | 4.528244 |
43c26093-0e62-4e08-97a9-7ef7bf680c0f | Henrik-Yao/NEUQ-ACM-Solution | week5/卢晨昕/7-2 哥德巴赫最新猜想.cpp | #include<bits/stdc++.h>
#define ll long long
#define inf 0x3f3f3f3f
using namespace std;
int n;
bool prime(ll x)
{
for(ll i=2;i<=sqrt(x);i++)
{
if(x%i==0)return false;
}
return true;
}
int main()
{
cin>>n;
for(ll i=1;i<=n;i++)
{
ll a;
cin>>a;
if(a%2==0)
{
if(i!=n)cout<<"2"<<endl;
else cout<<"2";
... | ALGO | 0.999943 | 3.527839 |
47c0ddae-caeb-43e8-ad72-75d1bc3f6c2f | hanktank0704/acDynamicProgram | week4/1958lcs3.cpp | #include <iostream>
using namespace std;
string a;
string b;
string c;
int d[101][101][101];
int main(){
// freopen("input.txt", "r", stdin);
// freopen("output.txt", "w", stdout);
cin >> a;
cin >> b;
cin >> c;
a = ' ' + a;
b = ' ' + b;
c = ' ' + c;
int al = a.length();
int bl = ... | ALGO | 0.999849 | 4.267615 |
1ec9c683-f68c-4403-a7e1-9830e36104a0 | giabach1106/cp | 2022/haivai.cpp | #include <bits/stdc++.h>
#define ll long long
using namespace std;
const int maxn = 1000 ;
int A[maxn],B[maxn];
ll n,H;
void file(){
freopen(".INP","r",stdin);
freopen(".OUT","w",stdout);
}
int main(){
ios_base::sync_with_stdio(false);
cin.tie(0); cout.tie(0);
//file();
cin >> n >> H;
ll ans = 0;
for(int i=0... | ALGO | 0.999764 | 3.667213 |
115a1b48-d20e-4e92-a706-f37d84d739ac | Usman-B-Faisal/Programming-Fundamentals | Assignment 2/Q5.cpp | // Question 5
#include <iostream>
using namespace std;
int main()
{
int num, even, odd;
even=0;
odd=0;
cout<<"Enter a Number: ";
while (num!=-1)
{
cin>>num;
if((num%2)==0)
{even=even+1;}
else {odd=odd+1;}
}
cout<<"even: "<<even<<endl;
cout<<"odd: "<... | ALGO | 0.995436 | 3.816949 |
dd032b24-e903-47ce-a14c-33f5c396199d | dicpic/Practical | Программирование 1.Простой вывод.cpp | // Программирование 1.Простой вывод.cpp : Этот файл содержит функцию "main". Здесь начинается и заканчивается выполнение программы.
//
#include <iostream>
#include <conio.h>
int main()
{
setlocale(LC_ALL, "Russian");
int n = 2 + 2 * 2;
std::cout << "Результат вычисления выражения 2+2*2="<< n;
_getch();
}
| ALGO | 0.975619 | 3.02036 |
9461c581-4ca6-4f96-ad95-572e69a1e164 | Bigphess/Wizard | source/main.cpp |
#define GLFW_INCLUDE_GLU
#include <GLFW/glfw3.h>
#include <iostream>
#include <iomanip>
#include <opencv2/core.hpp> // include OpenCV core headers
#include <opencv2/imgproc.hpp> // include image processing headers
#include <opencv2/highgui.hpp> // include GUI-related headers
#include "PoseEstimation.h"
#include... | TOOL | 0.904536 | 3.767111 |
e29b98ac-eac7-42b3-8046-637a2c299d4c | ul88/problem-solving | Silver II/1912 연속합.cpp | #include<iostream>
#include<vector>
using namespace std;
int main()
{
vector <int> v;
vector <int> presum;
presum.push_back(0);
int N;
cin>>N;
for(int i=0,a;i<N;i++){
cin>>a;
v.push_back(a);
presum.push_back(presum[i]+v[i]);
}
int ans=presum[1];
int Min=presum[1];
for(int i=2;i<=N;i++){
ans=max(ans,pr... | ALGO | 0.999942 | 3.499188 |
d21f88c9-24fb-4b52-8f86-945f9259931c | tridibsamanta/CodeChef_Solutions | Practice/S03E02.cpp | /*
~ Author : @tridib_2003
*/
#pragma GCC optimize("O3")
// #pragma GCC optimize("Ofast")
// #pragma GCC target("avx,avx2,fma")
#include<bits/stdc++.h>
using namespace std;
#include <ext/pb_ds/assoc_container.hpp>
using namespace __gnu_pbds;
typedef tree<int, null_type, less<int>, rb_tree_tag,
tree_... | ALGO | 0.999835 | 4.849127 |
47c1f7b8-7da9-44e4-b9ed-2e53d7ae0c7d | amansinghsoft/cpp_programming | quadratic.cpp | // To find the root of quadratic equation of one variable.
#include <iostream>
#include <math.h>
using namespace std;
int main()
{
float a,b,c,d,e,f;
cout<<"enter the values of number:";
cin>>a>>b>>c;
d=b*b-4*a*c; //d=discriminant
if(d>0)
{
e=(-b + sqrt(d)) / (2 * a);
f=(-b - sqrt(d)) / (2 * a);
... | ALGO | 0.999607 | 3.300738 |
90511055-7364-4f94-9ac3-4066683f2845 | ijozic1/Algoritmi-i-strukture-podataka | Zadaca/Zadaca4/avl.cpp | #include <cstdlib>
#include <ctime>
#include <iomanip>
#include <iostream>
#include <list>
#include <string>
#include <utility>
#include <cmath>
using namespace std;
template <typename TipKljuca, typename TipVrijednosti>
class Mapa {
public:
virtual ~Mapa() {}
virtual TipVrijednosti& operator[](const TipKljuc... | ALGO | 0.979559 | 4.082107 |
2bb5a946-0b58-4d62-8b2b-571f9cb379d6 | 11yashpratapsingh/Leetcode-GeeksforGeeks | Array Subset of another array - GFG/array-subset-of-another-array.cpp | //{ Driver Code Starts
#include <bits/stdc++.h>
using namespace std;
string isSubset(int a1[], int a2[], int n, int m) ;
int main() {
int t;
cin >> t;
while (t--) {
int n, m;
cin >> n >> m;
int a1[n], a2[m];
for (int i = 0; i < n; i++) {
cin >> a1[i];
... | ALGO | 0.999951 | 5.95807 |
f034d887-99fc-4904-a669-13b067cfcb91 | falcaoanderson/CompetitiveProgramming | new-CSES/cses-1751.cpp | // 14/07/23 //
#include <iostream>
#include <algorithm>
#include <vector>
#include <queue>
#include <set>
#include <unordered_set>
#include <map>
#include <unordered_map>
#include <tuple>
#include <cstring>
#include <stack>
using namespace std;
#define ll long long
#define endl "\n"
#define fast_io ios_base::sync_wit... | ALGO | 0.999849 | 4.113028 |
bdc3b2ae-04c6-4510-9f63-55293547d300 | zhouyuhaoat/LeetCode | 1.basic/5.stack/1.path/71.简化路径-2.cpp | /*
* author: zhouyuhao
* created: 2025-03-02 13:48:48
* modified: 2025-03-02 14:29:15
* project: LeetCode of labuladong
* venue: 914, Harbin
*/
/*
* @lc app=leetcode.cn id=71 lang=cpp
*
* [71] 简化路径
*/
// @lc code=start
#include <ranges>
class Solution {
public:
string simplifyPath... | ALGO | 0.999833 | 6.404695 |
18da8a62-a776-4a07-93fc-e507f531c8e5 | iampreetsimar/dsa-practice | 18. Challenges - Bitmasking/4. countSetBits.cpp | #include <iostream>
using namespace std;
int main() {
// your code goes here
int t;
cin >> t;
while(t--) {
int num;
cin>> num;
int res = 0;
while(num) {
num = (num & (num - 1));
res++;
}
cout<<res<<endl;
}
... | ALGO | 0.999832 | 4.932423 |
40ac7276-5f5f-439f-bc4d-90669d56be71 | therahulkumar9/data-structures-and-algorithms | strings/problems/easy/reverse_string.cpp | #include <iostream>
#include <vector>
using namespace std;
class Solution {
public:
void reverseString(vector<char>& s) {
int i = 0;
int j = s.size() - 1;
// Swap elements until i meets j
while (i < j) {
char temp = s[i];
s[i] = s[j];
... | ALGO | 0.999325 | 6.093773 |
2640b4f1-2e89-4fb7-9563-1eb332a4569b | Vit7Z/origin | 03_alg_and_struct_data/03_task_0303/03_task_033.cpp | #include <iostream>
#include <fstream>
#include <string>
#include <clocale>
#include <locale.h>
void count_sort(int* arr, int sizeArr) {
int min = 10;
int max = 24;
int* tempArr{ new int[max + 1 - min] {0} };
for (int i = 0; i < sizeArr; i++) {
tempArr[arr[i] - min] = tempArr[arr[i] - min] + 1;
}
int i ... | ALGO | 0.99018 | 4.345641 |
b58c18c7-d425-4cd8-a6ba-29caf06f5245 | miguelAlessandro/CompetitiveProgramming | UVA/10474.cpp | #include <bits/stdc++.h>
using namespace std;
int n, m;
vector<int> v;
int main(){
int nc = 1;
while(scanf("%d %d", &n, &m), n + m){
v.resize(n);
for(int i = 0; i < n; ++i)
scanf("%d", &v[i]);
sort(v.begin(), v.end());
printf("CASE# %d:\n", nc++);
... | ALGO | 0.999565 | 4.173145 |
81256848-0ddf-4770-b48e-6898998fbb3b | ChapterM/UVA_code | ch5/5-7_Printer_Queue.cpp | #include <iostream>
#include <queue>
using namespace std;
// жǷڸ
bool First(queue<int> q, int t);
int main()
{
// ض
freopen("../../in.txt", "r", stdin);
freopen("../../out.txt", "w", stdout);
int T;
cin >> T;
while (T--)
{
// ȡ
int n, m;
cin >> n >> m;
que... | ALGO | 0.999896 | 4.448583 |
999b9237-84dd-4ff1-b509-cc05adb217dd | ishandutta2007/codeforces | unstoppablechillmachine/normal/859/A.cpp | #include <bits/stdc++.h>
using namespace std;
typedef long double ld;
typedef long long ll;
typedef unsigned long long ull;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;
typedef vector<ll> vll;
typedef vector<ull> vull;
typedef vector<vll> vvll;
typedef vector<int> vi;
typedef vector<vi> vvi;
typedef vector<p... | ALGO | 0.994101 | 3.443379 |
9655a23a-61ac-4523-bf25-e393253ac8ee | ishandutta2007/codeforces | rowdark/normal/627/A.cpp | #include<stdio.h>
#include<iostream>
using namespace std;
long long dp[2][2];
int main(){
long long s,x;
cin>>s>>x;
long long sub=0;
if(s==x) sub=2;
dp[0][0]=1;
int n1=0,n2=1;
for(int i=0;i<60;++i){
for(int a=0;a<2;++a) for(int b=0;b<2;++b) if((a^b)==(x&1)){
for(int c=0;c<2;++c){
if(((a+b+c)&1)==(s&1)){... | ALGO | 0.999855 | 3.315964 |
be6dcefb-a862-4de8-abac-17024db88989 | blackout-yash/LeetCode | 802-find-eventual-safe-states/802-find-eventual-safe-states.cpp | class Solution {
public:
vector<int> eventualSafeNodes(vector<vector<int>> &graph) {
int n = graph.size();
vector <vector <int>> rgraph(n);
for(int i = 0; i < n; i++){
for(auto child: graph[i]) rgraph[child].push_back(i);
}
vector <int> inorder(n), ans;
... | ALGO | 0.999997 | 5.873202 |
a9e15301-97e4-4b0a-b9f9-13f3fc073cfa | MostakemHossain/Stack_-_Queue | insertAtButtom.cpp | #include <iostream>
#include <stack>
using namespace std;
// naive T.C---O(n):: S.C---O(n)
void insertAtButtom(stack<int> &input, int x)
{
stack<int> temp;
while (!input.empty())
{
temp.push(input.top());
input.pop();
}
input.push(x);
while (!temp.empty())
{
input.... | ALGO | 0.999957 | 5.244902 |
69858139-a4c2-4b39-a5d0-5a211a892a71 | adityarawat1337x/DSA | 705-design-hashset/705-design-hashset.cpp | class MyHashSet {
public:
int n = 1000001;
vector<int> def;
MyHashSet() {
def.resize(n,0);
}
void add(int key) {
def[key]=1;
}
void remove(int key) {
def[key]=0;
}
bool contains(int key) {
return def[key];
}
};
/**
* Your MyHashSet ... | ALGO | 0.999515 | 5.210715 |
e95531be-f063-4ff5-adb4-43de6d56e87f | carbonfish/Algorithm-1 | OJ/cccc/L2-019. 悄悄关注.cpp | #include<bits/stdc++.h>
using namespace std;
map<string,int>Ac;
map<string,int>::iterator it;
char Val[8];
int main(){
int N,M,k;
scanf("%d%*c",&N);
while(N--){
scanf("%s%*c",Val);
Ac[Val]=-1;
}
int Sum=0;
scanf("%d%*c",&M);
int m=M;
while(M--){
scanf("%s %d%*c",Val,&k);
Sum+=k;
if(Ac[Val]!=-1){
Ac... | ALGO | 0.99996 | 3.44376 |
f7c9c4dd-df88-4fb6-ab66-3c4a4021a1ca | rohithvijayan774/Ipix_test | windows/runner/utils.cpp | #include "utils.h"
#include <flutter_windows.h>
#include <io.h>
#include <stdio.h>
#include <windows.h>
#include <iostream>
void CreateAndAttachConsole() {
if (::AllocConsole()) {
FILE *unused;
if (freopen_s(&unused, "CONOUT$", "w", stdout)) {
_dup2(_fileno(stdout), 1);
}
if (freopen_s(&unuse... | TOOL | 0.9988 | 6.76073 |
13da630c-2c48-45c4-b441-4bb7fba26e18 | Jordanyang/MyColorProcessing | 20170422/ColorProcessing/useful/Write_Data_To_File.cpp | #include<iostream>
#include<fstream>
#include<vector>
/*
filename1 Ҫдļ
//times Ҫдļֵı
*/
void save_to_text(std::string filename1, std::vector<double> &p)
{
using namespace std;
fstream outfile;
string tempfilenanme = filename1;
outfile.open(tempfilenanme, ios::out | ios::trunc);
for (auto i = 0; i < p.size(); ... | TOOL | 0.873489 | 3.301991 |
3d785dee-a0cf-4ce4-8031-4566f169cac2 | fr3ak2402/GalaxySlicer | src/libigl/igl/polar_svd3x3.cpp | template<typename Mat>
IGL_INLINE void igl::polar_svd3x3(const Mat& A, Mat& R)
{
// should be caught at compile time, but just to be 150% sure:
assert(A.rows() == 3 && A.cols() == 3);
Eigen::Matrix<typename Mat::Scalar, 3, 3> U, Vt;
Eigen::Matrix<typename Mat::Scalar, 3, 1> S;
svd3x3(A, U, S, Vt);
R = U * ... | ALGO | 0.983967 | 6.992301 |
a4b712b6-c335-4018-96de-d879bf01aa7f | tushxr12/leetcode-probs | Daily Problems/2900. Longest Unequal Adjacent Groups Subsequence I.cpp | class Solution {
public:
vector<string> getLongestSubsequence(vector<string>& words, vector<int>& groups) {
int n = words.size();
vector<string> ans;
for(int i = 0;i < n;i++)
{
if(i == 0 || groups[i] != groups[i - 1])
ans.push_back(words[i]);
}
... | ALGO | 0.999962 | 5.946537 |
9c3e274c-6ae4-4dc3-887d-27ad3097408c | ArifAhmed120829/ProblemSolving-CPP- | SoldierandBananas.cpp |
#include <iostream>
using namespace std;
int main() {
int k;//the cost of the first banana
int n;//number of dollars
int w;//number of banana he wants
cin>>k;
cin>>n;
cin>>w;
int sum = 0;
for(int i =1; i<=w; i++){
sum = sum + (k*i);
}
int result = sum - n;
if(resul... | ALGO | 0.99922 | 3.475384 |
4a681282-1289-4caa-85e4-fae9062bca66 | StartAt24/leetcode | basic_data_structure/array/974_subarrays_div_by_k.cpp | #include "common.hpp"
class Solution {
public:
int subarraysDivByK(vector<int>& nums, int k) {
int pre_sum = 0;
int n = nums.size();
int ret = 0;
unordered_map<int, int> umap;
for (int i = 0; i < n; i++) {
pre_sum += nums[i];
int reminder = pre_sum % ... | ALGO | 0.999561 | 5.804644 |
14167034-c616-43d0-a45b-42f898e5f199 | MADS1974/calcMassa | main.cpp | #include <iostream>
/* run this program using the console pauser or add your own getch, system("pause") or input loop */
float
calcularMassa (float a, float b)
{
const float mA = 321.43;
const float mB = 150.72;
printf ("\n 1,2 : 1,0 \t: = %f", (1, 2 * mA + 1 * mB));
printf ("\n 1,4 : 1,0 \t: = %f", (1, 4 * ... | TOOL | 0.87267 | 3.854857 |
23eb1830-1e6e-4c5a-b0a8-0b7ce3253fa8 | Ritikkumar992/Specialist-Sheet | Specialist_02/16.cpp | /*
.__ __ .__ __ ____ .________ ____ ____ ____ ________
_______ |__|_/ |_ |__|| | __/_ | | ____//_ |/_ |/_ |\_____ \
\_ __ \| |\ __\| || |/ / | | |____ \ | | | | | | / ____/
| | \/| | | | | || < | | / \ | | | | | |/ \
|__| |__| |__|... | ALGO | 0.999944 | 4.255027 |
c84e9c11-b7e3-4cb9-a6b5-fd21b888c9ae | mindigoo/TIL | C++/0x0C/0x0C_15.cpp | // https://www.acmicpc.net/problem/16987
// 16987. ġ
#include<bits/stdc++.h>
#define X first //
#define Y second //
using namespace std;
int N, N_copy;
int max_num = 0;
pair<int,int> user_arr[10];
void func(int n){ // Լ : ް ڸ
if(n==N){
int egg_cnt=0;
for(int i=0; i< N_copy; i++) // ް Ȯ
... | ALGO | 0.999943 | 4.530858 |
9dee1ef4-40ad-44b0-8d8b-1b61b6120a47 | algorithm003/algorithm | Week_02/id_52/LeetCode_111_052.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:
int minD(TreeNode* root) {
if(root==NULL)
return 0;
return... | ALGO | 0.999748 | 6.606178 |
69435f11-e340-40ec-82d1-3f803fd7dc7a | ishandutta2007/codeforces | thienu/normal/1371/B.cpp | #include <bits/stdc++.h>
#define u_map unordered_map
#define u_set unordered_set
#define u_multiset unordered_multiset
using ll = long long;
using namespace std;
void __print(int x) {cerr << x;}
void __print(long x) {cerr << x;}
void __print(long long x) {cerr << x;}
void __print(unsigned x) {cerr << x;}
void __pri... | ALGO | 0.999847 | 4.978456 |
d4781043-c69c-4013-a8b2-0525d58c3686 | Manikandan0307/Tasks | Number based Problems/trailing0s.cpp | #include <iostream>
using namespace std;
int countTrailingZeros(int n) {
int count = 0;
while (n >= 5) {
n /= 5;
count += n;
}
return count;
}
int main() {
int number;
cout << "Enter a number: ";
cin >> number;
int trailingZeros = countTrailingZeros(number);
cout... | ALGO | 0.999749 | 6.054745 |
e64b4773-0c9f-44fc-9bee-0b8c85bc4621 | jabae232/final_project_recar | 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.998859 | 6.785645 |
1fce0674-a34b-4cb3-af9b-107287b0d28c | Kaulwarmythri/DSA | Jump Game - GFG/jump-game.cpp | // { Driver Code Starts
//Initial Template for C++
#include <bits/stdc++.h>
using namespace std;
// } Driver Code Ends
//User function Template for C++
class Solution {
public:
int canReach(int A[], int n) {
int curr_reach=0, max_reach=0;
for(int i=0; i<n-1; i++) {
if(i > ... | ALGO | 0.999223 | 5.866601 |
f24d23bb-9a78-44dc-b59e-b31fcc9241fe | sushant10-creator/Love-babbar-spreadsheet | search2DMatrix.cpp | #include <bits/stdc++.h>
using namespace std;
/*
let say the vector is {{1,2},{3,4}} and target is 3
then we seacrh for the first row and first column element
if target is smaller than this element then the element is not found
if it is equal then the element is found
if target is smaller than this element then check f... | ALGO | 0.999624 | 4.652485 |
81ba6ba2-5e91-4b04-a2f6-b638907f0b5b | Shivam08IITKGP/OtherCP | HackerRank/FountainsAndBeauty_10.cpp | #include<bits/stdc++.h>
using namespace std;
int main() {
int n,c,d ;
cin>>n>>c>>d ;
int b[n],p[n],t[n] ;
for(int i=0;i<n;i++)
cin>>b[i]>>p[i]>>t[i] ;
vector<pair<int,int>>type_0,type_1 ;
for(int i=0;i<n;i++)
{
if(t[i]==0)
{
type_0.push_back({p[i],b[i]}) ... | ALGO | 0.999442 | 4.16706 |
e53314c5-0496-4dcb-97d1-55ae16cde20c | prantosky/HackerRank | C++/Deque/Solution.cpp | #include <deque>
#include <iostream>
#include <limits>
#include <vector>
using namespace std;
int max(const deque<int>::iterator begin, const deque<int>::iterator end) {
int maxVal = numeric_limits<int>::min();
deque<int>::iterator it = begin;
while (it != end) {
maxVal = max(maxVal, *it++);
}
... | ALGO | 0.999987 | 4.839722 |
c0104651-fe64-4a40-bb34-936bcd764b03 | chavalvit-k/Programming-Tasks | POSN/Camp1/Propaganda.cpp | /*
TASK: Propaganda
LANG: C
AUTHOR: Chavalvit Keartnattakorn
SCHOOL: CRU
*/
#include <bits/stdc++.h>
using namespace std;
int main(){
int D,i,ch=1;
scanf("%d",&D);
for(i=2 ; i<=sqrt(D) ; i++){
if(D%i==0)
ch=0;
}
printf((ch==1&&D!=1)?"Yes\n":"No\n");
return 0;
}
| ALGO | 0.999923 | 3.797199 |
57086370-2747-4582-b097-3d703939180e | smv1999/CompetitiveProgrammingQuestionBank | Arrays/Minimum_XOR_Value.cpp | /*
Given an integer array A of N integers, find the pair of integers
in the array which have minimum XOR value. Report the minimum XOR value.
Explanation: According to the problem, we are given the size of the array
and the numbers present in it. So we have to find two such numbers that are
the elements of the arra... | ALGO | 0.999976 | 4.899333 |
0b955370-482f-46dd-9922-8211e85eb5d5 | StevenL2017/Codeforces | problem/archive/8/8C.cpp | #include <iostream>
#include <cstdio>
#include <climits>
#include <cmath>
#include <cstring>
#include <string>
#include <array>
#include <vector>
#include <stack>
#include <queue>
#include <deque>
#include <set>
#include <map>
#include <bitset>
#include <numeric>
#include <algorithm>
#include <functional>
using namesp... | ALGO | 0.999994 | 4.119896 |
52cd03cd-dd86-4792-a93c-6b7503d2c182 | HASH-002/Software-Lab-3 | Assignment-2/q2,3/sortarray.cpp | #include <jni.h>
#include "sortarray.h"
#include <iostream>
using namespace std;
JNIEXPORT jintArray JNICALL
Java_sortarray_displaysortarray(JNIEnv *env, jobject obj, jintArray array)
{
jsize n = (env)->GetArrayLength(array);
jint* arr = (env)->GetIntArrayElements(array, NULL);
jintArray result = (env)->Ne... | ALGO | 0.980127 | 3.660993 |
33f41567-4777-4e26-917a-0f4fdba2f8b9 | dansalerno712/CS-182 | C++Sorts/startingPoint/tools.cpp | #include "sorting.hh"
template void Sortings<int, intintCompare>::swap(int*, unsigned int, unsigned int);
template void Sortings<char*, strstrCompare>::swap(char**, unsigned int, unsigned int);
template <class Elem, class Comp>
void Sortings<Elem, Comp>::swap(Elem* arr, unsigned int x, unsigned int y)
{
Elem temp =... | ALGO | 0.999469 | 4.781097 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.