QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#421769#3178. Shattered Cakejuancs#AC ✓712ms3640kbC++20277b2024-05-26 03:20:152024-05-26 03:20:15

Judging History

This is the latest submission verdict.

  • [2024-05-26 03:20:15]
  • Judged
  • Verdict: AC
  • Time: 712ms
  • Memory: 3640kb
  • [2024-05-26 03:20:15]
  • Submitted

answer

#include <bits/stdc++.h>
#define el '\n'
using namespace std;
typedef long long ll;
int main(){
    int W, N;
    cin>>W>>N;
    ll sum = 0;
    while(N--){
        int li, wi;
        cin>>li>>wi;
        sum += 1LL*li*wi;
    }
    sum/=W;
    cout<<sum<<el;
}

详细

Test #1:

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

input:

4
7
2 3
1 4
1 2
1 2
2 2
2 2
2 1

output:

6

result:

ok single line: '6'

Test #2:

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

input:

5
35
2 1
2 5
1 1
1 3
2 5
1 3
2 3
1 2
1 1
2 1
1 3
1 1
1 2
1 1
2 1
2 3
1 1
1 2
2 3
1 1
2 5
2 1
1 1
1 1
2 5
2 3
2 1
1 2
1 1
1 3
1 2
1 3
2 5
1 1
2 3

output:

25

result:

ok single line: '25'

Test #3:

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

input:

3
18
1 1
1 1
1 1
1 1
1 1
1 1
1 1
1 1
1 1
1 1
1 1
1 1
1 1
1 1
1 1
1 1
1 1
1 1

output:

6

result:

ok single line: '6'

Test #4:

score: 0
Accepted
time: 210ms
memory: 3628kb

input:

500
1292900
1 3
2 5
2 1
1 3
2 3
1 1
2 3
2 5
1 1
1 3
1 2
2 3
1 1
2 1
2 3
2 3
1 2
1 1
1 1
2 5
1 1
2 5
1 2
2 3
2 3
1 1
1 2
1 1
2 1
2 3
2 3
2 1
1 2
1 1
2 3
2 5
2 1
2 5
1 1
1 1
2 1
2 5
1 3
1 2
1 1
1 3
1 1
1 3
1 1
1 2
1 2
1 3
2 3
1 1
2 3
1 3
2 5
2 5
1 2
1 3
2 3
1 1
1 3
1 1
1 1
1 2
1 3
2 5
1 2
2 1
1 1
2 1
...

output:

9235

result:

ok single line: '9235'

Test #5:

score: 0
Accepted
time: 712ms
memory: 3628kb

input:

7345
4421690
1 2
1 3
2 3
1 1
1 1
2 1
2 5
1 2
1 3
2 3
1 1
1 1
2 1
2 5
1 2
1 3
2 3
1 1
1 1
2 1
2 5
1 2
1 3
2 3
1 1
1 1
2 1
2 5
1 2
1 3
2 3
1 1
1 1
2 1
2 5
1 2
1 3
2 3
1 1
1 1
2 1
2 5
1 2
1 3
2 3
1 1
1 1
2 1
2 5
1 2
1 3
2 3
1 1
1 1
2 1
2 5
1 2
1 3
2 3
1 1
1 1
2 1
2 5
1 2
1 3
2 3
1 1
1 1
2 1
2 5
1 2
1 3...

output:

2150

result:

ok single line: '2150'