Problem hidden
|This problem was hidden by Editorial Board member probably because it has incorrect language|version or invalid test data, or description of the problem is not clear.|

ABR0001 - Арифметик үйлдлүүд(жишээ)

а, b хоёр бодит тоо өгөгдөв. Эдгээр тоонуудын нийлбэр, ялгавар, үржвэрийг ол.

Input

а ба b хоёр бодит тоог хооронд нь нэг хоосон зайгаар тусгаарлан өгнө

Output

Эхний мөрөнд уг хоёр тооны нийлбэр, дараагийн мөрөнд ялгавар (a-b), гурав дахь мөрөнд үржвэрийг таслалаас хойш нэг орны нарийвчлалтай байхаар хэвлэнэ.

Example

Input:
10.5 3.6

Output:
14.1
6.9
37.8

Паскал хэл дээрх бодолт:
 
      var
        a,b:real;
      begin
        read(a,b);
        writeln(a+b:0:1);
        writeln(a-b:0:1);
        writeln(a*b:0:1);
      end. 

С хэл дээрх бодолт:
   
      #include "stdio.h"
      int main()
      {
        float a,b;
        scanf("%f%f",&a,&b);
        printf("%.1f\n%.1f\n%.1f", a+b, a-b, a*b);
        return 0;
      } 

C++ хэл дээрх бодолт:

      #include "iostream"
      using namespace std;
      int main()
      {
        double a,b;
        cin >> a >> b;
        cout.setf(ios::fixed|ios::showpoint);
        cout.precision(1);
        cout << a+b << endl << a-b << endl << a*b;
        return 0;
      } 

Нэмсэн:sw40
Огноо:2007-10-14
Хугацааны хязгаарлалт:1s
Эх кодын хэмжээний хязгаарлалт:50000B
Memory limit:1536MB
Cluster: Cube (Intel G860)
Програмчлалын хэлүүд:Бүгд дараах хэлүүдээс бусад: ADA95 ASM64 BASH BF C++ 4.3.2 C99 CLPS CLOJURE D ERL FSHARP GO ICON ICK JS-RHINO LUA NEM NICE NODEJS OBJC OCAML PERL6 PIKE PRLG-swi SCALA SCM guile SCM qobi SED ST SQLITE TCL VB.NET WHITESPACE
Эх сурвалж:Абрамов С. А.

hide comments
2023-07-28 15:27:49
ene bodlogiig c# bodson hun bna uu
2023-07-27 07:58:01 CS09D006
Ranking link zasah heregtei bna . https://www.spoj.com/CSMS/ranks2/ bolgoh heregtei bna
odoo https://www.spoj.com/CSMS/ranks bna
2023-02-13 09:27:23
#include<bits/stdc++.h>
#define int long long
#define F first
#define S second
#define pb push_back
#define mp make_pair

using namespace std;

const int M = 200005;
int a[M], b[M], z[M];
int d[M], e[M], c[M], n;
vector<pair<int, int > > V1[M], V2[M];
void spath1(int x){
priority_queue<pair<int, int > >Q;
Q.push({0, x});
while(!Q.empty()){
int w = -Q.top().F;
int u = Q.top().S;
Q.pop();

c[u] = 1;

for(auto i: V1[u]) {
int v = i.F;
int r = i.S;

if (d[v] == -1 || d[v] > w + r) {
d[v] = w + r;
Q.push(mp(-d[v],v));
}
}
while(!Q.empty() && c[Q.top().S]) Q.pop();
}
}
void spath2(int x){
priority_queue<pair<int, int > >Q;
Q.push(mp(0,x));
while(!Q.empty()){
int w = -Q.top().F;
int u = Q.top().S;
Q.pop();

c[u] = 1;

for(auto i: V2[u]) {
int v = i.F;
int r = i.S;

if (e[v] == -1 || e[v] > w + r) {
e[v] = w + r;
Q.push(mp(-e[v],v));
}
}
while(!Q.empty() && c[Q.top().S]) Q.pop();
}
}
signed main(){
ios_base::sync_with_stdio(false);
cin.tie(0); cout.tie(0);

int m; cin >> n >> m;

for (int i = 1; i <= m; i++) {
cin >> a[i] >> b[i] >> z[i];
V1[a[i]].pb({b[i], z[i]});
V2[b[i]].pb({a[i], z[i]});
}

memset(d, -1, sizeof(d));
memset(e, -1, sizeof(e));
d[1] = 0;
e[n] = 0;

spath1(1);
memset(c, 0, sizeof(c));
spath2(n);

int mn = (1LL<<62);
for (int i = 1; i <= m; i++) {
if (d[a[i]] == -1 || e[b[i]] == -1) continue ;
int x = d[a[i]] + e[b[i]] + z[i]/2;
mn = min(mn, x);
}
cout << mn;
return 0;
}
2020-04-09 17:39:25 odonhuu
float bish doable
2019-05-16 15:30:27
ene yaagaad aldaatai bolood bgn bol
2019-04-05 12:56:06


Last edit: 2019-04-05 12:57:05
2019-03-25 11:56:27
#include<bits/stdc++.h>
using namespace std;
vector <long long> v;
int main() {
long long n, i, p = 0;
cin>>n;
if(n == 0){
cout<<"10";
return 0;
}
if(n < 10){
cout<<n;
return 0;
}
for(i = 9; i >= 2; i --) {
while(n % i == 0){
n = n / i;
//cout<<n<<"\n";
v.push_back(i);
}
}
if(n > 1) {
cout<<"-1\n";
return 0;
}
reverse(v.begin() , v.end());
for(i = 0; i < v.size(); i ++)
cout<<v[i];
}

Last edit: 2019-03-25 11:59:05
2019-03-22 02:45:09
https://play.typeracer.com?rt=17jgq0msj3
2019-02-22 07:47:02
#include<bits/stdc++.h>
using namespace std;
int main(){
long long ans=INT_MAX,s=0,a[1000005],b,c,d,e,i,j,n;
cin>>n;
for(i=0;i<n;i++){
cin>>a[i];
s+=a[i];
}

for(i=0;i<(1<<n);i++){
long long sum1=0;
for(j=0;j<n;j++){
if((1<<j)&i) {
sum1+=a[j];
}
}
ans=min(ans,abs(s-2*sum1));
}
cout<<ans;

}
2017-04-25 11:25:33
#include<bits/stdc++.h>
using namespace std;
long long a[101][101];
int main()
{
int j,i,n;
cin>>n;
for(i=1; i<=n; i++)
for(j=1; j<=n; j++) cin >> a[i][j];
for(i = 1; i <= n; i++)
{
int x = i;
int y = 1;
while(x > 0 && y <= n) {
cout << a[x][y] << ' ';
x--;
y++;
}
}
for(j = 2; j <= n; j++)
{
int x = n;
int y = j;
while(x > 0 && y <= n) {
cout << a[x][y] << ' ';
x--;
y++;
}
}
return 0;
}
© Spoj.com. All Rights Reserved. Spoj uses Sphere Engine™ © by Sphere Research Labs.