uuid
string
repo_name
string
relative_path
string
content
string
category
string
algo_rel_score
float64
quality_score
float64
e2db41c1-64f0-4ae1-ab55-f56f722ceaac
Saipranathi77/Operating-system-
lab pro- 39=LOOK disk scheduling algorithms.cpp
#include <stdio.h> #include <stdlib.h> void sort(int arr[], int n) { for (int i = 0; i < n-1; i++) { for (int j = 0; j < n-i-1; j++) { if (arr[j] > arr[j+1]) { int temp = arr[j]; arr[j] = arr[j+1]; arr[j+1] = temp; } ...
ALGO
0.999964
5.265896
9f356dc2-e5bc-49b3-b268-9e51497599ce
Toxic-kitten/labs
lab3/lab3.cpp
#include <iostream> #include <bitset> #include <iomanip> using namespace std; std::string bitsetView(std::bitset<36> b) { std::string res = b.to_string(); res.erase(0, res.find('1')); return res; } int main(){ long long x; cout << "Yout digit: "; cin >> x; int one = 0b0000'0001; int n;...
ALGO
0.997496
4.03609
ff435517-9cf8-48d4-8bf1-28e423b0fa6d
safilbhoraniya/software-engineering
module 3/31--StarPlus.cpp
#include<iostream> using namespace std; int main(){ int n; cout<<"enter a number of rows and columns:"; cin>>n; int mid = n / 2 + 1; for(int i = 1;i<=n;i++){ for(int j = 1;j<=n;j++){ if(j == mid || i == mid) cout<<"* "; else cout<<" "; } cout<<e...
ALGO
0.999364
3.476128
8adcc580-5eb0-4b37-907e-1d7cca7d8ebe
ishandutta2007/codeforces
tute7627/normal/516/B.cpp
//#define _GLIBCXX_DEBUG #include<bits/stdc++.h> using namespace std; #define endl '\n' #define lfs cout<<fixed<<setprecision(10) #define ALL(a) (a).begin(),(a).end() #define ALLR(a) (a).rbegin(),(a).rend() #define spa << " " << #define fi first #define se second #define MP make_pair #define MT make_tuple #define P...
ALGO
0.999988
3.7346
23d455e6-c2ef-43bf-a241-f619487dc23d
Siya8een/leetcode
0232-implement-queue-using-stacks/0232-implement-queue-using-stacks.cpp
class MyQueue { stack<int> input, output; public: MyQueue() { } void push(int x) { input.push(x); } int pop() { if (output.empty()) { while (!input.empty()) { output.push(input.top()); input.pop(); } ...
ALGO
0.991967
5.828962
5d60af77-272d-4acc-baa4-7d23d4460eea
arshbhatia8/Leetcode-Problems
0209-minimum-size-subarray-sum/0209-minimum-size-subarray-sum.cpp
class Solution { public: int minSubArrayLen(int target, vector<int>& nums) { int n = nums.size(); long long s = 0; int ans = n + 1; for (int i = 0, j = 0; i < n; ++i) { s += nums[i]; while (j < n && s >= target) { ans = min(ans, i - j + 1); ...
ALGO
0.999996
6.5094
91ae181a-3821-4d68-a6d7-92ca32c8a7e5
fayazashraf98/HiveDatabase
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
dda58141-9d27-4e2f-853d-75d1506e578d
113bommy/deepmind_codecontests_refine
cpp_gold_filter_file/cpp_train_4205_0.cpp
#include <bits/stdc++.h> using namespace std; const int MOD = 1000000007; const double eps = 1e-8; const int nm = 300005; int n, k, m, t; long long res; int a[nm]; char s[nm]; bool check[nm]; long long Pow(int x, int mu) { if (mu == 0) return 1ll; long long res = Pow(x, mu >> 1); res = res * res % MOD; if (mu &...
ALGO
0.999863
3.14029
a678b9e6-5133-4486-b414-896fa5e877e0
NitinSundar/Comp
codeforces/990C.cpp
#include<bits/stdc++.h> using namespace std; typedef long long int lli; #define pb push_back #define mod 1000000007 #define IOS ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0); lli reduce(string s) { int cnt = 0; stack<char> st; for(int i=0;i<s.size();i++) { if(st.empty()) { ...
ALGO
0.999894
4.105358
d929f79e-5ba9-4f55-8d56-971d7b01448d
CSE1342-F19/Lecture-Materials
Chapter04/while_quit.cpp
#include <iostream> using namespace std; int main() { char input; cout << "Enter a number: "; cin >> input; int sum = 0; while (input != 'q') { if (input < 'a') { int inputNumber = (int)input - 48; sum += inputNumber; cout << "New Sum: " << sum << endl; } cout << "Enter a n...
ALGO
0.973171
3.915484
cadcd363-aa7e-4291-9d14-05ff0fd0dfa5
JaekwonHa/problem_solving
BOJ/c++/1158 조세퍼스 문제.cpp
#include <iostream> #include <algorithm> #include <queue> using namespace std; int N,M; int arr[5010]; queue<int> q; int main() { scanf("%d %d", &N, &M); for(int i=1; i<=N; i++) q.push(i); bool first=true; while(!q.empty()) { for(int i=1; i<M; i++) { int temp = q.front(); q.pop(); q.push(temp); } ...
ALGO
0.999973
3.21135
dfcbef43-239a-41e9-9438-20353ef4fbd4
DevleenaBanerjee/Stock_Prediction_ds
venv/Lib/site-packages/pystan/stan/lib/stan_math/lib/boost_1.69.0/libs/algorithm/string/example/regex_example.cpp
// Boost string_algo library example file ---------------------------------// // See http://www.boost.org for updates, documentation, and revision history. #include <string> #include <iostream> #include <iterator> #include <boost/regex.hpp> #include <boost/algorithm/string/regex.hpp> using namespace std; using na...
TOOL
0.914891
5.125824
8c68d9ac-b5bf-4490-938f-f87ce185eda6
jotesoft/sudachi_yzm
src/common/fs/path_util.cpp
#include <algorithm> #include <sstream> #include <unordered_map> #include "common/fs/fs.h" #ifdef ANDROID #include "common/fs/fs_android.h" #endif #include "common/fs/fs_paths.h" #include "common/fs/path_util.h" #include "common/logging/log.h" #ifdef _WIN32 #include <shlobj.h> // Used in GetExeDirectory() #else #incl...
TOOL
0.982779
4.230883
c6182561-3dcf-43a3-abc9-f7c32db54b45
kikizg/LORA
main.cpp
#include <boost/program_options.hpp> #include <vector> #include <string> #include <ctime> #include <fstream> #include <iostream> #include<openssl/rsa.h> #include<openssl/pem.h> #define _DEBUG #include "comm.h" #include "clock.h" #define WHITE "\033[0m" #define RED "\033[1;31m" #define GREEN "\033[1;32m" #define BROW...
TOOL
0.886831
5.748293
32b4cd37-45e6-4744-b890-db289f23fd7c
mahadodla4/GFG_solutions
Easy/Summed Matrix/summed-matrix.cpp
//{ Driver Code Starts #include <bits/stdc++.h> using namespace std; // } Driver Code Ends class Solution { public: long long sumMatrix(long long n, long long q) { if(q>2*n) { return 0; } else { return n-abs((n+1)-q); } } }; //{ ...
ALGO
0.999914
4.961903
06bd09df-7081-40c1-9df1-933aeeb343c1
venu1201/Competitive-Programming
A_Food_for_Animals.cpp
#include<bits/stdc++.h> #define int long long int #define yes cout<<"YES"<<endl; #define no cout<<"NO"<<endl; #define endl "\n" #define prtarr(arr) for(auto it:arr){for(auto x:it){cout<<x<<' ';}cout<<endl;} using namespace std; int32_t main() { std::ios::sync_with_stdio(false); cin.tie(0); cout.tie(0); int T; c...
ALGO
0.999816
3.324435
fdf57dd9-c200-40ff-8e66-4dce36442d76
Swap2003/Learning-CPP
Classes/Classes/Lecture 16 Recursion/IsArraySorted1.cpp
//Front se #include <iostream> using namespace std; bool isArraySorted(int *a,int n){ if (n<=1) { return true; } // Recursive Case bool kyachotasortedhai=isArraySorted(a+1,n-1); if(a[0]<=a[1] and kyachotasortedhai==true){ return true; } return false; } int main() { i...
ALGO
0.999892
4.638264
1fe0fa81-db65-4262-a505-30269819236e
Unaimend/Funktionsanzeige1
Funktionsanzeige/Renderer.cpp
#include <vector> #include <iostream> #include "SFML/Graphics.hpp" #include "CalculateValues.h" #include "Renderer.h" //dynamische speicherzuweisung mit button undso und benno anti vektor lösung damit ich mehrer funktionen gleichzeitig anzeigen lassen kann //Die Lösung um im nachh hinein noch einen hinzuzufügen :) ya...
TOOL
0.946875
4.142918
4d8f1ab9-9b54-4399-bf90-38541b7f2abe
RealN00B/android_frameworks_av
media/module/codecs/mp3dec/src/pvmp3_polyphase_filter_window.cpp
/* ------------------------------------------------------------------------------ PacketVideo Corp. MP3 Decoder Library Filename: pvmp3_polyphase_filter_window.cpp Date: 09/21/2007 ------------------------------------------------------------------------------ REVISION HISTORY Description: --------...
ALGO
0.983753
4.600871
9834bd79-9e01-46a2-a58f-ca5f4f357666
ink19/LeetCode
2021_08/1402/main.cpp
#include <vector> #include <algorithm> using namespace std; class Solution { public: int maxSatisfaction(vector<int>& satisfaction) { const int satisfaction_len = satisfaction.size(); std::sort(satisfaction.rbegin(), satisfaction.rend()); int max_result = 0; int sum_it = 0; ...
ALGO
0.999888
6.243154
f3149509-0721-4f5f-b759-2b322ddad2f8
hbpatel1976/CPP
opover3.cpp
#include<iostream> using namespace std; class Time { private: int hour, minute, second; public: Time(){hour = 0; minute = 0; second = 0;} Time(int h, int m, int s) {hour = h; minute = m; second = s;} void show() {cout << "Hour : " << hour << " Minute : " << minute << " Second : " << second << endl;} Time op...
ALGO
0.985041
4.507894
06d79961-bb98-4709-9c3e-15f9da5056d0
yuuki1052/atcoder_gcc
ABC320/E/main.cpp
#include <iostream> #include <sstream> #include <fstream> #include <string> #include <vector> #include <deque> #include <queue> #include <stack> #include <set> #include <map> #include <algorithm> #include <functional> #include <utility> #include <bitset> #include <cmath> #include <cstdlib> #include <ctime> #include <cs...
ALGO
0.999752
3.607749
a6ae0159-1b0e-4de3-9402-ffdbe07ae123
davidfcalle/AlgorithmAnalysis
taller4/main.cpp
#include <queue> #include <iostream> #include <fstream> #include <map> #include "BST.h" #include "Node.h" #include <math.h> #include <stdlib.h> #include <utility> #include <queue> #include "Number.h" #include "optimal.h" #include <set> #include <stdio.h> /* printf, scanf, puts, NULL */ #include <stdlib.h> /* s...
ALGO
0.997594
3.404461
2a06bfa7-6d42-43d9-a85e-19d8551e0993
Mindjolt2406/Competitive-Programming
Codeforces/607/C.cpp
/* Rathin Bhargava IIIT Bangalore */ #include<bits/stdc++.h> #define mt make_tuple #define mp make_pair #define pu push_back #define INF 1000000001 #define MOD 1000000007 #define EPS 1e-6 #define ll long long int #define ld long double #define fi first #define se second #define all(v) v.begin(),v.end() #define pr(v) {...
ALGO
0.999747
4.287295
93e83701-e936-4ae8-8994-4f7c1e91b146
kalok008/MyCodePortfolio
SoftUni Courses/C++ Fundamentals - ноември 2024/8. Exercise - Strings and Streams/05. Mathematical Expression.cpp
#include <iostream> #include <sstream> #include <cstring> using namespace std; bool valid(string line){ int brackets = 0; for(char c : line){ if(c=='('){ brackets++; } if(c==')'){ if(brackets<=0){ return false; }else{ b...
ALGO
0.982602
4.706444
4dd54510-25f5-4f70-bf4b-64374fee79d7
iLodia5/Acadimic_C-I-_-I-_
semester_2/OOP/project_9/program_2.cpp
#include<iostream> using namespace std; class Myclass { private: int No1,No2; public: //constructor for intilize Myclass(int r =0,int i=0):No1(r),No2(i) {} //this constructor is important (new idea) Myclass operator%(Myclass const &obj)//everytime we put (+) between two objects this con...
TOOL
0.949813
3.741953
3f2d13d8-212d-4ca0-91ee-7a6043c0c486
Maikaphuong/NamNhat
HAHAHAHAHA/addNode2.cpp
#include<iostream> using namespace std; //Them x vao vi tri trong danh sach struct Node { int data; Node* previous; Node* next; }; struct List { Node* pHead; Node* pEnd; }; void createList(List& roll) { roll.pHead = NULL; roll.pEnd = NULL; } Node* createNode(int x) { Node* temp = new Node; temp->data = x; tem...
ALGO
0.999028
3.39895
3730b343-a72a-4db0-8809-7c624403e7b6
debarghamitraroy/Competitive-Programming
CodeChef/TRAVELFAST.cpp
#include <iostream> using namespace std; void solve(); int main() { solve(); return 0; } void solve() { int t; cin >> t; while (t--) { int x, y; cin >> x >> y; if (x < y) cout << "BIKE"; else if (x > y) cout << "CAR"; else ...
ALGO
0.999861
4.530534
e650fdfe-6a3b-4d04-b7ba-848a45596e3b
1M0NKEY1/ITMO_algorithms_second_semester
algo_9_all/algo9_F1/main.cpp
#include <iostream> #include <vector> #include <queue> using namespace std; struct Edge { int source, destination; }; class Graph { public: vector<vector<int>> adjacency_list; Graph(vector<Edge> const &edges, int n) { adjacency_list.resize(n); for (auto &edge: edges) { adjace...
ALGO
0.999984
5.30608
971065d7-52a7-4355-8e83-e2646740c6c5
ZahidTurjo/Data-Structure
Practice problem/week2/e2_3.cpp
#include<bits/stdc++.h> using namespace std; class Node{ public: int val; Node * next; Node(int val){ this->val=val; this->next=NULL; } }; void insert_at_tail(Node * &head,Node * &tail,int val){ Node * newNode=new Node(val); if(head ==NULL){ head=newNode; ...
ALGO
0.999954
3.838012
283b7ff2-23a1-4ca4-bfee-adc9c6ed615e
microsoft/openjdk-jdk20u
src/hotspot/os/windows/os_perf_windows.cpp
#include "precompiled.hpp" #include "iphlp_interface.hpp" #include "jvm_io.h" #include "logging/log.hpp" #include "memory/allocation.inline.hpp" #include "memory/resourceArea.hpp" #include "pdh_interface.hpp" #include "runtime/os_perf.hpp" #include "runtime/os.hpp" #include "runtime/semaphore.inline.hpp" #include "runt...
TOOL
0.892257
3.090666
dcd4a071-e9ba-4d7a-91ba-6c806debd3df
Petra-Rall/Academic-Coding
1st Semester/ANC/STL/STL#3/5.stack-backspace.cpp
#include<iostream> #include<stack> using namespace std; int main(){ string str1, str2; stack<char>s1, s2, s3,s4, s5, s6; cout << "Enter first string: " << endl; getline(cin, str1); cout << "Enter second string: " << endl; getline(cin, str2); for(int i=0; i<str1.size(); i++){ if(!s...
ALGO
0.99921
4.02992
62696a23-eae2-44b3-8a48-42f7d0dd46cd
Shantanu9799/Striver-A2Z-Sheet
Singly_Linked_List/DeleteNodeInLinkedList.cpp
/** * Definition for singly-linked list. * struct ListNode { * int val; * ListNode *next; * ListNode(int x) : val(x), next(NULL) {} * }; */ class Solution { public: void deleteNode(ListNode* node) { ListNode* tmp = node -> next; swap(node -> val, tmp -> val); node -> next ...
ALGO
0.999688
5.416068
3c3a7ff8-44ff-4e9f-9b10-928a16a036f7
starlordvk/github-upload
string_run_length_encoding/run_length_encoding.cpp
#include <bits/stdc++.h> using namespace std; char* RunLengthEncoding(string s) { int l = s.length(); char * newString = new char[2 * l](); int count = 1, i =0, k=0; while(i < l-1) { if(s[i] == s[i+1]) { count++; } else { newString[...
ALGO
0.999951
4.489694
cc24ee32-d0db-480d-8163-6be4de9eb5a1
KaziRifatAlMuin/CodeDrive
Number Theory/Mobius + divisors - Coprime Subseq.cpp
#include <bits/stdc++.h> using namespace std; typedef long long ll; const int N = 1e5 + 7, mod = 1e9 + 7; ll cnt[N]; // cnt[x] = frequency of x in the input ll d[N]; // d[i] = # of input elements divisible by i ll f[N]; // f[i] = # of non-empty subseq’s all divisible by i ll mob[N]; // Möbius function μ(i)...
ALGO
0.999917
4.785422
03a95af8-34ca-4e8b-8f74-c7cb8f24b8ca
BerryBurst/frameworks_av
media/codecs/amrwb/dec/src/dec_acelp_2p_in_64.cpp
/* ------------------------------------------------------------------------------ Filename: dec_acelp_2p_in_64.cpp Date: 05/08/2007 ------------------------------------------------------------------------------ REVISION HISTORY Description: ------------------------------------------------------------------...
ALGO
0.999691
5.926583
e753c472-2134-4a75-9e9d-25dddb088757
Gineticus/Sandpile-Model
lib/sandpile/sandpile.cpp
#include "sandpile.h" bool Sandpile::Make(const char* filename) { std::ifstream file(filename, std::ios::binary); if (!file.is_open()) { std::cerr << "Can't open file: " << filename << std::endl; return false; } char* line = new char[100]; while (file.getline(line, 100)) { ...
ALGO
0.99039
4.67424
1b6681e1-2dd3-4e0f-8c25-a92c9f99cc64
NIT-Hamirpur-CSE-Labs/Operating-Systems-lab
try/sjfprem.cpp
//SJF preemptive #include<iostream> using namespace std; struct pr { int bt,bbt,tat,wt,p,at,c,st; }; void input(pr p[],int i) { cout<<"\n p["<<i+1<<"]"; cout<<"\n burst time "; cin>>p[i].bt; cout<<"\n arrival time "; cin>>p[i].at; p[i].bbt=p[i].bt; p[i].wt=0; p[i].p=i+1; p[i].c=0; } void sorta(pr p[],in...
ALGO
0.999987
3.687373
ccf50666-6ab2-4d02-a968-7af5333286c4
1394469939/-
作业1(Prim算法).cpp
#include <stdio.h> #define MAXE 100 #define MAXV 100 typedef struct { int vex1; //边的起始顶点 int vex2; //边的终止顶点 int weight; //边的权值 }Edge; void kruskal(Edge E[], int n, int e) { int i, j, m1, m2, sn1, sn2, k, sum = 0; int vset[n + 1]; for (i = 1; i <= n; i++) //初始化辅助数组 vset[i] = i; k = 1;//表示当前构造最小生成树的第k条边,初值为1 j ...
ALGO
0.999981
3.911382
d5ab70d5-d541-45fa-a00b-b92b65a4e6a3
dpvasani/30-Days-Of-DSA
Programing Street 150/Sprint 2/69.CheckingforPerfectSquaresinaRange.cpp
#include <iostream> #include <vector> #include <cmath> using namespace std; vector<int> perfectSquaresInRange(int start, int end) { vector<int> perfectSquares; for (int i = ceil(sqrt(start)); i * i <= end; i++) { perfectSquares.push_back(i * i); } return perfectSquares; } int main() { int ...
ALGO
0.987417
4.145052
7c5e162c-0af1-48af-b280-7260a362c7cd
Hyeongho/Coding-test
230518/전력망을 둘로 나누기.cpp
#include <string> #include <vector> #include <iostream> #include <limits.h> #include <stack> #include <math.h> using namespace std; vector<bool> visit; int dfs(int start, vector<vector<int>>& g) { int size = g.size(); vector<bool> visited(size, false); visit[start] = true; stack<int> s; s.push(start); int...
ALGO
0.999921
4.737123
55a3a98b-8bce-4b96-8f36-8b0d0ea563c6
rt-kill/CompetitiveProgramming
CSES/Geometry/Line_Segment_Intersection/main.cpp
#include <bits/stdc++.h> using namespace std; /* Macros {{{ */ /* A lot of this is from some of Benq's submissions [https://codeforces.com/profile/Benq] Ugly af to the eyes, but with vim fold its barable Hopefully c++20 concepts can make all this stuff must cleaner */ /* Basics {{{ */ using ll = long lon...
ALGO
0.999807
4.933185
cde5ab4f-82ef-455c-8302-85caa74d2e1a
akr-009/LeetCodesols
347. Top K Frequent Elements.cpp
class Solution { public: vector<int> topKFrequent(vector<int>& nums, int k) { unordered_map <int,int> mp; for(int i=0;i<nums.size();i++) { mp[nums[i]]++; } vector <int> counts; for(auto it=mp.begin(); it!=mp.end(); ++it) { ...
ALGO
0.999991
6.047516
27531034-16cd-4cc7-8cce-e852261f1e71
HankLyu/NCPC_pratice
course/LIS_LCS/Code/LIS(n^2).cpp
#include<cstdio> #include<cstdlib> #include<cstring> #include<vector> #include<iostream> #include<algorithm> #define MAX 100000 using namespace std ; int num[ MAX ] , n ; int lis[ MAX ] ; int prev[ MAX ] ; // prev[x] 紀錄 s[x] 是接在哪個位置的數字後面 // 如果它前面沒有數字就紀錄 -1 int set ;...
ALGO
0.999921
3.24313
5175fa50-138b-44ac-8473-206f74c3c858
ShashankBagda/ICT
Codes/C++/Data Structures using C++/Codes/20_Queue.cpp
#include<iostream> using namespace std; class Node { public: int no; int priority; Node *next; Node() { no=0; priority = 0; next=NULL; } Node(int n,int p) { no=n; priority = p; next=NULL; } }; class PriorityQueue { public: Node *front; Node *rear; PriorityQueue() { ...
ALGO
0.999783
4.105572
574a0517-f662-47f1-a96f-9297d8cacefe
sirkp/DSA
7. Matrix/problems/p8.cpp
// https://practice.geeksforgeeks.org/problems/boundary-traversal-of-matrix-1587115620/1/?track=SPCF-Matrix&batchId=154 void boundaryTraversal(int m, int n, int arr[SIZE][SIZE]){ for(int i=0;i<n;i++) cout<<arr[0][i]<<" "; for(int i=1;i<m;i++) cout<<arr[i][(n-1)]<<" "; if(m>1) for(int...
ALGO
0.994444
3.761142
e1efb63f-697f-4ea6-89a3-b0437e2320a9
VinayakJamadar/DSA
Trie/Lect 6.Maximum XOR of Two Numbers in an Array/usingStructure.cpp
// Problem: Maximum XOR of Two Numbers in an Array // Article Link: https://takeuforward.org/data-structure/maximum-xor-of-two-numbers-in-an-array/ // N = Number of elements in arr1 // M = Number of elements in arr2 // Time Complexity: O(N*32) + O(M*32) // Reason: // 1. O(N*32) for inserting all the elements of arr1...
ALGO
0.999998
5.877227
09aa540c-c772-4b00-bef8-2af4e94b0310
himanshugupta09/Competitive_Programming
CODEFORCES/1781_B_Goig-to-Cinema.cpp
#include <bits/stdc++.h> using namespace std; #define f(i,a,b) for(ll i = a;i < b;i++) #define maxHeap priority_queue<int> #define minHeap priority_queue<int, vector<int>, greater<int> > #define ll long long ll md = 1e9+7; void printer(vector<ll>& v) { for(auto i:v) { cout << i << " "; } } /...
ALGO
0.999832
4.490779
60cd5343-a563-47f9-a5e8-3e72f152168b
ishandutta2007/codeforces
t90tank/normal/788/C.cpp
#include <bits/stdc++.h> using namespace std; using ll = long long; using db = double; using vi = vector<int>; #define pb push_back const int D = 2006; int k, n; vector<int> a; int f[D+10]; int main() { scanf( "%d%d", &k, &n ); set<int> S; for (int i = 1; i <= n; ++i) { int x; scanf( "%d", &x ); x...
ALGO
0.999864
3.538823
d1a03245-4817-43ae-8616-6573749d7c84
igoingdown/leetcode
441_my_own_method.cpp
class Solution { public: int arrangeCoins(int n) { int i = 1; while ((n -= i) >= 0) { i++; } return i - 1; } };
ALGO
0.999993
6.671931
06660286-ef1d-4bcb-b6e9-27de97667b4b
kdukuray/large_int_dsa_honors
largeInt.cpp
#include "largeInt.hpp" //default constructor largeInt::largeInt(){ sign = true; } //constructor with string largeInt::largeInt(std::string toConsume){ stringToLargeInt(toConsume); } //returns true if number is poisitive bool largeInt::isPositive() const{ return sign; } // copy constructor largeInt::larg...
TOOL
0.989308
3.775414
03c767f2-1b8a-41fc-956f-027c31b4d395
Ivalocs/Timus-Online-Judge
1264 - Workdays.cpp
/* Idea : 1) N*(M+1), make note for the overflow. */ #pragma GCC target ("avx2") #pragma GCC optimization ("O3") #pragma GCC optimization ("unroll-loops") #include <bits/stdc++.h> using namespace std; #define v vector #define ALL(x) x.begin(),x.end() #define rALL(x) x.rbegin(),x.rend() #define endl '\n' #define DEB...
ALGO
0.999699
3.783172
849a3c1c-9065-43a2-a92d-c1afd6e8ea85
rococojie/topcoder
ChocolateBar_div2_556.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.999918
4.502385
ca63493d-f8d1-41e0-a73a-e469cd55afe9
rishabhv12/Data-Structure-And-Algorithm
Tree/pre_in_post_orderTraversal.cpp
// Preoder, inorder and postorder traversal came under Depth-first search // Time complexity - O(n) // Space complexity - best/average - O(log(n)) - height of the tree , worst case - O(n) #include<bits/stdc++.h> using namespace std; // Structure of Binary Search Tree struct bstNode{ int data; bstNode *lef...
ALGO
0.999943
5.680079
f847b455-8bc1-4c46-9748-538f7dca7250
DanNixon/CSC3224_CSC3222_Gaming
Simulation_GraphicalPathFinder/main.cpp
/** * @file * @author Dan Nixon (120263697) * * For CSC3222 Project 2. */ #include <iostream> #include "PathFinder.h" /** * @brief Entry point of the graphical path finder. */ int main(int argc, char *argv[]) { Simulation::GraphicalPathFinder::PathFinder p; return p.run(); }
ALGO
0.903494
3.567036
47c6a1f7-3a85-45ba-ad43-2c934b63e4f2
janmbuys/oxdp
src/third_party/eigen/doc/examples/TutorialLinAlgComputeTwice.cpp
#include <iostream> #include <Eigen/Dense> using namespace std; using namespace Eigen; int main() { Matrix2f A, b; LLT<Matrix2f> llt; A << 2, -1, -1, 3; b << 1, 2, 3, 1; cout << "Here is the matrix A:\n" << A << endl; cout << "Here is the right hand side b:\n" << b << endl; cout << "Computing LLT...
ALGO
0.999889
3.145425
97e6ee86-029b-421c-9ef5-a507e0c72838
volzkzg/sgu
318.cpp
#include <cstdio> #include <cstdlib> #include <cstring> #include <cmath> #include <iostream> #include <fstream> #include <algorithm> #include <vector> #define rep(i,j,k) for (int i=j;i<=k;++i) #define rrep(i,j,k) for (int i=j;i>=k;--i) #define pb push_back using namespace std; const int maxn = 111,maxm = 111; typedef...
ALGO
0.99983
3.326677
e0d526d1-7ee1-4f3b-b9c8-4032dccdfb12
PradeepS1210/MNC-Interview-Questions
Google/IndexesOfSubarraySum.cpp
/* Examples: ---------- Input: arr[] = [1, 2, 3, 7, 5], target = 12 Output: [2, 4] Explanation: The sum of elements from 2nd to 4th position is 12. Input: arr[] = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10], target = 15 Output: [1, 5] Explanation: The sum of elements from 1st to 5th position is 15. Input: arr[] = [5, 3, 4], targ...
ALGO
0.999989
6.801795
226bb24a-4807-4a37-a8d8-2a86276992be
chkrn/leetcode
unique_paths/solution.cpp
// https://leetcode.com/explore/interview/card/top-interview-questions-medium/111/dynamic-programming/808/ #include <vector> class Solution { private: vector<int> cache; int& getCache(int m, int n) { if(m > n) return cache[100 * n + m]; else return cache[100 * m + n]; ...
ALGO
0.99997
6.915984
98be0981-f44b-4279-9cbd-3d92e855683a
yanzhangyz1986/shua_ti_reference
LintCode-master/C++/minimum-window-substring.cpp
// Time: O(n) // Space: O(1) class Solution { public: /** * @param source: A string * @param target: A string * @return: A string denote the minimum window * Return "" if there is no such a string */ string minWindow(string &source, string &target) { if (source.em...
ALGO
0.999985
7.240223
36d70027-6a4f-4732-9528-d194e9fc8417
pbysu/BOJ
~2017/1351.cpp
#include<iostream> #include<unordered_map> using namespace std; typedef long long ll; unordered_map<ll, ll> ma; ll n; int p, q; ll func(ll num) { if (ma[num] != 0) return ma[num]; return ma[num] = func(num / p) + func(num / q); } int main() { scanf("%lld %d %d", &n, &p, &q); ma[0] = 1; printf("%lld", func(n)); ...
ALGO
0.99974
4.260685
5c725ce0-c281-4241-a8f8-299ad8c66b95
THU-DSP-LAB/llvm-project
bolt/lib/Passes/HFSortPlus.cpp
#include "bolt/Passes/HFSort.h" #include "llvm/Support/CommandLine.h" #include <cmath> #include <set> #include <vector> #define DEBUG_TYPE "hfsort" using namespace llvm; using namespace bolt; namespace opts { extern cl::OptionCategory BoltOptCategory; cl::opt<unsigned> ITLBPageSize("itlb-page-size", ...
ALGO
0.999335
5.303108
e2e3cda8-22da-46cb-bc14-620ea4b514b1
ishandutta2007/codeforces
pavlekn/normal/1523/D.cpp
#include <bits/stdc++.h> using namespace std; #define int long long const int MAXN = (1LL << 15); int cnt[MAXN]; int x[MAXN]; int32_t main() { ios_base::sync_with_stdio(false); cin.tie(0); mt19937 rng(chrono::steady_clock::now().time_since_epoch().count()); int n, m, k; cin >> n >> m >> k; ...
ALGO
0.999982
3.966769
78815c20-58c8-4ae3-9c39-cc1f8d663ee5
acashcrypto/acash
src/snark/libsnark/common/utils.cpp
/** @file ***************************************************************************** Implementation of misc math and serialization utility functions ***************************************************************************** * @author This file is part of libsnark, developed by SCIPR Lab * and...
TOOL
0.964992
7.068283
557e466a-259e-4311-8106-4852bd09eb44
ishandutta2007/codeforces
gmusya/normal/9/D.cpp
#include <iostream> #include <vector> #include <map> #include <algorithm> using namespace std; typedef unsigned long long ull; map <pair <int, int>, ull> dp; ull solve(int n, int h) { if (!n) return (h == 0); if (h < 0) return 0; if (dp.find({n, h}) != dp.end()) return dp[{n, h}]; ull res = 0; ...
ALGO
0.999767
4.141198
afdcbe49-2039-4b56-8104-9703750050ed
skygupta07/cpp
39_BinaryTree4/8!-BoundaryTraversal.cpp
/* bool isLeaf(TreeNode<int>* root){ return ( !(root->left) && !(root->right) ); } void addLeftBoundary(TreeNode<int>* root, vector <int> &result){ TreeNode<int>* curr = root->left; while (curr){ if (!isLeaf(curr)) result.push_back(curr->data); // for next iterations if (curr->left...
ALGO
0.999954
5.578466
532ff52f-88eb-4e27-a6d4-2a4d6f269211
BaeSungHyun/Algorithm
helloworld/MergeSortImplement.cpp
#include <iostream> using namespace std; // defaut initizliaer take time ...... !!!! ex -> int arr[] {} struct coordi { int x; int y; coordi(int x_, int y_) { x = x_; y = y_; } coordi() = default; // X& operator=(X& other); coordi& operator=(const coordi& other) { ...
ALGO
0.999978
5.526275
2cc4736d-991b-4e7c-9b37-69de73005f97
sumit-raghukant-soni/Leetcode_Solutions
2182-find-the-minimum-and-maximum-number-of-nodes-between-critical-points/find-the-minimum-and-maximum-number-of-nodes-between-critical-points.cpp
/** * Definition for singly-linked list. * struct ListNode { * int val; * ListNode *next; * ListNode() : val(0), next(nullptr) {} * ListNode(int x) : val(x), next(nullptr) {} * ListNode(int x, ListNode *next) : val(x), next(next) {} * }; */ class Solution { public: vector<int> nodesBetw...
ALGO
0.999996
5.243337
8bd48c18-2470-4bbe-b399-861c617c3afe
kwang-12/ros_basalt
thirdparty/eigen-3.4.0/doc/examples/Tutorial_ReductionsVisitorsBroadcasting_reductions_norm.cpp
#include <Eigen/Dense> #include <iostream> using namespace std; using namespace Eigen; int main() { VectorXf v(2); MatrixXf m(2,2), n(2,2); v << -1, 2; m << 1,-2, -3,4; cout << "v.squaredNorm() = " << v.squaredNorm() << endl; cout << "v.norm() = " << v.norm() << endl; cout << "v.lpN...
ALGO
0.997405
4.03798
dbd09952-d3b2-4994-b42d-85f14e955f28
ishandutta2007/codeforces
jhin/normal/1029/B.cpp
// system.cout(translate *from glut); #include <bits/stdc++.h> using namespace std; #define f for(int i=0;i<n;i++) const int mod=1e9+7; vector<long long> p; int ho,mi,se; void fix_time() { if(se>59)mi+=se/60,se=se%60;if(se<0)se+=60,mi--; if(mi>59)ho+=mi/60,mi=mi%60;if(mi<0)mi+=60,ho--; if(ho<0)ho+=24;if(ho...
ALGO
0.999867
3.636089
37b0c5a5-f313-4421-966c-616e7223f5bc
pronad1/Data-Structure
Chapter_three/deletion.cpp
#include<iostream> using namespace std; int main() { // this algorithm deletes every occurrence of pattern from str string str = "To Be or not 2B, that is the ?"; string pattern = "B"; int index = str.find(pattern); while (index != -1) { str.erase(index, pattern.length()); inde...
ALGO
0.999825
4.183612
f7e4bac5-dcd0-49d5-b888-e02712a7b7b6
axDev-toolchain/benchmark
skia/src/src/core/SkCordic.cpp
#include "SkCordic.h" #include "SkMath.h" #include "Sk64.h" // 0x20000000 equals pi / 4 const int32_t kATanDegrees[] = { 0x20000000, 0x12E4051D, 0x9FB385B, 0x51111D4, 0x28B0D43, 0x145D7E1, 0xA2F61E, 0x517C55, 0x28BE53, 0x145F2E, 0xA2F98, 0x517CC, 0x28BE6, 0x145F3, 0xA2F9, 0x517C, 0x28BE, 0x145F, 0xA2F, 0x5...
ALGO
0.970272
5.735994
2a99491d-d69d-40fb-b094-04da2b905002
karan-pawar-09/codeforces
B_Distinct_Year.cpp
#include<bits/stdc++.h> using namespace std; #define ll long long bool is_distinct(string s) { int n=s.size(); bool ans=true; sort(s.begin(),s.end()); for(int i=1;i<n;i++) { if(s[i]==s[i-1]) { ans=false; break; } } return ans; } int main() { ios_base:...
ALGO
0.999816
4.878271
21d0b902-eb48-42a3-9515-8c4788ef08c5
Arvi-Saleque/revision-template
reverse dp.cpp
// https://codeforces.com/problemset/problem/1061/C // reverse DP // sometimes it needs to do reverse DP to avoid overcounting #include<bits/stdc++.h> using namespace std; typedef long long int ll; const int N = 1e6 + 2, mod = 1000000007; vector<int> divs[N + 2]; void pre() { for(int i = 1; i <= N; i++) { ...
ALGO
0.999919
4.826029
877e133d-ceef-4f3e-b213-686fb8d85c35
user992199/ISA_Practice
20-03/kadane_algo.cpp
#include<iostream> using namespace std; int kadane(int * arr, int n){ int cs = 0, ms = INT_MIN; for(int i = 0; i < n; i++){ cs += arr[i]; ms = max(ms, cs); cs = max(cs, 0); } return ms; } int main(){ int arr[] = {-5, -4, -3, -2, -1}; int n = sizeof(arr)/sizeof(arr[0]); cout<<kadane(arr, n)<<endl; return 0...
ALGO
0.999969
4.352733
670a6f87-476e-4f97-a235-da77959970a9
chapel-lang/chapel-attic
third-party/llvm/llvm-src/lib/CodeGen/LiveIntervalUnion.cpp
#include "llvm/CodeGen/LiveIntervalUnion.h" #include "llvm/ADT/STLExtras.h" #include "llvm/ADT/SparseBitVector.h" #include "llvm/CodeGen/LiveInterval.h" #include "llvm/CodeGen/TargetRegisterInfo.h" #include "llvm/Support/raw_ostream.h" #include <cassert> #include <cstdlib> using namespace llvm; #define DEBUG_TYPE "re...
ALGO
0.962603
7.222612
07fb3a03-bddb-4eff-9e17-0e917d0bad3b
bios-bunda-mulia-university/cp-solution
HackerEarth/Algorithms/highest_average_nissan.cpp
#include <bits/stdc++.h> using namespace std; int main() { int n; cin >> n; vector<double> list; vector<double> avg; double input; for(int i=0; i<n; i++) { cin >> input; list.push_back(input); } sort(list.begin(), list.end()); double sum = 0.0; for(int i=1; i<=n; i++) { sum += list[i-...
ALGO
0.999962
4.365558
7ee9ba3e-39eb-40c7-a397-a44799798d3a
6299481145/Programming
c++/funfactor.cpp
#include <iostream> using namespace std; void factor(); int main() { factor(); } void factor() { int n=60, i; for (int i = 1; i <= n; i++) { if (n%i==0) { cout<<i<<" "; } } }
ALGO
0.999749
3.825684
49f03928-2be3-4168-a8c3-e7f846b36d1a
Akshaansh1/Algo
binary trees/findNode.cpp
#include <bits/stdc++.h> using namespace std; class TreeNode { public: int data; TreeNode *left; TreeNode *right; TreeNode(int data) { this->data = data; left = NULL; right = NULL; } }; TreeNode *takeinput() { int rootData; cout<<"Enter The Root Data : "; ...
ALGO
0.999851
4.474326
9da137ab-c1e6-4577-a016-45ce1248d500
ishandutta2007/codeforces
pavelkunyavskiy/normal/316/B2.cpp
//#include <iostream> #include <fstream> #include <vector> #include <set> #include <map> #include <cstring> #include <string> #include <cmath> #include <cassert> #include <ctime> #include <algorithm> #include <sstream> #include <list> #include <queue> #include <deque> #include <stack> #include <cstdlib> #include <cstdi...
ALGO
0.999983
3.624843
b13110ff-ca2d-4849-ade3-86d7d5c64481
iamroshans/C--Practice
Code 17-To swap first and last digit of a number/main.cpp
// To swap first and last digit of a number. #include<iostream> #include<math.h> using namespace std; int main(){ int first,last,count,num,temp,swapped; // double swapped; cout<<"Enter the number : "<<endl; cin>>num; temp=num; last=num%10; count=(int)log10(num); while(num>=10){ ...
ALGO
0.999596
4.10987
6eb2b8bd-3adb-4ca9-9e5e-181994325c99
ishandutta2007/codeforces
archuser84/normal/1389/D.cpp
#define _CRT_SECURE_NO_WARNINGS #define _USE_MATH_DEFINES #include <bits/stdc++.h> #define ll long long #define pii pair<int,int> #define Loop(x, a, b) for(int x = a; x < b; ++x) #define LoopR(x, a, b) for(int x = b - 1; x >= a; --x) #define all(x) x.begin(),x.end() #define Bit(x,k) ((x >> k) & 1) #define Mod1 10000000...
ALGO
0.999951
3.920157
dc47c1e8-385f-4754-a53c-eff0fa9b9f1b
cherry0697/Codes
merge_sort.cpp
#include<bits/stdc++.h> using namespace std; void merge(int le,int m,int ri,int a[]) { int n1=m-le+1; int n2=ri-m; int l[n1],r[n2]; for(int i=0;i<n1;i++) l[i]=a[i+le]; for(int i=0;i<n2;i++) r[i]=a[m+1+i]; int i=0,j=0; int k=le; while(i<n1 && j<n2) { if(l[i]<r[j]) { a[k]=l[...
ALGO
0.99999
3.886952
777afdf9-6042-4183-a117-6ad66f1e8a44
Suryansh-23/CodeForces
742A - Arpa's Land.cpp
#include <iostream> using namespace std; int main() { int n; cin >> n; if (n == 0) { cout << 1; return 0; } else { switch (n % 4) { case 0: cout << 6; return 0; case 1: cout << 8; return 0; ...
ALGO
0.99993
3.206334
a082f165-7d56-4e06-8c80-cf87ad3d691a
patmarion/boost-build
boost_1_45_0/libs/algorithm/string/example/replace_example.cpp
// Boost string_algo library example file ---------------------------------// // See http://www.boost.org for updates, documentation, and revision history. #include <string> #include <iostream> #include <iterator> //#include <boost/algorithm/string/replace.hpp> //#include <boost/algorithm/string/erase.hpp> //#incl...
TOOL
0.891876
5.471968
aae3bd91-6100-4a9f-b366-9d68055a4977
shubhamkanade/cpp-program
predict the output all/predict the output on operator overloading/4.cpp
#include<iostream> using namespace std; class Demo { public: void fun(signed int i) { cout<<"first defination"; } void fun(unsigned int j) { cout<<"second defination"; } }; int main() { Demo obj; int i=10; unsigned int j=11; obj.fun(i); obj.fun(j); return 0; }
TOOL
0.979311
4.342102
a5d6447c-bf03-4356-a593-65e3e3337448
sitkat/flutter_firebase_store
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
5f9cff97-212c-464d-8895-ccc33ce864c0
Shuiliusheng/spec2006_simpoint
arm_x86_gem5/src/systemc/tests/systemc/misc/user_guide/chpt11.1/mean.cpp
/***************************************************************************** mean.cpp -- Original Author: Martin Janssen, Synopsys, Inc., 2002-02-15 *****************************************************************************/ /***************************************************************************** ...
ALGO
0.999339
4.69205
f0e69c57-bc53-4c42-af99-eaffceee9878
mortie/llvm
llvm/lib/DebugInfo/CodeView/TypeIndexDiscovery.cpp
#include "llvm/ADT/ArrayRef.h" #include "llvm/Support/Endian.h" using namespace llvm; using namespace llvm::codeview; static inline MethodKind getMethodKind(uint16_t Attrs) { Attrs &= uint16_t(MethodOptions::MethodKindMask); Attrs >>= 2; return MethodKind(Attrs); } static inline bool isIntroVirtual(uint16_t At...
TOOL
0.890775
6.330872
4d0a8d03-0415-4b37-8623-f6d54ab90154
yongjiangbuaa/BGame2
cocos2d/cocos/3d/CCOBB.cpp
#include "3d/CCOBB.h" NS_CC_BEGIN #define ROTATE(a,i,j,k,l) g=a.m[i + 4 * j]; h=a.m[k + 4 * l]; a.m[i + 4 * j]=(float)(g-s*(h+g*tau)); a.m[k + 4 * l]=(float)(h+s*(g-h*tau)); static Mat4 _getConvarianceMatrix(const Vec3* vertPos, int vertCount) { int i; Mat4 Cov; double S1[3]; double S2[3][3]; S...
ALGO
0.998341
6.076499
dad02364-cc5a-4f15-ac59-abc8f3579b19
engrsakib/phitron
XPSC/werkly contest/week 4/C_Dotify_Playlist.cpp
#include <bits/stdc++.h> #define br "\n" #define ll long long #define yes cout << "YES\n" #define no cout << "NO\n" using namespace std; int main() { // _Created : 23 April 2024 || 21:36:02 // _File : C_Dotify_Playlist.cpp // Writer : Md. Nazmus Sakib /* Enter your code here. Read input fro...
ALGO
0.998999
4.403681
14b81dcc-9a69-4b28-86c5-b4515a1a9980
ishandutta2007/codeforces
hitonanode/normal/1172/C2.cpp
#include <bits/stdc++.h> using namespace std; using lint = long long int; using pint = pair<int, int>; using plint = pair<lint, lint>; struct fast_ios { fast_ios(){ cin.tie(0); ios::sync_with_stdio(false); cout << fixed << setprecision(20); }; } fast_ios_; #define FI first #define SE second #define ALL(x) (x).begin(), ...
ALGO
0.999996
4.088735
3c147efd-17c6-4640-b322-8cd6abadb889
KMORaza/Optimal_Aircraft_Fuselage_Design--TO
002/solution/source/fem_solver.cpp
#include "fem_solver.h" #include <Eigen/Sparse> #include <cmath> #include <stdexcept> #include <iostream> FEMSolver::FEMSolver(Geometry& geometry, const Material& material) : geometry_(geometry), material_(material), max_deflection_(0.0), ultimate_load_factor_(1.0), temp_min_(0.0), temp_max_(0.0), damp...
ALGO
0.999697
6.767294
f07aa200-4563-4c2a-a48a-66c7c444922c
ishandutta2007/codeforces
flowerletter/normal/938/C.cpp
#include <bits/stdc++.h> #define rep(i, a, b) for(int i = (a); i <= int(b); i ++) #define per(i, a, b) for(int i = (a); i >= int(b); i --) #define fi first #define se second #define all(s) s.begin(), s.end() #define trv(i, u, v) for(int i = head[u], v = e[i].to; i; v = e[i = e[i].nxt].to) #define sz(s) (int)(s.size()) ...
ALGO
0.999723
3.985951
e45d8237-38fe-4a38-ab22-211c3e7e43e9
DipuHowlader/learning_dsa
B_George_and_Accommodation.cpp
#include <iostream> using namespace std; int main() { ios_base::sync_with_stdio(false); cin.tie(nullptr); int t, count= 0; scanf("%d", &t); while (t--) { int p,c;scanf("%d %d", &p, &c); if (c > p+1) count++; } printf("%d", count); return 0; }
ALGO
0.998538
3.475132
b9d8def1-d957-4c36-aefb-7b9b0c8f7d76
goldenpython/Contests
UVA/p11287v0.cpp
/******************************************************************************* * Cristian Alexandrescu * * 2163013577ba2bc237f22b3f4d006856 * * 11a4bb2c77aca6a9927b85f259d9af10db791ce5cf884bb31e7f7a889d4fb385 ...
ALGO
0.999851
4.458468
f4c96f39-edd0-47ad-90a0-8074e8c9cda3
raincross7/code-similarity
codes/train_code/problem306/problem306_256.cpp
#include <iostream> #include <cstdio> #include <string> #include <cstring> #include <deque> #include <list> #include <queue> #include <stack> #include <vector> #include <utility> #include <algorithm> #include <map> #include <set> #include <complex> #include <cmath> #include <limits> #include <climits> #include <ctime> ...
ALGO
0.9998
3.642926
7392c945-3a31-40ee-bfca-69a2e1c4264b
01joy/HZip
main.cpp
/* * main.cpp * * Created on: 2016818 * Author: zhenlin */ #include"HuffmanCode.h" #include<iostream> #include<fstream> #include<string> #include<cstring> // for strcmp #include<ctime> #include<iomanip> // for setprecision using namespace std; bool DoesFileExist(char *path){ ifstream is(path); if(!is)ret...
TOOL
0.947755
3.847689
8f7a3740-e6da-42d9-a0f6-ff0941d96120
usukhbaatar/sqrt-online-course
Day5/2iinzereg.cpp
#include <iostream> using namespace std; int main() { int n; cin >> n; int z = 1, x = 0; // 2^0 = 1 ,, z = 1, x = 0 // 2^x = z while (z < n) { z = z * 2; x = x + 1; } // 2^x == z >= n if (z == n) { cout << x << endl; } else { cout << -1 << endl; } return 0; }
ALGO
0.999948
4.949024
f04173dc-3139-4fad-ab11-9550753192a6
Bkmakwana2002/DSA
GFG-Course/maths/pallindrome.cpp
#include <bits/stdc++.h> using namespace std; #define ll long long int void solve() { int rev = 0; int n; cin>>n; int temp = n; while(temp>0) { int rem = temp%10; temp = temp/10; rev = rev*10 + rem; } if(rev == n) { cout<<true; return; } ...
ALGO
0.999898
4.954062