結果
| 問題 | No.3155 Same Birthday |
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2025-08-08 12:52:23 |
| 言語 | C (gcc 15.2.0) |
| 結果 |
RE
|
| 実行時間 | - |
| コード長 | 547 bytes |
| 記録 | |
| コンパイル時間 | 109 ms |
| コンパイル使用メモリ | 38,372 KB |
| 最終ジャッジ日時 | 2026-02-22 13:41:41 |
|
ジャッジサーバーID (参考情報) |
judge5 / judge5 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | RE * 2 |
| other | RE * 49 |
ソースコード
#include<stdio.h>
void main() {
int n; //人数
int a[100]; //誕生月
int b[100]; //誕生日
int found = 0; //一致する組があるかどうか
printf("整数を入力してください\n");
scanf("%d", &n);
for (int i = 0; i < n ; i++){
scanf("%d %d", &a[i], &b[i]);
}
for (int i = 0; i < n - 1; i++) {
for (int j = i + 1; j < n; j++) {
if (a[i] == a[j] && b[i] == b[j]) {
found = 1;
break;
}
}
if (found == 1) {
break;
}
}
if (found == 1) {
printf("Yes");
}
else {
printf("No");
}
}