uuid string | repo_name string | relative_path string | content string | category string | algo_rel_score float64 | quality_score float64 |
|---|---|---|---|---|---|---|
56c774c8-3707-4cce-b20c-490dfbb14be8 | linkumokunn/code_la | TIOJ/2224.cpp | /*
=============================================================================
/\ \ / /\ |\ /| |===========
/ \ \ / / \ | \ / | |
/ \ \ / / \ | \ / | |
/ \ | / \ | \... | ALGO | 0.999701 | 4.134339 |
5c615109-5a20-4fc4-b7ae-9b66d5875a73 | Opendigitalradio/ODR-AudioEnc | fdk-aac/libAACdec/src/usacdec_ace_ltp.cpp | /* -----------------------------------------------------------------------------
Software License for The Fraunhofer FDK AAC Codec Library for Android
© Copyright 1995 - 2018 Fraunhofer-Gesellschaft zur Förderung der angewandten
Forschung e.V. All rights reserved.
1. INTRODUCTION
The Fraunhofer FDK AAC Codec Lib... | ALGO | 0.998106 | 4.14915 |
0bebee54-5542-4ce1-8c68-6ef41a7867fa | sontungexpt/UIT-Workspaces | C_C++/HocKi2_Nam1/UIT-Together/MangHaiChieu/Bai030/Bai030.cpp | #include <iostream>
#include <fstream>
#include <string>
#include <iomanip>
#include <cctype>
#include <math.h>
using namespace std;
#define MAXR 500
#define MAXC 500
//initalize function
string GetFileLink(string);
void Xuat(int[][MAXC], int, int);
void Nhap(string, int[][MAXC], int&, int&);
int TinhTongDuong(int[]... | ALGO | 0.998959 | 3.083855 |
14d48de0-2727-4986-953c-273b47a5bcfb | zaforf/competitiveprogramming | cses/mathematics/creatingstringsII.cpp | #include <bits/stdc++.h>
using namespace std;
const int MOD=1e9+7;
const int MAXN=1e6;
long long exp(long long a,long long b) {
long long ret = 1;
a %= MOD;
while (b) {
if (b&1) ret = ret * a % MOD;
a = a * a % MOD;
b>>=1;
}
return ret;
}
long long fac[MAXN+1];
long long inv[MAXN+1];
int charcnt[26];
voi... | ALGO | 0.999993 | 5.391605 |
10beeaea-977d-4cf5-ae66-5b653547e1fd | Maverick0705/CodeForces | 1733C.cpp | #include<bits/stdc++.h>
using namespace std;
#define gc getchar_unlocked
#define fo(i,n) for(i=0;i<n;i++)
#define Fo(i,k,n) for(i=k;k<n?i<n:i>n;k<n?i+=1:i-=1)
#define ll long long
#define si(x) scanf("%d",&x)
#define sl(x) scanf("%lld",&x)
#define ss(s) scanf("%s",s)
#define pi(x) printf("%d\n",x)
#define pl(x) printf(... | ALGO | 0.999752 | 3.400294 |
d754ec89-a03d-4ae0-bff4-2b03ea56333f | fengyc/leetcode | 79.cpp | #include <vector>
#include <list>
#include <string>
using namespace std;
class Solution {
public:
bool exist(const vector<vector<char>> &b, vector<vector<bool>> &m, int r, int c, const string &word, int pos) {
if (r < 0 || r >= b.size() || c < 0 || c >= b[0].size()) {
return false;
}
... | ALGO | 0.999513 | 6.253772 |
e5182e7c-beaa-450c-942f-a7a4fc76bc7a | bhanujabh/DSA-using-CPP | misc/operatorOverloading.cpp | #include<iostream>
#include<cstring>
using namespace std;
class String{
public:
char *str;
String(char *temp){
str = new char[30];
strcpy(str,temp);
}
char *operator+(char *s){
char *temp = new char[30];
strcpy(temp, str);
strcat(str, s);
return str;
... | TOOL | 0.972594 | 3.886232 |
3cfa7b3c-58a6-4e78-9b57-5d87a1fa4720 | Ruta2021/2022 | linkedlist/delete_in_cirll.cpp | #include<stdio.h>
#include<stdlib.H>
struct Node
{
int data;
struct Node *next;
}
*Head;
void create(int A[],int n)
{
int i;
struct Node *t,*last;
Head=new Node;
Head->data=A[0];
Head->next=Head;
last=Head;
for(i=1;i<n;i++)
{
t=new Node;
t->data=A[i];
... | ALGO | 0.999967 | 3.865031 |
f5d043e3-2fe6-4509-a4e8-9cbc6a246671 | Siddhit-kale/CP-Practical | Week_7/merge Intervels.cpp | #include<bits/stdc++.h>
using namespace std;
class Solution {
public:
vector<vector<int>> merge(vector<vector<int>>& intervals) {
sort(intervals.begin(), intervals.end());
int k = 0;
for (int i = 1; i < intervals.size(); i++) {
if (intervals[k][1] >= intervals[i][0]) ... | ALGO | 0.999996 | 5.936828 |
33f63d9c-d22d-4778-b069-bfef7363361a | ishandutta2007/codeforces | bayweiheng/normal/1398/C.cpp | #include<bits/stdc++.h>
using namespace std;
typedef vector<double> vd;
typedef vector<vd> vvd;
typedef vector<vvd> vvvd;
typedef vector<string> vs;
typedef vector<char> vc;
typedef vector<vc> vvc;
typedef vector<int> vi;
typedef vector<vi> vvi;
typedef long long ll;
typedef vector<long long> vll;
typedef vector<vll>... | ALGO | 0.999972 | 4.160828 |
d7811900-dc40-496c-9c9b-3372486c4e51 | vfolunin/archives-solutions | EOlymp/7111.cpp | #include <iostream>
#include <algorithm>
#include <vector>
#include <set>
#include <map>
#include <string>
using namespace std;
int main() {
freopen("input.txt", "r", stdin);
freopen("output.txt", "w", stdout);
int index;
cin >> index;
index--;
string s = "AEIJOUY";
vector<int> factorial... | ALGO | 0.999752 | 4.367108 |
7a59e698-ea89-447d-874a-0b99a7c5babf | Mirthhh08/Strivers-A2Z-DSA-Sheet | Step-3/3.3 Hard/10_reverse_pairs.cpp | #include <bits/stdc++.h>
using namespace std;
// brute force approach
// T.C :- O(N^2)
// S.C .:-O(1)
int countReversePairs_brute(int arr[], int n)
{
int cnt = 0;
for (int i = 0; i < n; i++)
{
for (int j = i + 1; j < n; j++)
{
if (arr[i] > (2 * arr[j]))
{
... | ALGO | 0.997758 | 4.627565 |
67c96f71-ac63-47a6-a3af-99c436eb9e3a | ErickDev1218/Estrutura-de-dados-avancada | AVL_codigo_inicial/avl.cpp | #include <iostream>
#include "node.h"
#include "avl.h"
using namespace std;
//Retorna a altura do nó
//Se nó vazio retorna 0
//Senao retorna a altura do no (height)
int avl_tree::height(Node *node) {
return !node ? 0 : node->height;
}
int avl_tree::balance(Node *node) {
return height(node->right) - height(... | ALGO | 0.998555 | 3.897012 |
b5132ea1-8f62-44a2-b5e6-8751a51e3be1 | luizapiancastelli/cpbayes | src/noreg.cpp | #include <Rcpp.h>
using namespace Rcpp;
#include "rejection.h"
NumericVector proposal_ln(double param, double sigma){
NumericVector param_prime = rlnorm(1, log(param), sigma);
return(param_prime);
}
// [[Rcpp::export]]
double logqcomp(NumericVector y, double mu, double nu){
NumericVector log_q = nu*(y*log(mu) -... | ALGO | 0.999832 | 3.315707 |
29dfa708-db0d-47e9-abd6-a2b794a86f9c | aristofanio/freemat | FreeMat/libs/libCore/Min.cpp | #include "Operators.hpp"
#include "IEEEFP.hpp"
#include "Math.hpp"
#include "Complex.hpp"
// The LessThan function is called by Min
struct OpLessThan {
template <typename T>
static inline T func(const T& v1, const T& v2) {
if (IsNaN(v1)) return v2;
if (IsNaN(v2)) return v1;
return (v1 < v2) ? v1 : v2;
... | ALGO | 0.998967 | 7.201808 |
c23039d6-83f5-4e53-9df9-d5482e398e90 | NaF1sh/problem-solving-1 | codeforces/A_Three_Integers_Again.cpp | #include <iostream>
#include <vector>
void generateString(int n, int k) {
std::string result;
for (int i = 0; i < n; ++i) {
result += 'a' + (i % k);
}
std::cout << result << std::endl;
}
int main() {
int t;
std::cin >> t;
while (t--) {
int n, k;
std::cin >> n >> k;
... | ALGO | 0.998438 | 4.3114 |
9fa7f822-323d-4fc1-99aa-7d1c66bd7fdf | videolan/vlc | modules/stream_out/dlna/dlna.cpp | #ifdef HAVE_CONFIG_H
# include "config.h"
#endif
#include "dlna.hpp"
#include <vector>
#include <string>
#include <sstream>
#include <iomanip>
#include <vlc_configuration.h>
#include <vlc_cxx_helpers.hpp>
#include <vlc_dialog.h>
#include <vlc_rand.h>
#include <vlc_sout.h>
#include <vlc_block.h>
static const char* A... | TOOL | 0.953554 | 6.251294 |
c4a5ba8a-5436-441e-9c24-6180e4247254 | Pankum123/DSA-IN-CPP | 4STACKS/16max_rectangle_area_2D_1s.cpp | #include<iostream>
#include<vector>
#include<stack>
#include<limits.h>
using namespace std;
vector<int> nextsmallerelement(int* arr,int n){
stack<int> s;
s.push(-1);
vector<int> ans(n);
for(int i = n-1; i>=0; i--){
int curr = arr[i];
while(s.top() != -1 && arr[s.top()] >= curr){
... | ALGO | 0.999982 | 4.509204 |
10c4af0a-3a4e-41f8-bdab-1b31422f3cba | aayushdewangan11/DSA-Practice | Codeforces/PhoenixAndPuzzle.cpp | #include<bits/stdc++.h>
using namespace std;
int main(){
int t;
cin>>t;
while(t--){
// int n;
// cin>>n;
// bool ans = false;
// for(int i = 0; i<n; i++){
// if(pow(2,i)==n){
// ans = true;
// break;
// }
// }
... | ALGO | 0.999477 | 5.220105 |
e54468f3-8d48-4d06-b166-bd6de0a939d6 | amit-23-hub/LeetCode---POTD | 2872. Maximum Number of K-Divisible Components.cpp | class Solution {
public:
int ans = 0;
unordered_map<int, vector<int>> adj;
long dfs(int node, int parent, int &k, vector<int>& values)
{
long subTreeSum = values[node];
for(auto &child : adj[node])
{
if(child != parent)
subTreeSum += dfs(child, node, ... | ALGO | 0.999932 | 5.833265 |
96b62ff3-9dae-477c-a291-a2f80837fa04 | cran/Boom | src/Models/HMM/Clickstream/NestedHmm.cpp | #include "Models/HMM/Clickstream/NestedHmm.hpp"
#include <thread>
#include "LinAlg/Matrix.hpp"
#include "LinAlg/Selector.hpp"
#include "LinAlg/SubMatrix.hpp"
#include "LinAlg/VectorView.hpp"
#include "Models/HMM/hmm_tools.hpp"
#include "cpputil/ThreadTools.hpp"
#include "distributions.hpp"
#include "distributions/Mark... | ALGO | 0.991251 | 6.024493 |
f009384e-e2ec-4133-a9b6-556cf381dab1 | waliulrayhan/cpp-Competitive-Programming | C++ Practice/Knapsack2.cpp |
#include <iostream>
#include <algorithm>
#include <vector>
using namespace std;
bool compare(pair<float, int> p1, pair<float, int> p2)
{
return p1.first > p2.first;
}
int fractional_knapsack(vector<int> weights, vector<int> values, int capacity)
{
int len = weights.size();
int total_value = 0;
vect... | ALGO | 0.999968 | 4.854674 |
67e7d3da-4d44-413b-96c7-5a92299a273a | MERWINDASARI/adventOfCode | 2024/day5/Part2.cpp | #include<iostream>
#include<vector>
#include<math.h>
#include<limits.h>
#include<unordered_set>
#include<unordered_map>
#include<algorithm>
#include<map>
#include <sstream>
#include <queue>
using namespace std;
typedef long long ll;
string scanRules(vector<vector<int>>& rules){
string s;
string updates="... | ALGO | 0.999708 | 4.720581 |
315e8d31-97c4-43d4-8fb2-7719e3ea35a2 | hongjonghwa/algorithms | ex/2002-sort-using-hw/main_bak.cpp | #include<stdio.h>
#include<stdlib.h>
#include<assert.h>
#include<algorithm>
#include<time.h>
#include <functional>
#include "BST.cpp"
#define SIZE 1048576
#define IDX 2048
void my_sort(unsigned int DATA[SIZE]);
unsigned int DATA[SIZE];
unsigned int BAK_DATA[SIZE];
unsigned int idx1[IDX], idx2[IDX];
long long int SC... | ALGO | 0.99325 | 3.68502 |
cb34118b-0f58-41b4-92e3-c33bb60eb280 | sky-bro/AC | leetcode.com/0729 My Calendar I/main2.cpp | #include <iostream>
#include <map> // <set>
#include <vector>
using namespace std;
// ref: [Java/C++] Clean Code with Explanation
// https://leetcode.com/problems/my-calendar-ii/discuss/109519/JavaC%2B%2B-Clean-Code-with-Explanation
// just bf, at most 1000 books
class MyCalendar {
private:
vector<pair<int, int>... | ALGO | 0.999726 | 5.905376 |
d58a7cc5-42b8-429c-8a9a-56146a60fd5f | NTMyDung/Demo | 212/main.cpp | #include <iostream>
using namespace std;
bool nguyento ( int x){ //ham kiem tra 1 so co phai so nguyen to khong
if( x<=1) return false;
if( x==2) return true;
for( int i=2; i<x; i++){
if( x%i==0) return false;
}
return true;
}
void xepnguyen... | ALGO | 0.999716 | 4.236006 |
8ac6e456-c03a-4a0d-ab58-c452fd3df413 | InwooLeeme/Algorithm | Boj/17391.cpp | #pragma GCC target("sse,sse2,sse3,ssse3,sse4,avx,avx2")
#pragma GCC optimize("Ofast")
#pragma GCC optimize("unroll-loops")
#include <bits/stdc++.h>
#include <ext/rope>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
using namespace std;
using namespace __gnu_cxx;
using namespace __gnu_pbds... | ALGO | 0.999941 | 4.319173 |
e57fa305-2c31-462f-ae29-ee572b860903 | Abhinav7076/My-Codes | LeetCode-Solutions-master/C++/maximum-alternating-subsequence-sum.cpp | // Time: O(n)
// Space: O(1)
class Solution {
public:
long long maxAlternatingSum(vector<int>& nums) {
long long result = nums[0];
for (int i = 0; i < size(nums) - 1; ++i) {
result += max(nums[i + 1] - nums[i], 0);
}
return result;
}
};
| ALGO | 0.999993 | 5.787802 |
204e53c7-22bb-467e-8d65-9d29f7f181bc | sh2268411762/- | 啊哈C/啊哈C/for循环打印乘法表2.cpp | /*
#include <stdio.h>
#include <stdlib.h>
int main()
{
// i,jԼresult
int i, j, result, k;
for (i = 9; i >= 1; i--)
{
printf("\n");
for (j = 1; j <= i; j++)
{
result = i * j;
printf("%d*%d=%-4d", i, j, result);
}
}
//ʽַУʮӦıֵʽΪ4룻
// ʵλ4ʱÿո룬
// ʵλ4λʱʵλ................................... | ALGO | 0.999282 | 3.387286 |
cd2696db-e7d1-4343-af60-81c7ba2d8970 | Utkash2207/Practical.cpp | practical_10.cpp |
// WAP that accepts 9 number in form of matrix and display transpose of that matrix.
#include <iostream>
using namespace std;
int main() {
// Declare a 3x3 matrix
int matrix[3][3];
// Accept input for the matrix
cout << "Enter 9 numbers for the matrix:" << endl;
for(int i = 0; i < 3; i++) {
... | ALGO | 0.998509 | 4.79846 |
4fb76234-2ff1-4c9e-a08b-0ab27974eae4 | anushka209/DSALeetCode_Problems | 1667-find-kth-bit-in-nth-binary-string/1667-find-kth-bit-in-nth-binary-string.cpp | class Solution {
public:
char findKthBit(int n, int k) {
if(n == 1)
return '0';
int len = (1<<n)- 1; // pow(2,n)-1
if (k<ceil(len/2.0))
return findKthBit(n-1,k);
else if(k==ceil(len/2.0))
return '1';
else
{
char ch=findKthBit(n-1,len-(k-1)... | ALGO | 0.999995 | 6.259116 |
aeb87a10-7a82-44ba-b881-f6aed61d36f8 | stereshkin/coursera-white_belt | 2 week/monthly_business.cpp | #include <iostream>
#include <string>
#include <vector>
#include <algorithm>
using namespace std;
int main() {
int q;
int months = 1;
cin >> q;
vector<vector<string>> current_month(31);
for (int i = 0; i < q; ++i) {
string code;
cin >> code;
if (code == "ADD") {
... | ALGO | 0.970404 | 4.810148 |
389bc044-ed9f-4832-8f76-87323fa0b274 | YupiSoftwarePunk/Homework-With-One-dimensional-Arrays | arrays.cpp | #include <iostream>
#include <cstdlib>
using namespace std;
void main()
{
setlocale(LC_ALL, "ru");
srand(time(NULL));
//exercise 1
const int size = 10;
int arr[size];
int min_value = INT_MAX, max_value = INT_MIN;
for (int i = 0; i < size; i++)
{
arr[i] = rand();
cout << arr[i] << " ";
if (arr[i] > max... | ALGO | 0.956813 | 3.327688 |
4bee4827-7c99-4663-ad32-bdb7dd5b10e1 | statco19/BOJ-problems | 10026.cpp | #include <bits/stdc++.h>
#define vt vector
#define en '\n'
#define ll long long
#define ull unsigned long long
#define ld long double
#define ioa insert_or_assign
#define umap unordered_map
#define prq priority_queue
#define pb push_back
#define pii pair<int,int>
#define sz(x) (int)(x).size()
#define all(x) (x).begin(... | ALGO | 0.995924 | 3.166254 |
76d09770-244a-4291-a1df-ab4fee65d341 | hartiksalaria/CP-Hackpack | range queries/seg_tree.cpp | #include <bits/stdc++.h>
using namespace std;
struct seg {
vector <int> st;
int n;
void init(int n) {
this->n = n;
st.resize(4*n, 0);
}
void build(int start, int end, int node, vector <int> &v) {
if(start == end) {
st[node] = v[start];
return;
}
int mid = (start+end)/2;
build(start, mid, n... | ALGO | 0.999962 | 4.613054 |
2fc29515-87c9-4a85-8d1c-582301816250 | raincross7/code-similarity | codes/train_code/problem399/problem399_427.cpp | #include <algorithm>
#include <cstdio>
#include <iostream>
#include <map>
#include <cmath>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <string>
#include <vector>
#include <stdlib.h>
#include <stdio.h>
#include <bitset>
using namespace std;
#define FOR(I,A,B) for(int I = (A); I < (B); ++... | ALGO | 0.999747 | 3.933567 |
240d365b-4245-472d-a759-f441b272dbea | comwork2016/algorithm_fragments | RobustKarpRabin/main.cpp | #include <stdio.h>
#include <math.h>
#include <string.h>
#include <stdlib.h>
#define d 12// number of characters in the alphabet
void RABIN_KARP_MATCHER( char *T, char *P, int q)
{
if(!T || !P || q<=0)
{
return;
}
int M = strlen( P );
int N = strlen( T );
int i, j;
int p = 0;//hash ... | ALGO | 0.999902 | 3.826471 |
19bd3633-f74c-4ff6-8fbe-13ce96d1c4aa | naoyat/topcoder | fileedit/2009/PerfectPermutation2.cpp | #line 2 "PerfectPermutation.cpp"
#include <iostream>
#include <sstream>
#include <cstdio>
#include <cmath>
#include <cctype>
#include <algorithm>
#include <string>
#include <vector>
#include <deque>
#include <stack>
#include <queue>
#include <list>
#include <map>
#include <set>
// BEGIN CUT HERE
#include "cout.h"
// EN... | ALGO | 0.999939 | 4.374308 |
6748f206-2da9-4f92-9fa5-213b3c876f12 | pokachopotun/msu_m118_ivanov | hpc_mod_and_tech/lab2/main.cpp | #define _USE_MATH_DEFINES
#include <cstdio>
#include <cmath>
#include <cstdlib>
#include <iostream>
#include <vector>
#include <string>
#include <mpi.h>
#include <omp.h>
using namespace std;
double u1(double x, double y, double t) {
return (t * t + 1) * sin(2 * M_PI * x) * sin(2 * M_PI * y);
}
double u1t(doub... | ALGO | 0.999817 | 4.074076 |
88f7a288-d82b-4f90-bb54-521d77d41ec6 | VijayNegi/LeetCodeProblems | solutions/863. All Nodes Distance K in Binary Tree.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<int> distanceK(TreeNode* root, TreeNode* target, int k) {
bool found= false;
... | ALGO | 0.999997 | 6.039343 |
de74dcd8-d2f1-4b93-9309-0435db907a41 | raincross7/code-similarity | codes/train_code/problem165/problem165_413.cpp | #include <iostream>
#include <vector>
#include <string>
using namespace std;
int main(int argc, char *argv[])
{
int n;
char mcxi[] = {'m', 'c' ,'x', 'i'};
string num;
cin >> n;
while (n--) {
vector<pair<char, int> > vp;
for (int i = 0; i < 4; ++i)
vp.push_back(make_pair(... | ALGO | 0.999604 | 3.772054 |
5f1dcbb0-8f98-4738-9990-83493342832a | cananella/baekjoonSolution | CPP/2638_chees.cpp | #include<iostream>
#include<queue>
using namespace std;
int map[100][100];
bool visited[100][100];
int n,m;
int num_of_chees=0;
int dx[4]={1,-1,0,0};
int dy[4]={0,0,1,-1};
void updatemap(){
queue<pair<int,int>> q;
for(int i=0;i<n;i++)for(int j=0;j<m;j++) visited[i][j]=false;
for(int i=0;i<n;i++){
... | ALGO | 0.999937 | 3.821397 |
ef69bdac-9e36-4928-b253-78826fc4dd92 | alexandraback/datacollection | solutions_5670465267826688_0/C++/kerker/C.cpp | #include <stdio.h>
#include <stdlib.h>
#include <string.h>
char s[10004],ss[10004];
char pre[10004],ppre[10004];
char get(char a,char b){
if(a=='1' && b=='1') return '1';
else if(a=='1' && b=='i') return 'i';
else if(a=='1' && b=='j') return 'j';
else if(a=='1' && b=='k') return 'k';
else... | ALGO | 0.999928 | 3.511026 |
8cedfdfc-a02c-4b78-8a9d-751711766ce3 | yujin-hong/algorithm_study | 3055/main.cpp | #include <iostream>
#include <queue>
using namespace std;
int m,n;
char a[51][51];
int visited[51][51];
int dx[4]={1,0,-1,0};
int dy[4]={0,1,0,-1};
queue<pair<int, int>> waterq;
queue<pair<int, int>> beaq;
pair<int, int> des;
pair<int, int> start;
void bfs() {
while(!beaq.empty()) {
int wqsize = waterq.... | ALGO | 0.999776 | 3.860965 |
78c838e4-1e94-4ade-a7ea-520a8528c9c0 | Withnoidea/OJ | luogu/Luogu_P_1923.cpp | #include <bits/stdc++.h>
using namespace std;
typedef long long LL;
const int N = 5e6 + 10;
LL q[N];
int n, m;
void quick_sort(LL q[], int l, int r)
{
if (l >= r)
return;
int i = l - 1, j = r + 1, x = q[l + r >> 1];
while (i < j)
{
do
i++;
while (q[i] < x);
do
j--;
while (q[j] >... | ALGO | 0.999995 | 3.442879 |
39b0ba1f-2313-42cb-97a2-9581578555f9 | Aatiqur-Rahman/OJProblem | CC/New folder/meanmax.cpp |
#include <bits/stdc++.h>
using namespace std;
vector <int> v;
void fasterio(){
ios_base :: sync_with_stdio(false);
cin.tie(NULL);
cout.tie(NULL);
}
void solve(){
int n ;cin >> n;
v.clear () ;
for ( int i = 0 ;i < n ;i++) {
int data ; cin >> data ;
v.push_back(data) ;
}
sort ( v.begin ()... | ALGO | 0.999709 | 4.836529 |
41d98722-7939-4b69-b757-9a4883ca39e3 | SIDLAD/CC | ICPC Camp/Camp 2024 Contest 4/A_Sticky_Situation.cpp | #include <bits/stdc++.h>
const long double EPS = 1e-7;
const long long int M = (long long int) 1e9 + 7;//998'244'353;
using namespace std;
//insert policy here
//insert mintcode here
#if defined (ONLINE_JUDGE) || !__has_include (</home/sidlad/Desktop/Coding Folder/c and cpp codes/Debug.h>)
void _exe() {}
temp... | ALGO | 0.999951 | 4.554394 |
91e980e4-6616-4f1c-870a-04a19e6c7ce4 | sky21kr/algorithm | 백준/11651.cpp | #include<iostream>
#include<vector>
#include<algorithm>
using namespace std;
int main()
{
int N;
cin >> N;
vector<pair<int, int>> arr;
for (int i = 0, x = 0, y = 0; i < N; i++)
{
cin >> x >> y;
arr.push_back(make_pair(y, x));
}
sort(arr.begin(), arr.end());
for (int i = 0; i < N; i++)
{
printf("%d %... | ALGO | 0.999951 | 4.199925 |
370745f0-241b-4521-bbd5-bbd4c95a8980 | lsrosa/myLegUp | bak/llvm-2.9_mips/lib/Transforms/Utils/InlineFunction.cpp | #include "llvm/Transforms/Utils/Cloning.h"
#include "llvm/Constants.h"
#include "llvm/DerivedTypes.h"
#include "llvm/Module.h"
#include "llvm/Instructions.h"
#include "llvm/IntrinsicInst.h"
#include "llvm/Intrinsics.h"
#include "llvm/Attributes.h"
#include "llvm/Analysis/CallGraph.h"
#include "llvm/Analysis/DebugInfo.h... | TOOL | 0.975529 | 7.289845 |
7ad647c6-32e7-4abc-bd0a-39845e2755e7 | ishandutta2007/codeforces | gabrielwu/normal/1500/B.cpp | #include <bits/stdc++.h>
using namespace std;
#define forn(i, n) for(int i=0; i<(n); i++)
#define readVec(v) forn(i, v.size()){cin >> v[i];}
#define printArr(arr, n) forn(i, n){if (i) cout << " "; cout << arr[i];} cout << endl;
#define pb push_back
#define mp make_pair
#define MOD 1000000007
#define f first
#define s ... | ALGO | 0.999991 | 3.1958 |
418c0f37-570b-4f92-bd46-ea4222962c73 | 192011157/DAA | prime or not.cpp | #include<stdio.h>
int main(){
int n,i,count=0;
printf("Enter the number to be checked:");
scanf("%d",&n);
for(i=1;i<=n;i++){
if(n%i==0){
count+=1;
}}
if(count<=2){
printf("The given number %d is prime",n);
}
else{
printf("The given number %d is not prime",n);
}
} | ALGO | 0.999955 | 3.184267 |
05074a0d-aa24-4a12-9a92-58dc907460e9 | zeeSaan25/Phitron_codes_cpp | module2_mid1_q4.cpp | #include<bits/stdc++.h>
using namespace std;
#define ll long long int
#define boost() ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);
class Student{
public:
int id;
char name[101];
char section;
int marks;
};
int main(){
boost();
int t; cin>>t;
while(t--){
Student a,b,c;
cin>>... | ALGO | 0.999879 | 3.419958 |
a042c508-298d-4145-b49e-71dc21af4967 | stellalphatic/PF | PD/week-2/task13_twoVar.cpp | #include <iostream>
using namespace std;
int main()
{
int n, sum = 0;
cin >> n;
sum += n;
cin >> n;
sum += n;
cin >> n;
sum += n;
cin >> n;
sum += n;
cin >> n;
sum += n;
cout << sum;
} | ALGO | 0.992222 | 3.125309 |
6a9c17f6-4f2e-4dd4-bf05-aef80eda6404 | Priyagarg1/CPP-Programming | Plus_minus.cpp | #include<iostream>
#include<bits/stdc++.h>
using namespace std;
int main()
{
int i,n,arr[100];
float p_count=0,n_count=0,z_count=0,p_1;
cin>>n;
for(i=0;i<n;i++)
{
cin>>arr[i];
}
for(i=0;i<n;i++)
{
if(arr[i]>0)
{
p_count=p_count+1;
}
... | ALGO | 0.999865 | 3.628191 |
19e79e59-0ebe-44f0-8d85-077b899a9416 | JNDWI/PPPUCpp2ndJP | Programming-code/Chapter24/chapter.24.6.1.cpp |
//
// This is example code from Chapter 24.6.1 "Classical Gaussian elimination" of
// "Programming -- Principles and Practice Using C++" by Bjarne Stroustrup
//
#include "std_lib_facilities.h"
#include "Matrix.h"
#include "MatrixIO.h"
using namespace std;
using Numeric_lib::Index;
//--------------------------------... | ALGO | 0.999868 | 6.091354 |
5f7c3b4b-c623-4fd6-849a-5fdcd212d0d5 | Kartik-Mathur/19JuneCPP2022 | Lecture-8/SwitchCase.cpp | // SwitchCase.cpp
#include <iostream>
using namespace std;
int main() {
char ch;
cin >> ch;
switch (ch) {
case 'n':
case 'N':
cout << "North\n";
break;
case 'e':
case 'E':
cout << "East\n";
break;
case 's':
case 'S':
cout << "South\n";
break;
case 'w':
case 'W':
cout << "West\n";
break;
de... | ALGO | 0.93217 | 3.254923 |
3dfa08f1-f8c1-4fef-897b-7e43463cfee0 | AsthaJain00016/DSA | Pointers/p4.cpp | //predict the output
#include<iostream>
using namespace std;
int main(){
int a=5,b=10;
int &name=a;
int *ptr=&a;
(*ptr)++;
ptr=&b;
*ptr=*ptr+5;
name+=5;
cout<<a<<b;
} | ALGO | 0.997004 | 3.444853 |
545996ec-91cd-4625-ac3c-cab8d09fbc58 | MuhammadMouostafa/Algorithms | probability/CodeForces - 476B.cpp | #define _CRT_SECURE_NO_WARNINGS
#ifdef __GNUC__
# define ffs(x) __builtin_ffs(x)
#elif __INTEL_COMPILER
# define ffs(x) _bit_scan_forward(x)
#endif
#include <bits/stdc++.h>
#include<ext/pb_ds/assoc_container.hpp>
#include<ext/pb_ds/tree_policy.hpp>
using namespace std;
using namespace __gnu_pbds;
template<typename ... | ALGO | 0.999492 | 4.338351 |
64810a49-84eb-4fbd-b158-26a368336f46 | Dhruv-Panwala/Learning_Cpp | time.cpp | #include<iostream>
using namespace std;
class Time{
public:
int hr,mi,se;
void setData(int a, int b, int c)
{
hr=a;
mi=b;
se=c;
}
void display()
{
cout<<hr<<":"<<mi<<":"<<se<<endl;
}
void generalize()
{
hr=hr+(mi/60);
mi=mi%60+(se/6... | TOOL | 0.972071 | 4.045932 |
a9324356-ab36-4fc2-91a1-ff5894ec2d4e | werner-yin/code-public-2 | Luogu/P4783.cpp | #include <bits/stdc++.h>
#define eb emplace_back
#define ep emplace
#define fi first
#define se second
#define in read<int>()
#define lin read<ll>()
#define rep(i, x, y) for(int i = (x); i <= (y); i++)
#define per(i, x, y) for(int i = (x); i >= (y); i--)
using namespace std;
using ll = long long;
using db = double;
... | ALGO | 0.999943 | 3.369785 |
aa363363-0939-4813-a072-77ad87f26151 | saiy2k/cocos2dx-platformer | LineInterpolation/libs/cocos2dx/text_input_node/CCTextFieldTTF.cpp | #include "CCTextFieldTTF.h"
#include "CCDirector.h"
#include "CCEGLView.h"
NS_CC_BEGIN
static int _calcCharCount(const char * pszText)
{
int n = 0;
char ch = 0;
while ((ch = *pszText))
{
CC_BREAK_IF(! ch);
if (0x80 != (0xC0 & ch))
{
++n;
}
... | TOOL | 0.862395 | 6.381079 |
9f45f621-548c-4156-93b2-452afb4d227c | ishandutta2007/codeforces | magga/normal/1693/A.cpp | #include<bits/stdc++.h>
#pragma GCC optimize("Ofast")
#pragma GCC target("sse,sse2,sse3,ssse3,sse4,avx,avx2")
#pragma GCC optimization ("O3")
#pragma GCC optimization ("unroll-loops")
#define filei freopen("input.txt", "r", stdin);
#define fileo freopen("output.txt", "w", stdout);
#define gooi cout<<"Case #"<<i+1<<": "... | ALGO | 0.99982 | 3.562092 |
65ba3e45-b88e-4088-9426-de0ca77074eb | Arvinhahaha/C | 三角形.cpp | #include<iostream>
#include<algorithm>
using namespace std;
#define MAX 101
int D[MAX][MAX];
int n,T;
int MaxSum(int i,int j)
{
if(i==n)
return D[i][j];
int x=MaxSum(i+1,j);
int y=MaxSum(i+1,j+1);
return D[i][j]+max(x,y);
}
int main()
{
while(cin>>T){
while(T--){
cin>>n;
for(int i=1;i<=n;i++)
for(in... | ALGO | 0.999706 | 3.463311 |
d6548707-a08e-44a0-957d-442cdf8b694a | revbayes/revbayes.archive | boost_1_60_0/libs/iterator/example/permutation_iter_example.cpp | #include <iostream>
#include <vector>
#include <deque>
#include <algorithm>
#include <boost/iterator/permutation_iterator.hpp>
#include <boost/cstdlib.hpp>
#include <assert.h>
int main() {
using namespace boost;
int i = 0;
typedef std::vector< int > element_range_type;
typedef std::deque< int > index_type;
... | ALGO | 0.981258 | 4.412151 |
50afc0a9-abc4-4e63-bcf4-a4c8041e98a9 | Mugdha-Hazra/180-Questions-Striver-SDE-sheet-in-CPP | 1354-construct-target-array-with-multiple-sums/1354-construct-target-array-with-multiple-sums.cpp | class Solution {
public:
bool isPossible(vector<int>& target) {
auto s = accumulate(begin(target), end(target), (long long)0);
priority_queue<int> q(begin(target), end(target));
while (s > 1 && q.top() > s / 2) {
auto cur = q.top(); q.pop();
s -= cur;
if (s <= 1)
retu... | ALGO | 0.999892 | 5.271514 |
37a6c962-aebd-4141-97fa-e248c3ba078b | Saleh7127/CPP-solution-by-Fellow_junior | Codeforces/cf182D.cpp | #include <bits/stdc++.h>
using namespace std;
#define ll long long
#define test int t; cin>>t; for(int cs=1;cs<=t;cs++)
bool check(string x,ll n,string a)
{
for(ll i=0;i<x.size();i++)
{
if(x[i]!=a[i%n]) return 0;
}
return 1;
}
int main()
{
ios_base::sync_with_stdio(0);
cin.tie(0);cout.tie... | ALGO | 0.999837 | 4.404083 |
e786a423-0ec1-48e2-bf9a-d7408dacb25f | imanshu822/5-DSA_Questions_a_Day | 1590-make-sum-divisible-by-p/1590-make-sum-divisible-by-p.cpp | class Solution {
public:
int minSubarray(vector<int>& nums, int p) {
int rem = accumulate(nums.begin(), nums.end(), 0LL) % p, pre = 0, res = nums.size();
if (!rem) return 0;
unordered_map<int, int> mp = {{0, -1}};
for (int i = 0; i < nums.size(); ++i) {
pre = (pre + nums[... | ALGO | 0.999964 | 5.508861 |
41ab6426-ad1f-4eb6-912b-b87058d1ac82 | clemkoh/csc417-fluid-simulator | extern/libigl/include/igl/loop.cpp | #include "loop.h"
#include <igl/adjacency_list.h>
#include <igl/triangle_triangle_adjacency.h>
#include <igl/unique.h>
#include <vector>
template <
typename DerivedF,
typename SType,
typename DerivedNF>
IGL_INLINE void igl::loop(
const int n_verts,
const Eigen::PlainObjectBase<DerivedF> & F,
Eigen::Spars... | ALGO | 0.998744 | 5.897307 |
06857903-44e7-45eb-a106-63a31428293f | Nitishrai1/Data-Structures-Algorithms-BootCamp-Supreme-3.0 | Stack/class1/inplementation.cpp | // implement a stack using array in cpp
#include<bits/stdc++.h>
using namespace std;
class Stack{
public:
int *arr;
int size=-1;
int top;
Stack(int size){
this->size=size;
arr=new int[this->size];
this->top=-1;
}
void push(int data){
if(top==size-1)... | ALGO | 0.991723 | 5.033823 |
91db8fa3-ba5a-4665-a541-9ae5bd30249f | Abdullah-Niaz/Data-Structure-Algorithm | 11. Trees/AVL_Tress/LL_Rotation_BST.cpp | #include <iostream>
using namespace std;
struct Node{
struct Node *lchild;
int data;
int height;
struct Node *rchild;
}*root = NULL;
int NodeHeight(struct Node *p){
int hl,hr; // height of left and right subtree
hl = p && p->lchild ? p->lchild->height:0; // left subtree
hr = p && p->rchild... | ALGO | 0.999965 | 5.495774 |
b5a36949-883e-4341-a750-26ac9c28d11e | its-hafsa04/Leetcode-problems | 0018-4sum/0018-4sum.cpp | class Solution {
public:
vector<vector<int>> fourSum(vector<int>& nums, int target) {
sort(nums.begin(), nums.end());
vector<vector<int>> ans;
int n = nums.size();
for (int i = 0; i < n; i++) {
if (i > 0 and nums[i] == nums[i - 1])
continue;
fo... | ALGO | 0.999944 | 6.048686 |
6e099d23-e3ce-4233-898e-3ad73733e527 | Mulab11/cntt2016-hw1 | TC-SRM-573-div1-450/linkct.cpp | #include <bits/stdc++.h>
using namespace std;
typedef long long int LL;
const int MAXN = 55;
const LL INF = 0x3f3f3f3f3f3f3f3fLL;
class SkiResorts{
public:
LL d[MAXN][MAXN]; int n, N; bool vis[MAXN][MAXN];
LL minCost(vector <string> g, vector <int> ht){
int i, j, k, mp1, mp2; LL mn;
n = g.size(), N = n * n;
me... | ALGO | 0.999799 | 3.826845 |
0bb842d2-8072-465b-bd91-00c581cfbe44 | ng-dst/oop-labs | lab2/lib/LemniscateBooth.cpp | #include "LemniscateBooth.h"
#include <cmath>
#include <cstdio>
namespace AlgebraicCurves {
LemniscateBooth::LemniscateBooth() {
_m = 1.0;
_c = 1.0;
calculatePolar();
}
LemniscateBooth::LemniscateBooth(const double m, const double c) {
_m = m;
_c = c;
calcul... | TOOL | 0.989586 | 4.985585 |
31df0674-eaff-4ca7-bc7f-97fe4ffb7187 | Pabfigueira/Maratona | Codeforces/Div2_202A.cpp | #include <bits/stdc++.h>
using namespace std;
#define sc(a) scanf("%d", &a)
#define sc2(a, b) scanf("%d%d", &a, &b)
#define sc3(a, b, c) scanf("%d%d%d", &a, &b, &c)
#define scs(a) scanf("%s", a)
#define pri(x) printf("%d\n", x)
#define prie(x) printf("%d ", x)
#define mp make_pair
#define pb push_back
#define BUFF io... | ALGO | 0.999858 | 3.74108 |
26826e6c-af08-417e-9e4f-201a4562be16 | truongtanht/c- | 4.6.cpp | #include <iostream>
#include <iomanip>
using namespace std;
int main () {
int a, b;
cin >> a >>b;
cout << "Tong cua 2 so " << setw(-5) << a << " va " << setw(-3) << b<< " la " << setw(-1) << a+b;
}
| ALGO | 0.963601 | 4.117755 |
a169ef05-473e-4776-9316-5bd288b7c3c9 | VedantGhodke/C-and-CPP-Language-Programs | .github/workflows/BUBBLE SORT.cpp | #include <stdio.h>
int main()
{
int array[100], n, c, d, swap;
printf("Enter number of elements : \n");
scanf("%d", &n);
printf("Enter %d integers : \n", n);
for (c = 0; c < n; c++)
scanf("%d", &array[c]);
for (c = 0 ; c < n - 1; c++)
{
for (d = 0 ; d < n - c - 1; d++)
{
if (array[d]>array... | ALGO | 0.999914 | 3.931512 |
29921653-c032-4465-be5f-e5934a85f6c0 | aphrim/codeforces-workspace | completed/900/orac-and-factors.cpp | #include <bits/stdc++.h>
#define int long long int
//#define USACO
using namespace std;
template<typename T> istream& operator>>(istream& in, vector<T>& a) {for(auto &x : a) in >> x; return in;};
template<typename T> ostream& operator<<(ostream& out, vector<T>& a) {for(auto &x : a) out << x << ' '; return out;};
tem... | ALGO | 0.999875 | 4.319539 |
17f289e7-cff2-4d2b-b7c4-03ed4d385b30 | gilthawk23/Pepega | C++ files/codeforces/50A.cpp | #include <iostream>
using namespace std;
int main()
{
int p, m, n;
cin >> m >> n;
p = m * n;
if (p % 2 == 1)
--p;
cout << p / 2;
} | ALGO | 0.999334 | 3.449839 |
acbb186b-d2ad-4b7a-af7a-3536b4af4957 | Yashasvi-30/C-Cpp | DoWhile/avg.cpp | #include <iostream>
using namespace std;
int main() {
double number, sum = 0, count = 0;
do {
cout << "Enter a number (enter a negative number to finish): ";
cin >> number;
if (number >= 0) {
sum += number;
count++;
}
} while (number >= 0);
if... | TOOL | 0.993067 | 5.219285 |
5d7b71b5-88c6-4ee6-bc8f-8a5fdfe1c8ec | artiam99/GeeksforGeeks | 15 Advanced Data Structures/2 Trie/9 Telephone Dictionary.cpp | #include<bits/stdc++.h>
using namespace std;
struct TrieNode
{
TrieNode* children[26];
bool isleaf;
};
TrieNode* GetNode()
{
TrieNode* Node = new TrieNode;
for(int i = 0 ; i < 26 ; i++)
Node->children[i] = NULL;
Node->isleaf = false;
return Node;
}
void Insert(TrieNode* root , string &s)
{
for(in... | ALGO | 0.999729 | 4.432276 |
60b3a63c-5e81-4640-9a70-4f722978b59b | sn0wbars/1semester | TESTS 2007-2008/2008_5_B.cpp | #include <iostream>
#include <cerrno>
#include <assert.h>
using std::cout;
using std::cin;
unsigned long long int SummOfDividers(int num);
int SmartInput(const char name[], const int bound1 = INT_MIN, const int bound2 = INT_MAX);
int main()
{
cout << "# Test 2008.5.B -Summ of Dividers- \n";
int N = SmartInput("N",... | ALGO | 0.999795 | 5.42213 |
56e3461d-9a84-4baa-b094-7c59ad133542 | ishandutta2007/codeforces | social_zhao/normal/1598/B.cpp | #include<bits/stdc++.h>
using namespace std;
int get() {
int x = 0, f = 1; char c = getchar();
while(!isdigit(c)) { if(c == '-') f = -1; c = getchar(); }
while(isdigit(c)) { x = x * 10 + c - '0'; c = getchar(); }
return x * f;
}
const int N = 1005;
int n, a[N][6];
int calc(int x, int y) {
int cntx = 0, cnty = 0... | ALGO | 0.999817 | 4.970491 |
7b4a181d-bfc7-422d-b930-f5331816127d | macrobomastercontrolteam/Infantry_WheeledBiped | eigen-3.4.0/doc/snippets/SelfAdjointEigenSolver_SelfAdjointEigenSolver_MatrixType.cpp | MatrixXd X = MatrixXd::Random(5,5);
MatrixXd A = X + X.transpose();
cout << "Here is a random symmetric 5x5 matrix, A:" << endl << A << endl << endl;
SelfAdjointEigenSolver<MatrixXd> es(A);
cout << "The eigenvalues of A are:" << endl << es.eigenvalues() << endl;
cout << "The matrix of eigenvectors, V, is:" << endl << ... | ALGO | 0.999664 | 3.056724 |
d0f7341b-a523-4d55-908e-853f59d52943 | Shaykat/Data-Structure | selection sort().cpp | #include<iostream>
using namespace std;
int list[20];
void Selection_Sort (int n)
{
int min, min_index, i;
//select the location and find the minimum value
for (int select = 0; select < n-1; select++) // discard last index
{
min = list [select ];
min_index = select;
for ( i= select+1; i < n ; i++) //s... | ALGO | 0.999901 | 3.810094 |
0238c93e-aec0-49e0-98f6-582c473aa502 | facundosander/C | tarea2/src/jugadoresLDE.cpp | #include "../include/jugadoresLDE.h"
typedef struct rep_jugadoresNodo *TJugadoresNodo;
struct rep_jugadoresNodo {
TJugador jugador;
TFecha fecha;
rep_jugadoresNodo * sig;
rep_jugadoresNodo * prev;
};
struct rep_jugadoresLDE {
rep_jugadoresNodo * ini;
rep_jugadoresNodo * fin;
nat cantidad;
... | ALGO | 0.994148 | 4.329199 |
7feae67e-b629-4ddf-9ef4-86da7305d8d9 | ja-errorpro/problems | C_CPP/CodeForce/1555C.cpp | /*
I_suck_at_programming.
*/
#include<bits/stdc++.h>
using namespace std;
#define endl '\n'
#define ll long long
#define IO ios_base::sync_with_stdio(0); cin.tie(0);
#define GETOUT cout.tie(0);
#define cls cin.sync();
#define afsdf_djfkssdfa sjdajawdjsjkghuoiwkjdksdfsdf_m
#define cendl cout << endl;
#define fr(n,l) f... | ALGO | 0.999982 | 3.889583 |
dcbeaaa7-c554-4650-9c3b-e33b45e9e238 | ishandutta2007/codeforces | joyfun/normal/668/B.cpp | #include <cstdio>
#include <cstring>
#include <algorithm>
using namespace std;
const int N = 1000005;
int n, q;
int ans[N], cao[N];
int main() {
scanf("%d%d", &n, &q);
int tp, x;
int tot = 0;
int sb = 0;
int f = 0;
while (q--) {
scanf("%d", &tp);
if (tp == 1) {
sca... | ALGO | 0.999977 | 3.488974 |
af9710ae-6b32-4328-aa51-b5878bf6a15f | nithyasarathim/TECHDOSE_TRAINING | Math/Assignment/LC866.cpp | // Problem: Prime Palindrome (LeetCode 866)
class Solution {
public:
bool isPrime(int n){
if(n<2) return false;
if(n%2==0) return false;
for(int j=3;j*j<=n;j++){
if(n%j==0){
return false;
}
}
return true;
}
bool isPalin... | ALGO | 0.999804 | 6.550478 |
84d992ec-f781-44ff-9b9f-3c0bc2affae6 | HONGDUCK/SHA3-with-FHE | src/pke/extras/bfv-mult-bug.cpp | /*
Simple example for BFVrns (integer arithmetic)
*/
#include "openfhe.h"
using namespace lbcrypto;
void EvalNoiseBFV(PrivateKey<DCRTPoly> privateKey, ConstCiphertext<DCRTPoly> ciphertext, Plaintext ptxt, usint ptm,
double& noise, double& logQ);
int main() {
CCParams<CryptoContextBFVRNS> pa... | ALGO | 0.994302 | 5.271576 |
60491852-4dfc-4704-9585-9aef63e4b253 | bravesnow/LeetCodeOJ | source_files/Remove Element.cpp | #include <iostream>
using namespace std;
int removeElement(int A[], int n, int elem) {
//DZȽϣһ鼴
int index = 0;
for (int i = 0; i < n; ++i){
if (A[i] != elem){
A[index++] = A[i];
}
}
return index;
}
int main(int argc, char *argv[])
{
int a[] = {3, 8, 3, 2, 9};
cout<<removeElement(a, 5,... | ALGO | 0.999683 | 4.893076 |
7b631863-2dae-42bb-b681-0bdc766c8bf3 | sameergupta01/Algos-2 | string_man.cpp | #include <vector>
#include <list>
#include <map>
#include <set>
#include <queue>
#include <deque>
#include <stack>
#include <bitset>
#include <algorithm>
#include <functional>
#include <numeric>
#include <utility>
#include <sstream>
#include <iostream>
#include <iomanip>
#include <cstdio>
#include <cmath>
#include <cst... | ALGO | 0.999817 | 4.139651 |
81e037f0-3c96-457d-b93e-0e29f4c2fbf0 | murilogontijo/URI-accepted-solutions | Uri 2635.cpp | #include<bits/stdc++.h>
using namespace std;
int main()
{
freopen("in.txt","r",stdin);
int n,q;
string text;
while(cin >> n){
vector<string>data;
for(int i = 0; i < n ; i++){
cin >> text;
data.push_back(text);
}
cin >> q;
while(q--){
... | ALGO | 0.998078 | 3.605532 |
7c287543-f4af-40c6-82b0-852c003f8004 | Max-Gieseke/Checkers | src/CheckerBoard.cpp | //
// Created by maxgi on 10/31/2023.
//
#include "../include/CheckerBoard.h"
CheckerBoard::CheckerBoard() {
whiteKings = 0;
blackKings = 0;
whitePieces = 0;
whitePieces = whitePieces | 0xFFF << 20;
blackPieces = 0;
blackPieces = blackPieces | 0xFFF;
currentPlayer = 1; //black starts
}
s... | ALGO | 0.996708 | 4.850558 |
c2a82536-3358-40ec-9b0a-49b4f3b12769 | upple/BOJ | src/16000/16946.cpp17.cpp | #include <bits/stdc++.h>
using namespace std;
struct xy{int x, y;};
const int dx[]={0, 0, 1, -1};
const int dy[]={1, -1, 0, 0};
char arr[1002][1002];
int v[1002][1002];
int s[1000000];
int c;
void bfs(int x, int y)
{
c++;
queue<xy> Q;
v[x][y]=c;
int size=0;
Q.push({x, y});
while(Q.size())
{
x=Q.front().x, y=... | ALGO | 0.999689 | 4.227369 |
53e892c5-021f-4df6-afb9-558f3845d766 | AtharvaMahamuni/Cpp | 450_LoveBabbarQuestions/Array/05_move_neg_no.cpp | #include <iostream>
using namespace std;
int main()
{
int array[] = {-12, 11, -13, -5, 6, -7, 5, -3, -6};
int no = 0;
int arraySize = sizeof(array) / sizeof(array[0]);
for (int i : array)
{
cout << i << " ";
}
cout << endl;
for (int i = 0; i < arraySize; i++)
{
if ... | ALGO | 0.999957 | 4.308482 |
261e81ee-08c3-4dbd-a169-05610eaac1b4 | Mulab11/cntt2016-hw1 | TC-SRM-551-div1-250/cjy.cpp | #include<bits/stdc++.h>
using namespace std;
int i,j,k,s,t,p,q,r,n;
class ColorfulChocolates//枚举
{
public:
int maximumSpread(string c,int m)
{
for(n=c.size();i<n;i++)for(s=0,j=p=i;~j&&s<=m;j--)
{
if(c[i]==c[j])s+=p-j,p--;
for(t=s,k=q=i;k<n&&t<=m;k++)if(c[i]==c[k])if(t+=k-q,q++,t<=m)r=max(r,q-p-1);
... | ALGO | 0.999802 | 4.189441 |
b3db8536-d661-45ad-9c94-d3daab47d732 | Fy5tew/Labs-1-1 | ОАиП/лр9/LR9/LR9_5_2/main.cpp | #include <iostream>
using namespace std;
double f(double x) {
return pow(x, 3) - 1;
}
int main() {
double a = 0, b = 3, n = 200;
double h, x, s1, s2, s;
h = (b - a) / (2 * n);
x = a + 2 * h;
s1 = s2 = 0;
for (int i = 1; i < n; i++) {
s2 += f(x);
x += h;
s1 += f(x);
x += h;
}
s = (h / 3) * (f(a) + ... | ALGO | 0.99991 | 4.481859 |
9d625bad-9140-4641-921d-85af24b50b14 | xconfigurator/test_20200428_c_cpp | 04_OJ/pat_advanced_level/1028.cpp | /*
@author liuyang
@since 2021/2/20
PAT 1028
List Sorting
https://pintia.cn/problem-sets/994805342720868352/problems/994805468327690240
参考视频:
https://www.bilibili.com/video/BV1Ty4y1n7JH?p=7&spm_id_from=pageDriver
22:35
Sample Input 1:
3 1
000007 James 85
000010 Amy 90
000001 Zoe 60
Sample Output 1:
000001 Zoe 60
00... | ALGO | 0.997924 | 4.764352 |
72b1faa9-bf8f-488c-a451-29cf504bf70e | yurychu/cpp_coding | nine/external.cpp | // внешние переменные
#include <iostream>
using namespace std;
// внешнаяя переменная
double warming = 0.3;
// прототипы функций
void update(double dt);
void local();
int main(){
cout << "Глобалоное потепление - " << warming << " градуса.\n";
update(0.1); // вызов функции, изменяющий переменную warming
cout << ... | TOOL | 0.855423 | 3.283519 |
37a987ca-ee4e-4c65-97b9-01b0d5a33307 | MUYANGGUO/PA3 | Submission/jacobi.cpp | /**
* @file jacobi.cpp
* @author Patrick Flick <<EMAIL>>
* @brief Implements matrix vector multiplication and Jacobi's method.
*
* Copyright (c) 2014 Georgia Institute of Technology. All Rights Reserved.
*/
#include "jacobi.h"
/*
* TODO: Implement your solutions here
*/
// my implementation:
#include <i... | ALGO | 0.99996 | 6.627547 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.