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.|

RGB7002 - Гурвалжин

Өгөгдсөн гурвалжны периметрийг ол.

Input

Гурвалжны талууд бүхэл тоогоор нэг мөрөнд зайгаар тусгаарлагдан өгөгдөнө.

Output

Гурвалжны периметр.

Example

Input:
3 4 5

Output:
12


Нэмсэн:Bataa
Огноо:2011-01-15
Хугацааны хязгаарлалт:1s
Эх кодын хэмжээний хязгаарлалт:50000B
Memory limit:1536MB
Cluster: Cube (Intel G860)
Програмчлалын хэлүүд:ADA95 ASM32 BASH BF C NCSHARP CSHARP C++ 4.3.2 CPP C99 CLPS LISP sbcl LISP clisp D ERL FORTRAN HASK ICON ICK JAVA JS-RHINO JULIA LUA NEM NICE OCAML PAS-GPC PAS-FPC PERL PHP PIKE PRLG-swi PYTHON PYPY3 PYTHON3 RUBY SCALA SCM guile ST TCL WHITESPACE

hide comments
2019-03-25 02:40:00
#include <iostream>
using namespace std;
main()
{
int a,b,c,p;
cin>>a>>b>>c;
p=a+b+c;
cout<<p;
}
2019-03-22 09:37:58
#include<stdio.h>
main()
int a,b,c;
scanf("%d%d%d",&a,&b,&c);
printf("%d",a+b+c);
return 0;
}
2019-02-28 11:42:43
#include<bits/stdc++.h>
using namespace std;
long long a[100000],b[100000],i,j,k,l,n,m;
main(){
cin>>n;
for(i=1; i<=n; i++) cin>>a[i];
b[1]=a[1];
b[2]=a[1]+a[2];

for(i=3; i<=n; i++)
b[i]=max(a[i]+a[i-1]+b[i-3] , max(a[i]+b[i-2],b[i-1]));

k=b[1];
for(i=2; i<=n; i++) k=max(b[i],k);
cout<<k;
}
2019-02-28 10:12:55
oorooo bod novshoo

Last edit: 2019-02-28 10:14:07
2019-02-28 09:49:51
#include<bits/stdc++.h>
using namespace std;
int main(){
long long a,b,c[100005],d,e,i,j,n,dp[1000005];
cin>>a;
for(i=1;i<=a;i++){
cin>>c[i];
}
sort(c+1,c+a+1);
dp[1]=INT_MAX;
dp[2]=c[2]-c[1];
for(i=3;i<=a;i++){
dp[i]=min(dp[i-1],dp[i-2])+c[i]-c[i-1];
}
cout<<dp[a];
}
2019-02-21 04:23:27
#include<bits/stdc++.h>
using namespace std;
int main(){
int i = 0,e,m[1000],j,o = 0,y = 0;
while(cin>>e) {
m[i] = e;
i ++;
}
for(j = 1; j < i; j ++){
if(m[j] > m[j-1] && m[j] > m[j+1]) o ++;
if(m[j] < m[j-1] && m[j] < m[j+1]) y ++;
}
cout<<o<<" "<<y;
}
2019-02-13 10:39:08
#include<bits/stdc++.h>
using namespace std;
long long n;
int main()
{
cin >> n;
pair <int, int>a[n];
int p = 0;
int q[n], c[n];
for (int i = 0; i < n; i++)
{
cin >> a[i].first;
c[i] = a[i].first;
a[i].second = i;
}
sort (a, a + n);
for (int i = 0; i < n; i++)
if (a[i].first != a[i + 1].first)
{
q[p] = a[i].second;
p++;
}
sort (q, q + p);
cout << p << "\n";
for (int i = 0; i < p; i++)
cout << c[q[i]] << " ";

}
2019-02-13 08:44:39
B
#include<bits/stdc++.h>
using namespace std;

int main(){
int N;
char c;
cin>>N;
int a = 0;
int b= 0;
while(N--)
{
cin>>c;
if(c=='x')
{
a++;
}
else
{
a=0;
}

if(a>=3)
{
b++;
}
}
cout<<b<<endl;
return 0;
}
2019-01-31 14:29:32
#include<bits/stdc++.h>
using namespace std;
int main(){
long long ans=0,a[100005],b[100005],c[100005],d[100005],e,i,j,n;
long long a1=-INFINITY,a2=INFINITY;
cin>>n;
for(i=1;i<=n;i++){
cin>>a[i];
}
for(i=1;i<=n;i++){
a1=max(a1,a[i]);
a2=min(a2,a[i]);
}
}
2019-01-30 04:32:26
#include<stdio.h>
#include<conio.h>
main(void) {
int a,b,c,d;
printf("Ogogdson gurwaljinii primetriig ol?\n");
printf("a too: "); scanf("%d", &a);
printf("b too: "); scanf("%d", &b);
printf("c too: "); scanf("%d", &c);
d = a + b + c;
printf("Primetr: %d", d);
}
© Spoj.com. All Rights Reserved. Spoj uses Sphere Engine™ © by Sphere Research Labs.