Rumah hujung hadapan web html tutorial Codeforces #282 div2 ABC_html/css_WEB-ITnose

Codeforces #282 div2 ABC_html/css_WEB-ITnose

Jun 24, 2016 am 11:52 AM

A. Digital Counter

time limit per test

1 second

memory limit per test

256 megabytes

input

standard input

output

standard output

Malek lives in an apartment block with 100 floors numbered from 0 to 99. The apartment has an elevator with a digital counter showing the floor that the elevator is currently on. The elevator shows each digit of a number with 7 light sticks by turning them on or off. The picture below shows how the elevator shows each digit.

One day when Malek wanted to go from floor 88 to floor 0 using the elevator he noticed that the counter shows number 89 instead of 88. Then when the elevator started moving the number on the counter changed to 87. After a little thinking Malek came to the conclusion that there is only one explanation for this: One of the sticks of the counter was broken. Later that day Malek was thinking about the broken stick and suddenly he came up with the following problem.

Suppose the digital counter is showing number n. Malek calls an integer x (0?≤?x?≤?99) good if it's possible that the digital counter was supposed to show x but because of some(possibly none) broken sticks it's showing n instead. Malek wants to know number of good integers for a specific n. So you must write a program that calculates this number. Please note that the counter always shows two digits.

Input

The only line of input contains exactly two digits representing number n (0?≤?n?≤?99). Note that n may have a leading zero.

Output

In the only line of the output print the number of good integers.

Sample test(s)

Input

89
Salin selepas log masuk

Output

Input

00
Salin selepas log masuk

Output

Input

73
Salin selepas log masuk

Output

15
Salin selepas log masuk

Note

In the first sample the counter may be supposed to show 88 or 89.

In the second sample the good integers are 00, 08, 80 and 88.

In the third sample the good integers are 03,?08,?09,?33,?38,?39,?73,?78,?79,?83,?88,?89,?93,?98,?99.


