uuid string | repo_name string | relative_path string | content string | category string | algo_rel_score float64 | quality_score float64 |
|---|---|---|---|---|---|---|
6a710621-02db-47d9-8402-061ce4fef0f3 | yxzlwz/oi-code | luogu/P1352.cpp | #include <bits/stdc++.h>
using namespace std;
const int N = 6001;
int n, r[N], dp[N][2];
bool vis[N];
struct EDGE {
int v, next;
} edge[N << 1];
int ecnt, head[N];
inline void add_edge(int u, int v) {
edge[++ecnt] = (EDGE){v, head[u]};
head[u] = ecnt;
}
int dfs(int u) {
if (!head[u]) {
dp... | ALGO | 0.999823 | 3.874513 |
9330605d-1f54-43ad-8c9c-b170b61708fe | lixiang1199/PAT | 1088 三人行/源.cpp | #include<iostream>
using namespace std;
int temp[10];//ּ
int main() {
int m;//Լ
float X, Y;
cin >> m >> X >> Y;
int i, y;//ұ
float z;//ȫfloat/double
int p = 0;
for (int i = 10; i < 100; i++)//
{
y = i / 10 + (i % 10) * 10;//
if (abs(i - y) / float(X) == float(y) / float(Y))//עת
{
temp[p++] = i;
z =... | ALGO | 0.999498 | 3.36283 |
49c13515-5ca2-4266-811c-044eb653b6df | Camypai/Spbkt_GorshkovIP | lab22/program22.cpp | #include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#include <errno.h>
#include <sys/types.h>
#include <sys/wait.h>
int main()
{
int x, pid;
x=2;
printf("Single process, x=%d\n",x);
pid=fork();
if(pid == 0)
printf("New, x=%d\n",x); // Потомок
else if(pid > 0)
{ // Родитель
printf("Old, pid=%d, x=%d\n",pid,x);
... | TOOL | 0.96632 | 3.791748 |
e04f40b6-a15c-435e-935b-005f5073a21c | Zhenghao-He/Knight- | Knight/cocos2d/extensions/Particle3D/PU/CCPUInterParticleCollider.cpp | #include "CCPUInterParticleCollider.h"
#include "extensions/Particle3D/PU/CCPUParticleSystem3D.h"
NS_CC_BEGIN
// Constants
const float PUParticle3DInterParticleCollider::DEFAULT_ADJUSTMENT = 1.0f;
const PUParticle3DInterParticleCollider::InterParticleCollisionResponse PUParticle3DInterParticleCollider::DEFAULT_COLLIS... | TOOL | 0.945043 | 6.909686 |
3ec8a15a-86ec-4fae-906a-9b08eb2f363a | squaresLab/BatFix | results/transcoder/translations/py/PROGRAM_CHECK_ISBN.cpp | bool isValidISBN ( const std :: string & isbn ) {
if ( isbn . size ( ) != 10 ) return false ;
int _sum = 0 ;
for ( int i = 0 ;
i < 9 ;
++ i ) {
if ( 0 <= isdigit ( isbn [ i ] ) && i <= 9 ) _sum += isdigit ( isbn [ i ] ) * ( 10 - i ) ;
else return false ;
}
if ( ( isbn [ 9 ] != 'X' && 0 <= isdigit ... | TOOL | 0.9752 | 5.707368 |
0026c6d7-b7aa-4cef-897d-8a6520e1d054 | MarcoStb1993/rnexploration | rsb_nbv_exploration/src/GlobalGraphSearcher.cpp | #include <rsb_nbv_exploration/GlobalGraphSearcher.h>
GlobalGraphSearcher::GlobalGraphSearcher() :
_gg_kd_tree_index(3, _gg_kd_adaptor,
nanoflann::KDTreeSingleIndexAdaptorParams(20)) {
}
void GlobalGraphSearcher::initialize(
rsb_nbv_exploration_msgs::GlobalGraph &gg) {
_gg_kd_adaptor.gg = gg;
_gg_kd_tree_ind... | ALGO | 0.996403 | 6.040747 |
9ee619c6-367d-4522-9cb4-a6b72f92542e | AdityaKharmaleGoat7/Dynamic-Programming | House_Robbery.cpp | #include <bits/stdc++.h>
#define ll long long
#define vi vector<int>
#define rep(i, a, b) for(int i = a;i < b;i++)
using namespace std;
int solve(int index, int* arr, int n){
if(index >= n){
return 0;
}
int include = arr[index] + solve(index +2, arr, n);
int exclude = 0 + solve(index +1, arr, ... | ALGO | 0.999928 | 4.171088 |
09f00b38-5ec9-4d08-b947-089c546b609a | zhangbowen-jpg/Code--Practice | 合并果子.cpp | /*************************************************************************
> File Name: 合并果子.cpp
> Author: zhangbowen
> Mail:
> Created Time: 2019年11月06日 星期三 17时18分01秒
************************************************************************/
#include<iostream>
#include<stdio.h>
#include<string.h>
#include<stdlib.... | ALGO | 0.999986 | 3.86723 |
b2d87b58-c77c-4021-8c41-44c15c73c89c | reokoizumi/kyoupro | arihon/kaisetumita/2-1/DFS-2.cpp | #include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i = 0; i < n; i++)
using ll = long long;
using P = pair<int, int>;
const int INF = 1e+8;
double PI = 3.141592653589793238;
int n, m;
vector<vector<char>> field(101, vector<char>(101));
void dfs(int x, int y) {
field[x][y] = '.';
for (int dx... | ALGO | 0.999785 | 4.210938 |
ccdd4c92-30c7-4dbb-a0eb-5c22b2aaf07c | DevrajChdhary/CPP | ActivitySelection.cpp | #include<bits/stdc++.h>
using namespace std;
int main(){
int n;
cin>>n;
vector<vector<int>>v;
for(int i=0;i<n;i++){
int start,end;
cin>>start>>end;
v.push_back({start,end});
}
sort(v.begin(),v.end());
int take=1;
int end=v[0][1];
for(int i=1;i<n;i++){
... | ALGO | 0.999685 | 4.360756 |
552768a7-ad2c-41f1-8d01-086de44f745c | hansususu/boj_algorithm | 1874.cpp | #include <iostream>
#include <stack>
#include <vector>
using namespace std;
int main() {
stack<int> s;
vector<char> res;
int cnt = 1, n;
cin >> n;
for (int i = 0; i < n; i++) {
int x;
cin >> x;
while (cnt <= x) {
s.push(cnt);
cnt++;
res.p... | ALGO | 0.999997 | 4.101078 |
39834f9a-4784-4931-9386-1125a3c1cab5 | NoOneofConsequencePrime/Solutions | LeetCode/C++/linked-list-cycle.cpp | #include <iostream>
#include <vector>
#include <string>
#include <algorithm>
#include <queue>
#include <stack>
#include <deque>
#include <unordered_set>
#include <numeric>
#include <map>
using namespace std;
//ios::sync_with_stdio(false); cin.tie(nullptr); cout.tie(nullptr);
bool hasCycle(ListNode *head) {
if (!h... | ALGO | 0.999648 | 3.798823 |
4e6d5de8-f3f9-4c76-a5a4-cae79e07dc5f | kritika2611/Algorithms-and-Datastructures | _Binary_trees/15. max_sum_path.cpp | #include <bits/stdc++.h>
using namespace std;
class node{
public:
int data;
node* left;
node* right;
node(int d){
this->data=d;
left=NULL;
right=NULL;
}
};
node* Tree(){
int d;
cin>>d;
if(d==-1){
return NULL;
}
node *n=new node(d);
n->left=... | ALGO | 0.999963 | 4.487906 |
1460d419-136e-4b60-9db8-e48b63ac7fd4 | MohamedMousad/Problem_Solving | CSES/CSES sheets/Sorting&Searhcing/M-Playlist.cpp | #include <bits/stdc++.h>
using namespace std;
#define all(s) s.begin(), s.end()
#define cin(vec) \
for (auto &i : vec) \
cin >> i
#define int long long
#define ld long double
#define Ceil(a, b) (a / b) + (a % b != 0)
#define fill(i, a, b) for (long long i = a; i < b; i++)
#define rep(n) for (int i = 0; i... | ALGO | 0.999744 | 5.010333 |
b0153f9a-6b5b-4954-b170-2cce3340f688 | Keyu-He/Enhancing-Debugging-Skills-of-LLMs-with-Prompt-Engineering | solutions_correct/algorithms/P/Process Restricted Friend Requests/Process Restricted Friend Requests.cpp | // Runtime: 361 ms (Top 82.03%) | Memory: 22.1 MB (Top 38.96%)
/ Standard DSU Class
class DSU {
vector<int> parent, size;
public:
DSU(int n) {
for(int i=0; i<=n; i++) {
parent.push_back(i);
size.push_back(1);
}
}
int findParent(int num) {
if(parent[num] ... | ALGO | 0.999986 | 6.082326 |
ec54851d-df15-4735-aac5-e12882fe5b5c | ViniciusMVilela/entrega03-flutter | windows/runner/utils.cpp | #include "utils.h"
#include <flutter_windows.h>
#include <io.h>
#include <stdio.h>
#include <windows.h>
#include <iostream>
void CreateAndAttachConsole() {
if (::AllocConsole()) {
FILE *unused;
if (freopen_s(&unused, "CONOUT$", "w", stdout)) {
_dup2(_fileno(stdout), 1);
}
if (freopen_s(&unuse... | TOOL | 0.9988 | 6.76073 |
1716f770-1f45-4e44-9903-74f7c5b8e9b9 | kramer04/France-Ioi | Niveau 5/Plus courts chemins/Parcours le plus court/main.cpp | #include <iostream>
#include <vector>
#include <queue>
#include <climits>
#include <algorithm>
struct Edge
{
int node, length;
};
struct State
{
int node, distance;
bool operator>(const State &other) const
{
return distance > other.distance;
}
};
int main()
{
std::ios::sync_with_stdio(false);
std::cin... | ALGO | 0.999951 | 4.199551 |
aee2d38f-1dcd-47fd-b317-6e0b1e1a70c8 | neonux/mozilla-all | content/xslt/src/xpath/txLocationStep.cpp | /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*
Implementation of an XPath LocationStep
*/
#include "txExpr.h"
#include "txIXPathContext.h"
#include "txNodeSet.h"
#include "txXPathTreeWalker.h"
//-----------------------------/
//- Virtual methods from Expr -/
//---------------... | ALGO | 0.925332 | 7.233768 |
cf2797b2-2786-48a4-bbb1-7c4ca81622fc | InvalidNamee/OJ-AC-Repository-for-UPC | AC_code/CSES系列/3843_Graph_Algorithms/11_L_Cycle_Finding.cpp | #include <iostream>
#include <cstring>
#include <stack>
using namespace std;
const int N = 2510, M = 5010;
struct Node {
int x, y, w;
} ed[M];
long long dis[N];
int pre[N];
bool vis[N];
int main() {
ios::sync_with_stdio(0);
cin.tie(0), cout.tie(0);
int n, m;
cin >> n >> m;
for (int i = 1; i <... | ALGO | 0.999996 | 3.980757 |
e69d91cb-5ac7-4495-9e32-727963735567 | AnshAg111/6Companies30days | microsoft/4.cpp | class Solution {
public:
int maxRotateFunction(vector<int>& nums) {
int sum=0, s=0, n=nums.size();
for(int i=0; i<n; i++){
sum+=nums[i];
s+=(i*nums[i]);
}
int max=s;
for(int i=1; i<n; i++){
s=s+sum-(n*nums[n-i]);
if(max<s) max=s... | ALGO | 0.999922 | 5.750585 |
4c54c30c-4b18-454f-8901-c2e323edb05f | Nimfell/OOP_2 | 7.cpp | #include <stdio.h>
#include "iostream"
using namespace std;
int add(int a, int b)
{
return a + b;
}
int subtract(int a, int b)
{
return a - b;
}
class Parent
{ // динамический полиморфизм (даёт возможность вызова переопределенной функции для дочернего класса)
virtual void PutChar(char ch) { cout << Lett... | TOOL | 0.852921 | 3.209927 |
3f9de1db-95b7-45d9-8969-839e707ce643 | ingallz/Algorithm | Greedy/vnoicup22_r1_b.cpp |
/* 𝑪𝒓𝒆𝒂𝒕𝒆𝒅 𝒃𝒚 𝑻𝒓𝒂𝒏 𝑫𝒖𝒄 𝑯𝒖𝒚 */
#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
#include <ext/pb_ds/detail/standard_policies.hpp>
#pragma GCC optimize("O3")
#pragma GCC target("sse4")
using namespace std;
using namespace __gnu_pbds;
#define int... | ALGO | 0.999882 | 3.762293 |
d2f38c76-5e82-402e-b82f-92e7e1fb0376 | WojciechPtas/C-Compiler | LLVM_IR_Generation_Examples/fac.cpp | #include "llvm/IR/Module.h" /* Module */
#include "llvm/IR/Function.h" /* Function */
#include "llvm/IR/IRBuilder.h" /* IRBuilder */
#include "llvm/IR/LLVMContext.h" /* LLVMContext */
#include "llvm/IR/GlobalValue.h" /* GlobaleVariable, LinkageTypes */
#includ... | TOOL | 0.956928 | 6.316678 |
2528f50a-e7dc-4019-aff3-8e82509b3f62 | praveenreddychalamalla/Problem-Solving | CPP/Stacks/bintree_traversals_without_recursion.cpp | #include<bits/stdc++.h>
#define mp make_pair
#define pb push_back
#define F first
#define S second
#define pi pair<int,int>
#define FOR(i,a,b) for(int i=(a);i<(b);i++)
using namespace std;
struct Node {
int data;
Node* left;
Node* right;
};
vector<int> inOrder(Node* root){
vector<int>v;
Node* temp=... | ALGO | 0.999888 | 4.087561 |
34c830ed-9e09-4719-a0c1-0b4567d7397d | yashkandpal98/CPP | Year-2 New/DS/Tests/Test2.cpp | #include<iostream>
using namespace std;
void insert(int n, int a[10][10])
{
for(int i = 0; i < n; i++) for(int j = 0; j < n; j++){
cin>>a[i][j];
cout<<"Edge between "<<i+1<<" and "<<j+1<<"\n";
}
}
int main()
{
int n;
int a[10][10];
cout<<"Enter number of vertices: "; cin>>n;
cout<<"Enter edges:\n\n";
ins... | ALGO | 0.983114 | 3.627648 |
07988c41-ee27-4f74-80ab-d8b488c6edc6 | qloach/GeometricToolsEngine1p0 | GeometricTools/GTEngine/Source/GteFluid3UpdateState.cpp | #include "GTEnginePCH.h"
#include "GteFluid3UpdateState.h"
#include "GteShaderFactory.h"
using namespace gte;
//----------------------------------------------------------------------------
Fluid3UpdateState::~Fluid3UpdateState()
{
}
//----------------------------------------------------------------------------
Fluid3U... | TOOL | 0.969018 | 6.251546 |
dac175ef-cd7f-4519-856a-1b973c1af649 | bony2023/Competitive-Programming | Contests/CodeChef/2014 October Long Challenge/07 SEATSR.cpp | // Author : Bony Roopchandani
// SEATSR
// DP - Levenshtein Distance
// INCLUDES
#include <algorithm>
#include <climits>
#include <cmath>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <iostream>
#include <list>
#include <map>
#include <queue>
#include <set>
#include <stack>
#include <string>
#includ... | ALGO | 0.999966 | 3.926351 |
a0d534d0-5b61-4247-ae47-d63bfa6ad8eb | willkim28/oop-in-cpp-244 | w7/w7_home/SuperHero.cpp | // Workshop 7
// Name: Woohyun Kim
// Student #: 122733157
// Course: OOP244 Fall 2018
// File: SuperHero.cpp
#include <iostream>
#include <cstring>
#include "SuperHero.h"
using namespace std;
using namespace sict;
namespace sict {
SuperHero::SuperHero() : Hero() {
shABonus = 0;
shDBonus = 0;
... | TOOL | 0.946754 | 4.693516 |
2683c6d9-18ea-4201-8dfc-7300c5d87d4f | yamin-2001/Competitive-Programming | LOJ-solutions/Integer_Divisibility.cpp | #include <bits/stdc++.h>
using namespace std;
string t_case() { static int tc; return "Case " + to_string(++tc) + ':'; }
typedef long long ll;
typedef unsigned long long ull;
typedef long double lld;
const int N = 2e5 + 19;
const ll INF = 1e18;
#define endl "\n"
#define pub push_back
#define F first
#define S second
... | ALGO | 0.999427 | 4.103629 |
9a1a632f-84aa-485a-ac2d-494d76f4f536 | Riznee2000/ardupilot | libraries/Filter/DerivativeFilter.cpp | /// @file Derivative.cpp
/// @brief A class to implement a derivative (slope) filter
/// See http://www.holoborodko.com/pavel/numerical-methods/numerical-derivative/smooth-low-noise-differentiators/
//
#include <inttypes.h>
#include <AP_Math/AP_Math.h>
#include "Filter.h"
#include "DerivativeFilter.h"
template <class ... | ALGO | 0.950639 | 7.00499 |
01e2dc24-4b0f-4d4b-ba0a-015a5b1e7588 | lonelyenvoy/ACMCodingPlayground | src/Codeforces/888B.cpp | /**
* Created by LonelyEnvoy on 2017-11-12.
* B. Buggy Robot
* Keywords: greedy
*/
#include <cstdio>
#include <cstring>
#include <algorithm>
using namespace std;
#define rep(i,a,n) for(int i=a;i<n;++i)
#define erep(i,a,n) for(int i=a;i<=n;++i)
#define per(i,a,n) for(int i=n-1;i>=a;--i)
int c[256];
int main() {
... | ALGO | 0.998507 | 3.246826 |
da478bb5-2566-4ede-8456-12fa23fb73af | 1shtandon/Leetcode-Solutions | Graphs/Detonate_maximum_bombs.cpp | class Solution {
public:
void dfs(int node, vector<int> &visited, vector<int> adj[], int &cnt){
visited[node] = 1;
cnt++;
for(auto neighbour: adj[node]){
if(!visited[neighbour]){
dfs(neighbour, visited, adj, cnt);
}
}
}
int maximumDe... | ALGO | 0.99993 | 5.794868 |
37eb37db-00f1-4286-bb18-309cedff7865 | devararendy/tcp_proxy | sdk/boost_1_77_0/libs/hana/example/maximum.cpp | #include <boost/hana/assert.hpp>
#include <boost/hana/equal.hpp>
#include <boost/hana/greater.hpp>
#include <boost/hana/integral_constant.hpp>
#include <boost/hana/maximum.hpp>
#include <boost/hana/tuple.hpp>
namespace hana = boost::hana;
int main() {
// without a predicate
BOOST_HANA_CONSTANT_CHECK(
h... | TEST | 0.945651 | 5.629549 |
9fc2556f-cf16-4618-a4fe-fd59edf94889 | goldfishrock/Marlin-bugfix-2.0.x-SKR.1.4.Turbo.BLTouch.TFT35 | Marlin/src/lcd/menu/game/maze.cpp | #include "../../../inc/MarlinConfigPre.h"
#if ENABLED(MARLIN_MAZE)
#include "game.h"
int8_t move_dir, last_move_dir, // NESW0
prizex, prizey, prize_cnt, old_encoder;
fixed_t playerx, playery;
// Up to 50 lines, then you win!
typedef struct { int8_t x, y; } pos_t;
uint8_t head_ind;
pos_t maze_walls[50] = {
... | ALGO | 0.929765 | 5.047589 |
aa190a16-4a64-4a5d-bcf1-6779d3d7ddb1 | man0045/Data_Structure_with_Cpp | Dynamic_Programming/bits_count.cpp | #include<iostream>
#include<climits>
#include<string.h>
using namespace std;
int dp[105][105][2];
int f(int n, int k, int last){
if(n == 0) return 0;
if(n == 1){
if(k == 0) return 1;
else return 0;
}
if(dp[n][k][last] != -1) return dp[n][k][last];
if(last == 1){
return dp[n][k][last] = f(n-1, k, 0) + f(n-1... | ALGO | 0.999898 | 3.735337 |
aa5c2177-2c0e-44a6-8156-d3578b643480 | AvanishShukla20/Leetcode-problems | 123-best-time-to-buy-and-sell-stock-iii/best-time-to-buy-and-sell-stock-iii.cpp | class Solution {
public:
int maxProfit(vector<int>& prices) {
int n = prices.size();
vector<vector<int>> after(2, vector<int> (3, -1)), curr(2, vector<int> (3, -1));
after[0][2] = 0;
after[1][2] = 0;
for(int b = 0; b<=1; b++)
{
for(int c = 0; c <= 2; c++... | ALGO | 0.999933 | 5.889412 |
06641a10-4ef6-42bd-a7d5-e0b49eef45fc | aditya-dho1e/DSA-Sheet | subsetsSum.cpp | //Given a list arr of N integers, print sums of all subsets in it.
// Input:
// N = 2
// arr[] = {2, 3}
// Output:
// 0 2 3 5
#include <bits/stdc++.h>
void add(vector<int> &num,vector<int> &chk,vector<int> &ans){
int sum=0;
for(int i=0;i<num.size();i++){
if(chk[i]==1){
sum+=num[i];
... | ALGO | 0.999969 | 5.664169 |
ba177f8f-86bb-4ff1-824a-d4fec627fac9 | laurin-hefti/Fluid-Dynamic | matrixSolvers.cpp | #define TEST false
#if TEST == true
#include <iostream>
#include <vector>
#include "utils.cpp"
#endif
class MatrixSolver {
public:
float tolleranz;
int maxiter;
int startDump;
float dumpinit;
float dumpreleas;
float maxError;
void init(){
this->tolleranz = 10e-4;
this->maxiter = 10e5;
thi... | ALGO | 0.999771 | 5.319319 |
d854a465-2a92-432e-96b2-83deb1d9131e | Phantasm-Studios/UnrealEngine | Engine/Source/ThirdParty/nvTextureTools/nvTextureTools-2.0.6/src/src/nvtt/squish/alpha.cpp | #include "alpha.h"
#include <algorithm>
namespace squish {
static int FloatToInt( float a, int limit )
{
// use ANSI round-to-zero behaviour to get round-to-nearest
int i = ( int )( a + 0.5f );
// clamp to the limit
if( i < 0 )
i = 0;
else if( i > limit )
i = limit;
// done
return i;
}
void CompressAlp... | TOOL | 0.964441 | 7.060163 |
827f86cb-461e-4097-b471-32b26e0824f1 | 9Tempest/llvm-hacked | mlir/lib/Dialect/Transform/Transforms/CheckUses.cpp | #include "mlir/Dialect/Transform/Transforms/Passes.h"
#include "mlir/Dialect/Transform/IR/TransformInterfaces.h"
#include "mlir/Interfaces/SideEffectInterfaces.h"
#include "mlir/Pass/Pass.h"
#include "llvm/ADT/SetOperations.h"
namespace mlir {
namespace transform {
#define GEN_PASS_DEF_CHECKUSESPASS
#include "mlir/Di... | TOOL | 0.910512 | 4.967258 |
849e5db9-a2fd-4019-8852-7ac2541487c8 | gqrfield/ASCIIvideo | opencv/sources/3rdparty/carotene/src/channels_combine.cpp | #include "common.hpp"
#include "vtransform.hpp"
namespace CAROTENE_NS {
#define FILL_LINES2(macro,type) \
macro##_LINE(type,0) \
macro##_LINE(type,1)
#define FILL_LINES3(macro,type) \
FILL_LINES2(macro,type) \
macro##_LINE(type,2)
#define FILL_LINES4(macro,type) \
... | ALGO | 0.964484 | 5.604625 |
bf7851a8-f0a6-4ace-9ac3-b2f5a9822126 | PhamVietAn/BTVN_C_SS5 | Ex10.cpp | #include <stdio.h>
int main(){
int n, reverse = 0;
printf("nhap so nguyen: ");
scanf("%d",&n);
if(n<0){
printf("-");
n=-n;
}
if(n==0){
printf("0");
}
while (n > 0) {
reverse = reverse * 10 + n % 10;
n /= 10;
}
while (reverse > 0) {
printf("%d ", reverse % 10);
rever... | ALGO | 0.999835 | 3.662651 |
1cc68dea-d0b6-4c92-b9d9-ebdd7e502458 | ishandutta2007/codeforces | thebes/normal/1077/E.cpp | #include <bits/stdc++.h>
using namespace std;
const int MN = 2e5+5;
typedef long long ll;
map<ll,ll> cnt;
vector<ll> wew;
ll N, i, j, x;
int main(){
for(scanf("%lld",&N),i=1;i<=N;i++){
scanf("%lld",&x);
cnt[x]++;
}
for(auto v : cnt) wew.push_back(v.second);
... | ALGO | 0.999894 | 3.843976 |
5c6cfc1f-8867-4e0d-9d21-9fd00bbc065e | truongcongthanh2000/CSES-Solutions | Sorting and Searching/MovieFestivalII.cpp | #pragma GCC diagnostic ignored "-Wunused-parameter"
#include <bits/stdc++.h>
using namespace std;
#define INP "solve"
#define OUT "solve"
const int maxN = 3e5 + 10;
const int maxM = 20;
const int maxP = 1e4 + 10;
const long long INF_LL = 1e17;
const int INF = 1e9 + 100;
const int MOD = 1e9 + 7;
const int Base = 30;
... | ALGO | 0.999889 | 4.656936 |
8ad269f7-e70f-46f9-b832-2d41b24eb010 | rupesh-dev30/DSA-in-CPP | 05_Patterns/09_Butterfly.cpp | #include <bits/stdc++.h>
using namespace std;
int main() {
// code here
int num;
cout<<"Enter the number: ";
cin>>num;
for(int i=0; i<num; i++){
for(int j=0; j<=i; j++){
cout<<"* ";
}
for(int j=0; j<num-i-1; j++){
cout<<" ";
}
for(int j=num-i-1; j>0; j--){
cout<<" ";... | ALGO | 0.999972 | 3.600932 |
ca72fd0c-39be-42aa-b101-5b1bd25595a1 | sskesu/CppPrac | day05/day05/CircularList.cpp | #include "CircularList.h"
void CircularList::AddNode(int _data)
{
if (tail == nullptr) {
Node* temp = new Node;
temp->data = _data;
temp->next = temp;
tail = temp;
}
else {
Node* temp = new Node;
temp->data = _data;
temp->next = tail->next;
tail->next = temp;
tail = temp;
}
}
void CircularList::... | ALGO | 0.923676 | 4.327426 |
e6d0c967-32be-4b42-b18e-e4dbec7d0c74 | CORRECT-1024/code | nowcoder/2025/3/F.cpp | #include <bits/stdc++.h>
using namespace std;
typedef long long LL;
typedef unsigned long long ULL;
void work() {
int n, a, b, c;
cin >> n >> a >> b >> c;
if (a + b + c > 2 * n || a + b + c < n) {
cout << "No\n";
return;
}
cout << "Yes\n";
}
int main()
{
#ifdef QHK
freopen("... | ALGO | 0.999682 | 3.702835 |
a6de27f4-cb15-4ff6-bf63-cb0eb131900d | hanhansoul/ACM | codeforces/445B.cpp | #include <vector>
#include <list>
#include <map>
#include <set>
#include <queue>
#include <deque>
#include <stack>
#include <bitset>
#include <algorithm>
#include <functional>
#include <numeric>
#include <utility>
#include <sstream>
#include <iostream>
#include <iomanip>
#include <cstdio>
#include <cmath>
#include <cst... | ALGO | 0.999969 | 3.575921 |
a86ab0ad-b44f-41ea-a7fb-af71fa42bfe8 | Lewis-Stuart-11/3DGS-to-PC | gaussian-pointcloud-rasterization/third_party/glm/test/gtx/gtx_fast_trigonometry.cpp | #include <glm/ext/scalar_ulp.hpp>
#define GLM_ENABLE_EXPERIMENTAL
#include <glm/gtc/type_precision.hpp>
#include <glm/gtx/fast_trigonometry.hpp>
#include <glm/gtx/integer.hpp>
#include <glm/gtx/common.hpp>
#include <glm/gtc/constants.hpp>
#include <glm/gtc/vec1.hpp>
#include <glm/trigonometric.hpp>
#include <cmath>
#i... | TEST | 0.945488 | 6.277224 |
9a255c09-a0ca-4c6a-a95b-c0270be50a10 | ishandutta2007/codeforces | mhq/normal/1034/B.cpp | #include <bits/stdc++.h>
using namespace std;
typedef long double ld;
typedef long long ll;
int n, m;
ll all = 0;
const int maxN = 15;
vector < pair < int, int > > g[maxN][maxN];
bool used[maxN][maxN];
pair < int, int > mt[maxN][maxN];
bool kuhn(int a, int b) {
if (used[a][b]) return false;
used[a][b] = true;
... | ALGO | 0.999968 | 4.059384 |
d0725f92-fffb-4c2d-b6cd-2208e4c95fbf | rrungureanu/Eye-Tracking-thresholding | EyeTracking-Thresholding/Source.cpp | #include "opencv2/objdetect/objdetect.hpp"
#include "opencv2/highgui/highgui.hpp"
#include "opencv2/imgproc/imgproc.hpp"
#include <iostream>
#include <stdio.h>
#include <chrono>
using namespace std;
using namespace cv;
/** Function Headers */
void detectAndDisplay(Mat frame, int runTime);
/** Global variables */
st... | ALGO | 0.983313 | 4.884659 |
4a22e40e-f8c8-4d4d-bb20-2249c06ac693 | ishandutta2007/codeforces | krk/normal/1539/A.cpp | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
int T;
int n, x, t;
int main()
{
scanf("%d", &T);
while (T--) {
scanf("%d %d %d", &n, &x, &t);
int mn = min(t / x, n - 1);
ll sum = ll(mn + 1) * mn / 2;
cout << sum + ll(mn) * (n - (mn + 1)) << endl;
}
... | ALGO | 0.999936 | 3.919104 |
a30388dc-110c-4601-a586-5315e7726561 | jeffyehtw/UVa | Volume 103/10394 - Twin Primes.cpp | #include<iostream>
#include<vector>
#define MAX 20000001
using namespace std;
class obj
{
public:
obj() {}
obj(int a, int b)
:x(a), y(b) {}
int x, y;
};
vector<int> p;
vector<obj> t;
bool prime[MAX];
void initilize()
{
//initialize
prime[0] = false;
prime[1] = false;
for (int i = 2; i < MAX; i++)
prime[... | ALGO | 0.998081 | 4.127419 |
46287041-8d39-4bfc-ad07-1f48ee76230f | jithsg/CPP | sentinel.cpp | #include<iostream>
#include<vector>
#include<ranges>
#include<algorithm>
// int main(){
// std::vector R {1, 2, 3, 4, 5};
// auto sentinel {R.end()};
// // for (auto it {R.begin()}; it != sentinel; ++it){
// // std::cout<<*it<<std::endl;
// // }
// std::ranges::for_each(R.begin(), R.end(... | TOOL | 0.979225 | 4.094708 |
6d891c06-c9dc-4b94-af5f-845423e8e3f3 | account-deactivated1/LeetCode | 242-valid-anagram/valid-anagram.cpp | class Solution {
public:
bool isAnagram(string s, string t) {
if (s.size() != t.size()) return false;
int count[26] = {0};
for (int i = 0; i < s.size(); i++) {
count[s[i] - 'a']++;
count[t[i] - 'a']--;
};
for (int i = 0; i < 26; i++) {
if... | ALGO | 0.999992 | 6.231415 |
f61b6a63-5bb7-4a69-a03c-fbc5519b37f7 | DimitarSht/Informatics_10B_2024_2025 | Grade_09/Първи срок/Седмица_02_Преговор_29_09_2023/zad3.cpp | #include<iostream>
using namespace std;
int main()
{
int a, b, c;
cin>>a>>b>>c;
int distance1 = a - b;
int distance2 = a - c;
if(distance1 < 0)
{
distance1 = distance1 * (-1);
}
if(distance2 < 0)
{
distance2 = distance2 * (-1);
}
if(distance1 > distance2)
... | ALGO | 0.999973 | 3.344236 |
5ea8f393-f4fa-4ae6-b457-30d12249351b | RazorBach/Leetcode | solutions/290-word-pattern/word-pattern.cpp | // Given a pattern and a string str, find if str follows the same pattern.
//
// Here follow means a full match, such that there is a bijection between a letter in pattern and a non-empty word in str.
//
// Example 1:
//
//
// Input: pattern = "abba", str = "dog cat cat dog"
// Output: true
//
// Example 2:
//
//
// In... | ALGO | 0.996381 | 6.630414 |
f88a2ef1-5875-4689-abd8-60b23f1e3bf2 | ntalalala/DSA_2023 | CPPLAN01_LARGE_NUMBER.cpp | #include<bits/stdc++.h>
using namespace std;
void hieu(string s1, string s2){
int l1 = s1.length(), l2 = s2.length();
int max = l1 < l2 ? l2 : l1;
for (int i = l1; i <= max ; i++) s1 = '0' + s1;
for (int i = l2; i <= max ; i++) s2 = '0' + s2;
string k = s1;
int du = 0;
for (int i = s1.length(); i >= 0; i--){
i... | ALGO | 0.999988 | 4.877428 |
914bd222-5802-4389-ba47-aef0822b90c7 | ishandutta2007/codeforces | belonogov/normal/251/A.cpp | #include <iostream>
#include <cstdio>
#include <algorithm>
#include <cmath>
#include <string>
#include <cstring>
#include <vector>
#include <set>
#include <map>
#include <cassert>
typedef long long ll;
#define forn(i, n) for(int i = 0; i < int(n); i++)
#define pb push_back
#define mp make_pair
#define ff first
#defin... | ALGO | 0.999835 | 3.39099 |
e2a9ac78-befc-4779-a3d1-ff873ea25f39 | kd1995-max/Data-Structure-and-algos | Stack/QueueStack.cpp | void QueueStack :: push(int x)
{
// Your Code
q1.push(x);
while(!q2.empty())
{
q1.push(q2.front());
q2.pop();
}
swap(q1,q2);
}
//Function to pop an element from stack using two queues.
int QueueStack :: pop()
{
// Your C... | ALGO | 0.9987 | 4.834627 |
0cc85464-47f3-4e23-909c-d91d9d6abd4c | tanamaay/DSA_SUPREAM-BATCH | Introduction_to_Arrays_10th February 2023/Change_array_values_to_1.cpp | #include<iostream>
using namespace std;
int main(){
int arr[5] = {1,2,3,4,5};
for(int i = 0;i<5;i++){
// Changing value to 1
arr[i] = 1;
}
for(int i = 0;i<5;i++){
// Just print the array. We get changed values
cout<<arr[i]<<" ";
}
return 0;
} | ALGO | 0.99495 | 3.367874 |
35cfd684-101f-42b7-b149-58e1fda2e8ea | CakeForest/noip | new/1.7.13.cpp | #include<stdio.h>
#include<stdlib.h>
#include<string.h>
int main()
{
int n;
scanf("%d",&n);
char a[120][30];
for(int i=1;i<=n;i++)
{
scanf("%s",a[i]);
}
for(int i=1;i<=n;i++)
{
for(int m=0;m<=strlen(a[i])-1;m++)
{
if(m==0&&a[i][m]>='a'&&a[i][m]<='z')
a[i][m]-=32;
else if(m!=0&&a[i][m]>='A'&&a... | ALGO | 0.999884 | 3.465955 |
a480dfeb-f25b-41fd-b0db-5c886e1bf97f | alexandraback/datacollection | solutions_5744014401732608_0/C++/trunghai95/slides.cpp | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
int test;
int b, m;
bool edge[51][51];
vector<int> vc;
int countPath(int p)
{
if (p >= b)
{
for (int i = 1; i < vc.size(); ++i)
if (!edge[vc[i-1]][vc[i]])
return 0;
if (!edge[vc.back()][b])
return 0;
return 1;
}
vc.push_back(p);
... | ALGO | 0.999617 | 3.853009 |
3335e9b8-30a4-4e83-a9bf-7d09b0f03793 | KAKXA/Early-Shuati | Leetcode/C++/50_myPow.cpp | class Solution {
public:
double myPow(double x, int n) {
int temp = n<0 ? -(n+1) : n;
double res = 1;
double tempPow = x;
while(temp)
{
if(temp&1) res *= tempPow;
temp >>= 1;
tempPow *= tempPow;
}
return n<0 ? 1.0/(res * x)... | ALGO | 0.99994 | 5.669843 |
6b7bc2d5-0c70-40b1-bd5b-89c5f5324e9b | kkang0/Algorithm_solving | 프로그래머스/2/12945. 피보나치 수/피보나치 수.cpp | #include <string>
#include <vector>
using namespace std;
int solution(int n) {
vector<int> fib(n + 1);
fib[0] = 0;
fib[1] = 1;
for(int i = 2; i <= n; i++) {
fib[i] = (fib[i - 1] + fib[i - 2]) % 1234567;
}
return fib[n];
} | ALGO | 0.999967 | 5.265747 |
6a920297-4642-4142-b443-6b9b271b2b36 | tinwoon/baekjoon_algorithm | Algorithm_code/1517.cpp | #pragma warning (disable : 4996)
#include <iostream>
#include <vector>
#include <math.h>
#include <algorithm>
#define MAX 1000001
//inversion counting
//B.emplace_back(std::make_pair(A[k], k)); Ŀ ġ ̵ϴ Ȯϴ ص.
int N;
int size;
std::vector<int> A;
std::vector< std::pair<int, int> > B;
std::vector<long long> tree;
... | ALGO | 0.999882 | 4.342966 |
5ec1221f-64ee-4d31-9655-904793f26067 | Avnerus/ichigo | ExternalLibs/Box2D/Collision/Shapes/b2PolygonShape.cpp | #include <Box2D/Collision/Shapes/b2PolygonShape.h>
#include <new>
b2Shape* b2PolygonShape::Clone(b2BlockAllocator* allocator) const
{
void* mem = allocator->Allocate(sizeof(b2PolygonShape));
b2PolygonShape* clone = new (mem) b2PolygonShape;
*clone = *this;
return clone;
}
void b2PolygonShape::SetAsBox(float32 hx,... | ALGO | 0.983747 | 7.939983 |
3db86276-66a2-489b-b433-74bdb409e91a | Chaitanya674/DSA-CPP | Sorting/selection.cpp | #include<iostream>
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 = 0 ; i < n-1 ; i++){
for(int j = i ; j< n ; j++){
if(arr[j] < arr[i]){
int temp = arr[j];
arr[j... | ALGO | 0.999983 | 4.122375 |
ff7bd72d-5a1d-428a-8757-61064aa5bdce | kaushikavinash/heat_equation | nvidia-labs/lab4.pipelining/c99/solution_task3/main.cpp | #include <cstdio>
#include <cstdlib>
#include <fstream>
#include <omp.h>
#include "constants.h"
using namespace std;
#pragma acc routine seq
unsigned char mandelbrot(int Px, int Py);
int main() {
size_t bytes=WIDTH*HEIGHT*sizeof(unsigned int);
unsigned char *image=(unsigned char*)malloc(bytes);
int num_bloc... | ALGO | 0.996791 | 4.066144 |
59b1f51b-cdcc-47ca-b701-2ffd967ead5a | UtkarshMidha/Leetcode | Random Daily Solved Questions/1443. Minimum Time to Collect All Apples in a Tree.cpp | class Solution {
public:
int dfs(int node, int parent, vector<vector<int>>& adj, vector<bool>& hasApple) {
int totalTime = 0, childTime = 0;
for (auto child : adj[node]) {
if (child == parent) continue;
childTime = dfs(child, node, adj, hasApple);
// childTime > 0... | ALGO | 0.999967 | 5.889999 |
e0c572c6-25d5-4473-a953-ef698e898ebb | RoscaMitrut/CS-UBB | Sem5/PPD/LABS/Laborator3/lab3/lab3_2.cpp | /*
#include <iostream>
#include <fstream>
#include <vector>
#include <chrono>
#include "mpi.h"
#define MAX_DIGITS 10000
using namespace std;
using namespace std::chrono;
void writeNumber(string filename, int number[], int N) {
ofstream file(filename);
if (!file) {
throw new exception("Problem in open... | ALGO | 0.99919 | 3.640475 |
c42a1e26-45a1-4626-ac13-ada0bf5a1434 | pmpatos/rustdesk | flutter/windows/runner/utils.cpp | #include "utils.h"
#include <flutter_windows.h>
#include <io.h>
#include <stdio.h>
#include <windows.h>
#include <iostream>
void CreateAndAttachConsole() {
if (::AllocConsole()) {
FILE *unused;
if (freopen_s(&unused, "CONOUT$", "w", stdout)) {
_dup2(_fileno(stdout), 1);
}
if (freopen_s(&unuse... | TOOL | 0.998454 | 6.783336 |
6f7564f9-e64a-4967-80c5-9a58e5402201 | ronit5757/c-- | oddnumber.cpp | // #include<iostream>
// #include<iomanip>
// using namespace std;
// int main()
// {
// int a,b,c;
// cout<<"enter number 1"<<endl;
// cin>>a;
// cout<<"enter number 2"<<endl;
// cin>>b;
// cout<<"enter number 3"<<endl;
// cin>>c;
// cout<<endl;
// if((a % 2 != 0) && (a >=0))
// ... | ALGO | 0.992106 | 3.845407 |
60896235-4823-4fdf-9de6-35dff487ebd4 | Xuedixuedi/Data-Structure-design | 003/main.cpp | #include <iostream>
#include "Maze.h"
#include "Stack.h"
using namespace std;
void printStack(Stack<Point> s);
int main() {
auto maze = new Maze;
Point start = maze->_start;
maze->printMaze(maze->_maze);
Stack<Point> s = maze->dfs(start.x, start.y);
maze->changeMaze();
maze->printMaze(maze->_... | ALGO | 0.965561 | 4.498085 |
66a9ae3f-21f7-4bf7-97bf-8ec5eb5f1a89 | ChoonHean/Kattis | DataStructures/ST.cpp | // From CP4 (Steven Halim, Felix Halim, Suhendry Effendy)
// https://github.com/stevenhalim/cpbook-code
#include <bits/stdc++.h>
using namespace std;
typedef vector<int> vi;
typedef long long ll;
typedef pair<ll, ll> pll;
typedef vector<pll> vpll;
const ll llinf = -4e18;
#if __cplusplus >= 201703L
template<class S... | ALGO | 0.999964 | 4.893687 |
a27f13f0-c3a1-447f-9b14-8bef1579d669 | Mah-Moud-Zaki/Todo-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.998859 | 6.785645 |
86f5bd58-ca00-4af1-b131-e2a0f2fafb39 | EpochFlame/regrown | src/plugProjectKandoU/aiTeki.cpp | #include "PikiAI.h"
#include "Game/EnemyBase.h"
#include "Game/enemyInfo.h"
#include "Game/gameStat.h"
#include "Game/PikiState.h"
#include "Game/Footmark.h"
#include "Dolphin/rand.h"
namespace PikiAI {
/*
* --INFO--
* Address: 8021295C
* Size: 000090
*/
ActTeki::ActTeki(Game::Piki* piki)
: Action(piki)
{
mNa... | TOOL | 0.963025 | 4.705254 |
d745960b-2b25-4b14-903c-f44806870d40 | tanvirh103/Data-Structure | PostFixeve.cpp | #include <iostream>
#include <string>
using namespace std;
class Stack {
int top;
int arr[100];
int maxsize;
public:
Stack(){
maxsize = 100;
top = 0;
}
void push(int element){
if(top < maxsize){
arr[top] = element;
top++;
}
... | ALGO | 0.999869 | 4.458601 |
edf4c86d-69d4-47a6-b142-aae8e0f1c079 | jadhavhpranav1121/Leetcode-Solutions | C++ Solutions/complement-of-base-10-integer.cpp | // https://leetcode.com/problems/complement-of-base-10-integer
class Solution {
public:
int bitwiseComplement(int n) {
int l=n;
if(n==0){
return 1;
}
int r=1;
while(l!=0){
l=l>>1;
r=r<<1;
}
return (~n & r-1);
}
}; | ALGO | 0.99987 | 6.505998 |
ea341d57-a970-41f3-8035-026122ac884e | kysvamsi/Codeforces | 1932D.cpp | #include<bits/stdc++.h>
#define int long long
#define f(i,a,b) for (int i=a;i<b;i++)
#define all(a) a.begin(),a.end()
#define vint vector<int>
#define mint map<int,int>
#define sint set<int>
#define qint queue<int>
#define pb push_back
#define pf push_front
const int MOD = 1e9 + 7;
using namespace std;
void solve(){
... | ALGO | 0.999871 | 4.725605 |
38913464-97cc-4677-9c17-f831bbf50e68 | GeorgeLyon/SwiftHDL | mlir/llvm/llvm/lib/CodeGen/RegisterScavenging.cpp | #include "llvm/CodeGen/RegisterScavenging.h"
#include "llvm/ADT/ArrayRef.h"
#include "llvm/ADT/BitVector.h"
#include "llvm/ADT/SmallVector.h"
#include "llvm/ADT/Statistic.h"
#include "llvm/CodeGen/LiveRegUnits.h"
#include "llvm/CodeGen/MachineBasicBlock.h"
#include "llvm/CodeGen/MachineFrameInfo.h"
#include "llvm/CodeG... | ALGO | 0.871789 | 7.369312 |
2fc97051-ea3c-494c-8b52-77616dd5fb4e | aerick8602/CSES-Problem-Set | Sorting and Searching/Ferris_Wheel.cpp | #include <bits/stdc++.h>
using namespace std;
using ll = long long; // -2^63 to 2^63 - 1
using ld = long double; // 12 bytes (12*8 bits)
template <typename T>
using v = vector<T>;
template <typename T>
using vv = vector<vector<T>>;
template <typename T>
using us = unordered_set<T>;
template <typename T>
using pq = pr... | ALGO | 0.999942 | 4.643221 |
784c3d9b-d6c1-4bc3-98d5-d01a80b3e221 | johnoneil/mupen64plus-web | boost_1_59_0/libs/numeric/ublas/doc/samples/hermitian_matrix.cpp | #include <boost/numeric/ublas/hermitian.hpp>
#include <boost/numeric/ublas/io.hpp>
int main () {
using namespace boost::numeric::ublas;
hermitian_matrix<std::complex<double>, lower> ml (3, 3);
for (unsigned i = 0; i < ml.size1 (); ++ i) {
for (unsigned j = 0; j < i; ++ j)
ml (i, j) = st... | ALGO | 0.981793 | 3.586708 |
7e12d86e-7fcb-477e-a96e-d0aaec5a7957 | TusharCSE35/Online-Programming | Codeforces/D_Omkar_and_Bed_Wars.cpp | /*********************************************************************************\
* _________ _ _ ________ _ _ __ ________ *
* |___ ___|| | | || ______|| | | | / \ | ____ | *
* | | | | | || |______ | |_____| | / /\ \ | |____| |... | ALGO | 0.999983 | 3.978764 |
7ec2c85a-78a4-4cf9-88e8-42bf766c3058 | Jehops/freebsd-ports-legacy | graphics/nurbs++/files/patch-nurbs.cpp | --- nurbs/nurbs.cpp.orig Fri May 24 10:25:49 2002
+++ nurbs/nurbs.cpp Fri Dec 1 00:22:20 2006
@@ -28,7 +28,7 @@
#include <nurbsS.h>
#include "integrate.h"
-#include <malloc.h>
+#include <stdlib.h>
/*!
*/
@@ -391,9 +391,9 @@
T du,dv ;
// compute a coarse distance for the curve
Point_nD<T,N> a,b,c ;
- ... | ALGO | 0.999276 | 6.797972 |
b9055dec-3444-4126-a8db-713c28da7ea9 | rod41732/2110211-Intro-Data-Struct | TripleSum.cpp | #include <cstdio>
#include <vector>
#include <unordered_map>
using namespace std;
typedef pair<int, int> pii;
unordered_map<int, vector<pii> > left;
int found[1000], a[1000];
int main(){
// freopen("test.in", "r", stdin);
int n, m;
scanf("%d %d", &n, &m);
for (int i=0; i<n; i++)
scanf("%d", &a[i]);
int total... | ALGO | 0.99984 | 3.840298 |
9aad01bb-7339-489d-8383-b82c61465c2e | kolomietsbogdan/factorial_calculating | main.cpp | #include <iostream>
#include <vector>
#include <chrono>
void multiply(std::vector<int>& result, int multiplier){
int carry = 0;
for (size_t i = 0; i < result.size(); ++i){
int product = result[i] * multiplier + carry;
result[i] = product % 10;
carry = product / 10;
}
while(carry){
result.push_back(carry % ... | ALGO | 0.998338 | 5.03486 |
a770b325-1b91-46c9-b5d6-7657df4a55fa | kokorinosoba/contests | AtCoder/ABC0/ABC031/A.cpp | #include <bits/stdc++.h>
using namespace std;
int main() {
int a, d; cin >> a >> d;
cout << (min(a, d) + 1) * max(a, d) << endl;
}
| ALGO | 0.999635 | 3.170226 |
2090769a-fc2f-4e45-a81f-e19d8ae7acf6 | MikhaelMounay/ClashofClansTowerDefenseGame | ClashOfClansQtGame/astar.cpp | #include "astar.h"
#include "game.h"
Astar::Astar(QVector<QVector<int>> Map, QPoint Start, QPoint End, Game *gameViewPtr)
{
map = Map;
start = Start;
end = End;
gameView = gameViewPtr;
}
int Astar::calculateH(QPoint a, QPoint b)
{
return qAbs(a.x() - b.x()) + qAbs(a.y() - b.y());
}
QPoint Astar::... | ALGO | 0.999958 | 4.473551 |
3421cd3f-a250-4152-a082-3f1e7e4c5f6b | Giulia-Azeka/Competitive-Programming-Training | codeforces/4_A_Watermelon.cpp | /*One hot summer day Pete and his friend Billy decided to buy a watermelon. They chose the biggest and the ripest one, in their opinion. After that the watermelon was weighed, and the scales showed w kilos. They rushed home, dying of thirst, and decided to divide the berry, however they faced a hard problem.
Pete and ... | ALGO | 0.99984 | 4.407755 |
be7d20dd-3d81-4284-a444-0c85b7f102d0 | nwcarter/cpp_practice_2015 | assignment3/main.cpp | #include <iostream>
#include <string>
#include <vector>
#include "FileReader.h"
#include "StringFunctions.h"
using namespace std;
const int OFFSET = 65;
void readFile(string filename, vector<int>& library);
void initVector(vector<int>& v);
int getCount(vector<int> v, char ch);
int main(int argc, char const *argv[])
... | TOOL | 0.959081 | 4.60438 |
02eebec8-893f-4e5f-946d-a9afda2b5eb9 | 113bommy/LogicalErrorFixCodeT5 | LogicalErrorFix_metric/ParseError_CodeT5_LineNumber_cpp_output/Problem_94_output_483.cpp | #include <bits/stdc++.h>
using namespace std;
signed main() {
ios_base::sync_with_stdio(false);
cin.tie(NULL);
long long t;
cin >> t;
while (t--) {
long long n, k;
cin >> n >> k;
vector<long long> v(n);
for (long long i = 0; i < n; i++) {
long long x;
cin >> x;
v[i] = pow(10LL, x);
}
sort(v.begin(), v.end());
vector<lo... | ALGO | 0.999816 | 3.461184 |
237eb34f-b2fa-4ced-bcd2-1ec8679b89d1 | nenuon/CompetitiveProgramming | Atcoder/ABC033/D3.cpp | #include <algorithm>
#include <cstdio>
#include <iostream>
#include <map>
#include <cmath>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <string>
#include <vector>
#include <stdlib.h>
#include <stdio.h>
#include <bitset>
#include <cstring>
#include <deque>
#include <iomanip>
#include <lim... | ALGO | 0.999793 | 3.491826 |
bd375656-b294-4f66-b7fc-243e8a12668f | ishandutta2007/codeforces | nikolapesic2802/normal/1361/A.cpp |
// Problem : A. Johnny and Contribution
// Contest : Codeforces - Codeforces Round #647 (Div. 1) - Thanks, Algo Muse!
// URL : http://codeforces.com/contest/1361/problem/A
// Memory Limit : 256 MB
// Time Limit : 2000 ms
// Powered by CP Editor (https://github.com/cpeditor/cpeditor)
#include <bits/stdc++.h>
#include ... | ALGO | 0.999992 | 3.970743 |
dfb27232-0c33-43ea-a295-100b444ce7e6 | qsnake/trilinos | packages/mesquite/src/TargetCalculator/JacobianCalculator.cpp | /** \file JacobianCalculator.cpp
* \brief
* \author Jason Kraftcheck
*/
#include "Mesquite.hpp"
#include "JacobianCalculator.hpp"
#include "MappingFunction.hpp"
#include "MsqError.hpp"
#include "TopologyInfo.hpp"
namespace MESQUITE_NS {
void JacobianCalculator::get_Jacobian_2D( const MappingFunction2D* mf,
... | ALGO | 0.994711 | 7.415195 |
5ac223a5-9fa2-45b4-a441-32753db23e51 | GregWagner/Udemy-DSA-Courses | Coding-Minutes/Data_Structures_and_Algorithms_Essentials/Section_24_Dynamic_Programming_Introduction/knapsack_problem.cpp | /*
* Given weights and prices of n items, we need to put a
* subset of items in a bag of capacity W such that we get
* the maximum total value in the bag (also known as a knapsack)
*
* You need to maximum the profit while keeping the weight
* of the bag less than or equal to W
*
* input
* n = 4
* W = 11
* ... | ALGO | 0.999999 | 6.609644 |
af10bcff-7739-4083-b55d-7e1046fc7eea | andresgonzalezfornell/TFM | src/effects/Reverb.cpp | #include "Reverb.h"
/**
* @brief Reverb constructor.
*/
Reverb::Reverb() AS_EFFECT_CONSTRUCTOR {
for (int i = 0; i < maxchannels; i++) {
for (int j = 0; j < maxfilters; j++) {
pointer[i][j] = 0;
}
}
}
/**
* @brief It applies reverb effect.
* @param input input signal point... | ALGO | 0.906574 | 5.406341 |
60d9d45d-640d-40bc-9f59-1b7ebc23decc | oxygen-hunter/Flashboom | data/leetcode_cpp/squares-of-a-sorted-array.cpp | // Time: O(n)
// Space: O(1)
class Solution {
public:
vector<int> sortedSquares(vector<int>& A) {
int right = distance(A.cbegin(), lower_bound(A.cbegin(), A.cend(), 0));
int left = right - 1;
vector<int> result;
while (0 <= left || right < A.size()) {
if (right == A.siz... | ALGO | 0.999993 | 6.108315 |
c2ddcc44-f37b-4859-a02b-58bc29271491 | osumi-kyopuro/icpc | acabc100c.cpp | #include<iostream>
#include<vector>
#include<string>
#include<algorithm>
#include<queue>
#include<cmath>
#include<climits>
#include<set>
#include<map>
#define ll long long
using namespace std;
ll waru(ll x) {
ll count = 0;
while (x % 2 == 0) {
x /= 2;
count++;
}
return count;
}
int main() {
ll n,sum=0;
cin >... | ALGO | 0.999909 | 4.019684 |
0c554afc-3627-45f1-aa58-e4b6362452f3 | AraragiEro/newk | .history/HJ20_20210316174431.CPP | #include<iostream>
#include<string>
#include<vector>
using namespace std;
int main(){
string input;
while(cin>>input){
bool iseight=false;
bool isThreeType=false;
bool isNotex=true;
if(input.size()>8) iseight=true;
vector<int> mark(4);
for(auto i=input... | ALGO | 0.961046 | 3.111874 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.