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-09-27 08:16:11
please4 u do nigga wadddaf]



Last edit: 2019-09-27 08:16:31
2019-09-23 11:21:16
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
ll ans=INT_MAX,s=0,a,b,c[123456],sum1,d,e,i,j,n;
int main(){
ios_base::sync_with_stdio(NULL);
cin.tie(NULL);
cout.tie(NULL);
cin>>n;
for(i=1;i<=n;i++){
if(i==1){
cout<<0<<endl;continue;
}
if(i==2){
cout<<6<<endl;continue;
}
if(i==3){
cout<<28<<endl;continue;
}
if(i==4){
cout<<96<<endl;continue;
}
a=i*i*(i*i-1);
cout<<(a-8*(i-4)*(i-4)+112-40*i)/2<<endl;
}
}
2019-09-16 06:13:40
95170271 ohidoo zalgaarai
2019-09-11 04:54:43
nadaa hamaagu
2019-07-23 08:32:05
#include<bits/stdc++.h>

using namespace std;

int main () {
int i,n,s,k,p;
char x;
char a[1000];
// freopen("Text hashilt.in","r",stdin);
// freopen("Text hashilt.out","w",stdout);
n=1;
while (scanf("%c",&x)!=EOF) {
a[n]=x;
n++;
}
for(i=1;i<=n;i++) {
if(a[i]=='"'){
if (p==2) {
a[i]='}';
p=1;
}
else {
a[i]='{';
p=2;
}
}
}
for(i=1;i<n;i++) {
cout<<a[i];
}

return 0;

}
2019-07-04 17:23:47
https://sg.acolytefight.io/?party=p32-eda2

Last edit: 2019-07-05 09:32:12
2019-04-06 11:53:50
#include<bits/stdc++.h>
using namespace std;
long long k=1,ans,a[123],b[123],d,e,i,j,n,c;
string s,s1;
int main(){
ios_base::sync_with_stdio(NULL);
cin.tie(NULL);
cout.tie(NULL);
cin>>s;
a[0]=0;
b[0]=0;
for(i=0;i<s.size();i++){

if(s[i]=='A'){
a[k]=a[k-1]+1;
b[k]=b[k-1];
}
else{
b[k]=b[k-1]+1;
a[k]=a[k-1];
}
k++;
}
for(i=0;i<=s.size();i++){
for(j=i+1;j<=s.size();j++){
if(a[j]-a[i]==b[j]-b[i]){
ans++;
//cout<<i<<" "<<j<<endl;
}
}
}
cout<<ans;
}
ABAB
2019-04-05 12:37:59
#include<bits/stdc++.h>
using namespace std;
#define ll long long
#define mk make_pair
#define pb push_back
#define ios ios_base::sync_with_stdio(); cin.tie(0); cout.tie(0);
ll sum1,sum2,a,b,t,c[1234567],ans,d[1234567],e[1234567],r,i,j,n;
vector<char> v3,v2,v,v1;
int main(){
ios
string s3,s2,s,s1;
cin>>s;
a=s.size();
ans=s.size()-1;
while(s.size()>0){
s1=s;
reverse(s1.begin(),s1.end());
if(s==s1){
cout<<a-s.size();
exit(0);
}
s.erase(s.begin());
}
}
2019-04-04 12:07:26
#include<bits/stdc++.h>
using namespace std;
#define mk make_pair
#define ll long long
#define ios ios_base::sync_with_stdio(); cin.tie(0); cout.tie(0);
ll a[100][100],n,m,c,d,e,i,j,x,y,xx,yy;
pair<ll,ll> b[100][100];
queue< pair < ll,ll> > q;
int main(){
ios
cin>>x>>y>>xx>>yy;
q.push(mk(x,y));
for(i=1;i<=100;i++){
for(j=1;j<=100;j++){
a[i][j]=9999;
}
}
a[x][y]=0;
while(!q.empty()){
n=q.front().first;
m=q.front().second;
if(n<1 || m<1 || n>10 || m>10 ) q.pop();
else{
if(n==xx&&m==yy){ break; }
if(a[n+1][m+2]==9999){
q.push(mk(n+1,m+2));
b[n+1][m+2]=mk(n,m);
a[n+1][m+2]=a[n][m]+1;
}
if(a[n+1][m-2]==9999){
q.push(mk(n+1,m-2));
b[n+1][m-2]=mk(n,m);
a[n+1][m-2]=a[n][m]+1;
}
if(a[n-1][m+2]==9999){
q.push(mk(n-1,m+2));
b[n-1][m+2]=mk(n,m);
a[n-1][m+2]=a[n][m]+1;
}
if(a[n-1][m-2]==9999){
q.push(mk(n-1,m-2));
b[n-1][m-2]=mk(n,m);
a[n-1][m-2]=a[n][m]+1;
}
if(a[n+2][m+1]==9999){
q.push(mk(n+2,m+1));
b[n+2][m+1]=mk(n,m);
a[n+2][m+1]=a[n][m]+1;
}
if(a[n+2][m-1]==9999){
q.push(mk(n+2,m-1));
b[n+2][m-1]=mk(n,m);
a[n+2][m-1]=a[n][m]+1;
}
if(a[n-2][m+1]==9999){
q.push(mk(n-2,m+1));
b[n-2][m+1]=mk(n,m);
a[n-2][m+1]=a[n][m]+1;
}
if(a[n-2][m-1]==9999){
q.push(mk(n-2,m-1));
b[n-2][m-1]=mk(n,m);
a[n-2][m-1]=a[n][m]+1;
}
q.pop();
}
}
cout<<a[xx][yy]<<endl;
cout<<xx<<" "<<yy<<endl;
while(b[xx][yy].first!=x && b[xx][yy].second!=y){
cout<<b[xx][yy].first<<" "<<b[xx][yy].second<<endl;
n=b[xx][yy].first;
m=b[xx][yy].second;
xx=n;
yy=m;
}
cout<<x<<" "<<y;
}
2019-04-04 06:20:24
#include<stdio.h>
#include<stdlib.h>
#include<math.h>
using namespace std;
main()
{ int a[100];
int k,m,j,i,n;
scanf("%d",&n);
for(i=1;i<=n;i++)
scanf("%d",a[i]);
for(i=1;i<=n;i++)
printf("%5d\n",a[i]);
for(i=1;i>=2;i--)
k=i; m=a[i];
for(j=1;j<=i-1;j--)
if(a[j]>m)
k=j;
m=a[n];
if(k!=i){
a[k]=a[i];
a[i]=m;
} for(i=1;i<=n;i++)
printf("%5d\n",a[i]);
system("pause");
}
© Spoj.com. All Rights Reserved. Spoj uses Sphere Engine™ © by Sphere Research Labs.