結果
| 問題 | No.3641 OHO SHI KA TSU(Waiting ver.) |
| コンテスト | |
| ユーザー |
👑 tails
|
| 提出日時 | 2026-08-27 18:12:11 |
| 言語 | C(gnu17) (gcc 15.3.0) |
| 結果 |
AC
不安定
|
| 実行時間 | 21 ms / 2,500 ms |
| + 873µs | |
| コード長 | 1,271 bytes |
| 記録 | |
| コンパイル時間 | 1,237 ms |
| コンパイル使用メモリ | 39,040 KB |
| 実行使用メモリ | 13,696 KB |
| 最終ジャッジ日時 | 2026-08-27 18:12:18 |
| 合計ジャッジ時間 | 3,915 ms |
|
ジャッジサーバーID (参考情報) |
judge3_0 / judge1_0 |
(要ログイン)
| サブタスク | 配点 | 結果 |
|---|---|---|
| サンプル | 0 % | AC * 1 |
| 小課題1 | 20 % | AC * 5 |
| 小課題2 | 30 % | AC * 11 |
| 小課題3 | 30 % | AC * 10 |
| 小課題4 | 20 % | AC * 25 |
| 合計 | 100 点 |
コンパイルメッセージ
main.c:35:1: warning: return type defaults to 'int' [-Wimplicit-int]
35 | f0(){
| ^~
main.c:41:1: warning: return type defaults to 'int' [-Wimplicit-int]
41 | f1(){
| ^~
main.c:69:1: warning: return type defaults to 'int' [-Wimplicit-int]
69 | f2(){
| ^~
main.c: In function 'f2':
main.c:75:9: warning: implicit declaration of function 'write' [-Wimplicit-function-declaration]
75 | write(1,wbuf,wp-wbuf);
| ^~~~~
main.c: In function 'main':
main.c:82:9: warning: implicit declaration of function '_exit' [-Wimplicit-function-declaration]
82 | _exit(0);
| ^~~~~
main.c:82:9: warning: incompatible implicit declaration of built-in function '_exit' [-Wbuiltin-declaration-mismatch]
ソースコード
#pragma GCC optimize("Ofast")
#pragma GCC target("avx2")
#define rd_init() char*rp=({char*mmap();mmap(0l,1l<<25,1,2,0,0ll);})
#define rd() ({int _v=0,_c;while(_c=*rp++-48,_c>=0)_v=_v*10+_c;_v;})
#define wt(v) {unsigned _z=v,_n=0;long _d=0;while(++_n,_d=_d<<8|0x30|_z%10,_z/=10);*(long*)wp=_d;wp+=_n;}
#define rep(v,e) for(typeof(e)v=0;v<e;++v)
#define repeat(e) for(typeof(e)_=e;_--;)
#define HASH_BITS 19
#define HASH_N (1<<HASH_BITS)
#define HASH_MASK (HASH_N-1)
int hash[HASH_N];
int hash_get(int x){
int h=x&HASH_MASK;
while(1){
if(hash[h]==0){
hash[h]=x;
return h;
}
if(hash[h]==x){
return h;
}
h=h+1&HASH_MASK;
}
}
char wbuf[1<<25];
struct {int s,t;} st[HASH_N];
struct {int i,n;} d[200000];
int z[100000];
int m;
f0(){
rep(i,HASH_N){
st[i].s=-1;
}
}
f1(){
rd_init();
rd(); // skip n
m=rd();
int q=rd();
rep(j,q){
int i,t;
int u=*rp; rp+=2;
if(u=='1'){
i=rd()-1;
}else{
int s=hash_get(rd());
i=d[st[s].s].i;
++z[i];
st[s].s=d[st[s].s].n;
}
t=hash_get(rd());
d[j].i=i;
d[j].n=-1;
if(st[t].s<0){
st[t].s=j;
}else{
d[st[t].t].n=j;
}
st[t].t=j;
}
}
f2(){
char*wp=wbuf;
rep(i,m){
wt(z[i]);
*wp++='\n';
}
write(1,wbuf,wp-wbuf);
}
int main(){
f0();
f1();
f2();
_exit(0);
}
tails