uuid string | repo_name string | relative_path string | content string | category string | algo_rel_score float64 | quality_score float64 |
|---|---|---|---|---|---|---|
0993e777-75bd-4611-b10d-06f1e22b60ff | Yush1nk1m/Problem-Solving | BOJ/Random/25513_BFS.cpp | /**
* @file 25513_BFS.cpp
* @brief 00:51:44
* @date 2024-08-11
*
* @copyright Copyright (c) 2024
*
*/
#include <bits/stdc++.h>
using namespace std;
#define NONE -1
int r, c, r6, c6;
int dr[4] = { -1, 0, 1, 0 };
int dc[4] = { 0, -1, 0, 1 };
vector<vector<int>> board(5, vector<int>(5));
vector<vector<vector... | ALGO | 0.999934 | 5.178588 |
8634a2fa-dc1c-459a-9006-435d0303ac5c | ishandutta2007/codeforces | yuu/normal/949/C.cpp | #include <bits/stdc++.h>
using namespace std;
#define FOR(i, j, k) for(int i=(j); i<=(k); i++)
#define FFOR(i, j, k) for(int i=(j); i<(k); i++)
#define DFOR(i, j, k) for(int i=(j); i>=(k); i--)
#define bug(x) cerr<<#x<<" = "<<(x)<<'\n'
#define pb push_back
#define mp make_pair
#define setbit(s, i) (s|=(1LL<<(i)))
#defi... | ALGO | 0.999997 | 3.273524 |
da31bdbe-0b27-4b80-8dd9-a8388c3016a7 | jpbonfim/w1-hackathon | frontend/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.998336 | 6.772262 |
06d3a85b-c631-4ebb-8c18-47cbb922d15d | Arya23D/code | 3213-count-subarrays-where-max-element-appears-at-least-k-times/3213-count-subarrays-where-max-element-appears-at-least-k-times.cpp | class Solution {
public:
long long countSubarrays(vector<int>& nums, int k) {
long long res = 0;
int max_element = 0, maxi_count = 0;
for (int i = 0; i < nums.size(); i++) {
max_element = max(max_element, nums[i]);
}
for (int right = 0, left = 0; right < nums.si... | ALGO | 0.999945 | 6.126576 |
8fc7d1ff-d25d-40da-a87d-637c1914bb81 | skkuso/scope-ocr | scope-ocr --username aravindh.shankar.91@gmail.com/tess-two/tess-two/jni/com_googlecode_tesseract_android/src/cube/cube_utils.cpp | #include <math.h>
#include <string>
#include <vector>
#include "cube_utils.h"
#include "char_set.h"
#include "unichar.h"
namespace tesseract {
CubeUtils::CubeUtils() {
}
CubeUtils::~CubeUtils() {
}
// convert a prob to a cost (-ve log prob)
int CubeUtils::Prob2Cost(double prob_val) {
if (prob_val < MIN_PROB) {
... | TOOL | 0.944154 | 6.316905 |
f4c0ff2a-2d7a-4d0b-96c9-6fb0e4a715cc | Mydeen0302/Data_Structure | leetcode/inttoeng.cpp | #include<bits/stdc++.h>
using namespace std;
vector<string> belowten={"","One","Two","Three","Four","Five","Six","Seven","Eight","Nine"};
vector<string> belowtwenty={"Ten","Eleven","Twelve","Thirteen","Fourteen","Fifteen","Sixteen","Seventeen","Eighteen","Nineteen"};
vector<string> belowhundred={"","Ten","Tewnt... | ALGO | 0.999093 | 5.27684 |
b9da2f96-75c2-45de-aaaf-cd48429653de | hank55663/competition-programming | hw4/2/B.cpp | #include<bits/stdc++.h>
#define LL long long
#define pii pair<int,int>
#define pdd pair<double,double>
#define x first
#define y second
#define pb push_back
#define mp make_pair
#define MEM(x) memset(x,0,sizeof(x))
#define MEMS(x) memset(x,-1,sizeof(x))
using namespace std;
#define MXN 100005
pdd operator-(const pdd &p... | ALGO | 0.999842 | 3.490533 |
f920e264-fdd5-4988-a45a-dae8b16f4d90 | furkantektas/FingerTracker | FingerTracking/calibration.cpp | #include "calibration.h"
#include <fstream>
using namespace cv;
using namespace std;
Calibration::Calibration() {
boardSize = Size(9,6);
}
void Calibration::displayPairIndex(Mat& img) {
std::ostringstream imageIndex;
imageIndex<<stereoPairIndex<<"/"<<noOfStereoPairs;
int baseLine = 0;
Size txtSiz... | TOOL | 0.854151 | 5.952624 |
6a7acb2d-ac5f-4ddf-9197-15415f66e853 | eclipse-oniro-mirrors/communication_netstack | frameworks/native/http/http_client/http_client_constant.cpp | #include "http_client_constant.h"
#include <unistd.h>
#include <string>
namespace OHOS {
namespace NetStack {
namespace HttpClient {
const char *const HttpConstant::HTTP_METHOD_GET = "GET";
const char *const HttpConstant::HTTP_METHOD_HEAD = "HEAD";
const char *const HttpConstant::HTTP_METHOD_OPTIONS = "OPTIONS";
const... | CONFIG | 0.923591 | 5.59953 |
8ee41c0b-1857-41c2-bce0-5320102c8e26 | wotsushi/competitive-programming | abc/abc104/d/main.cpp | #include "template.hpp"
using mint = modint1000000007;
int main() {
STR(S);
ll Q = 0;
auto dp = vec(mint, 4, 4);
dp[0][0] = 1;
each(c, S) {
if (c == 'C') {
rep(j, 3) { dp[3][j] += dp[2][j]; }
}
if (c == 'B') {
rep(j, 2) { dp[2][j] += dp[1][j]; }
}
if (c == 'A') {
++dp[1]... | ALGO | 0.999912 | 4.128998 |
a977abb7-33a4-4707-9a7b-527ae74cf6d1 | oxygen-hunter/Flashboom | data/big-vul-100/add_attention_code/Mixtral/top0-100/median-of-a-row-wise-sorted-matrix-Solution.matrixMedian/177842_+Info.cpp | _PUBLIC_ codepoint_t next_codepoint_handle_ext(
struct smb_iconv_handle *ic,
const char *str, charset_t src_charset,
size_t *bytes_consumed)
{
/* it cannot occupy more than 4 bytes in UTF16 format */
smb_iconv_t descriptor;
size_t ilen_o... | ALGO | 0.998512 | 5.161011 |
7960688a-77db-4aa1-9b9f-e2e4539d54aa | mexyusef/fmus-3g | src/media/codec.cpp | #include "fmus/media/codec.hpp"
#include "fmus/core/logger.hpp"
#include <algorithm>
#include <cmath>
namespace fmus::media {
// G.711 μ-law and A-law implementation
namespace g711 {
// μ-law compression tables
static const int16_t MULAW_BIAS = 0x84;
static const int16_t MULAW_CLIP = 32635;
// A-law compression con... | TOOL | 0.875108 | 6.727007 |
ec351edf-1a9b-4b7b-b6e9-183866612130 | cwalther/Plasma-nobink-test | Sources/Plasma/CoreLib/hsMatrix44.cpp | #include "HeadSpin.h"
#include "hsGeometry3.h"
#include "hsQuat.h"
#include "hsMatrix44.h"
#include "hsStream.h"
#include <math.h>
#ifdef HS_SIMD_INCLUDE
# include HS_SIMD_INCLUDE
#endif
static hsMatrix44 myIdent = hsMatrix44().Reset();
const hsMatrix44& hsMatrix44::IdentityMatrix() { return myIdent; }
// CPU-optim... | ALGO | 0.979699 | 5.538184 |
dddf548e-e153-4bef-9279-5cae4f8297e8 | Arc-Team/android_device_oneplus_oneplus3 | gps/utils/loc_misc_utils.cpp | #define LOG_NDEBUG 0
#define LOG_TAG "LocSvc_misc_utils"
#include <stdio.h>
#include <string.h>
#include <log_util.h>
#include <loc_misc_utils.h>
#include <ctype.h>
int loc_util_split_string(char *raw_string, char **split_strings_ptr,
int max_num_substrings, char delimiter)
{
int raw_stri... | TOOL | 0.954149 | 5.32358 |
4d3bcd25-7983-4c9d-966b-0e8e433915a4 | vki/TTWinClient | 3rdParty/src/cxImage/cxImage/ximatran.cpp | // xImaTran.cpp : Transformation functions
/* 07/08/2001 v1.00 - Davide Pizzolato - www.xdp.it
* CxImage version 6.0.0 02/Feb/2008
*/
#include "ximage.h"
#include "ximath.h"
#if CXIMAGE_SUPPORT_BASICTRANSFORMATIONS
////////////////////////////////////////////////////////////////////////////////
bool CxImage::GraySc... | TOOL | 0.945424 | 5.679199 |
9305c67f-9a17-4818-9f40-cd61796cd0b0 | mirandaholmes/stratification-paper | CodesOutputs/b2/ParticlesPolymer.cpp | //
// Particles_WormChain.cpp
//
//
// Created by Miranda Holmes-Cerfon on 2019-07-18.
//
#include "Particles.hpp"
// Initialize all the variables that depend on particular system.
void Particles::setup(void) {
nstats = 2;
rad = 0.5*VectorXd::Ones(n*dim); // radii (all ones)
// potential energy... | ALGO | 0.999426 | 4.477107 |
8c73d664-159a-4f6f-83c6-234a7560a16b | mohammedjasam/Technical-Interview-Guide | LeetCode/leetcode_target-sum.cpp | /*
*
* Tag: DFS
* Time: O(2^n)
* Space: O(n)
*/
class Solution {
public:
int findTargetSumWays(vector<int>& nums, int S) {
int ans = 0;
if(nums.size() == 0)
return ans;
int sum = 0, n = nums.size();
dfs(sum, ans, nums, 0, n, S);
return ans;
}
private:
void... | ALGO | 0.999996 | 6.022293 |
525cf58d-628f-46c7-82e6-350574e6573a | Heyitskezia/Chapter-4-Programming-Challenge | Page 220 no. 4.cpp | #include<iostream>
using namespace std;
int main()
{
double length1, length2, width1, width2, area1, area2;
cout << "FIND OUT WHICH RECTANGLE AREA IS GREATER" << endl << endl ;
cout << "Please input the length of rectangle 1: " ;
cin >> length1;
cout << "Please input the width of rectangle 1: " ;
cin >> width... | ALGO | 0.998016 | 3.404392 |
1fd7c6e7-a66d-45f0-9d28-46147aff352a | Chestha31/100-Days-of-Leetcode | Day2/sol3.cpp | class Solution {
public:
vector<int> sortArrayByParity(vector<int>& nums) {
vector<int> even;
vector<int> odd;
for(int i=0;i<nums.size();i++){
if(nums[i]%2==0){
even.push_back(nums[i]);
}
else{
odd.push_back(nums[i]);
... | ALGO | 0.999978 | 5.643566 |
9e700c5e-ae43-4a17-993e-a7120b0e7cd4 | batzor/AlgorithmsForEverything | scraped_leetcode_solutions/k-closest-points-to-origin.cpp | class Solution {
public:
static bool dist_cmp(vector<int> pt1, vector<int> pt2){
return pt1[0] * pt1[0] + pt1[1] * pt1[1]
< pt2[0] * pt2[0] + pt2[1] * pt2[1];
}
vector<vector<int>> kClosest(vector<vector<int>>& points, int k) {
sort(points.begin(), points.end(), dist_cmp);
... | ALGO | 0.999999 | 5.966465 |
cb80d6e4-db0d-4be8-bd90-df1e9822c22a | PepToniBibiloni/IMEDEA | src/c++_calib/undistort_rectify.cpp | #include <opencv2/core/core.hpp>
#include <opencv2/calib3d/calib3d.hpp>
#include <opencv2/highgui/highgui.hpp>
#include <opencv2/imgproc/imgproc.hpp>
#include <stdio.h>
#include <iostream>
#include "popt_pp.h"
using namespace std;
using namespace cv;
int main(int argc, char const *argv[])
{
Mat R1, R2, P1, P2, Q;
... | TOOL | 0.931481 | 4.763611 |
4bc671a1-2cf6-4de0-af9c-1899afb56c76 | Abrackadabrr/FEFM_cpp_3sem | Chapter_2/seminar_5/tasks_for_templates/01_is_prime.cpp | template < unsigned int p, unsigned int d >
struct Check_Is_Prime
{
static constexpr bool value =
(p % d != 0) && Check_Is_Prime < p, d - 1 > ::value;
};
template < unsigned int p >
struct Check_Is_Prime < p, 2 >
{
static constexpr bool value = (p % 2 != 0);
};
template < unsigned int p >
struct Is_Prime
{
s... | ALGO | 0.999595 | 6.029754 |
e98129b0-b6d7-4785-bcf9-9cb158b6e994 | jackfiled/luogu | src/P1621.cpp | #include <cstdio>
#include <cmath>
#include <vector>
#include <unordered_set>
#include <memory>
using namespace std;
// 引用https://www.luogu.com.cn/blog/nopartyfoucaodong/solution-p3383
bool isPrime(int x)
{
if (x == 1)
{
return false;
}
if (x == 2 || x == 3)
{
return true;
}
... | ALGO | 0.999875 | 3.839744 |
c5e443e0-4bca-4dee-aeb9-4b1d202b7b33 | ishandutta2007/codeforces | marcin_smu/normal/1158/B.cpp | #pragma GCC optimize("O3")
#include <bits/stdc++.h>
// #include <ext/pb_ds/assoc_container.hpp>
// using namespace __gnu_pbds;
// gp_hash_table<int, int> mapka;
using namespace std;
#define PB push_back
#define MP make_pair
#define LL long long
#define int LL
#define FOR(i,a,b) for(int i = (a); i <= (b); i++)
#define ... | ALGO | 0.999987 | 3.197778 |
8777d2c4-b1c7-4207-83b3-8bb7e9fd276f | scorpaust/UE4Engine | Engine/Source/ThirdParty/ICU/icu4c-53_1/source/common/ucharstrie.cpp | #include "unicode/utypes.h"
#include "unicode/appendable.h"
#include "unicode/ucharstrie.h"
#include "unicode/uobject.h"
#include "unicode/utf16.h"
#include "cmemory.h"
#include "uassert.h"
U_NAMESPACE_BEGIN
UCharsTrie::~UCharsTrie() {
uprv_free(ownedArray_);
}
UStringTrieResult
UCharsTrie::current() const {
... | ALGO | 0.988127 | 7.309044 |
61649164-df59-4471-9b8b-f5540abe0522 | sarvex/leetcode-raku | solution/2300-2399/2352.Equal Row and Column Pairs/Solution.cpp | class Solution {
public:
int equalPairs(vector<vector<int>>& grid) {
int n = grid.size();
vector<vector<int>> g(n, vector<int>(n));
for (int j = 0; j < n; ++j) {
for (int i = 0; i < n; ++i) {
g[i][j] = grid[j][i];
}
}
int ans = 0;
... | ALGO | 0.99997 | 6.067993 |
c3068b49-494d-41ea-b990-ca93c39c0a00 | Hasanul-Bari/oop | stl/program 14.2 using lists.cpp | #include<iostream>
#include<list>
#include<cstdlib>
using namespace std;
void display( list<int> &a)
{
list <int> :: iterator itr;
for(itr=a.begin(); itr!=a.end(); itr++)
{
cout<<*itr<<", ";
}
cout<<endl;
}
int main()
{
list<int> list1;
list<int> list2(5);
for(int i=0; i<3; i... | ALGO | 0.961429 | 3.933062 |
335c144e-fe0c-4b2b-beb6-8d1309b98c9b | mkp0/CP | LeetCode/79. Word Search.cpp | class Solution
{
public:
bool dfs(vector<vector<char>> &board, int i, int j, string word, int idx)
{
if (idx == word.size())
return true;
if (i >= board.size() || j >= board[0].size() || board[i][j] == '?' || word[idx] != board[i][j])
return false;
char temp = bo... | ALGO | 0.99998 | 6.327492 |
aedcafa3-5ed9-4742-8cc3-5d8a60669957 | aaporosh/Algorithm | lift.cpp | #include<bits/stdc++.h>
using namespace std;
int main(){
int t;
cin >> t;
for(int i=1;i<=t;i++){
int a,b;
cin >> a>>b;
int sum=16+ abs(b-a)*4;
int add = sum+(a*4) +3;
cout << "Case " <<i<<": "<<add<<endl;
}
} | ALGO | 0.999408 | 3.999618 |
19097e08-cb8e-4e3e-b46f-0758ae05d3b6 | dongqh/leetcode | algorithms/cpp/findTheWinnerOfTheCircularGame/findTheWinnerOfTheCircularGame.cpp | // Date : 2025-05-27
/**
* @Solution 1: Simulation with List
* @Time complexity: O(n^2)
* @Space complexity: O(n)
* @Date: 2025-05-27 09:18:54
*/
int findTheWinner(int n, int k) {
vector<int> vec;
for (int i = 1; i <= n; ++i) {
vec.push_back(i);
}
int start = 0;
while (vec.size() > ... | ALGO | 0.999995 | 6.052918 |
ad5af8d3-47e3-4abb-9bab-8646930dd16c | alexandraback/datacollection | solutions_5652388522229760_0/C++/additya1998/gcj.cpp | #include<bits/stdc++.h>
using namespace std;
bool get(int cur, int a[]){
while(cur){
a[cur%10] = 1;
cur/=10;
}
for(int i=0; i<10; ++i) if(!a[i]) return 0;
return 1;
}
int ans[1100000];
int main(){
ans[0] = -1;
for(int i=1; i<=1000001; ++i){
int a[10];
memset(a,0,sizeof a);
int cur = i;
while(!get(cur,... | ALGO | 0.999581 | 5.042833 |
0522e8d2-0ea0-461e-b36f-b352fede5d4f | 113bommy/deepmind_codecontests_refine | cpp_gold_filter_file/cpp_train_4219_23.cpp | #include <bits/stdc++.h>
using namespace std;
int n, m, s;
int a[100100];
int main() {
cin >> n >> m;
for (int i = 1; i <= n; i++) {
cin >> a[i];
}
sort(a + 1, a + 1 + n, greater<int>());
for (int i = 1; i <= n; i++) {
s = s + a[i];
if (s >= m) {
cout << i;
return 0;
}
}
cout <... | ALGO | 0.999993 | 4.884633 |
097b432a-5cf1-4b1a-9d28-344ae85c281e | Shivampahuja12/DSA-IN-CPP | Arrays/unionOfTwoArrays.cpp | #include<iostream>
#include<vector>
#include<algorithm>
using namespace std;
vector<int> unionNoDup(vector<int> &a, vector<int> &b){
vector<int> ans;
for (int i=0; i<a.size(); i++){
ans.push_back(a[i]);
}
for (int i=0; i<b.size(); i++){
ans.push_back(b[i]);
}
return ans;
}
vect... | ALGO | 0.999891 | 4.80046 |
ad255ceb-07fc-48cd-8bd2-c1f10cc3ec18 | nasheenkalam037/ECE650 | A2/a2-ece650.cpp | #include <iostream>
#include<string>
#include<queue>
#include<vector>
#include<bits/stdc++.h>
#define arraySIZE 100
using namespace std;
int i,j;
int startpoint;
int endpoint;
int aArray[arraySIZE][arraySIZE];
int number_of_vertice;
queue <int> queue_of_points;
int visited[arraySIZE],distance_value[arraySIZE];
int p... | ALGO | 0.999434 | 3.839077 |
90a9a646-3b8d-4326-9c4e-b6517d477966 | sarvex/leetcode-d | solution/2100-2199/2100.Find Good Days to Rob the Bank/Solution.cpp | class Solution {
public:
vector<int> goodDaysToRobBank(vector<int>& security, int time) {
int n = security.size();
if (n <= time * 2) return {};
vector<int> left(n);
vector<int> right(n);
for (int i = 1; i < n; ++i)
if (security[i] <= security[i - 1])
... | ALGO | 0.999982 | 5.924258 |
cecc5283-a1c5-4701-a40c-29888cd3c905 | goingeast/data-structure-and-algorithms | 71-Simplify-Path/solution.cpp | class Solution {
public:
string simplifyPath(string path) {
string res, tmp;
vector<string> stk;
stringstream ss(path);
while(getline(ss,tmp,'/')) {
//if (tmp == "" or tmp == ".") continue;
if (tmp == ".."){
if( !stk.empty()){
... | ALGO | 0.999971 | 5.817043 |
d2a208dd-9f36-4f9a-9689-ca253735b7a3 | smadi0x86/Hallucina | obfuscator-llvm/clang-tools-extra/clangd/Headers.cpp | #include "Headers.h"
#include "Preamble.h"
#include "SourceCode.h"
#include "clang/Basic/SourceLocation.h"
#include "clang/Basic/SourceManager.h"
#include "clang/Frontend/CompilerInstance.h"
#include "clang/Lex/HeaderSearch.h"
#include "clang/Lex/PPCallbacks.h"
#include "clang/Lex/Preprocessor.h"
#include "clang/Toolin... | TOOL | 0.929387 | 7.900454 |
68fdd308-21fa-42aa-a82e-5bab0c818bc1 | thegamer1907/Code_Analysis | contest/1542593918.cpp | #include <iostream>
#include <cstdio>
#include <cstdlib>
#include <cmath>
#include <algorithm>
#include <climits>
#include <cstring>
#include <string>
#include <set>
#include <bitset>
#include <map>
#include <queue>
#include <stack>
#include <vector>
#include <cassert>
#include <ctime>
#define rep(i,m,n... | ALGO | 0.999975 | 4.067214 |
05382a5a-91d1-40f0-ab9d-66a19e029029 | LoganJoe/training-data | 2018.8/2018.08.13/string.cpp | #include<bits/stdc++.h>
#define N 1005
int n, top, type, k;
std::vector<std::string> s;
std::string tmp;
char ch[N];
int main ()
{
freopen("string.in","r",stdin);
freopen("string.out","w",stdout);
scanf ("%s", ch); n = strlen (ch);
scanf ("%d%d", &type, &k);
for (int i = 0; i < n; i++)
for (int j = i; j < n; j+... | ALGO | 0.999982 | 3.430238 |
5e191c39-18c9-4c30-b456-e624c126397f | AveshVerma/DSA-for-Interviews-Coding-Blocks | recursion/duplicate_char_formatting.cpp | #include<bits/stdc++.h>
using namespace std;
void dupFormat(char s[], int i){
if(s[i] == '\0'){
return;
}
if(s[i] == s[i+1]){
int j = i+1;
while(s[j]!='\0'){
j++;
}
while(j>=i+1){
s[j+1] = s[j];
j--;
}
s[i+1] = '*';... | ALGO | 0.999953 | 3.271033 |
3e3bfb47-5740-4e32-85a0-d6f5637e7e9c | Bole0331/MS | src/serial/Handle Holes/main.cpp | #include <iostream>
#include <cstdlib>
#include <ctime>
#include <vector>
#include <set>
#include <queue>
#include <map>
#include "point.h"
#define next nxt
using namespace std;
typedef pair<pair<int, int>, pair<int, int> > Pair;
vector<point> v;
// for exact correctness
vector<bool> ok;
vector<int> order;
vector... | ALGO | 0.996507 | 3.696875 |
43602825-c454-4f6a-81bb-78e04548fd01 | SachinBhandari/ProgrammingBuildingBlocks | DS/Stack_Using_Classes.CPP | #include<iostream.h>
#include<conio.h>
#include<process.h>
class stack
{
int a[10];
int top;
public:
void push(int v);
void pop();
void display();
stack()
{
top=-1;
}
};
void stack::push(int v)
{
if(top==9)
{
cout<<"\nStack overflow!!";
exit(1);
}
else
{
top++;
a[top]=v;
}
}
void stack::po... | ALGO | 0.99054 | 3.502293 |
33bc9d5b-aa94-4d2e-8305-956d016f3246 | changsongzhu/leetcode | C++/category/misc/214_h.cpp | /**
214[H]. Shortest Palindrome
Given a string S, you are allowed to convert it to a palindrome by adding characters in front of it. Find and return the shortest palindrome you can find by performing this transformation.
For example:
Given "aacecaaa", return "aaacecaaa".
Given "abcd", return "dcbabcd".
**/
class Solut... | ALGO | 0.999823 | 6.515883 |
d3a319b6-07cc-481f-ac46-d6c42b49d295 | PeizhongQiu/leetcode | 05/29/1022.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.999985 | 6.265599 |
18d32470-fcc4-4f4d-88dd-ad89c7b2b2a1 | Altafalam3/LeetCode | submissions/remove-duplicates-from-sorted-list-ii/Runtime Error/9-12-2023, 8_05_12 PM/Solution.cpp | // https://leetcode.com/problems/remove-duplicates-from-sorted-list-ii
/**
* Definition for singly-linked list.
* struct ListNode {
* int val;
* ListNode *next;
* ListNode() : val(0), next(nullptr) {}
* ListNode(int x) : val(x), next(nullptr) {}
* ListNode(int x, ListNode *next) : val(x), ne... | ALGO | 0.999916 | 5.791817 |
ee1b096c-a379-4206-a110-951009d5d07b | wujysh/2014_ACM_Summer_Training | 基本算法/UVa_948_Fibonaccimal_Base_(Fibonacci进制).cpp | #include <iostream>
#include <cstdio>
using namespace std;
const int MAXN = 50;
int n, fib[MAXN], nCase;
void init() {
fib[0] = 1; fib[1] = 2;
for (int i = 2; i < MAXN; i++) {
fib[i] = fib[i-1] + fib[i-2];
}
}
void solve() {
int a;
scanf("%d", &a);
printf("%d = ", a);
bool flag... | ALGO | 0.999416 | 3.627342 |
a83d63dd-839d-4a75-825b-6241910a0274 | saga-gis/saga-gis | saga-gis/src/tools/statistics/statistics_regression/gw_multi_regression_grid.cpp | //---------------------------------------------------------
#include "gw_multi_regression_grid.h"
///////////////////////////////////////////////////////////
// //
// //
// //
///////////////////////////////////////////////////////////
//--------------------------------------... | DATA | 0.908628 | 4.123417 |
d225491a-a14c-421b-b292-913a3a21dea8 | Munawertaj/Codeforces | C_Word_on_the_Paper.cpp | /*
Date: 04 July 2023
Problem Link:
Author: Tareq Munawer Taj
CSE, Rajshahi University
*/
#include <bits/stdc++.h>
#define ll long long
#define ull unsigned long long
#define ld long double
#define pb push_back
#define pp pop_back
#define mp make_pair
#define pii pair<int, int>
#define pll pair<ll, ll>
#define vii v... | ALGO | 0.977249 | 3.971967 |
ab6f515b-31d5-4b3f-8d52-614b5a8b34ba | normal-account/EvalMaxSAT2022 | lib/cadical/src/profile.cpp | #ifndef QUIET
#include "internal.hpp"
namespace CaDiCaL {
// Initialize all profile counters with constant name and profiling level.
Profiles::Profiles (Internal * s)
:
internal (s)
#define PROFILE(NAME, LEVEL) \
, NAME (#NAME, LEVEL)
PROFILES
#undef PROFILE
{
}
void Internal::start_profiling (Profile & prof... | TOOL | 0.959874 | 6.637776 |
784dd26d-b283-4e95-8902-b5bca4b8550a | YourName0729/competitive-programming | Kattis/zoo.cpp | // https://open.kattis.com/problems/zoo
#include <bits/stdc++.h>
#include <ext/pb_ds/tree_policy.hpp>
#include <ext/pb_ds/assoc_container.hpp>
#define For(i, n) for (int i = 0; i < n; ++i)
#define Forcase int __t = 0; cin >> __t; while (__t--)
#define ll long long
#define ull unsigned long long
#define ar array
using... | ALGO | 0.999153 | 4.593212 |
56b5c207-9f0a-426a-a480-d41ce8c21b34 | RobPo/PaperiNode | examples/06_WeatherForecast/Encrypt.cpp | /****************************************************************************************
* File: Encrypt.cpp
* Author: Gerben den Hartog
* Company: Ideetron B.V.
* Website: http://www.ideetron.nl/LoRa
* E-mail: <EMAIL>
* Created on: 09-02-2017
* Supported Hardware: ID150119-02 Nexus board with RFM95
*... | TOOL | 0.979868 | 5.440921 |
31f9e704-0943-45d8-8898-36a818af2aba | AditiDey/DSA-IMP-QUESTIONS | trees/balanced_tree.cpp | #include <bits/stdc++.h>
using namespace std;
struct Node
{
int key;
struct Node *left;
struct Node *right;
Node(int k){
key=k;
left=right=NULL;
}
};
int isBalanced(Node *root){
if(root==NULL)
return 0;
int lh=isBalanced(root->left);
if(lh==-1)return -1;
int rh=isBala... | ALGO | 0.999821 | 5.074348 |
1181c6cd-7b32-4c70-8a53-0955ffbaf158 | hardikkumar4472/Daily-problems | 0334-increasing-triplet-subsequence/0334-increasing-triplet-subsequence.cpp | class Solution {
public:
bool increasingTriplet(vector<int>& nums) {
int fs=INT_MAX;
int ss=INT_MAX;
for (int i=0;i<nums.size();i++){
if (nums[i]<=fs){
fs=nums[i];
}
else if(nums[i]<=ss){
ss=nums[i];
}
... | ALGO | 0.999959 | 5.831815 |
a74c3208-7c92-4947-84f2-9ecbf2e5326c | hidacow/CPPstudy | Homework2/classifygrade.cpp | #include<iostream>
using namespace std;
int main(){
int score;
cin>>score;
if(score>=90&&score<=100){
cout<<"A"<<endl;
}
if(score>=80&&score<=89){
cout<<"B"<<endl;
}
if(score>=70&&score<=79){
cout<<"C"<<endl;
}
if(score>=60&&score<=69){
cout<<"D"<<end... | ALGO | 0.999674 | 3.558653 |
bacd9753-8d30-4552-a8fd-1aa4d796e7a9 | wangjilong9597/Study_notes | 基础知识学习/c++关键字学习/0 CPlusPlusThings-master/practical_exercises/10_day_practice/day4/friend/func.cpp | //使用友元函数计算两点间距离
#include <cmath>
#include <iostream>
using namespace std;
class Point {
public:
Point(int x = 0, int y = 0) : X(x), Y(y) {}
int GetX() { return X; }
int GetY() { return Y; }
friend float Distance(Point &a, Point &b);
private:
int X, Y; //私有数据成员
};
//通过将一个模块声明为另一个模块的友元,一个模块能够引用到另一个模块中本是被隐藏的信息。... | TOOL | 0.973749 | 4.876069 |
928a8104-f59a-4c7d-9bd1-fc7b1b762926 | Rakesh-0786/DSA_Basic | Arrays/Arrays Problems/separate-digits.cpp | #include<bits/stdc++.h>
using namespace std;
int main(){
int arr[]={13,25,83,77};
int n = sizeof(arr) / sizeof(arr[0]);
vector<int>answer;
for(int i=0;i<n;i++){
string numStr=to_string(arr[i]);
for(int j=0;j<numStr.size();j++){
answer.push_back(numStr[j]-'0');
}
... | ALGO | 0.97916 | 4.930593 |
7a1151ce-7028-4a63-9fb5-06159ab1c0d8 | darhnoel/Learning | Cpp/HackerrankCpp/box_it.cpp | #include <iostream>
class Box{
private:
long long l, b, h;
public:
Box(): l {0}, b{0}, h{0} {}
Box(int le, int br, int he)
: l{le}, b {br}, h {he}
{};
// Copy constructor
Box(Box &B):
l{B.l},
b{B.b},
h{B.h}
... | ALGO | 0.99049 | 3.920733 |
4e14e1f7-6b7f-4459-8394-56a32e5ca8a6 | Shadow-Candle-Studio/CZUEngines | UE/Engine/Source/ThirdParty/ICU/icu4c-64_1/source/i18n/sortkey.cpp | //===============================================================================
//
// File sortkey.cpp
//
//
//
// Created by: Helena Shih
//
// Modification History:
//
// Date Name Description
//
// 6/20/97 helena Java class name change.
// 6/23/97 helena Added comments t... | TOOL | 0.990995 | 6.212571 |
06876f48-639f-48dc-a180-09083f80e52c | madkonda/FinIQ | fm/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.998435 | 6.76775 |
c7873340-fa32-4023-876c-06b71e120811 | plus-22/chimeraclient | src/noise.cpp | #include <cmath>
#include "noise.h"
#include <iostream>
#include <cstring> // memset
#include "debug.h"
#include "util/numeric.h"
#include "util/string.h"
#include "exceptions.h"
#define NOISE_MAGIC_X 1619
#define NOISE_MAGIC_Y 31337
#define NOISE_MAGIC_Z 52591
// Unsigned magic seed prevents undefined behavi... | ALGO | 0.979965 | 6.934142 |
b1fb27a3-b3ce-4e89-895b-925b2055ae20 | kumawatvinit/DSABUSTED | DSA-with-cpp_yt/L23_2D_Arrays/3_waveprint.cpp | #include<iostream>
using namespace std;
void wavePrint(int **arr, int n, int m)
{
for(int j=0; j<m; ++j)
{
if(j%2==0)
{
for(int i=0; i<n; ++i)
{
cout << arr[i][j] << " ";
}
}
else
{
for(int i=n-1; i>=0; --i)... | ALGO | 0.999113 | 3.359133 |
cc0d08d1-bb4a-48d8-9f59-7482971396d5 | ishandutta2007/codeforces | whzzt/normal/1017/B.cpp | #include <bits/stdc++.h>
#pragma optimize("no-stack-protector")
#define pb push_back
#define fi first
#define se second
#define debug(...) fprintf(stderr, __VA_ARGS__)
#define ALL(a) a.begin(), a.end()
#define lowbit(x) ((x) & -(x))
using namespace std;
typedef long long ll;
typedef unsigned int uint;
typedef unsigne... | ALGO | 0.999989 | 3.861882 |
49955bee-facd-4d99-8905-9591b70663a2 | jdroniou/HArDCore3D-release | src/Quadrature/quad3d_face.cpp |
#include <quad3d_face.hpp>
#include <max_degrees_quadratures.hpp>
#include <iostream>
using namespace HArDCore3D;
/*!
* @addtogroup Quadratures
* @{
*/
QuadRuleTriangle::QuadRuleTriangle( size_t doe, bool warn )
: _npts(dunavant_order_num(std::max(int(doe),1))),
qsx(0),
qsy(0),
qsz(0),
qswg(0),
_... | ALGO | 0.97729 | 6.231909 |
567672bd-de4b-46ce-983c-75c669809cf3 | dharmitarapara/DSA_Programs | Algorithms/Searching/SearchInRotatedSortedArray.cpp | #include <iostream>
#include <vector>
using namespace std;
// https://www.codingninjas.com/codestudio/problems/search-in-rotated-sorted-array_1082554
int getPivot(vector<int> &arr, int n)
{
int s = 0;
int e = n - 1;
int mid = s + (e - s) / 2;
while (s < e)
{
if (arr[mid] >= arr[0])
... | ALGO | 0.999991 | 5.82322 |
bd5ea451-a231-4e68-8172-44b875cb6b72 | FangYang970206/Leetcode | Difficulty/Medium/[74] Search a 2D Matrix/solution.cpp | /*
* @lc app=leetcode id=74 lang=cpp
*
* [74] Search a 2D Matrix
*/
#include <vector>
using namespace std;
class Solution {
public:
bool searchMatrix(vector<vector<int>>& matrix, int target) {
if (matrix.empty()) return false;
if (matrix[0].empty()) return false;
int height = matrix.s... | ALGO | 0.999952 | 6.392163 |
41f5abe8-1b92-44df-ba0e-205ab413da79 | utoppia/leetcode | SlideWindow/3-longest-substring-without-repeating-characters.cpp | /******************************************
* author : utoppia
* description : solution for leetcode
* updated at : 2024-01-12 16:16:28
* filename : 3-longest-substring-without-repeating-characters.cpp
* language : cpp
* editor : Emacs 27.1
*****************************************/
#include <al... | ALGO | 0.999978 | 6.150363 |
85a11af9-9e7c-4e43-9029-7c907fa02b19 | jackTCurtis/css222 | Exercises/ch12/time.cpp | #include <iostream>
#include <time.h>
#include <cmath>
#include <cstring>
#include "time.h"
using namespace std;
string week[7] = {"Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday", "Sunday"};
double Time::convert_to_seconds() const
{
return ((hour * 60) + minute) * 60 + second;
}
void Time::prin... | TOOL | 0.852315 | 3.616898 |
cb200df9-09c1-47ca-9cbf-efe6a2f048c4 | Mohammedpr13795/problem-solving | 03 - Algorithms & Problem Solving Level 3/Problem #41 Reverse Words.cpp | #include <iostream>
#include "MyPrint.h"
#include <string>
#include "MyRead.h"
#include "vector"
using namespace std;
int main()
{
string S1 = MyRead::ReadString();
cout << "\n\String after reversing words: \n";
cout << MyPrint::ReverseWordsInString(S1);
system("pause>0");
}
| TOOL | 0.979249 | 4.642172 |
9255f626-bbec-4218-a231-49a0b0b3f6db | Lupa666/IV_PSNR_OpticalFlow | src/IVPSNR/xPSNR.cpp | // Original authors: Jakub Stankowski, <EMAIL>,
// Adrian Dziembowski, <EMAIL>,
// Poznan University of Technology, Poznań, Poland
#include "xPSNR.h"
#include "xDistortion.h"
#include "xDistortionSTD.h"
#include "xPixelOps.h"
#include <cassert>
#include <numeric>
namespace PMBB_N... | TOOL | 0.989871 | 5.524457 |
c695b783-f3b5-4b3a-97b0-e2602620fa5a | amremam2004/winmerge | Src/stringdiffs.cpp | /**
* @file stringdiffs.cpp
*
* @brief Implementation file for sd_ComputeWordDiffs (q.v.)
*
*/
// ID line follows -- this is updated by SVN
// $Id$
#include <windows.h>
#include <tchar.h>
#include <assert.h>
#include <mbctype.h>
#include "string_util.h"
#include "stringdiffs.h"
#include "CompareOptions.h"
#incl... | TOOL | 0.996781 | 5.934019 |
ba78b85e-7e9f-4974-b157-aa340a0be394 | Lesords/ACM | hdoj/刷题/HDU-1711 Number Sequence.cpp | #include<cstdio>//ac don't use cin !!!
#include<cstring>
using namespace std;
const int maxn = 1e6+5;
int nextt[10005],n[maxn],m[10005];
int num_1,num_2;
void get_next() {
int i = 0, j = -1;
nextt[0] = -1;
while(i<num_2) {//Ŀ괮
if(j==-1||m[i]==m[j]) nextt[++i] = ++j;
else j = nextt[j];//
}
}
int kmp() {
int i =... | ALGO | 0.999918 | 3.721405 |
65672994-6365-4f8b-bf32-b74ccd938da1 | Tinyshellzz/leetcode | Q0005_Longest_Palindromic_Substring.cpp | #include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
#include <iostream>
using namespace std;
#include <algorithm>
// check wheather string is a palindrome, start from the center and expand to the edge
class Solution {
public:
string longestPalindrome(string s) {\
int size = 2*s... | ALGO | 0.999579 | 3.889319 |
e8d3f70b-0be5-4c17-9ae4-9dfb354ddf24 | Mohit21251139/stiver_sde_sheet | 0112-path-sum/0112-path-sum.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.999972 | 6.032574 |
86a5e41c-7e5b-44eb-b584-369185e13e59 | sky8c9/Prac | AtCoder/ABC/389/C.cpp | #include <iostream>
#include <vector>
using namespace std;
using ll = long long;
void task() {
int q;
cin >> q;
vector<ll> val;
val.push_back(0);
int offset = 0;
while(q--) {
int t;
cin >> t;
if (t == 1 || t == 3) {
if (t == 1) {
int add;
... | ALGO | 0.999481 | 4.240613 |
97408fa9-bd26-43d1-a526-58aa89617404 | denisamihaila/Formal-Languages-and-Automata-Project | TEMA1/NFA_cu_drum/NFA+drum.cpp | #include <fstream>
#include <iostream>
#include <string>
#include <unordered_map>
#include <vector>
#include <set>
#include <map>
//2.automat finit nedeterminist
using namespace std;
ifstream f("input.txt");
ofstream g("output.txt");
int stare, n, m, i, j, stare_finala, nrcuv, nod1, nod2, stare_init, nrf, stare_curenta... | ALGO | 0.999958 | 4.863904 |
5a21a356-48bf-46a0-a5d0-59fa9e6cc168 | ifangfeng/mracs | src/rcsc.cpp | // scatter of reconstructed halo vs. dark matter catalogue
#include"mracs.h"
int main(){
read_parameter();
const int Mbin{4};
double THR{15};
double GSR{1}; // Gaussian smoothing radius
double lth_opt_M{17.5}; // optimal lambda_th
double lth_opt_N{11.25};
std::string ofname_dm {"out... | DATA | 0.981665 | 3.27792 |
7664d5be-0d6e-4809-8bb8-5c8e6495d208 | xeonqq/clean_slam | src/camera_motion_estimator.cpp | //
// Created by root on 1/20/20.
//
#include <chrono>
#include <future>
#include <iostream>
#include "camera_motion_estimator.h"
#include "cv_utils.h"
#include "eigen_utils.h"
#include <cv.hpp>
#include <opencv2/core/eigen.hpp>
#include <third_party/spdlog/spdlog.h>
namespace clean_slam {
using namespace std::chron... | ALGO | 0.997483 | 6.223729 |
69b3fc4a-b462-41d4-9500-f43256b100a7 | Thestouges/Problem4 | Source.cpp | /*
Given an array of integers, find the first missing positive integer in linear time and constant space. In other words, find the lowest positive integer that does not exist in the array. The array can contain duplicates and negative numbers as well.
For example, the input [3, 4, -1, 1] should give 2. The input [1, 2... | ALGO | 0.99972 | 5.698864 |
a8b7493f-6e11-49c0-84cc-a9e3ba495182 | xf519ffi77/donghedd | 20250308/B - Card Pile.cpp | #include <bits/stdc++.h>
#define endl '\n'
using namespace std;
typedef pair<int, int> PII;
typedef long long LL;
const int mod = 1e9 + 7, inf = 0x3f3f3f3f;
int main()
{
ios::sync_with_stdio(0), cin.tie(0), cout.tie(0);
stack<int> s;
for (int i = 1; i <= 100; i ++ ) s.push(0);
int q;
cin >> q;
while (q -- )
{
... | ALGO | 0.999764 | 4.965817 |
8d21158c-bb66-4273-a929-5bdc4d3fb29d | manni2000/DSA_Imp-Questions | Stack/evalutionPostfix.cpp | class solution{
public:
int evalutionPostfix(string S){
stack<int>st;
for(int i=0;i<s.size();i++){
if(s[i]=='+'|| s[i]=='-'||s[i]=='*'||s[i]=='/'){
int x=st.top();
st.pop();
int y=st.top();
st.pop();
if(s[i]=='+')
st.push(x+y);
... | ALGO | 0.999839 | 4.442016 |
955e6b02-60b5-42fe-a84e-d1887cd33255 | rimonsarmah/CP_CipherSchools | Assignment 5/swapKNodesfromEnd.cpp | #include <bits/stdc++.h>
using namespace std;
class Node{
public:
int data;
Node *next;
Node(){
data = 0;
next = NULL;
}
Node(int i){
data = i;
next = NULL;
}
};
void push(Node **head, int new_data)
{
Node *new_n... | ALGO | 0.999976 | 4.689574 |
8fa81c2a-a836-4258-9234-4058b1262baa | kripken/llvm-js | examples/Kaleidoscope/Chapter2/toy.cpp | #include <cstdio>
#include <cstdlib>
#include <string>
#include <map>
#include <vector>
//===----------------------------------------------------------------------===//
// Lexer
//===----------------------------------------------------------------------===//
// The lexer returns tokens [0-255] if it is an unknown cha... | TOOL | 0.91961 | 7.74433 |
f6b6cd4f-1598-4dea-b887-fd5d36a98398 | beefeather/clean-sources-cpp | examples/city-places-parser/roger/Place.cpp | namespace;
using std::string;
/**
* Место, элемент результата программы
*/
struct Place {
public:
Place(string name, string address, lj::Comment* comment) :
name_(name), address_(address), comment_(comment), pos_rank_(0), neg_rank_(
0), lat_(0), lon_(0) {
}
//название места
void setName(str... | TOOL | 0.867101 | 3.95384 |
f229c0bf-7f66-45ca-bfdd-6eeeefc074d6 | mdyamin99/CSE-Fundamentals-with-Phitron | Phitrin_C++/Module-3/class_and_object.cpp | #include<bits/stdc++.h>
using namespace std;
class Student
{
public:
char name[100];
int roll;
double cgpa;
};
int main()
{
Student a,b;
cin.getline(a.name,100);
cin>>a.roll>>a.cgpa;
getchar();
cin.getline(b.name,100);
cin>>b.roll>>b.cgpa;
cout<<a.name<<" "<<a.roll<<" "<<a... | ALGO | 0.942598 | 3.2065 |
655c10fc-c6de-4669-8776-aef5296f5a65 | Jiwon116/Algorithm | BOJ/13335.cpp | #include <bits/stdc++.h>
#define ll long long
#define pii pair<int, int>
using namespace std;
int main() {
ios_base::sync_with_stdio(false);
cin.tie(nullptr);
cout.tie(nullptr);
int n, w, l; cin >> n >> w >> l; // n : 트럭의 수, w : 다리의 길이, l : 다리의 최대 하중
queue<int> truck; // 트럭 각각의 무게
for(i... | ALGO | 0.999935 | 4.809763 |
817fe5ee-b85f-4e7a-9626-ff5825297b44 | DionysiosB/CodeForces | 0400-0499/427A-PoliceRecruits.cpp | #include <cstdio>
int main(){
int n(0); scanf("%d", &n);
long manPower(0), untreated(0);
while(n--){
int input(0); scanf("%d", &input);
if(input < 0){(manPower > 0) ? (--manPower) : (++untreated);}
else{manPower += input;}
}
printf("%ld\n", untreated);
return 0;
}
| ALGO | 0.999572 | 3.501488 |
70e60731-2789-4615-a70e-2e1f90e1ec15 | Haribala-09/hyprdots | User/History/5033aa42/qkVS.cpp | #include <bits/stdc++.h>
using namespace std;
#define rev(ans) reverse(ans.begin(), ans.end())
#define mems(a, n) memset(a, n, sizeof(a))
#define pb push_back
#define fst first
#define scd second
#define int long long
using pii = pair<int, int>;
using pci = pair<char, int>;
void dbg_out() { cerr << endl; }
template ... | ALGO | 0.999918 | 4.104134 |
560ac4de-9384-4a04-962a-9b893a98427d | shubhansu-kr/DynammicProgramming-Striver | 00_Fibonacci.cpp | // Fibonacci Sequence Using DP
#include <bits/stdc++.h>
using namespace std;
class Solution1
{
// Tabulation : Bottoms UP
// Time complexity : O(N);
// Space Complexity : O(N) + O(N) ;
public:
int fibonacci(int n)
{
vector<int> dp(n);
dp[0] = 0, dp[1] = 1;
for (int i = 2; i... | ALGO | 0.999948 | 5.625543 |
cd009b7a-774e-4149-99c9-05f2279e7573 | idriss-code/RPG | util/fonctionDessin.cpp | #include "fonctionDessin.h"
SDL_Rect Trajectoire(int x1, int y1, int x2, int y2,float v)
{
SDL_Rect rect;
if (abs(y2-y1)+abs(x2-x1)>v)
{
float angle=atan2(y2-y1,x2-x1);
rect.x=x1+v*cos(angle);
rect.y=y1+v*sin(angle);
}
else rect.x=x2,rect.y=y2;
return rect;
}
void se... | TOOL | 0.913764 | 3.665204 |
f5e84257-e1d1-4e2a-aff8-0a655de97b40 | iammarajul/competitive_programming | Codeforecs/1040D.cpp |
#include<bits/stdc++.h>
using namespace std;
int sc1(){int x; scanf("%d",&x); return x;}
long long sc2(){long long x;scanf("%lld",&x);return x;}
#define gcd(a,b) __gcd(a,b)
#define lcm(a,b) (a*b)/gcd(a,b)
#define Int sc1()
#define LL sc2()
#define For(n) for... | ALGO | 0.999856 | 4.335663 |
da315be6-be8e-415d-a024-451e9eb02f0f | alexandraback/datacollection | solutions_1595491_1/C++/marijn/b.cpp | #include <string>
#include <iostream>
#include <cstdlib>
#include <cstdio>
#include <vector>
using namespace std;
int main() {
int n; scanf("%d", &n);
for (int c = 1; c <= n; c++) {
int ans = 0;
int N, S, p;
scanf("%d %d %d", &N, &S, &p);
int minneeded = max(0, p+p+p-2);
... | ALGO | 0.99928 | 3.240089 |
a8a9ac94-8918-41e2-9605-f71dcfa85ec2 | Kratik777/Programming-Street-150 | Sprint 3/Easy/SimplePyramidPattern.cpp | #include <iostream>
using namespace std;
//Function to print simple pyramid pattern.
void pyramidPattern(int n){
for(int row = 0 ; row < n ; row++){
// spaces:
for(int col = 0 ; col<n-1-row; col++){
cout<<" "<<" ";
}
// stars:
for(int col = 0 ; col<2*row+1; col++){
cout<<"*"<<" ... | ALGO | 0.999878 | 4.28367 |
f81ef027-17a3-40a9-8333-76ff4593ad36 | chujunc/gem5 | gem5/src/systemc/tests/systemc/misc/communication/channel/hwsw/hwsw.cpp | /*****************************************************************************
hwsw.cpp --
Original Author: Martin Janssen, Synopsys, Inc., 2002-02-15
*****************************************************************************/
/*****************************************************************************
... | TOOL | 0.852047 | 5.60743 |
96ee5eab-c30c-46ce-85ae-353ffd69549e | philong07712/DACoHoa | Manager.cpp | # include "Manager.h"
Manager::Manager() {
size = 0;
}
void Manager::addEmployee(Employee e) {
list[size] = e;
size++;
}
void Manager::addEmployee(Employee e, int n) {
// Kiem tra neu n co dat yeu cau
if (n < 0 || n > size) {
return;
}
for (int i = size; i > n; i--) {
list[i] = list[i - 1];
}
list[n] = ... | TOOL | 0.878163 | 3.567525 |
ea30fd16-83c2-4080-a5c3-f8046b6e11a9 | alexandraback/datacollection | solutions_5769900270288896_0/C++/mt01020/NoisyNeighbors.cpp | #include<cstdio>
using namespace std;
int main(){
int T, R, C, N;
int room[16];
scanf(" %d ", &T);
for(int t=1; t<=T; ++t){
scanf(" %d %d %d ", &R, &C, &N);
for(int i=0; i<R; ++i){
for(int j=0; j<C; ++j){
room[i*C+j] = (i==0 ? 0 : 1)+(i==R-1 ? 0 : 1)+(j==0 ? 0 : 1)+(j==C-1 ? 0 : 1);
}
}
... | ALGO | 0.998452 | 3.182296 |
3f5a00c6-db3b-4d58-b69a-3cc0c5cc24e4 | xbresson/CS5284_2024 | codes/02_Graph_Science/LFR/Sources/combinatorics.cpp | #if !defined(COMBINATORICS_INCLUDED)
#define COMBINATORICS_INCLUDED
template <typename Seq>
double average_func(Seq &sq) {
if (sq.empty())
return 0;
double av=0;
typename Seq::iterator it = sq.begin();
while(it != sq.end())
av+=*(it++);
av=av/sq.size();
return av;
}
template <typename Seq>
double... | ALGO | 0.974917 | 5.612788 |
69e50123-dd00-4a06-952f-2158773835e5 | Adriancanfly/vs2019 | cprimeplus上机实践/11.2/strptr.cpp | /*strptr.c -- ַָ*/
#include<stdio.h>
int main(void)
{
printf("%s, %p, %c\n", "We", "are", *"space farers");
return 0;
}
//˫ݱΪַָλõָ룡 | TOOL | 0.885509 | 3.202022 |
9161da2a-2eaa-4135-87b2-22be01c5b0bc | yangfengzzz/DigitalVox3 | vox.geometry/fdm_solvers/fdm_cg_solver2.cpp | #include "../common.h"
#include "../cg.h"
#include "../constants.h"
#include "fdm_cg_solver2.h"
using namespace vox;
using namespace geometry;
FdmCgSolver2::FdmCgSolver2(unsigned int maxNumberOfIterations, double tolerance)
: _maxNumberOfIterations(maxNumberOfIterations), _lastNumberOfIterations(0), _tolerance(t... | ALGO | 0.998771 | 6.095223 |
407503b7-8e00-4a24-9bf9-ceeb5a165c91 | riyasachdeva-22/DS-Problems | hashing/longest_subseq.cpp | // { Driver Code Starts
#include <bits/stdc++.h>
using namespace std;
int findLongestConseqSubseq(int [], int );
int main() {
int t;
cin>>t;
while(t--)
{
int n;
cin>>n;
int a[n];
// input array elements
for(int i=0;i<n;i++)
cin>>a[i];
cout<< findLongestConseqSubseq(a, n)<<endl;
}... | ALGO | 0.999832 | 5.242939 |
e4007da4-5835-4f05-b409-a5f4e4ec6449 | azaruddin98/CPP | non-type_template_argument.cpp | #include <iostream>
#include<cstring>
using namespace std;
template<typename T,int size>
T sum(T (&parr)[size]) //must be address, reference, nullptr,enums,integrals
{ int total = 0;
for(int i=0;i<size;i++){
total += parr[i];
}
return total;
}
int main() {
int a[5]={10,20,30,40,50};
cout... | ALGO | 0.946675 | 4.262378 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.