QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#405222#6748. Spin the WheelqzuserCompile Error//C++17459b2024-05-05 14:09:262024-05-05 14:09:28

Judging History

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

  • [2024-05-05 14:09:28]
  • 评测
  • [2024-05-05 14:09:26]
  • 提交

answer

#include<bits/stdc++.h>
using namespace std;
#define int long long
const int N = 1e5 + 10;
int a[N];
signed main()
{
    int n;
    cin >> n;
    for (int i = 1; i <= n; i ++) cin >> a[i];
    int p = ((a[2] + n - a[1]) % n) % n;
    for (int i = 2; i < n; i ++)
    {
        if ((a[i] + p) % mod != a[i + 1])
        {
            cout << "-1\n";
            return;
        }
    } 
    cout << d + (a[1] != 0) << endl;
    return 0;
}

Details

answer.code: In function ‘int main()’:
answer.code:14:26: error: ‘mod’ was not declared in this scope; did you mean ‘modf’?
   14 |         if ((a[i] + p) % mod != a[i + 1])
      |                          ^~~
      |                          modf
answer.code:17:13: error: return-statement with no value, in function returning ‘int’ [-fpermissive]
   17 |             return;
      |             ^~~~~~
answer.code:20:13: error: ‘d’ was not declared in this scope
   20 |     cout << d + (a[1] != 0) << endl;
      |             ^