제출 #1039817

#제출 시각아이디문제언어결과실행 시간메모리
1039817azberjibiouArranging Tickets (JOI17_arranging_tickets)C++17
0 / 100
0 ms348 KiB
#pragma GCC optimize("O3")
#pragma GCC optimize("unroll-loops")
#include <bits/stdc++.h>
#define all(v) v.begin(), v.end()
#define pb push_back
#define lb lower_bound
#define gibon ios::sync_with_stdio(false); cin.tie(0);
#define fi first
#define se second
#define pii pair<int, int>
#define pll pair<ll, ll>
typedef long long ll;
using namespace std;
const int mxN=605;
const int mxM=1557;
const int mxK=60;
const ll MOD=1'000'000'007;
const ll inv2=500'000'004;
const ll INF=1e16;
int N, M;
int ans;
int cnt[mxN][mxN];
void input(){
    cin >> N >> M;
    for(int i=1;i<=M;i++){
        int a, b, c;
        cin >> a >> b >> c;
        if(a>b) swap(a, b);
        for(int j=1;j<=N;j++) for(int k=1;k<=N;k++){
            int p1=(a<=j && j<b), p2=(a<=k && k<b);
            if(p1+p2!=1) continue;
            cnt[j][k]++;
        }
    }
    //for(int i=1;i<=N;i++) for(int j=1;j<=N;j++) printf("cnt[%d][%d]=%d\n", i, j, cnt[i][j]);
    for(int i=1;i<=N;i++) for(int j=1;j<=N;j++) ans=max(ans, (cnt[i][j]+1)/2);
    cout << ans;
}
int main(){
    gibon
    input();
}
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...