Toggle menu
Toggle personal menu
Not logged in
Your IP address will be publicly visible if you make any edits.

1R/2016 09 26

From ZeroWiki
Revision as of 13:29, 27 September 2016 by 175.124.46.11 (talk) ({CREATE})
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

오늘의 문제

참가자

  • 15이원준

코드

15이원준

#include<iostream>
#include<map>
#include<utility>
using namespace std;

int main(){
  int N, ans = 0;
  multimap<int, int, less<int>> arr;
  cin>> N;

  for(int i = 0; i<N; i++){
    int tmp1, tmp2;
    scanf("%d %d", &tmp1, &tmp2);
    arr.insert(pair<int, int>(tmp1, tmp2));
  }

  for(auto it = arr.begin(); it != arr.end();){
    int firstfinish = it->second;

    for(it++; it != arr.end() && it->first < firstfinish; it++){
      int etime = it->second;
      if(etime < firstfinish){
        firstfinish = etime;
      }
    }
    ans++;
  }

  cout<< ans << endl;
}

박인서

곽정흠

아이디어

15이원준

  • 겹치는 시간 중에서 가장 먼저 끝나는 것을 기준으로 골랐습니다.

박인서

곽정흠