#include <iostream>#include <stdio.h>#include <string>#include <cstring>#include <algorithm>#include <cmath>#define N 1000#define ll __int64using namespace std;int vis[20]={2,7,2,3,3,4,2,5,1,2};//电梯数字显示出现不同程度损坏,可能有一个或几个stick熄灭,算出每个数字存在的情况</cmath></algorithm></cstring></string></stdio.h></iostream>
Salin selepas log masuk
<span style="font-family: Arial, Helvetica, sans-serif; font-size: 12px;">int main()</span>
Salin selepas log masuk
{    int n;    while(~scanf("%d",&n))    {        int ans=1;        int a=n%10;        int b=n/10;        ans*=vis[a];        ans*=vis[b];        cout  <p></p>  <p class="sycode">   </p><p class="sycode">    B. Modular Equations   </p>   <p class="sycode">    </p><p class="sycode">     time limit per test    </p> 1 second      <p class="sycode">    </p><p class="sycode">     memory limit per test    </p> 256 megabytes      <p class="sycode">    </p><p class="sycode">     input    </p> standard input      <p class="sycode">    </p><p class="sycode">     output    </p> standard output       <p class="sycode">   </p><p>Last week, Hamed learned about a new type of equations in his math class called Modular Equations. Lets define i modulo j as the remainder of division of i by j and denote it by . A Modular Equation, as Hamed's teacher described, is an equation of the form  in which a and b are two non-negative integers and x is a variable. We call a positive integer x for which  a solution of our equation.</p>   <p>Hamed didn't pay much attention to the class since he was watching a movie. He only managed to understand the definitions of these equations.</p>   <p>Now he wants to write his math exercises but since he has no idea how to do that, he asked you for help. He has told you all he knows about Modular Equations and asked you to write a program which given two numbers a and b determines how many answers the Modular Equation  has.</p>    <p class="sycode">   </p><p class="sycode">    Input   </p>   <p>In the only line of the input two space-separated integers a and b (0?≤?a,?b?≤?109) are given.</p>    <p class="sycode">   </p><p class="sycode">    Output   </p>   <p>If there is an infinite number of answers to our equation, print "infinity" (without the quotes). Otherwise print the number of solutions of the Modular Equation .</p>    <p class="sycode">   </p><p class="sycode">    Sample test(s)   </p>   <p class="sycode">    </p><p class="sycode">     </p><p class="sycode">      Input     </p>     <pre class="brush:php;toolbar:false">21 5
Salin selepas log masuk

Output

Input

9435152 272
Salin selepas log masuk

Output

282
Salin selepas log masuk

Input

10 10
Salin selepas log masuk

Output

infinity
Salin selepas log masuk

Note

In the first sample the answers of the Modular Equation are 8 and 16 since


#include <iostream>#include <stdio.h>#include <string>#include <cstring>#include <algorithm>#include <cmath>#define N 10000009#define ll __int64using namespace std;//a=b+kx;因为数据比较大10^9,所有不能直接暴力,稍微转化一下</cmath></algorithm></cstring></string></stdio.h></iostream>
Salin selepas log masuk
int main(){    ll a,b;    while(~scanf("%I64d%I64d",&a,&b))    {        ll c=a-b;        if(a==b)        {            printf("infinity\n");            continue;        }        if(a<b printf continue ll ans="0;" for i="1;i*i<=c;i++)" if>b)                {                    ans++;                }                if( i*i<c>b) )                  ans++;            }        }        cout  <br>  <p class="sycode">   </p>
<p class="sycode">    C. Treasure   </p>   <p class="sycode">    </p>
<p class="sycode">     time limit per test    </p> 2 seconds      <p class="sycode">    </p>
<p class="sycode">     memory limit per test    </p> 256 megabytes      <p class="sycode">    </p>
<p class="sycode">     input    </p> standard input      <p class="sycode">    </p>
<p class="sycode">     output    </p> standard output       <p class="sycode">   </p>
<p>Malek has recently found a treasure map. While he was looking for a treasure he found a locked door. There was a string s written on the door consisting of characters '(', ')' and '#'. Below there was a manual on how to open the door. After spending a long time Malek managed to decode the manual and found out that the goal is to replace each '#' with one or more ')' characters so that the final string becomes beautiful. </p>   <p>Below there was also written that a string is called beautiful if for each i (1?≤?i?≤?|s|) there are no more ')' characters than '(' characters among the first i characters of s and also the total number of '(' characters is equal to the total number of ')' characters. </p>   <p>Help Malek open the door by telling him for each '#' character how many ')' characters he must replace it with.</p>    <p class="sycode">   </p>
<p class="sycode">    Input   </p>   <p>The first line of the input contains a string s (1?≤?|s|?≤?105). Each character of this string is one of the characters '(', ')' or '#'. It is guaranteed that s contains at least one '#' character.</p>    <p class="sycode">   </p>
<p class="sycode">    Output   </p>   <p>If there is no way of replacing '#' characters which leads to a beautiful string print ?-?1. Otherwise for each character '#' print a separate line containing a positive integer, the number of ')' characters this character must be replaced with.</p>   <p>If there are several possible answers, you may output any of them.</p>    <p class="sycode">   </p>
<p class="sycode">    Sample test(s)   </p>   <p class="sycode">    </p>
<p class="sycode">     </p>
<p class="sycode">      Input     </p>     <pre class="brush:php;toolbar:false">(((#)((#)
Salin selepas log masuk

Output

12
Salin selepas log masuk

Input

()((#((#(#()
Salin selepas log masuk

Output

221
Salin selepas log masuk

Input

Output

-1
Salin selepas log masuk
Salin selepas log masuk

Input

(#)
Salin selepas log masuk

Output

-1
Salin selepas log masuk
Salin selepas log masuk

Note

|s| denotes the length of the string s.


#include <stdio.h>#include <string>#include <cstring>#include <algorithm>#include <iostream>#include <vector>#define N 100009using namespace std;char str[N];vector<int> t;int main(){    while(~scanf("%s",str))    {        int a=0,b=0,c=0;        int num=0;        int len=strlen(str);        for(int i=0;i<len if a else b c int f="1;" for i="0;i<len;i++)" break t.push_back num-="(a-b);" c-- num-- num cout return>  <br>  <br>  <p></p>  <p><br> </p>  <p><br> </p>  <p><br> </p>  <p><br> </p>  <p><br> </p>  <p><br> </p>  <p><br> </p>  <p><br> </p>  <p><br> </p> </len></int></vector></iostream></algorithm></cstring></string></stdio.h>
Salin selepas log masuk
Kenyataan Laman Web ini
Kandungan artikel ini disumbangkan secara sukarela oleh netizen, dan hak cipta adalah milik pengarang asal. Laman web ini tidak memikul tanggungjawab undang-undang yang sepadan. Jika anda menemui sebarang kandungan yang disyaki plagiarisme atau pelanggaran, sila hubungi admin@php.cn

Alat AI Hot

Undresser.AI Undress

Undresser.AI Undress

Apl berkuasa AI untuk mencipta foto bogel yang realistik

AI Clothes Remover

AI Clothes Remover

Alat AI dalam talian untuk mengeluarkan pakaian daripada foto.

Undress AI Tool

Undress AI Tool

Gambar buka pakaian secara percuma

Clothoff.io

Clothoff.io

Penyingkiran pakaian AI

AI Hentai Generator

AI Hentai Generator

Menjana ai hentai secara percuma.

Artikel Panas

R.E.P.O. Kristal tenaga dijelaskan dan apa yang mereka lakukan (kristal kuning)
3 minggu yang lalu By 尊渡假赌尊渡假赌尊渡假赌
R.E.P.O. Tetapan grafik terbaik
3 minggu yang lalu By 尊渡假赌尊渡假赌尊渡假赌
R.E.P.O. Cara Memperbaiki Audio Jika anda tidak dapat mendengar sesiapa
3 minggu yang lalu By 尊渡假赌尊渡假赌尊渡假赌
WWE 2K25: Cara Membuka Segala -galanya Di Myrise
3 minggu yang lalu By 尊渡假赌尊渡假赌尊渡假赌

Alat panas

Notepad++7.3.1

Notepad++7.3.1

Editor kod yang mudah digunakan dan percuma

SublimeText3 versi Cina

SublimeText3 versi Cina

Versi Cina, sangat mudah digunakan

Hantar Studio 13.0.1

Hantar Studio 13.0.1

Persekitaran pembangunan bersepadu PHP yang berkuasa

Dreamweaver CS6

Dreamweaver CS6

Alat pembangunan web visual

SublimeText3 versi Mac

SublimeText3 versi Mac

Perisian penyuntingan kod peringkat Tuhan (SublimeText3)

Apakah tujuan & lt; kemajuan & gt; unsur? Apakah tujuan & lt; kemajuan & gt; unsur? Mar 21, 2025 pm 12:34 PM

Artikel ini membincangkan html & lt; kemajuan & gt; elemen, tujuan, gaya, dan perbezaan dari & lt; meter & gt; elemen. Tumpuan utama adalah menggunakan & lt; kemajuan & gt; untuk menyelesaikan tugas dan & lt; meter & gt; untuk stati

Apakah tujuan & lt; DATALIST & GT; unsur? Apakah tujuan & lt; DATALIST & GT; unsur? Mar 21, 2025 pm 12:33 PM

Artikel ini membincangkan html & lt; datalist & gt; elemen, yang meningkatkan bentuk dengan menyediakan cadangan autokomplete, meningkatkan pengalaman pengguna dan mengurangkan kesilapan. Kira -kira: 159

Apakah amalan terbaik untuk keserasian penyemak imbas dalam HTML5? Apakah amalan terbaik untuk keserasian penyemak imbas dalam HTML5? Mar 17, 2025 pm 12:20 PM

Artikel membincangkan amalan terbaik untuk memastikan keserasian silang pelayar HTML5, memberi tumpuan kepada pengesanan ciri, peningkatan progresif, dan kaedah ujian.

Apakah tujuan & lt; meter & gt; unsur? Apakah tujuan & lt; meter & gt; unsur? Mar 21, 2025 pm 12:35 PM

Artikel ini membincangkan html & lt; meter & gt; elemen, digunakan untuk memaparkan nilai skalar atau pecahan dalam julat, dan aplikasi umum dalam pembangunan web. Ia membezakan & lt; meter & gt; dari & lt; kemajuan & gt; dan Ex

Bagaimana saya menggunakan html5 & lt; masa & gt; elemen untuk mewakili tarikh dan masa secara semantik? Bagaimana saya menggunakan html5 & lt; masa & gt; elemen untuk mewakili tarikh dan masa secara semantik? Mar 12, 2025 pm 04:05 PM

Artikel ini menerangkan html5 & lt; time & gt; elemen untuk perwakilan tarikh/masa semantik. Ia menekankan pentingnya atribut DateTime untuk pembacaan mesin (format ISO 8601) bersama teks yang boleh dibaca manusia, meningkatkan aksesibilit

Bagaimana saya menggunakan atribut pengesahan borang html5 untuk mengesahkan input pengguna? Bagaimana saya menggunakan atribut pengesahan borang html5 untuk mengesahkan input pengguna? Mar 17, 2025 pm 12:27 PM

Artikel ini membincangkan menggunakan atribut pengesahan bentuk HTML5 seperti had, corak, min, max, dan panjang untuk mengesahkan input pengguna secara langsung dalam penyemak imbas.

Apakah tag meta viewport? Mengapa penting untuk reka bentuk responsif? Apakah tag meta viewport? Mengapa penting untuk reka bentuk responsif? Mar 20, 2025 pm 05:56 PM

Artikel ini membincangkan tag Meta Viewport, penting untuk reka bentuk web responsif pada peranti mudah alih. Ia menerangkan bagaimana penggunaan yang betul memastikan skala kandungan yang optimum dan interaksi pengguna, sementara penyalahgunaan boleh membawa kepada isu reka bentuk dan kebolehaksesan.

Apakah tujuan & lt; iframe & gt; Tag? Apakah pertimbangan keselamatan semasa menggunakannya? Apakah tujuan & lt; iframe & gt; Tag? Apakah pertimbangan keselamatan semasa menggunakannya? Mar 20, 2025 pm 06:05 PM

Artikel ini membincangkan & lt; iframe & gt; Tujuan TAG dalam membenamkan kandungan luaran ke dalam halaman web, kegunaan umum, risiko keselamatan, dan alternatif seperti tag objek dan API.

See all articles