QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#637302#9248. An Easy Math Problemblue_sky#WA 82ms3940kbC++201.9kb2024-10-13 12:04:012024-10-13 12:04:02

Judging History

This is the latest submission verdict.

  • [2024-10-31 22:36:43]
  • hack成功,自动添加数据
  • (/hack/1098)
  • [2024-10-31 22:13:58]
  • hack成功,自动添加数据
  • (/hack/1096)
  • [2024-10-31 22:00:43]
  • hack成功,自动添加数据
  • (/hack/1095)
  • [2024-10-13 12:04:02]
  • Judged
  • Verdict: WA
  • Time: 82ms
  • Memory: 3940kb
  • [2024-10-13 12:04:01]
  • Submitted

answer

#include <bits/stdc++.h>
#define int long long
#define x first
#define y second
#define bug(X) cout << "bug:# " << X << endl
#define bug2(f, X) cout << "bug:# " << f << " " << X << endl
#define bug3(i, j, G) cout << "bug:# " << i << ' ' << j << ' ' << G << endl
#define endl '\n'
using namespace std;
const int mod = 1e11 + 3;
const int N = 10 + 5e5;
void _();
signed main()
{
    ios::sync_with_stdio(0);
    cin.tie(0);
    cout.tie(0);
    int t = 1;
    cin >> t;
    while (t--)
        _();
    return 0;
}

map<int, vector<int>> Y;
void _()
{
    int n;
    // cin >> n;
    n=1e10;
    int cnt = 0;
    vector<int> yin;
    map<pair<int, int>, int> res;
    for (int i = 1; i <= n / i; i++)
        if (n % i == 0)
        {
            cnt += n / i == i ? 1 : 2;
            yin.push_back(i);
            if (n / i - i)
                yin.push_back(n / i);
            res[{1, i}]++;
            res[{1, n / i}]++;
        }
    // map<int,int> special;
    for (auto v : yin)
    {
        if (Y.count(v))
        {
            for(auto y:Y[v])
                {
                    int g = __gcd(y, v / y);
                    // if(i<=v/i&&!res.count({i/g,v/i/g})) special[v]=1;
                    if (y <= v / y)
                        res[{y / g, v / y / g}]++;
                }
        }
        else 
        for (int i = 2; i <= n / i; i++)
            if (v % i == 0)
            {
                Y[v].push_back(i);
                int g = __gcd(i, v / i);
                // if(i<=v/i&&!res.count({i/g,v/i/g})) special[v]=1;
                if (i <= v / i)
                    res[{i / g, v / i / g}]++;
            }
    }
    // for (auto [v, c] : special)
    //     cout << v << ' ';
    // cout << endl;
    // for (auto [V, _] : res)
    //     bug2(V.x, V.y);
    // cout << res.size() << endl;
    bug3(res.size(), cnt, res.size() - cnt);
}

详细

Test #1:

score: 0
Wrong Answer
time: 82ms
memory: 3940kb

input:

10
1
2
3
4
5
6
7
8
9
10

output:

bug:# 221 121 100
bug:# 221 121 100
bug:# 221 121 100
bug:# 221 121 100
bug:# 221 121 100
bug:# 221 121 100
bug:# 221 121 100
bug:# 221 121 100
bug:# 221 121 100
bug:# 221 121 100

result:

wrong answer 1st lines differ - expected: '1', found: 'bug:# 221 121 100'