結果
| 問題 | No.3155 Same Birthday |
| コンテスト | |
| ユーザー |
ruase_
|
| 提出日時 | 2025-08-14 23:42:49 |
| 言語 | C++23 (gcc 15.2.0 + boost 1.90.0) |
| 結果 |
AC
|
| 実行時間 | 148 ms / 2,000 ms |
| + 953µs | |
| コード長 | 682 bytes |
| 記録 | |
| コンパイル時間 | 1,494 ms |
| コンパイル使用メモリ | 186,176 KB |
| 実行使用メモリ | 11,520 KB |
| 最終ジャッジ日時 | 2026-07-14 01:02:07 |
| 合計ジャッジ時間 | 8,196 ms |
|
ジャッジサーバーID (参考情報) |
judge3_0 / judge1_1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 2 |
| other | AC * 49 |
ソースコード
#include <iostream>
#include <sstream>
#include <iomanip>
#include <algorithm>
using namespace std;
int main()
{
int n;
cin >> n;
int a[n][2];
string s[n];
for(int i = 0; i < n; i++) cin >> a[i][0] >> a[i][1];
for (int i = 0; i < n; i++) {
ostringstream oss1, oss2;
oss1 << setw(5) << setfill('0') << a[i][0];
oss2 << setw(5) << setfill('0') << a[i][1];
string s1 = oss1.str();
string s2 = oss2.str();
s[i] = s1 + s2;
}
sort(s, s+n);
bool flg = false;
for (int i = 0; i < n; i++) {
if (s[i] == s[i+1]) {
flg = true;
break;
}
}
if (flg) {
cout << "Yes" << endl;
}else {
cout << "No" << endl;
}
}
ruase_