uuid string | repo_name string | relative_path string | content string | category string | algo_rel_score float64 | quality_score float64 |
|---|---|---|---|---|---|---|
5c949577-3464-43e6-a2d2-05bfc659eb95 | krutibaraiya/Codeforces | vanyabooks.cpp | #include <bits/stdc++.h>
using namespace std;
#define IOS ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);
#define endl "\n"
#define int long long
const int N = 1e5 + 5;
int32_t main()
{
IOS;
int n,d=0;
cin >> n;
for(int i=9; n>0; i*=10)
{
d=d+n;
n=n-i;
}
cout << d << endl;
r... | ALGO | 0.99962 | 3.596556 |
209a3de1-cb46-4de0-b1f2-ac86aa99ed13 | YashKumarVerma/CBSE-Computer-Science | Class 11/prime-till-n.CPP | // print prime till n
#include<iostream>
using namespace std;
int main ()
{
// clear the screen
system("cls");
// declare variable
int a;
// get input
cout << "Enter a number" << endl;
cin >> a;
int i,j,f;
for(int i=2; i<201; i++){
f=0;
for(int j=2; j<i; j++){
if(i%j==0){
f=1;
}
}
if(f <... | ALGO | 0.998958 | 3.527611 |
4663a10c-0375-4143-9493-dd2fd0b9ad48 | JulioIbMo/Ejercicios-Propuestos-C-Programacion-I-UAJMS | 22 23 Arreglos Bidimensionales Matrices/6.cpp | #include <iostream>
using namespace std;
int main (){
//GENERAR MATRIZ n*n DE DODS DIGITOS RANDOM
int n;
cin>>n;
int matriz[n][n];
srand(time(NULL));
for (int i = 0; i < n; ++i)
{
for (int j = 0; j < n; ++j)
{
matriz[i][j] = 10 + (rand()%89);
}
}
for (i... | ALGO | 0.997471 | 3.596008 |
5ee77f19-3995-4a93-8a21-e569c6bbf606 | antoine-chan-lock/PolarInterpolants | CommonLibraries/libigl/include/igl/count.cpp | template <typename XType, typename SType>
IGL_INLINE void igl::count(
const Eigen::SparseMatrix<XType>& X,
const int dim,
Eigen::SparseVector<SType>& S)
{
// dim must be 2 or 1
assert(dim == 1 || dim == 2);
// Get size of input
int m = X.rows();
int n = X.cols();
// resize output
if(dim==1)
{
... | ALGO | 0.994198 | 5.298262 |
00a80ef7-97b1-4205-a568-fb0669200e45 | rupali199999/Leetcode | 3227-find-missing-and-repeated-values/find-missing-and-repeated-values.cpp | class Solution {
public:
vector<int> findMissingAndRepeatedValues(vector<vector<int>>& grid) {
vector<int> ans(2,0);
int n=grid.size();
vector<int> g(n*n,0);
for(int i=0;i<n;i++){
for(int j=0;j<n;j++){
g[grid[i][j]-1]++;
if(g[grid[i][j]-1]>... | ALGO | 0.9998 | 5.741616 |
e6b500a0-86a6-4027-b72d-82695143b6d4 | fmorenovr/ComputerScience_UCSP | MCC203-Computacion_Grafica/Trabajo_2_Fast-Winding-Numbers/fast-winding-number-soups/libigl/include/igl/frame_field_deformer.cpp | #include <Eigen/Dense>
#include <Eigen/Sparse>
#include <vector>
#include <igl/cotmatrix_entries.h>
#include <igl/cotmatrix.h>
#include <igl/vertex_triangle_adjacency.h>
namespace igl
{
class Frame_field_deformer
{
public:
IGL_INLINE Frame_field_deformer();
IGL_INLINE ~Frame_field_deformer();
// Initialize t... | ALGO | 0.999778 | 5.844829 |
1e94c331-7f55-4f99-8672-72354d41350c | ML-UCV/ML-CodeBert-DistinctSolutions | Raw Dataset/cmmdc/Euclid-impartiri/train/1ce0f86c-137d-11eb-8e00-309c234925a0.cpp | #include <fstream>
using namespace std;
ifstream in("cmmdc.in");
ofstream out("cmmdc.out");
int main(){
long long a,b;
in >> a >> b;
while (b != 0)
{
int rest = a % b;
a = b;
b = rest;
}
if(a==1)
out << 0;
else
out << a;
return 0;
... | ALGO | 0.999939 | 4.091035 |
523d3e08-cc59-43cb-9451-0c9988321cc6 | jharkawat/cp-codes | algozenith/7_8_week/B_frog2.cpp | #include<bits/stdc++.h>
using namespace std;
using ll = long long;
#define IOS ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);
/*
conditions
*/
ll dp[100100];
ll arr[100100];
ll n,k;
ll rec(ll level)
{
// for(ll i=0;i<n;i++)
// {
// cout << dp[i] ;
// }
// cout << "\n";
if(level == n-... | ALGO | 0.999974 | 4.270403 |
f602e6dc-964c-4114-8456-a16e564a39c7 | yoloeww/StrongNote | 1.2.重复字符.cpp | # include<iostream>
using namespace std;
int main()
{
string str1;
string str2;
string ret;
getline(cin,str1);
getline(cin,str2);
int hashtable[256] = {0};
for(int i = 0;i < str2.size();i++)
{
hashtable[str2[i]]++;
}
for(int i = 0;i < str1.size();i++)
{
if(has... | ALGO | 0.999917 | 3.725163 |
123ba61a-b63e-498d-b5d4-890a0c0e1da9 | dotos-next/android_frameworks_av | media/libstagefright/codecs/amrnb/enc/src/enc_lag6.cpp | /*
------------------------------------------------------------------------------
Pathname: ./audio/gsm-amr/c/src/enc_lag6.c
Functions:
Date: 02/05/2002
------------------------------------------------------------------------------
REVISION HISTORY
Description: Updated template used to PV coding template.
... | ALGO | 0.998972 | 7.382874 |
91c38edd-37e5-48eb-9001-1132952e6f8d | tomoakiii/atcoder2 | Archive/abc219/b.cpp | #include <atcoder/all>
#include <bits/stdc++.h>
using namespace std;
using namespace atcoder;
#define rep(i,n) for (ll i = 0; i < (n); ++i)
template<typename T> inline bool chmax(T &a, T b) { return ((a < b) ? (a = b, true) : (false)); }
template<typename T> inline bool chmin(T &a, T b) { return ((a > b) ? (a = b, true... | ALGO | 0.999933 | 3.819786 |
2e4deac1-5ea7-4315-9036-3be0bc4d7b7f | SWEG-2016EC-Batch/Socrates | ETS1263_Selman_Awel/hallow pyramid.cpp | #include <iostream>
using namespace std;
int main() {
int height;
cout << "Enter the height of the pyramid: ";
cin >> height;
for (int i = 1; i <= height; i++) {
for (int j = i; j < height; j++) {
cout << " ";
}
for (int j = 1; j <= (2 * i - 1); j++) {
i... | ALGO | 0.998994 | 5.158943 |
e87b7ccb-33c4-4b6f-a8e6-29f0774aede4 | farrokh03/algorithm | LargestArea.cpp | #include <iostream>
#include <stack>
// time complexity = O(n)
using namespace std;
int largestRectangleArea(int Array[], int size) {
stack<int> stack;
int maxArea = 0;
int Index = 0;
while (Index < size) {
if (stack.empty() || Array[Index] >= Array[stack.top()]) {
stack.... | ALGO | 0.999961 | 6.989058 |
87996bb2-5df0-4e46-8b5d-6d4974aad62d | imulan/procon | aoj/vol2/0210.cpp | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define rep(i,n) for(int (i)=0;(i)<(int)(n);++(i))
#define each(itr,c) for(__typeof(c.begin()) itr=c.begin(); itr!=c.end(); ++itr)
#define all(x) (x).begin(),(x).end()
#define pb push_back
#define fi first
#define se second
struct person
{
int x,... | ALGO | 0.999834 | 4.076512 |
f11025ce-eab6-4de9-aca9-91e52aaed735 | TeaPavlovic/KiAA | vezbe/stabla/dsu.cpp | //Union-find
#include <iostream>
#include <vector>
using namespace std;
vector<int> roditelj;
vector<int> rang;
void napraviDsu(int n) {
roditelj.resize(n);
rang.resize(n, 1); //stavi svuda rang 1
for(int i=0; i<n; i++)
roditelj[i] = i;
}
int predstavnik(int a) {
int t = a;
while(roditel... | ALGO | 0.99989 | 4.812227 |
60d969b4-4afe-4bcb-8a33-fd02eded04e5 | adafcaefc/Geome3Dash | Geome3Dash/src/helper/Easing.cpp | #include "Easing.h"
namespace g3d
{
namespace ease
{
// Method implementations for InOutQuad
double InOutQuad::calculate(double t, double b, double c, double d) const {
t /= d / 2;
if (t < 1) return c / 2 * t * t + b;
t--;
return -c / 2 * (t * (t ... | ALGO | 0.980143 | 4.684031 |
8ec1c6b5-8520-4af5-8832-01c2f0c09d3f | vitorguidi/Competitive-Programming | judges/spoj/cartog11.cpp | #include "bits/stdc++.h"
using namespace std;
#define pb push_back
#define mp make_pair
#define fst first
#define snd second
#define fr(i,n) for(int i=0;i<n;i++)
#define frr(i,n) for(int i=1;i<=n;i++)
#define ms(x,i) memset(x,i,sizeof(x))
#define dbg(x) cout << #x << " = " << x << endl
#define pq priority_queue
#de... | ALGO | 0.997452 | 3.960313 |
f2961f8c-ab5d-4d4c-81e2-74f4efa425d6 | StanfordPLArchSec/pincpu-gem5 | src/systemc/tests/systemc/misc/stars/star103832/star103832.cpp | /*****************************************************************************
star103832.cpp --
Original Author: Martin Janssen, Synopsys, Inc., 2002-02-15
*****************************************************************************/
/*************************************************************************... | TEST | 0.851188 | 5.709166 |
2d5bc76d-73fe-42f0-a12f-9d8c2edd27e7 | alexandraback/datacollection | solutions_5751500831719424_0/C++/AlexBovk/Main.cpp | #include <algorithm>
#include <cmath>
#include <fstream>
#include <iomanip>
#include <iostream>
#include <limits>
#include <map>
#include <queue>
#include <set>
#include <stack>
#include <string>
#include <vector>
void Solve(std::ifstream& input,std::ofstream& output) {
std::size_t N;
input>>N;
std::vector... | ALGO | 0.999778 | 4.757758 |
84a819b4-b4df-4be6-a593-63f97fa5dc86 | STARFALL088/CP | AtCoder/abc264_d.cpp | #pragma GCC optimize("Ofast,unroll-loops,no-stack-protector,fast-math")
#include <bits/stdc++.h>
using namespace std;
namespace io
{
template <typename T1, typename T2>
ostream &operator<<(ostream &os, const pair<T1, T2> &p) { return os << p.first << " " << p.second; }
template <typename T>
ostream &ope... | ALGO | 0.999877 | 4.904291 |
5a1dd11f-43c6-49d4-9391-7a0807049367 | MarceloMenegheti/CPlusPlus | aulaUdemyShell_Sort.cpp | #include <iostream>
#include <stdlib.h>
#include <string>
#define TAM 10
using namespace std;
void imprimir_vetor(int vetor[TAM]){
cout<<"\n";
for(int i = 0; i < TAM; i++){
cout<<" |"<<vetor[i] <<"| ";
}
}
void shell_Sort(int vetor[TAM]){
int i, j, atual;
int h = 1;
//De quantos em q... | ALGO | 0.999848 | 4.582452 |
09882fba-52b6-4fad-b266-b514fa5514e7 | saif-gitreps/Algorithms | Two-Pointer/String-Compression.cpp | class Solution {
public:
int compress(vector<char>& chars) {
vector<char> temp;
for (int i = 0; i < chars.size(); i++) {
int ptr = i;
int char_count = 1;
while (i + 1 < chars.size() && chars[i] == chars[i + 1]) {
i++;
char_count++;
... | ALGO | 0.999977 | 6.535765 |
f2ff84ba-4468-4392-b640-4dd30048d516 | gursimran0410/Data-Structures-Algorithms | Strings/Maximum Number of Words Found in Sentences.cpp | class Solution {
public:
int mostWordsFound(vector<string>& sentences) {
int res=0;
for(auto i:sentences)
res=max(res,(int)count(i.begin(),i.end(),' ')+1);
return res;
}
};
| ALGO | 0.999783 | 5.729977 |
7212cc2e-1fb7-41f2-a7c1-f942daf777de | FahidShadmanKarim/LeetCode | Graph/floodfill.cpp | class Solution {
bool visited[51][51];
int dx[4] = {0,1,0,-1};
int dy[4] = {1,0,-1,0};
public:
void dfs( vector<vector<int>>& image, int x , int y ,int row,int column, int c , int col){
if(x<0 || x>=row || y<0 || y >=column || visited[x][y]){
return;
}
else if(im... | ALGO | 0.999856 | 6.223539 |
c1baf800-7a74-4c9c-876b-815612ce4c9e | ishandutta2007/codeforces | autumnkite/normal/1540/A.cpp | #include <bits/stdc++.h>
void solve() {
int n;
std::cin >> n;
std::vector<int> d(n);
for (int &x : d) {
std::cin >> x;
}
std::sort(d.begin(), d.end());
long long ans = d.back();
long long sum = 0;
for (int i = 0; i < n; ++i) {
ans += sum - 1ll * i * d[i];
sum += d[i];
}
std::cout << ans << "\n";
}
in... | ALGO | 0.999938 | 4.998976 |
05b8dca1-7123-44cc-b167-7439b43dc8ac | aicdy/lab2 | 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.99874 | 6.767714 |
da9e6d20-db66-4d29-a337-d2b4e3f86fa6 | NitroRonak/Blind-75 | Tree/Build_binaryTree_from_PreOrder_IndOrder.cpp | #include<bits/stdc++.h>
using namespace std;
class Node{
public:
int data;
Node *left, *right;
Node(int data){
this->data = data;
this->left = NULL;
this->right = NULL;
}
};
//Construct binary tree from preorder and inorder
Node *solve(vector<int>& pre, vector<int>& in,int... | ALGO | 0.999983 | 5.179314 |
a6074fdf-57e7-4e31-8dd3-d402d1c958c8 | iarnabhazra/Competitive-Coding | Hacker Earth/Algorithm/Searching/Linear Search/leastNumber.cpp | /* Find Smallest Number Reapted exactly K number of times. */
#include<iostream>
using namespace std;
int main(){
int n;
cin >> n;
int *arr;
arr = new int[n];
int k;
cin >> k;
//taking inputs in the array
for (int i=0; i<n; i++){
cin >> arr[i];
}
//sorting the... | ALGO | 0.999997 | 3.729769 |
bf435978-4ce6-4d12-aff3-73171ceb5dac | MostafaMohamed2001/C-Data-Structure | .history/hello_20240701184229.cpp | #include <iostream>
#include <cmath>
using namespace std;
int main()
{
int n,k;
cin >> n>>k;
int arr[n];
for (int i = 0; i < n; i++){
cin >> arr[i];
}
cout << endl;
sort(arr, arr + n);
for (int i = 0; i < k; i++)
{
for (int j = i; j < n && j < i + 3; j++)
... | ALGO | 0.999903 | 3.211865 |
25011e69-df09-4781-b61a-bd3c1093696e | ShimChang/baekjoon | 1309.cpp | #include<iostream>
using namespace std;
int d[100001][3];
int main(){
int n;
cin>>n;
d[0][0]=1;
for(int i=1;i<=n;i++){
d[i][0]+=(d[i-1][0]+d[i-1][1]+d[i-1][2]);
d[i][1]+=(d[i-1][0]+d[i-1][2]);
d[i][2]+=(d[i-1][0]+d[i-1][1]);
for(int j=0;j<3;j++){
... | ALGO | 0.99993 | 3.897991 |
2078a1ca-acb6-43fc-bd66-244e628d15c4 | ishandutta2007/codeforces | emiso/normal/1558/B.cpp | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#ifdef EBUG
#include "trace.h"
#else
template<typename... Args> void trace(Args... args) {}
template<typename... Args> void recInit(Args... args) {}
template<typename... Args> void recEnd(Args... args) {}
#define trace2(args...) trace(args)
#endif
#... | ALGO | 0.999943 | 4.079467 |
7c75919f-40a1-4621-acfe-56726c7be0e2 | sahilhirdhani/leetcode | 2334-number-of-flowers-in-full-bloom/2334-number-of-flowers-in-full-bloom.cpp | class Solution {
public:
vector<int> fullBloomFlowers(vector<vector<int>>& flowers, vector<int>& people) {
map<int, int> flowerCount;
for (const auto& flower : flowers) {
flowerCount[flower[0]]++;
flowerCount[flower[1] + 1]--;
}
vector<int> days;
for... | ALGO | 0.999977 | 6.143086 |
b255d9af-0945-4898-97da-b19cc1bad425 | XuanLongNg/Data-Structure-and-Algorithms | Practice/di chuyen trong ma tran .cpp | /*
Cho ma trận A[M][N]. Nhiệm vụ của bạn là đếm tất cả các đường đi từ phần tử A[0][0] đến phần tử A[M-1][N-1]. Bạn chỉ được phép dịch chuyển xuống dưới hoặc sang phải phần tử liền kề với vị trí hiện tại.
Input:
Dòng đầu tiên đưa vào số lượng bộ test T.
Những dòng kế tiếp đưa vào các bộ test. Mỗi bộ test gồm hai phần... | ALGO | 0.999839 | 4.482128 |
69994c70-7ae5-4b43-89ab-a2053172e4d1 | NUWACOIN/Nuwa | src/bloom.cpp | #include "bloom.h"
#include "chainparams.h"
#include "hash.h"
#include "primitives/transaction.h"
#include "script/script.h"
#include "script/standard.h"
#include "random.h"
#include "streams.h"
#include <math.h>
#include <stdlib.h>
#define LN2SQUARED 0.4804530139182014246671025263266649717305529515945455
#define LN... | ALGO | 0.960792 | 7.133807 |
6b7df98c-7d3a-400c-b5db-7310332e877f | Chan531/BaekJoon_Online_Judge | 너구리구구.cpp | #include <iostream>
#include <vector>
#include <algorithm>
#include <queue>
#define p pair<int, long long>
#define N 5001
using namespace std;
int n;
long long ans;
vector<p> path[N];
bool visited[N];
void input()
{
cin >> n;
for (int i = 1; i < n; i++)
{
int a, b, c;
cin >> a >> b >> c;
path[a].push_back... | ALGO | 0.999859 | 4.312979 |
7e62e8bd-317d-44ea-8925-e7b17cf249c2 | ishandutta2007/codeforces | fuppy/normal/1487/C.cpp | //*
#pragma GCC target("avx2")
#pragma GCC optimize("O3")
#pragma GCC optimize("unroll-loops")
//*/
#include <bits/stdc++.h>
// #include <atcoder/all>
using namespace std;
// using namespace atcoder;
#define DEBUG(x) cerr<<#x<<": "<<x<<endl;
#define DEBUG_VEC(v) cerr<<#v<<":";for(int i=0;i<v.size();i++) cerr<<"... | ALGO | 0.999922 | 4.390164 |
ba0822ce-3b97-4af6-ba2d-3cec882d9429 | ml-inory/melotts.axcl | 3rdparty/librosa/eigen3/doc/examples/make_circulant2.cpp | #include <Eigen/Core>
#include <iostream>
using namespace Eigen;
// [circulant_func]
template<class ArgType>
class circulant_functor {
const ArgType &m_vec;
public:
circulant_functor(const ArgType& arg) : m_vec(arg) {}
const typename ArgType::Scalar& operator() (Index row, Index col) const {
Index index = ... | ALGO | 0.99967 | 5.538595 |
03fa5599-abeb-43a9-823e-93da5cb47bb1 | kusum-bhattarai/Tic-Tac-Toe | GameState.cpp | // File Name: GameState.cpp
//
// Author: Kusum Bhattarai Sharma
// Date: 04/29/2024
// Assignment Number: 4
// Instructor: Xiaomin Li
//
// GameState represents the current state of a tic tac toe game that allows
// players to undo the most recent of their opponents moves.
// It maintains the current game board and a ... | ALGO | 0.992462 | 6.845077 |
6164a009-ed98-4179-a255-236accb4d2da | Armando437121/OrnelasArmado_CIS5_SUMMER2016 | LAB/Gaddis_8thEd_Chap3_Prob19_LoanPayments/main.cpp | /*
* File: main.cpp
* Author: Armando Ornelas
* Created on June 27, 2016, 1:30 PM
* Purpose: Equal Monthly Loan Payments
*/
//System Libraries
#include <iostream> //Input/Output Library
#include <iomanip> //Format Library
#include <cmath> //Math Library
using namespace std; //Namespace of the System Li... | ALGO | 0.989471 | 3.673631 |
7ed4757f-a9f3-4aa2-99d9-948f289ee102 | priyal-gopawat/DSA | WarmUp/P9.cpp | //WAP to print all natural numbers from 1-n using while loop
#include<bits/stdc++.h>
using namespace std;
int main() {
int i,n;
printf("print all natural no. from 1 to:");
scanf("%d",&n);
i=1;
while(i<=n)
{
printf("%d\n",i);
i++;
}
return 0;
}
| ALGO | 0.889827 | 3.291092 |
a1aa7a5f-65e0-4872-a6e3-c19361156e17 | davidzwei/GPE | 21964-Fill the Containers.cpp | #include <bits/stdc++.h>
using namespace std;
int main(){
int n, m; // n milk divides to m container
while(cin >> n >> m){
vector<int> vessel(n);
for(int i = 0; i<n; i++)
cin >> vessel[i];
int Max = *max_element(vessel.begin(), vessel.end());
int sum = accumulate(ve... | ALGO | 0.99999 | 4.011002 |
18fedf60-f0dd-49f3-a32f-de1c4e67813f | throx/advent2024 | day15/day15.cpp | #include <stdint.h>
#include <iostream>
#include <string>
#include <regex>
#include <numeric>
#include "../shared/Point.h"
#include "../shared/Rect.h"
#ifdef _WIN32
#include <conio.h>
#else
static inline void _getch() {}
#endif
using namespace std;
const regex INPUT_R("(\\d+) (\\d+)");
void dump2(const set<Point2... | ALGO | 0.998872 | 5.201847 |
1256e89b-e500-4a7e-8a9c-350b582afe67 | raincross7/code-similarity | codes/train_code/problem036/problem036_156.cpp | #include <bits/stdc++.h>
using namespace std;
#include <math.h>
#include <iomanip>
int main() {
int n;
cin>>n;
vector<int>a(n);
deque<int>k;
for(int i=0;i<n;i++){
cin>>a[i];
if(i%2==0){k.push_back(a[i]);}
else{k.push_front(a[i]);}
}
if(n%2!=0){reverse(k.begin(),k.end());}
for(int i=0;i<n;i+... | ALGO | 0.999951 | 4.120041 |
1cb2705c-8081-4725-9b5f-fe5420d830a9 | ashavijit/DailyDsa | daily/missingnum.cpp | #include<bits/stdc++.h>
using namespace std;
#define do_not_sync ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL);
#define speedup { \
do_not_sync \
cin.exceptions(cin.failbit); \
}
class Solution
{
public:
int findDuplicate(vector<int> &nums)
{
unordered_set<int> s;
for... | ALGO | 0.99988 | 4.788854 |
094bc255-c522-4130-8e65-16e5e096e1d2 | ishandutta2007/codeforces | cerberus97/normal/845/B.cpp | /*
Cerberus97
Hanit Banga
*/
#include <iostream>
#include <iomanip>
#include <cmath>
#include <cstdio>
#include <cstring>
#include <cstdlib>
#include <map>
#include <set>
#include <queue>
#include <stack>
#include <vector>
#include <algorithm>
using namespace std;
#define pb push_back
#define fast_cin() ios_base::sy... | ALGO | 0.999435 | 3.515217 |
8c713868-b1db-45a4-b515-34665f255851 | sarvex/leetcode-boo | solution/2200-2299/2243.Calculate Digit Sum of a String/Solution.cpp | class Solution {
public:
string digitSum(string s, int k) {
while (s.size() > k) {
string t;
int n = s.size();
for (int i = 0; i < n; i += k) {
int x = 0;
for (int j = i; j < min(i + k, n); ++j) {
x += s[j] - '0';
... | ALGO | 0.99998 | 6.340856 |
4bfb2cbf-732c-475c-a0fd-2baccfb4aed5 | ishandutta2007/codeforces | peterr/normal/1618/G.cpp | #include <bits/stdc++.h>
using namespace std;
const int MAXN = 2E5;
int par[2 * MAXN];
int sz[2 * MAXN];
long long query_ans[MAXN];
list<int> small[2 * MAXN];
list<int> big[2 * MAXN];
long long smallsum[2 * MAXN];
long long bigsum[2 * MAXN];
long long ans = 0;
int getRoot(int x)
{
if (par[x] != x)
par[x] = getRo... | ALGO | 0.999841 | 3.732238 |
ca68a941-1645-497a-8267-4f070bf55f6d | djshaji/neural-amp-modeler-lv2 | deps/NeuralAmpModelerCore/Dependencies/eigen/doc/examples/TutorialLinAlgSetThreshold.cpp | #include <iostream>
#include <Eigen/Dense>
int main()
{
Eigen::Matrix2d A;
A << 2, 1,
2, 0.9999999999;
Eigen::FullPivLU<Eigen::Matrix2d> lu(A);
std::cout << "By default, the rank of A is found to be " << lu.rank() << std::endl;
lu.setThreshold(1e-5);
std::cout << "With threshold 1e-5, the ran... | ALGO | 0.999854 | 4.377453 |
1882a8a3-4e37-4f8d-9188-f8f371223a45 | Saaj-0809/EXP-20 | 20_2.cpp | //Name: Saaj Mulik
//Prn: 23070123109
//Class: EnTC B-2
#include<iostream>
using namespace std;
void insertionSort(int arr[], int n ){
for (int i = 1; i < n; i++){
int key=arr[i];
int j=i-1;
while (j>=0 && arr[j]>key){
arr[j+1]=arr[j];
j--;
}
arr[j+1]=... | ALGO | 0.999958 | 4.614324 |
b6f300cb-41df-4bae-a9f0-db0e1c4ba282 | kauschie/SOWCPP | ch3/program3-25.cpp | /* This program demonstrates random numbers */
#include <iostream>
#include <cstdlib> // for rand() and srand()
#include <ctime> // For the time function
using namespace std;
int main()
{
// Get the system time
unsigned seed = time(0);
// See the random number generator
srand(seed);
// Display three random num... | ALGO | 0.973305 | 4.042939 |
e3aa21ae-5f9d-4a04-a7b8-165e6ec14cfc | xupeiwust/nextfoam-cfd | ThirdParty-2405/sources/cgal/CGAL-4.14.3/examples/Ridges_3/Ridges_Umbilics_SM.cpp | #include <CGAL/Simple_cartesian.h>
#include <CGAL/Surface_mesh.h>
#include "PolyhedralSurf_rings.h"
#include "compute_normals.h"
#include <CGAL/Ridges.h>
#include <CGAL/Umbilics.h>
#include <CGAL/Monge_via_jet_fitting.h>
#include <fstream>
#include <cassert>
#if defined(CGAL_USE_BOOST_PROGRAM_OPTIONS) && ! defined(DON... | ALGO | 0.999229 | 6.54129 |
b92ae8b1-d620-40bb-b8c3-59f2274a3961 | revalo/pokerai | pai/third_party/ompeval/benchmark.cpp |
#include "omp/Random.h"
#include "omp/Hand.h"
#include "omp/HandEvaluator.h"
#include <iostream>
#include <chrono>
#include <vector>
#include <algorithm>
#if OMP_BENCHMARK_3RD_PARTY
// Include last because of all the badly named macros. I hate C programmers.
#include "evaluators/SKPokerEval/SevenEval.h"
#i... | ALGO | 0.984056 | 7.180152 |
f395ec24-d816-408c-8822-849bad17c899 | Anantadhirya/LeetCode | 0131-palindrome-partitioning/0131-palindrome-partitioning.cpp | class Solution {
public:
vector<vector<string>> partition(string s) {
ios_base::sync_with_stdio(false); cin.tie(0);
int n = s.size();
vector<vector<vector<string>>> ans(n);
string tmp;
bool palindrome;
for(int r = 0; r < n; r++) {
tmp = "";
for... | ALGO | 0.999985 | 6.266568 |
494f7caa-1723-4729-b110-2c824cbd0ae1 | jakshat2/Codeforces-Div.-2-A-Ladder-a2oj-Solutions | A_IQ_test.cpp | /***************************************************
************** Author:- Akshat *********************
****************************************************/
#include <bits/stdc++.h>
using namespace std;
#define in(ar, n) \
for (int i = 0; i < n; i++) \
cin >> ar[i]
#define in2d(ar, n, m) ... | ALGO | 0.999944 | 4.073854 |
060e2162-fb1f-457c-84db-12eb1c3ec4bb | drost-dev/ttit_flutter | 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 |
73b35ffb-045c-4ccc-ac61-1f4bc33e3c93 | fBeyer89/ADI_preproc | Project3_Hyp_DTI/Hyp/Staple/Eigen/install/doc/examples/TutorialLinAlgSelfAdjointEigenSolver.cpp | #include <iostream>
#include <Eigen/Dense>
using namespace std;
using namespace Eigen;
int main()
{
Matrix2f A;
A << 1, 2, 2, 3;
cout << "Here is the matrix A:\n" << A << endl;
SelfAdjointEigenSolver<Matrix2f> eigensolver(A);
if (eigensolver.info() != Success) abort();
cout << "The eigenvalues of A ... | ALGO | 0.999423 | 3.846247 |
68d11c94-5d82-48ae-aec4-350eb18e02d5 | marianaaferreira/univali | algoritmos I/reforço/i/main.cpp | #include <iostream>
#define TMAX 50
using namespace std;
int main(){
int v[TMAX];
for (int i=0; i<TMAX; i++){
v[i] = (i+5*i)%(i+1);
cout << v[i] << " ";
}
return 0;
}
| ALGO | 0.999497 | 3.013287 |
f61cf0bd-6bac-456d-81d1-a367e47b4200 | PaukIsUha/optimizing_formating_code | predictions/submissions-aizu-cot-gpt35/Codenet/p02391/234069043/response_2.cpp | #include <iostream>
int main() {
constexpr double pai = 3.141592653589;
int a, b;
std::cin >> a >> b;
std::cout << (a > b ? "a > b" : (a < b ? "a < b" : "a == b")) << std::endl;
return 0;
} | ALGO | 0.988061 | 4.382658 |
15ca2aa7-04c1-4b71-9a3a-cb056778718e | vincepandolfo/oii-training | cms.di.unipi.it/maree.cpp | #include <list>
#include <vector>
#include <queue>
#include <iostream>
using namespace std;
struct punto
{
list<int> toNext;
int time, time1, timeLeft;
punto(): time(1000000001), timeLeft(0), time1(1000000001) {}
};
void visita(vector<punto> &grafo, int T, int c)
{
queue<int> q;
q.push(c);
w... | ALGO | 0.999974 | 5.048036 |
31166f97-3034-4753-9d21-f713fb356abb | alexerat/HPCMinimizer | arprec/src/outx.cpp | #define _CRT_SECURE_NO_DEPRECATE
#include <arprec/mp_real.h>
#include <arprec/mp_complex.h>
#include "small_inline.h"
#include <cstdio>
using std::cerr;
using std::endl;
/* This routine is deprecated.
* Use more C++ friendly mp_real::to_string or mp_real::write. */
void mp_real::mpoutx(const mp_real& a, int la, ... | TOOL | 0.864413 | 4.16797 |
5e78ebd9-5e5c-4a95-88b0-7d32a78a06ae | anm336/LeetCode-Questions | Number of subsets with product less than k - GFG/number-of-subsets-with-product-less-than-k.cpp | //{ Driver Code Starts
#include <bits/stdc++.h>
using namespace std;
// } Driver Code Ends
//User function Template for C++
class Solution {
public:
int func(int i, int arr[], int prod, int N, int K, vector<vector<int>> &dp){
if(i==N){
if(prod<=K) return 1;
return 0;
}
... | ALGO | 0.999875 | 5.126668 |
6a156540-0847-455b-b8cd-93c68c086168 | emotionless/Programming-Problem-Solution | codeforces/249_B.cpp | #include <cstring>
#include <cassert>
#include <vector>
#include <list>
#include <queue>
#include <map>
#include <set>
#include <deque>
#include <stack>
#include <bitset>
#include <algorithm>
#include <functional>
#include <numeric>
#include <utility>
#include <sstream>
#include <iostream>
#include <iomanip>
#include <... | ALGO | 0.999995 | 3.690166 |
3b5b9b3d-0ea0-48b7-81d7-485f9bed6942 | porterlin/LeetCode | dynamic-programming/322v2.cpp | // 遞推
class Solution {
public:
int coinChange(vector<int>& coins, int amount) {
int n = coins.size();
vector<vector<int>> dp(n + 1, vector<int>(amount + 1, 1e9));
dp[0][0] = 0;
for (int i = 0; i < n; i++) {
for (int c = 0; c <= amount; c++) {
if (c < coins... | ALGO | 0.999949 | 5.709438 |
ea25f71b-7584-49fe-b6bf-9e6cb4fe462a | jinhan814/solutions | UCPC/ucpc22_k.cpp | #include <bits/stdc++.h>
using namespace std;
auto sol = [](int n, auto v) {
vector adj(1 << n | 1, vector(0, 0));
vector par(1 << n | 1, 0);
for (auto [a, b] : v) {
adj[a].push_back(b);
par[b] = a;
}
int x = -1, y = -1;
for (int i = 1; i <= 1 << n; i++) {
if (par[i]) continue;
if (x == -1) x = i;
else... | ALGO | 0.999888 | 4.381163 |
73653152-5b2e-48e6-bfd1-015e01321267 | f-zyj/ACM | 按 OJ 分类/51Nod/f-51Nod-1095-Anigram单词/f-51Nod-1095-Anigram单词/main.cpp | #include <iostream>
#include <algorithm>
#include <cstring>
#include <map>
using namespace std;
int main()
{
int n;
scanf("%d", &n);
map<string, int> mp_1, mp_2;
for (int i = 0; i < n; i++)
{
char s[11];
scanf("%s", s);
int len = (int)strlen(s);
// 原串存入
... | ALGO | 0.999975 | 3.920283 |
61c917ff-7411-40af-997c-6f70d09bdc4c | andyzhu23/Competitive-Programming | codeforces/div 2 + div 1/LATOKEN/A.cpp | /*
* Author: Andy Zhu
*/
//include
#include <bits/stdc++.h>
using namespace std;
// define
#define endl "\n"
#define l_b lower_bound
#define u_b upper_bound
#define ins insert
#define fir first
#define sec second
#define lc (rt << 1)
#define rc (rt << 1 | 1)
#define ep emplace_back
#define ef emplace_front
#define ... | ALGO | 0.999909 | 3.38184 |
d0428949-2496-4c40-89bb-16bc04e5140e | 4A6F6F6E61/LeetCode | test.cpp | #include "LeetCode.h"
using namespace lc;
int main()
{
Solution solution;
solution.strStr("hello", "ll");
return 0;
} | ALGO | 0.999524 | 4.278769 |
7d37a2b1-7f43-4cfc-a877-c0b0623f7db9 | notwatermango/cp-submissions | codeforces/1665/C.cpp | #include <bits/stdc++.h>
using namespace std;
typedef int64_t i64;
typedef int32_t i32;
i32 water = !not!iscntrl(isupper(isgraph(iscntrl(ispunct(isalpha(EOF))))));
#define mango(x)
#define fastmango cin.tie(nullptr)->sync_with_stdio(water)
#define precisemango(x) cout << fixed << setprecision(x)
#ifdef notwatermango
... | ALGO | 0.999816 | 4.039214 |
58359a47-39a7-4059-aaea-01b600da7076 | pedroestevaodev/data-structures | 1-bimestre/2023-08-28/exe-1/driver.cpp | #include "queue.h"
#include <iostream>
using namespace std;
Queue::Queue() {
count = 0;
tail = 0;
head = 1;
}
Queue::~Queue() {
cout << "Fila destruida!" << endl;
}
bool Queue::Full() {
return (count == MaxQueue);
}
bool Queue::Empty() {
return count == 0;
}
void Queue::Append(int x) {
... | TOOL | 0.870507 | 4.471936 |
f49f1f03-0e2c-4928-962d-c54957a01b8d | tgolubev/Poisson_eqn_solvers | Poisson_2D/C++/with_Eigen/Set_2DAV_diags.cpp | #include <iostream>
#include<vector>
#include "Set_2DAV_diags.h"
//far lower diagonal
std::vector<double> set_far_lower_Vdiag(Eigen::MatrixXd &epsilon, std::vector<double> &Farlower_diag){
for(int index = 1; index<= N*(N-1); index++){
int i = index % N;
if(i==0) i=N;
int j = 1+floor((index... | ALGO | 0.999416 | 3.616063 |
5c563113-27b3-416f-9287-de7f829d8731 | sarvex/leetcode-clojurescript | solution/0000-0099/0018.4Sum/Solution.cpp | class Solution {
public:
vector<vector<int>> fourSum(vector<int>& nums, int target) {
int n = nums.size();
if (n < 4) {
return {};
}
sort(nums.begin(), nums.end());
vector<vector<int>> res;
for (int i = 0; i < n - 3; ++i) {
if (i > 0 && nums[i]... | ALGO | 0.999984 | 6.384923 |
7f8ba768-2cfd-496b-bbe8-b9100086eef1 | Yousif-Elanany/Malahi-App | windows/runner/utils.cpp | #include "utils.h"
#include <flutter_windows.h>
#include <io.h>
#include <stdio.h>
#include <windows.h>
#include <iostream>
void CreateAndAttachConsole() {
if (::AllocConsole()) {
FILE *unused;
if (freopen_s(&unused, "CONOUT$", "w", stdout)) {
_dup2(_fileno(stdout), 1);
}
if (freopen_s(&unuse... | TOOL | 0.998733 | 6.76775 |
c43aabcd-7661-447a-9213-2d76cd1e8f5b | kushnayak/competitive-programming | C++/USACO/Silver/2016/Jan/angry.cpp | #include <bits/stdc++.h>
#define IO(f) cin.tie(0)->sync_with_stdio(0); if (fopen(f ".in", "r")) freopen(f ".in","r",stdin), freopen(f ".out","w",stdout)
#define forn(i,n) for(int i=0;i<n;i++)
#define for1(i,n) for(int i=1;i<=n;i++)
#define sz(v) int((v).size())
#define all(v) (v).begin(),(v).end()
#define nl '\n'
#d... | ALGO | 0.999949 | 4.509846 |
b6a2dc13-1b10-40db-b315-e3efad9bb8e9 | EMLS-ICTCAS/Aicas-2025 | llama.cpp/ggml/src/ggml-sycl/rope.cpp | #include "rope.hpp"
struct rope_corr_dims {
float v[2];
};
static float rope_yarn_ramp(const float low, const float high, const int i0) {
const float y = (i0 / 2 - low) / sycl::max(0.001f, high - low);
return 1.0f - sycl::min(1.0f, sycl::max(0.0f, y));
}
static void rope_yarn(
float theta_extrap, flo... | ALGO | 0.994447 | 7.236537 |
03cb82e9-e6a5-401a-8370-b6a959f683d5 | lmc5474/Algorithm-cpp | Class051/MaximumRunningTimeOfNComputers.cpp | #include "/Users/liaomeicheng/Desktop/Code/C++/LeetcodeHead.h"
using namespace std;
class Solution {
bool valid(int n, vector<int>& batteries, long long cur){
long long sum = 0;
for(int num : batteries){
if(num >= cur){
n--;
}else {
sum += num... | ALGO | 0.999812 | 5.488512 |
892957ef-4fd0-423f-8ca6-30459594d72d | rene-d/hackerrank | algorithms/dynamic-programming/dorsey-thief.cpp | // Algorithms > Dynamic Programming > Dorsey Thief
// standard knapsack problem
//
// https://www.hackerrank.com/challenges/dorsey-thief/problem
// https://www.hackerrank.com/contests/101nov13/challenges/dorsey-thief
//
#include <bits/stdc++.h>
using namespace std;
unsigned long knapSack(unsigned long W, const vector... | ALGO | 0.999991 | 5.302588 |
27686acb-26ea-4b6f-9b5f-74e8073e7c0f | cqnkxy/LeetCode-Cpp | Merge Two Sorted Lists.cpp | /*
Merge two sorted linked lists and return it as a new
list. The new list should be made by splicing
together the nodes of the first two lists.
*/
/**
* Definition for singly-linked list.
* struct ListNode {
* int val;
* ListNode *next;
* ListNode(int x) : val(x), next(NULL) {}
... | ALGO | 0.999937 | 5.95823 |
2e70f85e-914d-4350-85b6-f07e7ae6e82b | OpenSees/OpenSees | SRC/material/nD/eig3.cpp |
/* Eigen decomposition code for symmetric 3x3 matrices, copied from the public
domain Java Matrix library JAMA. */
#include <math.h>
#ifdef MAX
#undef MAX
#endif
#define MAX(a, b) ((a)>(b)?(a):(b))
#define n 3
static double hypot2(double x, double y) {
return sqrt(x*x+y*y);
}
// Symmetric Householder reduct... | ALGO | 0.999988 | 4.594481 |
062030a2-bb9a-491a-b5db-c6ec95a0a13d | sanjayvramani/web_firebase | 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 |
a008c83d-077e-4fda-9992-9f1b4687abea | ishandutta2007/codeforces | luhong/normal/1039/A.cpp | #include <cstdio>
#include <algorithm>
long long b[201000], a[201000], t; int x[201000];
int main()
{
int n; scanf("%d%lld", &n, &t);
for(int i = 1; i <= n; i++) scanf("%lld", &a[i]);
for(int i = 1; i <= n; i++)
{
scanf("%d", &x[i]);
if(x[i] < x[i - 1] || x[i] < i) return 0 * puts("No");
}
for(int i = 1; i <... | ALGO | 0.99999 | 3.253825 |
ed07d4de-cab5-47ea-88a1-23dc27c41099 | benedicka/Competitive-Programming | Gym/102152E/19551020_AC_140ms_20kB.cpp | #include<bits/stdc++.h>
using namespace std;
string x,c,y;
int t,ans,a[30],n,m;
int main()
{
scanf("%d",&t);
while(t--)
{
cin>>n>>m>>x>>c>>y;
ans = 0;
memset(a,-1,sizeof(a));
for(int i=0;i<n;i++)
{
if(a[x[i]-'a']==-1) a[x[i]-'a'] = x[i]-'0';
a[x[i]-'a']=min((c[i]-'0'),a[x[i]-'a']);
}
for(int i... | ALGO | 0.999854 | 3.469601 |
9b288a39-37d6-4b65-9dc9-9e1ef9cb0d87 | Moongss/ps | Baekjoon/20000-29999/23825.cpp | #include <bits/stdc++.h>
#define endl "\n"
#define fastio cin.tie(0)->sync_with_stdio(0)
using namespace std;
#define x first
#define y second
#define all(v) v.begin(), v.end()
#define compress(v) sort(all(v)), v.erase(unique(all(v)), v.end())
#define lower(v, x) (int)(lower_bound(all(v), x) - v.begin())
#define upper... | ALGO | 0.999916 | 3.61358 |
539af4a1-5e88-46d6-b0f3-814699ad6977 | SethRobinson/TeenageLawnmower | Source/shared/CRandom.cpp | #include "CRandom.h"
#include "time.h"
CRandom::CRandom(void)
{
rseed = 1;
mti=CMATH_N+1;
}
// Returns a number from 0 to n (excluding n)
unsigned int CRandom::Random( unsigned int n )
{
unsigned long y;
static unsigned long mag01[2]={0x0, CMATH_MATRIX_A};
if(n==0)
return(0);
... | ALGO | 0.992224 | 5.108561 |
d8cf006a-3771-4962-a0c5-8ad0a776ac32 | TejasMishr/Codeforces_sol | Minimise_Inversions.cpp | // +########################################################################################+
#include<bits/stdc++.h>
using namespace std;
// Code Shortners
#define ub upper_bound
#define lb lower_bound
#define endl "\n"
#define ll long long
#define lli long long int
#define vi vector<int>
#define vc vector<char>
#defi... | ALGO | 0.999986 | 4.951146 |
6aa22645-7db1-481f-8e59-11a9dbfd94ec | eibatatao/URIOnlineJudge-Answers | AnotherAccepted-cpp/URI_1866 - (3281845) - Accepted.cpp | #include <iostream>
#include <vector>
#include <string.h>
using namespace std;
int main(int argc, char** argv)
{
int c, n;
cin >> n;
for (int i = 0; i < n; i++)
{
cin >> c;
if (c % 2 == 0) cout << "0" << endl;
else cout << "1" << endl;
}
return 0;
} | ALGO | 0.999883 | 4.019601 |
02bbf522-a88f-46de-b82c-11db34f390a7 | UtkarshJain05/DSA | 5. BINARY SEARCH/1. BS on 1D Arrays/P10 - Single Element In Array/P10-Brute.cpp | // Search Single Element In Array.(Brute) --> TC : O(N) SC : O(1)
#include <bits/stdc++.h>
using namespace std;
int fnc(vector<int> &arr)
{
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];
... | ALGO | 0.999884 | 4.773382 |
9550229a-90ec-4b31-b9e3-ef84dbf398d6 | Sayemahamed/cpp | A_Way_Too_Long_Words.cpp | #include<bits/stdc++.h>
using namespace std;
int main()
{
long long t;
cin >> t;
while (t--)
{
string str;
cin >> str;
if(str.length()>10)
cout<<str[0]<<str.length()-2<<str[str.length()-1]<<endl;
else
cout<<str<<endl;
}
} | ALGO | 0.999219 | 3.74643 |
6ac9cef0-2df2-43dd-825d-bfc48834879c | tarik2568/undergrad-sessional-files | Second year odd semester Data structure and algorithm lab codes/Task 1.cpp | #include<iostream>
#include<ctime>
clock_t begin=clock();
using namespace std;
int main(){
int A[30],n,i,a;
cout<<"Enter the number of elements : ";
cin>>n;
cout<<"Enter the elements : ";
for(i=0;i<n;i++)
{
cin>>A[i];
}
cout<<"Enter value for searching : ";
cin>>a;
for(i=... | ALGO | 0.996914 | 4.004199 |
b432575f-c827-405b-b9d3-640d98f08eaf | weissms/owb-mirror | tags/Galekid1.0/BAL/Graphics/WebCore/WK/BCPathWK.cpp | #include "config.h"
#include "Path.h"
#include "FloatPoint.h"
#include "FloatRect.h"
#include "PathTraversalState.h"
#include <math.h>
#include <wtf/MathExtras.h>
const float QUARTER = 0.552f; // approximation of control point positions on a bezier
// to simulate a quarter of a circle.
n... | TOOL | 0.933358 | 7.174924 |
629e59f0-4351-4c0a-bb65-03413b1c44c4 | ishandutta2007/codeforces | enem/normal/1195/D1.cpp | #include <bits/stdc++.h>
using namespace std;
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
using namespace __gnu_pbds;
#define M 998244353
#define ll long long
#define REP(i,a,b) for(ll i=a;i<b;i++)
#define REPI(i,a,b) for(ll i=b-1;i>=a;i--)
#define F first
#define S second
#define PB p... | ALGO | 0.999593 | 4.173383 |
4b2ce1c5-93c6-4cf4-9929-2744489bb6f9 | nkirov/nkirov.github.com | 2022/CITB107/sources/ch4/maxtemp.cpp | #include <iostream>
using namespace std;
int main()
{ double next;
double highest;
cout << "Please enter the temperature values:\n";
if (cin >> next) highest = next;
else
{ cout << "No data!\n";
return 1;
}
while (cin >> next)
if (next > highest) highest = next;
cout << "The hig... | ALGO | 0.901635 | 4.145752 |
4f268041-f3a8-4089-9b50-33bf8b363286 | orangeistoxic/ZeroJudge_C--Practice | uva739.cpp | #include<bits/stdc++.h>
using namespace std;
int main()
{
cout<<setw(34)<<left<<" NAME"<<"SOUNDEX CODE\n";
string name;
string data1="BPFVCSKGJQXZDTLMNRAEIOUYWH";
string data2="11112222222233455600000000";
while(cin>>name)
{
string scode="A000";
scode[0]=name[0];
... | ALGO | 0.997367 | 3.364582 |
216ed33a-cf0c-42d4-887e-26b7cb685f00 | Phantom-HY/PH-code | c++/SYC/AC/1783/填充二叉搜索树.cpp | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
int n;
struct Tree
{
int data;
int sum;
int l, r;
int cnt;
} x[105];
int a[105];
int number(int j)
{
if (j == -1)
return 0;
return x[j].cnt = number(x[j].l) +
number(x[j].r) + 1;
}
void dfs(int id, in... | ALGO | 0.999995 | 3.993807 |
98af3e7d-4122-4056-9e64-098bc5cddd04 | YuehChuan/fix-openCV-2.4.9_NCVPixelOperations | samples/gpu/bgfg_segm.cpp | #include <iostream>
#include <string>
#include "opencv2/core/core.hpp"
#include "opencv2/gpu/gpu.hpp"
#include "opencv2/highgui/highgui.hpp"
using namespace std;
using namespace cv;
using namespace cv::gpu;
enum Method
{
FGD_STAT,
MOG,
MOG2,
GMG
};
int main(int argc, const char** argv)
{
cv::Com... | ALGO | 0.974018 | 5.500531 |
f49c50cf-511d-494e-b6f2-c30fc11ef85a | 113bommy/deepmind_codecontests_refine | cpp_gold_filter_file/cpp_test_40_8.cpp | #include <bits/stdc++.h>
using namespace std;
const int mod = 1e9 + 7;
const int inf = 1e9;
const double pi = acos(-1);
vector<int> eg[300005];
int idx[300005], vis[300005], a[300005], b[300005], c[300005];
vector<int> ans[300005];
vector<int> tmp;
int dfsid = 0;
struct edge {
int to, qid;
};
int fa[300005];
int ff(i... | ALGO | 0.99997 | 4.309865 |
1058c35d-4283-42b4-af2b-96e11c5086ab | ChernyackovEugeny/HomeAssignments | Assignment2b/pnotation.cpp | // the primary function
/* Chernyackov Eugeny <EMAIL>
home assignment 2b
*/
#include "pnotation.hpp"
#include <iostream>
void pnotation() {
std::string st;
std::getline(std::cin, st);
double *q = new double[100];
int up = 0;
std::string cur;
for (long unsigned int i = 0; i < st.length(); i... | ALGO | 0.997212 | 4.095023 |
d7b05ab8-442b-47bf-9f40-859ca8ddf343 | cmangos/mangos-tbc | src/game/AI/ScriptDevAI/scripts/outland/tempest_keep/botanica/boss_laj.cpp | /* ScriptData
SDName: Boss_Laj
SD%Complete: 90
SDComment: Immunities are wrong, must be adjusted to use resistance from creature_templates. Most spells require database support.
SDCategory: Tempest Keep, The Botanica
EndScriptData */
#include "AI/ScriptDevAI/include/sc_common.h"
#include "AI/ScriptDevAI/base/CombatAI.... | TOOL | 0.86972 | 5.465615 |
78386594-eec7-4b1e-918c-b68c0dbfd970 | Rakshit0404/OOPS-programs-and-explainations-by-me | 34_C++_operator_overloading_outside_and_-.cpp | //This is same as the previous program but here "-" operator has been overloaded
//and the operator function has been created outside the class, after declaring it inside the class.
#include<bits/stdc++.h>
using namespace std;
class Oranges{
int ownOranges;
int goneOranges;
public:
Oranges()
{
ownOranges=0... | ALGO | 0.969518 | 5.114595 |
2ef8ec08-cdf6-4edb-b2cf-96a63e9f3117 | KulmeetSJ/Leetcode | 0152-maximum-product-subarray/0152-maximum-product-subarray.cpp | class Solution {
public:
int maxProduct(vector<int>& nums) {
int pro = 1;
int product = nums[0];
for(int i=0;i<nums.size();i++)
{
pro = pro*nums[i];
product = max(product,pro);
if(pro==0)
pro = 1;
}
pro =... | ALGO | 0.999983 | 5.869192 |
d3dc37ca-c2d0-4444-893f-0a677d648335 | yejineee/problem-solving | baekjoon/computational_thinking/hanoi.cpp | #include <iostream>
#include <stdio.h>
#include <vector>
#include <queue>
#include <utility>
#include <set>
#include <math.h>
using namespace std ;
const int INF = 999999999 ;
const int n_rod = 3 ;
queue< pair<vector<vector<int > >, int > > Q; // prev, current, move
set<vector<vector<int> > > visit ;
int N, dest ;
voi... | ALGO | 0.999954 | 4.121278 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.