uuid string | repo_name string | relative_path string | content string | category string | algo_rel_score float64 | quality_score float64 |
|---|---|---|---|---|---|---|
b337513e-f34d-4bf5-970f-a435370ce20c | AlvesJonathan/Estudos-em-C | exercicio19.cpp | #include<stdio.h>
#include<stdlib.h>
#include<math.h>
int main ()
{
float celsius, fahrenheit, conversao;
printf("Digite os graus em fahrenheit: ");
scanf("%f", &fahrenheit);
conversao=(fahrenheit-32)/1.8;
printf("O valor dos graus digitados em celsius eh: %.2f\n\n",conversao);
system("PAUSE");
return 0... | ALGO | 0.869999 | 3.352194 |
1e64ceef-f4e9-4704-ad87-915b95ac85a1 | RalfZgeib/QEB_BioEX | Marlin-2.0.3--BioEX_R4--Firmware/Marlin/src/feature/bedlevel/abl/abl.cpp | #include "../../../inc/MarlinConfig.h"
#if ENABLED(AUTO_BED_LEVELING_BILINEAR)
#include "../bedlevel.h"
#include "../../../module/motion.h"
#define DEBUG_OUT ENABLED(DEBUG_LEVELING_FEATURE)
#include "../../../core/debug_out.h"
#if ENABLED(EXTENSIBLE_UI)
#include "../../../lcd/extensible_ui/ui_api.h"
#endif
xy_p... | ALGO | 0.984741 | 6.429111 |
fa72074c-0245-4ac7-98d1-265af1b5ffd9 | ElkeMilne/ADDS | Algorithm-Design-Data-Structures-master/exam-1/main.cpp | #include <iostream>
#include <string>
#include "Bag.h"
#include <time.h>
using namespace std;
#include <iostream>
using namespace std;
void stars(int n) {
cout << "*";
if (n == 1) {
cout << endl;
} else {
stars(n - 1);
}
}
int sum_of_squares(int n) {
return n == 1 ? 1 : n * n + su... | ALGO | 0.993074 | 3.402095 |
8e602368-0e8a-4158-a1eb-526f92c885a2 | TheIslland/Code_learn | 7.代码练习/其他/hafuman.cpp | /*************************************************************************
> File Name: hafuman.c
> Author:TheIslland
> Mail: <EMAIL>
> Created Time: 2019年01月22日 星期二 10时00分53秒
************************************************************************/
#include <iostream>
#include <queue>
#include <algorithm>
#incl... | ALGO | 0.99918 | 3.518023 |
b08db2e2-c457-444c-b3b3-82fa87481229 | Power2565/Project-cho202_dynexcoin_wallet_app | src/Wallet/WalletRpcServer.cpp | #include <list>
#include <boost/algorithm/string/predicate.hpp>
#include "WalletRpcServer.h"
#include "crypto/hash.h"
#include "Common/CommandLine.h"
#include "Common/StringTools.h"
#include "CryptoNoteCore/CryptoNoteFormatUtils.h"
#include "CryptoNoteCore/CryptoNoteBasicImpl.h"
#include "CryptoNoteCore/Account.h"
#inc... | WEB | 0.869596 | 7.06285 |
674edaf5-bdcf-4296-a01d-fac37cb79f1e | LDlornd/OI-Memory | 洛谷/比赛/NOIp热身赛/T2067 会议座位/T2067 会议座位.cpp | #include<cstdio>
#include<iostream>
#include<map>
using namespace std;
typedef long long int ll;
const int MAXN=100005;
string s;
ll ans=0;
int n;
int arr[MAXN],temp[MAXN];
map<string,int> mp;
bool judge(char c){
if((c>='a'&&c<='z')||(c>='A'&&c<='Z')) return true;
else return false;
}
void Merge(int s1,int e1,int e2)... | ALGO | 0.999848 | 3.608073 |
3645e01e-dbd4-408e-b18c-f1c8b6494617 | dereksodo/allcode | 2019/2019down/nfls/Uva348.cpp | #include <iostream>
#include <cstring>
#include <cstdlib>
#include <set>
#include <vector>
#include <map>
#include <cstdio>
#include <utility>
#include <algorithm>
#include <cmath>
#include <queue>
#include <stack>
#include <cassert>
#include <climits>
#include <numeric>
using namespace std;
typedef long long ll;
#defi... | ALGO | 0.999086 | 3.53553 |
aeae2eb3-5462-4bbb-b383-3acff1aea3df | mohit0-0rai/Data-Structures-and-Algorithms | DS/KadanesAlgorithm.cpp | #include<bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef vector<int> vi;
typedef pair<int, int> pii;
#define MOD 1000000007
int main() {
ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL);
int n;
cin >> n;
vector<int> a(n);
for(int i = 0; i < n; ++i)
cin >> a[i];
// Kadane's Al... | ALGO | 0.999948 | 4.85622 |
9454b060-65e8-4add-aa85-426ffb43d4f5 | ankitksh81/leetcode-challenges | September 2022/day4.cpp | /*
Vertical Order Traversal of a Binary Tree
https://leetcode.com/problems/vertical-order-traversal-of-a-binary-tree/
*/
// Solution: BFS
class Solution {
public:
vector<vector<int>> verticalTraversal(TreeNode* root) {
map<int, map<int, multiset<int>>> mp;
queue<pair<TreeNode*, pair<int, int>>> ... | ALGO | 0.999995 | 6.620746 |
7863b6a1-5176-414a-9b22-8585f03e6abe | Mathavaroopan/cp-algorithms | programs/E_Two_Round_Dances.cpp | #include "bits/stdc++.h"
#define int long long
#define uint unsigned long long
#define vi vector<int>
#define vvi vector<vi >
#define vb vector<bool>
#define vvb vector<vb >
#define fr(i,n) for(int i=0; i<(n); i++)
#define rep(i,a,n) for(int i=(a); i<=(n); i++)
#define nl cout<<"\n"
#define dbg(var) cout<<#var<<"="<<va... | ALGO | 0.999719 | 5.321647 |
f346dc0c-9550-4b12-a8a7-37e07416eaf6 | panyaoyu/BeautifulAlgorithm | Chapter-8-Greedy-Algorithm-and-Dynamic-Programming/01背包.cpp | /*
4
2 3
1 2
3 4
2 2
5
7
*/
#include<bits/stdc++.h>
using namespace std;
int dp[105][10005]={0};
int nc;
struct obj{
int w;
int v;
obj(int wwint vv):w(ww)v(vv){}
};
vector<obj> a;
int main(){
cin>>n;
int tmp1tmp2;
for(int i=0;i<n;i++){
scanf("%d%d"&tmp1&tmp2);
a.push_back(obj(tmp1tmp2));
}
cin>>c;
fo... | ALGO | 0.999988 | 3.726024 |
2423d856-2af6-4e24-8173-e2bd849b7a4a | MTG/essentia | src/algorithms/stats/median.cpp | #include "median.h"
#include "essentiamath.h"
using namespace essentia;
using namespace standard;
const char* Median::name = "Median";
const char* Median::category = "Statistics";
const char* Median::description = DOC("This algorithm computes the median of an array. When there is an odd number of numbers, the median ... | ALGO | 0.999986 | 6.271596 |
8dddfb36-7416-4edc-bf61-e6faead3904d | manasvi83/Leetcode | 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.99987 | 6.575531 |
92b30af6-5ad5-4d0e-a22e-5807805e3353 | icprog/Microcontrollers | Servomotor/pid.cpp | #include "pid.h"
adrone::pid::pid()
{ }
void adrone::pid::init(const double &kp, const double &ki, const double &kd, const double &dt, const double &max, const double &min)
{
_dt = dt;
_previus_error = 0;
_integral = 0;
_flag = true;
_max = max;
_min = min;
kpid(kp, ki, kd);
}
void adrone::pid::kpid(co... | ALGO | 0.996353 | 5.441327 |
4488d0ad-ba20-4053-9eee-7e70a551367b | andersonjwan/readings | stroustrup2018tour/ch11/sec03/main.cpp | #include <iostream>
#include <list>
#include <string>
using std::list;
struct Entry {
std::string name;
int number;
};
std::ostream&
operator<<(std::ostream& os, const Entry& entry) {
os << "{\"" << entry.name << "\" , " << entry.number << "}";
return os;
}
int
lookupNumber(const std::string& s, const list<... | TOOL | 0.987494 | 6.140086 |
200f334a-e205-4928-b412-ed2fd22653d8 | Avichal14/Problem-Of-The-Day | ll2Insert.cpp | #include<iostream>
using namespace std;
class Node {
public:
int data;
Node* next;
Node() {
this->data = 0;
this->next = NULL;
}
Node(int data) {
this->data = data;
this->next = NULL;
}
};
void print(Node*& head) {
Node* temp = head;
while... | ALGO | 0.999929 | 4.101118 |
051e4197-b00d-4fd4-83b0-c0212aa189b1 | CuongNguyen291201/CTDL | CTDL/TH4/solocphat1.cpp | #include<bits/stdc++.h>
using namespace std;
void result(){
int n; cin>>n;
queue<string> q;
q.push("6");
q.push("8");
vector<string> res;
while(q.front().length() <= n){
string tmp = q.front();
q.pop();
q.push(tmp+'6');
q.push(tmp+'8');
res.push_back(tmp);
}
for(int i=res.size()-1;i>=0;i--) cout<<res... | ALGO | 0.999318 | 4.142416 |
9c56a170-ed24-4aab-acb2-67ac95bceb60 | tap/TapTools | max-sdk/source/matrix/simplejit/jit.simple.cpp | #include "jit.common.h"
// Our Jitter object instance data
typedef struct _jit_simple {
t_object ob;
double gain; // our attribute (multiplied against each cell in the matrix)
} t_jit_simple;
// prototypes
BEGIN_USING_C_LINKAGE
t_jit_err jit_simple_init (void);
t_jit_simple *jit_simple_new (void);
void ji... | ALGO | 0.957609 | 6.425855 |
d677a559-055e-4c08-83c7-990efd8573cc | Fizur-Rahman-Fahim/Vector | print_array_reverse.cpp | #include<bits/stdc++.h>
using namespace std;
int main()
{
int n;
cin>>n;
int arr[n];
for(int i=0;i<n;i++)
{
cin>>arr[i];
}
for(int i=n-1;i>-1;i--)
{
cout<<arr[i]<<" ";
}
return 0;
} | ALGO | 0.999594 | 3.768337 |
a04ad5a3-6be9-4f56-9efd-cef901cc29eb | sabeelkhan99/CBlocks | recursion/code.cpp | #include<iostream>
#include<vector>
#include<cstring>
#include<unordered_map>
using namespace std;
#define int long long int
unordered_map<int,unordered_map<int,int> >dp;
int solve(int n,int last){
if(n==0){
return 1;
}
if(dp[n][last]){
return dp[n][last];
}
if(last==-1... | ALGO | 0.999956 | 4.72833 |
bc3712d9-5e08-46c0-ba6b-0ec507241d2c | NafiHasan/HabiJabi | C++/Codeforces Contests/CF div 2 and div 3/Round 725/a.cpp | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define en "\n"
#define fast_io() ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL)
#define w(t) int t; cin >> t; while (t--)
int main() {
fast_io();
w(t) {
int n;
cin >> n;
int a[n];
for (int i = 0; i < n; i++)cin >> a[i];
... | ALGO | 0.998598 | 3.576919 |
fd4e7f8e-e547-4e4e-97f2-69e637518181 | jyqiu1216/Rino | sdk/boost_1_62_0/libs/context/example/v2/fibonacci.cpp | #include <cstdlib>
#include <iostream>
#include <memory>
#include <boost/context/all.hpp>
namespace ctx = boost::context;
int main() {
int n=35;
ctx::execution_context< int > source(
[n](ctx::execution_context< int > sink, int) mutable {
int a=0;
int b=1;
while(n--... | ALGO | 0.994581 | 5.175082 |
7b87b0d9-03cd-4091-85b6-2eeadbdd3e6a | YD-S/Cpp-09 | ex01/main.cpp | //
// Created by Yash on 12/2/24.
//
#include "RPN.hpp"
int main(int argc, char **argv) {
if (argc != 2) {
std::cerr << "Usage: ./rpn \"1 2 + 4 * 5 + 3 -\"" << std::endl;
return 1;
}
try {
std::string str = argv[1];
RPN rpn;
rpn.parse(str);
rpn.print();
} catch (std::exception &e) {
std::cerr << e.w... | ALGO | 0.869726 | 6.139386 |
eba5f788-fa27-428e-9ad9-58fbb14acc76 | ishandutta2007/codeforces | ecnerwala/normal/1137/B.cpp | #include<bits/stdc++.h>
using namespace std;
int main() {
ios_base::sync_with_stdio(0), cin.tie(0), cout.tie(0);
string S; cin >> S;
string T; cin >> T;
vector<int> fail;
fail.push_back(-1);
for (int i = 0; i < int(T.size()); i++) {
int cur = fail.back();
while (cur != -1 && T[cur] != T[i]) {
cur = fail[c... | ALGO | 0.999997 | 4.39045 |
32a91f35-57f7-47fc-ac22-8bf11fa31014 | hardik302001/leetcode | problems/increasing_subsequences/solution.cpp | class Solution {
public:
vector<vector<int>> findSubsequences(vector<int>& nums) {
set<vector<int>> res;
vector<int> seq;
helper(nums, seq, res, 0);
return vector<vector<int>>(res.begin(), res.end());
}
void helper(vector<int> &nums, vector<int>& seq, set<vector... | ALGO | 0.99999 | 6.23548 |
1749c615-6089-4d4b-acc5-88d5a2b82a63 | SatoshiNakamotoRoot/Satoshi-Nakamoto-Bitcoin | src/node/eviction.cpp | #include <node/eviction.h>
#include <algorithm>
#include <array>
#include <chrono>
#include <cstdint>
#include <functional>
#include <map>
#include <vector>
static bool ReverseCompareNodeMinPingTime(const NodeEvictionCandidate &a, const NodeEvictionCandidate &b)
{
return a.m_min_ping_time > b.m_min_ping_time;
}
... | ALGO | 0.997451 | 7.774124 |
b77f1ab9-dcc7-4c79-96bd-e3ada75a29d2 | sjtubinlong/Programming-Challenges | leetcode/Sqrt_x.cpp | class Solution {
public:
int sqrt(int x) {
// Note: The Solution object is instantiated only once and is reused by each test case.
if( x < 2 ) return x;
int from = 1, to = x/2;
int cur = 1;
while( from <= to ){
cur = from + (to-from)/2;
if( x/cur > cur... | ALGO | 0.999921 | 5.82205 |
e68db65c-aee6-4982-8d6f-ef66e830c9aa | lxb1226/leetcode_cpp | src/question98.cpp | #include <iostream>
#include <vector>
#include <climits>
#include <stack>
using namespace std;
// 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(nu... | ALGO | 0.999994 | 6.201412 |
dfe12b4d-2a51-4a55-a685-67d6476134af | dylan007/Coding | google/google_code_jam/21/Quali/moons.cpp | /*=======================
Author : Shounak Dey
File : moons
=======================*/
#include <bits/stdc++.h>
using namespace std;
using ll = long long int;
using ull = unsigned long long int;
#define PB push_back
#define MK make_pair
#define SZ(a) (int)(sizeof(a))
#define F first
#define S second
#define ... | ALGO | 0.999816 | 4.259377 |
08b9beb6-f425-425d-8a10-483fd75a0c7b | ishandutta2007/codeforces | tfg/normal/516/A.cpp | #include <iostream>
#include <vector>
int main() {
std::ios_base::sync_with_stdio(false); std::cin.tie(NULL);
int n;
std::cin >> n;
std::string str;
std::cin >> str;
std::string ans;
std::vector<int> freq(10, 0);
for(auto v : str) {
if(v > '1') {
freq[v - '0']++;
}
}
while(freq[9]) {
freq[9]--;
fr... | ALGO | 0.999986 | 5.14696 |
83908448-33fd-4b94-9033-27ab9628ea32 | ANUNAY-NALAM/interview_prep | striver day2 problem 2.cpp | #include<bits/stdc++.h>
using namespace std;
int main()
{
int n;
cin>>n;
int arr[n][2];
for(int i=0;i<n;++i)
{
cin>>arr[i][0];
cin>>arr[i][1];
}
for(int i=0;i<n;++i)
{
cout<<arr[i][0]<<" ";
cout<<arr[i][1];
cout<<endl;
}
int k;
for(int i=0;i<n-1;++i)
{
if(arr[i][1]>arr[i+1][0])
{
++k;
ar... | ALGO | 0.999979 | 3.569807 |
d0ea291d-562c-4593-b74f-56b65b13227f | Anuskawebb/DSA-with-Cpp | doublepointers,cpp.cpp |
// pointer to pointer
#include <bits/stdc++.h>
using namespace std;
int main()
{
int variable = 169;
int* pointer1;
int** pointer2;
// Storing address of variable
// in pointer1
pointer1 = &variable;
// Storing address of pointer1
// in pointer2
pointer2 = &pointer1;
// Displaying the value of variablewith usi... | ALGO | 0.997765 | 4.606555 |
570f6f26-53b1-46c0-84f2-dbda62663fd8 | MuctepK/Olympiad | ACMP/71.cpp | #include <bits/stdc++.h>
using namespace std;
int arr[20];
int N, m=1000000000, sum=0;
vector < vector <int> > v;
vector <int> temp;
void calculate(int element, int current_sum, int size ){
if (size>=N-1){
return;
}
temp.push_back(element);
int another=sum-current_sum;
if (abs(another-curr... | ALGO | 0.999915 | 3.921266 |
8aa5aee6-9f7a-4d2a-b8ad-911af5c7bb3b | peterzheng98/gpu-memory | src/base/pytorch/third_party/flash-attention/csrc/composable_kernel/example/60_gemm_multi_ABD/gemm_multi_ABD_xdl_fp16.cpp | #include <iostream>
#include <numeric>
#include <initializer_list>
#include <cstdlib>
#include "ck/ck.hpp"
#include "ck/tensor_operation/gpu/device/gemm_specialization.hpp"
#include "ck/tensor_operation/gpu/device/impl/device_gemm_multiple_abd_xdl_cshuffle.hpp"
#include "ck/tensor_operation/gpu/element/element_wise_op... | ALGO | 0.906562 | 6.790931 |
43fd1572-38f8-4a81-9d47-28ca129ebb6b | saaadaliii/pf-lab | input number are equal.cpp | #include<iostream>
using namespace std;
int main()
{
int num1,num2,num3;
printf("Enter first number:");
scanf("%d",& num1);
printf("Enter second number:");
scanf("%d",& num2);
printf("Enter third number:");
scanf("%d",& num3);
if (num1 == num2){
if (num2 == num3){
printf("All values are equa... | ALGO | 0.998198 | 3.268768 |
8bf920d9-fa58-48b9-8807-81c340174916 | codacy-open-source-projects-scans/oceanbase | src/sql/engine/expr/ob_expr_lower.cpp | #define USING_LOG_PREFIX SQL_ENG
#if defined(__x86_64__)
#include <immintrin.h>
#endif
#include <string.h>
#include "sql/engine/expr/ob_expr_lower.h"
#include "share/object/ob_obj_cast.h"
#include "objit/common/ob_item_type.h"
//#include "sql/engine/expr/ob_expr_promotion_util.h"
#include "sql/session/ob_sql_session_... | TOOL | 0.859282 | 6.02592 |
ae7d9d17-aef4-408d-999e-ec9b0ca41dd4 | sjsfwch/LeetCode | 470.用-rand-7-实现-rand-10.cpp | /*
* @lc app=leetcode.cn id=470 lang=cpp
*
* [470] 用 Rand7() 实现 Rand10()
*/
// @lc code=start
// The rand7() API is already defined for you.
// int rand7();
// @return a random integer in the range 1 to 7
class Solution {
public:
int rand10() {
while (true) {
int num = (rand7() - 1) * 7... | ALGO | 0.996845 | 4.863375 |
a3ca5f70-77c7-40cf-baa3-c39175436bbf | adricort/rovy | arduino/Arduino/libraries/FastLED/src/bitswap.cpp | /// @file bitswap.cpp
/// Functions for doing a rotation of bits/bytes used by parallel output
/// Disables pragma messages and warnings
#define FASTLED_INTERNAL
#include "FastLED.h"
void transpose8x1_noinline(unsigned char *A, unsigned char *B) {
uint32_t x, y, t;
// Load the array and pack it into x and y... | ALGO | 0.999791 | 6.811153 |
d7d33b62-8e35-47f4-bca1-0e1efe81ec04 | arjunbalaji99/competitiveprogramming | problems/stoneswapping.cpp | #include <bits/stdc++.h>
using namespace std;
#define ll long long
struct Cow {
int start;
int time;
};
bool comp (Cow c1, Cow c2){
if (c1.start < c2.start)
return true;
return false;
}
int main() {
//freopen("inputf.in", "r", stdin);
//freopen("outputf.out", "w", stdout);
int n;
cin >> n;
... | ALGO | 0.999793 | 4.525474 |
94fec0ea-a0db-4530-be4d-eb0f4c493702 | vishaldubey40/college-problems | B_Powers_of_Two.cpp | #include<bits/stdc++.h>
using namespace std;
int main(){
long long int n;
cin >> n;
vector<long long int> v(n);
for(long long int i=0;i<n;i++)
cin >> v[i];
sort(v.begin(),v.end());
vector<long long int> v1(30);
int a = 2;
for(long long int i=0;i<30;i++){
v1[i]=a;
a*=... | ALGO | 0.999601 | 3.546221 |
46007844-80e5-443a-b917-6fe8a2b9d68f | jongyeon95/algorithmStudy | Samsung_SW_Expert_Academy/D4/7088. 은기의 송아지 세기.cpp | #include <iostream>
#include <cstring>
using namespace std;
int arr[100001];
int dp[100001][3];
int main(){
cin.tie(NULL);
cout.tie(NULL);
int testcase;
cin >> testcase;
int N,Q,L,R;
for (int t = 1; t <= testcase; ++t)
{
cin >> N >> Q;
memset(arr,0,sizeof(arr));
memset(dp,0,sizeof(dp));
for (int i = 1; ... | ALGO | 0.997332 | 3.223544 |
2703d9f1-7a59-4c10-a2b9-6ab9a33ba26a | ehnryx/acm | swerc-2011-cf101561/g.cpp | //#pragma GCC optimize("O3")
//#pragma GCC target("sse4,avx2,abm,fma,tune=native")
#include <bits/stdc++.h>
using namespace std;
#define _USE_MATH_DEFINES
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
using namespace __gnu_pbds;
template <typename T>
using ordered_set = tree<T, null_typ... | ALGO | 0.99977 | 4.201741 |
a3588d79-f077-4f9f-881a-660196040de3 | kunyavskiy/competitive-programming-archive | codeforces.com/round/110/C.cpp | #include <iostream>
#include <fstream>
#include <vector>
#include <set>
#include <map>
#include <string>
#include <cmath>
#include <cassert>
#include <ctime>
#include <algorithm>
#include <queue>
#include <memory.h>
#include <stack>
#define mp make_pair
#define pb push_back
#define setval(a,v) mems... | ALGO | 0.999648 | 3.568405 |
793fd172-d394-4852-8e3d-cd3a9fe55260 | zzm99/Algorithm-Training | 动态规划/树形DP/337. 打家劫舍 III.cpp | class Solution {
public:
int rob(TreeNode* root) {
vector<int> ret = dfs(root);
return max(ret[0], ret[1]);
}
vector<int> dfs(TreeNode* root){
vector<int> ret(2);
if(!root) return ret;
vector<int> left = dfs(root->left);
vector<int> right = dfs(root->right);
... | ALGO | 0.999974 | 6.3984 |
3318648b-e78f-4a78-b4d5-82b4784bd097 | Herong1212/C-_learning | use_STL_容器/use_list/demo02.cpp | #include <iostream>
using namespace std;
#include<list>
class Person
{
public:
string mName;
int mAge;
int mHeight;
public:
Person(string name, int age, int height);
~Person();
};
Person::Person(string name, int age, int height)
{
mName = name;
mAge = age;
mHeight = height;
}
Person... | ALGO | 0.998719 | 4.23007 |
a0e40e54-b59e-4df5-864b-6e48c630f156 | stamcenter/llvm-zeno | pstl/test/std/algorithms/alg.sorting/partial_sort_copy.pass.cpp | // UNSUPPORTED: c++03, c++11, c++14
// Tests for partial_sort_copy
#include "support/pstl_test_config.h"
#include <cmath>
#include <execution>
#include <algorithm>
#include "support/utils.h"
using namespace TestUtils;
template <typename T>
struct Num
{
T val;
Num() : val(0) {}
Num(T v) : val(v) {}
... | TEST | 0.971478 | 7.001765 |
0de46aed-6b6d-41cd-b5d3-7779c261b4de | Shivsharma779/Leetcode_solutions | 268. Missing Number/shiv_sol.cpp | class Solution {
public:
int missingNumber(vector<int>& nums) {
int n = nums.size();
int i = 0;
while(i < n)
{
int j = nums[i];
if(j < n && nums[i] != nums[j]) swap(nums[i], nums[j]);
else i++;
}
for(int i = 0; i < n; i++)
{... | ALGO | 0.99986 | 5.838202 |
099b1840-7087-475d-a55f-06335ad042a9 | alisaocctoi/VVP | lab20/lab20.4.cpp | // lab20.4.cpp : Этот файл содержит функцию "main". Здесь начинается и заканчивается выполнение программы.
//
#include <iostream>
using namespace std;
int main()
{
char c;
cout<<"c:";
cin >> c;
int b;
string s;
cout << "string:";
getline(cin, s);
for (int i = 0; i < s.length; i++)
{
if (s[i]==c)
{
s.i... | TOOL | 0.979092 | 3.895524 |
4969dcc2-ed9f-4e50-ba84-d9f334decae3 | SC23-apdx298/Mixed-BLAS-Evaluation | dense/magma-2.7.1/sparse/src/zpbicgstab_merge.cpp | /*
-- MAGMA (version 2.7.1) --
Univ. of Tennessee, Knoxville
Univ. of California, Berkeley
Univ. of Colorado, Denver
@date February 2023
@precisions normal z -> s d c
@author Hartwig Anzt
*/
#include "magmasparse_internal.h"
#define RTOLERANCE lapackf77_dlamch( "E" )... | ALGO | 0.998983 | 5.479167 |
7674f658-7d34-46a5-b8b8-9d7a0e1d6dc0 | zhiwei1988/LeetCode | 76-minimum-window-substring/solution.cpp | class Solution {
public:
string minWindow(string s, string t) {
unordered_map<char, int> need;
unordered_map<char, int> window;
for (auto c : t) need[c]++;
int start = 0;
int len = INT_MAX;
int left = 0;
int right = 0;
int valid = 0;
... | ALGO | 0.999993 | 6.674456 |
96d84762-3249-48ee-8bf7-4822b2674cc2 | Hoanghung0603/BT_LTNC | Week2/B7.cpp | #include <iostream>
using namespace std;
int main(){
int n;
cin>>n;
cout<<n<<' ';
int temp=n;
while(n>0){
cin>>n;
if(n==temp)
continue;
else cout<<n<<' ';
temp=n;
}
}
| ALGO | 0.999877 | 3.125774 |
ddf605df-cb82-4e28-991f-c7b261695d44 | jvujcic/cp | cpp/hackerrank/week-of-code-24/apple_and_orange.cpp | #include <bits/stdc++.h>
using namespace std;
using i64 = int64_t;
using ui64 = uint64_t;
int main() {
freopen("input.txt", "r", stdin);
// ios_base::sync_with_stdio(false);
i64 s, t, a, b, m, n;
cin >> s >> t;
cin >> a >> b;
cin >> m >> n;
i64 apple_count = 0;
i64 orange_count = 0;
... | ALGO | 0.999711 | 4.078778 |
5cf14120-c0fc-483a-a531-ff46fd0bfb01 | Jinal-rathod/rw_jinalrathod_cpp_lectures | two_pointer/q2.cpp | // removing duplicates from a sorting array
#include <iostream>
#include <vector>
using namespace std;
int find(int arr[], int n)
{
int j = 0;
for (int i = 1; i < n; i++)
{
if (arr[i] != arr[j])
{
j++;
arr[j] = arr[i];
}
}
return j + 1;
}
int main()... | ALGO | 0.99995 | 4.76725 |
44da4c96-f401-4e38-a724-070464b876e1 | TrevorGarrett/WordleSolver | WordleSolver/ConsoleGame.cpp | #include <iostream>
#include <unordered_map>
#include <vector>
#include <chrono>
#include <thread>
#include "defines.h"
#include "Functions.h"
#include "Game.h"
bool isValidWord(std::string word) {
return true; // FIXME check that word is in the dictionary
}
void playConsoleGame(Game* game) { //FIXME need to remove ... | TOOL | 0.912922 | 4.946491 |
0388f36c-0acd-47ab-ab17-52a1bf1aff9c | ishu9565/leetcode | 27-remove-element/27-remove-element.cpp | class Solution {
public:
int removeElement(vector<int>& nums, int val) {
int n=nums.size(),r,cnt=0;
r=n-1;
for(int i=0;i<n;i++){
if(nums[i]==val){
cnt++;}
}
for(int i=0;i<n-cnt;i++){
if(nums[i]==val){
while(r>0&&nums[r... | ALGO | 0.999915 | 6.021211 |
010e1ab2-59dd-43cb-b278-e528f9767520 | sarvex/leetcode-boo | solution/0200-0299/0204.Count Primes/Solution.cpp | class Solution {
public:
int countPrimes(int n) {
vector<bool> primes(n, true);
int ans = 0;
for (int i = 2; i < n; ++i) {
if (primes[i]) {
++ans;
for (int j = i; j < n; j += i) primes[j] = false;
}
}
return ans;
}
}... | ALGO | 0.999967 | 6.013493 |
8590222d-b589-4043-a274-a0f4b7ddb946 | raincross7/code-similarity | codes/train_code/problem373/problem373_162.cpp | #include<bits/stdc++.h>
#define rep(i, n) for (int i = 0; i < (n); ++i)
#define rrep(i, a, b) for (int i = (a); i < (b); ++i)
#define PI acos(-1)
#define pcnt __builtin_popcountll
#define rng(a) a.begin(), a.end()
#define rrng(a) a.rbegin(), a.rend()
#define sz(x) (int)(x).size()
#define v(T) vector<T>
#define vv(T) v... | ALGO | 0.999981 | 3.366803 |
fdf6f289-824f-4bd1-9b45-4a059f651def | azizmithani/ngs-scripts | Identify_SNPs_NulliTetra_Lines.cpp | #include <iostream>
#include <fstream>
#include <sstream>
#include <string>
#include <vector>
#include <map>
#include <set>
#include <limits>
#include "Utilities.h"
using namespace std;
const int MIN_COVERAGE = 5;
const int MIN_BASE_COVERAGE = 3;
const double MIN_BASE_PROPORTION = 0.05;
const int OFFSET = 3;
typedef... | DATA | 0.978992 | 5.605144 |
4122b315-2eae-4a45-8808-de35ffcff67a | manya706/DSA-Codebase | TLE_sheet/contest/div 937 div4/problemE.cpp | #include <iostream>
#include <vector>
#include <unordered_map>
using namespace std;
#define int long long
#define vi vector<int>
#define read(a) for(auto &element: a) cin >> element
#define mod 1000000007
vector<vector<int>> divisors(200005);
vector<vector<int>> divisorsFrequency(200005);
vector<int> distances(200005)... | ALGO | 0.999877 | 5.199039 |
3d124ae5-7a46-44fd-9041-6f39052ef9b0 | RowonChung/SSAFY21_Algorithm | 강수현/S1/[0330] 1932. 정수 삼각형.cpp | #include <iostream>
#include <vector>
#include <cmath>
#include <queue>
#include <algorithm>
using namespace std;
int N;
vector<int>v[500];
int index = 1;
int main() {
cin >> N;
for (int i = 0; i < N; i++) {
for (int j = 0; j < index; j++) {
int input;
cin >> input;
v[i].push_back(input);
}
index++;... | ALGO | 0.999493 | 3.682863 |
69f2d975-8d14-492e-9c58-aea75574a3f5 | Yong0507/Multi-Core-Programming | 과제/17번 성긴동기화 SKList/성긴동기화 SKList.cpp | #include <iostream>
#include <mutex>
#include <thread>
#include <vector>
#include <chrono>
using namespace std;
using namespace chrono;
const int NUM_TEST = 4000'000;
constexpr int NUM_LV = 10;
class null_mutex {
void lock() {};
void unlock() {};
};
class SKNODE {
public:
int value;
SKNODE* next[NUM_LV];
int t... | TEST | 0.952837 | 5.526579 |
4b7fb70e-19bb-4621-bbfc-fcf6bbe6f56b | SpexGuy/MinkowskiHull3D | main.cpp | #include <iostream>
#include <cstdlib>
#include <cmath>
#include <glm/glm.hpp>
#include <glm/gtc/matrix_transform.hpp>
#include <glm/gtx/transform.hpp>
#include <stb/stb_image.h>
#include "gl_includes.h"
#include "Perf.h"
#include "hull3D.h"
#include "loader.h"
using namespace std;
using namespace glm;
GLuint compi... | ALGO | 0.880748 | 3.913787 |
e040ec36-63bc-48fc-951b-b945d2e694bd | Shaquille-Wu/MNN | source/backend/cpu/x86_x64/avx/MNNGemmFloatCommon_4.cpp | #include <algorithm>
#include <cmath>
#include "FunctionSummary.hpp"
#include "backend/cpu/compute/Int8FunctionsOpt.h"
#ifndef _MM_TRANSPOSE4_PS
#define _MM_TRANSPOSE4_PS(row0, row1, row2, row3) \
do { \
__m128 tmp3, tmp2, tmp1, tmp0; \
tmp0 = _... | ALGO | 0.998959 | 6.916719 |
d2e18fb2-b13a-4714-8f22-b492d72c1c06 | camilacuba/Programaci-n_1 | PRACTICA 2/ejercicio_02_04.cpp | //Materia. Programacion I, Paralelo 3
//Autor:Camila Valentina Cuba Fernandez
//Fecha de Creacion: 22/02/2025
//Problema Planteado: lanzamiento de moneda y porcentaje de cara o cruz
#include <iostream>
#include <cstdlib>
using namespace std;
int main()
{
float n, cc=0, cx=0,i;
int d;
float pc, px;
... | ALGO | 0.999766 | 4.455029 |
57db8ee6-f8fd-4a4b-acea-486a0177f568 | gtanish2003/DSA_in_CPP | BinaryTree/ConstructTreeFromINORDERandPOSTORDER.cpp | #include <iostream>
#include <vector>
#include <map>
using namespace std;
class Node
{
public:
int data;
Node *left;
Node *right;
Node(int data)
{
this->data = data;
this->left = NULL;
this->right = NULL;
}
};
void createMapping(int in[], map<int, int> &NodeToIndex, in... | ALGO | 0.999991 | 5.827977 |
6febfe25-c815-45f6-9b76-b312c2c73377 | M-Bekheet/learn-in-public | c++/17-STL/13.1-STL-practice.cpp | #include <iostream>
#include <map>
#include <stack>
using namespace std;
/*
Problem: Given a string containing only these characters '(', ')','{','}', '[', and ']'
The string should be valid if:
- Open brackets must be closed by the same type of brackets
- Open brackets must be closed in the correct order
... | ALGO | 0.997952 | 6.468728 |
74cf2507-78da-4ddb-afc3-9625bcd6a338 | Aysha-khanom/CPP | string/Word Capitalization.cpp | #include<bits/stdc++.h>
using namespace std;
int main()
{
string a;
cin >> a;
for(int i=0; i<a.size(); i++)
{
if(a[0]>='a' && a[0]<='z')
{
a[0]-=32;
}
}
cout << a;
}
| ALGO | 0.993392 | 4.146822 |
2aad3fea-3eed-40be-a0ad-faf870c30d32 | Adi2209/DSA | buyAndSellStocksIV.cpp | class Solution {
public:
int find(vector<int> &prices,int ind,bool buy,int c,int k,vector<vector<vector<int>>> &memo)
{ //if buy =1 means we have to buy now
//else we have to sell now
if(ind>=prices.size()||c>=k) return 0; //counter
else if(memo[ind][buy][c]!=-1) return memo[i... | ALGO | 0.999923 | 5.585422 |
64331b54-08bf-4ea3-9a89-125bd806f722 | jihorobert/FlutterBasic | 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.998784 | 6.761023 |
0244a639-82a1-4314-b41b-4a0fdff8c7de | habiburrahmantalha/UVA-online-Judge | 599_The_Forrest_for_the_Trees.cpp | #include<stdio.h>
#include<string.h>
int P[30],f[30];
int n;
int findset(int x)
{
if(x!=P[x])
P[x]=findset(P[x]);
return P[x];
}
void reset()
{
int i;
for(i=0;i<=26;i++)
P[i]=i;
}
void unionset(int x,int y)
{
int px=findset(x);
int py=findset(y);
P[py]=P[px];
}
int main()
{
... | ALGO | 0.999572 | 3.001193 |
b85ff79e-f691-4b47-84f8-f11329e0619b | gitkrypton18/CPP_PROBLEMS_LAB | PATTERNS/O.cpp | /*
9
87
654
3210
*/
#include <iostream>
using namespace std;
int main() {
int alpha = 9;
for (int i = 0; i < 4; i++) {
for (int j = 0; j <= i; j++) {
cout << alpha;
alpha--;
}
cout << endl;
}
return 0;
}
| ALGO | 0.999855 | 3.744529 |
074ac010-edf4-46bc-ba9b-88741fb9a824 | ishandutta2007/codeforces | kpw29/normal/1416/B.cpp | #include <bits/stdc++.h>
using namespace std;
#define e1 first
#define e2 second
#define pb push_back
#define mp make_pair
#define boost {ios_base::sync_with_stdio(false); cin.tie(0); cout.tie(0); }
#define eb emplace_back
#define OUT(x) {cout << x; exit(0); }
#define FOR(i,a,b) for(int i=(a);i<=(b);++i)
#define scanf(... | ALGO | 0.999214 | 3.491158 |
11a2ebf0-ade9-4330-bd01-ba27d42b01e4 | hannanmiyaji/flutter | lib/lib/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.997811 | 6.76775 |
cdb7e514-7e17-4e0c-97ba-c43595b0ddf0 | fallen-Ikaroc/calculator | Labs/lab1/lab1/seminar2.cpp | #include "core.h"
void seminar2()
{
system("cls");
// start seminar 2
cout << "Seminar 2" << endl << "The characteristic feature of the column of the integer matrix is the sum of" << endl <<
"the modules of its negative odd-numbered elements. By rearranging the columns" << endl <<
"of a given matrix, arrange ... | ALGO | 0.995934 | 3.052252 |
6ac7046b-f3f0-4704-8a64-3639e33c2cdd | ceschoon/Minecraft-Labyrinth | Labyrinth-demo/datapacks/Cedric_Labyrinth/data/laby/cpp_maze_gen/mcfunction_maze.cpp | #include <fstream>
#include <iostream>
#include <iomanip>
#include <string>
#include <random>
using namespace std;
int random_offset(double random_number)
{
double cumul = 0;
double proba;
proba = 1.0/4;
if (random_number-cumul<proba) return 1;
else cumul += proba;
proba = 1.0/8;
if (random_number-cumul<pr... | TOOL | 0.976922 | 4.601454 |
013bb318-e7f4-4041-950a-b45978ae1f94 | wtf42/au-networking | src/client.cpp | #include <iostream>
#include <sstream>
#include <queue>
#include <thread>
#include <mutex>
#include <condition_variable>
#include <atomic>
#include "common.h"
#include "stream_socket.h"
#include "tcp_socket.h"
#include "messages.h"
#include "protocol.h"
enum state_t { WAIT, READY, EXIT };
std::atomic<state_t> state;... | WEB | 0.853269 | 4.410348 |
41605653-daea-4751-87bf-5711b5a88c1a | dingningpei/LLM_Semantics | serene-python-client-stp/stp/minizinc/chuffed-rel2onto_20170728/boost_1_87_0/libs/math/example/bernoulli_example.cpp | #pragma warning (disable : 4100) // unreferenced formal parameter.
#pragma warning (disable : 4127) // conditional expression is constant.
//#define BOOST_MATH_OVERFLOW_ERROR_POLICY ignore_error
#include <boost/multiprecision/cpp_dec_float.hpp>
#include <boost/math/special_functions/bernoulli.hpp>
#include <iostream... | ALGO | 0.996931 | 5.140999 |
8a9a9cff-a3a7-454a-80db-6689b32bd6de | Ruchika349/Geeks-for-Geeks-practice | Difficulty: Easy/Remaining String/remaining-string.cpp | //{ Driver Code Starts
#include <bits/stdc++.h>
using namespace std;
// } Driver Code Ends
// User function template for C++
class Solution {
public:
string printString(string s, char ch, int count) {
// Your code goes here
int counter = 0;
size_t pos = 0;
while(counter ... | ALGO | 0.999657 | 5.649785 |
5c9146eb-4717-45bd-ab2b-1f233ef3aee4 | zerls/PAT | pat_advanced/1099.cpp | #include <iostream>
#include <vector>
#include <algorithm>
#include <queue>
using namespace std;
static vector<int> in;
static int n,indexs=0,num=0; //num 输出空格控制
struct Node{
int l,r,data;
}node_1099[110];
static void inlorder(int root) {
if(root == -1) return ;
inlorder(node_1099[root].l);
node_1099[ro... | ALGO | 0.999996 | 3.889348 |
9f0429af-4b74-4aae-8ef4-e23c0fd47e4d | ishandutta2007/codeforces | radal/normal/NA/358.cpp | #include <iostream>
#include <algorithm>
using namespace std;
int main(){
int n;
cin>>n;
for (int i=0; i<n; i++){
if (i%2==0){
cout<<"I hate ";
}
if (i%2==1){
cout<<"I love ";
}
if (i<n-1){
cout<<"that ";
}
}
cout<<"it";
} | ALGO | 0.999746 | 3.335397 |
02361382-851d-493e-b947-b6f8e249eead | Mohammad-Ashikul-Islam/Competitive_Programming | Codechef/Elections in Chefland.cpp | #include<bits/stdc++.h>
using namespace std;
#define ll long long
int main()
{
ll t;
cin >> t;
while(t--){
ll n,m;
cin >> n >> m;
ll ans = 0;
for(ll i=0; i<n; i++){
ll x;
cin >> x;
if(x>=m) ans++;
}
cout << ans << endl;
... | ALGO | 0.999948 | 3.892586 |
38a6b076-8986-4ebf-afe3-34f8affc4d33 | tahaalotwala/Algorithms | 03_mergeSort.cpp | #include <bits/stdc++.h>
using namespace std;
void merge1(vector<int> &nums, int start, int end, int mid)
{
vector<int> temp(end - start + 1);
int i = start;
int j = mid + 1;
int k = 0;
while (i <= mid && j <= end)
{
if (nums[i] < nums[j])
{
temp[k] = nums[i];
... | ALGO | 0.999989 | 5.310186 |
3bec4213-ea4f-4343-9a4f-b6d2faceb0a5 | HLRJ/Cpu0_For_LLVM17 | llvm-project-llvmorg-17.0.6/libc/src/math/generic/ceil.cpp | #include "src/math/ceil.h"
#include "src/__support/FPUtil/NearestIntegerOperations.h"
#include "src/__support/common.h"
namespace __llvm_libc {
LLVM_LIBC_FUNCTION(double, ceil, (double x)) { return fputil::ceil(x); }
} // namespace __llvm_libc
| ALGO | 0.977297 | 6.505051 |
2e8d59d9-5d68-42a9-88b7-74f9f2f93046 | shivansh2502/Competitive-Programming | Hashing/Range_Xor.cpp | #include<bits/stdc++.h>
using namespace std;
#define ll long long
int main(){
ll t;
cin>>t;
vector<ll> v;
while(t--){
ll type;
cin>>type;
if(type==0){
ll x;
cin>>x;
v.push_back(x);
}
else if(type==1){
ll l,r,x;
... | ALGO | 0.999962 | 4.035647 |
4d285ee8-e657-443c-bb61-3c57136a8b10 | skygupta07/DSA | 79_searching1/13_arrangingCoins.cpp | // arrangingCoins
/*
You have n coins and you want to build a staircase with these coins.
The staircase consists of k rows where the ith row has exactly i coins.
The last row of the staircase may be incomplete.
Given the integer n, return the number of complete rows of the staircase you will build.
Example 1:
Inp... | ALGO | 0.998918 | 6.827141 |
a19b7459-b7b5-4b48-b7f2-98df42aaf34f | BlissOS/platform_external_swiftshader | third_party/llvm-subzero/lib/Support/SmallPtrSet.cpp | #include "llvm/ADT/SmallPtrSet.h"
#include "llvm/ADT/DenseMapInfo.h"
#include "llvm/Support/MathExtras.h"
#include <algorithm>
#include <cassert>
#include <cstdlib>
using namespace llvm;
void SmallPtrSetImplBase::shrink_and_clear() {
assert(!isSmall() && "Can't shrink a small set!");
free(CurArray);
// Reduce ... | ALGO | 0.95681 | 7.880895 |
d5109e92-2a60-4ee3-9e89-1534b011f7c5 | jcamilo1599/flutter_matrix-islands | 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.99887 | 6.783439 |
7da449b1-bad7-4566-9a4e-c8df15a105e1 | ehlsmsrpanjdi/CodingTest | 프로그래머스/0/181852. 뒤에서 5등 위로/뒤에서 5등 위로.cpp | #include <string>
#include <vector>
#include <algorithm>
using namespace std;
vector<int> solution(vector<int> num_list) {
sort(num_list.begin(), num_list.end());
std::vector<int> vec(num_list.begin() + 5, num_list.end());
return vec;
} | ALGO | 0.99916 | 3.995102 |
c5eaa198-f1f6-4d34-80c9-c7a22cc2a802 | SaatvikPoonia/SIT315 | Task M2_T1P/pthread.cpp | // Name: Saatvik
// Including Liraries
#include <chrono>
#include <iostream>
#include <stdlib.h>
#include <pthread.h>
#include <thread>
#include <time.h>
#include <unistd.h>
#include <string>
using namespace std;
#include <iomanip>
// Initialising the threads & N
#define NUM_THREADS 100
#define N 100
// Initialising... | ALGO | 0.997841 | 4.17285 |
6ea42874-e1f3-4099-ac82-4feaec066d21 | HunterSun2018/filament-ex | third_party/spirv-tools/source/fuzz/fuzzer_pass_outline_functions.cpp | #include "source/fuzz/fuzzer_pass_outline_functions.h"
#include <vector>
#include "source/fuzz/fuzzer_util.h"
#include "source/fuzz/instruction_descriptor.h"
#include "source/fuzz/transformation_outline_function.h"
#include "source/fuzz/transformation_split_block.h"
namespace spvtools {
namespace fuzz {
FuzzerPassO... | TOOL | 0.944947 | 7.841599 |
42bce24e-e559-4bc9-8553-37de98bab43c | daniel-elesbao/POO2025Q2 | C++/137. Crescimento/Crescimento.cpp | #include <iostream>
int main()
{
int T, pA, pB;
double gA, gB;
std::cin >> T;
for (int i = 0; i < T; i++)
{
std::cin >> pA >> pB >> gA >> gB;
int anos = 0;
while (pA <= pB && anos <= 100)
{
pA += (pA * gA / 100);
pB += (pB * gB / 100);
... | ALGO | 0.999599 | 3.90964 |
109a44b7-a1f1-435c-97a7-3ce2275bc518 | GeeKY03/cppcodesolutions | hjfhdkghjkgf.cpp | #include<bits/stdc++.h>
using namespace std;
#pragma GCC target ("avx2")
#pragma GCC optimization ("O3")
#pragma GCC optimization ("unroll-loops")
typedef long long ll;
typedef vector<int> vi;
typedef vector<long long int> vlli;
#define pb push_back
#define endl '\n'
#define all(x) x.begin(),x.end()
#define ff first
#d... | ALGO | 0.999953 | 5.780619 |
6231f703-4bf5-46dd-925c-ab6a7f775775 | rohith44hack/cpp.r | sudokkuupdated.r.cpp | #include <iostream>
#include <vector>
#include <ctime>
#include <cstdlib>
#include <string> // Needed for string
#include <cstdlib> // For atoi
using namespace std;
#define N 9
#define EMPTY 0
#define REMOVED_CELLS 40
int board[N][N];
void printBoard() {
cout << "\n ";
for (int j = 0; j < N; j++) {
... | ALGO | 0.995956 | 6.662631 |
07ded28d-53a3-4613-8a89-48885fcfcd1a | stringing/Federated-LLM-Based-APR | RoPGen/src/coding style attacks/author-style-transform/transform/program_file/target_author_file/82/82.cpp | #include <bits/stdc++.h>
using namespace std;
struct gem {
int r, t, p;
}g;
vector <gem> gems;
double sum1[1005], num[1005];
int n, p, k, t;
string s;
long long sum;
bool cmp (gem x, gem y)
{
if (sum1[x.r] / num[x.r] != sum1 [y.r] / num [y.r])
{
return sum1[x.r] / num [x.r] < sum1[y.r] / num [y.r];... | ALGO | 0.999151 | 3.397212 |
cdd147a4-8507-4938-a260-74960c2f29c2 | faterazer/LeetCode | 2594. Minimum Time to Repair Cars/Solution.cpp | #include <algorithm>
#include <cmath>
#include <ranges>
#include <vector>
using namespace std;
class Solution {
public:
long long repairCars(vector<int>& ranks, int cars)
{
long long left = 0, right = 1LL * ranges::min(ranks) * cars * cars;
while (left < right) {
long long mid = lef... | ALGO | 0.999955 | 5.429987 |
02216d08-324d-462e-b0f4-2c9ae42a67a8 | hatimchharchhoda/C_plus_plus_praticals | polar_rectangle.cpp | #include<iostream>
#include<math.h>
using namespace std;
class polar
{
protected:
float r,radian;
public:
polar()
{
cout<<"enter the value of r and radian: ";
cin>>r>>radian;
}
};
class rectangle: public polar
{
float x,y;
public:
void display()
{
x=r*cos(radian);
... | TOOL | 0.89636 | 3.783225 |
217470fe-ea15-451b-9127-79987a39654b | sunyinqi0508/AQuery2 | tests/datagen_jose/gen.cpp | // cmvc_id = %Z% %W% %I% %E% %U%
#ifndef genIMPLEMENTATION
#define genIMPLEMENTATION
#include <iostream.h>
#include "RandGen.hpp"
int num[6];
int nelems=0;
int member(int a_)
{
for (int i=0; i<nelems; i++)
{
if (num[i] == a_) return 1;
}
return 0;
}
int gen(int flag_)
{
RandNumGen rg;
if (flag_... | ALGO | 0.927193 | 3.208346 |
bfa2e6d8-3403-4800-8334-5e0fa8a0e1b3 | utsavtyagi01/Coding_Ninjas_Problems | Bubble_Sort.cpp | void bubbleSort(vector<int>& arr, int n)
{
//write your code here
bool count=false;
for(int i=0;i<n-1;i++){
count=true;
for(int j=0;j<n-i-1;j++){
if (arr[j] > arr[j + 1]) {
int temp=arr[j];
arr[j]=arr[j+1];
arr[j+1]=temp;
count=t... | ALGO | 0.999915 | 5.295639 |
4e5a953b-cedf-4d7a-93a7-7e7d379ad91b | danieljhuynh/project | cisp430/SelectionSort.cpp | /*
Title: SelectionSort (Source code based on Prof Ross' code)
Author: Daniel Huynh
Date: 1/26/2020
Change List:
Fixed compiling error: void main to int main
Added for loop open/close braces
Added print statements
Whitespace cleanup
Since array is global, passing the argument into functions isn't needed
Cop... | ALGO | 0.999964 | 5.088227 |
8aec1a82-0df4-4d97-92e8-34060816e492 | leoni05/PS | BOJ/9200/9242.cpp | #include <bits/stdc++.h>
using namespace std;
char digit[20][20] = {
"**** ** ** ****",
" * * * * *",
"*** ***** ***",
"*** **** ****",
"* ** **** * *",
"**** *** ****",
"**** **** ****",
"*** * * * *",
"**** ***** ****",
"**** **** ****"
};
char str[5][45];
int get_digit(int x){
for(in... | ALGO | 0.997891 | 3.919788 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.