uuid string | repo_name string | relative_path string | content string | category string | algo_rel_score float64 | quality_score float64 |
|---|---|---|---|---|---|---|
a9b1858a-a169-467f-a777-49eaefd0a7d8 | sangyx/algorithm | leetcode/Array/Minimum Size Subarray Sum.cpp | class Solution {
public:
int minSubArrayLen(int s, vector<int>& nums) {
int n = nums.size(), len = INT_MAX;
vector<int> sums(n + 1, 0);
for (int i = 1; i <= n; i++) {
sums[i] = sums[i - 1] + nums[i - 1];
}
for (int i = n; i >= 0 && sums[i] >= s; i--) {
... | ALGO | 0.999974 | 6.204933 |
0bd9dd9a-05b4-4f14-bfa0-85c28fbd86cc | wangyouwang/Win32Program | algorithm_training/51nod/select_pos.cpp | #include <stdio.h>
#include <string.h>
#include <math.h>
#include <stdlib.h>
#define max_num 10000
long long select_pos(int n, int *arrays)
{
long long short_distance = 0x7fffffffffffffffLL;
long long distance;
int i;
int j;
for (i = 0; i < n; i++) {
distance = 0;
for( j=0; j<n; j... | ALGO | 0.999967 | 3.649263 |
a9b77611-41de-4bb7-9ee5-57ecef5fcb61 | badmuffin/DSA | LC-Easy/083_RemoveDuplicatesSortList.cpp | /*
83. Remove Duplicates from Sorted List
--------------------------------------
Input: head = [1,1,2]
Output: [1,2]
*/
#include <iostream>
using namespace std;
struct ListNode {
int val;
ListNode *next;
ListNode() : val(0), next(nullptr) {}
ListNode(int x): val(x), next(nullptr) {}
ListNode(int x, ListNode... | ALGO | 0.999956 | 6.158742 |
94e4d64d-4265-481d-8ff3-b4d80959fff8 | elissabj/training | UVa jugde/benderBRP.cpp | //https://onlinejudge.org/index.php?option=com_onlinejudge&Itemid=8&category=609&page=show_problem&problem=2502
#include<bits/stdc++.h>
using namespace std;
int main(){
map<string,map<string,string>>combination;
combination["+x"]["+y"] = "+y";
combination["+x"]["-y"] = "-y";
combination["+x"]["+z"] =... | ALGO | 0.999548 | 4.363306 |
eef62066-419c-46c7-8048-3337281d45a7 | Pawank197/soc | leetcode/2352.cpp | #include <bits/stdc++.h>
using namespace std;
// LeetCode 2352: Equal Row and Column Pairs
// Problem link: https://leetcode.com/problems/equal-row-and-column-pairs/
class Solution {
public:
int equalPairs(vector<vector<int>>& grid) {
int ans = 0;
map<vector<int>, int> rowMap;
... | ALGO | 0.999941 | 6.531404 |
131ba535-756e-4c1a-b648-988217203793 | Blackfury7/LeetCode | 1395-count-number-of-teams/1395-count-number-of-teams.cpp | class Solution {
public:
int numTeams(vector<int>& rating) {
int res = 0;
for (auto i = 1; i < rating.size() - 1; ++i) {
int less[2] = {}, greater[2] = {};
for (auto j = 0; j < rating.size(); ++j) {
if (rating[i] < rating[j])
++less[j > i];... | ALGO | 0.999989 | 5.658036 |
d4da9aa5-5718-48d3-b4f9-712679ca6242 | riceroll/MylarFilmSimulator | lib/libigl/include/igl/mat_min.cpp | template <typename DerivedX, typename DerivedY, typename DerivedI>
IGL_INLINE void igl::mat_min(
const Eigen::DenseBase<DerivedX> & X,
const int dim,
Eigen::PlainObjectBase<DerivedY> & Y,
Eigen::PlainObjectBase<DerivedI> & I)
{
assert(dim==1||dim==2);
// output size
int n = (dim==1?X.cols():X.rows());
... | ALGO | 0.998416 | 4.811377 |
d68e4006-8756-4e77-8411-947461c6f9e2 | byterom/android_external_skia | src/effects/SkLightingImageFilter.cpp | #include "SkLightingImageFilter.h"
#include "SkBitmap.h"
#include "SkColorPriv.h"
#include "SkReadBuffer.h"
#include "SkWriteBuffer.h"
#include "SkReadBuffer.h"
#include "SkWriteBuffer.h"
#include "SkTypes.h"
#if SK_SUPPORT_GPU
#include "effects/GrSingleTextureEffect.h"
#include "gl/GrGLEffect.h"
#include "GrEffect.h"... | TOOL | 0.853158 | 7.62856 |
31915454-a041-4f2a-84f0-ede6bae1bf41 | AHussain98/CPP | Reversing a number.cpp | #include<iostream>
using namespace std;
int num = 1001;
int check = num;
int ans = 0;
int main() {
while (num > 0) {
ans = ans*10 + num%10;
num /= 10;
}
cout << ans << endl;
if (ans == check) {
cout << "pallindrome!" <<endl;
}
} | ALGO | 0.99977 | 4.29643 |
4386a229-a9d9-440f-bade-eb2aa2572a48 | minhvpham/Competitive_Programing | codeforces/kcbn.cpp | // Onegai no bug
// Author : 13minusone
#include<bits/stdc++.h>
using namespace std;
#define task "akarui"
#define SZ(c) (c).size()
#define getbit(x,i) (((x) >> (i)) & 1)
#define turnoff(x,i) (x)&(~(1<<(i)))
#define __builtin_popcount __builtin_popcountll
#define all(x) (x).begin(),(x).end()
#define pb(x) push_back(x)
... | ALGO | 0.999872 | 3.958063 |
e307ca36-1487-4e6c-8976-5c3b152ec305 | PixelStuffs/frameworks_av | media/libeffects/lvm/lib/SpectrumAnalyzer/src/LVPSA_QPD_Init.cpp | #include "LVPSA_QPD.h"
/************************************************************************************/
/* */
/* FUNCTION: LVPSA_QPD_Init */
/* ... | TOOL | 0.951784 | 5.494559 |
9c07513a-22ef-43a2-aa09-837e0da4cf2a | ishandutta2007/codeforces | xellos/normal/336/A.cpp | // iostream is too mainstream
#include <cstdio>
// bitch please
#include <iostream>
#include <vector>
#include <set>
#include <tr1/unordered_map>
#include <string>
#include <queue>
#include <stack>
#include <algorithm>
#include <cmath>
#define dibs reserve
#define OVER9000 234567890
#define tisic 47
#define soclose 10e... | ALGO | 0.999867 | 3.239696 |
fd69f1df-1e33-4831-a4f1-b1357a3de110 | khaledsliti/CompetitiveProgramming | Codeforces/Other/CF1117-D12-C.cpp | /********************************************************************************************************
Author: RedStone
Problem link:
https://codeforces.com/contest/1117/problem/C
Idea:
If we can reach the destination point after x days so we can reach it after (x + 1) days. Because we can simply go ... | ALGO | 0.999943 | 4.491774 |
7a5e1cc0-eb96-41b5-a184-79ee4fa572b1 | AdarshGzz/LeetCode-DSA | 2846-robot-collisions/2846-robot-collisions.cpp | class Solution {
public:
vector<int> survivedRobotsHealths(vector<int>& positions, vector<int>& healths, string directions) {
int n = positions.size();
vector<vector<int>> robots;
for (int i = 0; i < n; ++i) {
robots.push_back({positions[i], healths[i], directions[i], i});
... | ALGO | 0.999978 | 6.312618 |
dfaa3d83-a07b-45e4-8bed-6a6ced0d8d12 | Mokhaled2004/Algorithm | LabTask1/Huffman.cpp | #include <cstdio>
#include <cstdlib>
#include <cstring>
#include <iostream>
using namespace std;
class Node
{
public:
char data;
int freq;
Node *left;
Node *right;
Node(char d, int f) : data(d), freq(f), left(nullptr), right(nullptr) {}
};
class MinHeap
{
private:
int size;
int capacity;
... | ALGO | 0.999995 | 5.590215 |
d5adf700-9acd-454c-981d-875edeedf894 | Pramoth-N/DAA | day4/workout/heapSort.cpp |
/*
Given an array of integers, implement the Heapsort algorithm to sort the array in ascending order.
Input Format
• An integer n represents the size of the array.
• The next line represents the value of the array.
Output Format
• Displays the array in the ascending order.
• Print -1, if the array is already sorted.
... | ALGO | 0.99998 | 5.285806 |
a51aa937-03fb-4607-a306-8a1cd2909dc7 | ishandutta2007/codeforces | plasmatic/normal/735/D.cpp | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
// Defines and one-liners
#define INF 0x3f3f3f3f
#define LLINF 0x3f3f3f3f3f3f3f3f
template <typename T> inline T& back(vector<T> &vec) { return *(vec.end() - 1); }
template <typename T> inline void pop(vector<T> &vec) { return vec.erase(vec.end() - ... | ALGO | 0.999937 | 4.429847 |
4d5c3872-c496-4ba3-a589-160b7446b673 | SiyangShao/codes | codeforces/2022/VP/R179/A.cpp | #include <bits/stdc++.h>
using namespace std;
using ll = long long;
auto solve() {
ll n;
cin >> n;
vector<ll> a(n);
map<ll, ll> mp;
for (auto &i : a) {
cin >> i;
mp[i]++;
if (n % 2 == 1 && mp[i] > (n + 1) / 2) {
cout << "NO\n";
return;
}
... | ALGO | 0.999925 | 4.746781 |
87ef720d-5bd6-47de-be9d-da06961c35c2 | Maxhu787/tmp | scist/1/w3/toj36.cpp | #include <iostream>
#define ll long long
using namespace std;
ll solve(ll a, ll b, ll c) {
ll result = 1;
a = a % c;
while(b > 0) {
if(b % 2 != 0) {
result = (result * a) % c;
}
b /= 2;
a = (a * a) % c;
}
return result;
}
int main() {
long long a, b, c;
cin >> a >> b >> c;
cout ... | ALGO | 0.999986 | 4.885606 |
600130aa-2841-4bac-b9b3-538882ef1356 | abdul-karim007/Flutter-Practice | class19june/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.998299 | 6.797273 |
1fe5dc6d-1fba-4f0c-88c5-69a0816f5f61 | Inventor77/Leetcode | Challenges/2021/12.Dec_2021/Dec_04_Stream_of_Characters.cpp | class Node {
private:
Node* links[26];
bool isEnd;
public:
Node()
{
isEnd = false;
for (int i = 0;i < 26;i++) links[i] = NULL;
}
Node* get(char c)
{
if (links[c - 'a'] == NULL) return NULL;
else return links[c - 'a'];
}
void set(char c)
{
... | ALGO | 0.999239 | 6.716809 |
10363865-2e8b-4671-acc5-54ac8d172d69 | theneuronarc/LeetCodeAlgorithms | src/sort_colors.cpp | /*
https://leetcode.com/problems/sort-colors/
Given an array with n objects colored red, white or blue, sort them so that objects of the same color are adjacent, with the colors in the order red, white and blue.
Here, we will use the integers 0, 1, and 2 to represent the color red, white, and blue respectively.
Note... | ALGO | 0.999615 | 6.130566 |
7e6ccf15-6331-4b4a-bfa4-a18f4b0f871a | canaltecniqueza/XBSX2 | pcsx2/SPU2/ADSR.cpp | #include "PrecompiledHeader.h"
#include "Global.h"
#include "common/Assertions.h"
static const s32 ADSR_MAX_VOL = 0x7fffffff;
static const int InvExpOffsets[] = {0, 4, 6, 8, 9, 10, 11, 12};
static u32 PsxRates[160];
void InitADSR() // INIT ADSR
{
for (int i = 0; i < (32 + 128); i++)
{
int shift = (i - 32) >> 2;
... | TOOL | 0.957714 | 5.458573 |
6c694f9d-5808-4c44-a970-a380a6b68802 | Agasthya-Samyak-Jnan/LeetCode-Problems | Easy/Check If it is a Straight Line.cpp | #include<bits/stdc++.h>
using namespace std;
// Link to the Problem : https://leetcode.com/problems/check-if-it-is-a-straight-line/
// Difficulty : Easy
/* SLOPE OF A STRAIGHT LINE IS SAME BETWEEN ANY TWO POINTS ON IT. AVOID DIVISION OPERATOR. */
class Solution {
public:
bool checkStraightLine(vector<vector<int>... | ALGO | 0.999638 | 5.363368 |
32197c59-d173-4a47-a3a0-0138913d15d7 | CrazyNicolas/AFEA | code/MFEA/Matrix.cpp | #include "Matrix.h"
#include <cstring>
#include <algorithm>
#include <stdio.h>
#include <cmath>
#include <time.h>
using namespace std;
Matrix::Matrix()
{
mat = NULL;
}
Matrix::Matrix(int _a, int _b) //Create a matrix with size a * b and fitted with 0s
{
a = _a; b = _b;
mat = new double*[a];
for (int i = 0; i < ... | ALGO | 0.985256 | 3.210921 |
2e2abb2a-2186-4147-9e12-bb358cd11a96 | tayu0110/atcoder | arc/arc134d.cpp | #include <iostream>
#include <iomanip>
#include <string>
#include <vector>
#include <algorithm>
#include <utility>
#include <tuple>
#include <map>
#include <queue>
#include <deque>
#include <set>
#include <stack>
#include <numeric>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <cmath>
#include <casse... | ALGO | 0.999998 | 3.43397 |
ba842e08-51f5-4606-8d43-23fcd36361f5 | a-h-taju/Cpp-Practice | Lab-1/11.cpp | /*....11....Implement a function that computes the result of raising a
number to a given power. Then, apply this function to calculate
powers for various numbers and exponents.*/
#include <iostream>
#include <iomanip>
using namespace std;
double power(double base, int exponent)
{
double result = 1.0;
bool isNe... | ALGO | 0.996595 | 6.492352 |
edf45296-691a-4742-9b23-d64709b9781f | vbonnici/grafe-sim | analysis/data/p00000/s229748691.cpp | #include<iostream>
int main(){
int a=0,i,b;
for(i=1;i<10;i++){
a=a+1;
for(b=1;b<10;b++){
std::cout<<a<<"x"<<b<<"=";
std::cout<<a*b<<std::endl;
}
}
return 0;
} | ALGO | 0.920156 | 3.468874 |
5109bf06-8946-4d8c-8c48-46c502573d3a | dixe/NMM | GameLib/src/GameMap.cpp | #include "stdafx.h"
#include "GameMap.h"
#include "Position.h"
namespace GameLib
{
void GameMap::Initialize(){
SetupNineMMMap();
}
// assume checks has been made to validate if the move is legal according to the rules before calling this function
void GameMap::Move(Node &fromNode, Node &toNode... | ALGO | 0.992366 | 5.60562 |
904c080f-2a38-4313-811f-d34f420e5ab5 | Marcus-Programmer/Trabalho-grafos | etapa2/main.cpp | #include <iostream>
#include <fstream>
#include <sstream>
#include <iomanip>
#include <filesystem>
#include <vector>
#include <string>
#include "Graph.hpp"
#include "Solver.hpp"
using namespace std;
namespace fs = std::filesystem;
// Função para ler arquivo de entrada e configurar solver
Solver* parseInputFile(const ... | ALGO | 0.964478 | 5.814746 |
c5c13f3f-4213-4bf9-a467-c06ef377d420 | Il-Capitano/cppb | src/analyze.cpp | #include "analyze.h"
#include <filesystem>
#include <fstream>
#include <iterator>
#include <cassert>
#include <string_view>
#include <nlohmann/json.hpp>
using json = nlohmann::json;
struct include_file
{
std::string path;
bool is_library;
};
static std::string get_file(fs::path const &file_path)
{
std::ifstream f... | TOOL | 0.987577 | 7.278751 |
26afab0f-b6c8-422f-8ce3-87d999bd08a2 | Ali-hey-0/opencv | modules/dnn/src/ocl4dnn/src/ocl4dnn_conv_spatial.cpp | #include "../../precomp.hpp"
#include <opencv2/core/utils/configuration.private.hpp>
#include <string>
#include <vector>
#include <fstream>
#include <sys/stat.h>
#include "../include/common.hpp"
#include "../include/ocl4dnn.hpp"
#include "opencl_kernels_dnn.hpp"
#include "../include/math_functions.hpp"
#include "../i... | TOOL | 0.914608 | 5.825357 |
23911acd-ebab-421f-a33e-809dab5c22c1 | sugikazu75/atcoder | submissions/atcoder.jp/arc108/arc108_b/Main.cpp | #include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for(int i = 0; i < n; i++)
#define all(v) v.begin(), v.end()
typedef long long ll;
int main(){
ll n;
cin >> n;
string s;
cin >> s;
vector <char> t;
ll ans = n;
for(int i=0; i<n; i++){
t.push_back(s[i]);
if(t.s... | ALGO | 0.999587 | 3.962066 |
b0d5f279-693d-43e0-9ace-4634e5ef0cf4 | jwelyl/ps | kakao/220125/[3차] 방금 그곡_retry2.cpp | // https://programmers.co.kr/learn/courses/30/lessons/17683
#include <string>
#include <vector>
#include <cmath>
#include <iostream>
#define CSH 'V'
#define DSH 'W'
#define FSH 'X'
#define GSH 'Y'
#define ASH 'Z'
using namespace std;
int time_to_min(string t) { // HH:MM 시각 문자열을 분 단위 시각 정수로 바꿈
return stoi(t.subs... | ALGO | 0.999359 | 5.6971 |
401c9f7e-7fc8-4b98-a4af-53bfd7c64165 | QUSIR/opencore-amr_demo | opencore-amr-0.1.3/opencore/codecs_v2/audio/gsm_amr/amr_wb/dec/src/isp_isf.cpp | /*
------------------------------------------------------------------------------
Filename: isp_isf.cpp
------------------------------------------------------------------------------
INPUT AND OUTPUT DEFINITIONS
int16 isf[], (i) Q15 : isf[m] normalized (range: 0.0<=val<=0.5)
int16 isp[], (o) ... | ALGO | 0.995429 | 5.672958 |
74323bcf-4e18-481c-adc4-39d783b00cb5 | sKAR04/CP-Practice | Codeforces/433/433A.cpp | /*
#####################################################
# I will win.. maybe not immediately but definitely #
#####################################################
*/
#include <bits/stdc++.h>
using namespace std;
//save time
#define endl '\n'
typedef long long ll;
//for sorting
#define all(a) a.begin(),a.end()
//C... | ALGO | 0.999853 | 3.941983 |
42494fab-57d7-4237-8a5d-df713c97500d | Dmitriy282/BI-118 | Краснокутський Денис/Chapter 1/Lab 1.3.1.cpp | #include <iostream> //we included iostream
#include <iomanip> //we included iomanip
#include <string> //we included string
using namespace std;
int main()
{
int minute = 60; // minute in seconds
int hour = 60 * minute; // hour in seconds
int three_hours = 3 * hour; // 3 hours in seconds (3*60*60)
... | ALGO | 0.956666 | 3.309416 |
c6c7a80e-21eb-490e-8106-d76a4cc2d006 | jwnhy/lam | llvm-project/libc/src/stdfix/abshr.cpp | #include "abshr.h"
#include "src/__support/common.h"
#include "src/__support/fixed_point/fx_bits.h"
#include "src/__support/macros/config.h"
namespace LIBC_NAMESPACE_DECL {
LLVM_LIBC_FUNCTION(short fract, abshr, (short fract x)) {
return fixed_point::abs(x);
}
} // namespace LIBC_NAMESPACE_DECL
| ALGO | 0.907518 | 6.021568 |
fa75dc5b-3e46-4f0f-9de4-598b44c8d503 | MohammedKhaled-co/Pomodoro-Timer-Task-Management-mobile-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 |
fca93837-6e32-4b56-ad86-64bc26a381ea | bhupendra-dew/Self | Python/OPENCV_learning and porjects/opencv-4.x/modules/objdetect/src/barcode_decoder/abs_decoder.cpp | #include "../precomp.hpp"
#include "abs_decoder.hpp"
namespace cv {
namespace barcode {
void cropROI(const Mat &src, Mat &dst, const std::vector<Point2f> &rects)
{
std::vector<Point2f> vertices = rects;
int height = cvRound(norm(vertices[0] - vertices[1]));
int width = cvRound(norm(vertices[1] - vertices[... | ALGO | 0.996036 | 7.098686 |
5957c19e-cd20-4769-a074-d89e310c243e | IcEy-999/MyUESource | Engine/Source/ThirdParty/hlslcc/hlslcc/src/hlslcc_lib/opt_if_simplification.cpp | /**
* \file opt_if_simplification.cpp
*
* Moves constant branches of if statements out to the surrounding
* instruction stream.
*/
#include "ShaderCompilerCommon.h"
#include "ir.h"
#include "IRDump.h"
class ir_if_simplification_visitor : public ir_hierarchical_visitor
{
public:
ir_if_simplification_visitor()
{
th... | ALGO | 0.96278 | 7.538625 |
e0b49680-697b-46c1-b89b-1cf3c6ff1b75 | legendrig/rigcoin | src/rpcmining.cpp | #include "main.h"
#include "db.h"
#include "init.h"
#include "bitcoinrpc.h"
using namespace json_spirit;
using namespace std;
// Return average network hashes per second based on the last 'lookup' blocks,
// or from the last difficulty change if 'lookup' is nonpositive.
// If 'height' is nonnegative, compute the esti... | WEB | 0.953078 | 5.51202 |
88143e09-4345-484f-8431-5ffd7eaa95b4 | nbulsi/also | lib/nbulsi-mockturtle/experiments/rewrite.cpp | #include <lorina/aiger.hpp>
#include <mockturtle/algorithms/cleanup.hpp>
#include <mockturtle/algorithms/node_resynthesis/xag_npn.hpp>
#include <mockturtle/algorithms/rewrite.hpp>
#include <mockturtle/algorithms/xag_balancing.hpp>
#include <mockturtle/io/aiger_reader.hpp>
#include <mockturtle/networks/xag.hpp>
#include... | TOOL | 0.87677 | 5.331346 |
02c9ebe3-d5ae-4a1e-99d3-46ec04c740d1 | eunjiyun/2021-Data_Structure | dataStructure/Week10/10-lolDic_f.cpp | #include"10-lolDic.h"
champion_bt* Insert_SL(champion_bt* head,int* lengthSl, char position[], char name[], int hp, int attack, int defense)
{
struct champion_bt* champ = (champion_bt*)malloc(sizeof(struct champion_bt));
strcpy_s(champ->position, 13, position);
strcpy_s(champ->name, 13, name);
champ->hp = hp;
cha... | ALGO | 0.986312 | 3.005815 |
6ecb2b2a-b140-4067-beef-75f1fed6f582 | sk10salman/placement | sort.cpp | #include<iostream>
#include<bits/stdc++.h>
using namespace std;
int main()
{
char ar[4];
for(int i=0;i<4;i++)
cin>>ar[i];
sort(ar,ar+4);
cout<<ar<<" ";
return 0;
}
| ALGO | 0.999048 | 3.003411 |
678c8347-d675-4d9e-95cb-8fa2edbfc2e6 | patrick03524/Algebra-Abstracta | Trash/weas/main.cpp | #include <iostream>
#include <string.h>
#include "Encriptado.h"
using namespace std;
/*
string alfabeto = "abcdefghijklmnopqrstuvwxyz";
unsigned int len = alfabeto.size();
string encrip_mensa(string mensaje){
string mensaje_encrip;
for(unsigned int i= 0; i<mensaje.size(); i++){
mensaje_encrip+=alfabeto... | TOOL | 0.933619 | 3.686713 |
0e7a86a2-434d-4c78-b45d-a10268547bb9 | tridibsamanta/GeeksforGeeks_Solutions | Practice/Check_if_an_array_is_sorted.cpp | /**
* Title : Check if an array is sorted
* Author : Tridib Samanta
* Link : https://practice.geeksforgeeks.org/problems/check-if-an-array-is-sorted/0
**/
#include<bits/stdc++.h>
using namespace std;
int isArraySorted(int arr[], int n) {
if (n == 1)
return 1;
if (arr[n-1] < arr[n-2])
... | ALGO | 0.999838 | 5.01326 |
4b16155d-b968-4443-89dd-d3da1fd5d218 | ASHRAFUL-QU10/CPP-PROGRAMMING-OPP | outercircle2DM.cpp | #include<iostream>
#include<conio.h>
using namespace std;
main()
{
int a[5][20],n,m,i,j;
cout<<"Enter no. of Rows and Columns:";
cin>>n>>m;
cout<<"Enter Matrix:";
for(i=0;i<n;i++)
{
for(j=0;j<m;j++)
{
cin>>a[i][j];
}
}
int w,x,y,z;
w=0; //rows
x=0;
y=n-1; //rows
z=m-1;
for(i=w;i<=y;i... | ALGO | 0.999586 | 3.089948 |
97be7ec9-121b-4eaa-a83b-4e678638cb42 | yymin1022/Algorithm_Study | BOJ/14221.cpp | #include <bits/stdc++.h>
using namespace std;
int dijkstra(int);
bool store[5001];
int dist[5001];
int N, M, p, q;
vector<pair<int, int>> cost[5001];
int main(){
cin.tie(0);
cout.tie(0);
ios_base::sync_with_stdio(false);
cin >> N >> M;
for(int i = 0; i <= N; i++){
dist[i] = 2147483647;... | ALGO | 0.999973 | 4.258936 |
5d4a26f5-1b78-4a20-82fe-12d16286cda7 | githubwys/Struct-PL-SVO | 3rdparty/line_descriptor/src/LSDDetector_custom.cpp | #include "precomp_custom.hpp"
//using namespace cv;
namespace cv
{
namespace line_descriptor
{
Ptr<LSDDetectorC> LSDDetectorC::createLSDDetectorC()
{
return Ptr<LSDDetectorC>( new LSDDetectorC() );
}
/* compute Gaussian pyramid of input image */
void LSDDetectorC::computeGaussianPyramid( const Mat& image, int numO... | ALGO | 0.998238 | 5.350739 |
0f231199-7ed6-4719-960d-c3c3eef8548e | ishandutta2007/codeforces | _guoyh_/normal/1580/C.cpp | # include <bits/stdc++.h>
# define ll long long
# define fst first
# define snd second
using namespace std;
const int MAXN = 400051;
const int MAXB = 505;
int n, m, b, cnt;
ll px[MAXN], py[MAXN];
int r[MAXB][MAXB];
int d[MAXN];
int st[MAXN];
void add(int nw, int id){
st[id] = nw;
if (px[id] + py[id] > b){
for (int ... | ALGO | 0.999853 | 3.925557 |
acd7e689-2448-4e85-8276-7b7b3a9e58c4 | Kawser-nerd/CLCDSA | Source Codes/CodeJamData/15/02/17.cpp | #include <iostream>
#include <stdio.h>
#include <algorithm>
using namespace std;
int main()
{
FILE* reader = fopen("B-large.in", "r");
int T;
fscanf(reader, "%d", &T);
for (int t=1; t<=T; t++) {
int D;
fscanf(reader, "%d", &D);
int P[1000];
for (int i=0; i<D; i++) {
... | ALGO | 0.999713 | 3.352913 |
b57fcaef-9f0b-42cd-a171-d79efd13617c | adityakuppa26/Algorithms | Searching/linear_search.cpp | int linear_search(int arr[], int n, int x) // x is the required element to be found
{
for(int i=0;i<n;i++)
{
if(arr[i]==x)
{
return i;
}
}
}
| ALGO | 0.999865 | 4.098095 |
82f1202e-d706-49a0-8695-6820873fb7e8 | Kulkarni-Vaishnavi/Data-Structures---Algorithms | 05_Queues/03_Circular_queue.cpp | #include <iostream>
#define n 10
using namespace std;
/* run this program using the console pauser or add your own getch, system("pause") or input loop */
class que{
int *a;
int front;
int rear;
public:
que(){
a = new int[n];
front=-1;
rear = -1;
}
bool isfull(){
if((rear+1 % n)== front)
return... | ALGO | 0.958384 | 3.547231 |
01d05b8b-cbd9-47b8-be10-5f80d7fa98f0 | welkin-qing/C | c++/期中考试/字符串替换.cpp | #include<iostream>
#include<string>
using namespace std;
int main()
{
string a,b,c,m;
int i,j;
getline(cin,a);
while(1){
getline(cin,m);
if(m.compare("end")==0) break;
a=a+'\n';
a=a+m;
}
a=a;
getline(cin,b);
getline(cin,c);
i=a.find(b);
while(i!=string::npos) //npos==-1ʾ
{
a.replace(i,b.length()... | ALGO | 0.975872 | 3.190278 |
47d8c345-9e4d-436b-b10b-c31678f0a882 | souravbiswassanto/Codeforces | 1547C.cpp |
// Problem: C. Pair Programming
// Contest: Codeforces - Codeforces Round #731 (Div. 3)
// URL: https://codeforces.com/contest/1547/problem/C
// Memory Limit: 512 MB
// Time Limit: 2000 ms
// Powered by CP Editor (https://github.com/cpeditor/cpeditor)
#include <bits/stdc++.h>
#pragma GCC diagnostic ignored "-Wunused-... | ALGO | 0.999579 | 3.950046 |
9619d227-b1e9-42bc-9926-22e23e630b05 | sarvex/leetcode-guile | solution/0200-0299/0219.Contains Duplicate II/Solution.cpp | class Solution {
public:
bool containsNearbyDuplicate(vector<int>& nums, int k) {
unordered_map<int, int> d;
for (int i = 0; i < nums.size(); ++i) {
if (d.count(nums[i]) && i - d[nums[i]] <= k) {
return true;
}
d[nums[i]] = i;
}
ret... | ALGO | 0.999976 | 6.374495 |
44391f66-5828-490a-98f1-2e6e27b8c0a2 | divykantsharma/Leetcode-Solution | 0543-diameter-of-binary-tree/0543-diameter-of-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.999928 | 6.652221 |
adabcf0c-1e18-4b20-a024-428b2a57534c | Andycode3759/competitions | 2022_Q4/YZOJ.C1357_12.26/N/N.cpp | // Score: 83/100
// WA
#include <bits/stdc++.h>
using namespace std;
const double EPS = 1e-7;
double getHeight(double x, double y, double w)
{
double lt = sqrt(x * x - w * w), rt = sqrt(y * y - w * w);
return lt * rt / (lt + rt);
}
int main()
{
double x, y, c;
while (scanf("%lf%lf%lf", &x, &y, &c) == ... | ALGO | 0.999923 | 3.639536 |
5faf3542-ce87-46be-bb7a-ed518ba4e735 | vineetjai/Spoj | FENCE1.cpp | #include<iostream>
#include<stdio.h>
#define pi 3.14159
using namespace std;
int main(){
int l;
cin>>l;
while(l!=0){
double f;
f=double(l*l)/(2*pi);
printf("%.2f\n",f);
cin>>l;
}
}
| ALGO | 0.999375 | 3.310165 |
a3391f6d-949d-44f9-800e-b6e693978958 | imWhS/ProblemSolving | baekjoon_5532/main.cpp | /*
5532 방학 숙제
방학 숙제는 수학 B 페이지, 국어 A 페이지 풀기다.
방학은 총 L 일이다.
하루에 국어는 최대 C 페이지, 수학은 최대 D 페이지 풀 수 있다.
input
L (2 <= L <= 40)
A (1 <= A, B <= 1000)
B
C (1 <= C, D <= 100)
D
output
겨울 방학동안 숙제를 하지 않고 놀 수 있는 최대 날의 수
*/
#include <iostream>
using namespace std;
int L, A, B, C, D;
void solution() {
//방학 일수 ... | ALGO | 0.999795 | 3.692854 |
31571f2d-6b6c-47cb-83aa-8eabecf791af | scarsty/lammps_m | src/KOKKOS/pair_eam_kokkos.cpp | /* ----------------------------------------------------------------------
Contributing authors: Stan Moore (SNL), Christian Trott (SNL)
------------------------------------------------------------------------- */
#include "math.h"
#include "stdio.h"
#include "stdlib.h"
#include "string.h"
#include "kokkos.h"
#inclu... | ALGO | 0.998147 | 6.408046 |
8dfaf4a7-86d5-4ddb-820d-15b02849ae8e | RahulScripted/CodeChef | Algorithm-Practice-Codechef/Number Theory/ApplesAndOranges.cpp | // Rushitote went to a programming contest to distribute apples and oranges to the contestants. He has N apples and M oranges, which need to be divided equally amongst the contestants. Find the maximum possible number of contestants such that:
// 1. Every contestant gets an equal number of apples; and
// 2. Every con... | ALGO | 0.999185 | 5.856018 |
ffe8b897-c4e6-4737-b8ab-3011678c4591 | PavitraMahakulkar/cp- | code/Repetitionscses.cpp | #include<iostream>
#include<bits/stdc++.h>
using namespace std;
int main()
{
string s;
cin>>s;
int ans=0;
int c=0;
char l='A';
for(char d:s){
if(d==l){
++c;
ans=max(ans,c);
}
else{
c=1;
l=d;
}
}
cout<<ans;
} | ALGO | 0.997948 | 3.348387 |
59856b77-636c-4038-b0fd-41432a60edb6 | navamee4/CPPDS-EXPERIMENTS | matrix.cpp | #include <iostream>
using namespace std;
int main()
{
int i,j;
int arr[4][2]={{1,2},{4,5},{7,8},{10,11}};
int mat[4][2]={{1,2},{4,5},{7,8},{10,11}};
int sum[4][2];
cout<<"2D array:\n";
for(i=0;i<4;i++)
{
for(j=0;j<2;j++)
{
cout<<"\t"<< arr[i][j];
}
cout<<endl;
}
for(i=0;i<4;i++)
{
for(j=0;j... | ALGO | 0.999656 | 3.653108 |
fb1597e7-a18f-48ab-bfdd-24f7fded9c91 | hasnatnayeem/uva_solutions | 11650 Mirror Clock.cpp | #include <iostream>
#include <cstdio>
using namespace std;
int main()
{
int hour, minute, TC;
char c;
// freopen("input.txt", "r", stdin);
// freopen("output.txt", "w", stdout);
cin >> TC;
while (TC--)
{
cin >> hour >> c >> minute;
if (hour == 12 && minute > 0)
{
... | ALGO | 0.988485 | 3.72196 |
e0576afd-e28f-45bc-b520-4393924480dc | jayendra1107/data-structure-and-algorithms | Linked List/10_remove_duplicates_from_sorted_linked_list.cpp | // Program to remove duplicates from sorted linked list
#include<iostream>
#include "Node.cpp" // This line calls the Node.cpp where a class is created to build linked list data type
using namespace std;
// Input Linked List
// This function takes input until -1
Node *take_input() {
int data;
cin>>data;
N... | ALGO | 0.999952 | 5.743503 |
1f14ef50-f20a-4f12-8341-6632f475ef4c | CySpiegel/CS3800-Operating-Systems | pa05_scheduler/schedulers.cpp | #include "schedulers.h"
//Round Robin scheduler implementation. In general, this function maintains a double ended queue
//of processes that are candidates for scheduling (the ready variable) and always schedules
//the first process on that list, if available (i.e., if the list has members)
int RoundRobin(const int& c... | ALGO | 0.998865 | 4.03429 |
3521bf61-0d2c-4e38-99cb-c65b6322aa51 | ayush9009/Placement-Drive-Classes | AmazonSheet SumOfSubarrayMinimum.cpp | class Solution {
public:
// 2 9 7 8 3 4 6 1
// 0 1 2 3 4 5 6 7 (0 base indexing)
// suppose element is 3 to 3 prevSmaller=2 ,nextSmaller=1
// nextSmaller indeX+1 means these are the elemtns which are greater than 3 in right side
// prevSmaller index+1 means these are the elements ehich are greater than 3 in lefft si... | ALGO | 0.999975 | 5.763591 |
162676e2-1123-4d07-9246-ccaa44fd3234 | SahitSunny/DSA-Questions | Arrays/2-D_Arrays/7.Binary_Search.cpp | #include<bits/stdc++.h>
using namespace std;
int main()
{
int row,col;
cin>>row>>col;
vector<vector <int>> matrix(row, vector<int> (col));
for(int i=0; i<row; i++)
{
for(int j=0; j<col; j++)
{
int ele = 0;
cin>>ele;
matrix[i][j] = ele;
}
... | ALGO | 0.999779 | 4.163387 |
f1312ff6-ee8b-4207-8060-65d3f06ae1a9 | PranavBahuguna/KT-ThirdParty | boost_1_72_0/libs/phoenix/example/bind_goose.cpp | // bind_goose.cpp
// This example is based on code by Paul Heil to be found here:
// http://www.codeproject.com/Tips/248492/How-does-boost-phoenix-improve-boost-bind
//
// Show different ways of using boost bind and phoenix to handle deletion.
//
#include <iostream>
#include <boost/function.hpp>
#include <boost/bind.h... | TOOL | 0.967054 | 5.729767 |
3774b6b1-693a-4624-8194-19a39b6e567e | dmkz/competitive-programming | codeforces.com/Codeforces Ladder 1500-1599/0322B.cpp | /*
Problem: 322B. Ciel and Flowers
Solution: combinatorics, math
*/
#include <iostream>
#include <vector>
#include <algorithm>
int main() {
int a, b, c; std::cin >> a >> b >> c;
int res = a / 3 + b / 3 + c / 3;
if (a > 0 && b > 0 && c > 0) {
res = std::max(res, (a-1) / 3 + (b - 1) / 3 + (c ... | ALGO | 0.999876 | 4.754751 |
9ffccc43-c2b3-4534-95d2-5419ae48772d | zcsky/code | T37571.cpp | #include<iostream>
#include<math.h>
using namespace std;
int main()
{
int m,n,sum;
cin>>m>>n;
if(m<=1) m=2;
for(;m<=n;++m)
{
int temp=sqrt(m);
sum=1;
for(int i=2;i<=temp;++i)
{
if(m%i==0) sum+=i+m/i;
if(sum>m) break;
}
if(sum==m) cout<<m<<endl;
}
return 0;
}
// 64
| ALGO | 0.999988 | 3.739429 |
59a3c8d0-2c83-4de3-b7e6-2f4cb12c44de | karan-pawar-09/codeforces | A_Binary_Decimal.cpp |
#include<bits/stdc++.h>
using namespace std;
#define ll long long
void solve() {
ll n;
cin>>n;
string s=to_string(n);
ll answer=0;
for(ll i=0;i<s.size();i++) {
answer=max(answer,(ll)(s[i]-'0'));
}
cout<<answer<<endl;
}
int32_t main() {
ios_base::... | ALGO | 0.999697 | 5.062981 |
cc5aad9f-062e-4fab-8f62-3d19bcd671db | ChenXingLing/OI-Algorithm-Template | 【DP动态规划】/背包/【模板】泛化物品 (烹调方案).cpp | // luogu-judger-enable-o2
#include<algorithm>
#include<cstring>
#include<cstdio>
#define lg long long
lg ans,T,n,i,j,f[100010];
struct QAQ{lg a,b,v;}Q[55];
inline bool cmp(const QAQ &a,const QAQ &b){return a.v*b.b<b.v*a.b;}
int main(){
scanf("%lld%lld",&T,&n);
for(i=1;i<=n;i++)scanf("%lld",&Q[i].a);
for(i=1;i<=n;i++... | ALGO | 0.999979 | 3.45878 |
ce2c7dbc-e806-4c10-bff0-97ba41de8ee4 | Jai-Marothiya/Complete-DSA | Lec-37-1.cpp | // Find all the subsequences of a string
#include <bits/stdc++.h>
using namespace std;
void solve(vector<string> &ans, string output, int index, string &str)
{
// Base case
if (index >= str.length())
{
if (!output.empty())
ans.push_back(output);
return;
}
// Exclude ind... | ALGO | 0.999941 | 5.657952 |
c06957f8-d779-4593-9028-eb228d981cc1 | MichaelKrLim/ChessEngine | src/magic_main.cpp | #include <array>
#include <fstream>
#include "Magic_generation_util.h"
#include "Magic_util.h"
#include "Pieces.h"
#include "Position.h"
using namespace engine;
int main()
{
std::ofstream magic_header("magic_squares.h");
std::array<Magic_square, 64> bishop_magic_squares{};
magic_header <<
R"(#include <array>
#i... | CONFIG | 0.870646 | 5.815868 |
ed4b76ea-07c5-4c21-9501-b35bf02be153 | deGekata/OlympSeminars | 3_sem/Base/Contest1/O-labirint.cpp | #include <iostream>
#include <algorithm>
#include <vector>
int main() {
int N, M, K;
std::cin >> N >> M >> K;
std::vector<std::vector<uint64_t>> matrix(N + 2, std::vector<uint64_t>(M + 2, 0));
std::vector<std::vector<std::vector<uint64_t>>> dp_cnt(K + 2, std::vector<std::vector<uint64_t>>(N + 2, s... | ALGO | 0.999843 | 4.670148 |
0a72bd96-a89f-4ebb-9eac-0dc0c5e60cec | bhyeanhasan/Competitive-Programming-Solutions | Code Forces Problem Solutions/A. Add Odd or Subtract Even.cpp | /*
Md Babul Hasan (Noyen)
Patuakhali Science and Technology University
Faculty of Computer Science and Engineering
16 th Batch (PSTU-CSE-2019)
<EMAIL> // B H Yean Hasan
*/
#include<bits/stdc++.h>
#define ll long long int
#define pi acos(-1)
#define vc vector<ll>
#define in(a) scanf("%d",&a)
#define... | ALGO | 0.999781 | 3.711287 |
f92ac736-9c39-449b-a06b-edf2648393c1 | Iportill2/CPP09 | ex02/main.cpp |
#include "PmergeMe.hpp"
int main(int argc, char **argv)
{
if (argc < 2)
{
std::cout << "Error" << std::endl;
return 1;
}
try
{
PmergeMe pm(argv);
std::cout << "Before: ";
pm.printVec();
pm.algorithm();
}
catch(const std::exception &e)
{
std::cerr << e.what() << std::endl;
return 1;
}
retur... | ALGO | 0.854665 | 4.675865 |
ea7aab13-11e6-4e84-b654-585939facb44 | DavideD96/Esercizi-di-LSN | lezione 6/ISING_1Ddef/Monte_Carlo_ISING_1D.cpp | /****************************************************************
*****************************************************************
_/ _/ _/_/_/ _/ Numerical Simulation Laboratory
_/_/ _/ _/ _/ Physics Department
_/ _/_/ _/ _/ Universita' degli Studi di Milano
_/ _/ ... | ALGO | 0.997807 | 4.163902 |
6bca2b1c-9064-421c-9687-e8e105820013 | ang198/HDU | src/ripple/shamap/impl/SHAMapSync.cpp | //------------------------------------------------------------------------------
//==============================================================================
#include <ripple/basics/random.h>
#include <ripple/shamap/SHAMap.h>
#include <ripple/nodestore/Database.h>
namespace ripple {
void
SHAMap::visitLeaves(std... | ALGO | 0.966795 | 7.018589 |
2824e580-79a3-445f-a483-f27a0f8b7b0e | polarr/competitive-programming | USACO/Gold/2016Open/1.cpp | /**
* Solution by 1egend
* Date: 2024-01-29
* Contest: USACO 2016 Open
* Problem: Gold P1. Splitting the Field
**/
#include <bits/stdc++.h>
using namespace std;
#define mp make_pair
#define pb push_back
#define ull unsigned long long
#define ll long long
const int MAX_N = 1e5 + 1;
const int MOD = 1e9 + 7;
const... | ALGO | 0.999821 | 4.776797 |
a71e1e09-17d8-4548-9c3a-5d36f0fc3d73 | sugamkarki/NAMI-Year-II-Term-I-Software_Engineering | Samir's files/Week 4/5.cpp | #include <iostream>
using namespace std;
int main(){
int accounts[] = {5658845, 1302850, 7825877, 7576651, 4520125, 7895122,8080152, 4562555, 1250255, 1005231, 7881200, 4581002, 8777541, 5552012, 6545231, 8451277, 5050552,3852085};
int searched;
cout << "Enter the bank account number: ";
cin... | ALGO | 0.976578 | 3.863899 |
02db5f33-15e2-405a-be4e-6a2f6e926c07 | aimpert/FPGA_FIR_Filter | src/FIRFilter.cpp | #include "../include/FIRFilter.h"
//#define baseline
//#define pipelined
#define full_unroll
#ifdef full_unroll
void fir(data_t *y, data_t x) {
coef_t c[N] = {53, 0, -91, 0, 313, 500, 313, 0, -91, 0,53};
static data_t shift_reg[N];
acc_t acc = 0;
int i;
#pragma HLS array_partition variable=shift_r... | ALGO | 0.983671 | 4.598327 |
9df003e0-5cfc-40bf-a7eb-c526092f6c28 | dye8128/ABC | 308A.cpp | #include <bits/stdc++.h>
using namespace std;
int main() {
vector<int> s(8);
for(int i = 0; i < 8; i++){
cin >> s.at(i);
}
bool flag = true;
for(int i = 0; i < 7; i++){
if(s.at(i) > s.at(i + 1)) flag = false;
if(s.at(i) < 100 || s.at(i) > 675) flag = false;
if(s.at(i... | ALGO | 0.999692 | 3.368946 |
49c7d188-800d-4f69-b7dc-181ccfb82edb | lfq0921/NJU-Problem-Solving | OJ/board-3.cpp | #include <cstring>
#include <algorithm>
#include <cstdio>
#include <iostream>
#include <queue>
using namespace std;
typedef long long ll;
const int N = 500 + 5; //
const int M = 2500 + 5; //
const ll inf = 0x3f3f3f3f3f3f3f3fll;
bool flag[N][N] = {0};
inline int read()
{
int x = 0, f = 1;
char ch = getchar();
... | ALGO | 0.999827 | 3.591519 |
78e90bee-c05e-4da9-bba2-d7f7b15a6a84 | pawan1498/CODECHEF | December/long/februry/long challenge/chef_next_gen.cpp | #include <iostream>
using namespace std;
int main()
{
int t;
cin >> t;
while (t--)
{
int a, b, x, y;
cin >> a >> b >> x >> y;
if ((a * b) > (x * y))
cout << "No" << endl;
else
cout << "Yes" << endl;
}
} | ALGO | 0.998955 | 3.994425 |
a9158740-6789-44ec-be90-2c115906361f | AatirNadim/cpp-solutions | Stack/daily_temperatures.cpp | // problem link --> https://leetcode.com/problems/daily-temperatures/
// my solution link --> https://leetcode.com/problems/daily-temperatures/discuss/2926431/C%2B%2B-oror-Stack-oror-Easy
class Solution {
public:
vector<int> dailyTemperatures(vector<int>& temperatures) {
int n = temperatures.size();
... | ALGO | 0.999872 | 6.656907 |
7f40edc3-7eb7-49a6-a806-36b30a068069 | zero24x/hotshotcoin | src/netbase.cpp | #include "netbase.h"
#include "util.h"
#include "sync.h"
#include "hash.h"
#ifndef WIN32
#include <sys/fcntl.h>
#endif
#include <boost/algorithm/string/case_conv.hpp> // for to_lower()
#include <boost/algorithm/string/predicate.hpp> // for startswith() and endswith()
using namespace std;
// Settings
static proxyTyp... | TOOL | 0.984382 | 4.974189 |
be851d65-9427-4f8f-a396-8e4459069cd7 | Ali-Noghabi/QR-Factorization | eigen-3.4.0/eigen-3.4.0/unsupported/doc/examples/MatrixFunction.cpp | #include <unsupported/Eigen/MatrixFunctions>
#include <iostream>
using namespace Eigen;
std::complex<double> expfn(std::complex<double> x, int)
{
return std::exp(x);
}
int main()
{
const double pi = std::acos(-1.0);
MatrixXd A(3,3);
A << 0, -pi/4, 0,
pi/4, 0, 0,
0, 0, 0;
std::... | ALGO | 0.999043 | 4.353816 |
e90b42fe-f851-4b60-b6ee-0d92b65548fb | RotterYkrn/atcoder | abc/abc351~375/abc363/c/main.cpp | #ifdef __TEMPLATE__
#pragma region template
#endif
#include <bits/stdc++.h>
using namespace std;
#if __has_include(<atcoder/all>)
#include <atcoder/all>
using namespace atcoder;
#endif
// おまじない
#pragma GCC target("avx")
#pragma GCC optimize("O3")
#pragma GCC optimize("unroll-loops")
struct Init { Init() { ios::sync_w... | ALGO | 0.999968 | 5.305875 |
e204a961-9685-43e0-996a-201da755c172 | preanto/beecrowdsolve | 1009.cpp | #include <iostream>
using namespace std;
int main() {
char name[50];
double a , b,s=0,y=0;
cin>>name>>a>>b;
s = b*0.15;
y = s+a;
printf("TOTAL = R$ %.2lf\n",y);
return 0;
}
| TOOL | 0.978555 | 4.020757 |
7a9c3ffa-145b-405a-9cdc-99ba64cbe3d1 | No-needto-recall/cmdGame | src/PokemonDataCalculation.cpp | #include "PokemonDataCalculation.h"
//静态数据成员初始化
DataType PokemonDataCalculation::_defaultData = 1;
PokemonDataCalculation& PokemonDataCalculation::getInstance()
{
static PokemonDataCalculation instance;
return instance;
}
DataType PokemonDataCalculation::CalculatPokemonData(Pokemon* pokemon, PokemonDataType type)
... | TOOL | 0.87326 | 5.629538 |
e6c55265-dc51-4493-b384-95e5483eb4d7 | ishandutta2007/codeforces | kmjp/normal/333/D.cpp | #include <bits/stdc++.h>
using namespace std;
typedef signed long long ll;
#undef _P
#define _P(...) (void)printf(__VA_ARGS__)
#define FOR(x,to) for(x=0;x<to;x++)
#define ITR(x,c) for(__typeof(c.begin()) x=c.begin();x!=c.end();x++)
#define ZERO(a) memset(a,0,sizeof(a))
#define MINUS(a) memset(a,0xff,sizeof(a))
//-----... | ALGO | 0.999858 | 3.897322 |
4f506b1b-b5c8-4176-b464-36ef2d6aeb13 | mptoolkit/mptoolkit-old | junk/kondo-exactdiag.cpp | typedef IrredTensor<std::complex<double> > OpType;
OpType CHup, CHdown, Cup, Cdown, CHupP, CHdownP, CupP, CdownP, BandI;
OpType BandSz, BandSp, BandSm, SpinSp, SpinSm, SpinSz, SpinI;
#define SIGN -
OpType MakeHopping(OpType const& LeftIdent)
{
return tensor_prod(tensor_prod(LeftIdent, CHupP), Cup)
+ tensor_... | ALGO | 0.998823 | 5.633723 |
a56d9dff-cf2b-48fa-a6e5-6c0744b6889f | SidanthR/MyPepcoding | 3_FunctionAndArray/reverseAnArray.cpp | #include<iostream>
using namespace std;
void reverse(int* arr, int n){
// write your code here
for(int i = n - 1, j = 0; i >= n/2 ; i--, j++) {
int temp = arr[j];
arr[j] = arr[i];
arr[i] = temp;
}
}
void display(int* arr, int n){
for(int i = 0 ; i < n; i++){
cout<<... | ALGO | 0.999679 | 5.004319 |
b64bd2fa-7272-492e-bb91-40152823c24d | Panda381/PicoLibSDK | PicoPad/GAME/TVTENNIS/src/main.cpp |
// ****************************************************************************
//
// Main code
//
// ****************************************************************************
#include "include.h"
#define SEGM 4 // base segment size in pixels
#define DIGW 4 // digit width in segmen... | ALGO | 0.966818 | 5.11336 |
f4bc1015-5f05-4e5d-a61a-0367087caf54 | uraniumhub/uranium | src/rpcrawtransaction.cpp | #include <boost/assign/list_of.hpp>
#include "base58.h"
#include "bitcoinrpc.h"
#include "db.h"
#include "init.h"
#include "main.h"
#include "net.h"
#include "wallet.h"
using namespace std;
using namespace boost;
using namespace boost::assign;
using namespace json_spirit;
//
// Utilities: convert hex-encoded Values
... | WEB | 0.915907 | 7.089581 |
8b64301e-f978-457c-93d4-2bc8f0ac8d0d | VuHai-Sec/LilStormy | CPP0501.cpp | #include <bits/stdc++.h>
using namespace std;
struct Point {
double x, y;
};
void input(Point &a) {
cin >> a.x >> a.y ;
}
double distance(Point a, Point b) {
return sqrt( pow( (a.x - b.x ), 2 ) + pow( (a.y - b.y), 2) );
}
int main(){
struct Point A, B;
int t;
cin>>t;
while(t--){
input(A);... | ALGO | 0.998703 | 4.301476 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.