text
stringlengths
59
71.4k
#include <bits/stdc++.h> using namespace std; int main() { string s, s1, s2; cin >> s; s1 = s; sort(s1.begin(), s1.end()); s2 += s1[0]; for (int i = 1; i < s1.length(); i++) { if (s1[i] != s1[i - 1]) s2 += s1[i]; } int d = 0; for (int j = s2.length() - 1; j >= 0; j--) { ...
/** * 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: 00:41:38 05/01/2016 // Design Name: // Module Name: reset // Project Name: // Target Devices: // Tool versions: // Description: // // Dependenc...
module top( output RGB0, RGB1, RGB2 ); wire clk; SB_HFOSC inthosc ( .CLKHFPU(1'b1), .CLKHFEN(1'b1), .CLKHF(clk) ); localparam counter_width = 32; reg [counter_width-1:0] ctr; always@(posedge clk) begin ctr <= ctr + 1; end localparam pwm_width = 12; localparam pwm_max = (2**pwm_width) - 1; localparam ...
/** * 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 MAXN = 1e5 + 233; struct item { int ini, num; } t[MAXN]; int vis1[MAXN] = {0}, vis2[MAXN] = {0}; int cg[MAXN] = {0}; int n; bool cmp1(const item &a, const item &b) { return a.num < b.num; } bool cmp2(const item &a, const item &b) { return a.i...
#include <bits/stdc++.h> using namespace std; int gcd(int a, int b) { if (!b) return a; return gcd(b, a % b); } char str[5]; int main() { int t = 0, x = 0; scanf( %d , &t); for (int i = 0; i < t; i++) { cin >> str; if (strcmp(str, ++X ) == 0 || strcmp(str, X++ ) == 0) { ...
#include <bits/stdc++.h> void build(const std::vector<std::pair<int, int>>& values, std::vector<int64_t>& seg, int node, int start, int end) { if (start == end) { seg[node] = values[start].second; } else if (start < end) { int mid = (start + end) / 2; build(values, seg, 2 * node...
//Legal Notice: (C)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 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 law...
#include <bits/stdc++.h> using namespace std; int n, k, i, j, x, lg[1 << 20], f1[1 << 20], f2[1 << 20], ans, n1, n2, a; long long e[42]; bool g[1 << 20]; int main() { scanf( %d%d , &n, &k); for (i = 0; i < n; i++) for (j = 0; j < n; j++) { scanf( %d , &x); if (x) e[i] |= 1ll << j...
/** * ------------------------------------------------------------ * Copyright (c) All rights reserved * SiLab, Institute of Physics, University of Bonn * ------------------------------------------------------------ */ `timescale 1ps/1ps `default_nettype none module seq_gen_blk_mem ( clka, clkb, wea, addra, ...
#include <bits/stdc++.h> using namespace std; const int MOD = 1e9 + 7; const int N = 1e6 + 10; int n; long long cnt[4][20][20]; int dp[N][20][3]; int main() { ios::sync_with_stdio(0); cin.tie(0); cout.tie(0); cin >> n; int lg2 = log2(n); dp[1][lg2][0] = 1; if (pow(2, lg2 - 1) *...
`timescale 1ns / 1ps ////////////////////////////////////////////////////////////////////////////////// // Company: // Engineer: // // Create Date: 22:14:04 10/01/2015 // Design Name: // Module Name: freqdiv // Project Name: // Target Devices: // Tool versions: // Description: // // Dependencies: // //...
#include <bits/stdc++.h> using namespace std; int main() { int t; scanf( %d , &t); while (t--) { int n; scanf( %d , &n); vector<int> a(n, 0); for (int i = 0; i < n; i++) scanf( %d , &a[i]); int m; scanf( %d , &m); vector<pair<int, int> > h(m, {0, 0}); for ...
`include "../src/fsctl.v" module test_fsctl(); parameter integer C_SPEED_DATA_WIDTH = 16; parameter integer C_REG_IDX_WIDTH = 8; reg clk; reg resetn; reg wr_en; reg[C_REG_IDX_WIDTH-1:0] wr_addr = 0; reg[31:0] wr_data; reg o_clk; reg o_resetn; wire br0_init; wire b...
#include <bits/stdc++.h> #pragma GCC optimize( Ofast ) #pragma GCC optimize( unroll-loops ) using namespace std; ; long long max(long long a, long long b) { if (a > b) return a; else return b; } long long min(long long a, long long b) { if (a > b) return b; else ret...
#include <bits/stdc++.h> using namespace std; const int MAXN = 2e5 + 5; vector<int> circuit; vector<int> e[MAXN]; void calc(int v) { stack<int> s; while (true) { if (((int)e[v].size()) == 0) { circuit.push_back(v); if (!((int)s.size())) { break; } v = s....
// bsg_clk_gen_osc // // new settings are delivered via bsg_tag_i // // the clock is designed to be atomically updated // between any of its values without glitching. // // the order of components is: // // ADT, CDT, FDT --> feedback (and buffer to outside world) // // All three stages invert their outputs. // // All ...
#include <bits/stdc++.h> using namespace std; const double eps = 1e-8; const int MAXN = 1e2 + 5; const long long MOD = 1e9 + 7; int a[1005][3000]; int main() { int n, s, d; int maxx = 0; cin >> n; for (int i = 0; i < n; i++) { cin >> s >> d; for (int j = s; j <= 100000000; j += d...
#include <bits/stdc++.h> using namespace std; int main() { int n, m, k, c = 0; n = 4; m = 14; string arr[n][m]; cin >> k; for (int i = 0; i < n; i++) { for (int j = 0; j < m; j++) { if (j == 0) arr[i][j] = |# ; else { if (j == m - 3 && i == 0 || j =...
#include <bits/stdc++.h> template <class T> inline bool rd(T &ret) { char c; int sgn; if (c = getchar(), c == EOF) return 0; while (c != - && (c < 0 || c > 9 )) c = getchar(); sgn = (c == - ) ? -1 : 1; ret = (c == - ) ? 0 : (c - 0 ); while (c = getchar(), c >= 0 && c <= 9 ) re...
#include <bits/stdc++.h> using namespace std; inline int IN() { int x = 0, 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) + ch - 0 ; ch = g...
#include <bits/stdc++.h> using namespace std; long long n, grid[2500][2500], R[10005], C[10005]; vector<pair<long long, pair<long long, long long> > > A, B; int main() { ios_base::sync_with_stdio(0); cin.tie(0); cin >> n; for (long long i = 0; i < n; i++) for (long long j = 0; j < n; j++) ...
module ADT7310P32LS16L ( (* intersynth_port="Reset_n_i" *) input Reset_n_i, (* intersynth_port="Clk_i" *) input Clk_i, (* intersynth_port="ReconfModuleIn_s", intersynth_conntype="Bit" *) input Enable_i, (* intersynth_port="ReconfModuleIRQs_s", intersynth_conntype="Bit" *) output CpuIntr_o, (* inte...
#include <bits/stdc++.h> using namespace std; long long mypow(long long x, int y) { long long an = 1; while (y) { if (y & 1) { an *= x; an %= 1000000007; } x *= x; x %= 1000000007; y >>= 1; } return an; } int d[1000001]; int f(int k, int w) { 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...
/* * 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; int main() { int n; cin >> n; while (n--) { long long s, a, b, c; cin >> s >> a >> b >> c; s /= c; s += (s / a) * b; cout << s << endl; } return 0; }
#include <bits/stdc++.h> using namespace std; long long n, m, x, y, a, b, times, red, t3; long long k; void work3() { long long t1, t2; if (red == 0) { times--; red = m * 2 * (n - 1); } if (x != 1 && x != n) t3 = 2 * times; else t3 = times; if (red > n * m) { ...
#include <bits/stdc++.h> using namespace std; mt19937 rng(chrono::steady_clock::now().time_since_epoch().count()); const long long INF = 1e18; const long long N = 1e5 + 100; long long n; long long a[N], dp_right[N], dp_left[N], full_right[N], full_left[N]; signed main() { ios_base::sync_with_stdio(0),...
/*********************************************************************** FIFO Memory This file is part FPGA Libre project http://fpgalibre.sf.net/ Description: FIFO memory with empty, full and avalible outputs. To Do: - Author: - Juan Pablo D. Borgna, - Salvador E. Tropea, salvador en inti ...
#include <bits/stdc++.h> long long int x, y, z, i, flag, flag2, top; long long int A[200010]; int main() { scanf( %lld , &x); for (i = 1; i <= x; i++) { scanf( %lld , &A[i]); if (A[i] == 1 && flag == 0) { y = i + 1; flag = 1; } } for (i = y; i <= x; i++) { i...
/** * 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 MOD = 1e9 + 7; long long power(long long a, long long b) { long long ans = 1; while (b > 0) { if (b & 1) ans *= a; a = a * a; b >>= 1; } return ans; } long long powm(long long a, long long b) { a %= MOD; long lon...
/** * 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 (c) 2011 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 // // ...
module EchoVerilog(input CLK, input RST_N, output RDY_indications_0_deq, input EN_indications_0_deq, input [31:0]request_say_v, output RDY_request_say, input EN_request_say, output RDY_indications_0_notEmpty, output indications_0_notEmpty, output RDY_indications_0_first, output [31:0]indications_0_first, output RDY_i...
/** * 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 "network_params.h" module matrix_multiply( // a matrix multiply implementaion of a single layer feed forward network input clock, input reset, input [(`FFN_WIDTH*`NUM_INPUT_N)-1:0] input_neurons, input [(`FFN_WIDTH*`NUM_INPUT_N*`NUM_OUTPUT_N)-1:0] weight_matrix, output [(`FFN_WIDTH*2*`NUM_OUTPUT_N)-...
#include <bits/stdc++.h> using namespace std; int main() { int tc; scanf( %d , &tc); for (int i = 0; i < tc; i++) { int N, K; scanf( %d %d , &N, &K); if (N < K) { printf( NO n ); continue; } if (N % 2 == 0) { if (2 * K <= N) { printf( YES n...
#include <bits/stdc++.h> using namespace std; int n, Q, l, r; int a[5000], b[5000][5000], c[5000][5000]; int main() { scanf( %d , &n); for (int i = 1; i <= n; i++) scanf( %d , &a[i]); for (int i = 1; i <= n; i++) b[i][i] = c[i][i] = a[i]; for (int L = 1; L < n; L++) for (int i = 1; i + L <...
/* * 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 generated by Vivado(TM) HLS - High-Level Synthesis from C, C++ and SystemC // Version: 2017.2 // Copyright (C) 1986-2017 Xilinx, Inc. All Rights Reserved. // // ============================================================== `timescale 1 ns / 1 ...
#include <bits/stdc++.h> using namespace std; int bit[200005]; void update(long long int x) { while (x < 200005) { bit[x] += 1; if (x == 0) break; x += x & (-x); } } long long int query(long long int x) { long long int ans = 0; while (x >= 0) { ans += bit[x]; if (...
#include <bits/stdc++.h> using namespace std; const int MAXN = 1e6 + 10; const long long inf = 1e15; const int mod = 1e6; void faster() { ios_base::sync_with_stdio(false); cin.tie(NULL); } const long long N = 3e5 + 10; int n, m; string s; pair<long long, long long> p[N]; long long prefix[N...
#include <bits/stdc++.h> using namespace std; int main() { long long n, k, s; cin >> n >> k >> s; if ((n - 1) * k < s || s < k) { cout << NO n ; return 0; } cout << YES n ; long long m = s / k; int rem = s % k; int count = 0; int room = 1; for (; count < rem; ++...
#include <bits/stdc++.h> using namespace std; int main() { int n, i, c = 0, a[101]; cin >> n; for (i = 0; i < n; i++) cin >> a[i]; for (i = 0; i < n - 1; i++) { if (a[i] == 0) { if (a[i + 1] == 1 && a[i - 1] == 1) { c++; a[i + 1] = 0, a[i - 1] = 0; } }...
`timescale 1ns / 1ps module Mem_I_D( clk, we_i, adr_i, stb_i, //Byte_Sel, Half_W, dat_o, ack_o, dat_i, Signext ); input clk; ...
/* * 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 is written by Zhiyang Ong * and Andrew Mattheisen */ `timescale 1ns/100ps /** * `timescale time_unit base / precision base * * -Specifies the time units and precision for delays: * -time_unit is the amount of time a delay of 1 represents. * The time unit must be 1 10 or 100 * -base is the time ba...
#include <bits/stdc++.h> using namespace std; int n; void solve() { scanf( %d , &n); int tmp, tot; if (n == 0) { printf( O-|-OOOO n ); return; } while (n) { tmp = n % 10; if (tmp >= 5) { tot = tmp - 5; printf( -O| ); } else { tot = tmp; ...
module top; reg [1:0] lv, rv; reg pass; wire res, resb; assign res = lv ==? rv; assign resb = lv !=? rv; initial begin pass = 1'b1; lv = 2'b00; rv = 2'b00; #1; if (res !== 1'b1) begin $display("Failed: %b ==? %b returned 1'b%b not 1'b1", lv, rv, res); pass = 1'b0; en...
/** * 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...
// // Designed by Qiang Wu // `timescale 1ns/1ps module packet_buffer( input clk, input reset, output [239:0] TRIG0, input [63:0] in_data, input [23:0] in_pkt_route, input in_wr, output reg in_empty, input in_req, output reg in_ack, output reg [63:0] out_data, output reg [23:0] out_pkt_route...
#include <bits/stdc++.h> using namespace std; int query(int x, int y) { if (x == -1) return 0; cout << 1 << << x << << y << endl; string ret; cin >> ret; return ( TAK == ret); } int get(int l, int r) { if (l > r) return -1; while (l < r) { int m = (l + r) >> 1; i...
#include <bits/stdc++.h> using namespace std; const int PI = 3.1415926535; const int inf = 1000111222; const int mod = 1000000007; const int N = 100007; int main() { ios_base ::sync_with_stdio(0); cin.tie(0); cout.tie(0); int n; cin >> n; vector<int> ar(n); for (int i = 0; i < n;...
// // Copyright 2014-2015 Ettus Research LLC // module noc_block_channelizer_256 #( parameter NOC_ID = 64'h11FB_0000_0000_0000, parameter STR_SINK_FIFOSIZE = 11) ( input bus_clk, input bus_rst, input ce_clk, input ce_rst, input [63:0] i_tdata, input i_tlast, input i_tvalid, output i_tready, output [63:0...
#include <bits/stdc++.h> using namespace std; int main() { ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL); ; string s; cin >> s; if (s[0] == @ || s.back() == @ || (s.find( @ ) == -1)) { cout << No solution ; return 0; } vector<int> v; for (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 la...
// 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...
// Accellera Standard V2.3 Open Verification Library (OVL). // Accellera Copyright (c) 2005-2008. All rights reserved. `include "std_ovl_defines.h" `module ovl_win_unchange (clock, reset, enable, start_event, test_expr, end_event, fire); parameter severity_level = `OVL_SEVERITY_DEFAULT; parameter width ...
// *************************************************************************** // *************************************************************************** // Copyright 2011(c) Analog Devices, Inc. // // All rights reserved. // // Redistribution and use in source and binary forms, with or without modification, // are...
/* * 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...
// trigger_interface.v `timescale 1 ns / 1 ps module trigger_interface ( input clk, input sync, input reset, input write, input [31:0]writedata, input [3:0]address, output reg [31:0]reg0, output reg [31:0]reg1, output reg [31:0]reg2, output reg [31:0]reg3, output reg [31:0]reg4, output reg [31:0]reg5, ...
// ========== Copyright Header Begin ========================================== // // OpenSPARC T1 Processor File: nc_inv_chk.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/or...
// megafunction wizard: %FIFO%VBB% // GENERATION: STANDARD // VERSION: WM1.0 // MODULE: scfifo // ============================================================ // File Name: FIFO_DETECTION_YN.v // Megafunction Name(s): // scfifo // // Simulation Library Files(s): // // ==========================================...
#include <bits/stdc++.h> using namespace std; const long long INF = 2e18; signed main() { ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0); long long n; cin >> n; vector<long long> a(n); map<long long, long long> dp; for (long long i = 0; i < n; ++i) { cin >> a[i]; ...
#include <bits/stdc++.h> using namespace std; const int MAX = 2e5 + 20; int n, a[MAX]; int main(void) { int T; scanf( %d , &T); while (T--) { scanf( %d , &n); bool allBad = 1; int rl = 0, rr = 0; scanf( %d , &a[1]); for (register int i = (2); i <= (n); ++i) { sc...
module control(op, funct, mem_to_reg, mem_write, branch, alu_ctrl, alu_src, reg_dst, reg_write, jump) ; input [5:0] funct; input [5:0] op; output [0:0] mem_to_reg, mem_write, branch, alu_src, reg_dst, reg_write, jump; output [1:0] alu_ctrl; reg [0:0] mem_to_reg, mem_write, branch, alu_src, reg_dst, r...
#include <bits/stdc++.h> using namespace std; struct trie { struct tree { long long al[26]; bool ex; } nxt[100005]; long long cnt, dep[100005]; void insert(char *s) { long long l = strlen(s), rt = 0; for (register long long i = 0; i < l; i++) { long long c = s[i] - a...
#include <bits/stdc++.h> using namespace std; int n, k; const int maxn = 300000 + 500; const int maxk = 5005; const int INF = 2e9 + 100; int a[maxn]; int d[maxk][maxk]; int main() { scanf( %d %d , &n, &k); for (int i = 1; i <= n; i++) { scanf( %d , &a[i]); } int large = n % 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 la...
#include <bits/stdc++.h> using namespace std; vector<pair<long long int, long long int> > adj[100005]; long long int sp = 0, mst = 0, p = 100003; int n, m; int main() { cin >> n >> m; long long int c = p - (n - 2); adj[1].push_back({2, c}); m--; for (int i = 2; i <= n - 2 + 1; i++, m--) ad...
module mul32x32_fsm(input clk, input rst, input req, input [31:0] p0, input [31:0] p1, output reg ack, output reg [31:0] out); wire [31:0] ...
#include <bits/stdc++.h> using namespace std; using llong = long long; inline char Flip(char x) { return (x == 0 ) ? 1 : 0 ; } int main() { ios::sync_with_stdio(0); cin.tie(0); cout.tie(0); int t; cin >> t; vector<int> ans; while (t--) { int n; cin >> n; n *= 2;...
#include <bits/stdc++.h> using namespace std; long long int p = 1e9 + 7; int main() { int t; cin >> t; while (t--) { int x; cin >> x; string s; cin >> s; int inl = s.length(); int i = 0; while (s.length() < x) { int l1 = s.length(); for (int j ...
/* * sobel.v * * Created on: 09/10/2012 * Author: Lord_Rafa */ `timescale 1 ps / 1 ps module Sobel ( input clk, input rst, output [31:0] data_fifo_out, output data_valid_fifo_out, input wire [8:0] usedw_fifo_out, output wire[31:0] ram_r_address, input ram_r_waitrequest, input r...
#include <bits/stdc++.h> using namespace std; const long double eps = 1e-9; const long double pi = acos(-1.0); int gcd(int a, int b) { return (b == 0) ? a : gcd(b, a % b); } int xabs(int a) { return a > 0 ? a : -a; } struct spoint { double x; double y; int id; spoint(); spoint(double x, ...
`default_nettype none module main_counter( input wire iCLOCK, input wire inRESET, //Config Write input wire iCONF_WRITE, input wire iCONF_ENA, //Counter Write input wire iCOUNT_WRITE, input wire [1:0] inCOUNT_DQM, input wire [63:0] iCOUNT_COUNTER, //Output output wire oWORKING, output wire ...
// DESCRIPTION: Verilator: Verilog Test module // // This file ONLY is placed into the Public Domain, for any use, // without warranty, 2010 by Wilson Snyder. module t (/*AUTOARG*/ // Outputs data_out, // Inputs wr, wa, rst_l, rd, ra, data_in, clk ); input clk; /*AUTOINPUT*/ // Beginning of au...
/** * 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: Verilog Test module // // This file ONLY is placed under the Creative Commons Public Domain, for // any use, without warranty, 2021 by Rupert Swarbrick. // SPDX-License-Identifier: CC0-1.0 module t(/*AUTOARG*/ // Inputs value ); input [1:0] value; sub u_sub(.value(value), .o...
#include <bits/stdc++.h> using namespace std; long long int mod = 1e8 + 5e4 + 1; const double error = 1e-7; const double PI = acos(-1); mt19937 rng(chrono::system_clock::now().time_since_epoch().count()); inline long long int MOD(long long int x, long long int m = mod) { long long int y = x % m; ret...
/* * In The Name Of God * ======================================== * [] File Name : way.v * * [] Creation Date : 31-03-2015 * * [] Last Modified : Tue, Mar 31, 2015 10:58:49 PM * * [] Created By : Parham Alvani () * ======================================= */ `timescale 1 ns/100 ps module way (enable, word, 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 la...
#include <bits/stdc++.h> using namespace std; const int N = 1 << 19; const double PI = acos(-1); int n, x; int a[N]; vector<long long> f, g, h; long long res[N]; int rev[N]; void calc_rev(int n, int logn) { for (int i = 0; i < n; ++i) { rev[i] = 0; for (int j = 0; j < logn; ++j) ...
/* * 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; long long n, m, d, bd[4]; vector<long long> pst[4][100069]; int main() { long long i, j, ii, k, l, z = 1, y, x, p; bool ft = 1; scanf( %lld%lld%lld , &n, &m, &d); for (i = 0; i < d; i++) { scanf( %lld%lld , &k, &l); for (ii = 0; ii < 4; i...
#include <bits/stdc++.h> using namespace std; #define ll long long #define fi first #define se second const int MAX = 2 * 1e5 + 10; const int MOD = 1e9 + 7; ll t; ll n, m, k; ll a, b, x, y, x2, y2; ll bio[MAX]; ll arr[MAX]; vector <ll> v; string s; int main() { cin >> t; ...
// DESCRIPTION: Verilator: Verilog Test module // // This file ONLY is placed into the Public Domain, for any use, // without warranty, 2007 by Wilson Snyder. module t (/*AUTOARG*/ // Inputs clk ); input clk; reg toggle; integer cyc; initial cyc=1; Test test (/*AUTOINST*/ // Inputs ...
#include <bits/stdc++.h> using namespace std; int q, n; long long k; long long len[100004]; string s1 = What are you doing while sending , s2 = ? Are you busy? Will you send , s3 = ? , f0 = What are you doing at the end of the world? Are you busy? Will you ...
/** * 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...
///////////////////////////////////////////////////////////// // Created by: Synopsys DC Ultra(TM) in wire load mode // Version : L-2016.03-SP3 // Date : Sun Nov 20 02:51:51 2016 ///////////////////////////////////////////////////////////// module GDA_St_N8_M8_P1 ( in1, in2, res ); input [7:0] in1; input [...
#include <bits/stdc++.h> using namespace std; inline long long read() { long long x = 0, f = 1; char c = getchar(); while ((c < 0 || c > 9 ) && (c != - )) c = getchar(); if (c == - ) f = -1, c = getchar(); while (c >= 0 && c <= 9 ) x = x * 10 + c - 0 , c = getchar(); return x * f; ...
#include <bits/stdc++.h> int main() { int x; int n, m; scanf( %d %d , &n, &m); if (m == 3 && n > 4) { printf( -1 n ); return 0; } for (x = 0; x < m; ++x) printf( %d %d n , x, x * x + 10001); for (x = 0; x < n - m; ++x) printf( %d %d n , x, -x * x); return 0; }
#include <bits/stdc++.h> using namespace std; const int inf = 0x3f3f3f3f; const long long infLL = 0x3f3f3f3f3f3f3f3fLL; const int hash_mod = 1000037; const double eps = 1e-10; const double pi = acos(-1); const int maxn = 5000 + 5; int n, m; char s[maxn]; int f[maxn][maxn], g[maxn]; int main() { ...
#include <bits/stdc++.h> using namespace std; const int M = 10; set<int> s[M]; int n, p[M]; bool check(int x) { vector<int> b; while (x) { b.push_back(x % 10); x /= 10; } if (b.size() > n) return false; for (int i = 0; i < b.size(); i++) if (s[p[i]].find(b[i]) == s[p[i]]....