Submission #25420250


Source Code Expand

#include <iostream>
#include <vector>
#include <string>
#include <algorithm>
#include <functional>
#include <cmath>
#include <map>
#define rep(i,n) for (int i=0;i<n;i++)

#define DENOM 1000000007

using namespace std;
using ll = long long;

int main(){
  map<string, map<string, int>> m ;
  int n ;
  cin >> n ;
  rep(i, n) {
    string s, t ;
    cin >> s >> t;
    auto it_s = m.find(s) ;
    if (it_s == m.end()) {
      map<string, int> tmp_m ;
      m[s] = tmp_m ;
    }
    auto it_t = m[s].find(t) ;
    if (it_t == m[s].end()) {
      m[s][t] = 1 ;
    } else {
      cout << "Yes" << endl ;
      return 0 ;
    }
  }
  cout << "No" << endl ;
  return 0 ;
}

Submission Info

Submission Time
Task B - Same Name
User ntgo
Language C++ (Clang 10.0.0)
Score 200
Code Size 704 Byte
Status AC
Exec Time 8 ms
Memory 3252 KiB

Judge Result

Set Name Sample All
Score / Max Score 0 / 0 200 / 200
Status
AC × 3
AC × 11
Set Name Test Cases
Sample example0.txt, example1.txt, example2.txt
All 000.txt, 001.txt, 002.txt, 003.txt, 004.txt, 005.txt, 006.txt, 007.txt, example0.txt, example1.txt, example2.txt
Case Name Status Exec Time Memory
000.txt AC 7 ms 2912 KiB
001.txt AC 8 ms 3184 KiB
002.txt AC 6 ms 3252 KiB
003.txt AC 2 ms 3048 KiB
004.txt AC 2 ms 3100 KiB
005.txt AC 2 ms 3076 KiB
006.txt AC 5 ms 3196 KiB
007.txt AC 5 ms 3008 KiB
example0.txt AC 1 ms 2988 KiB
example1.txt AC 2 ms 3044 KiB
example2.txt AC 2 ms 3044 KiB