Бодолт илгээх | Бүх бодолтууд | Шилдэг бодолтууд | Жагсаалт руу буцах |
RGB8003 - Хамгийн бага тоо |
Тоон дараалал өгөгдөв. Хамгийн бага тоог ол. / Массив ашиглахгүй. /
Input
Эхний мөрөнд N (тоон дарааллын тоонуудын тоо) тоо өгөгдөнө.
Дараагийн мөрөнд N тоонууд зайгаар тусгаарлагдан өгөгдөнө. (Бүх тоо Integer төрөл)
Output
Хамгийн бага тоо.
Example
Input:
7
4 2 5 -1 4 6 2
Output:
-1
Нэмсэн: | Bataa |
Огноо: | 2010-01-04 |
Хугацааны хязгаарлалт: | 1s |
Эх кодын хэмжээний хязгаарлалт: | 50000B |
Memory limit: | 1536MB |
Cluster: | Cube (Intel G860) |
Програмчлалын хэлүүд: | ADA95 ASM32 ASM64 BASH BF C CSHARP C++ 4.3.2 CPP CPP14 C99 CLPS LISP sbcl LISP clisp D ERL FORTRAN HASK ICON ICK JAVA JS-RHINO LUA NEM NICE OCAML PAS-GPC PAS-FPC PERL PHP PIKE PRLG-swi PYTHON RUBY SCALA SCM guile SCM qobi ST TCL TEXT WHITESPACE |
hide comments
|
|||||
2025-02-19 14:39:27
Last edit: 2025-02-19 14:58:21 |
|||||
2025-02-14 06:37:33
#include <bits/stdc++.h> using namespace std; int main() { int m, n, x, y; cin >> m >> n >> x >> y; int moves = 0; // vertical and horizontal moves += (x - 1); // up moves += (m - x); // down moves += (y - 1); // left moves += (n - y); // right // diagonal moves += min(x - 1, y - 1); // top left moves += min(x - 1, n - y); // top right moves += min(m - x, y - 1); // bottom left moves += min(m - x, n - y); // bottom right cout << moves << endl; return 0; } |
|||||
2023-01-20 07:42:44
#include <bits/stdc++.h> using namespace std; int a[1001]; int main() { int n; cin>>n; for(int i=1; i<=n; i++) cin>>a[i]; sort(a+1,a+n+1); cout<<a[n-n+1]; } |
|||||
2015-03-21 11:45:50 Erhee
Last edit: 2015-03-26 09:48:35 |
|||||
2014-11-19 09:23:22 Ням-очир
#include<stdio.h> #include<stdlib.h> main() { int n,min=0; scanf("%d%d",&n,&min); for(int i=1;i<n;i++) { int a; scanf("%d",&a); if(a<=min) { min=a; } } printf("%d",min); system("pause"); } |
|||||
2014-01-24 15:32:59 uuganbayar
yuu ve yuun massiv ashiglahgui ntr ve haha |
|||||
2011-12-25 04:09:31 NOMIN_0702
#include<iostream.h> main() { int a,b,c,d; cin>>a; cin>>b; cin>>c; cin>>d; a<b<c<d; cout<<a<<endl; return 0; } Last edit: 2011-12-25 04:09:57 |
|||||
2011-10-24 14:59:21 enkhtsolmon
int main () { int n; cin >> n; int min = 0; for (int i = 0; i < n; i ++) { int input; cin >> input; if (input <= min) { min = input; } } cout << min; return 0; } |
|||||
2011-10-11 06:51:08 nasanbat
hooe yaj massiw ashiglahgui bodhiin yun t1 iin |
|||||
2010-10-08 16:38:05 Uka_09
iim ym uldeej yadg bn a 3.14 gj |