uuid string | repo_name string | relative_path string | content string | category string | algo_rel_score float64 | quality_score float64 |
|---|---|---|---|---|---|---|
bae1cfb2-9fea-424c-96bb-f1d092a2bd48 | DevleenaBanerjee/Stock_Prediction_ds | venv/Lib/site-packages/pystan/stan/lib/stan_math/test/unit/math/mix/mat/fun/log_determinant_spd_test.cpp | #include <stan/math/mix/mat.hpp>
#include <gtest/gtest.h>
#include <test/unit/math/rev/mat/fun/util.hpp>
TEST(AgradMixMatrixLogDeterminantSPD, fv_1stDeriv) {
using stan::math::fvar;
using stan::math::log_determinant_spd;
using stan::math::matrix_fv;
using stan::math::var;
fvar<var> a(3.0, 1.0);
fvar<var> ... | TEST | 0.86495 | 7.105087 |
d5ffbcf0-3159-447d-8971-ae605a05d0d1 | tusikalanse/acm-icpc | cf/1190/a.cpp | #include <bits/stdc++.h>
using namespace std;
const int N = 1e5 + 10;
long long n, a[N];
int m, ans, page = 0;
long long p1, p2, cnt, k;
int main() {
scanf("%lld%d%lld", &n, &m, &k);
for(int i = 1; i <= m; ++i) {
scanf("%lld", &a[i]);
}
p2 = k;
ans = a[1] <= 1LL * k;
cnt = 0;
for(int i = 1; i <= m; ++i) {
... | ALGO | 0.999951 | 3.52386 |
bbc49b7e-d976-4ad4-8828-76c771733093 | kaushik20004/cse205-ds | assignments/LAB8/846.cpp | class Solution {
public:
bool isNStraightHand(vector<int>& hand, int groupSize) {
if (hand.size() % groupSize != 0) {
return false;
}
map<int, int> count;
for (int card : hand) {
count[card]++;
}
while (!count.empty()) {
int start = count.begin()->first;
f... | ALGO | 0.999915 | 6.323348 |
e86fb6e5-e1ef-4654-98d6-136eb0bb4be1 | yosupo06/yosupo-library | test/oj/aplusb.test.cpp | // clang-format off
// verification-helper: PROBLEM https://judge.yosupo.jp/problem/many_aplusb
// clang-format on
#include <cstdio>
#include "yosupo/fastio.hpp"
yosupo::Scanner sc(stdin);
yosupo::Printer pr(stdout);
int main() {
int t;
sc.read(t);
for (int i = 0; i < t; i++) {
long long a, b;
... | ALGO | 0.992998 | 5.841679 |
ae8d1e2f-2056-405f-bd84-7319b35917ac | devararendy/tcp_proxy | sdk/boost_1_77_0/libs/math/example/binomial_example_nag.cpp | // Simple example of computing probabilities for a binomial random variable.
// Replication of source nag_binomial_dist (g01bjc).
// Shows how to replace NAG C library calls by Boost Math Toolkit C++ calls.
// Note that the default policy does not replicate the way that NAG
// library calls handle 'bad' arguments, but... | ALGO | 0.999253 | 6.490297 |
acf389f1-6977-495b-8f74-088c9a34091e | tanviranindo/Contest | BRACU ACM Student Chapter/Online Workshop on Programming Skills DAY 01 ( C++ ) BRACU ACM Student chapter/R.cpp | #include <iostream>
#include <string>
using namespace std;
int main() {
string input;
cin >> input;
for(int i=1; i<input.length(); i++)
{
if(input[i]==input[i-1])
{
input.erase(i-1,2);
i=0;
}
}
input.length()==0 ? cout << "Empty String" : cout << ... | ALGO | 0.99993 | 4.902283 |
561208ee-604c-4262-9018-36b0bb3b4759 | cvsuser-chromium/chromium-third-party | skia/src/core/SkEdge.cpp | #include "SkEdge.h"
#include "SkFDot6.h"
#include "SkMath.h"
/*
In setLine, setQuadratic, setCubic, the first thing we do is to convert
the points into FDot6. This is modulated by the shift parameter, which
will either be 0, or something like 2 for antialiasing.
In the float case, we want to turn the ... | ALGO | 0.984875 | 6.136645 |
e15fa2fc-3597-4d3f-9b6b-ec8d7fa2e655 | chachang12/sushi-doshi | sushi_doshi/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.998925 | 6.771107 |
baed3323-69e5-43da-8617-0d856b2c044a | shobhit3661/Practice-Problems- | Algorithms/90'ClockwiseMatrixRotation.cpp | /*
Given a N*N matrix Rotate the matrix Rotate the matrix in 90* ClockWise;
Also a leetcode problem;
intput:-
3
1 2 3
4 5 6
7 8 9
output:-
7 4 1
8 5 2
9 6 3
Algo:-
first transpose the matrix;
//m[i][j] = m[j][i];
1 4 7
2 5 8
3 6 9
then filp the martix;
7 4 1
8 5 2
9 6 3
*/
#include<bits/s... | ALGO | 0.999984 | 4.490176 |
03f566d5-3cce-4084-b1e1-558c6399a2cd | Xilinx/hls-llvm-project | libcxx/test/std/algorithms/alg.modifying.operations/alg.reverse/reverse_copy.pass.cpp | // <algorithm>
// template<BidirectionalIterator InIter, OutputIterator<auto, InIter::reference> OutIter>
// constexpr OutIter // constexpr after C++17
// reverse_copy(InIter first, InIter last, OutIter result);
#include <algorithm>
#include <cassert>
#include "test_macros.h"
#include "test_iterators.h"... | TEST | 0.91836 | 6.893712 |
a94c15d3-0458-4021-8249-4465a19e8cd6 | Suraj-2705/logicBuildingWithCPP | doubllyLinked.cpp | #include<iostream>
using namespace std;
class Node{
public:
int data;
Node *next;
Node *prev;
Node(int val){
data = val;
next = NULL;
prev = NULL;
}
};
void insertAtBeginning(Node **head, int value){
Node *nodeObj = new Node(value);
... | ALGO | 0.99978 | 4.471475 |
207ebdaf-dba2-4c31-a09d-16f0cdbcf1fa | htcondor/htcondor | src/condor_sysapi/ncpus.cpp | #include "condor_common.h"
#include "condor_config.h"
#include "condor_debug.h"
#include "sysapi.h"
#include "sysapi_externs.h"
/* Calculate how many cpus a machine has using the various method each OS
allows us */
/* For Linux, the counting code is it's own chunk */
#if defined(LINUX)
static void ncpus_linux( int *... | TOOL | 0.880643 | 5.637589 |
a0b8418a-1057-465a-8bad-1ecfdda436f8 | 10kshakir/c-cpp-file | c-cpp-file/snuke_string.cpp | #include <iostream>
#include <string.h>
using namespace std;
int main()
{
char str[200001];
cin>>str;
int a =0;
int b =0;
for(int i =0;i<strlen(str);i++)
{
if(str[i]='A')
{
a=i+1;
break;
}
}
for(int i =0;i<strlen(str);i++)
{
if(... | ALGO | 0.995327 | 3.063502 |
4d812272-843d-4b7b-bf38-be00e9b00eec | Basuoni/Problem-Solving-L3 | DFS/Mail_Stamps.cpp | #include <bits/stdc++.h>
#define ll long long
using namespace std;
int MOD = 1e9 + 7;
const int N = 1e9 + 1;
map<int, vector<int>> adjList;
map<int,bool> vis;
void dfs(int root)
{
if (vis[root])
return;
vis[root] = true;
for (int ne : adjList[root])
{
dfs(ne);
}
cout << root <<... | ALGO | 0.999871 | 4.787257 |
7762b93f-f297-4320-bd9a-eda22f2156b2 | wangy-bjut/leetcode | src/leetcode/2287.cpp | #include<string>
#include<unordered_map>
using namespace std;
class Solution {
public:
int rearrangeCharacters(string s, string target) {
unordered_map<char,int> hash1,hash2;
int n1 = s.length(),n2 = target.length();
int num = n1+1;
for(int i = 0;i<n2;i++)
{
h... | ALGO | 0.999971 | 5.151802 |
d332e9fe-bd2f-428c-9034-07c1e8c99dbf | zero1777/Leetcode | 916 - Word Subsets/solution.cpp | class Solution {
public:
bool isSubset(string word, vector<int> freq) {
for (auto w : word) freq[w - 'a']--;
for (int i=0; i<26; i++) if (freq[i] > 0) return false;
return true;
}
vector<string> wordSubsets(vector<string>& words1, vector<string>& words2) {
vector<string> ret;... | ALGO | 0.999952 | 5.925293 |
34aed6d1-8013-4901-8b90-29a5cb40887b | Ryexocious/problemsolving | pyramids.cpp | #include<bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef vector<ll> vec;
typedef map<string,int> mp;
#define cy cout<<"YES"<<endl;
#define cn cout<<"NO"<<endl;
#define all(x) (x).begin(), (x).end()
#define fast ios::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL);
#define pb push_back
#define pf ... | ALGO | 0.999291 | 3.632041 |
46d033e2-d513-4736-b883-fda4cf8b4057 | premchand2005/c-programming | chapter 4 pratice/3.3.cpp | #include<stdio.h>
int main(){
int i = 0, n = 3, factorial = 1;
while(i<=factorial){
factorial*=1;
i++;
}
printf("the value of factorial %d is %d", n, factorial);
return 0;
}
| ALGO | 0.999937 | 3.311273 |
9b0597ca-a0d6-41bc-9a2f-8e4272d510d9 | Blackstarez/Algorithm_solve | Algorithm_solve/4485.cpp | #include <iostream>
#include <queue>
#include <vector>
using namespace std;
#define INT_MAX 0x7fffffff
struct Pos {
int x, y;
int cost;
};
bool operator<(const Pos& p1, const Pos& p2)
{
return p1.cost > p2.cost;
}
int main()
{
ios::sync_with_stdio(false);
cin.tie(NULL);
int testCase = 1;
while (true)
{
pri... | ALGO | 0.999697 | 4.4902 |
84980084-7d57-4613-8bb4-592041c339c6 | Noor-Nasri/daily-leetcode | 392-is-subsequence/is-subsequence.cpp | class Solution {
public:
bool isSubsequence(string s, string t) {
if (s.size() == 0) return true;
int matched = 0;
for (char c : t){
if (c == s[matched]){
matched++;
if (matched == s.size()) return true;
}
}
return fa... | ALGO | 0.999878 | 6.34815 |
2ebea7f3-82e5-4332-93d5-3d9221111673 | RaisingTheDerp/raisingthebar | root/dlls/hl1_dll/hl1_npc_hornet.cpp | #include "cbase.h"
#include "AI_Default.h"
#include "AI_Task.h"
#include "AI_Schedule.h"
#include "AI_Node.h"
#include "AI_Hull.h"
#include "AI_Hint.h"
#include "AI_Memory.h"
#include "AI_Route.h"
#include "AI_Senses.h"
#include "soundent.h"
#include "game.h"
#include "NPCEvent.h"
#include "EntityList.h"
#include "acti... | ALGO | 0.945055 | 5.801081 |
66c140d6-7db8-4fcc-a953-440e9a5ac33f | Krish-the-programmer/My_cpp_repository | day4/pattern3.cpp | #include <iostream>
using namespace std;
int main()
{
int n;
cin>>n;
for (int i = n; i <= 1; i++)
{
for (int j = 1; j >= i; j--)
{
cout<<"*";
}
cout<<endl;
}
return 0;
} | ALGO | 0.999975 | 3.561455 |
49e44daa-4314-43b9-80e1-acd7d770db93 | darkshuige/codecode | c code/1043 Is It a Binary Search Tree.cpp | #include<bits/stdc++.h>
#define jiasu ios::sync_with_stdio(false),cin.tie(0),cout.tie(0)
#define int long long
#define endl "\n"
#define inf 0x3f3f3f3f3f3f3f3f
using namespace std;
const int maxn=40005;
int flag=0;
vector<int>pre,post;
void f(int root,int tail)
{
if(root>tail) return ;
int i=root+1,j=tail;
if(flag==... | ALGO | 0.999998 | 4.075076 |
95d1f5ca-79b0-41bb-9a68-598ee04b7478 | Icay12/LeetCode | Cpp/50_Pow(x, n).cpp | class Solution {
public:
double myPow(double x, int n) {
if(n == 0) {
return 1;
}
if(n < 0) {
x = 1.0/x;
if(n == INT_MIN) {
n = (n + 1) * -1;
return x * myPow(x, n);
}
n = -n; // be careful when n = I... | ALGO | 0.999744 | 5.915236 |
6b35a934-269a-46aa-bbcf-97e470cc07d4 | Kancipher/Memory-Hierarchy-simulation | SourceCodes/Cache.cpp | #include "cache.h" // Include the header file for the Cache class
#include<iostream> // Include the input/output stream library
#include<fstream> // Include the file stream library
#include<vector> // Include the vector library
#include<string> // Include the string library
#include<sstream> // Include the string strea... | ALGO | 0.917646 | 5.810508 |
6eabd435-6e7a-4062-86b8-9ec41cbfb6c2 | dliganov/Chaotic-DAW | rosic/filters/rosic_BiquadDesigner.cpp | #include "rosic_BiquadDesigner.h"
using namespace rosic;
double BiquadDesigner::getBiquadMagnitudeAt(const double &b0, const double &b1, const double &b2,
const double &a1, const double &a2, const double &frequency, const double &sampleRate)
{
double omega = 2.0 * PI * frequency / sampleRate; // optimize to one m... | ALGO | 0.982685 | 5.438124 |
80740a43-9763-4f77-bca9-321fb0dd9a20 | Kritika30032002/kritika_leetcode | Value equal to index value - GFG/value-equal-to-index-value.cpp | // { Driver Code Starts
#include<bits/stdc++.h>
using namespace std;
// } Driver Code Ends
//User function template for C++
class Solution{
public:
vector<int> valueEqualToIndex(int arr[], int n) {
// code here
vector<int> v;
for(int i=0;i<n;i++){
if(i+1==arr[i]){
v.push_back(a... | ALGO | 0.999645 | 5.420947 |
03364920-b01c-45a6-bc3e-1830387a1f77 | toan207/Competitive-Programming | CodeForces/problem/A/1409A_YetAnotherTwoIntegersProblem.cpp | //https://codeforces.com/problemset/problem/1409/A
#include <bits/stdc++.h>
using namespace std;
int main()
{
int t; cin>>t;
while(t--)
{
long long a,b; cin>>a>>b;
if (abs(a-b)%10)
cout<<(int)(abs(a-b)/10) + 1<<endl;
else
cout<<(int)(abs(a-b)/10)<<endl;
... | ALGO | 0.999119 | 4.205335 |
eb2cf483-058a-4109-943d-27735524c1d1 | zhangruoyao68/DBA | example_Reactive_ModelB/CPU_version/MPI_version/base_CPU.cpp | #include <iostream>
#include <fstream>
#include <string>
#include <cmath>
#include <random>
#include <cstring>
#include <cpuid.h> // GCC-provided
#include <mpi.h>
#define MPI_CALL(call) \
{ ... | ALGO | 0.999856 | 3.487912 |
ae567c44-68c3-4500-ba23-918afa93aa04 | DanielHaba/magma | sparse/src/zbicgstab_merge.cpp | /*
-- MAGMA (version 2.0) --
Univ. of Tennessee, Knoxville
Univ. of California, Berkeley
Univ. of Colorado, Denver
@date
@precisions normal z -> s d c
@author Hartwig Anzt
*/
#include "magmasparse_internal.h"
#define RTOLERANCE lapackf77_dlamch( "E" )
#define ATOLERA... | ALGO | 0.999836 | 5.784604 |
7ade9eeb-95f2-46e3-9e58-df0494c691e1 | codeAntu/LeetCode-problems | cpp/partitioning-into-minimum-number-of-deci-binary-numbers.cpp | #include "iostream"
#include "math.h"
#include "vector"
#include "map"
using namespace std;
class Solution {
public:
int minPartitions(string n) {
int max = 0;
for (char c : n) {
if (max < c - '0') max = c - '0';
}
return max;
}
};
int main() {
Solution s;
return 0;
} | ALGO | 0.999528 | 4.596899 |
549a9905-ce9d-4933-9488-016bb5559851 | GraceKim12/AmazingGrace_git | 2) PROGRAMMING LANGUAGES/3) C++/4. 객체 포인터와 객체배열, 객체의 동적 생성/연산자중복.cpp | #include <iostream>
using namespace std;
class Circle{
int radius;
public:
Circle(int r=0) {radius = r;};
void show() {cout << " " << radius << " " << endl;}
Circle operator +(Circle& c ) {
Circle tmp; // ӽ ü
tmp.radius = this->radius + c.radius;
return tmp;
}
};
int m... | TOOL | 0.97458 | 4.646492 |
6fbca71d-c47a-41fd-a8ab-61997ae9ca20 | gaurlakshya/Leetcode_Submissions | Shortest Path in Weighted undirected graph - GFG/shortest-path-in-weighted-undirected-graph.cpp | //{ Driver Code Starts
#include <bits/stdc++.h>
using namespace std;
// } Driver Code Ends
class Solution {
public:
vector<int> shortestPath(int n, int m, vector<vector<int>>& edges) {
// Code here
// vector<pair<int,int>> adj[n+1];
// for(auto it:edges){
// adj[it[0]].push_ba... | ALGO | 0.999982 | 6.118124 |
32afaa58-8acf-4cf0-8e8c-49ef43c39eb7 | LeoninCS/My_AlgorithmCode | Algorithm_Code/xcq算法模板/平衡树.cpp | #include<bits/stdc++.h>
#include<ext/pb_ds/assoc_container.hpp>
using namespace std;
using namespace __gnu_pbds;
using i64 = long long;
using pll = pair<i64,int>;
using ordered_set = tree<pll,null_type,less<pll>,rb_tree_tag,tree_order_statistics_node_update>;
const int inf = 1e9;
const i64 INF = 1e18;
void solve()
{
... | ALGO | 0.997873 | 3.442643 |
992ceaa9-8265-4367-a3fe-c125e2aad715 | UdaySharmaGitHub/DSA-CPP | 25_Dynamic_Programming/Problems_on_dp/Medium/1937_Maximum_Number_of_Points_with_Cost.cpp | /*
1937. Maximum Number of Points with Cost
You are given an m x n integer matrix points (0-indexed). Starting with 0 points, you want to maximize the number of points you can get from the matrix.
To gain points, you must pick one cell in each row. Picking the cell at coordinates (r, c) will add points[r][c] to your sc... | ALGO | 0.99999 | 6.342224 |
7f1a4f1c-baf1-46e2-9ab3-676c230cc0c8 | Sakura-12/PyLammps | lib/poems/onbody.cpp | #include "onbody.h"
#include "body.h"
#include "inertialframe.h"
#include "joint.h"
#include "onfunctions.h"
#include "virtualmatrix.h"
#include "matrixfun.h"
#include <iostream>
#include "norm.h"
#include "eulerparameters.h"
using namespace std;
OnBody::OnBody(){
system_body = 0;
system_joint = 0;
parent = 0;
... | ALGO | 0.95527 | 5.541317 |
0736b887-2e53-4601-bea4-53d654bf9981 | sslionel/LinkedList | DoublyLinkedList/insertion/i2.cpp | // insert at tail
#include<iostream>
using namespace std;
class Node{
public:
int data;
Node* prev;
Node* next;
public:
Node(int num){
data = num;
prev = NULL;
next = NULL;
}
};
void insertAtTail(int num,Node* &head,Node* &tail){
// case1
if(head==NULL && ... | ALGO | 0.99983 | 4.583494 |
63963308-e74a-417b-a54c-75663a773905 | FranciscoCalo/UTN | AyED2025/funcBart.cpp | #include <iostream>
#include <string>
/*
Implementacion 1: frase: Z -> E*
Frase(2)= "bart.bart"
int main (){
cout << frase(42);
}
Implementacion 2: frase: Z -> { }
Frase(2)
int main(){
Frase(42);]\
}
*/
void frase1(unsigned , std::string);
std::string frase2(unsigned , std::string);
std::string... | ALGO | 0.989386 | 4.103703 |
d9abf18b-a311-4536-9dff-959e7e0d6da7 | Zhaisan/ads | old/quiz3/test7.cpp | #include <iostream>
#include <string>
#include <vector>
using namespace std;
int cnt1[500500];
int cnt2[500500];
vector<int> prefix_func(string s) {
int n = s.size();
vector<int> p(n);
p[0] = 0;
for (int i = 1; i < n; i++) {
int j = p[i - 1];
while (j > 0 && s[j] != s[i])
... | ALGO | 0.999917 | 3.69508 |
9b5e5701-c023-4e05-9693-e94a401eea3e | njrafi/Competitive-Programming-Solutions | HackerEarth/Ankit and Race Team.cpp | #include <bits/stdc++.h>
#ifndef ONLINE_JUDGE
#define gc getchar
#define pc putchar
#else
#define gc getchar_unlocked
#define pc putchar_unlocked
#endif
using namespace std;
#define vi vector<int>
#define vll vector<i64>
#define si set<int>
#define vs vector<string>
#define pii pair<int,int>
#defi... | ALGO | 0.999872 | 3.795106 |
e2d31d9e-ad9a-4946-9b6d-36053f22a7ec | Johannyjm/c-pro | AtCoder/ahc/ahc013/strproc.cpp | #include <bits/stdc++.h>
#define rep(i, n) for(int i = 0; i < (n); ++i)
#define rep1(i, n) for(int i = 1; i < (n); ++i)
using namespace std;
using ll = long long;
int main(){
cin.tie(nullptr);
ios::sync_with_stdio(false);
string s = "asdflkj";
swap(s[0], s[2]);
cout << s << endl;
return... | ALGO | 0.998992 | 3.3115 |
ed571318-f142-4223-8ce7-52f0185ecd6e | Midas847/Competitive-Coding | LeetCode Submissions/n-th-tribonacci-number/Runtime Error/9-24-2021, 4_33_10 PM/Solution.cpp | // https://leetcode.com/problems/n-th-tribonacci-number
class Solution {
public:
int tribonacci(int n) {
int dp[n+1];
for(int i=0;i<=n;i++)
dp[i] = 0;
dp[0] = 0;
dp[1] = 1;
dp[2] = 1;
for(int i=3;i<=n;i++){
dp[i] = dp[i-1] + dp[i-2] + dp[i-3];... | ALGO | 0.999981 | 6.375898 |
3f6a0a9a-7976-4f96-876c-5cfe7f05b18e | satyasaibhushan/Advent-of-Code-2024-Cpp-Solutions | 15/sol.cpp | #include <iostream>
#include <vector>
#include <fstream>
#include <utility>
#include <map>
#include <sstream>
#include <chrono>
#include <queue>
#include <algorithm>
using namespace std;
struct State
{
int v;
int h;
char c;
};
bool valid(int x, int y, vector<string> grid)
{
if (x < 0 || x >= grid.siz... | ALGO | 0.999734 | 5.761697 |
92686956-6347-47ec-a19a-fd1b3b92231e | kiranatmakuri516/LEETCODE | k-th smallest element in BST - GFG/kth-smallest-element-in-bst.cpp | //{ Driver Code Starts
#include <bits/stdc++.h>
using namespace std;
#define MAX_HEIGHT 100000
// Tree Node
struct Node {
int data;
Node* left;
Node* right;
Node(int val) {
data = val;
left = right = NULL;
}
};
// Function to Build Tree
Node* buildTree(string str) {
// Corner ... | ALGO | 0.999933 | 6.377894 |
cfe611bb-fb36-4b2d-bbd2-ed5d483a7fe8 | dg8fv2010/LeetCode | 113.cpp | /**
* Definition for a binary tree node.
* struct TreeNode {
* int val;
* TreeNode *left;
* TreeNode *right;
* TreeNode(int x) : val(x), left(NULL), right(NULL) {}
* };
*/
class Solution {
public:
vector<vector<int> > ans;
void Func(TreeNode* root, int curSum, int sum, vector<int> v)
... | ALGO | 0.999966 | 5.647948 |
b9a4a91e-9b98-4bf5-9f22-356baa9e884c | pingjuiliao/mlir-playground | llvm-project/mlir/lib/Dialect/Affine/TransformOps/AffineTransformOps.cpp | #include "mlir/Dialect/Affine/TransformOps/AffineTransformOps.h"
#include "mlir/Dialect/Affine/Analysis/AffineStructures.h"
#include "mlir/Dialect/Affine/Analysis/Utils.h"
#include "mlir/Dialect/Affine/IR/AffineOps.h"
#include "mlir/Dialect/Affine/IR/AffineValueMap.h"
#include "mlir/Dialect/Affine/LoopUtils.h"
#include... | TOOL | 0.856731 | 7.865975 |
1b0ebf6f-aa99-447a-9228-20b57be2d632 | saeid-ebrahimi/Cpp | 07.Functions_and_recursion/5.dec_to_bin.cpp |
//in following code we want to convert entered number in decimal to binary
#include "stdafx.h"
#include <iostream>
#include <time.h>
#include <stdlib.h>
#include <string>
#include <math.h>
using std::cin;
using std::cout;
using std::endl;
using std::string;
void test_program();
bool is_decimal_num(string in_data);... | ALGO | 0.932951 | 5.1152 |
1a80a19f-cc3c-4ca9-a328-a745dd9bfecf | DaniloII09/PED-03-2023 | estructurasDinamicas/Lists/ListasDEnlazadas.cpp | #include <iostream>
using namespace std;
struct yo
{
int edad;
string nombre;
};
struct Nodo
{
struct yo inf;
struct Nodo *siguiente;
struct Nodo *anterior;
};
struct Nodo *lista = nullptr;
// Declaración de funciones
void InsertarInicio(struct yo D);
void InsertarFinal(struct yo D);
void Inser... | TOOL | 0.968138 | 4.532076 |
723139cc-f365-41f0-be6a-73ec53971ad1 | ngodangtan/nhapmonlaptrinhC | Bai Tap Buoi 01/bai_03.cpp | #include <iostream>
using namespace std;
int main()
{
int soNguyen;
cout << "Nhap nguyen: ";
cin >> soNguyen;
int soThuNhat = soNguyen / 10;
int soThuHai = soNguyen % 10;
cout << "Ket qua: " << soThuNhat + soThuHai << endl;
return 0;
} | ALGO | 0.975402 | 3.761631 |
6c5e2903-16d7-47a8-bcea-5c7ecede759e | Hussein2077/Monasbatech | 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.998764 | 6.762122 |
fb2b049b-9940-4db6-852a-f8e559a67cfe | akashb2003/dsa-questions | Arrays/15.cpp | // Given an integer array nums, move all 0's to the end of it while maintaining the relative order of the non-zero elements.
// Note that you must do this in-place without making a copy of the array.
class Solution {
public:
void moveZeroes(vector<int>& nums) {
int j=1,i=0;
while(j<nums.s... | ALGO | 0.999936 | 6.429542 |
2e5631e0-e536-4570-abd5-144b776112cd | suman987654432/C-DSA | DSA/reverse.cpp | #include <iostream>
#include <stack>
#include <string>
using namespace std;
int main() {
string str;
cout << "Enter string: ";
cin >> str;
stack<char> s;
for (int i = 0; i < str.length(); i++) {
s.push(str[i]);
}
cout << "Reverse: ";
while (!s.empty()) {
cout << s.top(... | ALGO | 0.998829 | 6.124857 |
9c691610-bf07-4771-af72-7cb2b2fba815 | GuacheSuede/MSSubmission1234567890 | submission/sma/boost_1_69_0/libs/numeric/ublas/doc/samples/triangular_adaptor.cpp | #include <boost/numeric/ublas/triangular.hpp>
#include <boost/numeric/ublas/io.hpp>
int main () {
using namespace boost::numeric::ublas;
matrix<double> m (3, 3);
triangular_adaptor<matrix<double>, lower> tal (m);
for (unsigned i = 0; i < tal.size1 (); ++ i)
for (unsigned j = 0; j <= i; ++ j)
... | ALGO | 0.986115 | 3.649494 |
018b884e-6a4b-496e-8116-e658f55566a9 | pratzie100/Leetcode | 1586-longest-subarray-of-1s-after-deleting-one-element/1586-longest-subarray-of-1s-after-deleting-one-element.cpp | static auto _enhancer = []()
{
ios::sync_with_stdio(false);
cin.tie(nullptr);
return 0;
}();
class Solution {
public:
int longestSubarray(vector<int>& nums) {
// int zerocount=0; // Number of zero's in the window.
// int l=0;
// int start=0;// Left end of the window.
// ... | ALGO | 0.999947 | 5.874589 |
dbb82fd6-2553-4ef5-934c-a0c7b56182c1 | CyberMatic-AmAn/CodeForces-Solution | 800_tle/1881A.cpp | /*
author : AmAn
time : hh:mm:ss xx
###### # # ###### ######## ######## # # # # #########
# # # # # # # # # # # # #
###### # # ###### # ######## # # # # #
# # # # # # # # # # # ... | ALGO | 0.999864 | 3.982469 |
9d52bdc3-5098-49ae-95fd-fb5723c481b1 | kkorolev1/ami-contests | algo2/contest4/A.cpp | #include <iostream>
#include <vector>
#include <queue>
using namespace std;
int main() {
freopen("input.txt", "r", stdin);
cin.tie(nullptr);
ios::ios_base::sync_with_stdio(false);
int n, s, f;
cin >> n >> s >> f;
const int MAX_VALUE = 100 * n;
vector<vector<int>> g(n + 1, vector<int>(n +... | ALGO | 0.999977 | 4.788047 |
7d5b4ee4-80df-4185-be6d-47635a75a6c6 | sarvex/leetcode-pascal | solution/1700-1799/1758.Minimum Changes To Make Alternating Binary String/Solution.cpp | class Solution {
public:
int minOperations(string s) {
int cnt = 0, n = s.size();
for (int i = 0; i < n; ++i) cnt += s[i] != "01"[i & 1];
return min(cnt, n - cnt);
}
}; | ALGO | 0.999937 | 5.868265 |
9323710b-291e-446c-aba4-886213b17648 | ishandutta2007/codeforces | brovko/normal/1591/A.cpp | #include <bits/stdc++.h>
using namespace std;
int n, a[105];
int main()
{
ios_base::sync_with_stdio(0);
cin.tie(0);
cout.tie(0);
int t;
cin >> t;
while(t--)
{
cin >> n;
for(int i = 0; i < n; i++)
cin >> a[i];
int s = 1;
for(int i = 0; i < n... | ALGO | 0.999945 | 4.157086 |
6ed54fb8-2998-4cfc-9cb2-a5fc5898ff7c | xitangking/CPlusPlus-Primer-Plus | 程序清单/第15章 友元、异常和其他/chapter15/chapter15/const_cast.cpp | #include<iostream>
using namespace std;
void change(const int *pt, int n);
int main()
{
int pop1 = 38383;
const int pop2 = 2000;
cout << "pop1pop2 " << pop1 << "" << pop2 << endl;
change(&pop1, -103);
change(&pop2, -103);
cout << "pop1pop2 " << pop1 << "" << pop2 << endl;
system("pause");
return 0;
}
void ... | ALGO | 0.945243 | 3.821861 |
7b64d10b-5dc0-4752-ac8c-ef753ada3ee9 | nglong14/CP | Chuan/knot.cpp | #include<bits/stdc++.h>
using namespace std;
#define int long long
const int maxn=2222;
int n;
vector<int> g[maxn], res;
int d[maxn];
int lis(int l, int r)
{
vector<int>a;
for (int i=l; i<r; i++)
{
auto it=upper_bound(a.begin(), a.end(), res[i]);
if (it!=a.end()) *it=res[i];
else a.push_back(... | ALGO | 0.999479 | 3.822071 |
62c02427-79ed-4b18-ac71-0dff97021a0a | Vesion/Misirlou | hihocode/1081-ShortestPathI.cpp | #include <iostream>
#include <algorithm>
#include <vector>
#include <string>
#include <cstring>
#include <climits>
using namespace std;
const int MAXN = 1005;
int g[MAXN][MAXN];
int dist[MAXN];
bool has[MAXN];
int N, M, S, T;
void dijkstra(int s) {
for (int i = 1; i <= N; ++i) dist[i] = g[s][i];
dist[s] = 0;... | ALGO | 0.999831 | 4.769434 |
cf571b7f-af8a-429d-8827-fe747809f201 | Thesohan/Basic-c-Algo | di.cpp | #include<bits/stdc++.h>
#include <stdio.h>
#include <limits.h>
using namespace std;
int minD(int V,int dist[], bool sptSet[])
{
int min = INT_MAX, min_index;
for (int v = 0; v < V; v++)
if (sptSet[v] == false && dist[v] <= min)
min = dist[v], min_index = v;
return min_index;
}
int printDis(int V,int ... | ALGO | 0.999964 | 4.113193 |
44ec7bf7-871c-4952-81b9-ba251e7a6ff0 | clivemeesala/cpp | maxshakehands.cpp | #include <iostream>
using namespace std;
int main()
{
int num;
cout<<"Enter the number of people in the room: ";
cin>>num;
int total = num * (num-1) / 2;
cout<<"Total handshakes = "<<total;
return 0;
}
| ALGO | 0.996412 | 4.858471 |
5d1549e5-3298-46a0-a248-bde78e3ec52d | Blackfury7/LeetCode | 1685-sum-of-absolute-differences-in-a-sorted-array/1685-sum-of-absolute-differences-in-a-sorted-array.cpp | class Solution {
public:
vector<int> getSumAbsoluteDifferences(vector<int>& nums) {
vector<int>ans(nums.size(),0);
for(int i = 1;i<nums.size();i++)
ans[0]+=(nums[i]-nums[0]);
for(int j = 1;j<nums.size();j++)
ans[j] = ans[j-1]+(nums[j]-nums[j-1])*j-(nums[j]-nu... | ALGO | 0.999883 | 5.34199 |
6ecd36ef-5eb0-4a82-b553-990335df87ee | yjm6560/BOJ | 2820/bef.cpp | /*
자동차 공장
BFS,DFS
*/
#include <iostream>
#include <algorithm>
#include <string.h>
#include <vector>
using namespace std;
char cmd;
int N, M, parent, a, x, pay[500001], diff[500001];
vector<vector<int>> relation;
bool updated = false;
int dfs(int a){
int ret = 0;
for(auto c : relation[a]){
ret += dfs(c) + diff[... | ALGO | 0.999542 | 4.046732 |
3a7ebd22-6457-4cb4-8e93-997f9a53fae7 | hasnain-cyber/competitive-programming | codeforces/Translation.cpp | #include <algorithm>
#include <cmath>
#include <iostream>
#include <limits>
#include <map>
#include <vector>
typedef long long int num;
using namespace std;
int main() {
string s1, s2;
cin >> s1;
cin >> s2;
if (string(s1.rbegin(), s1.rend()) == s2)
cout << "YES" << endl;
else
cou... | ALGO | 0.999948 | 3.345001 |
df7d8b26-3a84-41e3-851d-4427377000be | KangKangOS/android_frameworks_av | media/libstagefright/codecs/amrnb/dec/src/pstfilt.cpp | /*----------------------------------------------------------------------------
; INCLUDES
----------------------------------------------------------------------------*/
#include <string.h>
#include "pstfilt.h"
#include "typedef.h"
#include "mode.h"
#include "basicop_malloc.h"
#include "basic_op.h"
#include "weight_a.h... | ALGO | 0.992667 | 4.823016 |
91e0a81c-daef-4de3-8c8e-bb222eb0e4ec | TosmimForidMehtab/StriverA2ZSeries | BinarySearch/27FindinMatrix.cpp | #include<bits/stdc++.h>
#define int long long
#define endl "\n"
#define fast ios::sync_with_stdio(0);cin.tie(0);cout.tie(0);
using namespace std;
bool searchMatrix(vector<vector<int>>& mat, int target) {
int n = mat.size();
int m = mat[0].size();
int i = 0, j = m - 1;
while (i<n and j >= 0) {
if (mat[i][j] == tar... | ALGO | 0.999969 | 4.821789 |
08b9acd1-c787-40ea-bd09-66cf4dd544ef | MarufPulok/cp | Codeforces/1335A.cpp | #include<bits/stdc++.h>
using namespace std;
int main() {
int t;
cin >> t;
while(t--) {
long long n;
cin >> n;
if(n <= 2) cout << 0 << endl;
else {
if(n % 2 == 0) cout << n / 2 - 1 << endl;
else cout << n / 2 << endl;
}
}
return 0;
} | ALGO | 0.999912 | 5.082551 |
70f5a5bd-8cf9-4e9f-a0aa-4867ac7fbc27 | BUIE201/BUIE201-BUIE201-2020-1-HMW2 | Source.cpp | #include <iostream>
#include <vector>
#include <set>
#include <chrono>
using namespace std;
void TestVectorSet(int sz, int ValueToFind)
{
// measure
vector<int> largev;
largev.reserve(sz);
for (int i = 0; i < sz; i++)
{
largev.push_back(i);
}
// measure FindSimpleWithRangeForLoop(largev, ValueToFind);
// ... | ALGO | 0.992773 | 4.795251 |
91962992-580c-4821-b9b3-7f4f758ffbe1 | NipunRathore/GFGPracticeSolutions | Easy/Structs and Objects/structs-and-objects.cpp | //{ Driver Code Starts
//Initial Template for C++
#include <bits/stdc++.h>
using namespace std;
struct Rectangle
{
int length;
int breadth;
Rectangle(){}
Rectangle(int l,int b)
{
length=l;
breadth=b;
}
};
int area(Rectangle r);
void maxArea(Rectangle arr[],int n);
// } Dr... | ALGO | 0.99957 | 5.927243 |
016cc6e7-84c8-4fec-af21-d50c66ab0f26 | MadhuB76/CodeChef-Solutions | pair_sum.cpp | #include <iostream>
using namespace std;
int main()
{
int n;
cin >> n;
int count = 0;
for (int i = 1; i < n; i++)
{
for (int j = 1; j <= n; j++)
{
if (i + j == n)
{
count++;
}
}
}
cout << count << endl;
return 0;... | ALGO | 0.999308 | 4.163676 |
921c7aed-eb66-4849-a223-331e6a0e529d | Mahim1703003/Computer-Graphics | Bresenham.cpp | #include<iostream>
using namespace std;
void Bresenham(int x1, int y1, int x2, int y2)
{
int p,diff_x,diff_y;
diff_x = x2 - x1;// delta x = x2 - x1
diff_y = y2 - y1; // delta y = y2 - y1
cout<<"initial Point: ("<<x1<<", "<<y1<<")"<<endl;
p = 2 * diff_y - diff_x;
while(x1 != x2 || y1 != y2)... | ALGO | 0.999301 | 3.703784 |
ca72d32b-93ed-4d42-9114-b0d0414228c6 | infoSleuth25/Codeforces | comp2.cpp | #include<bits/stdc++.h>
using namespace std;
int main (){
int t;
cin >> t;
while(t--){
int n,x;
cin >> n >> x;
bool flag = false;
for(int i=0;i<n;i++){
if(i == x){
flag = true;
}
else{
cout << i << " ";
}
}
if(flag){
cout << x << endl;
}
else{
cout << endl;
}
}
return 0;... | ALGO | 0.999636 | 3.640618 |
42a1efa4-1d55-4639-85c8-9581ddb18671 | code-walker-23/LeetCode-Prep | Difficulty: Medium/Count Inversions/count-inversions.cpp | //{ Driver Code Starts
#include <bits/stdc++.h>
using namespace std;
// } Driver Code Ends
class Solution {
public:
int countInversion(vector<int>& arr, int low, int mid, int high){
int i = low;
int j = mid+1;
int count = 0;
while(i <= mid && j <= high){
if(arr[i] <= arr[j])count +... | ALGO | 0.999065 | 6.412525 |
7bcda4c4-7a1f-4de7-8153-35525e8f6a1a | iCoder0020/Competitive-Coding | CF-old/656/C.cpp | #include <bits/stdc++.h>
using namespace std;
#define int long long
#define INF 1e12
bool bs(vector<int>&A, int k)
{
int l = k;
int r = A.size()-1;
int prev = -1;
while(l<=r)
{
if(A[l] <= A[r])
{
if(A[l]<prev)
return false;
prev = A[l];
l++;
}
else
{
if(A[r]<prev)
return false;
... | ALGO | 0.999715 | 4.858665 |
ffa4040e-1b8c-4c5e-b8a2-6d20e188fa97 | blakeaw/atomic-molecular-nested-sampling | src/np-dimers-dumbbells/nested-parallel-omp-testing/pNest_dimers_parallel_replicates_nested.cpp | /* Nested Sampling Routine--Collected nested median energys.
Configured for NP dimer system with Radii r1, r2, mass m1, m2, and bondlength Lb, where r1<r2.
Uses combination of Colloid potential and screened electrostatics.
Has an LJ12-6 wall in the z-plane.
params and units:
R1;p1 (distance units), R2;p2 (distance un... | ALGO | 0.999463 | 5.411064 |
87db3f5c-7826-4e73-a79b-fa3cc9abda8d | shishirkumar1996/cp | 18/05.18/11.05.18/196A.cpp | #include<bits/stdc++.h>
#define faster ios::sync_with_stdio(false);cin.tie(0);
using namespace std;
int main(){
string input;
cin>>input;
string output = "";
char maxm = input[input.size()-1];
output += input[input.size()-1];
for(int i = input.size()-2;i>=0;i--)
if(input[i] >= maxm) {
outp... | ALGO | 0.999985 | 4.262464 |
9afe4850-1f7b-4820-af95-739fee9ac805 | lasjg72/CompetetiveProgramming | program/Atcoder/ABC/ABC_D/D120.cpp | #include <iostream>
#include <algorithm>
#include <tuple>
#include <vector>
#include <string>
#include <queue>
#include <cmath>
#include <set>
#include <map>
#include <cassert>
using namespace std;
using ll = long long;
struct UnionFind{
vector<ll> par;
UnionFind(int n):par(n, -1){};
int root(int x){
... | ALGO | 0.999991 | 4.184295 |
bd476423-50ad-4cd4-9d09-a677ab4e54f7 | MericLuc/CodinGame | Medium/the-last-crusade-episode-1.cpp | #include <iostream>
#include <string>
#include <vector>
#include <algorithm>
#include <sstream>
#include <map>
#define DEBUG 0 // Display debug infos
#define TYPES 14 // Number of pieces types
using namespace std;
struct Piece
{
int x; // X pos
int y; // Y pos
int type;// type
Piece(c... | ALGO | 0.998704 | 3.877529 |
1809dbbd-2fd5-45ec-91cf-e20b6363c12c | devrt/gazebo-mirror | deps/opende/src/sphere.cpp | /*
standard ODE geometry primitives: public API and pairwise collision functions.
the rule is that only the low level primitive collision functions should set
dContactGeom::g1 and dContactGeom::g2.
*/
#include <gazebo/ode/common.h>
#include <gazebo/ode/collision.h>
#include <gazebo/ode/matrix.h>
#include <gazebo/od... | ALGO | 0.987919 | 6.759581 |
6b6d5f6c-6c22-467b-b20e-b161ca8566e5 | etotheipi/BitcoinArmory | cppForSwig/cryptopp/rc2.cpp | // rc2.cpp - written and placed in the public domain by Wei Dai
#include "pch.h"
#include "rc2.h"
#include "misc.h"
#include "argnames.h"
NAMESPACE_BEGIN(CryptoPP)
void RC2::Base::UncheckedSetKey(const byte *key, unsigned int keyLen, const NameValuePairs ¶ms)
{
AssertValidKeyLength(keyLen);
int effectiveLen =... | ALGO | 0.969891 | 7.705417 |
1dd339ad-0a0f-4d40-b04b-b48e72f41362 | chetanpatil13/MorseCodeClock | src/morse_code.cpp | #include "morse_code.hpp"
const string MorseCode::getCode(unsigned int num)
{
if (num > 9)
return "Error: from MorseCode::getCode() : num is greate than 9 !!!";
else
return codesForNumbers[num];
}
| ALGO | 0.858052 | 3.679114 |
02d8a411-64e1-4915-8927-78643dd15de3 | jennybehre/Control_and_Trajectory_Tracking_for_Autonomous_Vehicle | project/pid_controller/eigen-3.3.7/doc/examples/Tutorial_ArrayClass_cwise_other.cpp | #include <Eigen/Dense>
#include <iostream>
using namespace Eigen;
using namespace std;
int main()
{
ArrayXf a = ArrayXf::Random(5);
a *= 2;
cout << "a =" << endl
<< a << endl;
cout << "a.abs() =" << endl
<< a.abs() << endl;
cout << "a.abs().sqrt() =" << endl
<< a.abs().sqrt() << endl... | ALGO | 0.983605 | 3.139807 |
f080dcdd-ce58-48ff-932e-51b8e8e75ec9 | WiseCoder24/DSA | Recursion/remove_dups.cpp | #include<bits/stdc++.h>
using namespace std;
string removeDups(string s){
if(s.length()==0){
return "";
}
char c = s[0];
string ans = removeDups(s.substr(1));
if(c==ans[0]){
return ans;
}
else{
return c+ans;
}
}
int main(){
cout<<removeDups("aaaabbbeeecdddd")... | ALGO | 0.999942 | 4.590606 |
37271afd-4cfe-4fc1-9813-06bd0f70278c | elias-lnwbr/initiation-programmation-cpp | assgnmt-04/lireetdire.cpp | #include <iostream>
using namespace std;
int separer_chiffre_gauche(int& nombre)
{
int dix(1);
int temp(nombre);
while (temp >= 10) {
dix *= 10;
temp /= 10;
}
nombre %= dix;
return temp;
}
/*****************************************************
* Compléter le code à partir d'ici
****************... | ALGO | 0.999813 | 3.527769 |
ce744083-c2c5-452f-b555-fb9e52029376 | tte0/CP | Tree_Infection.cpp | /*
Author: Teoman Ata Korkmaz
*/
#pragma GCC optimize("O3,fast-math,unroll-loops")
#include <bits/stdc++.h>
//#include <ext/pb_ds/assoc_container.hpp>
//#include <ext/pb_ds/tree_policy.hpp>
#define int ll
#define ff first
#define ss second
#define endl '\n'
#define spc ' '
#define pb push_back
#define e2(x) (1LL<<(x))... | ALGO | 0.999595 | 3.746008 |
07b5f73a-1554-4990-98ce-52b5fa721b39 | devansh511/DSA | Recursion/reverseArray.cpp | #include<bits/stdc++.h>
#include<time.h>
using namespace std;
typedef vector<long long> vi;
typedef pair<long long , long long> pii;
typedef unordered_map<long long, long long> um;
typedef map<long long, long long> om;
typedef priority_queue<long long> max_heap;
typedef priority_queue<long long, vector<long long>, gre... | ALGO | 0.999963 | 3.368263 |
07cf0640-fd65-40cc-96ce-b75a4b7acb26 | HinaPE/HinaPE-Houdini | HinaPE/3rd_party/eigen-3.4.0/bench/sparse_setter.cpp |
//g++ -O3 -g0 -DNDEBUG sparse_product.cpp -I.. -I/home/gael/Coding/LinearAlgebra/mtl4/ -DDENSITY=0.005 -DSIZE=10000 && ./a.out
//g++ -O3 -g0 -DNDEBUG sparse_product.cpp -I.. -I/home/gael/Coding/LinearAlgebra/mtl4/ -DDENSITY=0.05 -DSIZE=2000 && ./a.out
// -DNOGMM -DNOMTL -DCSPARSE
// -I /home/gael/Coding/LinearAlgebr... | ALGO | 0.978651 | 4.145121 |
1453525d-21fb-44e2-b278-0f8e0268b730 | nabillazian/Desain_Analisis_Algoritma | APSD - PA1 - Nabilla Lintana Zian/Pertemuan 3/Praktikum/PTM3 - Quicksort.cpp | #include<iostream>
using namespace std;
void swap(int arr[], int pos1, int pos2) {
int temp;
temp = arr[pos1];
arr[pos1] = arr[pos2];
arr[pos2] = temp;
}
int partition(int arr[], int low, int high, int pivot) {
int i = low;
int j = low;
while (i <= high) {
if (arr[i] > pivot) {
... | ALGO | 0.999908 | 5.575779 |
2e4110bb-3a02-41d0-8829-fd23dd78b1fe | VietDQ11/Assignment | bai10.cpp | #include<iostream>
using namespace std;
class String
{
public:
char* str;
//String();
friend String operator + (const String&, const String&);
friend ostream& operator << (ostream&, String&);
friend istream& operator >> (istream&, String&);
};
String operator+ (const String&str1, const String&str2)
{
int i,j;
... | ALGO | 0.892788 | 3.983218 |
2c0a7ef0-14b5-499b-9247-9f94bdcf57bc | ahmedibrahim404/CompetitiveProgramming | Codeforces/1313C/main.cpp | #include <bits/stdc++.h>
typedef long long ll ;
using namespace std ;
const int N = 500001+3;
int a[N], ans[N], n;
ll L[N], R[N];
int main(){
memset(R, 0, sizeof R);
memset(L, 0, sizeof L);
cin >> n;
for (int i = 0; i < n; i++) cin >> a[i];
stack<int> sk;
L[0] = a[0];
sk.push(0);
int... | ALGO | 0.999993 | 3.112731 |
29035879-d92f-4fe0-86c7-35bc448d864a | andiniafriyanti/postagefee | 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.998762 | 6.786404 |
a27c21c5-b546-4447-96de-7d44506d8db6 | erfatjahan/problem-solve | super zoon 13/day 1/day 4/F - Alice and the Cake.cpp | #include <bits/stdc++.h>
using namespace std;
priority_queue<long long> q, p;
int main()
{
long long t;
cin >>t;
while(t--)
{
long long n;
cin >> n;
while(!q.empty()) q.pop();
while (!p.empty()) p.pop();
long long s = 0;
for (long long i = 1; i <= n; i++)
... | ALGO | 0.999914 | 3.954694 |
2df97929-955b-4787-8175-116d9c8cffa0 | dkhanhdeptrai/Cpp | code ptit/c++/hinhchuz.cpp | #include <iostream>
using namespace std;
int main() {
int n;
cin >> n; // Nhập chiều cao của chữ Z (5 ≤ N ≤ 100)
// Kiểm tra điều kiện đầu vào
if (n < 5 || n > 100) {
cout << "N phai nam trong khoang [5, 100]" << endl;
return 0;
}
// Vẽ chữ Z
for (int i = 0; i < n; i++) {
... | ALGO | 0.995007 | 4.226589 |
5a025611-12ba-4613-b2d9-86c455f9928e | kunyavskiy/competitive-programming-archive | opencup/21-22/211212/E.cpp | #include <iostream>
#include <fstream>
#include <vector>
#include <set>
#include <map>
#include <cstring>
#include <string>
#include <cmath>
#include <cassert>
#include <ctime>
#include <algorithm>
#include <sstream>
#include <list>
#include <queue>
#include <deque>
#include <stack>
#include <cstdlib>
#include <cstdio>... | ALGO | 0.999794 | 4.093738 |
6f9691c0-e801-4c3e-a727-58cb5e500352 | ranasl62/UVA_SOLVE | math SSC.cpp | #include<iostream>
#include<cmath>
#define pi 2*acos(0.0)
using namespace std;
int main()
{
double x,h;
x=(1000/(tan(60.0*pi/180)/tan(30.0*pi/180)+1));
h=tan(30.0*pi/180)*(1000-x);
cout<<"X = "<<x<<endl<<"h = "<<h<<endl;
return 0;
}
| ALGO | 0.999336 | 3.065057 |
f8afdea4-0d9b-4f57-bb61-7a5aa0155a51 | yoshikiri/kyo-pro | atcoder/abc/159/a.cpp | #include <iostream>
#define rep(i, n) for (int i = 0; i < (int)(n); ++i)
int main() {
int n, m;
std::cin >> n >> m;
std::cout << n * (n - 1) / 2 + m * (m - 1) / 2 << '\n';
return 0;
}
| ALGO | 0.999686 | 3.196622 |
72e04f71-7ea1-49dc-af85-4a0f757da3b6 | larrychen20011120/DSA | Algorithm/Homework/HW9/go_out_maze.cpp | #include <iostream>
#include <queue>
using namespace std;
struct Position {
short x, y;
};
int main () {
ios_base::sync_with_stdio(false);
cin.tie(0);
short M, N;
Position start, end;
cin >> M >> N >> start.x >> start.y >> end.x >> end.y;
short route[M+2][N+2];
queue <Position> next_... | ALGO | 0.999922 | 4.18468 |
7c8ef678-1793-4635-9caa-843a7bb33c84 | QinHaoChen97/VS_C | Hot100/338.比特位计数.cpp | // @before-stub-for-debug-begin
#include <vector>
#include <string>
#include "commoncppproblem338.h"
using namespace std;
// @before-stub-for-debug-end
/*
* @lc app=leetcode.cn id=338 lang=cpp
*
* [338] 比特位计数
*/
// @lc code=start
#include <iostream>
#include <vector>
using namespace std;
// https://leetcode-cn.c... | ALGO | 0.999866 | 6.449087 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.