結果
問題 |
No.3155 Same Birthday
|
ユーザー |
|
提出日時 | 2025-06-01 21:56:54 |
言語 | C (gcc 13.3.0) |
結果 |
TLE
|
実行時間 | - |
コード長 | 640 bytes |
コンパイル時間 | 333 ms |
コンパイル使用メモリ | 27,344 KB |
実行使用メモリ | 7,844 KB |
最終ジャッジ日時 | 2025-06-01 21:57:00 |
合計ジャッジ時間 | 5,616 ms |
ジャッジサーバーID (参考情報) |
judge5 / judge3 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | -- * 2 |
other | AC * 1 TLE * 1 -- * 47 |
コンパイルメッセージ
main.c: In function ‘main’: main.c:7:5: warning: ignoring return value of ‘scanf’ declared with attribute ‘warn_unused_result’ [-Wunused-result] 7 | scanf("%zu", &n); | ^~~~~~~~~~~~~~~~ main.c:13:9: warning: ignoring return value of ‘scanf’ declared with attribute ‘warn_unused_result’ [-Wunused-result] 13 | scanf("%zu%zu", &a, &b); | ^~~~~~~~~~~~~~~~~~~~~~~
ソースコード
#include <stdio.h> #include <stdbool.h> #include <string.h> int main(void) { size_t n = 0; scanf("%zu", &n); bool BirthdayFlag = false; char str_array[n][12]; for (size_t i = 0; i < n; i++) { size_t a, b; scanf("%zu%zu", &a, &b); snprintf(str_array[i], sizeof(str_array[i]), "{%zu,%zu}", a, b); for (size_t j = 0; j < i; j++) { if (strcmp(str_array[j], str_array[i]) == 0) { BirthdayFlag = true; break; } } } if (BirthdayFlag) { printf("Yes\n"); } else { printf("No\n"); } return 0; }