text
stringlengths
59
71.4k
`define CYCLE_TIME 50 module TestBench; reg Clk; reg Reset; reg Start; integer i, outfile, counter; always #(`CYCLE_TIME/2) Clk = ~Clk; CPU CPU( .clk_i (Clk), .rst_i (Reset), .start_i(Start) ); initial begin counter = 0; ...
`timescale 1ps/1ps `default_nettype none (* DowngradeIPIdentifiedWarnings="yes" *) module axi_protocol_converter_v2_1_9_b2s_ar_channel # ( /////////////////////////////////////////////////////////////////////////////// // Parameter Definitions //////////////////////////////////////////////////////////////////////////...
#include <bits/stdc++.h> using namespace std; int main() { int n; cin >> n; cout << n << n ; for (int i = 0; i < n; i++) { cout << 1 << ; } cout << n ; }
#include <bits/stdc++.h> #pragma comment(linker, /STACK:256000000 ) using namespace std; const int INF = (1 << 29) + 5; const long long int LLINF = (1ll << 59) + 5; const int MOD = 1000 * 1000 * 1000 + 7; int n, q; pair<string, string> arr[228]; map<string, bool> can; queue<string> now; int main() ...
#include <bits/stdc++.h> using namespace std; int r, g, j, f[200001], sc, kq, mod = round(1e9) + 7; long long i, h; int main() { cin >> r >> g; f[0] = 1; for (i = 1; i * (i + 1) / 2 <= r + g; i++) { for (j = r; j >= 0; j--) { if (j >= i) f[j] = (f[j] + f[j - i]) % mod; } } ...
#include <bits/stdc++.h> using namespace std; int n, m; int a[1000005], dp1[1000005], dp2[1000005], dp3[1000005]; long long ans; int main(int argc, const char* argv[]) { ios_base::sync_with_stdio(false); cin.tie(0); cout.tie(0); cin >> n >> m; for (int i = 1; i <= n; ++i) cin >> a[i]; ...
/* * Copyright 2012, 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 ...
// ------------------------------------------------------------- // // Generated Architecture Declaration for rtl of ent_ad // // Generated // by: wig // on: Tue Jun 27 05:12:12 2006 // cmd: /cygdrive/h/work/eclipse/MIX/mix_0.pl ../verilog.xls // // !!! Do not edit this file! Autogenerated by MIX !!! // $Author: w...
/** * 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; inline long long read() { long long x = 0; int ch = getchar(), f = 1; while (!isdigit(ch) && (ch != - ) && (ch != EOF)) ch = getchar(); if (ch == - ) { f = -1; ch = getchar(); } while (isdigit(ch)) { x = (x << 1) + (x << 3) + ...
#include <bits/stdc++.h> using namespace std; const long double CHANGE = 1e-8; template <class c> struct rge { c b, e; }; template <class c> rge<c> range(c i, c j) { return rge<c>{i, j}; } template <class c> auto dud(c* x) -> decltype(cerr << *x, 0); template <class c> char dud(...); s...
/* * Copyright 2012, 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; long long n, k, i, j, a[2 * 100010]; vector<char> ans; int main() { cin >> n; for (int i = 1; i <= n; i++) { cin >> a[i]; } long long l = 1, r = n, f = -1e18; while (l <= r) { if (f >= a[l] && f >= a[r]) break; if (a[l] <= f && ...
#include <bits/stdc++.h> using namespace std; const int N = 2e5 + 7; vector<pair<int, int> > v[N]; int n, m; int foo, bar, id; long long val[N]; long long wt[N]; int dep[N]; int dp[20][N]; int par[N]; int x1[N]; int x2[N]; void dfs(int node, int baap) { dep[node] = dep[baap] + 1; dp[0]...
// (C) 2001-2016 Intel Corporation. All rights reserved. // Your use of Intel 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 docum...
#include <bits/stdc++.h> using namespace std; const long long INF = 2000000000LL; int main() { int m1, m2, m3, m4, m5; int w1, w2, w3, w4, w5; int hs, hu; int sum; cin >> m1 >> m2 >> m3 >> m4 >> m5; cin >> w1 >> w2 >> w3 >> w4 >> w5; cin >> hs >> hu; sum = max(150, 500 - 2 * m1 - 5...
#include <bits/stdc++.h> using namespace std; int n, p[11111], c[11111]; vector<pair<int, int> > ve; int main() { int a; cin >> n; for (int i = 2; i <= n; i++) { cin >> a; c[i] = a; } int s = 1; cin >> p[1]; for (int i = 2; i <= n; i++) { cin >> p[i]; if (p[i]...
#include <bits/stdc++.h> using namespace std; int n, k, f[33]; double ans = 0; vector<int> v[33]; string s; template <class T> ostream& operator<<(ostream& out, vector<T> v) { out << v.size() << n ; for (auto e : v) out << e << ; return out; } double check(int k) { double ans = 0,...
#include <bits/stdc++.h> using namespace std; long long n, m, k, x, s, a[200005], b[200005], c[200005], d[200005], ans; int bfind(int t) { int lo = 0, hi = k - 1, mid; while (lo < hi) { mid = lo + (hi - lo + 1) / 2; if (d[mid] > t) hi = mid - 1; else lo = mid; } r...
#include <bits/stdc++.h> using namespace std; vector<long long> st; long long n, q; vector<int> swp(20, false); vector<long long> arr; void build(long long ind, long long l, long long r) { if (l == r) { st[ind] = arr[l]; return; } long long mid = (l + r) >> 1; build(2 * ind, l, m...
/** * 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 <typename T, typename U> inline void smin(T &a, const U &b) { if (a > b) a = b; } template <typename T, typename U> inline void smax(T &a, const U &b) { if (a < b) a = b; } template <class T> inline void gn(T &first) { char c, sg = 0; ...
#include <bits/stdc++.h> using namespace std; int main() { int n, m; cin >> n >> m; int t[n]; for (int i = 0; i < n; i++) { cin >> t[i]; } if (n == 1) { cout << m - t[0]; return 0; } int ans = 0; for (int k = 0; k < n * n * n; k++) { set<int> st; for...
// Copyright 1986-2015 Xilinx, Inc. All Rights Reserved. // -------------------------------------------------------------------------------- // Tool Version: Vivado v.2015.4 (lin64) Build Wed Nov 18 09:44:32 MST 2015 // Date : Mon Aug 29 03:22:14 2016 // Host : fpgaserv running 64-bit Ubuntu 14.04.4 LTS ...
#include <bits/stdc++.h> using namespace std; int main() { int n, m, i, j; string ss; cin >> n >> m >> ss; for (i = 0; i < m; i++) { for (j = 0; j < n; j++) { if (ss[j] == B && ss[j + 1] == G ) { ss[j] = G ; ss[j + 1] = B ; j++; } } ...
module lsu_wb_router (/*AUTOARG*/ // Outputs out_sgpr_dest_addr, out_sgpr_dest_data, out_sgpr_dest_wr_en, out_sgpr_instr_done, out_sgpr_instr_done_wfid, out_vgpr_dest_addr, out_vgpr_dest_data, out_vgpr_dest_wr_en, out_vgpr_dest_wr_mask, out_vgpr_instr_done, out_vgpr_instr_done_wfid, out_tracemon_reti...
#include <bits/stdc++.h> using namespace std; struct per { string name; int score; } store[55]; bool cmp(per a, per b) { return a.score > b.score; } int main() { int n, tmp; cin >> n; for (int i = 0; i < n; i++) { cin >> store[i].name; cin >> tmp; store[i].score = 0; ...
#include <bits/stdc++.h> using namespace std; template <class T> void Max(T &a, T b) { if (b > a) a = b; } template <class T> void Min(T &a, T b) { if (b < a) a = b; } template <class T> T gcd(T a, T b) { return b ? gcd(b, a % b) : a; } int main() { ios::sync_with_stdio(false); ...
#include <bits/stdc++.h> using namespace std; struct line { int l, r; } p[510], q[510]; struct Point { long double x, y; } Q[10], tmp[10]; int vis[10]; long double A, B, C; int n, H, F, tot, cnt; void read(int &x) { char ch = getchar(); int mark = 1; for (; ch != - && (ch < 0 |...
module knightrider ( clk, reset_, led); input clk; input reset_; output [7:0] led; // Goal is to change LED pattern roughly every 250ms. The Papilio Pro // clock runs at 32 MHz (32.25 ns period). If we increment a 21 bit counter // on each clock cycle, it will roll over approximatel...
/* * 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 ...
/* * 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 int N = 3e5 + 10; int a[N], n, l, r, ans; bool check(int k) { for (int i = 1; i <= n; ++i) { if (1LL * k * (i - 1) > a[i]) return false; if (1LL * k * (n - i) > a[i]) return false; } return true; } int main() { scanf( %d , &n); ...
#include <bits/stdc++.h> using namespace std; int n, m, f[1000010], a[1000010]; char s[1000010]; bool vis[1000010]; long long Pow(int x) { if (x < 0) return 0; if (x == 0) return 1; long long ans = Pow(x >> 1); ans = ans * ans % 1000000007ll; if (x & 1) ans = (ans * 26ll) % 1000000007ll; ...
#include <bits/stdc++.h> using namespace std; const int maxn = 1000000007; vector<int> rec[100008]; int dp[2][100008], a[100008]; int fun(int minn, int val) { int ll = 0, rr, ss = rec[val].size(); if (ss == 0) return maxn; else if (rec[val][0] >= minn) return rec[val][0] + 1; rr = ...
#include <bits/stdc++.h> using namespace std; const double pai = acos(-1); const double eps = 1e-8; const long long mod = 1e9 + 7; const int MXN = 1e6 + 5; vector<int> v[MXN]; int c[MXN]; int suf[MXN]; int main() { int n; cin >> n; for (int i = 1; i <= n; i++) { int le; scanf( ...
/** * 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 1986-2017 Xilinx, Inc. All Rights Reserved. // -------------------------------------------------------------------------------- // Tool Version: Vivado v.2017.3 (lin64) Build Wed Oct 4 19:58:07 MDT 2017 // Date : Tue Oct 17 19:51:15 2017 // Host : TacitMonolith running 64-bit Ubuntu 16.04.3...
/** * 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; int main() { int n, k; cin >> n >> k; string s; cin >> s; if (n == 1 && k == 1) { cout << 0 << endl; return 0; } if (s[0] != 1 && k) { k--; s[0] = 1 ; } for (int i = 1; i < n && k; i++) { if (s[i] !=...
#include <bits/stdc++.h> using namespace std; void solve() { long long a, b; cin >> a >> b; if (b - a > 5) { cout << 0 << n ; } else { long long val = 1; for (long long j = a + 1; j <= b; j++) { val *= (j % 10); val %= 10; } cout << val << n ; } ...
#include <bits/stdc++.h> using namespace std; void err(istream_iterator<string> it) {} template <typename T, typename... Args> void err(istream_iterator<string> it, T a, Args... args) { cerr << << *it << = << a; err(++it, args...); } template <typename T, typename U> inline void min_self(T...
// DESCRIPTION: Verilator: Verilog Test module // // This file ONLY is placed into the Public Domain, for any use, // without warranty, 2005 by Wilson Snyder. // // Example module to create problem. // // generate a 64 bit value with bits // [HighMaskSel_Bot : LowMaskSel_Bot ] = 1 // [HighMaskSel_Top+3...
/* * 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 law...
//############################################################################# //# Function: Carry Save Adder (4:2) # //############################################################################# //# Author: Andreas Olofsson # ...
#include <bits/stdc++.h> using namespace std; using ld = long double; using ll = long long; using pii = pair<int, int>; using pll = pair<ll, ll>; using vi = vector<int>; const int oo = 1e9 + 7; const ll loo = 1e18; ll modpow(ll a, ll b) { ll res = 1; while (b) { if (b & 1) res = res * a ...
#include <bits/stdc++.h> using namespace std; int shi(int a[], int k, int len) { int s = 0, j; for (j = len - 1; j >= 0; j--) { s = s * k + a[j]; } return s; } int bian(int n, int k) { int i; for (i = 0; n > 0; i++) { n /= k; } return i; } int change(int a[1000], ...
#include <bits/stdc++.h> using namespace std; const int MAXN = 2500 + 10; int n; pair<int, int> p[MAXN]; pair<int, int> sec[MAXN]; int sz; int half(pair<int, int> p) { assert(p.first || p.second); return p.second > 0 || (p.second == 0 && p.first < 0); } long long dot(pair<int, int> a, pair<int...
// DESCRIPTION: Verilator: Unsupported tristate construct error // // This is a compile only regression test of tristate handling for bug514 // // This file ONLY is placed into the Public Domain, for any use, // without warranty, 2017 by Rob Stoddard. // SPDX-License-Identifier: CC0-1.0 module t (/*AUTOARG*/ // Out...
#include <bits/stdc++.h> using namespace std; long long M = 1000000007; signed main() { long long t; cin >> t; for (long long u = 0; u < t; u++) { long long k = 0; vector<long long> v; string s; cin >> s; for (long long i = 0; i < s.size(); i++) { if (i + 4 < s.si...
#include <bits/stdc++.h> using namespace std; int euclid(int a, int b, int &x, int &y) { if (!a) { x = 0; y = 1; return b; } int _x, _y; int g = euclid(b % a, a, _x, _y); x = _y - b / a * _x; y = _x; return g; } void relax(int &obj, int C3, int C4, int C5, int _k3, ...
//------------------------------------------------------------------------------ // The confidential and proprietary information contained in this file may // only be used by a person authorised under and to the extent permitted // by a subsisting licensing agreement from ARM Limited. // // (C) COPYRIGHT 201...
#include <bits/stdc++.h> using namespace std; const int maxn = 1e5 + 10; const int INF = 0x3f3f3f3f; int a[110][110]; int dp[100][2]; const int M = 1e5 + 10; int vis[M], prime[M]; void prim() { memset(vis, 0, sizeof(vis)); memset(prime, 0, sizeof(prime)); int cun = 1; for (int i = 2; i <...
// -------------------------------------------------------------------- // ng_CTR.v - PRIORITY COUNTER // // Read Bus: (octal counter addr) // 34 = cntr 1 (OVCTR) // 35 = cntr 2 (TIME2) // 36 = cntr 3 (TIME1) // 37 = cntr 4 (TIME3) // 40 = cntr 5 (TIME4) // // SB2 SB1 // 0 0 no counter or PINC ...
#include <bits/stdc++.h> using namespace std; int f; vector<string> cur; void upd(string s, int x, int y, int o) { int dx = 0, dy = 1; if (o) swap(dx, dy); for (int i = 0; i < s.size(); i++) { int xx = x + dx * i; int yy = y + dy * i; if (cur[xx][yy] == . || cur[xx][yy] == s[i]) ...
`include "logfunc.h" // FAST 2 port SRAM: // // Fast means 1 cycle read/write // // Max total bits is 1Kbytes (Size*Width) // // Size must be between 8 and 64 // (anything smaller is not worth it in SRAM, but OK) // module ram_2port_fast #(parameter Width = 64, Size=128, Forward=0) ( input ...
#include <bits/stdc++.h> using namespace std; long long dp[1001][2 * 1001][2]; long long MOD = 998244353; int main() { ios_base::sync_with_stdio(false); int n, k; cin >> n >> k; dp[1][1][0] = 2; dp[1][2][0] = 0; dp[1][1][1] = 0; dp[1][2][1] = 2; for (int i = 2; i <= n; ++i) { ...
#include <bits/stdc++.h> using namespace std; struct Data { long long l, r; } a[200100]; long long n, s, rmax, lmin; void Docfile() { scanf( %lld%lld , &n, &s); rmax = 0; lmin = 1e18; for (int i = 1; i <= n; i++) { scanf( %lld%lld , &a[i].l, &a[i].r); rmax = max(rmax, a[i].r); ...
#include <bits/stdc++.h> #pragma GCC optimize( O3 ) using namespace std; template <class T> using pq = priority_queue<T>; template <class T> using pqg = priority_queue<T, vector<T>, greater<T>>; int scan() { return getchar(); } template <class T> void scan(T a) { cin >> a; } void scan(int &a) ...
/* * 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...
// File : ../RTL/serialInterfaceEngine/siereceiver.v // Generated : 11/10/06 05:37:23 // From : ../RTL/serialInterfaceEngine/siereceiver.asf // By : FSM2VHDL ver. 5.0.0.9 ////////////////////////////////////////////////////////////////////// //// ...
// -*- verilog -*- // // USRP - Universal Software Radio Peripheral // // Copyright (C) 2007 Corgan Enterprises LLC // // 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 2 of...
//************************************************************************* // > ÎļþÃû: alu_display.v // > ÃèÊö £ºALUÏÔʾģ¿é£¬µ÷ÓÃFPGA°åÉϵÄIO½Ó¿ÚºÍ´¥ÃþÆÁ // > ×÷Õß : LOONGSON // > ÈÕÆÚ : 2016-04-14 //************************************************************************* module alu_display( //ʱÖÓÓë...
/////////////////////////////////////////////////////////////////////////////// // Copyright (c) 1995/2016 Xilinx, Inc. // // 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 // //...
/*********************************************************************** AVR ATtX5 CPU for Lattuino This file is part FPGA Libre project http://fpgalibre.sf.net/ Description: This module implements the CPU for Lattuino (iCE40HX1K Lattice FPGA available in the iCE Stick board). To Do: - Author: ...
// (c) Copyright 1995-2014 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 // laws. // // DISCLAIMER // This disclaimer is not a license and does not grant ...
// DESCRIPTION: Verilator: Verilog Test module // // This file ONLY is placed into the Public Domain, for any use, // without warranty, 2017 by Wilson Snyder. module t (/*AUTOARG*/); initial begin $display("Merge:"); $write("This "); $write("should "); $display("merge"); $display("f")...
#include <bits/stdc++.h> char c[301][301]; int n, m, k; int v[5][2] = {{0, 0}, {-1, 0}, {1, 0}, {0, -1}, {0, 1}}; void read() { scanf( %d %d %d , &n, &m, &k); for (int i = 0; i < n; i++) scanf( %s , &c[i]); } void print(int i, int j, int r) { for (int z = 0; z < 5; z++) printf( %d %d n , i...
// (C) 2001-2016 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; const int N = 5004; int main() { int a = 1, b = 1, n; string s; cin >> n; while (n--) { cin >> s; if (s == UL || s == DR ) ++a; else if (s.size() == 2) ++b; else ++a, ++b; } printf( %lld n , 1l...
/** * 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...
// DESCRIPTION: Verilator: System Verilog test of a complete CPU // // This code instantiates and runs a simple CPU written in System Verilog. // // This file ONLY is placed into the Public Domain, for any use, without // warranty. // SPDX-License-Identifier: CC0-1.0 // Contributed 2012 by M W Lund, Atmel Corporation ...
/** * This is written by Zhiyang Ong * and Andrew Mattheisen * for EE577b Troy WideWord Processor Project */ // Behavioral model for the 32-bit program counter module program_counter2a (next_pc,rst,clk); // Output signals... // Incremented value of the program counter output [0:31] next_pc; // ======...
/** * 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; map<int, int> m; int main() { int a, t, n, i, j, k, l, mn = INT_MAX, mx = 0; cin >> n >> k; int cnt = 0; int ans = 0; for (int i = 0; i < n; i++) { cin >> a; mn = min(mn, a); m[a]++; } int p = mn; while (p < k) { ...
/* * 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 Header Begin ========================================== // // OpenSPARC T1 Processor File: ctu_clsp_clkgn_ddiv.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 ...
//------------------------------------------------------------------- // // COPYRIGHT (C) 2013, VIPcore Group, Fudan University // // THIS FILE MAY NOT BE MODIFIED OR REDISTRIBUTED WITHOUT THE // EXPRESSED WRITTEN CONSENT OF VIPcore Group // // VIPcore : http://soc.fudan.edu.cn/vip // IP Owner : Yibo FA...
#include <bits/stdc++.h> struct Widget { std::string name; long long width, height; Widget(const std::string& name, long long width, long long height) : name(name), width(width), height(height) {} ~Widget() {} virtual void calculateSize() {} }; struct Box : public Widget { int spac...
//----------------------------------------------------------------------------- // Copyright (C) 2014 iZsh <izsh at fail0verflow.com> // // This code is licensed to you under the terms of the GNU GPL, version 2 or, // at your option, any later version. See the LICENSE.txt file for the text of // the license. //--------...
#include <bits/stdc++.h> using namespace std; const int N = 5001; int n, k, a[N * 60]; long long dp[N][N]; int main() { scanf( %d%d , &n, &k); for (int i = 0; i < n; i++) scanf( %d , a + i); sort(a, a + n); for (int i = 0; i < N; i++) for (int j = 0; j < N; j++) dp[i][j] = 5e18; dp[k...
#include <bits/stdc++.h> using namespace std; using ll = long long; using ii = pair<int, int>; const int MOD(1e9 + 7); const int MAXN(1e5 + 11); int n, first, z, a, l; int main() { scanf( %d%d%d%d%d , &n, &first, &z, &a, &l); int ans = 0; for (int ptr = 0; ptr < n;) { if (ptr) pt...
#include <bits/stdc++.h> using namespace std; inline void read(int &first) { first = 0; while (1) { char ch = getchar(); if (ch == || ch == n ) break; first = first * 10 + ch - 0 ; } } inline void write(int first) { char wr[12]; int k = 0; if (!first) ++k, wr[k] ...
#include <bits/stdc++.h> using namespace std; const long long int mxn = 1e5 + 5; int main() { ios_base::sync_with_stdio(false); cin.tie(NULL); long long int t = 1; cin >> t; while (t--) { long long int i, j, k, n, m; cin >> n >> k; string s; cin >> s; map<long lon...
#include <bits/stdc++.h> using namespace std; int n, m, s; long long ans = 0; int main() { int i, j, k; int a1, b1, a2, b2; int x1, y1, x2, y2; int p1, p2; cin >> n >> m >> s; for (i = 0; i <= n / 2; i++) { for (j = 0; j <= m / 2; j++) { for (k = 0; k <= n / 2; k++) { ...
// ============================================================== // File generated by Vivado(TM) HLS - High-Level Synthesis from C, C++ and SystemC // Version: 2014.4 // Copyright (C) 2014 Xilinx Inc. All rights reserved. // // ============================================================== `timescale 1ns/1p...
/* * Copyright 2015, Stephen A. Rodgers. 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 Foundation; either version 2 of the License, or * (at your option) any later version...
// Copyright 1986-2015 Xilinx, Inc. All Rights Reserved. // -------------------------------------------------------------------------------- // Tool Version: Vivado v.2015.1 (win64) Build Mon Apr 27 19:22:08 MDT 2015 // Date : Sun Mar 13 09:23:31 2016 // Host : DESKTOP-5FTSDRT running 64-bit major releas...
/** * 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...
`timescale 1ns / 1ps //////////////////////////////////////////////////////////////////////////////// // Company: // Engineer: // // Create Date: 17:58:48 11/16/2011 // Design Name: toprobertsons // Module Name: /home/ECONOLITE/lmagasweran/Documents/personal/School/EE412/Robertsons_Multiplier/robertsonstest.v //...
// file: design_1_clk_wiz_0_0.v // // (c) Copyright 2008 - 2013 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 // laws. // // DISCLAIMER // This disclaime...
/* * 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...
// DESCRIPTION: Verilator: Verilog Test module // This file ONLY is placed under the Creative Commons Public Domain, for // any use, without warranty, 2020 by Wilson Snyder. // SPDX-License-Identifier: CC0-1.0 `define CONCAT(a,b) a``b `define SHOW_LINED `CONCAT(show, `__LINE__) bit fails; module t (/*AUTOARG*/ //...
#include <bits/stdc++.h> using namespace std; bool is_possible(int m, long long k, long long p[], int n, int x, int a, int y, int b) { if (a != b) { int first = 0; int second = 0; int third = 0; for (int i = 1; i <= m; i++) { if (i % a == 0 && i % b == 0) ...
#include <bits/stdc++.h> using namespace std; const int MXN = 200; const int MXK = 5; int bans = -1; int t[MXN][MXK]; int a[MXK]; int n; int c[MXK]; int cc[] = {500, 1000, 1500, 2000, 2500, 3000}; int cat(int c, int n) { if (c * 2 > n) { return 0; } if (c * 4 > n && c * 2 <= n) { ...
#include <bits/stdc++.h> #define ll long long #define ull unsigned long long #define vll vector<ll> using namespace std; inline void sol() { ll n, m; cin >> n >> m; vll a(n); for(ll i=0;i<n;i++){ cin >> a[i]; } vector<pair<int,double>> b(m); for(int i=0;i<m;i++){ int r;...
#include <bits/stdc++.h> using namespace std; string itosm(long long x) { if (x == 0) return 0 ; string ans = ; while (x > 0) { ans += ((x % 10) + 0 ); x /= 10; } reverse(ans.begin(), ans.end()); return ans; } long long stoim(string str) { long long ans = 0; long ...