# | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
974204 | 2024-05-03T06:16:28 Z | sleepntsheep | Bitwise (BOI06_bitwise) | C | 1000 ms | 360 KB |
#include<stdio.h> #define N 10000 int n,p,k[N],at[N+1];unsigned z,l[N],r[N]; int main() { scanf("%d%d",&n,&p); for(int i=0;i<p;++i) scanf("%d",k+i); for(int i=0,len=0;i<p;++i) { at[i]=len; at[i+1]=len+=k[i]; for(int j=at[i];j<at[i+1];++j) scanf("%d%d",l+j,r+j); } for(unsigned b=31;b>=0;--b) { unsigned set=1u<<b; for(int i=0;i<p;++i) { int can=0,tuna=0; for(int j=at[i];j<at[i+1];++j) if(l[j]<=set&&set<=r[j])++can,tuna=j; if(can==0) set=0; } if(set) for(int i=0;i<p;++i) { int can=0,tuna=0; for(int j=at[i];j<at[i+1];++j) if(l[j]<=set&&set<=r[j])++can,tuna=j; l[tuna]-=set,r[tuna]-=set; } z|=set; } printf("%u",z); }
Compilation message
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Execution timed out | 1056 ms | 360 KB | Time limit exceeded |
2 | Execution timed out | 1062 ms | 348 KB | Time limit exceeded |
3 | Execution timed out | 1056 ms | 348 KB | Time limit exceeded |
4 | Execution timed out | 1036 ms | 348 KB | Time limit exceeded |
5 | Execution timed out | 1074 ms | 348 KB | Time limit exceeded |
6 | Execution timed out | 1053 ms | 348 KB | Time limit exceeded |
7 | Execution timed out | 1068 ms | 348 KB | Time limit exceeded |
8 | Execution timed out | 1027 ms | 344 KB | Time limit exceeded |
9 | Execution timed out | 1065 ms | 348 KB | Time limit exceeded |
10 | Execution timed out | 1069 ms | 348 KB | Time limit exceeded |
11 | Execution timed out | 1050 ms | 348 KB | Time limit exceeded |
12 | Execution timed out | 1040 ms | 344 KB | Time limit exceeded |
13 | Execution timed out | 1052 ms | 348 KB | Time limit exceeded |
14 | Execution timed out | 1052 ms | 348 KB | Time limit exceeded |
15 | Execution timed out | 1063 ms | 348 KB | Time limit exceeded |
16 | Execution timed out | 1059 ms | 348 KB | Time limit exceeded |
17 | Execution timed out | 1036 ms | 344 KB | Time limit exceeded |
18 | Execution timed out | 1040 ms | 344 KB | Time limit exceeded |
19 | Execution timed out | 1052 ms | 348 KB | Time limit exceeded |
20 | Execution timed out | 1064 ms | 348 KB | Time limit exceeded |