QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#407598#1373. Rating ProblemsTheSleepyDevil#AC ✓1ms3848kbC++141.7kb2024-05-09 05:37:182024-05-09 05:37:19

Judging History

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

  • [2024-05-09 05:37:19]
  • 评测
  • 测评结果:AC
  • 用时:1ms
  • 内存:3848kb
  • [2024-05-09 05:37:18]
  • 提交

answer

    /*
     Hell, 'til I reach Hell, I ain't scared
     Mama checkin' in my bedroom, I ain't there
                                                */
    #include<bits/stdc++.h>
    #include <ext/pb_ds/assoc_container.hpp>
    #include <ext/pb_ds/tree_policy.hpp>
    using namespace __gnu_pbds;
    using namespace std;

    #define Major  ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);
    #define TxtIO   freopen("input.txt","r",stdin); freopen("output.txt","w",stdout);
    #define read(a,n) for(int i = 0 ; i<n ; i++) cin>>a[i];
    #define write(a) for(auto x : a) cout<<x<<" ";
    #define int long long
    #define pb push_back
    #define all(a)  a.begin(),a.end()
    #define el "\n"

    typedef tree<int, null_type, less_equal<int>, rb_tree_tag, tree_order_statistics_node_update> ordered_set;

    const int inf=4e18;

    int dx[]={1,0,-1,0,1,1,-1,-1};
    int dy[]={0,1,0,-1,1,-1,1,-1};

    const int mod=1e9+7;
    const int MAX =1e6+7;

    //---------------------------Function----------------------------------//
    void TestCake(){
        int n,m;
        cin>>n>>m;
        double sum=0;
        for(int i=0;i<m;i++){
            int x;cin>>x;
            sum+=x;
        }
        double here=(sum)+((n-m)*-3);
        here/=n;
//        cout<<fixed;
        cout<<here<<" ";
        here=(sum)+((n-m)*3);
        here/=n;
        cout<<here;
    }
    //------------------------------Main---------------------------//
    signed main(){
        Major
        int T = 1;
//        cin >> T;
        while(T--){
            TestCake();
        //       cerr << "Time elapsed: " << 1.0 * clock() / CLOCKS_PER_SEC << " s.\n";
        }
        return 0;
    }

详细

Test #1:

score: 100
Accepted
time: 0ms
memory: 3820kb

input:

10 0

output:

-3 3

result:

ok 2 numbers

Test #2:

score: 0
Accepted
time: 1ms
memory: 3840kb

input:

10 10
3
2
1
0
-1
-2
-3
-2
-1
0

output:

-0.3 -0.3

result:

ok 2 numbers

Test #3:

score: 0
Accepted
time: 0ms
memory: 3840kb

input:

10 10
0
0
0
0
0
0
0
0
0
0

output:

0 0

result:

ok 2 numbers

Test #4:

score: 0
Accepted
time: 0ms
memory: 3844kb

input:

10 10
3
3
3
3
3
3
3
3
3
3

output:

3 3

result:

ok 2 numbers

Test #5:

score: 0
Accepted
time: 0ms
memory: 3812kb

input:

10 10
-3
-3
-3
-3
-3
-3
-3
-3
-3
-3

output:

-3 -3

result:

ok 2 numbers

Test #6:

score: 0
Accepted
time: 1ms
memory: 3848kb

input:

1 0

output:

-3 3

result:

ok 2 numbers

Test #7:

score: 0
Accepted
time: 0ms
memory: 3844kb

input:

1 1
2

output:

2 2

result:

ok 2 numbers

Test #8:

score: 0
Accepted
time: 0ms
memory: 3788kb

input:

9 7
1
3
2
2
1
1
2

output:

0.666667 2

result:

ok 2 numbers

Test #9:

score: 0
Accepted
time: 0ms
memory: 3824kb

input:

6 4
-2
-1
-2
0

output:

-1.83333 0.166667

result:

ok 2 numbers