uuid string | repo_name string | relative_path string | content string | category string | algo_rel_score float64 | quality_score float64 |
|---|---|---|---|---|---|---|
999ad13f-67e1-48f5-85c1-a6f786f740a4 | yongminp42/solved_ac_cpp | class2/2231.cpp | #include <iostream>
using namespace std;
int main()
{
cin.tie(nullptr);
cout.tie(nullptr);
ios::sync_with_stdio(false);
int n, temp_i, temp_num;
cin >> n;
for (int i = 1; i <= n; i++)
{
temp_i = i;
temp_num = 0;
for (int x = 10; temp_i != 0; temp_i /= x)
{
temp_num += temp_i ... | ALGO | 0.999964 | 4.423437 |
b47f0f02-7d9c-4750-af7c-018300c9f994 | MateuszSnamina/stars-ring | starsring_app/stars_ring_numerical/src/hamiltonian_creator_jabcdzx.cpp | #include <stdexcept>
#include <stars_ring_basis/raw_state.hpp>
#include <stars_ring_basis/raw_state_operations.hpp>
#include <stars_ring_numerical/hamiltonian_creator_jabcdzx.hpp>
namespace {
double phi1_id_psi2(double theta_1, double theta_2) {
return +std::cos((theta_1 - theta_2) / 2.0);
}
double phi1_tauc_psi... | ALGO | 0.966442 | 5.574933 |
d7a0d00a-1e54-4a3a-b24b-0866c8e81767 | alexandruionascu/fmi | HackerRank/fii_code_B.cpp | #include<bits/stdc++.h>
#define in cin
#define out cout
using namespace std;
ifstream f("data.in");
const int MAXSIZE = 100100;
int dp[MAXSIZE];
string marcel;
string correct;
int n;
void read() {
in >> n;
in >> marcel;
in >> correct;
}
void solve() {
int max_so_far = 0;
int max_ending_here =... | ALGO | 0.99998 | 3.927595 |
b4d72356-8f2d-4187-9b8b-067c23a12756 | salonijaiswal7412/DSA | GraphCourse-Udemy/04.Snakes And Ladders.cpp | #include<bits/stdc++.h>
using namespace std;
class Graph{
list<int> *l;
int V;
public:
Graph(int V){
this->V = V;
l = new list<int>[V+1];
}
void addEdge(int u,int v){
l[u].push_back(v);
}
int minCostBFS(int src,int dest){
queue<int> q;
vector... | ALGO | 0.999389 | 4.691472 |
9e787aad-6e07-45a8-a85a-27d993130dbc | marjanhasan/Algo-CPP | Assignment/Final Exam/Make_Palindrome.cpp | #include <bits/stdc++.h>
using namespace std;
int main()
{
// Write your code here
int t;
cin >> t;
while (t--)
{
string s1;
cin >> s1;
int n = s1.size(), dp[n + 1][n + 1];
string s2 = s1;
reverse(s2.begin(), s2.end());
for (int i = 0; i <= n; i++)
... | ALGO | 0.999977 | 5.098058 |
fad931d8-6bf1-4380-92aa-d50ba867a72f | Yashraj-sherke/DSA-Practice | Sliding window/424. Longest Repeating Character Replacement/424. Longest Repeating Character Replacement.cpp | class Solution {
public:
int characterReplacement(string s, int k) {
int n = s.size();
vector<int> freq(26, 0); // Frequency of each character
int start = 0, maxFreq = 0, maxLen = 0;
for (int end = 0; end < n; end++) {
freq[s[end] - 'A']++;
maxFreq = max(maxF... | ALGO | 0.999967 | 6.725344 |
a86ca6c9-600d-4134-887a-1d3eb88b8a51 | VDoring/CPP-My-Study-Functions | ModooCode/Switch.cpp | // Switch ؽƮ .
#include <iostream>
using std::cout;
using std::endl;
using std::cin;
int main() {
int user_input;
cout << " " << endl;
cout << "1. ̸ " << endl;
cout << "2. " << endl;
cout << "3. " << endl;
cin >> user_input;
switch (user_input) {
case 1:
cout << "DoR" << endl;
break;
case 2:
co... | TOOL | 0.884058 | 3.637516 |
b111901d-0769-48a9-a188-3db21d50c3f5 | AnJasid/questions_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.9988 | 6.76073 |
364b82cf-7a6e-45e8-b7a7-15d689018e06 | MercenariesEngineering/conan_recipes | antlr_4.8.1/src/runtime/src/atn/PredictionMode.cpp | #include "atn/RuleStopState.h"
#include "atn/ATNConfigSet.h"
#include "atn/ATNConfig.h"
#include "misc/MurmurHash.h"
#include "SemanticContext.h"
#include "PredictionMode.h"
using namespace antlr4;
using namespace antlr4::atn;
using namespace antlrcpp;
struct AltAndContextConfigHasher
{
/**
* The hash code is o... | ALGO | 0.992409 | 4.109624 |
ac900a8f-502c-444d-a650-09437f129d4a | ishandutta2007/codeforces | jtnydv25/normal/461/C.cpp | #include <bits/stdc++.h>
using namespace std;
#define ll long long
#define vi vector<int>
#define pb push_back
#define F first
#define S second
#define sd(x) scanf("%d", &(x))
const int N = 1e6 + 10;
int bit[N], A[N];
inline void update(int i, int v){
i++;
for(; i < N; i += (i & (-i))) bit[i] += v;
}
inline int ge... | ALGO | 0.999885 | 4.087334 |
88d9da73-26f1-46d1-9b40-afc33c7acbf4 | shubhansu-kr/WeeklyContest2022-Leetcode | 13_WeeklyContest310/q2.cpp | // https://leetcode.com/contest/weekly-contest-310/problems/optimal-partition-of-string/
#include <bits/stdc++.h>
using namespace std ;
class Solution {
// "gizfdfri"
public:
int partitionString(string s) {
int count = 0;
int i = 0;
while (i < s.length()) {
unordered_set<ch... | ALGO | 0.999958 | 6.00289 |
7e9364fd-b101-4b69-a1b2-35d2988700da | junhee-won/problem-solving | BOJ_2170.cpp | #include <algorithm>
#include <iostream>
#include <vector>
using namespace std;
vector<pair<int, int>> lines;
bool compare(pair<int, int> a, pair<int, int> b) { return a.first < b.first; }
int main(void) {
ios_base::sync_with_stdio(0);
cin.tie(0);
int n;
cin >> n;
for (int i = 0; i < n; i++) {
int a, ... | ALGO | 0.999669 | 4.098922 |
d1edb201-610d-4f9a-af77-37648969cb01 | DHuuNA/CodePTITcpp | CPP0139.cpp | #include<bits/stdc++.h>
using namespace std;
int ktsnt(int n){
if(n<2){
return 0;
}
for(int i=2;i<=sqrt(n);i++){
if(n%i==0){
return 0;
}
}
return 1;
}
int tcs(int n){
int sum=0;
while(n>0){
sum=sum+n%10;
n=n/10;
}
return sum;
}
int pttsnt(int n){
int sum=0;
for(int i=2;i<=sqrt(n);i++){
while(n... | ALGO | 0.999376 | 5.208695 |
322ffaf8-280d-4bfc-9ad6-6fa180677ceb | trueme521/rktotal | 3rdparty/7z/CPP/7zip/Compress/Rar1Decoder.cpp | #include "StdAfx.h"
#include "Rar1Decoder.h"
namespace NCompress {
namespace NRar1 {
static UInt32 PosL1[]={0,0,0,2,3,5,7,11,16,20,24,32,32, 256};
static UInt32 PosL2[]={0,0,0,0,5,7,9,13,18,22,26,34,36, 256};
static UInt32 PosHf0[]={0,0,0,0,0,8,16,24,33,33,33,33,33, 257};
static UInt32 PosHf1[]={0,0,0,0,0,0,4,44,60,... | ALGO | 0.961825 | 4.624828 |
a8507598-3234-47ab-a786-5dcd5f29807e | AddityaSharma/Graph | input_pattern.cpp | #include <bits/stdc++.h>
using namespace std;
// adjacency matrix representation -> undirected graph:
int main() {
int n, m;
cin >> n >> m;
// declare the adjacent matrix
int adj[n+1][n+1];
// take edges as input
for(int i = 0; i < m; i++) {
int u, v;
cin >> u >> v;
adj[u][v] = 1;
a... | ALGO | 0.999887 | 5.022033 |
d0384812-7b2b-4e00-85f7-15c0eb61c47b | kalinathalie/Sort | Ordenacao/Bubble/BubbleSort.cpp | #include "Sort.h"
void sort(int v[], int size){
int i, j;
for(i=0; i<size ; i++){
for(j=0 ; j<size-i-1 ; j++){
if(v[j] > v[j+1]){
swap(v[j], v[j+1]);
}
}
}
}
| ALGO | 0.999746 | 4.375323 |
daecfdcc-f604-4a44-aa74-717e7221d54f | HJC96/DataStructure | 4. Tree&Graph/Tree.cpp | #include <iostream>
using namespace std;
typedef struct tree* TreeNode;
typedef struct tree
{
TreeNode LeftChild;
int data;
TreeNode RightChild;
};
TreeNode Create()
{
TreeNode BinTree = new tree;
BinTree->LeftChild = NULL;
BinTree->RightChild = NULL;
BinTree->data = '\0';
return BinT... | ALGO | 0.999787 | 4.194381 |
2ced44eb-21f7-43b2-9add-baeb3326ac1b | narenderkumarnain/cp-practice | tle-2/bitmanipulation/CF_1567B_MEX_or_mixup.cpp | #include<bits/stdc++.h>
using namespace std;
/* template under progress */
#define lli long long int
#define ld long double
// modular arithemetic
mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());
/*---------------------------------------------------------------------------------------------------... | ALGO | 0.999945 | 4.405339 |
a7738784-e189-4e6f-9115-7ed8967dd671 | raincross7/code-similarity | codes/train_code/problem264/problem264_482.cpp | #include <bits/stdc++.h>
#define _GLIBCXX_DEBUG
using namespace std;
using ll = long long;
using vec = vector<ll>;
using vect = vector<double>;
using Graph = vector<vector<ll>>;
#define loop(i, n) for (ll i = 0; i < n; i++)
#define Loop(i, m, n) for (ll i = m; i < n; i++)
#define pool(i, n) for (ll i = n; i >= 0; i--)
... | ALGO | 0.999965 | 3.335616 |
2d2240b7-ec8f-4d77-be8f-30340694247b | sraihan73/Lucene- | misc/src/java/org/apache/lucene/misc/SweetSpotSimilarity.cpp | using namespace std;
#include "SweetSpotSimilarity.h"
namespace org::apache::lucene::misc
{
using ClassicSimilarity =
org::apache::lucene::search::similarities::ClassicSimilarity;
SweetSpotSimilarity::SweetSpotSimilarity()
: org::apache::lucene::search::similarities::ClassicSimilarity()
{
}
void SweetSpotSi... | TOOL | 0.962595 | 5.481765 |
f73fe829-04a1-46f0-852e-56054baca7c2 | Ivan-Nebogatikov/Homeworks | Semestr1/11/2/graph.cpp | #include <iostream>
#include "graph.h"
using namespace std;
struct Graph
{
int **array;
int vertexNumber;
};
Graph* createGraph(int vertex)
{
Graph *graph = new Graph;
graph->array = new int*[vertex];
for (int i = 0; i < vertex; ++i)
{
graph->array[i] = new int[vertex];
}
for (int i = 0; i < vertex; ++i)
... | ALGO | 0.998079 | 5.056503 |
d3093d9f-49df-43cf-81f0-19b4f596f223 | K14KHaNaSa/bojPractice | 31834.cpp | #include <iostream>
using namespace std;
int main(void) {
ios_base::sync_with_stdio(false);
cin.tie(0);
cout.tie(0);
int t, n, s, e;
cin >> t;
while (t--) {
cin >> n >> s >> e;
if ((s == n || s == 1) && (e == n || e == 1))
cout << "0\n";
else if (s == 1 || s == n || s + 1 == e || e + 1 == s)
cout <<... | ALGO | 0.99982 | 3.549937 |
d1b581f6-eb08-4bc5-92dc-a999c3277d63 | ishandutta2007/codeforces | dreamoon_love_aa/normal/1569/C.cpp | /*{{{*/
#include<cstdio>
#include<cstdlib>
#include<cstring>
#include<cmath>
#include<algorithm>
#include<string>
#include<iostream>
#include<sstream>
#include<set>
#include<map>
#include<queue>
#include<bitset>
#include<vector>
#include<limits.h>
#include<assert.h>
#define SZ(X) ((int)(X).size())
#define ALL(X) (X).be... | ALGO | 0.999976 | 4.1318 |
ba53a87e-c42a-45d1-ad39-be23695d0b15 | Kay-Rick/Algorithm | 数学/高精度乘法.cpp | /**
* @file 高精度乘法.cpp
* @author Rick (<EMAIL>)
* @version 1.0
* @date 2020-07-14 21:38:47
* @brief 一个高精度的数乘2
*
* @copyright Copyright (c) 2020 Rick, All Rights Reserved.
*
*/
/*
请注意,数字 123456789 是一个 9 位数字,完全由 1 到 9 组成,没有重复。
将其加倍,我们将获得 246913578,它恰好是另一个 9 位数字,恰好由 1 到 9 组成,只是排列不同。
现在,给定你一个 k 位的数... | ALGO | 0.999978 | 5.671769 |
e1b0b2c2-2b4c-4d27-8ee9-ceba0eeece68 | vikasjackar/cpp_programs_-codechef- | EXISTENCE.cpp | #include <iostream>
using namespace std;
int main() {
// your code goes here
int t;
cin>>t;
while(t--)
{
long long int x,y;
cin>>x>>y;
long long int lhs=(x*x*x*x) + 4*(y*y);
long long int rhs=4*(x*x)*y;
if(lhs==rhs)
cout<<"YES"<<endl;
else
cout<<"NO"<<endl;
}
return 0;
}... | ALGO | 0.999728 | 4.416996 |
c3b075a3-02b4-4686-b938-7ada87a496bf | Sifat-00/week1 | week1/Day 5/YetnotherrokenKeoard.cpp | #include<bits/stdc++.h>
using namespace std;
int main()
{
int t;
cin >> t;
while(t--)
{
string ar;
cin >> ar;
reverse(ar.begin(),ar.end());
int sam = 0;
int cap = 0;
string ans;
for(int i=0;i<ar.size();i++)
{
if(ar[i] == 'b')
... | ALGO | 0.999912 | 4.662739 |
bbd0e0ea-e2b1-403a-8724-c107c1734390 | ishandutta2007/codeforces | davidberard/normal/1534/E.cpp | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef long double ld;
const int N = 1010;
const int INF = 0x3f3f3f3f;
const int ss = N-2, tt = N-1;
struct Edge { int v, r; ll f, c, p; };
vector<Edge> adj[N]; int sz[N]; ll mc;
vector<Edge> mcf_edges; // for mcf on large graphs with negative costs... | ALGO | 0.999801 | 3.316054 |
53fd41ed-5dcb-4c90-9e09-3eb80462174f | colemaxwell/cs225a_project | project/python/stockfish_15_linux_x64/stockfish_15_src/src/movepick.cpp | #include <cassert>
#include "bitboard.h"
#include "movepick.h"
namespace Stockfish {
namespace {
enum Stages {
MAIN_TT, CAPTURE_INIT, GOOD_CAPTURE, REFUTATION, QUIET_INIT, QUIET, BAD_CAPTURE,
EVASION_TT, EVASION_INIT, EVASION,
PROBCUT_TT, PROBCUT_INIT, PROBCUT,
QSEARCH_TT, QCAPTURE_INIT, QCAPTURE,... | ALGO | 0.997687 | 7.802533 |
e64137d9-bab2-464f-9905-d8adf28bac99 | abhishekGarg26/Strivers-SDE-Sheet-Challenge-2023 | String/Reverse Words in a String.cpp | #include <bits/stdc++.h>
using namespace std;
// Recursive solution
class Solution {
public:
string func(string s,int ind,string &str){
string t="";
for(int i=ind;i<s.size();i++){
if(!t.size() && s[i]==' ') continue;
else if(s[i]!=' '){
t+=s[i];
... | ALGO | 0.999972 | 6.103241 |
a5c6c41f-89fd-4b09-b042-f3776c1fbf6c | RoelYoon/USACO-Training | Bronze/2024 December/Mooing Time/[TLE] moo.cpp | #include <iostream>
#include <vector>
#include <string>
#include <algorithm>
#include <set>
using namespace std;
class KMP{
string &P;
int m;
vector<int> reset;
public:
KMP(string &s):P(s),m(P.size()),reset(m){
int i=0,j=-1; reset[i]=j;
while(i<m){
while(j>=0 && P[i]!=P[j... | ALGO | 0.999861 | 3.191212 |
4d9c3f56-8629-4874-9181-47a48ef9acf5 | captabhi/CodechefArchive | Nov long challenge/nov5.cpp | #include<iostream>
using namespace std;
int main()
{
unsigned long long int n,q,L,R,x,y,l,r,temp,i,cnt=0,j,k,maxelm;
cin>>n>>q>>L>>R;
unsigned int arr[n+1]={0};
for(i=0;i<q;i++)
{
cin>>temp;
if(temp==1)
{
cin>>x>>y;
arr[x]=y;
}
else if(temp==2)
{
cnt=0;
cin>>l>>r;
for(j=l;j<=r;j++)
{
... | ALGO | 0.999868 | 3.408386 |
f1fb0a66-4214-4618-ab09-22376ea9e0ce | truongnh16072000/C- | contest7/bai6.cpp | #include<iostream>
#include<stack>
using namespace std;
string s;
void result()
{
stack<char> sta;
int kt=0;
for (int i=0;i<s.length();i++)
{
if (s[i]==')')
{
bool check = false;
while (sta.top()!='(')
{
char temp = sta.top();
... | ALGO | 0.999883 | 4.195622 |
48ea0a63-6626-41c9-9baa-0b9f469394fd | NandiSoham/Leetcode-POTD-Daily-Coding-Challenge | Year 2024/07_July/day27_2976. Minimum Cost to Convert String I.cpp | // Problem Link -> https://leetcode.com/problems/minimum-cost-to-convert-string-i/description/
class Solution {
public:
void FloydWarshall(vector<vector<long long>> &distanceMatrix, vector<char>& originalChars, vector<char>& changedChars, vector<int>& conversionCosts) {
for(int i = 0; i < originalChar... | ALGO | 0.99998 | 6.19733 |
6498e405-5957-4f3e-b988-85bb64699df6 | robthebloke/libASM | src/08_custom_functions.cpp | #include "examples.h"
// Here are a couple of pointless functions we want to register.
// Ensure the methods are using the vectorcall calling convention.
// For some reason, only zero or one arg methods are working :(
__m256 __vectorcall func0()
{
return _mm256_set1_ps(69.0f);
}
__m256 __vectorcall func1(__m256 a)... | TOOL | 0.875561 | 4.479614 |
f6bb962a-5fa2-4487-80b0-7d1b0777cac5 | coouir/codetree-TILs | 250110/빙빙 돌며 사각형 채우기/snail-alphabet-square.cpp | #include <iostream>
using namespace std;
int n, m;
char arr[100][100];
int r, c;
int dr[4]={0, 1, 0, -1}, dc[4]={1, 0, -1, 0}, dir_num;
bool InRange(int r, int c) {
return ((0<=r&&r<n) && (0<=c&&c<m));
}
int main() {
// Please write your code here.
cin >> n >> m;
int cnt = 65;
arr[r][c] = char(cn... | ALGO | 0.999591 | 3.478121 |
3d33b0e7-3d2d-42d7-8f84-e951682e49fa | Buenoscoin/Buenoscoin | src/crypto/hmac_sha256.cpp | #include "crypto/hmac_sha256.h"
#include <string.h>
CHMAC_SHA256::CHMAC_SHA256(const unsigned char* key, size_t keylen)
{
unsigned char rkey[64];
if (keylen <= 64) {
memcpy(rkey, key, keylen);
memset(rkey + keylen, 0, 64 - keylen);
} else {
CSHA256().Write(key, keylen).Finalize(rke... | ALGO | 0.985362 | 5.856034 |
16051d0d-e9ba-4123-be98-94202e20c730 | Taufique-07/Cpp | Reverse.Stack.cpp | #include<iostream>
#include<stack>
using namespace std;
void bottom(stack<int> &st,int element){
if(st.empty()){
st.push(element);
return;
}
int topelement=st.top();
st.pop();
bottom(st,element);
st.push(topelement);
}
void reverse(stack<int> &st)
{
if (st.empty()){... | ALGO | 0.999931 | 4.49699 |
8cb98d30-7018-4bea-b22a-ba7191388e6e | Jhonnatan7br/Non-Linear-problems | Discret Differential geometry/deps/polyscope/src/disjoint_sets.cpp | using std::vector;
namespace polyscope {
// Constructor
DisjointSets::DisjointSets(size_t n_) : n(n_), parent(n + 1), rank(n + 1) {
// Initialize all elements to be in different sets and to have rank 0
for (size_t i = 0; i <= n; i++) {
rank[i] = 0;
parent[i] = i;
}
}
// Find parent of element x
size_t ... | ALGO | 0.995804 | 6.205972 |
e7dd8f1f-6e22-459c-819c-9bffaffa1e25 | antonpannekoek/kariba | src/ShSDisk.cpp | #include <cmath>
#include <iostream>
#include <gsl/gsl_integration.h>
#include "kariba/ShSDisk.hpp"
#include "kariba/constants.hpp"
namespace kariba {
//! Constructor for the disk. No input parameters because the sized of the arrays
//! is set automatically, and every other property needs to be handled by the
//! s... | ALGO | 0.865433 | 7.079218 |
8e7aa9c4-9890-497a-9639-946d5b495e2d | alifjobaer12/solve_problem | B - ICPC Balloons.cpp | // starting with the name of almighty ALLAH //
// ~ HI I'M alifjobaer12 ~ //
// ^.^ TARGET NEXT ICPC REGION ^.^ //
#include <bits/stdc++.h>
#include <unistd.h>
// #include <ext/pb_ds/assoc_container.hpp> // Common file
// #incl... | ALGO | 0.999531 | 4.274336 |
9d30ae95-bc89-4206-99f4-916646013bf0 | EtisPatNet/EPN | src/pubkey.cpp | #include <pubkey.h>
#include <secp256k1.h>
#include <secp256k1_recovery.h>
namespace
{
/* Global secp256k1_context object used for verification. */
secp256k1_context* secp256k1_context_verify = nullptr;
} // namespace
/** This function is taken from the libsecp256k1 distribution and implements
* DER parsing for EC... | TOOL | 0.931376 | 7.390124 |
a4b97189-2cc8-4cd2-96b1-58ab8cdf5e69 | sanchit-sinha/CP | Contests/Codeforces/CF-Contest/1586/C/sol.cpp | #include "bits/stdc++.h"
using namespace std;
#define f first
#define s second
#define pb push_back
#define ll long long
#define ld long double
#define lb lower_bound
#define ub upper_bound
#define m... | ALGO | 0.999961 | 4.398124 |
fc63ddcb-aeef-4191-8d17-dfdbf0d019ed | Bhavik1603/My-Leetcode-Solutions | My Leetcode Solutions/Count Hills and Valleys in an Array/Count Hills and Valleys in an Array.cpp | // https://leetcode.com/problems/count-hills-and-valleys-in-an-array
class Solution {
public:
int countHillValley(vector<int>& nums) {
int res = 0;
nums.erase(unique(nums.begin(),nums.end()),nums.end());
for(int i = 0; i < nums.size(); i++)
cout << nums[i] << " ";
for(int i... | ALGO | 0.999994 | 5.526729 |
4dafd47c-c08c-4dbe-b21a-55843f172fe2 | bluster980/Leetcode-Solutions | 0700-search-in-a-binary-search-tree/0700-search-in-a-binary-search-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.999997 | 5.994936 |
13a27abd-a0f8-42e2-9e35-08c3e9783af4 | ayushman-sinha/My-LeetCode-Solutions | valid-palindrome/Accepted/8-10-2021, 2_53_10 PM/Solution.cpp | // https://leetcode.com/problems/valid-palindrome
class Solution {
public:
bool isPalindrome(string s) {
if(s.length()>83000)
return true;
if(s=="")
return false;
string str="";
string rev="";
for(int i=0;i<s.length();i++)
{
... | ALGO | 0.999759 | 6.188158 |
a5ac5919-7006-4c0f-9db6-c97e65ca4edc | setak482/2022_BOJ_solved | Gold/G1/16991 외판원 순회 3.cpp | #include <bits/stdc++.h>
#define point pair<int, int>
#define INF 987412365
using namespace std;
int siz;
double graph[16][16];
double dp[16][1 << 16];
double dist(point a, point b){
return abs(sqrt((a.first-b.first)*(a.first-b.first)+(a.second-b.second)*(a.second-b.second)));
}
double dfs(int cur, int visited){
... | ALGO | 0.999841 | 3.485425 |
6a7c1886-8892-49df-8bbf-772c73c1d2ae | Ruki2626/Data-Structure-and-Algorithm | naive Shuffle/Naive_Shuffle.cpp | #include<iostream>
#include<random>
using namespace std ;
void swap(int *a, int *b)
{
int temp = *a;
*a = *b;
*b = temp;
}
void Naive_Shuffle(int x[] , int n)
{
int pick;
int y[n];
for(int i=0;i<n;i++){
do{
pick = rand() % n ;
}while(x[pick] == 0);
y[i] = x[pick] ;
x[pick] = 0;
}
for(int ... | ALGO | 0.999939 | 3.364308 |
91f8a78f-32dd-492a-aab1-651d2e16c4f9 | yuchen123450/Ece4960 | Assignment#1/check.cpp | #include <iostream>
#include <cstdio>
#include <cmath>
#include "check.h"
using namespace std;
struct floatingNumber
{
unsigned int sign;
unsigned int mantissa;
unsigned int exponent;
};
floatingNumber Getfloatingformat(float InputValue)
{
floatingNumber floatform;
unsigned int crazybinary, man... | ALGO | 0.993685 | 3.664519 |
9e8d8327-cf12-4644-96d2-d754895bbaea | tbielak/AoC_cpp | sources/2020/2020_06.cpp | #include "2020_06.h"
namespace Day06_2020
{
AoC::Output Main::both_parts(const vector<string>& input)
{
vector<string> sinput = input;
sinput.push_back("");
sinput.push_back("");
vector<size_t> result(2);
for (size_t part = 1; part <= 2; part++)
{
int group = 0;
size_t sum = 0;
bool next_group ... | ALGO | 0.976723 | 5.559693 |
e055747d-3979-4846-8144-e2c646d72729 | June060522/Algorizm | CodingTest/백준 10951.cpp | #include <iostream>
using namespace std;
int main()
{
int a, b;
do
{
a = 0;
b = 0;
cin >> a >> b;
if (a + b > 0)
{
cout << a + b << endl;
}
} while (a + b != 0);
} | ALGO | 0.993069 | 3.160472 |
35088728-1b0a-43b8-b728-208aa5e063c9 | adarshranjan36/HackerRank_MountBlue_Job_Challenge | JumpingOnTheClouds.cpp | #include<bits/stdc++.h>
using namespace std;
int main(){
int n,k;
cin>>n>>k;
vector<int>arr(n);
for(int i=0;i<n;i++){
cin>>arr[i];
}
int energy=100;
int i=0;
do{
i=(i+k)%n;
energy--;
if(arr[i]==1){
energy-=2;
}
}
while(i!=0);
cout<<energy;
return 0;
}
| ALGO | 0.999956 | 3.3508 |
387cf618-0285-4646-9959-e3a77d975909 | WanxiaJaneYang/Scheduler | compute_stats.cpp | /*
created by Andrey Kan
<EMAIL>
2021
*/
#include <iostream>
#include <fstream>
#include <vector>
class Customer
{
public:
int priority;
int arrival_time;
int slots_remaining; // how many time slots are still needed
int response_time;
Customer(int par_priority, int par_arrival_time, int par_slots_... | ALGO | 0.959004 | 4.924438 |
4f0dff16-4f73-4b19-af3b-88b8508edd3f | notfay/College-Stuff | DataStructure/disointset.cpp | #include <stdio.h>
#define MAX 100
int parent[MAX];
int rank[MAX];
//void makeSet(int v) {
// parent[v] = v;
//}
//
//int findSet(int v) {
// if(v == parent[v]) {
// return v;
// }
// return findSet(parent[v]);
//}
//
//void unionSet(int a, int b) {
// a = findSet(a);
// b = findSet(b);
//
// if(a != b) {
// pare... | ALGO | 0.999411 | 4.276596 |
148c2be9-35bc-4f8d-b5de-0809f3a98bdc | Himanshu14Ag/DSA | DSA_Graphs/BridgesInGraph.cpp | //{ Driver Code Starts
#include<bits/stdc++.h>
using namespace std;
// } Driver Code Ends
//User function Template for C++
class Solution {
int timer = 1;
public:
void dfs(int node,int parent,vector<int>& visited,vector<int> adj[],
int tim[],int low[],vector<vector<int>>& bridges){
... | ALGO | 0.999969 | 5.441576 |
ed4be518-a9a9-4610-838a-a3c0efbff473 | Jubayer-Ahmed-Sajid/warm-up | B_Who_is_missing.cpp | #include <bits/stdc++.h>
using namespace std;
int main()
{
ios::sync_with_stdio(false);
cin.tie(nullptr);
// Your code here
int n;
cin >> n;
int v[4 * n - 1];
for (int i = 0; i < 4 * n - 1; i++)
{
cin >> v[i];
}
int v2[n + 1] = {0};
for (int i = 0; i < 4 * n - 1; i+... | ALGO | 0.999978 | 3.879393 |
0a0d0343-f714-4de5-9f05-a9aaf10064db | mdsazibhossenrabby/CPP | LearningStructureProgramming/LottaryPicker.cpp | #include <iostream>
#include <ctime>
using namespace std;
int main(void){
srand(time(NULL));
cout<<"<<<<<<Lottery's Givaway>>>>>>>>>>>\n"
"0. Samsung S23 Ultra\n"
"1. Iphone 16 Pro MAX\n"
"2. SMART TV 20``\n"
"3. Washing Machine\n"
"4. MUG\n";
cout<<"Enter a number 0 ... | TOOL | 0.945915 | 3.157235 |
e9cd0b2f-d679-4f42-803f-e90adeede13b | rohmish2/spoj_solutions | SPOJSOLUTIONS/RLE.cpp | // Problem: RLE
// Submission ID: 26158781
// Language: 4560
#include<bits/stdc++.h>
using namespace std;
int main()
{ char k[100010];
while(scanf("%s",k)!=EOF)
{ auto p=k[0];
int n=1;
for(int i=1;i<strlen(k);i++)
{ //cout<<n<<" "<<p<<" "<<k[i]<<endl;
if(p!=k[i])
{// cout<<"muth";
... | ALGO | 0.999869 | 3.321585 |
d5ae5856-1abd-4f3f-87bf-e4ec7efc7be2 | Liam-Tucker3/competitive-programming-solutions | kattis/inversefactorial.cpp | #include <cmath>
#include <cstring>
#include <iostream>
#include <sstream>
#include <string>
using namespace std;
int main(int argc, char *argv[]) {
string val;
cin >> val;
int count = val.length();
if (count <= 10) {
int num = stoi(val);
int curr_val = 1;
while (num != 1) {
num = num / cur... | ALGO | 0.999942 | 4.055262 |
b09fa5c8-56fd-4b38-b688-6f24f2dc85e3 | figlerg/dtu-rendering | raytrace/MerlTexture.cpp | #include <iostream>
#include <optix_world.h>
#include "BRDF.h"
#include "MerlTexture.h"
#include "mt_random.h"
using namespace std;
using namespace optix;
void MerlTexture::load(const char* filename)
{
const unsigned int MERL_SIZE = BRDF_SAMPLING_RES_THETA_H*BRDF_SAMPLING_RES_THETA_D*BRDF_SAMPLING_RES_PHI_D/2*3;
... | ALGO | 0.946638 | 4.331275 |
f0c3c21f-55d2-4068-8bb5-192eaff1370a | Foysal-Munsy/Rush-Roadmap | Week-30/Day 07/A_Odd_One_Out.cpp | //
// Created by Foysal Munsy on 28 / 12 / 2023
// Time: 20 : 36 : 40
//
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef long double ld;
#define nl '\n'
#define all(x) x.begin(), x.end()
#define rall(x) x.rbegin(), x.rend()
#ifdef LOKAL
#include "DEBUG_TEMPLATE.h"
#else
#define HERE
#define ... | ALGO | 0.999851 | 5.569567 |
1d510074-f0e8-4ef0-8553-1c2e46c0bbbe | 113bommy/deepmind_codecontests_refine | cpp_source_filter_file/cpp_train_6112_32.cpp | #include <bits/stdc++.h>
using namespace std;
void FastInputOutput() {
ios_base::sync_with_stdio(0);
cin.tie(0);
cout.tie(0);
}
long long binaryToDecimal(string n) {
string num = n;
long long dec_value = 0;
int base = 1;
int len = num.length();
for (int i = len - 1; i >= 0; i--) {
if (num[i] == '1')... | ALGO | 0.999994 | 3.347092 |
9fda5d9b-06f5-4f98-987f-2f5240499d45 | kkkgim/2025_study | c++/baekjoon/1764.cpp | #include <iostream>
#include <string>
#include <set>
#include <algorithm>
using namespace std;
int main() {
// C 스타일 입출력과의 동기화 해제
ios::sync_with_stdio(false);
// cin과 cout을 분리하여 실행 속도 향상
cin.tie(NULL);
int n,m;
std::cin >> n >> m;
set<string> no_listen;
set<string> no_see;
... | ALGO | 0.999929 | 3.847507 |
97351b0d-c9a0-40d1-b9ef-8cc9e0d40839 | SimonReese/Pool-Game-Tracking | src/BallDetector.cpp | /**
* @author Alessandro Bozzon
*/
#include <iostream>
#include <opencv2/core.hpp>
#include <opencv2/highgui.hpp>
#include <opencv2/imgproc/imgproc.hpp>
#include <fstream>
#include "BallDetector.h"
#include "TableSegmenter.h"
#include "Ball.h"
cv::Vec3b BallDetector::fieldMeanColor(const cv::Mat& image, int kernel_s... | ALGO | 0.995124 | 5.492993 |
eb95391c-7bf7-42bc-b2ee-6ba57c07c76e | pingany/poj | 3017/10746254_TLE.cpp | #include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <iostream>
#include <algorithm>
#include <vector>
#include <string>
#include <set>
using namespace std;
#define INLINE inline
#ifdef LOCAL
#define ASSERT(x) {if(!(x)) __asm{int 3};}
#else
#define ASSERT(x)
#endif
#define MAX_INT 0x7fffffffL
#define f... | ALGO | 0.999963 | 3.42959 |
404534cd-05da-4742-8b00-a6317aa10f79 | alicevision/mayaAPI | 2016.sp1/linux/devkit/plug-ins/threadTestWithLocksCmd/threadTestWithLocksCmd.cpp | #include <math.h>
#ifndef _WIN32
#include <unistd.h> // for sleep
#endif
#include <maya/MIOStream.h>
#include <maya/MSimple.h>
#include <maya/MTimer.h>
#include <maya/MGlobal.h>
#include <maya/MThreadAsync.h>
#include <maya/MThreadPool.h>
#include <maya/MSpinLock.h>
#include <maya/MMutexLock.h>
DeclareSimpleCommand... | TOOL | 0.993244 | 6.081768 |
be119568-c2fa-4d3b-bea6-0cb0011d0e35 | dokinkon/FMFST | source/fmfst.cpp | #include "fmfst.h"
#include "node.h"
#include "pathweighteditor.h"
#include "nodeeditor.h"
#include "graphicsscene.h"
#include <cassert>
struct FMFST::Private
{
QVector<Node> mNodes;
Node findNode(int nodeId);
};
Node FMFST::Private::findNode(int nodeId)
{
foreach (const Node& node, mNodes) {
if (... | ALGO | 0.998091 | 4.479659 |
33095342-bb86-46d3-9e9c-dbed4318c73c | dralves/sp1-sp2-galois | lonestar/sssp/bf/bloom_filter/counting.cpp | #include <bloom_filter/counting.hpp>
#include <algorithm>
#include <cassert>
namespace bf {
counting_bloom_filter::counting_bloom_filter(hasher h, size_t cells,
size_t width, bool partition)
: hasher_(std::move(h)), cells_(cells, width), partition_(partition) {
}
voi... | ALGO | 0.991088 | 7.21202 |
7f3ce0f0-dc5f-47b5-9fe3-cf17c20e57d2 | khaledsliti/CompetitiveProgramming | AtCoder/abc237/E.cpp | // RedStone
#include <bits/stdc++.h>
using namespace std;
#define pb push_back
#define mp make_pair
#define endl '\n'
#define D(x) cerr << #x << " = " << (x) << '\n'
#define sz(x) ((int)(x).size())
#define all(x) (x).begin(), (x).end()
#define rall(x) (x).rbegin(), (x).rend()
typedef long long ll;
const int N = 2e5 + ... | ALGO | 0.999929 | 4.443618 |
8a07497d-8b75-4d73-b406-62735ff5e848 | atharvarekhawar/Leetcode_codes | 42-trapping-rain-water/trapping-rain-water.cpp | class Solution {
public:
int trap(vector<int>& height) {
int n = height.size();
int l=0;
int r=n-1;
int leftMax=0;
int rightMax=0;
int res=0;
while(l<=r){
if(height[l]<=height[r]){
if(height[l]>=leftMax){
leftMa... | ALGO | 0.999987 | 6.820823 |
e1aece87-8ceb-4007-ab96-8d6edf34907e | naxocist/naxocist-cp | CEDT/ovenbreak/C09.cpp | #include <bits/stdc++.h>
using namespace std;
#define ln '\n'
#define ll long long
#define all(x) begin(x), end(x)
#define pb emplace_back
int32_t main() {
cin.tie(nullptr)->sync_with_stdio(0);
int n; cin >> n;
ll a = 0, b = 1, r = 1;
for(int i=2; i<=n; ++i) {
ll c = a + b;
a = b, b = c, r += b;
}
... | ALGO | 0.999929 | 4.115182 |
2e405cf6-c9d6-49ab-9381-7dcde070b720 | microsoft/Frigatebird | libraries/APM_Control/AP_PitchController.cpp | // Initial Code by Jon Challinger
// Modified by Paul Riseborough
#include <AP_HAL/AP_HAL.h>
#include "AP_PitchController.h"
extern const AP_HAL::HAL& hal;
const AP_Param::GroupInfo AP_PitchController::var_info[] = {
// @Param: TCONST
// @DisplayName: Pitch Time Constant
// @Description: This controls the time ... | TOOL | 0.870733 | 5.899878 |
f1bb6a56-6b82-48b8-ae1d-d0eab2ebddeb | pralinkhaira/gfg-soln | Difficulty: Medium/Longest Substring with K Uniques/longest-substring-with-k-uniques.cpp | class Solution {
public:
int longestKSubstr(string &s, int k) {
// code here
int bptr=0,ans=-1,n=s.size();
unordered_map<char,int>mp;
for(int i=0;i<n;i++){
mp[s[i]]++;
if(mp.size()==k){
ans=max(ans,i-bptr+1);
}
else{
... | ALGO | 0.99994 | 5.785487 |
cd3e9164-be9a-4615-8581-61d6744f3f99 | ywh3589/BOJ | 2953/main.cpp | #include <cstdio>
using namespace std;
int main() {
int i, j, k, s, m = 0, p = 0;
for (i = 1; i <= 5; i++) {
s = 0;
for (j = 0; j < 4; j++) {
scanf("%d", &k);
s += k;
}
if (m < s) {
m = s;
p = i;
}
}
printf("%d %d", p, m);
} | ALGO | 0.999697 | 3.171046 |
6c4adc50-ab32-4875-978c-9fbb64da8951 | apietruszka/PROI_lab1 | Numbers.cpp | #include <iostream>
#include <stdlib.h>
#include <vector>
#include "Numbers.h"
using namespace std;
Numbers::Numbers(std::vector<int> V)
{
for(int i=0;i<V.size();i++)
{
if (V[i]<1000 || V[i]>9999)
{
cout << "Constructor error. Number in wrong range" << endl;
}
}
cout<<"Creating Numbers objec... | TOOL | 0.989137 | 4.185927 |
f5e144fe-d8e4-4e73-8baa-1775d3fdf7f1 | Abdullah-F/My-programming-practice-cpp | 30DayOfCodes/Day 12Inheritance/main.cpp | #include <iostream>
#include <vector>
using namespace std;
class Person{
protected:
string firstName;
string lastName;
int id;
public:
Person(string firstName, string lastName, int identification){
this->firstName = firstName;
this->lastName = lastName;
this->id = identification;
}
... | TOOL | 0.985411 | 5.097694 |
4a8a087e-f674-4bc7-af62-94da903d1df4 | xianyun2014/data-struct_and_algorithm | 二叉树 - 二叉排序树/1.cpp |
#include "binarytree.h"
int main()
{
binarytree<int> tree(12);
for (int i = 0; i < 20; i++)
tree.insert(rand()%300);
tree.inorder();
std::cout <<std::endl;
tree.levelorder();
std::cout <<std::endl <<tree.high() <<std::endl << tree.number() <<std::endl;
return 0;
} | ALGO | 0.977427 | 4.90231 |
9ca75a22-a672-4858-95dd-61b73c9a20a5 | yash-gargji/codeforces-solution | G_1_Min_Fund_Prison_Easy.cpp | #include<bits/stdc++.h>
using namespace std;
int timer = 1;
long long dfs(int node,vector<vector<int>>&adj,int parent,vector<int> &vis,vector<int> &tin,vector<int> &low,vector<vector<int>> &ans,vector<long long >&size){
vis[node] = 1;
tin[node] = timer;
low[node] = timer;
timer++;
... | ALGO | 0.999946 | 4.539986 |
186fcaab-0c19-4d6b-bf7b-7e9abb970411 | lgmamaniap/leet-code-practice | exercises/easy-level/228.cpp | // 228. Summary Ranges
#include <iostream>
#include <vector>
using namespace std;
string retStr(int i, int j, vector<int> &nums) {
string resp;
if (i == j) {
resp = to_string(nums[i]);
return resp;
}
resp = to_string(nums[i]) + "->" + to_string(nums[j]);
return resp;
}
vector<string> summaryRanges(... | ALGO | 0.999937 | 6.133043 |
a89120e9-984f-42f0-8eb8-eb97a1fc2dad | sherifshouaib/movie_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.9988 | 6.76073 |
c4b41e8c-6720-40fd-8639-9c40bf9e7820 | Jamham1020/final-projects | CST-370-Algorithms/HW 3/main_hw3_1.cpp | /*
* INSTRUCTION:
* This is a C++ starting code for hw3_1.
* When you finish the development, download this file.
* Note that the current filename is "main.cpp".
* But rename it to "main_hw3_1.cpp".
* After that, upload the renamed file on Canvas.
*/
// Finish the head comment with Abstract,... | ALGO | 0.999839 | 5.273172 |
0e9859b7-67af-480c-a266-c50de124635f | amha-kindu/competitive-programming | 0560-subarray-sum-equals-k/0560-subarray-sum-equals-k.cpp | class Solution {
public:
int subarraySum(vector<int>& nums, int k) {
unordered_map<int, int> prefixCount({{0,1}});
int prefix=0, count=0;
for(int num: nums){
prefix+=num;
if(prefixCount.find(prefix-k)!=prefixCount.end())
count+=prefixCount[prefix-k];
... | ALGO | 0.999926 | 6.200021 |
2cd00195-6531-43fd-bf94-38468af924e8 | xymelon/leetcode | C++/Remove Duplicates from Sorted List.cpp | #include<iostream>
using namespace std;
struct ListNode {
int val;
ListNode *next;
ListNode(int x) : val(x), next(NULL) {}
};
void printList(ListNode* head){
while(head){
cout<<head->val<<"->";
head = head->next;
}
cout<<"NULL"<<endl;
}
class Solution {
public:
ListNode *... | ALGO | 0.999869 | 5.050963 |
d4405294-5a4e-46fe-a319-24d07562a478 | miwucy/LeetCode | 0973-k-closest-points-to-origin/0973-k-closest-points-to-origin.cpp | class Solution {
public:
vector<vector<int>> kClosest(vector<vector<int>>& points, int k) {
priority_queue<pair<int,pair<int,int>>> pq;
vector<vector<int>> ans;
for(vector<int> p:points) {
int dist=pow(p[0], 2)+pow(p[1], 2);
pq.push({dist,{p[0], p[1]}});
i... | ALGO | 0.999996 | 5.921041 |
f7b7685b-e537-4536-9d12-3105441ecc66 | phUR99/ps | 2025/05/본대_산책_2.cpp | #include <bits/stdc++.h>
using namespace std;
#define ll long long
const ll MOD = 1e9 + 7;
const vector<vector<ll>> v = {
{0, 1, 1, 0, 0, 0, 0, 0},
{1, 0, 1, 1, 0, 0, 0, 0},
{1, 1, 0, 1, 1, 0, 0, 0},
{0, 1, 1, 0, 1, 1, 0, 0},
{0, 0, 1, 1, 0, 1, 0, 1},
{0, 0, 0, 1, 1, 0, 1, 0},
{0, 0, 0, 0, 0... | ALGO | 0.999988 | 4.483998 |
93e2ab3a-cb1f-47ef-afba-6260a0efbc3c | icelemon233/ECH-Leetcode | 数组/差分数组/todo2132.用邮票贴满网格图.cpp | /*
* @lc app=leetcode.cn id=2132 lang=cpp
*
* [2132] 用邮票贴满网格图
*/
// @lc code=start
#include <vector>
using namespace std;
class Solution
{
public:
bool
possibleToStamp(vector<vector<int>> &grid, int stampHeight, int stampWidth)
{
int m = grid.size(), n = grid[0].size();
// 1. 计算 grid ... | ALGO | 0.999658 | 7.313433 |
c83cdac9-358f-4b94-a2e7-33d30f5b8b18 | SaurabhP7/FastDSA | 2pointerWA.cpp | #include<bits/stdc++.h>
using namespace std ;
typedef long long ll ;
void solve(){
int n,sum ;
cin>>n>>sum ;
int a[n] ;
for(int i=0;i<n;i++){
cin>>a[i] ;
}
int var_sum=0 ;
for(int l=0,r=0;l<n;l++){
cout<<var_sum<<"\n" ;
while(var_sum+a[r]<=sum){
var_sum=var_sum+a[r] ;
r++ ;
}
//cout<<var_s... | ALGO | 0.999486 | 3.776532 |
8166f3d8-d78e-477b-ae96-96549d22ab94 | bye1009/leecode | 数组/二分/35_搜索插入位置.cpp | #include <vector>
#include <iostream>
using namespace std;
class Solution {
public:
int search(vector<int>& nums, int target) {
int left = 0;
int right = nums.size() - 1;
while (left <= right){
int mid = left + (right - left)/2;
if (nums[mid] > target){
... | ALGO | 0.999971 | 5.465404 |
5f12d173-9682-495c-a594-6a37350810f4 | greenbeanpie/OI-training | NOIP2023-ZJ/ZJ-0778/Bgen.cpp | #include <bits/stdc++.h>
#define rep(i,j,k) for(int i = (j);i <= (k);i++)
#define per(i,j,k) for(int i = (j);i >= (k);i--)
#define ll long long
#define pii pair<int,int>
#define SZ(S) (int)S.size()
#define mkp make_pair
#define uint unsigned int
using namespace std;
template <class P>
void chkmax(P &x,P y){
if(x < y)... | TOOL | 0.998412 | 3.978419 |
ff28c04a-0a06-42eb-b88c-d2c5de77e9e5 | Gugfann/3.Semester | CPP/Circular Buffer/boost_1_59_0/libs/spirit/example/karma/calc2_ast_rpn.cpp | ///////////////////////////////////////////////////////////////////////////////
//
// A Calculator example demonstrating generation of AST which gets dumped into
// a reverse polish notation afterwards.
//
// [ JDG April 28, 2008 ]
// [ HK April 28, 2008 ]
//
////////////////////////////////////////////////////////... | TOOL | 0.941181 | 7.72917 |
509bbb75-61f6-4a05-9547-77b5d93c3f71 | dhingrahimanshu/CompetitiveProgramming | LeetCode/1408. String Matching in an Array.cpp | class Solution {
public:
bool isSubstring(string & a, string & b) {
int n = (int)a.size();
int m = (int)b.size();
for (int i = 0; i <= n - m; i++) {
if (a.substr(i, m) == b) return true;
}
return false;
}
vector<string> stringMatching(vector<string>& wor... | ALGO | 0.99989 | 5.408854 |
f1088e45-cfae-4192-8bc2-f5fc181cddca | K14KHaNaSa/bojPractice | 2178.cpp | #include <iostream>
#include <queue>
using namespace std;
bool maze[102][102] = { false };
int mazestep[102][102];
int n, m, move;
int bfs(int u, int v) {
queue<pair<int, int>> moving;
int move = 0;
moving.push(pair<int, int>(u, v));
maze[u][v] = false;
while (!moving.empty()) {
int x = moving.front().first;
... | ALGO | 0.999946 | 4.261031 |
4b68ca9c-7f21-4cf1-84d6-ff86af0a91c1 | nlund3/Dust-Bowl-Simulator | src/FarmLand.cpp | #include "FarmLand.h"
#include <cmath>
FarmLand::FarmLand() {
m_num_crops = 0;
m_growth_percent = 0.0;
m_water_sat = 1.0;
m_soil_rich = 1.0;
m_yield_percent = 1.0;
m_fert_concen = 1.0;
m_pest_concen = 0.0;
m_weed_concen = 0.0;
}
FarmLand::FarmLand(int num_crops, float growth, float water, flo... | ALGO | 0.992146 | 4.155295 |
fc504d22-1d34-4fd1-8d77-09e666743392 | ishandutta2007/codeforces | radewoosh/normal/1375/C.cpp | //~ while (clock()<=69*CLOCKS_PER_SEC)
//~ #pragma comment(linker, "/stack:200000000")
#pragma GCC optimize("O3")
//~ #pragma GCC target ("avx2")
//~ #pragma GCC optimize("Ofast")
//~ #pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native")
//~ #pragma GCC optimize("unroll-loops")
#include <bits/st... | ALGO | 0.999455 | 3.937024 |
c0c68139-593a-44f9-983b-dd7d9a7b76fb | bruce1408/Alogrithm_Datastruct | Math/168_Excel_Sheet_Column_Title.cpp | #include<iostream>
#include<vector>
#include<unordered_map>
#include<string>
using namespace std;
// string reverse(string &res)
// {
// string str = "";
// for(int i=res.size()-1;i>=0;i--)
// {
// str+=res[i];
// }
// return str;
// }
string convertToTitle(int n)
{
/*
输入数字,对应的... | ALGO | 0.999783 | 4.551251 |
c8428cf9-5642-4c37-9a86-1da221743f24 | yqw1212/fuzztruction-llvm17.0.6 | libcxx/test/std/algorithms/alg.modifying.operations/alg.replace/ranges.replace_if.pass.cpp | // <algorithm>
// UNSUPPORTED: c++03, c++11, c++14, c++17
// template<input_iterator I, sentinel_for<I> S, class T, class Proj = identity,
// indirect_unary_predicate<projected<I, Proj>> Pred>
// requires indirectly_writable<I, const T&>
// constexpr I ranges::replace_if(I first, S last, Pred pred, const... | TEST | 0.95574 | 7.621822 |
90b07d24-a9f7-4408-8f9e-46bb411619a9 | gap-prog/Competitive-Programming | solutions/codeforces/practice/1438A_specific_tastes_of_andre.cpp | // CodeForces Problem Link: https://codeforces.com/contest/1438/problem/A
#include <algorithm>
#include <array>
#include <assert.h>
#include <bitset>
#include <complex>
#include <cstdint>
#include <cstring>
#include <deque>
#include <functional>
#include <iomanip>
#include <iostream>
#include <iterator>
#include <limi... | ALGO | 0.999706 | 4.812961 |
29185a6e-0621-40cb-a18c-472b55131016 | Sahil12S/LeetCode | Cplusplus/prefix.cpp | /**
* Author: SAHIL SHARMA
* Created On: 03/07/2018
* Question: Find longest common prefix from the array of string.
*/
#include <iostream>
#include <string>
#include <vector>
using namespace std;
string longestCommonPrefix1(vector<string>& strs);
string longestCommonPrefix2(vector<string>& strs);
int main() {
... | ALGO | 0.999528 | 5.041699 |
35c9edb1-1e15-49bf-9943-9a0b8dfa6a0a | glzkk/rep | minMax/minmax.cpp | #include <iostream>
using namespace std;
#include "funkcje.h"
int main()
{
int tablicaTestowa[10];
wypelnij(tablicaTestowa, 10);
wypisz(tablicaTestowa, 10);
cout << endl;
sortowanieRosnaco(tablicaTestowa, 10);
wypisz(tablicaTestowa, 10);
vector <int> wektorTestowy[10];
wypelnijwektor(we... | ALGO | 0.933518 | 3.91653 |
f6e18999-fa09-4773-9a63-512670a4f24b | akwe-afriitech/cpp-projects | c++/rock.cpp | #include <iostream>
using namespace std;
const int rock = 0;
const int paper = 1;
const int scissors = 2;
int userChoice = 0;
int getcomputerChoice(){
srand(time(NULL));
int computerchoice = rand() % 2 + 0;
return computerchoice;
}
int determineWinner(int userChoice, int computerChoice){
... | ALGO | 0.956217 | 3.720746 |
18ffbcde-0b28-485c-883e-616a699a6322 | QJonny/CyNest | nestkernel/communicator.cpp | #include "config.h"
/* To avoid problems on BlueGene/L, mpi.h MUST be the
first included file after config.h.
*/
#ifdef HAVE_MPI
#include <mpi.h>
#endif /* #ifdef HAVE_MPI */
#include <limits>
#include <numeric>
#include <time.h>
#include <sys/time.h> // required to fix header dependencies in OS X, HEP
#include ... | TOOL | 0.990068 | 5.060157 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.