uuid string | repo_name string | relative_path string | content string | category string | algo_rel_score float64 | quality_score float64 |
|---|---|---|---|---|---|---|
ee8ece5d-eeed-4287-8a73-b840f794e4b0 | becastal/maratona | ufmg/dfs/treeConstructing.cpp | #include <bits/stdc++.h>
#define f first
#define s second
#define _ ios_base::sync_with_stdio(0);cin.tie(0);
#define endl '\n'
#define dbg(x) cout << #x << " = " << x << endl
typedef long long ll;
const int INF = 0x3f3f3f3f;
const ll LINF = 0x3f3f3f3f3f3f3f3fll;
using namespace std;
typedef pair<int, int> ii;
typedef v... | ALGO | 0.99993 | 3.727659 |
d4069ff0-35cd-48df-9b2b-2301b6dc0ca6 | chiachunho/NTUST_Exercise | OOP_C++/Homework/1249_WordGame/1249_WordGame/WordGame.cpp | // Student ID: B10615043
// Date: May 22, 2018
// Last Update: May 22, 2018
// Problem statement: This C++ program play word game.
#include <iostream>
#include <fstream>
#include <string>
#define FILE_NAME "words.txt"
#define SIZE 4
using namespace std;
bool visit(char board[][SIZE], int row, int column, string keywo... | ALGO | 0.99761 | 4.778932 |
72db59b3-464b-45be-b14a-32f31c48dd43 | Van-Vu/car | NumberGenerator/grouping.cpp | #include <iostream>
#include "grouping.h"
Grouping::Grouping(int gridSize) {
elementInGroup = 5;
countingGrid.assign((gridSize / elementInGroup) + 1, 0);
}
void Grouping::applyGroup(std::vector< std::vector<int> > drawResult) {
std::vector<int> row;
for (int i = 0; i < drawResult.size(); i++) {
row.clear();
f... | ALGO | 0.998634 | 5.021752 |
b934c570-2165-4f39-a05f-89e03aa00e2d | ANIKETRAJ28/DSA-and-CP | Linked List/leetcode/delete-a-ode-in-linkedlist.cpp | #include<bits/stdc++.h>
#define ll long long int
#define infp INT_MAX
#define infn INT_MIN
#define pp pair<int, int>
#define mod 1000000007
using namespace std;
template<typename T>
using vec = vector<T>;
// https://leetcode.com/problems/delete-node-in-a-linked-list/description/
struct ListNode {
int val;
Li... | ALGO | 0.999844 | 4.669517 |
be31cbd2-349a-4ac3-8eac-06d896c23998 | shreyaschavhan/100-days-of-code | Day 102 - 11th January 2021/library-fine.cpp | #include <bits/stdc++.h>
using namespace std;
vector<string> split_string(string);
// Complete the libraryFine function below.
int libraryFine(int d1, int m1, int y1, int d2, int m2, int y2) {
if(y1 == y2){
if(m1 == m2){
if(d1 > d2){
return ((d1 - d2) * 15);
}
... | ALGO | 0.999931 | 4.939775 |
cb2987fd-3528-4a04-a34d-f189fb8d9b00 | herywang/master_test | src/leetcode/practice_3.cpp | //
// Created by wangheng on 2020/9/10.
//https://leetcode-cn.com/problems/number-of-good-pairs/
#include <iostream>
#include <vector>
using namespace std;
class Solution{
public:
int numIdenticalPairs(vector<int>& nums){
int result = 0;
int i = 0;
int j;
while(i<nums.size()){
... | ALGO | 0.999832 | 5.738046 |
e8374bd3-1614-44f4-baf1-3b5a0ed1fcd0 | CodingPO8/ORE | OREAnalytics/orea/engine/parsensitivityutilities.cpp | #include <orea/engine/parsensitivityinstrumentbuilder.hpp>
#include <orea/engine/parsensitivityutilities.hpp>
#include <ored/utilities/log.hpp>
#include <ql/instruments/creditdefaultswap.hpp>
#include <ql/instruments/forwardrateagreement.hpp>
#include <ql/instruments/makecapfloor.hpp>
#include <ql/instruments/makeois.h... | ALGO | 0.994406 | 7.699515 |
f73edea7-5af6-415f-a394-7992fdcd4fe1 | jessicazhang236/Competitive | TLE/TLE17C8P3.cpp | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
int Q;
vector<ll> num;
ll K, M, N;
string cvt(ll a) {
string s="";
while (a) {
int i=a%10;
char m=i+'0';
s=m+s;
a/=10;
}
return s;
}
bool check(ll a) {
string s=cvt(a);
string s2=s;
reverse(s.... | ALGO | 0.999854 | 3.731464 |
b3aace2f-c3df-4928-81f1-3264bf4e84f0 | SMiles02/CompetitiveProgramming | AtCoder/ARC121B.cpp | #include <bits/stdc++.h>
#define ll long long
#define sz(x) (int)(x).size()
using namespace std;
set<ll> v[3];
signed main()
{
ios_base::sync_with_stdio(0); cin.tie(0);
int n;
ll k,ans;
char c;
cin>>n;
n*=2;
while (n--)
{
cin>>k>>c;
if (c=='R')
v[0].insert(k... | ALGO | 0.998375 | 3.817056 |
5824e70d-8739-4242-8ba6-f447d707abb9 | msameerfarooq/Hacktoberfest2022 | 10. String/mobile_keypad_conversion.cpp | // 450dsa q20 : Given a sentence in the form of a string, convert it into its equivalent mobile numeric keypad sequence.
#include <bits/stdc++.h>
using namespace std;
string printSequence(string str[], string input)
{
string output = "";
int n = input.length();
for (int i = 0; i < n; i++)
{
if... | ALGO | 0.999475 | 5.65122 |
12afad5c-d6fc-4894-ab4c-d769bb94bb18 | ishandutta2007/codeforces | fizzydavid/normal/131/C.cpp | #include<algorithm>
#include<cstdlib>
#include<cstdio>
#include<cstring>
#include<cmath>
#include<iostream>
#include<map>
#include<queue>
#include<stack>
#include<string>
#include<set>
#include<utility>
#include<vector>
using namespace std;
#define ff first
#define ss second
#define pb push_back
#define mp make_pair
t... | ALGO | 0.999889 | 3.763035 |
5f14df54-e64c-434d-8cd7-822faac20d7b | suyu13020027161/BA-ZHOU-SUYU | libraries/SITL/SIM_Calibration.cpp | #include <assert.h>
#include <AP_Math/AP_Math.h>
#include "SIM_Calibration.h"
#define MAX_ANGULAR_SPEED (2 * M_PI)
#include <stdio.h>
SITL::Calibration::Calibration(const char *home_str, const char *frame_str)
: Aircraft(home_str, frame_str)
{
mass = 1.5f;
}
void SITL::Calibration::update(const struct sit... | TOOL | 0.96718 | 5.150074 |
606f970e-2f35-471f-9b87-9cf68563acd4 | raincross7/code-similarity | codes/train_code/problem092/problem092_126.cpp | #include <bits/stdc++.h>
using namespace std;
using Graph = vector<vector<int>>;
using ll = long long;
using P = pair<int, int>;
#define rep(i,n) for(int i=0;i<(int)(n);i++)
#define all(v) v.begin(), v.end()
#define sz(x) ((int) x.size())
#define pb push_back
#define mp make_pair
#define F first
#define S second
typede... | ALGO | 0.999919 | 3.802393 |
51716162-e7df-48dc-b49d-212b4519b6fd | Moyu0730/CP-Question-Record | AtCoder/Beginner Contest 321/C. 321-like Searcher.cpp | /* Question : AtCoder Beginner Contest 321 - C. 321-like Searcher */
#include<bits/stdc++.h>
using namespace std;
/* Pragma */
#pragma GCC optimize("Ofast")
#pragma GCC optimize("Ofast,unroll-loops,no-stack-protector,fast-math")
#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native")
/* Self De... | ALGO | 0.999839 | 3.884654 |
f504de82-5e82-4a18-a868-7499e6b50794 | Adinath03/CPP | Leet Code/2089. Find Target Indices After Sorting Array.cpp | /* You are given a 0-indexed integer array nums and a target element target.
A target index is an index i such that nums[i] == target.
Return a list of the target indices of nums after sorting nums in non-decreasing order.
If there are no target indices, return an empty list. The returned list must be sorted in increa... | ALGO | 0.999985 | 6.360467 |
bf68f84a-09dc-4320-b614-29a05bd442d2 | ECP-copa/Cabana | benchmark/core/Cabana_BinSortPerformance.cpp | #include "../Cabana_BenchmarkUtils.hpp"
#include <Cabana_Core.hpp>
#include <Kokkos_Core.hpp>
#include <algorithm>
#include <fstream>
#include <iostream>
#include <numeric>
#include <random>
#include <sstream>
#include <string>
#include <vector>
//--------------------------------------------------------------------... | TEST | 0.950718 | 7.37365 |
4ab10534-0a83-4791-b1bf-1f5a26466f05 | thegamer1907/Code_Analysis | DP/349.cpp | #include "stdlib.h"
#include "stdio.h"
#include "math.h"
#include "string.h"
#define M 1000000007
#include "algorithm"
using namespace std;
int T[3000];
void swapp(int* a,int* b){
int c;
c = *a;
*a = *b;
*b = c;
}
int main(){
int n ;
scanf("%d",&n);
int A[n];
int i;
for(i=0;i<n;i+... | ALGO | 0.999956 | 3.644672 |
20e1bd58-975e-41a2-b2d2-a0536b595f0e | NK278/C-_DSA | recursion04/pallindrome.cpp | #include<bits:stdc++>
using namespace std;
bool ispal(string s){
int i=0,j=s.length()-1;
while(i<j){
if(s[i]!=s[j]) return false;
i++;
j--;
}
return true;
}
bool ispal2(string s,int i,int j){
if(i>j) return true;
if(s[i]!=s[j]) return false;
else return ispal2(s,i+1,j... | ALGO | 0.999669 | 3.27773 |
acc94636-38b2-44bb-87b6-a88fdd766e2f | techboy-s/Code | 226-invert-binary-tree/226-invert-binary-tree.cpp | /**
* Definition for a binary tree node.
* struct TreeNode {
* int val;
* TreeNode *left;
* TreeNode *right;
* TreeNode() : val(0), left(nullptr), right(nullptr) {}
* TreeNode(int x) : val(x), left(nullptr), right(nullptr) {}
* TreeNode(int x, TreeNode *left, TreeNode *right) : val(x), l... | ALGO | 0.999986 | 6.613112 |
6faed1b4-bc61-4928-bef2-59cd1e788aba | lovingmage/SPECIAL | exp/q4_eps.cpp | #include "core/op_equijoin.hpp"
#include "core/op_idx_equijoin.hpp"
#include "core/op_agg_count.hpp"
#include "core/relation.hpp"
// Utility function to initialize a relation with random values and flag bits
void init_relation(SecureRelation& relation, int num_cols, int num_rows, bool mixed_flags = false) {
for (i... | DATA | 0.986765 | 5.975919 |
b84ab630-a2c1-41fa-a155-fec47513a3c8 | rgyhuang/Competitive_Coding | DMOJ/CCC/CCC'96 S1.cpp | #include <bits/stdc++.h>
using namespace std;
void solve(){
int n;
cin>>n;
for(int i = 0; i < n; i++){
int c;
cin>>c;
int sum = 0;
for(int j = 1; j < c; j++){
if(c%j==0){
sum+=j;
}
}
if(sum==c){
cout<<c<<... | ALGO | 0.99961 | 4.437135 |
3712a911-d1c7-4ce2-8b24-b1be6eea8b0e | thosonit/flutter_clean_architecture | ts_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.998247 | 6.772262 |
7ea9a4e0-1ca7-4d85-b517-288e1f60d662 | astoghosh2019/Cpp-programming | Programs/armstrong.cpp | #include <iostream>
using namespace std;
int main()
{
int n,r,sum=0,temp;
cout<<"Enter the Number= ";
cin>>n;
temp=n;
while(n>0)
{
r=n%10;
sum=sum+(r*r*r);
n=n/10;
}
if(temp==sum)
cout<<"Armstrong Number."<<endl;
else
cout<<"Not Armstrong Number."<<endl;
r... | ALGO | 0.999647 | 4.176629 |
7b898e44-efa8-4d40-9722-763f7100b9fd | Pussycat-Doll/My_leetcode. | fib.cpp | int fib(int n)
{
if(n == 0)
return 0;
else if(n == 1 || n == 2)
return 1;
else
{
long long first = 0,second = 1,third = 0;
for(int i = 2; i <= n; ++i)
{
third = (first + second)%1000000007;
... | ALGO | 0.999923 | 4.347882 |
fed1202a-194c-44a9-b88f-6675749b9300 | COMP215/_michaelkristy | lab01/main.cpp | using namespace std;
#include <iostream>
#include <random>
#include <fstream>
#include <ctime>
#include <algorithm>
int RUNAMOUNT = 600;
void createRandomStrings();
string* sortingMess();
void runAgain(string*);
int main(int argc, const char * argv[]) {
srand ( time(NULL) );
createRandomStrings();
... | ALGO | 0.960864 | 4.199433 |
9562620e-39a3-4453-b449-4b9296e72aad | zionko0919/challenges_and_short_programs | DNA_Alignment_Challenge/ED.cpp | #include "ED.h" //NOLINT
#include <iostream> //NOLINT
#include <string>
#include <algorithm>
EditDistance::EditDistance(std::string strA, std::string strB) {
str_1 = strA;
str_2 = strB;
n = str_1.length();
m = str_2.length();
matrix = new int* [n+1];
for (int i = 0; i < n+ 1; i++) {
/... | ALGO | 0.998394 | 5.536742 |
34a43383-b01f-42b5-90cb-5f8d108f07bc | saurya01/Codeforces_x | Minimal_Sqaure.cpp | #include<bits/stdc++.h>
using namespace std;
int main(){
int t;
cin>>t;
while(t--){
int a,b;
cin>>a>>b;
if(a>b){
swap(a,b);
}
cout<<max(a*2,b)*max(a*2,b)<<endl;
}
return 0;
} | ALGO | 0.999409 | 3.916064 |
1765c963-6765-4eed-aad1-e487727c5248 | huhumeng/algorithm | leetcode/104.ไบๅๆ ็ๆๅคงๆทฑๅบฆ.cpp | /*
* @lc app=leetcode.cn id=104 lang=cpp
*
* [104] ไบๅๆ ็ๆๅคงๆทฑๅบฆ
*
* https://leetcode-cn.com/problems/maximum-depth-of-binary-tree/description/
*
* algorithms
* Easy (70.47%)
* Total Accepted: 67K
* Total Submissions: 95.1K
* Testcase Example: '[3,9,20,null,null,15,7]'
*
* ็ปๅฎไธไธชไบๅๆ ๏ผๆพๅบๅ
ถๆๅคงๆทฑๅบฆใ
*
* ไบๅๆ ็ๆทฑๅบฆไธบๆ น่็น... | ALGO | 0.999933 | 6.460018 |
029e3162-d7e1-471e-9e88-b22b373cec85 | God-D-Usopp/c-experiments | experiment/exp19_dijkstra.cpp | #include <iostream>
using namespace std;
void dijkstra(int graph[][10], int vertices, int source) {
int dist[vertices]; // To store the shortest distance from the source
bool visited[vertices]; // To track whether a vertex has been visited
// Initialize distances to a large value and visited to false
... | ALGO | 0.999964 | 5.922958 |
60e3defb-d3a3-4253-96ba-565ac0dd8782 | vishaljbhandari/LearnC | Pending/example/math/perfect_number.cpp | // g++ -Wall -Wextra -Werror check_perfect_number.cpp
#include<iostream>
#include<math.h>
using namespace std;
int main() {
int number, x;
printf("Enter The Number :");
cin >> number;
x = sqrt(number);
if (x * x == number)
cout << "The Number is Perfect Number.";
else
cout << "The Number is Not Perfect Numbe... | ALGO | 0.999623 | 3.705985 |
ae43e8a1-81da-4e1c-813e-95ff58b174a3 | jbloit/eigen | doc/examples/Tutorial_simple_example_dynamic_size.cpp | #include <Eigen/Core>
#include <iostream>
int main()
{
for (int size=1; size<=4; ++size)
{
Eigen::MatrixXi m(size,size+1); // a (size)x(size+1)-matrix of int's
for (int j=0; j<m.cols(); ++j) // loop over columns
for (int i=0; i<m.rows(); ++i) // loop over rows
m(i,j) = i+j*size; ... | ALGO | 0.968032 | 3.003005 |
ee1c7d5d-67c1-4284-baf1-d4d764e20eef | Kallil12/URI-Codes | URI - C++/1017.cpp | #include <iostream>
using namespace std;
int main () {
int horas, velocidade;
float consumo;
cin >> horas >> velocidade;
consumo = (horas*velocidade)/12.0;
cout.precision(3);
cout << fixed << consumo << endl;
return 0;
}
| ALGO | 0.946078 | 3.462842 |
bc7734db-0dab-4867-a512-0aad3c4dc4d6 | archie0732/c-solution | code/Anji's Binary Tree.cpp | #include <iostream>
#include <vector>
#include <map>
#include <set>
using namespace std;
/*
//*้ก็ฎ: Anji's Binary Tree
//*่งฃ้ก่
:็ฅๆๅ่ฏ็็
้ก็ฎไพๆบ:codeforce
้ก็ฎ้ฃ็ต:https://codeforces.com/contest/1900/problem/C?fbclid=IwAR2E4lZI2IF7PFjhADz8695KVJI-IGyajyy2ze9ebFU54E7tyoYRzl8qcBo
่งฃ้ก้ฃ็ต:https://github.com/archie0732/c-solut... | ALGO | 0.999806 | 4.444694 |
b019af77-1ca2-45bf-9630-dc591de704d6 | hermione521/blog_search | coreseek-4.1-beta/csft-4.1/src/md5.cpp | /* $Id$ */
#include "md5.h"
#include <string.h>
#undef BYTE_ORDER /* 1 = big-endian, -1 = little-endian, 0 = unknown */
#ifdef ARCH_IS_BIG_ENDIAN
# define BYTE_ORDER (ARCH_IS_BIG_ENDIAN ? 1 : -1)
#else
# define BYTE_ORDER 0
#endif
#define T_MASK ((md5_word_t)~0)
#define T1 /* 0xd76aa478 */ (T_MASK ^ 0x28955b87)
#d... | ALGO | 0.995242 | 6.509535 |
6686e3f1-b75c-4166-9c4c-49995d65fe96 | jyqiu1216/Rino | sdk/boost_1_62_0/libs/compute/perf/perf_prev_permutation.cpp | #include <algorithm>
#include <iostream>
#include <numeric>
#include <vector>
#include <boost/compute/system.hpp>
#include <boost/compute/algorithm/next_permutation.hpp>
#include <boost/compute/algorithm/prev_permutation.hpp>
#include <boost/compute/container/vector.hpp>
#include "perf.hpp"
int rand_int()
{
retu... | ALGO | 0.996234 | 5.289071 |
d6eb0b41-cb50-478f-8ee0-6faaf2f161e9 | OualidOuaquad/competitive-programming | CODE_JAM/CJ20/FINAL/a/a.cpp |
#include <bits/stdc++.h>
#include <climits>
using namespace std;
#define ll long long
#define ar array
// int knapSack(int v[], int w[], int n, int W) {
// if (W < 0)
// return INT_MIN;
// if (n < 0 || W == 0)
// return 0;
// int in = v[n] + knapSack(v, w, n - 1, W - w[n]);
// int ex = knap... | ALGO | 0.999209 | 3.392935 |
aaac00bd-bada-44a8-ac43-f86d8b3a3d66 | TT2TER/BITMY | Programming Methods and Practices/17-chaxunmingzi.cpp | #include <iostream>
#include <cstring>
#include <bits/stdc++.h>
#include <queue>
using namespace std;
int main()
{
queue<char *> name;
char c[22], h[33];
int n;
scanf("%d\n", &n);
while (n--)
{
gets(h);
if (memcmp(h, "Arrive", 6) == 0)
{
strcpy(c, &h[7]);
... | ALGO | 0.988373 | 3.911153 |
85df4638-3b7b-4b95-b00c-74bec31b3da2 | OddinYa/forUniversity | ะ3โ30/lab3/lab3/lab3Sourse.cpp | /*#include <iostream>
#include <iomanip>
#include <bitset>
using namespace std;
struct MyStruct {
unsigned short C : 7;
unsigned short F : 1;
unsigned short B : 1;
unsigned short N : 7;
};
void packData(MyStruct& data, unsigned short value) {
if (bitset<16>(value).count() == 16) {
data... | TOOL | 0.852194 | 3.673009 |
1bdca24a-1877-4a6a-88a1-bddf3859ee51 | stringing/Federated-LLM-Based-APR | RoPGen/src/RoPGen-enabled DL-CAIS/code-imitator/src/LibToolingAST/transformers/include-sort/IncludeSort.cpp | #include <clang/Tooling/Refactoring.h>
#include "IncludeSort.h"
/// Preprocessor callback that is called each time an include is encountered.
///
/// Collects all includes of a file.
void IncludeCollector::InclusionDirective(
SourceLocation HashLoc, const Token &IncludeTok, StringRef FileName,
bool IsA... | TOOL | 0.965705 | 7.225231 |
cdf36454-d142-42cc-a0a5-fc8391f6d50d | aki-ph-chem/try_neetcode | neet_code_150_cpp/graphs/course_schedule.cpp | #include <iostream>
#include <vector>
#include <algorithm>
#include <unordered_set>
#include <unordered_map>
// ่งฃใใชใใฃใ
class Solution {
#define DEBUG
using Graph = std::vector<std::vector<int>>;
public:
bool canFinish(int numCourse, std::vector<std::vector<int>>& prerequisites) {
// ใฐใฉใใฎๆง็ฏ
... | ALGO | 0.999857 | 5.891991 |
2fc3531f-d112-462d-9553-c97cd96e27cf | sarvex/leetcode-intercal | solution/1900-1999/1997.First Day Where You Have Been in All the Rooms/Solution.cpp | class Solution {
public:
int firstDayBeenInAllRooms(vector<int>& nextVisit) {
int n = nextVisit.size();
vector<long long> f(n);
const int mod = 1e9 + 7;
for (int i = 1; i < n; ++i) {
f[i] = (f[i - 1] + 1 + f[i - 1] - f[nextVisit[i - 1]] + 1 + mod) % mod;
}
... | ALGO | 0.999977 | 5.93171 |
7e3bb3a2-f31e-415f-9867-e583fa988501 | rakesh1196/DSA | decimalToOctal.cpp | #include <bits/stdc++.h>
using namespace std;
int decimalToOctal(int n) {
int octal = 0, place = 1;
while (n > 0) {
octal += (n % 8) * place;
n = n/8;
place *= 10;
}
return octal;
}
int main() {
int n;
cin >> n;
int octal = decimalToOctal(n);
cout << octal <... | ALGO | 0.99963 | 5.550556 |
2bd88a64-917b-44dc-bea0-115a1874030c | shuaideshangren/suanfa | 2.5้ๅๆ .cpp | #include<iostream>
#include<vector>
using namespace std;
struct ListNode {
int val;
struct ListNode *next;
ListNode(int x) : val(x), next(NULL) {}
};
class SetOfStacks {
public:
vector<vector<int> > setOfStacks(vector<vector<int> > ope, int size) {
// write code here
vector<vector<int... | ALGO | 0.999905 | 4.501702 |
1e4cc81f-4243-45cb-a6f2-88f47bfca284 | thigiacmaytinh/TGMTcpp | lib/opencv342/contrib/rgbd/src/depth_cleaner.cpp | #include "precomp.hpp"
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
namespace cv
{
namespace rgbd
{
class DepthCleanerImpl
{
public:
DepthCleanerImpl(int window_size, int depth, DepthCleaner::DEPTH_CLEANER_METHOD method)
:
... | ALGO | 0.995555 | 6.974392 |
d359631a-2e27-4788-bcea-bce31df93341 | dr0gsk0l/cp-library | test/library-checker/String/RunEnumerate.test.cpp | #define PROBLEM "https://judge.yosupo.jp/problem/runenumerate"
#include <bits/stdc++.h>
#include "library/sequence/RunEnumerate.hpp"
int main() {
std::string s;
std::cin >> s;
RunEnumerate RE(s);
std::cout << RE.ans.size() << "\n";
for (const auto &[t, l, r] : RE.ans)
std::cout << t << " "... | ALGO | 0.983448 | 4.01495 |
ad4f3be5-9a0e-4348-ba6e-e5bbd0bbbb6c | HiimHotta/URI | 1.Iniciante/014_DistรขnciaEntreDoisPontos.cpp | /*********************************************************************************************************
Leia os quatro valores correspondentes aos eixos x e y de dois pontos quaisquer no plano, p1(x1,y1) e
p2(x2,y2) e calcule a distรขncia entre eles, mostrando 4 casas decimais apรณs a vรญrgula, segundo a fรณrmula:... | ALGO | 0.999709 | 4.64039 |
39ca0a71-e7a3-42e2-8262-919fc1f21c16 | TusharAMD/Codechef-question | time.cpp | #include<iostream>
using namespace std;
int main()
{
short n,h,x,a=0;
cin>>n>>h>>x;
short t[n];
for(short i=0;i<n;i++)
{
cin>>t[i];
}
for(short i=0;i<n;i++)
{
t[i]+=x;
if(t[i]>=h)
{
a=1;
break;
}
}
if(a==1)
cout<<"YES";
else
{
cout<<"NO";
}
}
| ALGO | 0.999982 | 3.427827 |
ec4fad00-5656-4aa2-89d0-f951238a9141 | SudhaVF/CPP | loopex3.cpp | //Sum of all odd numbers from 1 to n
#include<iostream>
using namespace std;
int main(){
int n = 50;
int oddSum=0;
for(int i=1;i<=n;i++)
{
if(i%2 != 0){
oddSum += i;
}
}
cout<<"oddSumm="<<oddSum<<endl;
return 0;
} | ALGO | 0.999691 | 3.936405 |
f538f4c8-90ce-4fc7-8edc-42d4732d3cba | vishnu510/LeetCode_Problem | Jumping Caterpillars - GFG/jumping-caterpillars.cpp | // { Driver Code Starts
#include<bits/stdc++.h>
using namespace std;
int uneatenLeaves(int arr[],int n,int k);
int main()
{
int t;
cin>>t;
while(t--)
{
int n;
cin>>n;
int k;
cin>>k;
int arr[k];
for(int i=0;i<k;i++)
cin>>arr[i];
... | ALGO | 0.999752 | 4.49453 |
c135aa13-5273-4319-969c-fa1835979d60 | arpit9091/arpit | servers/physics_3d/joints/godot_cone_twist_joint_3d.cpp | /**************************************************************************/
/* godot_cone_twist_joint_3d.cpp */
/**************************************************************************/
/* This file is part of: */
/* ... | ALGO | 0.868202 | 7.380611 |
5e2cff14-ade3-4732-a97a-4ffd24a854ff | matsumoto0112/create_legend | legend/bullet/src/BulletCollision/CollisionDispatch/btConvex2dConvex2dAlgorithm.cpp | #include "btConvex2dConvex2dAlgorithm.h"
//#include <stdio.h>
#include "BulletCollision/NarrowPhaseCollision/btDiscreteCollisionDetectorInterface.h"
#include "BulletCollision/BroadphaseCollision/btBroadphaseInterface.h"
#include "BulletCollision/CollisionDispatch/btCollisionObject.h"
#include "BulletCollision/Collisio... | ALGO | 0.999578 | 6.671592 |
7f090529-a609-4ad9-96bc-8ceae0017d38 | adetaylor/android-frameworks-base-with-remote-control-service | tools/localize/merge_res_and_xliff.cpp | #include "merge_res_and_xliff.h"
#include "file_utils.h"
#include "Perforce.h"
#include "log.h"
#include <stdio.h>
static set<StringResource>::const_iterator
find_id(const set<StringResource>& s, const string& id, int index)
{
for (set<StringResource>::const_iterator it = s.begin(); it != s.end(); it++) {
... | TOOL | 0.922492 | 6.25525 |
7e715cb4-227a-478e-8a1c-5fc7f9ba91de | ummeabiha/MobileDevelopment | Labs/Lab11/lab11/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.997991 | 6.76775 |
7068629f-ac31-4fc1-9d17-0ecdc1f914f7 | iamdeepakvishwa/cp_programming | 2a.cpp | #include<bits/stdc++.h>
using namespace std;
int main(){
int n,i;
cin>>n;
vector<pair<string,int>> rounds(n);
map<string,int> playerScore;
for(i=0;i<n;i++){
cin>>rounds[i].first>>rounds[i].second;
playerScore[rounds[i].first] += rounds[i].second;
}
set<string> Winner;
i... | ALGO | 0.999959 | 4.453449 |
f7ea91c2-10dd-432a-a24d-62b50a1f2e73 | anilgathala/cpp-workspace | binarysearch/binary_search_with_duplicates.cpp | ///
/// Different varaitions
///
#include <iostream>
#include <vector>
// same code without dup
int binsearch_dup(std::vector<int> A, int key) {
int lo = 0;
int hi = A.size() - 1;
while (lo <= hi) {
int mid = lo + (hi - lo) / 2;
if (A[mid] == key) { return mid; }
if (key < A[mid])... | ALGO | 0.999618 | 5.320758 |
96d2650e-35b3-4ab3-8e3f-f78464b5e99a | devimam/Codeforces | Codeforce 158A Next Round.cpp | #include <iostream>
using namespace std;
int main()
{
int n,k;
cin>>n>>k;
int cnt=0;
int num;
for(int i=1;i<=k;i++){
cin>>num;
if(num>0) cnt++;
}
for(int i=k+1;i<=n;i++){
int num1;
cin>>num1;
if(num1==num && num>0) cnt++;
else num=-1;
}... | ALGO | 0.999917 | 3.530165 |
9d2b8514-c4e6-4039-a486-cdf95f471fd3 | yaochong-cc/LeetCode- | ไป้ญๆณๅธ่บซไธๅธๅ็ๆๅคง่ฝ้.cpp | //
// Created by Lenovo on 2024/5/12.
//
#include<iostream>
#include<vector>
#include<algorithm>
using namespace std;
//// ๆดๅๆณ---่ถ
ๆถ
//class Solution {
//public:
// int maximumEnergy(vector<int>& energy, int k) {
// vector<int> res;
// for(int i=0;i<energy.size();i++){
// int ans=0;
// ... | ALGO | 0.999954 | 4.827028 |
6b82b135-d911-4584-b4bd-5477523deba5 | LDlornd/OI-Memory | codeforces/Educational Codeforces Round 45 (Rated for Div. 2)/A. Commentary Boxes/A. Commentary Boxes.cpp | #include<cstdio>
#include<iostream>
using namespace std;
long long int m,n,a,b,temp,ans;
int main(){
scanf("%lld%lld%lld%lld",&n,&m,&a,&b);
temp=n/m;
ans=(n-temp*m)*b;
ans=min(ans,((temp+1)*m-n)*a);
printf("%lld",ans);
return 0;
}
| ALGO | 0.999376 | 3.533643 |
60615df2-0348-443f-9214-f62ba989b7ea | ishandutta2007/codeforces | liouzhou_101/normal/1245/C.cpp | #pragma GCC optimize("Ofast,unroll-loops,no-stack-protector,fast-math")
#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native")
//#pragma comment(linker, "/stack:200000000")
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
typedef double ld;... | ALGO | 0.999871 | 4.679445 |
d9823369-c5ed-4d56-9906-6df982ea165c | LnwZaZaToon/Algorithm | setsub2.cpp | #include<bits/stdc++.h>
using namespace std;
void BackTrack(vector<int>&vec , vector<int>&result , int start){
if(result.size() != 0 ){
for(int i = 0 ; i < result.size() ; i++){
cout<<result[i]<<" ";
}
cout<<endl;
}
for(int i = start ; i < vec.size() ; i++){
result.push_back(vec[i]);
BackTrack(vec,resul... | ALGO | 0.999917 | 4.578142 |
304b5a9d-0581-4274-a478-2fdf4e01407d | faetos/binkdogcoin | src/wallet_ismine.cpp | #include "wallet_ismine.h"
#include "key.h"
#include "keystore.h"
#include "script/script.h"
#include "script/standard.h"
#include "util.h"
#include <boost/foreach.hpp>
using namespace std;
typedef vector<unsigned char> valtype;
unsigned int HaveKeys(const vector<valtype>& pubkeys, const CKeyStore& keystore)
{
... | ALGO | 0.980759 | 5.494791 |
5cbca930-c8fd-45cc-bdd5-3969185bdd1c | gregorburger/SAGA-GIS | src/modules/grid/grid_analysis/fragmentation_classify.cpp | //---------------------------------------------------------
///////////////////////////////////////////////////////////
// //
// //
// //
///////////////////////////////////////////////////////////
//---------------------------------------------------------
#include "fragment... | ALGO | 0.913834 | 4.104786 |
5b9ec2a7-d4bd-4519-bb21-0b3f9aaa8eea | ishandutta2007/codeforces | cheetose/normal/1700/E.cpp | #include <bits/stdc++.h>
#define mp make_pair
#define pb push_back
#define X first
#define Y second
#define y0 y12
#define y1 y22
#define INF 987654321987654321
#define PI 3.141592653589793238462643383279502884
#define fup(i,a,b,c) for(int (i)=(a);(i)<=(b);(i)+=(c))
#define fdn(i,a,b,c) for(int (i)=(a);(i)>=(b);(i)-=(c... | ALGO | 0.999964 | 3.849627 |
e179b367-a795-4bd5-88b8-562ac9cc06b5 | ahuraa/CataCore | src/server/scripts/Kalimdor/TempleOfAhnQiraj/mob_anubisath_sentinel.cpp | /* ScriptData
SDName: mob_anubisath_sentinel
SD%Complete: 95
SDComment: Shadow storm is not properly implemented in core it should only target ppl outside of melee range.
SDCategory: Temple of Ahn'Qiraj
EndScriptData */
#include "ScriptMgr.h"
#include "ScriptedCreature.h"
#include "WorldPacket.h"
#include "Item.h"
#i... | TOOL | 0.90866 | 5.86302 |
bcef58db-00f2-4150-9ac1-1fabb833a3fd | imjoyhalder/Leetcode_Problem_solving | April/Day-25/2845. Count of Interesting Subarrays.cpp | #include<bits/stdc++.h>
using namespace std;
class Solution {
public:
long long countInterestingSubarrays(vector<int>& nums, int modulo, int k) {
const int n=nums.size();
unordered_map<int, int> mp;
mp[0]=1;
mp.reserve(n);
long long ans=0;
... | ALGO | 0.999847 | 4.516455 |
f4b53669-53fc-40d7-b894-bbfa4b839352 | Kotolanchik/ZFunc-PrefFunc-SuffMass | ConsoleApplication1/Z-func Pref-func Suff-mass.cpp | #include <iostream>
#include <vector>
#include <cmath>
#include <map>
using namespace std;
vector<int> prefix_function(string s) {
int n = (int)s.length();
vector<int> pi(n);
for (int i = 0; i < n; ++i) {// n = 12
for (int k = 0; k <= i; ++k) {
string aa = s.substr(0, k);
string bb = s.substr(i - k + 1, k);... | ALGO | 0.999687 | 4.412148 |
13afa802-5b12-4bb3-9057-59078160bdfb | 113bommy/PathRepair | variable_trace/cpp/cpp_code/cpp_incorrect/cpp_incorrect_test_55_2.cpp | #include <bits/stdc++.h>
using namespace std;
const int INF = 1000000000;
const int mod = 1e9 + 7;
long long power(int a, long long b) {
if (b == 0) return 1LL;
long long tmp = power(a, b / 2);
if (b & 1) return (tmp * tmp % mod) * a % mod;
return tmp * tmp % mod;
}
int main() {
ios::sync_with_stdio(false), c... | ALGO | 0.999976 | 5.026875 |
7d777592-5601-4b54-b7b3-b55dc5858197 | francescabarbaro/Challenge1 | Centered_differences/gradient.cpp | #include "gradient.hpp"
std::vector<double> gradient_method(const Data &data)
{
//initial values
std::vector<double> current_point = data.start_point;
std::vector<double> previous_point = data.start_point;
double alpha = data.initial_step;
std::vector<double> grad = data.grad( current_point);
... | ALGO | 0.999968 | 5.956319 |
710137cd-a941-4bb2-9162-6a1b591ccbac | 15999shivam/ADI | Stacks/linkedStack.cpp | #include <iostream>
using namespace std;
struct node
{
int data;
node *next;
};
class LinkedStack
{
node *list;
public:
LinkedStack()
{
list = NULL;
}
void push(int n)
{
node *temp = new node;
temp->data = n;
if (list == NULL)
{
lis... | ALGO | 0.99862 | 4.42359 |
e93bed8f-d22a-433c-b67b-a98b2f1d4de9 | lwDavid/Algorithm_Notebook | Codes/PAT_A1096.cpp | #include <math.h>
#include <stdio.h>
int main() {
int N, sqr, count, M, max = 0, j, pos = 2;
if (scanf("%d", &N))
;
sqr = sqrt(1.0 * N);
for (int i = 2; i <= sqr; i++) {
count = 0;
M = N;
j = i;
while (M % j == 0) {
count++;
M /= j;
... | ALGO | 0.999985 | 4.213086 |
33777895-071b-44ae-b2dd-746c258dadd1 | anuj308/dsac- | dsa/unit 2 linkedlist/q6.cpp | // Single File Programming Question
// Problem Statement
// Daniel has a singly linked list and wants to delete the middle node from the list. If there are two middle nodes (in the case of an even number of nodes), the second one should be considered the middle node and deleted. Otherwise, the single middle node is de... | ALGO | 0.999988 | 6.100866 |
04b59a1c-89cb-4b70-9861-20ad928ea887 | WarrenGames/Bob-the-blob | libraries/genericLib/sources/arithmetic/customArithmetic.cpp | #include "arithmetic/customArithmetic.h"
int getCeilInteger(int numerator, int denominator)
{
return ( numerator + denominator - 1 ) / denominator;
}
unsigned getPowValue(unsigned x, unsigned y)
{
unsigned result{1};
for( unsigned i{0} ; i < y ; ++i )
{
result *= x;
}
return result;
} | ALGO | 0.978738 | 5.451844 |
cbb86638-e136-4a2b-942b-ab2a40e5c200 | WYQ3333/light_server | everday/4_10_1.cpp | #include<iostream>
using namespace std;
bool IssuShu(int m){
if(m == 1){
return false;
}
for(int i = 2; i < m; ++i){
if(m%i == 0){
return false;
}
}
return true;
}
int main(){
int yearf, monthf, daysf;
int yeart, montht, dayst;
while(cin >> yearf >> ... | ALGO | 0.999426 | 3.685934 |
3ecfeb6e-d0c9-4d2b-9ecd-4dacd60c0859 | jinshuyi/Programming-Data-Structures-and-Algorithms-in-C-ECE-551D.001.Fa24 | 099_eval3/step1.cpp | #include <algorithm>
#include <fstream>
#include <iostream>
#include <sstream>
#include <stdexcept>
#include <string>
#include <vector>
// A class represent a ship
class Ship {
public:
std::string name;
std::string source;
std::string destination;
unsigned long capacity;
// Constructor definedto initialize... | TOOL | 0.899649 | 6.963771 |
dadab4a5-1227-4be6-adf6-c168b2846366 | Akrobatik/ps | BaekJoon/34000/34039.cpp | // Title : ๋ง์ด๋ง์ด ์ํ ๋๊ธฐ
// Link : https://www.acmicpc.net/problem/34039
// Time : 196 ms
// Memory: 7680 KB
#include <bits/stdc++.h>
using namespace std;
struct Node {
Node() : cnt(0), sum(0) {}
void Add(int dc, int ds) {
cnt += dc;
sum += ds;
}
Node& operator+=(const Node& other) {
cnt += oth... | ALGO | 0.999877 | 5.304276 |
a9f9d6cd-bb9b-452b-a6a2-ba97fad21588 | xjubep/Problem-Solving | deque/boj_5430.cpp | // Integer Lists (AC)
#include <bits/stdc++.h>
using namespace std;
const int NUM_MX_LEN = 4; // MX: '100]'
deque<int> dq;
int main(void) {
ios_base::sync_with_stdio(false);
cin.tie(nullptr);
int tc;
cin >> tc;
while (tc--) {
string fn, num;
bool error_flag = false, r_flag = ... | ALGO | 0.998995 | 4.703719 |
1d614e1f-bd0c-4f86-aab1-29c3fc04c2c9 | Li-Parker/DB2023 | extra/icu/source/common/unisetspan.cpp | #include "unicode/utypes.h"
#include "unicode/uniset.h"
#include "unicode/ustring.h"
#include "unicode/utf8.h"
#include "unicode/utf16.h"
#include "cmemory.h"
#include "uvector.h"
#include "unisetspan.h"
U_NAMESPACE_BEGIN
/*
* List of offsets from the current position from where to try matching
* a code point or a ... | TOOL | 0.978939 | 7.102013 |
cb5bf223-24d3-4b45-bf51-2b18844d9972 | DionysiosB/CodeForces | 0800-0899/888B-BuggyRobot.cpp | #include <iostream>
#include <map>
int main(){
long n; std::cin >> n;
std::string s; std::cin >> s;
long left(0), right(0), up(0), down(0);
for(long p = 0; p < n; p++){
if(s[p] == 'L'){++left;}
else if(s[p] == 'R'){++right;}
else if(s[p] == 'U'){++up;}
else if(s[p] == '... | ALGO | 0.999874 | 3.492811 |
e6ad1ffd-8ea6-4b05-b61a-3f8e3fa2f2cd | morshedalam3/cp_practice_week_2 | Day_2/K_Cumulative_Sum_Query.cpp | //Problem: https://www.spoj.com/problems/CSUMQ/en/
#include<bits/stdc++.h>
using namespace std;
int main() {
int N;
cin >> N;
vector<long long> numbers(N);
for (int i = 0; i < N; ++i) {
cin >> numbers[i];
}
int Q;
cin >> Q;
while (Q--) {
int i, j;
cin >> i >>... | ALGO | 0.999914 | 5.46034 |
18279fff-01a9-422f-96ee-952031bfd680 | Sadat-09/Codeforces | A_Rigged.cpp |
#include <bits/stdc++.h>
#define IO \
ios_base::sync_with_stdio(false); \
cin.tie(NULL); \
cout.tie(NULL)
typedef long long int ll;
typedef long double LD;
#define w(t) \
int t; \
cin >> t; \
while (t--) \
{ \
so... | ALGO | 0.99995 | 3.879162 |
af8eb219-5c4c-4666-a655-edf1f6bdc30f | HoangKimNgoc123/DataStructuresAndAlgorithms_HoangKimNgoc123 | Hoang Kim Ngoc - K225480106053/De quy/De quy - UCLN.cpp | #include<iostream>
using namespace std;
int UCLN (int a, int b){
if(b == 0) return a;
else return UCLN(b, a % b);
}
int main(){
int a, b;
cin >> a >> b;
cout << UCLN(a, b);
return 0;
} | ALGO | 0.999673 | 4.791868 |
c6a3427b-96bd-493c-9b2b-84f019673fc3 | Vishal1062996/Data-Structure | Matrices/lower_triangular_matrix.cpp | #include<iostream>
using namespace std;
class matrix{
private:
int n;
int *A;
public:
matrix(){
n=3;
A=new int[n];
}
matrix(int m){
n=m;
int x=m*(m-1)/2;
A=new int[x];
}
~matrix(){
delete []A;
A=NULL;
}
void display();... | ALGO | 0.998675 | 3.504036 |
a7583bcf-ef3d-44f1-bad1-7b52f208f8e1 | chardmeier/docent | src/SimulatedAnnealing.cpp | #include "SimulatedAnnealing.h"
#include "CoolingSchedule.h"
#include "NbestStorage.h"
#include "Random.h"
#include "SearchStep.h"
#include "StateGenerator.h"
#include <limits>
struct SimulatedAnnealingSearchState
: public SearchState
{
boost::shared_ptr<DocumentState> document;
CoolingSchedule *schedule;
uint ns... | ALGO | 0.999181 | 6.292368 |
167720dc-fd33-4849-930f-250c1e20788d | ishandutta2007/codeforces | crackersamdjam/normal/1200/B.cpp | #include <bits/stdc++.h>
#define gc getchar()
#define pc(x) putchar(x)
template<typename T> void scan(T &x){x = 0;register bool _=0;register T c=gc;_=c==45;c=_?gc:c;while(c<48||c>57)c=gc;for(;c<48||c>57;c=gc);for(;c>47&&c<58;c=gc)x=(x<<3)+(x<<1)+(c&15);x=_?-x:x;}
template<typename T> void printn(T n){register bool _=0;... | ALGO | 0.999955 | 3.607331 |
e5e840e5-a174-4380-83ba-bd51156bcb60 | Pavan-B-N/DSA-with-C_plus_plus | StriverAtoZ/Heaps/KthLargestElementInArray.cpp | // https://leetcode.com/problems/kth-largest-element-in-an-array/description/
// Can you solve it without sorting?
#include <queue>
#include <vector>
using namespace std;
// time complexity = o(n log k )
// space complexity = o(n)
class Solution
{
public:
int findKthLargest(vector<int> &nums, int k)
{
... | ALGO | 0.999955 | 5.518693 |
50ac7608-5c18-4423-8625-50fb8a3772fa | zhangmeishan/N3LDGClassifier | eigen/unsupported/doc/examples/MatrixLogarithm.cpp | #include <unsupported/Eigen/MatrixFunctions>
#include <iostream>
using namespace Eigen;
int main()
{
using std::sqrt;
MatrixXd A(3,3);
A << 0.5*sqrt(2), -0.5*sqrt(2), 0,
0.5*sqrt(2), 0.5*sqrt(2), 0,
0, 0, 1;
std::cout << "The matrix A is:\n" << A << "\n\n";
std::cout << "... | ALGO | 0.999254 | 3.621207 |
ec18144f-e07c-4444-a212-9fe7090f4f5f | sh-sho1kat/CODEFORCES | Codeforces Round 260 (Div. 1)/A_Boredom.cpp | ///********************** ุจูุณูู
ู ูฑูููููู ูฑูุฑููุญูู
ูููฐูู ูฑูุฑููุญููู
ู **********************///
/**
* author: Shefat Hossen Shoikat
* date : 2024-01-02 00:23:22
**/
#include <bits/stdc++.h>
using namespace std;
#define fastio ios_base::sync_with_stdio(false), cin.tie(NULL), cout.tie(NULL)
#define mod 1000000... | ALGO | 0.999861 | 4.438165 |
45591880-9aeb-4235-b275-8d7a181c0d71 | iamtasir/Competitive-programming | 2020/December/C. Social Distance.cpp | #include<bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef long double dl;
typedef unsigned long long ull;
#define pb push_back
#define PB pop_back
#define nn "\n"
#define O_O ios_base::sync_with_stdio(false); cin.tie(NUL... | ALGO | 0.999819 | 3.312707 |
94a1d18a-34a7-426d-9a32-9caecf578acc | marinnik/AoCPub | AoC6.cpp | #include<iostream>
#include<fstream>
#include<vector>
#include<string>
#include<sstream>
using namespace std;
vector<long long> outComma(istream& in, string& line);
vector<long long> countFishesByDays(vector<long long> fishes);
vector<long long> fishAging(vector<long long> fishes);
int main()
{
vector<long long> fi... | ALGO | 0.999255 | 3.995384 |
9b132ad9-656e-43a9-acfd-ae617a5baa1a | isaaclo97/programacion-competitiva | Problemas/UVA/369.cpp | #include <bits/stdc++.h>
#define INF 0x3F3F3F3F
using namespace std;
long long int binomialCoeff(long long int n, long long int k)
{
long long int C[k+1];
memset(C, 0, sizeof(C));
C[0] = 1;
for (long long int i = 1; i <= n; i++)
for (long long int j = min(i, k); j > 0; j--)
C[j] = C... | ALGO | 0.999254 | 4.059012 |
44a70958-88a3-4684-8cc7-fef0dca52105 | 9124tarun2004/DSa0192-C- | 11. Square root using IF-ELSE.cpp | #include <iostream>
#include <cmath> // For sqrt function
int main() {
double number, result;
std::cout << "Enter a number: ";
std::cin >> number;
if (number >= 0) {
result = sqrt(number);
std::cout << "The square root of " << number << " is " << result << std::endl;
} else {
... | TOOL | 0.991121 | 5.153456 |
358ba0a4-be82-4c25-8866-2464c65f427f | 192211877/Crytography | 28.cpp | #include <stdio.h>
#include <stdlib.h>
#include <math.h>
// Function to perform modular exponentiation
unsigned long long mod_exp(unsigned long long base, unsigned long long exp, unsigned long long mod) {
unsigned long long result = 1;
base = base % mod;
while (exp > 0) {
if (exp % 2 == 1) {
... | ALGO | 0.999968 | 4.467528 |
b7141b61-0d79-4854-85ef-f0484934f9af | arhanjain/Competitive-Programming-Solutions | mBIT/2021/Apple Orchard.cpp | #include<bits/stdc++.h>
using namespace std;
//funcs
#define mem(a, b) memset(a, (b), sizeof(a))
#define FOR(i, j, k, in) for(int i=j ; i<k ; i+=in)
#define SORT(v) sort(v.begin(), v.end())
#define SORTBY(v, comp) sort(v.begin(), v.end(). comp)
#define mp make_pair
#define pb push_back
#define MAXN (int)1e9
//types
t... | ALGO | 0.992997 | 3.50449 |
f6255a8f-aa59-43e0-ac0e-f4658a328b03 | AnuragPatel1/Codeforces-Problem | B_A_Perfectly_Balanced_String.cpp | #include <bits/stdc++.h>
using namespace std;
#define PI (3.141592653589)
#define int long long int
#define M 1000000007
#define pb push_back
#define f first
#define s second
#define rep(i,j) for(int i = 0; i<j; i++)
#define rrep(i,j) for(int i = j; i>=0; i--)
#define all(x) x.begin(), x.end()
#define print(x) cout <... | ALGO | 0.999837 | 4.32976 |
c49eb023-ea0e-4efe-a96d-93d6d23eb5e1 | umarfaruk2/code_forces | basic_problem/queue_at_the_school.cpp | #include <bits/stdc++.h>
using namespace std;
int main() {
ios_base::sync_with_stdio(0);
cin.tie(0);
int n, t;
cin >> n >> t;
string s;
cin >> s;
string st = "";
for(int i = 0; i < n; i += t + 1) {
if(s[i] == 'B' && s[i + t] == 'G') {
char temp = s[i];
... | ALGO | 0.999509 | 4.532412 |
d2cadfcd-7507-4a9f-8cb8-d7833b7f0a1e | depanshu357/CP-codes | NotaCheapString.cpp | #include<iostream>
#include<map>
using namespace std;
int main(){
int t;
cin>>t;
while(t--){
string s;
int p;
cin>>s;
cin>>p;
int arr[s.size()];
int price=0;
multimap<char,int> mp;
for(int i=0;i<s.size();i+... | ALGO | 0.999819 | 3.804782 |
42fd7fb2-7367-4445-8e27-e5ff3d71ae32 | ymwsimon/codecomp | codeforce/59a/a.cpp | #include <iostream>
#include <string>
using namespace std;
int main(){
string a;
cin>>a;
int count=0;
for(int i=0;i<a.length();i++)
if(a[i]<='Z')
count++;
if(count>a.length()-count)
for(int i=0;i<a.length();i++)
a[i]=toupper(a[i]);
else
for(int i=... | ALGO | 0.978666 | 4.827107 |
d3c62310-6cfd-418f-8168-877a0793ecef | proofy/boss | libraries/tdsp/dsp_fft.cpp | /**
A class for computing the fft for a vector. The computation is table based.
@author Wolfgang Hess
@author Karlheinz Stoeber
*/
#ifdef SWAP
#undef SWAP
#endif
#define SWAP(a,b) x=(a);(a)=(b);(b)=x;
#ifndef log2
#define log2(x) (log(x)/M_LN2)
#endif
template < class T >
void fft<T>::mbtrbtr (T * b, T * ... | ALGO | 0.999936 | 5.106957 |
22581558-56e7-4a99-b57b-b35ad2a69ace | An0nym0us-s1mple/QPro | prl_src/refactorROD.cpp | #include <iostream>
#include <cstdlib>
#include <fstream>
#include <string>
#include <cassert>
#include <vector>
#include <cmath>
#include <cstdint>
#include <numeric>
#include <mpi.h>
#include "nomask_Synthesizer4GE.hpp"
#include "MDR/Reconstructor/Reconstructor.hpp"
#include "MDR/Refactor/Refactor.hpp"
#include "SZ3/... | DATA | 0.988194 | 3.002334 |
cfe5b0da-6020-4efb-a898-ac06fcd85dd0 | MarceliEDU/kalko | 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 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.