답안 #1067511

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
1067511 2024-08-20T18:57:43 Z YENGOYAN Infinite Race (EGOI24_infiniterace2) C++17
0 / 100
1 ms 600 KB
#define _USE_MATH_DEFINES
#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
#define PUT(a, b) freopen(a, "r", stdin); freopen(b, "w", stdout);
#define all(a) a.begin(), a.end()
#define answerNO {cout << "NO" << endl; return;}
#define answerYES {cout << "YES" << endl; return;}
using namespace std;
#define ff first
#define ss second
#define pb push_back
#define replr(i, a, b) for (int i = int(a); i <= int(b); ++i)
#define reprl(i, a, b) for (int i = int(a); i >= int(b); --i)
#define rep(i, n) for (int i = 0; i < int(n); ++i)
#define mkp(a, b) make_pair(a, b)
typedef long long ll;
typedef long double ld;
typedef pair<int, int> PII;
typedef vector<int> VI;
typedef vector<PII> VPI;
typedef pair<ll, ll> PLL;
typedef vector<ll> VL;
typedef vector<PLL> VPL;
template<class T> T setmax(T& a, T b) { if (a < b) return a = b; return a; }
template<class T> T setmin(T& a, T b) { if (a < b) return a; return a = b; }
using namespace __gnu_pbds;
#define ordered_set tree<int, null_type, less<int>, rb_tree_tag, tree_order_statistics_node_update>
ll mod = 1e9 + 7;


void solve() {
    int n, q; cin >> n >> q;
    map<int, int> mp;
    int mx = 0;
    while (q--)
    {
        int c; cin >> c;
        int aC = abs(c);
        mp[aC] += c / aC;
        mx = max(mx, mp[aC]);
    }
    cout << mx << endl;
}

signed main() {
    ios_base::sync_with_stdio(false);
    cin.tie(NULL), cout.tie(NULL);
    //PUT("traffic.in", "traffic.out");
    int t = 1;
    //cin >> t;
    while (t--) {
        solve();
    }
}
# 결과 실행 시간 메모리 Grader output
1 Incorrect 0 ms 348 KB Output isn't correct
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Incorrect 1 ms 348 KB Output isn't correct
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Incorrect 0 ms 600 KB Output isn't correct
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Incorrect 0 ms 348 KB Output isn't correct
2 Halted 0 ms 0 KB -