QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#628135#9296. Golden SpiritSatonCompile Error//C++201.7kb2024-10-10 18:47:562024-10-10 18:47:57

Judging History

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

  • [2024-10-10 18:47:57]
  • 评测
  • [2024-10-10 18:47:56]
  • 提交

answer

///by Saton.
#include<bits/stdc++.h>
#define PI acos(-1)
#define fi first
#define se second 
#define sz(a) ((int)a.size())
#define all(a) a.begin(), a.end()
#define int long long
#define ll __int128
#define DD double double
#define LD long double
#define rep(i,a,b) for(int i = (a);i <= (b);i ++)
#define lep(i,a,b) for(int i = (a);i >= (b);i --)
#define FLUSH fflush(stdout)
using namespace std;
typedef pair<int,int> PII;
const int N = 1e6 + 10,mod = 998244353;
int n,m,k;
int a[N];

void solve() {
    cin >> n >> m >> k;
    if(2*k*n>=m) cout << 4*n*k << '\n';
    else cout << 2*m << '\n';
} 

signed main() {
    ios::sync_with_stdio(false), cin.tie(0), cout.tie(0);
    int T;
    cin >> T;
    while(T --) {
        solve();
    }
    // solve();
       
    return 0;
}  
/*   /\_/\
*   (= ._.)
*   / >  \>
*////by Saton.
#include<bits/stdc++.h>
#define PI acos(-1)
#define fi first
#define se second 
#define sz(a) ((int)a.size())
#define all(a) a.begin(), a.end()
#define int long long
#define ll __int128
#define DD double double
#define LD long double
#define rep(i,a,b) for(int i = (a);i <= (b);i ++)
#define lep(i,a,b) for(int i = (a);i >= (b);i --)
#define FLUSH fflush(stdout)
using namespace std;
typedef pair<int,int> PII;
const int N = 1e6 + 10,mod = 998244353;
int n,m,k;
int a[N];

void solve() {
    cin >> n >> m >> k;
    int ans = 2*n*k;
    if(m<=2*n*k) ans *= 2;
    else ans += m;
    cout << ans << '\n';
} 

signed main() {
    ios::sync_with_stdio(false), cin.tie(0), cout.tie(0);
    int T;
    cin >> T;
    while(T --) {
        solve();
    }
    // solve();
       
    return 0;
}  
/*   /\_/\
*   (= ._.)
*   / >  \>
*/

詳細信息

answer.code:57:11: error: redefinition of ‘const long long int N’
   57 | const int N = 1e6 + 10,mod = 998244353;
      |           ^
answer.code:17:11: note: ‘const long long int N’ previously defined here
   17 | const int N = 1e6 + 10,mod = 998244353;
      |           ^
answer.code:57:24: error: redefinition of ‘const long long int mod’
   57 | const int N = 1e6 + 10,mod = 998244353;
      |                        ^~~
answer.code:17:24: note: ‘const long long int mod’ previously defined here
   17 | const int N = 1e6 + 10,mod = 998244353;
      |                        ^~~
answer.code:58:5: error: redefinition of ‘long long int n’
   58 | int n,m,k;
      |     ^
answer.code:18:5: note: ‘long long int n’ previously declared here
   18 | int n,m,k;
      |     ^
answer.code:58:7: error: redefinition of ‘long long int m’
   58 | int n,m,k;
      |       ^
answer.code:18:7: note: ‘long long int m’ previously declared here
   18 | int n,m,k;
      |       ^
answer.code:58:9: error: redefinition of ‘long long int k’
   58 | int n,m,k;
      |         ^
answer.code:18:9: note: ‘long long int k’ previously declared here
   18 | int n,m,k;
      |         ^
answer.code:59:5: error: redefinition of ‘long long int a [1000010]’
   59 | int a[N];
      |     ^
answer.code:19:5: note: ‘long long int a [1000010]’ previously declared here
   19 | int a[N];
      |     ^
answer.code:61:6: error: redefinition of ‘void solve()’
   61 | void solve() {
      |      ^~~~~
answer.code:21:6: note: ‘void solve()’ previously defined here
   21 | void solve() {
      |      ^~~~~
answer.code:69:8: error: redefinition of ‘int main()’
   69 | signed main() {
      |        ^~~~
answer.code:27:8: note: ‘int main()’ previously defined here
   27 | signed main() {
      |        ^~~~