uuid string | repo_name string | relative_path string | content string | category string | algo_rel_score float64 | quality_score float64 |
|---|---|---|---|---|---|---|
ccfacfff-6fda-43f1-8d76-5437df5941de | StefanG97/SI_Homework_2016-2017 | Task 4-12.cpp | #include<iostream>
using namespace std;
bool DateValidator(int dd, int mm, int yyyy){
if(dd > 0 && dd < 28 && mm == 2)
return true;
else if(dd == 29 && mm == 2 && (yyyy % 4 == 0 || yyyy % 100 == 0 || yyyy % 400 == 0))
return true;
else if(dd > 0 && dd < 31 && (mm == 4 || mm == 6 || mm == 9 || mm == 11) && yyyy >... | ALGO | 0.998669 | 3.758114 |
29632672-5c3e-4332-9caf-627c27c1a60b | gilvillard/old-pml | ntl-extras/mat_lzz_pX_extra/tune/tune_lmultiplier.cpp | #include <NTL/lzz_pX.h>
#include <NTL/matrix.h>
#include <NTL/vector.h>
#include <iomanip>
#include "util.h"
#include "mat_lzz_pX_extra.h"
NTL_CLIENT
/*------------------------------------------------------------*/
/* checks one prime */
/*-----------------------------------... | TEST | 0.9957 | 5.550809 |
cc2cf97f-69c6-4e62-b918-8594011df3cc | matthew-kim-hi/KIMTAEHUN | 11048-1.cpp | #include <iostream>
#include <algorithm>
using namespace std;
int arr[1001][1001];
int d[1001][1001];
int n, m;
int max3(int a, int b, int c)
{
int m1 = max(a, b);
int m2 = max(b, c);
return max(m1, m2);
}
int main(void)
{
cin >> n >> m;
for (int i = 1; i <= n; i++)
{
for (int j = 1; j <= m; j++)
{
cin ... | ALGO | 0.999891 | 4.017113 |
a9f2b859-0358-42c5-84e6-ee157ce4d6fe | MKbrun/meals_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.998733 | 6.76775 |
ab470552-a90c-493d-919c-53aa10e51553 | draetus/faculdade_trabalhos | Estrutura_de_Dados/Recursividade_Lista_2/Recursividade_Ex5/main.cpp | #include <iostream>
using namespace std;
void torreHanoi(int haste1[],int haste2[],int haste3[], int n, int i=0)
{
haste3[i] = haste1[n-i-1];
if (i<n-1)
{
torreHanoi(haste1,haste2,haste3,n,i+1);
}
haste2[i] = haste3[n-i-1];
}
int main()
{
int haste1[10] = {10,9,8,7,6,5,4,3,2,1}, haste... | ALGO | 0.999954 | 4.343735 |
f35c2f0f-d369-4ba4-9088-f6cb25bfa019 | nmorenoch/LHMM | lammps-29Oct20/src/KOKKOS/compute_orientorder_atom_kokkos.cpp | /* ----------------------------------------------------------------------
Contributing author: Stan Moore (SNL)
------------------------------------------------------------------------- */
#include "compute_orientorder_atom_kokkos.h"
#include "atom_kokkos.h"
#include "atom_masks.h"
#include "kokkos.h"
#include "m... | ALGO | 0.999528 | 6.647899 |
ad9d5f41-f1f0-46b3-911b-49c7bffaf793 | niquefa/code-forces-playground | problem-solving-workspace/workspace/cf1469a/main.cpp | #include <bits/stdc++.h>
using namespace std;
#ifdef LOCAL
#include "debug.h"
#else
#define debug(...) 42
#endif
template<class T> string grow_to_size( T element , int size_to_get , const string& str_to_append = " " ){
string answer = to_string(element);
while( answer.size() < size_to_get )
answer = str_to_app... | ALGO | 0.999942 | 4.515309 |
46ff76d8-ad47-40f3-973e-301ca3129822 | saumya66/Competitive-Programming- | CodeChef/ss.cpp |
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
ll dp[5000][5000];
ll p[5000];
ll func2(ll t, ll n, ll k, std::vector<ll> v, ll d)
{
if (t >= k && p[d] - t >= k)return 0;
else if (d >= n)return 1e10;
else if (dp[d][t] != -1)
return dp[d][t];
ll on = func2(min(t + v[d], p[d] - t), n, k, v, d... | ALGO | 0.999985 | 4.211233 |
f4ea09b2-2235-47c0-9cc8-f55a858c68ce | Ardaerd/Programming-Paradigms | Lecture_2/lec_2/main.cpp | // stack memory vs heap memory
// value semantics vs reference semantics
// global scope, local scope
// free-functions
// class/struct? object? ------> type? instance?
// typedef (C)
// c-tor of a primitive type
// c-tor of a complex type (struct)
// write a c-tor of a struct instance as a free function (imperativ... | ALGO | 0.952737 | 4.039177 |
8f6ff9f7-bcde-4189-b079-e77e241278fd | leo4048111/miniob_test | deps/common/math/md5.cpp | //
// Created by Longda on 2010
//
#include "common/math/md5.h"
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
namespace common {
#define S11 7
#define S12 12
#define S13 17
#define S14 22
#define S21 5
#define S22 9
#define S23 14
#define S24 20
#define S31 4
#define S32 11
#define S33 16
#define S34 23... | ALGO | 0.982013 | 5.940903 |
aafeb8e5-35d6-4356-875b-79368a7c55b2 | y-ume/ProgrammingContest | OnlineJudges/Atcoder/arc075/F.cpp | // #include {{{
#include <iostream>
#include <cassert>
#include <cstring>
#include <cstdlib>
#include <cstdio>
#include <cctype>
#include <cmath>
#include <ctime>
#include <queue>
#include <set>
#include <map>
#include <stack>
#include <string>
#include <bitset>
#include <vector>
#include <complex>
#include <algorithm>... | ALGO | 0.999533 | 4.047352 |
504b8019-3c5f-45d2-8bdb-1822df5cdf7c | anand9git/DSA-code | 18.cpp | #include <bits/stdc++.h>
#include <iostream>
using namespace std;
int main(){
//program to find all pairs whose sum is equal to a given number.
int n;
cin>>n;
int arr[n];
for(int i=0;i<n;i++){
cin>>arr[i];
}
int k;
cin>>k;
map<int, int> m;
int ans = 0;
for(int i=0;i<... | ALGO | 0.999971 | 4.331589 |
b18994ca-a3a4-467b-8e4e-d5a281d7fa44 | emacsfreeman/test-github-pages | cpp/loops/main.cpp | #include <iostream>
using namespace std;
int main()
{
int numberOfCars = 3;
int carMiles[] = {15, 13, 15};
// total of Miles
int totalMiles = 0;
for (int counter = 0; counter < numberOfCars; counter++)
{
cout << "Counter is now " << counter << endl;
cout << "carMiles[count... | TOOL | 0.945854 | 4.494617 |
62190442-a86d-4560-89bc-983dfe8d62e1 | oldShogun/power-system-simulator | main.cpp | /**
* @file main.cpp
* @brief Тестирование небольшой 4-узловой схемы с одним генератором
* @author Claude
* @date 25.02.2025
*/
#include "Core/PS_PowerSystemSimulator.hpp"
#include "Core/PS_CorePowerSystem.hpp"
#include "Utils/PS_Logger.hpp"
#include "Elements/PS_SynchronousGenerator.hpp"
#include <iostream>
#inc... | TEST | 0.897155 | 5.774299 |
b8eb2c60-115d-47ae-922a-ec36fc92bcf1 | DuongHaoNika/DSA_CodePTIT | DSA09018 - LIỆT KÊ ĐỈNH TRỤ.cpp | #include <bits/stdc++.h>
using namespace std;
#define mp make_pair
#define fi first
#define se second
#define pb push_back
#define sz size()
#define ll long long
#define FOR(i, a, b) for (int i = a; i <= b; ++i)
#define FORD(i, a, b) for (int i = a; i >= b; --i)
#define F(i, a, b) for (int i = a; i < b; ++i)
#define FD... | ALGO | 0.99988 | 4.748133 |
8c6e5a73-fad2-44fd-9950-fa9a89f3912e | initial-d/usaco_training | usaco_training/2.2/Preface Numbering .cpp | /*
ID: duyimin1
PROG: preface
LANG: C++
*/
#include<iostream>
#include<algorithm>
#include<fstream>
#include<vector>
#include<map>
using namespace std;
typedef pair<char, int> PAIR;
int n;
string thousand[4] = {"", "M" , "MM" ,"MMM"};
string hundred[10] = {"","C" , "CC" , "CCC" ,"CD" , "D" , "DC","DCC", "DCCC" , "CM"... | ALGO | 0.999671 | 4.058074 |
6d3288e7-f452-4dcc-9082-d18a7d272415 | zwayzo/problem | multuplixing/socket.cpp | #include "multuplixing.hpp"
void clearSets(int i, fd_set *master_re, fd_set *master_wr) //clear the sets and initialze some variables(select)
{
printf("2\n");
FD_CLR(i, master_re);
printf("2\n");
FD_SET(i, master_wr);
printf("2\n");
}
int validSocket(int j, server *ser) //check if the j is a socke... | WEB | 0.912781 | 3.156499 |
08066f89-a520-4048-b1fd-85569d832bdd | kabraneel/Competitive-Programming | Concepts/KnapsackMaps.cpp | #include <bits/stdc++.h>
using namespace std;
typedef vector<int> vi;
typedef pair<int,int> pi;
#define PB push_back
#define MP make_pair
typedef long long ll;
#define FOR(i,a,b) for(int i=a; i<b; i++)
int maxn = 1e5 + 5;
long long int findmax(long long int a, long long int b){
if(a>b){
return a;
}
retu... | ALGO | 0.999974 | 4.246397 |
7c06c387-7c98-41a7-a496-862df81e7e15 | jiangyinzuo/algorithm | src/exercise/multi_university/ground_chashing_death.cpp | //
// Created by Jiang Yinzuo on 2020/8/9.
//
#include <cstdio>
#include <unordered_map>
const long long MOD = 998244353;
long long q_pow(long long base, long long idx) {
long long answer = 1;
while (idx) {
if (idx & 1) {
answer = answer * base % MOD;
}
base = base * base ... | ALGO | 0.999754 | 5.248472 |
9a49f684-6cc8-4e98-8ec6-e84d30f8e02c | guben/offer | algo1.cpp | #include <cstring>
#include <cstdio>
//题目和答案
class CMyString{
public:
CMyString(char* pData = nullptr);
CMyString(const CMyString& str);
~CMyString(void);
CMyString& operator=(const CMyString& str);
void Print();
private:
char* m_pData;
};
CMyString::CMyString(char* pData) {
if(pData== n... | TOOL | 0.878319 | 3.614437 |
588e02f5-1ea3-40d8-9423-dfdce2300647 | zhaofuq/LOD-SIBR-Viewer | src/core/graphics/Frustum.cpp | // Partially based on:
// http://www.lighthouse3d.com/tutorials/view-frustum-culling
#include "core/graphics/Camera.hpp"
#include "core/graphics/Frustum.hpp"
namespace sibr
{
Frustum::Frustum(const Camera& cam)
{
float ratio = cam.aspect();
float angle = cam.fovy();
float nearD = cam.znear();
float farD = c... | ALGO | 0.979841 | 7.004009 |
e0e29df6-453b-4164-ae42-20fc2158458a | 113bommy/deepmind_codecontests_refine | cpp_source_filter_file/cpp_train_26_8.cpp | #include <bits/stdc++.h>
const long long mod = (long long)1e9 + 7;
using namespace std;
int main() {
ios_base::sync_with_stdio(false);
cin.tie(NULL);
long long e, f, g, h, i, j;
cin >> e >> f >> g >> h >> i >> j;
bool valid = false;
for (long long a = 0; a <= 9; a++) {
for (long long b = 0; b <= 9; b++)... | ALGO | 0.999911 | 3.417995 |
07fbfe82-3dbd-4377-a09c-8377bd939482 | Fisher87/leetcode | cplus/delete-the-middle-node-of-a-linked-list.cpp | // Time: O(n)
// Space: O(1)
class Solution {
public:
ListNode* deleteMiddle(ListNode* head) {
ListNode dummy;
dummy.next = head;
auto slow = &dummy, fast = &dummy;
while (fast->next && fast->next->next) {
slow = slow->next;
fast = fast->next->next;
... | ALGO | 0.999878 | 6.12128 |
54de735b-cabb-4d9e-90e7-539f57250d85 | nunesg/Ahozinho | Material/5 - String OK/suffix_array_nlog^2_lcp.cpp | //OBS: usa a struct Hash
int sa[MAXN], lcp[MAXN];
string s;
Hash H;
int getLCP(int a, int b){//pega o LCP entre o sufixo começando em a e o sufix começando em b
int lo = 0;
int hi = min((int)s.size() - a, (int)s.size() - b);
int mid;
int ans = 0;
while(lo <= hi){
mid = (lo+hi)/2;
if(H.getRangeNormal(a, ... | ALGO | 0.999948 | 3.982937 |
e405a4a6-37d5-42c7-9629-23983ad68a59 | raincross7/code-similarity | codes/train_code/problem275/problem275_281.cpp | #include<bits/stdc++.h>
#define rep(i,N) for(int i=0;i<(N);i++)
#define FOR(i,a,b) for(int i=(a);i<(b);i++)
using namespace std;
const long long MOD = 1e9 + 7;
const long long INF = 1e12;
const int inf = 1e9;
const int mod = 1e9+7;
typedef long long ll;
typedef pair<ll,int> P;
typedef set<int> S;
int main(){
cout <... | ALGO | 0.999627 | 3.898773 |
75f32833-5287-41bb-a0c2-538b0378b5d3 | ishandutta2007/codeforces | shzhang/normal/1466/B.cpp | #include <cstdio>
#include <algorithm>
#include <vector>
#include <set>
#include <cstdlib>
#include <utility>
#include <cmath>
#include <queue>
#include <stack>
#include <cstring>
using namespace std;
#define ll long long
#ifndef ONLINE_JUDGE
#define debug(format, ...) fprintf(stderr, \
"%s:%d: " format "\n", __... | ALGO | 0.99978 | 3.842233 |
84e10958-5a15-4914-8342-b544c0d1338b | Nakib-Arman/CSE318---ArtificialIntelligence | 4.DecisionTree/.history/decision_tree_20250705121829.cpp | #include<bits/stdc++.h>
using namespace std;
float getEntropy(vector<vector<string>>& dataset,unordered_set<string>& decisions)
{
float entropy=0;
vector<string> decisions_vect;
vector<int> count(decisions.size(),0);
for(string decision : decisions){
decisions_vect.push_back(decision);
}
... | ALGO | 0.990765 | 5.382298 |
21c4f55f-df39-4cb0-8da8-9f433a3549ea | Juwei-Wang/operating-system | A3/original/sumFactors.cpp | /// reads in a positive integers in range (2 .. 2^63-1) from standard input
/// for each number on input:
/// if the number is prime, it is ignored
/// determines the smallest factor of the composite number
/// prints out the sum of all smallest factors
///
/// if no composite numbers are found, prints out "0"
///
... | ALGO | 0.999882 | 5.22454 |
67e954e3-f423-4123-92eb-8aacc13ade29 | raincross7/code-similarity | codes/train_code/problem195/problem195_493.cpp | #include<iostream>
#include<algorithm>
#include<climits>
using namespace std;
int min(int a,int b){
return (a>b?b:a);
}
int go(int *a,int n){
int f=0;
if(n==1) return f;
int s=abs(a[0]-a[1]);
if(n==2) return s;
int c=INT_MAX;
for(int i=2;i<n;i++){
c=min(s+abs(a[i]-a[i-1]),f+abs(a[i]-a[... | ALGO | 0.999964 | 4.157039 |
2b71489b-171e-4d33-a7c7-cf59dec67866 | Raikyr4/Exercicios_de_Hackathon | Grafos_em_Competicao/flood/11561 - Getting Gold.cpp | #include <iostream>
#include <vector>
using namespace std;
char Ma[200][200];
int N, M, x, y, cont;
char Y = 'G';
void floodt(int i, int j)
{
if (Ma[i][j] == Y)
{
cont++;
}
Ma[i][j] = '*';
if (j - 1 >= 0 && Ma[i][j - 1] == Y || Ma[i][j - 1] == '.')
floodt(i, j - 1);
if (j + 1 <... | ALGO | 0.997958 | 3.788988 |
997796d3-c877-4204-9ff9-06b1dada3ad4 | Jiatutu/orbslam3-window | Thirdparty/eigen/doc/examples/Tutorial_ArrayClass_mult.cpp | #include <Eigen/Dense>
#include <iostream>
using namespace Eigen;
using namespace std;
int main()
{
ArrayXXf a(2,2);
ArrayXXf b(2,2);
a << 1,2,
3,4;
b << 5,6,
7,8;
cout << "a * b = " << endl << a * b << endl;
}
| ALGO | 0.997755 | 3.51756 |
35f4feb5-5832-4ade-acf4-d52c4d255e21 | a-ungurianu/Infoarena-Solutions | cai.cpp | #include <iostream>
#include <fstream>
#include <algorithm>
#include <functional>
using namespace std;
ifstream in ("cai.in");
ofstream out ("cai.out");
int n;
short match(unsigned cG, unsigned cI) {
if(cG>cI)return 1;
else if(cG==cI)return 0;
return -1;
}
int main() {
unsigned t;
in >> t;
while(t--) {
in >... | ALGO | 0.999653 | 3.588755 |
59bbe1e4-c7ce-4768-9157-13e3e507fe3f | MooYongArin/grader-algoritm-design | 02-dynamic_prog/matrix_chain/mcm.cpp | #include <bits/stdc++.h>
#define endl '\n'
using namespace std;
int n ,arr[102], dp[102][102], split[102][102];
void printOptimalParens(int i, int j) {
if (i == j) {
cout << "A" << i;
} else {
cout << "(";
printOptimalParens(i, split[i][j]);
printOptimalParens(split[i][j] + 1, j... | ALGO | 0.999993 | 4.765127 |
d9f100f6-a1ae-4ea4-a556-87bf27da26b1 | sidjha57/Coding-Data-Transfer | Competitive/C++/Codeforces/A_Protect_Sheep.cpp | //https://codeforces.com/problemset/problem/948/A
#include<bits/stdc++.h>
//#include<ext/pb_ds/assoc_container.hpp>
//#include<ext/pb_ds/tree_policy.hpp>
//#include <ext/pb_ds/trie_policy.hpp>
//using namespace __gnu_pbds;
using namespace std;
//typedef tree<ll, null_type, less<ll>, rb_tree_tag, tree_order_statistics_... | ALGO | 0.999983 | 4.058402 |
9a5f50be-4c04-4da6-bbc8-730ca3ad53b9 | musandur/system-monitor-project-udacity | linux_parser.cpp | #include <dirent.h>
#include <unistd.h>
#include <sstream>
#include <string>
#include <vector>
#include "linux_parser.h"
using std::stof;
using std::string;
using std::to_string;
using std::vector;
// DONE: An example of how to read data from the filesystem
string LinuxParser::OperatingSystem() {
string line;
st... | TOOL | 0.894364 | 4.620561 |
c06cb82a-1fec-4db3-ae41-cd9f72c2334a | miyunluo/USACO-training | chapter4/4.1/Fence-Loops/main.cpp | /*
ID: miyunlu1
PROG: fence6
LANG: C++11
*/
#include<iostream>
using namespace std;
int inf = 999999;
int N;
int NP;
int edgeLen[101];//lenth of each edge
int edgeNum[101][2];//edge num
int edgeFind[101][2][101];
int edgeId[101][2][9];
int point[2][201];//
int table[201][201];
int dis[201][201];
void findP()
{
... | ALGO | 0.998973 | 3.596395 |
2f07a825-bfae-4585-9d7c-8ba3ed800990 | rds1983/SealangSharp | llvm/lib/DebugInfo/CodeView/ContinuationRecordBuilder.cpp | #include "llvm/DebugInfo/CodeView/ContinuationRecordBuilder.h"
using namespace llvm;
using namespace llvm::codeview;
namespace {
struct ContinuationRecord {
ulittle16_t Kind{uint16_t(TypeLeafKind::LF_INDEX)};
ulittle16_t Size{0};
ulittle32_t IndexRef{0xB0C0B0C0};
};
struct SegmentInjection {
SegmentInjection... | TOOL | 0.971137 | 7.252635 |
509ab5a7-0439-49c2-b9f1-d5bb0e53dc9b | camenduru/CatVTON-hf | detectron2/layers/csrc/ROIAlignRotated/ROIAlignRotated_cpu.cpp | // Note: this implementation originates from the Caffe2 ROIAlignRotated Op
// and PyTorch ROIAlign (non-rotated) Op implementations.
// The key difference between this implementation and those ones is
// we don't do "legacy offset" in this version, as there aren't many previous
// works, if any, using the "legacy" ROIA... | DATA | 0.94537 | 7.527931 |
96d49a47-54fe-4b12-b78e-1a0f12c6522d | ishandutta2007/codeforces | dxqwq/normal/26/C.cpp | // Problem: C. Parquet
// Contest: Codeforces - Codeforces Beta Round #26 (Codeforces format)
// URL: https://codeforces.com/problemset/problem/26/C
// Memory Limit: 256 MB
// Time Limit: 2000 ms
//
// Powered by CP Editor (https://cpeditor.org)
//And in that light,I find deliverance.
#include<bits/stdc++.h>
// #prag... | ALGO | 0.999708 | 4.135371 |
c72c61e8-fc4b-48dc-b2bb-ff96e48f663a | samuelloza/solutions | codeforces/normal/1095/B.cpp | #include <cstdio>
#include <iostream>
#include <vector>
#include <map>
#include <algorithm>
using namespace std;
int main(){
int n,d;
cin>>n;
std::vector<int> v;
while(n--){
cin>>d;
v.push_back(d);
}
sort(v.begin(),v.end());
map<int,int> mapa;
int min = 0;
for (int i = 0; i < v.size() -1 ; i++){
//for... | ALGO | 0.999972 | 3.784732 |
dda238c7-2a80-4288-8366-5ffd68e898ce | MedAzizTousli/Competitive-Programming-Solutions | Codeforces/!Junior Training Sheet/B/B_Roma_and_Changing_Signs.cpp | #include <bits/stdc++.h>
#define int long long
#define ll long long
#define FLASH ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL);
#define all(v) ((v).begin()), ((v).end())
#define rep(i, begin, end) for (__typeof(end) i = (begin) - ((begin) > (end)); i != (end) - ((begin) > (end)); i += 1 - 2 * ((begin... | ALGO | 0.999983 | 4.179321 |
3137e9ca-7101-4dd4-b7fb-08646aab17c2 | hjpark83/SelfStudy | Algorithm(C++)/C-master/동적계획법/9252_LCS.cpp | #include <iostream>
#include <vector>
#include <cmath>
using namespace std;
static int N;
static int DP[1001][1001];
static string A, B;
static vector<char> Path;
void getText(int r, int c);
int main()
{
cin >> A >> B;
for (int i = 1; i <= A.size(); i++) {
for (int j = 1; j <= B.size(); j++) {
... | ALGO | 0.999998 | 4.324711 |
959eb3d0-1547-42ce-a654-722007aaf728 | firewood/topcoder | atcoder/abc_133/e.cpp | // E.
#include <iostream>
#include <sstream>
#include <algorithm>
#include <vector>
using namespace std;
typedef long long LL;
static const LL MOD = 1000000007;
struct modll {
long long x;
modll() { }
modll(long long _x) : x(_x) { }
operator int() const { return (int)x; }
modll operator+(const modll& r) { ret... | ALGO | 0.99995 | 4.579311 |
7eb91d59-b4c1-4875-ac26-017c7a8a65dd | vevdokimovm/Code-Directory | Introduction to programming C++ from Yandex/1.6.7.cpp | #include <iostream>
#include <cmath>
#include <iomanip>
using namespace std;
int main()
{
int now, count = 0, sum = 0 , sum_x2 = 0;
double u;
cin >> now;
while (now != 0)
{
sum = sum + now;
sum_x2 = sum_x2 + now*now;
count++;
cin >> now;
}
u = sqrt((sum_x2 -... | ALGO | 0.999415 | 3.330077 |
18d48e0b-0e17-4299-8f82-974c125ee305 | tripiproject/cpp-eth-tripi | libdevcore/SHA3.cpp | /** @file SHA3.cpp
* @author Gav Wood <<EMAIL>>
* @date 2014
*/
#include "SHA3.h"
#include <cstdint>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include "RLP.h"
#include "picosha2.h"
using namespace std;
using namespace dev;
namespace dev
{
h256 EmptySHA3 = sha3(bytesConstRef());
h256 EmptyListSHA3 =... | ALGO | 0.948959 | 7.714515 |
fd1cde93-2e37-4e2d-822a-286722185bf3 | gyf1214/OI | POJ_2774/src/main.cpp | //Created At: Wed Dec 7 18:21:00 CST 2016
//orz zyx
//ntr czr
//Author: gyf
#include <cstdlib>
#include <cstdio>
#include <cstring>
#include <string>
#include <iostream>
#include <algorithm>
#include <vector>
#define rep(i, a, b) for (int _a = (a), _b = (b), i = _a; i <= _b; ++i)
#define clr(i, a) memset(i, (a), sizeo... | ALGO | 0.999743 | 3.761642 |
de1b3898-ed54-4b22-b4ff-08a129b2e082 | its-urgent/dsa | A8.cpp | /*
??PROBLEM STATEMENT:-
Given sequence k = k1 <k2 < ... <kn of n sorted keys, with a
search probability pi for each key ki . Build the Binary search tree that has
the least search cost given the access probability for each key?
*/
/*
#??Quick Revision Notes:-
??Optimal Binary Search Tree :-
*/
#include<iostream... | ALGO | 0.999991 | 5.13016 |
18f782c8-254b-4f76-9b62-b04511ad54fe | robjnhut/thuc_hanh_dsa | baitapLythuyet/stackque.cpp | #include <iostream>
#include <string>
#include <cctype>
#include <sstream> // Thư viện để xử lý chuỗi
using namespace std;
struct Node {
int data;
Node* next;
Node(int value) : data(value), next(nullptr) {}
};
class Stack {
private:
Node* topNode;
public:
Stack() : topNode(nullptr) {}
bool ... | ALGO | 0.999887 | 6.193086 |
93660e1b-0575-44ee-8919-a6c87466ac59 | statist32/squarepair | gameSolver.cpp | #include <iostream>
#include <fstream>
#include <vector>
#include <chrono>
#include <cmath>
#include <filesystem>
using namespace std;
typedef struct _solution
{
vector<vector<int>> board;
vector<pair<int, int>> clicks;
} SOLUTION;
/* helper function to display and store solutions */
string createFilename(int... | ALGO | 0.912957 | 5.68284 |
de169b22-0317-4c4e-bb0a-be88b6608bba | SakshamSahgal/Competitive-Programming | Codeforces + Codechef/B. Love Song.cpp | #include<iostream>
#include<algorithm>
#include<vector>
#define usi unsigned short int
#define ui unsigned int
#define ulli unsigned long long int
#define lli long long int
using namespace std;
int main()
{
ios_base::sync_with_stdio(false);
cin.tie(NULL);
cout.tie(NULL);
int n,q;
cin>>n>>q;
string s;
ci... | ALGO | 0.999915 | 3.871996 |
090a376f-0478-43c5-a5ff-cd3017bcbb22 | kim2001sh/codetree | 250111/악수와 전염병의 상관관계 2/correlation-between-shaking-hands-and-infectious-diseases2.cpp | #include <iostream>
#include <algorithm>
using namespace std;
class c{
public:
int time;
int wjs_to;
int wjs_cnt;
int wjs_from;
int wjs;
c(int time = 0, int wjs_from = 0, int wjs_to = 0) {
this->time = time;
this->wjs_from = wjs_from;
... | ALGO | 0.999706 | 3.478074 |
7be7d1d4-0747-4510-837e-1204691a5d85 | lyh2009/leaper | engine/3rdparty/box2d/src/collision/b2_polygon_shape.cpp | #include "box2d/b2_polygon_shape.h"
#include "box2d/b2_block_allocator.h"
#include <new>
b2Shape* b2PolygonShape::Clone(b2BlockAllocator* allocator) const
{
void* mem = allocator->Allocate(sizeof(b2PolygonShape));
b2PolygonShape* clone = new (mem) b2PolygonShape;
*clone = *this;
return clone;
}
void b2PolygonSha... | ALGO | 0.987417 | 7.940412 |
ec6d4c49-462b-4d4f-be16-c08e3ae85ce8 | VivekKumarMishra1301/Codechef-Problems | Starter71_perfect_trio.cpp | #include <iostream>
using namespace std;
int main()
{
// your code goes here
int t;
cin >> t;
while (t--)
{
int admi1, admi2, admi3;
cin >> admi1 >> admi2 >> admi3;
if ((admi1 == (admi2 + admi3)) || (admi2 == (admi1 + admi3)) || (admi3 == (admi1 + admi2)))
{
... | ALGO | 0.999813 | 4.542398 |
b5f5359b-332a-4856-9270-7c8146842a67 | NengQian/fluid_simulation | extern/eigen_3.3.4/unsupported/doc/examples/EulerAngles.cpp | #include <unsupported/Eigen/EulerAngles>
#include <iostream>
using namespace Eigen;
int main()
{
// A common Euler system by many armies around the world,
// where the first one is the azimuth(the angle from the north -
// the same angle that is show in compass)
// and the second one is elevation(the angl... | ALGO | 0.987988 | 5.125681 |
a042f4a8-cdab-49b2-9f20-c068e72d0065 | Shammi02/C- | Lab2_Japril/spellDays.cpp | // demonstrates separating digits with a remainder operator
// Mikhail Nesterenko
// 01/22/2016
#include <iostream>
using std::cin; using std::cout; using std::endl;
int main() {
cout << "Enter a number between 1 and 35: ";
int num;
cin >> num;
if (num < 1 || num > 35) { // ( || or ) (&& and)
... | ALGO | 0.985766 | 5.336793 |
8a229e95-9392-4530-922c-6ac5ab26650c | fitd-tech/cpp-sandbox | codewars/008_find_unique/find_unique.cpp | #include <vector>
#include <string>
#include "debug.hpp"
#include "find_unique.hpp"
float FindUnique(std::vector<float> &v) {
const std::vector<float> &input = v;
float first_value = input[0];
int first_value_count = 0;
float second_value = 0;
int second_value_count = 0;
float result = 0;
f... | ALGO | 0.99882 | 5.286458 |
e39e95b4-e6c4-4725-a9f3-e5a5b4a8c6c3 | spencerkohan/CoreEngine3D | Engine/PowerVR/PVRTVector.cpp | /******************************************************************************
@File PVRTVector.cpp
@Title PVRTVector
@Version
@Copyright Copyright (c) Imagination Technologies Limited.
@Platform ANSI compatible
@Description Vector and matrix mathematics library
**************... | TOOL | 0.995767 | 5.174946 |
a75a5a3f-c434-40bd-86cc-714544e11e31 | WMF1997/study_work | 20210410/leetcode/78.cpp | #include <vector>
#include <iostream>
using namespace std;
class Solution
{
public:
std::vector<std::vector<int>> subsets(std::vector<int>& nums)
{
std::vector<std::vector<int>> result;
std::vector<int> item;
result.push_back(item);
generate(0, nums, item, result);
return result;
}
private:
void generate... | ALGO | 0.999909 | 5.091992 |
33612177-1be8-4928-b880-f6eff705cdb7 | yzcmf/Interview | LeetCode-Solutions/C++/design-hashmap.cpp | // Time: O(1)
// Space: O(n)
class MyHashMap {
public:
/** Initialize your data structure here. */
MyHashMap() : data_(10000) {
}
/** value will always be positive. */
void put(int key, int value) {
auto& list = data_[key % data_.size()];
auto it = find_if(list.begin(... | ALGO | 0.99942 | 6.324904 |
e0edf3c7-c647-49da-83a2-d3e65e1ac898 | DVRodri8/Competitive-programs | OnlineJudgeUVa/C++/12xxx/12250 - Language Detection/main.cpp | // 12250 - Language Detection
#include <iostream>
#include <string>
using namespace std;
int main(){
string S;
int c = 1;
while(cin >> S){
if(S == "#") break;
if(S == "HELLO"){
cout << "Case " << c << ": " << "ENGLISH" << endl;
c++;
}else if(S == "HOLA"){
cout << "... | ALGO | 0.974224 | 4.043165 |
ff052a4c-fbbb-4414-8a95-b55648b13815 | ishandutta2007/codeforces | adalbert/normal/770/B.cpp | ///Lol kek cheburek///
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
typedef pair<int,int> pii;
typedef vector<int> vi;
typedef vector< pii > vii;
typedef double ld;
#define pb push_back
#define mp make_pair
#define ins insert
#define ers erase
#define elif else... | ALGO | 0.999992 | 4.352313 |
02326c44-180c-442d-9fed-bbc5ecd6a447 | pcw109550/problem-solving | Baekjoon/11758.cpp | #include <bits/stdc++.h>
using namespace std;
int main(void) {
ios::sync_with_stdio(false); cin.tie(nullptr);
int x[3] = {}, y[3] = {};
for (int i = 0; i < 3; i++) { cin >> x[i] >> y[i]; }
int x1 = x[1] - x[0], y1 = y[1] - y[0];
int x2 = x[2] - x[1], y2 = y[2] - y[1];
int result = x1 * y2 - x2 ... | ALGO | 0.999997 | 4.775896 |
bfb667cd-08d1-4dbb-b537-80007989637d | Galaxy-Nexus-Project/android_frameworks_base | core/jni/android/opengl/poly_clip.cpp | /*
* Generic Convex Polygon Scan Conversion and Clipping
* by Paul Heckbert
* from "Graphics Gems", Academic Press, 1990
*/
/* Based on the public domain code:
* poly_clip.c: homogeneous 3-D convex polygon clipper
*
* Paul Heckbert 1985, Dec 1989
*/
#include "poly.h"
#include "string.h"
#define LOG_TAG "Stre... | ALGO | 0.999567 | 6.781762 |
fd6c6924-aea3-40fc-8456-9115f3c20584 | jagonmoy/Graph-Theory | BFS/Problems Of Online Judges/Core BFS related Problems/UVA_10997.cpp | #include <bits/stdc++.h>
using namespace std;
#define sz 300
typedef pair<int,int> PII;
typedef pair<int,pair<int,int> > TII ;
int fx[] = {1,-1,0,0} ;
int fy[] = {0,0,1,-1} ;
int dis[sz][sz];
int visited[sz][sz];
int adj[sz][sz];
vector < TII > vec ;
bool check (int Vx, int Vy) {
int fact = 0 ;
for ( int i = 0 ... | ALGO | 0.998994 | 3.946354 |
1f04f69f-90b5-447b-a4fb-15fd53efb4f5 | ishandutta2007/codeforces | sfiction/normal/500/D.cpp | /*
ID: Sfiction
OJ: CF
PROB: 500D
*/
#include <cstdio>
#include <cstring>
#include <vector>
using namespace std;
const int MAXN=300100;
int edge[MAXN][3];
int n;
vector<int> E[MAXN];
int size[MAXN];
bool vis[MAXN];
double ans,sum;
void DFS(int u){
vis[u]=true;
size[u]=1;
for (int v,i=E[u].size()-1;i>=0;--i)
... | ALGO | 0.999908 | 4.058904 |
9deeb88e-84fe-4e49-89ea-36b666295a75 | AhmedRamadan6/Coursera-Algorithmic-Toolbox | week6/1 Maximum Amount of Gold/main.cpp | #include <iostream>
#include <vector>
using namespace std;
using std::vector;
int optimal_weight(int w, const vector<int> &item) {
int n= item.size(),val;
if (n<=0|| w<=0)
{
return 0;
}
int arr[n+1][w+1];
for(int i=0;i<=w;i++)
arr[0][i]=0;
for(int i=0;i<=n;i++)
arr... | ALGO | 0.999995 | 5.486355 |
e6586d03-a2e2-4214-945c-3ac0d216d6fa | Jiryeong29/2023-Algorithm-Study | 01월/Round03 기본수학/분수찾기(1193)/민성(1193).cpp | #include <iostream>
using namespace std;
int main() {
int x, i;
cin >> x;
for (i = 1; x > 0; i++) {x = x - i;}
i -= 1;
if (i % 2 == 1) {
cout << i + 1 - (i + x) << '/' << i + x << endl;
}
else {
cout << i + x << '/' << i + 1 - (i + x) << endl;
}
return 0;
}
| ALGO | 0.998508 | 3.732443 |
2631855a-d41e-414f-b1f1-9e7a972fd5f0 | DheerajBylan/Recursion-New | ReversePrintArray.cpp | /*
REVERSE PRINT ARRAY.
*/
/*
REVERSE ARRAY PRINT
APPROACH 1 : LINEAR SEARCH
*/
#include <iostream>
using namespace std;
void reversePrintArray(int arr[], int size, int index)
{
if (index == size)
{
return;
}
cout << arr[size - index - 1] << " ";
reversePrintArray(arr, size... | ALGO | 0.999776 | 5.078233 |
871cdf9a-c900-49f9-b507-209809f6ee17 | nekonekko/atcoder | abc/abc387/d.cpp | #include <cassert>
#include <cfenv>
#include <cfloat>
#include <ciso646>
#include <clocale>
#include <csetjmp>
#include <csignal>
#include <cstdbool>
#include <cinttypes>
#include <charconv>
#include <typeindex>
#include <any>
#include <scoped_allocator>
#include <forward_list>
#include <list>
#include <map>
#include <... | ALGO | 0.999972 | 4.323906 |
e72c0e38-7c47-44ec-8e06-a784bff25141 | tarunpatel1860/Computer-Graphics | MIDCIR.CPP | #include<iostream.h>
#include<graphics.h>
#include<stdio.h>
#include<conio.h>
void drawsym(int x,int y,int xc,int yc)
{
putpixel(y+xc,x+yc,YELLOW);
putpixel(x+xc,-y+yc,YELLOW);
putpixel(y+xc,-x+yc,YELLOW);
putpixel(-y+xc,-x+yc,YELLOW);
putpixel(-x+xc,-y+yc,YELLOW);
putpixel(-x+xc,y+yc,YELLOW);
putpixel(-y+xc,x+... | ALGO | 0.999268 | 4.622762 |
e6cdd368-3fed-4ace-9ed5-fa0aba3a31c8 | ishandutta2007/codeforces | illenium/normal/935/B.cpp | #include<iostream>
#include<cstdio>
#include<cstring>
#include<algorithm>
#include<vector>
#include<map>
#include<queue>
#include<cmath>
#include<stack>
#include<set>
#define ll long long
#define maxn 200005
#define re register
#define inf 1e9
#define eps 1e-10
using namespace std;
int main()
{
int n; cin>>n;
string... | ALGO | 0.99978 | 3.697391 |
47b03559-28b4-4174-ba6e-2da062265d23 | kanikachouhan0027/DSA | 86_BFS/1_bfs.cpp | // tex 2 has a directed edge towards vertex 5.
// Vertices 3, 4, and 5 have no outgoing edges.
// We can also see this in the diagram below.
// BFS traversal: 0 1 2 3 4 5
// Detailed explanation ( Input/output format, Notes, Images )
// Sample Input 1:
// 8 7
// 0 1
// 0 2
// 0 3
// 1 4
// 1 7
// 2 5
// 3 6
// Sampl... | ALGO | 0.999968 | 5.61477 |
e7fd1134-cd42-4202-ab6f-5848f2761ce3 | dehhganii/CSE701-third-project | GeometryAlgorithms.cpp | #include "GeometryAlgorithms.hpp"
#include <vector>
#include <algorithm>
#include <string>
#include "point.hpp"
/**
* @brief Parent class for all the algorithms to have input and the output. Both will be defined
*
*/
void GeometryAlgorithms::read_points(std::string){};
void GeometryAlgorithms::solve(){};
| ALGO | 0.999308 | 3.090545 |
42256920-6177-40ee-8476-582dfac24a34 | kunidesuyo/competitive-programming | ABC/151~200/196/C.cpp | #include <bits/stdc++.h>
#include <cmath>
using ll = long long;
const ll INF = __LONG_LONG_MAX__;
using namespace std;
int main() {
ll n;
cin >> n;
ll ans = 0;
for(ll i = 1; i < 1000000; i++) {
string num = to_string(i);
string s = num + num;
ll val = stoll(s);
if(va... | ALGO | 0.999894 | 5.135258 |
d339b0ed-ea4b-41e9-8f00-2fbcb6407872 | ishandutta2007/codeforces | teapotd/normal/1579/C.cpp | #define _USE_MATH_DEFINES
#include <bits/stdc++.h>
#ifdef LOC
#include "debuglib.h"
#else
#define deb(...)
#define DBP(...)
#endif
using namespace std;
using ll = long long;
using Vi = vector<int>;
using Pii = pair<int, int>;
#define pb push_back
#define mp make_pair
#de... | ALGO | 0.999923 | 3.722852 |
5156dbf2-d937-4f28-848b-a96c3cab549e | misaka10032s/CppScript | develop/old/number.cpp | #include <string>
#include <iostream>
#include <vector>
#include <unordered_map>
#include <cmath>
#include "number.h"
#include <chrono>
#include <time.h>
#define DIGITNUM 9
#define DIGIT10 (int)pow(10, (int)DIGITNUM)
#define DIGITINT 10/DIGITNUM + 1
#define DIGITFLOAT 38/DIGITNUM + 1
#define DIGITDOUBLE 308/DIGITNUM... | ALGO | 0.986073 | 3.292475 |
6d73d60b-8e4d-4737-ba28-43aa6750d070 | ShivamDhamija/leetcodeQuestions | 2913-subarrays-distinct-element-sum-of-squares-i/2913-subarrays-distinct-element-sum-of-squares-i.cpp | class Solution {
public:
int sumCounts(vector<int>& n) {
int a=0;
for(int i=0;i<n.size();i++)
{
unordered_set<int>s;
for(int j=i;j<n.size();j++)
{
s.insert(n[j]);
a+=s.size()*s.size();
}
}
ret... | ALGO | 0.999736 | 4.529368 |
732b09b3-ea11-48de-bd3e-8c853f6fbc38 | Oaik/problems-solution | codeforces/contest/651/c/48059140.cpp | #include <bits/stdc++.h>
using namespace std;
#define ll long long
#define all(v) ((v).begin()),((v).end())
#define sz(x) ((int) (x).size())
#define clr(a,b) memset(a,b,sizeof(a))
const double EPS = 1e-8;
int dcmp(double a, double b) {
return fabs(a - b) <= EPS ? 0 : a < b ? -1 : 1;
}
void debug() {
freopen("... | ALGO | 0.99925 | 4.705071 |
3d6a801f-fe0d-4289-a8d6-ed45b09e77cb | daar/bare-blender | blender/extern/bullet2/src/BulletCollision/BroadphaseCollision/btQuantizedBvh.cpp | #include "btQuantizedBvh.h"
#include "LinearMath/btAabbUtil2.h"
#include "LinearMath/btIDebugDraw.h"
#include "LinearMath/btSerializer.h"
#define RAYAABB2
btQuantizedBvh::btQuantizedBvh() :
m_bulletVersion(BT_BULLET_VERSION),
m_useQuantization(false),
//m_traversalMode(TRAVERSAL_STACKLESS_CACHE_FRIE... | ALGO | 0.999174 | 6.779053 |
0c72934c-f1cc-4d8e-9b67-bcf4da159863 | ishandutta2007/codeforces | turmax/normal/1244/G.cpp | #include <bits/stdc++.h>
using namespace std;
#define int long long
vector <int> res1;
vector <int> res2;
void slv(int n,int m,int low,int up)
{
if(n==0)
{
return;
}
if(n==1)
{
res1.push_back(low);
res2.push_back(up);
return;
}
if(m>=(n-1))
{
res1... | ALGO | 0.999989 | 3.933498 |
e97a938c-886a-42c5-a516-fa01f5ef2723 | lotato/XCPC | 牛客/牛客小白月赛62/剖分.cpp | #include<bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
const int maxn=500010;
const ll mod=1e9+7;
int val[20000000],lazy[20000000];
void solve()
{
int n,m;
cin>>n>>m;
for(int i=1;i<=m;i++)
{
int op,x;
cin>>op>>x;
if(op==1)
{
... | ALGO | 0.999947 | 4.045728 |
36e3b540-f088-41b8-bb02-87afcdbc20ed | jayeshpatel8/Coding-Practise-using-Leetcode-Coding-Platform | problems/richest_customer_wealth/solution.cpp | class Solution {
public:
int maximumWealth(vector<vector<int>>& accounts) {
int ans = 0;
for (auto &i : accounts){
ans = max(ans, accumulate(begin(i),end(i),0));
}
return ans;
}
}; | ALGO | 0.998127 | 5.991508 |
b292c9e0-f9a7-406d-b15a-4f8d89f2cc57 | vimday/PlayWithLeetCode | 每日一题 6-8 月/Day0819_palindromic-substrings.cpp | /*
* @Author :vimday
* @Desc :
* @Url :
* @File Name :Day0919_palindromic-substrings.cpp
* @Created Time:2020-08-19 00:35:19
* @E-mail :<EMAIL>
* @GitHub :https://github.com/vimday
*/
#include <bits/stdc++.h>
using namespace std;
void debug() {
#ifdef LOCAL
freopen("E:\\Cpp\\... | ALGO | 0.99993 | 5.653165 |
9ced6567-4cbf-4ba2-9d33-d5f1b15fbce7 | yingjerkao/FAME-GPU | FAME_Preprocessing/FAME_Parameter_Generator.cpp | #include "FAME_Internal_Common.h"
#include "FAME_Set_User_Define.h"
#include "FAME_Parameter_Lattice_Constants_Format.h"
#include "FAME_Parameter_Lattice_Vector.h"
#include "FAME_Parameter_Boundary_Point.h"
#include "FAME_Parameter_Recip_Lattice_Vector.h"
#include <iostream>
using namespace std;
void grid_nums_adjust... | TOOL | 0.944584 | 4.930618 |
f16e3497-6f8c-4afc-a081-bebc424d4672 | alexandraback/datacollection | solutions_5769900270288896_0/C++/VEK/A.cpp | #include <stdlib.h>
#include <stdio.h>
#include <iostream>
#include <fstream>
#include <string>
#include <vector>
typedef long long unsigned lluint;
int min(int a, int b) {return (a<b)?a:b;}
int max(int a, int b) {return (a>b)?a:b;}
using namespace std;
unsigned int testNum, w, h, n, best;
bool grid[16][16];
unsign... | ALGO | 0.999577 | 4.402529 |
87679122-eb8a-48bb-afb7-5bbf8f8cdd1c | jaintle/leetcode-sync | problems/4sum_ii/solution.cpp | class Solution {
public:
int fourSumCount(vector<int>& nums1, vector<int>& nums2, vector<int>& nums3, vector<int>& nums4) {
unordered_map<int,int> m;
for(int i = 0; i<nums1.size(); i++){
for(int j=0; j<nums2.size(); j++){
m[nums1[i]+nums2[j]]++;
}
}
... | ALGO | 0.999633 | 6.248996 |
84d052b5-e6ae-4822-9be0-f29a3ce9ab10 | SelvaBalasubramanian/GeeksForGeeks | C++/Arrays/Count Inversions in an array.cpp | #include<iostream>
using namespace std;
int merge(int *ar , int start , int mid , int end){
int size = end - start + 1;
int count = 0 , j = 0 , c = 0;
int arr[size];
int i = 0 ;
int p = start , q = mid+1;
while(i < size){
if(p > mid){
arr[i++] = ar[q++];
}
else if(q > end){
arr[i++] = ar[p++];
... | ALGO | 0.999961 | 4.793298 |
13afe565-d824-4359-9e03-7d6145e648c4 | ishandutta2007/codeforces | cqxym/normal/1548/B.cpp | #include<stdio.h>
#define R register int
#define L long long
#define I inline
I L Abs(L x){
return x>0?x:-x;
}
I L Gcd(L x,L y){
return y==0?x:Gcd(y,x%y);
}
L a[200001],f[200001][18];
I void Solve(){
int n,ans=0;
scanf("%d",&n);
L c,d;
scanf("%lld",&c);
for(R i=1;i!=n;i++){
scanf("%lld",&d);
a[i]=Abs(c-d);
... | ALGO | 0.999932 | 3.437906 |
dad374f9-eeac-4890-b9ea-067096fc7ef8 | Autumnal-Joy/leetcode | 1001-2000/1458/main2.cpp | #ifdef LEETCODE
#include <bits/stdc++.h>
using namespace std;
#endif
static auto _ = []() {
ios::sync_with_stdio(false);
cin.tie(nullptr);
cout.tie(nullptr);
return 0;
}();
#ifdef LEETCODE
struct TreeNode {
int val;
TreeNode *left;
TreeNode *right;
explicit TreeNode(const int x) : val... | ALGO | 0.999995 | 6.110929 |
7d2b2e5e-e2fc-440e-b4e6-59af47b62ff8 | nataraj2/MovingEB_CNSAMReX | CNS_EBoft_PulsatingSphere/Source/CNS_init_eb2.cpp |
#include <AMReX_EB2.H>
#include <AMReX_EB2_IF.H>
#include <AMReX_ParmParse.H>
#include <cmath>
#include <algorithm>
using namespace amrex;
void
initialize_EB2 (const Geometry& geom, const int required_coarsening_level,
const int max_coarsening_level,Real time)
{
BL_PROFILE("initializeEB2");
... | ALGO | 0.908595 | 4.756295 |
2e560f39-1e6e-4379-8769-f930c19fdcb6 | JoshWolper/MountStHelens | eigen/bench/perf_monitoring/trmv_upt.cpp | #include "gemv_common.h"
EIGEN_DONT_INLINE
void trmv(const Mat &A, Vec &B, const Vec &C)
{
B.noalias() += A.transpose().triangularView<Upper>() * C;
}
int main(int argc, char **argv)
{
return main_gemv(argc, argv, trmv);
}
| ALGO | 0.969675 | 4.898617 |
ac7fa4d8-1350-42e6-9e9e-ae70bc6918f3 | RakibHassanSoft/my_alogorithm_in_cpp | week 02 - Graph Algorithm/module 7 - cycle detection/7-5_Cycle_Detection.cpp | // dfs or bfs
#include <bits/stdc++.h>
using namespace std;
const int N = 1e3 + 5;
vector<int> adj[N];
bool visited[N];
bool dfs(int u, int p = -1)
{
bool isCycleExiest = false;
visited[u] = true;
for (int v : adj[u])
{
if (v == p)
continue;
if (visited[v])
retur... | ALGO | 0.999979 | 4.791421 |
36d74c48-8e65-49fb-b700-0c62c20a8cd9 | sarvex/leetcode-malbolge | solution/0600-0699/0632.Smallest Range Covering Elements from K Lists/Solution.cpp | class Solution {
public:
vector<int> smallestRange(vector<vector<int>>& nums) {
int n = 0;
for (auto& v : nums) n += v.size();
vector<pair<int, int>> t(n);
int k = nums.size();
for (int i = 0, j = 0; i < k; ++i) {
for (int v : nums[i]) {
t[j++] = {... | ALGO | 0.999997 | 5.684093 |
8774f49d-b429-4c0c-846c-00a6513b1735 | jasveenkaur1299/Leetcode-Pratice | 9-palindrome-number/9-palindrome-number.cpp | class Solution {
public:
bool isPalindrome(int x)
{
if(x<0 ||(x%10==0 &&x!=0))
return false;
int num=0;
while(x>num)
{
num=num*10 + x%10;
x/=10;
}
return (num==x || x==num/10);
}
}; | ALGO | 0.999957 | 6.028778 |
c41a596e-2dff-4648-ba73-09e6ee5660c7 | pierreeliseeflory/cryptographic-applications | Vigenere/vigenere.cpp | #include <fstream>
#include <cstring>
#include <iostream>
#include <cmath>
// float IC = 0.0667;
float IC = 0.071;
std::string ReadFile(std::string file) {
std::string text;
std::ifstream crypted_file(file);
if (crypted_file.is_open()) {
getline(crypted_file, text);
}
crypted_file.close(... | ALGO | 0.996282 | 3.560467 |
e2b1d99f-0710-4c52-a17a-89875cf62f14 | phonism/notes | AlgorithmQuestions/BlueBook/cf1419E.cpp | #include <bits/stdc++.h>
using namespace std;
int main() {
int tests;
scanf("%d", &tests);
for (int t = 0; t < tests; ++t) {
int n;
scanf("%d", &n);
unordered_map<int, int> mp;
mp[n] = 1;
int on = n;
for (int i = 2; i * i <= n; ++i) {
if (n % i =... | ALGO | 0.99989 | 4.565967 |
e6a65270-56f0-4ba0-b999-bd8cfa924039 | aayushi-jain-5/Data_Structures | Queue_using_arrays.cpp | #include<iostream>
using namespace std;
class Queue{
private:
int rear;
int front;
int arr[5];
public:
Queue(){
front=-1;
rear=-1;
for(int i=0;i<5;i++){
arr[i]=0;
}
}
bool isEmpty(){
if(front ==-1 && rear == -1){
return true ;
}
else
return false;
}
bo... | TOOL | 0.936127 | 3.99848 |
cd03201a-2036-446d-baf4-d3fdacd45718 | wqyg18/leetcode | 1049.最后一块石头的重量-ii.cpp | /*
* @lc app=leetcode.cn id=1049 lang=cpp
*
* [1049] 最后一块石头的重量 II
*/
#include <vector>
#include <numeric>
using namespace std;
// @lc code=start
class Solution
{
public:
int lastStoneWeightII(vector<int> &stones)
{
vector<int> dp(15001, 0);
int sum = accumulate(stones.begin(), stones.end(), ... | ALGO | 0.999095 | 5.144847 |
4492b767-f48d-4546-9483-3980ce99d101 | ishandutta2007/codeforces | tlewpdus/normal/983/C.cpp | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<int,int> pii;
int n;
int a[2010], b[2010];
int p, INF = 987654321;
int tra[10010][10];
int add[10010][10];
int con[10010];
int ron[800];
int pnum[10010];
vector<int> lis[5];
int D[2010][800][10];
int main() {
int i, j, k;
scan... | ALGO | 0.999873 | 3.202179 |
6f0445e9-965b-460f-8344-bfa210958528 | FabiOquendo/Competitive-Programming | Solved/Codeforces/363B - Fence.cpp | #include <bits/stdc++.h>
using namespace std;
int fence[150001];
int dp[150001];
int solve(int n, int k) {
dp[0] = 0;
for(int i = 0; i < k; i++)
dp[0] += fence[i];
double sum = dp[0];
int ans = 1;
int j = 0, h=k;
for(int i = 1; i <= n-k; i++) {
dp[i] = dp[i-1]-fence[j++]+fe... | ALGO | 0.999949 | 4.454929 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.