답안 #233388

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
233388 2020-05-20T11:03:46 Z topovik Izlet (COI19_izlet) C++14
0 / 100
2000 ms 52552 KB
#include <bits/stdc++.h>
//#include <ext/pb_ds/assoc_container.hpp>
//#include <ext/pb_ds/tree_policy.hpp>
#define f first
#define s second
#define pb push_back
#define INF 1000000000
#define N (long)1e5+2

using namespace std;

typedef long long ll;
typedef long double ld;

vector <vector <int> > gr;
vector <vector <int> > a1;

int n;
int ans[N];
int a[3000][3000];

int main()
{
    cin>>n;
    cin>>n;
    for (int i=0; i<n; i++)
        for (int j=0; j<n; j++) cin>>a[i][j];
    int mx=0;
    for (int i=0; i<n; i++)
        for (int j=0; j<n; j++) mx=max(mx,a[i][j]);
    ans[0]=1;
    int uniq=1;
    for (int i=1; i<n; i++)
    {
        bool g=1;
        for (int j=i-1; j>=0; j--)
            if (a[j][i-1]==a[j][i]) {g=0;ans[i]=ans[j];break;}
        if (g) uniq++,ans[i]=uniq;
    }
    for (int i=0; i<n; i++) cout<<ans[i]<<" ";
    cout<<endl;
    for (int i=0; i<n-1; i++) cout<<i+1<<" "<<i+2<<"\n";
}
# 결과 실행 시간 메모리 Grader output
1 Incorrect 5 ms 384 KB Output isn't correct
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 1816 ms 35640 KB Output is correct
2 Correct 1807 ms 35796 KB Output is correct
3 Execution timed out 2086 ms 52552 KB Time limit exceeded
4 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Incorrect 5 ms 384 KB Output isn't correct
2 Halted 0 ms 0 KB -