QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#356982#403. Memory2AdamGS100 ✓1ms4064kbC++231.3kb2024-03-18 16:56:542024-03-18 16:56:55

Judging History

你现在查看的是最新测评结果

  • [2024-03-18 16:56:55]
  • 评测
  • 测评结果:100
  • 用时:1ms
  • 内存:4064kb
  • [2024-03-18 16:56:54]
  • 提交

answer

#include "Memory2_lib.h"
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
#define rep(a, b) for(int a = 0; a < (b); ++a)
#define st first
#define nd second
#define pb push_back
#define all(a) a.begin(), a.end()
const int INF=1e9+7;
int T[107][107], odw[107][107];
int pyt(int a, int b) {
  if(a>b) swap(a, b);
  if(!odw[a][b]) {
    odw[a][b]=1;
    T[a][b]=Flip(a, b);
  }
  return T[a][b];
}
void Solve(int t, int n) {
  if(n==1) {
    Answer(0, 1, 0);
    return;
  }
  vector<int>T(2*n);
  vector<int>P={0, 1, 2};
  for(int i=3; i<2*n; ++i) {
    P.pb(i);
    rep(j, P.size()) {
      int ma=-INF, mi=INF;
      rep(l, P.size()) if(l!=j) {
        ma=max(ma, pyt(P[l], P[j]));
        mi=min(mi, pyt(P[l], P[j]));
      }
      if(ma==mi) {
        vector<int>V;
        rep(l, P.size()) if(l!=j) V.pb(P[l]);
        T[P[j]]=ma;
        P=V;
        break;
      }
    }
  }
  if(pyt(P[0], P[1])==pyt(P[0], P[2])) {
    T[P[0]]=pyt(P[0], P[1]);
    T[P[1]]=T[P[2]]=pyt(P[1], P[2]);
  } else if(pyt(P[1], P[0])==pyt(P[1], P[2])) {
    T[P[1]]=pyt(P[1], P[0]);
    T[P[0]]=T[P[2]]=pyt(P[0], P[2]);
  } else {
    T[P[2]]=pyt(P[2], P[0]);
    T[P[0]]=T[P[1]]=pyt(P[0], P[1]);
  }
  rep(i, 2*n) rep(j, i) if(T[i]==T[j]) Answer(i, j, T[i]);
}

詳細信息

Subtask #1:

score: 10
Accepted

Test #1:

score: 10
Accepted
time: 1ms
memory: 3804kb

Test #2:

score: 0
Accepted
time: 0ms
memory: 3820kb

Test #3:

score: 0
Accepted
time: 0ms
memory: 3832kb

Test #4:

score: 0
Accepted
time: 1ms
memory: 4032kb

Test #5:

score: 0
Accepted
time: 1ms
memory: 3732kb

Test #6:

score: 0
Accepted
time: 1ms
memory: 3804kb

Test #7:

score: 0
Accepted
time: 1ms
memory: 4020kb

Test #8:

score: 0
Accepted
time: 0ms
memory: 4060kb

Subtask #2:

score: 50
Accepted

Test #9:

score: 50
Accepted
time: 1ms
memory: 3768kb

Test #10:

score: 0
Accepted
time: 1ms
memory: 3784kb

Test #11:

score: 0
Accepted
time: 0ms
memory: 3764kb

Test #12:

score: 0
Accepted
time: 0ms
memory: 3764kb

Test #13:

score: 0
Accepted
time: 1ms
memory: 3796kb

Test #14:

score: 0
Accepted
time: 1ms
memory: 4064kb

Test #15:

score: 0
Accepted
time: 1ms
memory: 3684kb

Test #16:

score: 0
Accepted
time: 0ms
memory: 3724kb

Test #17:

score: 0
Accepted
time: 0ms
memory: 3716kb

Test #18:

score: 0
Accepted
time: 1ms
memory: 3748kb

Subtask #3:

score: 40
Accepted

Test #19:

score: 40
Accepted
time: 0ms
memory: 4044kb

Test #20:

score: 0
Accepted
time: 1ms
memory: 3836kb

Test #21:

score: 0
Accepted
time: 1ms
memory: 3824kb

Test #22:

score: 0
Accepted
time: 0ms
memory: 3700kb

Test #23:

score: 0
Accepted
time: 0ms
memory: 3792kb

Test #24:

score: 0
Accepted
time: 1ms
memory: 3828kb

Test #25:

score: 0
Accepted
time: 0ms
memory: 3796kb

Test #26:

score: 0
Accepted
time: 0ms
memory: 3724kb

Test #27:

score: 0
Accepted
time: 1ms
memory: 3980kb

Test #28:

score: 0
Accepted
time: 0ms
memory: 3732kb

Extra Test:

score: 0
Extra Test Passed