Submission #268901

# Submission time Handle Problem Language Result Execution time Memory
268901 2020-08-17T04:15:14 Z 반딧불(#5114) Making Friends on Joitter is Fun (JOI20_joitter2) C++17
0 / 100
1 ms 384 KB
#include <bits/stdc++.h>

using namespace std;

typedef long long ll;

int n, m;
bool follow[2002][2002];
int ans;

int main(){
    scanf("%d %d", &n, &m);
    for(int i=1; i<=m; i++){
        int x, y;
        scanf("%d %d", &x, &y);
        if(follow[x][y]){
            printf("%d\n", ans);
            continue;
        }

        follow[x][y] = 1;
        ans++;

        for(int x=1; x<=n; x++){
            for(int y=1; y<=n; y++){
                for(int z=1; z<=n; z++){
                    if(y!=z && follow[y][x] && follow[x][z] && follow[z][x] && !follow[y][z]){
                        ans++;
                        follow[y][z] = 1;
                    }
                }
            }
        }

        printf("%d\n", ans);
    }
}

Compilation message

joitter2.cpp: In function 'int main()':
joitter2.cpp:12:10: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
   12 |     scanf("%d %d", &n, &m);
      |     ~~~~~^~~~~~~~~~~~~~~~~
joitter2.cpp:15:14: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
   15 |         scanf("%d %d", &x, &y);
      |         ~~~~~^~~~~~~~~~~~~~~~~
# Verdict Execution time Memory Grader output
1 Correct 1 ms 384 KB Output is correct
2 Correct 1 ms 384 KB Output is correct
3 Correct 1 ms 384 KB Output is correct
4 Correct 1 ms 384 KB Output is correct
5 Incorrect 1 ms 384 KB Output isn't correct
6 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 1 ms 384 KB Output is correct
2 Correct 1 ms 384 KB Output is correct
3 Correct 1 ms 384 KB Output is correct
4 Correct 1 ms 384 KB Output is correct
5 Incorrect 1 ms 384 KB Output isn't correct
6 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 1 ms 384 KB Output is correct
2 Correct 1 ms 384 KB Output is correct
3 Correct 1 ms 384 KB Output is correct
4 Correct 1 ms 384 KB Output is correct
5 Incorrect 1 ms 384 KB Output isn't correct
6 Halted 0 ms 0 KB -