제출 #1326067

#제출 시각아이디문제언어결과실행 시간메모리
1326067JuanJLFurniture (JOI20_furniture)C++20
0 / 100
3 ms1080 KiB
#include <bits/stdc++.h>

#define fst first
#define snd second
#define pb push_back
#define SZ(x) (int)x.size()
#define ALL(x) x.begin(),end()
#define forn(i,a,b) for(int i = a; i<b; i++)
#define mset(a,v) memset(a,v,sizeof(a))
#define FIN ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);

using namespace std;
typedef long long ll;

const int MAXN = 100+5;

vector<pair<ll,ll>> oper = {{0,1},{1,0}};

ll n,m;
vector<vector<ll>> mapa;
bool vis[MAXN][MAXN];

void dfs(ll i, ll j){
	if(vis[i][j]) return;
	vis[i][j]=true;
	
	for(auto o:oper) if(i+o.fst<n && i+o.fst>=0 && j+o.snd<m && j+o.snd>=0){
		if(mapa[i+o.fst][j+o.snd]==0) dfs(i+o.fst,j+o.snd);
	}
}

int main(){
	ll t; t = 0;
	srand(time(NULL));
	while(true){
		cout<<t<<'\n';
		ll n,m; n=100; m=100;

		vector<vector<ll>> mapa(n,vector<ll>(m,0));

		map<pair<ll,ll>,bool> is; is[{1,1}]=true;
		is[{n,m}]=true;
		vector<pair<ll,ll>> qu(10000);

		forn(i,0,SZ(qu)){
			ll I,J;
			do{
				I = 1+rand()%n;
				J = 1+rand()%m;
			}while(is[{I,J}]);

			//is[{I,J}]=true;
			qu[i]={I,J};
		}


		ofstream out("test");

		out<<n<<" "<<m<<'\n';
		forn(i,0,n){
			forn(j,0,m){
				out<<mapa[i][j]<<" "; 
			}out<<'\n';
		}

		out<<SZ(qu)<<'\n';
		forn(i,0,SZ(qu)) out<<qu[i].fst<<" "<<qu[i].snd<<'\n';

		out.close();

		system("./code < test > wa");
		system("./s1 < test > ac");

		ifstream ac("ac");
		ifstream wa("wa");

		forn(i,0,SZ(qu)){
			ll rac; ac>>rac;
			ll rwa; wa>>rwa;
			if(rac!=rwa){
				return 0;
			}
		}

		ac.close();
		wa.close();

		t++;
		
	}
	return 0;
}

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

furniture.cpp: In function 'int main()':
furniture.cpp:71:23: warning: ignoring return value of 'int system(const char*)' declared with attribute 'warn_unused_result' [-Wunused-result]
   71 |                 system("./code < test > wa");
      |                 ~~~~~~^~~~~~~~~~~~~~~~~~~~~~
furniture.cpp:72:23: warning: ignoring return value of 'int system(const char*)' declared with attribute 'warn_unused_result' [-Wunused-result]
   72 |                 system("./s1 < test > ac");
      |                 ~~~~~~^~~~~~~~~~~~~~~~~~~~
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...