Submission #1000216

# Submission time Handle Problem Language Result Execution time Memory
1000216 2024-06-17T06:19:45 Z Unforgettablepl Making Friends on Joitter is Fun (JOI20_joitter2) C++17
0 / 100
5000 ms 452 KB
#include <bits/stdc++.h>
using namespace std;
 
#define int long long

bool adj[50][50];

int32_t main(){
    ios_base::sync_with_stdio(false);
    cin.tie(nullptr);
    int n,m;
    cin >> n >> m;
    for(int i=1;i<=m;i++){
        int a,b;cin>>a>>b;
        adj[a][b] = true;
        int ans = 0;
        for(int iter = 1;iter<=n;iter++){
            for(int x=1;x<=n;x++){
                for(int y=1;y<=n;y++){
                    for(int z=1;z<=n;z++){
                        if(z==x)continue;
                        if(adj[x][y] and adj[y][z] and adj[z][y])adj[x][z]=true;
                    }
                }
            }
        }
        for(auto&x:adj)for(bool&y:x)if(y)ans++;
        cout << ans << '\n';
    }
}
# Verdict Execution time Memory Grader output
1 Correct 1 ms 348 KB Output is correct
2 Correct 0 ms 348 KB Output is correct
3 Correct 0 ms 348 KB Output is correct
4 Correct 0 ms 348 KB Output is correct
5 Correct 1 ms 344 KB Output is correct
6 Correct 1 ms 348 KB Output is correct
7 Execution timed out 5099 ms 452 KB Time limit exceeded
8 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 1 ms 348 KB Output is correct
2 Correct 0 ms 348 KB Output is correct
3 Correct 0 ms 348 KB Output is correct
4 Correct 0 ms 348 KB Output is correct
5 Correct 1 ms 344 KB Output is correct
6 Correct 1 ms 348 KB Output is correct
7 Execution timed out 5099 ms 452 KB Time limit exceeded
8 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 1 ms 348 KB Output is correct
2 Correct 0 ms 348 KB Output is correct
3 Correct 0 ms 348 KB Output is correct
4 Correct 0 ms 348 KB Output is correct
5 Correct 1 ms 344 KB Output is correct
6 Correct 1 ms 348 KB Output is correct
7 Execution timed out 5099 ms 452 KB Time limit exceeded
8 Halted 0 ms 0 KB -