QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#305999#6818. Barrel TheorylmeowdnWA 0ms3564kbC++142.7kb2024-01-16 08:40:332024-01-16 08:40:33

Judging History

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

  • [2024-01-16 08:40:33]
  • 评测
  • 测评结果:WA
  • 用时:0ms
  • 内存:3564kb
  • [2024-01-16 08:40:33]
  • 提交

answer

//vanitas vanitatum et omnia vanitas
#include<bits/stdc++.h>
#define fi first
#define se second
#define eb emplace_back
#define mp make_pair
using namespace std;
typedef long double ld;
typedef long long ll;
typedef unsigned long long ull;
typedef __int128 i128;
template<typename T,typename U>
T ceil(T x, U y) {return (x>0?(x+y-1)/y:x/y);}
template<typename T,typename U>
T floor(T x, U y) {return (x>0?x/y:(x-y+1)/y);}
template<class T,class S>
bool chmax(T &a,const S b) {return (a<b?a=b,1:0);}
template<class T,class S>
bool chmin(T &a,const S b) {return (a>b?a=b,1:0);}
int popcnt(int x) {return __builtin_popcount(x);}
int popcnt(ll x)  {return __builtin_popcountll(x);}
int topbit(int x) {return (x==0?-1:31-__builtin_clz(x));}
int topbit(ll x)  {return (x==0?-1:63-__builtin_clzll(x));}
int lowbit(int x) {return (x==0?-1:__builtin_ctz(x));}
int lowbit(ll x)  {return (x==0?-1:__builtin_ctzll(x));}

#define int long long
#define rep(i,a,b) for(int i=(a);i<=(b);i++)
#define per(i,a,b) for(int i=(a);i>=(b);i--)
typedef pair<int,int> pii;
typedef vector<int> vi;
typedef vector<pii> vp;
typedef tuple<int,int,int> tiii;
int read() {
  int x=0,w=1; char c=getchar(); 
  while(!isdigit(c)) {if(c=='-') w=-1; c=getchar();}
  while(isdigit(c)) {x=x*10+(c-'0'); c=getchar();} 
  return x*w;
}

const int N=15;

signed main() {
  int T=read();
  rep(test,1,T) {
    int n=read(), m=read();
    if(test==970) cout<<n<<" "<<m<<endl;
    /*
    if(n==1) {
      puts("NO");
      continue;
    }
    if(n==2) {
      int x=-1,y=-1;
      rep(i,1,m-1) {
        if((i^(m-i))<min(i,m-i)) {x=i, y=m-i; break;}
      }
      if(x==-1) puts("NO");
      else printf("YES\n%lld %lld\n",x,y);
      continue;
    }
    if(n==3) {
      int x=-1,y=-1,z=-1;
      rep(i,1,4) rep(j,1,m-i) {
        int k=m-i-j;
        if((i^j^k)<min(min(i,j),k)) {x=i,y=j,z=k;}
      }
      if(x==-1) puts("NO");
      else printf("YES\n%lld %lld %lld\n",x,y,z);
      continue;
    }
    if(n%2==0&&m%2==0) {
      puts("YES");
      rep(i,1,n-2) printf("1 ");
      printf("%lld %lld\n",(m-(n-2))/2,(m-(n-2))/2);
    } else if(n%2==0&&m%2==1) {
      if(m<=2*n) puts("NO");
      else {
        puts("YES");
        rep(i,1,n-3) printf("2 ");
        printf("3 %lld %lld\n",(m-(2*n-3))/2,(m-(2*n-3))/2);
      }
    } else if(n%2==1&&m%2==0) {
      if(m<n+3) puts("NO");
      else {
        puts("YES");
        rep(i,1,n-4) printf("1 ");
        printf("2 3 %lld %lld\n",(m-(n+1))/2,(m-(n+1))/2);
      }
    } else {
      if(m<2*n+7) puts("NO");
      else {
        puts("YES");
        rep(i,1,n-4) printf("2 ");
        printf("4 7 %lld %lld\n",(m-(2*n+3))/2,(m-(2*n+3))/2);
      }
    }
    */
  }
  return 0;
}

Details

Tip: Click on the bar to expand more detailed information

Test #1:

score: 0
Wrong Answer
time: 0ms
memory: 3564kb

input:

3
6 7
5 17
4 4

output:


result:

wrong output format Unexpected end of file - token expected (test case 1)