Submission #69393567
Source Code Expand
Copy
#include <stdio.h>int main(void) {int T, tc;if (scanf("%d", &T) != 1) return 1;for (tc = 0; tc < T; tc++) {int nA, nB, nC;int yes = 0, no = 1010101010;if (scanf("%d%d%d", &nA, &nB, &nC) != 3) return 1;while (yes + 1 < no) {int m = yes + (no - yes) / 2;if (nA >= m && nC >= m) {int aleft = nA - m, cleft = nC - m;if ((long long)aleft + nB + cleft >= m) yes = m; else no = m;} else {no = m;}}printf("%d\n", yes);}return 0;
#include <stdio.h> int main(void) { int T, tc; if (scanf("%d", &T) != 1) return 1; for (tc = 0; tc < T; tc++) { int nA, nB, nC; int yes = 0, no = 1010101010; if (scanf("%d%d%d", &nA, &nB, &nC) != 3) return 1; while (yes + 1 < no) { int m = yes + (no - yes) / 2; if (nA >= m && nC >= m) { int aleft = nA - m, cleft = nC - m; if ((long long)aleft + nB + cleft >= m) yes = m; else no = m; } else { no = m; } } printf("%d\n", yes); } return 0; }
Submission Info
Submission Time | |
---|---|
Task | C - AtCoder AAC Contest |
User | mikecat |
Language | C (gcc 12.2.0) |
Score | 300 |
Code Size | 506 Byte |
Status | AC |
Exec Time | 93 ms |
Memory | 1984 KiB |
Judge Result
Set Name | Sample | All | ||||
---|---|---|---|---|---|---|
Score / Max Score | 0 / 0 | 300 / 300 | ||||
Status |
|
|
Set Name | Test Cases |
---|---|
Sample | 00_sample_00.txt |
All | 00_sample_00.txt, 01_random_01.txt, 01_random_02.txt, 01_random_03.txt, 01_random_04.txt, 01_random_05.txt, 01_random_06.txt, 01_random_07.txt, 01_random_08.txt, 01_random_09.txt, 01_random_10.txt, 01_random_11.txt, 01_random_12.txt, 01_random_13.txt |
Case Name | Status | Exec Time | Memory |
---|---|---|---|
00_sample_00.txt | AC | 0 ms | 1620 KiB |
01_random_01.txt | AC | 93 ms | 1916 KiB |
01_random_02.txt | AC | 92 ms | 1956 KiB |
01_random_03.txt | AC | 92 ms | 1968 KiB |
01_random_04.txt | AC | 92 ms | 1956 KiB |
01_random_05.txt | AC | 92 ms | 1888 KiB |
01_random_06.txt | AC | 92 ms | 1956 KiB |
01_random_07.txt | AC | 91 ms | 1956 KiB |
01_random_08.txt | AC | 92 ms | 1892 KiB |
01_random_09.txt | AC | 91 ms | 1984 KiB |
01_random_10.txt | AC | 92 ms | 1968 KiB |
01_random_11.txt | AC | 92 ms | 1940 KiB |
01_random_12.txt | AC | 92 ms | 1972 KiB |
01_random_13.txt | AC | 71 ms | 1576 KiB |