uuid string | repo_name string | relative_path string | content string | category string | algo_rel_score float64 | quality_score float64 |
|---|---|---|---|---|---|---|
fe819e8d-8bda-4204-9367-076785d0e379 | AnonMiraj/Competitive-solving | Codeforces/Codeforces Round 686 (Div. 3)/D. Number into Sequence.cpp | // ﷽
// Contest: Codeforces Round 686 (Div. 3)
// Judge: Codeforces
// URL: https://codeforces.com/problemset/problem/1454/D
// Memory Limit: 256
// Time Limit: 3000
// Start: Sun 03 Sep 2023 11:41:46 AM UTC
//
#include <algorithm>
#include <bitset>
#include <cctype>
#include <climits>
#include <cmath>
#include <iomani... | ALGO | 0.999816 | 4.940633 |
397b62a3-96ab-4130-bdfb-7e648a56f53e | alittlekitten/AlgorithmStack | CodeForce/Round#784_div4/A.cpp | #include <iostream>
using namespace std;
int main() {
ios_base::sync_with_stdio(false);
cin.tie(0);
cout.tie(NULL);
int n, input;
cin >> n;
for (int i = 0; i < n; ++i) {
cin >> input;
if (input < 1400) cout << "Division 4" << '\n';
else if (input < 1600) cout << "Divi... | ALGO | 0.999666 | 4.535097 |
96d35110-e23b-4297-ac68-1d2f59d65cb7 | shouryagautam/ADS | tocken.cpp | #include<iostream>
#include<string>
using namespace std;
int tockenise(string s, string t[])
{
int n = s.length();
int flag = 0;
int k = 0;
for(int i=0; i<n ;i++)
{
if( i < n && (s[i] == '+' || s[i] == '-' || s[i] == '*' || s[i] == '/' || s[i] == '(' || s[i] == ')') )
t[k++] = s[i];
while(i < n &... | ALGO | 0.999442 | 3.577768 |
c77386b1-5bc6-43d2-a68b-8901eaac1834 | sumondebnath/Problems-Solutions | Codeforces/ICPC Assiut University Community/Sheet #3 (Arrays)/O_Fibonacci.cpp | #include <bits/stdc++.h>
using namespace std;
int main()
{
int n;
cin >> n;
vector<long long> fib;
fib.push_back(0);
fib.push_back(0);
fib.push_back(1);
// fib[1 = 0;
// fib[2] = 1;
for (int i = 3; i <= n; i++)
{
fib.push_back(fib[i - 1] + fib[i - 2]);
}
cou... | ALGO | 0.999987 | 4.378248 |
538559a0-a43f-42b4-9f39-49dc87e427f3 | himu23/soc-cp | question sets/CSES/Introductory problems/trailingzeros.cpp | //#good
#include <bits/stdc++.h>
using namespace std;
int fivefactor(int n){
int ans=0;
while(n>0){
n=n/5;
ans+=n;
}
return ans;
}
int fivefactor1(int n){
int ans=0;
while(n>0){
if(n%5==0){
ans++;
n/=5;
}
if(n%5!=0) return ans;
... | ALGO | 0.999831 | 4.343609 |
af71c662-bf93-4c6c-85f0-54fda99502cb | Abhishek-Thakur14/Leetcode-Problems | 205-isomorphic-strings/isomorphic-strings.cpp | class Solution {
public:
bool isIsomorphic(string s, string t) {
if (s.length() != t.length()) return false;
// Mapping for characters in s -> t and t -> s
unordered_map<char, char> mapST, mapTS;
for (int i = 0; i < s.length(); ++i) {
char c1 = s[i];
char c2... | ALGO | 0.999911 | 7.008332 |
5fda0f45-e1ac-483f-b5fd-2a4514856da8 | HunterMahmud/LeetCode | 2716. Minimize String Length.cpp | // url = https://leetcode.com/problems/minimize-string-length
class Solution {
public:
int minimizedStringLength(string s) {
string t;
int n = s.size();
sort(s.begin(),s.end());
char ch= s[0];
t.push_back(ch);
for(int i=1;i<n;i++){
if(ch!=s[i]) {
... | ALGO | 0.999985 | 6.261333 |
bb46b10c-5d6f-4f4e-9b7d-9d58a5aaf28c | JonnyOu/NYOJ | 36.cpp | #include<iostream>
#include<string>
using namespace std;
const int MaxSize = 1010;
int a[MaxSize][MaxSize] = {0};
int LCS(string s1, string s2) {
int size1 = s1.size(), size2 = s2.size();
for (int i = 0; i < size1; i++) {
for (int j = 0; j < size2; j++) {
if (s1[i] == s2[j]) a[i+1][j+1] = a[i][j]+1;
else a[... | ALGO | 0.999946 | 4.704762 |
77b311da-7c4c-4e51-b1b9-2eedcca74e3a | ishandutta2007/codeforces | changyu/normal/1633/E.cpp | #include<bits/stdc++.h>
const int M=303,N=53,X=1e8;
int n,m,q,p[N],s[M],t[M],tmp[M*3],cnt,k,b0[M*3];
long long b1[M*3],S;
struct edge{int u,v,c,p;}e[M];
int Find(int u){return p[u]==u?u:p[u]=Find(p[u]);}
inline bool Check(int x,int ps){
int u,v;
bool res=0;
std::sort(e+1,e+1+m,[&](const edge&a,const edge&b){return s... | ALGO | 0.999969 | 3.779031 |
0fb8013c-e642-40c1-a5c8-ea8f8ea299d1 | lz520520/rust-1.75-ollvm | src/llvm-project/libcxx/test/std/algorithms/alg.sorting/alg.heap.operations/pop.heap/ranges_pop_heap.pass.cpp | // UNSUPPORTED: c++03, c++11, c++14, c++17
// <algorithm>
// template<random_access_iterator I, sentinel_for<I> S, class Comp = ranges::less,
// class Proj = identity>
// requires sortable<I, Comp, Proj>
// constexpr I
// ranges::pop_heap(I first, S last, Comp comp = {}, Proj proj = {}); ... | TEST | 0.996182 | 7.393222 |
da7187ee-c1c7-45d8-8e3b-dc02f9d6edce | NirajSarode/AssignmentsSppu | OOPL/stack&queue/stackqueue.cpp | #include <iostream>
#include <string.h>
#include <stack>
#include<queue>
using namespace std;
class stl
{
public:
void insertst(stack <int> st)
{
stack <int> s = st;
if(st.empty())
{
cout<<"Stack is empty!"<<endl;
}
while (!s.empty())
{
cout << '\t' << s.top();
s... | ALGO | 0.945782 | 3.761361 |
f3fea35c-795a-4590-bc06-a27bc7fea6ef | YJ243/python_codingTest | Samsung/bombshell_해설풀이.cpp | /*
* 2024.04.04
* 포탑 부수기 게임에서 각 턴마다 가장 약한 포탑을 각성시켜 공격자로 만들고,
* 강한 포탑을 공격하는 전략을 취한다.
* 각 턴마다 최선의 공격을 수행함으로써 남은 포탑 중 가장 강한 포탑의 공격력을 결정
*
* Algorithm**
* 초기 상태에서 모든 포탑의 상태를 읽어온 뒤, 주어진 턴 수만큼 게임을 진행
* 각 턴에서는 현재 살아있는 포탑들의 목록을 만들어 선정 규칙에 따라 정렬한다.
* 정렬된 목록에서 가장 앞에 있는 포탑이 각성하여 공격자로 선정되고,
* 각성 효과로 추가 공격력을 얻는다.
*
* 이후... | ALGO | 0.999873 | 5.316222 |
cf1a1524-77a3-48dd-80dc-35d690e69523 | honeyvikash/Leetcode_Solved_Problems | 0041-first-missing-positive/0041-first-missing-positive.cpp | class Solution {
public:
int firstMissingPositive(vector<int>& nums) {
int n = nums.size() ;
for(int i=0 ; i<n ; i++)
{
int num = nums[i];
if(num>=1 && num<=n)
{
int ind = num-1 ;
if(nums[ind]!=num)
{
... | ALGO | 0.999953 | 4.882095 |
b8218be0-6b95-4e71-8230-ed4d40f46c14 | SahilLathiya/CPP | 33-search-in-rotated-sorted-array/search-in-rotated-sorted-array.cpp | class Solution {
public:
int breakPoint(vector<int>& arr){
int l = 0, h = arr.size()-1;
while(l<h){
int mid = (h-l)/2 + l;
if(arr[mid]>=arr[0])
l = mid + 1;
else
h = mid;
}
return l;
}
int bs(vector<int>& a... | ALGO | 0.999989 | 5.781958 |
14b9e9ef-3418-47d6-a04c-aac1130e4682 | ishandutta2007/codeforces | lqs2015/normal/1312/F.cpp | #include<bits/stdc++.h>
using namespace std;
const int maxt=100;
int n,x,y,z,all,test,sg[44444][3],cr,ans;
bool used[5];
long long a[333333];
int SG(long long n,int t)
{
if (n<=maxt+all) return sg[n][t];
return sg[(n-maxt)%all+maxt][t];
}
int main()
{
scanf("%d",&test);
while(test--)
{
scanf("%d%d%d%d",&n,&x,&y,... | ALGO | 0.999845 | 3.543495 |
180e0e51-4f8a-4ea5-a280-6f01bb752271 | Lucas04-nhr/ProgrammingHomework | 04-第四章/936/936.cpp |
/*-------------------------------------------------------
ơ
---------------------------------------------------------
Ŀ
÷չʽarctg(x) ĽֵҪ10-5ʽͼ
ע⣺ΪС4λЧ֡
-------------------------------------------------------*/
#include<iostream>
#include<cmath>
#include<iomanip>
using namespace std;
const double e=1e-5; //ֵ
int mai... | ALGO | 0.999934 | 3.616993 |
ac55efce-30dc-4d74-ac5c-12f50c617f88 | sanjeetboora/Launchpad_29Dec2019 | Lecture11/codeOfStrings.cpp | #include <bits/stdc++.h>
using namespace std;
void codes(string input, string output){
if(input.length() == 0){
cout<<output<<endl;
return;
}
int one = input[0] - '0';
int two = 0;
if(input.length() > 1){
two = stoi(input.substr(0,2));
}
if(input.length()>1 && two <= 26){
string ros = input.substr(1);... | ALGO | 0.99966 | 3.988194 |
625a06c3-0b99-4f4c-b841-2293e855d188 | jariasf/CC126-2202 | Semana 4/Ejemplos/ejemplo_switch.cpp | #include <iostream>
using namespace std;
/*
Solicite un numero entero y devuelva el dia de la semana
1 -> Lunes, 2 -> Martes ..., 7 -> Domingo
*/
int main() {
short* num_dia = new short;
cout << "Ingrese un numero: ";
cin >> *num_dia;
switch (*num_dia) {
case 1: cout << "Lunes\n";
... | TOOL | 0.974922 | 3.052654 |
11ea96b9-0f6c-4cc4-8a05-1f1351221598 | Shivambaranwal267/Complete-Cpp--course | basic/rup.cpp | #include <iostream>
using namespace std;
int main()
{
int amount;
cout << "Enter the amount: " << endl;
cin >> amount;
int count = 1;
switch (count)
{
case 1:
cout << "Number of 100 notes";
cout << (amount / 100) << endl;
amount = amount % 100;
case 2:
co... | TOOL | 0.955788 | 4.430195 |
ef47c142-d42f-440e-bfb7-583da07f5501 | rupali-12/Leetcode-Problems | 0648-replace-words/0648-replace-words.cpp | class Solution {
public:
string findRoot(string word, unordered_set<string>st){
for(int len=1; len<word.length(); len++){
string root = word.substr(0, len);
if(st.count(root)){
return root;
}
}
return word;
}
string replaceWords(vector<st... | ALGO | 0.999967 | 6.034735 |
10081a4e-77d2-4765-ae11-85b68746d95e | libai245/wht | src/geodesic.cpp | #include <stdlib.h>
#include <stdio.h>
#include <string.h>
#include <math.h>
#include "geodesic.h"
/*
* The Vincenty method does not converge for antipodal points, but the
* code here handles this special case. Since the earth is a flattened
* sphere, the shortest route is over the poles. The trip via the North o... | ALGO | 0.99983 | 5.835241 |
29dff5af-6fa6-45d0-aae4-31c6d1571d0a | Priyam123dutta/GeeksforGeeks-160-Days-Coading-Challange | Day 10/Optimised.cpp | #include <iostream>
#include <vector>
using namespace std;
int maxSubarraySum(vector<int> &arr)
{
int maxEnding = arr[0], maxSum = arr[0];
for (int i = 1; i < arr.size(); i++)
{
maxEnding = max(maxEnding + arr[i], arr[i]);
maxSum = max(maxSum, maxEnding);
}
... | ALGO | 0.999667 | 6.126341 |
b1f928c1-2643-4be2-b513-7adaabb8f43c | subho2001/algo2nd | merge_sort.cpp | #include<iostream>
#include<cfloat>
using namespace std;
void merge(float a[], int p, int q, int r){
int n1 = q-p+1;
int n2 = r-q;
float L[n1+1];
float R[n2+1];
for(int i=0; i<n1; i++){
L[i] = a[p+i];
}
for(int j =0; j<n2; j++){
R[j] = a[q+1+j];
}
L[n1] = R[n2] = F... | ALGO | 0.999929 | 3.513962 |
b4a68ef2-14ae-47d5-927b-2892ab99d40b | priyankjairaj100/Codeforces-Solutions | contest/189/a/30562186_wrong_answer_2.cpp | #include <bits/stdc++.h>
using namespace std;
int main()
{
int n,a,b,c;cin>>n>>a>>b>>c;
int ans[3]={n/a,a/b,n/c};
sort(ans,ans+3);
cout<<ans[0]+1<<endl;
return(0);
}
| ALGO | 0.999733 | 3.155677 |
f8e58194-ecfd-47c9-ad9a-edeb990dea98 | ishandutta2007/codeforces | archuser84/normal/1381/A2.cpp | #define _USE_MATH_DEFINES
#define FAST ios::sync_with_stdio(false),cin.tie(0);
#include <bits/stdc++.h>
#define Loop(x, l, r) for(int x = (l); x < (r); ++x)
#define LoopR(x, l, r) for(int x = (r)-1; x >= (l); --x)
#define all(x) x.begin(), x.end()
#define Kill(x) return cout << (x) << '\n', 0
#define YN(flag) ((flag)? ... | ALGO | 0.999972 | 4.032468 |
a39f5fb4-695e-4ff8-8b31-d6157cb4c348 | ezterry/GB-framework_base | media/libstagefright/codecs/amrwb/src/isp_az.cpp | /*
------------------------------------------------------------------------------
Filename: isp_az.cpp
Date: 05/08/2004
------------------------------------------------------------------------------
REVISION HISTORY
Description:
------------------------------------------------------------------------------... | ALGO | 0.999643 | 4.915586 |
e9e5ed27-db5e-40b2-9f4f-49e0a4e0db65 | dhruvLearner8/Underwater-world-OpenGL | SurfaceNormal.cpp | //
// SurfaceNormal.cpp
//
#include "SurfaceNormal.h"
#include "ObjLibrary/Vector3.h"
using namespace ObjLibrary;
ObjLibrary::Vector3 getSurfaceNormalGroundPlain (
const ObjLibrary::Vector3& query_pos)
{
return Vector3(0.0, 1.0, 0.0);
}
ObjLibrary::Vector3 getSurfaceNormalSphere (
const ObjLibrar... | ALGO | 0.980366 | 5.199496 |
0f602dad-1403-4496-ae45-092aa4fd3ba0 | q550530/Train-prodect-and-note | Algorithm/Triangle area .cpp | #include "stdafx.h"
#include <iostream>
#include <cmath>
using namespace std;
int getArea(int);
int getArea(int, int);
float getArea(float);
float getArea(int, int, int);
int main()
{
cout << "正方形 : " << getArea(5) << endl;
cout << "矩形形 : " << getArea(5, 6) << endl;
cout << "三角形 : " << getArea(5, 6,... | ALGO | 0.992567 | 3.3563 |
36f60b30-2da0-42ac-bb99-a9f67301ff88 | CUCCS/ds | 2017-1/Sismark/alg3-2.cpp | #include <stdio.h>
#include <stdlib.h>
typedef int Status;
typedef char SElemType;
#define SIZE 100
#define CREAT 10
#define OVERFLOW -1
#define OK 1
#define FALSE 0
#define TRUE 1
#define ERROR 0
typedef struct {
SElemType *base;//ջָ
SElemType *top;//ջָ
int stacksize;
} SqStack;
Status InitStack(SqStack... | ALGO | 0.999453 | 3.850035 |
dbc0e414-f976-43b2-bd68-560d72dad796 | archallumin/ac | BOJ/1000 - 5000/3460.cpp | #include <iostream>
using namespace std;
int main(void) {
int t;
cin >> t;
while (t--) {
int a;
cin >> a;
for (int i = 0; i < 32; i++) {
if (a & (1 << i))
cout << i << " ";
}
cout << "\n";
}
return 0;
} | ALGO | 0.999137 | 4.171322 |
44409f68-b0b4-4d80-b355-c637104256b0 | chahmadbhatti/DSA-practice | Linked_List_047.cpp | //213047
#include <iostream>
#include <list>
#include <iterator>
using namespace std;
class Node
{
private:
int data;
Node *next;
public:
void insert(int a);
void print();
};
Node *Head;
void Node::insert(int x)
{
Node *temp = new Node();
temp->data = x;
temp->nex... | TOOL | 0.962888 | 4.030262 |
b43e3c8e-1079-4c69-9b9e-8ed94d69a412 | InclinedScorpio/coding_ultimate_series | data-structures/tree/binary-tree/operations/sum/subset/max_subset_sum.cpp | #include <iostream>
#include <queue>
using namespace std;
class Node {
public:
int data;
Node* left;
Node* right;
Node(int data) {
this->data = data;
}
};
int globalIndex=-1;
Node* createTree(int *arr) {
globalIndex++;
if(arr[globalIndex]<0) {
return NULL... | ALGO | 0.999978 | 5.05195 |
276b3300-2bb9-4eb1-87eb-8f0bec03c01e | ecell3-models/CardiacMyocytes-Nygren_1998 | Nygren_1998i_diAssignmentProcess.cpp |
#include "libecs.hpp"
#include "Process.hpp"
USE_LIBECS;
LIBECS_DM_CLASS( Nygren_1998i_diAssignmentProcess, Process )
{
public:
LIBECS_DM_OBJECT( Nygren_1998i_diAssignmentProcess, Process )
{
INHERIT_PROPERTIES( Process );
PROPERTYSLOT_SET_GET( Real, tau_di );
PROPERTYSLOT_SET_GET( Real, F );
... | ALGO | 0.965759 | 5.855263 |
6f98b9f5-35c8-482b-b246-7e4f25c3711f | CAPS-UMU/gem5-21-1-Berti-IPCP | src/systemc/tests/systemc/misc/sim_tests/srlatch/nor.cpp | /*****************************************************************************
nor.cpp --
Original Author: Martin Janssen, Synopsys, Inc., 2002-02-15
*****************************************************************************/
/*****************************************************************************
... | ALGO | 0.990244 | 6.428985 |
c79a39a3-5b09-4062-bdeb-121c02dc8fae | noonomyen/vigenere-cipher-tools | src/decrypt.cpp | #include <string>
#include <algorithm>
#include <iostream>
#include <stdexcept>
#include "vigenere-cipher.hpp"
void vigenere::decrypt(std::string& text, const std::string& key) {
if (key.empty()) {
throw std::logic_error("Key cannot be empty.");
}
size_t i = 0;
for (char& c : text) {
... | ALGO | 0.877172 | 7.350613 |
bfb8f294-d430-4938-bbe5-083f9dbdd183 | Sumu154/CP_Techniques | B_Sliding Window/l-Longest_Subarray_With_at_Most_K_Frequency.cpp | #include<bits/stdc++.h>
using namespace std;
#define ll long long
const ll INF = 1e18;
const ll MOD = 1e9+7;
/*
problem link -> https://leetcode.com/problems/length-of-longest-subarray-with-at-most-k-frequency/description/
8 2
1 2 3 1 2 3 1 2
output -> 6
*/
int main()
{
int n, k;
cin >> n >> k;
vector... | ALGO | 0.999927 | 4.992148 |
ec55b596-a359-477f-aed6-0a0037e49a93 | sandipan-das-sd/c | circular queue without using structure.cpp | #include <stdio.h>
#define SIZE 5
int queue[SIZE];
int front = -1, rear = -1;
void enqueue(int x)
{
if ((rear + 1) % SIZE == front)
{
printf("Queue is full\n");
} else {
rear = (rear + 1) % SIZE;
queue[rear] = x;
if (front == -1)
{
front = 0;
}
}
... | ALGO | 0.999352 | 4.75968 |
a7767873-05fb-4cd9-b008-00c9a8bb8950 | shozabhussain/CS200 | Programming Assignment 3/23100174_task1_PA3.cpp | #include <iostream>
using namespace std;
void inputBoard(bool** board, int rows, int cols)
{
int input = 0;
for(int i =0; i<rows; i++)
{
for(int j=0; j<cols; j++)
{
cout << "Enter the element for row " << i+1 << " and column " << j+1 <<": " ;
cin >> input ;
while(cin.fail() || (input !=1 && input !=0)... | ALGO | 0.990397 | 4.746367 |
fffee933-19ec-456b-9d12-89dadbd53f7b | pavel-ryzhov/global_vars | runs/001514.cpp | #include <string>
#include <memory>
#include <vector>
#include <map>
#include <iostream>
class list {
public:
list(const std::string& word, int count, list* parent = NULL, list* next = NULL) :
_word(word), _count(count), _prev(parent), _next(next) {
};
~list() {delete _next;}
list* prev() const {return _prev;... | ALGO | 0.999598 | 3.597904 |
6d3bd715-9906-4afb-a4d6-b53bb0cca4e2 | zv-proger/ol_programms | acmp/0648.cpp | /*
: (<EMAIL>)
0648 acmp.ru
*/
#include<bits/stdc++.h>
using namespace std;
int main() {
int n; cin >> n;
vector<int> dt(n);
for (auto &x: dt) cin >> x;
sort(dt.begin(), dt.end());
int l = 0, r = n - 1;
int ans = 0;
while (l < r) {
ans += dt[r--] - dt[l++];
}... | ALGO | 0.999955 | 4.139931 |
fd1e70f9-8739-497d-8f8d-7acd7499d3d9 | ishandutta2007/codeforces | jiangly/normal/1714/G.cpp | #include <bits/stdc++.h>
using i64 = long long;
void solve() {
int n;
std::cin >> n;
std::vector<std::vector<std::array<int, 3>>> adj(n);
for (int i = 1; i < n; i++) {
int x, a, b;
std::cin >> x >> a >> b;
x--;
adj[x].push_back({i, a, b});
}
std::vecto... | ALGO | 0.999879 | 5.185852 |
cfe1332b-9f70-4f38-8213-ea211ee518f9 | akshatprogrammer/25-Days-Algorithm-Challenge | Sorting/heapSort.cpp | #include<bits/stdc++.h>
using namespace std;
void heapify(int arr[],int n,int i){
int c1=2*i+1;
int c2=2*i+2;
int max=i;
if(c1<n and arr[c1]>arr[max])
max=c1;
if(c2<n and arr[c2]>arr[max])
max=c2;
if(max!=i){
swap(arr[i],arr[max]);
heapify(arr,n,max);
... | ALGO | 0.999982 | 4.746754 |
932f6124-05c7-4919-9d5c-3638b6f69cf6 | ishandutta2007/codeforces | danya090699/normal/766/D.cpp | #include <iostream>
#include <fstream>
#include <map>
#include <string>
using namespace std;
const int sz=3*1e6;
char buf[sz];
int fyk;
void g_st(string &s)
{
while(buf[fyk]>='a' and buf[fyk]<='z')
{
s.push_back(buf[fyk]), fyk++;
}
fyk++;
}
void g_in(int &a)
{
a=0;
while(buf[fyk]>='0' an... | ALGO | 0.999944 | 3.787446 |
d6d46998-1866-41ad-a32f-db7c9f348173 | vincentlaucsb/Graph-Drawing | lib/snap-exp/cascades-benchmark/sortTime.cpp | #include "stdafx.h"
/**
* Used for benchmarking the baseling algorithm in
* file devSort_v1.4.cpp. Takes as input starting point of
* a top cascade and outputs time taken for casacade detection.
* Input : Source, Dest, Start, Duration
* Output : Prints the time for cascade detection
*/
int main(int argc,char*... | ALGO | 0.995411 | 4.29031 |
fbc0ebdc-b9a4-45b9-9d69-1f40b7cf84f2 | mscheutz/diarc | vision/src/main/cpp/third_party/cmt/Matcher.cpp | #include "Matcher.h"
using cv::vconcat;
using cv::DMatch;
namespace cmt {
void Matcher::initialize(const vector<Point2f> & pts_fg_norm, const Mat desc_fg, const vector<int> & classes_fg,
const Mat desc_bg, const Point2f center)
{
FILE_LOG(logDEBUG) << "Matcher::initialize() call";
//Copy normalized ... | ALGO | 0.913862 | 6.16943 |
5fbf5100-85c6-4c6d-9592-cc21f6182ecf | inno-24/algorithm-study | 김영아/1654.cpp | #include <iostream>
#include <vector>
#include <algorithm>
using namespace std;
//랜선 주어진 길이로 자를 수 있는 갯수
long long cut_cable(long long lan_cables[],int k, long long length) {
long long count=0;
for(int i=0;i<k;++i){
count+=lan_cables[i]/length;
}
return count;
}
int main() {
int K, N;
c... | ALGO | 0.999966 | 5.171534 |
354c0269-13b6-4be1-a529-f6c4cfe7e5fc | raramos21/pazl | src/Systems/player_collide_with_platforms.cpp | #include "player_collide_with_platforms.hpp"
#include "../Components/components.hpp"
#include "../Systems/player_movement.hpp"
#include "../Util/clamp.hpp"
#include <SDL.h>
// Axis-Aligned Bounding Boxes(AABB) collision detection.
bool AABBCollision(Position aPos, Size aSize, Position bPos, Size bSize){
float aM... | ALGO | 0.948697 | 5.714098 |
9071fb83-a457-433d-ae71-e15fc49a5abb | MushfiqMoon/Basic-Data-Structure | 05 Singly Linked List/4_printing_list.cpp | #include <bits/stdc++.h>
using namespace std;
class Node
{
public:
int val;
Node *next;
Node(int val)
{
this->val = val;
this->next = NULL;
}
};
int main()
{
Node *head = new Node(10);
Node *a = new Node(20);
Node *b = new Node(30);
Node *c = new Node(40);
Node ... | ALGO | 0.998941 | 3.500692 |
345f2765-ee06-4016-9593-f57427679396 | hjiang13/LLMs-in-IR | POJ-104/83/5541.cpp | #include <iostream>
using namespace std;
int main(){
int p,q,i,j,k,n,a[100],b[100];
double c[100],GPA,m,r;
cin >> "%d",&n);
for(i=0; i<n; i++){
cin >> "%d",&(a[i]));
}
for(j=0; j<n; j++){
cin >> "%d",&(b[j]));
}
for(k=0; k<n; k++){
if((b[k])>=90&&b[k]<=100){
c[k]=(double)(4.0)*(a[k]);
}
else if((b[k])>=85&&b[k]<=89){
c... | ALGO | 0.999129 | 3.128584 |
12d7f673-8eac-4921-99ae-60e48af7ca76 | mashfiqur05/Problem-Solving | Codeforces/1381A_1_Prefix_Flip_Easy_Version.cpp | /// *** --- ||| In the name of ALLAH ||| --- *** ///
#include<bits/stdc++.h>
using namespace std;
#define fastio() ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);
#define fraction() cout.unsetf(ios::floatfield); cout.precision(10); cout.setf(ios::fixed,ios::floatfield);
#define file() freopen("inp... | ALGO | 0.999884 | 3.865309 |
89c62444-9b71-4712-8485-f77f394f1710 | UET-2425HK2-INT2210-01/23021448-CTDL-GT | Lect8_Assignments/Bai3.cpp | #include <iostream>
using namespace std;
const int MAX_N = 100;
const int MAX_W = 1000;
int main() {
int n, X;
cin >> n >> X;
int weight[MAX_N], value[MAX_N];
for (int i = 0; i < n; ++i) {
cin >> weight[i] >> value[i];
}
// dp[i][j]: Giá trị tối đa với i vật đầu tiên và tổng trọng lư... | ALGO | 0.999988 | 4.905124 |
f0fba8c3-5357-4c59-ab31-95f2905a7fa9 | Luffitys/android_device_xiaomi_sm8250-common | libinit/libinit_utils.cpp | #define _REALLY_INCLUDE_SYS__SYSTEM_PROPERTIES_H_
#include <sys/_system_properties.h>
#include <vector>
#include <libinit_utils.h>
void property_override(std::string prop, std::string value, bool add) {
auto pi = (prop_info *) __system_property_find(prop.c_str());
if (pi != nullptr) {
__system_propert... | TOOL | 0.880421 | 6.024902 |
3e1acbcd-9370-42dc-9539-2e1032a51fb3 | CommanderPotato/FMI---Uvod | Zad 3.cpp | #include <iostream>
#include <string>
using namespace std;
int main()
{
double o = 0;
double GPA;
cout << "Vuvedete ocenkite si." << endl;
int arr[5];
for (int i = 0; i<5; i++)
{
cin >> arr[i];
o += arr[i];
}
GPA = o / 5;
cout << " GPA: " << GPA << endl;
system("pause");
return 0;
} | TOOL | 0.895155 | 3.206474 |
47b74c5a-35e9-451c-8926-5c7e2c68a8b4 | amansinghbisht029/apnacollege_courseyt | connectedcompoquestion.cpp | #include <bits/stdc++.h>
using namespace std;
vector<bool> vis;
int n, m;
vector<vector<int>> adj;
vector<int> components;
int get_comp(int idx)
{
if (vis[idx])
return 0;
vis[idx] = true;
int ans = 1;
for (auto i : adj[idx])
{
if (!vis[i])
{
ans += get_comp(i);
... | ALGO | 0.999803 | 5.010041 |
b103c559-0d74-461a-aeba-08ec1015b273 | minombreesjeff/darwin_env | Tools/utils/lldb/llvm/lib/CodeGen/RegisterPressure.cpp | #include "llvm/CodeGen/RegisterPressure.h"
#include "llvm/CodeGen/LiveInterval.h"
#include "llvm/CodeGen/LiveIntervalAnalysis.h"
#include "llvm/CodeGen/MachineRegisterInfo.h"
#include "llvm/CodeGen/RegisterClassInfo.h"
#include "llvm/Support/Debug.h"
#include "llvm/Support/raw_ostream.h"
#include "llvm/Target/TargetMac... | TOOL | 0.896726 | 7.885087 |
448e8225-85fa-4d0c-a563-3f1ebd4933d6 | JR-Wesley/HPC101 | openmp/pi.cpp | #include <chrono>
#include <functional>
#include <immintrin.h> // 引入SIMD指令集
#include <iostream>
#include <omp.h>
#include <stdio.h>
#include <stdlib.h>
#include <time.h>
#define NUM_POINTS 100000000
using LoopBody = std::function_ref<void(long &)>;
struct BenchmarkResult {
std::string name;
double pi_estimate;
... | ALGO | 0.999712 | 6.589509 |
22fc3a5d-4421-4f23-9d14-03dd3bae652b | gokulcodes/competitive_programming_collections | atcoder/ABC/Square Inequality .cpp | #include <bits/stdc++.h>
using namespace std;
typedef long long LL;
#define br '\n'
#define mem(a, b) memset(a, b, sizeof(a))
#define REP(i, j, range, inc) for(int i = j; i < range; i+=inc)
#define RREP(i, j, range, inc) for(int i = j; i >= range; i-=inc)
#define all(a) (a.begin(), a.end())
#define rall(a) (a.end(),... | ALGO | 0.999949 | 3.807786 |
4713e3c7-fd12-4f6f-9167-563c9bceac36 | ndsoccerstar8598/AppliedDataStructures | MidtermPractice/trie.cpp | #include <iostream>
#include <string.h>
using namespace std;
class Trie{
private:
class Node{
public:
Node* next[26];
bool isWord;
Node(){
for(int i =0; i < 26;i++)
next[i]==nullptr;
isWord=false;
}
};
Node* head;
public:
void insert(string word){
Node* temp = head;
... | ALGO | 0.999343 | 4.306193 |
bd1485a5-1601-4283-a3ae-56c6baae3b5a | wujasper/CPSC-350-Assignment-4 | window.cpp | /*
Full Name: Jasper Wu
Student ID: 2339715
Chapman email: <EMAIL>
Course number and section: 350-01
Assignment Number: 4
*/
#include "window.h"
// default constructor to initialize variables
Window::Window() {
processTime = 0;
idleTime = 0;
}
// set process time for the student in service
void Wind... | TOOL | 0.891126 | 3.599228 |
cfa49e67-d20f-4c95-b99d-0c0d061ba065 | glKarin/com.n0n3m4.diii4a | Q3E/src/main/jni/gzdoom/src/rendering/swrenderer/line/r_renderdrawsegment.cpp | #include <stdlib.h>
#include "doomdef.h"
#include "m_bbox.h"
#include "p_lnspec.h"
#include "p_setup.h"
#include "a_sharedglobal.h"
#include "g_level.h"
#include "g_levellocals.h"
#include "p_effect.h"
#include "doomstat.h"
#include "r_state.h"
#include "v_palette.h"
#include "r_sky.h"
#include "po_man.h"
#include "r... | TOOL | 0.958233 | 4.78224 |
861e315c-e7cb-489e-93f8-869def8d837e | abdulhakkeempa/cpp-programming-lab-cusat | Pointers and Runtime Polymorphism/virtualFunctions&runTimePolymorphism_dynamicObjectCreatio.cpp | //program to dynamically create objects and access them using pointer incrementation
#include <iostream>
using namespace std;
class item{
int code;
float price;
public:
item(){
cout<<"Constructor"<<endl;
}
~item(){
cout<<"Destructor"<<endl;
}
void get_data(int c,float p){
code = c;
price = p;
};
void ... | TOOL | 0.972447 | 3.415389 |
6bb11002-e150-4ea4-b792-fbb00892286b | Shridhar1115/Cheff_SHRI | EVENSPLIT.cpp | #include <bits/stdc++.h>
using namespace std;
int main() {
int t;
cin>>t;
while(t--){
int n;
string s;
cin>>n;
cin>>s;
if (n==2)
cout<<s<<endl;
else {
sort(s.begin(),s.end());
cout<<s<<endl;
}
}
// your code go... | ALGO | 0.999918 | 3.960322 |
8cb80879-aabf-4ffc-90c3-c4492652c237 | cyber-hoax/LeetCodeQues | 961-n-repeated-element-in-size-2n-array/961-n-repeated-element-in-size-2n-array.cpp | class Solution {
public:
int repeatedNTimes(vector<int>& A) {
// int n = nums.size() /2;
// unordered_map<int,int> s;
// for(auto x : nums )
// s[x] ++;
// for(auto x : s){
// if(x.second == n)
// return x.first;
// }
// ... | ALGO | 0.999945 | 5.425519 |
313df18d-6376-4053-9e7c-6f22529533b5 | eiforiaa/cpp_lab | Lab1/Task2/Task2.cpp |
#include <iostream>
using namespace std;
#define _USE_MATH_DEFINES
#include <math.h>
double f(double x) {
return pow(cos(3 / 8 * M_PI - x / 4), 2) - pow(cos(11 / 8 * M_PI - x / 4), 2);
}
void main()
{
double x, fun;
cin >> x;
fun = f(x);
cout << fun;
}
| ALGO | 0.999366 | 3.654547 |
9ef110e8-066c-4a45-bfbf-b727721fdaa0 | AlphaPixel/3DNature | WCS-VNS/GeoLib/for_init.cpp | /*******************************************************************************
NAME FOR_INIT
PURPOSE: Initializes forward projection transformation parameters
PROGRAMMER DATE REASON
---------- ---- ------
T. Mi... | ALGO | 0.981972 | 3.543121 |
eb6310b8-ecc8-4a2d-b2bf-fe17de1ac3fb | NghiaST/VinhDinhCoder | Tìm kiếm/FINDK2.cpp | #include <iostream>
#define FOR(i, l, r) for(int i=l; i<=r; i++)
#define N 100005
using namespace std;
int n, k, x, r, a[N];
int main() {
scanf("%d%d", &n, &k);
FOR(i, 1, n) {
scanf("%d", &x);
if (x == k) a[++r] = i;
}
if (!r) cout << "NO"; else cout << r << '\n';
FOR(i, 1, r) cout ... | ALGO | 0.999988 | 3.684089 |
4037de22-1219-43ae-9bf1-7561ea148699 | Khushi1148/Competitive_Programming | GenerateSubsets(BitMasking).cpp |
#include<bits/stdc++.h>
using namespace std;
vector<vector<int>> subsets(vector<int> &nums){
int n = nums.size();
int subset_ct = (1<<n);
vector<vector<int>> subsets;
for(int mask=0; mask<subset_ct; ++mask){
vector<int> subset;
for(int k=0; k<n; k++){
if((mask &(1<<k))!=0)... | ALGO | 0.999986 | 5.258865 |
1f682b85-ce82-44fb-9b86-66bdc99ff84b | srujangit123/Competitive-programming | codeforces/Hungry Student Problem.cpp | #include <bits/stdc++.h>
using namespace std;
void solve() {
int x;
cin >> x;
if(x%3 == 0 || x%7 == 0 ) {
cout << "YES\n";
return;
}
while(x > 0) {
if(x%3 == 0) {
break;
}
x -= 7;
}
if(x < 0) {
cout << "NO\n";
}
else {
... | ALGO | 0.998483 | 3.790443 |
8cb003b7-7b28-44fb-a929-2fd7d50a4a19 | TJD2004/Coding-in-CPP | array/sumArray.cpp | #include <iostream>
using namespace std;
/*
Code to Sum all Element in Array
*/
int getSum(int arr[], int n){
int sum = 0;
for( int i = 0; i < n; i++){
sum = sum + arr[i];
}
return sum;
}
int main() {
int size;
cout << "Enter the size of array = ";
cin >> size;
... | ALGO | 0.988424 | 4.811673 |
20ea4d97-2354-4eb3-99b7-c2ea07161ace | idkmynamereally/LeetCodeSolutions | 73-set-matrix-zeroes/set-matrix-zeroes.cpp | class Solution {
public:
void setZeroes(vector<vector<int>>& matrix)
{
unordered_set<int> cols;
unordered_set<int> rows;
for (int i = 0; i < matrix.size(); i++)
{
for (int j = 0; j < matrix[0].size(); j++)
{
if (!matrix[i][j])
... | ALGO | 0.998235 | 6.656807 |
43bc772f-8836-4547-b229-db040be18936 | MRNOONE333/DSA | LEETCODE/290.cpp | #include <iostream>
#include <vector>
#include <string>
#include <map>
using namespace std;
class Solution {
public:
bool wordPattern(string p, string s) {
vector<string> st;
string cur = "";
for(auto it : s) {
if(it == ' ') {
st.push_back(cur);
c... | ALGO | 0.999409 | 6.572402 |
281d5d62-0620-4772-9623-5ac3a9fca325 | simonuks221/VHDL-soft-core | Source/Software/Compiler/optimisation/binary_tree/binary_tree.cpp | #include "binary_tree.hpp"
#include <vector>
#include <cassert>
#include <cmath>
IToken * TreeNode::get_token(void) {
return token;
}
TreeNode *TreeNode::get_left(void) {
return left;
}
TreeNode *TreeNode::get_right(void) {
return right;
}
void TreeNode::set_left(TreeNode *_left) {
left = _left;
}
vo... | ALGO | 0.981313 | 4.221791 |
b00f00e0-7cdf-4837-b328-540222020ac5 | Sayan11071998/Outscal-Assignments | Data Structure/Strings and Operator Overloading/Assignment - [Assignment] Character count/Main.cpp | #include <iostream>
#include <string>
using namespace std;
void charCount(const string& _input)
{
int asciiCount[256] = { 0 };
for (char c : _input) { asciiCount[(int)c]++; }
for (int i = 0; i < 256; i++)
if (asciiCount[i] > 0) { cout << (char)i << " - " << asciiCount[i] << endl; }
}
int main()
{
string inpu... | ALGO | 0.995688 | 5.285692 |
1dbc6b55-5d87-45a8-8564-001f63866e8f | wearrrrr/EoSDecomp | src/Global/_floor_decompiled.cpp |
/* WARNING: Removing unreachable block (ram,0x0045db99) */
/* WARNING: Globals starting with '_' overlap smaller symbols at the same address */
float10 __cdecl _floor(double param_1,undefined2 param_2)
{
uint uVar1;
int iVar2;
bool bVar3;
uint in_MXCSR;
ushort in_FPUControlWord;
float10 fVar4;
double d... | ALGO | 0.988219 | 3.274052 |
4a4e3c77-26cc-4fd5-9141-d963132ebad1 | sh-sho1kat/CODEFORCES | Codeforces Round 979 (Div. 2)/A_A_Gift_From_Orangutan.cpp | #include <bits/stdc++.h>
using namespace std;
// 2024-10-19 20:08:19
#define fastio ios_base::sync_with_stdio(false), cin.tie(NULL), cout.tie(NULL)
#define mod 1000000007
#define inf (1LL << 62)
#define all(x) x.begin(), x.end()
#define eb push_back
#define ff first
#define ss second
#define yes cout << "YES" << nl
#d... | ALGO | 0.999891 | 4.751534 |
01f66f88-0fdd-4a6c-b10d-5523c24e5e4a | tahmidul-islam-star/Codeforces-Problem-Solutions | 952 div 4 D.cpp | #include<iostream>
#include<vector>
#include<cstring>
using namespace std;
#define f1 for(int i=0;i<a;i++)
#define f2 for(int j=0;j<b;j++)
#define endl '\n'
#define int long long
void Tahmid()
{
int a, b; cin >> a >> b;
vector<string> vect(a);
vector<int> row(a, 0), col(b, 0);
f1
{
cin ... | ALGO | 0.999819 | 3.67208 |
6d03a62f-7d1c-485b-a2a7-24a19f0c1f4b | AlexMaximenko/sem_2 | contest_2_task_I.cpp | #include<iostream>
#include<vector>
#include<math.h>
template<class T>
class SummFenwick_3_Tree
{
public:
SummFenwick_3_Tree(size_t size_x, size_t size_y, size_t size_z)
{
elements_ = std::vector<std::vector<std::vector<T>>>(size_x, std::vector<std::vector<T>>(size_y, std::vector<T>(size_z, 0)));
}
SummFenwick_3_... | ALGO | 0.998123 | 4.540285 |
02842f74-78ba-4b24-aa32-73bcf5d251ab | sheeluofficial/practice | OthersCode/LeetCode-Solutions-master/LeetCode-Solutions-master/C++/diagonal-traverse.cpp | // Time: O(m * n)
// Space: O(1)
class Solution {
public:
vector<int> findDiagonalOrder(vector<vector<int>>& matrix) {
if (matrix.empty() || matrix[0].empty()) {
return {};
}
vector<int> result;
int row = 0, col = 0, d = 0;
vector<vector<int>> dirs = {{... | ALGO | 0.999996 | 7.002004 |
0520d0db-7b66-4616-a8f6-db27a12131bd | whitelok/fast-directional-chamfer-matching | Image/DistanceTransform.cpp | #include "DistanceTransform.h"
// dt of binary image using squared distance
void DistanceTransform::CompDT(const Image<uchar> *input,Image<float> *output,bool onEqualOne,Image<int> *nn)
{
uchar on;
on = (onEqualOne) ? 255 : 0;
int imageWidth = input->width();
int imageHeight = input->height();
// Initialize di... | ALGO | 0.999106 | 4.710366 |
c877f7e7-e80a-4004-a71b-7bb072d28876 | Steven-cpp/MyCasualRepo | test.cpp | #include <iostream>
#include <vector>
#include <algorithm>
#include <set>
using namespace std;
class Solution {
public:
vector<vector<int>> threeSum(vector<int>& nums) {
// 1. define two pointers `start`, `end`
int n = nums.size();
int start = 0, end = n - 1;
sort(nums.begin(), num... | ALGO | 0.999966 | 5.414652 |
f4f37178-a8b3-46d3-a4f5-cf2d440078b3 | apvanzanten/advent-of-code-2021 | 18b/main.cpp | #include <algorithm>
#include <cmath>
#include <fstream>
#include <functional>
#include <iomanip>
#include <iostream>
#include <memory>
#include <numeric>
#include <optional>
#include <string>
#include <tuple>
#include <vector>
template <typename T>
std::ostream &operator<<(std::ostream &os, const std::vector<T> &v) {... | ALGO | 0.998904 | 6.044425 |
93016ac1-ef0f-47c2-9d2e-476bd50c6119 | mdbal-lunule/lunule | src/boost/libs/filesystem/example/tut4.cpp | // filesystem tut4.cpp ---------------------------------------------------------------//
// Library home page: http://www.boost.org/libs/filesystem
#include <iostream>
#include <vector>
#include <algorithm>
#include <boost/filesystem.hpp>
using std::cout;
using namespace boost::filesystem;
int main(int argc, char... | TOOL | 0.864056 | 6.223881 |
7607d38f-36b3-476a-9888-a35a1130a7f2 | hzding621/algorithms | leetcode/cpp/030_substring_with_concatenation_of_all_words.cpp | #include <iostream>
#include <string>
#include <vector>
#include <unordered_map>
using namespace std;
class Solution {
public:
vector<int> findSubstring(string s, vector<string>& words) {
vector<int> v;
if (s.length()==0 || words.size()==0)
return v;
unordered_map<string,int> w... | ALGO | 0.999929 | 5.567248 |
c2a946e4-45fb-43ce-a5fd-21c7418e4195 | ishandutta2007/codeforces | wsyhb/normal/863/A.cpp | #include<bits/stdc++.h>
using namespace std;
namespace IO
{
const int buffer_size=1e5+5;
char buf[buffer_size],*S,*T;
bool flag_EOF;
inline char read_char()
{
if(S==T)
T=(S=buf)+fread(buf,1,buffer_size,stdin);
return S!=T?*(S++):EOF;
}
inline int read_int()
{
int flag=1;
char c=read_char(... | ALGO | 0.9999 | 4.186466 |
8f209c8f-be8a-4fbe-ae58-8f3e41849da2 | MerciaReginasl/Tecnicas_em_Programacao_P2_UFCG_EE | dados.cpp | #include <iostream>
#include <vector>
using namespace std;
int main() {
vector<int> dados;
int valor;
cout << "Insira os valores dos dados rolados (um valor negativo encerra a entrada):" << endl;
// Loop para receber valores
while (true) {
cout << "Valor do dado: ";
cin >> valor;... | ALGO | 0.998173 | 5.414165 |
fb4b6d99-97e3-41a7-a7fe-bc68d16048a0 | Ahmed-Zaher/CompetitiveProgramming | UVA/UVA 663.cpp | /*
* Consider a bipartite graph where L = {1, 2, 3, ..}, R = {A, B, C, ..}
* And |L| = |R| = n. We add an edge to i in L to j in R if the number i
* lies within borders of slide j. The problem tells us that there is a matching of size n
* in that graph. Let's find one such matching, and for each i find which j it w... | ALGO | 0.999443 | 4.487607 |
a72e1fc4-6d03-4acf-89ec-92bf7fb6d2d3 | RinCloud/TrickCatcher | Datasets/TrickyBugs/GenProgs/dpp_generated_progs_cpp/p02708/p02708_num0_parsed.cpp | #include <iostream>
#include <vector>
#include <algorithm>
using namespace std;
const int MOD = 1e9 + 7;
int main() {
int N, K;
cin >> N >> K;
vector<long long> nums(N + 1);
for (int i = 0; i <= N; i++) {
nums[i] = 1e100 + i;
}
int count = min(N - K + 1, K);
long long sum = 0;
... | ALGO | 0.999913 | 5.264738 |
f35c7386-5b19-471b-90e4-57cbfc7a28b1 | Atik203/C_and_CPP | C++/set.cpp | #include <bits/stdc++.h>
using namespace std;
int main()
{
set<int> s;
int n;
cin >> n;
while (n--)
{
int x;
cin >> x;
s.insert(x); // O(logN)
}
for (auto it = s.begin(); it != s.end(); it++)
{
cout << *it << endl;
}
if (s.count(9)) // O(logN)
... | ALGO | 0.999848 | 4.362297 |
35b56289-1727-4ebb-88fc-acbc14b76441 | aankitasoni/Data-Structures-and-Algorithms | Array/Merging 2 Array.cpp | // Merging 2 Arrays.
struct Array
{
int A[10];
int size;
int length;
};
void Display(struct Array arr)
{
int i;
printf("\nElements are\n");
for(i=0;i<arr.length;i++)
printf("%d ",arr.A[i]);
}
struct Array* Merge(struct Array *arr1,struct Array *arr2)
{
int i,j,k;
i=j=k=0;
struct Array *arr3=(struct Array ... | ALGO | 0.974656 | 4.474689 |
3a4c41d8-a098-4cf3-ad45-198949ed82f9 | shailendra-kc/Competitive-Programming | A_Almost_Prime.cpp | #include<bits/stdc++.h>
#define mod 1000000007
#define digit floor(log10(n) + 1)
#define ll long long
#define ld long double
#define all(v) begin(v),end(v)
#define loop(i,x,y) for(ll i=x;i<y;i++)
#define loop1(i,y,x) for(ll i=y;i>=x;i--)
#define yes cout<<"YES"<<endl;
#define no cout<<"NO"<<endl;
#define vll vector<... | ALGO | 0.999371 | 4.224954 |
68ba6dc2-3763-450f-b88d-6c89c0021135 | BongYunnong/TIL | Baekjoon/반복문/11022_A+B-8.cpp | // https://www.acmicpc.net/problem/11022
// 두 정수 A와 B를 입력받은 후 A+B출력
#include <iostream>
using namespace std;
int main(){
cin.tie(NULL)->sync_with_stdio(false);
int t;
cin >> t;
int a,b;
for(int i=0;i<t;i++){
cin >> a >> b;
cout<<"Case #"<<i+1<<": "<<a<<" + "<<b<<" = "<<a+b<<"\n";
... | ALGO | 0.997537 | 6.367579 |
7c752961-178d-4627-afba-a92a0de63d38 | Wilhelm-Marais/orbvins_fusion | vins_estimator/src/featureTracker/feature_tracker.cpp | #include "feature_tracker.h"
bool FeatureTracker::inBorder(const cv::Point2f &pt)
{
const int BORDER_SIZE = 1;
int img_x = cvRound(pt.x);
int img_y = cvRound(pt.y);
return BORDER_SIZE <= img_x && img_x < col - BORDER_SIZE && BORDER_SIZE <= img_y && img_y < row - BORDER_SIZE;
}
double distance(cv::Poin... | ALGO | 0.941861 | 5.017621 |
a97e16b5-bc72-4e52-806d-9ddd1d380ee0 | SokolovValy/CalculatorRPM | calc.cpp | #include <iostream>
#include <cstdlib>
using namespace std;
int main(){
int q,w;
q=0;
w=0;
char s;
while(true){
cout<<"Enter the data in the format: a+b"<<endl;
cin>>q>>s>>w;
switch(s){
case '*':
cout<<q*w<<endl;
break;
case '+':
cout<<q+w<<endl;
break;
case '-':
... | ALGO | 0.995738 | 3.204875 |
13d06756-73b9-4c22-9fbf-92287572c9c0 | kmjp/procon | codeforce/621-660/627/e3.cpp | #include <bits/stdc++.h>
using namespace std;
typedef signed long long ll;
#undef _P
#define _P(...) (void)printf(__VA_ARGS__)
#define FOR(x,to) for(x=0;x<(to);x++)
#define FORR(x,arr) for(auto& x:arr)
#define ITR(x,c) for(__typeof(c.begin()) x=c.begin();x!=c.end();x++)
#define ALL(a) (a.begin()),(a.end())
#define ZER... | ALGO | 0.999248 | 3.272417 |
81e497df-84fc-4d17-8aac-16369e8b9494 | hirakuuuu/kyopro | ABC/273/abc273_d.cpp | #include <bits/stdc++.h>
using namespace std;
#define rep(i, a, n) for(int i = a; i < n; i++)
#define ll long long
#define pii pair<int, int>
#define pll pair<ll, ll>
const int MOD = 1000000007;
const int mod = 998244353;
// 問題
// https://atcoder.jp/contests/abc273/tasks/abc273_d
int main(){
ll h, w; cin >> h >> ... | ALGO | 0.999812 | 4.600598 |
f6ef3102-1649-4c2e-9ea6-e9e3b7b0258e | Modding-Zaibatsu/ue5-polaris | Engine/Source/ThirdParty/nvTextureTools/nvTextureTools-2.0.8/src/src/nvtt/squish/maths.cpp | #include "maths.h"
#include "simd.h"
#include <cfloat>
namespace squish {
Sym3x3 ComputeWeightedCovariance( int n, Vec3 const* points, float const* weights, Vec3::Arg metric )
{
// compute the centroid
float total = 0.0f;
Vec3 centroid( 0.0f );
for( int i = 0; i < n; ++i )
{
total += weights[i];
centroid += ... | ALGO | 0.999878 | 6.542101 |
c6fc6408-7c67-40ab-9f3c-088bbbad7637 | ishandutta2007/codeforces | galen_colin/normal/509/E.cpp | #include <bits/stdc++.h>
#include <chrono>
using namespace std;
using namespace std::chrono;
// #pragma GCC target ("avx2")
// #pragma GCC optimization ("O3")
// #pragma GCC optimization ("unroll-loops")
#define f0r(a, b) for (long long a = 0; a < b; a++)
#define f1r(a, b, c) for (long long a = b; a < c; a++)
#... | ALGO | 0.999474 | 4.619476 |
c8fa7d5d-1263-4e94-91b7-5cbd792abfc7 | NK278/C-_DSA | Searching01 copy/Binary_search.cpp | #include<bits/stdc++.h>
using namespace std;
void vector_in(vector<int>& v,int n){
for(int i=0;i<n;i++){
int x;
cin>>x;
v.push_back(x);
}
}
int search(vector<int>& nums, int target) { // TC=O(logn)
int n = nums.size();
int lo=0,hi=n-1;
while(lo<=hi){
int mid = lo+((hi... | ALGO | 0.999951 | 5.464151 |
c9e56169-cc03-45b3-b8ad-3be19f9346e8 | 123CR0001/WinterProduct | AppFrame/source/Collision/Vector3.cpp | #include"Vector3.h"
bool Vector3::operator == (const Vector3& right) {
if (fabsf(x - right.x) > 0.01f) { return false; }
if (fabsf(y - right.y) > 0.01f) { return false; }
if (fabsf(z - right.z) > 0.01f) { return false; }
return true;
}
bool Vector3::operator != (const Vector3& right) {
if (fabs(x - right.x) > 0.... | TOOL | 0.875636 | 5.587483 |
061ee976-32e0-4015-8ea0-3ce29ab948fc | RinCloud/TrickCatcher | Datasets/TrickyBugs/GenProgs/dpp_generated_progs_cpp/p03241/p03241_num2_parsed.cpp | #include <iostream>
using namespace std;
int main() {
int N, M;
cin >> N >> M;
int gcd = 1;
for (int i = 2; i <= M / N; i++) {
if (M % i == 0) {
gcd = i;
}
}
cout << gcd << endl;
return 0;
}
| ALGO | 0.99994 | 5.162778 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.