# | Submission time | Handle | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
1048626 | 2024-08-08T08:48:27 Z | 5시간 대회를 2시간으로 즐길 수 있다니 완전 럭키비키잖아~(#11095) | Make them Meet (EGOI24_makethemmeet) | C++17 | 1 ms | 348 KB |
#include <bits/stdc++.h> using namespace std; int n; int pos[100]; int arr[100][100]; int query() { printf("?\n"); for(int i=0;i<n;i++) { for(int j=0;j<n;j++) { printf("%d",arr[i][j]); } printf("\n"); } fflush(stdout); int x; scanf("%d",&x); return x; } void answer() { printf("!\n"); for(int i=0;i<n;i++) { for(int j=0;j<n;j++) { printf("%d",arr[i][j]); } printf("\n"); } fflush(stdout); } int solve(int x) { memset(arr,0,sizeof(arr)); for(int i=0;i<n;i++) { arr[x][i]=true; } int got=query(); if (query()==n*n) { answer(); return -1; } int gv=(n*n-got)/(n-1); int lo=-1; int hi=n-1; while (lo+1<hi) { int mid=(lo+hi)/2; memset(arr,0,sizeof(arr)); int got1; if (mid!=0) { for(int i=0;i<=mid;i++) { arr[x][i]=true; } if (query()==(mid+1)*n) { lo=mid; } else { hi=mid; } } else { for(int i=mid+1;i<n;i++) { arr[x][i]=1; } int val=(n-gv)*n+gv; if (query()==val) { hi=mid; } else { lo=mid; } } } return hi; } int main(void) { int n,m; scanf("%d %d",&n,&m); printf("%d\n",n+1); for(int i=0;i<2;i++) { for(int j=0;j<n;j++) { printf("0 "); } printf("\n"); } for(int i=1;i<n;i++) { printf("0 "); for(int j=1;j<n;j++) { printf("%c ",i==j?'0':'1'); } printf("\n"); } }
Compilation message
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 0 ms | 344 KB | Output is correct |
2 | Incorrect | 0 ms | 348 KB | If people start at 0 and 2, then they can avoid each other |
3 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 1 ms | 344 KB | Output is correct |
2 | Incorrect | 0 ms | 348 KB | If people start at 0 and 1, then they can avoid each other |
3 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 0 ms | 348 KB | Output is correct |
2 | Incorrect | 0 ms | 348 KB | If people start at 1 and 2, then they can avoid each other |
3 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 0 ms | 344 KB | Output is correct |
2 | Incorrect | 0 ms | 348 KB | If people start at 0 and 2, then they can avoid each other |
3 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 0 ms | 344 KB | Output is correct |
2 | Incorrect | 0 ms | 348 KB | If people start at 0 and 2, then they can avoid each other |
3 | Halted | 0 ms | 0 KB | - |