QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#859015#9670. GG and YY’s Stone Gameshiyahahaya#WA 1ms3712kbC++202.7kb2025-01-17 12:41:172025-01-17 12:41:18

Judging History

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

  • [2025-01-17 12:41:18]
  • 评测
  • 测评结果:WA
  • 用时:1ms
  • 内存:3712kb
  • [2025-01-17 12:41:17]
  • 提交

answer

//                            _ooOoo_
//                           o8888888o
//                           88" . "88
//                           (| -_- |)
//                            O\ = /O
//                        ____/`---'\____
//                      .   ' \\| |// `.
//                       / \\||| : |||// \
//                     / _||||| -:- |||||- \
//                       | | \\\ - /// | |
//                     | \_| ''\---/'' | |
//                      \ .-\__ `-` ___/-. /
//                   ___`. .' /--.--\ `. . __
//                ."" '< `.___\_<|>_/___.' >'"".
//               | | : `- \`.;`\ _ /`;.`/ - ` : | |
//                 \ \ `-. \_ __\ /__ _/ .-` / /
//         ======`-.____`-.___\_____/___.-`____.-'======
//                            `=---='
//
//         .............................................
//    佛曰:     佛祖镇楼                  BUG辟易

#include <bits/stdc++.h>
#include <iostream>
#include <cstring>
#include <vector>
#include <queue>
#include <deque>
#include <utility>
#include <stack>
#include <map>
#include <set>
#include <algorithm>
#include<cmath>
#include<string>
#include<cstring>
#define int long long
#define endl '\n'
using namespace std;

const int N=2e5+10;
const int INF=9223372036854775807;
const int inf=0x3f3f3f3f;
typedef pair<int,int> PII;
typedef pair<double,int> PDI;
typedef pair<int,double> PID;

struct st{
    int val;
    int tag;
    bool operator<(const st &other) const
    {
        return val < other.val;
    }
}s1[N],s2[N];

void solve() {
    int n;
    cin>>n;
    int a,b,c,d;
    int cnt1=1,cnt2=1;

    for(int i=1;i<=n;i++)
    {
        cin>>a>>b>>c>>d;
         if(c==1&&d==1)
         {
             if(a<b)
             {
                 s1[cnt1].val=a;
                 s1[cnt1].tag=i;
                 cnt1++;
             }
             else
             {
                 s2[cnt2].val=b;
                 s2[cnt2].tag=i;
                 cnt2++;
             }
         }
         else if(c==1&&d==0)
         {
             s1[cnt1].val=a;
             s1[cnt1].tag=i;
             cnt1++;
         }
         else if(c==0&&d==1)
         {
             s2[cnt2].val=b;
             s2[cnt2].tag=i;
             cnt2++;
         }
    }

    sort(s1+1,s1+cnt1);
    sort(s2+1,s2+cnt2);

    cout<<cnt1-1<<' ';
    for(int i=1;i<cnt1;i++) cout<<s1[i].tag<<" ";
    cout<<endl;
    cout<<cnt2-1<<' ';
    for(int i=1;i<cnt2;i++) cout<<s2[i].tag<<" ";
    cout<<endl;
    return;
}

signed main() {
    std::ios::sync_with_stdio(false);
    cin.tie(0);
    cout.tie(0);
    int t=1;
    //cin >> t;
    while (t--) {
        solve();
    }
    return 0;
}

详细

Test #1:

score: 0
Wrong Answer
time: 1ms
memory: 3712kb

input:

3
1
2
3

output:

0 
0 

result:

wrong answer 1st lines differ - expected: '0 1', found: '0 '