목록분류 전체보기 (159)
할껀하고놀자
#include #include using namespace std; char arr[] = { 'A','D','O','P','Q','R' }; int main() { int n; cin >> n; for (int i = 1; i > n1 >> n2; if (n1.size() != n2.size()) { cout
#include #include #include #include using namespace std; int main() { int tc; cin >> tc; for (int t = 0; t > x1 >> y1 >> x2 >> y2 >> N; vector v; for (int i = 0; i > x >> y; v.push_back(make_pair(x, y)); } sort(v.begin(), v.end()); int out, line, in; tie(out, line, in) = make_tuple(0, 0, 0); for (int i = 0; i < v.size(); i++) { ..
#include #include #include using namespace std; class Meeting { public: int begin, end; }; bool compare(const Meeting &u, const Meeting &v) { if (u.end == v.end) { return u.begin > n; vector a(n); for (int i = 0; i > a[i].begin >> a[i].end; } sort(a.begin(), a.end(), compare); int now = 0; int ans = 0; for (i..
#include #include #include using namespace std; vector a; int main() { int t; cin >> t; while (t--) { a.clear(); int n, min = 100001, result = 0; cin >> n; for (int i = 0; i > x >> y; a.push_back(make_pair(x, y)); } sort(a.begin(), a.end()); for (int i = 0; i a[i].second) { min = a[i].second; result++; } } cout
import java.util.Scanner; public class Main{ public static void main(String[] args) { Scanner sc = new Scanner(System.in); String [] str = sc.nextLine().split("-"); String yang = str[0]; int iyang = 0; boolean ok = false; if(yang.contains("+")) { ok=true; } if(ok) { String [] tmp = yang.split("\\+"); for (int i = 0; i < tmp.length; i++) { iyang+=Integer.parseInt(tmp[i]); } }else { iyang=Integer...
#include #include using namespace std; int a[100001]; int n; int main() { cin >> n; for (int i = 0; i > a[i]; } sort(a, a + n); int max = 0; for (int i = 0; i < n; i++) { if (max < a[i] * (n - i)) max = a[i] * (n - i); } cout
#include #include using namespace std; int main() { int num; cin >> num; int * arr = new int[num]; for (int i = 0; i > arr[i]; } sort(arr, arr + num); int sum = 0; for (int i = 0; i n; vector a(n); for (int i = 0; i > a[i]; } sort(a.begin(), a.end(..
#include #include using namespace std; bool compare(int a, int b) { return a > b; } int main() { int n, val; cin >> n; cin >> val; int *arr = new int[n]; for (int i = 0; i > arr[i]; } sort(arr, arr + n,compare); int result = 0; for (int i = 0; i < n; i++) { result += val / arr[i]; val %= arr[i]; } cout
#include using namespace std; int main() { int n; cin >> n; n = 1000 - n; int result = 0; result += n / 500; n %= 500; result += n / 100; n %= 100; result += n / 50; n %= 50; result += n / 10; n %= 10; result += n / 5; n %= 5; result += n / 1; cout