목록전체 글 (159)
할껀하고놀자
#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...