답안 #898771

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
898771 2024-01-05T05:42:08 Z duckindog Ljeto (COCI21_ljeto) C++14
50 / 50
0 ms 348 KB
// from duckindog wth depression
#include<bits/stdc++.h>

using namespace std;

const int N = 110;
int n;
int t[N], a[N], b[N];

int32_t main() {
  cin.tie(0)->sync_with_stdio(0);

  if (fopen("duck.inp", "r")) {
    freopen("duck.inp", "r", stdin);
    freopen("duck.out", "w", stdout);
  }

  cin >> n;
  for (int i = 1; i <= n; ++i) cin >> t[i] >> a[i] >> b[i];

  int A = 0, B = 0;
  for (int i = 1; i <= n; ++i) {
    int &ret = a[i] <= 4 ? A : B;
    ret += 100;
    for (int j = i - 1; j >= 1; --j) {
      if (t[i] - t[j] > 10) break;
      if (a[i] == a[j]) {
        ret += 50;
        break;
      }
    }
  }
  cout << A << ' ' << B << '\n';
}

Compilation message

Main.cpp: In function 'int32_t main()':
Main.cpp:14:12: warning: ignoring return value of 'FILE* freopen(const char*, const char*, FILE*)' declared with attribute 'warn_unused_result' [-Wunused-result]
   14 |     freopen("duck.inp", "r", stdin);
      |     ~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~
Main.cpp:15:12: warning: ignoring return value of 'FILE* freopen(const char*, const char*, FILE*)' declared with attribute 'warn_unused_result' [-Wunused-result]
   15 |     freopen("duck.out", "w", stdout);
      |     ~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~
# 결과 실행 시간 메모리 Grader output
1 Correct 0 ms 348 KB Output is correct
2 Correct 0 ms 348 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 0 ms 348 KB Output is correct
2 Correct 0 ms 348 KB Output is correct
3 Correct 0 ms 348 KB Output is correct
4 Correct 0 ms 348 KB Output is correct
5 Correct 0 ms 348 KB Output is correct
6 Correct 0 ms 348 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 0 ms 348 KB Output is correct
2 Correct 0 ms 348 KB Output is correct
3 Correct 0 ms 348 KB Output is correct
4 Correct 0 ms 348 KB Output is correct
5 Correct 0 ms 348 KB Output is correct
6 Correct 0 ms 348 KB Output is correct
7 Correct 0 ms 348 KB Output is correct
8 Correct 0 ms 348 KB Output is correct
9 Correct 0 ms 348 KB Output is correct
10 Correct 0 ms 348 KB Output is correct
11 Correct 0 ms 348 KB Output is correct
12 Correct 0 ms 348 KB Output is correct
13 Correct 0 ms 348 KB Output is correct