Бодолт илгээх | Бүх бодолтууд | Шилдэг бодолтууд | Жагсаалт руу буцах |
CP306 - Math5 |
ӨгŃÓŠĐ˝ 3 ĐžŃОнŃОК ŃĐžĐžĐ˝Ń Đ°ŃĐ°Đ˛Ń ĐąĐ° СŃŃŃŃĐ˝ ĐžŃĐ˝Ń ŃиŃŃүүдиКн Đ°ĐťŃ Đ¸Ń ĐąĐžĐťĐžŃ ŃĐł ŃОгŃОО. ĐĽŃŃŃв Đ°ŃавŃŃĐ˝ ŃиŃŃ Đ¸Ń ĐąĐžĐť ARAVT, СŃŃŃŃĐ˝ ŃиŃŃ Đ¸Ń ĐąĐžĐť ZUUT ĐłŃĐś Ń ŃвНŃ.
Input
ĐŃŃван ĐžŃОнŃОК Đ˝ŃĐł ĐąŇŻŃ ŃĐť ŃОО ӊгӊгдӊнӊ. ĐŃĐ°Đ˛Ń ĐąĐžĐťĐžĐ˝ СŃŃŃŃĐ˝ ĐžŃОнгиКн ŃиŃŃŇŻŇŻĐ´ Đ˝Ń ŃНгааŃĐ°Đš ŃОО ӊгӊгдӊнӊ.
Output
ARAVT, ZUUT ĐłŃŃŃĐ˝ ŇŻŃ Đ´ŇŻĐ˝ĐłŇŻŇŻĐ´Đ¸ĐšĐ˝ Đ˝ŃгиКг Ń ŃвНŃĐ˝Ń.
Example
Input: 526 Output: ZUUT
Нэмсэн: | munkhbat |
Огноо: | 2015-03-09 |
Хугацааны хязгаарлалт: | 1s |
Эх кодын хэмжээний хязгаарлалт: | 50000B |
Memory limit: | 1536MB |
Cluster: | Cube (Intel G860) |
Програмчлалын хэлүүд: | Бүгд дараах хэлүүдээс бусад: ASM64 NCSHARP JS-MONKEY JULIA PYPY3 |
hide comments
|
||||||
2024-01-22 06:43:17
#include <bits/stdc++.h> int main(){ int i,j,n,t=1; scanf("%d",&n); int a[n][n]; for (i=0;i<n;i++){ if(i%2==0){ for(j=0;j<n;j++){ a[i][j]=t; t++; } } else{ for(j=n-1;j>=0;j--){ a[i][j]=t; t++; } } } for (i=0;i<n;i++){ for(j=0;j<n;j++){ printf("%3d",a[i][j]); } printf("\n"); } return 0; } |
||||||
2024-01-22 06:35:35
#include <bits/stdc++.h> using namespace std; int main(){ int t,s = 0, n = 0; cin >> t; int jin[t]; for (int i = 0; i < t; i++) { cin >> jin[i]; } int b = INT_MAX ; for (int i = 0; i < pow(2, t); i++) { int s = 0; int n = 0; for (int j=0; j<t; j++) { if ((i>>j)&1) { s=s+jin[j]; } else { n= n+jin[j]; } } int z=abs(s-n); b=min(b,z); } cout<<b; return 0; } |
||||||
2024-01-22 05:15:03
#include <bits/stdc++.h> using namespace std; int a[21]; int main() { int n,l; cin>>a[1]>>a[2]>>a[3]>>a[4]>>a[5]>>a[6]>>a[7]>>a[8]>>a[9]>>a[10]>>a[11]>>a[12]>>a[13]>>a[14]>>a[15]>>a[16]>>a[17]>>a[18]>>a[19]>>a[20]; cout<<a[20]<<" "<<a[11]<<endl; cout<<a[19]<<" "<<a[10]<<endl; cout<<a[18]<<" "<<a[9]<<endl; cout<<a[17]<<" "<<a[8]<<endl; cout<<a[16]<<" "<<a[7]<<endl; cout<<a[15]<<" "<<a[6]<<endl; cout<<a[14]<<" "<<a[5]<<endl; cout<<a[13]<<" "<<a[4]<<endl; cout<<a[12]<<" "<<a[3]<<endl; cout<<a[11]<<" "<<a[2]<<endl; cout<<a[10]<<" "<<a[1]<<endl; } |
||||||
2024-01-22 03:17:49
#include <bits/stdc++.h> using namespace std; struct point{ int x; int y; }; double zai(int x, int y, int x1,int y1) { return sqrt((x-x1)*(x-x1)+(y-y1)*(y-y1)); } int main() { int n,b,c,d; double z=-1,xl=0,xy=0; cin>>n; vector <point>v(n); for(int i=0;i<n;i++) { cin>>v[i].x>>v[i].y; } for(int i=0;i<n;i++) for(int j=0;j<n;j++) { z=max(z,zai(v[i].x,v[i].y,v[j].x,v[j].y)); } printf("%.15f",z); return 0; } Диаметрийг тохируулах |
||||||
2024-01-21 09:24:59
#include<bits/stdc++.h> using namespace std; struct point { int x; int y; } p; int main(){ int a,c; double xm = 0 , ym = 0, b; cin>>a; b = a; while(a--) { cin>>p.x>>p.y; xm += p.x; ym += p.y; } cout<<fixed<<setprecision(15)<<xm/b << " "<< ym/b; return 0; |
||||||
2024-01-21 07:21:12
#include<bits/stdc++.h> using namespace std; struct point { int x; int y; } p; double zai(int x, int y) { return sqrt(x*x+y*y); } int main(){ int a,b,c; double mx=0,z_x,z_y; cin>>a; while(a--) { cin>>p.x>>p.y; if(zai(p.x,p.y)>mx) { mx=zai(p.x,p.y); z_x=p.x; z_y=p.y; } } cout<<z_x<<" "<<z_y; return 0; } Хамгийн хол цэг Last edit: 2024-01-22 03:18:45 |
||||||
2024-01-20 11:26:06
#include <iostream> bool super(long long n) { int a = 0, s = 0, f = 0; while (n != 0) { int digit = n % 10; if (digit == 7) { s++; } else if (digit == 4) { f++; } else { a++; } n /= 10; } return (s == f && a == 0); } int main() { long long n; std::cin >> n; while (!super(n)) { n++; } std::cout << n << std::endl; return 0; } aztai too |
||||||
2024-01-20 07:04:48
#include<bits/stdc++.h> using namespace std; int jk[121]; int main() { char o[16], n[16]; int a, k, g = 0; //freopen("Tex.in","r",stdin); while(scanf("%s%s%d",&o,&n,&a)!=EOF) { jk[a]++; } k = jk[1]; for(int i = 2; i<= 120; i++) { if(k<jk[i]) k=jk[i]; } cout << k<<endl; for(int i = 0; i <= 120; i++) { if (k == jk[i]) { cout << i <<endl; } } } |
||||||
2024-01-20 06:36:54
Last edit: 2024-01-20 07:04:59 |
||||||
2024-01-18 04:18:44
#include <bits/stdc++.h> using namespace std; int a[1001], d[1001]; int main() { int n,b,j,i,c,l,q=0,k=0; cin>>n; while(1) { d[q]=n; q++; i=0; b=0; c=0; while(n!=0) { a[i]=n%10; n=n/10; i++; } sort(a+0,a+i); for(j=0; j<i; j++) b=b*10+a[j]; for(j=i-1; j>=0; j--) c=c*10+a[j]; l=abs(c-b); for(int s=0;s<q;s++) if(l==d[s]) {cout<<k+1; return 0; } k++; n=l; } } |