提出 #35208614


ソースコード 拡げる

#include<bits/stdc++.h>
int r(){int _;scanf("%d",&_);return _;}
int main(){
  int n=r(),m=r(),k=r();
  std::vector<std::pair<int,int>>a(m),b;
  for(auto&v:a)v={r(),r()};
  int x=282475249;
  for(;n>k;n-=x,a=b){
    while(x>n-k)x/=7;
    auto f=[&](int&i,int&j){while(i<(int)a.size()&&j>=a[i].second)j-=a[i++].second;};
    int li=0,lj=0,ri=0,rj=0;
    b={};
    for(f(ri,rj+=x);ri!=(int)a.size();){
      int l=std::min(a[li].second-lj,a[ri].second-rj);
      b.push_back({(a[li].first+a[ri].first)%7,l});
      f(li,lj+=l);
      f(ri,rj+=l);
    }
  }
  for(auto[v,t]:a)while(t--)printf("%d ",v);
}

提出情報

提出日時
問題 Ex - Fill Triangle
ユーザ cromarmot
言語 C++ (GCC 9.2.1)
得点 600
コード長 601 Byte
結果 AC
実行時間 123 ms
メモリ 15384 KiB

コンパイルエラー

./Main.cpp: In function ‘int r()’:
./Main.cpp:2:20: warning: ignoring return value of ‘int scanf(const char*, ...)’, declared with attribute warn_unused_result [-Wunused-result]
    2 | int r(){int _;scanf("%d",&_);return _;}
      |               ~~~~~^~~~~~~~~

ジャッジ結果

セット名 Sample All
得点 / 配点 0 / 0 600 / 600
結果
AC × 3
AC × 49
セット名 テストケース
Sample 00_sample_00.txt, 00_sample_01.txt, 00_sample_02.txt
All 00_sample_00.txt, 00_sample_01.txt, 00_sample_02.txt, 01_small_00.txt, 01_small_01.txt, 01_small_02.txt, 01_small_03.txt, 01_small_04.txt, 01_small_05.txt, 01_small_06.txt, 01_small_07.txt, 01_small_08.txt, 01_small_09.txt, 02_k_small_00.txt, 02_k_small_01.txt, 02_k_small_02.txt, 02_k_small_03.txt, 02_k_small_04.txt, 03_random_00.txt, 03_random_01.txt, 03_random_02.txt, 03_random_03.txt, 03_random_04.txt, 03_random_05.txt, 03_random_06.txt, 03_random_07.txt, 03_random_08.txt, 03_random_09.txt, 04_max_7_00.txt, 04_max_7_01.txt, 04_max_7_02.txt, 04_max_7_03.txt, 04_max_7_04.txt, 04_max_7_05.txt, 04_max_7_06.txt, 04_max_7_07.txt, 04_max_7_08.txt, 05_sparse_inc_00.txt, 05_sparse_inc_01.txt, 05_sparse_inc_02.txt, 06_sparse_dec_00.txt, 06_sparse_dec_01.txt, 06_sparse_dec_02.txt, 07_sparse_random_00.txt, 07_sparse_random_01.txt, 07_sparse_random_02.txt, 07_sparse_random_03.txt, 07_sparse_random_04.txt, 07_sparse_random_05.txt
ケース名 結果 実行時間 メモリ
00_sample_00.txt AC 9 ms 3720 KiB
00_sample_01.txt AC 2 ms 3712 KiB
00_sample_02.txt AC 2 ms 3636 KiB
01_small_00.txt AC 2 ms 3652 KiB
01_small_01.txt AC 3 ms 3696 KiB
01_small_02.txt AC 2 ms 3616 KiB
01_small_03.txt AC 1 ms 3740 KiB
01_small_04.txt AC 2 ms 3760 KiB
01_small_05.txt AC 2 ms 3716 KiB
01_small_06.txt AC 2 ms 3676 KiB
01_small_07.txt AC 2 ms 3592 KiB
01_small_08.txt AC 2 ms 3764 KiB
01_small_09.txt AC 2 ms 3764 KiB
02_k_small_00.txt AC 2 ms 3648 KiB
02_k_small_01.txt AC 7 ms 3844 KiB
02_k_small_02.txt AC 3 ms 3844 KiB
02_k_small_03.txt AC 3 ms 3652 KiB
02_k_small_04.txt AC 2 ms 3772 KiB
03_random_00.txt AC 45 ms 5616 KiB
03_random_01.txt AC 4 ms 3768 KiB
03_random_02.txt AC 41 ms 6120 KiB
03_random_03.txt AC 38 ms 7348 KiB
03_random_04.txt AC 12 ms 3720 KiB
03_random_05.txt AC 42 ms 3812 KiB
03_random_06.txt AC 6 ms 3772 KiB
03_random_07.txt AC 27 ms 4684 KiB
03_random_08.txt AC 36 ms 3756 KiB
03_random_09.txt AC 45 ms 8992 KiB
04_max_7_00.txt AC 123 ms 15076 KiB
04_max_7_01.txt AC 9 ms 3624 KiB
04_max_7_02.txt AC 118 ms 15384 KiB
04_max_7_03.txt AC 123 ms 15048 KiB
04_max_7_04.txt AC 9 ms 3620 KiB
04_max_7_05.txt AC 38 ms 6160 KiB
04_max_7_06.txt AC 121 ms 15076 KiB
04_max_7_07.txt AC 4 ms 3780 KiB
04_max_7_08.txt AC 58 ms 8076 KiB
05_sparse_inc_00.txt AC 98 ms 14884 KiB
05_sparse_inc_01.txt AC 10 ms 3668 KiB
05_sparse_inc_02.txt AC 92 ms 14188 KiB
06_sparse_dec_00.txt AC 95 ms 14900 KiB
06_sparse_dec_01.txt AC 8 ms 3608 KiB
06_sparse_dec_02.txt AC 42 ms 7112 KiB
07_sparse_random_00.txt AC 121 ms 14984 KiB
07_sparse_random_01.txt AC 4 ms 3736 KiB
07_sparse_random_02.txt AC 26 ms 4640 KiB
07_sparse_random_03.txt AC 121 ms 14904 KiB
07_sparse_random_04.txt AC 5 ms 3732 KiB
07_sparse_random_05.txt AC 37 ms 5372 KiB