제출 #1264838

#제출 시각아이디문제언어결과실행 시간메모리
1264838sasde조이터에서 친구를 만드는건 재밌어 (JOI20_joitter2)C++20
0 / 100
0 ms320 KiB
#include<bits/stdc++.h>
using namespace std;
bool M1;
#define PI 3.14159265358979323846
#define sz(a) (int)a.size()
#define all(x) x.begin(),x.end()
#define ii pair<int,int>
#define iii pair<int,ii>
#define iv pair<ii,ii>
#define se second
#define fi first
#define ffi fi.fi
#define sfi se.fi
#define sse se.se
#define fse fi.se
#define lt(i, c, d) for(int i = c; i <= d; ++i)
#define fl(i, c, d) for(int i = d; i >= c; --i)
#define pb push_back
#define emb emplace_back
#define emf emplace_front
#define em emplace
#define look_memory cerr<<abs(&M2-&M1)/1024.0/1024<<'\n'
#define look_time   cerr << "TIME : " << clock() * 0.001 << "s" <<'\n'
const int N=2e3+1;
int node,edge;
bitset<N>M[N];
bool M2;
main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(nullptr);
    cout.tie(nullptr);
    #define task "aws"
    if(fopen(task".inp","r")){
      freopen(task".inp","r",stdin);
      freopen(task".out","w",stdout);
    }
	cin >> node >> edge;
	for(int _=1;_<=edge;++_){
		int u,v;
		cin >> u >> v;
		M[u][v]=1;
		int ans=_;
		for(int i=1;i<=node;++i){
			for(int j=1;j<=node;++j){
				if(i==j)continue;
				if(M[i][j]&&M[j][i]){
					for(int k=1;k<=node;++k){
						if(k!=i&&k!=j){
							if(M[k][i]&&!M[k][j]){
								++ans;
								// cout <<i<<" "<<j<<" "<<k<<'\n';
							}
						}
					}
				}
			}
		}
		cout << ans<<'\n';
	}
look_memory;
look_time;
}

컴파일 시 표준 에러 (stderr) 메시지

joitter2.cpp:28:1: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type]
   28 | main()
      | ^~~~
joitter2.cpp: In function 'int main()':
joitter2.cpp:35:14: warning: ignoring return value of 'FILE* freopen(const char*, const char*, FILE*)' declared with attribute 'warn_unused_result' [-Wunused-result]
   35 |       freopen(task".inp","r",stdin);
      |       ~~~~~~~^~~~~~~~~~~~~~~~~~~~~~
joitter2.cpp:36:14: warning: ignoring return value of 'FILE* freopen(const char*, const char*, FILE*)' declared with attribute 'warn_unused_result' [-Wunused-result]
   36 |       freopen(task".out","w",stdout);
      |       ~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...