uuid string | repo_name string | relative_path string | content string | category string | algo_rel_score float64 | quality_score float64 |
|---|---|---|---|---|---|---|
26f0ca04-1837-447d-831a-34d4d7a26142 | pospx/frameworks_native | services/surfaceflinger/layerproto/LayerProtoParser.cpp | #include <android-base/stringprintf.h>
#include <layerproto/LayerProtoParser.h>
#include <ui/DebugUtils.h>
using android::base::StringAppendF;
using android::base::StringPrintf;
namespace android {
namespace surfaceflinger {
bool sortLayers(LayerProtoParser::Layer* lhs, const LayerProtoParser::Layer* rhs) {
uint... | TOOL | 0.945194 | 6.95029 |
3b1137fc-e2d1-4998-afa2-475ac924dec6 | Iman-Howlader/Competitive-Programming | BootCamp-S16/W-2/L_k_Factorization.cpp |
/*-----------------------------------------------------
| Iman Howlader |
| CSE, North South University |
| Email: <EMAIL> |
-----------------------------------------------------*/
#include <bits/stdc++.h>
using namespace std;
#ifdef LO... | ALGO | 0.999944 | 4.112377 |
de5a2c4d-9e85-4630-8676-d25ce178bc59 | ritikshukla29/oops-experiment-all | FibonacciSeries.cpp | #include <iostream>
using namespace std;
int main(int argc, char const *argv[])
{
int f = 0, s = 1, next, n, i = 1;
cout << "Enter the number of terms : ";
cin >> n;
cout << "Fibonacci Series is : ";
while (i <= n)
{
cout << f << " ";
next = f + s;
f = s;
s = next... | ALGO | 0.999869 | 4.076674 |
62479546-e6fe-4650-bb1d-91f4c1f44a80 | Asmita-306/DSA | LAB-7/queuecircular.cpp | #include <stdio.h>
#include <stdlib.h>
#define N 5
class Queue {
private:
int arr[N];
int front;
int rear;
public:
Queue() {
front = rear = -1;
}
void enqueue(int value);
int dequeue();
int peek();
};
int main() {
Queue q;
int choice, value, result;
do {
print... | ALGO | 0.996543 | 4.734326 |
c8e94010-bd7d-42aa-9e10-da5e42698c50 | youngineer-old/100DaysOfCode | striver/Day04/Hashing.cpp | #include<bits/stdc++.h>
using namespace std;
int main(){
int n, i, search_ele, arr[100], hash[100] = {0}, count;
cout<<"enter the size of the array: ";
cin>>n;
for(i = 0; i < n; i++){
cout<<"\n enter the "<<i+1<<" element: ";
cin>>arr[i];
}
for(int k = 0; k < n; k++){
... | ALGO | 0.99982 | 4.190184 |
2b3cdcfa-36c8-4d64-8157-37c81df2a9d6 | ishandutta2007/codeforces | kdvinit/normal/1206/C.cpp | /*
K.D. Vinit |,,|
*/
#include <iostream>
#include <cmath>
#include<bits/stdc++.h>
using namespace std;
#define int long long
void solve()
{
int n;
cin>>n;
if(n%2==0) { cout<<"NO"<<endl; return; }
cout<<"YES"<<endl;
int a[2*n+1];
for(int i=1;i<=n;i++)
{
if(i%2==1)
{
... | ALGO | 0.9999 | 3.593821 |
8620b076-506a-41e7-99d6-ee62b60c814f | raincross7/code-similarity | codes/train_code/problem401/problem401_430.cpp | #include <bits/stdc++.h>
#pragma GCC target("avx2")
#pragma GCC optimize("O3")
#pragma GCC optimize("unroll-loops")
#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native")
// #pragma GCC optimize("Ofast")
using namespace std;
using ll = long long;
// MACRO
// for loop
#define REP(i, n) for (ll ... | ALGO | 0.99946 | 3.753135 |
97e53bf4-c03b-42d5-8033-9ec1abf49a6b | chiragshrimal/ChiragCodes | c++/Graph/cycle_detection/cycle_undirected_dfs.cpp | #include<bits/stdc++.h>
using namespace std;
// using dfs
// time complexity including detect cycle O(n)
// space compelx,ity is O(n)+O(n)
bool dfs_traversal(int start,int parent,vector<int>& visited,vector<int> adj[]){
visited[start]=1;
int size=adj[start].size();
for(int i=0;i<size;i++){
if(visi... | ALGO | 0.999987 | 5.453408 |
e1758bbd-9edc-4461-9f4d-d49c46b39ac3 | Abdullah7919/DSA | strings/checkStringIsRotationToeachOther.cpp | #include<bits/stdc++.h>
using namespace std;
bool rotation(string s1, string s2){
if(s1.size()!=s2.size()){
return false;
}
string temp=s1+s1;
if(temp.find(s2)!=string::npos){
return true;
}
return false;
}
int main(){
string s1="geeksforgeeks";
string s2="forgeeksgeek... | ALGO | 0.999993 | 3.974747 |
addcdc10-e026-4aa4-9725-7f6662131d53 | Mldn/Multithreaded-kernel | KerSem.cpp | /*
* KerSem.cpp
*
* Created on: Sep 15, 2019
* Author: OS1
*/
#include "KerSem.h"
#include "ListPCB.h"
#include "PCB.h"
#include "Utility.h"
#include "Schedule.h"
KernelSem::KernelSem(int v) {
value = v ;
blokirani = new ListPCB();
}
KernelSem::~KernelSem() {
flock();
delete blokirani;
funlock();
}
... | ALGO | 0.985749 | 4.373934 |
deb5dd5f-0120-49c7-b719-d7b75fea3dce | dakshsethi/Daily-DSA-Coding | Linked List/Middle of LL/Middle_Node.cpp | #include <iostream>
using namespace std;
class ListNode {
public:
int val;
ListNode *next;
ListNode(int d)
{
val = d;
next = NULL;
}
};
void push(ListNode **head, int new_data)
{
ListNode *new_node = new ListNode(new_data);
new_node->next = ... | ALGO | 0.99995 | 5.910161 |
4765a705-69ec-44e0-aa08-a82fea5e025e | akshayupadhyay008/CpTemplate1 | ddffaa.cpp |
/*
input 1
8
0 1 2 3 4 5 6 7
2
0 1
0
1
2
1 5
6 2
0 2
2 6
7 5
2 6
6 4
6 2
output1
Number of states - 8
States
0 1 2 3 4 5 6 7
Number of Alphabets - 2
Alphabets
0 1
Starting state - 0
Final state count - 1
2
transitions -
1 5
6 2
0 2
2 6
7 5 ... | ALGO | 0.999899 | 4.217192 |
e91321f7-3839-402e-8740-036a471d7d4f | Jaslew/LeetCode | C++/312.戳气球.cpp | /*
困难
有 n 个气球,编号为0 到 n-1,每个气球上都标有一个数字,这些数字存在数组 nums 中。
现在要求你戳破所有的气球。每当你戳破一个气球 i 时,你可以获得 nums[left] * nums[i] * nums[right] 个硬币。
这里的 left 和 right 代表和 i 相邻的两个气球的序号。注意当你戳破了气球 i 后,气球 left 和气球 right 就变成了相邻的气球。
求所能获得硬币的最大数量。
说明:
你可以假设 nums[-1] = nums[n] = 1,但注意它们不是真实存在的所以并不能被戳破。
0 ≤ n ≤ 500, 0 ≤ nums[i] ≤ 100
示例:
输入: [3,1,5,... | ALGO | 0.999986 | 5.200547 |
f45f5649-372b-4cd6-9cf1-82aad2a08b04 | kiddos/ImageProcessing | src/ip/feature.cpp | #include <cassert>
#include <cmath>
#include <limits>
#include <algorithm>
#include <omp.h>
#include "image_processing.h"
#include "ip/util/math_function.h"
namespace ip {
namespace feature {
template <typename DType>
DType GetValidNeighbour(const PADDING padding,
const int w, const int h,
... | ALGO | 0.998933 | 4.173021 |
2ec8d7a2-497b-4cee-8bdb-803249e0bf4f | LuizaMannes/Competitive_Programming | CSES_problems/sorting_and_searching/stick_lengths.cpp | #include <bits/stdc++.h>
using namespace std;
#define int long long
#define endl '\n'
void solve() {
int n; cin >> n;
vector<int> ar(n);
for(int i = 0; i < n; i++) cin >> ar[i];
sort(ar.begin(), ar.end());
int mid = ar[(n / 2)], res = 0;
for(int i = 0; i < n; i++){
res += abs(mid -... | ALGO | 0.999877 | 5.050093 |
9c992893-54eb-4743-b448-2fc3ff3b63a0 | marioyc/Online-Judge-Solutions | SPOJ/Classical/1031 - Up Subsequence.cpp | #include <cstdio>
#include <cstring>
#include <algorithm>
#include <string>
#include <set>
using namespace std;
int memo[100][256],L;
char s[101],s2[101],sz,MAX_LEN,cont;
set<string> ans;
set<string> :: iterator it;
int solve(int pos, int last){
if(pos == L) return 0;
int &ret = memo[pos][last];
... | ALGO | 0.999835 | 4.513088 |
ec645ed5-afae-4723-b3f5-7cd818380faa | subhm2004/Leetcode_Solutions | 1878-check-if-array-is-sorted-and-rotated/check-if-array-is-sorted-and-rotated.cpp | class Solution {
public:
bool check(vector<int>& nums) {
int n = nums.size();
int peak = 0;
for (int i = 0; i < n; i++) {
if (nums[i] > nums[(i + 1) % n]) {
peak++;
}
}
return peak <= 1;
}
};
// class Solution { agar mujeh k ... | ALGO | 0.999965 | 5.899073 |
8c45746b-a8a9-4e8f-bc11-f2f70b4af78c | Mushfikulislam/Algorithm_Code | FF-6-th-LAB/Task-3.cpp | #include <iostream>
#include <vector>
using namespace std;
typedef vector<vector<int>> Matrix;
Matrix add(const Matrix &A, const Matrix &B)
{
int n = A.size();
Matrix result(n, vector<int>(n, 0));
for (int i = 0; i < n; ++i)
for (int j = 0; j < n; ++j)
result[i][j] = A[i][j] + B[i][j]... | ALGO | 0.999808 | 4.411429 |
f7657bf5-18bc-4197-a2ab-4d963747632b | Yeom-JinHo/Baekjoon | 9095.cpp | #include <iostream>
using namespace std;
void solution(int n)
{
int dp[11];
dp[1] = 1;
dp[2] = 2;
dp[3] = 4;
for (int i = 4; i < n + 1; i++)
{
dp[i] = dp[i - 1] + dp[i - 2] + dp[i - 3];
}
cout << dp[n] << '\n';
}
int main()
{
int t;
cin >> t;
for (int i = 0; i < t; i++)
{
int n;
ci... | ALGO | 0.999968 | 4.215689 |
6df440b4-12c4-4188-84bc-d7c9eb893d14 | EishaMazhar/Semester2-Resources | CP_LabTasks/lab 2/Q8.cpp | #include<iostream>
using namespace std;
int count_digits(int b)
{
static int count=0;
if(b!=0)
{
count++;
b=b/10;
count_digits(b); // recursive call
}
else
return count;
}
main()
{
int a;
cout<<" ** program to count digits in number ** \n\n";
cout<<"Enter a number : ";
cin... | ALGO | 0.999515 | 4.786656 |
378d8baf-9da7-4d57-adc7-6b0dc75758f3 | anshsharma43/Leetcode-repo | 1823. Find the Winner of the Circular Game.cpp | class Solution {
public:
// naive method
/*int dp[501][501];
int helper(int index,int k,vector<int> &arr)
{
if(dp[index][k]!=-1)
{
return dp[index][k];
}
if(arr.size()==1)
{
return dp[index][k]=arr[0];
}
... | ALGO | 0.999996 | 5.715229 |
510ef943-8777-4311-8a45-2c563af47837 | stalin670/LEETCODE-SOLUTIONS | 3274-check-if-two-chessboard-squares-have-the-same-color/3274-check-if-two-chessboard-squares-have-the-same-color.cpp | class Solution {
public:
#define ll long long
bool checkTwoChessboards(string x, string y) {
ll rowS = (x[0] - 'a') + (y[0] - 'a');
ll colS = (x[1] - '0') + (y[1] - '0');
return rowS % 2 == colS % 2;
}
}; | ALGO | 0.999857 | 5.701722 |
114d7556-a324-4ba4-a731-563307b1a82c | michal-pawlicki/inteligentne-metody-optymalizacji | Lab1/src/two_regret.cpp | #include "two_regret.hpp"
TSPSolution twoRegret(const TSPData& data, const int startNodeA) {
TSPSolution solution;
std::vector<bool> visited(data.coordinates.size(), false);
solution.pathA.push_back(startNodeA);
visited[startNodeA] = true;
int startNodeB = -1;
int maxDistance = -1;
for (int i = 0; i <... | ALGO | 0.999798 | 5.769089 |
6f386d85-47f3-4120-b781-0b5e2890b8a8 | AbidUllah0/chat_app_UI | 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 |
dbc9197a-c468-426a-9aa2-52f13c226822 | Chaitalykundu/LeetCode | 0104-maximum-depth-of-binary-tree/0104-maximum-depth-of-binary-tree.cpp | /**
* Definition for a binary tree node.
* struct TreeNode {
* int val;
* TreeNode *left;
* TreeNode *right;
* TreeNode() : val(0), left(nullptr), right(nullptr) {}
* TreeNode(int x) : val(x), left(nullptr), right(nullptr) {}
* TreeNode(int x, TreeNode *left, TreeNode *right) : val(x), l... | ALGO | 0.99964 | 6.385598 |
af9aa6c0-a4a0-4a6e-a525-4cfd33a5e010 | EduardoMerino/GitMetodosNumericos | Secante/Secante.cpp | #include <iostream>
#include <cmath>
#include <math.h>
#include <stdio.h>
#define ERROR 0.000000001
using namespace std;
double calculaError(int t, double vant, double vact){
//INPUT: tipo de Error, Valor Anterior, Valor Actual
double err = 0.0;
switch (t){
case 0 :
//Error Absoluto
err = vant -... | ALGO | 0.999857 | 4.07929 |
39fd8596-9aee-47aa-976e-f0ac25c92b52 | Sudhanshu2306/Competitive-coding | C_Tiles_Comeback.cpp | #include <bits/stdc++.h>
using namespace std;
// Commonly used loops
#define for0(i, n) for (int i = 0; i < (n); ++i)
#define for1(i, n) for (int i = 1; i <= (n); ++i)
#define rfor0(i, n) for (int i = (n) - 1; i >= 0; --i)
#define rfor1(i, n) for (int i = (n); i >= 1; --i)
#define foreach(it, v) for (auto it = v.begin... | ALGO | 0.999904 | 4.413124 |
a3ce08da-886e-458f-ac50-9c0aa165508e | thanhtung29497/reception-robot-sdk | android/cpp/rkai/thirdparty/eigen3/doc/examples/DenseBase_middleRows_int.cpp | #include <Eigen/Core>
#include <iostream>
using namespace Eigen;
using namespace std;
int main(void)
{
int const N = 5;
MatrixXi A(N,N);
A.setRandom();
cout << "A =\n" << A << '\n' << endl;
cout << "A(2..3,:) =\n" << A.middleRows(2,2) << endl;
return 0;
}
| ALGO | 0.913689 | 3.307581 |
cd336b8c-4ca2-4035-a7db-47b0837eb99f | eosspark/eos-sidechain | SideChain/externals/binaryen/test/emscripten/tests/bullet/src/BulletCollision/CollisionShapes/btMultiSphereShape.cpp | #include "btMultiSphereShape.h"
#include "BulletCollision/CollisionShapes/btCollisionMargin.h"
#include "LinearMath/btQuaternion.h"
#include "LinearMath/btSerializer.h"
btMultiSphereShape::btMultiSphereShape (const btVector3* positions,const btScalar* radi,int numSpheres)
:btConvexInternalAabbCachingShape ()
{
m_shap... | TOOL | 0.876299 | 6.773199 |
e0e5b9cb-5145-4b43-9a2b-d736dbf68464 | DaltonCole/SIG_COMP_STL | other/algorithm.cpp | // g++ -std=c++14 algorithm.cpp
#include <iostream>
#include <algorithm>
#include <vector>
// Random, for funsies
#include <stdlib.h> /* srand, rand */
#include <time.h> /* time */
#include <random>
using namespace std;
void print(const auto& v) { // Requires c++14 for type inference. Essentially makes a t... | ALGO | 0.998222 | 5.418689 |
410cfeb8-5319-4376-9ed7-20fc31be26f7 | mcbapo/mpsdyn | src/programs/banulsm/timeaverage/averageIsing_next.cpp | #include <math.h>
#include <iomanip>
#include "MPS.h"
#include "Contractor.h"
#define TMPSTORE 0 // Using temporary storage for intermediate results
#include "IsingHamiltonian.h"
using namespace shrt;
/** averageIsing constructs (by hand) a transverse operator to try to
approximate the time average after long... | ALGO | 0.997685 | 4.56724 |
d21f5e3d-f0d0-4a15-96fa-baa69e05e3f6 | liuweiky/GPLT | L2-029/main.cpp | #include <cstdio>
#include <algorithm>
#include <map>
#include <cmath>
#define MAX_N 10240
using namespace std;
int depend[MAX_N];
bool is_dep[MAX_N];
int A, B;
int trans(int t)
{
int res = 0;
do
{
int k = t % 10;
res += k * k;
t /= 10;
} while (t);
return res;
}
bool i... | ALGO | 0.99988 | 3.872299 |
20c82c86-92c9-4093-8ff8-237613cfd96d | JiaxuZ/E3SMv2_CL_SOM | components/homme/src/share/cxx/ComposeTransportImplVerticalRemap.cpp | #include "ComposeTransportImpl.hpp"
#include "Context.hpp"
#include "VerticalRemapManager.hpp"
#include "RemapFunctor.hpp"
namespace Homme {
using cti = ComposeTransportImpl;
void ComposeTransportImpl
::remap_v (const ExecViewUnmanaged<const Scalar*[NUM_TIME_LEVELS][NP][NP][NUM_LEV]>& dp3d,
const int np1, ... | ALGO | 0.915008 | 6.063249 |
da7d656e-835d-4833-b470-f0c094f7df69 | ZERstar/Leetcode | 0002-add-two-numbers/0002-add-two-numbers.cpp | /**
* Definition for singly-linked list.
* struct ListNode {
* int val;
* ListNode *next;
* ListNode() : val(0), next(nullptr) {}
* ListNode(int x) : val(x), next(nullptr) {}
* ListNode(int x, ListNode *next) : val(x), next(next) {}
* };
*/
class Solution {
public:
ListNode* addTwoNumbe... | ALGO | 0.9999 | 6.231485 |
594cc062-faa5-47ab-83c4-17bef1b2725a | brahmirai/c-plus-plus | sumofall.cpp | #include<iostream>
using namespace std;
int main() {
int n,sum=0;
cout<<"enter the value of n:"<<endl;
cin>>n;
while(n>0)
{
sum=sum+n;
n=n-1;
}
cout<<"sum of all the number is:"<<sum<<endl;
return 0;
} | ALGO | 0.999462 | 3.333068 |
8a9f35f1-5e45-4d9c-a1e4-78a4667240b5 | AlgorithmClimbing/Algorithm | BOJ/02_Silver/S4_10816/dhl.cpp | #include <iostream>
#include <unordered_map>
using namespace std;
unordered_map<long, int> COUNT_MAP;
int N, M;
int main()
{
ios_base::sync_with_stdio(false);
cin.tie(nullptr);
cin >> N;
for (int i = 0; i < N; i++){
int v;
cin >> v;
if (COUNT_MAP.count(v) > 0){
... | ALGO | 0.999864 | 4.531415 |
b8833471-02c2-451f-ab74-7dd081e0ad89 | ishandutta2007/codeforces | crabby_maskiv/normal/1077/B.cpp | #include<bits/stdc++.h>
//#define TIME
using namespace std;
typedef long long ll;
const int maxn=100005;
const int inf=0x3f3f3f3f;
inline void read(int &x) {
int f=1;x=0;char c=getchar();
while(c<'0'||c>'9') {if(c=='-')f=-1;c=getchar();}
while(c>='0'&&c<='9'){x=(x<<1)+(x<<3)+(c^48);c=getchar();}
x*=f;
}... | ALGO | 0.999988 | 3.876704 |
2d1534b2-f1d9-4020-9f50-ca425df2177d | luisolavarria/csc222 | 1Quarter/7CHAPTER/1Set/23.cpp | #include <iostream>
using namespace std;
int f(char x) {
return x * x;
}
int f(float g) {
return int(g);
}
int f(int a, int b = 0, int c = 5) {
int total = 0;
while (--c)
total += b;
return total - a;
}
int main() {
char ch = 3;
cout << f(2, 3, 4) << f(1, 2) << f(1) << f(ch) << e... | TOOL | 0.962429 | 3.366586 |
05a3b563-62e1-4c8f-92a9-6a2b83f05386 | AndrewMaxito/Algoritmia_Y_ED | Lab4/2024_2/20192406_LAB4_P2/main.cpp |
/*
* File: main.cpp
* Author: alulab14
*
* Created on 30 de noviembre de 2024, 09:19 AM
*/
#include <iostream>
#include <iomanip>
#include "ArbolBB.h"
#include "funcionesABB.h"
#include "funcionesAB.h"
#include "Pila.h"
#include "funcionesPila.h"
using namespace std;
void ingresa_Lote(ArbolBinarioBusqueda &... | ALGO | 0.998396 | 4.314284 |
31a036dd-9f0a-44fd-8b02-78b5fabfb7f7 | NestZ/competitive-programming | AtCoder/C-TaxIncrease.cpp | #include<bits/stdc++.h>
using namespace std;
typedef long long int ll;
int main(){
int a,b;cin >> a >> b;
for(int i = 1;i <= 1300;i++){
if(int(i * 0.08) == a && int(i * 0.1) == b)return cout << i, 0;
}
cout << -1;
}
| ALGO | 0.999609 | 3.264917 |
89c41bcc-d7e1-4409-83bd-a0fe17d680e7 | WrongSandwich/programProjects | projects1/Lab05/Trout-2839780-Lab-05/exercise3/main.cpp | /* -------------------------------------------------------------------------------
* File Name: main.cpp
* Author: Evan Trout
* Assignment: EECS-168 Lab 5 - Exercise 3
* Description: This program uses a text document to store integers and display them.
* Date: 02/26/18
* ------------------------------------------... | TOOL | 0.913904 | 3.482033 |
d606b906-25a9-40f1-82a1-fdf0b6acbd42 | Yuzhou541/Algorithm_competition | 58.dividors_number.cpp | #include<iostream>
#include<algorithm>
#include<unordered_map>
using namespace std;
const int mod = 1e9 + 7;
int main()
{
int T; cin >> T;
unordered_map<int, int> h;
while(T--){
int n; cin >> n;
for(int i = 2; i <= n / i; i++){
while(n % i == 0){
h[i]++;
n = n / i;
}
}
if(n > 1) h[n]++;
}
lo... | ALGO | 0.999979 | 5.365594 |
59f212da-b7de-4d04-930a-903a1ae448af | CodeMatMaster/Projects | C++ Projects/ArrayDice/ArrayDice.cpp | // Matarr J
// Rolling N sided Dice and
// Counting what we See
// USING ARRAYS
// EGR 126 Spring 2022
//difference betweeen Indicies and line
#include <iostream>
#include <time.h>
#include <algorithm>
//#include <bits/stdc++.h>
using namespace std;
int rollDie(int sides);
int main() {
std::cout << "Hello World!... | ALGO | 0.996238 | 5.267998 |
3466e57f-d37e-489e-92da-a84dc4398a43 | sanjeev1779/codechef | segment_tree2_long.cpp | #include<iostream>
#include<vector>
#include<string.h>
#include<stdio.h>
#include<map>
#include<math.h>
#include<algorithm>
#define LL long long
#define P(N) printf("%d\n",N);
#define S(N) scanf("%d",&N);
#define SL(N) scanf("%lld",&N);
#define pb push_back
#define mp make_pair
using namespace std;
#define GETCHAR get... | ALGO | 0.998955 | 3.605948 |
b9c436f5-8810-4a2c-bd81-601b4f1e1d61 | athuls/RL_Soar | Fall2011/boost_1_46_0/libs/regex/tools/generate/tables.cpp | /*
* LOCATION: see http://www.boost.org for most recent version.
* FILE tables.cpp
* VERSION see <boost/version.hpp>
* DESCRIPTION: Generates code snippets programatically, for cut-and
* paste into regex source.
*/
#include <map>
#include <vector>
#include <string>
#i... | TOOL | 0.923812 | 4.275406 |
718c21c4-5dec-48c4-a6ca-3df5e7159730 | cmu-db/peloton | src/codegen/operator/hash_group_by_translator.cpp | #include "codegen/operator/hash_group_by_translator.h"
#include "codegen/compilation_context.h"
#include "codegen/lang/if.h"
#include "codegen/proxy/oa_hash_table_proxy.h"
#include "codegen/operator/projection_translator.h"
#include "codegen/lang/vectorized_loop.h"
#include "codegen/type/integer_type.h"
namespace pel... | ALGO | 0.963245 | 6.17989 |
70843f12-ae7a-49cb-ad21-65170436c14d | Shubhpanwar23/newrepo | Sumevenodd.cpp | #include<iostream>
using namespace std;
void sumeven(int n){
int sum=0;
for(int i=1;i<=n;i++){
if(i%2==0){
sum=sum+i;
}
}
cout<<"Sum of even numbers is "<<sum<<endl;
}
void sumodd(int n){
int sum=0;
for(int i=1;i<=n;i++){
if(i%2!=0){
sum=sum+i;
}
}
cout<<"Sum of odd numbers is "<<s... | ALGO | 0.996608 | 4.618369 |
2841744b-33b2-4757-96e0-bd806d076dec | ZCC1997Git/Lammps_gpu_local | src/INTEL/pair_tersoff_intel.cpp | // clang-format off
/* ----------------------------------------------------------------------
Contributing author: Markus Höhnerbach (RWTH)
------------------------------------------------------------------------- */
#include "pair_tersoff_intel.h"
#include "comm.h"
#include "error.h"
#include "force.h"
#include ... | ALGO | 0.972731 | 7.218229 |
36986ff1-601f-4083-a177-c401af1a0e9e | shihabcodes/Competitive-Programming | Beginner Topics/S01/EP01 - Implementation/282A - Bit++.cpp | #include <bits/stdc++.h>
using namespace std;
int main()
{
int n;
cin >> n;
int x = 0;
for (int i = 0; i < n; i++)
{
string s;
cin >> s;
if (s[1] == '+')
{
x++;
}
else if (s[1] == '-')
{
x--;
}
}
cout ... | ALGO | 0.99968 | 4.467142 |
0b18c7ed-ec35-49b2-8290-878768f83f95 | atikislam/Codeforces | Healthy_Sleep.cpp | #include<bits/stdc++.h>
using namespace std;
#define endl "\n"
void solve(){
int h;
cin>>h;
if(h<8){
cout<<"LESS"<<endl;
}else if(h==8){
cout<<"PERFECT"<<endl;
}else{
cout<<"MORE"<<endl;
}
}
int main() {
ios_base::sync_with_stdio(false); cin.tie(NULL);
int t=1;
... | ALGO | 0.998319 | 3.296191 |
64bd8221-5d6f-44da-bb8a-69ec4a87c2ff | lawy623/Algorithm_Interview_Prep | Algo/Leetcode/047PermutationII.cpp | //1. Similar to permutation. But use a set to remove duplicates.
class Solution {
public:
vector<vector<int>> permuteUnique(vector<int>& nums) {
vector<vector<int>> res;
if(nums.size()==0) return res;
if(nums.size()==1){
res.push_back(nums);
return res;
}
... | ALGO | 0.999992 | 6.177979 |
95131fd9-7696-4f22-8a93-4f4656896dc6 | msalahuddin267/Data_Structure_and_Algorithm | Algorithm/Graph/Topological Sort use DFS.cpp | #include<bits/stdc++.h>
using namespace std;
const int mx = 1e6;
vector<int> adj_list[mx];
int vis[mx];
stack<int> ans;
int n, m;
bool DFS(int src)
{
vis[src] = 1;
for(auto adj_node : adj_list[src])
{
if(vis[adj_node] == 0)
{
if(DFS(adj_node))
return true;
... | ALGO | 0.999997 | 4.487141 |
a3c361c5-a880-4c8c-acb7-b5003c4dd1d1 | SnowyTulip/-LeetCode | LeetCode100/18四数之和.cpp | #include <vector>
#include <algorithm>
using namespace std;
class Solution {
public:
vector<vector<int>> fourSum(vector<int>& nums, int target) {
int n = nums.size();
vector <vector<int>> res;
sort(nums.begin(), nums.end());
if (n < 4) return res;
long long left = 0, mid1, mi... | ALGO | 0.999969 | 5.783033 |
4b98d7af-3bcc-40e8-8ff0-246a81970f53 | Vinay1513/PetGuardian | petcare_app/windows/runner/utils.cpp | #include "utils.h"
#include <flutter_windows.h>
#include <io.h>
#include <stdio.h>
#include <windows.h>
#include <iostream>
void CreateAndAttachConsole() {
if (::AllocConsole()) {
FILE *unused;
if (freopen_s(&unused, "CONOUT$", "w", stdout)) {
_dup2(_fileno(stdout), 1);
}
if (freopen_s(&unuse... | TOOL | 0.998703 | 6.76073 |
46278a4a-ae2d-48c0-ae86-972051f7edd2 | Arigiri/Connect-Four | Connect4/AI.cpp | #include <bits/stdc++.h>
using namespace std;
typedef vector<vector<int>> state;
const int width = 7, height = 6;
state read() // read data from map
{
state mat;
freopen("map.txt", "r", stdin);
for(int i = 0; i < height; i++) {
vector <int> v;
for (int j = 0 ; j < width; j++) {
... | ALGO | 0.999817 | 4.026891 |
50567826-bdc4-45ed-8af0-a9b123a9a4a5 | roytam1/UXP | gfx/skia/skia/src/core/SkStrokerPriv.cpp | #include "SkStrokerPriv.h"
#include "SkGeometry.h"
#include "SkPath.h"
static void ButtCapper(SkPath* path, const SkPoint& pivot,
const SkVector& normal, const SkPoint& stop,
SkPath*)
{
path->lineTo(stop.fX, stop.fY);
}
static void RoundCapper(SkPath* path, const SkPo... | TOOL | 0.977029 | 6.788834 |
2a763a18-2a12-4afc-8e8d-a084dbdd8e0f | raincross7/code-similarity | codes/train_code/problem219/problem219_95.cpp | #include <bits/stdc++.h>
using namespace std;
int main() {
int N;
cin >> N;
int f = 0, j = 1;
while(N >= (j / 10)){
j *= 10;
f += N % j / (j / 10);
}
if (N % f == 0)
cout << "Yes" << endl;
else
cout << "No" << endl;
} | ALGO | 0.999867 | 3.996881 |
4762620b-6465-4527-91e0-ebc5fa7dc639 | huwenao/mteasan | llvm-project/libcxx/test/std/containers/associative/set/contains.pass.cpp | // UNSUPPORTED: c++03, c++11, c++14, c++17
#include <cassert>
#include <set>
// <set>
// bool contains(const key_type& x) const;
template <typename T, typename V, typename B, typename... Vals>
void test(B bad, Vals... args) {
T set;
V vals[] = {args...};
for (auto& v : vals) set.insert(v);
for (aut... | TEST | 0.892825 | 6.687612 |
af86d5e2-d8bc-419f-b6f0-0cde936961c1 | dvaitam/codeforces | 0-999/900-999/980-989/981/solC.cpp | #include <bits/stdc++.h>
#pragma comment(linker, "/stack:200000000")
#pragma GCC optimize("Ofast")
#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native")
#include <bits/stdc++.h>
using namespace std;
typedef long long LL;
#define lop(i,a,b) for(register int i = (a); i <= (b); ++i)
#define dlop(i,... | ALGO | 0.999928 | 3.55956 |
567958ca-35bb-40a0-8a5d-714998dbeeb7 | NightmareXIX/Competitive-Programming | leetcode/Minimum_LCM.cpp | #include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i = 0; i < (n); i++)
#define ll long long
#define lld long double
#define el '\n'
#define ws " "
#define yes cout << "YES\n"
#define no cout << "NO\n"
#define pbk push_back
#define mkp make_pair
typedef vector<int> vi;
typedef vector<ll> vl;
vo... | ALGO | 0.999718 | 4.306737 |
1c2dbf30-5197-44e4-a986-f37521d6cc40 | ishandutta2007/codeforces | 300iq/normal/682/A.cpp | #include <bits/stdc++.h>
using namespace std;
#define ll long long
#define mp make_pair
#define INF (int) 1e9 + 7;
#define left left_fenwick
#define right right_fenwick
#define fc first
#define sc second
#define pb push_back
#define endl '\n'
int main() {
ios_base::sync_with_stdio(0);
//ifstream cin("input.txt");
... | ALGO | 0.99996 | 3.643128 |
4123939e-eeb3-4f28-ba60-2e18bcbea91d | samar-gupta/DSA_POTD | GFG/Minimum sum.cpp | //updated
// Approach 1: Sort the array and distribute digits alternatively to form two numbers such that smaller digits come at higher places. Then, add the two numbers using string addition to avoid integer overflow.
// Time Complexity: O(n log n), due to sorting of the array.
// Space Complexity: O(n), for storing t... | ALGO | 0.99999 | 6.893989 |
1017154e-c808-4c82-9752-d2fa78f9dc27 | gugomea/entrega-taller | codigo_practicas/Practica 1/astmath.cpp | /* ----------------------------------------------------------------
*
* astmath.cpp
*
* this file contains miscellaneous math functions.
*
* Companion code for
* Fundamentals of Astrodynamics and Applications
* 2... | ALGO | 0.998866 | 5.652019 |
e29e1021-eac3-46c0-9219-563351fe788a | xiaoland/CaiojSolution | question_solution/second_time/1034_2.cpp | // 二叉树的后序遍历:根据一个二叉树的前序遍历和中序遍历,求出后序遍历
#include <cstdio>
#include <cstring>
#include <cmath>
using namespace std;
int n, ss;
char a[1100], b[1100], c[1100];
void dfs(int al, int ar, int bl, int br) {
if(al>ar) {
return ;
}
int lc = 0;
for(int i = bl; i <= br; i++) { // 寻找根节点
if(a[al] == ... | ALGO | 0.999988 | 3.814549 |
b960800f-a240-4313-9329-f799fa6c790f | SWMFsoftware/AMPS | srcEarth/pt.cpp | //functions used fot particle tracking
#include "pic.h"
#include "Earth.h"
bool Earth::ParticleTracker::TrajectoryTrackingCondition(double *x,double *v,int spec,void *ParticleData) {
static int cnt=0;
bool res=false;
PIC::ParticleTracker::cParticleData *ParticleTrajectoryRecord;
ParticleTrajectoryRecord=(PI... | ALGO | 0.999101 | 4.135954 |
60050b69-8e89-461f-8e68-bc04b68ae2ae | 113bommy/deepmind_codecontests_refine | cpp_gold_filter_file/cpp_train_5894_23.cpp | #include <bits/stdc++.h>
using namespace std;
namespace FGF {
int n, m;
int read() {
int s = 0, w = 1;
char ch = getchar();
while (!isdigit(ch)) {
if (ch == '-') w = -w;
ch = getchar();
}
while (isdigit(ch)) {
s = s * 10 + ch - '0';
ch = getchar();
}
return s * w;
}
const int N = 5e5 + 5;
... | ALGO | 0.999971 | 4.733703 |
0cfe85dd-49d1-4f9c-87d3-74d4f3987ae0 | ishandutta2007/codeforces | ilya_msu/normal/231/E.cpp | #define _CRT_SECURE_NO_WARNINGS
#pragma comment(linker, "/STACK:64000000")
#define _USE_MATH_DEFINES
#include<iostream>
#include<vector>
#include<string>
#include<stack>
#include<algorithm>
#include<cmath>
#include<set>
#include<queue>
#include<sstream>
#include<utility>
#include<map>
#include<ctime>
using std::pair;... | ALGO | 0.999912 | 4.555452 |
5377f212-b0b6-44b6-b6fb-806336e97b89 | PhanNgocTrieu/SWPCT | leetcode/3392.cpp | class Solution {
public:
int countSubarrays(vector<int>& nums) {
int ans = 0;
for (int i = 2; i < nums.size() ; ++i) {
ans += ((nums[i - 2] + nums[i]) * 2) == (nums[i - 1]);
}
return ans;
}
};
| ALGO | 0.999919 | 5.849251 |
c7f3468f-0160-4d11-8913-ed6148b698c0 | MustafaOzkaya1/C-LANGUAGES-APPLICATIONS | C++ PROJELER/kendi çalışmalarım/carpım tablosu.cpp | #include <iostream>
using namespace std;
int main()
{
int n;
cout << "pozitif sayi gir: ";
cin >> n;
for (int i = 1; i <= 10; ++i) {
cout << n << " * " << i << " = " << n * i << endl;
}
return 0;
}
| ALGO | 0.998461 | 3.578426 |
0bdd598b-507c-4b13-906b-bf063a7fd6c5 | kadessovb02/kadessovb02_cpp_files_contester | problem604.cpp | #include<iostream>
using namespace std;
bool boolElection(bool x, bool y, bool z){
bool ans = 0;
if (x + y + z > 1)
{
ans = 1;
}
return ans;
}
int main()
{
bool x, y, z;
cin>>x>>y>>z;
cout<<boolElection(x, y, z);
} | ALGO | 0.999644 | 4.08543 |
cd552f8c-e1d7-4c90-bab7-8adce97697ac | mosthandsomeman/LeetCode | 846.cpp | #include<vector>
#include<algorithm>
#include<map>
#include<iostream>
using namespace std;
class Solution {
public:
bool isNStraightHand(vector<int>& hand, int W) {
if (hand.size() % W != 0) return false;
map<int, int> m;
for (int i = 0; i < hand.size(); ++i) {
if (m.find(hand[i]) == m.end()) m[hand[i]] = 1;
... | ALGO | 0.999982 | 5.000085 |
077a7c95-5899-4a17-86c7-e105a31c3632 | gururaj-s/mirage | perf_analysis/gem5/src/systemc/tests/systemc/misc/synth/combo/switch3/switch3.cpp | /*****************************************************************************
switch3.cpp --
Original Author: Martin Janssen, Synopsys, Inc., 2002-02-15
*****************************************************************************/
/****************************************************************************... | TOOL | 0.925415 | 4.535574 |
81f2c2ac-462f-4cb5-a2f7-41796414d53e | JJH-Log/BaekjoonOnlineJudgeSolvedList | 202110/10M5W/B14433.cpp | #define _CRT_SECURE_NO_WARNINGS
#include <iostream>
#include <vector>
#include <string>
#include <map>
#include <queue>
#include <stack>
#include <utility>
#include <algorithm>
#include <cstring>
#include <math.h>
#include <set>
#include <cassert>
#include <sstream>
#define MOD 10007
#define BOUND 1000000000
#define MI... | ALGO | 0.999532 | 4.11069 |
a6a01244-48d7-4fa5-a8ed-816f502ad266 | ElectroBean/Code-Design | hashtables - linked list - binary tree/project2D/BinaryTree.cpp | #include "BinaryTree.h"
#include "TreeNode.h"
#include <iostream>
BinaryTree::BinaryTree()
{
m_pRoot = nullptr;
}
BinaryTree::~BinaryTree()
{
}
bool BinaryTree::GetIsEmpty() const
{
if (m_pRoot == nullptr)
{
return true;
}
else return false;
}
void BinaryTree::Insert(Node* root, int a_nValue)
{
if (root->m_... | ALGO | 0.999844 | 3.488261 |
21693c9a-d488-4dcc-9fbf-5881d380cc69 | Ash-codes18/Cpp_DSA | Programs/Leetcode/0503-next-greater-element-ii/0503-next-greater-element-ii.cpp | class Solution {
public:
vector<int> nextGreaterElements(vector<int>& nums) {
int n = nums.size();
stack<int> st;
stack<int> cyclic;
vector<int> ans(n,-1);
for(int i=n*2-1;i>=0;i--){
int num = nums[i%n];
while(!st.empty() && st.top()<=num){... | ALGO | 0.999836 | 5.461982 |
d91f9029-531a-4b2c-a641-0417efc66c3e | Estuardo2281/Proyecto-3-progra | cifrado.cpp | #include "cifrado.h"
#include <iostream>
#include <fstream>
#include <string>
#include <sstream>
#include <algorithm>
using namespace std;
string charToString(char c) {
stringstream ss;
ss << c;
return ss.str();
}
string convertirMinusculaNoVocal(char letra, const string& llave) {
string resultado;
... | ALGO | 0.997286 | 6.136157 |
7bc3ba51-ae93-4723-930b-b63811153b51 | icelostnfound/programmerinterview | CodingInterview/KthNodeFromEnd.cpp | #include <iostream>
using namespace std;
//
struct ListNode {
int val;
struct ListNode *next;
ListNode(int x) :
val(x), next(NULL) {
}
};
ListNode* FindKthToTail(ListNode* pListHead, unsigned int k) {
if (pListHead==NULL||k==0)//֤³
{
return NULL;
}
ListNode *pAhead = pListHead;
ListNode *pBehind = NULL;
... | ALGO | 0.999236 | 3.76967 |
19dea6f2-40f8-4528-a214-22136974a5de | pr-db/cp | CodeForces/1708/B.cpp | #include <bits/stdc++.h>
typedef long long int ll;
using namespace std;
#define FastIO \
ios_base::sync_with_stdio(false); \
cin.tie(NULL); \
cout.tie(NULL)
#define nl cout << "\n";
int main()
{
FastIO;
ll t;
cin >> t;
while (t--)
{
ll n, l, r;
cin >> n >> l >> r;
... | ALGO | 0.999858 | 3.125772 |
a6caa9da-39d5-404e-8f70-273a8a2ba9c2 | durjoybarua5327/Online_judge_problem_solution | leetcode/11. Container With Most Water.cpp | class Solution {
public:
int maxArea(vector<int>& height) {
int j= height.size()-1;
int i=0;
int ans=0;
while(i<j){
long long value = min(height[i], height[j]) * (j - i);
if(height[i]>height[j]){
j--;
if(ans<... | ALGO | 0.999949 | 6.438965 |
23cb9657-b8d2-4979-8d93-dc622675075a | progCyrok/bmstu_computer_networks | CLionProjects/bmstu_cpp_works/letuchka_1.cpp | #include <iostream>
char * octal(int num) {
int number = num;
int len = 3;
int ot;
bool flag;
if (number == 0) {len = 4;}
while (number != 0) {len += 1; number /= 8;}
if (num < 0) {ot = 2; flag = true;}
else {ot = 1;flag = false;}
if (flag) {len += 1;}
char* answer = new ch... | ALGO | 0.997094 | 5.481498 |
df806b16-e1c2-40cb-9e94-62a58f606bcb | armandli/rlgames | cpp/gridworld/igridworld.cpp | #include <iostream>
#include <gridworld.h>
using namespace std;
using namespace gridworld;
int main(int argc, char* argv[]){
uint dp[] = {4, 1, 1, 1, 0};
for (int i = 1; i < argc; ++i){
int p = atoi(argv[i]);
dp[i - 1] = p;
}
Action action_map[] = {Action::UP, Action::DN, Action::LF, Action::RT};
... | ALGO | 0.998013 | 4.535711 |
99348c1f-f55e-48b4-a0a0-3c147ce59d75 | Ruchit-rt/fgpa_hardware_accelerateNN | dependencies/opencv-4.5.3/modules/ml/src/lr.cpp | //
// This is a implementation of the Logistic Regression algorithm
//
#include "precomp.hpp"
using namespace std;
namespace cv {
namespace ml {
class LrParams
{
public:
LrParams()
{
alpha = 0.001;
num_iters = 1000;
norm = LogisticRegression::REG_L2;
train_method = LogisticRe... | DATA | 0.989983 | 7.40494 |
f93b499f-fa94-4252-84ca-7d09cb56ecef | mrorii/github_lda | ctr/ctr.cpp | #include "ctr.h"
#include "opt.h"
extern gsl_rng * RANDOM_NUMBER;
int min_iter = 15;
c_ctr::c_ctr() {
m_beta = NULL;
m_theta = NULL;
m_U = NULL;
m_V = NULL;
m_num_factors = 0; // m_num_topics
m_num_items = 0; // m_num_docs
m_num_users = 0; // num of users
}
c_ctr::~c_ctr() {
// free memory
if (m_b... | ALGO | 0.981228 | 5.292101 |
e2e23eb6-0414-4a6b-bad6-1d0382b5fe37 | ljmf00/lldb-d | llvm/lib/Transforms/Utils/RelLookupTableConverter.cpp | #include "llvm/Transforms/Utils/RelLookupTableConverter.h"
#include "llvm/Analysis/ConstantFolding.h"
#include "llvm/Analysis/TargetTransformInfo.h"
#include "llvm/IR/BasicBlock.h"
#include "llvm/IR/IRBuilder.h"
#include "llvm/IR/Instructions.h"
#include "llvm/IR/Module.h"
#include "llvm/InitializePasses.h"
#include "l... | TOOL | 0.872011 | 7.864927 |
c3b2fe00-01cd-498b-a31b-67a06875285c | koba-e964/contest | yukicoder/449.cpp | #include <algorithm>
#include <cassert>
#include <iostream>
#include <map>
#include <string>
#include <vector>
#define REP(i,s,n) for(int i=(int)(s);i<(int)(n);i++)
using namespace std;
typedef long long int ll;
typedef vector<int> VI;
typedef vector<ll> VL;
typedef pair<int, int> PI;
/**
* Binary Indexed Tree (Fen... | ALGO | 0.999835 | 3.735336 |
b2462801-2ff6-4848-bacc-a3616ab2b56b | lucic71/llvm-ub-free | libcxx/test/std/algorithms/alg.modifying.operations/alg.replace/replace_copy.pass.cpp | // <algorithm>
// template<InputIterator InIter, typename OutIter, class T>
// requires OutputIterator<OutIter, InIter::reference>
// && OutputIterator<OutIter, const T&>
// && HasEqualTo<InIter::value_type, T>
// constexpr OutIter // constexpr after C++17
// replace_copy(InIter first, InIte... | TEST | 0.972409 | 6.812037 |
0ca0b8d0-c799-4457-938c-282b72fba46c | ishandutta2007/codeforces | andr0901/normal/1352/E.cpp | #pragma GCC optimize("Ofast")
#include <bits/stdc++.h>
using namespace std;
//vector string deque break continue
#define forn(i, s, f) for (int i = (int)s; i < (int)f; i++)
#define ll long long
#define ull unsigned long long
#define ld long double
#define pii pair <int, int>
#define fs first
#define sc second
#define... | ALGO | 0.999271 | 4.055506 |
84a40177-f56b-414a-8cf8-3aea0cfa7800 | nguyentrungthao/HomeProject | Code/ArduinoESP32/Pheriperal/TriacDimming/triacDimming.cpp | #include "triacDimming.h"
#include <Arduino.h>
gpio_num_t triac::acdet = -1;
// uint8_t triac::u8Frequence = 0;
uint16_t triac::u16TriacHighLimit = 9600; // mặc định ở tần số 50Hz
static triac* triac_set[5] = {};
static uint8_t num_triac = 0;
// phục vụ cho việc nhận dạng tần số
#define triacSAMPLES_TO_AVERAGE 10
st... | TOOL | 0.850045 | 4.769333 |
0c475841-5541-45fd-8216-0fbbcf32b565 | pablomarin-utp/Universidad-c- | Taller vectores.cpp | /*
Nombre: Juan Pablo Marín Marín
Entregado a: CAOS
Fecha de elaboración: 13 septiembre de 2024
Versión del IDE: Devcpp 5.1
*/
#include <iostream>
#include <vector>
#include <cmath>
using namespace std;
// Función para calcular el factorial de un número
int factorial(int n) {
if (n <= 1) return 1;
return n *... | ALGO | 0.995365 | 5.337996 |
a146d6ad-71a1-45d4-ae49-acfbd3ad5311 | Robertocaetano/ESC | 06/hacker.cpp | /**
* Hacker
*
* Para compilar utilize:
* g++ hacker.cpp -std=c++11 -Wall -o hacker
*/
#include <cstdint>
#include <map>
#include <iostream>
#include <fstream>
#include <iomanip>
#include <algorithm>
#include <bitset>
namespace hacker {
class tabelasimbolo {
public:
void add_label(const std::string &symbol,... | ALGO | 0.914689 | 3.552607 |
19e0c13d-c4d6-431e-ba94-12e08ac04b7a | Kera1111/Tehnike-programiranja | ZSR/ZSR14.cpp | /*-----------------------------------------------*/
/* ZSR14 - ZADATAK 7 */
#include <iostream>
#include <fstream>
int main() {
/*Kreiranje potrebne datoteke
std::ofstream izlaz("brojevi.dat", std::ios::binary);
double niz[10] = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10};
izlaz.write(reinterpret_cast<char*>(niz), sizeof n... | TOOL | 0.912572 | 3.272447 |
6ca49150-3451-44b1-85c3-b9fb2d8f3d18 | sarvex/leetcode-io | solution/1900-1999/1903.Largest Odd Number in String/Solution.cpp | class Solution {
public:
string largestOddNumber(string num) {
for (int i = num.size() - 1; i >= 0; --i) {
int c = num[i] - '0';
if ((c & 1) == 1) {
return num.substr(0, i + 1);
}
}
return "";
}
}; | ALGO | 0.999936 | 6.176675 |
a1bafb02-aa2d-4322-af6d-45e2cb242824 | uri010/Algorithm | C++/~2023 백준 문제 풀이/1159_농구 경기.cpp | //
// Created by 김유리 on 2024/03/02.
//
#include <iostream>
using namespace std;
int N;
string firstName;
int alphabet[27];
int main() {
cin.tie(nullptr);
cout.tie(nullptr);
ios::sync_with_stdio(false);
cin >> N;
for (int i = 0; i < N; i++) {
cin >> firstName;
alphabet[firstName[0... | ALGO | 0.999907 | 5.117544 |
677bafe0-25fc-4198-a231-b2346c62a939 | beingamanforever/cses-erdos-project_euler | CSES/Movie_Festival.cpp | /**
* author: compounding
* created: 2024-09-22 18:48:17
**/
#include <bits/stdc++.h>
using namespace std;
mt19937_64 RNG(chrono::steady_clock::now().time_since_epoch().count());
#define NeedForSpeed \
ios_base::sync_with_stdio(false); \
cin.tie(NULL); \
cout.ti... | ALGO | 0.999923 | 5.281644 |
cfa9d479-e75e-4811-8d6d-1e93c884e882 | aabhinavvvvvvv/CP_CF | A_Make_It_Zero.cpp | /*
* Competitive Programming Template
* Author: Abhinav Gupta
* GitHub: @aabhinavvvvvvv
*/
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using ull = unsigned long long;
using ld = long double;
using vi = vector<int>;
using vll = vector<ll>;
using pii = pair<int, int>;
using pll = pair<ll, ll... | ALGO | 0.99981 | 3.608722 |
3c898f1c-d978-41a0-95dd-d0930041a506 | Bhhvshh/LeetCodeSolutions | 2387-partition-array-such-that-maximum-difference-is-k/2387-partition-array-such-that-maximum-difference-is-k.cpp | class Solution {
public:
void countSort(vector<int> &nums){
int maxElement = *max_element(nums.begin(),nums.end());
vector<int> fr(maxElement+1);
for(auto x:nums)
fr[x]++;
for(int i = 1;i<=maxElement;i++)
fr[i]+=fr[i-1];
vector<int> output(nums.size());
for(int i = nums.size()-1;... | ALGO | 0.999977 | 5.551311 |
56d26202-8d84-49e8-b2e0-e322e9f99d7d | AyushOJOD/DSA-codes | Leetcode/lc_3333.cpp | #include <bits/stdc++.h>
using namespace std;
class Solution
{
#define MOD 1000000007
private:
int helper(string &word, int k, int curr, int prev)
{
if (curr >= k)
{
return 1;
}
int notTake = 0, take = 0;
if (prev != -1 && word[prev] == word[curr])
... | ALGO | 0.999989 | 5.305795 |
d80bf2ce-1d69-4454-acd3-2a3f9698f2f7 | Saleh7127/CPP-solution-by-Fellow_junior | POJ/poj2229.cpp | /***
created: 2021-10-20-21.19.38
***/
#include <iostream>
#include<vector>
using namespace std;
#define ll long long
#define test int tt; cin>>tt; for(int cs=1;cs<=tt;cs++)
#define get_lost_idiot return 0
ll dp[1000002];
int main()
{
ios_base::sync_with_stdio(0);
cin.tie(0);cout.tie(0);
ll n,m,i,j,k,l=1e9;
... | ALGO | 0.999986 | 4.275302 |
624f57f8-1e09-4a82-9745-f334d39aa5e6 | tfg1434/cp | LIT/E.cpp | #include <bits/stdc++.h>
using namespace std;
using pll = pair<long long, long long>;
#define ll long long
#define all(x) (x).begin(), (x).end()
#define rall(x) (x).rbegin(), (x).rend()
#define pb push_back
#define eb emplace_back
#define f first
#define s second
template<typename A, typename B> ostream& operator<<(ost... | ALGO | 0.999889 | 4.474159 |
80374684-8fa2-430f-b4e1-860bfb3cb1c5 | FaiqQazi/leetcode_challenge | 14-longest-common-prefix/longest-common-prefix.cpp | // class Solution {
// public:
// string longestCommonPrefix(vector<string>& strs) {
// //take the first term and iterate over it to find the longest string
// if(strs.size()==1 and strs[0]==""){
// return "";
// }
// string returnst="";
// string mainst;
// ... | ALGO | 0.999605 | 6.309527 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.