text
stringlengths
59
71.4k
// Accellera Standard V2.5 Open Verification Library (OVL). // Accellera Copyright (c) 2005-2010. All rights reserved. `include "std_ovl_defines.h" `module ovl_one_cold (clock, reset, enable, test_expr, fire); parameter severity_level = `OVL_SEVERITY_DEFAULT; parameter width = 32; parameter inactive ...
// Copyright 1986-2018 Xilinx, Inc. All Rights Reserved. // -------------------------------------------------------------------------------- // Tool Version: Vivado v.2018.2 (win64) Build Thu Jun 14 20:03:12 MDT 2018 // Date : Mon Sep 16 05:33:33 2019 // Host : varun-laptop running 64-bit Service Pac...
#include <bits/stdc++.h> using namespace std; const int maxn = 400007; int n, I, cnt = 0, ret = -1; int a[maxn], s[maxn]; int ck() { int ans = 1; for (int i = 1; i <= 8 * I / n; ++i) { ans *= 2; if (ans > cnt) return -1; } return ans; } int main() { scanf( %d%d , &n, &I); ...
#include <bits/stdc++.h> using namespace std; int main() { ios_base::sync_with_stdio(false); cin.tie(NULL); int t; cin >> t; while (t--) { int n, m; cin >> n >> m; int sum = 0; for (int i = 0; i < n; i++) { int a; cin >> a; sum += a; } ...
#include <bits/stdc++.h> using namespace std; int main() { int n, x; cin >> n >> x; if (n == 3) { cout << >vv << endl << ^<. << endl << ^.< << endl; cout << 1 << << 3; } if (n == 5) { cout << >...v << endl << v.<.. << endl << ..^.. << endl ...
/* * 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...
module adc_interface ( input CLK, input CLK_1M, //processor interface input [31:0] DATA_IN, output [31:0] DATA_OUT, input WR, ...
/* * .--------------. .----------------. .------------. * | .------------. | .--------------. | .----------. | * | | ____ ____ | | | ____ ____ | | | ______ | | * | ||_ || _|| | ||_ \ / _||...
/* * 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...
// (c) Copyright 1995-2017 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 ...
// ========== Copyright Header Begin ========================================== // // OpenSPARC T1 Processor File: bw_ioslave_dl.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 and...
/* * Copyright (c) 2000 Stephen Williams () * * This source code is free software; you can redistribute it * and/or modify it in source code form 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) * ...
#include <bits/stdc++.h> using namespace std; int main(int argc, char** argv) { int n, k; scanf( %d %d , &n, &k); if (k > n * 3) { printf( %d , 0); } else { printf( %d , 3 * n - k); } return 0; }
#include <bits/stdc++.h> using namespace std; long double PI = acosl(-1); bool compare_int(int a, int b) { return (a > b); } bool compare_string(string a, string b) { return a.size() < b.size(); } bool compare_pair(const pair<int, int> &a, const pair<int, int> &b) { if (a.second == b.second) return ...
#include <bits/stdc++.h> using namespace std; int main() { int t, n, counter, a, b, c; cin >> t; while (t--) { cin >> a >> b >> c; counter = 0; while (++counter) { (a < b) ? a += b : b += a; if (max(a, b) > c) break; } cout << counter << endl; } }
#include <bits/stdc++.h> using namespace std; int main() { int a, b, c, d, e, f; cin >> a >> b >> c >> d >> e >> f; cout << (a + b + c) * (a + b + c) - (a * a + c * c + e * e); }
#include <bits/stdc++.h> using namespace std; const int MOD = 1e9 + 7; const long long MX = 1e9; const long long INF = 1e9; void solve() { string s; cin >> s; int n = s.length(), mx[n + 1], c = 0; for (int i = 0; i < s.length(); ++i) { if (s[i] == 1 ) ++c; else if (c) ...
/* * 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 2011 Ettus Research 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 3 of the License, or // (at your option) any later version. // // This program is dis...
#include <bits/stdc++.h> using namespace std; void solve() { int n, k; cin >> n >> k; int ans = n; if (k >= n) { cout << 1; } else { for (int i = 2; i <= sqrt(n); i++) { if (n % i == 0) { if (i <= k) { ans = min(ans, n / i); } if (n /...
#include <bits/stdc++.h> using namespace std; int main() { long long int n, k, l, mx = 0, m, i, j, s = 0; cin >> n >> k; long long int a[n], t[n], sum[n], dv[n]; for (i = 0; i < n; i++) { cin >> a[i]; s += a[i]; dv[i] = s; } s = 0; for (i = 0; i < n; i++) { cin >>...
#include <bits/stdc++.h> using namespace std; int main() { int n; cin >> n; if (n % 2 == 0) { cout << -1; } else { for (int i = 0; i < n; i++) { cout << (2 * i) % n << ; } cout << endl; cout << 0 << ; for (int i = n - 1; i > 0; i--) { cout <<...
// (C) 2001-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 doc...
/* * Milkymist SoC * Copyright (C) 2007, 2008, 2009, 2010, 2011 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 dis...
module compressor2(a,b,s,c); parameter width = 0; input [width-1:0] a; input [width-1:0] b; output [width-1:0] s; output [width-1:0] c; assign s = a ^ b; assign c = a & b; endmodule // compressor2 module counter(clk,ld,nb,dn); parameter width = 0; input clk; input ld; input [width...
#include <bits/stdc++.h> using namespace std; int main() { long long t, i = 0, j, k, x, y, z, count = 0, p, flag = 0, ans = 0, sum = 0, l, n, m, max1, min1, pos, tmp, q; t = 1; while (t--) { long long n, r; scanf( %lld%lld , &n, &r); long double x[1005], y[1005]; ...
/** * 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; long long paw[30]; void pw() { paw[0] = 1; for (int i = 1; i < 20; i++) paw[i] = 10 * paw[i - 1]; } long long rev(long long a) { long long ret = 0; vector<int> v; while (a > 0) { v.push_back(a % 10); a /= 10; } for (int i = ...
#include <bits/stdc++.h> using namespace std; const int maxn = 8e4 + 10; const long long mod = 998244353, modg = 3, modi = 332748118; int a[maxn], b[maxn]; int pow_mod(int a, int b) { int ans = 1; while (b) { if (b & 1) ans = (long long)ans * a % mod; a = (long long)a * a % mod, b >>= 1; ...
#include <bits/stdc++.h> using namespace std; const double pi = acos(-1.0); const double eps = 1e-11; long long n, k; bool solveIt(long long d1, long long d2) { if ((k - d1 + d2) % 3 != 0) return false; long long Y = (k - d1 + d2) / 3; long long X = d1 + Y; long long Z = Y - d2; if (X >= 0...
#include <bits/stdc++.h> int main() { int n(0); scanf( %d , &n); char first = x , last = y ; int count(0); if (n % 2 == 0) { for (int k = 0; k < n / 2; k++) { printf( %c%c , (count) % 2 + a , (count) % 2 + a ); ++count; }; puts( ); for (int k = 0; k < n...
// // Copyright 2011, Kevin Lindsey // See LICENSE file for licensing information // module pram_sram_top( input wire clk, input wire button, output wire [6:0] a_to_g, output wire [3:0] an, output wire [6:0] a_to_g2, output wire [3:0] an2, output reg good, output reg bad, output wire [1:0] hi_addr, output wi...
// ---------------------------------------------------------------------- // Copyright (c) 2016, 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> int main() { int n; scanf( %d , &n); int a[n]; for (int i = 0; i < n; ++i) { scanf( %d , &a[i]); } int temp1, temp2, flag = 0; for (int i = 0; i < n; ++i) { temp1 = a[i] - 1; temp2 = a[temp1] - 1; if (a[temp2] - 1 == i) { flag = 1; ...
/* * 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...
`timescale 1ns / 1ps `include "hal/WcaPortDefs.h" //grab register addresses. // Name: WcaPortRead.v // // Copyright(c) 2013 Loctronix Corporation // http://www.loctronix.com // // This program is free software; you can redistribute it and/or // modify it under the terms of the GNU General Public License // ...
//bug906 import gmcupkg::*; module gminstdecode ( output instClassType instClass /*blah blah blah*/); always_comb begin /*AUTORESET*/ if (ldBitFromIo | stBitToIo) begin instClass.isBool = 1'b1; instClass.iFunc = IFUNC_BOOL; instClass.sub.bool = 1'b1; instClass.sub2.sub3.bool = 1'b1; ...
#include <bits/stdc++.h> using namespace std; long long dp[1 << 18][100], d, f[20]; int main() { int m, l, n, i, j, k, c[10]; char a[20]; memset(c, 0, sizeof(c)); for (f[0] = 1, i = 1; i < 20; i++) f[i] = f[i - 1] * i; scanf( %s%d , a, &m); l = strlen(a), n = 1 << l; for (i = 0; i < l;...
#include <bits/stdc++.h> using namespace std; void solve() { long long n, i, s = 0; cin >> n; long long a[n]; for (i = 0; i < n; i++) { cin >> a[i]; } s = s + a[0]; for (i = 1; i < n; i++) { if (a[i] != 1) { s = s + i * (a[i] - 1) + a[i]; } else { s = s ...
#include <bits/stdc++.h> using namespace std; int main() { std::ios_base::sync_with_stdio(false); cin.tie(0); cout.tie(0); long long t = 1; while (t--) { long long n, i, j = 0, x; cin >> n; string s = ; stack<long long> q; deque<long long> d; for (i = 0; i <...
//Copyright 1986-2017 Xilinx, Inc. All Rights Reserved. //-------------------------------------------------------------------------------- //Tool Version: Vivado v.2017.4.1 (win64) Build Tue Jan 30 15:32:00 MST 2018 //Date : Thu Apr 5 01:26:30 2018 //Host : varun-laptop running 64-bit Service Pack 1 (b...
#include <bits/stdc++.h> using namespace std; template <typename T> void read(T &x) { x = 0; char ch = getchar(); long long fh = 1; while (ch < 0 || ch > 9 ) { if (ch == - ) fh = -1; ch = getchar(); } while (ch >= 0 && ch <= 9 ) x = x * 10 + ch - 0 , ch = getchar(); ...
#include <bits/stdc++.h> using namespace std; void fnc() { int n; cin >> n; cout << n << endl; for (int i = 0; i < n; i++) cout << i + 1 << ; cout << endl; } int main() { int n; cin >> n; for (int i = 0; i < n; i++) fnc(); }
/* * 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...
/*============================================================================ This Verilog source file is part of the Berkeley HardFloat IEEE Floating-Point Arithmetic Package, Release 1, by John R. Hauser. Copyright 2019 The Regents of the University of California. All rights reserved. Redistribution an...
#include <bits/stdc++.h> using namespace std; template <typename flow_t, typename cost_t> struct min_cost_flow { const cost_t COST_INF = numeric_limits<cost_t>::max() / 2; struct edge { int node, rev; flow_t capacity; cost_t cost; edge() {} edge(int _node, int _rev, flow_t _c...
#include <bits/stdc++.h> #pragma hdrstop using namespace std; void rot(int n, int *x, int *y, int rx, int ry); int xy2d(int n, int x, int y) { int rx, ry, s, d = 0; for (s = n / 2; s > 0; s /= 2) { rx = (x & s) > 0; ry = (y & s) > 0; d += s * s * ((3 * rx) ^ ry); rot(s, &x, &y, r...
/** * 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; using ll = long long int; int gcd(int n, int m) { if (m == 0) return n; return gcd(m, n % m); } int lcm(int n, int m) { return n * m / gcd(n, m); } ll fact(ll n) { if (n == 1 or n == 0) return 1; else return ((n % 1000000007) * (fact(...
//----------------------------------------------------------------------------- // 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 = 1e5 + 5; const long long INF = 1e9 + 5; const long long mod = 1e9 + 7; const double pi = 3.1415926536; int main() { ios::sync_with_stdio(0); cin.tie(0); ios_base::sync_with_stdio(0); ; int n, m; cin >> n >> m; bool valid...
#include <bits/stdc++.h> using namespace std; inline int toInt(string s) { int v; istringstream sin(s); sin >> v; return v; } template <class T> inline string toString(T x) { ostringstream sout; sout << x; return sout.str(); } template <class T> inline T sqr(T x) { return...
module DecodeUnitRegisterOne( input CLK, One_A_IN, One_B_IN, Two_A_IN, Two_B_IN, MW_One_IN, MW_Two_IN, input input_IN, wren_IN, input [2:0] writeAd_IN, input ADR_MUX_IN, write_IN, PC_load_IN, input SPR_w_IN, SPR_i_IN, SPR_d_IN, input [2:0] cond_IN, op2_IN, input SW_IN, MAD_MUX_IN, FLAG_WRITE...
/* * Arithmetic Logic Unit for Zet * Copyright (C) 2008-2010 Zeus Gomez Marmolejo <> * * This file is part of the Zet processor. This processor is free * hardware; you can redistribute it and/or modify it under the terms of * the GNU General Public License as published by the Free Software * Foundation; e...
module rfa(/*AUTOARG*/ // Outputs simd0_queue_entry_serviced, simd1_queue_entry_serviced, simd2_queue_entry_serviced, simd3_queue_entry_serviced, simf0_queue_entry_serviced, simf1_queue_entry_serviced, simf2_queue_entry_serviced, simf3_queue_entry_serviced, execvgprsgpr_select_fu, //**CHANGE [PSP] ...
#include <bits/stdc++.h> using namespace std; int main() { ios::sync_with_stdio(false); long long T, n, k; cin >> T; for (int i = 0; i < T; i++) { cin >> n >> k; cout << k * 2 << n ; } }
#include <bits/stdc++.h> using namespace std; int main() { int m, n, k, l = 9999, j = 9999, s, i; cin >> n >> m >> k; int a[n + 3]; for (i = 1; i <= n; i++) cin >> a[i]; for (i = m + 1; i <= n; i++) { if (a[i] != 0 && a[i] <= k) { l = (i - m); break; } } for (...
/* * 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...
//----------------------------------------------------------------------------- // The FPGA is responsible for interfacing between the A/D, the coil drivers, // and the ARM. In the low-frequency modes it passes the data straight // through, so that the ARM gets raw A/D samples over the SSP. In the high- // frequency mo...
#include <bits/stdc++.h> using namespace std; char s[100005]; int main() { int n; while (cin >> n) { scanf( %s , s); int ct = 1, n = strlen(s); bool ok = false; int cant = 0, ans = 0; for (int i = 1; i < n; i++) { if (s[i] == s[i - 1]) ct++; else { ...
module barrel #(parameter width=16) (input [width-1:0] in, input [$clog2(width)-1:0] ct, input dir, input [1:0] type, output [width-1:0] out); /* direct inputs = f */ /* shifted inputs = g */ /* mux outputs = h */ wire [width-1:0] f[$clog2(width)-1:0], g[$clog2(width)-1:0], h[$clog2(width):0]; assi...
/*------------------------------------------------------------------------------ * 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...
/** * 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...
`timescale 1ns / 1ps /******************************************************************************* * Engineer: Robin zhang * Create Date: 2016.09.10 * Module Name: spi_slave_b2b * this module will get 64 bytes and then return the count 64 at next clks *************************************************************...
#include <bits/stdc++.h> using namespace std; int a[5000]; int main() { int n, k, l, r, s, sk; cin >> n >> k >> l >> r >> s >> sk; int d = s - sk; for (int i = 1; i <= k; i++) { a[i] = sk / k; if (sk % k != 0) { a[i]++; sk--; } } if (k != n) { for (i...
#include <bits/stdc++.h> int main() { int steps, count, i, n; char str[500]; char pc; scanf( %s , str); steps = count = 0; n = strlen(str); if (n == 0) { printf( 0 n ); return 0; } pc = str[0]; count = 1; for (i = 1; i < n; i++) { if (count == 5) { ...
#include <bits/stdc++.h> using namespace std; int dp[1002][20002]; int main() { ios_base::sync_with_stdio; int n, m, x, y, i, j, a; cin >> n; long long ans = 0; for (i = 1; i <= n; i++) { cin >> a; for (j = 0; j < a; j++) { dp[i][j] = dp[i - 1][j + a]; } for (j ...
#include <bits/stdc++.h> using namespace std; inline int read() { int s = 0; char ch = getchar(); while (!isdigit(ch)) ch = getchar(); while (isdigit(ch)) s = s * 10 + ch - 0 , ch = getchar(); return s; } inline char getch() { char ch = getchar(); while (!islower(ch)) ch = getchar()...
/////////////////////////////////////////////////////////////////////////////// // // 6.111 FPGA Labkit -- Hex display driver // // File: display_16hex.v // Date: 24-Sep-05 // // Created: April 27, 2004 // Author: Nathan Ickes // // 24-Sep-05 Ike: updated to use new reset-once state machine, remove clear // 28-Nov...
/** * 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 a, b, c, n, t, r = 0; cin >> a >> b >> c >> n; for (int i = 0; i < n; i++) { cin >> t; if (t > b && t < c) r++; } cout << r << endl; }
#include <bits/stdc++.h> using namespace std; const int maxn = 1e5 + 7; const double eps = 1e-9; int a[maxn]; int main() { std::ios::sync_with_stdio(false); int n, sum = 0; cin >> n; for (int i = 0; i < n; ++i) cin >> a[i], sum += a[i]; sort(a, a + n); int ans = 0; while (fabs(roun...
#include <bits/stdc++.h> using namespace std; const int N = 8; int main() { char r1, r2; int x1, x2; while (4 == scanf( %c%d %c%d , &r1, &x1, &r2, &x2)) { int y1 = r1 - a ; int y2 = r2 - a ; --x1; --x2; int ans = 0; for (int y = 0; y < (int)(N); y++) for ...
#include <bits/stdc++.h> using namespace std; const int maxval = 2e6 + 6; int b[maxval]; int main() { int n; scanf( %d , &n); for (int i = 0; i < n; i++) { int a; scanf( %d , &a); b[a] = a; } for (int i = 0; i < maxval; i++) if (!b[i]) b[i] = b[i - 1]; int ans = 0...
#include <bits/stdc++.h> using namespace std; bool dbg = 0; int main() { int N, K; cin >> N >> K; long long Count = 0; int x, y; for (int n = 0; n < N; ++n) { scanf( %d%d , &x, &y); Count += (long long)(y - x + 1); } cout << (K - Count % K) % K << endl; return 0; }
#include <bits/stdc++.h> const int MAXN = 200010; const int mod = 1000000007; void reduce(int& x) { x += x >> 31 & mod; } int mul(int a, int b) { return (long long)a * b % mod; } int remod(long long x) { x %= mod; return x + (x >> 63 & mod); } int n; int A[MAXN], W[MAXN]; long long rt[MAXN]; ...
// dtb_daq.v `timescale 1 ns / 1 ps module dtb_daq ( input clk_daq, input clk_sys, input [7:0]sclk, input reset, input sync, // control input [1:0]ctrl_adc_address, input ctrl_adc_write, input [15:0]ctrl_adc_writedata, input ctrl_adc_read, output [15:0]ctrl_adc_readdata, input [3:0]ctrl_deser160, ...
#include <bits/stdc++.h> using namespace std; const int N = (int)3e5 + 50; struct node { int sum, suf; void add(int val) { sum += val; suf = max(sum, 0); } }; node merge(node L, node R) { return {L.sum + R.sum, max(R.sum + L.suf, R.suf)}; } struct Tree { node dat[4 * N]; ...
module spi_trx ( input wire clk, input wire sck, output wire miso, input wire mosi, input wire ss, output wire rst_o, output wire [7:0] data_o, output wire ack_pop_o, input wire [7:0] data_i, input wire ack_i); // detect sck posedge reg [1:0] sck_hist_ff; always @(posedge cl...
#include <bits/stdc++.h> using namespace std; int main() { ios_base::sync_with_stdio(false); int n, k; while (cin >> n >> k) { int r = n, l = 1; cout << l; l++; for (int i = 1; i < k; i++) if (i % 2) { cout << << r; r--; } else { ...
/** * 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> const int inf = int(1e9); const int mod = inf + 7; const double PI = acos(-1.0); using namespace std; const int N = 1e5 + 155; void solve() { int n, k, s = 0; cin >> n >> k; for (int i = 0; i < n; ++i) { int x; cin >> x; s += x; } for (int ans =...
#include <bits/stdc++.h> using namespace std; int main() { long long n, k, i, j, A[200005], s = 1; cin >> n; for (long long(i) = 0; (i) < (n); (i) = (i + 1)) { cin >> A[i]; if (A[i] == n) { k = i; } } for (j = k; j < n - 1; j++) { if (A[j] < A[j + 1]) { s ...
module jt12_imp( input rst, input clk, input [7:0] din, input [1:0] addr, input cs_n, input wr_n, input limiter_en, output busy, output flag_B, output flag_A, // combined output /* output [11:0] snd_right, output [11:0] snd_left, output sample, */ // multiplexed output output syn_...
`timescale 1 ns / 1 ps module elink_tb; reg aclk; reg aresetn; reg start; wire csysreq = 1'b0; wire done; wire error; // Create an instance of the example tb elink_testbench dut (.aclk(aclk), .aresetn(aresetn), .csysreq(csysreq), .done(done), .er...
/** * 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...
/** * 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...
// Accellera Standard V2.5 Open Verification Library (OVL). // Accellera Copyright (c) 2005-2010. All rights reserved. `include "std_ovl_defines.h" `module ovl_change (clock, reset, enable, start_event, test_expr, fire); parameter severity_level = `OVL_SEVERITY_DEFAULT; parameter width = 1; ...
//----------------------------------------------------------------------------- // // (c) Copyright 2009-2010 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...
#include <bits/stdc++.h> using namespace std; string S; int ans; int main() { ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0); for (int i = 1; i <= 3; i++) { getline(cin, S); ans = 0; for (int j = 0; j < S.length(); j++) { if (S[j] == a || S[j] == i || S[j] ==...
#include <bits/stdc++.h> using namespace std; int t, n; int a[1000005]; vector<int> x; void solve() { int sum = 0, ans; cin >> n; for (int i = 1; i <= n; i++) { cin >> a[i]; sum += a[i]; } int l = 1, r = 1e7; while (l <= r) { int mid = (l + r) >> 1; if (mid * n ...
#include <bits/stdc++.h> using namespace std; const int N = 5e5 + 10, INF = 1e9; inline int read() { int x = 0, f = 1; char ch = getchar(); while (!isdigit(ch)) { if (ch == - ) f = -f; ch = getchar(); } while (isdigit(ch)) { x = x * 10 + ch - 48; ch = getchar(); } ...
#include <bits/stdc++.h> const int maxn = 100100; const int bl = 512; static const int N = 600; int n, k, q; int s[maxn]; struct block { int pop[N], c0; int push[N], c1; int ok; } o[maxn / bl + 10]; inline int eql(const int *a, const int *b, const int len) { for (int i = 0; i < len; ++i)...
//================================================================================================== // Filename : antares_reg_file.v // Created On : Tue Sep 1 10:29:48 2015 // Last Modified : Sat Nov 07 12:15:25 2015 // Revision : 1.0 // Author : Angel Terrones // Company : Universidad...
#include <bits/stdc++.h> using namespace std; int const N = 2005; long long f(long long x, long long n) { long long t = (x % 2 == 1 ? 1 : 2); long long h = 1; long long res = 0; while (true) { if ((x * h) > n) return res; res += (t - (x * h + t - 1 - min(x * h + t - 1, n))); t <<...
/* * MBus Copyright 2015 Regents of the University of Michigan * * 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 ...
//----------------------------------------------------------------------------- // // (c) Copyright 2010-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 ...