uuid string | repo_name string | relative_path string | content string | category string | algo_rel_score float64 | quality_score float64 |
|---|---|---|---|---|---|---|
5a383586-3b78-4a27-874c-8a28673f5ce8 | Nhypocrite/XJTU_Computer_Graphics_2021_lab02 | extern/libigl/include/igl/delaunay_triangulation.cpp | #include "delaunay_triangulation.h"
#include "flip_edge.h"
#include "lexicographic_triangulation.h"
#include "unique_edge_map.h"
#include "is_delaunay.h"
#include <vector>
#include <sstream>
template<
typename DerivedV,
typename Orient2D,
typename InCircle,
typename DerivedF>
IGL_INLINE void igl::delaunay_tri... | ALGO | 0.999118 | 7.657846 |
913489ac-8c86-4347-b737-0aff228afc66 | hacdias/playground | cpp/competitive-programming/UVA/10341/main.cpp | #include <bits/stdc++.h>
using namespace std;
int p, q, r, s, t, u;
double val(double x) {
return (p*exp(-x)+q*sin(x)+r*cos(x)+s*tan(x)+t*pow(x, 2)+u);
}
double find(double fi, double la) {
if (la - fi < 1e-10) return fi;
double mid = (fi+la)/2;
(val(mid) > 0) ? fi = mid : la = mid;
return find(fi, la);
}
... | ALGO | 0.999784 | 3.422344 |
e8b6aa5b-1d1a-4b74-8bbb-f801cf33e036 | ishandutta2007/codeforces | coderanshu/normal/1543/B.cpp | #include<bits/stdc++.h>
using namespace std ;
#define ll long long
#define pb push_back
#define all(v) v.begin(),v.end()
#define sz(a) (ll)a.size()
#define F first
#define S second
#define INF 2000000000000000000
#define popcount(x) ... | ALGO | 0.999927 | 4.953073 |
58c34e01-82ca-4af2-8bde-2716153aaca9 | plctlab/plct-gem5 | src/systemc/tests/systemc/misc/unit/data/datawidth_bool_to_signed/lost_carry/datawidth.cpp | /*****************************************************************************
datawidth.cpp --
Original Author: Martin Janssen, Synopsys, Inc., 2002-02-15
*****************************************************************************/
/**************************************************************************... | ALGO | 0.936886 | 5.478027 |
79c933ce-45f8-4718-b293-7a3a78274907 | jigmetnamgyal/Data-Structure-and-Algorithm | practisecpp/sieveOfEratostheness.cpp | #include <iostream>
#include <vector>
#include <cmath>
using namespace std;
//Finding prime number using trial and division method
//bool isPrime(int n){
// for(int i = 2; i <= sqrt(n); i++){
// if (n % i == 0) return false;
// }
// return true;
//
//}
//finding prime number using sieve of Eratosthenes... | ALGO | 0.999791 | 4.523836 |
bd8c2b71-c9d0-4bea-8a63-e3ccc5961d13 | mohammedjasam/Technical-Interview-Guide | LeetCode/leetcode_maximum-vacation-days.cpp | /*
*
* Tag: DP
* Time: O(kn^2)
* Space: O(n)
*/
class Solution {
public:
int maxVacationDays(vector<vector<int>>& flights, vector<vector<int>>& days) {
int ans = 0;
if(days.size() == 0 || flights.size() == 0){
return ans;
}
int n = flights.size(), k = days[0].siz... | ALGO | 0.999963 | 5.601409 |
50fbf407-8080-4086-9097-b9fa9c835ea8 | Solonani/DAA | DAA12..cpp | #include <stdio.h>
// Function to perform binary search
int binarySearch(int arr[], int left, int right, int target) {
while (left <= right) {
int mid = left + (right - left) / 2;
// Check if target is present at mid
if (arr[mid] == target)
return mid;
// If target gre... | ALGO | 0.999911 | 6.730223 |
a7e921c9-e92a-4204-89a2-b2461e95eef6 | Islombek885/lesson_3 | 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 |
ea5f09cb-2e55-45eb-8055-c4cbe928bfe7 | smpvini/estrutura-de-dados-2s-2023 | atividade2/exercicio2.cpp | #include <stdio.h>
void menor_maior_array(int arr[], int size, int *menor, int *maior) {
if (size <= 0) {
printf("O array est vazio.\n");
return;
}
*menor = arr[0];
*maior = arr[0];
for (int i = 1; i < size; i++) {
if (arr[i] < *menor) {
*menor = arr[i];
... | ALGO | 0.99966 | 5.179279 |
300d3aa1-6781-44ca-b4fe-d2d80357e4a9 | JulianKarrer/moleculardynamics | subprojects/eigen-3.4.0/lapack/cholesky.cpp | #include "lapack_common.h"
#include <Eigen/Cholesky>
// POTRF computes the Cholesky factorization of a real symmetric positive definite matrix A.
EIGEN_LAPACK_FUNC(potrf,(char* uplo, int *n, RealScalar *pa, int *lda, int *info))
{
*info = 0;
if(UPLO(*uplo)==INVALID) *info = -1;
else if(*n<0) ... | ALGO | 0.998695 | 6.004565 |
05ae064f-3031-4f31-8226-a76ccd436f0a | pranavbalu1/TicTacToeASM | Pseudocode.cpp | .data
myArray: .byte ' ',' ',' ',' ',' ',' ',' ',' ',' '
.text
main:
askUserXorO(); // Ask the user whether they rather play as 'X' or 'O'
// $s0 = userChar & $s1 = compChar
int boardMoves = 0; // The number of moves done by user and computer
bool di... | ALGO | 0.99591 | 3.610704 |
ea676225-086d-405b-ace6-776c16447adc | habib09/problem-solution | uva/10653 - Bombs! NO they are Mines!!.cpp | #include <set>
#include <map>
#include <list>
#include <cmath>
#include <ctime>
#include <climits>
#include <queue>
#include <stack>
#include <cctype>
#include <cstdio>
#include <string>
#include <vector>
#include <cassert>
#include <cstdlib>
#include <cstring>
#include <sstream>
#include <iostream>
#include <algorithm... | ALGO | 0.999828 | 4.161379 |
9dcc6e4d-50af-4427-8d94-29f611d0c617 | jajmo/stevens-code | CS-182/Graphs/getters.cpp | #include "mygraphs.hh"
#include "myamgraph.hh"
/**
* V()
* Returns the number of vertices in the graph
*
* Return unsigned int - The number of vertices currently in the graph
* Precondition - None
* Postcondition - None
*/
template unsigned int MyGraph<string>::V();
template unsigned int MyGraph<i... | ALGO | 0.906763 | 4.190921 |
5fededb0-7eaa-4f30-8ab4-0f0bf333af23 | DSdaniaa/PF-Week06-LAB | task9.cpp | #include <iostream>
#include <cmath>
using namespace std;
float calculate(int days, int weekends);
main(){
string year;
int days,weekends;
float result;
cout << "Enter normal or leap: ";
cin >> year;
cout << "Enter holidays in the year excluding Saturday or Sunday: ";
cin >> days;
cout <... | ALGO | 0.999092 | 3.873841 |
3e6bfe48-8314-4b98-b462-e3ad72c71591 | AdityaPatel10/C-Plus | DATA STRUCTURE/Sorting/Selection(using function).cpp | #include<iostream>
using namespace std;
void Selection(int a[], int n){
int i, j, temp, min;
for(i=0 ; i<n-1 ; i++){
min = i;
for(j=i+1; j<n ; j++){
if(a[i]<a[min])
min=j;
}
if(min!=i){
temp = a[i];
a[i] = a[min];
a[... | ALGO | 0.999856 | 3.78535 |
c2e0a06f-0f1e-4d1e-8706-f60a56209b33 | ActivePeter/GAMES101_study | patest/src/transforms/base.cpp | #include "base.h"
#include "math_def.h"
Eigen::Matrix3f get_rotate_trans_2d(float eular_angle, float trans_x, float trans_y)
{
Eigen::Matrix3f i;
float radius = eular_angle / 180 * PI;
i << cos(radius), -sin(radius), trans_x,
sin(radius), cos(radius), trans_y,
0.0, 0.0, 1.0;
return i;
} | ALGO | 0.899808 | 6.157525 |
b287fd66-7fd9-4b59-a6b6-c63966f41eab | hardikg2907/CSES | Tree Algorithms/Tree_Matching.cpp | #include <bits/stdc++.h>
using namespace std;
#define int long long
const int mod = 1e9 + 7;
vector<int> tree[200001];
int dp[200001][2];
void solve(int src, int par)
{
vector<int> prefix, suffix;
dp[src][0] = dp[src][1] = 0;
bool leaf = 1;
for (int child : tree[src])
{
if (child == par)
... | ALGO | 0.999343 | 4.498645 |
94d84705-0246-4974-8c8d-a4daa04e2dc7 | Logan-Shi/libs | eigen-eigen-b9cd8366d4e8/build_dir/doc/snippets/compile_ColPivHouseholderQR_solve.cpp | #include <Eigen/Dense>
#include <iostream>
using namespace Eigen;
using namespace std;
int main(int, char**)
{
cout.precision(3);
Matrix3f m = Matrix3f::Random();
Matrix3f y = Matrix3f::Random();
cout << "Here is the matrix m:" << endl << m << endl;
cout << "Here is the matrix y:" << endl << y << endl;
Matrix3f x... | ALGO | 0.999815 | 3.59237 |
cabbf708-581f-4af9-b15c-a57e1933fa33 | gab-borges/atcoder | problems/ABC381D.cpp | #include <bits/stdc++.h>
using namespace std;
typedef vector<int> vi;
typedef pair<int, int> ii;
typedef long long ll;
int main() {
ios_base::sync_with_stdio(0);
cin.tie(0);
int n; cin >> n;
vi A(n);
for (int i = 0 ; i < n; i++) cin >> A[i];
if (n == 1) {
cout << 0 << '\n';
return 0;
}
int ans = 0;
in... | ALGO | 0.999896 | 4.314591 |
99eea1ee-ec02-4d11-ac23-67efbce7490b | kambehmw/algorithms_cpp | atcoder/Educational_DP_Contest/C_Vacation.cpp | #include <iostream>
#include <vector>
#include <cstdlib>
using namespace std;
template<class T> inline bool chmax(T& a, T b) {
if (a < b) {
a = b;
return true;
}
return false;
}
int N;
long long a[100010][3];
long long dp[100010][3];
int main() {
cin >> N;
for (int i = 0; i < N; i... | ALGO | 0.999874 | 4.114889 |
d7a49cc9-3b39-4bc7-b214-26f7a51dbd3b | wcysai/Calabash | XVII Open Cup named after E.V. Pankratiev. XXI Ural Championship/M.cpp | #pragma GCC optimize(3)
#include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i = 0; i < int(n); i++)
#define Rep(i, n) for (int i = 1; i <=int(n); i++)
#define range(x) begin(x), end(x)
#ifdef __LOCAL_DEBUG__
#define _debug(fmt, ...) fprintf(stderr, "[%s] " fmt "\n", __func__, ##__VA_ARGS__)
#else
... | ALGO | 0.999833 | 3.298484 |
758399ba-11a4-4f79-bb51-30ed580e224d | jackfiled/luogu | src/P2392.cpp | #include <cstdio>
#include <cstring>
#include <algorithm>
using namespace std;
// 计算一科需要花费的时间
int calc(int time[], int length)
{
// 0-1背包问题
// 但是费用和价值相同
int dp[21][1201];
memset(dp, 0, sizeof(dp));
int sum = 0;
for (int i = 0; i < length; i++)
{
sum += time[i];
}
int t = ... | ALGO | 0.99958 | 3.184433 |
f1c0e255-19cb-4546-8fef-a4742221bb8f | cryptic-exe/Coding-practise | Coding/Prime Number.cpp | #include<iostream>
#include<cmath>
using namespace std;
int main()
{
int n;
bool flag = 0;
cin >> n;
for (int i=2; i <= sqrt(n);i++)
{
if(n%i==0)
{
cout << "Not prime";
flag = 1;
break;
}
}
if(flag==0){
cout << "Prime";... | ALGO | 0.99888 | 3.792638 |
7e91d7f7-c8ac-4a85-8cf5-d2633c2ff0d5 | larshinsr/TP3_1 | TP/lab3/test3.cpp | #include <iostream>
#include <vector>
template <typename T>
struct Node {
T data;
Node* left;
Node* right;
Node(const T& value) : data(value), left(nullptr), right(nullptr) {}
};
template <typename T>
class BinaryTree {
public:
struct Subtree {
Node<T>* root;
int max_depth... | ALGO | 0.999921 | 6.0664 |
34a29bda-8923-4eac-ab9b-00a6dd6b1d46 | Randowlh/Project_ACM_2021 | code/hdoj/3549dinic.cpp | #include <bits/stdc++.h>
using namespace std;
struct Edge
{
int from;
int to;
int flow;
int cap;
Edge(int fr, int t, int f, int c) : from(fr), to(t), flow(f), cap(c) {}
};
int G[1010][1010];
int book[10000];
int cur[10000];
int depth[10000];
int n, m, t, s;
int cnt = 0;
vector<Edge> edge;
vector<int... | ALGO | 0.999956 | 5.283028 |
52012968-108f-4197-a9ba-974db4c952a4 | JohanRamirez2022/Homework6-Johan_Ramirez | linkedBTree.cpp | #include "linkedBTree.h"
#include <string>
template<class ItemType>
LinkedBTree<ItemType> :: LinkedBTree() : rootPtr(nullptr) {}
template<class ItemType>
int LinkedBTree<ItemType>::getNumberOfNodesHelper(LinkedTreeNode<ItemType>* subTreePtr) const
{
if (subTreePtr == nullptr)
{
return 0;
}
int... | TOOL | 0.999026 | 4.202808 |
e2d25727-f38f-4ab2-b5f4-49f275b4a9a5 | J1NX-82/Learning-DSA | Codes/DAY 62 - Queues Practice Questions/interleaveTheFirstHalfOfQueue_withSecondHalf.cpp | class Solution{
public:
vector<int> rearrangeQueue(queue<int> &q){
vector<int> ans;
queue<int> newQ;
int halfSize = q.size() / 2;
for (int i = 0; i < halfSize; i++) {
newQ.push(q.front());
q.pop();
}
while (!newQ.empty()) {
ans.push_back(newQ... | ALGO | 0.999987 | 5.371426 |
12f9513b-243f-456d-87e1-1bd4dcd4f486 | QWERx29/My-Codes-and-Docs_OLD | Books/AOAPC/Book-2nd/Chapter06/6-02.cpp | // UVa514 Rails
// Rujia Liu
#include<cstdio>
#include<stack>
using namespace std;
const int MAXN = 1000 + 10;
int n, target[MAXN];
int main() {
while(scanf("%d", &n) == 1) {
stack<int> s;
int A = 1, B = 1;
for(int i = 1; i <= n; i++)
scanf("%d", &target[i]);
int ok = 1;
while(B <= n) {
... | ALGO | 0.999972 | 3.695444 |
2a2b7f01-5b08-4c2d-9672-73531d7f39c8 | mateusz-brzozowski/SOI-STUD | t4/main.cpp | // g++ main.cpp -lpthread
#include <iostream>
#include <vector>
#include <pthread.h>
#include <unistd.h>
#include "monitor.h"
#pragma region Buffer
class Buffer {
std::vector<int> buffer;
public:
void put(int value){
buffer.push_back(value);
}
int get(){
if(buffer.empty())
... | ALGO | 0.958013 | 4.983938 |
17a86a50-d3af-40c1-adc9-9660340581b8 | 2468785842/krkr2 | cpp/core/base/win32/EventImpl.cpp | //---------------------------------------------------------------------------
//---------------------------------------------------------------------------
// Script Event Handling and Dispatching
//---------------------------------------------------------------------------
#include "tjsCommHead.h"
#include "EventImp... | TOOL | 0.895011 | 5.526151 |
e9ba577d-8754-45f0-9590-4d9aac0c0d0c | tchomphoochan/cmutoi_codes | solutions/ipst/o61_oct_practice_uncategorized/oct15_starlight.cpp | #include <bits/stdc++.h>
using namespace std;
const int N = 5010;
int s, n;
int x[N], y[N];
bool check(double p)
{
bool pass = true;
double lb = 0;
for (int i = 0; i < n; ++i) {
if (x[i]-p > lb) {
pass = false;
break;
}
lb = x[i]+p;
}
if (lb < s)
... | ALGO | 0.999927 | 4.315943 |
8fcc8d75-dd86-45ca-a43a-8becd57d62e2 | SojebSikder/dsa-practice | codeforces/cpp/codeforces checking.cpp | #include <bits/stdc++.h>
using namespace std;
#define ll long long
void solve()
{
char n;
cin >> n;
string text = "codeforces";
string ans = "No";
for (int i = 0; i < text.size(); i++)
{
if (n == text[i])
{
ans = "Yes";
}
}
cout << ans << endl;
}
... | ALGO | 0.999761 | 4.426353 |
2a4c3b4b-7a73-4a40-a734-1e4741297aa6 | Nakib-Arman/CSE318---ArtificialIntelligence | 3.ChainReaction/.history/main_20250610081140.cpp | #include <bits/stdc++.h>
using namespace std;
class Cell {
int orb_num;
int critical_mass;
char color;
public:
Cell() {
this->orb_num = 0;
this->color = 'W';
this->critical_mass = 4;
}
// Cell(int orb_num, char color) {
// this->orb_num = orb_num;
// t... | ALGO | 0.998688 | 4.530052 |
c5c96a4d-e975-4e2f-87b8-a158d32bc3f5 | anima20/prac_c- | char_array.cpp | #include<iostream>
#include<math.h>
using namespace std;
int main(){
int arr[10];
int sum=0,p;
for(int i =0 ; i<=5 ; i++)
{
cin>>arr[i];
p=arr[i]*pow(2,i);
sum =sum+ p;
}
cout<<sum;
return 0;
} | ALGO | 0.999674 | 3.546595 |
754cff64-63c7-412c-bba5-e7db3e49e178 | xswzaq44321/UVa | 455/test.cpp | #include <cstdio>
#include <cstring>
#include <cstdlib>
#define SIZE 100
#define PRIME_MOD 1073676287
typedef long long int lli;
char s[SIZE];
lli h[SIZE], hBase[SIZE];
void hashInit(char *s, lli *h, lli *hBase, int len, lli prime = 0xdefaced){
h[0] = 0;
hBase[0] = 1;
for(int i = 1; i <= len; ++i){
h[i] = (h[i - ... | ALGO | 0.999731 | 3.642281 |
ade2f2a3-20fe-46de-897e-ffa2b2fddc34 | HolicKW/codetree-TILs | 250310/수들의 최대 차/maximum-difference-in-numbers.cpp | #include <iostream>
#include <climits>
#include <algorithm>
using namespace std;
int arr[1001];
int main() {
// Please write your code here.
int n,k;
cin >> n >> k;
for(int i = 0; i<n;i++){
cin>>arr[i];
}
int ans = 0;
sort(arr,arr+n);
for(int i = 0; i<n;i++){
int cnt = 0;... | ALGO | 0.999949 | 4.328463 |
310f6c97-cb5c-4c09-a071-9faaa5802513 | MahbubHossainFaisal/Problem-Solving | CODEFORCES DIV2/Div2-A/Roma-and-luckynumbers.cpp | #include <bits/stdc++.h>
using namespace std;
int main() {
int n,k;
cin>>n>>k;
int store =0;
while(n--){
string s;
cin>>s;
int cnt =0;
for(int i=0; i<s.size(); i++){
if(s[i] == '4' or s[i]== '7') ++cnt;
}
if(cnt <= k) store++;
}
cout<<store;
return 0;
}
| ALGO | 0.999318 | 3.788127 |
ee1a3a6b-dde3-4005-b9e5-80642ea7b686 | Sumonta056/My-Codes | Competitive program solution/good numbers easyversion c++.cpp | #include<bits/stdc++.h>
using namespace std;
int main()
{
int q;
cin>>q;
while(q--)
{
int n ;
cin>>n ;
while(1)
{
int m= n ;
bool good = 1;
while(m>0)
{
if(good && m%3==2) good=0;
m=m/3;
... | ALGO | 0.999934 | 3.520419 |
f1fcb988-9303-40e9-a745-02f677084802 | pnpn4/comsil_5_github | main.cpp | #include <stdio.h>
#include "Stack.h"
void prnMenu(){
cout<<"*******************************************"<<endl;
cout<<"* 1. 삽입 2. 삭제 3. 출력 4. 종료 *"<<endl;
cout<<"*******************************************"<<endl;
cout<<endl;
cout<<"원하시는 메뉴를 골라주세요: ";
}
int main(){
int mode, selectNumber, tmpItem;
... | TOOL | 0.951552 | 4.251584 |
443e47a3-2d80-48f7-b2a6-6c8f1d3c050e | Aryan-Satija/DSA | BASIC MATHEMATICS/seiveOfEratosthenes.cpp | // LEETCODE -> COUNT PRIMES
#include <bits/stdc++.h>
using namespace std;
class Solution {
public:
int countPrimes(int n) {
if(n == 0 || n == 1)
return 0;
vector<bool> seive(n, true);
seive[0] = false, seive[1] = false;
int cnt = 0;
for(long long int i = 2; i < n;... | ALGO | 0.999949 | 5.486166 |
bf5c3258-4e02-47d2-a99a-a90fc6d52118 | AlexGliesch/competitive-programming | uva/11479 - Is this the easiest problem.cpp | #include <ciso646>
#include <iostream>
using namespace std;
/*
* three lengths a, b and c make a triangle iff:
* a + b > c AND
* a + c > b AND
* b + c > a
*
* USE LONG LONG
* */
int main() {
long long ncases, a, b, c;
cin >> ncases;
for (int i = 0; i < ncases; ++i) {
cin >> a >> b >> c;
cout << ... | ALGO | 0.999621 | 4.506034 |
7936c857-2300-455a-b249-ad02a2261e0e | olkido/libigl_smgpclass | include/igl/quad_planarity.cpp | #include "quad_planarity.h"
#include <Eigen/Geometry>
template <typename DerivedV, typename DerivedF, typename DerivedP>
IGL_INLINE void igl::quad_planarity(
const Eigen::PlainObjectBase<DerivedV>& V,
const Eigen::PlainObjectBase<DerivedF>& F,
Eigen::PlainObjectBase<DerivedP> & P)
{
int nf = F.rows();
P.setZ... | ALGO | 0.99726 | 6.595133 |
0e9fcfd5-3d89-4bc1-bf00-a54ddc133ea3 | ishandutta2007/codeforces | andrew/normal/1203/D1.cpp | #include <bits/stdc++.h>
#include<ext/pb_ds/assoc_container.hpp>
#include<ext/pb_ds/tree_policy.hpp>
#pragma GCC optimize("-O3")
#pragma GCC optimize("Ofast")
#pragma GCC optimize("unroll-loops")
#define fi first
#define se second
#define p_b push_back
#define pll pair<ll,ll>
#define pii pair<int,int>
#define m_p mak... | ALGO | 0.999982 | 4.378911 |
f8973c29-56d8-481f-96cb-211ccf070447 | saurabhgupta08/CPP | Question Practice/Array/Midium Question/2_sum.cpp | #include <bits/stdc++.h>
using namespace std;
vector<int> twoSum(vector<int>& nums, int target) {
int n=nums.size();
// for(int i =0;i<n;i++){
// for(int j=i+1;j<n;j++){
// if(nums[i]+nums[j]==target){
// return {i,j};
// }
// ... | ALGO | 0.998981 | 5.493151 |
e11376fe-9a12-406d-ae65-ce8c0563a567 | rafaelpezzuto/eyes-free | ocr/ocrservice/jni/opticalflow/feature_detector.cpp | // Author: Andrew Harp
//
// Various feature detecting functions.
#include <float.h>
#include "utils.h"
#include "time_log.h"
#include "image.h"
#include "feature_detector.h"
// Threshold for pixels to be considered different.
#define FAST_DIFF_AMOUNT 10
// How far from edge of frame to stop looking for FAST featu... | ALGO | 0.983232 | 5.417886 |
56042921-a697-4274-a472-7c52ddc7c3ea | Rafe-sk/C_plus_plus | sign.cpp | #include <iostream>
using namespace std;
int main()
{
int rows;
cout << "enter number of rows";
cin >> rows;
for (int i = 1; i <= rows; ++i)
{
for (int j = 1; j <= i; ++j)
{
cout<<"*";
}
cout << endl;
}
return 0;
} | ALGO | 0.981048 | 3.875374 |
f69c5810-41c1-4501-9c3d-b832266f1a57 | trilinos/Trilinos | packages/amesos/src/CrsMatrixTranspose.cpp | //
// CrsMatrixTranspose( Epetra_CrsMatrix *In, Epetra_CrsMatrix *Out )
// fills the matrix "Out" with the transpose of the matrix "In".
//
// Notes:
// Only works on pseudo-distributed matrices, where all rows are stored
// on process 0.
// Testing has been limited to square matrices
// This implement... | ALGO | 0.999075 | 4.817034 |
4f2a463e-15d5-44cb-8e07-508bc2322684 | devanshmesson/Competitive-programming | Competitions/Cogno AI/Raj and cards.cpp | //Link to problem - https://www.hackerrank.com/contests/crack-the-code-to-cogno-ai/challenges/raj-and-cards
#include<bits/stdc++.h>
using namespace std;
// #define int long long int
#define endl "\n"
#define freopen freopen("input.txt","r",stdin);freopen("output1.txt","w",stdout);
#define pb push_back
// Taskkill /IM... | ALGO | 0.999865 | 4.877008 |
ccd863c5-f41c-4931-924a-f08999717ad2 | vidja-abhay/Data_Structure_C- | Data_Structure/DYANAMIC PROGRAMING/12_LARGEST_SQUARE.CPP | #include<bits/stdc++.h>
using namespace std;
int solveRec(vector<vector<int>> &mat, int i, int j, int &maxi){
if(i >= mat.size() || j >= mat[0].size()) return 0;
int right = solveRec(mat, i, j+1, maxi);
int diagonal = solveRec(mat, i+1, j+1, maxi);
int down = solveRec(mat, i+1, j, maxi);
if(mat[i... | ALGO | 0.999986 | 5.284584 |
4dfd0945-d89a-4ede-a0ab-dfc76c421205 | sysuhuang/leetcode | 237.删除链表中的节点.cpp | /*
* @lc app=leetcode.cn id=237 lang=cpp
*
* [237] 删除链表中的节点
*
* https://leetcode-cn.com/problems/delete-node-in-a-linked-list/description/
*
* algorithms
* Easy (80.22%)
* Likes: 627
* Dislikes: 0
* Total Accepted: 80.4K
* Total Submissions: 100.2K
* Testcase Example: '[4,5,1,9]\n5'
*
* 请编写一个函数,使其... | ALGO | 0.999884 | 6.320702 |
af079d1d-d358-4087-9608-8e4e9d7c9bf6 | TonuruRikkon/Tin-VL | 2023hsg12.cpp/SODEP.cpp | #include <bits/stdc++.h>
using namespace std;
int main()
{
int t=0,n;
cin>>n;
while (n>0)
{
t+=n%10;
n=n/10;
}
if(t%10==9)cout<<1;
else cout<<0;
} | ALGO | 0.999853 | 4.203721 |
81cd788b-2336-4570-98a4-792e36b60504 | ManthanChoudhury/Mastering_DSA | CP/Leetcode/Medium/Maximum_product_of_subarray.cpp | class Solution {
public:
int maxProduct(vector<int>& nums) {
int max_ending = 1;
int min_ending = 1;
int max_so_far = 0;
int n = nums.size();
for(int i = 0; i<n;i++){
if(nums[i]>0){
max_ending = max_ending * nums[i];
min_ending = mi... | ALGO | 0.999996 | 5.972807 |
4a215d04-c99a-4608-8339-65dcb935dd1d | prem-nj/DSA-Problem | 2050-count-good-numbers/count-good-numbers.cpp | class Solution {
private:
int M=1e9+7;
long long power(long a ,long b){
//base case
if(b==0){
return 1;
}
long long half=power(a,b/2);
long long res=(half*half)%M;
if(b%2==1){
res=(res*a)%M;
}
return res;
}
public... | ALGO | 0.999986 | 5.964528 |
373e4f32-4447-4012-b206-f35ec19c7ddc | xoravi/Assignments-and-Lab-Work | Algorithms & Operating System Lab/BANKERS ALGO.cpp | #include<bits/stdc++.h>
#include<vector>
using namespace std;
class Bank
{
int n,m;
int **maxim;
int **alloc;
int **need;
int *resr;
int *avail;
int *work;
int *safe;
bool *finish;
public:
Bank(int n,int m)
{
int k;
this->n=n;
this->m=m;
maxim= new int *[n];
alloc= new int *[n];
nee... | ALGO | 0.999801 | 3.287251 |
3d0dc90a-d335-44cf-a5a0-0862cc01953e | AlgorithmStudyClass/SWExpertAcademy | hyunho/samsung/SDS_Algorithm_Lecture/#4_Number theory/1644_sum of sequence prime number.cpp | /*
1644. 소수의 연속합
https://www.acmicpc.net/problem/1644
에라토스테네스의 체를 이용한 문제
*/
#include<iostream>
using namespace std ;
int N ;
int isPrime[4000001] ;
int prime[4000001] ;
int ans ;
int main() {
scanf("%d" , &N ) ;
for( int i = 2 ; i <= N ; i++ )
isPrime[i] = 1 ;
int index = 0 ;
for( int i = 2 ; i <= N ; i++ ... | ALGO | 0.999897 | 4.599832 |
84cf9ba2-4fb7-47f0-bb5d-ef7eda7adcf4 | MariaChrysafis/CompetitiveProgramming | COCI/2015-2016/Contest #3/Domino.cpp | #include <vector>
#include <algorithm>
#include <iostream>
#include <set>
#include <cmath>
#include <map>
#include <random>
#include <cassert>
#include <ctime>
#include <bitset>
#include <stack>
#include <cstdlib>
#include <queue>
#include <stdint.h>
#include <vector>
#include <cassert>
#include <numeric>
#include <ios... | ALGO | 0.999949 | 3.802867 |
183c3a97-ae3b-4bd3-863a-31280d40efa1 | seahwm/life_simulator | 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 |
c36c6c86-ad9f-4256-b831-f136c0453318 | AsanulSohan/C-Plus-Plus | ContinuousSquarePattern.cpp | #include <iostream>
using namespace std;
int main()
{
int n=3;
int num =1 ;
for(int i =0; i<n; i++)
{
for(int j=0; j<n; j++)
{
cout << num << " ";
num++;
}
cout << endl;
}
} | ALGO | 0.999777 | 3.60956 |
78b70423-73fe-4dc0-b461-4ddec433f3b6 | GrootTheDeveloper/OLP-ICPC | 800+BAI_CODE_HAY/Code/146.cpp | #include <bits/stdc++.h>
using namespace std;
#define int long long
const int mode = 1e9 + 7;
vector <int> p;
bool prime[2003];
int dp[1005][1005];
void sie(int N)
{
for (int i = 2; i <= N; i++)
if (!prime[i])
{
p.push_back(i);
for (int j = i*i; j <= N; j += i) prime[j] = tru... | ALGO | 0.999976 | 4.470192 |
e21a4ab3-ce15-4eb1-8f3f-ef576622b35c | manikanta2901/ubuntu | .history/practice/cpp/Codechef/DistinctPairSums_20210130182837.cpp | #include <bits/stdc++.h>
#include<vector>
#include<iostream>
#include<cmath>
#include<algorithm>
#include<iterator>
#include<string>
#include<map>
#include<queue>
using namespace std;
#define trav(dataType,DataStruct,name) for(dataType<DataStruct>::itt ip = name.bb(); ip != name.ee(); ip++)
//Pre processors & typedefs
... | ALGO | 0.999916 | 3.313437 |
991dbf1a-1a66-4630-88bd-4a3d87e5571d | byzhang/blaze | blazemark/src/boost/DMatSMatMult.cpp | //=================================================================================================
//=================================================================================================
//*************************************************************************************************
// Includes
//****... | ALGO | 0.999638 | 4.790495 |
ff59916c-8807-46e2-b18a-19e957a60e6a | FranFT/TFG---Face-expression-recognition | lib/STASM_cars/stasm/MOD_1/initasm.cpp | #include "../stasm.h"
#include "mh/yaw00.mh"
namespace stasm
{
void InitMods( // initialize ASM model
vec_Mod& mods, // out: ASM model (only one model in this version of Stasm)
const char* datadir) // in: directory of face detector files
{
if (mods.empty()) // models not yet initialized?... | TOOL | 0.888585 | 5.4069 |
b7c59fc9-736c-479a-bb2f-92b4422a11a7 | Siddharthm10/Competitive-Coding-Repo | CodeForces/contests/729_030721/A_Odd_set.cpp | //"It's not a bug, It's a feature
#include <iostream>
#include <string>
#include <bits/stdc++.h>
#include <vector>
#define ll long long int
using namespace std;
bool checkArr(int arr[], int n){
int countEven=0;
for(int i=0; i<2*n; i++){
if(arr[i]%2==0){
countEven++;
}
}
if(countEven==n) return true;
else r... | ALGO | 0.999543 | 4.72342 |
9d2575fd-81a7-4563-946c-9f188ea17c10 | ishandutta2007/codeforces | cuizhuyefei/normal/878/A.cpp | #include<cstdio>
#include<cstring>
#include<iostream>
#include<algorithm>
#define rep(i,a,b) for (int i=a; i<=b; i++)
#define per(i,a,b) for (int i=a; i>=b; i--)
typedef long long ll;
using namespace std;
inline void read(int &x) {
x=0; char c=getchar(); int f=1;
while (!isdigit(c)) {if (c=='-') f=-1; c=getchar();}
... | ALGO | 0.999914 | 3.815996 |
256c06f9-3111-4eef-a667-d9dff4cb60fa | mvg01/ps | baekjoon cpp/10973(combinatorics).cpp | #include <iostream>
#include <vector>
#include <algorithm>
using namespace std;
vector<int>v;
vector<int>a;
int main()
{
int n, x;
cin >> n;
for (int i = 0; i < n; i++) {
cin >> x;
a.push_back(x);
v.push_back(x);
}
prev_permutation(v.begin(), v.end());
bool chk = 0;
for (int i = 0; i < n - 1; i++) {
i... | ALGO | 0.999977 | 3.806842 |
90e99614-4278-47c8-be38-bc4b4f961047 | madhabkafle/LeetCode | 0039-combination-sum/0039-combination-sum.cpp | class Solution {
public:
vector<vector<int>> combinationSum(vector<int>& candidates, int target) {
vector<vector<int>> ans;
int n= candidates.size();
vector<int> v;
int sum=0;
fun(0,sum,n,candidates,target,ans,v);
return ans;
}
void fun(int i,int sum,int n,vector<int> ca... | ALGO | 0.999968 | 6.707795 |
7b1b5cf2-727e-4e19-9624-c6a3ba0322d7 | Rahul-IITG/DSA | binary_tree_right_side_view.cpp | #include <queue>
#include <vector>
using namespace std;
struct TreeNode {
int val;
TreeNode *left;
TreeNode *right;
TreeNode(int x) : val(x), left(nullptr), right(nullptr) {}
};
vector<int> rightSideView(TreeNode* root) {
if (root==nullptr) {
return {};
}
vector<int> sol;
queu... | ALGO | 0.99991 | 6.086406 |
743f72cc-2bbf-49ff-83f7-56c0a6287920 | wzh1998/ACM-ICPC | ACM/pat-basic-1030.cpp | #include <iostream>
#include <stdio.h>
#include <stdlib.h>
#include <cstring>
#include <cmath>
#include <algorithm>
using namespace std;
int main(void){
long long int n,p,maxn,minn,answer,i,fin_ans;
long long int arr[100001] = { -1 };
maxn = -2147483648;
minn = 2147483647;
answer = 0;
fin_ans =... | ALGO | 0.999945 | 3.226615 |
b703f633-998e-43ee-8d20-cd25594b5906 | tobiasprima/quizzler_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.998859 | 6.785645 |
64410851-7bc8-4777-b79b-ba69b27adf2b | MrPollito/PinballPhysicsGame | Box2D/Box2D/Dynamics/b2Island.cpp | #include <Box2D/Collision/b2Distance.h>
#include <Box2D/Dynamics/b2Island.h>
#include <Box2D/Dynamics/b2Body.h>
#include <Box2D/Dynamics/b2Fixture.h>
#include <Box2D/Dynamics/b2World.h>
#include <Box2D/Dynamics/Contacts/b2Contact.h>
#include <Box2D/Dynamics/Contacts/b2ContactSolver.h>
#include <Box2D/Dynamics/Joints/b2... | ALGO | 0.999964 | 6.568297 |
90ab1fa9-e92b-4a19-a58f-62378560eec9 | nirobsmh/Competitive-programming-codes | Algorithms/kruskal.cpp | #include<cstdio>
#include<iostream>
#include<algorithm>
int v,e,p[4000],r[4000],c[4000],el[4000];
typedef struct
{
int S;
int E;
int cost;
}edge ;
edge ed[4000],select[4000];
void init()
{
for(int i=1;i<=v;i++)
{
p[i]=i;
r[i]=0;
}
}
int find_set(int i)
{
if(i!=p[i])
... | ALGO | 0.999983 | 4.024411 |
8d210130-7a3a-43fc-a3c0-61874b217e23 | ykc0131/codetree-TILs | 240318/적석과 흑석 2/red-stone-and-black-stone-2.cpp | #include <iostream>
#include <vector>
#include <algorithm>
using namespace std;
int C,N;
vector<int> cVec;
vector<pair<int,int>> nVec;
void init(){
cin >> C >> N;
for(int i=0; i<C; i++){
int n;
cin >> n;
cVec.push_back(n);
}
for(int i=0; i<N; i++){
int a,b;
ci... | ALGO | 0.999894 | 4.104897 |
a16c8c45-9413-4ad4-a8a9-f57449eee326 | IvanAndonovMicev/Cpp-Exercises | Cpp-Fundamentals/07.Exam/Exercise_1.cpp | #include <iostream>
#include <sstream>
#include <list>
#include <vector>
#include <algorithm>
#include <climits>
#include <iomanip>
using namespace std;
#define MAX_SIE 99
int maxValuoAtOddPos(int arr[], int size)
{
int maxNumber = INT_MIN;
for (int cnt = 0; cnt < size; cnt++)
{
if (!(cnt % 2 == 0))
{
if (... | ALGO | 0.998381 | 4.185939 |
74392cee-a27c-42b5-9bcc-d842d10829c5 | ishandutta2007/codeforces | cxy07/normal/547/E.cpp | //Code By CXY07 - It's My Fiesta.
#include<bits/stdc++.h>
using namespace std;
//#define FILE
//#define int long long
#define randint(l, r) (rand() % ((r) - (l) + 1) + (l))
#define abs(x) ((x) < 0 ? (-(x)) : (x))
#define popc(x) __builtin_popcount(x)
#define inv(x) qpow((x), mod - 2)
#define lowbit(x) ((x) & (-(x)))
#... | ALGO | 0.999823 | 4.236411 |
c3e6dfc1-faef-4de7-8c72-9cd600270bed | bhuvisangam/aps-100-codes | 50TrappingRainwater/main.cpp | /*Given an array arr[] of N non-negative integers
representing the height of blocks. If width of each block is 1, compute how much water can be trapped between the blocks during the rainy season. */
#include<bits/stdc++.h>
using namespace std;
class Solution{
// Function to find the trapped water between the blo... | ALGO | 0.999646 | 6.593228 |
2507765e-3c34-4f98-b344-0242d931346b | lmun/competitiveProgramingSolutions | codeforces/975/a.cpp | #include <bits/stdc++.h>
#include <cstdio>
#include <cstring>
#include <cmath>
#include <cstring>
#include <complex>
#define endl "\n"
#define ll long long int
#define vi vector<int>
#define vll vector<ll>
#define vvi vector < vi >
#define pii pair<int,int>
#define pll pair<long long, long long>
#define mod 1000000007
... | ALGO | 0.999804 | 3.992835 |
5db863e4-5e7c-4cce-ae1e-bc81334d92ba | juanplopes/maratona-regional-2012 | cancer.cpp | //12489
//Combating cancer
//Graphs;Tree Isomorphism
#include <iostream>
#include <cmath>
#include <string>
#include <cstring>
#include <iomanip>
#include <vector>
#include <algorithm>
#define MAX 10006
using namespace std;
vector<int> A[MAX], B[MAX];
vector<int> NA[MAX], NB[MAX];
bool comp(const vector<int>& a, cons... | ALGO | 0.999884 | 3.676268 |
cfc3fb56-ae9a-47cd-9ee9-53bc03f6a5d6 | ishandutta2007/codeforces | sd0061/normal/1530/A.cpp | #include <bits/stdc++.h>
int main() {
int T;
scanf("%d", &T);
while (T--) {
int x;
scanf("%d", &x);
int a = 0;
while (x > 0) {
a = std::max(a, x % 10);
x /= 10;
}
printf("%d\n", a);
}
return 0;
} | ALGO | 0.999685 | 5.305379 |
21330edf-5e2c-40d9-9e2d-cb7f90a7f6a6 | Salabh2k2/Leetcode_Solution | 1030-smallest-string-starting-from-leaf/smallest-string-starting-from-leaf.cpp | class Solution {
public:
void dfs(TreeNode* root, vector<string>& paths, string current_path) {
if (!root) return;
current_path += char('a' + root->val);
if (!root->left && !root->right) {
reverse(current_path.begin(), current_path.end());
paths.push... | ALGO | 0.999973 | 6.733572 |
e09f2b3a-6ba1-44f4-816b-8d5c999f4cd1 | ishandutta2007/codeforces | pikel_rik/normal/303/C.cpp | #include <bits/stdc++.h>
using namespace std;
using ull = unsigned long long;
using ll = long long;
using ld = long double;
const int mod = 1e9 + 7;
const double pi = acos(-1.0);
const int inf = INT_MAX;
const int N = 5e3;
const int A = 1e6;
int n, k, a[N], cnt[A + 1], stn[N], sta[A];
int diff[A + 1][11], now[A + 1... | ALGO | 0.999977 | 4.489055 |
cca433e1-852f-4093-b9c9-79d522f965bc | raincross7/code-similarity | codes/train_code/problem346/problem346_147.cpp | #include <bits/stdc++.h>
using namespace std;
#define fi first
#define se second
int main()
{
cin.tie(0);
ios::sync_with_stdio(0);
int h,w,m;cin>>h>>w>>m;
map<int,int> mph,mpw;
set<pair<int,int>> st;
int maxh=0,maxw=0;
for(int i=0;i<m;i++)
{
int y,x;cin>>y>>x;
mph[y]++... | ALGO | 0.999967 | 3.894991 |
8288c1e4-e6b7-4e72-8f72-1083213f8983 | yuvrajpasricha7/DS_Lab_Experiments | DS Lab/LAB5.1 Stack.cpp | #include<iostream>
using namespace std;
class stackk
{
int top;
int *arr;
int n;
public:
stackk(int x)
{
n=x;
top=-1;
arr=new int(n);
}
void push(int v)
{
if(top==n-1)
cout<<"Overflow"<<endl;
else
{
arr[++top]=v;
... | ALGO | 0.996503 | 3.550589 |
6191dc65-c964-4202-b4e4-baec8cac707f | InvalidNamee/OJ-AC-Repository-for-UPC | AC_code/2024新生寒假集训系列/4017_广度优先搜索BFS/4_E_有多少细胞.cpp | #include <cstdio>
int dx[] = {-1, 1, 0, 0}, dy[] = {0, 0, -1, 1};
char mp[110][110];
int n, m;
bool valid(int x, int y) {
return x > 0 && x <= n && y > 0 && y <= m && mp[x][y] != '0';
}
void dfs(int x, int y) {
if (!valid(x, y)) return;
mp[x][y] = '0';
for (int i = 0; i < 4; ++i) {
dfs(x + dx... | ALGO | 0.999422 | 4.321374 |
e2613441-dc9c-48f6-bc0d-d6c6ea237818 | devcyjung/Exercism | solutions/cpp/binary-search/1/binary_search.cpp | #include "binary_search.h"
#include <stdexcept>
namespace binary_search {
size_t find(const std::vector<int>& data, const int& value) {
if (data.size() == 0) {
throw std::domain_error("empty vector");
}
size_t slice_begin {0U};
size_t slice_end {data.size()};
s... | ALGO | 0.999704 | 6.284798 |
0becfdb3-1d4d-4b6c-a537-e55703c131ed | Dytchem/OI-Notes | Dytchem-ac/Gym/104355G/44586963_AC_0ms_112kB.cpp | #define _CRT_SECURE_NO_WARNINGS
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
constexpr int INF = 0x7fffffff;
bitset<26> a[1000][26];
int main() {
ios::sync_with_stdio(false);
int n;
cin >> n;
cout << n - 1 << '\n';
for (int i = 1, w = (n + 1) * (n + 1) / 4;i < n;++i, --w) {
cout << i << ... | ALGO | 0.999358 | 3.267043 |
7c7ead3f-3396-4020-bd89-e9d8a4cff99c | Zilu45/UKL_TanzilurRahman_33_TIX_ID | ujian_ukl_1/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.998304 | 6.76775 |
34bfcec6-d50a-4154-a288-3729d3bd52a6 | RajdevKapoor/Leetcode-Practice | 937-reorder-data-in-log-files/937-reorder-data-in-log-files.cpp | class Solution {
public:
static bool comp(string &a, string &b){
string dig1,dig2;
int idx1, idx2;
for(int i=0; i<a.size(); i++){
if(a[i] == ' '){
idx1 = i+1;
break;
}
dig1 += a[i];
... | ALGO | 0.999326 | 5.834104 |
a696a937-c48e-473c-88b2-de676a69f483 | EngFahd/Academix | 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 |
3ccf06ba-c8c0-487c-b149-52657ce1aaaa | Workerlimit/pp1_2023 | lab3/a.cpp | #include <iostream>
using namespace std;
int main() {
int n;
cin >> n;
int arr[n];
for(int i = 0; i < n; i++) {
cin >> arr[i];
if(arr[i]%2==1) {
cout << arr[i] << " ";
}
}
return 0;
} | ALGO | 0.999585 | 4.085906 |
cb380b97-bfec-4f9f-9fb8-15365aa463d2 | quachconghoang/ros2_cpp_course | tutorials/week07/examples/ex03/dataprocessing.cpp | #include "dataprocessing.h"
#include <iostream> // Only here for showing the code is working
#include <thread>
DataProcessing::DataProcessing()
{
radars_.clear();
}
void DataProcessing::setRadars(std::vector<Radar*> radars){
radars_=radars;
}
void DataProcessing::findClosestReading(){
while(true){
double ... | ALGO | 0.981751 | 4.147701 |
4c441f41-1ce2-4b0b-96d1-00c64ea113c4 | Abrahul-107/DSA_CHALLENGE | BinarySearch/BS_in_oned/05_single_nonduplicate.cpp | #include<bits/stdc++.h>
using namespace std;
int singleNonDuplicate(vector<int>&arr)
{
int low = 0;
int high = arr.size()-1;
int n = arr.size();
if (n == 1) return arr[0];
if (arr[0] != arr[1]) return arr[0];
if (arr[n - 1] != arr[n - 2]) return arr[n - 1];
while (low<=high)
{
... | ALGO | 0.999948 | 4.67115 |
c709a42a-fcd3-498d-b1b5-84a40689dfe3 | tier3coder/1stproject | project1.cpp | #include<iostream>
#include<math.h>
#include<windows.h>
using namespace std;
int main ()
{
int num;
cin>>num;
char ch='A';
while(2){
int i,j,k,l,m,x;
if(num%2==0)
num--;
x=num/2+1;
for(i=1;i<=x;i++)
{
system("Color 70");
for(k=x-i;k>=0;k--)
cout<<" ";
... | ALGO | 0.999935 | 3.114959 |
6762d84c-a06a-483f-b63d-5b1a8574b637 | monokuroobo/toki | Percabangan/ifThen.cpp | #include <iostream>
using namespace std;
int main(){
int a;
cin >> a;
if (a>0){
cout << a;
}
}
| ALGO | 0.997819 | 3.082036 |
2c6d9314-dc0f-4095-afb0-1b399299dec1 | EdwardZhou538/CompetitiveProgramming | search/pails.cpp | #include <bits/stdc++.h>
using namespace std;
int main() {
ifstream fin;
ofstream fout;
fin.open("pails.in");
int x;
int y;
int m;
fin >> x >> y >> m;
int big_pail = max(x, y);
int small_pail = min(x, y);
int num_big_dumps = 0;
int capacity = 0;
int max_capacity = 0;
... | ALGO | 0.999957 | 4.110515 |
01cd2180-db1b-492f-b82f-2659aab98e1f | bluewhitesheen/Leetcode | longest-increasing-subsequence/Accepted/2-2-2023, 12_06_29 AM/Solution.cpp | // https://leetcode.com/problems/longest-increasing-subsequence
class Solution {
public:
int lengthOfLIS(vector<int>& nums) {
vector<int> v; v.push_back(nums[0]);
for(int i = 1; i < nums.size(); i++){
if(nums[i] > v.back()) v.push_back(nums[i]);
else *lower_bound(v.begin(), ... | ALGO | 0.999994 | 6.352342 |
d80a43a8-b7c8-44aa-96da-0dc6fd7bb36a | vmhl87/oly | contests/ioi11d1/garden/garden.cpp | #include "garden.h"
#include "gardenlib.h"
#include <vector>
std::vector<int> adj[5000];
int find(int i, int k){
int last = -1;
while(k--){
if(adj[i].size() == 1)
last = i, i = adj[i][0];
else if(adj[i][0] == last)
last = i, i = adj[i][1];
else last = i, i = adj[i][0];
}
return i;
}
void count_rou... | ALGO | 0.999872 | 3.803442 |
e5b1d863-f620-47db-b9ec-d609c123109f | funnychris/godot | thirdparty/graphite/src/Pass.cpp | #include "inc/Main.h"
#include "inc/debug.h"
#include "inc/Endian.h"
#include "inc/Pass.h"
#include <cstring>
#include <cstdlib>
#include <cassert>
#include <cmath>
#include "inc/Segment.h"
#include "inc/Code.h"
#include "inc/Rule.h"
#include "inc/Error.h"
#include "inc/Collider.h"
using namespace graphite2;
using vm:... | ALGO | 0.953854 | 3.179125 |
261e216e-330d-45d6-8cef-e697f4c300d7 | azdhafin/socs | arithmeticH.cpp | #include <stdio.h>
int main()
{
double a, b, c, d;
for(int i=0; i<3; i++)
{
scanf("%lf %lf %lf %lf", &a, &b, &c, &d);
printf("%.2lf\n", 2*a/1+4*b/2+6*c/3+4*d/4);
}
return 0;
}
| ALGO | 0.986736 | 3.060417 |
6b51c948-d058-436e-bb01-6910102c1511 | diohabara/competitive_programming | ac/abc215/D/main.cpp | #include <bits/stdc++.h>
#include <atcoder/all>
#include <boost/multiprecision/cpp_int.hpp>
using namespace atcoder;
using namespace boost::multiprecision;
using namespace std;
using ll = long long;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
const ll MOD = 1e9 + 7;
const int INF = INT_MAX;
const ll LLINF = ... | ALGO | 0.999988 | 3.898096 |
7dd507f1-edb2-423a-a98b-1e7df5af0456 | MallowDev/system_core | adb/usb_osx.cpp | #define TRACE_TAG TRACE_USB
#include "sysdeps.h"
#include <CoreFoundation/CoreFoundation.h>
#include <IOKit/IOKitLib.h>
#include <IOKit/IOCFPlugIn.h>
#include <IOKit/usb/IOUSBLib.h>
#include <IOKit/IOMessage.h>
#include <mach/mach_port.h>
#include <inttypes.h>
#include <stdio.h>
#include "adb.h"
#include "transpor... | TOOL | 0.943924 | 6.463424 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.