Submission #320778

# Submission time Handle Problem Language Result Execution time Memory
320778 2020-11-09T21:55:42 Z tjdgus4384 None (KOI17_cat) C++14
23 / 100
215 ms 22628 KB
#include<bits/stdc++.h>
using namespace std;
long long N, M, a, b, ans;
vector<long long> v[300001];

int main(){
    scanf("%lld %lld", &N, &M);
    for(long long i = 0;i < M;i++){
        scanf("%lld %lld", &a, &b);
        v[a].push_back(b);
        v[b].push_back(a);
    }
    long long T = M-N+2;
    for(long long i = 1;i <= N;i++){
        if(v[i].size() >= T) ans += i;
    }
    printf("%lld", ans);
    return 0;
}

Compilation message

cat.cpp: In function 'int main()':
cat.cpp:15:24: warning: comparison of integer expressions of different signedness: 'std::vector<long long int>::size_type' {aka 'long unsigned int'} and 'long long int' [-Wsign-compare]
   15 |         if(v[i].size() >= T) ans += i;
      |            ~~~~~~~~~~~~^~~~
cat.cpp:7:10: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
    7 |     scanf("%lld %lld", &N, &M);
      |     ~~~~~^~~~~~~~~~~~~~~~~~~~~
cat.cpp:9:14: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
    9 |         scanf("%lld %lld", &a, &b);
      |         ~~~~~^~~~~~~~~~~~~~~~~~~~~
# Verdict Execution time Memory Grader output
1 Correct 5 ms 7308 KB Output is correct
2 Incorrect 5 ms 7404 KB Output isn't correct
3 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 215 ms 22628 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 111 ms 20708 KB Output is correct
2 Correct 106 ms 20656 KB Output is correct
3 Correct 106 ms 20720 KB Output is correct
4 Correct 128 ms 20712 KB Output is correct
5 Correct 105 ms 20708 KB Output is correct
6 Correct 109 ms 20708 KB Output is correct
7 Correct 103 ms 20708 KB Output is correct
8 Correct 105 ms 20708 KB Output is correct
9 Correct 105 ms 20708 KB Output is correct
10 Correct 122 ms 21336 KB Output is correct
11 Correct 123 ms 21468 KB Output is correct
12 Correct 122 ms 21344 KB Output is correct
13 Correct 120 ms 21468 KB Output is correct
14 Correct 136 ms 21644 KB Output is correct
15 Correct 141 ms 21340 KB Output is correct
16 Correct 134 ms 21084 KB Output is correct
17 Correct 136 ms 21336 KB Output is correct
18 Correct 148 ms 21340 KB Output is correct
19 Correct 145 ms 21336 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 5 ms 7308 KB Output is correct
2 Incorrect 5 ms 7404 KB Output isn't correct
3 Halted 0 ms 0 KB -