text stringlengths 59 71.4k |
|---|
#include <bits/stdc++.h> using namespace std; int main() { int n, m; cin >> n >> m; if (n <= 6) { cout << m << endl; return 0; } int mark[8][8] = {0}, i, j, deg[8] = {0}, a, k; for (i = 0; i < m; i++) { int x, y; cin >> x >> y; mark[x][y] = 1; mark[y][x] =... |
`timescale 1ns/1ps
module tb;
reg E;
wire Y;
wire clk;
parameter NAND2_DEFAULT_DELAY = 1;
/* chip AUTO_TEMPLATE(
.notE(!E),
.G(clk),
); */
chip #(.NAND2_DELAY(NAND2_DEFAULT_DELAY))
U_CHIP
(
/*AUTOINST*/
// Outputs
.Y (Y),
// Inputs
.not... |
/*
* Copyright 2020 The SkyWater PDK Authors
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law... |
// megafunction wizard: %FIFO%
// GENERATION: STANDARD
// VERSION: WM1.0
// MODULE: scfifo
// ============================================================
// File Name: fifo_39x256.v
// Megafunction Name(s):
// scfifo
//
// Simulation Library Files(s):
// altera_mf
// ===============================... |
// ----------------------------------------------------------------------
// Copyright (c) 2015, The Regents of the University of California All
// rights reserved.
//
// Redistribution and use in source and binary forms, with or without
// modification, are permitted provided that the following conditions are
// met:... |
#include <bits/stdc++.h> using namespace std; const long long inf = 1e9; const long long N = 1e5 + 10; const long long bits = 30; const long long mod = 1e9 + 7; const long double pi = 3.14159265358979323846; int main() { ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL); ; ... |
// ======================================================================
// Design01.v generated from TopDesign.cysch
// 09/05/2015 at 17:07
// This file is auto generated. ANY EDITS YOU MAKE MAY BE LOST WHEN THIS FILE IS REGENERATED!!!
// ======================================================================
/... |
/*
* Copyright 2013, Homer Hsing <>
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to ... |
#include <bits/stdc++.h> using namespace std; int how_many(string s, vector<string>& deleted) { int res = 0; for (auto i : deleted) for (int j = 0; j < s.size(); j++) { if (i[j] != s[j]) break; if (j == s.size() - 1) res++; } return res; } int main() { ios_base::sync_... |
// ============================================================================
// Copyright (c) 2010
// ============================================================================
//
// Permission:
//
//
//
// Disclaimer:
//
// This VHDL/Verilog or C/C++ source code is intended as a design reference
... |
/*
* Generate a combinational adder of any width. The width parameter can
* be any integer value >0. The A and B inputs have WID bits, and the Q
* output has WID+1 bits to include the overflow.
*/
module addN
#(parameter WID = 4)
(input wire [WID-1:0] A,
input wire [WID-1:0] B,
output wire [WID:0] Q
... |
#include <bits/stdc++.h> int main() { int x, y; scanf( %d%d , &x, &y); int i = 1; while (1) { if (y < 2 || ((100 * x) + (10 * y)) < 220) { if (i & 1 == 1) printf( Hanako ); else printf( Ciel ); return 0; } if (i & 1 == 1) { if (x >=... |
#include <bits/stdc++.h> template <typename T> T inline SQR(const T &a) { return a * a; } template <typename T> T inline ABS(const T &a) { return a < 0 ? -a : a; } template <typename T> T inline MIN(const T &a, const T &b) { if (a < b) return a; return b; } template <typename T> T ... |
#include <bits/stdc++.h> using namespace std; const int MAXK = 3000; struct Update { int cost; long long profit; }; struct CommutativeUndoableDS { vector<array<long long, MAXK + 1> > dp; CommutativeUndoableDS() { dp.emplace_back(); fill(dp.back().begin(), dp.back().end(), 0); }... |
#include <bits/stdc++.h> using namespace std; const int maxx = 1e5 + 7; const int Inf = 1 << 30; const long long INF = 1ll << 60; int n; int a[maxx]; vector<int> vec; int pos[maxx]; map<int, int> mp; int ans; int main() { cin >> n; for (int i = 1; i <= n; i++) cin >> a[i]; int cnt = 0;... |
#include <bits/stdc++.h> using namespace std; void optimise() { ios_base::sync_with_stdio(false); cin.tie(NULL); } long long int mod = 1e9 + 7; void normalize(long long int &a) { a = (a + mod) % mod; } long long int modmul(long long int a, long long int b) { a = a % mod; b = b % mod; nor... |
#include <bits/stdc++.h> using namespace std; string s[105]; int main() { int n, m, cnt = 0, t, tt, temp, dis = 0, ans = 0, len; int row = 0, rowup = 2e9, rowdn = -1, col = 0, collft = 2e9, colrt = -1; int rowupcol, rowdncol, collftrow, colrtrow; scanf( %d %d , &n, &m); for (int i = 0; i < n; ... |
/**
* Copyright 2020 The SkyWater PDK Authors
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable la... |
/**
* Copyright 2020 The SkyWater PDK Authors
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable la... |
#include <bits/stdc++.h> using namespace std; const int M = 220000; vector<int> e1[M], e2[M]; int p[M], dis[M]; int main() { int n, m; cin >> n >> m; for (int i = 0; i < m; i++) { int u, v; cin >> u >> v; e1[u].push_back(v); e2[v].push_back(u); } int k; cin >> k... |
// --------------------------------------------------------------------
// Copyright (c) 2007 by Terasic Technologies Inc.
// --------------------------------------------------------------------
//
// Permission:
//
// Terasic grants permission to use and modify this code for use
// in synthesis for all Terasic De... |
`define ADDER_WIDTH 023
`define DUMMY_WIDTH 128
`define 3_LEVEL_ADDER
module adder_tree_top (
clk,
isum0_0_0_0, isum0_0_0_1, isum0_0_1_0, isum0_0_1_1, isum0_1_0_0, isum0_1_0_1, isum0_1_1_0, isum0_1_1_1,
sum,
);
input clk;
input [`ADDER_WIDTH+0-1:0] isum0_0_0_0, isum0_0_0_1, isum0_0_1_0, isum0_0_1_1, isum0_1_0_0,... |
/**
* Copyright 2020 The SkyWater PDK Authors
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable la... |
#include <bits/stdc++.h> using namespace std; const double EPS = 1e-3; const int SZ = 4000050, INF = 0x7FFFFFFF; const double PI = acos(-1); struct nd { double a, b, c, d, e; nd(double _a = 0, double _b = 0, double _c = 0, double _d = 0, double _e = 0) : a(_a), b(_b), c(_c), d(_d), e(_e) {} ... |
`timescale 1ns / 1ps
////////////////////////////////////////////////////////////////////////////////
// Company:
// Engineer:
//
// Create Date: 10:58:27 12/03/2015
// Design Name: div_64
// Module Name: C:/Users/Camilo/Documents/Xilinx_Workspace/Div64b/Div_tst.v
// Project Name: Div64b
// Target Device:
//... |
/*
* Milkymist SoC
* Copyright (C) 2007, 2008, 2009 Sebastien Bourdeauducq
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, version 3 of the License.
*
* This program is distributed in ... |
// $Id: c_fbmult.v 1836 2010-03-23 02:35:46Z dub $
/*
Copyright (c) 2007-2009, Trustees of The Leland Stanford Junior University
All rights reserved.
Redistribution and use in source and binary forms, with or without modification,
are permitted provided that the following conditions are met:
Redistributions of sourc... |
#include <bits/stdc++.h> using namespace std; const long double pi = 3.1415926535897932384626433832795l; template <typename T> inline auto sqr(T x) -> decltype(x * x) { return x * x; } template <typename T1, typename T2> inline bool umx(T1& a, T2 b) { if (a < b) { a = b; return 1; ... |
#include <bits/stdc++.h> using namespace std; bool check[100]; int main() { int n; string s; cin >> n; cin >> s; int ans = 0; for (int x = 0; x < s.size(); ++x) { if (!check[s[x] - a ]) { ans++; check[s[x] - a ] = 1; } } cout << ((ans >= n) ? YES : ... |
#include <bits/stdc++.h> #pragma comment(linker, /STACK:16777216 ) using namespace std; pair<int, int> p[10][10]; int nom[4]; bool cmp(int a, int b) { if (p[a][0] != p[b][0]) return (p[a][0] < p[b][0]); else return (p[a][1] < p[b][1]); } int main() { for (int i = (0); i < (4); i++... |
#include <bits/stdc++.h> #define int long long using namespace std; signed main(){ int t; cin >> t; while(t--){ int k, n, m; cin >> k >> n >> m; int a[n + 1], b[m + 1]; for(int i = 0;i < n;i++){ cin >> a[i]; } for(int i = ... |
#include <bits/stdc++.h> using namespace std; string g[51]; int pre[52][52]; int dp[51][51][51][51]; bool chk(int x1, int x2, int y1, int y2) { int r = pre[x2][y2] - pre[x1][y1 - 1] - pre[x1 - 1][y1] + pre[x1 - 1][y1 - 1]; if (r >= 1) return true; return false; } int fun(int r1, int r2, int c1... |
#include <bits/stdc++.h> using namespace std; int main() { int n, l, r, shag = 0; cin >> n; l = 1; r = n; while (l <= r) { if (shag % 2 == 0) cout << l++ << ; else cout << r-- << ; shag++; } return 0; } |
// ========== Copyright Header Begin ==========================================
//
// OpenSPARC T1 Processor File: bw_r_l2d_rep_bot.v
// Copyright (c) 2006 Sun Microsystems, Inc. All Rights Reserved.
// DO NOT ALTER OR REMOVE COPYRIGHT NOTICES.
//
// The above named program is free software; you can redistribute it ... |
`timescale 1ns / 1ps
//////////////////////////////////////////////////////////////////////////////////
// Company:
// Engineer:
//
// Create Date: 15:04:44 02/23/2015
// Design Name:
// Module Name: Descale_pipeline
// Project Name:
// Target Devices:
// Tool versions:
// Description:
//
/... |
#include <bits/stdc++.h> using namespace std; int f[8000]; char s[8000]; int main() { scanf( %s , s); int n = strlen(s), m = n; if (s[0] == * || s[0] == / ) { puts( 0 ); return 0; } f[m] = 1; for (int i = 0; i < n; i++) if (!isdigit(s[i])) if (s[i + 1] == * ... |
#include <bits/stdc++.h> using namespace std; long long dp[5050][505]; pair<long long, long long> pre[5050][505]; signed main() { ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL); long long d, s; cin >> d >> s; queue<pair<long long, long long>> q; for (long long i = 1;... |
//Legal Notice: (C)2014 Altera Corporation. All rights reserved. Your
//use of Altera Corporation's design tools, logic functions and other
//software and tools, and its AMPP partner logic functions, and any
//output files any of the foregoing (including device programming or
//simulation files), and any associated do... |
/**
* Copyright 2020 The SkyWater PDK Authors
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable la... |
#include <bits/stdc++.h> using namespace std; const int size = 3111; long long mod = 200000007; double p; int x, k, tmpx, a, m, b; double dp[2][1 << 9][2][255]; int main() { cin >> x >> k >> p; tmpx = x; p /= 100; int cur, nxt; m = (1 << 9) - 1; int res = (x & m); x >>= 9; ... |
/*
* Copyright 2020 The SkyWater PDK Authors
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law... |
#include <bits/stdc++.h> using namespace std; const double eps = 1e-10; inline int sgn(int x) { if (x > -eps || x < eps) return 0; if (x > 0) return 1; else return -1; } struct point { double x, y; point(double a = 0, double b = 0) { x = a; y = b; } point op... |
// ----------------------------------------------------------------------
// Copyright (c) 2015, The Regents of the University of California All
// rights reserved.
//
// Redistribution and use in source and binary forms, with or without
// modification, are permitted provided that the following conditions are
// met:... |
/* Data read from RAM and displayed on one LED while others are a
* binary counter
*/
module top (
input clk,
output LED1,
output LED2,
output LED3,
output LED4,
output LED5
);
parameter LOG2RAMDELAY = 20;
localparam BITS = 4;
localparam LOG2DELAY = LOG2RAMDELAY + 7;
reg [BITS+LOG2DELAY-1:0] cou... |
#include <bits/stdc++.h> using namespace std; using namespace std::chrono; long long mod = 1000000007; void __print(int x) { cerr << x; } void __print(long x) { cerr << x; } void __print(long long x) { cerr << x; } void __print(unsigned x) { cerr << x; } void __print(unsigned long x) { cerr << x; } vo... |
#include <bits/stdc++.h> using namespace std; const int maxN = 502; long long c[maxN][maxN]; long long a[maxN]; int n, m, b, md; int main() { cin >> n >> m >> b >> md; for (int i = 1; i <= n; i++) cin >> a[i]; c[0][0] = 1; for (int i = 1; i <= n; i++) for (int j = 0; j < m; j++) ... |
/*------------------------------------------------------------------------------
* This code was generated by Spiral Multiplier Block Generator, www.spiral.net
* Copyright (c) 2006, Carnegie Mellon University
* All rights reserved.
* The code is distributed under a BSD style license
* (see http://www.opensource.or... |
#include <bits/stdc++.h> using namespace std; const int mod = 1e9 + 7; long long qpow(long long x, long long y) { long long re = 1, base = x % mod; while (y) { if (y & 1) re = (re * base) % mod; base = (base * base) % mod; y >>= 1; } return re; } struct node { int to, w; ... |
#include <bits/stdc++.h> int main() { int s; scanf( %d , &s); char t[s]; scanf( %s , t); int i, count = 0; for (i = 0; i < s; ++i) { if (t[i] == t[i + 1]) ++count; } printf( %d , count); } |
//Legal Notice: (C)2015 Altera Corporation. All rights reserved. Your
//use of Altera Corporation's design tools, logic functions and other
//software and tools, and its AMPP partner logic functions, and any
//output files any of the foregoing (including device programming or
//simulation files), and any associated do... |
`timescale 1ns / 1ps
//////////////////////////////////////////////////////////////////////////////////
// Company: RIT
// Engineer: Cody Cziesler and Nick Desaulniers
//
// Create Date: 11:36:45 04/07/2011
// Design Name: instruction_decode
// Module Name: instruction_decode
// Project Name: Om... |
#include <bits/stdc++.h> using namespace std; int a, b, c, d, i; int digits(int n) { int d = 0; while (n) { n /= 10; d++; } return d; } int main() { cin >> a >> b; c = a; d = digits(b); for (i = 1; b; i++) { c += (b % 10) * (int)floor(pow((double)10, (double)d... |
//==================================================================================================
// Filename : musoc.v
// Created On : 2015-01-10 21:18:59
// Last Modified : 2015-05-28 09:43:30
// Revision : 1.0
// Author : Angel Terrones
// Company : Universidad Simón Bolívar
// Em... |
///////////////////////////////////////////////////////////////////////////////
//
// Copyright (C) 2014 Francis Bruno, All Rights Reserved
//
// This program is free software; you can redistribute it and/or modify it
// under the terms of the GNU General Public License as published by the Free
// Software Found... |
#include <bits/stdc++.h> using namespace std; int main() { long long a, b; cin >> a >> b; long long ans = 0; while (true) { long long x = max(a, b); long long y = min(a, b); if (x == 0 || y == 0) break; long long n = x / y; ans += n; x -= n * y; a = x; ... |
#include <bits/stdc++.h> long long gcdfun(long long x, long long y) { if (y == 0) return x; else return gcdfun(y, x % y); } using namespace std; int main() { ios_base::sync_with_stdio(false); cin.tie(NULL); int t; cin >> t; while (t--) { int n, k = 1, flag = 0, ans ... |
#include <bits/stdc++.h> using namespace std; int main() { ios_base::sync_with_stdio(false); cin.tie(NULL); int n, d, t, result, stored = 0; cin >> n >> d; for (int i = 0; i < n; i++) { cin >> t; stored += t; } d -= (n - 1) * 10; if (d - stored >= 0) { cout << (n - ... |
/*
* Copyright 2020 The SkyWater PDK Authors
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law... |
#include <bits/stdc++.h> #pragma optimize( TKACHENKO-GORYACHENKO ) using namespace std; const int maxn = 11e5; const int inf = 1e18; int n, m, k; int A[maxn]; int B[maxn]; int C[maxn]; int V[4 * maxn]; int T[4 * maxn]; inline void push(int v, int tl, int tr) { if (T[v] == 0) { return; ... |
#include <bits/stdc++.h> using namespace std; int main() { long long int i, j, k, m, n, a[100400], t, w, q, sum = 0; char s[105000]; long double x, y; cin >> q; for (j = 0; j < q; j++) { cin >> n; cin >> s; if (n > 2) { cout << YES << endl; cout << 2 << endl; ... |
// NeoGeo logic definition (simulation only)
// Copyright (C) 2018 Sean Gonsalves
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) an... |
/*
* Milkymist VJ SoC
* Copyright (C) 2007, 2008, 2009, 2010 Sebastien Bourdeauducq
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, version 3 of the License.
*
* This program is distri... |
#include<bits/stdc++.h> using namespace std; #define ll long long #define endl n #define pb push_back const ll INF=1e18+10; void solve() { ll n,m; cin>>n>>m; string s; cin>>s; string p=s; while(m--) { s=p; for(ll i=0;i<n;i++) { ... |
#include <bits/stdc++.h> using namespace std; const int maxn = 1005; typedef struct { int pre[maxn]; void init(int n) { for (int i = 0; i <= n + 1; ++i) pre[i] = i; } int find(int x) { if (x == pre[x]) return x; return pre[x] = find(pre[x]); } void merge(int x, int y) { p... |
//==================================================================================================
// Filename : RKOA_OPCHANGE.v
// Created On : 2016-10-24 22:49:36
// Last Modified : 2016-10-25 00:55:26
// Revision :
// Author : Jorge Sequeira Rojas
// Company : Instituto Tecnologico ... |
`default_nettype none
module serial_wb_mcu(
// System signals
clk_i, rst_i,
// Program memory address, instruction from program memory
pm_addr_o, pm_insn_i,
// Data port 0 and 1 (out)
port0_o,
port1_o,
strobe1_o,
// Data port 0 and 1 (in)
port2_i,
strobe2_o
);
in... |
#include <bits/stdc++.h> using namespace std; int n, ans = 0; int main() { cin >> n; for (int i = 1; i <= n; i++) for (int j = 1; j <= n; j++) { int x; cin >> x; if (i == j || (i + j) == (n + 1) || i == (n + 1) / 2 || j == (n + 1) / 2) ans += x; } cout << ... |
/**
* Copyright 2020 The SkyWater PDK Authors
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable la... |
#include <bits/stdc++.h> #include <stdio.h> using namespace std; typedef long long ll; typedef unsigned long long ul; #define len (int)1e5+5 #define mod (ll)(1e9+7) #define pq(a) priority_queue< a > #define pqd(b) priority_queue< b , vector< b > , greater< b >> #define MP make_pair #define v(i) v... |
#include <bits/stdc++.h> using namespace std; const int N = 1e5 + 10; char s[N]; int a[N], sta[N], tp; int main() { scanf( %s , s + 1); int n = strlen(s + 1); for (int i = 1; i <= n; ++i) if (s[i] == 0 ) { if (tp) a[sta[tp--]] = 1; } else sta[++tp] = i; for (int i ... |
// ***************************************************************************
// ***************************************************************************
// Copyright 2011(c) Analog Devices, Inc.
//
// All rights reserved.
//
// Redistribution and use in source and binary forms, with or without modification,
// are... |
//*****************************************************************************
// (c) Copyright 2009 - 2011 Xilinx, Inc. All rights reserved.
//
// This file contains confidential and proprietary information
// of Xilinx, Inc. and is protected under U.S. and
// international copyright and other intellectual property
/... |
// megafunction wizard: %LPM_MULT%VBB%
// GENERATION: STANDARD
// VERSION: WM1.0
// MODULE: lpm_mult
// ============================================================
// File Name: mult16_12.v
// Megafunction Name(s):
// lpm_mult
//
// Simulation Library Files(s):
// lpm
// ===========================... |
#include <bits/stdc++.h> using namespace std; int main() { int n; cin >> n; int A[n + 1], S[n + 1], S1[n + 3]; A[0] = 0; for (int i = 1; i <= n; i++) { cin >> A[i]; } S[0] = 0; for (int i = 1; i <= n; i++) { S[i] = S[i - 1] + A[i]; } string st; cin >> st; ... |
#include <bits/stdc++.h> using namespace std; long long n, ans, l; bool flag = 0; inline long long getLen(long long x) { long long cnt = 0; while (x) { cnt++; x /= 10; } return cnt; } inline long long getSum(long long x) { long long cnt = 0; while (x) { cnt += x % 1... |
#include <bits/stdc++.h> using namespace std; const long long LL_INF = (long long)2e18 + 5; struct point { long long x, y; point() : x(0), y(0) {} point(long long _x, long long _y) : x(_x), y(_y) {} }; struct reverse_monotonic_dp_hull { vector<point> points; int size() const { return (int)... |
/**
* Copyright 2020 The SkyWater PDK Authors
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable la... |
/*
* Milkymist VJ SoC
* Copyright (C) 2007, 2008, 2009 Sebastien Bourdeauducq
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, version 3 of the License.
*
* This program is distributed ... |
/*
* Copyright 2020 The SkyWater PDK Authors
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law... |
/**
* Copyright 2020 The SkyWater PDK Authors
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable la... |
/*
* Copyright 2020 The SkyWater PDK Authors
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law... |
#include <bits/stdc++.h> using namespace std; template <class A, class B> inline bool mina(A &first, B second) { return (first > second) ? (first = second, 1) : 0; } template <class A, class B> inline bool maxa(A &first, B second) { return (first < second) ? (first = second, 1) : 0; } map<char, ... |
#include <bits/stdc++.h> using namespace std; void Fast() { ios_base ::sync_with_stdio(0); cin.tie(0); cout.tie(0); } inline int RD() { int i; cin >> i; return i; } inline float RF() { float i; cin >> i; return i; } inline double RDO() { double i; cin >> i; ... |
// (C) 2001-2011 Altera Corporation. All rights reserved.
// Your use of Altera Corporation's design tools, logic functions and other
// software and tools, and its AMPP partner logic functions, and any output
// files any of the foregoing (including device programming or simulation
// files), and any associated doc... |
#include <bits/stdc++.h> using namespace std; inline void Boost() { ios::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL); } const int NMax = 1e6 + 50; string convert(const string &s) { string ret = @ ; for (int i = 0; i < (int)s.size(); ++i) { ret += # + s.substr(i, 1); ... |
#include <bits/stdc++.h> using namespace std; int dx[] = {0, 0, 1, -1}; int dy[] = {1, -1, 0, 0}; int dx8[] = {0, 0, 1, 1, 1, -1, -1, -1}; int dy8[] = {1, -1, -1, 0, 1, -1, 0, 1}; int kx8[] = {1, 1, 2, 2, -1, -1, -2, -2}; int ky8[] = {2, -2, 1, -1, 2, -2, 1, -1}; long long poww(long long a, long long b)... |
#include <bits/stdc++.h> using namespace std; struct node { double x, y; } g[500]; int main() { int i, j, k, n, m; scanf( %d , &n); for (i = 0; i < n; ++i) { scanf( %lf%lf , &g[i].x, &g[i].y); } double maxx = 0; double m1, m2; for (i = 0; i < n - 1; ++i) for (j = i + ... |
#include <bits/stdc++.h> using namespace std; const int mn = 201000, inf = 1 << 30; struct node { int x, y; } pt[mn], sub[mn]; struct point { int k, x, y, r; } e[mn * 2]; int s1[mn * 2], s2[mn * 2]; int xs[mn * 2], dis[mn], sa[mn], L; int n, m, i, j, step, lo, hi, mid; bool cmp(node a, node ... |
`timescale 1ns / 1ps
module ad5541a
(
input wire clk,
input wire rstn,
input wire [15:0] data,
input wire valid,
output wire ready,
output wire cs,
output wire din,
output wire ldac,
output wire sclk
);
localparam [... |
#include <bits/stdc++.h> using namespace std; using ll = long long; using ii = pair<int, int>; using vi = vector<int>; using vll = vector<long long>; using vii = vector<pair<int, int>>; int main() { int n, m; scanf( %d%d , &n, &m); vector<tuple<int, int, int>> ve; for (int i = 0; i < m; i+... |
#include <bits/stdc++.h> using namespace std; const int Hash = 743; const int Mod = 51123987; int powh[2000005], N, h1[2000005], h2[2000005], start[2000005], finish[2000005], a[2000005], b[2000005]; char s[2000005]; int getsub1(int lo, int hi) { return lo == 0 ? h1[hi] : h1[hi] - h1[lo - 1] * powh... |
// Accellera Standard V2.5 Open Verification Library (OVL).
// Accellera Copyright (c) 2005-2010. All rights reserved.
`include "std_ovl_defines.h"
`module ovl_decrement (clock, reset, enable, test_expr, fire);
parameter severity_level = `OVL_SEVERITY_DEFAULT;
parameter width = 1;
parameter value ... |
/**
* Copyright 2020 The SkyWater PDK Authors
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable la... |
// Accellera Standard V2.5 Open Verification Library (OVL).
// Accellera Copyright (c) 2005-2010. All rights reserved.
//------------------------------------------------------------------------------
// SHARED CODE
//------------------------------------------------------------------------------
// No shared code for ... |
// DESCRIPTION: Verilator: Verilog Test module
//
// Copyright 2010 by Wilson Snyder. This program is free software; you can
// redistribute it and/or modify it under the terms of either the GNU
// Lesser General Public License Version 3 or the Perl Artistic License
// Version 2.0.
// SPDX-License-Identifier: LGPL-3.0-... |
////////////////////////////////////////////////////////////////////////////////////
//
// pGB, yet another FPGA fully functional and super fun GB classic clone!
// Copyright (C) 2015-2016 Diego Valverde ()
//
// This program is free software; you can redistribute it and/or
// modify it under the terms of the GNU Gene... |
// MBT 7/7/2016
// DWP 11/27/2019
//
// 3 read-port, 1 write-port ram
//
// reads are synchronous
//
// although we could merge this with normal bsg_mem_1r1w
// and select with a parameter, we do not do this because
// it's typically a very big change to the instantiating code
// to move to/from sync/async, and we want... |
#include <bits/stdc++.h> using namespace std; int *a = new int[2000000]; int m, n; void add(int x, int l); void sub(int x, int l); int query(int x, int y, int x0, int y0, int t); int main() { int h, i, j, dir = 1, r, l, o, x, y, len, mid; cin >> n >> m; for (i = 0; i < 2000000; i++) a[i] = 0; ... |
#include<bits/stdc++.h> using namespace std; bool possible(int *arr, int n) { int s=0; s = accumulate(arr,arr+n,s); if(s%2) return false; bitset<2000000> b; b[0] = 1; for(int i=0;i<n;i++) b = b|(b<<arr[i]); return b[s/2]; } int main() { int n; cin>>n; int arr[n]... |
#include <bits/stdc++.h> using namespace std; template <typename T> int len(const T& a) { return a.size(); } using ll = long long; constexpr long double EPS = 1e-7; long double MaxSubarray(const vector<long double>& a) { long double best = -1e8; long double cur = 0.0; for (auto& i : a) { ... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.