text stringlengths 59 71.4k |
|---|
/**
* ------------------------------------------------------------
* Copyright (c) SILAB , Physics Institute of Bonn University
* ------------------------------------------------------------
*/
`timescale 1ps / 1ps
`include "firmware/src/qmca.v"
`include "firmware/src/qmca_clk_gen.v"
`include "utils/clock_mult... |
#include <bits/stdc++.h> #define PI atan(1.0)*4 #define rp(i,s,t) for (register int i = (s); i <= (t); i++) #define RP(i,t,s) for (register int i = (t); i >= (s); i--) #define sc(x) scanf( %d ,&x) #define scl(x) scanf( %lld ,&x) #define ll long long #define ull unsigned long long #define mst(a,b) memset... |
/**
* Copyright 2020 The SkyWater PDK Authors
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable la... |
#include <bits/stdc++.h> using namespace std; const double sq = 1.73205080757; int main() { long long k, k1; cin >> k; k1 = k * 2; k *= 2; k1 -= k1 % 3; k1++; if (k1 > k) k1 -= 3; long long h = 1, h1, an = 0; while (k1 > 0) { while (k1 * k1 + 3LL * h * h <= k * k && ... |
`timescale 1ns / 1ps
/// 2. first line output : if f0 valid
/// 3. sof for reset
module test();
parameter integer C_PIXEL_WIDTH = 8;
parameter integer C_IMG_WBITS = 12;
parameter integer C_IMG_HBITS = 12;
parameter integer C_DATACOUNT_BITS = 10;
// User parameters ends
// Parameters of Axi Master Bus Interface M_AX... |
// ----------------------------------------------------------------------
// 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> using namespace std; int dp[1123456], p[1123456]; int main() { int n, i, j; scanf( %d , &n); for (i = 0; i < n; ++i) { scanf( %d , &j); p[j] = i; } dp[1] = 1; int ans = 1; for (i = 2; i <= n; ++i) { if (p[i] > p[i - 1]) { dp[i] = 1 + d... |
#include <bits/stdc++.h> using namespace std; const int maxn = 2e5 + 10; const long long inf = 1e18; int a[maxn]; vector<int> g[maxn]; bool c[maxn], ok[maxn]; int dpdown[maxn], dpup[maxn]; int salem[maxn]; int mxdown[maxn], mxup[maxn]; int cnt[maxn]; int sum[maxn]; int n; int dip[maxn]; void... |
#include <bits/stdc++.h> using namespace std; int main() { long long int k, i, cn = 0, cnt = 0, j; cin >> k; string s; cin >> s; map<long long int, long long int> ans; long long int a[s.length()], n = s.length(); for (i = 0; i < s.length(); i++) { if (s[i] == 1 ) cnt++; } ... |
//UART FIFO
/*
Distributed under the MIT license.
Copyright (c) 2011 Dave McCoy ()
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 ... |
/*
* 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... |
//*****************************************************************************
// (c) Copyright 2009 - 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
/... |
#include <bits/stdc++.h> using namespace std; double PI = 3.141592653589793; const double EPS = 1e-9; const int N = 1e6 + 5; const long long mod = 1e9 + 7; const int oo = 1e9 + 9; int dx[] = {0, 0, 1, -1, 1, -1, 1, -1}; int dy[] = {1, -1, 0, 0, -1, 1, 1, -1}; int n, m; long long row[1005], col[1005]... |
// file: system_clk_wiz_1_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 disclaimer... |
// $Id: ugal_source.v 5188 2012-08-30 00:31:31Z dub $
/*
Copyright (c) 2007-2012, Trustees of The Leland Stanford Junior University
All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
Redistributions ... |
#include <bits/stdc++.h> using namespace std; const long double eps = 1e-9; const int inf = LONG_MAX; const long long inf64 = LLONG_MAX; const long double pi = 3.1415926535897932384626433832795; bool cmp(const pair<int, int> a, const pair<int, int> b) { return a.first > b.first; } int a[100100]; i... |
#include <bits/stdc++.h> using namespace std; void sort_vec(vector<int> x, vector<int> b, int cnt) { int index; int max = 101; for (; cnt > 0; cnt--) { for (int j = 0; j < x.size(); j++) { if (x[j] < max) { index = j; max = x[j]; } } cout << x[index]... |
#include <bits/stdc++.h> using namespace std; long long mod = 1000000007; int main() { ios_base::sync_with_stdio(false); cin.tie(NULL); long long n; cin >> n; long long a[n], b[n], c[n]; for (long long i = 0; i < n; i++) { cin >> a[i]; } for (long long i = 0; i < n; i++) cin ... |
#include <bits/stdc++.h> using namespace std; const int MAXN = 2e5 + 5; template <typename T> void chkmax(T &x, T y) { x = max(x, y); } template <typename T> void chkmin(T &x, T y) { x = min(x, y); } template <typename T> void read(T &x) { x = 0; int f = 1; char c = getchar(); ... |
#include <bits/stdc++.h> using namespace std; struct point { int x, y; point(int a = 0, int b = 0) { x = a; y = b; } }; struct cmpx { bool operator()(point a, point b) { if (a.x == b.x) return a.y < b.y; return a.x < b.x; } }; struct cmpy { bool operator()(poi... |
`timescale 1ns / 1ps
//////////////////////////////////////////////////////////////////////////////////
// Company: Tecnológico de Costa Rica
// Engineer: Mauricio Carvajal Delgado
//
// Create Date: 03.17.2013 10:36:22
// Design Name:
// Module Name: Coun_Baud
// Project Name:
// Target Devices:
// Tool versions:... |
#include <bits/stdc++.h> using namespace std; void solve() { int n, m; cin >> n >> m; vector<pair<string, int>> a(n); int c = 1; for (auto &t : a) { cin >> t.first; t.second = c++; } for (auto &t : a) { for (int i = 1; i < m; i += 2) { t.first[i] = z - t.first... |
#include <bits/stdc++.h> using namespace std; string r, s, t, u; int mini; int main() { int i, j, k; cin >> r >> u; int n, m = u.size(); mini = INT_MAX; s = ; for (i = 0; i < m; i++) s.append( 0 ); s.append(r); for (i = 0; i < m; i++) s.append( 0 ); n = s.size(); for (i... |
#include <bits/stdc++.h> #pragma GCC optimize(2) using namespace std; const int INF = 0x3f3f3f3f; const long long MOD = 1e9 + 7; long long n, sum[100002][2], sqsum[100002][2], cnt[100002][2], all_7[100002], s[100002], ten[200002]; long long solve(string str) { n = str.length(); memset(all_7, 0... |
/**
* Copyright 2020 The SkyWater PDK Authors
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable la... |
#include <bits/stdc++.h> using namespace std; template <typename A, typename B> inline void chmin(A& a, B b) { if (a > b) a = b; } template <typename A, typename B> inline void chmax(A& a, B b) { if (a < b) a = b; } template <class A, class B> ostream& operator<<(ostream& ost, const pair<A, B>... |
#include <bits/stdc++.h> using namespace std; int main() { char prev[26], next[26]; for (int i = 0; i < 26; i++) prev[i] = next[i] = -1; int n; cin >> n; for (int i = 0; i < n; i++) { string s; cin >> s; if (prev[s[0] - a ] == -1) prev[s[0] - a ] = 0; if (next[s[(int)s.... |
//Legal Notice: (C)2015 Altera Corporation. All rights reserved. Your
//use of Altera Corporation's design tools, logic functions and other
//software and tools, and its AMPP partner logic functions, and any
//output files any of the foregoing (including device programming or
//simulation files), and any associate... |
/*
* Copyright 2017 Google 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
*
* 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 arr[3005][3005]; long long zkw[3005 << 2], M; inline long long query(long long l, long long r) { long long ret = 1234567891; for (l += M - 1, r += M + 1; l ^ r ^ 1; l >>= 1, r >>= 1) { if (~l & 1) ret = min(ret, zkw[l ^ 1]); if (r & 1) ... |
// ICE40 RAM 4k cell, configured as 2048x2
//
// taken from Swapforth [1]
//
// [1] https://github.com/jamesbowman/swapforth
//
module SB_RAM2048x2(
output [1:0] RDATA,
input RCLK, RCLKE, RE,
input [10:0] RADDR,
input WCLK, WCLKE, WE,
input [10:0] WADDR,
input [1:0] MASK, WDATA
);
parameter I... |
#include <bits/stdc++.h> using namespace std; long long n, x, y; string s; int main() { cin.tie(0); ios_base::sync_with_stdio(0); cin >> n >> x >> y >> s; long long zeros = 0; int last = -1; for (auto c : s) { int b = (c - 0 ); if (b != last && !b) zeros++; last = b; ... |
#include <bits/stdc++.h> using namespace std; int n, c[25], coin[25]; int ans = 0; bool can; int p_b; bool good() { int cnt = 0; for (int i = 0; i < 25; i++) cnt += coin[i]; return cnt == 1; } void rec(int s, int r, int p) { if (r == 1) { if (c[p] > 1) coin[c[p]]++; p++; ... |
`timescale 1ns / 1ps
//////////////////////////////////////////////////////////////////////////////////
// Company:
// Engineer:
//
// Create Date: 2016/09/20 20:50:16
// Design Name:
// Module Name: autosm_tb
// Project Name:
// Target Devices:
// Tool Versions:
// Description:
//
// Dependencies:
//
// Rev... |
#include <bits/stdc++.h> using namespace std; int main() { int n, arr[200002], cum[200002]; long long int res = 1000000000000LL, count = 0LL, i, j, m; scanf( %d , &n); for (i = 1; i <= n; i++) { scanf( %d , &arr[i]); } for (i = 1; i <= n; i++) { cum[i] = arr[i]; } for (i ... |
// Released under GPL2.0
// (c) 2002 Tom Verbeure
module main;
integer myInt;
reg [39:0] myReg40;
reg [0:39] myReg40r;
reg [0:38] myReg39r;
reg [13:0] myReg14;
reg [7:0] myReg8;
reg [31:0] myReg32;
initial begin
$display("============================ myReg8 = 65");
myReg8 = 65;
$display(">| 65|");
$d... |
#include <bits/stdc++.h> using namespace std; int main() { long long x; x = 2; long long n; cin >> n; for (long long i = 1; i <= n; i++) { long long y = (x / i); if (y >= i * (i + 1) * (i + 1)) { throw 1; } printf( %I64d n , i * (i + 1) * (i + 1) - y); x = i... |
// (C) 1992-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 simulati... |
`timescale 1ns / 1ps
////////////////////////////////////////////////////////////////////////////////
// Company:
// Engineer:
//
// Create Date: 21:28:50 05/03/2008
// Design Name: ecsmul
// Module Name: tb1.v
// Project Name: smul_sca
// Target Device:
// Tool versions:
// Description:
//
// Verilog Tes... |
#include <bits/stdc++.h> using namespace std; int N, M, Q, A[100][100], B[10000][4], i, j; int main() { ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0); cin >> N >> M >> Q; for (i = 0; i < Q; i++) { cin >> B[i][0] >> B[i][1]; B[i][1]--; if (B[i][0] == 3) { cin >... |
#include <bits/stdc++.h> using namespace std; string s[105]; int n, m; int main() { long long l, r; cin >> l >> r; int digit1, digit2; digit1 = digit2 = 0; long long l1, r1; l1 = l; r1 = r; while (l1 != 0) { l1 /= 10; digit1++; } while (r1 != 0) { r1 /= ... |
//
// Generated by Bluespec Compiler, version 2012.01.A (build 26572, 2012-01-17)
//
// On Sat May 17 15:22:50 IDT 2014
//
// Method conflict info:
// Method: r1__write
// Conflict-free: r1__read
// Sequenced before (restricted): r2__write, r2__read
// Conflicts: r1__write
//
// Method: r1__read
// Conflict-free: r1__w... |
/*===========================================================================*/
/* Copyright (C) 2001 Authors */
/* */
/* This source file may be used and distributed without restriction provided */
... |
#include <bits/stdc++.h> using namespace std; char S[77777]; char T[77777]; char CET[77777]; int fv[77777]; inline int back(int point, int lenT, int lenS) { if (point == lenT + 1) { return 1; } int start; if (point == lenS) { start = T[point] - a + 2; } else { start =... |
`timescale 1ns / 1ps
//////////////////////////////////////////////////////////////////////////////////
// Company:
// Engineer:
//
// Create Date: 03/11/2016 02:09:05 PM
// Design Name:
// Module Name: Rotate_Mux_Array
// Project Name:
// Target Devices:
// Tool Versions:
// Description:
//
// Dependencies:
... |
#include <bits/stdc++.h> using namespace std; const int maxN = 500 + 5; const int maxM = 100000 + 5; inline long long read() { long long sum = 0, f = 1; char ch = getchar(); while (ch < 0 || ch > 9 ) { if (ch == - ) f = -1; ch = getchar(); } while (ch >= 0 && ch <= 9 ) { ... |
#include <bits/stdc++.h> using namespace std; int n, m, s = 0; int t[501][501]; int a = -1, b = -1, c = -1, d; int g = -1; int main() { ios_base::sync_with_stdio(false); cin >> n >> m; for (int i = 0; i < n - 1; i++) { for (int j = 0; j < m; j++) { cin >> t[i][j]; if (j == ... |
`timescale 1ns / 1ps
//////////////////////////////////////////////////////////////////////////////////
// Company: Case Western Reserve University
// Engineer: Matt McConnell
//
// Create Date: 14:48:00 01/25/2017
// Project Name: EECS301 Digital Design
// Design Name: Lab #2 Project
// Module Name: ... |
#include <bits/stdc++.h> using namespace std; int main() { int n = 1, i, j = 0; string s, t; getline(cin, s); getline(cin, t); for (i = 0; i < t.length(); i++) { if (s[j] == t[i]) { n++; j++; } } cout << n; } |
/**
* Copyright 2020 The SkyWater PDK Authors
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable la... |
#include <bits/stdc++.h> using namespace std; long long POW(long long A, long long N, long long MOD) { if (N == 0) return 1 % MOD; if (N == 1) return A % MOD; long long tmp = POW(A, N / 2, MOD) % MOD; if (N % 2) return ((tmp * tmp) % MOD * A % MOD) % MOD; else return (tmp * tmp) % MO... |
#include <bits/stdc++.h> using namespace std; string s; char a; int b, c, d, i, k, n; int main() { cin >> s; k = s.size(); if (k < 2) d = 1; while (n < 100 && d == 0) { while (i < k - 2 && d == 0) { if (s[i] > s[i + 2]) { a = s[i + 2]; s[i + 2] = s[i]; ... |
#include <bits/stdc++.h> using namespace std; const int N = 22e4; char s[N * 2]; int l[N * 2], r[N * 2]; int main() { ios::sync_with_stdio(0); int n, k; cin >> n >> k >> s; for (int i = 0; i < n; i++) s[i + n] = s[i]; for (int i = 0, lx = -2e9; i < n * 2; i++) { if (s[i] == s[i + 1])... |
#include <bits/stdc++.h> using std::map; using std::max; using std::min; using std::set; using std::string; using std::vector; constexpr long long magic_mod = 1000000007; constexpr long long big = 1ll << 60; struct Matrix { long long size; vector<long long> f; Matrix(long long size, long l... |
//bug284
module wrapper
(
/*AUTOOUTPUT*/
// Beginning of automatic outputs (from unused autoinst outputs)
output [1:0] bout, // From mybuf of buf
output [31:0] o, // From u_or of or
// End of automatics
/*AUTOINPUT*/
// Beginning of automatic inputs (from unused autoinst inputs)
input [1:0] ... |
`timescale 1ns / 1ps
////////////////////////////////////////////////////////////////////////////////
// Company:
// Engineer:
//
// Create Date: 22:40:09 05/12/2015
// Design Name: pipeline_control_registers
// Module Name: /media/BELGELER/Workspaces/Xilinx/processor/test_pipeline_control_registers.v
// Projec... |
#include <bits/stdc++.h> using namespace std; const int maxn = 100003; int l[maxn], r[maxn], L, R, K, n, cnt[maxn][30], sum[30], A[30], B[30]; char c[maxn], s[maxn]; int List[30][maxn], a[maxn], len[maxn], tot = 0; inline int get() { int f = 0, v = 0; char ch; while (!isdigit(ch = getchar())) ... |
#include <bits/stdc++.h> using namespace std; int n; long long a[300000]; int main() { while (cin >> n) { for (int i = 0; i < n; i++) cin >> a[i]; sort(a, a + n); long long ans = 0; for (int i = 0; i < n; i++) { int x = (i == n - 1 ? -1 : 0); ans += (x + i + 2) * a[i]... |
///////////////////////////////////////////////////////////////////////////////
//
// Project: Aurora Module Generator version 2.2
//
// Date: $Date: 2004/11/08 16:19:25 $
// Tag: $Name: i+H-38+78751 $
// File: $RCSfile: channel_error_detect.ejava,v $
// Rev: $Revision: 1.1.6... |
#include <bits/stdc++.h> using namespace std; int main() { bitset<30> a; bitset<30> b; a.reset(); b.reset(); bool bigger = 0; cout << ? 0 0 << endl; fflush(stdout); int aa; cin >> aa; if (aa == -1) { bigger = 1; } bitset<30> adda; bitset<30> addb; for ... |
#include <bits/stdc++.h> using namespace std; int n, m = 100000, a, b, c, cnt; struct Point { int x, y; Point() {} Point(int a, int b) { x = a, y = b; } bool operator==(Point b) const { return x == b.x && y == b.y; } Point operator+(Point b) { return Point(x + b.x, y + b.y); } Point operat... |
#include <bits/stdc++.h> using namespace std; const int MAXN = 257, MOD = 1e9 + 7; int pk[MAXN * MAXN], pk1[MAXN * MAXN], n, k, f[MAXN][MAXN], C[MAXN][MAXN]; int mul(int a, int b) { return 1LL * a * b % MOD; } void add(int &a, const int &b) { a += b; if (a >= MOD) a -= MOD; } void sub(int &a, cons... |
/***************************************************************************************************
** fpga_nes/hw/src/cpu/rp2a03.v
*
* Copyright (c) 2012, Brian Bennett
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without modification, are permitted
* provided that the fol... |
#include <bits/stdc++.h> using namespace std; bool check(char a) { if (a == a || a == e || a == i || a == o || a == u ) return true; if (a == 1 || a == 3 || a == 5 || a == 7 || a == 9 ) return true; return false; } int main() { ios_base::sync_with_stdio(false); cin.tie(0); ... |
#include <bits/stdc++.h> using namespace std; int main() { int n; scanf( %d , &n); vector<int> h(n), res(n); for (int i = 0; i < (int)(n); i++) { scanf( %d , &h[i]); } int bad = 0; int ans = 0; for (int i = 0; i < (int)(n); i++) { bad = min(bad, h[i] - i - 1); res[i... |
#include <bits/stdc++.h> using namespace std; int main() { int a[1002], b[1002], n, m; while (cin >> n >> m) { for (int i = 0; i < n; i++) cin >> a[i]; for (int i = 0; i < n; i++) cin >> b[i]; double be = m; bool flag = 0; for (int i = n - 1; i >= 0; i--) { be = be * b[... |
//
// 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; int n, m; int a[1 << 20]; int main() { scanf( %d%d , &n, &m); map<int, int> p; for (int i = 1; i <= n; i++) { int fi; scanf( %d , &fi); if (p.count(fi)) { p[fi] = 0; } else { p[fi] = i; } } bool im = ... |
#include <bits/stdc++.h> using namespace std; int main() { int n, x, y; cin >> n; vector<int> adj[n + 1], deg(n + 1, 0); vector<pair<int, int>> input; for (int i = 0; i < n - 1; i++) { cin >> x >> y; input.push_back(make_pair(x, y)); adj[x].push_back(y); adj[y].push_back(... |
// (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 ... |
#include <bits/stdc++.h> using namespace std; int ans[101]; int main() { int t; scanf( %d , &t); while (t--) { int n, cnt = 0; scanf( %d , &n); for (int i = 1; i <= n; i *= 2) { ans[++cnt] = i; n -= i; } if (n > 0) { ans[++cnt] = n; sort(an... |
#include <bits/stdc++.h> using namespace std; const int MAX = 205, MAXL = 1 << 20; char qq[MAXL]; char s[MAX][MAX]; pair<int, int> kamo[MAX][MAX]; vector<pair<int, int> > R[MAX][MAX]; int indeg[MAX][MAX]; int cik[MAX][MAX]; int imacik[MAX * MAX][10]; int brred, brstup; int pr[10], ps[10]; int bi... |
#include <bits/stdc++.h> using namespace std; const int N_MAX = 51000; int X[N_MAX], Y[N_MAX], Z[N_MAX]; bool vis[N_MAX]; bool ff(int i, int j) { if (X[i] != X[j]) return X[i] < X[j]; if (Y[i] != Y[j]) return Y[i] < Y[j]; return Z[i] < Z[j]; } int main() { int n; cin >> n; vector<i... |
module LookAheadAdder(a,b,cin,s,cout);
input wire [3:0]a;
input wire [3:0]b;
input wire cin;
output wire [3:0]s;
output wire cout;
wire [3:0]c;
wire [3:0]G;
wire [3:0]P;
assign G[3]=a[3]&&b[3];
assign G[2]=a[2]&&b[2];
assign G[1]=a[1]&&b[1];
assign G[0]=a[0]&&b[0];
assign P[3]=a[3]&&~b[3]||~a[3]&&b[3];
as... |
//*****************************************************************************
// DISCLAIMER OF LIABILITY
//
// This file contains proprietary and confidential information of
// Xilinx, Inc. ("Xilinx"), that is distributed under a license
// from Xilinx, and may be used, copied and/or disclosed only
// pursuant to the... |
#include<bits/stdc++.h> using namespace std; typedef long long ll; #define F first #define S second const int MXN = 200040; int cnt[MXN]; bool b[MXN]; ll n,d; int main(){ int t; cin >> t; while(t--){ string s; cin >> s; int n = s.size();... |
#include <bits/stdc++.h> using namespace std; int main() { ios_base::sync_with_stdio(0); ; int n, k; cin >> n >> k; while (n > 0 && k > 0) { k--; if (n % 10 == 0) n = n / 10; else n--; } cout << n << n ; return 0; } |
/**
* Copyright 2020 The SkyWater PDK Authors
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable la... |
#include <bits/stdc++.h> using namespace std; int R[300010 * 2], L[300010 * 2], n, m, sum[300010], sz; struct Fun { int k, b; } f[300010], id[300010 * 20], s[300010]; inline int Read() { char c = getchar(); int num = 0, f = 1; while ( 0 > c || c > 9 ) { if (c == - ) f = -1; c = ... |
// megafunction wizard: %RAM: 2-PORT%VBB%
// GENERATION: STANDARD
// VERSION: WM1.0
// MODULE: altsyncram
// ============================================================
// File Name: RAM16_s36_s36_altera.v
// Megafunction Name(s):
// altsyncram
//
// Simulation Library Files(s):
// altera_mf
// ===... |
#include <bits/stdc++.h> using namespace std; char ch[100010], temp[100010]; bool ok[100010]; int main() { int n; cin >> n; cin >> ch; int m = strlen(ch); for (int i = 1; i < n; i++) { cin >> temp; for (int j = 0; j < m; j++) { if (ch[j] >= a && ch[j] <= z && temp[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... |
// file: Clock65MHz_tb.v
//
// (c) Copyright 2008 - 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
// laws.
//
// DISCLAIMER
// This disclaimer is no... |
#include <cstdio> #include <iostream> #define ll long long using namespace std; int n , m , cnt = 0; const int N = 5e5 + 5; const int mod = 1e9 + 7; ll pow2[N]; int num[N] , fa[N]; int find(int x){ if(fa[x] == x) return x; return fa[x] = find(fa[x]); } int main(){... |
// 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 15:44:51 2017
// Host : TacitMonolith running 64-bit Ubuntu 16.04.3... |
#include <bits/stdc++.h> using namespace std; const int INF = 1000000001; const double EPS = 10e-9; const int MAXN = 100005; pair<int, int> t[MAXN << 1]; int MOD; void rob() { int n; scanf( %d , &n); int tmp; for (typeof(0) i = (0); i < (n); ++i) { scanf( %d , &tmp); t[i] = mak... |
/*******************************************************************************
*
* NetFPGA-10G http://www.netfpga.org
*
* File:
* timestamp_insertion_pkt_train.v
*
* Library:
* hw/osnt/pcores/osnt_10g_interface_v1_11_a
*
* Module:
* nf10_10g_interface
*
* Author:
* Anton... |
#include <bits/stdc++.h> using namespace std; const int MX = 100010; int t[MX]; int main() { int n; cin >> n; for (int i = (1); i <= (n); ++i) { scanf( %d , &t[i]); } for (int i = (1); i <= (n); ++i) { printf( %d , t[i] + t[i + 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 la... |
// ========== Copyright Header Begin ==========================================
//
// OpenSPARC T1 Processor File: sctag_dirg_buf.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 an... |
#include <bits/stdc++.h> using namespace std; int a[200][200], ans, n; bool flag = true; int main() { ios::sync_with_stdio(false); cin >> a[80][80] >> n; while (flag) { flag = false; for (int i = 1; i < 160; i++) for (int j = 1; j < 160; j++) if (a[i][j] >= 4) { ... |
//*****************************************************************************
// (c) Copyright 2008-2009 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
// ... |
/**
* 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) 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
// -- laws.
// --
// -- DISCLAIMER
// -- This disclaimer is not a... |
// Testbench for m6502 ALU.
module tb_m6502_alu;
reg [7 : 0] tb_operation;
reg [7 : 0] tb_op_a;
reg [7 : 0] tb_op_b;
reg tb_carry_in;
wire [7 : 0] tb_result;
wire tb_carry;
wire tb_zero;
wire tb_overflow;
reg [31 : 0] error_ctr;
reg [31 : 0] tc_ctr;
//---... |
// -- test force/release of:
// a wire assigned to a reg
// a wire with no assignment
// a whole bus (assigned to a reg),
// a single bit of a bus (assigned to a reg)
// -- make sure the force/release is passed into the hierarchy
//
// -- run with
// iverilog -Wall tt.v
// vvp a.... |
#include <bits/stdc++.h> int main() { int n, a, b, c, sum = 0, i, j; int d[10001] = {0}; scanf( %d %d %d %d , &n, &a, &b, &c); for (i = 0; i <= a / 2; i++) d[i]++; for (i = a / 2; i >= 0; i--) { for (j = 1; j <= b && i + j <= n; j++) { d[i + j]++; } } for (i = 0; i <= c... |
#include <bits/stdc++.h> using namespace std; const int N = (int)4e2; const int INF = (int)1e9; int n, m, a[N][N], p; int dyn[N][N], last[N]; vector<pair<int, int> > q[N * N]; int len[N][N]; int main() { cin >> n >> m >> p; for (int i = 0; i < n; ++i) { for (int j = 0; j < m; ++j) { ... |
#include <bits/stdc++.h> using namespace std; int main() { string s; cin >> s; string t = ; for (int i = 0; i < s.length(); i++) { if (s[i] != a && s[i] != e && s[i] != i && s[i] != o && s[i] != u && s[i] != y && s[i] != Y && s[i] != A && s[i] != E && s[... |
//Legal Notice: (C)2013 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... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.