Submission #59357773


Source Code Expand

Copy
#include <bits/stdc++.h>
#define int long long
#define ALL(obj) obj.begin(), obj.end()
const int INF = (int)1 << 61;
const int MOD = 1000000007;
using namespace std;
signed main() {
vector<int> balls(4);
for (int &i : balls) cin >> i;
sort(ALL(balls));
int head = 1;
int ans = 0;
while (head < 4) {
if (balls[head] == balls[head - 1]) {
ans++;
head += 2;
} else {
head++;
 
הההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההה
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
#include <bits/stdc++.h>
#define int long long
#define ALL(obj) obj.begin(), obj.end()
const int INF = (int)1 << 61;
const int MOD = 1000000007;
using namespace std;

signed main() {
    vector<int> balls(4);
    for (int &i : balls) cin >> i;

    sort(ALL(balls));

    int head = 1;
    int ans = 0;
    while (head < 4) {
        if (balls[head] == balls[head - 1]) {
            ans++;
            head += 2;
        } else {
            head++;
        }
    }

    cout << ans << endl;

    return 0;
}

Submission Info

Submission Time
Task A - Pairing
User NagaimoDON
Language C++ 20 (gcc 12.2)
Score 100
Code Size 536 Byte
Status AC
Exec Time 1 ms
Memory 3648 KB

Judge Result

Set Name Sample All
Score / Max Score 0 / 0 100 / 100
Status
AC × 3
AC × 22
Set Name Test Cases
Sample 00_sample_01.txt, 00_sample_02.txt, 00_sample_03.txt
All 00_sample_01.txt, 00_sample_02.txt, 00_sample_03.txt, 01_test_01.txt, 01_test_02.txt, 01_test_03.txt, 01_test_04.txt, 01_test_05.txt, 01_test_06.txt, 01_test_07.txt, 01_test_08.txt, 01_test_09.txt, 01_test_10.txt, 01_test_11.txt, 01_test_12.txt, 01_test_13.txt, 01_test_14.txt, 01_test_15.txt, 01_test_16.txt, 01_test_17.txt, 01_test_18.txt, 01_test_19.txt
Case Name Status Exec Time Memory
00_sample_01.txt AC 1 ms 3452 KB
00_sample_02.txt AC 1 ms 3648 KB
00_sample_03.txt AC 1 ms 3452 KB
01_test_01.txt AC 1 ms 3524 KB
01_test_02.txt AC 1 ms 3520 KB
01_test_03.txt AC 1 ms 3648 KB
01_test_04.txt AC 1 ms 3408 KB
01_test_05.txt AC 1 ms 3496 KB
01_test_06.txt AC 1 ms 3648 KB
01_test_07.txt AC 1 ms 3492 KB
01_test_08.txt AC 1 ms 3480 KB
01_test_09.txt AC 1 ms 3432 KB
01_test_10.txt AC 1 ms 3468 KB
01_test_11.txt AC 1 ms 3492 KB
01_test_12.txt AC 1 ms 3460 KB
01_test_13.txt AC 1 ms 3444 KB
01_test_14.txt AC 1 ms 3456 KB
01_test_15.txt AC 1 ms 3496 KB
01_test_16.txt AC 1 ms 3492 KB
01_test_17.txt AC 1 ms 3468 KB
01_test_18.txt AC 1 ms 3356 KB
01_test_19.txt AC 1 ms 3524 KB


2025-03-30 (Sun)
04:29:55 +00:00