text
stringlengths
59
71.4k
// ========== Copyright Header Begin ========================================== // // OpenSPARC T1 Processor File: fpu_cnt_lead0_lvl1.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 i...
`timescale 1ns / 1ps //////////////////////////////////////////////////////////////////////////////// // Company: // Engineer: // // Create Date: 18:35:24 11/16/2014 // Design Name: vCounter2BCD // Module Name: /home/aneez/workspace/vLCDisplay/vCounter2BCD_tb.v // Project Name: vLCDisplay // Target Device: /...
#include <bits/stdc++.h> using namespace std; int n, s = 19, i, sum, j, l; int main() { cin >> n; for (i = 1; i < n; i++) { s += 9; l = s; while (l) { sum += (l % 10); l /= 10; } if (sum != 10) i--; sum = 0; } cout << s; }
`timescale 1ns / 1ps ////////////////////////////////////////////////////////////////////////////////// // Company: Boston University // Engineer: Zafar M. Takhirov // // Create Date: 12:59:40 04/12/2011 // Design Name: EC311 Support Files // Module Name: vga_display // Project Name: Lab5 / Lab6 / Proj...
/* Memory will halt the processor clock until the data has been obtained from the USB-EPP interface */ module memory( input wire mclk, input wire epp_astb, input wire epp_dstb, input wire epp_wr, output wire epp_wait, inout wire[7:0] epp_data, output reg core_stall = 0, input wire read, input wire write, in...
`timescale 1ns / 1ps ////////////////////////////////////////////////////////////////////////////////// // Company: // Engineer: // // Create Date: 19:05:34 05/14/2015 // Design Name: // Module Name: median5x5 // Project Name: // Target Devices: // Tool versions: // Description: // // Dependencies: // ...
`timescale 1ns / 1ps ////////////////////////////////////////////////////////////////////////////////// // Company: // Engineer: Grig Barbulescu // // Create Date: 01/17/2016 04:48:20 PM // Design Name: // Module Name: top // Project Name: // Target Devices: // Tool Versions: // Description: // //...
#include <bits/stdc++.h> using namespace std; void jizz() { cout << -1 << endl; exit(0); } int s[200005], l[200005], r[200005]; int main() { ios_base::sync_with_stdio(0); cin.tie(0); int n; cin >> n; for (int i = 1; i <= n; ++i) { cin >> s[i] >> l[i]; r[i] = s[i] + l[i]...
#include <bits/stdc++.h> using namespace std; int N, M; string s[2020]; long long dp[2020][2020][2], C[2020][2020][2], S[2020][2020][2]; int main() { ios::sync_with_stdio(0); cin.tie(0); cin >> N >> M; for (int i = 1; i <= N; i++) { cin >> s[i]; s[i] = # + s[i]; } for (in...
// ------------------------------------------------------------- // // Generated Architecture Declaration for rtl of ent_b // // Generated // by: wig // on: Mon Oct 24 10:52:44 2005 // cmd: /cygdrive/h/work/eclipse/MIX/mix_0.pl -nodelta ../../verilog.xls // // !!! Do not edit this file! Autogenerated by MIX !!! //...
#include <bits/stdc++.h> const int maxn = 10010; const int mod = 1000000007; int n; char ch[4][maxn]; int f[maxn][8][2]; int obs[maxn]; int ot, vt; void part0() { memset(obs, 0, sizeof(obs)); for (int j = 1; j <= n; j++) for (int i = 3; i >= 1; i--) obs[j] = (obs[j] << 1) + ((ch[i]...
// // Copyright (c) 1999 Steven Wilson () // // 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) // ...
`timescale 1ns / 1ps //---------------------------------------------------------------------// // Name: compute_vex_tb.v // Author: Chris Wynnyk // Date: 2/3/2008 // Purpose: Test structure for the compute_vex.v module. //---------------------------------------------------------------------// module ame...
/** * 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...
module integration_tb(); reg clk, enable, reset, advance, direction, break, align; integer i; wire [3:0] state; reg [15:0] compare, autoreload; wire compare_out; wire [15:0] value; wire pos, neg, db, tim_commutation_out; commutation motor1( .clk(clk), .enable_i(enable), .reset_i(reset), .advance_i(p...
#include <bits/stdc++.h> #pragma comment(linker, /STACK:60777216 ) using namespace std; int d[10]; int c[107][107]; long long dp[107][17]; long long solve(int len, int pos) { if (pos == 9) { if (len >= d[9]) { return 1; } return 0; } if (dp[len][pos] != -1) { ret...
#include <bits/stdc++.h> using namespace std; const int P = 998244353, N = 3e5; int n, L, C, r[N], A[N], B[N]; int g[N], g0[N], g1[N], g2[N]; int f0[N], f1[N], f2[N]; int q0[N], q1[N]; int t1[N], t2[N], t3[N], t4[N]; inline void Add(int &x, int y) { x += y; if (x >= P) x -= P; } inline int M...
// Copyright 1986-2016 Xilinx, Inc. All Rights Reserved. // -------------------------------------------------------------------------------- // Tool Version: Vivado v.2016.4 (win64) Build Wed Dec 14 22:35:39 MST 2016 // Date : Mon Feb 13 12:44:42 2017 // Host : WK117 running 64-bit major release (build ...
// (C) 2001-2017 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 from any of the foregoing (including device programming or simulation // files), and any associated ...
/** * 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 `include "global.v" module fpu_top(clk_in, reset_in, fpuOpCode_in, roundingMode_in, operandA_in, operandB_in, resultReady_out, result_out, invalidOperation_out, divisionByZero_out, overflow_out, underflow_out, inexact_out); // I/O PORTS input clk_in, reset_in; input [3:0] fpuOpCo...
`timescale 1ns / 1ps ////////////////////////////////////////////////////////////////////////////////// // Company: // Engineer: // // Create Date: 17:59:16 05/22/2016 // Design Name: // Module Name: Deteccion_Tecla // Project Name: // Target Devices: // Tool versions: // Description: // // Dependencies...
////////////////////////////////////////////////////////////////// // // // Amber 2 Core top-Level module // // // // This file is part of the Amber project ...
// (C) 2001-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...
/** * 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> cnt, b; vector<int> ans; int a[200010], x; int n, m, p; int main() { cin >> n >> m >> p; for (int i = 0; i < n; i++) cin >> a[i]; for (int i = 0; i < m; i++) { cin >> x; b[x]++; } for (int i = 0; i < p; i++) { ...
// *************************************************************************** // *************************************************************************** // Copyright 2011(c) Analog Devices, Inc. // // All rights reserved. // // Redistribution and use in source and binary forms, with or without modification, // ar...
#include <bits/stdc++.h> using namespace std; int n; int maxt[5210][5210]; int a[5210][5210]; char str[5210]; int getn(char ch) { if (ch >= 0 && ch <= 9 ) { return ch - 0 ; } else { return 10 + ch - A ; } } int main() { scanf( %d , &n); memset(maxt, 0, sizeof(maxt));...
#include <bits/stdc++.h> using namespace std; int main() { int a, b; long long p(1); cin >> a >> b; while (b--) p = (p << 1ll) % 1000000009ll; long long ans(1); while (a--) { p--; if (p < 0) p += 1000000009ll; ans *= p; ans %= 1000000009ll; } cout << ans; ...
#include <bits/stdc++.h> using namespace std; map<pair<int, int>, int> M; set<pair<int, int> > tmp; char s[77777][11]; int main() { int n; scanf( %d , &n); for (int ii = 0; ii < n; ii++) { scanf( %s , s[ii]); for (int i = 0; i < 9; i++) { for (int j = i; j < 9; j++) { ...
`timescale 1ns / 1ps module HighPassFilter(clk, new_sample, input_sample, output_sample); input clk; input new_sample; reg enable_systolic; wire clk_systolic; input [15:0] input_sample; output [15:0] output_sample; reg [2:0] state; localparam IDLE = 3'd0, CLK_A = 3'd1, CLK_B = ...
/* This file is part of avgai. avgai 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. avgai is distributed in the hope that it...
module TestStateEncoder(); //Inputs to encoder reg clk, enable; //reg [6:0] state; reg [13:0] state; //Encoder output. wire out; defparam e.STATE_LENGTH=4'b1110; stateEncoder e(clk, state, enable, out); initial begin $dumpfile ("TestStateEncoderTestbench.vcd"); $dumpvars; end initial begin $display("\tTime\tSt...
`default_nettype none // ============================================================================ module message_formatter # ( parameter WIDTH = 24, // Word length in bits. MUST be a multiply of 4 parameter COUNT = 2, // Word count parameter TX_INTERVAL = 4 // Character transmission interval ) ( //...
/* * Copyright (c) 2009 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; either version 3, or (at your option) an...
// Copyright 1986-2017 Xilinx, Inc. All Rights Reserved. // -------------------------------------------------------------------------------- // Tool Version: Vivado v.2017.2 (win64) Build Thu Jun 15 18:39:09 MDT 2017 // Date : Tue Sep 19 09:38:22 2017 // Host : DarkCube running 64-bit major release ...
// ========== Copyright Header Begin ========================================== // // OpenSPARC T1 Processor File: fpu_in2_gt_in1_2b.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...
#include <bits/stdc++.h> using namespace std; const long long inf = 1e6; long long n, K, d, a[200010]; map<long long, long long> mp; struct trnode { long long lc, rc, c, u; } tr[400010]; long long tot = 0; void pushdown(long long x) { long long lc = tr[x].lc, rc = tr[x].rc, c = tr[x].u; tr[x...
// megafunction wizard: %FIFO% // GENERATION: STANDARD // VERSION: WM1.0 // MODULE: scfifo // ============================================================ // File Name: fifo_64_1.v // Megafunction Name(s): // scfifo // // Simulation Library Files(s): // // ==========================================...
/* Copyright (c) 2014-2018 Alex Forencich Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distri...
#include <bits/stdc++.h> using namespace std; int main() { int n, m; cin >> n >> m; long long p = 1000000000; vector<int> a; a.resize(n); long long fib[100]; fib[0] = 1; fib[1] = 1; for (long long i = 2; i < 100; i++) fib[i] = (fib[i - 1] + fib[i - 2]) % p; for (int i = 0; i ...
module konamicoder ( digit_0, digit_1, digit_2, digit_3, state ); output [6:0] digit_0; output [6:0] digit_1; output [6:0] digit_2; output [6:0] digit_3; input [3:0] state; wire [6:0] digit_0; wire [6:0] digit_1; wire [6:0] digit_2; wire [6:0] digit_3; // Least-significant bit is segm...
// *************************************************************************** // *************************************************************************** // Copyright 2011(c) Analog Devices, Inc. // // All rights reserved. // // Redistribution and use in source and binary forms, with or without modification, // a...
#include <bits/stdc++.h> using namespace std; const long long N = 1e5 + 5; bool match(string s1, string s2) { long long cnt = 0; for (long long i = 0; s1[i]; ++i) { if (s1[i] != s2[i]) ++cnt; if (cnt > 1) return 0; } return 1; } int32_t main() { ios_base::sync_with_stdio(0); ...
#include <bits/stdc++.h> using namespace std; int xx[4] = {0, 0, 1, -1}; int yy[4] = {1, -1, 0, 0}; int n, m, q; int h[int(1e3 + 100)], dem, st[int(1e3 + 100)], vt[int(1e3 + 100)], top, mid; int a[int(1e3 + 100)][int(1e3 + 100)]; int hl[int(1e3 + 100)][int(1e3 + 100)], cl[int(1e3 + 100)][int(1e3 + 100)], ...
// -*- Mode: Verilog -*- // Filename : test_00.v // Description : Simple ADXL362 Test Case to bring environment to life // Author : Philip Tracton // Created On : Thu Jun 23 11:36:12 2016 // Last Modified By: Philip Tracton // Last Modified On: Thu Jun 23 11:36:12 2...
/** * 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...
// ------------------------------------------------------------------------------ // -- -- // -- (C) 2016-2022 Revanth Kamaraj (krevanth) -- // -- ...
module data_generator( input wire CLK, input wire CE, output wire D1, output wire D2 ); // Ring buffers reg [254:0] ring1; initial ring1 <= 255'b010100110101100010111100101101010010011100001110110010000001011011011111011000101110100111001101101100110111101100001111100110000001011011010000...
#include <bits/stdc++.h> using namespace std; map<int, vector<int> > mx; map<int, vector<int> > my; int pow(int x) { long long i = 2; long long r = 1; while (x) { if (x & 1) r = (r * i) % 1000000007; i = (i * i) % 1000000007; x = x >> 1; } return r; } int main() { i...
#include <bits/stdc++.h> using namespace std; int main() { set<string> S; long n; string a; cin >> n; for (long i = 0; i < n; i++) { cin >> a; string s = ; long j = 0; while (j < a.size()) { if (a[j] == k ) { long k = j; while (a[k] == k ) ...
#include <bits/stdc++.h> using namespace std; template <typename T> inline T abs(T t) { return t < 0 ? -t : t; } const unsigned long long modn = 1000000007; inline unsigned long long mod(unsigned long long x) { return x % modn; } const int MAX = 100009; int deg[MAX], ok[MAX]; vector<int> adj[MAX];...
#include <bits/stdc++.h> using namespace std; int n, m; char gird[64][64]; set<long long int> set_of_cols; int main(void) { int i, j; scanf( %d%d , &n, &m); for (i = 0; i < n; ++i) scanf( %s , gird[i]); for (i = 0; i < n; ++i) { long long int id = 0; for (j = 0; j < m; ++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; int main() { ios_base::sync_with_stdio(false), cout.tie(0), cin.tie(0); int n; cin >> n; if (n <= 3) { cout << 0 << n ; return 0; } int Max = -1, k; for (int i = 2; i < n; ++i) { int tp = n / i * (i - 1); if (n % i >...
#include <bits/stdc++.h> using namespace std; int main() { int n; cin >> n; int a[123456]; int avg[123456]; for (int i = 0; i < n; i++) cin >> a[i]; long long count = 0; for (int i = 0; i < n; i++) count += a[i]; int Max = count / n; int rem = count % n; long long c = 0; ...
#include <bits/stdc++.h> using namespace std; int main() { ios_base::sync_with_stdio(0), cin.tie(0), cout.tie(0); int n, m; cin >> n >> m; bool aOk = true, bOk = true; vector<vector<int>> a(n, vector<int>(m)), b(n, vector<int>(m)); for (int i = 0; i < n; i++) { for (int j = 0; j < m; j...
#include <bits/stdc++.h> using namespace std; int ans[120000], fa[120000], i, j, k, l, n, m, n2; int get(int x) { return fa[x] == x ? x : (fa[x] = get(fa[x])); } int main() { scanf( %d , &n); if (n & 1) return puts( -1 ), 0; for (i = 0; i < n; ++i) fa[i] = i; n2 = n / 2; for (i = 0; i < n2; ...
#include <bits/stdc++.h> using namespace std; struct child { long long v, p, d; }; child c[4123]; bool gone[4123]; int main() { int n; scanf( %d , &n); for (int i = 0; i < (int)(n); i++) { scanf( %lld%lld%lld , &c[i].v, &c[i].d, &c[i].p); } int ans = 0; vector<int> all; ...
`timescale 1ns / 1ps //////////////////////////////////////////////////////////////////////////////// // Company: // Engineer: // // Create Date: 17:12:55 03/06/2016 // Design Name: sumcomp // Module Name: C:/XilinxP/Practica1/sumcomp_test.v // Project Name: Practica1 // Target Device: // Tool ver...
`timescale 1ns / 1ps ////////////////////////////////////////////////////////////////////////////////// // Company: // Engineer: // // Create Date: 22:40:46 12/20/2010 // Design Name: // Module Name: clk_test // Project Name: // Target Devices: // Tool versions: // Description: // // Dependencies: // // Revision:...
#include <bits/stdc++.h> using namespace std; template <typename Arg1> void ZZ(const char* name, Arg1&& arg1) { std::cerr << name << = << arg1 << endl; } template <typename Arg1, typename... Args> void ZZ(const char* names, Arg1&& arg1, Args&&... args) { const char* comma = strchr(names + 1, , ...
//====================================================================== // // chacha_poly1305_p1305.v // ----------------------- // Poly 1305 module for the ChaCha20-Poly1305 AEAD cipher core. // // // Copyright (c) 2016, Secworks Sweden AB // Joachim Strömbergson // // Redistribution and use in source and binary form...
#include <bits/stdc++.h> using namespace std; int read() { bool f = 0; int x = 0; char c = getchar(); while (c < 0 || 9 < c) { if (c == - ) f = 1; c = getchar(); } while ( 0 <= c && c <= 9 ) x = (x << 3) + (x << 1) + (c ^ 48), c = getchar(); return !f ? x : -x; ...
module qsys ( clk_clk, reset_reset_n, sdram_clock_areset_conduit_export, sdram_clock_c0_clk, sdram_read_control_fixed_location, sdram_read_control_read_base, sdram_read_control_read_length, sdram_read_control_go, sdram_read_control_done, sdram_read_control_early_done, sdram_read_user_read_buffer, sdram_rea...
// ---------------------------------------------------------------------- // 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:...
/* * 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: %RAM: 2-PORT% // GENERATION: STANDARD // VERSION: WM1.0 // MODULE: altsyncram // ============================================================ // File Name: cx4_pgmrom.v // Megafunction Name(s): // altsyncram // // Simulation Library Files(s): // altera_mf // =============================...
/** * 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 Header Begin ========================================== // // OpenSPARC T1 Processor File: bw_io_ic_filter.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 a...
#include <iostream> #include <vector> #include <algorithm> using namespace std; #define int long long void solve() { int n; vector<long long> vect; cin >> n; for (int i = 0; i < n; i++) { long long x; cin >> x; vect.push_back(x); } sor...
`timescale 1ns / 1ps /******************************************************************************* * Engineer: Robin zhang * Create Date: 2016.09.10 * Module Name: spi_slave *******************************************************************************/ module spi_slave_cpha0( clk,sck,mosi,miso,ssel,rst_n ); in...
// // 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...
//`define ADD_SFD module fifo9togmii ( // FIFO input sys_rst, input [8:0] dout, input empty, output rd_en, output rd_clk, // GMII input gmii_tx_clk, output gmii_tx_en, output [7:0] gmii_txd ); assign rd_clk = gmii_tx_clk; //-----------------------------------...
#include <bits/stdc++.h> inline void DoNothing() {} template <typename T> inline T Abs(const T a) { return a < 0 ? -a : a; } template <typename T> inline T Min(const T a, const T b) { return a < b ? a : b; } template <typename T> inline T Max(const T a, const T b) { return a > b ? a : b; ...
#include <bits/stdc++.h> using namespace std; int main() { ios_base::sync_with_stdio(false); cin.tie(0); int n, tt; cin >> n >> tt; vector<int> a(1 << n); long long sum = 0; for (int i = 0; i < (1 << n); i++) { cin >> a[i]; sum += (long long)a[i]; } cout << fixed << s...
/* * 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() { ios_base::sync_with_stdio(false); cin.tie(NULL); int n, m; cin >> n >> m; map<string, string> mp; for (int i = 0; i < m; i++) { string s1, s2; cin >> s1 >> s2; if (s2.size() < s1.size()) mp[s1] = s2; e...
#include <bits/stdc++.h> using namespace std; static const int INF = 500000000; template <class T> void debug(T a, T b) { for (; a != b; ++a) cerr << *a << ; cerr << endl; } int n; pair<pair<int, int>, int> es[5005]; vector<pair<int, int> > g[5005]; int size[5005]; int cut[5005]; int pr...
/* * 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 (c) 2015, Microsoft Corporation 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 source code ...
// -------------------------------------------------------------------------------- //| Avalon ST Packets to Bytes Component // -------------------------------------------------------------------------------- `timescale 1ns / 100ps module altera_avalon_st_packets_to_bytes //if ENCODING ==0, CHANNEL_WIDTH must be 8 //...
// This file is part of Verilog-65c816. // // Copyright 2017 by FPGApeeps // // Verilog-65c816 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 la...
/* Copyright 2018 Nuclei System Technology, Inc. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except i...
#include <bits/stdc++.h> using namespace std; long double det(long double x, long double y, long double z, long double t) { return x * t - y * z; } long long int pow(long long int n, long long int m) { if (m == 0) return 1; if (m == 1) return n % (int)1e9 + 7; long long int t = pow(n, m / 2) % (...
#include <bits/stdc++.h> using namespace std; int main() { int t; while (~scanf( %d , &t)) { while (t--) { int n; scanf( %d , &n); char a[n + 1]; scanf( %s , a); int ans = 0; for (int i = 0; i < n; i++) { if (a[i] == > || a[n - i - 1] == < ...
#include <bits/stdc++.h> using namespace std; int main() { int n, m, a, b; cin >> n >> m; double mn = 101.00, x = 0.00; for (int i = 1; i <= n; i++) { cin >> a >> b; x = a / (b * 1.00); if (mn > x) mn = x; } cout << fixed << setprecision(8); cout << mn * m << endl; ...
/*------------------------------------------------------------------------------ * 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 law...
#include <bits/stdc++.h> using namespace std; int MOD = 1e9 + 7; long long int power(long long int a, long long int b) { long long int res = 1; a = a % MOD; while (b > 0) { if (b & 1) { res = (res * a) % MOD; b--; } a = (a * a) % MOD; b >>= 1; } return r...
#include <bits/stdc++.h> using namespace std; const long long N = 5e5 + 5; const long long mod = 1e9 + 7; void solve() { long long n; cin >> n; if (n == 1) { cout << -1 << endl; return; } cout << n << << n + 1 << << n * (n + 1) << endl; } int32_t main() { ios_base...
#include <bits/stdc++.h> using namespace std; const int SIZE = 100005; int gap, tmp[SIZE * 2]; class SuffixArray { public: int sa[SIZE], rk[SIZE], ht[SIZE]; static bool cmp(int x, int y) { if (tmp[x] != tmp[y]) return tmp[x] < tmp[y]; return tmp[x + gap] < tmp[y + gap]; } void gao...
/* * 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() { const string t = RGB ; int q; cin >> q; for (int i = 0; i < q; ++i) { int n, k; string s; cin >> n >> k >> s; int ans = 1e9; for (int j = 0; j < n - k + 1; ++j) { for (int offset = 0; offset < 3; ++offs...
// megafunction wizard: %FIFO%VBB% // GENERATION: STANDARD // VERSION: WM1.0 // MODULE: dcfifo // ============================================================ // File Name: fifo_4kx16_dc.v // Megafunction Name(s): // dcfifo // ============================================================ // **************...
/** * 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; void _print(long long t) { cerr << t; } void _print(int t) { cerr << t; } void _print(string t) { cerr << t; } void _print(char t) { cerr << t; } void _print(long double t) { cerr << t; } void _print(double t) { cerr << t; } void _print(unsigned long long t)...
#include <bits/stdc++.h> using namespace std; struct tree { int l, r, c, p; }; int n, K, m, r; long long res, a[10000011], b[10000011]; bool cmp1(tree a, tree b) { return a.l < b.l; } bool cmp2(tree a, tree b) { return a.r < b.r; } void update(int x, int l, int r, int c, int p) { if (l == r) { ...
//***************************************************************************** // (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 /...
`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 base for each unit, ranging from seconds * to femtoseconds, and must be...